Added COMPOBJ.DllEntryPoint (Acrobat3 16bit needs it).

This commit is contained in:
Andreas Mohr 1999-06-22 19:10:52 +00:00 committed by Alexandre Julliard
parent 13a30bace7
commit 1597d735ef
2 changed files with 42 additions and 1 deletions

View File

@ -115,7 +115,7 @@ type win16
113 stub ?SETATGROW@CARRAYFVALUE@@RECHHPEX@Z
114 stub ?SETSIZE@CARRAYFVALUE@@RECHHH@Z
115 pascal CoGetState(ptr) CoGetState16
116 stub DLLENTRYPOINT
116 pascal DllEntryPoint(long word word word long word) COMPOBJ_DllEntryPoint
117 stub ?RELEASE@CSTDMALLOC@@VEAKXZ
118 stub ?ALLOC@CSTDMALLOC@@VEAPEXK@Z
119 stub SHRRELEASE

View File

@ -122,6 +122,10 @@ static COM_ExternalLock* COM_ExternalLockLocate(
*
* TODO: Most of these things will have to be made thread-safe.
*/
HINSTANCE16 COMPOBJ_hInstance = 0;
HINSTANCE COMPOBJ_hInstance32 = 0;
static int COMPOBJ_Attach = 0;
LPMALLOC16 currentMalloc16=NULL;
LPMALLOC currentMalloc32=NULL;
@ -1982,3 +1986,40 @@ static void COM_ExternalLockDelete(
} while ( current != EL_END_OF_LIST );
}
}
/***********************************************************************
* COMPOBJ_DllEntryPoint [COMPOBJ.entry]
*
* Initialization code for the COMPOBJ DLL
*
* RETURNS:
*/
BOOL WINAPI COMPOBJ_DllEntryPoint(DWORD Reason, HINSTANCE16 hInst, WORD ds, WORD HeapSize, DWORD res1, WORD res2)
{
TRACE(ole, "(%08lx, %04x, %04x, %04x, %08lx, %04x)\n", Reason, hInst, ds, HeapSize,
res1, res2);
switch(Reason)
{
case DLL_PROCESS_ATTACH:
COMPOBJ_Attach++;
if(COMPOBJ_hInstance)
{
ERR(ole, "compobj.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;
}
COMPOBJ_hInstance = hInst;
break;
case DLL_PROCESS_DETACH:
if(!--COMPOBJ_Attach)
COMPOBJ_hInstance = 0;
break;
}
return TRUE;
}