diff --git a/dlls/dbghelp/Makefile.in b/dlls/dbghelp/Makefile.in index 014942ac521..076c50323dd 100644 --- a/dlls/dbghelp/Makefile.in +++ b/dlls/dbghelp/Makefile.in @@ -3,6 +3,8 @@ IMPORTLIB = dbghelp EXTRADEFS = -D_IMAGEHLP_SOURCE_ DELAYIMPORTS = version +EXTRADLLFLAGS = -mno-cygwin + C_SRCS = \ coff.c \ cpu_arm.c \ diff --git a/dlls/dbghelp/dbghelp_private.h b/dlls/dbghelp/dbghelp_private.h index cdd074709d7..08986881a95 100644 --- a/dlls/dbghelp/dbghelp_private.h +++ b/dlls/dbghelp/dbghelp_private.h @@ -30,7 +30,6 @@ #include "oaidl.h" #include "winnls.h" #include "wine/list.h" -#include "wine/unicode.h" #include "wine/rbtree.h" #include "cvconst.h" diff --git a/dlls/dbghelp/dwarf.c b/dlls/dbghelp/dwarf.c index 0a7b83452a7..5925a00bfe5 100644 --- a/dlls/dbghelp/dwarf.c +++ b/dlls/dbghelp/dwarf.c @@ -718,7 +718,7 @@ compute_location(const struct module *module, dwarf2_traverse_context_t* ctx, st case DW_OP_pick: stack[stk + 1] = stack[stk - dwarf2_parse_byte(ctx)]; stk++; break; case DW_OP_swap: tmp = stack[stk]; stack[stk] = stack[stk-1]; stack[stk-1] = tmp; break; case DW_OP_rot: tmp = stack[stk]; stack[stk] = stack[stk-1]; stack[stk-1] = stack[stk-2]; stack[stk-2] = tmp; break; - case DW_OP_abs: stack[stk] = labs(stack[stk]); break; + case DW_OP_abs: stack[stk] = sizeof(stack[stk]) == 8 ? llabs((INT64)stack[stk]) : abs((INT32)stack[stk]); break; case DW_OP_neg: stack[stk] = -stack[stk]; break; case DW_OP_not: stack[stk] = ~stack[stk]; break; case DW_OP_and: stack[stk-1] &= stack[stk]; stk--; break; @@ -3119,7 +3119,7 @@ static ULONG_PTR eval_expression(const struct module* module, struct cpu_stack_w case DW_OP_pick: stack[sp + 1] = stack[sp - dwarf2_parse_byte(&ctx)]; sp++; break; case DW_OP_swap: tmp = stack[sp]; stack[sp] = stack[sp-1]; stack[sp-1] = tmp; break; case DW_OP_rot: tmp = stack[sp]; stack[sp] = stack[sp-1]; stack[sp-1] = stack[sp-2]; stack[sp-2] = tmp; break; - case DW_OP_abs: stack[sp] = labs(stack[sp]); break; + case DW_OP_abs: stack[sp] = sizeof(stack[sp]) == 8 ? llabs((INT64)stack[sp]) : abs((INT32)stack[sp]); break; case DW_OP_neg: stack[sp] = -stack[sp]; break; case DW_OP_not: stack[sp] = ~stack[sp]; break; case DW_OP_and: stack[sp-1] &= stack[sp]; sp--; break; diff --git a/dlls/dbghelp/elf_module.c b/dlls/dbghelp/elf_module.c index a77b034f420..5f92432d0e8 100644 --- a/dlls/dbghelp/elf_module.c +++ b/dlls/dbghelp/elf_module.c @@ -333,7 +333,7 @@ struct elf_map_file_data }; static BOOL elf_map_file_read(struct image_file_map* fmap, struct elf_map_file_data* emfd, - void* buf, size_t len, off_t off) + void* buf, size_t len, size_t off) { LARGE_INTEGER li; DWORD bytes_read; @@ -1068,8 +1068,8 @@ static BOOL elf_load_debug_info_from_map(struct module* module, lret = dwarf2_parse(module, module->reloc_delta, thunks, fmap); ret = ret || lret; } - if (strstrW(module->module.ModuleName, S_ElfW) || - !strcmpW(module->module.ModuleName, S_WineLoaderW)) + if (wcsstr(module->module.ModuleName, S_ElfW) || + !wcscmp(module->module.ModuleName, S_WineLoaderW)) { /* add the thunks for native libraries */ if (!(dbghelp_options & SYMOPT_PUBLICS_ONLY)) @@ -1263,7 +1263,7 @@ static BOOL elf_load_file_from_fmap(struct process* pcs, const WCHAR* filename, ptr = HeapAlloc(GetProcessHeap(), 0, (lstrlenW(filename) + 1) * sizeof(WCHAR)); if (ptr) { - strcpyW(ptr, filename); + lstrcpyW(ptr, filename); elf_info->module_name = ptr; } else ret = FALSE; @@ -1424,7 +1424,7 @@ static BOOL elf_search_and_load_file(struct process* pcs, const WCHAR* filename, return module->module.SymType; } - if (strstrW(filename, S_libstdcPPW)) return FALSE; /* We know we can't do it */ + if (wcsstr(filename, S_libstdcPPW)) return FALSE; /* We know we can't do it */ ret = elf_load_file(pcs, filename, load_offset, dyn_addr, elf_info); /* if relative pathname, try some absolute base dirs */ if (!ret && filename == file_name(filename)) @@ -1494,7 +1494,7 @@ static BOOL elf_enum_modules_internal(const struct process* pcs, { bufstr[sizeof(bufstr) - 1] = '\0'; MultiByteToWideChar(CP_UNIXCP, 0, bufstr, -1, bufstrW, ARRAY_SIZE(bufstrW)); - if (main_name && !bufstrW[0]) strcpyW(bufstrW, main_name); + if (main_name && !bufstrW[0]) lstrcpyW(bufstrW, main_name); if (!cb(bufstrW, (ULONG_PTR)lm.l_addr, (ULONG_PTR)lm.l_ld, FALSE, user)) break; } @@ -1536,7 +1536,7 @@ static BOOL elf_enum_modules_internal(const struct process* pcs, { bufstr[sizeof(bufstr) - 1] = '\0'; MultiByteToWideChar(CP_UNIXCP, 0, bufstr, -1, bufstrW, ARRAY_SIZE(bufstrW)); - if (main_name && !bufstrW[0]) strcpyW(bufstrW, main_name); + if (main_name && !bufstrW[0]) lstrcpyW(bufstrW, main_name); if (!cb(bufstrW, (ULONG_PTR)lm.l_addr, (ULONG_PTR)lm.l_ld, FALSE, user)) break; } diff --git a/dlls/dbghelp/macho_module.c b/dlls/dbghelp/macho_module.c index 3249a7ab2ac..51119593770 100644 --- a/dlls/dbghelp/macho_module.c +++ b/dlls/dbghelp/macho_module.c @@ -1267,7 +1267,7 @@ static WCHAR *query_dsym(const GUID *uuid, const WCHAR *filename) p += query->DeviceNameLength / sizeof(WCHAR); memcpy(p, dsym_subpath, sizeof(dsym_subpath)); p += ARRAY_SIZE(dsym_subpath) - 1; - strcpyW(p, filename); + lstrcpyW(p, filename); } if (query != (void *)buf) HeapFree(GetProcessHeap(), 0, query); @@ -1300,19 +1300,19 @@ static void find_and_map_dsym(struct process *pcs, struct module* module) return; p = file_name(module->module.LoadedImageName); - len = strlenW(module->module.LoadedImageName) + strlenW(dot_dsym) + strlenW(dsym_subpath) + strlenW(p) + 1; + len = lstrlenW(module->module.LoadedImageName) + lstrlenW(dot_dsym) + lstrlenW(dsym_subpath) + lstrlenW(p) + 1; path = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); if (!path) return; - strcpyW(path, module->module.LoadedImageName); - strcatW(path, dot_dsym); - strcatW(path, dsym_subpath); - strcatW(path, p); + lstrcpyW(path, module->module.LoadedImageName); + lstrcatW(path, dot_dsym); + lstrcatW(path, dsym_subpath); + lstrcatW(path, p); if (try_dsym(pcs, path, fmap)) goto found; - strcpyW(path + strlenW(module->module.LoadedImageName), dot_dwarf); + lstrcpyW(path + lstrlenW(module->module.LoadedImageName), dot_dwarf); if (try_dsym(pcs, path, fmap)) goto found; @@ -1514,7 +1514,7 @@ static BOOL macho_load_file(struct process* pcs, const WCHAR* filename, ptr = HeapAlloc(GetProcessHeap(), 0, (lstrlenW(filename) + 1) * sizeof(WCHAR)); if (ptr) { - strcpyW(ptr, filename); + lstrcpyW(ptr, filename); macho_info->module_name = ptr; } else ret = FALSE; @@ -1566,7 +1566,7 @@ static BOOL macho_search_and_load_file(struct process* pcs, const WCHAR* filenam return module->module.SymType; } - if (strstrW(filename, S_libstdcPPW)) return FALSE; /* We know we can't do it */ + if (wcsstr(filename, S_libstdcPPW)) return FALSE; /* We know we can't do it */ load_params.process = pcs; load_params.load_addr = load_addr; @@ -1658,7 +1658,7 @@ static BOOL macho_enum_modules_internal(const struct process* pcs, bufstr[sizeof(bufstr) - 1] = '\0'; TRACE("[%d] image file %s\n", i, debugstr_a(bufstr)); MultiByteToWideChar(CP_UNIXCP, 0, bufstr, -1, bufstrW, ARRAY_SIZE(bufstrW)); - if (main_name && !bufstrW[0]) strcpyW(bufstrW, main_name); + if (main_name && !bufstrW[0]) lstrcpyW(bufstrW, main_name); if (!cb(bufstrW, info.imageLoadAddress, user)) break; } } diff --git a/dlls/dbghelp/module.c b/dlls/dbghelp/module.c index 3255ac7a246..23e67390185 100644 --- a/dlls/dbghelp/module.c +++ b/dlls/dbghelp/module.c @@ -55,9 +55,9 @@ static int match_ext(const WCHAR* ptr, size_t len) for (e = ext; *e; e++) { - l = strlenW(*e); + l = lstrlenW(*e); if (l >= len) return 0; - if (strncmpiW(&ptr[len - l], *e, l)) continue; + if (wcsnicmp(&ptr[len - l], *e, l)) continue; return l; } return 0; @@ -67,7 +67,7 @@ static const WCHAR* get_filename(const WCHAR* name, const WCHAR* endptr) { const WCHAR* ptr; - if (!endptr) endptr = name + strlenW(name); + if (!endptr) endptr = name + lstrlenW(name); for (ptr = endptr - 1; ptr >= name; ptr--) { if (*ptr == '/' || *ptr == '\\') break; @@ -95,14 +95,14 @@ static BOOL is_wine_loader(const WCHAR *module) else { buffer = heap_alloc( sizeof(wineW) + 2 * sizeof(WCHAR) ); - strcpyW( buffer, wineW ); + lstrcpyW( buffer, wineW ); } - if (!strcmpW( filename, buffer )) + if (!wcscmp( filename, buffer )) ret = TRUE; - strcatW( buffer, suffixW ); - if (!strcmpW( filename, buffer )) + lstrcatW( buffer, suffixW ); + if (!wcscmp( filename, buffer )) ret = TRUE; heap_free( buffer ); @@ -114,7 +114,7 @@ static void module_fill_module(const WCHAR* in, WCHAR* out, size_t size) const WCHAR *ptr, *endptr; size_t len, l; - ptr = get_filename(in, endptr = in + strlenW(in)); + ptr = get_filename(in, endptr = in + lstrlenW(in)); len = min(endptr - ptr, size - 1); memcpy(out, ptr, len * sizeof(WCHAR)); out[len] = '\0'; @@ -124,11 +124,11 @@ static void module_fill_module(const WCHAR* in, WCHAR* out, size_t size) lstrcpynW(out, S_WineLoaderW, size); else { - if (len > 3 && !strcmpiW(&out[len - 3], S_DotSoW) && + if (len > 3 && !wcsicmp(&out[len - 3], S_DotSoW) && (l = match_ext(out, len - 3))) - strcpyW(&out[len - l - 3], S_ElfW); + lstrcpyW(&out[len - l - 3], S_ElfW); } - while ((*out = tolowerW(*out))) out++; + while ((*out = towlower(*out))) out++; } void module_set_module(struct module* module, const WCHAR* name) @@ -157,15 +157,15 @@ WCHAR *get_wine_loader_name(struct process *pcs) else { buffer = heap_alloc( sizeof(wineW) + 2 * sizeof(WCHAR) ); - strcpyW( buffer, wineW ); + lstrcpyW( buffer, wineW ); } - p = buffer + strlenW( buffer ) - strlenW( suffixW ); - if (p > buffer && !strcmpW( p, suffixW )) + p = buffer + lstrlenW( buffer ) - lstrlenW( suffixW ); + if (p > buffer && !wcscmp( p, suffixW )) *p = 0; if (pcs->is_64bit) - strcatW(buffer, suffixW); + lstrcatW(buffer, suffixW); TRACE( "returning %s\n", debugstr_w(buffer) ); return buffer; @@ -269,7 +269,7 @@ struct module* module_find_by_nameW(const struct process* pcs, const WCHAR* name for (module = pcs->lmodules; module; module = module->next) { - if (!strcmpiW(name, module->module.ModuleName)) return module; + if (!wcsicmp(name, module->module.ModuleName)) return module; } SetLastError(ERROR_INVALID_NAME); return NULL; @@ -295,14 +295,14 @@ struct module* module_is_already_loaded(const struct process* pcs, const WCHAR* /* first compare the loaded image name... */ for (module = pcs->lmodules; module; module = module->next) { - if (!strcmpiW(name, module->module.LoadedImageName)) + if (!wcsicmp(name, module->module.LoadedImageName)) return module; } /* then compare the standard filenames (without the path) ... */ filename = get_filename(name, NULL); for (module = pcs->lmodules; module; module = module->next) { - if (!strcmpiW(filename, get_filename(module->module.LoadedImageName, NULL))) + if (!wcsicmp(filename, get_filename(module->module.LoadedImageName, NULL))) return module; } SetLastError(ERROR_INVALID_NAME); @@ -444,7 +444,7 @@ static BOOL module_is_container_loaded(const struct process* pcs, if (!base) return FALSE; filename = get_filename(ImageName, NULL); - len = strlenW(filename); + len = lstrlenW(filename); for (module = pcs->lmodules; module; module = module->next) { @@ -453,7 +453,7 @@ static BOOL module_is_container_loaded(const struct process* pcs, base < module->module.BaseOfImage + module->module.ImageSize) { modname = get_filename(module->module.LoadedImageName, NULL); - if (!strncmpiW(modname, filename, len) && + if (!wcsnicmp(modname, filename, len) && !memcmp(modname + len, S_DotSoW, 3 * sizeof(WCHAR))) { return TRUE; @@ -532,17 +532,17 @@ static BOOL image_locate_debug_link(const struct module* module, struct image_fi if (!fmap_link) return FALSE; filename_len = MultiByteToWideChar(CP_UNIXCP, 0, filename, -1, NULL, 0); - path_len = strlenW(module->module.LoadedImageName); - if (module->real_path) path_len = max(path_len, strlenW(module->real_path)); + path_len = lstrlenW(module->module.LoadedImageName); + if (module->real_path) path_len = max(path_len, lstrlenW(module->real_path)); p = HeapAlloc(GetProcessHeap(), 0, (globalDebugDirLen + path_len + 6 + 1 + filename_len + 1) * sizeof(WCHAR)); if (!p) goto found; /* we prebuild the string with "execdir" */ - strcpyW(p, module->module.LoadedImageName); + lstrcpyW(p, module->module.LoadedImageName); slash = p; - if ((slash2 = strrchrW(slash, '/'))) slash = slash2 + 1; - if ((slash2 = strrchrW(slash, '\\'))) slash = slash2 + 1; + if ((slash2 = wcsrchr(slash, '/'))) slash = slash2 + 1; + if ((slash2 = wcsrchr(slash, '\\'))) slash = slash2 + 1; /* testing execdir/filename */ MultiByteToWideChar(CP_UNIXCP, 0, filename, -1, slash, filename_len); @@ -555,10 +555,10 @@ static BOOL image_locate_debug_link(const struct module* module, struct image_fi if (module->real_path) { - strcpyW(p, module->real_path); + lstrcpyW(p, module->real_path); slash = p; - if ((slash2 = strrchrW(slash, '/'))) slash = slash2 + 1; - if ((slash2 = strrchrW(slash, '\\'))) slash = slash2 + 1; + if ((slash2 = wcsrchr(slash, '/'))) slash = slash2 + 1; + if ((slash2 = wcsrchr(slash, '\\'))) slash = slash2 + 1; MultiByteToWideChar(CP_UNIXCP, 0, filename, -1, slash, filename_len); if (image_check_debug_link(p, fmap_link, crc)) goto found; } @@ -1174,9 +1174,9 @@ BOOL WINAPI SymGetModuleInfoW(HANDLE hProcess, DWORD dwAddr, miw.CheckSum = miw64.CheckSum; miw.NumSyms = miw64.NumSyms; miw.SymType = miw64.SymType; - strcpyW(miw.ModuleName, miw64.ModuleName); - strcpyW(miw.ImageName, miw64.ImageName); - strcpyW(miw.LoadedImageName, miw64.LoadedImageName); + lstrcpyW(miw.ModuleName, miw64.ModuleName); + lstrcpyW(miw.ImageName, miw64.ImageName); + lstrcpyW(miw.LoadedImageName, miw64.LoadedImageName); memcpy(ModuleInfo, &miw, ModuleInfo->SizeOfStruct); return TRUE; diff --git a/dlls/dbghelp/path.c b/dlls/dbghelp/path.c index b706cd1d312..1c0dc6a44ef 100644 --- a/dlls/dbghelp/path.c +++ b/dlls/dbghelp/path.c @@ -46,7 +46,7 @@ const WCHAR* file_name(const WCHAR* str) { const WCHAR* p; - for (p = str + strlenW(str) - 1; p >= str && !is_sep(*p); p--); + for (p = str + lstrlenW(str) - 1; p >= str && !is_sep(*p); p--); return p + 1; } @@ -54,7 +54,7 @@ static inline void file_pathW(const WCHAR *src, WCHAR *dst) { int len; - for (len = strlenW(src) - 1; (len > 0) && (!is_sep(src[len])); len--); + for (len = lstrlenW(src) - 1; (len > 0) && (!is_sep(src[len])); len--); memcpy( dst, src, len * sizeof(WCHAR) ); dst[len] = 0; } @@ -176,12 +176,12 @@ BOOL WINAPI SymMatchFileNameW(PCWSTR file, PCWSTR match, TRACE("(%s %s %p %p)\n", debugstr_w(file), debugstr_w(match), filestop, matchstop); - fptr = file + strlenW(file) - 1; - mptr = match + strlenW(match) - 1; + fptr = file + lstrlenW(file) - 1; + mptr = match + lstrlenW(match) - 1; while (fptr >= file && mptr >= match) { - if (toupperW(*fptr) != toupperW(*mptr) && !(is_sep(*fptr) && is_sep(*mptr))) + if (towupper(*fptr) != towupper(*mptr) && !(is_sep(*fptr) && is_sep(*mptr))) break; fptr--; mptr--; } @@ -229,10 +229,10 @@ static BOOL do_searchW(PCWSTR file, PWSTR buffer, BOOL recurse, static const WCHAR S_DotW[] = {'.','\0'}; static const WCHAR S_DotDotW[] = {'.','.','\0'}; - pos = strlenW(buffer); + pos = lstrlenW(buffer); if (pos == 0) return FALSE; if (buffer[pos - 1] != '\\') buffer[pos++] = '\\'; - strcpyW(buffer + pos, S_AllW); + lstrcpyW(buffer + pos, S_AllW); if ((h = FindFirstFileW(buffer, &fd)) == INVALID_HANDLE_VALUE) return FALSE; /* doc doesn't specify how the tree is enumerated... @@ -240,9 +240,9 @@ static BOOL do_searchW(PCWSTR file, PWSTR buffer, BOOL recurse, */ do { - if (!strcmpW(fd.cFileName, S_DotW) || !strcmpW(fd.cFileName, S_DotDotW)) continue; + if (!wcscmp(fd.cFileName, S_DotW) || !wcscmp(fd.cFileName, S_DotDotW)) continue; - strcpyW(buffer + pos, fd.cFileName); + lstrcpyW(buffer + pos, fd.cFileName); if (recurse && (fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) found = do_searchW(file, buffer, TRUE, cb, user); else if (SymMatchFileNameW(buffer, file, NULL, NULL)) @@ -263,7 +263,7 @@ BOOL WINAPI SearchTreeForFileW(PCWSTR root, PCWSTR file, PWSTR buffer) { TRACE("(%s, %s, %p)\n", debugstr_w(root), debugstr_w(file), buffer); - strcpyW(buffer, root); + lstrcpyW(buffer, root); return do_searchW(file, buffer, TRUE, NULL, NULL); } @@ -296,7 +296,7 @@ BOOL WINAPI EnumDirTreeW(HANDLE hProcess, PCWSTR root, PCWSTR file, TRACE("(%p %s %s %p %p %p)\n", hProcess, debugstr_w(root), debugstr_w(file), buffer, cb, user); - strcpyW(buffer, root); + lstrcpyW(buffer, root); return do_searchW(file, buffer, TRUE, cb, user); } @@ -390,13 +390,13 @@ BOOL WINAPI SymFindFileInPathW(HANDLE hProcess, PCWSTR searchPath, PCWSTR full_p /* first check full path to file */ if (sffip_cb(full_path, &s)) { - strcpyW(buffer, full_path); + lstrcpyW(buffer, full_path); return TRUE; } while (searchPath) { - ptr = strchrW(searchPath, ';'); + ptr = wcschr(searchPath, ';'); if (ptr) { memcpy(tmp, searchPath, (ptr - searchPath) * sizeof(WCHAR)); @@ -405,12 +405,12 @@ BOOL WINAPI SymFindFileInPathW(HANDLE hProcess, PCWSTR searchPath, PCWSTR full_p } else { - strcpyW(tmp, searchPath); + lstrcpyW(tmp, searchPath); searchPath = NULL; } if (do_searchW(filename, tmp, FALSE, sffip_cb, &s)) { - strcpyW(buffer, tmp); + lstrcpyW(buffer, tmp); return TRUE; } } @@ -584,7 +584,7 @@ static BOOL CALLBACK module_find_cb(PCWSTR buffer, PVOID user) } if (matched > mf->matched) { - strcpyW(mf->filename, buffer); + lstrcpyW(mf->filename, buffer); mf->matched = matched; } /* yes, EnumDirTree/do_search and SymFindFileInPath callbacks use the opposite @@ -619,7 +619,7 @@ BOOL path_find_symbol_file(const struct process* pcs, const struct module* modul /* first check full path to file */ if (module_find_cb(full_pathW, &mf)) { - strcpyW( buffer, full_pathW ); + lstrcpyW( buffer, full_pathW ); return TRUE; } @@ -643,7 +643,7 @@ BOOL path_find_symbol_file(const struct process* pcs, const struct module* modul while (searchPath) { - ptr = strchrW(searchPath, ';'); + ptr = wcschr(searchPath, ';'); if (ptr) { memcpy(buffer, searchPath, (ptr - searchPath) * sizeof(WCHAR)); @@ -652,7 +652,7 @@ BOOL path_find_symbol_file(const struct process* pcs, const struct module* modul } else { - strcpyW(buffer, searchPath); + lstrcpyW(buffer, searchPath); searchPath = NULL; } /* return first fully matched file */ @@ -661,7 +661,7 @@ BOOL path_find_symbol_file(const struct process* pcs, const struct module* modul /* if no fully matching file is found, return the best matching file if any */ if ((dbghelp_options & SYMOPT_LOAD_ANYTHING) && mf.matched) { - strcpyW( buffer, mf.filename ); + lstrcpyW( buffer, mf.filename ); *is_unmatched = TRUE; return TRUE; } @@ -716,12 +716,12 @@ BOOL search_dll_path(const WCHAR *name, BOOL (*match)(void*, HANDLE, const WCHAR end = buf + GetEnvironmentVariableW(winebuilddirW, buf, len); memcpy(end, dllsW, sizeof(dllsW)); - strcpyW(end + ARRAY_SIZE(dllsW), name); - if ((p = strrchrW(end, '.')) && !lstrcmpW(p, dot_soW)) *p = 0; - if ((p = strrchrW(end, '.')) && !lstrcmpW(p, dot_dllW)) *p = 0; - p = end + strlenW(end); + lstrcpyW(end + ARRAY_SIZE(dllsW), name); + if ((p = wcsrchr(end, '.')) && !lstrcmpW(p, dot_soW)) *p = 0; + if ((p = wcsrchr(end, '.')) && !lstrcmpW(p, dot_dllW)) *p = 0; + p = end + lstrlenW(end); *p++ = '\\'; - strcpyW(p, name); + lstrcpyW(p, name); file = CreateFileW(buf, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); if (file != INVALID_HANDLE_VALUE) { @@ -732,12 +732,12 @@ BOOL search_dll_path(const WCHAR *name, BOOL (*match)(void*, HANDLE, const WCHAR memcpy(end, programsW, sizeof(programsW)); end += ARRAY_SIZE(programsW); - strcpyW(end, name); - if ((p = strrchrW(end, '.')) && !lstrcmpW(p, dot_soW)) *p = 0; - if ((p = strrchrW(end, '.')) && !lstrcmpW(p, dot_exeW)) *p = 0; - p = end + strlenW(end); + lstrcpyW(end, name); + if ((p = wcsrchr(end, '.')) && !lstrcmpW(p, dot_soW)) *p = 0; + if ((p = wcsrchr(end, '.')) && !lstrcmpW(p, dot_exeW)) *p = 0; + p = end + lstrlenW(end); *p++ = '\\'; - strcpyW(p, name); + lstrcpyW(p, name); file = CreateFileW(buf, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); if (file != INVALID_HANDLE_VALUE) { @@ -752,13 +752,13 @@ BOOL search_dll_path(const WCHAR *name, BOOL (*match)(void*, HANDLE, const WCHAR for (i = 0;; i++) { WCHAR env_name[64]; - sprintfW(env_name, winedlldirW, i); + swprintf(env_name, ARRAY_SIZE(env_name), winedlldirW, i); if (!(len = GetEnvironmentVariableW(env_name, NULL, 0))) break; if (!(buf = heap_alloc((len + lstrlenW(name) + 2) * sizeof(WCHAR)))) return FALSE; len = GetEnvironmentVariableW(env_name, buf, len); buf[len++] = '\\'; - strcpyW(buf + len, name); + lstrcpyW(buf + len, name); file = CreateFileW(buf, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); if (file != INVALID_HANDLE_VALUE) { diff --git a/dlls/dbghelp/pe_module.c b/dlls/dbghelp/pe_module.c index b69085368bd..a5219532b91 100644 --- a/dlls/dbghelp/pe_module.c +++ b/dlls/dbghelp/pe_module.c @@ -777,7 +777,7 @@ struct module* pe_load_native_module(struct process* pcs, const WCHAR* name, return NULL; opened = TRUE; } - else if (name) strcpyW(loaded_name, name); + else if (name) lstrcpyW(loaded_name, name); else if (dbghelp_options & SYMOPT_DEFERRED_LOADS) FIXME("Trouble ahead (no module name passed in deferred mode)\n"); if (!(modfmt = HeapAlloc(GetProcessHeap(), 0, sizeof(struct module_format) + sizeof(struct pe_module_info)))) diff --git a/dlls/dbghelp/symbol.c b/dlls/dbghelp/symbol.c index 7ba1049c079..bcb26ee7048 100644 --- a/dlls/dbghelp/symbol.c +++ b/dlls/dbghelp/symbol.c @@ -1039,7 +1039,7 @@ static BOOL sym_enum(HANDLE hProcess, ULONG64 BaseOfDll, PCWSTR Mask, if (BaseOfDll == 0) { /* do local variables ? */ - if (!Mask || !(bang = strchrW(Mask, '!'))) + if (!Mask || !(bang = wcschr(Mask, '!'))) return symt_enum_locals(pair.pcs, Mask, se); if (bang == Mask) return FALSE; @@ -1082,7 +1082,7 @@ static BOOL sym_enum(HANDLE hProcess, ULONG64 BaseOfDll, PCWSTR Mask, return FALSE; /* we always ignore module name from Mask when BaseOfDll is defined */ - if (Mask && (bang = strchrW(Mask, '!'))) + if (Mask && (bang = wcschr(Mask, '!'))) { if (bang == Mask) return FALSE; Mask = bang + 1; @@ -1841,7 +1841,7 @@ DWORD WINAPI UnDecorateSymbolNameW(const WCHAR *decorated_name, WCHAR *undecorat { MultiByteToWideChar(CP_ACP, 0, ptr, -1, undecorated_name, undecorated_length); undecorated_name[undecorated_length - 1] = 0; - ret = strlenW(undecorated_name); + ret = lstrlenW(undecorated_name); und_free(ptr); } HeapFree(GetProcessHeap(), 0, buf); @@ -1864,7 +1864,7 @@ static int re_fetch_char(const WCHAR** re) static inline int re_match_char(WCHAR ch1, WCHAR ch2, BOOL _case) { - return _case ? ch1 - ch2 : toupperW(ch1) - toupperW(ch2); + return _case ? ch1 - ch2 : towupper(ch1) - towupper(ch2); } static const WCHAR* re_match_one(const WCHAR* string, const WCHAR* elt, BOOL _case)