mirror of
https://github.com/reactos/reactos.git
synced 2025-05-25 12:14:32 +00:00
[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!
svn path=/trunk/; revision=71520
This commit is contained in:
parent
fe2ef00a13
commit
1b3d6dfdc1
1 changed files with 6 additions and 7 deletions
|
@ -20,8 +20,6 @@
|
||||||
|
|
||||||
#include "shellmenu.h"
|
#include "shellmenu.h"
|
||||||
|
|
||||||
HINSTANCE shell32_hInstance = NULL;
|
|
||||||
|
|
||||||
DWORD WINAPI WinList_Init(void)
|
DWORD WINAPI WinList_Init(void)
|
||||||
{
|
{
|
||||||
/* do something here (perhaps we may want to add our own implementation fo win8) */
|
/* do something here (perhaps we may want to add our own implementation fo win8) */
|
||||||
|
@ -38,10 +36,10 @@ class CRShellModule : public CComModule
|
||||||
public:
|
public:
|
||||||
};
|
};
|
||||||
|
|
||||||
CRShellModule gModule;
|
CRShellModule gModule;
|
||||||
CAtlWinModule gWinModule;
|
CAtlWinModule gWinModule;
|
||||||
|
|
||||||
HINSTANCE g_hRShell;
|
HINSTANCE shell32_hInstance = NULL;
|
||||||
|
|
||||||
static LSTATUS inline _RegSetStringValueW(HKEY hKey, LPCWSTR lpValueName, LPCWSTR lpStringData)
|
static LSTATUS inline _RegSetStringValueW(HKEY hKey, LPCWSTR lpValueName, LPCWSTR lpStringData)
|
||||||
{
|
{
|
||||||
|
@ -59,7 +57,7 @@ static HRESULT RegisterComponent(REFGUID clsid, LPCWSTR szDisplayName)
|
||||||
if (!StringFromGUID2(clsid, szClsid, _countof(szClsid)))
|
if (!StringFromGUID2(clsid, szClsid, _countof(szClsid)))
|
||||||
return E_FAIL;
|
return E_FAIL;
|
||||||
|
|
||||||
if (!GetModuleFileNameW(g_hRShell, szFilename, _countof(szFilename)))
|
if (!GetModuleFileNameW(shell32_hInstance, szFilename, _countof(szFilename)))
|
||||||
return E_FAIL;
|
return E_FAIL;
|
||||||
|
|
||||||
HRESULT hr = StringCchPrintfW(szRoot, 0x104u, L"CLSID\\%s", szClsid);
|
HRESULT hr = StringCchPrintfW(szRoot, 0x104u, L"CLSID\\%s", szClsid);
|
||||||
|
@ -117,13 +115,14 @@ STDAPI_(BOOL) DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID fImpLoad)
|
||||||
{
|
{
|
||||||
if (dwReason == DLL_PROCESS_ATTACH)
|
if (dwReason == DLL_PROCESS_ATTACH)
|
||||||
{
|
{
|
||||||
g_hRShell = hInstance;
|
shell32_hInstance = hInstance;
|
||||||
|
|
||||||
gModule.Init(NULL, hInstance, NULL);
|
gModule.Init(NULL, hInstance, NULL);
|
||||||
DisableThreadLibraryCalls(hInstance);
|
DisableThreadLibraryCalls(hInstance);
|
||||||
}
|
}
|
||||||
else if (dwReason == DLL_PROCESS_DETACH)
|
else if (dwReason == DLL_PROCESS_DETACH)
|
||||||
{
|
{
|
||||||
|
shell32_hInstance = NULL;
|
||||||
gModule.Term();
|
gModule.Term();
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
Loading…
Reference in a new issue