I have an API that return the following structure:
typedef struct _WTS_CLIENT_ADDRESS { DWORD AddressFamily; BYTE
Address[20];
} WTS_CLIENT_ADDRESS, *PWTS_CLIENT_ADDRESS;
I have defined it in VB .NET as:
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Auto)> _
Private Structure WTS_CLIENT_ADDRESS
Dim AddressFamily As UInt32
Dim Address As Byte
End Structure
The data from function is returned in the ppBuffer variable.
My quistion is how to get the Address part of structure as string?
Some sample code:
Dim FRetVal As Integer
Dim pBytesReturned As Integer '= ppBuffer.Capacity
Dim ppBuffer As WTS_CLIENT_ADDRESS
FRetVal = WTSQuerySessionInformation(ptrOpenedServer,
SessionId, InfoType, ppBuffer, pBytesReturned)
If FRetVal <> 0 Then
' Code to extract the Address from stucture
??????????????????
Else
Throw New Exception("Error")
End If