Jump to content

Howto convert IPv6 from WTSClientAddress to string?


Recommended Posts

Posted

With WTSQuerySessionInfo you can query the client address by passing in the

WTSClientAddress constant. This returns a _WTS_CLIENT_ADDRESS structure:

typedef struct _WTS_CLIENT_ADDRESS { DWORD AddressFamily; BYTE Address[20];

} WTS_CLIENT_ADDRESS, *PWTS_CLIENT_ADDRESS;

 

I tried using RtlIpv6AddressToString but that doesn't return a valid

address. Please suggest how to convert.

 

(Crossposted in microsoft.public.win32.programmer.kernel:

http://msdn.microsoft.com/newsgroups/default.aspx?dg=microsoft.public.win32.programmer.kernel&mid=538a0940-256e-480c-afaa-b9f287e7d680&sloc=en-us)

  • 3 weeks later...
  • Replies 1
  • Created
  • Last Reply
Guest Ayesha Mascarenhas [MSFT]
Posted

Re: Howto convert IPv6 from WTSClientAddress to string?

 

Hello,

There is no API for this. You have to manually format the IPV6 address into

a string. Each octet takes 2 bytes so examining the Address member in

WTS_CLIENT_ADDRESS you should be able to walk the array to assemble the IPV6

address.

 

--

This posting is provided "AS IS" with no warranties, and confers no rights.

"Remko" <Remko@discussions.microsoft.com> wrote in message

news:2F499249-49A0-45D9-B789-2FF8C69800FD@microsoft.com...

> With WTSQuerySessionInfo you can query the client address by passing in

> the

> WTSClientAddress constant. This returns a _WTS_CLIENT_ADDRESS structure:

> typedef struct _WTS_CLIENT_ADDRESS { DWORD AddressFamily; BYTE

> Address[20];

> } WTS_CLIENT_ADDRESS, *PWTS_CLIENT_ADDRESS;

>

> I tried using RtlIpv6AddressToString but that doesn't return a valid

> address. Please suggest how to convert.

>

> (Crossposted in microsoft.public.win32.programmer.kernel:

> http://msdn.microsoft.com/newsgroups/default.aspx?dg=microsoft.public.win32.programmer.kernel&mid=538a0940-256e-480c-afaa-b9f287e7d680&sloc=en-us)


×
×
  • Create New...