Backout of 266694bb2f66 due to bustage. r=me

This commit is contained in:
Brian R. Bondy 2013-03-23 11:11:27 -04:00
Родитель efbc670344
Коммит 79377b6f15
1 изменённых файлов: 16 добавлений и 64 удалений

Просмотреть файл

@ -79,29 +79,9 @@ public:
RawRef mRawRef;
};
template<>
class nsAutoRefTraits<HMODULE>
{
public:
typedef HMODULE RawRef;
static RawRef Void()
{
return NULL;
}
static void Release(RawRef aFD)
{
if (aFD != Void()) {
FreeLibrary(aFD);
}
}
};
typedef nsAutoRef<HKEY> nsAutoRegKey;
typedef nsAutoRef<SC_HANDLE> nsAutoServiceHandle;
typedef nsAutoRef<HANDLE> nsAutoHandle;
typedef nsAutoRef<HMODULE> nsModuleHandle;
namespace
{
@ -144,34 +124,6 @@ namespace
alreadyChecked = true;
return isMetro;
}
HMODULE
LoadLibrarySystem32(LPCWSTR module)
{
WCHAR systemPath[MAX_PATH + 1] = { L'\0' };
// If GetSystemPath fails we accept that we'll load the DLLs from the
// normal search path.
GetSystemDirectoryW(systemPath, MAX_PATH + 1);
size_t systemDirLen = wcslen(systemPath);
// Make the system directory path terminate with a slash
if (systemDirLen && systemPath[systemDirLen - 1] != L'\\') {
systemPath[systemDirLen] = L'\\';
++systemDirLen;
// No need to re-NULL terminate
}
size_t fileLen = wcslen(module);
wcsncpy(systemPath + systemDirLen, module,
MAX_PATH - systemDirLen);
if (systemDirLen + fileLen <= MAX_PATH) {
systemPath[systemDirLen + fileLen] = L'\0';
} else {
systemPath[MAX_PATH] = L'\0';
}
return LoadLibraryW(systemPath);
}
}
#endif