Commit 7cc7a6de authored by Alex Henrie's avatar Alex Henrie Committed by Alexandre Julliard

msi: Use the wcsdup function instead of reimplementing it.

parent ccfa33b0
...@@ -1051,7 +1051,7 @@ static UINT load_file(MSIRECORD *row, LPVOID param) ...@@ -1051,7 +1051,7 @@ static UINT load_file(MSIRECORD *row, LPVOID param)
msi_reduce_to_long_filename( file->FileName ); msi_reduce_to_long_filename( file->FileName );
file->ShortName = msi_dup_record_field( row, 3 ); file->ShortName = msi_dup_record_field( row, 3 );
file->LongName = strdupW( folder_split_path(file->ShortName, '|')); file->LongName = wcsdup( folder_split_path(file->ShortName, '|') );
file->FileSize = MSI_RecordGetInteger( row, 4 ); file->FileSize = MSI_RecordGetInteger( row, 4 );
file->Version = msi_dup_record_field( row, 5 ); file->Version = msi_dup_record_field( row, 5 );
...@@ -1307,9 +1307,9 @@ static UINT load_folder( MSIRECORD *row, LPVOID param ) ...@@ -1307,9 +1307,9 @@ static UINT load_folder( MSIRECORD *row, LPVOID param )
src_long = src_short; src_long = src_short;
/* FIXME: use the target short path too */ /* FIXME: use the target short path too */
folder->TargetDefault = strdupW(tgt_long); folder->TargetDefault = wcsdup(tgt_long);
folder->SourceShortPath = strdupW(src_short); folder->SourceShortPath = wcsdup(src_short);
folder->SourceLongPath = strdupW(src_long); folder->SourceLongPath = wcsdup(src_long);
msi_free(p); msi_free(p);
TRACE("TargetDefault = %s\n",debugstr_w( folder->TargetDefault )); TRACE("TargetDefault = %s\n",debugstr_w( folder->TargetDefault ));
...@@ -1960,7 +1960,7 @@ static WCHAR *create_temp_dir( MSIDATABASE *db ) ...@@ -1960,7 +1960,7 @@ static WCHAR *create_temp_dir( MSIDATABASE *db )
{ {
GetTempPathW( MAX_PATH, tmp ); GetTempPathW( MAX_PATH, tmp );
} }
if (!(db->tempfolder = strdupW( tmp ))) return NULL; if (!(db->tempfolder = wcsdup( tmp ))) return NULL;
} }
if ((ret = msi_alloc( (lstrlenW( db->tempfolder ) + 20) * sizeof(WCHAR) ))) if ((ret = msi_alloc( (lstrlenW( db->tempfolder ) + 20) * sizeof(WCHAR) )))
...@@ -2480,7 +2480,7 @@ static HKEY open_key( const MSICOMPONENT *comp, HKEY root, const WCHAR *path, BO ...@@ -2480,7 +2480,7 @@ static HKEY open_key( const MSICOMPONENT *comp, HKEY root, const WCHAR *path, BO
access |= get_registry_view( comp ); access |= get_registry_view( comp );
if (!(subkey = strdupW( path ))) return NULL; if (!(subkey = wcsdup( path ))) return NULL;
p = subkey; p = subkey;
if ((q = wcschr( p, '\\' ))) *q = 0; if ((q = wcschr( p, '\\' ))) *q = 0;
if (create) if (create)
...@@ -2525,7 +2525,7 @@ static WCHAR **split_multi_string_values( const WCHAR *str, DWORD len, DWORD *co ...@@ -2525,7 +2525,7 @@ static WCHAR **split_multi_string_values( const WCHAR *str, DWORD len, DWORD *co
p = str; p = str;
while ((p - str) < len) while ((p - str) < len)
{ {
if (!(ret[i] = strdupW( p ))) if (!(ret[i] = wcsdup( p )))
{ {
for (; i >= 0; i--) msi_free( ret[i] ); for (; i >= 0; i--) msi_free( ret[i] );
msi_free( ret ); msi_free( ret );
...@@ -2823,7 +2823,7 @@ static void delete_key( const MSICOMPONENT *comp, HKEY root, const WCHAR *path ) ...@@ -2823,7 +2823,7 @@ static void delete_key( const MSICOMPONENT *comp, HKEY root, const WCHAR *path )
WCHAR *subkey, *p; WCHAR *subkey, *p;
HKEY hkey; HKEY hkey;
if (!(subkey = strdupW( path ))) return; if (!(subkey = wcsdup( path ))) return;
do do
{ {
if ((p = wcsrchr( subkey, '\\' ))) if ((p = wcsrchr( subkey, '\\' )))
...@@ -3128,7 +3128,7 @@ static LPWSTR resolve_keypath( MSIPACKAGE* package, MSICOMPONENT *cmp ) ...@@ -3128,7 +3128,7 @@ static LPWSTR resolve_keypath( MSIPACKAGE* package, MSICOMPONENT *cmp )
{ {
if (!cmp->KeyPath) if (!cmp->KeyPath)
return strdupW( msi_get_target_folder( package, cmp->Directory ) ); return wcsdup( msi_get_target_folder( package, cmp->Directory ) );
if (cmp->Attributes & msidbComponentAttributesRegistryKeyPath) if (cmp->Attributes & msidbComponentAttributesRegistryKeyPath)
{ {
...@@ -3174,7 +3174,7 @@ static LPWSTR resolve_keypath( MSIPACKAGE* package, MSICOMPONENT *cmp ) ...@@ -3174,7 +3174,7 @@ static LPWSTR resolve_keypath( MSIPACKAGE* package, MSICOMPONENT *cmp )
MSIFILE *file = msi_get_loaded_file( package, cmp->KeyPath ); MSIFILE *file = msi_get_loaded_file( package, cmp->KeyPath );
if (file) if (file)
return strdupW( file->TargetPath ); return wcsdup( file->TargetPath );
} }
return NULL; return NULL;
} }
...@@ -3445,7 +3445,7 @@ static BOOL CALLBACK Typelib_EnumResNameProc( HMODULE hModule, LPCWSTR lpszType, ...@@ -3445,7 +3445,7 @@ static BOOL CALLBACK Typelib_EnumResNameProc( HMODULE hModule, LPCWSTR lpszType,
sz = lstrlenW(tl_struct->source)+4; sz = lstrlenW(tl_struct->source)+4;
if ((INT_PTR)lpszName == 1) if ((INT_PTR)lpszName == 1)
tl_struct->path = strdupW(tl_struct->source); tl_struct->path = wcsdup(tl_struct->source);
else else
{ {
tl_struct->path = msi_alloc(sz * sizeof(WCHAR)); tl_struct->path = msi_alloc(sz * sizeof(WCHAR));
...@@ -3532,7 +3532,7 @@ static UINT ITERATE_RegisterTypeLibraries(MSIRECORD *row, LPVOID param) ...@@ -3532,7 +3532,7 @@ static UINT ITERATE_RegisterTypeLibraries(MSIRECORD *row, LPVOID param)
LPCWSTR guid; LPCWSTR guid;
guid = MSI_RecordGetString(row,1); guid = MSI_RecordGetString(row,1);
CLSIDFromString( guid, &tl_struct.clsid); CLSIDFromString( guid, &tl_struct.clsid);
tl_struct.source = strdupW( file->TargetPath ); tl_struct.source = wcsdup( file->TargetPath );
tl_struct.path = NULL; tl_struct.path = NULL;
EnumResourceNamesW(module, L"TYPELIB", Typelib_EnumResNameProc, EnumResourceNamesW(module, L"TYPELIB", Typelib_EnumResNameProc,
...@@ -4316,7 +4316,7 @@ static WCHAR *get_ini_file_name( MSIPACKAGE *package, MSIRECORD *row ) ...@@ -4316,7 +4316,7 @@ static WCHAR *get_ini_file_name( MSIPACKAGE *package, MSIRECORD *row )
dirprop = MSI_RecordGetString( row, 3 ); dirprop = MSI_RecordGetString( row, 3 );
if (dirprop) if (dirprop)
{ {
folder = strdupW( msi_get_target_folder( package, dirprop ) ); folder = wcsdup( msi_get_target_folder( package, dirprop ) );
if (!folder) folder = msi_dup_property( package->db, dirprop ); if (!folder) folder = msi_dup_property( package->db, dirprop );
} }
else else
...@@ -5211,7 +5211,7 @@ static UINT ACTION_ResolveSource(MSIPACKAGE* package) ...@@ -5211,7 +5211,7 @@ static UINT ACTION_ResolveSource(MSIPACKAGE* package)
INSTALLPROPERTY_DISKPROMPTW,prompt,&size); INSTALLPROPERTY_DISKPROMPTW,prompt,&size);
} }
else else
prompt = strdupW(package->db->path); prompt = wcsdup(package->db->path);
record = MSI_CreateRecord(2); record = MSI_CreateRecord(2);
MSI_RecordSetInteger(record, 1, MSIERR_INSERTDISK); MSI_RecordSetInteger(record, 1, MSIERR_INSERTDISK);
...@@ -6272,7 +6272,7 @@ static UINT ITERATE_InstallODBCDriver( MSIRECORD *rec, LPVOID param ) ...@@ -6272,7 +6272,7 @@ static UINT ITERATE_InstallODBCDriver( MSIRECORD *rec, LPVOID param )
const WCHAR *dir = msi_get_target_folder( package, driver_file->Component->Directory ); const WCHAR *dir = msi_get_target_folder( package, driver_file->Component->Directory );
driver_file->TargetPath = msi_build_directory_name( 2, dir, driver_file->FileName ); driver_file->TargetPath = msi_build_directory_name( 2, dir, driver_file->FileName );
} }
driver_path = strdupW(driver_file->TargetPath); driver_path = wcsdup(driver_file->TargetPath);
ptr = wcsrchr(driver_path, '\\'); ptr = wcsrchr(driver_path, '\\');
if (ptr) *ptr = '\0'; if (ptr) *ptr = '\0';
...@@ -6355,7 +6355,7 @@ static UINT ITERATE_InstallODBCTranslator( MSIRECORD *rec, LPVOID param ) ...@@ -6355,7 +6355,7 @@ static UINT ITERATE_InstallODBCTranslator( MSIRECORD *rec, LPVOID param )
} }
*ptr = '\0'; *ptr = '\0';
translator_path = strdupW(translator_file->TargetPath); translator_path = wcsdup(translator_file->TargetPath);
ptr = wcsrchr(translator_path, '\\'); ptr = wcsrchr(translator_path, '\\');
if (ptr) *ptr = '\0'; if (ptr) *ptr = '\0';
...@@ -6841,7 +6841,7 @@ static UINT ITERATE_WriteEnvironmentString( MSIRECORD *rec, LPVOID param ) ...@@ -6841,7 +6841,7 @@ static UINT ITERATE_WriteEnvironmentString( MSIRECORD *rec, LPVOID param )
goto done; goto done;
} }
size = (lstrlenW(value) + 1) * sizeof(WCHAR); size = (lstrlenW(value) + 1) * sizeof(WCHAR);
newval = strdupW(value); newval = wcsdup(value);
if (!newval) if (!newval)
{ {
res = ERROR_OUTOFMEMORY; res = ERROR_OUTOFMEMORY;
...@@ -7651,7 +7651,7 @@ UINT MSI_InstallPackage( MSIPACKAGE *package, LPCWSTR szPackagePath, ...@@ -7651,7 +7651,7 @@ UINT MSI_InstallPackage( MSIPACKAGE *package, LPCWSTR szPackagePath,
LPWSTR p, dir; LPWSTR p, dir;
LPCWSTR file; LPCWSTR file;
dir = strdupW(szPackagePath); dir = wcsdup(szPackagePath);
p = wcsrchr(dir, '\\'); p = wcsrchr(dir, '\\');
if (p) if (p)
{ {
......
...@@ -169,7 +169,7 @@ static WCHAR *search_file( MSIPACKAGE *package, WCHAR *path, MSISIGNATURE *sig ) ...@@ -169,7 +169,7 @@ static WCHAR *search_file( MSIPACKAGE *package, WCHAR *path, MSISIGNATURE *sig )
attr = msi_get_file_attributes( package, path ); attr = msi_get_file_attributes( package, path );
if (attr != INVALID_FILE_ATTRIBUTES && (attr & FILE_ATTRIBUTE_DIRECTORY)) if (attr != INVALID_FILE_ATTRIBUTES && (attr & FILE_ATTRIBUTE_DIRECTORY))
return strdupW(path); return wcsdup(path);
return NULL; return NULL;
} }
...@@ -180,7 +180,7 @@ static WCHAR *search_file( MSIPACKAGE *package, WCHAR *path, MSISIGNATURE *sig ) ...@@ -180,7 +180,7 @@ static WCHAR *search_file( MSIPACKAGE *package, WCHAR *path, MSISIGNATURE *sig )
size = msi_get_file_version_info( package, path, 0, NULL ); size = msi_get_file_version_info( package, path, 0, NULL );
if (!size) if (!size)
return strdupW(path); return wcsdup(path);
buffer = msi_alloc(size); buffer = msi_alloc(size);
if (!buffer) if (!buffer)
...@@ -213,7 +213,7 @@ static WCHAR *search_file( MSIPACKAGE *package, WCHAR *path, MSISIGNATURE *sig ) ...@@ -213,7 +213,7 @@ static WCHAR *search_file( MSIPACKAGE *package, WCHAR *path, MSISIGNATURE *sig )
goto done; goto done;
} }
val = strdupW(path); val = wcsdup(path);
done: done:
msi_free(buffer); msi_free(buffer);
...@@ -276,7 +276,7 @@ static UINT search_components( MSIPACKAGE *package, WCHAR **appValue, MSISIGNATU ...@@ -276,7 +276,7 @@ static UINT search_components( MSIPACKAGE *package, WCHAR **appValue, MSISIGNATU
else else
PathAddBackslashW(path); PathAddBackslashW(path);
*appValue = strdupW(path); *appValue = wcsdup(path);
} }
else if (sigpresent) else if (sigpresent)
{ {
...@@ -285,7 +285,7 @@ static UINT search_components( MSIPACKAGE *package, WCHAR **appValue, MSISIGNATU ...@@ -285,7 +285,7 @@ static UINT search_components( MSIPACKAGE *package, WCHAR **appValue, MSISIGNATU
attr = msi_get_file_attributes( package, path ); attr = msi_get_file_attributes( package, path );
if (attr != INVALID_FILE_ATTRIBUTES && !(attr & FILE_ATTRIBUTE_DIRECTORY)) if (attr != INVALID_FILE_ATTRIBUTES && !(attr & FILE_ATTRIBUTE_DIRECTORY))
*appValue = strdupW(path); *appValue = wcsdup(path);
} }
done: done:
...@@ -474,7 +474,7 @@ static LPWSTR get_ini_field(LPWSTR buf, int field) ...@@ -474,7 +474,7 @@ static LPWSTR get_ini_field(LPWSTR buf, int field)
int i = 1; int i = 1;
if (field == 0) if (field == 0)
return strdupW(buf); return wcsdup(buf);
beg = buf; beg = buf;
while ((end = wcschr(beg, ',')) && i < field) while ((end = wcschr(beg, ',')) && i < field)
...@@ -491,7 +491,7 @@ static LPWSTR get_ini_field(LPWSTR buf, int field) ...@@ -491,7 +491,7 @@ static LPWSTR get_ini_field(LPWSTR buf, int field)
end = beg + lstrlenW(beg); end = beg + lstrlenW(beg);
*end = '\0'; *end = '\0';
return strdupW(beg); return wcsdup(beg);
} }
static UINT search_ini( MSIPACKAGE *package, WCHAR **appValue, MSISIGNATURE *sig ) static UINT search_ini( MSIPACKAGE *package, WCHAR **appValue, MSISIGNATURE *sig )
...@@ -590,7 +590,7 @@ static void expand_any_path( MSIPACKAGE *package, WCHAR *src, WCHAR *dst, size_t ...@@ -590,7 +590,7 @@ static void expand_any_path( MSIPACKAGE *package, WCHAR *src, WCHAR *dst, size_t
static LANGID *parse_languages( const WCHAR *languages, DWORD *num_ids ) static LANGID *parse_languages( const WCHAR *languages, DWORD *num_ids )
{ {
UINT i, count = 1; UINT i, count = 1;
WCHAR *str = strdupW( languages ), *p, *q; WCHAR *str = wcsdup( languages ), *p, *q;
LANGID *ret; LANGID *ret;
if (!str) return NULL; if (!str) return NULL;
...@@ -851,7 +851,7 @@ static UINT check_directory( MSIPACKAGE *package, const WCHAR *dir, WCHAR **appV ...@@ -851,7 +851,7 @@ static UINT check_directory( MSIPACKAGE *package, const WCHAR *dir, WCHAR **appV
if (attr != INVALID_FILE_ATTRIBUTES && (attr & FILE_ATTRIBUTE_DIRECTORY)) if (attr != INVALID_FILE_ATTRIBUTES && (attr & FILE_ATTRIBUTE_DIRECTORY))
{ {
TRACE("directory exists, returning %s\n", debugstr_w(dir)); TRACE("directory exists, returning %s\n", debugstr_w(dir));
*appValue = strdupW(dir); *appValue = wcsdup(dir);
} }
return ERROR_SUCCESS; return ERROR_SUCCESS;
......
...@@ -327,13 +327,13 @@ MSIASSEMBLY *msi_load_assembly( MSIPACKAGE *package, MSICOMPONENT *comp ) ...@@ -327,13 +327,13 @@ MSIASSEMBLY *msi_load_assembly( MSIPACKAGE *package, MSICOMPONENT *comp )
msiobj_release( &rec->hdr ); msiobj_release( &rec->hdr );
return NULL; return NULL;
} }
a->feature = strdupW( MSI_RecordGetString( rec, 2 ) ); a->feature = wcsdup( MSI_RecordGetString( rec, 2 ) );
TRACE("feature %s\n", debugstr_w(a->feature)); TRACE("feature %s\n", debugstr_w(a->feature));
a->manifest = strdupW( MSI_RecordGetString( rec, 3 ) ); a->manifest = wcsdup( MSI_RecordGetString( rec, 3 ) );
TRACE("manifest %s\n", debugstr_w(a->manifest)); TRACE("manifest %s\n", debugstr_w(a->manifest));
a->application = strdupW( MSI_RecordGetString( rec, 4 ) ); a->application = wcsdup( MSI_RecordGetString( rec, 4 ) );
TRACE("application %s\n", debugstr_w(a->application)); TRACE("application %s\n", debugstr_w(a->application));
a->attributes = MSI_RecordGetInteger( rec, 5 ); a->attributes = MSI_RecordGetInteger( rec, 5 );
......
...@@ -254,14 +254,14 @@ static MSICLASS *load_class( MSIPACKAGE* package, MSIRECORD *row ) ...@@ -254,14 +254,14 @@ static MSICLASS *load_class( MSIPACKAGE* package, MSIRECORD *row )
switch(i) switch(i)
{ {
case 1: case 1:
cls->DefInprocHandler = strdupW(L"ole2.dll"); cls->DefInprocHandler = wcsdup(L"ole2.dll");
break; break;
case 2: case 2:
cls->DefInprocHandler32 = strdupW(L"ole32.dll"); cls->DefInprocHandler32 = wcsdup(L"ole32.dll");
break; break;
case 3: case 3:
cls->DefInprocHandler = strdupW(L"ole2.dll"); cls->DefInprocHandler = wcsdup(L"ole2.dll");
cls->DefInprocHandler32 = strdupW(L"ole32.dll"); cls->DefInprocHandler32 = wcsdup(L"ole32.dll");
break; break;
} }
} }
...@@ -333,7 +333,7 @@ static MSIMIME *load_mime( MSIPACKAGE* package, MSIRECORD *row ) ...@@ -333,7 +333,7 @@ static MSIMIME *load_mime( MSIPACKAGE* package, MSIRECORD *row )
extension = MSI_RecordGetString( row, 2 ); extension = MSI_RecordGetString( row, 2 );
mt->Extension = load_given_extension( package, extension ); mt->Extension = load_given_extension( package, extension );
mt->suffix = strdupW( extension ); mt->suffix = wcsdup( extension );
mt->clsid = msi_dup_record_field( row, 3 ); mt->clsid = msi_dup_record_field( row, 3 );
mt->Class = load_given_class( package, mt->clsid ); mt->Class = load_given_class( package, mt->clsid );
......
...@@ -413,8 +413,8 @@ static int COND_IsNumber( WCHAR x ) ...@@ -413,8 +413,8 @@ static int COND_IsNumber( WCHAR x )
static WCHAR *strstriW( const WCHAR *str, const WCHAR *sub ) static WCHAR *strstriW( const WCHAR *str, const WCHAR *sub )
{ {
LPWSTR strlower, sublower, r; LPWSTR strlower, sublower, r;
strlower = CharLowerW( strdupW( str ) ); strlower = CharLowerW( wcsdup( str ) );
sublower = CharLowerW( strdupW( sub ) ); sublower = CharLowerW( wcsdup( sub ) );
r = wcsstr( strlower, sublower ); r = wcsstr( strlower, sublower );
if (r) if (r)
r = (LPWSTR)str + (r - strlower); r = (LPWSTR)str + (r - strlower);
......
...@@ -98,7 +98,7 @@ UINT msi_schedule_action( MSIPACKAGE *package, UINT script, const WCHAR *action ...@@ -98,7 +98,7 @@ UINT msi_schedule_action( MSIPACKAGE *package, UINT script, const WCHAR *action
package->script_actions_count[script] * sizeof(WCHAR *) ); package->script_actions_count[script] * sizeof(WCHAR *) );
else newbuf = msi_alloc( sizeof(WCHAR *) ); else newbuf = msi_alloc( sizeof(WCHAR *) );
newbuf[count] = strdupW( action ); newbuf[count] = wcsdup( action );
package->script_actions[script] = newbuf; package->script_actions[script] = newbuf;
return ERROR_SUCCESS; return ERROR_SUCCESS;
} }
...@@ -116,7 +116,7 @@ UINT msi_register_unique_action( MSIPACKAGE *package, const WCHAR *action ) ...@@ -116,7 +116,7 @@ UINT msi_register_unique_action( MSIPACKAGE *package, const WCHAR *action )
package->unique_actions_count * sizeof(WCHAR *) ); package->unique_actions_count * sizeof(WCHAR *) );
else newbuf = msi_alloc( sizeof(WCHAR *) ); else newbuf = msi_alloc( sizeof(WCHAR *) );
newbuf[count] = strdupW( action ); newbuf[count] = wcsdup( action );
package->unique_actions = newbuf; package->unique_actions = newbuf;
return ERROR_SUCCESS; return ERROR_SUCCESS;
} }
...@@ -178,7 +178,7 @@ static LPWSTR msi_get_deferred_action(LPCWSTR action, LPCWSTR actiondata, ...@@ -178,7 +178,7 @@ static LPWSTR msi_get_deferred_action(LPCWSTR action, LPCWSTR actiondata,
DWORD len; DWORD len;
if (!actiondata) if (!actiondata)
return strdupW(action); return wcsdup(action);
len = lstrlenW(action) + lstrlenW(actiondata) + len = lstrlenW(action) + lstrlenW(actiondata) +
lstrlenW(usersid) + lstrlenW(prodcode) + lstrlenW(usersid) + lstrlenW(prodcode) +
...@@ -219,7 +219,7 @@ WCHAR *msi_create_temp_file( MSIDATABASE *db ) ...@@ -219,7 +219,7 @@ WCHAR *msi_create_temp_file( MSIDATABASE *db )
{ {
GetTempPathW( MAX_PATH, tmp ); GetTempPathW( MAX_PATH, tmp );
} }
if (!(db->tempfolder = strdupW( tmp ))) return NULL; if (!(db->tempfolder = wcsdup( tmp ))) return NULL;
} }
if ((ret = msi_alloc( (lstrlenW( db->tempfolder ) + 20) * sizeof(WCHAR) ))) if ((ret = msi_alloc( (lstrlenW( db->tempfolder ) + 20) * sizeof(WCHAR) )))
...@@ -267,7 +267,7 @@ static MSIBINARY *create_temp_binary(MSIPACKAGE *package, LPCWSTR source) ...@@ -267,7 +267,7 @@ static MSIBINARY *create_temp_binary(MSIPACKAGE *package, LPCWSTR source)
CloseHandle( file ); CloseHandle( file );
if (r != ERROR_SUCCESS) goto error; if (r != ERROR_SUCCESS) goto error;
binary->source = strdupW( source ); binary->source = wcsdup( source );
binary->tmpfile = tmpfile; binary->tmpfile = tmpfile;
list_add_tail( &package->binaries, &binary->entry ); list_add_tail( &package->binaries, &binary->entry );
...@@ -304,7 +304,7 @@ static void file_running_action(MSIPACKAGE* package, HANDLE Handle, ...@@ -304,7 +304,7 @@ static void file_running_action(MSIPACKAGE* package, HANDLE Handle,
action->handle = Handle; action->handle = Handle;
action->process = process; action->process = process;
action->name = strdupW(name); action->name = wcsdup(name);
list_add_tail( &package->RunningActions, &action->entry ); list_add_tail( &package->RunningActions, &action->entry );
} }
...@@ -754,9 +754,9 @@ static msi_custom_action_info *do_msidbCustomActionTypeDll( ...@@ -754,9 +754,9 @@ static msi_custom_action_info *do_msidbCustomActionTypeDll(
msiobj_addref( &package->hdr ); msiobj_addref( &package->hdr );
info->package = package; info->package = package;
info->type = type; info->type = type;
info->target = strdupW( target ); info->target = wcsdup( target );
info->source = strdupW( source ); info->source = wcsdup( source );
info->action = strdupW( action ); info->action = wcsdup( action );
CoCreateGuid( &info->guid ); CoCreateGuid( &info->guid );
EnterCriticalSection( &msi_custom_action_cs ); EnterCriticalSection( &msi_custom_action_cs );
...@@ -1201,9 +1201,9 @@ static msi_custom_action_info *do_msidbCustomActionTypeScript( ...@@ -1201,9 +1201,9 @@ static msi_custom_action_info *do_msidbCustomActionTypeScript(
msiobj_addref( &package->hdr ); msiobj_addref( &package->hdr );
info->package = package; info->package = package;
info->type = type; info->type = type;
info->target = strdupW( function ); info->target = wcsdup( function );
info->source = strdupW( script ); info->source = wcsdup( script );
info->action = strdupW( action ); info->action = wcsdup( action );
CoCreateGuid( &info->guid ); CoCreateGuid( &info->guid );
EnterCriticalSection( &msi_custom_action_cs ); EnterCriticalSection( &msi_custom_action_cs );
...@@ -1615,10 +1615,10 @@ UINT __cdecl s_remote_GetActionInfo(const GUID *guid, WCHAR **name, int *type, W ...@@ -1615,10 +1615,10 @@ UINT __cdecl s_remote_GetActionInfo(const GUID *guid, WCHAR **name, int *type, W
if (!info) if (!info)
return ERROR_INVALID_DATA; return ERROR_INVALID_DATA;
*name = strdupW(info->action); *name = wcsdup(info->action);
*type = info->type; *type = info->type;
*hinst = alloc_msihandle(&info->package->hdr); *hinst = alloc_msihandle(&info->package->hdr);
*dll = strdupW(info->source); *dll = wcsdup(info->source);
*func = strdupWtoA(info->target); *func = strdupWtoA(info->target);
return ERROR_SUCCESS; return ERROR_SUCCESS;
......
...@@ -262,7 +262,7 @@ UINT MSI_OpenDatabaseW(LPCWSTR szDBPath, LPCWSTR szPersist, MSIDATABASE **pdb) ...@@ -262,7 +262,7 @@ UINT MSI_OpenDatabaseW(LPCWSTR szDBPath, LPCWSTR szPersist, MSIDATABASE **pdb)
else else
lstrcpyW( path, save_path ); lstrcpyW( path, save_path );
db->path = strdupW( path ); db->path = wcsdup( path );
db->media_transform_offset = MSI_INITIAL_MEDIA_TRANSFORM_OFFSET; db->media_transform_offset = MSI_INITIAL_MEDIA_TRANSFORM_OFFSET;
db->media_transform_disk_id = MSI_INITIAL_MEDIA_TRANSFORM_DISKID; db->media_transform_disk_id = MSI_INITIAL_MEDIA_TRANSFORM_DISKID;
...@@ -272,7 +272,7 @@ UINT MSI_OpenDatabaseW(LPCWSTR szDBPath, LPCWSTR szPersist, MSIDATABASE **pdb) ...@@ -272,7 +272,7 @@ UINT MSI_OpenDatabaseW(LPCWSTR szDBPath, LPCWSTR szPersist, MSIDATABASE **pdb)
db->storage = stg; db->storage = stg;
db->mode = mode; db->mode = mode;
if (created) if (created)
db->deletefile = strdupW( szDBPath ); db->deletefile = wcsdup( szDBPath );
list_init( &db->tables ); list_init( &db->tables );
list_init( &db->transforms ); list_init( &db->transforms );
...@@ -1542,10 +1542,10 @@ static UINT msi_get_table_labels(MSIDATABASE *db, LPCWSTR table, LPWSTR **labels ...@@ -1542,10 +1542,10 @@ static UINT msi_get_table_labels(MSIDATABASE *db, LPCWSTR table, LPWSTR **labels
goto end; goto end;
} }
(*labels)[0] = strdupW(table); (*labels)[0] = wcsdup(table);
for (i=1; i<=count; i++ ) for (i=1; i<=count; i++ )
{ {
(*labels)[i] = strdupW(MSI_RecordGetString(prec, i)); (*labels)[i] = wcsdup(MSI_RecordGetString(prec, i));
} }
end: end:
...@@ -1572,7 +1572,7 @@ static UINT msi_get_query_columns(MSIQUERY *query, LPWSTR **columns, DWORD *numc ...@@ -1572,7 +1572,7 @@ static UINT msi_get_query_columns(MSIQUERY *query, LPWSTR **columns, DWORD *numc
for (i=1; i<=count; i++ ) for (i=1; i<=count; i++ )
{ {
(*columns)[i-1] = strdupW(MSI_RecordGetString(prec, i)); (*columns)[i-1] = wcsdup(MSI_RecordGetString(prec, i));
} }
*numcolumns = count; *numcolumns = count;
...@@ -1602,7 +1602,7 @@ static UINT msi_get_query_types(MSIQUERY *query, LPWSTR **types, DWORD *numtypes ...@@ -1602,7 +1602,7 @@ static UINT msi_get_query_types(MSIQUERY *query, LPWSTR **types, DWORD *numtypes
*numtypes = count; *numtypes = count;
for (i=1; i<=count; i++ ) for (i=1; i<=count; i++ )
{ {
(*types)[i-1] = strdupW(MSI_RecordGetString(prec, i)); (*types)[i-1] = wcsdup(MSI_RecordGetString(prec, i));
} }
end: end:
...@@ -1689,7 +1689,7 @@ static UINT msi_get_merge_table (MSIDATABASE *db, LPCWSTR name, MERGETABLE **pta ...@@ -1689,7 +1689,7 @@ static UINT msi_get_merge_table (MSIDATABASE *db, LPCWSTR name, MERGETABLE **pta
list_init(&table->rows); list_init(&table->rows);
table->name = strdupW(name); table->name = wcsdup(name);
table->numconflicts = 0; table->numconflicts = 0;
msiobj_release(&mergeview->hdr); msiobj_release(&mergeview->hdr);
......
...@@ -225,7 +225,7 @@ static LPWSTR msi_dialog_dup_property( msi_dialog *dialog, LPCWSTR property, BOO ...@@ -225,7 +225,7 @@ static LPWSTR msi_dialog_dup_property( msi_dialog *dialog, LPCWSTR property, BOO
prop = msi_dup_property( dialog->package->db, property ); prop = msi_dup_property( dialog->package->db, property );
if (!prop) if (!prop)
prop = strdupW( property ); prop = wcsdup( property );
return prop; return prop;
} }
...@@ -402,8 +402,8 @@ static msi_control *dialog_create_window( msi_dialog *dialog, MSIRECORD *rec, DW ...@@ -402,8 +402,8 @@ static msi_control *dialog_create_window( msi_dialog *dialog, MSIRECORD *rec, DW
control->hIcon = NULL; control->hIcon = NULL;
control->hImageList = NULL; control->hImageList = NULL;
control->hDll = NULL; control->hDll = NULL;
control->tabnext = strdupW( MSI_RecordGetString( rec, 11) ); control->tabnext = wcsdup( MSI_RecordGetString( rec, 11 ) );
control->type = strdupW( MSI_RecordGetString( rec, 3 ) ); control->type = wcsdup( MSI_RecordGetString( rec, 3 ) );
control->progress_current = 0; control->progress_current = 0;
control->progress_max = 100; control->progress_max = 100;
control->progress_backwards = FALSE; control->progress_backwards = FALSE;
...@@ -446,7 +446,7 @@ static LPWSTR msi_dialog_get_uitext( msi_dialog *dialog, LPCWSTR key ) ...@@ -446,7 +446,7 @@ static LPWSTR msi_dialog_get_uitext( msi_dialog *dialog, LPCWSTR key )
rec = MSI_QueryGetRecord( dialog->package->db, L"SELECT * FROM `UIText` WHERE `Key` = '%s'", key ); rec = MSI_QueryGetRecord( dialog->package->db, L"SELECT * FROM `UIText` WHERE `Key` = '%s'", key );
if (!rec) return NULL; if (!rec) return NULL;
text = strdupW( MSI_RecordGetString( rec, 2 ) ); text = wcsdup( MSI_RecordGetString( rec, 2 ) );
msiobj_release( &rec->hdr ); msiobj_release( &rec->hdr );
return text; return text;
} }
...@@ -677,9 +677,9 @@ static void event_subscribe( msi_dialog *dialog, const WCHAR *event, const WCHAR ...@@ -677,9 +677,9 @@ static void event_subscribe( msi_dialog *dialog, const WCHAR *event, const WCHAR
} }
if (!(sub = msi_alloc( sizeof(*sub) ))) return; if (!(sub = msi_alloc( sizeof(*sub) ))) return;
sub->dialog = dialog; sub->dialog = dialog;
sub->event = strdupW( event ); sub->event = wcsdup( event );
sub->control = strdupW( control ); sub->control = wcsdup( control );
sub->attribute = strdupW( attribute ); sub->attribute = wcsdup( attribute );
list_add_tail( &dialog->package->subscriptions, &sub->entry ); list_add_tail( &dialog->package->subscriptions, &sub->entry );
} }
...@@ -856,7 +856,7 @@ static WCHAR *msi_get_binary_name( MSIPACKAGE *package, MSIRECORD *rec ) ...@@ -856,7 +856,7 @@ static WCHAR *msi_get_binary_name( MSIPACKAGE *package, MSIRECORD *rec )
while (*p && *p != '}') p++; while (*p && *p != '}') p++;
if (!*p++) return text; if (!*p++) return text;
p = strdupW( p ); p = wcsdup( p );
msi_free( text ); msi_free( text );
return p; return p;
} }
...@@ -1163,7 +1163,7 @@ static UINT msi_dialog_checkbox_control( msi_dialog *dialog, MSIRECORD *rec ) ...@@ -1163,7 +1163,7 @@ static UINT msi_dialog_checkbox_control( msi_dialog *dialog, MSIRECORD *rec )
prop = MSI_RecordGetString( rec, 9 ); prop = MSI_RecordGetString( rec, 9 );
if (prop) if (prop)
{ {
control->property = strdupW( prop ); control->property = wcsdup( prop );
control->value = msi_get_checkbox_value( dialog, prop ); control->value = msi_get_checkbox_value( dialog, prop );
TRACE("control %s value %s\n", debugstr_w(control->property), debugstr_w(control->value)); TRACE("control %s value %s\n", debugstr_w(control->property), debugstr_w(control->value));
} }
...@@ -1207,8 +1207,8 @@ static UINT msi_dialog_line_control( msi_dialog *dialog, MSIRECORD *rec ) ...@@ -1207,8 +1207,8 @@ static UINT msi_dialog_line_control( msi_dialog *dialog, MSIRECORD *rec )
control->hBitmap = NULL; control->hBitmap = NULL;
control->hIcon = NULL; control->hIcon = NULL;
control->hDll = NULL; control->hDll = NULL;
control->tabnext = strdupW( MSI_RecordGetString( rec, 11) ); control->tabnext = wcsdup( MSI_RecordGetString( rec, 11 ) );
control->type = strdupW( MSI_RecordGetString( rec, 3 ) ); control->type = wcsdup( MSI_RecordGetString( rec, 3 ) );
control->progress_current = 0; control->progress_current = 0;
control->progress_max = 100; control->progress_max = 100;
control->progress_backwards = FALSE; control->progress_backwards = FALSE;
...@@ -1458,7 +1458,7 @@ static UINT msi_combobox_add_item( MSIRECORD *rec, LPVOID param ) ...@@ -1458,7 +1458,7 @@ static UINT msi_combobox_add_item( MSIRECORD *rec, LPVOID param )
value = MSI_RecordGetString( rec, 3 ); value = MSI_RecordGetString( rec, 3 );
text = MSI_RecordGetString( rec, 4 ); text = MSI_RecordGetString( rec, 4 );
info->items[info->addpos_items] = strdupW( value ); info->items[info->addpos_items] = wcsdup( value );
pos = SendMessageW( info->hwnd, CB_ADDSTRING, 0, (LPARAM)text ); pos = SendMessageW( info->hwnd, CB_ADDSTRING, 0, (LPARAM)text );
SendMessageW( info->hwnd, CB_SETITEMDATA, pos, (LPARAM)info->items[info->addpos_items] ); SendMessageW( info->hwnd, CB_SETITEMDATA, pos, (LPARAM)info->items[info->addpos_items] );
...@@ -1705,7 +1705,7 @@ static UINT msi_dialog_edit_control( msi_dialog *dialog, MSIRECORD *rec ) ...@@ -1705,7 +1705,7 @@ static UINT msi_dialog_edit_control( msi_dialog *dialog, MSIRECORD *rec )
prop = MSI_RecordGetString( rec, 9 ); prop = MSI_RecordGetString( rec, 9 );
if( prop ) if( prop )
control->property = strdupW( prop ); control->property = wcsdup( prop );
val = msi_dup_property( dialog->package->db, control->property ); val = msi_dup_property( dialog->package->db, control->property );
SetWindowTextW( control->hwnd, val ); SetWindowTextW( control->hwnd, val );
...@@ -1864,7 +1864,7 @@ msi_maskedit_set_text( struct msi_maskedit_info *info, LPCWSTR text ) ...@@ -1864,7 +1864,7 @@ msi_maskedit_set_text( struct msi_maskedit_info *info, LPCWSTR text )
{ {
if( info->group[i].len < lstrlenW( p ) ) if( info->group[i].len < lstrlenW( p ) )
{ {
LPWSTR chunk = strdupW( p ); WCHAR *chunk = wcsdup( p );
chunk[ info->group[i].len ] = 0; chunk[ info->group[i].len ] = 0;
SetWindowTextW( info->group[i].hwnd, chunk ); SetWindowTextW( info->group[i].hwnd, chunk );
msi_free( chunk ); msi_free( chunk );
...@@ -2035,7 +2035,7 @@ static UINT msi_dialog_maskedit_control( msi_dialog *dialog, MSIRECORD *rec ) ...@@ -2035,7 +2035,7 @@ static UINT msi_dialog_maskedit_control( msi_dialog *dialog, MSIRECORD *rec )
prop = MSI_RecordGetString( rec, 9 ); prop = MSI_RecordGetString( rec, 9 );
if( prop ) if( prop )
info->prop = strdupW( prop ); info->prop = wcsdup( prop );
msi_maskedit_create_children( info, font ); msi_maskedit_create_children( info, font );
...@@ -2245,7 +2245,7 @@ static UINT msi_dialog_create_radiobutton( MSIRECORD *rec, LPVOID param ) ...@@ -2245,7 +2245,7 @@ static UINT msi_dialog_create_radiobutton( MSIRECORD *rec, LPVOID param )
prop = MSI_RecordGetString( rec, 1 ); prop = MSI_RecordGetString( rec, 1 );
if( prop ) if( prop )
control->property = strdupW( prop ); control->property = wcsdup( prop );
return ERROR_SUCCESS; return ERROR_SUCCESS;
} }
...@@ -2311,7 +2311,7 @@ static UINT msi_dialog_radiogroup_control( msi_dialog *dialog, MSIRECORD *rec ) ...@@ -2311,7 +2311,7 @@ static UINT msi_dialog_radiogroup_control( msi_dialog *dialog, MSIRECORD *rec )
SetWindowLongPtrW( control->hwnd, GWL_EXSTYLE, WS_EX_CONTROLPARENT ); SetWindowLongPtrW( control->hwnd, GWL_EXSTYLE, WS_EX_CONTROLPARENT );
if( prop ) if( prop )
control->property = strdupW( prop ); control->property = wcsdup( prop );
/* query the Radio Button table for all control in this group */ /* query the Radio Button table for all control in this group */
r = MSI_OpenQuery( package->db, &view, L"SELECT * FROM `RadioButton` WHERE `Property` = '%s'", prop ); r = MSI_OpenQuery( package->db, &view, L"SELECT * FROM `RadioButton` WHERE `Property` = '%s'", prop );
...@@ -2744,7 +2744,7 @@ static UINT msi_listbox_add_item( MSIRECORD *rec, LPVOID param ) ...@@ -2744,7 +2744,7 @@ static UINT msi_listbox_add_item( MSIRECORD *rec, LPVOID param )
value = MSI_RecordGetString( rec, 3 ); value = MSI_RecordGetString( rec, 3 );
text = MSI_RecordGetString( rec, 4 ); text = MSI_RecordGetString( rec, 4 );
info->items[info->addpos_items] = strdupW( value ); info->items[info->addpos_items] = wcsdup( value );
pos = SendMessageW( info->hwnd, LB_ADDSTRING, 0, (LPARAM)text ); pos = SendMessageW( info->hwnd, LB_ADDSTRING, 0, (LPARAM)text );
SendMessageW( info->hwnd, LB_SETITEMDATA, pos, (LPARAM)info->items[info->addpos_items] ); SendMessageW( info->hwnd, LB_SETITEMDATA, pos, (LPARAM)info->items[info->addpos_items] );
...@@ -3762,7 +3762,7 @@ static LRESULT msi_dialog_oncreate( HWND hwnd, LPCREATESTRUCTW cs ) ...@@ -3762,7 +3762,7 @@ static LRESULT msi_dialog_oncreate( HWND hwnd, LPCREATESTRUCTW cs )
dialog->default_font = msi_dup_property( dialog->package->db, L"DefaultUIFont" ); dialog->default_font = msi_dup_property( dialog->package->db, L"DefaultUIFont" );
if (!dialog->default_font) if (!dialog->default_font)
{ {
dialog->default_font = strdupW( L"MS Shell Dlg" ); dialog->default_font = wcsdup( L"MS Shell Dlg" );
if (!dialog->default_font) if (!dialog->default_font)
{ {
msiobj_release( &rec->hdr ); msiobj_release( &rec->hdr );
...@@ -4024,8 +4024,8 @@ static msi_dialog *dialog_create( MSIPACKAGE *package, const WCHAR *name, msi_di ...@@ -4024,8 +4024,8 @@ static msi_dialog *dialog_create( MSIPACKAGE *package, const WCHAR *name, msi_di
return NULL; return NULL;
} }
dialog->attributes = MSI_RecordGetInteger( rec, 6 ); dialog->attributes = MSI_RecordGetInteger( rec, 6 );
dialog->control_default = strdupW( MSI_RecordGetString( rec, 9 ) ); dialog->control_default = wcsdup( MSI_RecordGetString( rec, 9 ) );
dialog->control_cancel = strdupW( MSI_RecordGetString( rec, 10 ) ); dialog->control_cancel = wcsdup( MSI_RecordGetString( rec, 10 ) );
msiobj_release( &rec->hdr ); msiobj_release( &rec->hdr );
rec = MSI_CreateRecord(2); rec = MSI_CreateRecord(2);
...@@ -4372,7 +4372,7 @@ static UINT pending_event_end_dialog( msi_dialog *dialog, const WCHAR *argument ...@@ -4372,7 +4372,7 @@ static UINT pending_event_end_dialog( msi_dialog *dialog, const WCHAR *argument
{ {
dialog->pending_event = event_end_dialog; dialog->pending_event = event_end_dialog;
msi_free( dialog->pending_argument ); msi_free( dialog->pending_argument );
dialog->pending_argument = strdupW( argument ); dialog->pending_argument = wcsdup( argument );
return ERROR_SUCCESS; return ERROR_SUCCESS;
} }
...@@ -4380,7 +4380,7 @@ static UINT pending_event_end_dialog( msi_dialog *dialog, const WCHAR *argument ...@@ -4380,7 +4380,7 @@ static UINT pending_event_end_dialog( msi_dialog *dialog, const WCHAR *argument
static UINT event_new_dialog( msi_dialog *dialog, const WCHAR *argument ) static UINT event_new_dialog( msi_dialog *dialog, const WCHAR *argument )
{ {
/* store the name of the next dialog, and signal this one to end */ /* store the name of the next dialog, and signal this one to end */
dialog->package->next_dialog = strdupW( argument ); dialog->package->next_dialog = wcsdup( argument );
msi_event_cleanup_all_subscriptions( dialog->package ); msi_event_cleanup_all_subscriptions( dialog->package );
msi_dialog_end_dialog( dialog ); msi_dialog_end_dialog( dialog );
return ERROR_SUCCESS; return ERROR_SUCCESS;
...@@ -4390,7 +4390,7 @@ static UINT pending_event_new_dialog( msi_dialog *dialog, const WCHAR *argument ...@@ -4390,7 +4390,7 @@ static UINT pending_event_new_dialog( msi_dialog *dialog, const WCHAR *argument
{ {
dialog->pending_event = event_new_dialog; dialog->pending_event = event_new_dialog;
msi_free( dialog->pending_argument ); msi_free( dialog->pending_argument );
dialog->pending_argument = strdupW( argument ); dialog->pending_argument = wcsdup( argument );
return ERROR_SUCCESS; return ERROR_SUCCESS;
} }
...@@ -4415,7 +4415,7 @@ static UINT pending_event_spawn_dialog( msi_dialog *dialog, const WCHAR *argumen ...@@ -4415,7 +4415,7 @@ static UINT pending_event_spawn_dialog( msi_dialog *dialog, const WCHAR *argumen
{ {
dialog->pending_event = event_spawn_dialog; dialog->pending_event = event_spawn_dialog;
msi_free( dialog->pending_argument ); msi_free( dialog->pending_argument );
dialog->pending_argument = strdupW( argument ); dialog->pending_argument = wcsdup( argument );
return ERROR_SUCCESS; return ERROR_SUCCESS;
} }
......
...@@ -443,7 +443,7 @@ static UINT copy_install_file(MSIPACKAGE *package, MSIFILE *file, LPWSTR source) ...@@ -443,7 +443,7 @@ 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 = wcsdup( file->TargetPath ))) return ERROR_OUTOFMEMORY;
if ((p = wcsrchr(pathW, '\\'))) *p = 0; if ((p = wcsrchr(pathW, '\\'))) *p = 0;
len = lstrlenW( pathW ) + 16; len = lstrlenW( pathW ) + 16;
if (!(tmpfileW = msi_alloc(len * sizeof(WCHAR)))) if (!(tmpfileW = msi_alloc(len * sizeof(WCHAR))))
...@@ -522,7 +522,7 @@ static BOOL installfiles_cb(MSIPACKAGE *package, LPCWSTR filename, DWORD action, ...@@ -522,7 +522,7 @@ static BOOL installfiles_cb(MSIPACKAGE *package, LPCWSTR filename, DWORD action,
{ {
create_directory( package, file->Component->Directory ); create_directory( package, file->Component->Directory );
} }
*path = strdupW( file->TargetPath ); *path = wcsdup( file->TargetPath );
*attrs = file->Attributes; *attrs = file->Attributes;
*(MSIFILE **)user = file; *(MSIFILE **)user = file;
} }
...@@ -706,7 +706,7 @@ static BOOL patchfiles_cb(MSIPACKAGE *package, LPCWSTR file, DWORD action, ...@@ -706,7 +706,7 @@ static BOOL patchfiles_cb(MSIPACKAGE *package, LPCWSTR file, DWORD action,
} }
patch->path = msi_create_temp_file( package->db ); patch->path = msi_create_temp_file( package->db );
*path = strdupW( patch->path ); *path = wcsdup( patch->path );
*attrs = patch->File->Attributes; *attrs = patch->File->Attributes;
*(MSIFILEPATCH **)user = patch; *(MSIFILEPATCH **)user = patch;
} }
...@@ -971,7 +971,7 @@ static BOOL add_wildcard( FILE_LIST *files, const WCHAR *source, WCHAR *dest ) ...@@ -971,7 +971,7 @@ static BOOL add_wildcard( FILE_LIST *files, const WCHAR *source, WCHAR *dest )
if (!new) if (!new)
return FALSE; return FALSE;
new->source = strdupW(source); new->source = wcsdup(source);
ptr = wcsrchr(dest, '\\') + 1; ptr = wcsrchr(dest, '\\') + 1;
filename = wcsrchr(new->source, '\\') + 1; filename = wcsrchr(new->source, '\\') + 1;
...@@ -1125,7 +1125,7 @@ static UINT ITERATE_MoveFiles( MSIRECORD *rec, LPVOID param ) ...@@ -1125,7 +1125,7 @@ static UINT ITERATE_MoveFiles( MSIRECORD *rec, LPVOID param )
if (msi_get_file_attributes( package, sourcedir ) == INVALID_FILE_ATTRIBUTES) if (msi_get_file_attributes( package, sourcedir ) == INVALID_FILE_ATTRIBUTES)
goto done; goto done;
source = strdupW(sourcedir); source = wcsdup(sourcedir);
if (!source) if (!source)
goto done; goto done;
} }
...@@ -1150,18 +1150,18 @@ static UINT ITERATE_MoveFiles( MSIRECORD *rec, LPVOID param ) ...@@ -1150,18 +1150,18 @@ static UINT ITERATE_MoveFiles( MSIRECORD *rec, LPVOID param )
{ {
WCHAR *p; WCHAR *p;
if (sourcename) if (sourcename)
destname = strdupW(sourcename); destname = wcsdup(sourcename);
else if ((p = wcsrchr(sourcedir, '\\'))) else if ((p = wcsrchr(sourcedir, '\\')))
destname = strdupW(p + 1); destname = wcsdup(p + 1);
else else
destname = strdupW(sourcedir); destname = wcsdup(sourcedir);
if (!destname) if (!destname)
goto done; goto done;
} }
} }
else else
{ {
destname = strdupW(MSI_RecordGetString(rec, 4)); destname = wcsdup(MSI_RecordGetString(rec, 4));
if (destname) msi_reduce_to_long_filename(destname); if (destname) msi_reduce_to_long_filename(destname);
} }
...@@ -1251,7 +1251,7 @@ static WCHAR *get_duplicate_filename( MSIPACKAGE *package, MSIRECORD *row, const ...@@ -1251,7 +1251,7 @@ static WCHAR *get_duplicate_filename( MSIPACKAGE *package, MSIRECORD *row, const
if (MSI_RecordIsNull( row, 5 )) if (MSI_RecordIsNull( row, 5 ))
{ {
WCHAR *p; WCHAR *p;
dst_path = strdupW( src ); dst_path = wcsdup( src );
p = wcsrchr( dst_path, '\\' ); p = wcsrchr( dst_path, '\\' );
if (p) *p = 0; if (p) *p = 0;
} }
...@@ -1259,7 +1259,7 @@ static WCHAR *get_duplicate_filename( MSIPACKAGE *package, MSIRECORD *row, const ...@@ -1259,7 +1259,7 @@ static WCHAR *get_duplicate_filename( MSIPACKAGE *package, MSIRECORD *row, const
{ {
const WCHAR *dst_key = MSI_RecordGetString( row, 5 ); const WCHAR *dst_key = MSI_RecordGetString( row, 5 );
dst_path = strdupW( msi_get_target_folder( package, dst_key ) ); dst_path = wcsdup( msi_get_target_folder( package, dst_key ) );
if (!dst_path) if (!dst_path)
{ {
/* try a property */ /* try a property */
...@@ -1500,7 +1500,7 @@ static UINT ITERATE_RemoveFiles(MSIRECORD *row, LPVOID param) ...@@ -1500,7 +1500,7 @@ static UINT ITERATE_RemoveFiles(MSIRECORD *row, LPVOID param)
return ERROR_SUCCESS; return ERROR_SUCCESS;
} }
size = 0; size = 0;
if ((filename = strdupW( MSI_RecordGetString(row, 3) ))) if ((filename = wcsdup( MSI_RecordGetString(row, 3) )))
{ {
msi_reduce_to_long_filename( filename ); msi_reduce_to_long_filename( filename );
size = lstrlenW( filename ); size = lstrlenW( filename );
......
...@@ -152,7 +152,7 @@ static WCHAR *load_ttf_name_id( MSIPACKAGE *package, const WCHAR *filename, DWOR ...@@ -152,7 +152,7 @@ static WCHAR *load_ttf_name_id( MSIPACKAGE *package, const WCHAR *filename, DWOR
goto end; goto end;
} }
for (i = 0; i < dwRead / sizeof(WCHAR); i++) buf[i] = SWAPWORD(buf[i]); for (i = 0; i < dwRead / sizeof(WCHAR); i++) buf[i] = SWAPWORD(buf[i]);
ret = strdupW(buf); ret = wcsdup(buf);
msi_free(buf); msi_free(buf);
break; break;
} }
...@@ -260,7 +260,7 @@ static UINT ITERATE_RegisterFonts(MSIRECORD *row, LPVOID param) ...@@ -260,7 +260,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 = wcsdup( file->TargetPath );
p = wcsrchr(uipath,'\\'); p = wcsrchr(uipath,'\\');
if (p) p++; if (p) p++;
else p = uipath; else p = uipath;
...@@ -341,7 +341,7 @@ static UINT ITERATE_UnregisterFonts( MSIRECORD *row, LPVOID param ) ...@@ -341,7 +341,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 = wcsdup( file->TargetPath );
p = wcsrchr( uipath,'\\' ); p = wcsrchr( uipath,'\\' );
if (p) p++; if (p) p++;
else p = uipath; else p = uipath;
......
...@@ -219,7 +219,7 @@ static WCHAR *deformat_component( FORMAT *format, FORMSTR *str, int *ret_len ) ...@@ -219,7 +219,7 @@ static WCHAR *deformat_component( FORMAT *format, FORMSTR *str, int *ret_len )
if (comp->Action == INSTALLSTATE_SOURCE) if (comp->Action == INSTALLSTATE_SOURCE)
ret = msi_resolve_source_folder( format->package, comp->Directory, NULL ); ret = msi_resolve_source_folder( format->package, comp->Directory, NULL );
else else
ret = strdupW( msi_get_target_folder( format->package, comp->Directory ) ); ret = wcsdup( msi_get_target_folder( format->package, comp->Directory ) );
if (ret) *ret_len = lstrlenW( ret ); if (ret) *ret_len = lstrlenW( ret );
else *ret_len = 0; else *ret_len = 0;
...@@ -239,12 +239,12 @@ static WCHAR *deformat_file( FORMAT *format, FORMSTR *str, BOOL shortname, int * ...@@ -239,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 = lstrlenW( ret ); if ((ret = wcsdup( 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 = lstrlenW( ret ); if ((ret = wcsdup( file->TargetPath ))) len = lstrlenW( ret );
goto done; goto done;
} }
len++; len++;
...@@ -770,7 +770,7 @@ static DWORD deformat_string_internal(MSIPACKAGE *package, LPCWSTR ptr, ...@@ -770,7 +770,7 @@ static DWORD deformat_string_internal(MSIPACKAGE *package, LPCWSTR ptr,
return ERROR_SUCCESS; return ERROR_SUCCESS;
} }
*data = strdupW(ptr); *data = wcsdup(ptr);
*len = lstrlenW(ptr); *len = lstrlenW(ptr);
ZeroMemory(&format, sizeof(FORMAT)); ZeroMemory(&format, sizeof(FORMAT));
......
...@@ -379,7 +379,7 @@ WCHAR *msi_resolve_source_folder( MSIPACKAGE *package, const WCHAR *name, MSIFOL ...@@ -379,7 +379,7 @@ WCHAR *msi_resolve_source_folder( MSIPACKAGE *package, const WCHAR *name, MSIFOL
if (folder) *folder = f; if (folder) *folder = f;
if (f->ResolvedSource) if (f->ResolvedSource)
{ {
path = strdupW( f->ResolvedSource ); path = wcsdup( f->ResolvedSource );
TRACE(" already resolved to %s\n", debugstr_w(path)); TRACE(" already resolved to %s\n", debugstr_w(path));
return path; return path;
} }
...@@ -397,7 +397,7 @@ WCHAR *msi_resolve_source_folder( MSIPACKAGE *package, const WCHAR *name, MSIFOL ...@@ -397,7 +397,7 @@ WCHAR *msi_resolve_source_folder( MSIPACKAGE *package, const WCHAR *name, MSIFOL
path = msi_build_directory_name( 3, p, f->SourceLongPath, NULL ); path = msi_build_directory_name( 3, p, f->SourceLongPath, NULL );
TRACE("-> %s\n", debugstr_w(path)); TRACE("-> %s\n", debugstr_w(path));
f->ResolvedSource = strdupW( path ); f->ResolvedSource = wcsdup( path );
msi_free( p ); msi_free( p );
return path; return path;
......
...@@ -282,9 +282,9 @@ static UINT msi_media_get_disk_info(MSIPACKAGE *package, MSIMEDIAINFO *mi) ...@@ -282,9 +282,9 @@ static UINT msi_media_get_disk_info(MSIPACKAGE *package, MSIMEDIAINFO *mi)
return ERROR_FUNCTION_FAILED; return ERROR_FUNCTION_FAILED;
} }
mi->disk_prompt = strdupW(MSI_RecordGetString(row, 3)); mi->disk_prompt = wcsdup(MSI_RecordGetString(row, 3));
mi->cabinet = strdupW(MSI_RecordGetString(row, 4)); mi->cabinet = wcsdup(MSI_RecordGetString(row, 4));
mi->volume_label = strdupW(MSI_RecordGetString(row, 5)); mi->volume_label = wcsdup(MSI_RecordGetString(row, 5));
msiobj_release(&row->hdr); msiobj_release(&row->hdr);
return ERROR_SUCCESS; return ERROR_SUCCESS;
...@@ -460,7 +460,7 @@ static INT_PTR cabinet_copy_file(FDINOTIFICATIONTYPE fdint, ...@@ -460,7 +460,7 @@ 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 = wcsdup(path))) return ERROR_OUTOFMEMORY;
if ((p = wcsrchr(tmppathW, '\\'))) *p = 0; if ((p = wcsrchr(tmppathW, '\\'))) *p = 0;
len = lstrlenW( tmppathW ) + 16; len = lstrlenW( tmppathW ) + 16;
if (!(tmpfileW = msi_alloc(len * sizeof(WCHAR)))) if (!(tmpfileW = msi_alloc(len * sizeof(WCHAR))))
...@@ -681,7 +681,7 @@ static UINT get_drive_type(const WCHAR *path) ...@@ -681,7 +681,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, L"OriginalDatabase" ); WCHAR *p, *ret = NULL, *orig_db = msi_dup_property( db, L"OriginalDatabase" );
if (UrlIsW( orig_db, URLIS_URL ) && (ret = strdupW( orig_db )) && (p = wcsrchr( ret, '/'))) p[1] = 0; if (UrlIsW( orig_db, URLIS_URL ) && (ret = wcsdup( orig_db )) && (p = wcsrchr( ret, '/' ))) p[1] = 0;
msi_free( orig_db ); msi_free( orig_db );
return ret; return ret;
} }
...@@ -706,11 +706,11 @@ UINT msi_load_media_info(MSIPACKAGE *package, UINT Sequence, MSIMEDIAINFO *mi) ...@@ -706,11 +706,11 @@ UINT msi_load_media_info(MSIPACKAGE *package, UINT Sequence, MSIMEDIAINFO *mi)
mi->disk_id = MSI_RecordGetInteger(row, 1); mi->disk_id = MSI_RecordGetInteger(row, 1);
mi->last_sequence = MSI_RecordGetInteger(row, 2); mi->last_sequence = MSI_RecordGetInteger(row, 2);
msi_free(mi->disk_prompt); msi_free(mi->disk_prompt);
mi->disk_prompt = strdupW(MSI_RecordGetString(row, 3)); mi->disk_prompt = wcsdup(MSI_RecordGetString(row, 3));
msi_free(mi->cabinet); msi_free(mi->cabinet);
mi->cabinet = strdupW(MSI_RecordGetString(row, 4)); mi->cabinet = wcsdup(MSI_RecordGetString(row, 4));
msi_free(mi->volume_label); msi_free(mi->volume_label);
mi->volume_label = strdupW(MSI_RecordGetString(row, 5)); mi->volume_label = wcsdup(MSI_RecordGetString(row, 5));
msiobj_release(&row->hdr); msiobj_release(&row->hdr);
msi_set_sourcedir_props(package, FALSE); msi_set_sourcedir_props(package, FALSE);
...@@ -887,7 +887,7 @@ UINT ready_media( MSIPACKAGE *package, BOOL compressed, MSIMEDIAINFO *mi ) ...@@ -887,7 +887,7 @@ UINT ready_media( MSIPACKAGE *package, BOOL compressed, MSIMEDIAINFO *mi )
lstrcpyW( 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 = wcsdup( p + 1 );
msi_free( url ); msi_free( url );
return ERROR_SUCCESS; return ERROR_SUCCESS;
...@@ -914,7 +914,7 @@ UINT ready_media( MSIPACKAGE *package, BOOL compressed, MSIMEDIAINFO *mi ) ...@@ -914,7 +914,7 @@ UINT ready_media( MSIPACKAGE *package, BOOL compressed, MSIMEDIAINFO *mi )
} }
msi_free(mi->last_volume); msi_free(mi->last_volume);
mi->last_volume = strdupW(mi->volume_label); mi->last_volume = wcsdup(mi->volume_label);
} }
if (mi->cabinet) if (mi->cabinet)
{ {
......
...@@ -1080,7 +1080,7 @@ static WCHAR *reg_get_value( HKEY hkey, const WCHAR *name, DWORD *type ) ...@@ -1080,7 +1080,7 @@ static WCHAR *reg_get_value( HKEY hkey, const WCHAR *name, DWORD *type )
if (!msi_reg_get_val_dword( hkey, name, &val )) return NULL; if (!msi_reg_get_val_dword( hkey, name, &val )) return NULL;
swprintf( temp, ARRAY_SIZE(temp), L"%u", val ); swprintf( temp, ARRAY_SIZE(temp), L"%u", val );
return strdupW( temp ); return wcsdup( temp );
} }
ERR( "unhandled value type %lu\n", *type ); ERR( "unhandled value type %lu\n", *type );
...@@ -1210,7 +1210,7 @@ static UINT MSI_GetProductInfo(LPCWSTR szProduct, LPCWSTR szAttribute, ...@@ -1210,7 +1210,7 @@ static UINT MSI_GetProductInfo(LPCWSTR szProduct, LPCWSTR szAttribute,
{ {
unsquash_guid(val, packagecode); unsquash_guid(val, packagecode);
msi_free(val); msi_free(val);
val = strdupW(packagecode); val = wcsdup(packagecode);
} }
} }
} }
...@@ -1488,7 +1488,7 @@ UINT WINAPI MsiGetProductInfoExW(LPCWSTR szProductCode, LPCWSTR szUserSid, ...@@ -1488,7 +1488,7 @@ UINT WINAPI MsiGetProductInfoExW(LPCWSTR szProductCode, LPCWSTR szUserSid,
val = reg_get_value(props, szProperty, &type); val = reg_get_value(props, szProperty, &type);
if (!val) if (!val)
val = strdupW(L""); val = wcsdup(L"");
r = msi_copy_outval(val, szValue, pcchValue); r = msi_copy_outval(val, szValue, pcchValue);
} }
...@@ -1513,7 +1513,7 @@ UINT WINAPI MsiGetProductInfoExW(LPCWSTR szProductCode, LPCWSTR szUserSid, ...@@ -1513,7 +1513,7 @@ UINT WINAPI MsiGetProductInfoExW(LPCWSTR szProductCode, LPCWSTR szUserSid,
val = reg_get_value(hkey, szProperty, &type); val = reg_get_value(hkey, szProperty, &type);
if (!val) if (!val)
val = strdupW(L""); val = wcsdup(L"");
r = msi_copy_outval(val, szValue, pcchValue); r = msi_copy_outval(val, szValue, pcchValue);
} }
...@@ -1528,10 +1528,10 @@ UINT WINAPI MsiGetProductInfoExW(LPCWSTR szProductCode, LPCWSTR szUserSid, ...@@ -1528,10 +1528,10 @@ UINT WINAPI MsiGetProductInfoExW(LPCWSTR szProductCode, LPCWSTR szUserSid,
goto done; goto done;
msi_free(val); msi_free(val);
val = strdupW(L"5"); val = wcsdup(L"5");
} }
else else
val = strdupW(L"1"); val = wcsdup(L"1");
r = msi_copy_outval(val, szValue, pcchValue); r = msi_copy_outval(val, szValue, pcchValue);
goto done; goto done;
...@@ -1539,13 +1539,13 @@ UINT WINAPI MsiGetProductInfoExW(LPCWSTR szProductCode, LPCWSTR szUserSid, ...@@ -1539,13 +1539,13 @@ UINT WINAPI MsiGetProductInfoExW(LPCWSTR szProductCode, LPCWSTR szUserSid,
else if (props && (val = reg_get_value(props, package, &type))) else if (props && (val = reg_get_value(props, package, &type)))
{ {
msi_free(val); msi_free(val);
val = strdupW(L"5"); val = wcsdup(L"5");
r = msi_copy_outval(val, szValue, pcchValue); r = msi_copy_outval(val, szValue, pcchValue);
goto done; goto done;
} }
if (prod || managed) if (prod || managed)
val = strdupW(L"1"); val = wcsdup(L"1");
else else
goto done; goto done;
...@@ -1557,7 +1557,7 @@ UINT WINAPI MsiGetProductInfoExW(LPCWSTR szProductCode, LPCWSTR szUserSid, ...@@ -1557,7 +1557,7 @@ UINT WINAPI MsiGetProductInfoExW(LPCWSTR szProductCode, LPCWSTR szUserSid,
goto done; goto done;
/* FIXME */ /* FIXME */
val = strdupW(L""); val = wcsdup(L"");
r = msi_copy_outval(val, szValue, pcchValue); r = msi_copy_outval(val, szValue, pcchValue);
} }
else else
...@@ -1760,7 +1760,7 @@ UINT WINAPI MsiGetPatchInfoExW(LPCWSTR szPatchCode, LPCWSTR szProductCode, ...@@ -1760,7 +1760,7 @@ UINT WINAPI MsiGetPatchInfoExW(LPCWSTR szPatchCode, LPCWSTR szProductCode,
val = reg_get_value(datakey, szProperty, &type); val = reg_get_value(datakey, szProperty, &type);
if (!val) if (!val)
val = strdupW(L""); val = wcsdup(L"");
r = ERROR_SUCCESS; r = ERROR_SUCCESS;
...@@ -1915,7 +1915,7 @@ UINT WINAPI MsiEnableLogW( DWORD dwLogMode, const WCHAR *szLogFile, DWORD attrib ...@@ -1915,7 +1915,7 @@ UINT WINAPI MsiEnableLogW( DWORD dwLogMode, const WCHAR *szLogFile, DWORD attrib
FILE_ATTRIBUTE_NORMAL, NULL); FILE_ATTRIBUTE_NORMAL, NULL);
if (file != INVALID_HANDLE_VALUE) if (file != INVALID_HANDLE_VALUE)
{ {
gszLogFile = strdupW(szLogFile); gszLogFile = wcsdup(szLogFile);
CloseHandle(file); CloseHandle(file);
} }
else ERR( "unable to enable log %s (%lu)\n", debugstr_w(szLogFile), GetLastError() ); else ERR( "unable to enable log %s (%lu)\n", debugstr_w(szLogFile), GetLastError() );
......
...@@ -1188,14 +1188,4 @@ static inline LPWSTR strdupAtoW( LPCSTR str ) ...@@ -1188,14 +1188,4 @@ static inline LPWSTR strdupAtoW( LPCSTR str )
return ret; return ret;
} }
static inline LPWSTR strdupW( LPCWSTR src )
{
LPWSTR dest;
if (!src) return NULL;
dest = msi_alloc( (lstrlenW(src)+1)*sizeof(WCHAR) );
if (dest)
lstrcpyW(dest, src);
return dest;
}
#endif /* __WINE_MSI_PRIVATE__ */ #endif /* __WINE_MSI_PRIVATE__ */
...@@ -987,7 +987,7 @@ MSIPACKAGE *MSI_CreatePackage( MSIDATABASE *db ) ...@@ -987,7 +987,7 @@ MSIPACKAGE *MSI_CreatePackage( MSIDATABASE *db )
package->LastActionTemplate = NULL; package->LastActionTemplate = NULL;
package->LastActionResult = MSI_NULL_INTEGER; package->LastActionResult = MSI_NULL_INTEGER;
package->WordCount = 0; package->WordCount = 0;
package->PackagePath = strdupW( db->path ); package->PackagePath = wcsdup( db->path );
create_temp_property_table( package ); create_temp_property_table( package );
msi_clone_properties( package->db ); msi_clone_properties( package->db );
...@@ -1225,7 +1225,7 @@ static WCHAR *get_property( MSIDATABASE *db, const WCHAR *prop ) ...@@ -1225,7 +1225,7 @@ static WCHAR *get_property( MSIDATABASE *db, const WCHAR *prop )
} }
if (MSI_ViewFetch( view, &rec ) == ERROR_SUCCESS) if (MSI_ViewFetch( view, &rec ) == ERROR_SUCCESS)
{ {
ret = strdupW( MSI_RecordGetString( rec, 1 ) ); ret = wcsdup( MSI_RecordGetString( rec, 1 ) );
msiobj_release( &rec->hdr ); msiobj_release( &rec->hdr );
} }
MSI_ViewClose( view ); MSI_ViewClose( view );
...@@ -1431,7 +1431,7 @@ UINT MSI_OpenPackageW(LPCWSTR szPackage, DWORD dwOptions, MSIPACKAGE **pPackage) ...@@ -1431,7 +1431,7 @@ UINT MSI_OpenPackageW(LPCWSTR szPackage, DWORD dwOptions, MSIPACKAGE **pPackage)
package = MSI_CreatePackage( db ); package = MSI_CreatePackage( db );
msiobj_release( &db->hdr ); msiobj_release( &db->hdr );
if (!package) return ERROR_INSTALL_PACKAGE_INVALID; if (!package) return ERROR_INSTALL_PACKAGE_INVALID;
package->localfile = strdupW( localfile ); package->localfile = wcsdup( localfile );
package->delete_on_close = delete_on_close; package->delete_on_close = delete_on_close;
r = msi_get_suminfo( db->storage, 0, &si ); r = msi_get_suminfo( db->storage, 0, &si );
...@@ -1892,7 +1892,7 @@ INT MSI_ProcessMessage( MSIPACKAGE *package, INSTALLMESSAGE eMessageType, MSIREC ...@@ -1892,7 +1892,7 @@ INT MSI_ProcessMessage( MSIPACKAGE *package, INSTALLMESSAGE eMessageType, MSIREC
template_rec = msi_dup_record_field(record, 0); template_rec = msi_dup_record_field(record, 0);
template_prefix = msi_get_error_message(package->db, eMessageType >> 24); template_prefix = msi_get_error_message(package->db, eMessageType >> 24);
if (!template_prefix) template_prefix = strdupW(L""); if (!template_prefix) template_prefix = wcsdup(L"");
if (!template_rec) if (!template_rec)
{ {
...@@ -1924,7 +1924,7 @@ INT MSI_ProcessMessage( MSIPACKAGE *package, INSTALLMESSAGE eMessageType, MSIREC ...@@ -1924,7 +1924,7 @@ INT MSI_ProcessMessage( MSIPACKAGE *package, INSTALLMESSAGE eMessageType, MSIREC
msi_free(package->LastAction); msi_free(package->LastAction);
msi_free(package->LastActionTemplate); msi_free(package->LastActionTemplate);
package->LastAction = msi_dup_record_field(record, 1); package->LastAction = msi_dup_record_field(record, 1);
if (!package->LastAction) package->LastAction = strdupW(L""); if (!package->LastAction) package->LastAction = wcsdup(L"");
package->LastActionTemplate = msi_dup_record_field(record, 3); package->LastActionTemplate = msi_dup_record_field(record, 3);
break; break;
} }
...@@ -2576,7 +2576,7 @@ UINT msi_package_add_info(MSIPACKAGE *package, DWORD context, DWORD options, ...@@ -2576,7 +2576,7 @@ UINT msi_package_add_info(MSIPACKAGE *package, DWORD context, DWORD options,
info->context = context; info->context = context;
info->options = options; info->options = options;
info->property = property; info->property = property;
info->value = strdupW(value); info->value = wcsdup(value);
list_add_head(&package->sourcelist_info, &info->entry); list_add_head(&package->sourcelist_info, &info->entry);
return ERROR_SUCCESS; return ERROR_SUCCESS;
...@@ -2599,8 +2599,8 @@ UINT msi_package_add_media_disk(MSIPACKAGE *package, DWORD context, DWORD option ...@@ -2599,8 +2599,8 @@ UINT msi_package_add_media_disk(MSIPACKAGE *package, DWORD context, DWORD option
disk->context = context; disk->context = context;
disk->options = options; disk->options = options;
disk->disk_id = disk_id; disk->disk_id = disk_id;
disk->volume_label = strdupW(volume_label); disk->volume_label = wcsdup(volume_label);
disk->disk_prompt = strdupW(disk_prompt); disk->disk_prompt = wcsdup(disk_prompt);
list_add_head(&package->sourcelist_media, &disk->entry); list_add_head(&package->sourcelist_media, &disk->entry);
return ERROR_SUCCESS; return ERROR_SUCCESS;
......
...@@ -911,8 +911,8 @@ static UINT msi_apply_patch_package( MSIPACKAGE *package, const WCHAR *file ) ...@@ -911,8 +911,8 @@ static UINT msi_apply_patch_package( MSIPACKAGE *package, const WCHAR *file )
r = ERROR_OUTOFMEMORY; r = ERROR_OUTOFMEMORY;
patch->registered = FALSE; patch->registered = FALSE;
if (!(patch->filename = strdupW( file ))) goto done; if (!(patch->filename = wcsdup( file ))) goto done;
if (!(patch->localfile = strdupW( localfile ))) goto done; if (!(patch->localfile = wcsdup( localfile ))) goto done;
r = msi_apply_patch_db( package, patch_db, patch ); r = msi_apply_patch_db( package, patch_db, patch );
if (r != ERROR_SUCCESS) WARN("patch failed to apply %u\n", r); if (r != ERROR_SUCCESS) WARN("patch failed to apply %u\n", r);
...@@ -1027,7 +1027,7 @@ UINT msi_apply_registered_patch( MSIPACKAGE *package, LPCWSTR patch_code ) ...@@ -1027,7 +1027,7 @@ UINT msi_apply_registered_patch( MSIPACKAGE *package, LPCWSTR patch_code )
return r; return r;
} }
patch_info->registered = TRUE; patch_info->registered = TRUE;
patch_info->localfile = strdupW( patch_file ); patch_info->localfile = wcsdup( patch_file );
if (!patch_info->localfile) if (!patch_info->localfile)
{ {
msiobj_release( &patch_db->hdr ); msiobj_release( &patch_db->hdr );
......
...@@ -1129,7 +1129,7 @@ struct wire_record *marshal_record(MSIHANDLE handle) ...@@ -1129,7 +1129,7 @@ struct wire_record *marshal_record(MSIHANDLE handle)
ret->fields[i].u.iVal = rec->fields[i].u.iVal; ret->fields[i].u.iVal = rec->fields[i].u.iVal;
break; break;
case MSIFIELD_WSTR: case MSIFIELD_WSTR:
ret->fields[i].u.szwVal = strdupW(rec->fields[i].u.szwVal); ret->fields[i].u.szwVal = wcsdup(rec->fields[i].u.szwVal);
break; break;
case MSIFIELD_STREAM: case MSIFIELD_STREAM:
IStream_AddRef(rec->fields[i].u.stream); IStream_AddRef(rec->fields[i].u.stream);
......
...@@ -1088,7 +1088,7 @@ UINT WINAPI MsiSourceListAddSourceExW( const WCHAR *szProduct, const WCHAR *szUs ...@@ -1088,7 +1088,7 @@ UINT WINAPI MsiSourceListAddSourceExW( const WCHAR *szProduct, const WCHAR *szUs
postfix = (dwOptions & MSISOURCETYPE_NETWORK) ? L"\\" : L"/"; postfix = (dwOptions & MSISOURCETYPE_NETWORK) ? L"\\" : L"/";
if (szSource[lstrlenW(szSource) - 1] == *postfix) if (szSource[lstrlenW(szSource) - 1] == *postfix)
source = strdupW(szSource); source = wcsdup(szSource);
else else
{ {
size = lstrlenW(szSource) + 2; size = lstrlenW(szSource) + 2;
...@@ -1125,7 +1125,7 @@ UINT WINAPI MsiSourceListAddSourceExW( const WCHAR *szProduct, const WCHAR *szUs ...@@ -1125,7 +1125,7 @@ UINT WINAPI MsiSourceListAddSourceExW( const WCHAR *szProduct, const WCHAR *szUs
goto done; goto done;
} }
info->path = strdupW(source); info->path = wcsdup(source);
lstrcpyW(info->szIndex, name); lstrcpyW(info->szIndex, name);
info->index = dwIndex; info->index = dwIndex;
add_source_to_list(&sourcelist, info, &index); add_source_to_list(&sourcelist, info, &index);
......
...@@ -218,7 +218,7 @@ static UINT STORAGES_set_row(struct tagMSIVIEW *view, UINT row, MSIRECORD *rec, ...@@ -218,7 +218,7 @@ static UINT STORAGES_set_row(struct tagMSIVIEW *view, UINT row, MSIRECORD *rec,
return r; return r;
} }
name = strdupW(MSI_RecordGetString(rec, 1)); name = wcsdup(MSI_RecordGetString(rec, 1));
if (!name) if (!name)
{ {
r = ERROR_OUTOFMEMORY; r = ERROR_OUTOFMEMORY;
......
...@@ -3419,7 +3419,7 @@ UINT msi_table_apply_transform( MSIDATABASE *db, IStorage *stg, int err_cond ) ...@@ -3419,7 +3419,7 @@ UINT msi_table_apply_transform( MSIDATABASE *db, IStorage *stg, int err_cond )
list_add_tail( &transforms, &transform->entry ); list_add_tail( &transforms, &transform->entry );
transform->name = strdupW( name + 1 ); transform->name = wcsdup( name + 1 );
if ( !wcscmp( transform->name, L"_Tables" ) ) if ( !wcscmp( transform->name, L"_Tables" ) )
tables = transform; tables = transform;
......
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