137 references to HRESULT
System.Private.Windows.Core (127)
Windows\Win32\Foundation\HRESULT.cs (25)
8public static HRESULT HRESULT_FROM_WIN32(WIN32_ERROR error) 11public static implicit operator HRESULT(Exception ex) 14return (HRESULT)ex.HResult; 23public static readonly HRESULT COR_E_ARGUMENT = (HRESULT)unchecked((int)0x80070057); 24public static readonly HRESULT TLBX_E_LIBNOTREGISTERED = (HRESULT)unchecked((int)0x80131165); 25public static readonly HRESULT COR_E_MISSINGFIELD = (HRESULT)unchecked((int)0x80131511); 26public static readonly HRESULT COR_E_MISSINGMEMBER = (HRESULT)unchecked((int)0x80131512); 27public static readonly HRESULT COR_E_MISSINGMETHOD = (HRESULT)unchecked((int)0x80131513); 28public static readonly HRESULT COR_E_NOTSUPPORTED = (HRESULT)unchecked((int)0x80131515); 29public static readonly HRESULT COR_E_OVERFLOW = (HRESULT)unchecked((int)0x80131516); 30public static readonly HRESULT COR_E_INVALIDOLEVARIANTTYPE = (HRESULT)unchecked((int)0x80131531); 31public static readonly HRESULT COR_E_SAFEARRAYTYPEMISMATCH = (HRESULT)unchecked((int)0x80131533); 32public static readonly HRESULT COR_E_TARGETINVOCATION = (HRESULT)unchecked((int)0x80131604); 33public static readonly HRESULT COR_E_OBJECTDISPOSED = (HRESULT)unchecked((int)0x80131622);
Windows\Win32\Graphics\GdiPlus\StatusExtensions.cs (7)
27return new ExternalException(SR.GdiplusGenericError, (int)HRESULT.E_FAIL); 39return new ExternalException(SR.GdiplusGenericError, (int)HRESULT.E_FAIL); 43return new ExternalException(SR.GdiplusAborted, (int)HRESULT.E_ABORT); 49return new ExternalException(SR.GdiplusAccessDenied, (int)HRESULT.E_ACCESSDENIED); 70return new ExternalException(SR.GdiplusUnsupportedGdiplusVersion, (int)HRESULT.E_FAIL); 73return new ExternalException(SR.GdiplusNotInitialized, (int)HRESULT.E_FAIL); 76return new ExternalException($"{SR.GdiplusUnknown} [{status}]", (int)HRESULT.E_UNEXPECTED);
Windows\Win32\PInvokeCore.PrintDlgEx.cs (1)
12internal static extern unsafe HRESULT PrintDlgEx(PRINTDLGEXW* pPD);
Windows\Win32\System\Com\AgileComPointer.cs (5)
84var scope = GlobalInterfaceTable.GetInterface<TInterface>(_cookie, out HRESULT hr); 95var scope = TryGetInterface<TAsInterface>(out HRESULT hr); 103public ComScope<TInterface> TryGetInterface(out HRESULT hr) 109public ComScope<TAsInterface> TryGetInterface<TAsInterface>(out HRESULT hr) 147HRESULT hr = GlobalInterfaceTable.RevokeInterface(cookie);
Windows\Win32\System\Com\ComHelpers.cs (11)
40internal static ComScope<T> TryGetComScope<T>(object? @object, out HRESULT hr) where T : unmanaged, IComIID => 49T* result = TryGetComPointer<T>(@object, out HRESULT hr); 68using var scope = TryGetComScope<T>(@object, out HRESULT hr); 76/// Typically either <see cref="HRESULT.S_OK"/> or <see cref="HRESULT.E_POINTER"/>. Check for success, not 80internal static T* TryGetComPointer<T>(object? @object, out HRESULT result) where T : unmanaged, IComIID 84result = HRESULT.E_POINTER; 115result = HRESULT.E_NOINTERFACE; 122result = HRESULT.S_OK; 182HRESULT hr = unknown->QueryInterface(IID.Get<IUnknown>(), (void**)&unknown); 339HRESULT hr = PInvokeCore.LoadRegTypeLib(typeLibrary, majorVersion, minorVersion, 0, typelib);
Windows\Win32\System\Com\ComManagedStream.cs (30)
45HRESULT IStream.Interface.Clone(IStream** ppstm) 49return HRESULT.E_POINTER; 56return HRESULT.S_OK; 59HRESULT IStream.Interface.Commit(uint grfCommitFlags) 65return HRESULT.S_OK; 68HRESULT IStream.Interface.CopyTo(IStream* pstm, ulong cb, ulong* pcbRead, ulong* pcbWritten) 72return HRESULT.STG_E_INVALIDPOINTER; 108return HRESULT.S_OK; 111HRESULT ISequentialStream.Interface.Read(void* pv, uint cb, uint* pcbRead) 115return HRESULT.STG_E_INVALIDPOINTER; 126return HRESULT.S_OK; 129HRESULT IStream.Interface.Read(void* pv, uint cb, uint* pcbRead) 132HRESULT IStream.Interface.Seek(long dlibMove, SeekOrigin dwOrigin, ulong* plibNewPosition) 178return HRESULT.S_OK; 181return HRESULT.S_OK; 184HRESULT IStream.Interface.SetSize(ulong libNewSize) 187return HRESULT.S_OK; 190HRESULT IStream.Interface.Stat(STATSTG* pstatstg, uint grfStatFlag) 194return HRESULT.STG_E_INVALIDPOINTER; 216return HRESULT.S_OK; 220HRESULT IStream.Interface.LockRegion(ulong libOffset, ulong cb, uint dwLockType) => HRESULT.STG_E_INVALIDFUNCTION; 223HRESULT IStream.Interface.Revert() => HRESULT.S_OK; 226HRESULT IStream.Interface.UnlockRegion(ulong libOffset, ulong cb, uint dwLockType) => HRESULT.STG_E_INVALIDFUNCTION; 228HRESULT ISequentialStream.Interface.Write(void* pv, uint cb, uint* pcbWritten) 232return HRESULT.STG_E_INVALIDPOINTER; 243return HRESULT.S_OK; 246HRESULT IStream.Interface.Write(void* pv, uint cb, uint* pcbWritten)
Windows\Win32\System\Com\ComScope.cs (6)
60public ComScope<TTo> TryQuery<TTo>(out HRESULT hr) where TTo : unmanaged, IComIID 80public static ComScope<T> TryQueryFrom<TFrom>(TFrom* from, out HRESULT hr) where TFrom : unmanaged, IComIID 83hr = from is null ? HRESULT.E_POINTER : ((IUnknown*)from)->QueryInterface(IID.Get<T>(), scope); 94HRESULT.E_POINTER.ThrowOnFailure(); 104/// use the interface, otherwise use <see cref="TryQuery{TTo}(out HRESULT)"/>. 114HRESULT hr = AsUnknown->QueryInterface(IID.Get<TInterface>(), (void**)&unknown);
Windows\Win32\System\Com\GlobalInterfaceTable.cs (4)
40HRESULT hr = s_globalInterfaceTable->RegisterInterfaceInGlobal( 52public static ComScope<TInterface> GetInterface<TInterface>(uint cookie, out HRESULT result) 64public static HRESULT RevokeInterface(uint cookie) 66HRESULT hr = s_globalInterfaceTable->RevokeInterfaceFromGlobal(cookie);
Windows\Win32\System\Com\GlobalInterfaceTable.UnknownStrategy.cs (1)
31return cookie != 0 ? (int)HRESULT.S_OK : (int)RevokeInterface(_cookie);
Windows\Win32\System\Com\IComCallableWrapper.cs (4)
32public unsafe HRESULT QueryInterface(in Guid riid, out void* ppvObject) 41public unsafe HRESULT QueryInterface(Guid* riid, void** ppvObject) 44return ((delegate* unmanaged[Stdcall]<IComCallableWrapper*, Guid*, void**, HRESULT>)_vtbl[0])(pThis, riid, ppvObject); 62internal delegate* unmanaged[Stdcall]<IEnumUnknown*, Guid*, void**, HRESULT> QueryInterface_1;
Windows\Win32\System\Com\IDispatch.cs (11)
15internal HRESULT TryGetProperty( 23internal HRESULT TryGetProperty( 33HRESULT hr = dispatch->Invoke( 43if (hr == HRESULT.DISP_E_EXCEPTION) 47hr = (HRESULT)pExcepInfo.scode; 92public HRESULT SetPropertyValue(int dispatchId, VARIANT value, out string? errorText) 110HRESULT hr = Invoke( 120if (hr == HRESULT.DISP_E_EXCEPTION) 124hr = (HRESULT)pExcepInfo.scode; 135internal HRESULT GetIDOfName(string name, out int dispId) 141HRESULT result = GetIDsOfNames(IID.NULL(), (PWSTR*)&n, 1u, PInvokeCore.GetThreadLocale(), &id);
Windows\Win32\System\Com\IDispatch.Interface.cs (8)
22private static HRESULT GetTypeInfoCount(IDispatch* @this, uint* pctinfo) 26private static HRESULT GetTypeInfo(IDispatch* @this, uint iTInfo, uint lcid, ITypeInfo** ppTInfo) 30private static HRESULT GetIDsOfNames(IDispatch* @this, Guid* riid, PWSTR* rgszNames, uint cNames, uint lcid, int* rgDispId) 34private static HRESULT Invoke( 54HRESULT GetTypeInfoCount( 58HRESULT GetTypeInfo( 64HRESULT GetIDsOfNames( 72HRESULT Invoke(
Windows\Win32\System\Com\ITypeInfo.cs (2)
9public HRESULT GetIDOfName(string name, out int memberId) 15HRESULT result = GetIDsOfNames((PWSTR*)&n, 1, &id);
Windows\Win32\System\Com\WinFormsComWrappers.cs (9)
20unknown->QueryInterface_1 = (delegate* unmanaged[Stdcall]<IUnknown*, Guid*, void**, HRESULT>)fpQueryInterface; 56/// Handles exceptions and converts to <see cref="HRESULT"/>. 59internal static HRESULT UnwrapAndInvoke<TThis, TInterface>(TThis* @this, Func<TInterface, HRESULT> func) 66return @object is null ? HRESULT.COR_E_OBJECTDISPOSED : func(@object); 95/// <inheritdoc cref="UnwrapAndInvoke{TThis, TInterface}(TThis*, Func{TInterface, HRESULT})"/> 96internal static HRESULT UnwrapAndInvoke<TThis, TInterface>(TThis* @this, Action<TInterface> action) 105return HRESULT.COR_E_OBJECTDISPOSED; 109return HRESULT.S_OK;
Windows\Win32\System\Variant\VARIANT.cs (3)
275HRESULT hr = PInvokeCore.SafeArrayLock(psa); 276Debug.Assert(hr == HRESULT.S_OK); 434Debug.Assert(hr == HRESULT.S_OK);
System.Windows.Forms (4)
System\Windows\Forms\Dialogs\TaskDialog\TaskDialog.cs (4)
114/// always return <see cref="HRESULT.S_FALSE"/> to prevent the dialog from applying the 144/// <see cref="HRESULT.S_OK"/> to cache the button instance, 150/// returned <see cref="HRESULT.S_OK"/>, so that further 151/// handles will return <see cref="HRESULT.S_FALSE"/> to
System.Windows.Forms.Interop.Tests (1)
AccessibleObjectTests.cs (1)
456var result = enumVariant.Next(1, &variantObject, &retreivedCount);
System.Windows.Forms.Primitives (5)
Microsoft\VisualStudio\Shell\IVsPerPropertyBrowsing.cs (5)
144/// result other than <see cref="HRESULT.S_OK"/> or false for <paramref name="pfDisplay"/> will suppress this feature. 153/// <see cref="HRESULT.S_OK"/> return code will display the default values. 181/// window selection combo. Returning any result other than <see cref="HRESULT.S_OK"/> will cause the default to 191/// <see cref="HRESULT.S_OK"/> or false for <paramref name="pfCanReset"/> will not allow the value to be reset. 199/// If the return value is <see cref="HRESULT.S_OK"/>, the property's value will then be refreshed to the