D
David White
I have the following structure. I need to create a pointer to it for calling
the Windows API. When I try, I get an error. I have found that the String is
the culprit. In the C declaration for this structure, the String is shown as
UNICODE_STRING. Can someone tell me the correct datatype to use for the String
which will allow me to both call the Win API and declare a pointer to this
structure? Thanks.
[StructLayout(LayoutKind.Sequential)]
struct OBJECT_TYPE_INFORMATION
{
public String TypeName;
public uint TotalNumberOfObjects;
public uint TotalNumberOfHandles;
public uint TotalPagedPoolUsage;
public uint TotalNonPagedPoolUsage;
public uint TotalNamePoolUsage;
public uint TotalHandleTableUsage;
public uint HighWaterNumberOfObjects;
public uint HighWaterNumberOfHandles;
public uint HighWaterPagedPoolUsage;
public uint HighWaterNonPagedPoolUsage;
public uint HighWaterNamePoolUsage;
public uint HighWaterHandleTableUsage;
public uint InvalidAttributes;
public GENERIC_MAPPING GenericMapping;
public uint ValidAccessMask;
public bool SecurityRequired;
public bool MaintainHandleCount;
public uint PoolType;
public uint DefaultPagedPoolCharge;
public uint DefaultNonPagedPoolCharge;
}
the Windows API. When I try, I get an error. I have found that the String is
the culprit. In the C declaration for this structure, the String is shown as
UNICODE_STRING. Can someone tell me the correct datatype to use for the String
which will allow me to both call the Win API and declare a pointer to this
structure? Thanks.
[StructLayout(LayoutKind.Sequential)]
struct OBJECT_TYPE_INFORMATION
{
public String TypeName;
public uint TotalNumberOfObjects;
public uint TotalNumberOfHandles;
public uint TotalPagedPoolUsage;
public uint TotalNonPagedPoolUsage;
public uint TotalNamePoolUsage;
public uint TotalHandleTableUsage;
public uint HighWaterNumberOfObjects;
public uint HighWaterNumberOfHandles;
public uint HighWaterPagedPoolUsage;
public uint HighWaterNonPagedPoolUsage;
public uint HighWaterNamePoolUsage;
public uint HighWaterHandleTableUsage;
public uint InvalidAttributes;
public GENERIC_MAPPING GenericMapping;
public uint ValidAccessMask;
public bool SecurityRequired;
public bool MaintainHandleCount;
public uint PoolType;
public uint DefaultPagedPoolCharge;
public uint DefaultNonPagedPoolCharge;
}