Commit e12d39dc authored by Alexandre Julliard's avatar Alexandre Julliard

winhlp32: Avoid Unicode macros.

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