LegacyUpdate/nsisplugin/MessageForHresult.c

18 lines
308 B
C
Raw Normal View History

#include <windows.h>
#include <nsis/pluginapi.h>
#include "../shared/HResult.h"
2024-09-27 07:46:10 -04:00
PLUGIN_METHOD(MessageForHresult) {
PLUGIN_INIT();
HRESULT hr = popint();
if (hr == 0) {
pushstring(L"Unknown error");
return;
}
LPWSTR message = GetMessageForHresult(hr);
pushstring(message);
LocalFree(message);
}