Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "none",
"comment": "First attempt at logging DLL load failure info",
"packageName": "react-native-windows",
"email": "[email protected]",
"dependentChangeType": "none"
}
9 changes: 8 additions & 1 deletion vnext/Shared/HermesRuntimeHolder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,14 @@ void NAPI_CDECL removeInspectorPage(int32_t pageId) noexcept;

class HermesFuncResolver : public IFuncResolver {
public:
HermesFuncResolver() : libHandle_(LoadLibraryAsPeerFirst(L"hermes.dll")) {}
HermesFuncResolver() {
libHandle_ = LoadLibraryAsPeerFirst(L"hermes.dll");

// If hermes.dll failed to load, catch the last Win32 error and surface it.
if (libHandle_ == nullptr) {
CRASH_ON_ERROR(GetLastError());
}
}

FuncPtr getFuncPtr(const char *funcName) override {
return reinterpret_cast<FuncPtr>(GetProcAddress(libHandle_, funcName));
Expand Down