DismGetLastErrorMessage function

Gets the error message in the current thread, immediately after a failure.

Syntax

HRESULT WINAPI DismGetLastErrorMessage(
  _Out_ DismString **ErrorMessage
);

Parameters

ErrorMessage [out]
The detailed error message in the current thread.

Return value

Returns S_OK on success.

Remarks

You can get a detailed error message immediately after a DISM API failure. The last error message is maintained on a per-thread basis. An error message on a thread will not overwrite the last error message on another thread.

DismGetLastErrorMessage does not apply to the DismShutdown function, DismDelete function, or the DismGetLastErrorMessage function.

You must call the DismDelete function to free the memory of ErrorMessage when the return value is S_OK.

Example

HRESULT hr = S_OK;
DismString* ErrorMessage;
hr = DismGetLastErrorMessage(&ErrorMessage);

Requirements

Requirement Description
Supported host platforms DISM API can be used on any operating system supported by the Windows Assessment and Deployment Kit (Windows ADK). For more information, see the Windows ADK Technical Reference
Minimum supported client Windows 7 [desktop apps only]
Minimum supported server Windows Server 2008 R2 [desktop apps only]
Header DismAPI.h
Library DismAPI.lib
DLL DismAPI.dll

See also

DISM API Troubleshooting