mirror of
https://github.com/reactos/wine.git
synced 2025-02-09 05:36:56 +00:00
Fix snooping of 16-bit dlls being loaded at the same address.
This commit is contained in:
parent
ff6bda8960
commit
967813dca5
@ -103,6 +103,9 @@ SNOOP16_RegisterDLL(NE_MODULE *pModule,LPCSTR name) {
|
|||||||
char *s;
|
char *s;
|
||||||
|
|
||||||
if (!TRACE_ON(snoop)) return;
|
if (!TRACE_ON(snoop)) return;
|
||||||
|
|
||||||
|
TRACE("hmod=%x, name=%s\n", pModule->self, name);
|
||||||
|
|
||||||
if (!snr) {
|
if (!snr) {
|
||||||
xsnr=GLOBAL_Alloc(GMEM_ZEROINIT,2*sizeof(*snr),0,WINE_LDT_FLAGS_CODE|WINE_LDT_FLAGS_32BIT);
|
xsnr=GLOBAL_Alloc(GMEM_ZEROINIT,2*sizeof(*snr),0,WINE_LDT_FLAGS_CODE|WINE_LDT_FLAGS_32BIT);
|
||||||
snr = GlobalLock16(xsnr);
|
snr = GlobalLock16(xsnr);
|
||||||
@ -128,10 +131,15 @@ SNOOP16_RegisterDLL(NE_MODULE *pModule,LPCSTR name) {
|
|||||||
}
|
}
|
||||||
while (*dll) {
|
while (*dll) {
|
||||||
if ((*dll)->hmod == pModule->self)
|
if ((*dll)->hmod == pModule->self)
|
||||||
return; /* already registered */
|
{
|
||||||
|
/* another dll, loaded at the same address */
|
||||||
|
GlobalUnlock16((*dll)->funhandle);
|
||||||
|
GlobalFree16((*dll)->funhandle);
|
||||||
|
break;
|
||||||
|
}
|
||||||
dll = &((*dll)->next);
|
dll = &((*dll)->next);
|
||||||
}
|
}
|
||||||
*dll = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(SNOOP16_DLL)+strlen(name));
|
*dll = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, *dll, sizeof(SNOOP16_DLL)+strlen(name));
|
||||||
(*dll)->next = NULL;
|
(*dll)->next = NULL;
|
||||||
(*dll)->hmod = pModule->self;
|
(*dll)->hmod = pModule->self;
|
||||||
if ((s=strrchr(name,'\\')))
|
if ((s=strrchr(name,'\\')))
|
||||||
@ -340,4 +348,3 @@ FARPROC16 SNOOP16_GetProcAddress16(HMODULE16 hmod,DWORD ordinal,FARPROC16 origfu
|
|||||||
return origfun;
|
return origfun;
|
||||||
}
|
}
|
||||||
#endif /* !__i386__ */
|
#endif /* !__i386__ */
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user