public TransactionHandle( string name, ObjectFlags objectFlags, DirectoryHandle rootDirectory, Guid unitOfWorkGuid, TmHandle tmHandle, TransactionAccess access ) { ObjectAttributes oa = new ObjectAttributes(name, objectFlags, rootDirectory); IntPtr handle; try { Win32.NtOpenTransaction( out handle, access, ref oa, ref unitOfWorkGuid, tmHandle ?? IntPtr.Zero ).ThrowIf(); } finally { oa.Dispose(); } this.Handle = handle; }
public TransactionHandle( string name, ObjectFlags objectFlags, DirectoryHandle rootDirectory, Guid unitOfWorkGuid, TmHandle tmHandle, TransactionAccess access ) { NtStatus status; ObjectAttributes oa = new ObjectAttributes(name, objectFlags, rootDirectory); IntPtr handle; try { if ((status = Win32.NtOpenTransaction( out handle, access, ref oa, ref unitOfWorkGuid, tmHandle ?? IntPtr.Zero )) >= NtStatus.Error) { Win32.ThrowLastError(status); } } finally { oa.Dispose(); } this.Handle = handle; }
public ResourceManagerHandle( string name, ObjectFlags objectFlags, DirectoryHandle rootDirectory, TmHandle tmHandle, Guid guid, ResourceManagerAccess access ) { NtStatus status; ObjectAttributes oa = new ObjectAttributes(name, objectFlags, rootDirectory); IntPtr handle; try { if ((status = Win32.NtOpenResourceManager( out handle, access, tmHandle, ref guid, ref oa )) >= NtStatus.Error) { Win32.ThrowLastError(status); } } finally { oa.Dispose(); } this.Handle = handle; }
public ResourceManagerHandle( string name, ObjectFlags objectFlags, DirectoryHandle rootDirectory, TmHandle tmHandle, Guid guid, ResourceManagerAccess access ) { ObjectAttributes oa = new ObjectAttributes(name, objectFlags, rootDirectory); IntPtr handle; try { Win32.NtOpenResourceManager( out handle, access, tmHandle, ref guid, ref oa ).ThrowIf(); } finally { oa.Dispose(); } this.Handle = handle; }
public static TransactionHandle Create( TransactionAccess access, string name, ObjectFlags objectFlags, DirectoryHandle rootDirectory, Guid unitOfWorkGuid, TmHandle tmHandle, TransactionOptions createOptions, long timeout, string description ) { NtStatus status; ObjectAttributes oa = new ObjectAttributes(name, objectFlags, rootDirectory); IntPtr handle; if (unitOfWorkGuid == Guid.Empty) { unitOfWorkGuid = Guid.NewGuid(); } try { UnicodeString descriptionStr = new UnicodeString(description); try { if ((status = Win32.NtCreateTransaction( out handle, access, ref oa, ref unitOfWorkGuid, tmHandle ?? IntPtr.Zero, createOptions, 0, 0, ref timeout, ref descriptionStr )) >= NtStatus.Error) { Win32.Throw(status); } } finally { descriptionStr.Dispose(); } } finally { oa.Dispose(); } return(new TransactionHandle(handle, true)); }
public static ResourceManagerHandle Create( ResourceManagerAccess access, string name, ObjectFlags objectFlags, DirectoryHandle rootDirectory, TmHandle tmHandle, Guid guid, ResourceManagerOptions createOptions, string description ) { NtStatus status; ObjectAttributes oa = new ObjectAttributes(name, objectFlags, rootDirectory); IntPtr handle; try { UnicodeString descriptionStr = new UnicodeString(description); try { if ((status = Win32.NtCreateResourceManager( out handle, access, tmHandle, ref guid, ref oa, createOptions, ref descriptionStr )) >= NtStatus.Error) { Win32.ThrowLastError(status); } } finally { descriptionStr.Dispose(); } } finally { oa.Dispose(); } return(new ResourceManagerHandle(handle, true)); }
public static TransactionHandle Create( TransactionAccess access, TmHandle tmHandle, TransactionOptions createOptions, long timeout, string description ) { return(Create( access, null, 0, null, Guid.Empty, tmHandle, createOptions, timeout, description )); }