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