[DBGHELP] Sync with Wine Staging 3.3. CORE-14434
authorAmine Khaldi <amine.khaldi@reactos.org>
Sun, 4 Mar 2018 22:54:20 +0000 (23:54 +0100)
committerAmine Khaldi <amine.khaldi@reactos.org>
Sun, 4 Mar 2018 22:54:20 +0000 (23:54 +0100)
30 files changed:
dll/win32/dbghelp/CMakeLists.txt
dll/win32/dbghelp/coff.c
dll/win32/dbghelp/cpu_arm.c
dll/win32/dbghelp/cpu_arm64.c
dll/win32/dbghelp/cpu_i386.c
dll/win32/dbghelp/cpu_ppc.c
dll/win32/dbghelp/cpu_x86_64.c
dll/win32/dbghelp/crc32.c
dll/win32/dbghelp/dbghelp.c
dll/win32/dbghelp/dbghelp_private.h
dll/win32/dbghelp/dwarf.c
dll/win32/dbghelp/elf_module.c
dll/win32/dbghelp/image.c
dll/win32/dbghelp/macho_module.c
dll/win32/dbghelp/minidump.c
dll/win32/dbghelp/module.c
dll/win32/dbghelp/msc.c
dll/win32/dbghelp/path.c
dll/win32/dbghelp/pe_module.c
dll/win32/dbghelp/precomp.h [new file with mode: 0644]
dll/win32/dbghelp/rosstubs.c
dll/win32/dbghelp/rsym.c
dll/win32/dbghelp/source.c
dll/win32/dbghelp/stabs.c
dll/win32/dbghelp/stack.c
dll/win32/dbghelp/storage.c
dll/win32/dbghelp/symbol.c
dll/win32/dbghelp/type.c
media/doc/README.WINE
sdk/include/reactos/wine/mscvpdb.h

index 7b0c384..66229f4 100644 (file)
@@ -70,7 +70,7 @@ else()
         storage.c
         symbol.c
         type.c
