John M. Dlugosz has asked for the wisdom of the Perl Monks concerning the following question:
Am I importing them wrong, passing it wrong, or what?
###### ## try WNetOpenEnum et.al. to find connections w/o letters. my $WNetOpenEnum= new Win32::API ("mpr", "WNetOpenEnum", "IIIIP", "N") + or die; $handle= 'xxxx'; # allocate 4 bytes use constant RESOURCE_CONNECTED => 0x00000001; use constant RESOURCETYPE_DISK => 0x00000001; $result= $WNetOpenEnum->Call (RESOURCE_CONNECTED, RESOURCETYPE_DISK, 0 +, 0, $handle); print "result for WNetOpenEnum is $result\n"; my $WNetEnumResource= new Win32::API ("mpr", "WNetEnumResource", "PPPP +", "I") or die; my $count= pack ("V", -1); my $bufsize= 5000; $buffer= 'x' x (1+$bufsize); for (;;) { $bufsize= pack ("V", 5000); $result= $WNetEnumResource->Call ($handle, $count, $buffer, $bufsiz +e); print "result for WNetEnumResource is $result\n"; last if $result != 0; print "count=$count, bufsize=$bufsize\n"; print $buffer; # just to see if it's not all x's. }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Passing/Returning HANDLE's with Win32::API
by Corion (Patriarch) on Feb 07, 2005 at 22:56 UTC | |
by John M. Dlugosz (Monsignor) on Feb 07, 2005 at 23:31 UTC | |
by Corion (Patriarch) on Feb 07, 2005 at 23:33 UTC | |
by John M. Dlugosz (Monsignor) on Feb 08, 2005 at 16:24 UTC | |
by Corion (Patriarch) on Feb 09, 2005 at 08:43 UTC |