Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^2: Win32::API::Struct: Pointers of Pointers

by esskar (Deacon)
on Jun 29, 2006 at 08:25 UTC ( #558253=note: print w/ replies, xml ) Need Help??


in reply to Re: Win32::API::Struct: Pointers of Pointers
in thread Win32::API::Struct: Pointers of Pointers

well,

it is not working. here is would i did.

my $func = import_api_ex( 'advapi32', 'DWORD QueryUsersOnEncryptedFile(LPCWSTR lpFileName, LPVOID pUsers +)' ) ; # LPVOID* is not known die "Could not import API QueryUsersOnEncryptedFile: $!" unless define +d $func; my $encCertHashList = Win32::API::Struct->new('ENCRYPTION_CERTIFICATE_HASH_LIST'); $func->Call( make_unicode( File::Spec->canonpath($filename) ), $encCertHashList ); print $encCertHashList-> {nCert_Hash}; # i get: Can't use string ("փ?") as a HASH ref while + "strict refs" in use $encCertHashList = Win32::API::Struct->new('ENCRYPTION_CERTIFICATE_HAS +H_LIST'); $func->Call( make_unicode( File::Spec->canonpath($filename) ), \$encCertHashList ); print $encCertHashList-> {nCert_Hash}; # i get: Use of uninitialized value in print
i tried both variants without the make_unicode call <- made no differences!


Comment on Re^2: Win32::API::Struct: Pointers of Pointers
Download Code
Re^3: Win32::API::Struct: Pointers of Pointers
by BrowserUk (Pope) on Jun 29, 2006 at 12:18 UTC

    I wonder what return code you're getting?


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
      okay. i get 87 as a result, which means: The parameter is incorrect.

      now i tried the following:
      sub query_users { my ( $self, $filename ) = @_; my $func = import_api( 'advapi32', 'QueryUsersOnEncryptedFile', 'PP', 'N' ) +; die "Could not import API QueryUsersOnEncryptedFile: $!" unless defined $func; $filename = make_unicode( File::Spec->canonpath($filename) ); print "filename: $filename\n"; my $encCertHashList = Win32::API::Struct->new( 'ENCRYPTION_CERTIFI +CATE_HASH_LIST' ); print "retval: " . $func->Call( $filename, $encCertHashList) . "\n +"; print $encCertHashList->{nCert_Hash}, "\n"; $encCertHashList = Win32::API::Struct->new( 'ENCRYPTION_CERTIFICAT +E_HASH_LIST' ); print "retval: " . $func->Call( $filename, \$encCertHashList) . "\ +n"; print $encCertHashList->{nCert_Hash}, "\n"; $encCertHashList = " " x 1024; print "retval: " . $func->Call( $filename, $encCertHashList) . "\n +"; print $encCertHashList, "\n"; $encCertHashList = " " x 1024; print "retval: " . $func->Call( $filename, \$encCertHashList) . "\ +n"; print $encCertHashList, "\n"; }
      as a result i get
      filename: C : \ e f s . p l retval: 0 Use of uninitialized value in print at C:/Perl/site/lib/Win32/Security +/EFS.pm line 180, <DATA> line 164. retval: 0 Use of uninitialized value in print at C:/Perl/site/lib/Win32/Security +/EFS.pm line 184, <DATA> line 164. retval: 0 @&#9830; retval: 0
      in this case, the call works. but the structure is not really filled.
      btw. the file is encrypted!

        I'm getting much the same results. No errors, just nothing returned in the buffer :(

        I'm using the C source code from here as a reference. Maybe it will give you some clues I'm not seeing?

        I'll update if I have any success.


        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
        "Science is about questioning the status quo. Questioning authority".
        In the absence of evidence, opinion is indistinguishable from prejudice.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://558253]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (7)
As of 2014-12-28 17:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (182 votes), past polls