iea has asked for the wisdom of the Perl Monks concerning the following question:

Hi guys,

i´m trying to get a number of volume stored information using a dll and win32::api. I need to pass a pointer to a INFO structure that is returned with information about the file.
Win32::API::Struct->typedef ( "FILE_INFO", qw( WCHAR Path; GUID Guid; DWORD Count; DWORD Type; USHORT Number; USHORT Parts; DWORD Index; DWORD Attributes; DWORD Flags; ) );
How can i create a pointer to a structure using win32::api.
my $pt = Win32::API::Struct->new('FILE_INFO')or die "ERROR: $^E"; new Win32::API('dll',"GetInfo", ['P','P','N'], 'N' ) or die "ERROR: $^ +E"; #or new Win32::API('dll',"GetInfo", ['P','S','N'], 'N' ) or die "ERROR: $^ +E"; my $test = $APIHandle->Call($FileHandle,$pt,1024)or die "ERROR: $!";
Can i pack the structure? and if how ... ?

my $lpInfo = pack('CIIIIIIII',0,0);

any ideas would help me ...

thanks a lot

iea

Replies are listed 'Best First'.
Re: Point to a structure
by John M. Dlugosz (Monsignor) on Aug 10, 2008 at 05:16 UTC
    I've always used pack. Dump the resulting binary string as hex, to help you fiddle with the pack code.
      Thanks ...
      @anony
      It wont work with Win32API::File ,Win32::File.

      @John M. Dlugosz
      I´ve got the pack code now but GUID Guid; seems to be
      unknown. I also get wrong parameter error.

      I will post the code later ... thanks for your help

        Isn't there equivalent functionality in Win32API::File?
Re: Point to a structure
by Anonymous Monk on Aug 10, 2008 at 01:54 UTC