Fix more fixed length buffers.
This commit is contained in:
parent
92167f6021
commit
efcc1ec5e4
|
@ -969,32 +969,21 @@ static UINT ACTION_CreateFolders(MSIPACKAGE *package)
|
||||||
static MSICOMPONENT* load_component( MSIRECORD * row )
|
static MSICOMPONENT* load_component( MSIRECORD * row )
|
||||||
{
|
{
|
||||||
MSICOMPONENT *comp;
|
MSICOMPONENT *comp;
|
||||||
DWORD sz;
|
|
||||||
|
|
||||||
comp = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(MSICOMPONENT) );
|
comp = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(MSICOMPONENT) );
|
||||||
if (!comp)
|
if (!comp)
|
||||||
return comp;
|
return comp;
|
||||||
|
|
||||||
/* fill in the data */
|
/* fill in the data */
|
||||||
sz = IDENTIFIER_SIZE;
|
comp->Component = load_dynamic_stringW( row, 1 );
|
||||||
MSI_RecordGetStringW(row,1,comp->Component,&sz);
|
|
||||||
|
|
||||||
TRACE("Loading Component %s\n",
|
TRACE("Loading Component %s\n", debugstr_w(comp->Component));
|
||||||
debugstr_w(comp->Component));
|
|
||||||
|
|
||||||
sz = 0x100;
|
|
||||||
if (!MSI_RecordIsNull(row,2))
|
|
||||||
MSI_RecordGetStringW(row,2,comp->ComponentId,&sz);
|
|
||||||
|
|
||||||
sz = IDENTIFIER_SIZE;
|
|
||||||
MSI_RecordGetStringW(row,3,comp->Directory,&sz);
|
|
||||||
|
|
||||||
|
comp->ComponentId = load_dynamic_stringW( row, 2 );
|
||||||
|
comp->Directory = load_dynamic_stringW( row, 3 );
|
||||||
comp->Attributes = MSI_RecordGetInteger(row,4);
|
comp->Attributes = MSI_RecordGetInteger(row,4);
|
||||||
|
|
||||||
comp->Condition = load_dynamic_stringW( row, 5 );
|
comp->Condition = load_dynamic_stringW( row, 5 );
|
||||||
|
comp->KeyPath = load_dynamic_stringW( row, 6 );
|
||||||
sz = IDENTIFIER_SIZE;
|
|
||||||
MSI_RecordGetStringW(row,6,comp->KeyPath,&sz);
|
|
||||||
|
|
||||||
comp->Installed = INSTALLSTATE_ABSENT;
|
comp->Installed = INSTALLSTATE_ABSENT;
|
||||||
comp->Action = INSTALLSTATE_UNKNOWN;
|
comp->Action = INSTALLSTATE_UNKNOWN;
|
||||||
|
@ -2264,11 +2253,9 @@ static UINT ACTION_LaunchConditions(MSIPACKAGE *package)
|
||||||
static LPWSTR resolve_keypath( MSIPACKAGE* package, MSICOMPONENT *cmp )
|
static LPWSTR resolve_keypath( MSIPACKAGE* package, MSICOMPONENT *cmp )
|
||||||
{
|
{
|
||||||
|
|
||||||
if (cmp->KeyPath[0]==0)
|
if (!cmp->KeyPath)
|
||||||
{
|
return resolve_folder(package,cmp->Directory,FALSE,FALSE,NULL);
|
||||||
LPWSTR p = resolve_folder(package,cmp->Directory,FALSE,FALSE,NULL);
|
|
||||||
return p;
|
|
||||||
}
|
|
||||||
if (cmp->Attributes & msidbComponentAttributesRegistryKeyPath)
|
if (cmp->Attributes & msidbComponentAttributesRegistryKeyPath)
|
||||||
{
|
{
|
||||||
MSIRECORD * row = 0;
|
MSIRECORD * row = 0;
|
||||||
|
@ -2380,7 +2367,7 @@ static void ACTION_RefCountComponent( MSIPACKAGE* package, MSICOMPONENT *comp )
|
||||||
BOOL write = FALSE;
|
BOOL write = FALSE;
|
||||||
|
|
||||||
/* only refcount DLLs */
|
/* only refcount DLLs */
|
||||||
if (comp->KeyPath[0]==0 ||
|
if (comp->KeyPath == NULL ||
|
||||||
comp->Attributes & msidbComponentAttributesRegistryKeyPath ||
|
comp->Attributes & msidbComponentAttributesRegistryKeyPath ||
|
||||||
comp->Attributes & msidbComponentAttributesODBCDataSource)
|
comp->Attributes & msidbComponentAttributesODBCDataSource)
|
||||||
write = FALSE;
|
write = FALSE;
|
||||||
|
@ -2475,7 +2462,7 @@ static UINT ACTION_ProcessComponents(MSIPACKAGE *package)
|
||||||
LIST_FOR_EACH_ENTRY( comp, &package->components, MSICOMPONENT, entry )
|
LIST_FOR_EACH_ENTRY( comp, &package->components, MSICOMPONENT, entry )
|
||||||
{
|
{
|
||||||
ui_progress(package,2,0,0,0);
|
ui_progress(package,2,0,0,0);
|
||||||
if (comp->ComponentId[0]!=0)
|
if (comp->ComponentId)
|
||||||
{
|
{
|
||||||
WCHAR *keypath = NULL;
|
WCHAR *keypath = NULL;
|
||||||
MSIRECORD * uirow;
|
MSIRECORD * uirow;
|
||||||
|
@ -3305,7 +3292,7 @@ static UINT ACTION_PublishFeatures(MSIPACKAGE *package)
|
||||||
WCHAR buf[21];
|
WCHAR buf[21];
|
||||||
|
|
||||||
memset(buf,0,sizeof(buf));
|
memset(buf,0,sizeof(buf));
|
||||||
if ( component->ComponentId[0] )
|
if (component->ComponentId)
|
||||||
{
|
{
|
||||||
TRACE("From %s\n",debugstr_w(component->ComponentId));
|
TRACE("From %s\n",debugstr_w(component->ComponentId));
|
||||||
CLSIDFromString(component->ComponentId, &clsid);
|
CLSIDFromString(component->ComponentId, &clsid);
|
||||||
|
|
|
@ -50,12 +50,12 @@ typedef struct tagMSICOMPONENT
|
||||||
{
|
{
|
||||||
struct list entry;
|
struct list entry;
|
||||||
DWORD magic;
|
DWORD magic;
|
||||||
WCHAR Component[IDENTIFIER_SIZE];
|
LPWSTR Component;
|
||||||
WCHAR ComponentId[IDENTIFIER_SIZE];
|
LPWSTR ComponentId;
|
||||||
WCHAR Directory[IDENTIFIER_SIZE];
|
LPWSTR Directory;
|
||||||
INT Attributes;
|
INT Attributes;
|
||||||
LPWSTR Condition;
|
LPWSTR Condition;
|
||||||
WCHAR KeyPath[IDENTIFIER_SIZE];
|
LPWSTR KeyPath;
|
||||||
|
|
||||||
INSTALLSTATE Installed;
|
INSTALLSTATE Installed;
|
||||||
INSTALLSTATE ActionRequest;
|
INSTALLSTATE ActionRequest;
|
||||||
|
|
|
@ -498,7 +498,11 @@ void ACTION_free_package_structures( MSIPACKAGE* package)
|
||||||
MSICOMPONENT *comp = LIST_ENTRY( item, MSICOMPONENT, entry );
|
MSICOMPONENT *comp = LIST_ENTRY( item, MSICOMPONENT, entry );
|
||||||
|
|
||||||
list_remove( &comp->entry );
|
list_remove( &comp->entry );
|
||||||
|
HeapFree( GetProcessHeap(), 0, comp->Component );
|
||||||
|
HeapFree( GetProcessHeap(), 0, comp->ComponentId );
|
||||||
|
HeapFree( GetProcessHeap(), 0, comp->Directory );
|
||||||
HeapFree( GetProcessHeap(), 0, comp->Condition );
|
HeapFree( GetProcessHeap(), 0, comp->Condition );
|
||||||
|
HeapFree( GetProcessHeap(), 0, comp->KeyPath );
|
||||||
HeapFree( GetProcessHeap(), 0, comp->FullKeypath );
|
HeapFree( GetProcessHeap(), 0, comp->FullKeypath );
|
||||||
HeapFree( GetProcessHeap(), 0, comp );
|
HeapFree( GetProcessHeap(), 0, comp );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue