From fa8d16a0eb52a6fe3d49671f8f69d51d7d341a15 Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Sat, 26 Oct 2019 13:08:05 +0100 Subject: [PATCH] [ADVPACK] Sync with Wine Staging 4.18. CORE-16441 --- dll/win32/advpack/advpack.c | 10 +++++----- dll/win32/advpack/files.c | 4 ++-- dll/win32/advpack/install.c | 17 ++++++++--------- dll/win32/advpack/precomp.h | 2 +- dll/win32/advpack/reg.c | 10 +++++----- media/doc/README.WINE | 2 +- 6 files changed, 22 insertions(+), 23 deletions(-) diff --git a/dll/win32/advpack/advpack.c b/dll/win32/advpack/advpack.c index 2e8027f6402..f2de8a6b257 100644 --- a/dll/win32/advpack/advpack.c +++ b/dll/win32/advpack/advpack.c @@ -20,6 +20,7 @@ */ #include +#include #include "windef.h" #include "winbase.h" @@ -29,7 +30,6 @@ #include "winnls.h" #include "setupapi.h" #include "advpub.h" -#include "wine/unicode.h" #include "wine/debug.h" #include "advpack_private.h" @@ -139,7 +139,7 @@ void set_ldids(HINF hInf, LPCWSTR pszInstallSection, LPCWSTR pszWorkingDir) /* SetupGetLineTextW returns the value if there is only one key, but * returns the whole line if there is more than one key */ - if (!(value = strchrW(line, '='))) + if (!(value = wcschr(line, '='))) { SetupGetStringFieldW(&context, 0, NULL, 0, &size); key = HeapAlloc(GetProcessHeap(), 0, size * sizeof(WCHAR)); @@ -158,10 +158,10 @@ void set_ldids(HINF hInf, LPCWSTR pszInstallSection, LPCWSTR pszWorkingDir) value++; /* Extract the flags */ - ptr = strchrW(value, ','); + ptr = wcschr(value, ','); if (ptr) { *ptr = '\0'; - flags = atolW(ptr+1); + flags = wcstol(ptr+1, NULL, 10); } /* set dest to pszWorkingDir if key is SourceDir */ @@ -177,7 +177,7 @@ void set_ldids(HINF hInf, LPCWSTR pszInstallSection, LPCWSTR pszWorkingDir) /* set all ldids to dest */ while ((ptr = get_parameter(&key, ',', FALSE))) { - ldid = atolW(ptr); + ldid = wcstol(ptr, NULL, 10); SetupSetDirectoryIdW(hInf, ldid, dest); } HeapFree(GetProcessHeap(), 0, key_copy); diff --git a/dll/win32/advpack/files.c b/dll/win32/advpack/files.c index c5efbb25642..3e4cb366007 100644 --- a/dll/win32/advpack/files.c +++ b/dll/win32/advpack/files.c @@ -25,13 +25,13 @@ #include "winbase.h" #include "winuser.h" #include "winreg.h" +#include "winnls.h" #include "winver.h" #include "winternl.h" #include "setupapi.h" #include "advpub.h" #include "fdi.h" #include "wine/debug.h" -#include "wine/unicode.h" #include "advpack_private.h" WINE_DEFAULT_DEBUG_CHANNEL(advpack); @@ -505,7 +505,7 @@ HRESULT WINAPI DelNodeRunDLL32W(HWND hWnd, HINSTANCE hInst, LPWSTR cmdline, INT szFlags = get_parameter(&cmdline_ptr, ',', TRUE); if (szFlags) - dwFlags = atolW(szFlags); + dwFlags = wcstol(szFlags, NULL, 10); res = DelNodeW(szFilename, dwFlags); diff --git a/dll/win32/advpack/install.c b/dll/win32/advpack/install.c index c3caf3ae7eb..70dc4d74aa6 100644 --- a/dll/win32/advpack/install.c +++ b/dll/win32/advpack/install.c @@ -31,7 +31,6 @@ #include "advpub.h" #include "ole2.h" #include "wine/debug.h" -#include "wine/unicode.h" #include "advpack_private.h" WINE_DEFAULT_DEBUG_CHANNEL(advpack); @@ -207,7 +206,7 @@ LPWSTR get_parameter(LPWSTR *params, WCHAR separator, BOOL quoted) if (quoted && *token == '"') { - WCHAR *end = strchrW(token + 1, '"'); + WCHAR *end = wcschr(token + 1, '"'); if (end) { *end = 0; @@ -216,7 +215,7 @@ LPWSTR get_parameter(LPWSTR *params, WCHAR separator, BOOL quoted) } } - *params = strchrW(*params, separator); + *params = wcschr(*params, separator); if (*params) *(*params)++ = '\0'; @@ -397,7 +396,7 @@ static HRESULT get_working_dir(ADVInfo *info, LPCWSTR inf_filename, LPCWSTR work static const WCHAR backslash[] = {'\\',0}; static const WCHAR inf_dir[] = {'\\','I','N','F',0}; - if ((ptr = strrchrW(inf_filename, '\\'))) + if ((ptr = wcsrchr(inf_filename, '\\'))) { len = ptr - inf_filename + 1; ptr = inf_filename; @@ -451,7 +450,7 @@ static HRESULT install_init(LPCWSTR inf_filename, LPCWSTR install_sec, 'D','e','f','a','u','l','t','I','n','s','t','a','l','l',0 }; - if (!(ptr = strrchrW(inf_filename, '\\'))) + if (!(ptr = wcsrchr(inf_filename, '\\'))) ptr = inf_filename; len = lstrlenW(ptr); @@ -493,7 +492,7 @@ static HRESULT install_init(LPCWSTR inf_filename, LPCWSTR install_sec, lstrcatW(info->inf_path, backslash); lstrcatW(info->inf_path, info->inf_filename); - /* RunSetupCommand opens unmodifed filename parameter */ + /* RunSetupCommand opens unmodified filename parameter */ if (flags & RSC_FLAG_INF) path = inf_filename; else @@ -769,7 +768,7 @@ INT WINAPI LaunchINFSectionW(HWND hWnd, HINSTANCE hInst, LPWSTR cmdline, INT sho str_flags = get_parameter(&cmdline_ptr, ',', TRUE); if (str_flags) { - DWORD inf_flags = atolW(str_flags); + DWORD inf_flags = wcstol(str_flags, NULL, 10); if (inf_flags & LIS_QUIET) flags |= RSC_FLAG_QUIET; if (inf_flags & LIS_NOGRPCONV) flags |= RSC_FLAG_NGCONV; } @@ -867,7 +866,7 @@ HRESULT WINAPI LaunchINFSectionExW(HWND hWnd, HINSTANCE hInst, LPWSTR cmdline, I flags = get_parameter(&cmdline_ptr, ',', TRUE); if (flags) - cabinfo.dwFlags = atolW(flags); + cabinfo.dwFlags = wcstol(flags, NULL, 10); if (!is_full_path(cabinfo.pszCab) && !is_full_path(cabinfo.pszInf)) { @@ -883,7 +882,7 @@ HRESULT WINAPI LaunchINFSectionExW(HWND hWnd, HINSTANCE hInst, LPWSTR cmdline, I else lstrcpyW(cabinfo.szSrcPath, cabinfo.pszCab); - ptr = strrchrW(cabinfo.szSrcPath, '\\'); + ptr = wcsrchr(cabinfo.szSrcPath, '\\'); *(++ptr) = '\0'; } diff --git a/dll/win32/advpack/precomp.h b/dll/win32/advpack/precomp.h index a1c236fe339..99f9b22c4f5 100644 --- a/dll/win32/advpack/precomp.h +++ b/dll/win32/advpack/precomp.h @@ -12,11 +12,11 @@ #include #include #include +#include #include #include #include -#include #include "advpack_private.h" diff --git a/dll/win32/advpack/reg.c b/dll/win32/advpack/reg.c index 82c1d2b6e8c..d6c4a6d36ad 100644 --- a/dll/win32/advpack/reg.c +++ b/dll/win32/advpack/reg.c @@ -22,11 +22,11 @@ #include "windef.h" #include "winbase.h" #include "winreg.h" +#include "winnls.h" #include "winerror.h" #include "winuser.h" #include "winternl.h" #include "advpub.h" -#include "wine/unicode.h" #include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(advpack); @@ -186,16 +186,16 @@ static HRESULT write_predefined_strings(HMODULE hm, LPCWSTR ini_path) *sys_root = '\0'; GetEnvironmentVariableW(SystemRoot, sys_root, ARRAY_SIZE(sys_root)); - if(!strncmpiW(sys_root, mod_path + 1, strlenW(sys_root))) + if(!_wcsnicmp(sys_root, mod_path + 1, lstrlenW(sys_root))) { *sys_mod_path = '\"'; - strcpyW(sys_mod_path + 1, escaped_SystemRoot); - strcatW(sys_mod_path, mod_path + 1 + strlenW(sys_root)); + lstrcpyW(sys_mod_path + 1, escaped_SystemRoot); + lstrcatW(sys_mod_path, mod_path + 1 + lstrlenW(sys_root)); } else { FIXME("SYS_MOD_PATH needs more work\n"); - strcpyW(sys_mod_path, mod_path); + lstrcpyW(sys_mod_path, mod_path); } WritePrivateProfileStringW(Strings, SYS_MOD_PATH, sys_mod_path, ini_path); diff --git a/media/doc/README.WINE b/media/doc/README.WINE index e9355bf8981..1f4ff18efaf 100644 --- a/media/doc/README.WINE +++ b/media/doc/README.WINE @@ -45,7 +45,7 @@ dll/directx/wine/wined3d # Synced to WineStaging-3.3 dll/win32/activeds # Synced to WineStaging-4.18 dll/win32/actxprxy # Synced to WineStaging-3.3 -dll/win32/advpack # Synced to WineStaging-4.0 +dll/win32/advpack # Synced to WineStaging-4.18 dll/win32/atl # Synced to WineStaging-4.0 dll/win32/atl80 # Synced to WineStaging-3.3 dll/win32/atl100 # Synced to WineStaging-3.3