From e32507b52592e82f87f97d58148c6d84c328ea45 Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Mon, 23 Dec 2019 00:57:33 +0100 Subject: [PATCH] [LOCALUI] Sync with Wine Staging 4.18. CORE-16441 --- media/doc/README.WINE | 2 +- .../printing/monitors/localmon/ui/localui.c | 22 ++++++++++--------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/media/doc/README.WINE b/media/doc/README.WINE index 277510e938b..f49e47cdf73 100644 --- a/media/doc/README.WINE +++ b/media/doc/README.WINE @@ -224,7 +224,7 @@ dll/win32/xolehlp # Synced to WineStaging-3.21 dll/cpl/inetcpl # Synced to WineStaging-4.18 -win32ss/printing/monitors/localmon/ui/ # Synced to WineStaging-3.3 (known there as /dll/win32/localui) +win32ss/printing/monitors/localmon/ui/ # Synced to WineStaging-4.18 (known there as /dll/win32/localui) ReactOS shares the following programs with Winehq. diff --git a/win32ss/printing/monitors/localmon/ui/localui.c b/win32ss/printing/monitors/localmon/ui/localui.c index 9fb975cd851..f548f55c2e8 100644 --- a/win32ss/printing/monitors/localmon/ui/localui.c +++ b/win32ss/printing/monitors/localmon/ui/localui.c @@ -19,6 +19,9 @@ */ #include +#ifdef __REACTOS__ +#include +#endif #include "windef.h" #include "winbase.h" @@ -30,7 +33,6 @@ #include "ddk/winsplp.h" #include "wine/debug.h" -#include "wine/unicode.h" #include "localui.h" WINE_DEFAULT_DEBUG_CHANNEL(localui); @@ -187,7 +189,7 @@ static void dlg_port_already_exists(HWND hWnd, LPCWSTR portname) message = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); if (message) { message[0] = '\0'; - snprintfW(message, len, res_PortExistsW, portname); + swprintf(message, res_PortExistsW, portname); MessageBoxW(hWnd, message, res_PortW, MB_OK | MB_ICONERROR); HeapFree(GetProcessHeap(), 0, message); } @@ -213,7 +215,7 @@ static void dlg_invalid_portname(HWND hWnd, LPCWSTR portname) message = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); if (message) { message[0] = '\0'; - snprintfW(message, len, res_InvalidNameW, portname); + swprintf(message, res_InvalidNameW, portname); MessageBoxW(hWnd, message, res_PortW, MB_OK | MB_ICONERROR); HeapFree(GetProcessHeap(), 0, message); } @@ -375,12 +377,12 @@ static INT_PTR CALLBACK dlgproc_lptconfig(HWND hwnd, UINT msg, WPARAM wparam, LP status = FALSE; res = GetDlgItemInt(hwnd, LPTCONFIG_EDIT, (BOOL *) &status, FALSE); /* length is in WCHAR, including the '\0' */ - GetDlgItemTextW(hwnd, LPTCONFIG_EDIT, bufferW, sizeof(bufferW) / sizeof(bufferW[0])); + GetDlgItemTextW(hwnd, LPTCONFIG_EDIT, bufferW, ARRAY_SIZE(bufferW)); TRACE("got %s and %u (translated: %u)\n", debugstr_w(bufferW), res, status); /* native localui.dll use the same limits */ if ((res > 0) && (res < 1000000) && status) { - sprintfW(bufferW, fmt_uW, res); + swprintf(bufferW, fmt_uW, res); res = XcvDataW( data->hXcv, cmd_ConfigureLPTPortCommandOKW, (PBYTE) bufferW, (lstrlenW(bufferW) +1) * sizeof(WCHAR), @@ -416,13 +418,13 @@ static DWORD get_type_from_name(LPCWSTR name) { HANDLE hfile; - if (!strncmpiW(name, portname_LPT, sizeof(portname_LPT) / sizeof(WCHAR) -1)) + if (!_wcsnicmp(name, portname_LPT, ARRAY_SIZE(portname_LPT) -1)) return PORT_IS_LPT; - if (!strncmpiW(name, portname_COM, sizeof(portname_COM) / sizeof(WCHAR) -1)) + if (!_wcsnicmp(name, portname_COM, ARRAY_SIZE(portname_COM) -1)) return PORT_IS_COM; - if (!strcmpiW(name, portname_FILE)) + if (!wcsicmp(name, portname_FILE)) return PORT_IS_FILE; if (name[0] == '/') @@ -431,10 +433,10 @@ static DWORD get_type_from_name(LPCWSTR name) if (name[0] == '|') return PORT_IS_PIPE; - if (!strncmpW(name, portname_CUPS, sizeof(portname_CUPS) / sizeof(WCHAR) -1)) + if (!wcsncmp(name, portname_CUPS, ARRAY_SIZE(portname_CUPS) -1)) return PORT_IS_CUPS; - if (!strncmpW(name, portname_LPR, sizeof(portname_LPR) / sizeof(WCHAR) -1)) + if (!wcsncmp(name, portname_LPR, ARRAY_SIZE(portname_LPR) -1)) return PORT_IS_LPR; /* Must be a file or a directory. Does the file exist ? */ -- 2.17.1