}
private:
+// String resouces packaged as PE files only exist on Windows
+#ifdef HOST_WINDOWS
HRESULT GetLibrary(LocaleID langId, HRESOURCEDLL* phInst);
#ifndef DACCESS_COMPILE
HRESULT LoadLibraryHelper(HRESOURCEDLL *pHInst,
HRESULT LoadLibraryThrows(HRESOURCEDLL * pHInst);
HRESULT LoadLibrary(HRESOURCEDLL * pHInst);
HRESULT LoadResourceFile(HRESOURCEDLL * pHInst, LPCWSTR lpFileName);
-#endif
+#endif // DACCESS_COMPILE
+#endif // HOST_WINDOWS
// We do not have global constructors any more
static LONG m_dwDefaultInitialized;
//*****************************************************************************
//*****************************************************************************
+// String resouces packaged as PE files only exist on Windows
+#ifdef HOST_WINDOWS
HRESULT CCompRC::GetLibrary(LocaleID langId, HRESOURCEDLL* phInst)
{
CONTRACTL
*phInst = hInst;
return hr;
}
+#endif // HOST_WINDOWS
//*****************************************************************************
// Load the string
#ifndef DACCESS_COMPILE
+// String resouces packaged as PE files only exist on Windows
+#ifdef HOST_WINDOWS
HRESULT CCompRC::LoadResourceFile(HRESOURCEDLL * pHInst, LPCWSTR lpFileName)
{
-#ifdef HOST_WINDOWS
DWORD dwLoadLibraryFlags;
if(m_pResourceFile == m_pDefaultResource)
+ {
dwLoadLibraryFlags = LOAD_LIBRARY_AS_DATAFILE;
+ }
else
+ {
dwLoadLibraryFlags = 0;
+ }
- if ((*pHInst = WszLoadLibraryEx(lpFileName, NULL, dwLoadLibraryFlags)) == NULL) {
+ if((*pHInst = WszLoadLibraryEx(lpFileName, NULL, dwLoadLibraryFlags)) == NULL)
+ {
return HRESULT_FROM_GetLastError();
}
-#else // HOST_WINDOWS
- PORTABILITY_ASSERT("UNIXTODO: Implement resource loading - use peimagedecoder?");
-#endif // HOST_WINDOWS
return S_OK;
}
// only strings.
hr = LoadResourceFile(pHInst, rcPathName);
if (SUCCEEDED(hr))
+ {
break;
-
+ }
}
}
EX_CATCH_HRESULT(hr);
// Last ditch search effort in current directory
- if (FAILED(hr)) {
+ if (FAILED(hr))
+ {
hr = LoadResourceFile(pHInst, m_pResourceFile);
}
#ifdef SELF_NO_HOST
_ASSERTE(!"CCompRC::LoadLibraryThrows not implemented for SELF_NO_HOST");
hr = E_NOTIMPL;
-#else
+#else // SELF_NO_HOST
PathString rcPath; // Path to resource DLL.
// Try first in the same directory as this dll.
return hr;
}
+
HRESULT CCompRC::LoadLibrary(HRESOURCEDLL * pHInst)
{
CONTRACTL
return hr;
}
#endif // DACCESS_COMPILE
+#endif //HOST_WINDOWS