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