P
Peter Arnhold
Hi,
how can I correctly 'unpack' $SessionInfo?:
use Win32::API;
my $WTSOpenServer = new Win32::API("wtsapi32.dll", "WTSOpenServer",[P],N);
my $hServer = $WTSOpenServer->Call('');
my $SessionInfo = pack 'L4', 0;
my $Count = pack 'C', 0;
my $WTSEnumerateSessions = new Win32::API(
'wtsapi32.dll', 'WTSEnumerateSessions',[qw(N N N P P)],'I'
);
$WTSEnumerateSessions->Call($hServer,0,1,$SessionInfo,$Count);
print unpack('C', $Count), "\n"; # 2 - OK, system and console
print unpack 'H*', $SessionInfo; # not realy struct _WTS_SESSION_INFO??
THX,
Peter
how can I correctly 'unpack' $SessionInfo?:
use Win32::API;
my $WTSOpenServer = new Win32::API("wtsapi32.dll", "WTSOpenServer",[P],N);
my $hServer = $WTSOpenServer->Call('');
my $SessionInfo = pack 'L4', 0;
my $Count = pack 'C', 0;
my $WTSEnumerateSessions = new Win32::API(
'wtsapi32.dll', 'WTSEnumerateSessions',[qw(N N N P P)],'I'
);
$WTSEnumerateSessions->Call($hServer,0,1,$SessionInfo,$Count);
print unpack('C', $Count), "\n"; # 2 - OK, system and console
print unpack 'H*', $SessionInfo; # not realy struct _WTS_SESSION_INFO??
THX,
Peter