Commit 7cd3c9f0 authored by Alexandre Julliard's avatar Alexandre Julliard

msi: Build with msvcrt.

parent 5182813a
...@@ -4,6 +4,8 @@ IMPORTS = uuid urlmon wininet comctl32 shell32 shlwapi cabinet oleaut32 ole32 ...@@ -4,6 +4,8 @@ IMPORTS = uuid urlmon wininet comctl32 shell32 shlwapi cabinet oleaut32 ole32
EXTRAIDLFLAGS = --prefix-server=s_ EXTRAIDLFLAGS = --prefix-server=s_
EXTRADLLFLAGS = -mno-cygwin
C_SRCS = \ C_SRCS = \
action.c \ action.c \
alter.c \ alter.c \
......
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
#include "msidefs.h" #include "msidefs.h"
#include "winver.h" #include "winver.h"
#include "shlwapi.h" #include "shlwapi.h"
#include "wine/unicode.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "msipriv.h" #include "msipriv.h"
...@@ -55,20 +54,20 @@ void msi_parse_version_string(LPCWSTR verStr, PDWORD ms, PDWORD ls) ...@@ -55,20 +54,20 @@ void msi_parse_version_string(LPCWSTR verStr, PDWORD ms, PDWORD ls)
const WCHAR *ptr; const WCHAR *ptr;
int x1 = 0, x2 = 0, x3 = 0, x4 = 0; int x1 = 0, x2 = 0, x3 = 0, x4 = 0;
x1 = atoiW(verStr); x1 = wcstol(verStr, NULL, 10);
ptr = strchrW(verStr, '.'); ptr = wcschr(verStr, '.');
if (ptr) if (ptr)
{ {
x2 = atoiW(ptr + 1); x2 = wcstol(ptr + 1, NULL, 10);
ptr = strchrW(ptr + 1, '.'); ptr = wcschr(ptr + 1, '.');
} }
if (ptr) if (ptr)
{ {
x3 = atoiW(ptr + 1); x3 = wcstol(ptr + 1, NULL, 10);
ptr = strchrW(ptr + 1, '.'); ptr = wcschr(ptr + 1, '.');
} }
if (ptr) if (ptr)
x4 = atoiW(ptr + 1); x4 = wcstol(ptr + 1, NULL, 10);
/* FIXME: byte-order dependent? */ /* FIXME: byte-order dependent? */
*ms = x1 << 16 | x2; *ms = x1 << 16 | x2;
if (ls) *ls = x3 << 16 | x4; if (ls) *ls = x3 << 16 | x4;
...@@ -106,10 +105,10 @@ static UINT get_signature( MSIPACKAGE *package, MSISIGNATURE *sig, const WCHAR * ...@@ -106,10 +105,10 @@ static UINT get_signature( MSIPACKAGE *package, MSISIGNATURE *sig, const WCHAR *
/* get properties */ /* get properties */
sig->File = msi_dup_record_field(row,2); sig->File = msi_dup_record_field(row,2);
if ((p = strchrW(sig->File, '|'))) if ((p = wcschr(sig->File, '|')))
{ {
p++; p++;
memmove(sig->File, p, (strlenW(p) + 1) * sizeof(WCHAR)); memmove(sig->File, p, (lstrlenW(p) + 1) * sizeof(WCHAR));
} }
minVersion = msi_dup_record_field(row,3); minVersion = msi_dup_record_field(row,3);
...@@ -287,7 +286,7 @@ static UINT search_components( MSIPACKAGE *package, WCHAR **appValue, MSISIGNATU ...@@ -287,7 +286,7 @@ static UINT search_components( MSIPACKAGE *package, WCHAR **appValue, MSISIGNATU
{ {
if (type == msidbLocatorTypeFileName) if (type == msidbLocatorTypeFileName)
{ {
ptr = strrchrW(path, '\\'); ptr = wcsrchr(path, '\\');
*(ptr + 1) = '\0'; *(ptr + 1) = '\0';
} }
else else
...@@ -327,12 +326,12 @@ static void convert_reg_value( DWORD regType, const BYTE *value, DWORD sz, WCHAR ...@@ -327,12 +326,12 @@ static void convert_reg_value( DWORD regType, const BYTE *value, DWORD sz, WCHAR
/* escape leading pound with another */ /* escape leading pound with another */
*appValue = msi_alloc(sz + sizeof(WCHAR)); *appValue = msi_alloc(sz + sizeof(WCHAR));
(*appValue)[0] = '#'; (*appValue)[0] = '#';
strcpyW(*appValue + 1, (LPCWSTR)value); lstrcpyW(*appValue + 1, (LPCWSTR)value);
} }
else else
{ {
*appValue = msi_alloc(sz); *appValue = msi_alloc(sz);
strcpyW(*appValue, (LPCWSTR)value); lstrcpyW(*appValue, (LPCWSTR)value);
} }
break; break;
case REG_DWORD: case REG_DWORD:
...@@ -340,7 +339,7 @@ static void convert_reg_value( DWORD regType, const BYTE *value, DWORD sz, WCHAR ...@@ -340,7 +339,7 @@ static void convert_reg_value( DWORD regType, const BYTE *value, DWORD sz, WCHAR
* char if needed * char if needed
*/ */
*appValue = msi_alloc(10 * sizeof(WCHAR)); *appValue = msi_alloc(10 * sizeof(WCHAR));
sprintfW(*appValue, dwordFmt, *(const DWORD *)value); swprintf(*appValue, 10, dwordFmt, *(const DWORD *)value);
break; break;
case REG_EXPAND_SZ: case REG_EXPAND_SZ:
sz = ExpandEnvironmentStringsW((LPCWSTR)value, NULL, 0); sz = ExpandEnvironmentStringsW((LPCWSTR)value, NULL, 0);
...@@ -353,7 +352,7 @@ static void convert_reg_value( DWORD regType, const BYTE *value, DWORD sz, WCHAR ...@@ -353,7 +352,7 @@ static void convert_reg_value( DWORD regType, const BYTE *value, DWORD sz, WCHAR
lstrcpyW(*appValue, binPre); lstrcpyW(*appValue, binPre);
ptr = *appValue + lstrlenW(binPre); ptr = *appValue + lstrlenW(binPre);
for (i = 0; i < sz; i++, ptr += 2) for (i = 0; i < sz; i++, ptr += 2)
sprintfW(ptr, binFmt, value[i]); swprintf(ptr, 3, binFmt, value[i]);
break; break;
default: default:
WARN("unimplemented for values of type %d\n", regType); WARN("unimplemented for values of type %d\n", regType);
...@@ -463,7 +462,7 @@ static UINT search_reg( MSIPACKAGE *package, WCHAR **appValue, MSISIGNATURE *sig ...@@ -463,7 +462,7 @@ static UINT search_reg( MSIPACKAGE *package, WCHAR **appValue, MSISIGNATURE *sig
} }
if ((regType == REG_SZ || regType == REG_EXPAND_SZ) && if ((regType == REG_SZ || regType == REG_EXPAND_SZ) &&
(ptr = strchrW((LPWSTR)value, '"')) && (end = strchrW(++ptr, '"'))) (ptr = wcschr((LPWSTR)value, '"')) && (end = wcschr(++ptr, '"')))
*end = '\0'; *end = '\0';
else else
ptr = (LPWSTR)value; ptr = (LPWSTR)value;
...@@ -501,7 +500,7 @@ static LPWSTR get_ini_field(LPWSTR buf, int field) ...@@ -501,7 +500,7 @@ static LPWSTR get_ini_field(LPWSTR buf, int field)
return strdupW(buf); return strdupW(buf);
beg = buf; beg = buf;
while ((end = strchrW(beg, ',')) && i < field) while ((end = wcschr(beg, ',')) && i < field)
{ {
beg = end + 1; beg = end + 1;
while (*beg == ' ') while (*beg == ' ')
...@@ -510,7 +509,7 @@ static LPWSTR get_ini_field(LPWSTR buf, int field) ...@@ -510,7 +509,7 @@ static LPWSTR get_ini_field(LPWSTR buf, int field)
i++; i++;
} }
end = strchrW(beg, ','); end = wcschr(beg, ',');
if (!end) if (!end)
end = beg + lstrlenW(beg); end = beg + lstrlenW(beg);
...@@ -600,13 +599,13 @@ static void expand_any_path( MSIPACKAGE *package, WCHAR *src, WCHAR *dst, size_t ...@@ -600,13 +599,13 @@ static void expand_any_path( MSIPACKAGE *package, WCHAR *src, WCHAR *dst, size_t
dst[0] = '\0'; dst[0] = '\0';
/* Ignore the short portion of the path */ /* Ignore the short portion of the path */
if ((ptr = strchrW(src, '|'))) if ((ptr = wcschr(src, '|')))
ptr++; ptr++;
else else
ptr = src; ptr = src;
deformat_string(package, ptr, &deformatted); deformat_string(package, ptr, &deformatted);
if (!deformatted || strlenW(deformatted) > len - 1) if (!deformatted || lstrlenW(deformatted) > len - 1)
{ {
msi_free(deformatted); msi_free(deformatted);
return; return;
...@@ -624,7 +623,7 @@ static LANGID *parse_languages( const WCHAR *languages, DWORD *num_ids ) ...@@ -624,7 +623,7 @@ static LANGID *parse_languages( const WCHAR *languages, DWORD *num_ids )
LANGID *ret; LANGID *ret;
if (!str) return NULL; if (!str) return NULL;
for (p = q = str; (q = strchrW( q, ',' )); q++) count++; for (p = q = str; (q = wcschr( q, ',' )); q++) count++;
if (!(ret = msi_alloc( count * sizeof(LANGID) ))) if (!(ret = msi_alloc( count * sizeof(LANGID) )))
{ {
...@@ -634,9 +633,9 @@ static LANGID *parse_languages( const WCHAR *languages, DWORD *num_ids ) ...@@ -634,9 +633,9 @@ static LANGID *parse_languages( const WCHAR *languages, DWORD *num_ids )
i = 0; i = 0;
while (*p) while (*p)
{ {
q = strchrW( p, ',' ); q = wcschr( p, ',' );
if (q) *q = 0; if (q) *q = 0;
ret[i] = atoiW( p ); ret[i] = wcstol( p, NULL, 10 );
if (!q) break; if (!q) break;
p = q + 1; p = q + 1;
i++; i++;
...@@ -808,7 +807,7 @@ static UINT recurse_search_directory( MSIPACKAGE *package, WCHAR **appValue, MSI ...@@ -808,7 +807,7 @@ static UINT recurse_search_directory( MSIPACKAGE *package, WCHAR **appValue, MSI
* here. Add two because we might need to add a backslash if the dir name * here. Add two because we might need to add a backslash if the dir name
* isn't backslash-terminated. * isn't backslash-terminated.
*/ */
len = dirLen + max(fileLen, strlenW(starDotStarW)) + 2; len = dirLen + max(fileLen, lstrlenW(starDotStarW)) + 2;
buf = msi_alloc(len * sizeof(WCHAR)); buf = msi_alloc(len * sizeof(WCHAR));
if (!buf) if (!buf)
return ERROR_OUTOFMEMORY; return ERROR_OUTOFMEMORY;
...@@ -844,8 +843,8 @@ static UINT recurse_search_directory( MSIPACKAGE *package, WCHAR **appValue, MSI ...@@ -844,8 +843,8 @@ static UINT recurse_search_directory( MSIPACKAGE *package, WCHAR **appValue, MSI
if (hFind != INVALID_HANDLE_VALUE) if (hFind != INVALID_HANDLE_VALUE)
{ {
if (findData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY && if (findData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY &&
strcmpW( findData.cFileName, szDot ) && wcscmp( findData.cFileName, szDot ) &&
strcmpW( findData.cFileName, szDotDot )) wcscmp( findData.cFileName, szDotDot ))
{ {
lstrcpyW(subpath, dir); lstrcpyW(subpath, dir);
PathAppendW(subpath, findData.cFileName); PathAppendW(subpath, findData.cFileName);
...@@ -854,8 +853,8 @@ static UINT recurse_search_directory( MSIPACKAGE *package, WCHAR **appValue, MSI ...@@ -854,8 +853,8 @@ static UINT recurse_search_directory( MSIPACKAGE *package, WCHAR **appValue, MSI
while (rc == ERROR_SUCCESS && !*appValue && msi_find_next_file( package, hFind, &findData )) while (rc == ERROR_SUCCESS && !*appValue && msi_find_next_file( package, hFind, &findData ))
{ {
if (!strcmpW( findData.cFileName, szDot ) || if (!wcscmp( findData.cFileName, szDot ) ||
!strcmpW( findData.cFileName, szDotDot )) !wcscmp( findData.cFileName, szDotDot ))
continue; continue;
lstrcpyW(subpath, dir); lstrcpyW(subpath, dir);
...@@ -889,7 +888,7 @@ static UINT check_directory( MSIPACKAGE *package, const WCHAR *dir, WCHAR **appV ...@@ -889,7 +888,7 @@ static UINT check_directory( MSIPACKAGE *package, const WCHAR *dir, WCHAR **appV
static BOOL is_full_path( const WCHAR *path ) static BOOL is_full_path( const WCHAR *path )
{ {
WCHAR first = toupperW(path[0]); WCHAR first = towupper(path[0]);
BOOL ret; BOOL ret;
if (first >= 'A' && first <= 'Z' && path[1] == ':') if (first >= 'A' && first <= 'Z' && path[1] == ':')
...@@ -1019,7 +1018,7 @@ static UINT search_dr( MSIPACKAGE *package, WCHAR **appValue, MSISIGNATURE *sig ...@@ -1019,7 +1018,7 @@ static UINT search_dr( MSIPACKAGE *package, WCHAR **appValue, MSISIGNATURE *sig
if (sz) if (sz)
expand_any_path( package, path, expanded, MAX_PATH ); expand_any_path( package, path, expanded, MAX_PATH );
else else
strcpyW(expanded, path); lstrcpyW(expanded, path);
if (parent) if (parent)
{ {
...@@ -1031,10 +1030,10 @@ static UINT search_dr( MSIPACKAGE *package, WCHAR **appValue, MSISIGNATURE *sig ...@@ -1031,10 +1030,10 @@ static UINT search_dr( MSIPACKAGE *package, WCHAR **appValue, MSISIGNATURE *sig
PathAddBackslashW(parent); PathAddBackslashW(parent);
} }
strcpyW(path, parent); lstrcpyW(path, parent);
strcatW(path, expanded); lstrcatW(path, expanded);
} }
else if (sz) strcpyW(path, expanded); else if (sz) lstrcpyW(path, expanded);
PathAddBackslashW(path); PathAddBackslashW(path);
...@@ -1088,7 +1087,7 @@ static UINT ITERATE_AppSearch(MSIRECORD *row, LPVOID param) ...@@ -1088,7 +1087,7 @@ static UINT ITERATE_AppSearch(MSIRECORD *row, LPVOID param)
if (value) if (value)
{ {
r = msi_set_property( package->db, propName, value, -1 ); r = msi_set_property( package->db, propName, value, -1 );
if (r == ERROR_SUCCESS && !strcmpW( propName, szSourceDir )) if (r == ERROR_SUCCESS && !wcscmp( propName, szSourceDir ))
msi_reset_source_folders( package ); msi_reset_source_folders( package );
msi_free(value); msi_free(value);
......
...@@ -26,7 +26,6 @@ ...@@ -26,7 +26,6 @@
#include "winbase.h" #include "winbase.h"
#include "winreg.h" #include "winreg.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "wine/unicode.h"
#include "msipriv.h" #include "msipriv.h"
WINE_DEFAULT_DEBUG_CHANNEL(msi); WINE_DEFAULT_DEBUG_CHANNEL(msi);
...@@ -43,7 +42,7 @@ static BOOL load_fusion_dlls( MSIPACKAGE *package ) ...@@ -43,7 +42,7 @@ static BOOL load_fusion_dlls( MSIPACKAGE *package )
WCHAR path[MAX_PATH]; WCHAR path[MAX_PATH];
DWORD len = GetSystemDirectoryW( path, MAX_PATH ); DWORD len = GetSystemDirectoryW( path, MAX_PATH );
strcpyW( path + len, szMscoree ); lstrcpyW( path + len, szMscoree );
if (package->hmscoree || !(package->hmscoree = LoadLibraryW( path ))) return TRUE; if (package->hmscoree || !(package->hmscoree = LoadLibraryW( path ))) return TRUE;
if (!(pLoadLibraryShim = (void *)GetProcAddress( package->hmscoree, "LoadLibraryShim" ))) if (!(pLoadLibraryShim = (void *)GetProcAddress( package->hmscoree, "LoadLibraryShim" )))
{ {
...@@ -176,13 +175,13 @@ static UINT get_assembly_name_attribute( MSIRECORD *rec, LPVOID param ) ...@@ -176,13 +175,13 @@ static UINT get_assembly_name_attribute( MSIRECORD *rec, LPVOID param )
struct assembly_name *name = param; struct assembly_name *name = param;
const WCHAR *attr = MSI_RecordGetString( rec, 2 ); const WCHAR *attr = MSI_RecordGetString( rec, 2 );
const WCHAR *value = MSI_RecordGetString( rec, 3 ); const WCHAR *value = MSI_RecordGetString( rec, 3 );
int len = strlenW( fmtW ) + strlenW( attr ) + strlenW( value ); int len = lstrlenW( fmtW ) + lstrlenW( attr ) + lstrlenW( value );
if (!(name->attrs[name->index] = msi_alloc( len * sizeof(WCHAR) ))) if (!(name->attrs[name->index] = msi_alloc( len * sizeof(WCHAR) )))
return ERROR_OUTOFMEMORY; return ERROR_OUTOFMEMORY;
if (!strcmpiW( attr, nameW )) strcpyW( name->attrs[name->index++], value ); if (!wcsicmp( attr, nameW )) lstrcpyW( name->attrs[name->index++], value );
else sprintfW( name->attrs[name->index++], fmtW, attr, value ); else swprintf( name->attrs[name->index++], len, fmtW, attr, value );
return ERROR_SUCCESS; return ERROR_SUCCESS;
} }
...@@ -216,7 +215,7 @@ static WCHAR *get_assembly_display_name( MSIDATABASE *db, const WCHAR *comp, MSI ...@@ -216,7 +215,7 @@ static WCHAR *get_assembly_display_name( MSIDATABASE *db, const WCHAR *comp, MSI
MSI_IterateRecords( view, NULL, get_assembly_name_attribute, &name ); MSI_IterateRecords( view, NULL, get_assembly_name_attribute, &name );
len = 0; len = 0;
for (i = 0; i < name.count; i++) len += strlenW( name.attrs[i] ) + 1; for (i = 0; i < name.count; i++) len += lstrlenW( name.attrs[i] ) + 1;
display_name = msi_alloc( (len + 1) * sizeof(WCHAR) ); display_name = msi_alloc( (len + 1) * sizeof(WCHAR) );
if (display_name) if (display_name)
...@@ -224,8 +223,8 @@ static WCHAR *get_assembly_display_name( MSIDATABASE *db, const WCHAR *comp, MSI ...@@ -224,8 +223,8 @@ static WCHAR *get_assembly_display_name( MSIDATABASE *db, const WCHAR *comp, MSI
display_name[0] = 0; display_name[0] = 0;
for (i = 0; i < name.count; i++) for (i = 0; i < name.count; i++)
{ {
strcatW( display_name, name.attrs[i] ); lstrcatW( display_name, name.attrs[i] );
if (i < name.count - 1) strcatW( display_name, commaW ); if (i < name.count - 1) lstrcatW( display_name, commaW );
} }
} }
...@@ -427,7 +426,7 @@ static enum clr_version get_clr_version( MSIPACKAGE *package, const WCHAR *filen ...@@ -427,7 +426,7 @@ static enum clr_version get_clr_version( MSIPACKAGE *package, const WCHAR *filen
{ {
UINT i; UINT i;
for (i = 0; i < CLR_VERSION_MAX; i++) for (i = 0; i < CLR_VERSION_MAX; i++)
if (!strcmpW( strW, clr_version[i] )) version = i; if (!wcscmp( strW, clr_version[i] )) version = i;
} }
msi_free( strW ); msi_free( strW );
} }
...@@ -526,7 +525,7 @@ static WCHAR *build_local_assembly_path( const WCHAR *filename ) ...@@ -526,7 +525,7 @@ static WCHAR *build_local_assembly_path( const WCHAR *filename )
UINT i; UINT i;
WCHAR *ret; WCHAR *ret;
if (!(ret = msi_alloc( (strlenW( filename ) + 1) * sizeof(WCHAR) ))) if (!(ret = msi_alloc( (lstrlenW( filename ) + 1) * sizeof(WCHAR) )))
return NULL; return NULL;
for (i = 0; filename[i]; i++) for (i = 0; filename[i]; i++)
......
...@@ -32,7 +32,6 @@ ...@@ -32,7 +32,6 @@
#include "oleauto.h" #include "oleauto.h"
#include "shlwapi.h" #include "shlwapi.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "wine/unicode.h"
#include "msiserver.h" #include "msiserver.h"
#include "msiserver_dispids.h" #include "msiserver_dispids.h"
...@@ -1976,7 +1975,7 @@ static HRESULT InstallerImpl_Version(WORD wFlags, ...@@ -1976,7 +1975,7 @@ static HRESULT InstallerImpl_Version(WORD wFlags,
if (FAILED(hr)) if (FAILED(hr))
return hr; return hr;
sprintfW(version, format, verinfo.dwMajorVersion, verinfo.dwMinorVersion, swprintf(version, ARRAY_SIZE(version), format, verinfo.dwMajorVersion, verinfo.dwMinorVersion,
verinfo.dwBuildNumber, verinfo.dwPlatformID); verinfo.dwBuildNumber, verinfo.dwPlatformID);
V_VT(pVarResult) = VT_BSTR; V_VT(pVarResult) = VT_BSTR;
......
...@@ -22,8 +22,6 @@ ...@@ -22,8 +22,6 @@
#define COBJMACROS #define COBJMACROS
#include "config.h"
#include <stdarg.h> #include <stdarg.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
...@@ -40,7 +38,6 @@ ...@@ -40,7 +38,6 @@
#include "winemsi.h" #include "winemsi.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "wine/exception.h" #include "wine/exception.h"
#include "wine/unicode.h"
#include "wine/list.h" #include "wine/list.h"
WINE_DEFAULT_DEBUG_CHANNEL(msi); WINE_DEFAULT_DEBUG_CHANNEL(msi);
...@@ -314,7 +311,7 @@ value: ...@@ -314,7 +311,7 @@ value:
if( !szNum ) if( !szNum )
YYABORT; YYABORT;
$$.type = VALUE_INTEGER; $$.type = VALUE_INTEGER;
$$.u.integer = atoiW( szNum ); $$.u.integer = wcstol( szNum, NULL, 10 );
cond_free( szNum ); cond_free( szNum );
} }
| COND_DOLLARS identifier | COND_DOLLARS identifier
...@@ -417,7 +414,7 @@ static WCHAR *strstriW( const WCHAR *str, const WCHAR *sub ) ...@@ -417,7 +414,7 @@ static WCHAR *strstriW( const WCHAR *str, const WCHAR *sub )
LPWSTR strlower, sublower, r; LPWSTR strlower, sublower, r;
strlower = CharLowerW( strdupW( str ) ); strlower = CharLowerW( strdupW( str ) );
sublower = CharLowerW( strdupW( sub ) ); sublower = CharLowerW( strdupW( sub ) );
r = strstrW( strlower, sublower ); r = wcsstr( strlower, sublower );
if (r) if (r)
r = (LPWSTR)str + (r - strlower); r = (LPWSTR)str + (r - strlower);
msi_free( strlower ); msi_free( strlower );
...@@ -433,7 +430,7 @@ static BOOL str_is_number( LPCWSTR str ) ...@@ -433,7 +430,7 @@ static BOOL str_is_number( LPCWSTR str )
return FALSE; return FALSE;
for (i = 0; i < lstrlenW( str ); i++) for (i = 0; i < lstrlenW( str ); i++)
if (!isdigitW(str[i])) if (!iswdigit(str[i]))
return FALSE; return FALSE;
return TRUE; return TRUE;
...@@ -452,44 +449,44 @@ static INT compare_substring( LPCWSTR a, INT operator, LPCWSTR b ) ...@@ -452,44 +449,44 @@ static INT compare_substring( LPCWSTR a, INT operator, LPCWSTR b )
return 1; return 1;
/* if both strings contain only numbers, use integer comparison */ /* if both strings contain only numbers, use integer comparison */
lhs = atoiW(a); lhs = wcstol(a, NULL, 10);
rhs = atoiW(b); rhs = wcstol(b, NULL, 10);
if (str_is_number(a) && str_is_number(b)) if (str_is_number(a) && str_is_number(b))
return compare_int( lhs, operator, rhs ); return compare_int( lhs, operator, rhs );
switch (operator) switch (operator)
{ {
case COND_SS: case COND_SS:
return strstrW( a, b ) != 0; return wcsstr( a, b ) != 0;
case COND_ISS: case COND_ISS:
return strstriW( a, b ) != 0; return strstriW( a, b ) != 0;
case COND_LHS: case COND_LHS:
{ {
int l = strlenW( a ); int l = lstrlenW( a );
int r = strlenW( b ); int r = lstrlenW( b );
if (r > l) return 0; if (r > l) return 0;
return !strncmpW( a, b, r ); return !wcsncmp( a, b, r );
} }
case COND_RHS: case COND_RHS:
{ {
int l = strlenW( a ); int l = lstrlenW( a );
int r = strlenW( b ); int r = lstrlenW( b );
if (r > l) return 0; if (r > l) return 0;
return !strncmpW( a + (l - r), b, r ); return !wcsncmp( a + (l - r), b, r );
} }
case COND_ILHS: case COND_ILHS:
{ {
int l = strlenW( a ); int l = lstrlenW( a );
int r = strlenW( b ); int r = lstrlenW( b );
if (r > l) return 0; if (r > l) return 0;
return !strncmpiW( a, b, r ); return !wcsnicmp( a, b, r );
} }
case COND_IRHS: case COND_IRHS:
{ {
int l = strlenW( a ); int l = lstrlenW( a );
int r = strlenW( b ); int r = lstrlenW( b );
if (r > l) return 0; if (r > l) return 0;
return !strncmpiW( a + (l - r), b, r ); return !wcsnicmp( a + (l - r), b, r );
} }
default: default:
ERR("invalid substring operator\n"); ERR("invalid substring operator\n");
...@@ -508,35 +505,35 @@ static INT compare_string( LPCWSTR a, INT operator, LPCWSTR b, BOOL convert ) ...@@ -508,35 +505,35 @@ static INT compare_string( LPCWSTR a, INT operator, LPCWSTR b, BOOL convert )
if (!b) b = szEmpty; if (!b) b = szEmpty;
if (convert && str_is_number(a) && str_is_number(b)) if (convert && str_is_number(a) && str_is_number(b))
return compare_int( atoiW(a), operator, atoiW(b) ); return compare_int( wcstol(a, NULL, 10), operator, wcstol(b, NULL, 10) );
/* a or b may be NULL */ /* a or b may be NULL */
switch (operator) switch (operator)
{ {
case COND_LT: case COND_LT:
return strcmpW( a, b ) < 0; return wcscmp( a, b ) < 0;
case COND_GT: case COND_GT:
return strcmpW( a, b ) > 0; return wcscmp( a, b ) > 0;
case COND_EQ: case COND_EQ:
return strcmpW( a, b ) == 0; return wcscmp( a, b ) == 0;
case COND_NE: case COND_NE:
return strcmpW( a, b ) != 0; return wcscmp( a, b ) != 0;
case COND_GE: case COND_GE:
return strcmpW( a, b ) >= 0; return wcscmp( a, b ) >= 0;
case COND_LE: case COND_LE:
return strcmpW( a, b ) <= 0; return wcscmp( a, b ) <= 0;
case COND_ILT: case COND_ILT:
return strcmpiW( a, b ) < 0; return wcsicmp( a, b ) < 0;
case COND_IGT: case COND_IGT:
return strcmpiW( a, b ) > 0; return wcsicmp( a, b ) > 0;
case COND_IEQ: case COND_IEQ:
return strcmpiW( a, b ) == 0; return wcsicmp( a, b ) == 0;
case COND_INE: case COND_INE:
return strcmpiW( a, b ) != 0; return wcsicmp( a, b ) != 0;
case COND_IGE: case COND_IGE:
return strcmpiW( a, b ) >= 0; return wcsicmp( a, b ) >= 0;
case COND_ILE: case COND_ILE:
return strcmpiW( a, b ) <= 0; return wcsicmp( a, b ) <= 0;
default: default:
ERR("invalid string operator\n"); ERR("invalid string operator\n");
return 0; return 0;
...@@ -619,7 +616,7 @@ static int COND_GetOperator( COND_input *cond ) ...@@ -619,7 +616,7 @@ static int COND_GetOperator( COND_input *cond )
while ( 1 ) while ( 1 )
{ {
len = lstrlenW( table[i].str ); len = lstrlenW( table[i].str );
if ( !len || 0 == strncmpW( table[i].str, p, len ) ) if ( !len || 0 == wcsncmp( table[i].str, p, len ) )
break; break;
i++; i++;
} }
...@@ -668,7 +665,7 @@ static int COND_GetOne( struct cond_str *str, COND_input *cond ) ...@@ -668,7 +665,7 @@ static int COND_GetOne( struct cond_str *str, COND_input *cond )
if (ch == '"' ) if (ch == '"' )
{ {
LPCWSTR p = strchrW( str->data + 1, '"' ); LPCWSTR p = wcschr( str->data + 1, '"' );
if (!p) return COND_ERROR; if (!p) return COND_ERROR;
len = p - str->data + 1; len = p - str->data + 1;
rc = COND_LITER; rc = COND_LITER;
...@@ -688,18 +685,18 @@ static int COND_GetOne( struct cond_str *str, COND_input *cond ) ...@@ -688,18 +685,18 @@ static int COND_GetOne( struct cond_str *str, COND_input *cond )
if ( len == 3 ) if ( len == 3 )
{ {
if ( !strncmpiW( str->data, szNot, len ) ) if ( !wcsnicmp( str->data, szNot, len ) )
rc = COND_NOT; rc = COND_NOT;
else if( !strncmpiW( str->data, szAnd, len ) ) else if( !wcsnicmp( str->data, szAnd, len ) )
rc = COND_AND; rc = COND_AND;
else if( !strncmpiW( str->data, szXor, len ) ) else if( !wcsnicmp( str->data, szXor, len ) )
rc = COND_XOR; rc = COND_XOR;
else if( !strncmpiW( str->data, szEqv, len ) ) else if( !wcsnicmp( str->data, szEqv, len ) )
rc = COND_EQV; rc = COND_EQV;
else if( !strncmpiW( str->data, szImp, len ) ) else if( !wcsnicmp( str->data, szImp, len ) )
rc = COND_IMP; rc = COND_IMP;
} }
else if( (len == 2) && !strncmpiW( str->data, szOr, len ) ) else if( (len == 2) && !wcsnicmp( str->data, szOr, len ) )
rc = COND_OR; rc = COND_OR;
} }
else if( COND_IsNumber( ch ) ) else if( COND_IsNumber( ch ) )
......
...@@ -24,7 +24,6 @@ ...@@ -24,7 +24,6 @@
#include "winbase.h" #include "winbase.h"
#include "winerror.h" #include "winerror.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "wine/unicode.h"
#include "msi.h" #include "msi.h"
#include "msiquery.h" #include "msiquery.h"
#include "objbase.h" #include "objbase.h"
...@@ -152,7 +151,7 @@ static UINT check_columns( const column_info *col_info ) ...@@ -152,7 +151,7 @@ static UINT check_columns( const column_info *col_info )
/* check for two columns with the same name */ /* check for two columns with the same name */
for( c1 = col_info; c1; c1 = c1->next ) for( c1 = col_info; c1; c1 = c1->next )
for( c2 = c1->next; c2; c2 = c2->next ) for( c2 = c1->next; c2; c2 = c2->next )
if (!strcmpW( c1->column, c2->column )) if (!wcscmp( c1->column, c2->column ))
return ERROR_BAD_QUERY_SYNTAX; return ERROR_BAD_QUERY_SYNTAX;
return ERROR_SUCCESS; return ERROR_SUCCESS;
......
...@@ -18,9 +18,6 @@ ...@@ -18,9 +18,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "config.h"
#include "wine/port.h"
#define COBJMACROS #define COBJMACROS
#include <stdarg.h> #include <stdarg.h>
...@@ -38,7 +35,6 @@ ...@@ -38,7 +35,6 @@
#include "wine/asm.h" #include "wine/asm.h"
#include "wine/heap.h" #include "wine/heap.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "wine/unicode.h"
#include "wine/exception.h" #include "wine/exception.h"
WINE_DEFAULT_DEBUG_CHANNEL(msi); WINE_DEFAULT_DEBUG_CHANNEL(msi);
...@@ -129,7 +125,7 @@ BOOL msi_action_is_unique( const MSIPACKAGE *package, const WCHAR *action ) ...@@ -129,7 +125,7 @@ BOOL msi_action_is_unique( const MSIPACKAGE *package, const WCHAR *action )
for (i = 0; i < package->unique_actions_count; i++) for (i = 0; i < package->unique_actions_count; i++)
{ {
if (!strcmpW( package->unique_actions[i], action )) return TRUE; if (!wcscmp( package->unique_actions[i], action )) return TRUE;
} }
return FALSE; return FALSE;
} }
...@@ -191,7 +187,7 @@ static LPWSTR msi_get_deferred_action(LPCWSTR action, LPCWSTR actiondata, ...@@ -191,7 +187,7 @@ static LPWSTR msi_get_deferred_action(LPCWSTR action, LPCWSTR actiondata,
lstrlenW(format) - 7; lstrlenW(format) - 7;
deferred = msi_alloc(len * sizeof(WCHAR)); deferred = msi_alloc(len * sizeof(WCHAR));
sprintfW(deferred, format, actiondata, usersid, prodcode, action); swprintf(deferred, len, format, actiondata, usersid, prodcode, action);
return deferred; return deferred;
} }
...@@ -200,15 +196,15 @@ static void set_deferred_action_props( MSIPACKAGE *package, const WCHAR *deferre ...@@ -200,15 +196,15 @@ static void set_deferred_action_props( MSIPACKAGE *package, const WCHAR *deferre
static const WCHAR sep[] = {'<','=','>',0}; static const WCHAR sep[] = {'<','=','>',0};
const WCHAR *end, *beg = deferred_data + 1; const WCHAR *end, *beg = deferred_data + 1;
end = strstrW(beg, sep); end = wcsstr(beg, sep);
msi_set_property( package->db, szCustomActionData, beg, end - beg ); msi_set_property( package->db, szCustomActionData, beg, end - beg );
beg = end + 3; beg = end + 3;
end = strstrW(beg, sep); end = wcsstr(beg, sep);
msi_set_property( package->db, szUserSID, beg, end - beg ); msi_set_property( package->db, szUserSID, beg, end - beg );
beg = end + 3; beg = end + 3;
end = strchrW(beg, ']'); end = wcschr(beg, ']');
msi_set_property( package->db, szProductCode, beg, end - beg ); msi_set_property( package->db, szProductCode, beg, end - beg );
} }
...@@ -229,7 +225,7 @@ WCHAR *msi_create_temp_file( MSIDATABASE *db ) ...@@ -229,7 +225,7 @@ WCHAR *msi_create_temp_file( MSIDATABASE *db )
if (!(db->tempfolder = strdupW( tmp ))) return NULL; if (!(db->tempfolder = strdupW( tmp ))) return NULL;
} }
if ((ret = msi_alloc( (strlenW( db->tempfolder ) + 20) * sizeof(WCHAR) ))) if ((ret = msi_alloc( (lstrlenW( db->tempfolder ) + 20) * sizeof(WCHAR) )))
{ {
if (!GetTempFileNameW( db->tempfolder, szMsi, 0, ret )) if (!GetTempFileNameW( db->tempfolder, szMsi, 0, ret ))
{ {
...@@ -299,7 +295,7 @@ static MSIBINARY *get_temp_binary(MSIPACKAGE *package, LPCWSTR source) ...@@ -299,7 +295,7 @@ static MSIBINARY *get_temp_binary(MSIPACKAGE *package, LPCWSTR source)
LIST_FOR_EACH_ENTRY( binary, &package->binaries, MSIBINARY, entry ) LIST_FOR_EACH_ENTRY( binary, &package->binaries, MSIBINARY, entry )
{ {
if (!strcmpW( binary->source, source )) if (!wcscmp( binary->source, source ))
return binary; return binary;
} }
...@@ -522,7 +518,7 @@ UINT CDECL __wine_msi_call_dll_function(DWORD client_pid, const GUID *guid) ...@@ -522,7 +518,7 @@ UINT CDECL __wine_msi_call_dll_function(DWORD client_pid, const GUID *guid)
{ {
WCHAR endpoint[12]; WCHAR endpoint[12];
sprintfW(endpoint, endpoint_fmtW, client_pid); swprintf(endpoint, ARRAY_SIZE(endpoint), endpoint_fmtW, client_pid);
status = RpcStringBindingComposeW(NULL, ncalrpcW, NULL, endpoint, NULL, &binding_str); status = RpcStringBindingComposeW(NULL, ncalrpcW, NULL, endpoint, NULL, &binding_str);
if (status != RPC_S_OK) if (status != RPC_S_OK)
{ {
...@@ -607,7 +603,8 @@ static DWORD custom_start_server(MSIPACKAGE *package, DWORD arch) ...@@ -607,7 +603,8 @@ static DWORD custom_start_server(MSIPACKAGE *package, DWORD arch)
(arch == SCS_64BIT_BINARY && package->custom_server_64_process)) (arch == SCS_64BIT_BINARY && package->custom_server_64_process))
return ERROR_SUCCESS; return ERROR_SUCCESS;
sprintfW(buffer, pipe_name, GetCurrentProcessId(), arch == SCS_32BIT_BINARY ? 32 : 64); swprintf(buffer, ARRAY_SIZE(buffer), pipe_name,
GetCurrentProcessId(), arch == SCS_32BIT_BINARY ? 32 : 64);
pipe = CreateNamedPipeW(buffer, PIPE_ACCESS_DUPLEX, 0, 1, sizeof(DWORD64), pipe = CreateNamedPipeW(buffer, PIPE_ACCESS_DUPLEX, 0, 1, sizeof(DWORD64),
sizeof(GUID), 0, NULL); sizeof(GUID), 0, NULL);
if (pipe == INVALID_HANDLE_VALUE) if (pipe == INVALID_HANDLE_VALUE)
...@@ -620,8 +617,8 @@ static DWORD custom_start_server(MSIPACKAGE *package, DWORD arch) ...@@ -620,8 +617,8 @@ static DWORD custom_start_server(MSIPACKAGE *package, DWORD arch)
GetSystemWow64DirectoryW(path, MAX_PATH - ARRAY_SIZE(msiexecW)); GetSystemWow64DirectoryW(path, MAX_PATH - ARRAY_SIZE(msiexecW));
else else
GetSystemDirectoryW(path, MAX_PATH - ARRAY_SIZE(msiexecW)); GetSystemDirectoryW(path, MAX_PATH - ARRAY_SIZE(msiexecW));
strcatW(path, msiexecW); lstrcatW(path, msiexecW);
sprintfW(cmdline, argsW, path, GetCurrentProcessId()); swprintf(cmdline, ARRAY_SIZE(cmdline), argsW, path, GetCurrentProcessId());
if (wow64 && arch == SCS_64BIT_BINARY) if (wow64 && arch == SCS_64BIT_BINARY)
{ {
...@@ -746,7 +743,7 @@ static msi_custom_action_info *do_msidbCustomActionTypeDll( ...@@ -746,7 +743,7 @@ static msi_custom_action_info *do_msidbCustomActionTypeDll(
{ {
WCHAR endpoint[12]; WCHAR endpoint[12];
sprintfW(endpoint, endpoint_fmtW, GetCurrentProcessId()); swprintf(endpoint, ARRAY_SIZE(endpoint), endpoint_fmtW, GetCurrentProcessId());
status = RpcServerUseProtseqEpW(ncalrpcW, RPC_C_PROTSEQ_MAX_REQS_DEFAULT, status = RpcServerUseProtseqEpW(ncalrpcW, RPC_C_PROTSEQ_MAX_REQS_DEFAULT,
endpoint, NULL); endpoint, NULL);
if (status != RPC_S_OK) if (status != RPC_S_OK)
...@@ -825,14 +822,14 @@ static HANDLE execute_command( const WCHAR *app, WCHAR *arg, const WCHAR *dir ) ...@@ -825,14 +822,14 @@ static HANDLE execute_command( const WCHAR *app, WCHAR *arg, const WCHAR *dir )
return INVALID_HANDLE_VALUE; return INVALID_HANDLE_VALUE;
} }
if (arg) len_arg = strlenW( arg ); if (arg) len_arg = lstrlenW( arg );
if (!(cmd = msi_alloc( (len_exe + len_arg + 4) * sizeof(WCHAR) ))) if (!(cmd = msi_alloc( (len_exe + len_arg + 4) * sizeof(WCHAR) )))
{ {
msi_free( exe ); msi_free( exe );
return INVALID_HANDLE_VALUE; return INVALID_HANDLE_VALUE;
} }
p = cmd; p = cmd;
if (strchrW( exe, ' ' )) if (wcschr( exe, ' ' ))
{ {
*p++ = '\"'; *p++ = '\"';
memcpy( p, exe, len_exe * sizeof(WCHAR) ); memcpy( p, exe, len_exe * sizeof(WCHAR) );
...@@ -842,7 +839,7 @@ static HANDLE execute_command( const WCHAR *app, WCHAR *arg, const WCHAR *dir ) ...@@ -842,7 +839,7 @@ static HANDLE execute_command( const WCHAR *app, WCHAR *arg, const WCHAR *dir )
} }
else else
{ {
strcpyW( p, exe ); lstrcpyW( p, exe );
p += len_exe; p += len_exe;
} }
if (arg) if (arg)
...@@ -962,15 +959,15 @@ static UINT HANDLE_CustomType23( MSIPACKAGE *package, const WCHAR *source, const ...@@ -962,15 +959,15 @@ static UINT HANDLE_CustomType23( MSIPACKAGE *package, const WCHAR *source, const
HANDLE handle; HANDLE handle;
if (!(dir = msi_dup_property( package->db, szOriginalDatabase ))) return ERROR_OUTOFMEMORY; if (!(dir = msi_dup_property( package->db, szOriginalDatabase ))) return ERROR_OUTOFMEMORY;
if (!(p = strrchrW( dir, '\\' )) && !(p = strrchrW( dir, '/' ))) if (!(p = wcsrchr( dir, '\\' )) && !(p = wcsrchr( dir, '/' )))
{ {
msi_free( dir ); msi_free( dir );
return ERROR_FUNCTION_FAILED; return ERROR_FUNCTION_FAILED;
} }
*p = 0; *p = 0;
len_dir = p - dir; len_dir = p - dir;
len_src = strlenW( source ); len_src = lstrlenW( source );
len_tgt = strlenW( target ); len_tgt = lstrlenW( target );
if (!(arg = msi_alloc( (len + len_dir + len_src + len_tgt + 5) * sizeof(WCHAR) ))) if (!(arg = msi_alloc( (len + len_dir + len_src + len_tgt + 5) * sizeof(WCHAR) )))
{ {
msi_free( dir ); msi_free( dir );
...@@ -985,7 +982,7 @@ static UINT HANDLE_CustomType23( MSIPACKAGE *package, const WCHAR *source, const ...@@ -985,7 +982,7 @@ static UINT HANDLE_CustomType23( MSIPACKAGE *package, const WCHAR *source, const
len += len_src; len += len_src;
arg[len++] = '"'; arg[len++] = '"';
arg[len++] = ' '; arg[len++] = ' ';
strcpyW( arg + len, target ); lstrcpyW( arg + len, target );
TRACE("installing %s concurrently\n", debugstr_w(source)); TRACE("installing %s concurrently\n", debugstr_w(source));
...@@ -1318,7 +1315,7 @@ UINT ACTION_CustomAction(MSIPACKAGE *package, const WCHAR *action) ...@@ -1318,7 +1315,7 @@ UINT ACTION_CustomAction(MSIPACKAGE *package, const WCHAR *action)
int len; int len;
/* deferred action: [properties]Action */ /* deferred action: [properties]Action */
if ((ptr = strrchrW(action, ']'))) if ((ptr = wcsrchr(action, ']')))
{ {
deferred_data = action; deferred_data = action;
action = ptr + 1; action = ptr + 1;
...@@ -1417,7 +1414,7 @@ UINT ACTION_CustomAction(MSIPACKAGE *package, const WCHAR *action) ...@@ -1417,7 +1414,7 @@ UINT ACTION_CustomAction(MSIPACKAGE *package, const WCHAR *action)
len = deformat_string( package, target, &deformated ); len = deformat_string( package, target, &deformated );
rc = msi_set_property( package->db, source, deformated, len ); rc = msi_set_property( package->db, source, deformated, len );
if (rc == ERROR_SUCCESS && !strcmpW( source, szSourceDir )) if (rc == ERROR_SUCCESS && !wcscmp( source, szSourceDir ))
msi_reset_source_folders( package ); msi_reset_source_folders( package );
msi_free(deformated); msi_free(deformated);
break; break;
......
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
#include "winreg.h" #include "winreg.h"
#include "winnls.h" #include "winnls.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "wine/unicode.h"
#include "msi.h" #include "msi.h"
#include "msiquery.h" #include "msiquery.h"
#include "msipriv.h" #include "msipriv.h"
...@@ -251,7 +250,7 @@ UINT MSI_OpenDatabaseW(LPCWSTR szDBPath, LPCWSTR szPersist, MSIDATABASE **pdb) ...@@ -251,7 +250,7 @@ UINT MSI_OpenDatabaseW(LPCWSTR szDBPath, LPCWSTR szPersist, MSIDATABASE **pdb)
goto end; goto end;
} }
if (!strchrW( save_path, '\\' )) if (!wcschr( save_path, '\\' ))
{ {
GetCurrentDirectoryW( MAX_PATH, path ); GetCurrentDirectoryW( MAX_PATH, path );
lstrcatW( path, szBackSlash ); lstrcatW( path, szBackSlash );
...@@ -456,7 +455,7 @@ static LPWSTR msi_build_createsql_prelude(LPWSTR table) ...@@ -456,7 +455,7 @@ static LPWSTR msi_build_createsql_prelude(LPWSTR table)
if (!prelude) if (!prelude)
return NULL; return NULL;
sprintfW(prelude, create_fmt, table); swprintf(prelude, size, create_fmt, table);
return prelude; return prelude;
} }
...@@ -492,7 +491,7 @@ static LPWSTR msi_build_createsql_columns(LPWSTR *columns_data, LPWSTR *types, D ...@@ -492,7 +491,7 @@ static LPWSTR msi_build_createsql_columns(LPWSTR *columns_data, LPWSTR *types, D
comma[0] = ','; comma[0] = ',';
ptr = &types[i][1]; ptr = &types[i][1];
len = atolW(ptr); len = wcstol(ptr, NULL, 10);
extra[0] = '\0'; extra[0] = '\0';
switch (types[i][0]) switch (types[i][0])
...@@ -503,14 +502,14 @@ static LPWSTR msi_build_createsql_columns(LPWSTR *columns_data, LPWSTR *types, D ...@@ -503,14 +502,14 @@ static LPWSTR msi_build_createsql_columns(LPWSTR *columns_data, LPWSTR *types, D
case 'L': case 'L':
lstrcatW(extra, localizable); lstrcatW(extra, localizable);
type = type_char; type = type_char;
sprintfW(size, size_fmt, ptr); swprintf(size, ARRAY_SIZE(size), size_fmt, ptr);
break; break;
case 's': case 's':
lstrcpyW(extra, type_notnull); lstrcpyW(extra, type_notnull);
/* fall through */ /* fall through */
case 'S': case 'S':
type = type_char; type = type_char;
sprintfW(size, size_fmt, ptr); swprintf(size, ARRAY_SIZE(size), size_fmt, ptr);
break; break;
case 'i': case 'i':
lstrcpyW(extra, type_notnull); lstrcpyW(extra, type_notnull);
...@@ -539,7 +538,7 @@ static LPWSTR msi_build_createsql_columns(LPWSTR *columns_data, LPWSTR *types, D ...@@ -539,7 +538,7 @@ static LPWSTR msi_build_createsql_columns(LPWSTR *columns_data, LPWSTR *types, D
return NULL; return NULL;
} }
sprintfW(expanded, column_fmt, columns_data[i], type, size, extra, comma); swprintf(expanded, ARRAY_SIZE(expanded), column_fmt, columns_data[i], type, size, extra, comma);
sql_size += lstrlenW(expanded); sql_size += lstrlenW(expanded);
p = msi_realloc(columns, sql_size * sizeof(WCHAR)); p = msi_realloc(columns, sql_size * sizeof(WCHAR));
...@@ -573,7 +572,7 @@ static LPWSTR msi_build_createsql_postlude(LPWSTR *primary_keys, DWORD num_keys) ...@@ -573,7 +572,7 @@ static LPWSTR msi_build_createsql_postlude(LPWSTR *primary_keys, DWORD num_keys)
for (i = 0, ptr = keys; i < num_keys; i++) for (i = 0, ptr = keys; i < num_keys; i++)
{ {
ptr += sprintfW(ptr, key_fmt, primary_keys[i]); ptr += swprintf(ptr, size - (ptr - keys), key_fmt, primary_keys[i]);
} }
/* remove final ', ' */ /* remove final ', ' */
...@@ -584,7 +583,7 @@ static LPWSTR msi_build_createsql_postlude(LPWSTR *primary_keys, DWORD num_keys) ...@@ -584,7 +583,7 @@ static LPWSTR msi_build_createsql_postlude(LPWSTR *primary_keys, DWORD num_keys)
if (!postlude) if (!postlude)
goto done; goto done;
sprintfW(postlude, postlude_fmt, keys); swprintf(postlude, size, postlude_fmt, keys);
done: done:
msi_free(keys); msi_free(keys);
...@@ -644,7 +643,7 @@ static LPWSTR msi_import_stream_filename(LPCWSTR path, LPCWSTR name) ...@@ -644,7 +643,7 @@ static LPWSTR msi_import_stream_filename(LPCWSTR path, LPCWSTR name)
lstrcpyW( fullname, path ); lstrcpyW( fullname, path );
/* chop off extension from path */ /* chop off extension from path */
ptr = strrchrW(fullname, '.'); ptr = wcsrchr(fullname, '.');
if (!ptr) if (!ptr)
{ {
msi_free (fullname); msi_free (fullname);
...@@ -673,7 +672,7 @@ static UINT construct_record(DWORD num_columns, LPWSTR *types, ...@@ -673,7 +672,7 @@ static UINT construct_record(DWORD num_columns, LPWSTR *types,
break; break;
case 'I': case 'i': case 'I': case 'i':
if (*data[i]) if (*data[i])
MSI_RecordSetInteger(*rec, i + 1, atoiW(data[i])); MSI_RecordSetInteger(*rec, i + 1, wcstol(data[i], NULL, 10));
break; break;
case 'V': case 'v': case 'V': case 'v':
if (*data[i]) if (*data[i])
...@@ -790,9 +789,9 @@ static UINT MSI_DatabaseImport(MSIDATABASE *db, LPCWSTR folder, LPCWSTR file) ...@@ -790,9 +789,9 @@ static UINT MSI_DatabaseImport(MSIDATABASE *db, LPCWSTR folder, LPCWSTR file)
msi_parse_line( &ptr, &labels, &num_labels, &len ); msi_parse_line( &ptr, &labels, &num_labels, &len );
if (num_columns == 1 && !columns[0][0] && num_labels == 1 && !labels[0][0] && if (num_columns == 1 && !columns[0][0] && num_labels == 1 && !labels[0][0] &&
num_types == 2 && !strcmpW( types[1], forcecodepage )) num_types == 2 && !wcscmp( types[1], forcecodepage ))
{ {
r = msi_set_string_table_codepage( db->strings, atoiW( types[0] ) ); r = msi_set_string_table_codepage( db->strings, wcstol( types[0], NULL, 10 ) );
goto done; goto done;
} }
...@@ -824,7 +823,7 @@ static UINT MSI_DatabaseImport(MSIDATABASE *db, LPCWSTR folder, LPCWSTR file) ...@@ -824,7 +823,7 @@ static UINT MSI_DatabaseImport(MSIDATABASE *db, LPCWSTR folder, LPCWSTR file)
records = temp_records; records = temp_records;
} }
if (!strcmpW(labels[0], suminfo)) if (!wcscmp(labels[0], suminfo))
{ {
r = msi_add_suminfo( db, records, num_records, num_columns ); r = msi_add_suminfo( db, records, num_records, num_columns );
if (r != ERROR_SUCCESS) if (r != ERROR_SUCCESS)
...@@ -966,11 +965,11 @@ static UINT msi_export_stream( const WCHAR *folder, const WCHAR *table, MSIRECOR ...@@ -966,11 +965,11 @@ static UINT msi_export_stream( const WCHAR *folder, const WCHAR *table, MSIRECOR
if (r != ERROR_SUCCESS) if (r != ERROR_SUCCESS)
return r; return r;
len = (sz + strlenW( folder ) + strlenW( table ) + ARRAY_SIZE( fmt ) + 1) * sizeof(WCHAR); len = sz + lstrlenW( folder ) + lstrlenW( table ) + ARRAY_SIZE( fmt ) + 1;
if (!(path = msi_alloc( len ))) if (!(path = msi_alloc( len * sizeof(WCHAR) )))
return ERROR_OUTOFMEMORY; return ERROR_OUTOFMEMORY;
len = sprintfW( path, fmt, folder, table ); len = swprintf( path, len, fmt, folder, table );
if (!CreateDirectoryW( path, NULL ) && GetLastError() != ERROR_ALREADY_EXISTS) if (!CreateDirectoryW( path, NULL ) && GetLastError() != ERROR_ALREADY_EXISTS)
{ {
msi_free( path ); msi_free( path );
...@@ -978,7 +977,7 @@ static UINT msi_export_stream( const WCHAR *folder, const WCHAR *table, MSIRECOR ...@@ -978,7 +977,7 @@ static UINT msi_export_stream( const WCHAR *folder, const WCHAR *table, MSIRECOR
} }
path[len++] = '\\'; path[len++] = '\\';
strcpyW( path + len, stream ); lstrcpyW( path + len, stream );
file = CreateFileW( path, GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, file = CreateFileW( path, GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE,
NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL ); NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL );
msi_free( path ); msi_free( path );
...@@ -1108,14 +1107,14 @@ static UINT MSI_DatabaseExport( MSIDATABASE *db, LPCWSTR table, LPCWSTR folder, ...@@ -1108,14 +1107,14 @@ static UINT MSI_DatabaseExport( MSIDATABASE *db, LPCWSTR table, LPCWSTR folder,
if (handle == INVALID_HANDLE_VALUE) if (handle == INVALID_HANDLE_VALUE)
return ERROR_FUNCTION_FAILED; return ERROR_FUNCTION_FAILED;
if (!strcmpW( table, forcecodepage )) if (!wcscmp( table, forcecodepage ))
{ {
UINT codepage = msi_get_string_table_codepage( db->strings ); UINT codepage = msi_get_string_table_codepage( db->strings );
r = msi_export_forcecodepage( handle, codepage ); r = msi_export_forcecodepage( handle, codepage );
goto done; goto done;
} }
if (!strcmpW( table, summaryinformation )) if (!wcscmp( table, summaryinformation ))
{ {
r = msi_export_summaryinformation( db, handle ); r = msi_export_summaryinformation( db, handle );
goto done; goto done;
...@@ -1288,7 +1287,7 @@ static BOOL merge_type_match(LPCWSTR type1, LPCWSTR type2) ...@@ -1288,7 +1287,7 @@ static BOOL merge_type_match(LPCWSTR type1, LPCWSTR type2)
((type2[0] == 'L') || (type2[0] == 'S'))) ((type2[0] == 'L') || (type2[0] == 'S')))
return TRUE; return TRUE;
return !strcmpW( type1, type2 ); return !wcscmp( type1, type2 );
} }
static UINT merge_verify_colnames(MSIQUERY *dbview, MSIQUERY *mergeview) static UINT merge_verify_colnames(MSIQUERY *dbview, MSIQUERY *mergeview)
...@@ -1313,7 +1312,7 @@ static UINT merge_verify_colnames(MSIQUERY *dbview, MSIQUERY *mergeview) ...@@ -1313,7 +1312,7 @@ static UINT merge_verify_colnames(MSIQUERY *dbview, MSIQUERY *mergeview)
if (!MSI_RecordGetString(mergerec, i)) if (!MSI_RecordGetString(mergerec, i))
break; break;
if (strcmpW( MSI_RecordGetString( dbrec, i ), MSI_RecordGetString( mergerec, i ) )) if (wcscmp( MSI_RecordGetString( dbrec, i ), MSI_RecordGetString( mergerec, i ) ))
{ {
r = ERROR_DATATYPE_MISMATCH; r = ERROR_DATATYPE_MISMATCH;
goto done; goto done;
...@@ -1379,7 +1378,7 @@ static UINT merge_verify_primary_keys(MSIDATABASE *db, MSIDATABASE *mergedb, ...@@ -1379,7 +1378,7 @@ static UINT merge_verify_primary_keys(MSIDATABASE *db, MSIDATABASE *mergedb,
for (i = 1; i <= count; i++) for (i = 1; i <= count; i++)
{ {
if (strcmpW( MSI_RecordGetString( dbrec, i ), MSI_RecordGetString( mergerec, i ) )) if (wcscmp( MSI_RecordGetString( dbrec, i ), MSI_RecordGetString( mergerec, i ) ))
{ {
r = ERROR_DATATYPE_MISMATCH; r = ERROR_DATATYPE_MISMATCH;
goto done; goto done;
...@@ -1407,7 +1406,7 @@ static LPWSTR get_key_value(MSIQUERY *view, LPCWSTR key, MSIRECORD *rec) ...@@ -1407,7 +1406,7 @@ static LPWSTR get_key_value(MSIQUERY *view, LPCWSTR key, MSIRECORD *rec)
do do
{ {
str = msi_dup_record_field(colnames, ++i); str = msi_dup_record_field(colnames, ++i);
cmp = strcmpW( key, str ); cmp = wcscmp( key, str );
msi_free(str); msi_free(str);
} while (cmp); } while (cmp);
...@@ -1497,7 +1496,7 @@ static LPWSTR create_diff_row_query(MSIDATABASE *merge, MSIQUERY *view, ...@@ -1497,7 +1496,7 @@ static LPWSTR create_diff_row_query(MSIDATABASE *merge, MSIQUERY *view,
goto done; goto done;
} }
sprintfW(clause + oldsize - 1, setptr, key, val); swprintf(clause + oldsize - 1, size - (oldsize - 1), setptr, key, val);
msi_free(val); msi_free(val);
} }
...@@ -1506,7 +1505,7 @@ static LPWSTR create_diff_row_query(MSIDATABASE *merge, MSIQUERY *view, ...@@ -1506,7 +1505,7 @@ static LPWSTR create_diff_row_query(MSIDATABASE *merge, MSIQUERY *view,
if (!query) if (!query)
goto done; goto done;
sprintfW(query, fmt, table, clause); swprintf(query, size, fmt, table, clause);
done: done:
msi_free(clause); msi_free(clause);
......
...@@ -45,7 +45,6 @@ ...@@ -45,7 +45,6 @@
#include "shlwapi.h" #include "shlwapi.h"
#include "patchapi.h" #include "patchapi.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "wine/unicode.h"
WINE_DEFAULT_DEBUG_CHANNEL(msi); WINE_DEFAULT_DEBUG_CHANNEL(msi);
...@@ -206,10 +205,10 @@ BOOL msi_create_full_path( MSIPACKAGE *package, const WCHAR *path ) ...@@ -206,10 +205,10 @@ BOOL msi_create_full_path( MSIPACKAGE *package, const WCHAR *path )
WCHAR *new_path; WCHAR *new_path;
int len; int len;
if (!(new_path = msi_alloc( (strlenW( path ) + 1) * sizeof(WCHAR) ))) return FALSE; if (!(new_path = msi_alloc( (lstrlenW( path ) + 1) * sizeof(WCHAR) ))) return FALSE;
strcpyW( new_path, path ); lstrcpyW( new_path, path );
while ((len = strlenW( new_path )) && new_path[len - 1] == '\\') while ((len = lstrlenW( new_path )) && new_path[len - 1] == '\\')
new_path[len - 1] = 0; new_path[len - 1] = 0;
while (!msi_create_directory( package, new_path )) while (!msi_create_directory( package, new_path ))
...@@ -222,7 +221,7 @@ BOOL msi_create_full_path( MSIPACKAGE *package, const WCHAR *path ) ...@@ -222,7 +221,7 @@ BOOL msi_create_full_path( MSIPACKAGE *package, const WCHAR *path )
ret = FALSE; ret = FALSE;
break; break;
} }
if (!(slash = strrchrW( new_path, '\\' ))) if (!(slash = wcsrchr( new_path, '\\' )))
{ {
ret = FALSE; ret = FALSE;
break; break;
...@@ -436,8 +435,8 @@ static UINT copy_install_file(MSIPACKAGE *package, MSIFILE *file, LPWSTR source) ...@@ -436,8 +435,8 @@ static UINT copy_install_file(MSIPACKAGE *package, MSIFILE *file, LPWSTR source)
TRACE("file in use, scheduling rename operation\n"); TRACE("file in use, scheduling rename operation\n");
if (!(pathW = strdupW( file->TargetPath ))) return ERROR_OUTOFMEMORY; if (!(pathW = strdupW( file->TargetPath ))) return ERROR_OUTOFMEMORY;
if ((p = strrchrW(pathW, '\\'))) *p = 0; if ((p = wcsrchr(pathW, '\\'))) *p = 0;
len = strlenW( pathW ) + 16; len = lstrlenW( pathW ) + 16;
if (!(tmpfileW = msi_alloc(len * sizeof(WCHAR)))) if (!(tmpfileW = msi_alloc(len * sizeof(WCHAR))))
{ {
msi_free( pathW ); msi_free( pathW );
...@@ -490,7 +489,7 @@ static MSIFILE *find_file( MSIPACKAGE *package, UINT disk_id, const WCHAR *filen ...@@ -490,7 +489,7 @@ static MSIFILE *find_file( MSIPACKAGE *package, UINT disk_id, const WCHAR *filen
{ {
if (file->disk_id == disk_id && if (file->disk_id == disk_id &&
file->state != msifs_installed && file->state != msifs_installed &&
!strcmpiW( filename, file->File )) return file; !wcsicmp( filename, file->File )) return file;
} }
return NULL; return NULL;
} }
...@@ -670,7 +669,7 @@ static MSIFILEPATCH *find_filepatch( MSIPACKAGE *package, UINT disk_id, const WC ...@@ -670,7 +669,7 @@ static MSIFILEPATCH *find_filepatch( MSIPACKAGE *package, UINT disk_id, const WC
LIST_FOR_EACH_ENTRY( patch, &package->filepatches, MSIFILEPATCH, entry ) LIST_FOR_EACH_ENTRY( patch, &package->filepatches, MSIFILEPATCH, entry )
{ {
if (!patch->extracted && patch->disk_id == disk_id && !strcmpW( key, patch->File->File )) if (!patch->extracted && patch->disk_id == disk_id && !wcscmp( key, patch->File->File ))
return patch; return patch;
} }
return NULL; return NULL;
...@@ -923,7 +922,7 @@ static WCHAR *wildcard_to_file( const WCHAR *wildcard, const WCHAR *filename ) ...@@ -923,7 +922,7 @@ static WCHAR *wildcard_to_file( const WCHAR *wildcard, const WCHAR *filename )
WCHAR *path; WCHAR *path;
DWORD dirlen, pathlen; DWORD dirlen, pathlen;
ptr = strrchrW(wildcard, '\\'); ptr = wcsrchr(wildcard, '\\');
dirlen = ptr - wildcard + 1; dirlen = ptr - wildcard + 1;
pathlen = dirlen + lstrlenW(filename) + 1; pathlen = dirlen + lstrlenW(filename) + 1;
...@@ -964,8 +963,8 @@ static BOOL add_wildcard( FILE_LIST *files, const WCHAR *source, WCHAR *dest ) ...@@ -964,8 +963,8 @@ static BOOL add_wildcard( FILE_LIST *files, const WCHAR *source, WCHAR *dest )
return FALSE; return FALSE;
new->source = strdupW(source); new->source = strdupW(source);
ptr = strrchrW(dest, '\\') + 1; ptr = wcsrchr(dest, '\\') + 1;
filename = strrchrW(new->source, '\\') + 1; filename = wcsrchr(new->source, '\\') + 1;
new->sourcename = filename; new->sourcename = filename;
...@@ -993,7 +992,7 @@ static BOOL add_wildcard( FILE_LIST *files, const WCHAR *source, WCHAR *dest ) ...@@ -993,7 +992,7 @@ static BOOL add_wildcard( FILE_LIST *files, const WCHAR *source, WCHAR *dest )
LIST_FOR_EACH_ENTRY(file, &files->entry, FILE_LIST, entry) LIST_FOR_EACH_ENTRY(file, &files->entry, FILE_LIST, entry)
{ {
if (strcmpW( source, file->source ) < 0) if (wcscmp( source, file->source ) < 0)
{ {
list_add_before(&file->entry, &new->entry); list_add_before(&file->entry, &new->entry);
return TRUE; return TRUE;
...@@ -1039,7 +1038,7 @@ static BOOL move_files_wildcard( MSIPACKAGE *package, const WCHAR *source, WCHAR ...@@ -1039,7 +1038,7 @@ static BOOL move_files_wildcard( MSIPACKAGE *package, const WCHAR *source, WCHAR
/* only the first wildcard match gets renamed to dest */ /* only the first wildcard match gets renamed to dest */
file = LIST_ENTRY(list_head(&files.entry), FILE_LIST, entry); file = LIST_ENTRY(list_head(&files.entry), FILE_LIST, entry);
size = (strrchrW(file->dest, '\\') - file->dest) + lstrlenW(file->destname) + 2; size = (wcsrchr(file->dest, '\\') - file->dest) + lstrlenW(file->destname) + 2;
file->dest = msi_realloc(file->dest, size * sizeof(WCHAR)); file->dest = msi_realloc(file->dest, size * sizeof(WCHAR));
if (!file->dest) if (!file->dest)
{ {
...@@ -1048,11 +1047,11 @@ static BOOL move_files_wildcard( MSIPACKAGE *package, const WCHAR *source, WCHAR ...@@ -1048,11 +1047,11 @@ static BOOL move_files_wildcard( MSIPACKAGE *package, const WCHAR *source, WCHAR
} }
/* file->dest may be shorter after the reallocation, so add a NULL /* file->dest may be shorter after the reallocation, so add a NULL
* terminator. This is needed for the call to strrchrW, as there will no * terminator. This is needed for the call to wcsrchr, as there will no
* longer be a NULL terminator within the bounds of the allocation in this case. * longer be a NULL terminator within the bounds of the allocation in this case.
*/ */
file->dest[size - 1] = '\0'; file->dest[size - 1] = '\0';
lstrcpyW(strrchrW(file->dest, '\\') + 1, file->destname); lstrcpyW(wcsrchr(file->dest, '\\') + 1, file->destname);
while (!list_empty(&files.entry)) while (!list_empty(&files.entry))
{ {
...@@ -1074,8 +1073,8 @@ done: ...@@ -1074,8 +1073,8 @@ done:
void msi_reduce_to_long_filename( WCHAR *filename ) void msi_reduce_to_long_filename( WCHAR *filename )
{ {
WCHAR *p = strchrW( filename, '|' ); WCHAR *p = wcschr( filename, '|' );
if (p) memmove( filename, p + 1, (strlenW( p + 1 ) + 1) * sizeof(WCHAR) ); if (p) memmove( filename, p + 1, (lstrlenW( p + 1 ) + 1) * sizeof(WCHAR) );
} }
static UINT ITERATE_MoveFiles( MSIRECORD *rec, LPVOID param ) static UINT ITERATE_MoveFiles( MSIRECORD *rec, LPVOID param )
...@@ -1134,7 +1133,7 @@ static UINT ITERATE_MoveFiles( MSIRECORD *rec, LPVOID param ) ...@@ -1134,7 +1133,7 @@ static UINT ITERATE_MoveFiles( MSIRECORD *rec, LPVOID param )
lstrcatW(source, sourcename); lstrcatW(source, sourcename);
} }
wildcards = strchrW(source, '*') || strchrW(source, '?'); wildcards = wcschr(source, '*') || wcschr(source, '?');
if (MSI_RecordIsNull(rec, 4)) if (MSI_RecordIsNull(rec, 4))
{ {
...@@ -1143,7 +1142,7 @@ static UINT ITERATE_MoveFiles( MSIRECORD *rec, LPVOID param ) ...@@ -1143,7 +1142,7 @@ static UINT ITERATE_MoveFiles( MSIRECORD *rec, LPVOID param )
WCHAR *p; WCHAR *p;
if (sourcename) if (sourcename)
destname = strdupW(sourcename); destname = strdupW(sourcename);
else if ((p = strrchrW(sourcedir, '\\'))) else if ((p = wcsrchr(sourcedir, '\\')))
destname = strdupW(p + 1); destname = strdupW(p + 1);
else else
destname = strdupW(sourcedir); destname = strdupW(sourcedir);
...@@ -1231,9 +1230,9 @@ static WCHAR *get_duplicate_filename( MSIPACKAGE *package, MSIRECORD *row, const ...@@ -1231,9 +1230,9 @@ static WCHAR *get_duplicate_filename( MSIPACKAGE *package, MSIRECORD *row, const
if (MSI_RecordIsNull( row, 4 )) if (MSI_RecordIsNull( row, 4 ))
{ {
len = strlenW( src ) + 1; len = lstrlenW( src ) + 1;
if (!(dst_name = msi_alloc( len * sizeof(WCHAR)))) return NULL; if (!(dst_name = msi_alloc( len * sizeof(WCHAR)))) return NULL;
strcpyW( dst_name, strrchrW( src, '\\' ) + 1 ); lstrcpyW( dst_name, wcsrchr( src, '\\' ) + 1 );
} }
else else
{ {
...@@ -1247,7 +1246,7 @@ static WCHAR *get_duplicate_filename( MSIPACKAGE *package, MSIRECORD *row, const ...@@ -1247,7 +1246,7 @@ static WCHAR *get_duplicate_filename( MSIPACKAGE *package, MSIRECORD *row, const
{ {
WCHAR *p; WCHAR *p;
dst_path = strdupW( src ); dst_path = strdupW( src );
p = strrchrW( dst_path, '\\' ); p = wcsrchr( dst_path, '\\' );
if (p) *p = 0; if (p) *p = 0;
} }
else else
......
...@@ -25,7 +25,6 @@ ...@@ -25,7 +25,6 @@
#include "winreg.h" #include "winreg.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "msipriv.h" #include "msipriv.h"
#include "wine/unicode.h"
WINE_DEFAULT_DEBUG_CHANNEL(msi); WINE_DEFAULT_DEBUG_CHANNEL(msi);
...@@ -190,9 +189,9 @@ static WCHAR *font_name_from_file( MSIPACKAGE *package, const WCHAR *filename ) ...@@ -190,9 +189,9 @@ static WCHAR *font_name_from_file( MSIPACKAGE *package, const WCHAR *filename )
msi_free( name ); msi_free( name );
return NULL; return NULL;
} }
ret = msi_alloc( (strlenW( name ) + strlenW( truetypeW ) + 1 ) * sizeof(WCHAR) ); ret = msi_alloc( (lstrlenW( name ) + lstrlenW( truetypeW ) + 1 ) * sizeof(WCHAR) );
strcpyW( ret, name ); lstrcpyW( ret, name );
strcatW( ret, truetypeW ); lstrcatW( ret, truetypeW );
msi_free( name ); msi_free( name );
} }
return ret; return ret;
...@@ -206,20 +205,20 @@ WCHAR *msi_get_font_file_version( MSIPACKAGE *package, const WCHAR *filename ) ...@@ -206,20 +205,20 @@ WCHAR *msi_get_font_file_version( MSIPACKAGE *package, const WCHAR *filename )
if ((version = load_ttf_name_id( package, filename, NAME_ID_VERSION ))) if ((version = load_ttf_name_id( package, filename, NAME_ID_VERSION )))
{ {
int len, major = 0, minor = 0; int len, major = 0, minor = 0;
if ((p = strchrW( version, ';' ))) *p = 0; if ((p = wcschr( version, ';' ))) *p = 0;
p = version; p = version;
while (*p && !isdigitW( *p )) p++; while (*p && !iswdigit( *p )) p++;
if ((q = strchrW( p, '.' ))) if ((q = wcschr( p, '.' )))
{ {
major = atoiW( p ); major = wcstol( p, NULL, 10 );
p = ++q; p = ++q;
while (*q && isdigitW( *q )) q++; while (*q && iswdigit( *q )) q++;
if (!*q || *q == ' ') minor = atoiW( p ); if (!*q || *q == ' ') minor = wcstol( p, NULL, 10 );
else major = 0; else major = 0;
} }
len = strlenW( fmtW ) + 20; len = lstrlenW( fmtW ) + 20;
ret = msi_alloc( len * sizeof(WCHAR) ); ret = msi_alloc( len * sizeof(WCHAR) );
sprintfW( ret, fmtW, major, minor ); swprintf( ret, len, fmtW, major, minor );
msi_free( version ); msi_free( version );
} }
return ret; return ret;
...@@ -277,7 +276,7 @@ static UINT ITERATE_RegisterFonts(MSIRECORD *row, LPVOID param) ...@@ -277,7 +276,7 @@ static UINT ITERATE_RegisterFonts(MSIRECORD *row, LPVOID param)
/* the UI chunk */ /* the UI chunk */
uirow = MSI_CreateRecord( 1 ); uirow = MSI_CreateRecord( 1 );
uipath = strdupW( file->TargetPath ); uipath = strdupW( file->TargetPath );
p = strrchrW(uipath,'\\'); p = wcsrchr(uipath,'\\');
if (p) p++; if (p) p++;
else p = uipath; else p = uipath;
MSI_RecordSetStringW( uirow, 1, p ); MSI_RecordSetStringW( uirow, 1, p );
...@@ -360,7 +359,7 @@ static UINT ITERATE_UnregisterFonts( MSIRECORD *row, LPVOID param ) ...@@ -360,7 +359,7 @@ static UINT ITERATE_UnregisterFonts( MSIRECORD *row, LPVOID param )
/* the UI chunk */ /* the UI chunk */
uirow = MSI_CreateRecord( 1 ); uirow = MSI_CreateRecord( 1 );
uipath = strdupW( file->TargetPath ); uipath = strdupW( file->TargetPath );
p = strrchrW( uipath,'\\' ); p = wcsrchr( uipath,'\\' );
if (p) p++; if (p) p++;
else p = uipath; else p = uipath;
MSI_RecordSetStringW( uirow, 1, p ); MSI_RecordSetStringW( uirow, 1, p );
......
...@@ -36,7 +36,6 @@ ...@@ -36,7 +36,6 @@
#include "msipriv.h" #include "msipriv.h"
#include "winemsi.h" #include "winemsi.h"
#include "wine/exception.h" #include "wine/exception.h"
#include "wine/unicode.h"
WINE_DEFAULT_DEBUG_CHANNEL(msi); WINE_DEFAULT_DEBUG_CHANNEL(msi);
...@@ -163,7 +162,7 @@ static WCHAR *deformat_index( FORMAT *format, FORMSTR *str, int *ret_len ) ...@@ -163,7 +162,7 @@ static WCHAR *deformat_index( FORMAT *format, FORMSTR *str, int *ret_len )
if (!(val = msi_alloc( (str->len + 1) * sizeof(WCHAR) ))) return NULL; if (!(val = msi_alloc( (str->len + 1) * sizeof(WCHAR) ))) return NULL;
lstrcpynW(val, get_formstr_data(format, str), str->len + 1); lstrcpynW(val, get_formstr_data(format, str), str->len + 1);
field = atoiW( val ); field = wcstol( val, NULL, 10 );
msi_free( val ); msi_free( val );
if (MSI_RecordIsNull( format->record, field ) || if (MSI_RecordIsNull( format->record, field ) ||
...@@ -222,7 +221,7 @@ static WCHAR *deformat_component( FORMAT *format, FORMSTR *str, int *ret_len ) ...@@ -222,7 +221,7 @@ static WCHAR *deformat_component( FORMAT *format, FORMSTR *str, int *ret_len )
else else
ret = strdupW( msi_get_target_folder( format->package, comp->Directory ) ); ret = strdupW( msi_get_target_folder( format->package, comp->Directory ) );
if (ret) *ret_len = strlenW( ret ); if (ret) *ret_len = lstrlenW( ret );
else *ret_len = 0; else *ret_len = 0;
msi_free( key ); msi_free( key );
return ret; return ret;
...@@ -240,12 +239,12 @@ static WCHAR *deformat_file( FORMAT *format, FORMSTR *str, BOOL shortname, int * ...@@ -240,12 +239,12 @@ static WCHAR *deformat_file( FORMAT *format, FORMSTR *str, BOOL shortname, int *
if (!(file = msi_get_loaded_file( format->package, key ))) goto done; if (!(file = msi_get_loaded_file( format->package, key ))) goto done;
if (!shortname) if (!shortname)
{ {
if ((ret = strdupW( file->TargetPath ))) len = strlenW( ret ); if ((ret = strdupW( file->TargetPath ))) len = lstrlenW( ret );
goto done; goto done;
} }
if (!(len = GetShortPathNameW(file->TargetPath, NULL, 0))) if (!(len = GetShortPathNameW(file->TargetPath, NULL, 0)))
{ {
if ((ret = strdupW( file->TargetPath ))) len = strlenW( ret ); if ((ret = strdupW( file->TargetPath ))) len = lstrlenW( ret );
goto done; goto done;
} }
len++; len++;
...@@ -352,14 +351,14 @@ static WCHAR *build_default_format( const MSIRECORD *record ) ...@@ -352,14 +351,14 @@ static WCHAR *build_default_format( const MSIRECORD *record )
for (i = 1; i <= count; i++) for (i = 1; i <= count; i++)
{ {
size += sprintfW( buf, fmt, i, i ); size += swprintf( buf, ARRAY_SIZE(buf), fmt, i, i );
if (!(tmp = msi_realloc( ret, size * sizeof(*ret) ))) if (!(tmp = msi_realloc( ret, size * sizeof(*ret) )))
{ {
msi_free( ret ); msi_free( ret );
return NULL; return NULL;
} }
ret = tmp; ret = tmp;
strcatW( ret, buf ); lstrcatW( ret, buf );
} }
return ret; return ret;
} }
......
...@@ -24,7 +24,6 @@ ...@@ -24,7 +24,6 @@
#include "winbase.h" #include "winbase.h"
#include "winerror.h" #include "winerror.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "wine/unicode.h"
#include "msi.h" #include "msi.h"
#include "msiquery.h" #include "msiquery.h"
#include "objbase.h" #include "objbase.h"
...@@ -117,7 +116,7 @@ static BOOL msi_columns_in_order(MSIINSERTVIEW *iv, UINT col_count) ...@@ -117,7 +116,7 @@ static BOOL msi_columns_in_order(MSIINSERTVIEW *iv, UINT col_count)
iv->sv->ops->get_column_info(iv->sv, i, &a, NULL, NULL, NULL); iv->sv->ops->get_column_info(iv->sv, i, &a, NULL, NULL, NULL);
iv->table->ops->get_column_info(iv->table, i, &b, NULL, NULL, NULL); iv->table->ops->get_column_info(iv->table, i, &b, NULL, NULL, NULL);
if (strcmpW( a, b )) return FALSE; if (wcscmp( a, b )) return FALSE;
} }
return TRUE; return TRUE;
} }
...@@ -161,7 +160,7 @@ static UINT msi_arrange_record(MSIINSERTVIEW *iv, MSIRECORD **values) ...@@ -161,7 +160,7 @@ static UINT msi_arrange_record(MSIINSERTVIEW *iv, MSIRECORD **values)
if (r != ERROR_SUCCESS) if (r != ERROR_SUCCESS)
goto err; goto err;
if (!strcmpW( a, b )) if (!wcscmp( a, b ))
{ {
MSI_RecordCopyField(*values, colidx, padded, i); MSI_RecordCopyField(*values, colidx, padded, i);
break; break;
......
...@@ -37,7 +37,6 @@ ...@@ -37,7 +37,6 @@
#include "wine/heap.h" #include "wine/heap.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "wine/exception.h" #include "wine/exception.h"
#include "wine/unicode.h"
WINE_DEFAULT_DEBUG_CHANNEL(msi); WINE_DEFAULT_DEBUG_CHANNEL(msi);
...@@ -166,7 +165,7 @@ UINT msi_strcpy_to_awstring( const WCHAR *str, int len, awstring *awbuf, DWORD * ...@@ -166,7 +165,7 @@ UINT msi_strcpy_to_awstring( const WCHAR *str, int len, awstring *awbuf, DWORD *
if (!sz) if (!sz)
return ERROR_SUCCESS; return ERROR_SUCCESS;
if (len < 0) len = strlenW( str ); if (len < 0) len = lstrlenW( str );
if (awbuf->unicode && awbuf->str.w) if (awbuf->unicode && awbuf->str.w)
{ {
...@@ -197,7 +196,7 @@ UINT msi_strncpyWtoA(const WCHAR *str, int lenW, char *buf, DWORD *sz, BOOL remo ...@@ -197,7 +196,7 @@ UINT msi_strncpyWtoA(const WCHAR *str, int lenW, char *buf, DWORD *sz, BOOL remo
if (!sz) if (!sz)
return buf ? ERROR_INVALID_PARAMETER : ERROR_SUCCESS; return buf ? ERROR_INVALID_PARAMETER : ERROR_SUCCESS;
if (lenW < 0) lenW = strlenW(str); if (lenW < 0) lenW = lstrlenW(str);
lenA = WideCharToMultiByte(CP_ACP, 0, str, lenW + 1, NULL, 0, NULL, NULL); lenA = WideCharToMultiByte(CP_ACP, 0, str, lenW + 1, NULL, 0, NULL, NULL);
WideCharToMultiByte(CP_ACP, 0, str, lenW + 1, buf, *sz, NULL, NULL); WideCharToMultiByte(CP_ACP, 0, str, lenW + 1, buf, *sz, NULL, NULL);
lenA--; lenA--;
...@@ -219,7 +218,7 @@ UINT msi_strncpyW(const WCHAR *str, int len, WCHAR *buf, DWORD *sz) ...@@ -219,7 +218,7 @@ UINT msi_strncpyW(const WCHAR *str, int len, WCHAR *buf, DWORD *sz)
if (!sz) if (!sz)
return buf ? ERROR_INVALID_PARAMETER : ERROR_SUCCESS; return buf ? ERROR_INVALID_PARAMETER : ERROR_SUCCESS;
if (len < 0) len = strlenW(str); if (len < 0) len = lstrlenW(str);
if (buf) if (buf)
memcpy(buf, str, min(len + 1, *sz) * sizeof(WCHAR)); memcpy(buf, str, min(len + 1, *sz) * sizeof(WCHAR));
if (buf && len >= *sz) if (buf && len >= *sz)
...@@ -239,7 +238,7 @@ const WCHAR *msi_get_target_folder( MSIPACKAGE *package, const WCHAR *name ) ...@@ -239,7 +238,7 @@ const WCHAR *msi_get_target_folder( MSIPACKAGE *package, const WCHAR *name )
if (!folder->ResolvedTarget) if (!folder->ResolvedTarget)
{ {
MSIFOLDER *parent = folder; MSIFOLDER *parent = folder;
while (parent->Parent && strcmpW( parent->Parent, parent->Directory )) while (parent->Parent && wcscmp( parent->Parent, parent->Directory ))
{ {
parent = msi_get_loaded_folder( package, parent->Parent ); parent = msi_get_loaded_folder( package, parent->Parent );
} }
...@@ -370,11 +369,11 @@ WCHAR *msi_resolve_source_folder( MSIPACKAGE *package, const WCHAR *name, MSIFOL ...@@ -370,11 +369,11 @@ WCHAR *msi_resolve_source_folder( MSIPACKAGE *package, const WCHAR *name, MSIFOL
TRACE("working to resolve %s\n", debugstr_w(name)); TRACE("working to resolve %s\n", debugstr_w(name));
if (!strcmpW( name, szSourceDir )) name = szTargetDir; if (!wcscmp( name, szSourceDir )) name = szTargetDir;
if (!(f = msi_get_loaded_folder( package, name ))) return NULL; if (!(f = msi_get_loaded_folder( package, name ))) return NULL;
/* special resolving for root dir */ /* special resolving for root dir */
if (!strcmpW( name, szTargetDir ) && !f->ResolvedSource) if (!wcscmp( name, szTargetDir ) && !f->ResolvedSource)
{ {
f->ResolvedSource = get_source_root( package ); f->ResolvedSource = get_source_root( package );
} }
...@@ -548,7 +547,7 @@ static void set_target_path( MSIPACKAGE *package, MSIFOLDER *folder, const WCHAR ...@@ -548,7 +547,7 @@ static void set_target_path( MSIPACKAGE *package, MSIFOLDER *folder, const WCHAR
WCHAR *target_path; WCHAR *target_path;
if (!(target_path = msi_normalize_path( path ))) return; if (!(target_path = msi_normalize_path( path ))) return;
if (strcmpW( target_path, folder->ResolvedTarget )) if (wcscmp( target_path, folder->ResolvedTarget ))
{ {
msi_free( folder->ResolvedTarget ); msi_free( folder->ResolvedTarget );
folder->ResolvedTarget = target_path; folder->ResolvedTarget = target_path;
...@@ -936,7 +935,7 @@ UINT MSI_SetFeatureStateW( MSIPACKAGE *package, LPCWSTR szFeature, INSTALLSTATE ...@@ -936,7 +935,7 @@ UINT MSI_SetFeatureStateW( MSIPACKAGE *package, LPCWSTR szFeature, INSTALLSTATE
/* update all the features that are children of this feature */ /* update all the features that are children of this feature */
LIST_FOR_EACH_ENTRY( child, &package->features, MSIFEATURE, entry ) LIST_FOR_EACH_ENTRY( child, &package->features, MSIFEATURE, entry )
{ {
if (child->Feature_Parent && !strcmpW( szFeature, child->Feature_Parent )) if (child->Feature_Parent && !wcscmp( szFeature, child->Feature_Parent ))
MSI_SetFeatureStateW(package, child->Feature, iState); MSI_SetFeatureStateW(package, child->Feature, iState);
} }
...@@ -1031,7 +1030,7 @@ UINT WINAPI MsiSetFeatureAttributesW( MSIHANDLE handle, LPCWSTR name, DWORD attr ...@@ -1031,7 +1030,7 @@ UINT WINAPI MsiSetFeatureAttributesW( MSIHANDLE handle, LPCWSTR name, DWORD attr
return ERROR_INVALID_HANDLE; return ERROR_INVALID_HANDLE;
costing = msi_dup_property( package->db, szCostingComplete ); costing = msi_dup_property( package->db, szCostingComplete );
if (!costing || !strcmpW( costing, szOne )) if (!costing || !wcscmp( costing, szOne ))
{ {
msi_free( costing ); msi_free( costing );
msiobj_release( &package->hdr ); msiobj_release( &package->hdr );
...@@ -1318,7 +1317,7 @@ static UINT MSI_GetFeatureInfo( MSIPACKAGE *package, LPCWSTR name, LPDWORD attrs ...@@ -1318,7 +1317,7 @@ static UINT MSI_GetFeatureInfo( MSIPACKAGE *package, LPCWSTR name, LPDWORD attrs
if (attrs) *attrs = map_feature_attributes( feature->Attributes ); if (attrs) *attrs = map_feature_attributes( feature->Attributes );
if (title_len) if (title_len)
{ {
if (feature->Title) len = strlenW( feature->Title ); if (feature->Title) len = lstrlenW( feature->Title );
else len = 0; else len = 0;
if (*title_len <= len) if (*title_len <= len)
{ {
...@@ -1327,14 +1326,14 @@ static UINT MSI_GetFeatureInfo( MSIPACKAGE *package, LPCWSTR name, LPDWORD attrs ...@@ -1327,14 +1326,14 @@ static UINT MSI_GetFeatureInfo( MSIPACKAGE *package, LPCWSTR name, LPDWORD attrs
} }
else if (title) else if (title)
{ {
if (feature->Title) strcpyW( title, feature->Title ); if (feature->Title) lstrcpyW( title, feature->Title );
else *title = 0; else *title = 0;
*title_len = len; *title_len = len;
} }
} }
if (help_len) if (help_len)
{ {
if (feature->Description) len = strlenW( feature->Description ); if (feature->Description) len = lstrlenW( feature->Description );
else len = 0; else len = 0;
if (*help_len <= len) if (*help_len <= len)
{ {
...@@ -1343,7 +1342,7 @@ static UINT MSI_GetFeatureInfo( MSIPACKAGE *package, LPCWSTR name, LPDWORD attrs ...@@ -1343,7 +1342,7 @@ static UINT MSI_GetFeatureInfo( MSIPACKAGE *package, LPCWSTR name, LPDWORD attrs
} }
else if (help) else if (help)
{ {
if (feature->Description) strcpyW( help, feature->Description ); if (feature->Description) lstrcpyW( help, feature->Description );
else *help = 0; else *help = 0;
*help_len = len; *help_len = len;
} }
...@@ -1588,7 +1587,7 @@ UINT MSI_SetInstallLevel( MSIPACKAGE *package, int iInstallLevel ) ...@@ -1588,7 +1587,7 @@ UINT MSI_SetInstallLevel( MSIPACKAGE *package, int iInstallLevel )
if (iInstallLevel < 1) if (iInstallLevel < 1)
return MSI_SetFeatureStates( package ); return MSI_SetFeatureStates( package );
len = sprintfW( level, fmt, iInstallLevel ); len = swprintf( level, ARRAY_SIZE(level), fmt, iInstallLevel );
r = msi_set_property( package->db, szInstallLevel, level, len ); r = msi_set_property( package->db, szInstallLevel, level, len );
if ( r == ERROR_SUCCESS ) if ( r == ERROR_SUCCESS )
r = MSI_SetFeatureStates( package ); r = MSI_SetFeatureStates( package );
......
...@@ -31,7 +31,6 @@ ...@@ -31,7 +31,6 @@
#include "winreg.h" #include "winreg.h"
#include "shlwapi.h" #include "shlwapi.h"
#include "objidl.h" #include "objidl.h"
#include "wine/unicode.h"
#include "resource.h" #include "resource.h"
WINE_DEFAULT_DEBUG_CHANNEL(msi); WINE_DEFAULT_DEBUG_CHANNEL(msi);
...@@ -59,7 +58,7 @@ static BOOL source_matches_volume(MSIMEDIAINFO *mi, LPCWSTR source_root) ...@@ -59,7 +58,7 @@ static BOOL source_matches_volume(MSIMEDIAINFO *mi, LPCWSTR source_root)
const WCHAR *p; const WCHAR *p;
int len, len2; int len, len2;
strcpyW(root, source_root); lstrcpyW(root, source_root);
PathStripToRootW(root); PathStripToRootW(root);
PathAddBackslashW(root); PathAddBackslashW(root);
...@@ -69,12 +68,12 @@ static BOOL source_matches_volume(MSIMEDIAINFO *mi, LPCWSTR source_root) ...@@ -69,12 +68,12 @@ static BOOL source_matches_volume(MSIMEDIAINFO *mi, LPCWSTR source_root)
return FALSE; return FALSE;
} }
len = strlenW( volume_name ); len = lstrlenW( volume_name );
len2 = strlenW( mi->volume_label ); len2 = lstrlenW( mi->volume_label );
if (len2 > len) return FALSE; if (len2 > len) return FALSE;
p = volume_name + len - len2; p = volume_name + len - len2;
return !strcmpiW( mi->volume_label, p ); return !wcsicmp( mi->volume_label, p );
} }
static UINT msi_change_media(MSIPACKAGE *package, MSIMEDIAINFO *mi) static UINT msi_change_media(MSIPACKAGE *package, MSIMEDIAINFO *mi)
...@@ -309,10 +308,10 @@ static WCHAR *get_cabinet_filename(MSIMEDIAINFO *mi) ...@@ -309,10 +308,10 @@ static WCHAR *get_cabinet_filename(MSIMEDIAINFO *mi)
int len; int len;
WCHAR *ret; WCHAR *ret;
len = strlenW(mi->sourcedir) + strlenW(mi->cabinet) + 1; len = lstrlenW(mi->sourcedir) + lstrlenW(mi->cabinet) + 1;
if (!(ret = msi_alloc(len * sizeof(WCHAR)))) return NULL; if (!(ret = msi_alloc(len * sizeof(WCHAR)))) return NULL;
strcpyW(ret, mi->sourcedir); lstrcpyW(ret, mi->sourcedir);
strcatW(ret, mi->cabinet); lstrcatW(ret, mi->cabinet);
return ret; return ret;
} }
...@@ -342,7 +341,7 @@ static INT_PTR cabinet_next_cabinet(FDINOTIFICATIONTYPE fdint, ...@@ -342,7 +341,7 @@ static INT_PTR cabinet_next_cabinet(FDINOTIFICATIONTYPE fdint,
goto done; goto done;
} }
if (strcmpiW( mi->cabinet, cab )) if (wcsicmp( mi->cabinet, cab ))
{ {
char *next_cab; char *next_cab;
ULONG length; ULONG length;
...@@ -467,8 +466,8 @@ static INT_PTR cabinet_copy_file(FDINOTIFICATIONTYPE fdint, ...@@ -467,8 +466,8 @@ static INT_PTR cabinet_copy_file(FDINOTIFICATIONTYPE fdint,
TRACE("file in use, scheduling rename operation\n"); TRACE("file in use, scheduling rename operation\n");
if (!(tmppathW = strdupW( path ))) return ERROR_OUTOFMEMORY; if (!(tmppathW = strdupW( path ))) return ERROR_OUTOFMEMORY;
if ((p = strrchrW(tmppathW, '\\'))) *p = 0; if ((p = wcsrchr(tmppathW, '\\'))) *p = 0;
len = strlenW( tmppathW ) + 16; len = lstrlenW( tmppathW ) + 16;
if (!(tmpfileW = msi_alloc(len * sizeof(WCHAR)))) if (!(tmpfileW = msi_alloc(len * sizeof(WCHAR))))
{ {
msi_free( tmppathW ); msi_free( tmppathW );
...@@ -671,7 +670,7 @@ static UINT get_drive_type(const WCHAR *path) ...@@ -671,7 +670,7 @@ static UINT get_drive_type(const WCHAR *path)
{ {
WCHAR root[MAX_PATH + 1]; WCHAR root[MAX_PATH + 1];
strcpyW(root, path); lstrcpyW(root, path);
PathStripToRootW(root); PathStripToRootW(root);
PathAddBackslashW(root); PathAddBackslashW(root);
...@@ -681,7 +680,7 @@ static UINT get_drive_type(const WCHAR *path) ...@@ -681,7 +680,7 @@ static UINT get_drive_type(const WCHAR *path)
static WCHAR *get_base_url( MSIDATABASE *db ) static WCHAR *get_base_url( MSIDATABASE *db )
{ {
WCHAR *p, *ret = NULL, *orig_db = msi_dup_property( db, szOriginalDatabase ); WCHAR *p, *ret = NULL, *orig_db = msi_dup_property( db, szOriginalDatabase );
if (UrlIsW( orig_db, URLIS_URL ) && (ret = strdupW( orig_db )) && (p = strrchrW( ret, '/'))) p[1] = 0; if (UrlIsW( orig_db, URLIS_URL ) && (ret = strdupW( orig_db )) && (p = wcsrchr( ret, '/'))) p[1] = 0;
msi_free( orig_db ); msi_free( orig_db );
return ret; return ret;
} }
...@@ -793,7 +792,7 @@ static UINT find_published_source(MSIPACKAGE *package, MSIMEDIAINFO *mi) ...@@ -793,7 +792,7 @@ static UINT find_published_source(MSIPACKAGE *package, MSIMEDIAINFO *mi)
MSISOURCETYPE_NETWORK, index++, MSISOURCETYPE_NETWORK, index++,
volume, &volumesz) == ERROR_SUCCESS) volume, &volumesz) == ERROR_SUCCESS)
{ {
if (check_all || !strncmpiW(source, volume, strlenW(source))) if (check_all || !wcsnicmp(source, volume, lstrlenW(source)))
{ {
lstrcpyW(cabinet_file, volume); lstrcpyW(cabinet_file, volume);
PathAddBackslashW(cabinet_file); PathAddBackslashW(cabinet_file);
...@@ -832,11 +831,11 @@ static UINT find_published_source(MSIPACKAGE *package, MSIMEDIAINFO *mi) ...@@ -832,11 +831,11 @@ static UINT find_published_source(MSIPACKAGE *package, MSIMEDIAINFO *mi)
mi->disk_id = id; mi->disk_id = id;
msi_free( mi->volume_label ); msi_free( mi->volume_label );
if (!(mi->volume_label = msi_alloc( ++volumesz * sizeof(WCHAR) ))) return ERROR_OUTOFMEMORY; if (!(mi->volume_label = msi_alloc( ++volumesz * sizeof(WCHAR) ))) return ERROR_OUTOFMEMORY;
strcpyW( mi->volume_label, volume ); lstrcpyW( mi->volume_label, volume );
msi_free( mi->disk_prompt ); msi_free( mi->disk_prompt );
if (!(mi->disk_prompt = msi_alloc( ++promptsz * sizeof(WCHAR) ))) return ERROR_OUTOFMEMORY; if (!(mi->disk_prompt = msi_alloc( ++promptsz * sizeof(WCHAR) ))) return ERROR_OUTOFMEMORY;
strcpyW( mi->disk_prompt, prompt ); lstrcpyW( mi->disk_prompt, prompt );
if (source_matches_volume(mi, source)) if (source_matches_volume(mi, source))
{ {
...@@ -875,20 +874,20 @@ UINT ready_media( MSIPACKAGE *package, BOOL compressed, MSIMEDIAINFO *mi ) ...@@ -875,20 +874,20 @@ UINT ready_media( MSIPACKAGE *package, BOOL compressed, MSIMEDIAINFO *mi )
WCHAR temppath[MAX_PATH], *p, *url; WCHAR temppath[MAX_PATH], *p, *url;
msi_free( cabinet_file ); msi_free( cabinet_file );
if (!(url = msi_alloc( (strlenW( base_url ) + strlenW( mi->cabinet ) + 1) * sizeof(WCHAR) ))) if (!(url = msi_alloc( (lstrlenW( base_url ) + lstrlenW( mi->cabinet ) + 1) * sizeof(WCHAR) )))
{ {
return ERROR_OUTOFMEMORY; return ERROR_OUTOFMEMORY;
} }
strcpyW( url, base_url ); lstrcpyW( url, base_url );
strcatW( url, mi->cabinet ); lstrcatW( url, mi->cabinet );
if ((rc = msi_download_file( url, temppath )) != ERROR_SUCCESS) if ((rc = msi_download_file( url, temppath )) != ERROR_SUCCESS)
{ {
ERR("failed to download %s (%u)\n", debugstr_w(url), rc); ERR("failed to download %s (%u)\n", debugstr_w(url), rc);
msi_free( url ); msi_free( url );
return rc; return rc;
} }
if ((p = strrchrW( temppath, '\\' ))) *p = 0; if ((p = wcsrchr( temppath, '\\' ))) *p = 0;
strcpyW( mi->sourcedir, temppath ); lstrcpyW( mi->sourcedir, temppath );
PathAddBackslashW( mi->sourcedir ); PathAddBackslashW( mi->sourcedir );
msi_free( mi->cabinet ); msi_free( mi->cabinet );
mi->cabinet = strdupW( p + 1 ); mi->cabinet = strdupW( p + 1 );
...@@ -901,7 +900,7 @@ UINT ready_media( MSIPACKAGE *package, BOOL compressed, MSIMEDIAINFO *mi ) ...@@ -901,7 +900,7 @@ UINT ready_media( MSIPACKAGE *package, BOOL compressed, MSIMEDIAINFO *mi )
if (mi->volume_label) if (mi->volume_label)
{ {
/* assume first volume is in the drive */ /* assume first volume is in the drive */
if (mi->last_volume && strcmpiW( mi->last_volume, mi->volume_label )) if (mi->last_volume && wcsicmp( mi->last_volume, mi->volume_label ))
{ {
WCHAR *source = msi_dup_property( package->db, szSourceDir ); WCHAR *source = msi_dup_property( package->db, szSourceDir );
BOOL match = source_matches_volume( mi, source ); BOOL match = source_matches_volume( mi, source );
...@@ -951,12 +950,12 @@ UINT msi_add_cabinet_stream( MSIPACKAGE *package, UINT disk_id, IStorage *storag ...@@ -951,12 +950,12 @@ UINT msi_add_cabinet_stream( MSIPACKAGE *package, UINT disk_id, IStorage *storag
} }
} }
if (!(cab = msi_alloc( sizeof(*cab) ))) return ERROR_OUTOFMEMORY; if (!(cab = msi_alloc( sizeof(*cab) ))) return ERROR_OUTOFMEMORY;
if (!(cab->stream = msi_alloc( (strlenW( name ) + 1) * sizeof(WCHAR ) ))) if (!(cab->stream = msi_alloc( (lstrlenW( name ) + 1) * sizeof(WCHAR ) )))
{ {
msi_free( cab ); msi_free( cab );
return ERROR_OUTOFMEMORY; return ERROR_OUTOFMEMORY;
} }
strcpyW( cab->stream, name ); lstrcpyW( cab->stream, name );
cab->disk_id = disk_id; cab->disk_id = disk_id;
cab->storage = storage; cab->storage = storage;
IStorage_AddRef( storage ); IStorage_AddRef( storage );
......
...@@ -852,10 +852,10 @@ extern BOOL decode_streamname(LPCWSTR in, LPWSTR out) DECLSPEC_HIDDEN; ...@@ -852,10 +852,10 @@ extern BOOL decode_streamname(LPCWSTR in, LPWSTR out) DECLSPEC_HIDDEN;
extern UINT msi_get_stream( MSIDATABASE *, const WCHAR *, IStream ** ) DECLSPEC_HIDDEN; extern UINT msi_get_stream( MSIDATABASE *, const WCHAR *, IStream ** ) DECLSPEC_HIDDEN;
extern UINT MSI_OpenDatabaseW( LPCWSTR, LPCWSTR, MSIDATABASE ** ) DECLSPEC_HIDDEN; extern UINT MSI_OpenDatabaseW( LPCWSTR, LPCWSTR, MSIDATABASE ** ) DECLSPEC_HIDDEN;
extern UINT MSI_DatabaseOpenViewW(MSIDATABASE *, LPCWSTR, MSIQUERY ** ) DECLSPEC_HIDDEN; extern UINT MSI_DatabaseOpenViewW(MSIDATABASE *, LPCWSTR, MSIQUERY ** ) DECLSPEC_HIDDEN;
extern UINT MSI_OpenQuery( MSIDATABASE *, MSIQUERY **, LPCWSTR, ... ) DECLSPEC_HIDDEN; extern UINT WINAPIV MSI_OpenQuery( MSIDATABASE *, MSIQUERY **, LPCWSTR, ... ) DECLSPEC_HIDDEN;
typedef UINT (*record_func)( MSIRECORD *, LPVOID ); typedef UINT (*record_func)( MSIRECORD *, LPVOID );
extern UINT MSI_IterateRecords( MSIQUERY *, LPDWORD, record_func, LPVOID ) DECLSPEC_HIDDEN; extern UINT MSI_IterateRecords( MSIQUERY *, LPDWORD, record_func, LPVOID ) DECLSPEC_HIDDEN;
extern MSIRECORD *MSI_QueryGetRecord( MSIDATABASE *db, LPCWSTR query, ... ) DECLSPEC_HIDDEN; extern MSIRECORD * WINAPIV MSI_QueryGetRecord( MSIDATABASE *db, LPCWSTR query, ... ) DECLSPEC_HIDDEN;
extern UINT MSI_DatabaseGetPrimaryKeys( MSIDATABASE *, LPCWSTR, MSIRECORD ** ) DECLSPEC_HIDDEN; extern UINT MSI_DatabaseGetPrimaryKeys( MSIDATABASE *, LPCWSTR, MSIRECORD ** ) DECLSPEC_HIDDEN;
/* view internals */ /* view internals */
......
...@@ -27,7 +27,6 @@ ...@@ -27,7 +27,6 @@
#include "winerror.h" #include "winerror.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "wine/exception.h" #include "wine/exception.h"
#include "wine/unicode.h"
#include "msi.h" #include "msi.h"
#include "msiquery.h" #include "msiquery.h"
#include "objbase.h" #include "objbase.h"
...@@ -74,9 +73,9 @@ UINT VIEW_find_column( MSIVIEW *table, LPCWSTR name, LPCWSTR table_name, UINT *n ...@@ -74,9 +73,9 @@ UINT VIEW_find_column( MSIVIEW *table, LPCWSTR name, LPCWSTR table_name, UINT *n
NULL, &haystack_table_name ); NULL, &haystack_table_name );
if( r != ERROR_SUCCESS ) if( r != ERROR_SUCCESS )
return r; return r;
x = strcmpW( name, col_name ); x = wcscmp( name, col_name );
if( table_name ) if( table_name )
x |= strcmpW( table_name, haystack_table_name ); x |= wcscmp( table_name, haystack_table_name );
if( !x ) if( !x )
{ {
*n = i; *n = i;
...@@ -138,7 +137,7 @@ UINT MSI_DatabaseOpenViewW(MSIDATABASE *db, ...@@ -138,7 +137,7 @@ UINT MSI_DatabaseOpenViewW(MSIDATABASE *db,
return r; return r;
} }
UINT MSI_OpenQuery( MSIDATABASE *db, MSIQUERY **view, LPCWSTR fmt, ... ) UINT WINAPIV MSI_OpenQuery( MSIDATABASE *db, MSIQUERY **view, LPCWSTR fmt, ... )
{ {
UINT r; UINT r;
int size = 100, res; int size = 100, res;
...@@ -147,11 +146,11 @@ UINT MSI_OpenQuery( MSIDATABASE *db, MSIQUERY **view, LPCWSTR fmt, ... ) ...@@ -147,11 +146,11 @@ UINT MSI_OpenQuery( MSIDATABASE *db, MSIQUERY **view, LPCWSTR fmt, ... )
/* construct the string */ /* construct the string */
for (;;) for (;;)
{ {
va_list va; __ms_va_list va;
query = msi_alloc( size*sizeof(WCHAR) ); query = msi_alloc( size*sizeof(WCHAR) );
va_start(va, fmt); __ms_va_start(va, fmt);
res = vsnprintfW(query, size, fmt, va); res = vswprintf(query, size, fmt, va);
va_end(va); __ms_va_end(va);
if (res == -1) size *= 2; if (res == -1) size *= 2;
else if (res >= size) size = res + 1; else if (res >= size) size = res + 1;
else break; else break;
...@@ -201,7 +200,7 @@ UINT MSI_IterateRecords( MSIQUERY *view, LPDWORD count, ...@@ -201,7 +200,7 @@ UINT MSI_IterateRecords( MSIQUERY *view, LPDWORD count,
} }
/* return a single record from a query */ /* return a single record from a query */
MSIRECORD *MSI_QueryGetRecord( MSIDATABASE *db, LPCWSTR fmt, ... ) MSIRECORD * WINAPIV MSI_QueryGetRecord( MSIDATABASE *db, LPCWSTR fmt, ... )
{ {
MSIRECORD *rec = NULL; MSIRECORD *rec = NULL;
MSIQUERY *view = NULL; MSIQUERY *view = NULL;
...@@ -212,11 +211,11 @@ MSIRECORD *MSI_QueryGetRecord( MSIDATABASE *db, LPCWSTR fmt, ... ) ...@@ -212,11 +211,11 @@ MSIRECORD *MSI_QueryGetRecord( MSIDATABASE *db, LPCWSTR fmt, ... )
/* construct the string */ /* construct the string */
for (;;) for (;;)
{ {
va_list va; __ms_va_list va;
query = msi_alloc( size*sizeof(WCHAR) ); query = msi_alloc( size*sizeof(WCHAR) );
va_start(va, fmt); __ms_va_start(va, fmt);
res = vsnprintfW(query, size, fmt, va); res = vswprintf(query, size, fmt, va);
va_end(va); __ms_va_end(va);
if (res == -1) size *= 2; if (res == -1) size *= 2;
else if (res >= size) size = res + 1; else if (res >= size) size = res + 1;
else break; else break;
...@@ -592,7 +591,7 @@ static UINT msi_set_record_type_string( MSIRECORD *rec, UINT field, ...@@ -592,7 +591,7 @@ static UINT msi_set_record_type_string( MSIRECORD *rec, UINT field,
if (type & MSITYPE_NULLABLE) if (type & MSITYPE_NULLABLE)
szType[0] &= ~0x20; szType[0] &= ~0x20;
sprintfW( &szType[1], fmt, (type&0xff) ); swprintf( &szType[1], ARRAY_SIZE(szType) - 1, fmt, (type&0xff) );
TRACE("type %04x -> %s\n", type, debugstr_w(szType) ); TRACE("type %04x -> %s\n", type, debugstr_w(szType) );
......
...@@ -27,7 +27,6 @@ ...@@ -27,7 +27,6 @@
#include "objbase.h" #include "objbase.h"
#include "shlwapi.h" #include "shlwapi.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "wine/unicode.h"
#include "msipriv.h" #include "msipriv.h"
WINE_DEFAULT_DEBUG_CHANNEL(msi); WINE_DEFAULT_DEBUG_CHANNEL(msi);
...@@ -71,7 +70,7 @@ static struct transform_desc *parse_transform_desc( const WCHAR *str ) ...@@ -71,7 +70,7 @@ static struct transform_desc *parse_transform_desc( const WCHAR *str )
if (!(ret = msi_alloc_zero( sizeof(*ret) ))) return NULL; if (!(ret = msi_alloc_zero( sizeof(*ret) ))) return NULL;
q = strchrW( p, '}' ); q = wcschr( p, '}' );
if (*p != '{' || !q) goto error; if (*p != '{' || !q) goto error;
len = q - p + 1; len = q - p + 1;
...@@ -80,14 +79,14 @@ static struct transform_desc *parse_transform_desc( const WCHAR *str ) ...@@ -80,14 +79,14 @@ static struct transform_desc *parse_transform_desc( const WCHAR *str )
ret->product_code_from[len] = 0; ret->product_code_from[len] = 0;
p = q + 1; p = q + 1;
if (!(q = strchrW( p, ';' ))) goto error; if (!(q = wcschr( p, ';' ))) goto error;
len = q - p; len = q - p;
if (!(ret->version_from = msi_alloc( (len + 1) * sizeof(WCHAR) ))) goto error; if (!(ret->version_from = msi_alloc( (len + 1) * sizeof(WCHAR) ))) goto error;
memcpy( ret->version_from, p, len * sizeof(WCHAR) ); memcpy( ret->version_from, p, len * sizeof(WCHAR) );
ret->version_from[len] = 0; ret->version_from[len] = 0;
p = q + 1; p = q + 1;
q = strchrW( p, '}' ); q = wcschr( p, '}' );
if (*p != '{' || !q) goto error; if (*p != '{' || !q) goto error;
len = q - p + 1; len = q - p + 1;
...@@ -96,14 +95,14 @@ static struct transform_desc *parse_transform_desc( const WCHAR *str ) ...@@ -96,14 +95,14 @@ static struct transform_desc *parse_transform_desc( const WCHAR *str )
ret->product_code_to[len] = 0; ret->product_code_to[len] = 0;
p = q + 1; p = q + 1;
if (!(q = strchrW( p, ';' ))) goto error; if (!(q = wcschr( p, ';' ))) goto error;
len = q - p; len = q - p;
if (!(ret->version_to = msi_alloc( (len + 1) * sizeof(WCHAR) ))) goto error; if (!(ret->version_to = msi_alloc( (len + 1) * sizeof(WCHAR) ))) goto error;
memcpy( ret->version_to, p, len * sizeof(WCHAR) ); memcpy( ret->version_to, p, len * sizeof(WCHAR) );
ret->version_to[len] = 0; ret->version_to[len] = 0;
p = q + 1; p = q + 1;
q = strchrW( p, '}' ); q = wcschr( p, '}' );
if (*p != '{' || !q) goto error; if (*p != '{' || !q) goto error;
len = q - p + 1; len = q - p + 1;
...@@ -173,7 +172,7 @@ static UINT check_transform_applicable( MSIPACKAGE *package, IStorage *transform ...@@ -173,7 +172,7 @@ static UINT check_transform_applicable( MSIPACKAGE *package, IStorage *transform
if (wanted_flags & MSITRANSFORM_VALIDATE_LANGUAGE) if (wanted_flags & MSITRANSFORM_VALIDATE_LANGUAGE)
{ {
if (!template[0] || ((p = strchrW( template, ';' )) && match_language( package, atoiW( p + 1 ) ))) if (!template[0] || ((p = wcschr( template, ';' )) && match_language( package, wcstol( p + 1, NULL, 10 ) )))
{ {
valid_flags |= MSITRANSFORM_VALIDATE_LANGUAGE; valid_flags |= MSITRANSFORM_VALIDATE_LANGUAGE;
} }
...@@ -189,7 +188,7 @@ static UINT check_transform_applicable( MSIPACKAGE *package, IStorage *transform ...@@ -189,7 +188,7 @@ static UINT check_transform_applicable( MSIPACKAGE *package, IStorage *transform
msiobj_release( &si->hdr ); msiobj_release( &si->hdr );
return ERROR_INSTALL_PACKAGE_INVALID; return ERROR_INSTALL_PACKAGE_INVALID;
} }
if (!strcmpW( desc->product_code_from, product_code_installed )) if (!wcscmp( desc->product_code_from, product_code_installed ))
{ {
valid_flags |= MSITRANSFORM_VALIDATE_PRODUCT; valid_flags |= MSITRANSFORM_VALIDATE_PRODUCT;
} }
...@@ -245,7 +244,7 @@ static UINT check_transform_applicable( MSIPACKAGE *package, IStorage *transform ...@@ -245,7 +244,7 @@ static UINT check_transform_applicable( MSIPACKAGE *package, IStorage *transform
msiobj_release( &si->hdr ); msiobj_release( &si->hdr );
return ERROR_INSTALL_PACKAGE_INVALID; return ERROR_INSTALL_PACKAGE_INVALID;
} }
if (!strcmpW( desc->upgrade_code, upgrade_code_installed )) if (!wcscmp( desc->upgrade_code, upgrade_code_installed ))
valid_flags |= MSITRANSFORM_VALIDATE_UPGRADECODE; valid_flags |= MSITRANSFORM_VALIDATE_UPGRADECODE;
msi_free( upgrade_code_installed ); msi_free( upgrade_code_installed );
} }
...@@ -303,7 +302,7 @@ UINT msi_check_patch_applicable( MSIPACKAGE *package, MSISUMMARYINFO *si ) ...@@ -303,7 +302,7 @@ UINT msi_check_patch_applicable( MSIPACKAGE *package, MSISUMMARYINFO *si )
guids = msi_split_string( guid_list, ';' ); guids = msi_split_string( guid_list, ';' );
for (i = 0; guids[i] && ret != ERROR_SUCCESS; i++) for (i = 0; guids[i] && ret != ERROR_SUCCESS; i++)
{ {
if (!strcmpW( guids[i], product_code )) ret = ERROR_SUCCESS; if (!wcscmp( guids[i], product_code )) ret = ERROR_SUCCESS;
} }
msi_free( guids ); msi_free( guids );
msi_free( guid_list ); msi_free( guid_list );
...@@ -333,7 +332,7 @@ static UINT msi_parse_patch_summary( MSISUMMARYINFO *si, MSIPATCHINFO **patch ) ...@@ -333,7 +332,7 @@ static UINT msi_parse_patch_summary( MSISUMMARYINFO *si, MSIPATCHINFO **patch )
msi_free( pi ); msi_free( pi );
return ERROR_PATCH_PACKAGE_INVALID; return ERROR_PATCH_PACKAGE_INVALID;
} }
if (!(p = strchrW( p + 1, '}' ))) if (!(p = wcschr( p + 1, '}' )))
{ {
msi_free( pi->patchcode ); msi_free( pi->patchcode );
msi_free( pi ); msi_free( pi );
...@@ -526,7 +525,7 @@ static UINT patch_update_file_sequence( MSIDATABASE *db, const struct patch_offs ...@@ -526,7 +525,7 @@ static UINT patch_update_file_sequence( MSIDATABASE *db, const struct patch_offs
LIST_FOR_EACH_ENTRY( po, &pos->files, struct patch_offset, entry ) LIST_FOR_EACH_ENTRY( po, &pos->files, struct patch_offset, entry )
{ {
if (!strcmpiW( file, po->name )) if (!wcsicmp( file, po->name ))
{ {
MSI_RecordSetInteger( rec, 8, seq + pos->offset_to_apply ); MSI_RecordSetInteger( rec, 8, seq + pos->offset_to_apply );
r = MSI_ViewModify( view, MSIMODIFY_UPDATE, rec ); r = MSI_ViewModify( view, MSIMODIFY_UPDATE, rec );
...@@ -557,7 +556,7 @@ static UINT patch_update_filepatch_sequence( MSIDATABASE *db, const struct patch ...@@ -557,7 +556,7 @@ static UINT patch_update_filepatch_sequence( MSIDATABASE *db, const struct patch
LIST_FOR_EACH_ENTRY( po, &pos->patches, struct patch_offset, entry ) LIST_FOR_EACH_ENTRY( po, &pos->patches, struct patch_offset, entry )
{ {
if (seq == po->sequence && !strcmpiW( file, po->name )) if (seq == po->sequence && !wcsicmp( file, po->name ))
{ {
MSIQUERY *delete_view, *insert_view; MSIQUERY *delete_view, *insert_view;
MSIRECORD *rec2; MSIRECORD *rec2;
...@@ -858,7 +857,7 @@ static DWORD is_uninstallable( MSIDATABASE *db ) ...@@ -858,7 +857,7 @@ static DWORD is_uninstallable( MSIDATABASE *db )
if (MSI_ViewFetch( view, &rec ) == ERROR_SUCCESS) if (MSI_ViewFetch( view, &rec ) == ERROR_SUCCESS)
{ {
const WCHAR *value = MSI_RecordGetString( rec, 1 ); const WCHAR *value = MSI_RecordGetString( rec, 1 );
ret = atoiW( value ); ret = wcstol( value, NULL, 10 );
msiobj_release( &rec->hdr ); msiobj_release( &rec->hdr );
} }
...@@ -1005,17 +1004,17 @@ UINT msi_apply_transforms( MSIPACKAGE *package ) ...@@ -1005,17 +1004,17 @@ UINT msi_apply_transforms( MSIPACKAGE *package )
if (!PathIsRelativeW( xforms[i] )) transform = xforms[i]; if (!PathIsRelativeW( xforms[i] )) transform = xforms[i];
else else
{ {
WCHAR *p = strrchrW( package->PackagePath, '\\' ); WCHAR *p = wcsrchr( package->PackagePath, '\\' );
DWORD len = p - package->PackagePath + 1; DWORD len = p - package->PackagePath + 1;
if (!(transform = msi_alloc( (len + strlenW( xforms[i] ) + 1) * sizeof(WCHAR)) )) if (!(transform = msi_alloc( (len + lstrlenW( xforms[i] ) + 1) * sizeof(WCHAR)) ))
{ {
msi_free( xforms ); msi_free( xforms );
msi_free( xform_list ); msi_free( xform_list );
return ERROR_OUTOFMEMORY; return ERROR_OUTOFMEMORY;
} }
memcpy( transform, package->PackagePath, len * sizeof(WCHAR) ); memcpy( transform, package->PackagePath, len * sizeof(WCHAR) );
memcpy( transform + len, xforms[i], (strlenW( xforms[i] ) + 1) * sizeof(WCHAR) ); memcpy( transform + len, xforms[i], (lstrlenW( xforms[i] ) + 1) * sizeof(WCHAR) );
} }
r = MSI_DatabaseApplyTransformW( package->db, transform, 0 ); r = MSI_DatabaseApplyTransformW( package->db, transform, 0 );
if (transform != xforms[i]) msi_free( transform ); if (transform != xforms[i]) msi_free( transform );
......
...@@ -27,7 +27,6 @@ ...@@ -27,7 +27,6 @@
#include "winuser.h" #include "winuser.h"
#include "winerror.h" #include "winerror.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "wine/unicode.h"
#include "msi.h" #include "msi.h"
#include "msiquery.h" #include "msiquery.h"
#include "msipriv.h" #include "msipriv.h"
...@@ -582,7 +581,7 @@ UINT msi_record_set_string( MSIRECORD *rec, UINT field, const WCHAR *value, int ...@@ -582,7 +581,7 @@ UINT msi_record_set_string( MSIRECORD *rec, UINT field, const WCHAR *value, int
MSI_FreeField( &rec->fields[field] ); MSI_FreeField( &rec->fields[field] );
if (value && len < 0) len = strlenW( value ); if (value && len < 0) len = lstrlenW( value );
if (value && len) if (value && len)
{ {
......
...@@ -30,7 +30,6 @@ ...@@ -30,7 +30,6 @@
#include "activscp.h" #include "activscp.h"
#include "oleauto.h" #include "oleauto.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "wine/unicode.h"
#include "msiserver.h" #include "msiserver.h"
...@@ -136,7 +135,7 @@ static HRESULT WINAPI MsiActiveScriptSite_GetItemInfo(IActiveScriptSite* iface, ...@@ -136,7 +135,7 @@ static HRESULT WINAPI MsiActiveScriptSite_GetItemInfo(IActiveScriptSite* iface,
} }
/* Are we looking for the session object? */ /* Are we looking for the session object? */
if (!strcmpW(szSession, pstrName)) { if (!wcscmp(szSession, pstrName)) {
if (dwReturnMask & SCRIPTINFO_ITYPEINFO) { if (dwReturnMask & SCRIPTINFO_ITYPEINFO) {
HRESULT hr = get_typeinfo(Session_tid, ppti); HRESULT hr = get_typeinfo(Session_tid, ppti);
if (SUCCEEDED(hr)) if (SUCCEEDED(hr))
......
...@@ -34,7 +34,6 @@ ...@@ -34,7 +34,6 @@
#include "wincrypt.h" #include "wincrypt.h"
#include "winver.h" #include "winver.h"
#include "winuser.h" #include "winuser.h"
#include "wine/unicode.h"
#include "sddl.h" #include "sddl.h"
WINE_DEFAULT_DEBUG_CHANNEL(msi); WINE_DEFAULT_DEBUG_CHANNEL(msi);
...@@ -273,10 +272,10 @@ UINT WINAPI MsiSourceListEnumMediaDisksW(LPCWSTR szProductCodeOrPatchCode, ...@@ -273,10 +272,10 @@ UINT WINAPI MsiSourceListEnumMediaDisksW(LPCWSTR szProductCodeOrPatchCode,
goto done; goto done;
if (pdwDiskId) if (pdwDiskId)
*pdwDiskId = atolW(value); *pdwDiskId = wcstol(value, NULL, 10);
ptr2 = data; ptr2 = data;
ptr = strchrW(data, ';'); ptr = wcschr(data, ';');
if (!ptr) if (!ptr)
ptr = data; ptr = data;
else else
...@@ -286,7 +285,7 @@ UINT WINAPI MsiSourceListEnumMediaDisksW(LPCWSTR szProductCodeOrPatchCode, ...@@ -286,7 +285,7 @@ UINT WINAPI MsiSourceListEnumMediaDisksW(LPCWSTR szProductCodeOrPatchCode,
{ {
if (type == REG_DWORD) if (type == REG_DWORD)
{ {
sprintfW(convert, fmt, *data); swprintf(convert, ARRAY_SIZE(convert), fmt, *data);
size = lstrlenW(convert); size = lstrlenW(convert);
ptr2 = convert; ptr2 = convert;
} }
...@@ -308,7 +307,7 @@ UINT WINAPI MsiSourceListEnumMediaDisksW(LPCWSTR szProductCodeOrPatchCode, ...@@ -308,7 +307,7 @@ UINT WINAPI MsiSourceListEnumMediaDisksW(LPCWSTR szProductCodeOrPatchCode,
if (type == REG_DWORD) if (type == REG_DWORD)
{ {
sprintfW(convert, fmt, *ptr); swprintf(convert, ARRAY_SIZE(convert), fmt, *ptr);
size = lstrlenW(convert); size = lstrlenW(convert);
ptr = convert; ptr = convert;
} }
...@@ -459,7 +458,7 @@ UINT WINAPI MsiSourceListEnumSourcesW(LPCWSTR szProductCodeOrPatch, LPCWSTR szUs ...@@ -459,7 +458,7 @@ UINT WINAPI MsiSourceListEnumSourcesW(LPCWSTR szProductCodeOrPatch, LPCWSTR szUs
goto done; goto done;
} }
sprintfW(name, format, dwIndex + 1); swprintf(name, ARRAY_SIZE(name), format, dwIndex + 1);
res = RegQueryValueExW(subkey, name, 0, 0, (LPBYTE)szSource, pcchSource); res = RegQueryValueExW(subkey, name, 0, 0, (LPBYTE)szSource, pcchSource);
if (res != ERROR_SUCCESS && res != ERROR_MORE_DATA) if (res != ERROR_SUCCESS && res != ERROR_MORE_DATA)
...@@ -569,8 +568,8 @@ UINT WINAPI MsiSourceListGetInfoW( LPCWSTR szProduct, LPCWSTR szUserSid, ...@@ -569,8 +568,8 @@ UINT WINAPI MsiSourceListGetInfoW( LPCWSTR szProduct, LPCWSTR szUserSid,
if (rc != ERROR_SUCCESS) if (rc != ERROR_SUCCESS)
return rc; return rc;
if (!strcmpW( szProperty, INSTALLPROPERTY_MEDIAPACKAGEPATHW ) || if (!wcscmp( szProperty, INSTALLPROPERTY_MEDIAPACKAGEPATHW ) ||
!strcmpW( szProperty, INSTALLPROPERTY_DISKPROMPTW )) !wcscmp( szProperty, INSTALLPROPERTY_DISKPROMPTW ))
{ {
rc = OpenMediaSubkey(sourcekey, &media, FALSE); rc = OpenMediaSubkey(sourcekey, &media, FALSE);
if (rc != ERROR_SUCCESS) if (rc != ERROR_SUCCESS)
...@@ -579,14 +578,14 @@ UINT WINAPI MsiSourceListGetInfoW( LPCWSTR szProduct, LPCWSTR szUserSid, ...@@ -579,14 +578,14 @@ UINT WINAPI MsiSourceListGetInfoW( LPCWSTR szProduct, LPCWSTR szUserSid,
return ERROR_SUCCESS; return ERROR_SUCCESS;
} }
if (!strcmpW( szProperty, INSTALLPROPERTY_MEDIAPACKAGEPATHW )) if (!wcscmp( szProperty, INSTALLPROPERTY_MEDIAPACKAGEPATHW ))
szProperty = mediapack; szProperty = mediapack;
RegQueryValueExW(media, szProperty, 0, 0, (LPBYTE)szValue, pcchValue); RegQueryValueExW(media, szProperty, 0, 0, (LPBYTE)szValue, pcchValue);
RegCloseKey(media); RegCloseKey(media);
} }
else if (!strcmpW( szProperty, INSTALLPROPERTY_LASTUSEDSOURCEW ) || else if (!wcscmp( szProperty, INSTALLPROPERTY_LASTUSEDSOURCEW ) ||
!strcmpW( szProperty, INSTALLPROPERTY_LASTUSEDTYPEW )) !wcscmp( szProperty, INSTALLPROPERTY_LASTUSEDTYPEW ))
{ {
rc = RegQueryValueExW(sourcekey, INSTALLPROPERTY_LASTUSEDSOURCEW, rc = RegQueryValueExW(sourcekey, INSTALLPROPERTY_LASTUSEDSOURCEW,
0, 0, NULL, &size); 0, 0, NULL, &size);
...@@ -610,7 +609,7 @@ UINT WINAPI MsiSourceListGetInfoW( LPCWSTR szProduct, LPCWSTR szUserSid, ...@@ -610,7 +609,7 @@ UINT WINAPI MsiSourceListGetInfoW( LPCWSTR szProduct, LPCWSTR szUserSid,
return ERROR_SUCCESS; return ERROR_SUCCESS;
} }
if (!strcmpW( szProperty, INSTALLPROPERTY_LASTUSEDTYPEW )) if (!wcscmp( szProperty, INSTALLPROPERTY_LASTUSEDTYPEW ))
{ {
if (*source != 'n' && *source != 'u' && *source != 'm') if (*source != 'n' && *source != 'u' && *source != 'm')
{ {
...@@ -624,7 +623,7 @@ UINT WINAPI MsiSourceListGetInfoW( LPCWSTR szProduct, LPCWSTR szUserSid, ...@@ -624,7 +623,7 @@ UINT WINAPI MsiSourceListGetInfoW( LPCWSTR szProduct, LPCWSTR szUserSid,
} }
else else
{ {
ptr = strrchrW(source, ';'); ptr = wcsrchr(source, ';');
if (!ptr) if (!ptr)
ptr = source; ptr = source;
else else
...@@ -633,7 +632,7 @@ UINT WINAPI MsiSourceListGetInfoW( LPCWSTR szProduct, LPCWSTR szUserSid, ...@@ -633,7 +632,7 @@ UINT WINAPI MsiSourceListGetInfoW( LPCWSTR szProduct, LPCWSTR szUserSid,
output_out: output_out:
if (szValue) if (szValue)
{ {
if (strlenW(ptr) < *pcchValue) if (lstrlenW(ptr) < *pcchValue)
lstrcpyW(szValue, ptr); lstrcpyW(szValue, ptr);
else else
rc = ERROR_MORE_DATA; rc = ERROR_MORE_DATA;
...@@ -642,7 +641,7 @@ output_out: ...@@ -642,7 +641,7 @@ output_out:
*pcchValue = lstrlenW(ptr); *pcchValue = lstrlenW(ptr);
msi_free(source); msi_free(source);
} }
else if (!strcmpW( szProperty, INSTALLPROPERTY_PACKAGENAMEW )) else if (!wcscmp( szProperty, INSTALLPROPERTY_PACKAGENAMEW ))
{ {
*pcchValue = *pcchValue * sizeof(WCHAR); *pcchValue = *pcchValue * sizeof(WCHAR);
rc = RegQueryValueExW(sourcekey, INSTALLPROPERTY_PACKAGENAMEW, 0, 0, rc = RegQueryValueExW(sourcekey, INSTALLPROPERTY_PACKAGENAMEW, 0, 0,
...@@ -737,8 +736,8 @@ UINT msi_set_last_used_source(LPCWSTR product, LPCWSTR usersid, ...@@ -737,8 +736,8 @@ UINT msi_set_last_used_source(LPCWSTR product, LPCWSTR usersid,
return r; return r;
} }
size = (lstrlenW(format) + lstrlenW(value) + 7) * sizeof(WCHAR); size = lstrlenW(format) + lstrlenW(value) + 7;
buffer = msi_alloc(size); buffer = msi_alloc(size * sizeof(WCHAR));
if (!buffer) if (!buffer)
return ERROR_OUTOFMEMORY; return ERROR_OUTOFMEMORY;
...@@ -749,7 +748,7 @@ UINT msi_set_last_used_source(LPCWSTR product, LPCWSTR usersid, ...@@ -749,7 +748,7 @@ UINT msi_set_last_used_source(LPCWSTR product, LPCWSTR usersid,
return r; return r;
} }
sprintfW(buffer, format, typechar, index, value); swprintf(buffer, size, format, typechar, index, value);
size = (lstrlenW(buffer) + 1) * sizeof(WCHAR); size = (lstrlenW(buffer) + 1) * sizeof(WCHAR);
r = RegSetValueExW(source, INSTALLPROPERTY_LASTUSEDSOURCEW, 0, r = RegSetValueExW(source, INSTALLPROPERTY_LASTUSEDSOURCEW, 0,
...@@ -795,22 +794,22 @@ UINT WINAPI MsiSourceListSetInfoW( LPCWSTR szProduct, LPCWSTR szUserSid, ...@@ -795,22 +794,22 @@ UINT WINAPI MsiSourceListSetInfoW( LPCWSTR szProduct, LPCWSTR szUserSid,
} }
property = szProperty; property = szProperty;
if (!strcmpW( szProperty, INSTALLPROPERTY_MEDIAPACKAGEPATHW )) if (!wcscmp( szProperty, INSTALLPROPERTY_MEDIAPACKAGEPATHW ))
property = media_package; property = media_package;
rc = OpenSourceKey(szProduct, &sourcekey, MSICODE_PRODUCT, dwContext, FALSE); rc = OpenSourceKey(szProduct, &sourcekey, MSICODE_PRODUCT, dwContext, FALSE);
if (rc != ERROR_SUCCESS) if (rc != ERROR_SUCCESS)
return rc; return rc;
if (strcmpW( szProperty, INSTALLPROPERTY_LASTUSEDSOURCEW ) && if (wcscmp( szProperty, INSTALLPROPERTY_LASTUSEDSOURCEW ) &&
dwOptions & (MSISOURCETYPE_NETWORK | MSISOURCETYPE_URL)) dwOptions & (MSISOURCETYPE_NETWORK | MSISOURCETYPE_URL))
{ {
RegCloseKey(sourcekey); RegCloseKey(sourcekey);
return ERROR_INVALID_PARAMETER; return ERROR_INVALID_PARAMETER;
} }
if (!strcmpW( szProperty, INSTALLPROPERTY_MEDIAPACKAGEPATHW ) || if (!wcscmp( szProperty, INSTALLPROPERTY_MEDIAPACKAGEPATHW ) ||
!strcmpW( szProperty, INSTALLPROPERTY_DISKPROMPTW )) !wcscmp( szProperty, INSTALLPROPERTY_DISKPROMPTW ))
{ {
rc = OpenMediaSubkey(sourcekey, &media, TRUE); rc = OpenMediaSubkey(sourcekey, &media, TRUE);
if (rc == ERROR_SUCCESS) if (rc == ERROR_SUCCESS)
...@@ -819,7 +818,7 @@ UINT WINAPI MsiSourceListSetInfoW( LPCWSTR szProduct, LPCWSTR szUserSid, ...@@ -819,7 +818,7 @@ UINT WINAPI MsiSourceListSetInfoW( LPCWSTR szProduct, LPCWSTR szUserSid,
RegCloseKey(media); RegCloseKey(media);
} }
} }
else if (!strcmpW( szProperty, INSTALLPROPERTY_PACKAGENAMEW )) else if (!wcscmp( szProperty, INSTALLPROPERTY_PACKAGENAMEW ))
{ {
DWORD size = (lstrlenW(szValue) + 1) * sizeof(WCHAR); DWORD size = (lstrlenW(szValue) + 1) * sizeof(WCHAR);
rc = RegSetValueExW(sourcekey, INSTALLPROPERTY_PACKAGENAMEW, 0, rc = RegSetValueExW(sourcekey, INSTALLPROPERTY_PACKAGENAMEW, 0,
...@@ -827,7 +826,7 @@ UINT WINAPI MsiSourceListSetInfoW( LPCWSTR szProduct, LPCWSTR szUserSid, ...@@ -827,7 +826,7 @@ UINT WINAPI MsiSourceListSetInfoW( LPCWSTR szProduct, LPCWSTR szUserSid,
if (rc != ERROR_SUCCESS) if (rc != ERROR_SUCCESS)
rc = ERROR_UNKNOWN_PROPERTY; rc = ERROR_UNKNOWN_PROPERTY;
} }
else if (!strcmpW( szProperty, INSTALLPROPERTY_LASTUSEDSOURCEW )) else if (!wcscmp( szProperty, INSTALLPROPERTY_LASTUSEDSOURCEW ))
{ {
if (!(dwOptions & (MSISOURCETYPE_NETWORK | MSISOURCETYPE_URL))) if (!(dwOptions & (MSISOURCETYPE_NETWORK | MSISOURCETYPE_URL)))
rc = ERROR_INVALID_PARAMETER; rc = ERROR_INVALID_PARAMETER;
...@@ -989,7 +988,7 @@ static void add_source_to_list(struct list *sourcelist, media_info *info, ...@@ -989,7 +988,7 @@ static void add_source_to_list(struct list *sourcelist, media_info *info,
/* update the rest of the list */ /* update the rest of the list */
if (found) if (found)
sprintfW(iter->szIndex, fmt, ++iter->index); swprintf(iter->szIndex, ARRAY_SIZE(iter->szIndex), fmt, ++iter->index);
else if (index) else if (index)
(*index)++; (*index)++;
} }
...@@ -1027,7 +1026,7 @@ static UINT fill_source_list(struct list *sourcelist, HKEY sourcekey, DWORD *cou ...@@ -1027,7 +1026,7 @@ static UINT fill_source_list(struct list *sourcelist, HKEY sourcekey, DWORD *cou
} }
lstrcpyW(entry->szIndex, name); lstrcpyW(entry->szIndex, name);
entry->index = atoiW(name); entry->index = wcstol(name, NULL, 10);
size++; size++;
r = RegEnumValueW(sourcekey, index, name, &size, NULL, r = RegEnumValueW(sourcekey, index, name, &size, NULL,
...@@ -1134,13 +1133,13 @@ UINT WINAPI MsiSourceListAddSourceExW( LPCWSTR szProduct, LPCWSTR szUserSid, ...@@ -1134,13 +1133,13 @@ UINT WINAPI MsiSourceListAddSourceExW( LPCWSTR szProduct, LPCWSTR szUserSid,
} }
else if (dwIndex > count || dwIndex == 0) else if (dwIndex > count || dwIndex == 0)
{ {
sprintfW(name, fmt, count + 1); swprintf(name, ARRAY_SIZE(name), fmt, count + 1);
rc = RegSetValueExW(typekey, name, 0, REG_EXPAND_SZ, (LPBYTE)source, size); rc = RegSetValueExW(typekey, name, 0, REG_EXPAND_SZ, (LPBYTE)source, size);
goto done; goto done;
} }
else else
{ {
sprintfW(name, fmt, dwIndex); swprintf(name, ARRAY_SIZE(name), fmt, dwIndex);
info = msi_alloc(sizeof(media_info)); info = msi_alloc(sizeof(media_info));
if (!info) if (!info)
{ {
...@@ -1244,7 +1243,7 @@ UINT WINAPI MsiSourceListAddMediaDiskW(LPCWSTR szProduct, LPCWSTR szUserSid, ...@@ -1244,7 +1243,7 @@ UINT WINAPI MsiSourceListAddMediaDiskW(LPCWSTR szProduct, LPCWSTR szUserSid,
OpenMediaSubkey(sourcekey, &mediakey, TRUE); OpenMediaSubkey(sourcekey, &mediakey, TRUE);
sprintfW(szIndex, fmt, dwDiskId); swprintf(szIndex, ARRAY_SIZE(szIndex), fmt, dwDiskId);
size = 2; size = 2;
if (szVolumeLabel) size += lstrlenW(szVolumeLabel); if (szVolumeLabel) size += lstrlenW(szVolumeLabel);
......
...@@ -20,9 +20,6 @@ ...@@ -20,9 +20,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "config.h"
#include <stdarg.h> #include <stdarg.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
...@@ -32,7 +29,6 @@ ...@@ -32,7 +29,6 @@
#include "query.h" #include "query.h"
#include "wine/list.h" #include "wine/list.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "wine/unicode.h"
WINE_DEFAULT_DEBUG_CHANNEL(msi); WINE_DEFAULT_DEBUG_CHANNEL(msi);
...@@ -746,15 +742,15 @@ number: ...@@ -746,15 +742,15 @@ number:
static LPWSTR parser_add_table( void *info, LPCWSTR list, LPCWSTR table ) static LPWSTR parser_add_table( void *info, LPCWSTR list, LPCWSTR table )
{ {
static const WCHAR space[] = {' ',0}; static const WCHAR space[] = {' ',0};
DWORD len = strlenW( list ) + strlenW( table ) + 2; DWORD len = lstrlenW( list ) + lstrlenW( table ) + 2;
LPWSTR ret; LPWSTR ret;
ret = parser_alloc( info, len * sizeof(WCHAR) ); ret = parser_alloc( info, len * sizeof(WCHAR) );
if( ret ) if( ret )
{ {
strcpyW( ret, list ); lstrcpyW( ret, list );
strcatW( ret, space ); lstrcatW( ret, space );
strcatW( ret, table ); lstrcatW( ret, table );
} }
return ret; return ret;
} }
...@@ -978,7 +974,7 @@ static BOOL SQL_MarkPrimaryKeys( column_info **cols, ...@@ -978,7 +974,7 @@ static BOOL SQL_MarkPrimaryKeys( column_info **cols,
found = FALSE; found = FALSE;
for( c = *cols, idx = 0; c && !found; c = c->next, idx++ ) for( c = *cols, idx = 0; c && !found; c = c->next, idx++ )
{ {
if( strcmpW( k->column, c->column ) ) if( wcscmp( k->column, c->column ) )
continue; continue;
c->type |= MSITYPE_KEY; c->type |= MSITYPE_KEY;
found = TRUE; found = TRUE;
......
...@@ -33,7 +33,6 @@ ...@@ -33,7 +33,6 @@
#include "query.h" #include "query.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "wine/unicode.h"
WINE_DEFAULT_DEBUG_CHANNEL(msidb); WINE_DEFAULT_DEBUG_CHANNEL(msidb);
...@@ -615,7 +614,7 @@ UINT msi_commit_streams( MSIDATABASE *db ) ...@@ -615,7 +614,7 @@ UINT msi_commit_streams( MSIDATABASE *db )
for (i = 0; i < db->num_streams; i++) for (i = 0; i < db->num_streams; i++)
{ {
name = msi_string_lookup( db->strings, db->streams[i].str_index, NULL ); name = msi_string_lookup( db->strings, db->streams[i].str_index, NULL );
if (!strcmpW( name, szSumInfo )) continue; if (!wcscmp( name, szSumInfo )) continue;
if (!(encname = encode_streamname( FALSE, name ))) return ERROR_OUTOFMEMORY; if (!(encname = encode_streamname( FALSE, name ))) return ERROR_OUTOFMEMORY;
TRACE("saving stream %s as %s\n", debugstr_w(name), debugstr_w(encname)); TRACE("saving stream %s as %s\n", debugstr_w(name), debugstr_w(encname));
......
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
#include "winbase.h" #include "winbase.h"
#include "winerror.h" #include "winerror.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "wine/unicode.h"
#include "msi.h" #include "msi.h"
#include "msiquery.h" #include "msiquery.h"
#include "objbase.h" #include "objbase.h"
...@@ -311,7 +310,7 @@ int msi_add_string( string_table *st, const WCHAR *data, int len, BOOL persisten ...@@ -311,7 +310,7 @@ int msi_add_string( string_table *st, const WCHAR *data, int len, BOOL persisten
if( !data ) if( !data )
return 0; return 0;
if (len < 0) len = strlenW( data ); if (len < 0) len = lstrlenW( data );
if( !data[0] && !len ) if( !data[0] && !len )
return 0; return 0;
...@@ -404,7 +403,7 @@ UINT msi_string2id( const string_table *st, const WCHAR *str, int len, UINT *id ...@@ -404,7 +403,7 @@ UINT msi_string2id( const string_table *st, const WCHAR *str, int len, UINT *id
{ {
int i, c, low = 0, high = st->sortcount - 1; int i, c, low = 0, high = st->sortcount - 1;
if (len < 0) len = strlenW( str ); if (len < 0) len = lstrlenW( str );
while (low <= high) while (low <= high)
{ {
......
...@@ -31,7 +31,6 @@ ...@@ -31,7 +31,6 @@
#include "shlwapi.h" #include "shlwapi.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "wine/exception.h" #include "wine/exception.h"
#include "wine/unicode.h"
#include "msi.h" #include "msi.h"
#include "msiquery.h" #include "msiquery.h"
#include "msidefs.h" #include "msidefs.h"
...@@ -985,31 +984,31 @@ static void parse_filetime( LPCWSTR str, FILETIME *ft ) ...@@ -985,31 +984,31 @@ static void parse_filetime( LPCWSTR str, FILETIME *ft )
/* YYYY/MM/DD hh:mm:ss */ /* YYYY/MM/DD hh:mm:ss */
while (isspaceW( *p )) p++; while (iswspace( *p )) p++;
lt.wYear = strtolW( p, &end, 10 ); lt.wYear = wcstol( p, &end, 10 );
if (*end != '/') return; if (*end != '/') return;
p = end + 1; p = end + 1;
lt.wMonth = strtolW( p, &end, 10 ); lt.wMonth = wcstol( p, &end, 10 );
if (*end != '/') return; if (*end != '/') return;
p = end + 1; p = end + 1;
lt.wDay = strtolW( p, &end, 10 ); lt.wDay = wcstol( p, &end, 10 );
if (*end != ' ') return; if (*end != ' ') return;
p = end + 1; p = end + 1;
while (isspaceW( *p )) p++; while (iswspace( *p )) p++;
lt.wHour = strtolW( p, &end, 10 ); lt.wHour = wcstol( p, &end, 10 );
if (*end != ':') return; if (*end != ':') return;
p = end + 1; p = end + 1;
lt.wMinute = strtolW( p, &end, 10 ); lt.wMinute = wcstol( p, &end, 10 );
if (*end != ':') return; if (*end != ':') return;
p = end + 1; p = end + 1;
lt.wSecond = strtolW( p, &end, 10 ); lt.wSecond = wcstol( p, &end, 10 );
TzSpecificLocalTimeToSystemTime( NULL, &lt, &utc ); TzSpecificLocalTimeToSystemTime( NULL, &lt, &utc );
SystemTimeToFileTime( &utc, ft ); SystemTimeToFileTime( &utc, ft );
...@@ -1018,7 +1017,7 @@ static void parse_filetime( LPCWSTR str, FILETIME *ft ) ...@@ -1018,7 +1017,7 @@ static void parse_filetime( LPCWSTR str, FILETIME *ft )
static UINT parse_prop( LPCWSTR prop, LPCWSTR value, UINT *pid, INT *int_value, static UINT parse_prop( LPCWSTR prop, LPCWSTR value, UINT *pid, INT *int_value,
FILETIME *ft_value, awcstring *str_value ) FILETIME *ft_value, awcstring *str_value )
{ {
*pid = atoiW( prop ); *pid = wcstol( prop, NULL, 10 );
switch (*pid) switch (*pid)
{ {
case PID_CODEPAGE: case PID_CODEPAGE:
...@@ -1026,7 +1025,7 @@ static UINT parse_prop( LPCWSTR prop, LPCWSTR value, UINT *pid, INT *int_value, ...@@ -1026,7 +1025,7 @@ static UINT parse_prop( LPCWSTR prop, LPCWSTR value, UINT *pid, INT *int_value,
case PID_CHARCOUNT: case PID_CHARCOUNT:
case PID_SECURITY: case PID_SECURITY:
case PID_PAGECOUNT: case PID_PAGECOUNT:
*int_value = atoiW( value ); *int_value = wcstol( value, NULL, 10 );
break; break;
case PID_LASTPRINTED: case PID_LASTPRINTED:
......
...@@ -35,7 +35,6 @@ ...@@ -35,7 +35,6 @@
#include "query.h" #include "query.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "wine/unicode.h"
WINE_DEFAULT_DEBUG_CHANNEL(msidb); WINE_DEFAULT_DEBUG_CHANNEL(msidb);
...@@ -493,7 +492,7 @@ static MSITABLE *find_cached_table( MSIDATABASE *db, LPCWSTR name ) ...@@ -493,7 +492,7 @@ static MSITABLE *find_cached_table( MSIDATABASE *db, LPCWSTR name )
MSITABLE *t; MSITABLE *t;
LIST_FOR_EACH_ENTRY( t, &db->tables, MSITABLE, entry ) LIST_FOR_EACH_ENTRY( t, &db->tables, MSITABLE, entry )
if( !strcmpW( name, t->name ) ) if( !wcscmp( name, t->name ) )
return t; return t;
return NULL; return NULL;
...@@ -523,12 +522,12 @@ static UINT get_defaulttablecolumns( MSIDATABASE *db, LPCWSTR name, MSICOLUMNINF ...@@ -523,12 +522,12 @@ static UINT get_defaulttablecolumns( MSIDATABASE *db, LPCWSTR name, MSICOLUMNINF
TRACE("%s\n", debugstr_w(name)); TRACE("%s\n", debugstr_w(name));
if (!strcmpW( name, szTables )) if (!wcscmp( name, szTables ))
{ {
p = _Tables_cols; p = _Tables_cols;
n = 1; n = 1;
} }
else if (!strcmpW( name, szColumns )) else if (!wcscmp( name, szColumns ))
{ {
p = _Columns_cols; p = _Columns_cols;
n = 4; n = 4;
...@@ -606,7 +605,7 @@ static UINT get_table( MSIDATABASE *db, LPCWSTR name, MSITABLE **table_ret ) ...@@ -606,7 +605,7 @@ static UINT get_table( MSIDATABASE *db, LPCWSTR name, MSITABLE **table_ret )
table->persistent = MSICONDITION_TRUE; table->persistent = MSICONDITION_TRUE;
lstrcpyW( table->name, name ); lstrcpyW( table->name, name );
if (!strcmpW( name, szTables ) || !strcmpW( name, szColumns )) if (!wcscmp( name, szTables ) || !wcscmp( name, szColumns ))
table->persistent = MSICONDITION_NONE; table->persistent = MSICONDITION_NONE;
r = table_get_column_info( db, name, &table->colinfo, &table->col_count ); r = table_get_column_info( db, name, &table->colinfo, &table->col_count );
...@@ -972,8 +971,8 @@ BOOL TABLE_Exists( MSIDATABASE *db, LPCWSTR name ) ...@@ -972,8 +971,8 @@ BOOL TABLE_Exists( MSIDATABASE *db, LPCWSTR name )
UINT r, table_id, i; UINT r, table_id, i;
MSITABLE *table; MSITABLE *table;
if( !strcmpW( name, szTables ) || !strcmpW( name, szColumns ) || if( !wcscmp( name, szTables ) || !wcscmp( name, szColumns ) ||
!strcmpW( name, szStreams ) || !strcmpW( name, szStorages ) ) !wcscmp( name, szStreams ) || !wcscmp( name, szStorages ) )
return TRUE; return TRUE;
r = msi_string2id( db->strings, name, -1, &table_id ); r = msi_string2id( db->strings, name, -1, &table_id );
...@@ -1097,10 +1096,10 @@ static UINT get_stream_name( const MSITABLEVIEW *tv, UINT row, WCHAR **pstname ) ...@@ -1097,10 +1096,10 @@ static UINT get_stream_name( const MSITABLEVIEW *tv, UINT row, WCHAR **pstname )
switch( n ) switch( n )
{ {
case 2: case 2:
sprintfW( number, fmt, ival-0x8000 ); swprintf( number, ARRAY_SIZE(number), fmt, ival-0x8000 );
break; break;
case 4: case 4:
sprintfW( number, fmt, ival^0x80000000 ); swprintf( number, ARRAY_SIZE(number), fmt, ival^0x80000000 );
break; break;
default: default:
ERR( "oops - unknown column width %d\n", n ); ERR( "oops - unknown column width %d\n", n );
...@@ -2063,7 +2062,7 @@ static UINT TABLE_add_column(struct tagMSIVIEW *view, LPCWSTR table, UINT number ...@@ -2063,7 +2062,7 @@ static UINT TABLE_add_column(struct tagMSIVIEW *view, LPCWSTR table, UINT number
msitable = find_cached_table(tv->db, table); msitable = find_cached_table(tv->db, table);
for (i = 0; i < msitable->col_count; i++) for (i = 0; i < msitable->col_count; i++)
{ {
if (!strcmpW( msitable->colinfo[i].colname, column )) if (!wcscmp( msitable->colinfo[i].colname, column ))
{ {
InterlockedIncrement(&msitable->colinfo[i].ref_count); InterlockedIncrement(&msitable->colinfo[i].ref_count);
break; break;
...@@ -2154,9 +2153,9 @@ UINT TABLE_CreateView( MSIDATABASE *db, LPCWSTR name, MSIVIEW **view ) ...@@ -2154,9 +2153,9 @@ UINT TABLE_CreateView( MSIDATABASE *db, LPCWSTR name, MSIVIEW **view )
TRACE("%p %s %p\n", db, debugstr_w(name), view ); TRACE("%p %s %p\n", db, debugstr_w(name), view );
if ( !strcmpW( name, szStreams ) ) if ( !wcscmp( name, szStreams ) )
return STREAMS_CreateView( db, view ); return STREAMS_CreateView( db, view );
else if ( !strcmpW( name, szStorages ) ) else if ( !wcscmp( name, szStorages ) )
return STORAGES_CreateView( db, view ); return STORAGES_CreateView( db, view );
sz = FIELD_OFFSET( MSITABLEVIEW, name[lstrlenW( name ) + 1] ); sz = FIELD_OFFSET( MSITABLEVIEW, name[lstrlenW( name ) + 1] );
...@@ -2615,7 +2614,7 @@ static UINT msi_table_load_transform( MSIDATABASE *db, IStorage *stg, ...@@ -2615,7 +2614,7 @@ static UINT msi_table_load_transform( MSIDATABASE *db, IStorage *stg,
UINT number = MSI_NULL_INTEGER; UINT number = MSI_NULL_INTEGER;
UINT row = 0; UINT row = 0;
if (!strcmpW( name, szColumns )) if (!wcscmp( name, szColumns ))
{ {
MSI_RecordGetStringW( rec, 1, table, &sz ); MSI_RecordGetStringW( rec, 1, table, &sz );
number = MSI_RecordGetInteger( rec, 2 ); number = MSI_RecordGetInteger( rec, 2 );
...@@ -2627,7 +2626,7 @@ static UINT msi_table_load_transform( MSIDATABASE *db, IStorage *stg, ...@@ -2627,7 +2626,7 @@ static UINT msi_table_load_transform( MSIDATABASE *db, IStorage *stg,
if ( number == MSI_NULL_INTEGER ) if ( number == MSI_NULL_INTEGER )
{ {
/* reset the column number on a new table */ /* reset the column number on a new table */
if (strcmpW( coltable, table )) if (wcscmp( coltable, table ))
{ {
colcol = 0; colcol = 0;
lstrcpyW( coltable, table ); lstrcpyW( coltable, table );
...@@ -2673,7 +2672,7 @@ static UINT msi_table_load_transform( MSIDATABASE *db, IStorage *stg, ...@@ -2673,7 +2672,7 @@ static UINT msi_table_load_transform( MSIDATABASE *db, IStorage *stg,
WARN("failed to insert row %u\n", r); WARN("failed to insert row %u\n", r);
} }
if (!strcmpW( name, szColumns )) if (!wcscmp( name, szColumns ))
msi_update_table_columns( db, table ); msi_update_table_columns( db, table );
msiobj_release( &rec->hdr ); msiobj_release( &rec->hdr );
...@@ -2736,8 +2735,8 @@ UINT msi_table_apply_transform( MSIDATABASE *db, IStorage *stg ) ...@@ -2736,8 +2735,8 @@ UINT msi_table_apply_transform( MSIDATABASE *db, IStorage *stg )
if ( name[0] != 0x4840 ) if ( name[0] != 0x4840 )
continue; continue;
if ( !strcmpW( name+1, szStringPool ) || if ( !wcscmp( name+1, szStringPool ) ||
!strcmpW( name+1, szStringData ) ) !wcscmp( name+1, szStringData ) )
continue; continue;
transform = msi_alloc_zero( sizeof(TRANSFORMDATA) ); transform = msi_alloc_zero( sizeof(TRANSFORMDATA) );
...@@ -2748,11 +2747,11 @@ UINT msi_table_apply_transform( MSIDATABASE *db, IStorage *stg ) ...@@ -2748,11 +2747,11 @@ UINT msi_table_apply_transform( MSIDATABASE *db, IStorage *stg )
transform->name = strdupW( name + 1 ); transform->name = strdupW( name + 1 );
if ( !strcmpW( transform->name, szTables ) ) if ( !wcscmp( transform->name, szTables ) )
tables = transform; tables = transform;
else if (!strcmpW( transform->name, szColumns ) ) else if (!wcscmp( transform->name, szColumns ) )
columns = transform; columns = transform;
else if (!strcmpW( transform->name, szProperty )) else if (!wcscmp( transform->name, szProperty ))
property_update = TRUE; property_update = TRUE;
TRACE("transform contains stream %s\n", debugstr_w(name)); TRACE("transform contains stream %s\n", debugstr_w(name));
...@@ -2788,8 +2787,8 @@ UINT msi_table_apply_transform( MSIDATABASE *db, IStorage *stg ) ...@@ -2788,8 +2787,8 @@ UINT msi_table_apply_transform( MSIDATABASE *db, IStorage *stg )
{ {
transform = LIST_ENTRY( list_head( &transforms ), TRANSFORMDATA, entry ); transform = LIST_ENTRY( list_head( &transforms ), TRANSFORMDATA, entry );
if ( strcmpW( transform->name, szColumns ) && if ( wcscmp( transform->name, szColumns ) &&
strcmpW( transform->name, szTables ) && wcscmp( transform->name, szTables ) &&
ret == ERROR_SUCCESS ) ret == ERROR_SUCCESS )
{ {
ret = msi_table_load_transform( db, stg, strings, transform, bytes_per_strref ); ret = msi_table_load_transform( db, stg, strings, transform, bytes_per_strref );
......
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
#include "windef.h" #include "windef.h"
#include "winbase.h" #include "winbase.h"
#include "wine/unicode.h"
#include "query.h" #include "query.h"
#include "sql.tab.h" #include "sql.tab.h"
...@@ -124,11 +123,11 @@ static const Keyword aKeywordTable[] = { ...@@ -124,11 +123,11 @@ static const Keyword aKeywordTable[] = {
/* /*
** Comparison function for binary search. ** Comparison function for binary search.
*/ */
static int compKeyword(const void *m1, const void *m2){ static int __cdecl compKeyword(const void *m1, const void *m2){
const Keyword *k1 = m1, *k2 = m2; const Keyword *k1 = m1, *k2 = m2;
int ret, len = min( k1->len, k2->len ); int ret, len = min( k1->len, k2->len );
if ((ret = strncmpiW( k1->name, k2->name, len ))) return ret; if ((ret = wcsnicmp( k1->name, k2->name, len ))) return ret;
if (k1->len < k2->len) return -1; if (k1->len < k2->len) return -1;
else if (k1->len > k2->len) return 1; else if (k1->len > k2->len) return 1;
return 0; return 0;
......
...@@ -36,7 +36,6 @@ ...@@ -36,7 +36,6 @@
#include "msidefs.h" #include "msidefs.h"
#include "msipriv.h" #include "msipriv.h"
#include "winuser.h" #include "winuser.h"
#include "wine/unicode.h"
WINE_DEFAULT_DEBUG_CHANNEL(msi); WINE_DEFAULT_DEBUG_CHANNEL(msi);
...@@ -47,7 +46,7 @@ static BOOL check_language(DWORD lang1, LPCWSTR lang2, DWORD attributes) ...@@ -47,7 +46,7 @@ static BOOL check_language(DWORD lang1, LPCWSTR lang2, DWORD attributes)
if (!lang2 || lang2[0]==0) if (!lang2 || lang2[0]==0)
return TRUE; return TRUE;
langdword = atoiW(lang2); langdword = wcstol(lang2, NULL, 10);
if (attributes & msidbUpgradeAttributesLanguagesExclusive) if (attributes & msidbUpgradeAttributesLanguagesExclusive)
return (lang1 != langdword); return (lang1 != langdword);
...@@ -68,7 +67,7 @@ static BOOL find_product( const WCHAR *list, const WCHAR *product ) ...@@ -68,7 +67,7 @@ static BOOL find_product( const WCHAR *list, const WCHAR *product )
while (*q && *q != '}') q++; while (*q && *q != '}') q++;
if (*q != '}') return FALSE; if (*q != '}') return FALSE;
q++; q++;
if (q - p < strlenW( product )) return FALSE; if (q - p < lstrlenW( product )) return FALSE;
if (!memcmp( p, product, (q - p) * sizeof(WCHAR) )) return TRUE; if (!memcmp( p, product, (q - p) * sizeof(WCHAR) )) return TRUE;
p = q + 1; p = q + 1;
while (*p && *p != ';') p++; while (*p && *p != ';') p++;
...@@ -92,19 +91,19 @@ static void append_productcode( MSIPACKAGE *package, const WCHAR *action_prop, c ...@@ -92,19 +91,19 @@ static void append_productcode( MSIPACKAGE *package, const WCHAR *action_prop, c
return; return;
} }
if (prop) len += strlenW( prop ); if (prop) len += lstrlenW( prop );
len += strlenW( product ) + 2; len += lstrlenW( product ) + 2;
if (!(newprop = msi_alloc( len * sizeof(WCHAR) ))) return; if (!(newprop = msi_alloc( len * sizeof(WCHAR) ))) return;
if (prop) if (prop)
{ {
strcpyW( newprop, prop ); lstrcpyW( newprop, prop );
strcatW( newprop, szSemiColon ); lstrcatW( newprop, szSemiColon );
} }
else newprop[0] = 0; else newprop[0] = 0;
strcatW( newprop, product ); lstrcatW( newprop, product );
r = msi_set_property( package->db, action_prop, newprop, -1 ); r = msi_set_property( package->db, action_prop, newprop, -1 );
if (r == ERROR_SUCCESS && !strcmpW( action_prop, szSourceDir )) if (r == ERROR_SUCCESS && !wcscmp( action_prop, szSourceDir ))
msi_reset_source_folders( package ); msi_reset_source_folders( package );
TRACE( "related product property %s now %s\n", debugstr_w(action_prop), debugstr_w(newprop) ); TRACE( "related product property %s now %s\n", debugstr_w(action_prop), debugstr_w(newprop) );
......
...@@ -26,7 +26,6 @@ ...@@ -26,7 +26,6 @@
#include "winbase.h" #include "winbase.h"
#include "winerror.h" #include "winerror.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "wine/unicode.h"
#include "msi.h" #include "msi.h"
#include "msiquery.h" #include "msiquery.h"
#include "objbase.h" #include "objbase.h"
...@@ -187,7 +186,7 @@ static UINT parse_column(MSIWHEREVIEW *wv, union ext_column *column, ...@@ -187,7 +186,7 @@ static UINT parse_column(MSIWHEREVIEW *wv, union ext_column *column,
NULL, &table_name); NULL, &table_name);
if (r != ERROR_SUCCESS) if (r != ERROR_SUCCESS)
return r; return r;
if (strcmpW(table_name, column->unparsed.table) != 0) if (wcscmp(table_name, column->unparsed.table) != 0)
continue; continue;
} }
...@@ -200,7 +199,7 @@ static UINT parse_column(MSIWHEREVIEW *wv, union ext_column *column, ...@@ -200,7 +199,7 @@ static UINT parse_column(MSIWHEREVIEW *wv, union ext_column *column,
if(r != ERROR_SUCCESS ) if(r != ERROR_SUCCESS )
return r; return r;
if(strcmpW(col_name, column->unparsed.column)) if(wcscmp(col_name, column->unparsed.column))
continue; continue;
column->parsed.column = i; column->parsed.column = i;
column->parsed.table = table; column->parsed.table = table;
...@@ -587,7 +586,7 @@ static UINT STRCMP_Evaluate( MSIWHEREVIEW *wv, const UINT rows[], const struct c ...@@ -587,7 +586,7 @@ static UINT STRCMP_Evaluate( MSIWHEREVIEW *wv, const UINT rows[], const struct c
else if( r_str && ! l_str ) else if( r_str && ! l_str )
sr = -1; sr = -1;
else else
sr = strcmpW( l_str, r_str ); sr = wcscmp( l_str, r_str );
*val = ( expr->op == OP_EQ && ( sr == 0 ) ) || *val = ( expr->op == OP_EQ && ( sr == 0 ) ) ||
( expr->op == OP_NE && ( sr != 0 ) ); ( expr->op == OP_NE && ( sr != 0 ) );
...@@ -682,7 +681,7 @@ static UINT check_condition( MSIWHEREVIEW *wv, MSIRECORD *record, JOINTABLE **ta ...@@ -682,7 +681,7 @@ static UINT check_condition( MSIWHEREVIEW *wv, MSIRECORD *record, JOINTABLE **ta
return r; return r;
} }
static int compare_entry( const void *left, const void *right ) static int __cdecl compare_entry( const void *left, const void *right )
{ {
const MSIROWENTRY *le = *(const MSIROWENTRY**)left; const MSIROWENTRY *le = *(const MSIROWENTRY**)left;
const MSIROWENTRY *re = *(const MSIROWENTRY**)right; const MSIROWENTRY *re = *(const MSIROWENTRY**)right;
...@@ -1247,7 +1246,7 @@ UINT WHERE_CreateView( MSIDATABASE *db, MSIVIEW **view, LPWSTR tables, ...@@ -1247,7 +1246,7 @@ UINT WHERE_CreateView( MSIDATABASE *db, MSIVIEW **view, LPWSTR tables,
{ {
JOINTABLE *table; JOINTABLE *table;
if ((ptr = strchrW(tables, ' '))) if ((ptr = wcschr(tables, ' ')))
*ptr = '\0'; *ptr = '\0';
table = msi_alloc(sizeof(JOINTABLE)); table = msi_alloc(sizeof(JOINTABLE));
......
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