Commit e12d39dc authored by Alexandre Julliard's avatar Alexandre Julliard

winhlp32: Avoid Unicode macros.

parent edf44bfb
MODULE = winhlp32.exe MODULE = winhlp32.exe
APPMODE = -mwindows APPMODE = -mwindows
EXTRADEFS = -DWINE_NO_UNICODE_MACROS
IMPORTS = user32 gdi32 IMPORTS = user32 gdi32
DELAYIMPORTS = shell32 comctl32 comdlg32 DELAYIMPORTS = shell32 comctl32 comdlg32
......
...@@ -46,7 +46,7 @@ static HANDLE CALLBACK WHD_Open(LPSTR name, BYTE flags) ...@@ -46,7 +46,7 @@ static HANDLE CALLBACK WHD_Open(LPSTR name, BYTE flags)
case 2: mode = GENERIC_READ; break; case 2: mode = GENERIC_READ; break;
default: WINE_FIXME("Undocumented flags %x\n", flags); default: WINE_FIXME("Undocumented flags %x\n", flags);
} }
return CreateFile(name, mode, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, return CreateFileA(name, mode, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL,
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
} }
......
...@@ -902,7 +902,7 @@ static BOOL HLPFILE_RtfAddTransparentBitmap(struct RtfData* rd, const BITMAPINFO ...@@ -902,7 +902,7 @@ static BOOL HLPFILE_RtfAddTransparentBitmap(struct RtfData* rd, const BITMAPINFO
DeleteDC(hdcMem); DeleteDC(hdcMem);
/* we create the bitmap on the fly */ /* we create the bitmap on the fly */
hdcEMF = CreateEnhMetaFile(NULL, NULL, NULL, NULL); hdcEMF = CreateEnhMetaFileW(NULL, NULL, NULL, NULL);
hdcMem = CreateCompatibleDC(hdcEMF); hdcMem = CreateCompatibleDC(hdcEMF);
/* sets to RGB(0,0,0) the transparent bits in final bitmap */ /* sets to RGB(0,0,0) the transparent bits in final bitmap */
...@@ -2014,7 +2014,7 @@ static BOOL HLPFILE_SystemCommands(HLPFILE* hlpfile) ...@@ -2014,7 +2014,7 @@ static BOOL HLPFILE_SystemCommands(HLPFILE* hlpfile)
hlpfile->lpszTitle = HeapAlloc(GetProcessHeap(), 0, strlen(str) + 1); hlpfile->lpszTitle = HeapAlloc(GetProcessHeap(), 0, strlen(str) + 1);
if (!hlpfile->lpszTitle) return FALSE; if (!hlpfile->lpszTitle) return FALSE;
lstrcpy(hlpfile->lpszTitle, str); strcpy(hlpfile->lpszTitle, str);
WINE_TRACE("Title: %s\n", hlpfile->lpszTitle); WINE_TRACE("Title: %s\n", hlpfile->lpszTitle);
/* Nothing more to parse */ /* Nothing more to parse */
return TRUE; return TRUE;
...@@ -2028,7 +2028,7 @@ static BOOL HLPFILE_SystemCommands(HLPFILE* hlpfile) ...@@ -2028,7 +2028,7 @@ static BOOL HLPFILE_SystemCommands(HLPFILE* hlpfile)
if (hlpfile->lpszTitle) {WINE_WARN("title\n"); break;} if (hlpfile->lpszTitle) {WINE_WARN("title\n"); break;}
hlpfile->lpszTitle = HeapAlloc(GetProcessHeap(), 0, strlen(str) + 1); hlpfile->lpszTitle = HeapAlloc(GetProcessHeap(), 0, strlen(str) + 1);
if (!hlpfile->lpszTitle) return FALSE; if (!hlpfile->lpszTitle) return FALSE;
lstrcpy(hlpfile->lpszTitle, str); strcpy(hlpfile->lpszTitle, str);
WINE_TRACE("Title: %s\n", hlpfile->lpszTitle); WINE_TRACE("Title: %s\n", hlpfile->lpszTitle);
break; break;
...@@ -2036,7 +2036,7 @@ static BOOL HLPFILE_SystemCommands(HLPFILE* hlpfile) ...@@ -2036,7 +2036,7 @@ static BOOL HLPFILE_SystemCommands(HLPFILE* hlpfile)
if (hlpfile->lpszCopyright) {WINE_WARN("copyright\n"); break;} if (hlpfile->lpszCopyright) {WINE_WARN("copyright\n"); break;}
hlpfile->lpszCopyright = HeapAlloc(GetProcessHeap(), 0, strlen(str) + 1); hlpfile->lpszCopyright = HeapAlloc(GetProcessHeap(), 0, strlen(str) + 1);
if (!hlpfile->lpszCopyright) return FALSE; if (!hlpfile->lpszCopyright) return FALSE;
lstrcpy(hlpfile->lpszCopyright, str); strcpy(hlpfile->lpszCopyright, str);
WINE_TRACE("Copyright: %s\n", hlpfile->lpszCopyright); WINE_TRACE("Copyright: %s\n", hlpfile->lpszCopyright);
break; break;
...@@ -2047,10 +2047,10 @@ static BOOL HLPFILE_SystemCommands(HLPFILE* hlpfile) ...@@ -2047,10 +2047,10 @@ static BOOL HLPFILE_SystemCommands(HLPFILE* hlpfile)
break; break;
case 4: case 4:
macro = HeapAlloc(GetProcessHeap(), 0, sizeof(HLPFILE_MACRO) + lstrlen(str) + 1); macro = HeapAlloc(GetProcessHeap(), 0, sizeof(HLPFILE_MACRO) + strlen(str) + 1);
if (!macro) break; if (!macro) break;
p = (char*)macro + sizeof(HLPFILE_MACRO); p = (char*)macro + sizeof(HLPFILE_MACRO);
lstrcpy(p, str); strcpy(p, str);
macro->lpszMacro = p; macro->lpszMacro = p;
macro->next = 0; macro->next = 0;
for (m = &hlpfile->first_macro; *m; m = &(*m)->next); for (m = &hlpfile->first_macro; *m; m = &(*m)->next);
...@@ -2734,7 +2734,7 @@ HLPFILE *HLPFILE_ReadHlpFile(LPCSTR lpszPath) ...@@ -2734,7 +2734,7 @@ HLPFILE *HLPFILE_ReadHlpFile(LPCSTR lpszPath)
} }
hlpfile = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, hlpfile = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
sizeof(HLPFILE) + lstrlen(lpszPath) + 1); sizeof(HLPFILE) + strlen(lpszPath) + 1);
if (!hlpfile) return 0; if (!hlpfile) return 0;
hlpfile->lpszPath = (char*)hlpfile + sizeof(HLPFILE); hlpfile->lpszPath = (char*)hlpfile + sizeof(HLPFILE);
......
...@@ -90,7 +90,7 @@ typedef struct ...@@ -90,7 +90,7 @@ typedef struct
typedef struct typedef struct
{ {
LOGFONT LogFont; LOGFONTA LogFont;
HFONT hFont; HFONT hFont;
COLORREF color; COLORREF color;
} HLPFILE_FONT; } HLPFILE_FONT;
......
...@@ -61,7 +61,7 @@ static WINHELP_BUTTON** MACRO_LookupButton(WINHELP_WINDOW* win, LPCSTR na ...@@ -61,7 +61,7 @@ static WINHELP_BUTTON** MACRO_LookupButton(WINHELP_WINDOW* win, LPCSTR na
WINHELP_BUTTON** b; WINHELP_BUTTON** b;
for (b = &win->first_button; *b; b = &(*b)->next) for (b = &win->first_button; *b; b = &(*b)->next)
if (!lstrcmpi(name, (*b)->lpszID)) break; if (!lstrcmpiA(name, (*b)->lpszID)) break;
return b; return b;
} }
...@@ -79,7 +79,7 @@ void CALLBACK MACRO_CreateButton(LPCSTR id, LPCSTR name, LPCSTR macro) ...@@ -79,7 +79,7 @@ void CALLBACK MACRO_CreateButton(LPCSTR id, LPCSTR name, LPCSTR macro)
WINE_TRACE("(\"%s\", \"%s\", %s)\n", id, name, macro); WINE_TRACE("(\"%s\", \"%s\", %s)\n", id, name, macro);
size = sizeof(WINHELP_BUTTON) + lstrlen(id) + lstrlen(name) + lstrlen(macro) + 3; size = sizeof(WINHELP_BUTTON) + strlen(id) + strlen(name) + strlen(macro) + 3;
button = HeapAlloc(GetProcessHeap(), 0, size); button = HeapAlloc(GetProcessHeap(), 0, size);
if (!button) return; if (!button) return;
...@@ -89,15 +89,15 @@ void CALLBACK MACRO_CreateButton(LPCSTR id, LPCSTR name, LPCSTR macro) ...@@ -89,15 +89,15 @@ void CALLBACK MACRO_CreateButton(LPCSTR id, LPCSTR name, LPCSTR macro)
ptr = (char*)button + sizeof(WINHELP_BUTTON); ptr = (char*)button + sizeof(WINHELP_BUTTON);
lstrcpy(ptr, id); strcpy(ptr, id);
button->lpszID = ptr; button->lpszID = ptr;
ptr += lstrlen(id) + 1; ptr += strlen(id) + 1;
lstrcpy(ptr, name); strcpy(ptr, name);
button->lpszName = ptr; button->lpszName = ptr;
ptr += lstrlen(name) + 1; ptr += strlen(name) + 1;
lstrcpy(ptr, macro); strcpy(ptr, macro);
button->lpszMacro = ptr; button->lpszMacro = ptr;
button->wParam = WH_FIRST_BUTTON; button->wParam = WH_FIRST_BUTTON;
...@@ -236,8 +236,8 @@ static void CALLBACK MACRO_ChangeButtonBinding(LPCSTR id, LPCSTR macro) ...@@ -236,8 +236,8 @@ static void CALLBACK MACRO_ChangeButtonBinding(LPCSTR id, LPCSTR macro)
b = MACRO_LookupButton(win, id); b = MACRO_LookupButton(win, id);
if (!*b) {WINE_FIXME("Couldn't find button '%s'\n", id); return;} if (!*b) {WINE_FIXME("Couldn't find button '%s'\n", id); return;}
size = sizeof(WINHELP_BUTTON) + lstrlen(id) + size = sizeof(WINHELP_BUTTON) + strlen(id) +
lstrlen((*b)->lpszName) + lstrlen(macro) + 3; strlen((*b)->lpszName) + strlen(macro) + 3;
button = HeapAlloc(GetProcessHeap(), 0, size); button = HeapAlloc(GetProcessHeap(), 0, size);
if (!button) return; if (!button) return;
...@@ -248,15 +248,15 @@ static void CALLBACK MACRO_ChangeButtonBinding(LPCSTR id, LPCSTR macro) ...@@ -248,15 +248,15 @@ static void CALLBACK MACRO_ChangeButtonBinding(LPCSTR id, LPCSTR macro)
ptr = (char*)button + sizeof(WINHELP_BUTTON); ptr = (char*)button + sizeof(WINHELP_BUTTON);
lstrcpy(ptr, id); strcpy(ptr, id);
button->lpszID = ptr; button->lpszID = ptr;
ptr += lstrlen(id) + 1; ptr += strlen(id) + 1;
lstrcpy(ptr, (*b)->lpszName); strcpy(ptr, (*b)->lpszName);
button->lpszName = ptr; button->lpszName = ptr;
ptr += lstrlen((*b)->lpszName) + 1; ptr += strlen((*b)->lpszName) + 1;
lstrcpy(ptr, macro); strcpy(ptr, macro);
button->lpszMacro = ptr; button->lpszMacro = ptr;
*b = button; *b = button;
...@@ -291,7 +291,7 @@ static void CALLBACK MACRO_CloseSecondarys(void) ...@@ -291,7 +291,7 @@ static void CALLBACK MACRO_CloseSecondarys(void)
for (win = Globals.win_list; win; win = next) for (win = Globals.win_list; win; win = next)
{ {
next = win->next; next = win->next;
if (lstrcmpi(win->info->name, "main")) if (lstrcmpiA(win->info->name, "main"))
WINHELP_ReleaseWindow(win); WINHELP_ReleaseWindow(win);
} }
} }
...@@ -308,7 +308,7 @@ static void CALLBACK MACRO_CloseWindow(LPCSTR lpszWindow) ...@@ -308,7 +308,7 @@ static void CALLBACK MACRO_CloseWindow(LPCSTR lpszWindow)
for (win = Globals.win_list; win; win = next) for (win = Globals.win_list; win; win = next)
{ {
next = win->next; next = win->next;
if (!lstrcmpi(win->info->name, lpszWindow)) if (!lstrcmpiA(win->info->name, lpszWindow))
WINHELP_ReleaseWindow(win); WINHELP_ReleaseWindow(win);
} }
} }
...@@ -415,7 +415,7 @@ static void CALLBACK MACRO_ExtInsertMenu(LPCSTR str1, LPCSTR str2, LPCSTR str3, ...@@ -415,7 +415,7 @@ static void CALLBACK MACRO_ExtInsertMenu(LPCSTR str1, LPCSTR str2, LPCSTR str3,
static BOOL CALLBACK MACRO_FileExist(LPCSTR str) static BOOL CALLBACK MACRO_FileExist(LPCSTR str)
{ {
WINE_TRACE("(\"%s\")\n", str); WINE_TRACE("(\"%s\")\n", str);
return GetFileAttributes(str) != INVALID_FILE_ATTRIBUTES; return GetFileAttributesA(str) != INVALID_FILE_ATTRIBUTES;
} }
void CALLBACK MACRO_FileOpen(void) void CALLBACK MACRO_FileOpen(void)
...@@ -457,7 +457,7 @@ static void CALLBACK MACRO_FocusWindow(LPCSTR lpszWindow) ...@@ -457,7 +457,7 @@ static void CALLBACK MACRO_FocusWindow(LPCSTR lpszWindow)
if (!lpszWindow || !lpszWindow[0]) lpszWindow = "main"; if (!lpszWindow || !lpszWindow[0]) lpszWindow = "main";
for (win = Globals.win_list; win; win = win->next) for (win = Globals.win_list; win; win = win->next)
if (!lstrcmpi(win->info->name, lpszWindow)) if (!lstrcmpiA(win->info->name, lpszWindow))
SetFocus(win->hMainWnd); SetFocus(win->hMainWnd);
} }
...@@ -494,7 +494,7 @@ void CALLBACK MACRO_HelpOnTop(void) ...@@ -494,7 +494,7 @@ void CALLBACK MACRO_HelpOnTop(void)
HMENU menu; HMENU menu;
for (win = Globals.win_list; win; win = win->next) for (win = Globals.win_list; win; win = win->next)
if (!lstrcmpi(win->info->name, "main")) if (!lstrcmpiA(win->info->name, "main"))
main_wnd = win->hMainWnd; main_wnd = win->hMainWnd;
if (!main_wnd) if (!main_wnd)
{ {
...@@ -519,7 +519,7 @@ void CALLBACK MACRO_History(void) ...@@ -519,7 +519,7 @@ void CALLBACK MACRO_History(void)
if (Globals.active_win && !Globals.active_win->hHistoryWnd) if (Globals.active_win && !Globals.active_win->hHistoryWnd)
{ {
HWND hWnd = CreateWindow(HISTORY_WIN_CLASS_NAME, "History", WS_OVERLAPPEDWINDOW, HWND hWnd = CreateWindowA(HISTORY_WIN_CLASS_NAME, "History", WS_OVERLAPPEDWINDOW,
0, 0, 0, 0, 0, 0, Globals.hInstance, Globals.active_win); 0, 0, 0, 0, 0, 0, Globals.hInstance, Globals.active_win);
ShowWindow(hWnd, SW_NORMAL); ShowWindow(hWnd, SW_NORMAL);
} }
...@@ -714,7 +714,7 @@ static void CALLBACK MACRO_Prev(void) ...@@ -714,7 +714,7 @@ static void CALLBACK MACRO_Prev(void)
void CALLBACK MACRO_Print(void) void CALLBACK MACRO_Print(void)
{ {
PRINTDLG printer; PRINTDLGW printer;
WINE_TRACE("()\n"); WINE_TRACE("()\n");
...@@ -738,7 +738,7 @@ void CALLBACK MACRO_Print(void) ...@@ -738,7 +738,7 @@ void CALLBACK MACRO_Print(void)
printer.hPrintTemplate = 0; printer.hPrintTemplate = 0;
printer.hSetupTemplate = 0; printer.hSetupTemplate = 0;
if (PrintDlgA(&printer)) { if (PrintDlgW(&printer)) {
WINE_FIXME("Print()\n"); WINE_FIXME("Print()\n");
} }
} }
...@@ -765,7 +765,7 @@ static void CALLBACK MACRO_RegisterRoutine(LPCSTR dll_name, LPCSTR proc, LPCSTR ...@@ -765,7 +765,7 @@ static void CALLBACK MACRO_RegisterRoutine(LPCSTR dll_name, LPCSTR proc, LPCSTR
} }
if (!dll) if (!dll)
{ {
HANDLE hLib = LoadLibrary(dll_name); HANDLE hLib = LoadLibraryA(dll_name);
/* FIXME: the library will not be unloaded until exit of program /* FIXME: the library will not be unloaded until exit of program
* We don't send the DW_TERM message * We don't send the DW_TERM message
......
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