New routine DllEntryPoint for shell.dll. Loads shell32.dll,

since most shell.dll functions call their 32-bit counterparts.
This commit is contained in:
James Juran 1999-08-15 16:32:03 +00:00 committed by Alexandre Julliard
parent e8ad6fe60a
commit e020a9a95d
2 changed files with 56 additions and 1 deletions

View File

@ -64,6 +64,61 @@ static HHOOK SHELL_hHook = 0;
static UINT16 uMsgWndCreated = 0;
static UINT16 uMsgWndDestroyed = 0;
static UINT16 uMsgShellActivate = 0;
HINSTANCE16 SHELL_hInstance = 0;
HINSTANCE SHELL_hInstance32;
static int SHELL_Attach = 0;
/***********************************************************************
* SHELL_DllEntryPoint [SHELL.entry]
*
* Initialization code for shell.dll. Automatically loads the
* 32-bit shell32.dll to allow thunking up to 32-bit code.
*
* RETURNS:
*/
BOOL WINAPI SHELL_DllEntryPoint(DWORD Reason, HINSTANCE16 hInst,
WORD ds, WORD HeapSize, DWORD res1, WORD res2)
{
TRACE_(shell)("(%08lx, %04x, %04x, %04x, %08lx, %04x)\n",
Reason, hInst, ds, HeapSize, res1, res2);
switch(Reason)
{
case DLL_PROCESS_ATTACH:
SHELL_Attach++;
if (SHELL_hInstance)
{
ERR_(shell)("shell.dll instantiated twice!\n");
/*
* We should return FALSE here, but that will break
* most apps that use CreateProcess because we do
* not yet support seperate address-spaces.
*/
return TRUE;
}
SHELL_hInstance = hInst;
if(!SHELL_hInstance32)
{
if(!(SHELL_hInstance32 = LoadLibraryA("shell32.dll")))
{
ERR_(shell)("Could not load sibling shell32.dll\n");
return FALSE;
}
}
break;
case DLL_PROCESS_DETACH:
if(!--SHELL_Attach)
{
SHELL_hInstance = 0;
if(SHELL_hInstance32)
FreeLibrary(SHELL_hInstance32);
}
break;
}
return TRUE;
}
/*************************************************************************
* DragAcceptFiles32 [SHELL32.54]

View File

@ -27,7 +27,7 @@ type win16
#100 4 0550 HERETHARBETYGARS exported, shared data
#101 8 010e FINDEXEDLGPROC exported, shared data
#101 DLLENTRYPOINT #win95 SHELL.DLL
101 pascal DllEntryPoint(long word word word long word) SHELL_DllEntryPoint
102 pascal16 RegisterShellHook(word word) RegisterShellHook16
103 pascal ShellHookProc(word word long) ShellHookProc16