Author: hbelusca
Date: Sat Jun 4 22:50:33 2016
New Revision: 71520
URL:
http://svn.reactos.org/svn/reactos?rev=71520&view=rev
Log:
[RSHELL]: When rshell is compiled and used on Windows (as a testing replacement for
shell32), it should correctly initialize the shell32_instance handle so that the rest of
shell32 code can use something valid!
Modified:
trunk/reactos/base/shell/rshell/misc.cpp
Modified: trunk/reactos/base/shell/rshell/misc.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/rshell/misc.cpp…
==============================================================================
--- trunk/reactos/base/shell/rshell/misc.cpp [iso-8859-1] (original)
+++ trunk/reactos/base/shell/rshell/misc.cpp [iso-8859-1] Sat Jun 4 22:50:33 2016
@@ -20,8 +20,6 @@
#include "shellmenu.h"
-HINSTANCE shell32_hInstance = NULL;
-
DWORD WINAPI WinList_Init(void)
{
/* do something here (perhaps we may want to add our own implementation fo win8) */
@@ -38,10 +36,10 @@
public:
};
-CRShellModule gModule;
-CAtlWinModule gWinModule;
-
-HINSTANCE g_hRShell;
+CRShellModule gModule;
+CAtlWinModule gWinModule;
+
+HINSTANCE shell32_hInstance = NULL;
static LSTATUS inline _RegSetStringValueW(HKEY hKey, LPCWSTR lpValueName, LPCWSTR
lpStringData)
{
@@ -59,7 +57,7 @@
if (!StringFromGUID2(clsid, szClsid, _countof(szClsid)))
return E_FAIL;
- if (!GetModuleFileNameW(g_hRShell, szFilename, _countof(szFilename)))
+ if (!GetModuleFileNameW(shell32_hInstance, szFilename, _countof(szFilename)))
return E_FAIL;
HRESULT hr = StringCchPrintfW(szRoot, 0x104u, L"CLSID\\%s", szClsid);
@@ -117,13 +115,14 @@
{
if (dwReason == DLL_PROCESS_ATTACH)
{
- g_hRShell = hInstance;
+ shell32_hInstance = hInstance;
gModule.Init(NULL, hInstance, NULL);
DisableThreadLibraryCalls(hInstance);
}
else if (dwReason == DLL_PROCESS_DETACH)
{
+ shell32_hInstance = NULL;
gModule.Term();
}
return TRUE;