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

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

by BrowserUk (Patriarch)
on Jun 29, 2006 at 12:18 UTC ( [id://558300]=note: print w/replies, xml ) Need Help??


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

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.

Replies are listed 'Best First'.
Re^4: Win32::API::Struct: Pointers of Pointers
by esskar (Deacon) on Jun 29, 2006 at 13:36 UTC
    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.
        that's what i mean. it is a pointer of a pointer. The function alloactes the needed memory itself. here is the prove
        sub query_users { my ( $self, $filename ) = @_; my $func = import_api( 'advapi32', 'QueryUsersOnEncryptedFile', 'P +P', 'N' ); die "Could not import API QueryUsersOnEncryptedFile: $!" unless defined $func; $filename = make_unicode( File::Spec->canonpath($filename) ); + my $ptr = " " x 4; # 4 == sizeof(void*) my $result = $func->Call( "$filename", $ptr ); print "result: $result\n"; return undef if $result; my $address = unpack( "L*", $ptr ); printf("0x%08x\n", $address); }
        i think i have to switch to XS at this point.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (3)
As of 2024-03-29 01:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found