With the
WTSQuerySessionInformation API you can get the Client
IP address of a Terminal Server client. On Vista and Windows Server 2008 this returns an IPv6 address in a pointer to a WtsClientAddress structure:
Code:
_WTS_CLIENT_ADDRESS = record
AddressFamily: DWORD; // AF_INET, AF_IPX, AF_NETBIOS, AF_UNSPEC
Address: array [0..19] of BYTE; // client network address
end;
I want to convert the Address to a string but don't know how. I tried to use
RtlIpv6AddressToString API this succeeds but returns bogus.
My IPConfig:
IPv6 Address. . . . . . . . . . . : 1111:2222:1111:2222:1111:2222:1111:2222
Link-local IPv6 Address . . . . . : fe80::fd16:38fb:af7a:66c4%10
Dump of the Address byte array:
182530000010000000000710
Hex Dump: 7C F4 12 00 8B 1D 49 00 38 F4 12 00 AF 1E 49 00 7C F4 12 00
Anyone?