-        dbghelp_private.h
+        precomp.h
         ${CMAKE_CURRENT_BINARY_DIR}/dbghelp_stubs.c)
 
     add_library(dbghelp SHARED
@@ -82,7 +82,7 @@ else()
     target_link_libraries(dbghelp wine ${PSEH_LIB} oldnames zlib)
     add_delay_importlibs(dbghelp version)
     add_importlibs(dbghelp psapi msvcrt kernel32 ntdll)
-    add_pch(dbghelp dbghelp_private.h SOURCE)
+    add_pch(dbghelp precomp.h SOURCE)
     add_cd_file(TARGET dbghelp DESTINATION reactos/system32 FOR all)
 
 endif()
index a9d983e..01c5826 100644 (file)
  *     Add symbol size to internal symbol table.
  */
 
+#include "config.h"
+#include "wine/port.h"
+
+#include <assert.h>
+#include <stdlib.h>
+
+#include <string.h>
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+
+#include <stdarg.h>
+#include "windef.h"
+#include "winbase.h"
+#include "winternl.h"
+
+#include "wine/exception.h"
+#include "wine/debug.h"
 #include "dbghelp_private.h"
+#include "wine/mscvpdb.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(dbghelp_coff);
 
index 5aae67d..5246160 100644 (file)
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
+#include <assert.h>
+
+#include "ntstatus.h"
+#define WIN32_NO_STATUS
 #include "dbghelp_private.h"
+#include "winternl.h"
+#include "wine/debug.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(dbghelp);
 
index a2a0bb4..dd2ccfb 100644 (file)
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
+#include <assert.h>
+
+#define NONAMELESSUNION
+#define NONAMELESSSTRUCT
+#include "ntstatus.h"
+#define WIN32_NO_STATUS
 #include "dbghelp_private.h"
+#include "winternl.h"
+#include "wine/debug.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(dbghelp);
 
index c713049..592f56e 100644 (file)
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
-#include "dbghelp_private.h"
+#include <assert.h>
 
+#include "ntstatus.h"
+#define WIN32_NO_STATUS
+#include "dbghelp_private.h"
 #ifndef DBGHELP_STATIC_LIB
-#include <wine/winbase16.h>
+#include "wine/winbase16.h"
+#include "winternl.h"
+#include "wine/debug.h"
 #endif
 
 WINE_DEFAULT_DEBUG_CHANNEL(dbghelp);
@@ -215,16 +220,16 @@ static BOOL i386_stack_walk(struct cpu_stack_walk* csw, LPSTACKFRAME64 frame, CO
         /* Init done */
         set_curr_mode((frame->AddrPC.Mode == AddrModeFlat) ? stm_32bit : stm_16bit);
 
-        /* cur_switch holds address of WOW32Reserved field in TEB in debuggee
+        /* cur_switch holds address of SystemReserved1[0] field in TEB in debuggee
          * address space
          */
         if (NtQueryInformationThread(csw->hThread, ThreadBasicInformation, &info,
                                      sizeof(info), NULL) == STATUS_SUCCESS)
         {
-            curr_switch = (DWORD_PTR)info.TebBaseAddress + FIELD_OFFSET(TEB, WOW32Reserved);
+            curr_switch = (DWORD_PTR)info.TebBaseAddress + FIELD_OFFSET(TEB, SystemReserved1[0]);
             if (!sw_read_mem(csw, curr_switch, &p, sizeof(p)))
             {
-                WARN("Can't read TEB:WOW32Reserved\n");
+                WARN("Can't read TEB:SystemReserved1[0]\n");
                 goto done_err;
             }
             next_switch = p;
index 6c38245..a481685 100644 (file)
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
+#include <assert.h>
+
+#include "ntstatus.h"
+#define WIN32_NO_STATUS
 #include "dbghelp_private.h"
+#include "winternl.h"
+#include "wine/debug.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(dbghelp);
 
index 5beb6df..aa659fa 100644 (file)
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
+#include <assert.h>
+
+#define NONAMELESSUNION
+#define NONAMELESSSTRUCT
+#include "ntstatus.h"
+#define WIN32_NO_STATUS
 #include "dbghelp_private.h"
+#include "winternl.h"
+#include "wine/debug.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(dbghelp);
 
@@ -702,6 +710,7 @@ static void*    x86_64_find_runtime_function(struct module* module, DWORD64 addr
             while (rtf->UnwindData & 1)  /* follow chained entry */
             {
                 FIXME("RunTime_Function outside IMAGE_DIRECTORY_ENTRY_EXCEPTION unimplemented yet!\n");
+                return NULL;
                 /* we need to read into the other process */
                 /* rtf = (RUNTIME_FUNCTION*)(module->module.BaseOfImage + (rtf->UnwindData & ~1)); */
             }
index 6490133..73042fe 100644 (file)
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
+#include "config.h"
+#include "wine/port.h"
+
+#include <stdio.h>
+
 #include "dbghelp_private.h"
 
 /* Copyright (C) 1986 Gary S. Brown
index 3fa5765..6779e9a 100644 (file)
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
-#include "dbghelp_private.h"
+#ifndef DBGHELP_STATIC_LIB
+#include "config.h"
 
+#include "dbghelp_private.h"
+#include "winerror.h"
+#include "psapi.h"
+#include "wine/debug.h"
+#include "wdbgexts.h"
+#include "winnls.h"
+#else
+#include "dbghelp_private.h"
 #include "wdbgexts.h"
+#endif
 
 WINE_DEFAULT_DEBUG_CHANNEL(dbghelp);
 
@@ -355,7 +365,7 @@ BOOL WINAPI SymInitializeW(HANDLE hProcess, PCWSTR UserSearchPath, BOOL fInvadeP
     pcs->dbg_hdr_addr = 0;
     pcs->next = process_first;
     process_first = pcs;
-
+    
 #ifndef DBGHELP_STATIC_LIB
     if (check_live_target(pcs))
     {
index d6b2bbe..9848acb 100644 (file)
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
-#ifndef _DBGHELP_PRIVATE_H_
-#define _DBGHELP_PRIVATE_H_
+#pragma once
 
-#include <config.h>
-
-#include <assert.h>
-#include <stdio.h>
-
-#ifdef HAVE_SYS_MMAN_H
-# include <sys/mman.h>
-#endif
-#ifdef HAVE_SYS_STAT_H
-# include <sys/stat.h>
-#endif
-#ifdef HAVE_UNISTD_H
-# include <unistd.h>
-#endif
-
-#define _INC_WINDOWS
-#define COM_NO_WINDOWS_H
-
-#define NONAMELESSUNION
-#define NONAMELESSSTRUCT
+#include <stdarg.h>
 
 #ifndef DBGHELP_STATIC_LIB
 
-#include <wine/port.h>
+#include "windef.h"
+#include "winbase.h"
+#include "winver.h"
+#include "dbghelp.h"
+#include "objbase.h"
+#include "oaidl.h"
+#include "winnls.h"
+#include "wine/list.h"
+#include "wine/unicode.h"
+#include "wine/rbtree.h"
 
-#include <ntstatus.h>
-#define WIN32_NO_STATUS
-#include <windef.h>
-#include <winbase.h>
-#include <winver.h>
-#include <winternl.h>
-#include <dbghelp.h>
-#include <objbase.h>
-#include <cvconst.h>
-#include <psapi.h>
-
-#include <wine/debug.h>
-#include <wine/mscvpdb.h>
-#include <wine/unicode.h>
+#include "cvconst.h"
 
 #else /* DBGHELP_STATIC_LIB */
 
 #include <string.h>
 #include "compat.h"
-
-#endif /* DBGHELP_STATIC_LIB */
-
 #include <wine/list.h>
 #include <wine/rbtree.h>
+#endif /* DBGHELP_STATIC_LIB */
 
 /* #define USE_STATS */
 
@@ -401,6 +375,7 @@ struct module
 {
     struct process*             process;
     IMAGEHLP_MODULEW64          module;
+    WCHAR                       modulename[64]; /* used for enumeration */
     struct module*              next;
     enum module_type           type : 16;
     unsigned short              is_virtual : 1;
@@ -844,7 +819,3 @@ extern struct symt_pointer*
 extern struct symt_typedef*
                     symt_new_typedef(struct module* module, struct symt* ref, 
                                      const char* name) DECLSPEC_HIDDEN;
-
-#include "image_private.h"
-
-#endif /* _DBGHELP_PRIVATE_H_ */
index 7b338d1..0d51792 100644 (file)
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
-#include "dbghelp_private.h"
+#ifndef DBGHELP_STATIC_LIB
+
+#define NONAMELESSUNION
+
+#include "config.h"
+
+#include <sys/types.h>
+#include <fcntl.h>
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#ifdef HAVE_SYS_MMAN_H
+#include <sys/mman.h>
+#endif
+#include <limits.h>
+#include <stdlib.h>
+#include <string.h>
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+#include <stdio.h>
+#include <assert.h>
+#include <stdarg.h>
 
 #ifdef HAVE_ZLIB
 #include <zlib.h>
 #endif
 
+#include "windef.h"
+#include "winternl.h"
+#include "winbase.h"
+#include "winuser.h"
+#include "ole2.h"
+#include "oleauto.h"
+
+#include "dbghelp_private.h"
+#include "image_private.h"
+
+#include "wine/debug.h"
+
+#else
+#include "dbghelp_private.h"
+#include "image_private.h"
+#endif /* !DBGHELP_STATIC_LIB */
+
 WINE_DEFAULT_DEBUG_CHANNEL(dbghelp_dwarf);
 
 /* FIXME:
index 2edab86..066c2f5 100644 (file)
@@ -19,7 +19,8 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
-#include "dbghelp_private.h"
+#include "config.h"
+#include "wine/port.h"
 
 #if defined(__svr4__) || defined(__sun)
 #define __ELF__ 1
 #define _FILE_OFFSET_BITS 32
 #endif
 
+#include <assert.h>
+#include <stdio.h>
 #include <stdlib.h>
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
 #include <fcntl.h>
+#ifdef HAVE_SYS_MMAN_H
+#include <sys/mman.h>
+#endif
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+
+#include "dbghelp_private.h"
+#include "winternl.h"
+
+#include "image_private.h"
 
-#include <wine/library.h>
+#include "wine/library.h"
+#include "wine/debug.h"
 
 #ifdef __ELF__
 
@@ -1471,9 +1489,11 @@ static BOOL elf_search_and_load_file(struct process* pcs, const WCHAR* filename,
     if (!ret && !strchrW(filename, '/'))
     {
         ret = elf_load_file_from_path(pcs, filename, load_offset, dyn_addr,
-                                      getenv("PATH"), elf_info) ||
-            elf_load_file_from_path(pcs, filename, load_offset, dyn_addr,
-                                    getenv("LD_LIBRARY_PATH"), elf_info);
+                                      getenv("PATH"), elf_info);
+        if (!ret) ret = elf_load_file_from_path(pcs, filename, load_offset, dyn_addr,
+                                                getenv("LD_LIBRARY_PATH"), elf_info);
+        if (!ret) ret = elf_load_file_from_path(pcs, filename, load_offset, dyn_addr,
+                                                BINDIR, elf_info);
         if (!ret) ret = elf_load_file_from_dll_path(pcs, filename,
                                                     load_offset, dyn_addr, elf_info);
     }
index 3420caa..ef94ef6 100644 (file)
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
+#include "config.h"
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
 #include "dbghelp_private.h"
+#include "winternl.h"
+#include "wine/debug.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(dbghelp);
 
index cc991a7..01fa300 100644 (file)
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
+#include "config.h"
+#include "wine/port.h"
+
+#ifdef HAVE_MACH_O_LOADER_H
+#include <CoreFoundation/CFString.h>
+#define LoadResource mac_LoadResource
+#define GetCurrentThread mac_GetCurrentThread
+#include <CoreServices/CoreServices.h>
+#undef LoadResource
+#undef GetCurrentThread
+#undef DPRINTF
+#endif
+
+#include <stdio.h>
+#include <assert.h>
+#include <stdarg.h>
+#include <errno.h>
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#ifdef HAVE_SYS_MMAN_H
+# include <sys/mman.h>
+#endif
+
+#include "ntstatus.h"
+#define WIN32_NO_STATUS
 #include "dbghelp_private.h"
+#include "winternl.h"
+#include "wine/library.h"
+#include "wine/debug.h"
+#include "image_private.h"
 
 #ifdef HAVE_MACH_O_LOADER_H
 
@@ -48,10 +78,6 @@ struct dyld_all_image_infos {
 };
 #endif
 
-#include "winternl.h"
-#include "wine/library.h"
-#include "wine/debug.h"
-
 #ifdef WORDS_BIGENDIAN
 #define swap_ulong_be_to_host(n) (n)
 #else
index e861cca..4dead52 100644 (file)
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
-#include "dbghelp_private.h"
-
 #include <time.h>
 
+#define NONAMELESSUNION
+#define NONAMELESSSTRUCT
+
+#include "ntstatus.h"
+#define WIN32_NO_STATUS
+#include "dbghelp_private.h"
+#include "winternl.h"
+#include "psapi.h"
+#include "wine/debug.h"
+
 WINE_DEFAULT_DEBUG_CHANNEL(dbghelp);
 
 /******************************************************************
index c0084ec..0173469 100644 (file)
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
+#include "config.h"
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <assert.h>
+
 #include "dbghelp_private.h"
+#ifndef DBGHELP_STATIC_LIB
+#include "psapi.h"
+#include "winternl.h"
+#include "wine/debug.h"
+#endif
 
 WINE_DEFAULT_DEBUG_CHANNEL(dbghelp);
 
@@ -91,7 +102,9 @@ static void module_fill_module(const WCHAR* in, WCHAR* out, size_t size)
 
 void module_set_module(struct module* module, const WCHAR* name)
 {
-    module_fill_module(name, module->module.ModuleName, sizeof(module->module.ModuleName));
+    module_fill_module(name, module->module.ModuleName,
+            sizeof(module->module.ModuleName) / sizeof(module->module.ModuleName[0]));
+    module_fill_module(name, module->modulename, sizeof(module->modulename) / sizeof(module->modulename[0]));
 }
 
 const WCHAR *get_wine_loader_name(void)
@@ -815,7 +828,7 @@ BOOL  WINAPI SymEnumerateModulesW64(HANDLE hProcess,
         if (!(dbghelp_options & SYMOPT_WINE_WITH_NATIVE_MODULES) &&
             (module->type == DMT_ELF || module->type == DMT_MACHO))
             continue;
-        if (!EnumModulesCallback(module->module.ModuleName,
+        if (!EnumModulesCallback(module->modulename,
                                  module->module.BaseOfImage, UserContext))
             break;
     }
@@ -915,7 +928,7 @@ BOOL  WINAPI EnumerateLoadedModulesW64(HANDLE hProcess,
         if (!GetModuleInformation(hProcess, hMods[i], &mi, sizeof(mi)) ||
             !GetModuleBaseNameW(hProcess, hMods[i], baseW, sizeof(baseW) / sizeof(WCHAR)))
             continue;
-        module_fill_module(baseW, modW, sizeof(modW) / sizeof(CHAR));
+        module_fill_module(baseW, modW, sizeof(modW) / sizeof(modW[0]));
         EnumLoadedModulesCallback(modW, (DWORD_PTR)mi.lpBaseOfDll, mi.SizeOfImage,
                                   UserContext);
     }
@@ -926,6 +939,12 @@ BOOL  WINAPI EnumerateLoadedModulesW64(HANDLE hProcess,
 
 #endif /* DBGHELP_STATIC_LIB */
 
+static void dbghelp_str_WtoA(const WCHAR *src, char *dst, int dst_len)
+{
+    WideCharToMultiByte(CP_ACP, 0, src, -1, dst, dst_len - 1, NULL, NULL);
+    dst[dst_len - 1] = 0;
+}
+
 /******************************************************************
  *             SymGetModuleInfo (DBGHELP.@)
  *
@@ -941,19 +960,16 @@ BOOL  WINAPI SymGetModuleInfo(HANDLE hProcess, DWORD dwAddr,
     miw64.SizeOfStruct = sizeof(miw64);
     if (!SymGetModuleInfoW64(hProcess, dwAddr, &miw64)) return FALSE;
 
-    mi.SizeOfStruct  = miw64.SizeOfStruct;
+    mi.SizeOfStruct  = ModuleInfo->SizeOfStruct;
     mi.BaseOfImage   = miw64.BaseOfImage;
     mi.ImageSize     = miw64.ImageSize;
     mi.TimeDateStamp = miw64.TimeDateStamp;
     mi.CheckSum      = miw64.CheckSum;
     mi.NumSyms       = miw64.NumSyms;
     mi.SymType       = miw64.SymType;
-    WideCharToMultiByte(CP_ACP, 0, miw64.ModuleName, -1,
-                        mi.ModuleName, sizeof(mi.ModuleName), NULL, NULL);
-    WideCharToMultiByte(CP_ACP, 0, miw64.ImageName, -1,
-                        mi.ImageName, sizeof(mi.ImageName), NULL, NULL);
-    WideCharToMultiByte(CP_ACP, 0, miw64.LoadedImageName, -1,
-                        mi.LoadedImageName, sizeof(mi.LoadedImageName), NULL, NULL);
+    dbghelp_str_WtoA(miw64.ModuleName, mi.ModuleName, sizeof(mi.ModuleName));
+    dbghelp_str_WtoA(miw64.ImageName, mi.ImageName, sizeof(mi.ImageName));
+    dbghelp_str_WtoA(miw64.LoadedImageName, mi.LoadedImageName, sizeof(mi.LoadedImageName));
 
     memcpy(ModuleInfo, &mi, ModuleInfo->SizeOfStruct);
 
@@ -975,7 +991,7 @@ BOOL  WINAPI SymGetModuleInfoW(HANDLE hProcess, DWORD dwAddr,
     miw64.SizeOfStruct = sizeof(miw64);
     if (!SymGetModuleInfoW64(hProcess, dwAddr, &miw64)) return FALSE;
 
-    miw.SizeOfStruct  = miw64.SizeOfStruct;
+    miw.SizeOfStruct  = ModuleInfo->SizeOfStruct;
     miw.BaseOfImage   = miw64.BaseOfImage;
     miw.ImageSize     = miw64.ImageSize;
     miw.TimeDateStamp = miw64.TimeDateStamp;
@@ -1010,25 +1026,20 @@ BOOL  WINAPI SymGetModuleInfo64(HANDLE hProcess, DWORD64 dwAddr,
     miw64.SizeOfStruct = sizeof(miw64);
     if (!SymGetModuleInfoW64(hProcess, dwAddr, &miw64)) return FALSE;
 
-    mi64.SizeOfStruct  = miw64.SizeOfStruct;
+    mi64.SizeOfStruct  = ModuleInfo->SizeOfStruct;
     mi64.BaseOfImage   = miw64.BaseOfImage;
     mi64.ImageSize     = miw64.ImageSize;
     mi64.TimeDateStamp = miw64.TimeDateStamp;
     mi64.CheckSum      = miw64.CheckSum;
     mi64.NumSyms       = miw64.NumSyms;
     mi64.SymType       = miw64.SymType;
-    WideCharToMultiByte(CP_ACP, 0, miw64.ModuleName, -1,
-                        mi64.ModuleName, sizeof(mi64.ModuleName), NULL, NULL);
-    WideCharToMultiByte(CP_ACP, 0, miw64.ImageName, -1,
-                        mi64.ImageName, sizeof(mi64.ImageName), NULL, NULL);
-    WideCharToMultiByte(CP_ACP, 0, miw64.LoadedImageName, -1,
-                        mi64.LoadedImageName, sizeof(mi64.LoadedImageName), NULL, NULL);
-    WideCharToMultiByte(CP_ACP, 0, miw64.LoadedPdbName, -1,
-                        mi64.LoadedPdbName, sizeof(mi64.LoadedPdbName), NULL, NULL);
+    dbghelp_str_WtoA(miw64.ModuleName, mi64.ModuleName, sizeof(mi64.ModuleName));
+    dbghelp_str_WtoA(miw64.ImageName, mi64.ImageName, sizeof(mi64.ImageName));
+    dbghelp_str_WtoA(miw64.LoadedImageName, mi64.LoadedImageName, sizeof(mi64.LoadedImageName));
+    dbghelp_str_WtoA(miw64.LoadedPdbName, mi64.LoadedPdbName, sizeof(mi64.LoadedPdbName));
 
     mi64.CVSig         = miw64.CVSig;
-    WideCharToMultiByte(CP_ACP, 0, miw64.CVData, -1,
-                        mi64.CVData, sizeof(mi64.CVData), NULL, NULL);
+    dbghelp_str_WtoA(miw64.CVData, mi64.CVData, sizeof(mi64.CVData));
     mi64.PdbSig        = miw64.PdbSig;
     mi64.PdbSig70      = miw64.PdbSig70;
     mi64.PdbAge        = miw64.PdbAge;
index 8fe509b..eba2649 100644 (file)
  *     Add symbol size to internal symbol table.
  */
 
-#include "dbghelp_private.h"
+#define NONAMELESSUNION
+
+#include "config.h"
+#include "wine/port.h"
 
-#include <wine/exception.h>
+#include <assert.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <string.h>
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+
+#include <stdarg.h>
+#include "windef.h"
+#include "winbase.h"
+#include "winternl.h"
+
+#include "wine/exception.h"
+#include "wine/debug.h"
+#include "dbghelp_private.h"
+#include "wine/mscvpdb.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(dbghelp_msc);
 
index bd4893b..8c74426 100644 (file)
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
+#include "config.h"
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
 #include "dbghelp_private.h"
+#include "winnls.h"
+#include "winternl.h"
+#include "wine/debug.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(dbghelp);
 
index dac94bb..b629213 100644 (file)
  *
  */
 
+#include "config.h"
+#include "wine/port.h"
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <assert.h>
+
 #include "dbghelp_private.h"
+#include "image_private.h"
+#ifndef DBGHELP_STATIC_LIB
+#include "winternl.h"
+#include "wine/debug.h"
+#endif
 
 WINE_DEFAULT_DEBUG_CHANNEL(dbghelp);
 
diff --git a/dll/win32/dbghelp/precomp.h b/dll/win32/dbghelp/precomp.h
new file mode 100644 (file)
index 0000000..e359f21
--- /dev/null
@@ -0,0 +1,39 @@
+
+#ifndef _DBGHELP_PRECOMP_H_
+#define _DBGHELP_PRECOMP_H_
+
+#include <wine/config.h>
+#include <wine/port.h>
+
+#include <assert.h>
+#include <stdio.h>
+
+#ifdef HAVE_SYS_MMAN_H
+# include <sys/mman.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+
+#define _INC_WINDOWS
+#define COM_NO_WINDOWS_H
+
+#define NONAMELESSUNION
+#define NONAMELESSSTRUCT
+
+#include <ntstatus.h>
+#define WIN32_NO_STATUS
+
+#include "dbghelp_private.h"
+
+#include <winternl.h>
+#include <psapi.h>
+#include <wine/debug.h>
+#include <wine/mscvpdb.h>
+
+#include "image_private.h"
+
+#endif /* !_DBGHELP_PRECOMP_H_ */
index 85bd67f..7ac6026 100644 (file)
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
+#include <assert.h>
+
 #include "dbghelp_private.h"
+#include "image_private.h"
 
+#include <wine/debug.h>
 WINE_DEFAULT_DEBUG_CHANNEL(dbghelp);
 
 #define PDBGHELP_CREATE_USER_DUMP_CALLBACK PVOID
index 05c2725..9b7bf4e 100644 (file)
@@ -8,6 +8,7 @@
 #include "dbghelp_private.h"
 #include <reactos/rossym.h>
 
+#include <wine/debug.h>
 WINE_DEFAULT_DEBUG_CHANNEL(dbghelp_rsym);
 
 
index 29123e1..e98f780 100644 (file)
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  *
  */
+#include "config.h"
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <assert.h>
 
 #include "dbghelp_private.h"
+#ifndef DBGHELP_STATIC_LIB
+#include "wine/debug.h"
+#endif
 
 WINE_DEFAULT_DEBUG_CHANNEL(dbghelp);
 
index faa9f47..1ec0065 100644 (file)
  *     available (hopefully) from http://sources.redhat.com/gdb/onlinedocs
  */
 
-#include "dbghelp_private.h"
+#include "config.h"
+#include "wine/port.h"
+
+#include <sys/types.h>
+#include <fcntl.h>
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#ifdef HAVE_SYS_MMAN_H
+#include <sys/mman.h>
+#endif
+#include <limits.h>
+#include <stdlib.h>
+#include <string.h>
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+#include <stdio.h>
+#include <assert.h>
+#include <stdarg.h>
 
 #ifdef HAVE_MACH_O_NLIST_H
 # include <mach-o/nlist.h>
 #endif
 
+#ifndef DBGHELP_STATIC_LIB
+#include "windef.h"
+#include "winbase.h"
+#include "winnls.h"
+#endif
+
+#include "dbghelp_private.h"
+
+#ifndef DBGHELP_STATIC_LIB
+#include "wine/debug.h"
+#endif
+
 WINE_DEFAULT_DEBUG_CHANNEL(dbghelp_stabs);
 
 #ifndef DBGHELP_STATIC_LIB
index ffb4b31..21412f6 100644 (file)
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
+#include "config.h"
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <assert.h>
+
 #include "dbghelp_private.h"
+#include "wine/debug.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(dbghelp);
 
index 32e80d4..7750ce6 100644 (file)
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
-#include "dbghelp_private.h"
 
+#include "config.h"
+#include <assert.h>
+#include <stdlib.h>
+#ifndef DBGHELP_STATIC_LIB
+#include "wine/debug.h"
+#endif
+
+#include "dbghelp_private.h"
 #ifdef USE_STATS
 #include <math.h>
 #endif
index 9efb474..633aa45 100644 (file)
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
+#define NONAMELESSUNION
+
+#include "config.h"
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <limits.h>
+#include <sys/types.h>
+#include <assert.h>
+#ifndef DBGHELP_STATIC_LIB
+#include "wine/debug.h"
+#endif
 #include "dbghelp_private.h"
+#ifndef DBGHELP_STATIC_LIB
+#include "winnls.h"
+#endif
 
 WINE_DEFAULT_DEBUG_CHANNEL(dbghelp);
 WINE_DECLARE_DEBUG_CHANNEL(dbghelp_symt);
index d55332e..e069231 100644 (file)
  * upon which full support for datatype handling will eventually be built.
  */
 
+#define NONAMELESSUNION
+
+#include "config.h"
+#include <stdlib.h>
+#include <stdarg.h>
+#include <assert.h>
+
+#ifndef DBGHELP_STATIC_LIB
+#include "windef.h"
+#include "winbase.h"
+#include "winnls.h"
+#include "wine/debug.h"
+#endif
 #include "dbghelp_private.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(dbghelp);
index ef3c045..24c72fb 100644 (file)
@@ -63,7 +63,7 @@ reactos/dll/win32/cryptdlg            # Synced to WineStaging-2.9
 reactos/dll/win32/cryptdll            # Synced to WineStaging-2.9
 reactos/dll/win32/cryptnet            # Synced to WineStaging-2.9
 reactos/dll/win32/cryptui             # Synced to WineStaging-2.16
-reactos/dll/win32/dbghelp             # Synced to Wine-3.0
+reactos/dll/win32/dbghelp             # Synced to WineStaging-3.3
 reactos/dll/win32/dciman32            # Synced to WineStaging-2.9
 reactos/dll/win32/faultrep            # Synced to WineStaging-2.9
 reactos/dll/win32/fontsub             # Synced to WineStaging-2.9
index 2f0b479..744c17f 100644 (file)
@@ -96,6 +96,8 @@
  * types, they are not completely linked together.
  */
 
+#pragma once
+
 #include "pshpack1.h"
 
 /* ======================================== *