Exposes the Win32 FormatMessage & GetLastError functions.
More...
|
enum class | FORMAT_MESSAGE : uint {
ALLOCATE_BUFFER = 0x00000100
, IGNORE_INSERTS = 0x00000200
, FROM_SYSTEM = 0x00001000
, ARGUMENT_ARRAY = 0x00002000
,
FROM_HMODULE = 0x00000800
, FROM_STRING = 0x00000400
} |
| Possible flags to pass to the FormatMessage(FORMAT_MESSAGE, IntPtr, int, uint, out StringBuilder, int, IntPtr) method. More...
|
|
|
static int | GetLastError () |
| Gets the last error to have occurred from within the unmanaged C++ Windows API. More...
|
|
static string | FormatError (int err) |
| Gets an error message from the given err HResult.
This is a convenience method that calls FormatMessage(FORMAT_MESSAGE, IntPtr, int, uint, out StringBuilder, int, IntPtr). More...
|
|
static string | GetLastErrorString () |
| Gets the last error message to have occurred from within the unmanaged C++ Windows API, as a string. More...
|
|
|
static int | hresult |
| Gets both the last HResult error ID and the associated string error message for the last error message to have occurred from within the unmanaged C++ Windows API. More...
|
|
Exposes the Win32 FormatMessage & GetLastError functions.
◆ FORMAT_MESSAGE
Possible flags to pass to the FormatMessage(FORMAT_MESSAGE, IntPtr, int, uint, out StringBuilder, int, IntPtr) method.
Enumerator |
---|
ALLOCATE_BUFFER | |
IGNORE_INSERTS | |
FROM_SYSTEM | |
ARGUMENT_ARRAY | |
FROM_HMODULE | |
FROM_STRING | |
◆ FormatError()
static string VolumeControl.Core.Helpers.GetWin32Error.FormatError |
( |
int |
err | ) |
|
|
static |
Gets an error message from the given err HResult.
This is a convenience method that calls FormatMessage(FORMAT_MESSAGE, IntPtr, int, uint, out StringBuilder, int, IntPtr).
- Parameters
-
err | The HResult error ID to format into a string. |
- Returns
- The string error message associated with HResult err .
◆ GetLastError()
static int VolumeControl.Core.Helpers.GetWin32Error.GetLastError |
( |
| ) |
|
|
static |
Gets the last error to have occurred from within the unmanaged C++ Windows API.
- Returns
- An int representing the HResult of the last error.
◆ GetLastErrorString()
static string VolumeControl.Core.Helpers.GetWin32Error.GetLastErrorString |
( |
| ) |
|
|
static |
Gets the last error message to have occurred from within the unmanaged C++ Windows API, as a string.
- Returns
- A string error message.
◆ hresult
int VolumeControl.Core.Helpers.GetWin32Error.hresult |
|
static |
Gets both the last HResult error ID and the associated string error message for the last error message to have occurred from within the unmanaged C++ Windows API.
- Returns
- HResult and string error message as a tuple.
The documentation for this class was generated from the following file:
- /home/runner/work/volume-control/volume-control/VolumeControl.Core/Helpers/GetWin32Error.cs