Commit 58f22b03 authored by Alexandre Julliard's avatar Alexandre Julliard

advpack: Build with msvcrt.

parent 1ff9bbd0
......@@ -2,6 +2,8 @@ MODULE = advpack.dll
IMPORTLIB = advpack
IMPORTS = ole32 setupapi version advapi32
EXTRADLLFLAGS = -mno-cygwin
C_SRCS = \
advpack.c \
files.c \
......
......@@ -20,6 +20,7 @@
*/
#include <stdarg.h>
#include <stdlib.h>
#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);
......
......@@ -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);
......
......@@ -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);
......@@ -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';
}
......
......@@ -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);
......
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