https://bugs.winehq.org/show_bug.cgi?id=41450
brewmanz brewmanz@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Severity|normal |enhancement Version|1.9.20 |1.9.22
--- Comment #3 from brewmanz brewmanz@gmail.com --- here is some code that fixes the problem:
diff --git a/dlls/kernel32/process.c b/dlls/kernel32/process.c index 5b584ac..c1f1301 100644 --- a/dlls/kernel32/process.c +++ b/dlls/kernel32/process.c @@ -65,6 +65,13 @@ WINE_DEFAULT_DEBUG_CHANNEL(process); WINE_DECLARE_DEBUG_CHANNEL(file); WINE_DECLARE_DEBUG_CHANNEL(relay); +WINE_DECLARE_DEBUG_CHANNEL(timestamp); + +static void print_timestamp(void) +{ + ULONG ticks = NtGetTickCount(); + DPRINTF( "%3u.%03u:", ticks / 1000, ticks % 1000 ); +}
#ifdef __APPLE__ extern char **__wine_get_main_environment(void); @@ -1100,9 +1107,11 @@ }
if (TRACE_ON(relay)) + { + if (TRACE_ON(timestamp)) print_timestamp(); DPRINTF( "%04x:Starting process %s (entryproc=%p)\n", GetCurrentThreadId(), debugstr_w(peb->ProcessParameters->ImagePathName.Buffer), entry ); - + } SetLastError( 0 ); /* clear error code */ if (peb->BeingDebugged) DbgBreakPoint(); return call_process_entry( peb, entry ); diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index f1ef7ab..5b2fddd 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -50,6 +50,13 @@ WINE_DECLARE_DEBUG_CHANNEL(loaddll); WINE_DECLARE_DEBUG_CHANNEL(imports); WINE_DECLARE_DEBUG_CHANNEL(pid); +WINE_DECLARE_DEBUG_CHANNEL(timestamp); + +static void print_timestamp(void) +{ + ULONG ticks = NtGetTickCount(); + DPRINTF( "%3u.%03u:", ticks / 1000, ticks % 1000 ); +}
#ifdef _WIN64 #define DEFAULT_SECURITY_COOKIE_64 (((ULONGLONG)0x00002b99 << 32) | 0x2ddfa232) @@ -1046,6 +1053,7 @@ { if (TRACE_ON(relay)) { + if (TRACE_ON(timestamp)) print_timestamp(); if (TRACE_ON(pid)) DPRINTF( "%04x:", GetCurrentProcessId() ); DPRINTF("%04x:Call TLS callback (proc=%p,module=%p,reason=%s,reserved=0)\n", @@ -1059,6 +1067,7 @@ { if (TRACE_ON(relay)) { + if (TRACE_ON(timestamp)) print_timestamp(); if (TRACE_ON(pid)) DPRINTF( "%04x:", GetCurrentProcessId() ); DPRINTF("%04x:exception in TLS callback (proc=%p,module=%p,reason=%s,reserved=0)\n", @@ -1069,6 +1078,7 @@ __ENDTRY if (TRACE_ON(relay)) { + if (TRACE_ON(timestamp)) print_timestamp(); if (TRACE_ON(pid)) DPRINTF( "%04x:", GetCurrentProcessId() ); DPRINTF("%04x:Ret TLS callback (proc=%p,module=%p,reason=%s,reserved=0)\n", @@ -1100,6 +1110,7 @@ size_t len = min( wm->ldr.BaseDllName.Length, sizeof(mod_name)-sizeof(WCHAR) ); memcpy( mod_name, wm->ldr.BaseDllName.Buffer, len ); mod_name[len / sizeof(WCHAR)] = 0; + if (TRACE_ON(timestamp)) print_timestamp(); if (TRACE_ON(pid)) DPRINTF( "%04x:", GetCurrentProcessId() ); DPRINTF("%04x:Call PE DLL (proc=%p,module=%p %s,reason=%s,res=%p)\n", @@ -1117,6 +1128,7 @@ } __EXCEPT_ALL { + if (TRACE_ON(timestamp)) print_timestamp(); if (TRACE_ON(relay)) { if (TRACE_ON(pid)) @@ -1133,6 +1145,7 @@ deleted. */ if (TRACE_ON(relay)) { + if (TRACE_ON(timestamp)) print_timestamp(); if (TRACE_ON(pid)) DPRINTF( "%04x:", GetCurrentProcessId() ); DPRINTF("%04x:Ret PE DLL (proc=%p,module=%p %s,reason=%s,res=%p) retval=%x\n", diff --git a/dlls/ntdll/thread.c b/dlls/ntdll/thread.c index 6127c8f..1b12c9c 100644 --- a/dlls/ntdll/thread.c +++ b/dlls/ntdll/thread.c @@ -47,6 +47,13 @@
WINE_DEFAULT_DEBUG_CHANNEL(thread); WINE_DECLARE_DEBUG_CHANNEL(relay); +WINE_DECLARE_DEBUG_CHANNEL(timestamp); + +static void print_timestamp(void) +{ + ULONG ticks = NtGetTickCount(); + DPRINTF( "%3u.%03u:", ticks / 1000, ticks % 1000 ); +}
struct _KUSER_SHARED_DATA *user_shared_data = NULL;
@@ -448,8 +455,10 @@ MODULE_DllThreadAttach( NULL );
if (TRACE_ON(relay)) + { + if (TRACE_ON(timestamp)) print_timestamp(); DPRINTF( "%04x:Starting thread proc %p (arg=%p)\n", GetCurrentThreadId(), func, arg ); - + } call_thread_entry_point( (LPTHREAD_START_ROUTINE)func, arg ); }
diff --git a/programs/winedevice/device.c b/programs/winedevice/device.c index 44aa1a0..8fd5883 100644 --- a/programs/winedevice/device.c +++ b/programs/winedevice/device.c @@ -40,6 +40,13 @@
WINE_DEFAULT_DEBUG_CHANNEL(winedevice); WINE_DECLARE_DEBUG_CHANNEL(relay); +WINE_DECLARE_DEBUG_CHANNEL(timestamp); + +static void print_timestamp(void) +{ + ULONG ticks = NtGetTickCount(); + DPRINTF( "%3u.%03u:", ticks / 1000, ticks % 1000 ); +}
extern NTSTATUS CDECL wine_ntoskrnl_main_loop( HANDLE stop_event );
@@ -264,9 +271,11 @@ driver_object->DriverInit = (PDRIVER_INITIALIZE)((char *)module + nt->OptionalHeader.AddressOfEntryPoint);
if (WINE_TRACE_ON(relay)) + { + if (TRACE_ON(timestamp)) print_timestamp(); WINE_DPRINTF( "%04x:Call driver init %p (obj=%p,str=%s)\n", GetCurrentThreadId(), driver_object->DriverInit, driver_object, wine_dbgstr_w(keyname->Buffer) ); - + } status = driver_object->DriverInit( driver_object, keyname );
if (WINE_TRACE_ON(relay))