msi: Clean up memset usage.
This commit is contained in:
parent
edb58a6d05
commit
3a94011ab6
|
@ -573,8 +573,7 @@ UINT MSI_InstallPackage( MSIPACKAGE *package, LPCWSTR szPackagePath,
|
|||
|
||||
MSI_SetPropertyW(package, szAction, szInstall);
|
||||
|
||||
package->script = msi_alloc(sizeof(MSISCRIPT));
|
||||
memset(package->script,0,sizeof(MSISCRIPT));
|
||||
package->script = msi_alloc_zero(sizeof(MSISCRIPT));
|
||||
|
||||
package->script->InWhatSequence = SEQUENCE_INSTALL;
|
||||
|
||||
|
@ -3383,7 +3382,7 @@ static UINT ACTION_PublishFeatures(MSIPACKAGE *package)
|
|||
MSICOMPONENT* component = cl->component;
|
||||
WCHAR buf[21];
|
||||
|
||||
memset(buf,0,sizeof(buf));
|
||||
buf[0] = 0;
|
||||
if (component->ComponentId)
|
||||
{
|
||||
TRACE("From %s\n",debugstr_w(component->ComponentId));
|
||||
|
@ -3914,8 +3913,7 @@ static LPWSTR load_ttfname_from(LPCWSTR filename)
|
|||
ttRecord.uStringOffset +
|
||||
ttNTHeader.uStorageOffset,
|
||||
NULL, FILE_BEGIN);
|
||||
buf = msi_alloc( ttRecord.uStringLength + 1 + strlen(tt) );
|
||||
memset(buf, 0, ttRecord.uStringLength + 1 + strlen(tt));
|
||||
buf = msi_alloc_zero( ttRecord.uStringLength + 1 + strlen(tt) );
|
||||
ReadFile(handle, buf, ttRecord.uStringLength, &dwRead, NULL);
|
||||
if (strlen(buf) > 0)
|
||||
{
|
||||
|
@ -4080,8 +4078,7 @@ static UINT ITERATE_PublishComponent(MSIRECORD *rec, LPVOID param)
|
|||
sz+=3;
|
||||
sz *= sizeof(WCHAR);
|
||||
|
||||
output = msi_alloc(sz);
|
||||
memset(output,0,sz);
|
||||
output = msi_alloc_zero(sz);
|
||||
strcpyW(output,advertise);
|
||||
msi_free(advertise);
|
||||
|
||||
|
|
|
@ -1160,8 +1160,7 @@ static UINT register_verb(MSIPACKAGE *package, LPCWSTR progid,
|
|||
size += strlenW(verb->Argument);
|
||||
size += 4;
|
||||
|
||||
command = msi_alloc(size * sizeof (WCHAR));
|
||||
memset(command,0,size*sizeof(WCHAR));
|
||||
command = msi_alloc_zero(size * sizeof (WCHAR));
|
||||
|
||||
strcpyW(command,advertise);
|
||||
if (verb->Argument)
|
||||
|
|
|
@ -1891,29 +1891,29 @@ UINT WINAPI MsiReinstallFeatureW( LPCWSTR szProduct, LPCWSTR szFeature,
|
|||
FIXME("%s %s %li\n", debugstr_w(szProduct), debugstr_w(szFeature),
|
||||
dwReinstallMode);
|
||||
|
||||
memset(reinstallmode,0,sizeof(reinstallmode));
|
||||
ptr = reinstallmode;
|
||||
|
||||
if (dwReinstallMode & REINSTALLMODE_FILEMISSING)
|
||||
{ *ptr = 'p'; ptr++; }
|
||||
*ptr++ = 'p';
|
||||
if (dwReinstallMode & REINSTALLMODE_FILEOLDERVERSION)
|
||||
{ *ptr = 'o'; ptr++; }
|
||||
*ptr++ = 'o';
|
||||
if (dwReinstallMode & REINSTALLMODE_FILEEQUALVERSION)
|
||||
{ *ptr = 'w'; ptr++; }
|
||||
*ptr++ = 'w';
|
||||
if (dwReinstallMode & REINSTALLMODE_FILEEXACT)
|
||||
{ *ptr = 'd'; ptr++; }
|
||||
*ptr++ = 'd';
|
||||
if (dwReinstallMode & REINSTALLMODE_FILEVERIFY)
|
||||
{ *ptr = 'c'; ptr++; }
|
||||
*ptr++ = 'c';
|
||||
if (dwReinstallMode & REINSTALLMODE_FILEREPLACE)
|
||||
{ *ptr = 'a'; ptr++; }
|
||||
*ptr++ = 'a';
|
||||
if (dwReinstallMode & REINSTALLMODE_USERDATA)
|
||||
{ *ptr = 'u'; ptr++; }
|
||||
*ptr++ = 'u';
|
||||
if (dwReinstallMode & REINSTALLMODE_MACHINEDATA)
|
||||
{ *ptr = 'm'; ptr++; }
|
||||
*ptr++ = 'm';
|
||||
if (dwReinstallMode & REINSTALLMODE_SHORTCUT)
|
||||
{ *ptr = 's'; ptr++; }
|
||||
*ptr++ = 's';
|
||||
if (dwReinstallMode & REINSTALLMODE_PACKAGE)
|
||||
{ *ptr = 'v'; ptr++; }
|
||||
*ptr++ = 'v';
|
||||
*ptr = 0;
|
||||
|
||||
sz = sizeof(sourcepath);
|
||||
MsiSourceListGetInfoW(szProduct, NULL, MSIINSTALLCONTEXT_USERMANAGED,
|
||||
|
|
Loading…
Reference in New Issue