Bullock, Howard A. wrote:

>With the help of willem my new code follows. It returns zero (0) as the
>return code but the buffer does not appear to contain the expected data.
>Any additional insights would be appreciated.
>
>tod_elapsedt = 388696  <- this val always the same
>  
>

if you read the msdn docs, you will see that this is a pointer to the
timeofday struct.

you can obtain the contents of it using the same 'memcpy(P,N,N)' trick i
posted before.

willem


.........................

use Win32::API;
use Encode qw(encode);

$GetTOD = new Win32::API('Netapi32','NetRemoteTOD','PP','N');

$native_string = "server"; #Windows 2003
$Unicode_String = encode("UCS-2LE", uc($native_string));

$todptr= "\x00" x 4;
$rc = $GetTOD->Call($Unicode_String, $todptr);
print "Returncode = " . $rc . "\n";

$todptr= unpack("V", $todptr);

my $toddata= "\x00" x 48;

my $memcpy= new Win32::API('ntdll.dll', 'memcpy', 'PNN', 'V', '_cdecl');
$memcpy->Call($toddata, $todptr, length($toddata));

....  now you can unpack $toddata

_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to