public static KeyHandle Create( KeyAccess access, string name, ObjectFlags objectFlags, KeyHandle rootDirectory, RegOptions createOptions, out KeyCreationDisposition creationDisposition ) { NtStatus status; ObjectAttributes oa = new ObjectAttributes(name, objectFlags, rootDirectory); IntPtr handle; try { if ((status = Win32.NtCreateKey( out handle, access, ref oa, 0, IntPtr.Zero, createOptions, out creationDisposition )) >= NtStatus.Error) { Win32.ThrowLastError(status); } } finally { oa.Dispose(); } return(new KeyHandle(handle, true)); }
public static KeyHandle Create( KeyAccess access, string name, ObjectFlags objectFlags, KeyHandle rootDirectory, RegOptions createOptions ) { KeyCreationDisposition creationDisposition; return(Create(access, name, objectFlags, rootDirectory, createOptions, out creationDisposition)); }
public KeyHandle(string name, ObjectFlags objectFlags, KeyHandle rootDirectory, KeyAccess access) { ObjectAttributes oa = new ObjectAttributes(name, objectFlags, rootDirectory); IntPtr handle; try { Win32.NtOpenKey( out handle, access, ref oa ).ThrowIf(); } finally { oa.Dispose(); } this.Handle = handle; }
public KeyHandle(string name, ObjectFlags objectFlags, KeyHandle rootDirectory, KeyAccess access) { NtStatus status; ObjectAttributes oa = new ObjectAttributes(name, objectFlags, rootDirectory); IntPtr handle; try { if ((status = Win32.NtOpenKey( out handle, access, ref oa )) >= NtStatus.Error) { Win32.ThrowLastError(status); } } finally { oa.Dispose(); } this.Handle = handle; }