I have hex_data struct as output of a function of a DLL.
typedef struct hex_data
{
USHORT usLength;
LPBYTE lpbData;
} HEXDATA
where lpbData is a pointer to the byte stream and usLength is the length of the byte stream pointed to by lpbData. Now I need to marshal this struct to a C# struct. What unmanged type I should use for lpbData in below struct definition:
[StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)]
public struct HEXDATA {
[MarshalAs(UnmanagedType.U2)]
public UInt16 usLength;
[MarshalAs(UnmanagedType.?????)]
public byte[] lpbData;
} ;
Thanks