Commit c09ac7a4 authored by Alexandre Julliard's avatar Alexandre Julliard

winedbg: Use the explicit name for all A/W function.

parent 09db5288
...@@ -7,6 +7,7 @@ APPMODE = -mconsole ...@@ -7,6 +7,7 @@ APPMODE = -mconsole
IMPORTS = psapi dbghelp advapi32 kernel32 ntdll IMPORTS = psapi dbghelp advapi32 kernel32 ntdll
DELAYIMPORTS = user32 gdi32 DELAYIMPORTS = user32 gdi32
EXTRALIBS = @LIBPOLL@ EXTRALIBS = @LIBPOLL@
EXTRADEFS = -DWINE_NO_UNICODE_MACROS
C_SRCS = \ C_SRCS = \
be_alpha.c \ be_alpha.c \
......
...@@ -556,7 +556,7 @@ void parser_handle(HANDLE input) ...@@ -556,7 +556,7 @@ void parser_handle(HANDLE input)
static void parser(const char* filename) static void parser(const char* filename)
{ {
HANDLE h = CreateFile(filename, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0L, 0); HANDLE h = CreateFileA(filename, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0L, 0);
if (h != INVALID_HANDLE_VALUE) if (h != INVALID_HANDLE_VALUE)
{ {
parser_handle(h); parser_handle(h);
...@@ -577,8 +577,8 @@ HANDLE parser_generate_command_file(const char* pmt, ...) ...@@ -577,8 +577,8 @@ HANDLE parser_generate_command_file(const char* pmt, ...)
DWORD w; DWORD w;
const char* p; const char* p;
GetTempPath(sizeof(path), path); GetTempPathA(sizeof(path), path);
GetTempFileName(path, "WD", 0, file); GetTempFileNameA(path, "WD", 0, file);
hFile = CreateFileA(file, GENERIC_READ|GENERIC_WRITE|DELETE, FILE_SHARE_DELETE, hFile = CreateFileA(file, GENERIC_READ|GENERIC_WRITE|DELETE, FILE_SHARE_DELETE,
NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_DELETE_ON_CLOSE, 0); NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_DELETE_ON_CLOSE, 0);
if (hFile != INVALID_HANDLE_VALUE) if (hFile != INVALID_HANDLE_VALUE)
......
...@@ -160,7 +160,7 @@ struct dbg_breakpoint ...@@ -160,7 +160,7 @@ struct dbg_breakpoint
typedef struct tagTHREADNAME_INFO typedef struct tagTHREADNAME_INFO
{ {
DWORD dwType; /* Must be 0x1000 */ DWORD dwType; /* Must be 0x1000 */
LPCTSTR szName; /* Pointer to name - limited to 9 bytes (8 characters + terminator) */ LPCSTR szName; /* Pointer to name - limited to 9 bytes (8 characters + terminator) */
DWORD dwThreadID; /* Thread ID (-1 = caller thread) */ DWORD dwThreadID; /* Thread ID (-1 = caller thread) */
DWORD dwFlags; /* Reserved for future use. Must be zero. */ DWORD dwFlags; /* Reserved for future use. Must be zero. */
} THREADNAME_INFO; } THREADNAME_INFO;
......
...@@ -1501,9 +1501,9 @@ static void packet_query_monitor_wnd_helper(struct gdb_context* gdbctx, HWND hWn ...@@ -1501,9 +1501,9 @@ static void packet_query_monitor_wnd_helper(struct gdb_context* gdbctx, HWND hWn
HWND child; HWND child;
do { do {
if (!GetClassName(hWnd, clsName, sizeof(clsName))) if (!GetClassNameA(hWnd, clsName, sizeof(clsName)))
strcpy(clsName, "-- Unknown --"); strcpy(clsName, "-- Unknown --");
if (!GetWindowText(hWnd, wndName, sizeof(wndName))) if (!GetWindowTextA(hWnd, wndName, sizeof(wndName)))
strcpy(wndName, "-- Empty --"); strcpy(wndName, "-- Empty --");
packet_reply_open(gdbctx); packet_reply_open(gdbctx);
...@@ -1511,8 +1511,8 @@ static void packet_query_monitor_wnd_helper(struct gdb_context* gdbctx, HWND hWn ...@@ -1511,8 +1511,8 @@ static void packet_query_monitor_wnd_helper(struct gdb_context* gdbctx, HWND hWn
snprintf(buffer, sizeof(buffer), snprintf(buffer, sizeof(buffer),
"%*s%04lx%*s%-17.17s %08x %08x %.14s\n", "%*s%04lx%*s%-17.17s %08x %08x %.14s\n",
indent, "", (ULONG_PTR)hWnd, 13 - indent, "", indent, "", (ULONG_PTR)hWnd, 13 - indent, "",
clsName, GetWindowLong(hWnd, GWL_STYLE), clsName, GetWindowLongW(hWnd, GWL_STYLE),
GetWindowLongPtr(hWnd, GWLP_WNDPROC), wndName); GetWindowLongPtrW(hWnd, GWLP_WNDPROC), wndName);
packet_reply_hex_to_str(gdbctx, buffer); packet_reply_hex_to_str(gdbctx, buffer);
packet_reply_close(gdbctx); packet_reply_close(gdbctx);
......
...@@ -280,9 +280,9 @@ static void class_walker(HWND hWnd, struct class_walker* cw) ...@@ -280,9 +280,9 @@ static void class_walker(HWND hWnd, struct class_walker* cw)
ATOM atom; ATOM atom;
HWND child; HWND child;
if (!GetClassName(hWnd, clsName, sizeof(clsName))) if (!GetClassNameA(hWnd, clsName, sizeof(clsName)))
return; return;
if ((atom = FindAtom(clsName)) == 0) if ((atom = FindAtomA(clsName)) == 0)
return; return;
for (i = 0; i < cw->used; i++) for (i = 0; i < cw->used; i++)
...@@ -310,7 +310,7 @@ static void class_walker(HWND hWnd, struct class_walker* cw) ...@@ -310,7 +310,7 @@ static void class_walker(HWND hWnd, struct class_walker* cw)
void info_win32_class(HWND hWnd, const char* name) void info_win32_class(HWND hWnd, const char* name)
{ {
WNDCLASSEXA wca; WNDCLASSEXA wca;
HINSTANCE hInst = hWnd ? (HINSTANCE)GetWindowLongPtr(hWnd, GWLP_HINSTANCE) : 0; HINSTANCE hInst = hWnd ? (HINSTANCE)GetWindowLongPtrW(hWnd, GWLP_HINSTANCE) : 0;
if (!name) if (!name)
{ {
...@@ -323,7 +323,7 @@ void info_win32_class(HWND hWnd, const char* name) ...@@ -323,7 +323,7 @@ void info_win32_class(HWND hWnd, const char* name)
return; return;
} }
if (!GetClassInfoEx(hInst, name, &wca)) if (!GetClassInfoExA(hInst, name, &wca))
{ {
dbg_printf("Cannot find class '%s'\n", name); dbg_printf("Cannot find class '%s'\n", name);
return; return;
...@@ -366,15 +366,15 @@ static void info_window(HWND hWnd, int indent) ...@@ -366,15 +366,15 @@ static void info_window(HWND hWnd, int indent)
do do
{ {
if (!GetClassName(hWnd, clsName, sizeof(clsName))) if (!GetClassNameA(hWnd, clsName, sizeof(clsName)))
strcpy(clsName, "-- Unknown --"); strcpy(clsName, "-- Unknown --");
if (!GetWindowText(hWnd, wndName, sizeof(wndName))) if (!GetWindowTextA(hWnd, wndName, sizeof(wndName)))
strcpy(wndName, "-- Empty --"); strcpy(wndName, "-- Empty --");
dbg_printf("%*s%08lx%*s %-17.17s %08x %08x %08x %.14s\n", dbg_printf("%*s%08lx%*s %-17.17s %08x %08x %08x %.14s\n",
indent, "", (DWORD_PTR)hWnd, 12 - indent, "", indent, "", (DWORD_PTR)hWnd, 12 - indent, "",
clsName, GetWindowLong(hWnd, GWL_STYLE), clsName, GetWindowLongW(hWnd, GWL_STYLE),
GetWindowLongPtr(hWnd, GWLP_WNDPROC), GetWindowLongPtrW(hWnd, GWLP_WNDPROC),
GetWindowThreadProcessId(hWnd, NULL), wndName); GetWindowThreadProcessId(hWnd, NULL), wndName);
if ((child = GetWindow(hWnd, GW_CHILD)) != 0) if ((child = GetWindow(hWnd, GW_CHILD)) != 0)
...@@ -400,9 +400,9 @@ void info_win32_window(HWND hWnd, BOOL detailed) ...@@ -400,9 +400,9 @@ void info_win32_window(HWND hWnd, BOOL detailed)
return; return;
} }
if (!GetClassName(hWnd, clsName, sizeof(clsName))) if (!GetClassNameA(hWnd, clsName, sizeof(clsName)))
strcpy(clsName, "-- Unknown --"); strcpy(clsName, "-- Unknown --");
if (!GetWindowText(hWnd, wndName, sizeof(wndName))) if (!GetWindowTextA(hWnd, wndName, sizeof(wndName)))
strcpy(wndName, "-- Empty --"); strcpy(wndName, "-- Empty --");
if (!GetClientRect(hWnd, &clientRect) || if (!GetClientRect(hWnd, &clientRect) ||
!MapWindowPoints(hWnd, 0, (LPPOINT) &clientRect, 2)) !MapWindowPoints(hWnd, 0, (LPPOINT) &clientRect, 2))
...@@ -420,23 +420,23 @@ void info_win32_window(HWND hWnd, BOOL detailed) ...@@ -420,23 +420,23 @@ void info_win32_window(HWND hWnd, BOOL detailed)
GetParent(hWnd), GetParent(hWnd),
GetWindow(hWnd, GW_OWNER), GetWindow(hWnd, GW_OWNER),
clsName, clsName,
(HINSTANCE)GetWindowLongPtr(hWnd, GWLP_HINSTANCE), (HINSTANCE)GetWindowLongPtrW(hWnd, GWLP_HINSTANCE),
GetLastActivePopup(hWnd), GetLastActivePopup(hWnd),
GetWindowLongPtr(hWnd, GWLP_ID), GetWindowLongPtrW(hWnd, GWLP_ID),
GetWindowLong(hWnd, GWL_STYLE), GetWindowLongW(hWnd, GWL_STYLE),
GetWindowLong(hWnd, GWL_EXSTYLE), GetWindowLongW(hWnd, GWL_EXSTYLE),
GetWindowLongPtr(hWnd, GWLP_WNDPROC), GetWindowLongPtrW(hWnd, GWLP_WNDPROC),
wndName, wndName,
clientRect.left, clientRect.top, clientRect.right, clientRect.bottom, clientRect.left, clientRect.top, clientRect.right, clientRect.bottom,
windowRect.left, windowRect.top, windowRect.right, windowRect.bottom, windowRect.left, windowRect.top, windowRect.right, windowRect.bottom,
GetSystemMenu(hWnd, FALSE)); GetSystemMenu(hWnd, FALSE));
if (GetClassLong(hWnd, GCL_CBWNDEXTRA)) if (GetClassLongW(hWnd, GCL_CBWNDEXTRA))
{ {
UINT i; UINT i;
dbg_printf("Extra bytes:"); dbg_printf("Extra bytes:");
for (i = 0; i < GetClassLong(hWnd, GCL_CBWNDEXTRA) / 2; i++) for (i = 0; i < GetClassLongW(hWnd, GCL_CBWNDEXTRA) / 2; i++)
{ {
w = GetWindowWord(hWnd, i * 2); w = GetWindowWord(hWnd, i * 2);
/* FIXME: depends on i386 endian-ity */ /* FIXME: depends on i386 endian-ity */
......
...@@ -84,11 +84,11 @@ static void* source_map_file(const char* name, HANDLE* hMap, unsigned* size) ...@@ -84,11 +84,11 @@ static void* source_map_file(const char* name, HANDLE* hMap, unsigned* size)
{ {
HANDLE hFile; HANDLE hFile;
hFile = CreateFile(name, GENERIC_READ, FILE_SHARE_READ, NULL, hFile = CreateFileA(name, GENERIC_READ, FILE_SHARE_READ, NULL,
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
if (hFile == INVALID_HANDLE_VALUE) return (void*)-1; if (hFile == INVALID_HANDLE_VALUE) return (void*)-1;
if (size != NULL && (*size = GetFileSize(hFile, NULL)) == -1) return (void*)-1; if (size != NULL && (*size = GetFileSize(hFile, NULL)) == -1) return (void*)-1;
*hMap = CreateFileMapping(hFile, NULL, PAGE_READONLY, 0, 0, NULL); *hMap = CreateFileMappingW(hFile, NULL, PAGE_READONLY, 0, 0, NULL);
CloseHandle(hFile); CloseHandle(hFile);
if (!*hMap) return (void*)-1; if (!*hMap) return (void*)-1;
return MapViewOfFile(*hMap, FILE_MAP_READ, 0, 0, 0); return MapViewOfFile(*hMap, FILE_MAP_READ, 0, 0, 0);
...@@ -115,7 +115,7 @@ static BOOL source_locate_file(const char* srcfile, char* path) ...@@ -115,7 +115,7 @@ static BOOL source_locate_file(const char* srcfile, char* path)
{ {
BOOL found = FALSE; BOOL found = FALSE;
if (GetFileAttributes(srcfile) != INVALID_FILE_ATTRIBUTES) if (GetFileAttributesA(srcfile) != INVALID_FILE_ATTRIBUTES)
{ {
strcpy(path, srcfile); strcpy(path, srcfile);
found = TRUE; found = TRUE;
...@@ -216,7 +216,7 @@ static int source_display(const char* sourcefile, int start, int end) ...@@ -216,7 +216,7 @@ static int source_display(const char* sourcefile, int start, int end)
} }
else tmppath[0] = '\0'; else tmppath[0] = '\0';
if (GetFileAttributes(tmppath) == INVALID_FILE_ATTRIBUTES) if (GetFileAttributesA(tmppath) == INVALID_FILE_ATTRIBUTES)
{ {
/* /*
* OK, I guess the user doesn't really want to see it * OK, I guess the user doesn't really want to see it
......
...@@ -745,7 +745,7 @@ static unsigned dbg_start_debuggee(LPSTR cmdLine) ...@@ -745,7 +745,7 @@ static unsigned dbg_start_debuggee(LPSTR cmdLine)
flags = DEBUG_PROCESS | CREATE_NEW_CONSOLE; flags = DEBUG_PROCESS | CREATE_NEW_CONSOLE;
if (!DBG_IVAR(AlsoDebugProcChild)) flags |= DEBUG_ONLY_THIS_PROCESS; if (!DBG_IVAR(AlsoDebugProcChild)) flags |= DEBUG_ONLY_THIS_PROCESS;
if (!CreateProcess(NULL, cmdLine, NULL, NULL, FALSE, flags, if (!CreateProcessA(NULL, cmdLine, NULL, NULL, FALSE, flags,
NULL, NULL, &startup, &info)) NULL, NULL, &startup, &info))
{ {
dbg_printf("Couldn't start process '%s'\n", cmdLine); dbg_printf("Couldn't start process '%s'\n", cmdLine);
...@@ -950,8 +950,8 @@ enum dbg_start dbg_active_auto(int argc, char* argv[]) ...@@ -950,8 +950,8 @@ enum dbg_start dbg_active_auto(int argc, char* argv[])
{ {
char path[MAX_PATH]; char path[MAX_PATH];
GetTempPath(sizeof(path), path); GetTempPathA(sizeof(path), path);
GetTempFileName(path, "WD", 0, tmp + 10); GetTempFileNameA(path, "WD", 0, tmp + 10);
} }
else strcpy(tmp + 10, file); else strcpy(tmp + 10, file);
strcat(tmp, "\""); strcat(tmp, "\"");
......
...@@ -51,7 +51,7 @@ void minidump_write(const char* file, const EXCEPTION_RECORD* rec) ...@@ -51,7 +51,7 @@ void minidump_write(const char* file, const EXCEPTION_RECORD* rec)
MINIDUMP_EXCEPTION_INFORMATION mei; MINIDUMP_EXCEPTION_INFORMATION mei;
EXCEPTION_POINTERS ep; EXCEPTION_POINTERS ep;
hFile = CreateFile(file, GENERIC_READ|GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, hFile = CreateFileA(file, GENERIC_READ|GENERIC_WRITE, 0, NULL, CREATE_ALWAYS,
FILE_ATTRIBUTE_NORMAL, NULL); FILE_ATTRIBUTE_NORMAL, NULL);
if (hFile == INVALID_HANDLE_VALUE) return; if (hFile == INVALID_HANDLE_VALUE) return;
......
...@@ -201,7 +201,7 @@ static unsigned dbg_load_internal_vars(void) ...@@ -201,7 +201,7 @@ static unsigned dbg_load_internal_vars(void)
{ {
if (!dbg_internal_vars[i].pval) if (!dbg_internal_vars[i].pval)
{ {
if (!RegQueryValueEx(hkey, dbg_internal_vars[i].name, 0, if (!RegQueryValueExA(hkey, dbg_internal_vars[i].name, 0,
&type, (LPBYTE)&val, &count)) &type, (LPBYTE)&val, &count))
dbg_internal_vars[i].val = val; dbg_internal_vars[i].val = val;
dbg_internal_vars[i].pval = &dbg_internal_vars[i].val; dbg_internal_vars[i].pval = &dbg_internal_vars[i].val;
...@@ -229,7 +229,7 @@ static unsigned dbg_save_internal_vars(void) ...@@ -229,7 +229,7 @@ static unsigned dbg_save_internal_vars(void)
{ {
/* FIXME: type should be inferred from basic type -if any- of intvar */ /* FIXME: type should be inferred from basic type -if any- of intvar */
if (dbg_internal_vars[i].pval == &dbg_internal_vars[i].val) if (dbg_internal_vars[i].pval == &dbg_internal_vars[i].val)
RegSetValueEx(hkey, dbg_internal_vars[i].name, 0, RegSetValueExA(hkey, dbg_internal_vars[i].name, 0,
REG_DWORD, (const void*)dbg_internal_vars[i].pval, REG_DWORD, (const void*)dbg_internal_vars[i].pval,
sizeof(*dbg_internal_vars[i].pval)); sizeof(*dbg_internal_vars[i].pval));
} }
...@@ -565,7 +565,7 @@ void dbg_init_console(void) ...@@ -565,7 +565,7 @@ void dbg_init_console(void)
SetConsoleCtrlHandler(ctrl_c_handler, TRUE); SetConsoleCtrlHandler(ctrl_c_handler, TRUE);
/* set our own title */ /* set our own title */
SetConsoleTitle("Wine Debugger"); SetConsoleTitleA("Wine Debugger");
} }
static int dbg_winedbg_usage(BOOL advanced) static int dbg_winedbg_usage(BOOL advanced)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment