سلام

فکر کنم اینجوری

[DllImport("kernel32.dll", EntryPoint="CreateFileA")]
static extern int32 CreateFile (
string lpFileName,
int32 dwDesiredAccess,
int32 dwShareMode,
[MarshalAs(UnmanagedType.Struct)&#9 3; SECURITY_ATTRIBUTES lpSecurityAttributes,
int32 dwCreationDisposition,
int32 dwFlagsAndAttributes,
int32 hTemplateFile);
struct SECURITY_ATTRIBUTES{
private int32 nLength;
private int32 lpSecurityDescriptor;
private int32 bInheritHandle;
}