Index: include/wine/debug.h
===================================================================
--- include/wine/debug.h	(revision 23064)
+++ include/wine/debug.h	(working copy)
@@ -34,6 +34,46 @@
 struct _GUID;
 
 /*
+ * Happy-go-lucky functions to help me do initial debugging
+ * by printing only the calls that my program does, not the
+ * stuff that Wine does internally...
+ */
+
+static DWORD threads_in_function_blah[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
+
+static inline BOOL in_function_blah(DWORD tid) {
+	int i;
+	for (i = 0; i < 10; i++) if (threads_in_function_blah[i] == tid) return TRUE;
+	return FALSE;
+}
+
+static inline void set_in_function_blah(DWORD tid) {
+	int i;
+	for (i = 0; i < 10; i++) if (threads_in_function_blah[i] == 0) threads_in_function_blah[i] = tid;
+}
+
+static inline void no_longer_in_function_blah(DWORD tid) {
+	int i;
+	for (i = 0; i < 10; i++) if (threads_in_function_blah[i] == tid) threads_in_function_blah[i] = 0;
+}
+
+static inline BOOL wine_should_I_print_Call_msg( BOOL *am_ze_outer_function, DWORD tid ) {
+	if (! in_function_blah(tid)) {
+		set_in_function_blah(tid);
+		*am_ze_outer_function = TRUE;
+		return TRUE;
+	} else return FALSE;
+}
+
+static inline BOOL wine_should_I_print_Ret_msg( BOOL *am_ze_outer_function, DWORD tid ) {
+	if (*am_ze_outer_function) {
+		no_longer_in_function_blah(tid);
+		return TRUE;
+	} else return FALSE;
+}
+
+
+/*
  * Internal definitions (do not use these directly)
  */
 
Index: dlls/ntdll/relay.c
===================================================================
--- dlls/ntdll/relay.c	(revision 23064)
+++ dlls/ntdll/relay.c	(working copy)
@@ -476,6 +476,7 @@
 {
     LONGLONG ret;
     char buffer[80];
+    BOOL ich_bin_ze_outer_function = FALSE;
 
     int *args = &ret_addr + 1;
     /* Relay addr is the return address for this function */
@@ -485,17 +486,20 @@
 
     if (TRACE_ON(relay))
     {
+	if (wine_should_I_print_Call_msg(&ich_bin_ze_outer_function, GetCurrentThreadId())) {
         get_entry_point( buffer, relay );
 
         DPRINTF( "%04lx:Call %s(", GetCurrentThreadId(), buffer );
         RELAY_PrintArgs( args, nb_args, relay->argtypes );
         DPRINTF( ") ret=%08x\n", ret_addr );
+	}
     }
 
     ret = call_entry_point( relay->orig, nb_args, args );
 
     if (TRACE_ON(relay))
     {
+	if (wine_should_I_print_Ret_msg(&ich_bin_ze_outer_function, GetCurrentThreadId())) {
         BOOL ret64 = (relay->argtypes & 0x80000000) && (nb_args < 16);
         if (ret64)
             DPRINTF( "%04lx:Ret  %s() retval=%08x%08x ret=%08x\n",
@@ -505,6 +509,7 @@
             DPRINTF( "%04lx:Ret  %s() retval=%08x ret=%08x\n",
                      GetCurrentThreadId(),
                      buffer, (UINT)ret, ret_addr );
+	}
     }
     return ret;
 }
@@ -533,6 +538,7 @@
     BYTE *relay_addr = *((BYTE **)context->Esp - 1);
     DEBUG_ENTRY_POINT *relay = (DEBUG_ENTRY_POINT *)(relay_addr - 5);
     WORD nb_args = relay->args / sizeof(int);
+    BOOL ich_bin_ze_outer_function = FALSE;
 
     /* remove extra stuff from the stack */
     context->Eip = *(DWORD *)context->Esp;
@@ -547,6 +553,7 @@
 
     if (TRACE_ON(relay))
     {
+	if (wine_should_I_print_Call_msg(&ich_bin_ze_outer_function, GetCurrentThreadId())) {
         get_entry_point( buffer, relay );
 
         DPRINTF( "%04lx:Call %s(", GetCurrentThreadId(), buffer );
@@ -559,6 +566,7 @@
         DPRINTF(" ebp=%08lx esp=%08lx ds=%04lx es=%04lx gs=%04lx flags=%08lx\n",
                 context->Ebp, context->Esp, context->SegDs,
                 context->SegEs, context->SegGs, context->EFlags );
+	}
     }
 
     /* Now call the real function */
@@ -570,6 +578,7 @@
 
     if (TRACE_ON(relay))
     {
+	if (wine_should_I_print_Ret_msg(&ich_bin_ze_outer_function, GetCurrentThreadId())) {
         DPRINTF( "%04lx:Ret  %s() retval=%08lx ret=%08lx fs=%04lx\n",
                  GetCurrentThreadId(),
                  buffer, context->Eax, context->Eip, context->SegFs );
@@ -580,6 +589,7 @@
         DPRINTF(" ebp=%08lx esp=%08lx ds=%04lx es=%04lx gs=%04lx flags=%08lx\n",
                 context->Ebp, context->Esp, context->SegDs,
                 context->SegEs, context->SegGs, context->EFlags );
+	}
     }
 }
 
Index: dlls/kernel/wowthunk.c
===================================================================
--- dlls/kernel/wowthunk.c	(revision 23064)
+++ dlls/kernel/wowthunk.c	(working copy)
@@ -558,6 +558,7 @@
      * copy them to the 16-bit stack ...
      */
     char *stack = (char *)CURRENT_STACK16 - cbArgs;
+    BOOL ich_bin_ze_outer_function = FALSE;
 
     memcpy( stack, pArgs, cbArgs );
 
@@ -567,6 +568,7 @@
 
         if (TRACE_ON(relay))
         {
+	if (wine_should_I_print_Call_msg(&ich_bin_ze_outer_function, GetCurrentThreadId())) {
             DWORD count = cbArgs / sizeof(WORD);
             WORD * wstack = (WORD *)stack;
 
@@ -581,6 +583,7 @@
                     (WORD)context->Edx, (WORD)context->Esi, (WORD)context->Edi,
                     (WORD)context->Ebp, (WORD)context->SegEs, (WORD)context->SegFs );
             SYSLEVEL_CheckNotLevel( 2 );
+	}
         }
 
         if (context->EFlags & 0x00020000)  /* v86 mode */
