The following struct seems to work for me in C#
using DWORD = System.UInt32; // Optional alias, used below.
[StructLayout(LayoutKind.Sequential)]
public struct SECURITY_ATTRIBUTES
{
public DWORD nLength;
public IntPtr lpSecurityDescriptor;
public bool bInheritHandle;
}