Move some fields (refCount, tls_index and module) from WINE_MODREF to
LDR_MODULE.
This commit is contained in:
parent
255b6141f2
commit
f94c8b85b9
|
@ -71,7 +71,7 @@ static WINE_MODREF *MODULE32_LookupHMODULE( HMODULE hmod )
|
|||
return NULL;
|
||||
}
|
||||
for ( wm = MODULE_modref_list; wm; wm=wm->next )
|
||||
if (wm->module == hmod)
|
||||
if (wm->ldr.BaseAddress == hmod)
|
||||
return wm;
|
||||
return NULL;
|
||||
}
|
||||
|
@ -93,8 +93,8 @@ WINE_MODREF *MODULE_AllocModRef( HMODULE hModule, LPCSTR filename )
|
|||
if ((wm = RtlAllocateHeap( ntdll_get_process_heap(), HEAP_ZERO_MEMORY,
|
||||
sizeof(*wm) + long_len + short_len + 1 )))
|
||||
{
|
||||
wm->module = hModule;
|
||||
wm->tlsindex = -1;
|
||||
wm->ldr.BaseAddress = hModule;
|
||||
wm->ldr.TlsIndex = -1;
|
||||
|
||||
wm->filename = wm->data;
|
||||
memcpy( wm->filename, filename, long_len + 1 );
|
||||
|
@ -154,7 +154,7 @@ static BOOL MODULE_InitDLL( WINE_MODREF *wm, DWORD type, LPVOID lpReserved )
|
|||
TRACE("(%s,%s,%p) - CALL\n", wm->modname, typeName[type], lpReserved );
|
||||
|
||||
/* Call the initialization routine */
|
||||
retv = PE_InitDLL( wm->module, type, lpReserved );
|
||||
retv = PE_InitDLL( wm->ldr.BaseAddress, type, lpReserved );
|
||||
|
||||
/* The state of the module list may have changed due to the call
|
||||
to PE_InitDLL. We cannot assume that this module has not been
|
||||
|
@ -272,7 +272,7 @@ void MODULE_DllProcessDetach( BOOL bForceDetach, LPVOID lpReserved )
|
|||
/* Check whether to detach this DLL */
|
||||
if ( !(wm->flags & WINE_MODREF_PROCESS_ATTACHED) )
|
||||
continue;
|
||||
if ( wm->refCount > 0 && !bForceDetach )
|
||||
if ( wm->ldr.LoadCount > 0 && !bForceDetach )
|
||||
continue;
|
||||
|
||||
/* Call detach notification */
|
||||
|
@ -357,8 +357,8 @@ NTSTATUS WINAPI LdrFindEntryForAddress(const void* addr, PLDR_MODULE* mod)
|
|||
|
||||
for ( wm = MODULE_modref_list; wm; wm = wm->next )
|
||||
{
|
||||
if ((const void *)wm->module <= addr &&
|
||||
(char *)addr < (char*)wm->module + wm->ldr.SizeOfImage)
|
||||
if ((const void *)wm->ldr.BaseAddress <= addr &&
|
||||
(char *)addr < (char*)wm->ldr.BaseAddress + wm->ldr.SizeOfImage)
|
||||
{
|
||||
*mod = &wm->ldr;
|
||||
return STATUS_SUCCESS;
|
||||
|
@ -471,7 +471,7 @@ NTSTATUS WINAPI LdrGetDllHandle(ULONG x, ULONG y, PUNICODE_STRING name, HMODULE
|
|||
return STATUS_DLL_NOT_FOUND;
|
||||
}
|
||||
|
||||
*base = wm->module;
|
||||
*base = wm->ldr.BaseAddress;
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
|
@ -632,7 +632,7 @@ NTSTATUS MODULE_LoadLibraryExA( LPCSTR libname, DWORD flags, WINE_MODREF** pwm)
|
|||
}
|
||||
if (*pwm)
|
||||
{
|
||||
(*pwm)->refCount++;
|
||||
(*pwm)->ldr.LoadCount++;
|
||||
|
||||
if (((*pwm)->flags & WINE_MODREF_DONT_RESOLVE_REFS) &&
|
||||
!(flags & DONT_RESOLVE_DLL_REFERENCES))
|
||||
|
@ -640,7 +640,7 @@ NTSTATUS MODULE_LoadLibraryExA( LPCSTR libname, DWORD flags, WINE_MODREF** pwm)
|
|||
(*pwm)->flags &= ~WINE_MODREF_DONT_RESOLVE_REFS;
|
||||
PE_fixup_imports( *pwm );
|
||||
}
|
||||
TRACE("Already loaded module '%s' at %p, count=%d\n", filename, (*pwm)->module, (*pwm)->refCount);
|
||||
TRACE("Already loaded module '%s' at %p, count=%d\n", filename, (*pwm)->ldr.BaseAddress, (*pwm)->ldr.LoadCount);
|
||||
if (allocated_libdir)
|
||||
{
|
||||
RtlFreeHeap( ntdll_get_process_heap(), 0, (LPSTR)libdir );
|
||||
|
@ -679,12 +679,12 @@ NTSTATUS MODULE_LoadLibraryExA( LPCSTR libname, DWORD flags, WINE_MODREF** pwm)
|
|||
if (nts == STATUS_SUCCESS)
|
||||
{
|
||||
/* Initialize DLL just loaded */
|
||||
TRACE("Loaded module '%s' at %p\n", filename, (*pwm)->module);
|
||||
TRACE("Loaded module '%s' at %p\n", filename, (*pwm)->ldr.BaseAddress);
|
||||
if (!TRACE_ON(module))
|
||||
TRACE_(loaddll)("Loaded module '%s' : %s\n", filename, filetype);
|
||||
/* Set the refCount here so that an attach failure will */
|
||||
/* Set the ldr.LoadCount here so that an attach failure will */
|
||||
/* decrement the dependencies through the MODULE_FreeLibrary call. */
|
||||
(*pwm)->refCount = 1;
|
||||
(*pwm)->ldr.LoadCount = 1;
|
||||
|
||||
if (allocated_libdir)
|
||||
{
|
||||
|
@ -735,7 +735,7 @@ NTSTATUS WINAPI LdrLoadDll(LPCWSTR path_name, DWORD flags, PUNICODE_STRING libna
|
|||
if ( !MODULE_DllProcessAttach( wm, NULL ) )
|
||||
{
|
||||
WARN_(module)("Attach failed for module '%s'.\n", str.Buffer);
|
||||
LdrUnloadDll(wm->module);
|
||||
LdrUnloadDll(wm->ldr.BaseAddress);
|
||||
nts = STATUS_DLL_INIT_FAILED;
|
||||
wm = NULL;
|
||||
}
|
||||
|
@ -747,7 +747,7 @@ NTSTATUS WINAPI LdrLoadDll(LPCWSTR path_name, DWORD flags, PUNICODE_STRING libna
|
|||
break;
|
||||
}
|
||||
|
||||
*hModule = (wm) ? wm->module : NULL;
|
||||
*hModule = (wm) ? wm->ldr.BaseAddress : NULL;
|
||||
|
||||
RtlLeaveCriticalSection( &loader_section );
|
||||
|
||||
|
@ -812,7 +812,7 @@ static void MODULE_FlushModrefs(void)
|
|||
{
|
||||
next = wm->next;
|
||||
|
||||
if (wm->refCount)
|
||||
if (wm->ldr.LoadCount)
|
||||
continue;
|
||||
|
||||
/* Unlink this modref from the chain */
|
||||
|
@ -830,13 +830,13 @@ static void MODULE_FlushModrefs(void)
|
|||
|
||||
SERVER_START_REQ( unload_dll )
|
||||
{
|
||||
req->base = (void *)wm->module;
|
||||
req->base = wm->ldr.BaseAddress;
|
||||
wine_server_call( req );
|
||||
}
|
||||
SERVER_END_REQ;
|
||||
|
||||
if (wm->dlhandle) wine_dll_unload( wm->dlhandle );
|
||||
else UnmapViewOfFile( (LPVOID)wm->module );
|
||||
else NtUnmapViewOfSection( GetCurrentProcess(), wm->ldr.BaseAddress );
|
||||
FreeLibrary16( wm->hDummyMod );
|
||||
RtlFreeHeap( ntdll_get_process_heap(), 0, wm->deps );
|
||||
RtlFreeHeap( ntdll_get_process_heap(), 0, wm );
|
||||
|
@ -855,13 +855,13 @@ static void MODULE_DecRefCount( WINE_MODREF *wm )
|
|||
if ( wm->flags & WINE_MODREF_MARKER )
|
||||
return;
|
||||
|
||||
if ( wm->refCount <= 0 )
|
||||
if ( wm->ldr.LoadCount <= 0 )
|
||||
return;
|
||||
|
||||
--wm->refCount;
|
||||
TRACE("(%s) refCount: %d\n", wm->modname, wm->refCount );
|
||||
--wm->ldr.LoadCount;
|
||||
TRACE("(%s) ldr.LoadCount: %d\n", wm->modname, wm->ldr.LoadCount );
|
||||
|
||||
if ( wm->refCount == 0 )
|
||||
if ( wm->ldr.LoadCount == 0 )
|
||||
{
|
||||
wm->flags |= WINE_MODREF_MARKER;
|
||||
|
||||
|
|
|
@ -130,10 +130,8 @@ typedef struct _wine_modref
|
|||
{
|
||||
struct _wine_modref *next;
|
||||
struct _wine_modref *prev;
|
||||
HMODULE module;
|
||||
HMODULE16 hDummyMod; /* Win16 dummy module */
|
||||
void *dlhandle; /* handle returned by dlopen() */
|
||||
int tlsindex; /* TLS index or -1 if none */
|
||||
LDR_MODULE ldr;
|
||||
FARPROC (*find_export)( struct _wine_modref *wm, LPCSTR func,
|
||||
int hint, BOOL snoop );
|
||||
|
@ -142,7 +140,6 @@ typedef struct _wine_modref
|
|||
struct _wine_modref **deps;
|
||||
|
||||
int flags;
|
||||
int refCount;
|
||||
|
||||
char *filename;
|
||||
char *modname;
|
||||
|
|
|
@ -126,18 +126,18 @@ static FARPROC PE_FindExportedFunction(
|
|||
IMAGE_EXPORT_DIRECTORY *exports;
|
||||
DWORD exp_size;
|
||||
|
||||
if (!(exports = RtlImageDirectoryEntryToData( wm->module, TRUE,
|
||||
if (!(exports = RtlImageDirectoryEntryToData( wm->ldr.BaseAddress, TRUE,
|
||||
IMAGE_DIRECTORY_ENTRY_EXPORT, &exp_size )))
|
||||
return NULL;
|
||||
|
||||
if (HIWORD(funcName)) TRACE("(%s)\n",funcName);
|
||||
else TRACE("(%d)\n",LOWORD(funcName));
|
||||
|
||||
ordinals= get_rva(wm->module, exports->AddressOfNameOrdinals);
|
||||
function= get_rva(wm->module, exports->AddressOfFunctions);
|
||||
name = get_rva(wm->module, exports->AddressOfNames);
|
||||
ordinals= get_rva(wm->ldr.BaseAddress, exports->AddressOfNameOrdinals);
|
||||
function= get_rva(wm->ldr.BaseAddress, exports->AddressOfFunctions);
|
||||
name = get_rva(wm->ldr.BaseAddress, exports->AddressOfNames);
|
||||
forward = NULL;
|
||||
rva_start = (char *)exports - (char *)wm->module;
|
||||
rva_start = (char *)exports - (char *)wm->ldr.BaseAddress;
|
||||
|
||||
if (HIWORD(funcName))
|
||||
{
|
||||
|
@ -146,7 +146,7 @@ static FARPROC PE_FindExportedFunction(
|
|||
/* first check the hint */
|
||||
if (hint >= 0 && hint <= max)
|
||||
{
|
||||
ename = get_rva(wm->module, name[hint]);
|
||||
ename = get_rva(wm->ldr.BaseAddress, name[hint]);
|
||||
if (!strcmp( ename, funcName ))
|
||||
{
|
||||
ordinal = ordinals[hint];
|
||||
|
@ -158,7 +158,7 @@ static FARPROC PE_FindExportedFunction(
|
|||
while (min <= max)
|
||||
{
|
||||
int res, pos = (min + max) / 2;
|
||||
ename = get_rva(wm->module, name[pos]);
|
||||
ename = get_rva(wm->ldr.BaseAddress, name[pos]);
|
||||
if (!(res = strcmp( ename, funcName )))
|
||||
{
|
||||
ordinal = ordinals[pos];
|
||||
|
@ -177,7 +177,7 @@ static FARPROC PE_FindExportedFunction(
|
|||
for (i = 0; i < exports->NumberOfNames; i++)
|
||||
if (ordinals[i] == ordinal)
|
||||
{
|
||||
ename = get_rva(wm->module, name[i]);
|
||||
ename = get_rva(wm->ldr.BaseAddress, name[i]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -192,13 +192,13 @@ static FARPROC PE_FindExportedFunction(
|
|||
addr = function[ordinal];
|
||||
if (!addr) return NULL;
|
||||
|
||||
proc = get_rva(wm->module, addr);
|
||||
proc = get_rva(wm->ldr.BaseAddress, addr);
|
||||
if (((char *)proc < (char *)exports) || ((char *)proc >= (char *)exports + exp_size))
|
||||
{
|
||||
if (snoop)
|
||||
{
|
||||
if (!ename) ename = "@";
|
||||
proc = SNOOP_GetProcAddress(wm->module,ename,ordinal,proc);
|
||||
proc = SNOOP_GetProcAddress(wm->ldr.BaseAddress,ename,ordinal,proc);
|
||||
}
|
||||
return proc;
|
||||
}
|
||||
|
@ -218,7 +218,7 @@ static FARPROC PE_FindExportedFunction(
|
|||
ERR("module not found for forward '%s' used by '%s'\n", forward, wm->modname );
|
||||
return NULL;
|
||||
}
|
||||
if (!(proc = MODULE_GetProcAddress( wm_fw->module, end + 1, -1, snoop )))
|
||||
if (!(proc = MODULE_GetProcAddress( wm_fw->ldr.BaseAddress, end + 1, -1, snoop )))
|
||||
ERR("function not found for forward '%s' used by '%s'. If you are using builtin '%s', try using the native one instead.\n", forward, wm->modname, wm->modname );
|
||||
return proc;
|
||||
}
|
||||
|
@ -233,7 +233,7 @@ DWORD PE_fixup_imports( WINE_MODREF *wm )
|
|||
IMAGE_IMPORT_DESCRIPTOR *imports, *pe_imp;
|
||||
DWORD size;
|
||||
|
||||
imports = RtlImageDirectoryEntryToData( wm->module, TRUE, IMAGE_DIRECTORY_ENTRY_IMPORT, &size );
|
||||
imports = RtlImageDirectoryEntryToData( wm->ldr.BaseAddress, TRUE, IMAGE_DIRECTORY_ENTRY_IMPORT, &size );
|
||||
|
||||
/* first, count the number of imported non-internal modules */
|
||||
pe_imp = imports;
|
||||
|
@ -267,7 +267,7 @@ DWORD PE_fixup_imports( WINE_MODREF *wm )
|
|||
WINE_MODREF *wmImp;
|
||||
IMAGE_IMPORT_BY_NAME *pe_name;
|
||||
PIMAGE_THUNK_DATA import_list,thunk_list;
|
||||
char *name = get_rva(wm->module, pe_imp->Name);
|
||||
char *name = get_rva(wm->ldr.BaseAddress, pe_imp->Name);
|
||||
NTSTATUS nts;
|
||||
|
||||
if (characteristics_detection && !pe_imp->u.Characteristics)
|
||||
|
@ -292,8 +292,8 @@ DWORD PE_fixup_imports( WINE_MODREF *wm )
|
|||
|
||||
if (pe_imp->u.OriginalFirstThunk != 0) { /* original MS style */
|
||||
TRACE("Microsoft style imports used\n");
|
||||
import_list = get_rva(wm->module, (DWORD)pe_imp->u.OriginalFirstThunk);
|
||||
thunk_list = get_rva(wm->module, (DWORD)pe_imp->FirstThunk);
|
||||
import_list = get_rva(wm->ldr.BaseAddress, (DWORD)pe_imp->u.OriginalFirstThunk);
|
||||
thunk_list = get_rva(wm->ldr.BaseAddress, (DWORD)pe_imp->FirstThunk);
|
||||
|
||||
while (import_list->u1.Ordinal) {
|
||||
if (IMAGE_SNAP_BY_ORDINAL(import_list->u1.Ordinal)) {
|
||||
|
@ -301,7 +301,7 @@ DWORD PE_fixup_imports( WINE_MODREF *wm )
|
|||
|
||||
TRACE("--- Ordinal %s,%d\n", name, ordinal);
|
||||
thunk_list->u1.Function=(PDWORD)MODULE_GetProcAddress(
|
||||
wmImp->module, (LPCSTR)ordinal, -1, TRUE
|
||||
wmImp->ldr.BaseAddress, (LPCSTR)ordinal, -1, TRUE
|
||||
);
|
||||
if (!thunk_list->u1.Function) {
|
||||
ERR("No implementation for %s.%d imported from %s, setting to 0xdeadbeef\n",
|
||||
|
@ -309,10 +309,10 @@ DWORD PE_fixup_imports( WINE_MODREF *wm )
|
|||
thunk_list->u1.Function = (PDWORD)0xdeadbeef;
|
||||
}
|
||||
} else { /* import by name */
|
||||
pe_name = get_rva(wm->module, (DWORD)import_list->u1.AddressOfData);
|
||||
pe_name = get_rva(wm->ldr.BaseAddress, (DWORD)import_list->u1.AddressOfData);
|
||||
TRACE("--- %s %s.%d\n", pe_name->Name, name, pe_name->Hint);
|
||||
thunk_list->u1.Function=(PDWORD)MODULE_GetProcAddress(
|
||||
wmImp->module, pe_name->Name, pe_name->Hint, TRUE
|
||||
wmImp->ldr.BaseAddress, pe_name->Name, pe_name->Hint, TRUE
|
||||
);
|
||||
if (!thunk_list->u1.Function) {
|
||||
ERR("No implementation for %s.%d(%s) imported from %s, setting to 0xdeadbeef\n",
|
||||
|
@ -325,7 +325,7 @@ DWORD PE_fixup_imports( WINE_MODREF *wm )
|
|||
}
|
||||
} else { /* Borland style */
|
||||
TRACE("Borland style imports used\n");
|
||||
thunk_list = get_rva(wm->module, (DWORD)pe_imp->FirstThunk);
|
||||
thunk_list = get_rva(wm->ldr.BaseAddress, (DWORD)pe_imp->FirstThunk);
|
||||
while (thunk_list->u1.Ordinal) {
|
||||
if (IMAGE_SNAP_BY_ORDINAL(thunk_list->u1.Ordinal)) {
|
||||
/* not sure about this branch, but it seems to work */
|
||||
|
@ -333,7 +333,7 @@ DWORD PE_fixup_imports( WINE_MODREF *wm )
|
|||
|
||||
TRACE("--- Ordinal %s.%d\n",name,ordinal);
|
||||
thunk_list->u1.Function=(PDWORD)MODULE_GetProcAddress(
|
||||
wmImp->module, (LPCSTR) ordinal, -1, TRUE
|
||||
wmImp->ldr.BaseAddress, (LPCSTR) ordinal, -1, TRUE
|
||||
);
|
||||
if (!thunk_list->u1.Function) {
|
||||
ERR("No implementation for %s.%d imported from %s, setting to 0xdeadbeef\n",
|
||||
|
@ -341,11 +341,11 @@ DWORD PE_fixup_imports( WINE_MODREF *wm )
|
|||
thunk_list->u1.Function = (PDWORD)0xdeadbeef;
|
||||
}
|
||||
} else {
|
||||
pe_name=get_rva(wm->module, (DWORD)thunk_list->u1.AddressOfData);
|
||||
pe_name=get_rva(wm->ldr.BaseAddress, (DWORD)thunk_list->u1.AddressOfData);
|
||||
TRACE("--- %s %s.%d\n",
|
||||
pe_name->Name,name,pe_name->Hint);
|
||||
thunk_list->u1.Function=(PDWORD)MODULE_GetProcAddress(
|
||||
wmImp->module, pe_name->Name, pe_name->Hint, TRUE
|
||||
wmImp->ldr.BaseAddress, pe_name->Name, pe_name->Hint, TRUE
|
||||
);
|
||||
if (!thunk_list->u1.Function) {
|
||||
ERR("No implementation for %s.%d(%s) imported from %s, setting to 0xdeadbeef\n",
|
||||
|
@ -672,19 +672,19 @@ void PE_InitTls( void )
|
|||
int delta;
|
||||
|
||||
for (wm = MODULE_modref_list;wm;wm=wm->next) {
|
||||
peh = RtlImageNtHeader(wm->module);
|
||||
pdir = RtlImageDirectoryEntryToData( wm->module, TRUE,
|
||||
peh = RtlImageNtHeader(wm->ldr.BaseAddress);
|
||||
pdir = RtlImageDirectoryEntryToData( wm->ldr.BaseAddress, TRUE,
|
||||
IMAGE_DIRECTORY_ENTRY_TLS, &dirsize );
|
||||
if (!pdir) continue;
|
||||
delta = (char *)wm->module - (char *)peh->OptionalHeader.ImageBase;
|
||||
delta = (char *)wm->ldr.BaseAddress - (char *)peh->OptionalHeader.ImageBase;
|
||||
|
||||
if ( wm->tlsindex == -1 ) {
|
||||
if ( wm->ldr.TlsIndex == -1 ) {
|
||||
LPDWORD xaddr;
|
||||
wm->tlsindex = TlsAlloc();
|
||||
wm->ldr.TlsIndex = TlsAlloc();
|
||||
xaddr = _fixup_address(&(peh->OptionalHeader),delta,
|
||||
pdir->AddressOfIndex
|
||||
);
|
||||
*xaddr=wm->tlsindex;
|
||||
*xaddr=wm->ldr.TlsIndex;
|
||||
}
|
||||
datasize= pdir->EndAddressOfRawData-pdir->StartAddressOfRawData;
|
||||
size = datasize + pdir->SizeOfZeroFill;
|
||||
|
@ -698,6 +698,6 @@ void PE_InitTls( void )
|
|||
FIXME("TLS Callbacks aren't going to be called\n");
|
||||
}
|
||||
|
||||
TlsSetValue( wm->tlsindex, mem );
|
||||
TlsSetValue( wm->ldr.TlsIndex, mem );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -453,7 +453,7 @@ static DWORD VERSION_GetLinkedDllVersion(void)
|
|||
from one windows version */
|
||||
for ( wm = MODULE_modref_list; wm; wm=wm->next )
|
||||
{
|
||||
nt = RtlImageNtHeader(wm->module);
|
||||
nt = RtlImageNtHeader(wm->ldr.BaseAddress);
|
||||
ophd = &nt->OptionalHeader;
|
||||
|
||||
TRACE("%s: %02x.%02x/%02x.%02x/%02x.%02x/%02x.%02x\n",
|
||||
|
@ -472,7 +472,7 @@ static DWORD VERSION_GetLinkedDllVersion(void)
|
|||
/* test if it is a special dll */
|
||||
if (!strcasecmp(wm->modname, special_dlls[i]))
|
||||
{
|
||||
DWORD DllVersion = VERSION_GetSystemDLLVersion(wm->module);
|
||||
DWORD DllVersion = VERSION_GetSystemDLLVersion(wm->ldr.BaseAddress);
|
||||
if (WinVersion == NB_WINDOWS_VERSIONS)
|
||||
WinVersion = DllVersion;
|
||||
else {
|
||||
|
|
|
@ -134,7 +134,6 @@ static void load_library( void *base, const char *filename )
|
|||
}
|
||||
TRACE( "loaded %s %p %p\n", fullname, wm, module );
|
||||
HeapFree( GetProcessHeap(), 0, fullname );
|
||||
wm->refCount++; /* we don't support freeing builtin dlls (FIXME)*/
|
||||
|
||||
/* setup relay debugging entry points */
|
||||
if (TRACE_ON(relay)) RELAY_SetupDLL( (void *)module );
|
||||
|
|
|
@ -239,7 +239,7 @@ static void get_entry_point( char *buffer, DEBUG_ENTRY_POINT *relay )
|
|||
for (wm = MODULE_modref_list; wm; wm = wm->next)
|
||||
{
|
||||
if (!(wm->flags & WINE_MODREF_INTERNAL)) continue;
|
||||
exp = RtlImageDirectoryEntryToData( wm->module, TRUE, IMAGE_DIRECTORY_ENTRY_EXPORT, &size );
|
||||
exp = RtlImageDirectoryEntryToData( wm->ldr.BaseAddress, TRUE, IMAGE_DIRECTORY_ENTRY_EXPORT, &size );
|
||||
if (!exp) continue;
|
||||
debug = (DEBUG_ENTRY_POINT *)((char *)exp + size);
|
||||
if (debug <= relay && relay < debug + exp->NumberOfFunctions)
|
||||
|
@ -251,7 +251,7 @@ static void get_entry_point( char *buffer, DEBUG_ENTRY_POINT *relay )
|
|||
|
||||
/* Now find the function */
|
||||
|
||||
base = (char *)wm->module;
|
||||
base = (char *)wm->ldr.BaseAddress;
|
||||
strcpy( buffer, base + exp->Name );
|
||||
p = buffer + strlen(buffer);
|
||||
if (p > buffer + 4 && !strcasecmp( p - 4, ".dll" )) p -= 4;
|
||||
|
|
|
@ -535,7 +535,7 @@ static void start_process(void)
|
|||
/* create the main modref and load dependencies */
|
||||
if (!(wm = PE_CreateModule( current_process.module, main_exe_name, 0, 0, FALSE )))
|
||||
goto error;
|
||||
wm->refCount++;
|
||||
wm->ldr.LoadCount++;
|
||||
|
||||
if (main_exe_file) CloseHandle( main_exe_file ); /* we no longer need it */
|
||||
|
||||
|
|
Loading…
Reference in New Issue