mirror of
https://github.com/LegacyUpdate/LegacyUpdate.git
synced 2025-01-22 14:12:07 -05:00
17 lines
308 B
C
17 lines
308 B
C
#include <windows.h>
|
|
#include <nsis/pluginapi.h>
|
|
#include "../shared/HResult.h"
|
|
|
|
PLUGIN_METHOD(MessageForHresult) {
|
|
PLUGIN_INIT();
|
|
|
|
HRESULT hr = popint();
|
|
if (hr == 0) {
|
|
pushstring(L"Unknown error");
|
|
return;
|
|
}
|
|
|
|
LPWSTR message = GetMessageForHresult(hr);
|
|
pushstring(message);
|
|
LocalFree(message);
|
|
}
|