Initialize relay debugging earlier on now that the registry is loaded

by the server.
This commit is contained in:
Alexandre Julliard 2005-07-13 14:23:06 +00:00
parent 4391be583e
commit d3a6a16efd
3 changed files with 13 additions and 20 deletions

View File

@ -1971,21 +1971,6 @@ void WINAPI LdrInitializeThunk( HANDLE main_file, ULONG unknown2, ULONG unknown3
if (main_file) NtClose( main_file ); /* we no longer need it */ if (main_file) NtClose( main_file ); /* we no longer need it */
if (TRACE_ON(relay) || TRACE_ON(snoop))
{
RELAY_InitDebugLists();
if (TRACE_ON(relay)) /* setup relay for already loaded dlls */
{
LIST_ENTRY *entry, *mark = &peb->LdrData->InLoadOrderModuleList;
for (entry = mark->Flink; entry != mark; entry = entry->Flink)
{
LDR_MODULE *mod = CONTAINING_RECORD(entry, LDR_MODULE, InLoadOrderModuleList);
if (mod->Flags & LDR_WINE_INTERNAL) RELAY_SetupDLL( mod->BaseAddress );
}
}
}
RtlEnterCriticalSection( &loader_section ); RtlEnterCriticalSection( &loader_section );
load_path = NtCurrentTeb()->Peb->ProcessParameters->DllPath.Buffer; load_path = NtCurrentTeb()->Peb->ProcessParameters->DllPath.Buffer;

View File

@ -59,7 +59,6 @@ extern void DECLSPEC_NORETURN server_protocol_perror( const char *err );
extern void DECLSPEC_NORETURN server_abort_thread( int status ); extern void DECLSPEC_NORETURN server_abort_thread( int status );
/* module handling */ /* module handling */
extern void RELAY_InitDebugLists(void);
extern FARPROC RELAY_GetProcAddress( HMODULE module, const IMAGE_EXPORT_DIRECTORY *exports, extern FARPROC RELAY_GetProcAddress( HMODULE module, const IMAGE_EXPORT_DIRECTORY *exports,
DWORD exp_size, FARPROC proc, const WCHAR *user ); DWORD exp_size, FARPROC proc, const WCHAR *user );
extern FARPROC SNOOP_GetProcAddress( HMODULE hmod, const IMAGE_EXPORT_DIRECTORY *exports, DWORD exp_size, extern FARPROC SNOOP_GetProcAddress( HMODULE hmod, const IMAGE_EXPORT_DIRECTORY *exports, DWORD exp_size,

View File

@ -39,6 +39,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(relay);
WINE_DECLARE_DEBUG_CHANNEL(snoop); WINE_DECLARE_DEBUG_CHANNEL(snoop);
WINE_DECLARE_DEBUG_CHANNEL(seh); WINE_DECLARE_DEBUG_CHANNEL(seh);
#ifdef __i386__
static const WCHAR **debug_relay_excludelist; static const WCHAR **debug_relay_excludelist;
static const WCHAR **debug_relay_includelist; static const WCHAR **debug_relay_includelist;
static const WCHAR **debug_snoop_excludelist; static const WCHAR **debug_snoop_excludelist;
@ -48,6 +50,8 @@ static const WCHAR **debug_from_relay_includelist;
static const WCHAR **debug_from_snoop_excludelist; static const WCHAR **debug_from_snoop_excludelist;
static const WCHAR **debug_from_snoop_includelist; static const WCHAR **debug_from_snoop_includelist;
static BOOL init_done;
/* compare an ASCII and a Unicode string without depending on the current codepage */ /* compare an ASCII and a Unicode string without depending on the current codepage */
inline static int strcmpAW( const char *strA, const WCHAR *strW ) inline static int strcmpAW( const char *strA, const WCHAR *strW )
{ {
@ -102,11 +106,11 @@ static const WCHAR **build_list( const WCHAR *buffer )
/*********************************************************************** /***********************************************************************
* RELAY_InitDebugLists * init_debug_lists
* *
* Build the relay include/exclude function lists. * Build the relay include/exclude function lists.
*/ */
void RELAY_InitDebugLists(void) static void init_debug_lists(void)
{ {
OBJECT_ATTRIBUTES attr; OBJECT_ATTRIBUTES attr;
UNICODE_STRING name; UNICODE_STRING name;
@ -126,6 +130,9 @@ void RELAY_InitDebugLists(void)
static const WCHAR SnoopFromIncludeW[] = {'S','n','o','o','p','F','r','o','m','I','n','c','l','u','d','e',0}; static const WCHAR SnoopFromIncludeW[] = {'S','n','o','o','p','F','r','o','m','I','n','c','l','u','d','e',0};
static const WCHAR SnoopFromExcludeW[] = {'S','n','o','o','p','F','r','o','m','E','x','c','l','u','d','e',0}; static const WCHAR SnoopFromExcludeW[] = {'S','n','o','o','p','F','r','o','m','E','x','c','l','u','d','e',0};
if (init_done) return;
init_done = TRUE;
RtlOpenCurrentUser( KEY_ALL_ACCESS, &root ); RtlOpenCurrentUser( KEY_ALL_ACCESS, &root );
attr.Length = sizeof(attr); attr.Length = sizeof(attr);
attr.RootDirectory = root; attr.RootDirectory = root;
@ -201,8 +208,6 @@ void RELAY_InitDebugLists(void)
} }
#ifdef __i386__
#include "pshpack1.h" #include "pshpack1.h"
typedef struct typedef struct
@ -768,6 +773,8 @@ void RELAY_SetupDLL( HMODULE module )
char *p, dllname[80]; char *p, dllname[80];
DWORD size; DWORD size;
if (!init_done) init_debug_lists();
exports = RtlImageDirectoryEntryToData( module, TRUE, IMAGE_DIRECTORY_ENTRY_EXPORT, &size ); exports = RtlImageDirectoryEntryToData( module, TRUE, IMAGE_DIRECTORY_ENTRY_EXPORT, &size );
if (!exports) return; if (!exports) return;
debug = (DEBUG_ENTRY_POINT *)((char *)exports + size); debug = (DEBUG_ENTRY_POINT *)((char *)exports + size);
@ -833,6 +840,8 @@ void SNOOP_SetupDLL(HMODULE hmod)
SIZE_T size; SIZE_T size;
IMAGE_EXPORT_DIRECTORY *exports; IMAGE_EXPORT_DIRECTORY *exports;
if (!init_done) init_debug_lists();
exports = RtlImageDirectoryEntryToData( hmod, TRUE, IMAGE_DIRECTORY_ENTRY_EXPORT, &size ); exports = RtlImageDirectoryEntryToData( hmod, TRUE, IMAGE_DIRECTORY_ENTRY_EXPORT, &size );
if (!exports) return; if (!exports) return;
name = (char *)hmod + exports->Name; name = (char *)hmod + exports->Name;