Hi,

i'm working on a a new module right now (Win32::Security::EFS).
internally i use two functions to talk to Win32::API and Win32::API::Struct.
sub import_api_ex { my ( $lib, $sig ) = @_; my $key = join "_", map { uc } ( $lib, $sig ); $api{$key} = Win32::API->new( $lib, $sig ) unless exists $api{$key}; return $api{$key}; } sub define_struct { my ( $name, @params ) = @_; Win32::API::Struct->typedef( $name, @params ); }
Now, i want to implement the following function from advapi32.dll
DWORD QueryUsersOnEncryptedFile( LPCWSTR lpFileName, // file name PENCRYPTION_CERTIFICATE_HASH_LIST *pUsers // hash list );
as you can see, the 2nd parameter is a pointer to pointer of a structure. anyways, i defined all needed structers.
BEGIN { define_struct( 'EFS_HASH_BLOB', qw/ DWORD cbData; LPBYTE pbData; / ); define_struct( 'ENCRYPTION_CERTIFICATE_HASH', qw/ DWORD cbTotalLength; void* pUserSid; LPEFS_HASH_BLOB pHash; LPWSTR lpDisplayInformation; / ); define_struct( 'ENCRYPTION_CERTIFICATE_HASH_LIST', qw/ DWORD nCert_Hash; LPENCRYPTION_CERTIFICATE_HASH* pUsers; / ); }
Then, i tried to import the function
sub query_users { my ( $self, $filename ) = @_; my $func = import_api_ex( 'advapi32', 'DWORD QueryUsersOnEncrypted +File(LPCWSTR lpFileName, LPENCRYPTION_CERTIFICATE_HASH_LIST* pUsers)' ); die "Could not import API QueryUsersOnEncryptedFile: $!" unless defined $func; }
nothing special yet, but when i try to call the function, i get a WARNING:
Win32::API::parse_prototype: WARNING unknown parameter type 'LPENCRYPT +ION_CERTIFICATE_HASH_LIST*' at C:/Perl/site/lib/Wi n32/API.pm line 248, <DATA> line 164.
How do i fix this problem? Any hints appreciated!

In reply to Win32::API::Struct: Pointers of Pointers by esskar

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.