@@ -629,6 +632,8 @@
 
         if (TRACE_ON(relay))
         {
+	if (wine_should_I_print_Ret_msg(&ich_bin_ze_outer_function, GetCurrentThreadId())) {
+
             DPRINTF("%04lx:RetFrom16() ss:sp=%04x:%04x ",
                     GetCurrentThreadId(), SELECTOROF(NtCurrentTeb()->WOW32Reserved),
                     OFFSETOF(NtCurrentTeb()->WOW32Reserved));
@@ -636,6 +641,7 @@
                     (WORD)context->Eax, (WORD)context->Ebx, (WORD)context->Ecx,
                     (WORD)context->Edx, (WORD)context->Ebp, (WORD)context->Esp );
             SYSLEVEL_CheckNotLevel( 2 );
+	}
         }
     }
     else
@@ -644,6 +650,7 @@
 
         if (TRACE_ON(relay))
         {
+	if (wine_should_I_print_Call_msg(&ich_bin_ze_outer_function, GetCurrentThreadId())) {
             DWORD count = cbArgs / sizeof(WORD);
             WORD * wstack = (WORD *)stack;
 
@@ -654,6 +661,7 @@
             DPRINTF(") ss:sp=%04x:%04x\n",
                     SELECTOROF(NtCurrentTeb()->WOW32Reserved), OFFSETOF(NtCurrentTeb()->WOW32Reserved) );
             SYSLEVEL_CheckNotLevel( 2 );
+	}
         }
 
         /* push return address */
@@ -674,10 +682,12 @@
 
         if (TRACE_ON(relay))
         {
+	if (wine_should_I_print_Ret_msg(&ich_bin_ze_outer_function, GetCurrentThreadId())) {
             DPRINTF("%04lx:RetFrom16() ss:sp=%04x:%04x retval=%08lx\n",
                     GetCurrentThreadId(), SELECTOROF(NtCurrentTeb()->WOW32Reserved),
                     OFFSETOF(NtCurrentTeb()->WOW32Reserved), ret);
             SYSLEVEL_CheckNotLevel( 2 );
+}
         }
     }
 #else
Index: dlls/user/winproc.c
===================================================================
--- dlls/user/winproc.c	(revision 23064)
+++ dlls/user/winproc.c	(working copy)
@@ -404,19 +404,24 @@
                                       WPARAM wParam, LPARAM lParam )
 {
     LRESULT retvalue;
+    BOOL ich_bin_ze_outer_function = FALSE;
 
     USER_CheckNotLock();
 
     hwnd = WIN_GetFullHandle( hwnd );
     if (TRACE_ON(relay))
+	if (wine_should_I_print_Call_msg(&ich_bin_ze_outer_function, GetCurrentThreadId())) {
         DPRINTF( "%04lx:Call window proc %p (hwnd=%p,msg=%s,wp=%08x,lp=%08lx)\n",
                  GetCurrentThreadId(), proc, hwnd, SPY_GetMsgName(msg, hwnd), wParam, lParam );
+	}
 
     retvalue = WINPROC_wrapper( proc, hwnd, msg, wParam, lParam );
 
     if (TRACE_ON(relay))
+	if (wine_should_I_print_Ret_msg(&ich_bin_ze_outer_function, GetCurrentThreadId())) {
         DPRINTF( "%04lx:Ret  window proc %p (hwnd=%p,msg=%s,wp=%08x,lp=%08lx) retval=%08lx\n",
                  GetCurrentThreadId(), proc, hwnd, SPY_GetMsgName(msg, hwnd), wParam, lParam, retvalue );
+	}
     return retvalue;
 }
 
Index: tools/wineinstall
===================================================================
--- tools/wineinstall	(revision 23064)
+++ tools/wineinstall	(working copy)
@@ -95,7 +95,7 @@
   then {
     echo "You are running wineinstall as root, this is not advisable. Please rerun as a user."
     echo "Aborting."
-    exit 1
+    #exit 1
   }
   fi
 
