CVS: winex/dlls/dbghelp coff.c, 1.1, 1.2 dbghelp.c, 1.5, 1.6 dbghelp.spec, 1.5, 1.6 dbghelp_private.h, 1.1, 1.2 dwarf.c, 1.1, 1.2 image.c, 1.1, 1.2 Makefile.in, 1.2, 1.3 memory.c, 1.1, 1.2 minidump.c, 1.1, 1.2 module.c, 1.1, 1.2 msc.c, 1.1, 1.2 path.c, 1.1, 1.2 pe_module.c, 1.1, 1.2 source.c, 1.1, 1.2 stack.c, 1.1, 1.2 stubs.h, NONE, 1.1 symbol.c, 1.1, 1.2 type.c, 1.1, 1.2

[email protected] 30 Aug 2007 14:16:45 -0000
Newsgroups gmane.comp.emulators.winex.cvs
Message-ID <[email protected]>
Subject: winex/dlls/dbghelp coff.c,1.1,1.2 dbghelp.c,1.5,1.6 dbghelp.spec,1.5,1.6 dbghelp_private.h,1.1,1.2 dwarf.c,1.1,1.2 image.c,1.1,1.2 Makefile.in,1.2,1.3 memory.c,1.1,1.2 minidump.c,1.1,1.2 module.c,1.1,1.2 msc.c,1.1,1.2 path.c,1.1,1.2 pe_module.c,1.1,1.2 source.c,1.1,1.2 stack.c,1.1,1.2 stubs.h,NONE,1.1 symbol.c,1.1,1.2 type.c,1.1,1.2Update of /var/lib/cvsd/cvsroot/winex/dlls/dbghelp
In directory agravaine:/tmp/cvs-serv18634/dlls/dbghelp

Modified Files:
	coff.c dbghelp.c dbghelp.spec dbghelp_private.h dwarf.c 
	image.c Makefile.in memory.c minidump.c module.c msc.c path.c 
	pe_module.c source.c stack.c symbol.c type.c 
Added Files:
	stubs.h 
Log Message:

Build fixes for dbghelp
- changed Makefile.in and dbghelp.spec to work with our tools
- fixed some warnings (mostly TRACE related)
- changed some headers from 'include/wine' to 'include/wine-lgpl'
- added the 'stubs.h' header temporarily.  This just includes the prototypes for some functions that were previously missing.  I'll clean these up later.


Index: coff.c
===================================================================
RCS file: /var/lib/cvsd/cvsroot/winex/dlls/dbghelp/coff.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- coff.c	30 Aug 2007 14:15:59 -0000	1.1
+++ coff.c	30 Aug 2007 14:16:43 -0000	1.2
@@ -53,7 +53,7 @@
 #include "wine/exception.h"
 #include "wine/debug.h"
 #include "dbghelp_private.h"
-#include "wine/mscvpdb.h"
+#include "wine-lgpl/mscvpdb.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(dbghelp_coff);
 
@@ -221,12 +221,12 @@
                 fn = source_get(msc_dbg->module,
                                 coff_files.files[curr_file_idx].compiland->source);
 
