advpack: Build with msvcrt.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
1ff9bbd071
commit
58f22b03f6
|
@ -2,6 +2,8 @@ MODULE = advpack.dll
|
||||||
IMPORTLIB = advpack
|
IMPORTLIB = advpack
|
||||||
IMPORTS = ole32 setupapi version advapi32
|
IMPORTS = ole32 setupapi version advapi32
|
||||||
|
|
||||||
|
EXTRADLLFLAGS = -mno-cygwin
|
||||||
|
|
||||||
C_SRCS = \
|
C_SRCS = \
|
||||||
advpack.c \
|
advpack.c \
|
||||||
files.c \
|
files.c \
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "windef.h"
|
#include "windef.h"
|
||||||
#include "winbase.h"
|
#include "winbase.h"
|
||||||
|
@ -29,7 +30,6 @@
|
||||||
#include "winnls.h"
|
#include "winnls.h"
|
||||||
#include "setupapi.h"
|
#include "setupapi.h"
|
||||||
#include "advpub.h"
|
#include "advpub.h"
|
||||||
#include "wine/unicode.h"
|
|
||||||
#include "wine/debug.h"
|
#include "wine/debug.h"
|
||||||
#include "advpack_private.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
|
/* SetupGetLineTextW returns the value if there is only one key, but
|
||||||
* returns the whole line if there is more than one key
|
* 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);
|
SetupGetStringFieldW(&context, 0, NULL, 0, &size);
|
||||||
key = HeapAlloc(GetProcessHeap(), 0, size * sizeof(WCHAR));
|
key = HeapAlloc(GetProcessHeap(), 0, size * sizeof(WCHAR));
|
||||||
|
@ -158,10 +158,10 @@ void set_ldids(HINF hInf, LPCWSTR pszInstallSection, LPCWSTR pszWorkingDir)
|
||||||
value++;
|
value++;
|
||||||
|
|
||||||
/* Extract the flags */
|
/* Extract the flags */
|
||||||
ptr = strchrW(value, ',');
|
ptr = wcschr(value, ',');
|
||||||
if (ptr) {
|
if (ptr) {
|
||||||
*ptr = '\0';
|
*ptr = '\0';
|
||||||
flags = atolW(ptr+1);
|
flags = wcstol(ptr+1, NULL, 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* set dest to pszWorkingDir if key is SourceDir */
|
/* 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 */
|
/* set all ldids to dest */
|
||||||
while ((ptr = get_parameter(&key, ',', FALSE)))
|
while ((ptr = get_parameter(&key, ',', FALSE)))
|
||||||
{
|
{
|
||||||
ldid = atolW(ptr);
|
ldid = wcstol(ptr, NULL, 10);
|
||||||
SetupSetDirectoryIdW(hInf, ldid, dest);
|
SetupSetDirectoryIdW(hInf, ldid, dest);
|
||||||
}
|
}
|
||||||
HeapFree(GetProcessHeap(), 0, key_copy);
|
HeapFree(GetProcessHeap(), 0, key_copy);
|
||||||
|
|
|
@ -25,13 +25,13 @@
|
||||||
#include "winbase.h"
|
#include "winbase.h"
|
||||||
#include "winuser.h"
|
#include "winuser.h"
|
||||||
#include "winreg.h"
|
#include "winreg.h"
|
||||||
|
#include "winnls.h"
|
||||||
#include "winver.h"
|
#include "winver.h"
|
||||||
#include "winternl.h"
|
#include "winternl.h"
|
||||||
#include "setupapi.h"
|
#include "setupapi.h"
|
||||||
#include "advpub.h"
|
#include "advpub.h"
|
||||||
#include "fdi.h"
|
#include "fdi.h"
|
||||||
#include "wine/debug.h"
|
#include "wine/debug.h"
|
||||||
#include "wine/unicode.h"
|
|
||||||
#include "advpack_private.h"
|
#include "advpack_private.h"
|
||||||
|
|
||||||
WINE_DEFAULT_DEBUG_CHANNEL(advpack);
|
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);
|
szFlags = get_parameter(&cmdline_ptr, ',', TRUE);
|
||||||
|
|
||||||
if (szFlags)
|
if (szFlags)
|
||||||
dwFlags = atolW(szFlags);
|
dwFlags = wcstol(szFlags, NULL, 10);
|
||||||
|
|
||||||
res = DelNodeW(szFilename, dwFlags);
|
res = DelNodeW(szFilename, dwFlags);
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,6 @@
|
||||||
#include "advpub.h"
|
#include "advpub.h"
|
||||||
#include "ole2.h"
|
#include "ole2.h"
|
||||||
#include "wine/debug.h"
|
#include "wine/debug.h"
|
||||||
#include "wine/unicode.h"
|
|
||||||
#include "advpack_private.h"
|
#include "advpack_private.h"
|
||||||
|
|
||||||
WINE_DEFAULT_DEBUG_CHANNEL(advpack);
|
WINE_DEFAULT_DEBUG_CHANNEL(advpack);
|
||||||
|
@ -207,7 +206,7 @@ LPWSTR get_parameter(LPWSTR *params, WCHAR separator, BOOL quoted)
|
||||||
|
|
||||||
if (quoted && *token == '"')
|
if (quoted && *token == '"')
|
||||||
{
|
{
|
||||||
WCHAR *end = strchrW(token + 1, '"');
|
WCHAR *end = wcschr(token + 1, '"');
|
||||||
if (end)
|
if (end)
|
||||||
{
|
{
|
||||||
*end = 0;
|
*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)
|
if (*params)
|
||||||
*(*params)++ = '\0';
|
*(*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 backslash[] = {'\\',0};
|
||||||
static const WCHAR inf_dir[] = {'\\','I','N','F',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;
|
len = ptr - inf_filename + 1;
|
||||||
ptr = inf_filename;
|
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
|
'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;
|
ptr = inf_filename;
|
||||||
|
|
||||||
len = lstrlenW(ptr);
|
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);
|
str_flags = get_parameter(&cmdline_ptr, ',', TRUE);
|
||||||
if (str_flags)
|
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_QUIET) flags |= RSC_FLAG_QUIET;
|
||||||
if (inf_flags & LIS_NOGRPCONV) flags |= RSC_FLAG_NGCONV;
|
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);
|
flags = get_parameter(&cmdline_ptr, ',', TRUE);
|
||||||
if (flags)
|
if (flags)
|
||||||
cabinfo.dwFlags = atolW(flags);
|
cabinfo.dwFlags = wcstol(flags, NULL, 10);
|
||||||
|
|
||||||
if (!is_full_path(cabinfo.pszCab) && !is_full_path(cabinfo.pszInf))
|
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
|
else
|
||||||
lstrcpyW(cabinfo.szSrcPath, cabinfo.pszCab);
|
lstrcpyW(cabinfo.szSrcPath, cabinfo.pszCab);
|
||||||
|
|
||||||
ptr = strrchrW(cabinfo.szSrcPath, '\\');
|
ptr = wcsrchr(cabinfo.szSrcPath, '\\');
|
||||||
*(++ptr) = '\0';
|
*(++ptr) = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,11 +22,11 @@
|
||||||
#include "windef.h"
|
#include "windef.h"
|
||||||
#include "winbase.h"
|
#include "winbase.h"
|
||||||
#include "winreg.h"
|
#include "winreg.h"
|
||||||
|
#include "winnls.h"
|
||||||
#include "winerror.h"
|
#include "winerror.h"
|
||||||
#include "winuser.h"
|
#include "winuser.h"
|
||||||
#include "winternl.h"
|
#include "winternl.h"
|
||||||
#include "advpub.h"
|
#include "advpub.h"
|
||||||
#include "wine/unicode.h"
|
|
||||||
#include "wine/debug.h"
|
#include "wine/debug.h"
|
||||||
|
|
||||||
WINE_DEFAULT_DEBUG_CHANNEL(advpack);
|
WINE_DEFAULT_DEBUG_CHANNEL(advpack);
|
||||||
|
@ -186,16 +186,16 @@ static HRESULT write_predefined_strings(HMODULE hm, LPCWSTR ini_path)
|
||||||
*sys_root = '\0';
|
*sys_root = '\0';
|
||||||
GetEnvironmentVariableW(SystemRoot, sys_root, ARRAY_SIZE(sys_root));
|
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 = '\"';
|
*sys_mod_path = '\"';
|
||||||
strcpyW(sys_mod_path + 1, escaped_SystemRoot);
|
lstrcpyW(sys_mod_path + 1, escaped_SystemRoot);
|
||||||
strcatW(sys_mod_path, mod_path + 1 + strlenW(sys_root));
|
lstrcatW(sys_mod_path, mod_path + 1 + lstrlenW(sys_root));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
FIXME("SYS_MOD_PATH needs more work\n");
|
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);
|
WritePrivateProfileStringW(Strings, SYS_MOD_PATH, sys_mod_path, ini_path);
|
||||||
|
|
Loading…
Reference in New Issue