/// <summary> /// Throws the NT status value as an exception if it is an error or warning. /// </summary> /// <param name="status">The NT status value.</param> public static void ThrowIf(this NtStatus status) { if (status.IsError() || status.IsWarning()) { status.Throw(); } }
private MemoryAlloc GetPropertiesInformation() { int retLength; MemoryAlloc data = new MemoryAlloc(0x1000); NtStatus status = Win32.NtQueryInformationTransaction( this, TransactionInformationClass.TransactionPropertiesInformation, data, data.Size, out retLength ); if (status == NtStatus.BufferTooSmall) { // Resize the buffer and try again. data.ResizeNew(retLength); status = Win32.NtQueryInformationTransaction( this, TransactionInformationClass.TransactionPropertiesInformation, data, data.Size, out retLength ); } if (status.IsError()) { data.Dispose(); status.Throw(); } return(data); }