-                TRACE("Duplicating sect from %s: %x %x %x %d %d\n",
+                TRACE("Duplicating sect from %s: %lx %x %x %d %d\n",
                       fn, aux->Section.Length,
                       aux->Section.NumberOfRelocations,
                       aux->Section.NumberOfLinenumbers,
                       aux->Section.Number, aux->Section.Selection);
-                TRACE("More sect %d %s %08x %d %d %d\n",
+                TRACE("More sect %d %s %08lx %d %d %d\n",
                       coff_sym->SectionNumber,
                       coff_get_name(coff_sym, coff_strtab),
                       coff_sym->Value, coff_sym->Type,
@@ -240,7 +240,7 @@
 	    }
             else
 	    {
-                TRACE("New text sect from %s: %x %x %x %d %d\n",
+                TRACE("New text sect from %s: %lx %x %x %d %d\n",
                       source_get(msc_dbg->module, coff_files.files[curr_file_idx].compiland->source),
                       aux->Section.Length,
                       aux->Section.NumberOfRelocations,

Index: dbghelp.c
===================================================================
RCS file: /var/lib/cvsd/cvsroot/winex/dlls/dbghelp/dbghelp.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- dbghelp.c	30 Aug 2007 14:15:59 -0000	1.5
+++ dbghelp.c	30 Aug 2007 14:16:43 -0000	1.6
@@ -27,8 +27,12 @@
 #include "wdbgexts.h"
 #include "winnls.h"
 
+#include "stubs.h"
+
 WINE_DEFAULT_DEBUG_CHANNEL(dbghelp);
 
+
+
 /* TODO
  *  - support for symbols' types is still partly missing
  *      + C++ support
@@ -65,7 +69,7 @@
  */
 
 unsigned   dbghelp_options = SYMOPT_UNDNAME;
-HANDLE     hMsvcrt = NULL;
+HANDLE     hMsvcrt = 0;
 
 /***********************************************************************
  *           DllMain (DEBUGHLP.@)
@@ -266,7 +270,7 @@
 {
     struct process*     pcs;
 
-    TRACE("(%p %s %u)\n", hProcess, debugstr_w(UserSearchPath), fInvadeProcess);
+    TRACE("(hProcess = 0x%08x, userSearchPath = '%s', fInvadeProcess = %s)\n", hProcess, debugstr_w(UserSearchPath), fInvadeProcess ? "TRUE" : "FALSE");
 
     if (process_find_by_handle(hProcess))
         FIXME("what to do ??\n");
@@ -343,6 +347,8 @@
     WCHAR*              sp = NULL;
     BOOL                ret;
 
+    TRACE("initializing the process 0x%08x {userSearchPath = '%s', invadeProcess = %s}\n", hProcess, UserSearchPath ? UserSearchPath : "<NULL>", fInvadeProcess ? "TRUE" : "FALSE");
+
     if (UserSearchPath)
     {
         unsigned len;
@@ -390,6 +396,9 @@
 {
     struct process* pcs;
 
+
+    TRACE("setting current options to 0x%08lx\n", opts);
+
     for (pcs = process_first; pcs; pcs = pcs->next)
     {
         pcs_callback(pcs, CBA_SET_OPTIONS, &opts);
@@ -413,7 +422,7 @@
 BOOL WINAPI SymSetParentWindow(HWND hwnd)
 {
     /* Save hwnd so it can be used as parent window */
-    FIXME("(%p): stub\n", hwnd);
+    FIXME("(%u): stub\n", hwnd);
     return TRUE;
 }
 
@@ -485,7 +494,7 @@
     case CBA_EVENT:
     case CBA_READ_MEMORY:
     default:
-        FIXME("No mapping for action %u\n", action);
+        FIXME("No mapping for action %lu\n", action);
         return FALSE;
     }
     return cb32(hProcess, action, (PVOID)data32, (PVOID)user32);
@@ -496,7 +505,7 @@
  */
 BOOL pcs_callback(const struct process* pcs, ULONG action, void* data)
 {
-    TRACE("%p %u %p\n", pcs, action, data);
+    TRACE("%p %lu %p\n", pcs, action, data);
 
     if (!pcs->reg_cb) return FALSE;
     if (!pcs->reg_is_unicode)
@@ -529,7 +538,7 @@
         case CBA_EVENT:
         case CBA_READ_MEMORY:
         default:
-            FIXME("No mapping for action %u\n", action);
+            FIXME("No mapping for action %lu\n", action);
             return FALSE;
         }
     }
@@ -563,7 +572,7 @@
                                 PVOID UserContext)
 {
     DWORD64 tmp = ((ULONGLONG)(DWORD)CallbackFunction << 32) | (DWORD)UserContext;
-    TRACE("(%p, %p, %p)\n", 
+    TRACE("(%u, %p, %p)\n", 
           hProcess, CallbackFunction, UserContext);
     return sym_register_cb(hProcess, reg_cb64to32, tmp, FALSE);
 }
@@ -575,7 +584,7 @@
                                   PSYMBOL_REGISTERED_CALLBACK64 CallbackFunction,
                                   ULONG64 UserContext)
 {
-    TRACE("(%p, %p, %s)\n", 
+    TRACE("(%u, %p, %s)\n", 
           hProcess, CallbackFunction, wine_dbgstr_longlong(UserContext));
     return sym_register_cb(hProcess, CallbackFunction, UserContext, FALSE);
 }
@@ -587,7 +596,7 @@
                                    PSYMBOL_REGISTERED_CALLBACK64 CallbackFunction,
                                    ULONG64 UserContext)
 {
-    TRACE("(%p, %p, %s)\n", 
+    TRACE("(%u, %p, %s)\n", 
           hProcess, CallbackFunction, wine_dbgstr_longlong(UserContext));
     return sym_register_cb(hProcess, CallbackFunction, UserContext, TRUE);
 }

Index: dbghelp.spec
===================================================================
RCS file: /var/lib/cvsd/cvsroot/winex/dlls/dbghelp/dbghelp.spec,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- dbghelp.spec	30 Aug 2007 14:15:59 -0000	1.5
+++ dbghelp.spec	30 Aug 2007 14:16:43 -0000	1.6
@@ -1,3 +1,13 @@
+name	dbghelp
+type	win32
+init	DllMain
+
+import psapi.dll
+import kernel32.dll
+import ntdll.dll
+
+debug_channels (dbghelp dbghelp_coff dbghelp_dwarf dbghelp_msc dbghelp_stabs dbghelp_symt)
+
 @ stub DbgHelpCreateUserDump
 @ stub DbgHelpCreateUserDumpW
 @ stdcall EnumDirTree(long str str ptr ptr ptr)
@@ -15,11 +25,11 @@
 @ stub FindFileInPath
 @ stub FindFileInSearchPath
 @ stdcall GetTimestampForLoadedLibrary(long)
-@ stdcall ImageDirectoryEntryToData(ptr long long ptr) ntdll.RtlImageDirectoryEntryToData
+@ forward ImageDirectoryEntryToData ntdll.RtlImageDirectoryEntryToData
 @ stub ImageDirectoryEntryToDataEx
-@ stdcall ImageNtHeader(ptr) ntdll.RtlImageNtHeader
-@ stdcall ImageRvaToSection(ptr ptr long) ntdll.RtlImageRvaToSection
-@ stdcall ImageRvaToVa(ptr ptr long ptr) ntdll.RtlImageRvaToVa
+@ forward ImageNtHeader ntdll.RtlImageNtHeader
+@ forward ImageRvaToSection ntdll.RtlImageRvaToSection
+@ forward ImageRvaToVa ntdll.RtlImageRvaToVa
 @ stdcall ImagehlpApiVersion()
 @ stdcall ImagehlpApiVersionEx(ptr)
 @ stdcall MakeSureDirectoryPathExists(str)

Index: dbghelp_private.h
===================================================================
RCS file: /var/lib/cvsd/cvsroot/winex/dlls/dbghelp/dbghelp_private.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- dbghelp_private.h	30 Aug 2007 14:15:59 -0000	1.1
+++ dbghelp_private.h	30 Aug 2007 14:16:43 -0000	1.2
@@ -31,7 +31,7 @@
 #include "winnls.h"
 #include "wine/unicode.h"
 
-#include "cvconst.h"
+#include "wine-lgpl/cvconst.h"
 
 /* #define USE_STATS */
 

Index: dwarf.c
===================================================================
RCS file: /var/lib/cvsd/cvsroot/winex/dlls/dbghelp/dwarf.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- dwarf.c	30 Aug 2007 14:15:59 -0000	1.1
+++ dwarf.c	30 Aug 2007 14:16:43 -0000	1.2
@@ -760,7 +760,7 @@
 
                 if (!ReadProcessMemory(hproc, (void*)addr, &deref, sizeof(deref), NULL))
                 {
-                    WARN("Couldn't read memory at %x\n", addr);
+                    WARN("Couldn't read memory at %lx\n", addr);
                     return loc_err_cant_read;
                 }
                 stack[++stk] = deref;
@@ -815,7 +815,7 @@
         lctx.end_data = xloc.u.block.ptr + xloc.u.block.size;
         lctx.word_size = ctx->word_size;
 
-        err = compute_location(&lctx, loc, NULL, frame);
+        err = compute_location(&lctx, loc, 0, frame);
         if (err < 0)
         {
             loc->kind = loc_error;

Index: image.c
===================================================================
RCS file: /var/lib/cvsd/cvsroot/winex/dlls/dbghelp/image.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- image.c	30 Aug 2007 14:15:59 -0000	1.1
+++ image.c	30 Aug 2007 14:16:43 -0000	1.2
@@ -44,7 +44,7 @@
 PIMAGE_DEBUG_INFORMATION WINAPI MapDebugInformation(HANDLE FileHandle, LPSTR FileName,
                                                     LPSTR SymbolPath, DWORD ImageBase)
 {
-    FIXME("(%p, %s, %s, 0x%08x): stub\n", FileHandle, FileName, SymbolPath, ImageBase);
+    FIXME("(%x, %s, %s, 0x%08lx): stub\n", FileHandle, FileName, SymbolPath, ImageBase);
     SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
     return NULL;
 }

Index: Makefile.in
===================================================================
RCS file: /var/lib/cvsd/cvsroot/winex/dlls/dbghelp/Makefile.in,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- Makefile.in	30 Aug 2007 14:15:59 -0000	1.2
+++ Makefile.in	30 Aug 2007 14:16:43 -0000	1.3
@@ -2,9 +2,11 @@
 TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
-MODULE    = dbghelp.dll
-IMPORTLIB = libdbghelp.$(IMPLIBEXT)
-IMPORTS   = psapi kernel32 ntdll
+MODULE    = dbghelp
+EXTRALIBS = $(LIBUNICODE)
+
+LDDLLFLAGS = @LDDLLFLAGS@
+SYMBOLFILE = $(MODULE).tmp.o
 
 C_SRCS = \
 	coff.c \
@@ -27,4 +29,4 @@
 
 @MAKE_DLL_RULES@
 
-@DEPENDENCIES@  # everything below this line is overwritten by make depend
+### @DEPENDENCIES@  # everything below this line is overwritten by make depend

Index: memory.c
===================================================================
RCS file: /var/lib/cvsd/cvsroot/winex/dlls/dbghelp/memory.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- memory.c	30 Aug 2007 14:15:59 -0000	1.1
+++ memory.c	30 Aug 2007 14:16:43 -0000	1.2
@@ -55,7 +55,7 @@
         FIXME("Unsupported (yet) mode (%x)\n", addr->Mode);
         return 0;
     }
-    FIXME("Failed to linearize address %04x:%08x (mode %x)\n",
+    FIXME("Failed to linearize address %04x:%08lx (mode %x)\n",
           addr->Segment, addr->Offset, addr->Mode);
     return 0;
 }

Index: minidump.c
===================================================================
RCS file: /var/lib/cvsd/cvsroot/winex/dlls/dbghelp/minidump.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- minidump.c	30 Aug 2007 14:15:59 -0000	1.1
+++ minidump.c	30 Aug 2007 14:16:43 -0000	1.2
@@ -23,7 +23,8 @@
 #define NONAMELESSUNION
 #define NONAMELESSSTRUCT
 
-#include "ntstatus.h"
+/*#include "ntstatus.h"*/
+#include "winnt.h"
 #define WIN32_NO_STATUS
 #include "dbghelp_private.h"
 #include "winternl.h"
@@ -32,6 +33,9 @@
 
 WINE_DEFAULT_DEBUG_CHANNEL(dbghelp);
 
+#include "stubs.h"
+
+
 struct dump_memory
 {
     ULONG                               base;
@@ -166,9 +170,9 @@
     mdThd->PriorityClass = dc->spi->ti[thd_idx].dwBasePriority; /* FIXME */
     mdThd->Priority = dc->spi->ti[thd_idx].dwCurrentPriority;
 
-    if ((hThread = OpenThread(THREAD_ALL_ACCESS, FALSE, tid)) == NULL)
+    if ((hThread = OpenThread(THREAD_ALL_ACCESS, FALSE, tid)) == 0)
     {
-        FIXME("Couldn't open thread %u (%u)\n",
+        FIXME("Couldn't open thread %ld (%ld)\n",
               dc->spi->ti[thd_idx].dwThreadID, GetLastError());
         return FALSE;
     }

Index: module.c
===================================================================
RCS file: /var/lib/cvsd/cvsroot/winex/dlls/dbghelp/module.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- module.c	30 Aug 2007 14:15:59 -0000	1.1
+++ module.c	30 Aug 2007 14:16:43 -0000	1.2
@@ -30,6 +30,9 @@
 #include "winternl.h"
 #include "wine/debug.h"
 
+#include "stubs.h"
+
+
 WINE_DEFAULT_DEBUG_CHANNEL(dbghelp);
 
 const WCHAR        S_ElfW[]         = {'<','e','l','f','>','\0'};
@@ -431,6 +434,9 @@
 DWORD WINAPI SymLoadModule(HANDLE hProcess, HANDLE hFile, const char* ImageName,
                            const char* ModuleName, DWORD BaseOfDll, DWORD SizeOfDll)
 {
+    TRACE("(hProcess = 0x%08x, hFile = 0x%08x, ImageName = '%s', ModuleName = '%s', BaseOfDll = 0x%08lx, SizeOfDll = %ld)\n",
+            hProcess, hFile, ImageName, ModuleName, BaseOfDll, SizeOfDll);
+
     return SymLoadModuleEx(hProcess, hFile, ImageName, ModuleName, BaseOfDll,
                            SizeOfDll, NULL, 0);
 }
@@ -446,9 +452,9 @@
     unsigned    len;
     DWORD64     ret;
 
-    TRACE("(%p %p %s %s %s %08x %p %08x)\n",
+    TRACE("(hProcess = 0x%08x, hFile = 0x%08x, ImageName = '%s', ModuleName = '%s', BaseOfDll = 0x%016llx, DllSize = %ld, Data = %p, Flags = 0x%08lx)\n",
           hProcess, hFile, debugstr_a(ImageName), debugstr_a(ModuleName),
-          wine_dbgstr_longlong(BaseOfDll), DllSize, Data, Flags);
+          BaseOfDll, DllSize, Data, Flags);
 
     if (ImageName)
     {
@@ -482,9 +488,10 @@
     struct process*     pcs;
     struct module*	module = NULL;
 
-    TRACE("(%p %p %s %s %s %08x %p %08x)\n",
+    
+    TRACE("(hProcess = 0x%08x, hFile = 0x%08x, ImageName = '%s', ModuleName = '%s', BaseOfDll = 0x%016llx, DllSize = %ld, Data = %p, Flags = 0x%08lx)\n",
           hProcess, hFile, debugstr_w(wImageName), debugstr_w(wModuleName),
-          wine_dbgstr_longlong(BaseOfDll), SizeOfDll, Data, Flags);
+          BaseOfDll, SizeOfDll, Data, Flags);
 
     if (Data)
         FIXME("Unsupported load data parameter %p for %s\n",
@@ -504,7 +511,7 @@
         return TRUE;
     }
     if (Flags & ~(SLMFLAG_VIRTUAL))
-        FIXME("Unsupported Flags %08x for %s\n", Flags, debugstr_w(wImageName));
+        FIXME("Unsupported Flags %08lx for %s\n", Flags, debugstr_w(wImageName));
 
     /* force transparent ELF loading / unloading */
     elf_synchronize_module_list(pcs);
@@ -937,7 +944,7 @@
     struct module*      module;
     IMAGEHLP_MODULEW64  miw64;
 
-    TRACE("%p %s %p\n", hProcess, wine_dbgstr_longlong(dwAddr), ModuleInfo);
+    TRACE("%x %s %p\n", hProcess, wine_dbgstr_longlong(dwAddr), ModuleInfo);
 
     if (!pcs) return FALSE;
     if (ModuleInfo->SizeOfStruct > sizeof(*ModuleInfo)) return FALSE;

Index: msc.c
===================================================================
RCS file: /var/lib/cvsd/cvsroot/winex/dlls/dbghelp/msc.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- msc.c	30 Aug 2007 14:15:59 -0000	1.1
+++ msc.c	30 Aug 2007 14:16:43 -0000	1.2
@@ -1750,7 +1750,7 @@
 
     if (toc->file_size[file_nr] == 0 || toc->file_size[file_nr] == 0xFFFFFFFF)
     {
-        FIXME(">>> requesting NULL stream (%u)\n", file_nr);
+        FIXME(">>> requesting NULL stream (%ld)\n", file_nr);
         return NULL;
     }
     block_list = &toc->file_size[toc->num_files];
@@ -1881,8 +1881,8 @@
 static BOOL CALLBACK pdb_match(const char* file, void* user)
 {
     /* accept first file that exists */
-    HANDLE h = CreateFileA(file, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
-    TRACE("match with %s returns %p\n", file, h);
+    HANDLE h = CreateFileA(file, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
+    TRACE(".PDB match with '%s' returns 0x%08x\n", file, h);
     if (INVALID_HANDLE_VALUE != h) {
         CloseHandle(h);
         return FALSE;
@@ -1914,12 +1914,12 @@
     if (!ret)
     {
         WARN("\tCouldn't find %s\n", lookup->filename);
-        return NULL;
+        return 0;
     }
     h = CreateFileA(dbg_file_path, GENERIC_READ, FILE_SHARE_READ, NULL, 
-                    OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
-    TRACE("%s: %s returns %p\n", lookup->filename, dbg_file_path, h);
-    return (h == INVALID_HANDLE_VALUE) ? NULL : h;
+                    OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
+    TRACE(".PDB '%s': '%s' returns 0x%08x\n", lookup->filename, dbg_file_path, h);
+    return (h == INVALID_HANDLE_VALUE) ? 0 : h;
 }
 
 static void pdb_process_types(const struct msc_debug_info* msc_dbg, 
@@ -1944,10 +1944,11 @@
         case 19950410:      /* VC 4.0 */
         case 19951122:
         case 19961031:      /* VC 5.0 / 6.0 */
-        case 19990903:
+        case 19990903:      /* VC 7.1 */
+        case 20040203:      /* VC 8.0 */
             break;
         default:
-            ERR("-Unknown type info version %d\n", types.version);
+            ERR("-Unknown type info version %ld\n", types.version);
         }
 
         ctp.module = msc_dbg->module;
@@ -2011,7 +2012,7 @@
         case 19970604:      /* VC 6.0 */
             break;
         default:
-            ERR("-Unknown root block version %d\n", root->Version);
+            ERR("-Unknown root block version %ld\n", root->Version);
         }
         if (do_fill)
         {
@@ -2023,7 +2024,7 @@
                  pdb_lookup->u.jg.timestamp != root->TimeDateStamp ||
                  pdb_lookup->age != root->Age)
             ret = FALSE;
-        TRACE("found JG/%c for %s: age=%x timestamp=%x\n",
+        TRACE("found JG/%c for %s: age=%lx timestamp=%lx\n",
               do_fill ? 'f' : '-', pdb_lookup->filename, root->Age,
               root->TimeDateStamp);
         pdb_free(root);
@@ -2048,7 +2049,7 @@
         case 20000404:
             break;
         default:
-            ERR("-Unknown root block version %d\n", root->Version);
+            ERR("-Unknown root block version %ld\n", root->Version);
         }
         if (do_fill)
         {
@@ -2060,7 +2061,7 @@
                  memcmp(&pdb_lookup->u.ds.guid, &root->guid, sizeof(GUID)) ||
                  pdb_lookup->age != root->Age)
             ret = FALSE;
-        TRACE("found DS/%c for %s: age=%x guid=%s\n",
+        TRACE("found DS/%c for %s: age=%lx guid=%s\n",
               do_fill ? 'f' : '-', pdb_lookup->filename, root->Age,
               debugstr_guid(&root->guid));
         pdb_free(root);
@@ -2134,7 +2135,7 @@
                 imp_pdb_lookup.kind = PDB_JG;
                 imp_pdb_lookup.u.jg.timestamp = imp->TimeDateStamp;
                 imp_pdb_lookup.age = imp->Age;
-                TRACE("got for %s: age=%u ts=%x\n",
+                TRACE("got for %s: age=%ld ts=%lx\n",
                       imp->filename, imp->Age, imp->TimeDateStamp);
                 pdb_process_internal(pcs, msc_dbg, &imp_pdb_lookup, i);
             }
@@ -2154,15 +2155,15 @@
                                  unsigned module_index)
 {
     BOOL        ret = FALSE;
-    HANDLE      hFile, hMap = NULL;
+    HANDLE      hFile, hMap = 0;
     char*       image = NULL;
     BYTE*       symbols_image = NULL;
 
     TRACE("Processing PDB file %s\n", pdb_lookup->filename);
 
     /* Open and map() .PDB file */
-    if ((hFile = open_pdb_file(pcs, pdb_lookup)) == NULL ||
-        ((hMap = CreateFileMappingW(hFile, NULL, PAGE_READONLY, 0, 0, NULL)) == NULL) ||
+    if ((hFile = open_pdb_file(pcs, pdb_lookup)) == 0 ||
+        ((hMap = CreateFileMappingW(hFile, NULL, PAGE_READONLY, 0, 0, NULL)) == 0) ||
         ((image = MapViewOfFile(hMap, FILE_MAP_READ, 0, 0, 0)) == NULL))
     {
         WARN("Unable to open .PDB file: %s\n", pdb_lookup->filename);
@@ -2184,10 +2185,11 @@
         case 0:            /* VC 4.0 */
         case 19960307:     /* VC 5.0 */
         case 19970606:     /* VC 6.0 */
-        case 19990903:
+        case 19990903:     /* VC 7.0 */
+        case 20040203:     /* VC 8.0 */
             break;
         default:
-            ERR("-Unknown symbol info version %d %08x\n",
+            ERR("-Unknown symbol info version %ld %08lx\n",
                 symbols.version, symbols.version);
         }
 
@@ -2286,13 +2288,13 @@
 
 BOOL pdb_fetch_file_info(struct pdb_lookup* pdb_lookup)
 {
-    HANDLE              hFile, hMap = NULL;
+    HANDLE              hFile, hMap = 0;
     char*               image = NULL;
     BOOL                ret = TRUE;
 
     if ((hFile = CreateFileA(pdb_lookup->filename, GENERIC_READ, FILE_SHARE_READ, NULL,
-                             OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL)) == INVALID_HANDLE_VALUE ||
-        ((hMap = CreateFileMappingW(hFile, NULL, PAGE_READONLY, 0, 0, NULL)) == NULL) ||
+                             OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0)) == INVALID_HANDLE_VALUE ||
+        ((hMap = CreateFileMappingW(hFile, NULL, PAGE_READONLY, 0, 0, NULL)) == 0) ||
         ((image = MapViewOfFile(hMap, FILE_MAP_READ, 0, 0, 0)) == NULL))
     {
         WARN("Unable to open .PDB file: %s\n", pdb_lookup->filename);
@@ -2342,6 +2344,9 @@
         const OMFDirEntry*      next;
         unsigned int                    i;
 
+
+        TRACE("found %.4s type of PDB file {filepos = %ld}\n", (const char *)signature, cv->filepos);
+
         codeview_init_basic_types(msc_dbg->module);
 
         for (i = 0; i < hdr->cDir; i++)
@@ -2430,7 +2435,7 @@
     {
         const OMFSignatureRSDS* rsds = (const OMFSignatureRSDS*)msc_dbg->root;
 
-        TRACE("Got RSDS type of PDB file: guid=%s unk=%08x name=%s\n",
+        TRACE("Got RSDS type of PDB file: guid=%s unk=%08lx name=%s\n",
               wine_dbgstr_guid(&rsds->guid), rsds->unknown, rsds->name);
         pdb_lookup.filename = rsds->name;
         pdb_lookup.kind = PDB_DS;
@@ -2441,7 +2446,7 @@
         break;
     }
     default:
-        ERR("Unknown CODEVIEW signature %08x in module %s\n",
+        ERR("Unknown CODEVIEW signature %08lx in module %s\n",
             *signature, debugstr_w(msc_dbg->module->module.ModuleName));
         break;
     }

Index: path.c
===================================================================
RCS file: /var/lib/cvsd/cvsroot/winex/dlls/dbghelp/path.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- path.c	30 Aug 2007 14:15:59 -0000	1.1
+++ path.c	30 Aug 2007 14:16:43 -0000	1.2
@@ -57,16 +57,28 @@
 {
     HANDLE      h;
 
-    h = CreateFileA(DebugFilePath, GENERIC_READ, FILE_SHARE_READ, NULL,
-                    OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
+
+    TRACE("(FileName = '%s', SymbolPath = '%s', DebugFilePath = %p)\n", FileName, SymbolPath, DebugFilePath);
+
+    h = CreateFileA(FileName, GENERIC_READ, FILE_SHARE_READ, NULL,
+                    OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
+
+
     if (h == INVALID_HANDLE_VALUE)
     {
-        if (!SearchPathA(SymbolPath, file_name(FileName), NULL, MAX_PATH, DebugFilePath, NULL))
-            return NULL;
+        TRACE("file didn't exist in the current directory.  Trying search path '%s'\n", SymbolPath);
+        
+        if (!SearchPathA(SymbolPath, file_name(FileName), NULL, MAX_PATH, DebugFilePath, NULL)){
+            TRACE("the symbol file '%s' wasn't found on the path '%s'\n", FileName, SymbolPath);
+            return 0;
+        }
+
+
+        TRACE("the symbol file '%s' was found at '%s'\n", FileName, DebugFilePath);
         h = CreateFileA(DebugFilePath, GENERIC_READ, FILE_SHARE_READ, NULL,
-                        OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
+                        OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
     }
-    return (h == INVALID_HANDLE_VALUE) ? NULL : h;
+    return (h == INVALID_HANDLE_VALUE) ? 0 : h;
 }
  
 /******************************************************************
@@ -80,7 +92,7 @@
 {
     FIXME("(%s %s %p %p %p): stub\n", 
           FileName, SymbolPath, DebugFilePath, Callback, CallerData);
-    return NULL;
+    return 0;
 }
 
 /******************************************************************
@@ -94,10 +106,10 @@
 
     if (Callback) FIXME("Unsupported callback yet\n");
     if (!SearchPathW(SymbolPath, FileName, NULL, MAX_PATH, ImageFilePath, NULL))
-        return NULL;
+        return 0;
     h = CreateFileW(ImageFilePath, GENERIC_READ, FILE_SHARE_READ, NULL,
-                    OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
-    return (h == INVALID_HANDLE_VALUE) ? NULL : h;
+                    OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
+    return (h == INVALID_HANDLE_VALUE) ? 0 : h;
 }
 
 /******************************************************************
@@ -109,12 +121,23 @@
 {
     HANDLE h;
 
-    if (Callback) FIXME("Unsupported callback yet\n");
-    if (!SearchPathA(SymbolPath, FileName, NULL, MAX_PATH, ImageFilePath, NULL))
-        return NULL;
+
+    TRACE("(FileName = '%s', SymbolPath = '%s', ImageFilePath = %p, Callback = %p, user = %p)\n", FileName, SymbolPath, ImageFilePath, Callback, user);
+
+    if (Callback)
+        FIXME("Unsupported callback yet\n");
+
+
+    if (!SearchPathA(SymbolPath, FileName, NULL, MAX_PATH, ImageFilePath, NULL)){
+        ERR("the file '%s' was not found in the path '%s'\n", FileName, SymbolPath);
+        return 0;
+    }
+
+
+    TRACE("found the file '%s' at '%s'\n", FileName, ImageFilePath);
     h = CreateFileA(ImageFilePath, GENERIC_READ, FILE_SHARE_READ, NULL,
-                    OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
-    return (h == INVALID_HANDLE_VALUE) ? NULL : h;
+                    OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
+    return (h == INVALID_HANDLE_VALUE) ? 0 : h;
 }
 
 /******************************************************************
@@ -282,7 +305,7 @@
 BOOL WINAPI EnumDirTreeW(HANDLE hProcess, PCWSTR root, PCWSTR file,
                         LPWSTR buffer, PENUMDIRTREE_CALLBACKW cb, PVOID user)
 {
-    TRACE("(%p %s %s %p %p %p)\n",
+    TRACE("(%x %s %s %p %p %p)\n",
           hProcess, debugstr_w(root), debugstr_w(file), buffer, cb, user);
 
     strcpyW(buffer, root);
@@ -369,13 +392,13 @@
             timestamp = ~(DWORD_PTR)s->id;
             size = ~s->two;
             hFile = CreateFileW(buffer, GENERIC_READ, FILE_SHARE_READ, NULL,
-                                OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
+                                OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
             if (hFile == INVALID_HANDLE_VALUE) return FALSE;
-            if ((hMap = CreateFileMappingW(hFile, NULL, PAGE_READONLY, 0, 0, NULL)) != NULL)
+            if ((hMap = CreateFileMappingW(hFile, NULL, PAGE_READONLY, 0, 0, NULL)) != 0)
             {
                 if ((mapping = MapViewOfFile(hMap, FILE_MAP_READ, 0, 0, 0)) != NULL)
                 {
-                    IMAGE_NT_HEADERS*   nth = RtlImageNtHeader(mapping);
+                    IMAGE_NT_HEADERS*   nth = RtlImageNtHeader((HMODULE)mapping);
                     timestamp = nth->FileHeader.TimeDateStamp;
                     size = nth->OptionalHeader.SizeOfImage;
                     UnmapViewOfFile(mapping);
@@ -395,7 +418,7 @@
         {
             if (checksum != (DWORD_PTR)s->id)
             {
-                WARN("Found %s, but wrong checksums: %08x %08lx\n",
+                WARN("Found %s, but wrong checksums: %08lx %08lx\n",
                      debugstr_w(buffer), checksum, (DWORD_PTR)s->id);
                 return FALSE;
             }
@@ -425,7 +448,7 @@
                 }
                 if (pdb_lookup.u.jg.timestamp != (DWORD_PTR)s->id)
                 {
-                    WARN("Found %s, but wrong signature: %08x %08lx\n",
+                    WARN("Found %s, but wrong signature: %08lx %08lx\n",
                          debugstr_w(buffer), pdb_lookup.u.jg.timestamp, (DWORD_PTR)s->id);
                     return FALSE;
                 }
@@ -447,7 +470,7 @@
             }
             if (pdb_lookup.age != s->two)
             {
-                WARN("Found %s, but wrong age: %08x %08x\n",
+                WARN("Found %s, but wrong age: %08lx %08lx\n",
                      debugstr_w(buffer), pdb_lookup.age, s->two);
                 return FALSE;
             }
@@ -478,7 +501,7 @@
     WCHAR*              ptr;
     const WCHAR*        filename;
 
-    TRACE("(hProcess = %p, searchPath = '%s', full_path = '%s', id = %p, two = 0x%08x, three = 0x%08x, flags = 0x%08x, buffer = %p, cb = %p, user = %p)\n",
+    TRACE("(hProcess = 0x%08x, searchPath = '%s', full_path = '%s', id = %p, two = 0x%08lx, three = 0x%08lx, flags = 0x%08lx, buffer = %p, cb = %p, user = %p)\n",
           hProcess, debugstr_w(searchPath), debugstr_w(full_path),
           id, two, three, flags, buffer, cb, user);
 

Index: pe_module.c
===================================================================
RCS file: /var/lib/cvsd/cvsroot/winex/dlls/dbghelp/pe_module.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- pe_module.c	30 Aug 2007 14:15:59 -0000	1.1
+++ pe_module.c	30 Aug 2007 14:16:43 -0000	1.2
@@ -47,6 +47,10 @@
     unsigned int                stabs = 0, stabstr = 0;
     BOOL                        ret = FALSE;
 
+
+    TRACE("looking for STABS debug info {pcs = %p, module = %p, mapping = %p, nth = %p}\n",
+            pcs, module, mapping, nth);
+
     section = (IMAGE_SECTION_HEADER*)
         ((char*)&nth->OptionalHeader + nth->FileHeader.SizeOfOptionalHeader);
     for (i = 0; i < nth->FileHeader.NumberOfSections; i++, section++)
@@ -67,9 +71,9 @@
     {
         ret = stabs_parse(module, 
                           module->module.BaseOfImage - nth->OptionalHeader.ImageBase, 
-                          RtlImageRvaToVa(nth, (void*)mapping, stabs, NULL),
+                          RtlImageRvaToVa(nth, (HMODULE)mapping, stabs, NULL),
                           stabsize,
-                          RtlImageRvaToVa(nth, (void*)mapping, stabstr, NULL),
+                          RtlImageRvaToVa(nth, (HMODULE)mapping, stabstr, NULL),
                           stabstrsize);
     }
     return ret;
@@ -100,7 +104,7 @@
 
     if (SymFindFileInPath(pcs->handle, NULL, dbg_name, NULL, 0, 0, 0, tmp, dbg_match, NULL) &&
         (hFile = CreateFileA(tmp, GENERIC_READ, FILE_SHARE_READ, NULL,
-                             OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL)) != INVALID_HANDLE_VALUE &&
+                             OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0)) != INVALID_HANDLE_VALUE &&
         ((hMap = CreateFileMappingW(hFile, NULL, PAGE_READONLY, 0, 0, NULL)) != 0) &&
         ((dbg_mapping = MapViewOfFile(hMap, FILE_MAP_READ, 0, 0, 0)) != NULL))
     {
@@ -138,7 +142,7 @@
     else
         WINE_ERR("-Unable to peruse .DBG file %s (%s)\n", dbg_name, debugstr_a(tmp));
 
-    if (dbg_mapping) UnmapViewOfFile(dbg_mapping);
+    if (dbg_mapping) UnmapViewOfFile((void *)dbg_mapping);
     if (hMap) CloseHandle(hMap);
     if (hFile != INVALID_HANDLE_VALUE) CloseHandle(hFile);
     return ret;
@@ -163,7 +167,7 @@
     nDbg = dir->Size / sizeof(IMAGE_DEBUG_DIRECTORY);
     if (!nDbg) return FALSE;
 
-    dbg = RtlImageRvaToVa(nth, (void*)mapping, dir->VirtualAddress, NULL);
+    dbg = RtlImageRvaToVa(nth, (HMODULE)mapping, dir->VirtualAddress, NULL);
 
     /* Parse debug directory */
     if (nth->FileHeader.Characteristics & IMAGE_FILE_DEBUG_STRIPPED)
@@ -235,7 +239,7 @@
 #endif
 
     /* Add exported functions */
-    if ((exports = RtlImageDirectoryEntryToData((void*)mapping, FALSE,
+    if ((exports = RtlImageDirectoryEntryToData((HMODULE)mapping, FALSE,
                                                 IMAGE_DIRECTORY_ENTRY_EXPORT, &size)))
     {
         const WORD*             ordinals = NULL;
@@ -244,15 +248,15 @@
         unsigned int		j;
         char			buffer[16];
 
-        functions = RtlImageRvaToVa(nth, (void*)mapping, exports->AddressOfFunctions, NULL);
-        ordinals  = RtlImageRvaToVa(nth, (void*)mapping, exports->AddressOfNameOrdinals, NULL);
-        names     = RtlImageRvaToVa(nth, (void*)mapping, exports->AddressOfNames, NULL);
+        functions = RtlImageRvaToVa(nth, (HMODULE)mapping, exports->AddressOfFunctions, NULL);
+        ordinals  = RtlImageRvaToVa(nth, (HMODULE)mapping, exports->AddressOfNameOrdinals, NULL);
+        names     = RtlImageRvaToVa(nth, (HMODULE)mapping, exports->AddressOfNames, NULL);
 
         for (i = 0; i < exports->NumberOfNames; i++) 
         {
             if (!names[i]) continue;
             symt_new_public(module, NULL, 
-                            RtlImageRvaToVa(nth, (void*)mapping, names[i], NULL),
+                            RtlImageRvaToVa(nth, (HMODULE)mapping, names[i], NULL),
                             base + functions[ordinals[i]], 
                             1, TRUE /* FIXME */, TRUE /* FIXME */);
         }
@@ -264,7 +268,7 @@
             for (j = 0; j < exports->NumberOfNames; j++)
                 if ((ordinals[j] == i) && names[j]) break;
             if (j < exports->NumberOfNames) continue;
-            snprintf(buffer, sizeof(buffer), "%d", i + exports->Base);
+            snprintf(buffer, sizeof(buffer), "%lu", i + exports->Base);
             symt_new_public(module, NULL, buffer, base + (DWORD)functions[i], 1,
                             TRUE /* FIXME */, TRUE /* FIXME */);
         }
@@ -288,13 +292,13 @@
     IMAGE_NT_HEADERS*   nth;
 
     hFile = CreateFileW(module->module.LoadedImageName, GENERIC_READ, FILE_SHARE_READ,
-                        NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
+                        NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
     if (hFile == INVALID_HANDLE_VALUE) return ret;
     if ((hMap = CreateFileMappingW(hFile, NULL, PAGE_READONLY, 0, 0, NULL)) != 0)
     {
         if ((mapping = MapViewOfFile(hMap, FILE_MAP_READ, 0, 0, 0)) != NULL)
         {
-            nth = RtlImageNtHeader(mapping);
+            nth = RtlImageNtHeader((HMODULE)mapping);
 
             if (!(dbghelp_options & SYMOPT_PUBLICS_ONLY))
             {
@@ -329,6 +333,10 @@
     HANDLE              hMap;
     WCHAR               loaded_name[MAX_PATH];
 
+
+    TRACE("(pcs = %p, name = '%s', hFile = 0x%08x, base = 0x%08lx, size = %ld)\n",
+            pcs, debugstr_w(name), hFile, base, size);
+
     loaded_name[0] = '\0';
     if (!hFile)
     {
@@ -343,13 +351,13 @@
     else if (dbghelp_options & SYMOPT_DEFERRED_LOADS)
         FIXME("Trouble ahead (no module name passed in deferred mode)\n");
 
-    if ((hMap = CreateFileMappingW(hFile, NULL, PAGE_READONLY, 0, 0, NULL)) != NULL)
+    if ((hMap = CreateFileMappingW(hFile, NULL, PAGE_READONLY, 0, 0, NULL)) != 0)
     {
         void*   mapping;
 
         if ((mapping = MapViewOfFile(hMap, FILE_MAP_READ, 0, 0, 0)) != NULL)
         {
-            IMAGE_NT_HEADERS*   nth = RtlImageNtHeader(mapping);
+            IMAGE_NT_HEADERS*   nth = RtlImageNtHeader((HMODULE)mapping);
 
             if (nth)
             {

Index: source.c
===================================================================
RCS file: /var/lib/cvsd/cvsroot/winex/dlls/dbghelp/source.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- source.c	30 Aug 2007 14:15:59 -0000	1.1
+++ source.c	30 Aug 2007 14:16:43 -0000	1.2
@@ -225,7 +225,7 @@
 BOOL WINAPI SymGetSourceFileToken(HANDLE hProcess, ULONG64 base,
                                   PCSTR src, PVOID* token, DWORD* size)
 {
-    FIXME("%p %s %s %p %p: stub!\n",
+    FIXME("%x %s %s %p %p: stub!\n",
           hProcess, wine_dbgstr_longlong(base), debugstr_a(src), token, size);
     SetLastError(ERROR_NOT_SUPPORTED);
     return FALSE;
@@ -238,7 +238,7 @@
 BOOL WINAPI SymGetSourceFileTokenW(HANDLE hProcess, ULONG64 base,
                                    PCWSTR src, PVOID* token, DWORD* size)
 {
-    FIXME("%p %s %s %p %p: stub!\n",
+    FIXME("%x %s %s %p %p: stub!\n",
           hProcess, wine_dbgstr_longlong(base), debugstr_w(src), token, size);
     SetLastError(ERROR_NOT_SUPPORTED);
     return FALSE;

Index: stack.c
===================================================================
RCS file: /var/lib/cvsd/cvsroot/winex/dlls/dbghelp/stack.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- stack.c	30 Aug 2007 14:15:59 -0000	1.1
+++ stack.c	30 Aug 2007 14:16:43 -0000	1.2
@@ -27,11 +27,12 @@
 #include <string.h>
 #include <assert.h>
 
-#include "ntstatus.h"
+/*#include "ntstatus.h"*/
 #define WIN32_NO_STATUS
 #include "dbghelp_private.h"
 #include "winternl.h"
 #include "wine/winbase16.h"
+#include "stackframe.h"
 #include "wine/debug.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(dbghelp);
@@ -44,13 +45,13 @@
     switch (addr->Mode)
     {
     case AddrModeFlat:
-        return wine_dbg_sprintf("flat<%08x>", addr->Offset);
+        return wine_dbg_sprintf("flat<%08lx>", addr->Offset);
     case AddrMode1616:
-        return wine_dbg_sprintf("1616<%04x:%04x>", addr->Segment, addr->Offset);
+        return wine_dbg_sprintf("1616<%04x:%04lx>", addr->Segment, addr->Offset);
     case AddrMode1632:
-        return wine_dbg_sprintf("1632<%04x:%08x>", addr->Segment, addr->Offset);
+        return wine_dbg_sprintf("1632<%04x:%08lx>", addr->Segment, addr->Offset);
     case AddrModeReal:
-        return wine_dbg_sprintf("real<%04x:%04x>", addr->Segment, addr->Offset);
+        return wine_dbg_sprintf("real<%04x:%04lx>", addr->Segment, addr->Offset);
     default:
         return "unknown";
     }
@@ -60,7 +61,7 @@
                               DWORD size, LPDWORD nread)
 {
     SIZE_T      r;
-    if (!ReadProcessMemory(hProcess, (void*)addr, buffer, size, &r)) return FALSE;
+    if (!ReadProcessMemory(hProcess, (void*)addr, buffer, size, (LPDWORD)&r)) return FALSE;
     if (nread) *nread = r;
     return TRUE;
 }
@@ -69,7 +70,7 @@
                                 DWORD size, LPDWORD nread)
 {
     SIZE_T      r;
-    if (!ReadProcessMemory(hProcess, (void*)(DWORD_PTR)addr, buffer, size, &r)) return FALSE;
+    if (!ReadProcessMemory(hProcess, (void*)(DWORD_PTR)addr, buffer, size, (LPDWORD)&r)) return FALSE;
     if (nread) *nread = r;
     return TRUE;
 }
@@ -116,6 +117,9 @@
 
 static inline void addr_64to32(const ADDRESS64* addr64, ADDRESS* addr32)
 {
+    if (addr64->Offset >> 32)
+        ERR("detected a 64-bit address!\n");
+
     addr32->Offset = (ULONG)addr64->Offset;
     addr32->Segment = addr64->Segment;
     addr32->Mode = addr64->Mode;
@@ -172,7 +176,7 @@
     /* sanity check */
     if (curr_mode >= stm_done) return FALSE;
 
-    TRACE("Enter: PC=%s Frame=%s Return=%s Stack=%s Mode=%s cSwitch=%08x nSwitch=%08x\n",
+    TRACE("Enter: PC = %s Frame = %s Return = %s Stack = %s Mode = %s cSwitch = 0x%08lx nSwitch = 0x%08lx\n",
           wine_dbgstr_addr(&frame->AddrPC),
           wine_dbgstr_addr(&frame->AddrFrame),
           wine_dbgstr_addr(&frame->AddrReturn),
@@ -187,7 +191,7 @@
         if ((frame->AddrPC.Mode == AddrModeFlat) &&
             (frame->AddrFrame.Mode != AddrModeFlat))
         {
-            WARN("Bad AddrPC.Mode / AddrFrame.Mode combination\n");
+            WARN("[start] Bad AddrPC.Mode / AddrFrame.Mode combination\n");
             goto done_err;
         }
 
@@ -204,14 +208,14 @@
             curr_switch = (unsigned long)info.TebBaseAddress + FIELD_OFFSET(TEB, WOW32Reserved);
             if (!sw_read_mem(cb, curr_switch, &next_switch, sizeof(next_switch)))
             {
-                WARN("Can't read TEB:WOW32Reserved\n");
+                WARN("[start] Can't read TEB:WOW32Reserved\n");
                 goto done_err;
             }
             if (curr_mode == stm_16bit)
             {
                 if (!sw_read_mem(cb, next_switch, &frame32, sizeof(frame32)))
                 {
-                    WARN("Bad stack frame 0x%08x\n", next_switch);
+                    WARN("[start] Bad 16-bit stack frame 0x%08lx\n", next_switch);
                     goto done_err;
                 }
                 curr_switch = (DWORD)frame32.frame16;
@@ -229,7 +233,7 @@
                 p = sw_xlat_addr(cb, &tmp);
                 if (!sw_read_mem(cb, p, &frame16, sizeof(frame16)))
                 {
-                    WARN("Bad stack frame 0x%08x\n", p);
+                    WARN("[start] Bad 32-bit stack frame 0x%08lx\n", p);
                     goto done_err;
                 }
                 curr_switch = (DWORD)frame16.frame32;
@@ -243,7 +247,10 @@
              * but the 16 <=> 32 switch facility won't be available.
              */
             curr_switch = 0;
-        frame->AddrReturn.Mode = frame->AddrStack.Mode = (curr_mode == stm_16bit) ? AddrMode1616 : AddrModeFlat;
+
+
+        /* NOTE: native doesn't set frame->AddrStack.Mode until the second frame (when its offset is set) */
+        frame->AddrReturn.Mode /*= frame->AddrStack.Mode*/ = (curr_mode == stm_16bit) ? AddrMode1616 : AddrModeFlat;
         /* don't set up AddrStack on first call. Either the caller has set it up, or
          * we will get it in the next frame
          */
@@ -251,10 +258,17 @@
     }
     else
     {
-        if (frame->AddrFrame.Offset == 0) goto done_err;
+        if (frame->AddrFrame.Offset == 0){
+            ERR("[continue] null frame offset!\n");
+            goto done_err;
+        }
+
         if (frame->AddrFrame.Mode == AddrModeFlat)
         {
             assert(curr_mode == stm_32bit);
+            if (curr_mode != stm_32bit)
+                ERR("[continue] not in 32-bit stack mode!\n");
+
             do_switch = curr_switch && frame->AddrFrame.Offset >= curr_switch;
         }
         else
@@ -271,7 +285,7 @@
             {
                 if (!sw_read_mem(cb, next_switch, &frame32, sizeof(frame32)))
                 {
-                    WARN("Bad stack frame 0x%08x\n", next_switch);
+                    WARN("[continue16] Bad 32-bit stack frame 0x%08lx\n", next_switch);
                     goto done_err;
                 }
 
@@ -295,7 +309,7 @@
 
                 if (!sw_read_mem(cb, p, &frame16, sizeof(frame16)))
                 {
-                    WARN("Bad stack frame 0x%08x\n", p);
+                    WARN("[continue16] Bad 16-bit stack frame 0x%08lx\n", p);
                     goto done_err;
                 }
                 curr_switch = (DWORD)frame16.frame32;
@@ -312,16 +326,16 @@
 
                 if (!sw_read_mem(cb, p, &frame16, sizeof(frame16)))
                 {
-                    WARN("Bad stack frame 0x%08x\n", p);
+                    WARN("[continue32] Bad 16-bit stack frame 0x%08lx\n", p);
                     goto done_err;
                 }
 
                 TRACE("Got a 16 bit stack switch:"
                       "\n\tframe32: %08lx"
-                      "\n\tedx:%08x ecx:%08x ebp:%08x"
+                      "\n\tedx:%08lx ecx:%08lx ebp:%08lx"
                       "\n\tds:%04x es:%04x fs:%04x gs:%04x"
-                      "\n\tcall_from_ip:%08x module_cs:%04x relay=%08x"
-                      "\n\tentry_ip:%04x entry_point:%08x"
+                      "\n\tcall_from_ip:%08lx module_cs:%04lx relay=%08lx"
+                      "\n\tentry_ip:%04x entry_point:%08lx"
                       "\n\tbp:%04x ip:%04x cs:%04x\n",
                       (unsigned long)frame16.frame32,
                       frame16.edx, frame16.ecx, frame16.ebp,
@@ -348,7 +362,7 @@
                 next_switch = curr_switch;
                 if (!sw_read_mem(cb, next_switch, &frame32, sizeof(frame32)))
                 {
-                    WARN("Bad stack frame 0x%08x\n", next_switch);
+                    WARN("[continue32] Bad 32-bit stack frame 0x%08lx\n", next_switch);
                     goto done_err;
                 }
                 curr_switch = (DWORD)frame32.frame16;
@@ -414,8 +428,8 @@
                      */
                     frame->AddrReturn.Segment = val;
                 }
-	    }
-	}
+            }
+        }
         frame->AddrFrame.Offset &= ~1;
         /* we "pop" parameters as 16 bit entities... of course, this won't
          * work if the parameter is in fact bigger than 16bit, but
@@ -432,7 +446,7 @@
         if (!sw_read_mem(cb, frame->AddrFrame.Offset + sizeof(DWORD),
                          &frame->AddrReturn.Offset, sizeof(DWORD)))
         {
-            WARN("Cannot read new frame offset %08x\n", frame->AddrFrame.Offset + (int)sizeof(DWORD));
+            WARN("[next32] Cannot read new frame offset %08lx\n", frame->AddrFrame.Offset + (int)sizeof(DWORD));
             goto done_err;
         }
         sw_read_mem(cb, frame->AddrFrame.Offset + 2 * sizeof(DWORD),
@@ -447,7 +461,7 @@
     else
         frame->FuncTableEntry = NULL;
 
-    TRACE("Leave: PC=%s Frame=%s Return=%s Stack=%s Mode=%s cSwitch=%08x nSwitch=%08x FuncTable=%p\n",
+    TRACE("Leave: PC = %s Frame = %s Return = %s Stack = %s Mode = %s cSwitch = 0x%08lx nSwitch = 0x%08lx FuncTable = %p\n",
           wine_dbgstr_addr(&frame->AddrPC),
           wine_dbgstr_addr(&frame->AddrFrame),
           wine_dbgstr_addr(&frame->AddrReturn),
@@ -473,7 +487,7 @@
 {
     struct stack_walk_callback  swcb;
 
-    TRACE("(%d, %p, %p, %p, %p, %p, %p, %p, %p)\n",
+    TRACE("(%ld, %x, %x, %p, %p, %p, %p, %p, %p)\n",
           MachineType, hProcess, hThread, frame, ctx,
           f_read_mem, FunctionTableAccessRoutine,
           GetModuleBaseRoutine, f_xlat_adr);
@@ -511,7 +525,7 @@
     STACKFRAME                  frame32;
     BOOL                        ret;
 
-    TRACE("(%d, %p, %p, %p, %p, %p, %p, %p, %p)\n",
+    TRACE("(MachineType = %ld, hProcess = 0x%08x, hThread = 0x%08x, frame64 = %p, ctx = %p, f_read_mem = %p, FunctionTableAccessRoutine = %p, GetModuleBaseRoutine = %p, f_xlat_adr = %p)\n",
           MachineType, hProcess, hThread, frame64, ctx,
           f_read_mem, FunctionTableAccessRoutine,
           GetModuleBaseRoutine, f_xlat_adr);
@@ -583,7 +597,7 @@
 BOOL WINAPI SymRegisterFunctionEntryCallback(HANDLE hProc,
                                              PSYMBOL_FUNCENTRY_CALLBACK cb, PVOID user)
 {
-    FIXME("(%p %p %p): stub!\n", hProc, cb, user);
+    FIXME("(%x %p %p): stub!\n", hProc, cb, user);
     SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
     return FALSE;
 }
@@ -597,7 +611,7 @@
                                                PSYMBOL_FUNCENTRY_CALLBACK64 cb,
                                                ULONG64 user)
 {
-    FIXME("(%p %p %s): stub!\n", hProc, cb, wine_dbgstr_longlong(user));
+    FIXME("(%x %p %s): stub!\n", hProc, cb, wine_dbgstr_longlong(user));
     SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
     return FALSE;
 }

--- NEW FILE: stubs.h ---
#ifndef  __STUBS_H__
# define __STUBS_H__


/* WARNING!!  This file is only temporary! */

/* defined in 'psapi.h' */
DWORD WINAPI GetModuleFileNameExW(HANDLE hProcess, HMODULE hModule, LPWSTR lpFilename, DWORD nSize);
DWORD WINAPI GetModuleFileNameExA(HANDLE hProcess, HMODULE hModule, LPSTR lpFilename, DWORD nSize);
BOOL  WINAPI EnumProcessModules(HANDLE hProcess, HMODULE *lphModule, DWORD cb, LPDWORD lpcbNeeded);
BOOL  WINAPI GetModuleInformation(HANDLE hProcess, HMODULE hModule, LPMODULEINFO lpmodinfo, DWORD cb);
DWORD WINAPI GetModuleBaseNameA(HANDLE hProcess, HMODULE hModule, LPSTR lpBaseName, DWORD nSize);
DWORD WINAPI GetModuleBaseNameW(HANDLE hProcess, HMODULE hModule, LPWSTR lpBaseName, DWORD nSize);


/* defined in 'kernel32.h' */
DWORD WINAPI GetProcessId(HANDLE Process);



#endif
Index: symbol.c
===================================================================
RCS file: /var/lib/cvsd/cvsroot/winex/dlls/dbghelp/symbol.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- symbol.c	30 Aug 2007 14:15:59 -0000	1.1
+++ symbol.c	30 Aug 2007 14:16:43 -0000	1.2
@@ -486,8 +486,18 @@
     const char* name;
     DWORD64 size;
 
-    if (!symt_get_info(sym, TI_GET_TYPE, &sym_info->TypeIndex))
+
+    TRACE("(pair = %p, func = %p, sym = %p (0x%08x), sym_info = %p)\n", 
+            pair, func, sym, sym ? sym->tag : 0, sym_info);
+
+    if (sym_info->SizeOfStruct != sizeof(SYMBOL_INFO))
+        FIXME("the SYMBOL_INFO struct is the wrong size!\n");
+
+    if (!symt_get_info(sym, TI_GET_TYPE, &sym_info->TypeIndex)){
+        ERR("couldn't retrieve the type of the symbol\n");
         sym_info->TypeIndex = 0;
+    }
+
     sym_info->info = (DWORD)sym;
     sym_info->Reserved[0] = sym_info->Reserved[1] = 0;
     if (!symt_get_info(sym, TI_GET_LENGTH, &size) &&
@@ -939,7 +949,7 @@
 {
     struct sym_enum     se;
 
-    TRACE("(%p %s %s %p %p)\n", 
+    TRACE("(%x %s %s %p %p)\n", 
           hProcess, wine_dbgstr_longlong(BaseOfDll), debugstr_a(Mask),
           EnumSymbolsCallback, UserContext);
 
@@ -1165,7 +1175,7 @@
     struct module*              module;
     const char*                 name;
 
-    TRACE("(%p, %s, %p)\n", hProcess, Name, Symbol);
+    TRACE("(%x, %s, %p)\n", hProcess, Name, Symbol);
     if (!pcs) return FALSE;
     if (Symbol->SizeOfStruct < sizeof(*Symbol)) return FALSE;
     name = strchr(Name, '!');
@@ -1265,7 +1275,7 @@
      * increment index
      * if out of module bounds, move to next module in process address space
      */
-    FIXME("(%p, %p): stub\n", hProcess, Symbol);
+    FIXME("(%x, %p): stub\n", hProcess, Symbol);
     SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
     return FALSE;
 }
@@ -1276,7 +1286,7 @@
 
 BOOL WINAPI SymGetSymPrev(HANDLE hProcess, PIMAGEHLP_SYMBOL Symbol)
 {
-    FIXME("(%p, %p): stub\n", hProcess, Symbol);
+    FIXME("(%x, %p): stub\n", hProcess, Symbol);
     SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
     return FALSE;
 }
@@ -1291,7 +1301,7 @@
     struct module_pair  pair;
     struct symt_ht*     symt;
 
-    TRACE("%p %08x %p %p\n", hProcess, dwAddr, pdwDisplacement, Line);
+    TRACE("%x %08lx %p %p\n", hProcess, dwAddr, pdwDisplacement, Line);
 
     if (Line->SizeOfStruct < sizeof(*Line)) return FALSE;
 
@@ -1398,7 +1408,7 @@
     struct line_info*   li;
     BOOL                in_search = FALSE;
 
-    TRACE("(%p %p)\n", hProcess, Line);
+    TRACE("(%x %p)\n", hProcess, Line);
 
     if (Line->SizeOfStruct < sizeof(*Line)) return FALSE;
 
@@ -1482,7 +1492,7 @@
 {
     struct module_pair  pair;
 
-    TRACE("(%p %p)\n", hProcess, Line);
+    TRACE("(%x %p)\n", hProcess, Line);
 
     if (Line->SizeOfStruct < sizeof(*Line)) return FALSE;
     pair.pcs = process_find_by_handle(hProcess);
@@ -1515,7 +1525,7 @@
  */
 PVOID WINAPI SymFunctionTableAccess(HANDLE hProcess, DWORD AddrBase)
 {
-    WARN("(%p, 0x%08x): stub\n", hProcess, AddrBase);
+    WARN("(%x, 0x%08lx): stub\n", hProcess, AddrBase);
     return NULL;
 }
 
@@ -1524,7 +1534,7 @@
  */
 PVOID WINAPI SymFunctionTableAccess64(HANDLE hProcess, DWORD64 AddrBase)
 {
-    WARN("(%p, %s): stub\n", hProcess, wine_dbgstr_longlong(AddrBase));
+    WARN("(hProcess = 0x%08x, AddrBase = %s): stub\n", hProcess, wine_dbgstr_longlong(AddrBase));
     return NULL;
 }
 
@@ -1533,7 +1543,7 @@
  */
 BOOL WINAPI SymUnDName(PIMAGEHLP_SYMBOL sym, LPSTR UnDecName, DWORD UnDecNameLength)
 {
-    TRACE("(%p %s %u)\n", sym, UnDecName, UnDecNameLength);
+    TRACE("(%p %s %lu)\n", sym, UnDecName, UnDecNameLength);
     return UnDecorateSymbolName(sym->Name, UnDecName, UnDecNameLength,
                                 UNDNAME_COMPLETE) != 0;
 }
@@ -1551,7 +1561,7 @@
     static char* (*p_undname)(char*, const char*, int, void* (*)(size_t), void (*)(void*), unsigned short);
     static const WCHAR szMsvcrt[] = {'m','s','v','c','r','t','.','d','l','l',0};
 
-    TRACE("(%s, %p, %d, 0x%08x)\n",
+    TRACE("(%s, %p, %ld, 0x%08lx)\n",
           debugstr_a(DecoratedName), UnDecoratedName, UndecoratedLength, Flags);
 
     if (!p_undname)
@@ -1595,14 +1605,14 @@
 {
     struct sym_enum     se;
 
-    TRACE("(%p %s %u %u %s %s %p %p %x)\n",
+    TRACE("(%x %s %lu %lu %s %s %p %p %lx)\n",
           hProcess, wine_dbgstr_longlong(BaseOfDll), Index, SymTag, Mask,
           wine_dbgstr_longlong(Address), EnumSymbolsCallback,
           UserContext, Options);
 
     if (Options != SYMSEARCH_GLOBALSONLY)
     {
-        FIXME("Unsupported searching with options (%x)\n", Options);
+        FIXME("Unsupported searching with options (%lx)\n", Options);
         SetLastError(ERROR_INVALID_PARAMETER);
         return FALSE;
     }
@@ -1629,7 +1639,7 @@
     BOOL                ret = FALSE;
     char*               maskA = NULL;
 
-    TRACE("(%p %s %u %u %s %s %p %p %x)\n",
+    TRACE("(%x %s %lu %lu %s %s %p %p %lx)\n",
           hProcess, wine_dbgstr_longlong(BaseOfDll), Index, SymTag, debugstr_w(Mask),
           wine_dbgstr_longlong(Address), EnumSymbolsCallback,
           UserContext, Options);

Index: type.c
===================================================================
RCS file: /var/lib/cvsd/cvsroot/winex/dlls/dbghelp/type.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- type.c	30 Aug 2007 14:15:59 -0000	1.1
+++ type.c	30 Aug 2007 14:16:43 -0000	1.2
@@ -382,7 +382,7 @@
     DWORD64             size;
     int                 i;
 
-    TRACE("(%p %s %p %p)\n",
+    TRACE("(%x %s %p %p)\n",
           hProcess, wine_dbgstr_longlong(BaseOfDll), EnumSymbolsCallback,
           UserContext);