<html>
<head>
<style>
<!--
body { background-color:#ffffff }
.file { border:1px solid #eeeeee; margin-top:1em; margin-bottom:1em }
.pathname { font-family:monospace; float:right }
.fileheader { margin-bottom:.5em }
.diff { margin:0 }
.tasklist { padding:4px; border:1px dashed #000000; margin-top:1em }
.tasklist ul { margin-top:0; margin-bottom:0 }
tr.alt { background-color:#eeeeee }
#added { background-color:#ddffdd }
#addedchars { background-color:#99ff99; font-weight:bolder }
tr.alt #added { background-color:#ccf7cc }
#removed { background-color:#ffdddd }
#removedchars { background-color:#ff9999; font-weight:bolder }
tr.alt #removed { background-color:#f7cccc }
#info { color:#888888 }
#context { background-color:#eeeeee }
td {padding-left:.3em; padding-right:.3em }
tr.head { border-bottom-width:1px; border-bottom-style:solid }
tr.head td { padding:0; padding-top:.2em }
.task { background-color:#ffff00 }
.comment { padding:4px; border:1px dashed #000000; background-color:#ffffdd }
.error { color:red }
hr { border-width:0px; height:2px; background:black }
-->
</style>
</head>
<body>
<pre class="comment">Sync to Wine-20050830:
Francois Gouget <fgouget@free.fr>
- Change some Dll* functions so they are exported by name like on
Windows.
Update the documentation accordingly.
Johan Dahlin <jdahlin@async.com.br>
- Implemented MsiSetComponentState*.
- Added stubs for MsiSetComponentStateA and MsiSetComponentStateW.
- Added a null check for component.
Alexandre Julliard <julliard@winehq.org>
- Don't prefix the functions DllCanUnloadNow, DllGetClassObject and
Dll(Un)RegisterServer with the dll name so that the compiler can check
the prototypes.
Vincent Beron <vberon@mecano.gme.usherb.ca>
- Correct mismatches between spec files and comments about export
number.
Aric Stewart <aric@codeweavers.com>
- Display the correct text string in the action text field for the
dialog boxes. Also the string should be deformatted.
- Make index INT not UINT because it can be -1.
- Fixed a memory overflow and leak identified by Mike McCormack.
- Add some body to ResolveSource because it is possible to need it when
an install is begun but the media is not in the drive, such as in
install-on-demand cases.
- The file name used in the ui messages is the target name not the
source name.
Yuri Kozlov <kozlov.y@gmail.com>
- Remove duplicate declaration of MSI_SetPropertyW.
Mike McCormack <mike@codeweavers.com>
- Handle loading strings over 64k from the string table.
- build a standard Wine list of folders instead of using an array
- use folder pointers instead of array indexes
- build a standard Wine list of files instead of using an array
- use file pointers instead of array indexes
- build a standard Wine list of features instead of using an array
- use feature pointers instead of array indexes
- build a standard Wine list of components instead of using an array
- use component pointers instead of array indexes
- Store the component information in a standard Wine list.
- Add include guard to header and make functions extern.
- build a standard Wine list of extensions instead of using an array
- use extension pointers instead of array indexes
- build a standard Wine list of appids instead of using an array
- use appid pointers instead of array indexes
- build a standard Wine list of mime types instead of using an array
- use mime type pointers instead of array indexes
- Add the allocated mime type to the mime type list.
- build a standard Wine list of classes instead of using an array
- use class pointers instead of array indexes
- Fix a small bug introduced when converting appids to a list.
- Implement MsiModifyView (MSIMODIFY_INSERT_TEMPORARY).
- Better stub for MsiViewGetError.
- Don't dereference variables in a trace.
- the combination of all table keys must be unique, not each key
- MsiViewExecute may not be called before MsiModifyView
- Make sure to save the result calculated in ACTION_UpdateInstallStates.
Steven Edwards <steven_ed4153@yahoo.com>
- Add real stub for MsiConfigureFeatureW.</pre><pre class="diff" id="context">Modified: trunk/reactos/lib/msi/action.c
Modified: trunk/reactos/lib/msi/action.h
Modified: trunk/reactos/lib/msi/classes.c
Modified: trunk/reactos/lib/msi/create.c
Modified: trunk/reactos/lib/msi/custom.c
Modified: trunk/reactos/lib/msi/delete.c
Modified: trunk/reactos/lib/msi/events.c
Modified: trunk/reactos/lib/msi/files.c
Modified: trunk/reactos/lib/msi/format.c
Modified: trunk/reactos/lib/msi/helpers.c
Modified: trunk/reactos/lib/msi/insert.c
Modified: trunk/reactos/lib/msi/install.c
Modified: trunk/reactos/lib/msi/msi.c
Modified: trunk/reactos/lib/msi/msi.spec
Modified: trunk/reactos/lib/msi/msipriv.h
Modified: trunk/reactos/lib/msi/msiquery.c
Modified: trunk/reactos/lib/msi/package.c
Modified: trunk/reactos/lib/msi/regsvr.c
Modified: trunk/reactos/lib/msi/select.c
Modified: trunk/reactos/lib/msi/table.c
Modified: trunk/reactos/w32api/include/msi.h
Modified: trunk/reactos/w32api/include/msiquery.h
</pre><hr /><div class="file">
<div class="fileheader"><big><b>Modified: trunk/reactos/lib/msi/action.c</b></big></div>
<pre class="diff"><small id="info">--- trunk/reactos/lib/msi/action.c        2005-09-05 21:19:23 UTC (rev 17671)
+++ trunk/reactos/lib/msi/action.c        2005-09-05 21:34:19 UTC (rev 17672)
@@ -379,6 +379,7 @@
</small></pre><pre class="diff" id="context"> WCHAR timet[0x100];
MSIRECORD * row = 0;
LPCWSTR ActionText;
</pre><pre class="diff" id="added">+ LPWSTR deformated;
</pre><pre class="diff" id="context">
GetTimeFormatW(LOCALE_USER_DEFAULT, 0, NULL, format, timet, 0x100);
@@ -387,8 +388,10 @@
</pre><pre class="diff" id="context"> return;
ActionText = MSI_RecordGetString(row,2);
</pre><pre class="diff" id="added">+ deformat_string(package, ActionText, &deformated);
</pre><pre class="diff" id="context">
</pre><pre class="diff" id="removed">- sprintfW(message,template_s,timet,action,<span id="removedchars">ActionText</span>);
</pre><pre class="diff" id="added">+ sprintfW(message,template_s,timet,action,<span id="addedchars">deformated</span>);
+ ce_actiontext(package, deformated);
</pre><pre class="diff" id="context"> msiobj_release(&row->hdr);
row = MSI_CreateRecord(1);
@@ -396,6 +399,7 @@
</pre><pre class="diff" id="context">
MSI_ProcessMessage(package, INSTALLMESSAGE_ACTIONSTART, row);
msiobj_release(&row->hdr);
</pre><pre class="diff" id="added">+ HeapFree(GetProcessHeap(),0,deformated);
</pre><pre class="diff" id="context"> }
static void ui_actioninfo(MSIPACKAGE *package, LPCWSTR action, BOOL start,
@@ -799,7 +803,6 @@
</pre><pre class="diff" id="context"> {
if (strcmpW(StandardActions[i].action, action)==0)
{
</pre><pre class="diff" id="removed">- ce_actiontext(package, action);
</pre><pre class="diff" id="context"> if (!run)
{
ui_actioninfo(package, action, TRUE, 0);
@@ -965,71 +968,80 @@
</pre><pre class="diff" id="context"> return rc;
}
</pre><pre class="diff" id="removed">-static <span id="removedchars">int load_component(MSIPACKAGE* package, MSIRECORD * row</span>)
</pre><pre class="diff" id="added">+static <span id="addedchars">MSICOMPONENT* load_component( MSIRECORD * row </span>)
</pre><pre class="diff" id="context"> {
</pre><pre class="diff" id="removed">- <span id="removedchars">int index = package->loaded_components</span>;
</pre><pre class="diff" id="added">+ <span id="addedchars">MSICOMPONENT *comp</span>;
</pre><pre class="diff" id="context"> DWORD sz;
</pre><pre class="diff" id="added">+ comp = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(MSICOMPONENT) );
+ if (!comp)
+ return comp;
+
</pre><pre class="diff" id="context"> /* fill in the data */
</pre><pre class="diff" id="removed">-
- package->loaded_components++;
- if (package->loaded_components == 1)
- package->components = HeapAlloc(GetProcessHeap(),0,
- sizeof(MSICOMPONENT));
- else
- package->components = HeapReAlloc(GetProcessHeap(),0,
- package->components, package->loaded_components *
- sizeof(MSICOMPONENT));
-
- memset(&package->components[index],0,sizeof(MSICOMPONENT));
-
</pre><pre class="diff" id="context"> sz = IDENTIFIER_SIZE;
</pre><pre class="diff" id="removed">- MSI_RecordGetStringW(row,1,<span id="removedchars">package->components[index].</span>Component,&sz);
</pre><pre class="diff" id="added">+ MSI_RecordGetStringW(row,1,<span id="addedchars">comp-></span>Component,&sz);
</pre><pre class="diff" id="context">
TRACE("Loading Component %s\n",
</pre><pre class="diff" id="removed">- debugstr_w(<span id="removedchars">package->components[index].</span>Component));
</pre><pre class="diff" id="added">+ debugstr_w(<span id="addedchars">comp-></span>Component));
</pre><pre class="diff" id="context">
sz = 0x100;
if (!MSI_RecordIsNull(row,2))
</pre><pre class="diff" id="removed">- MSI_RecordGetStringW(row,2,<span id="removedchars">package->components[index].</span>ComponentId,&sz);
</pre><pre class="diff" id="added">+ MSI_RecordGetStringW(row,2,<span id="addedchars">comp-></span>ComponentId,&sz);
</pre><pre class="diff" id="context">
sz = IDENTIFIER_SIZE;
</pre><pre class="diff" id="removed">- MSI_RecordGetStringW(row,3,<span id="removedchars">package->components[index].</span>Directory,&sz);
</pre><pre class="diff" id="added">+ MSI_RecordGetStringW(row,3,<span id="addedchars">comp-></span>Directory,&sz);
</pre><pre class="diff" id="context">
</pre><pre class="diff" id="removed">- <span id="removedchars">package->components[index].</span>Attributes = MSI_RecordGetInteger(row,4);
</pre><pre class="diff" id="added">+ <span id="addedchars">comp-></span>Attributes = MSI_RecordGetInteger(row,4);
</pre><pre class="diff" id="context">
sz = 0x100;
</pre><pre class="diff" id="removed">- MSI_RecordGetStringW(row,5,<span id="removedchars">package->components[index].</span>Condition,&sz);
</pre><pre class="diff" id="added">+ MSI_RecordGetStringW(row,5,<span id="addedchars">comp-></span>Condition,&sz);
</pre><pre class="diff" id="context">
sz = IDENTIFIER_SIZE;
</pre><pre class="diff" id="removed">- MSI_RecordGetStringW(row,6,<span id="removedchars">package->components[index].</span>KeyPath,&sz);
</pre><pre class="diff" id="added">+ MSI_RecordGetStringW(row,6,<span id="addedchars">comp-></span>KeyPath,&sz);
</pre><pre class="diff" id="context">
</pre><pre class="diff" id="removed">- package->components[index].Installed = INSTALLSTATE_ABSENT;
- package->components[index].Action = INSTALLSTATE_UNKNOWN;
- <span id="removedchars">package->components[index].ActionRequest = INSTALLSTATE_UNKNOWN</span>;
</pre><pre class="diff" id="added">+ <span id="addedchars">comp->Installed = INSTALLSTATE_ABSENT</span>;
+ comp->Action = INSTALLSTATE_UNKNOWN;
+ comp->ActionRequest = INSTALLSTATE_UNKNOWN;
</pre><pre class="diff" id="context">
</pre><pre class="diff" id="removed">- <span id="removedchars">package->components[index].</span>Enabled = TRUE;
</pre><pre class="diff" id="added">+ <span id="addedchars">comp-></span>Enabled = TRUE;
</pre><pre class="diff" id="context">
</pre><pre class="diff" id="removed">- return <span id="removedchars">index</span>;
</pre><pre class="diff" id="added">+ return <span id="addedchars">comp</span>;
</pre><pre class="diff" id="context"> }
typedef struct {
MSIPACKAGE *package;
</pre><pre class="diff" id="removed">- INT index;
- <span id="removedchars">INT cnt</span>;
</pre><pre class="diff" id="added">+ <span id="addedchars">MSIFEATURE *feature</span>;
</pre><pre class="diff" id="context"> } _ilfs;
</pre><pre class="diff" id="removed">-static UINT <span id="removedchars">iterate_component_check(MSIRECORD *row, LPVOID param</span>)
</pre><pre class="diff" id="added">+static UINT <span id="addedchars">add_feature_component( MSIFEATURE *feature, MSICOMPONENT *comp </span>)
</pre><pre class="diff" id="context"> {
</pre><pre class="diff" id="added">+ ComponentList *cl;
+
+ cl = HeapAlloc( GetProcessHeap(), 0, sizeof (*cl) );
+ if ( !cl )
+ return ERROR_NOT_ENOUGH_MEMORY;
+ cl->component = comp;
+ list_add_tail( &feature->Components, &cl->entry );
+
+ return ERROR_SUCCESS;
+}
+
+static UINT iterate_component_check( MSIRECORD *row, LPVOID param )
+{
</pre><pre class="diff" id="context"> _ilfs* ilfs= (_ilfs*)param;
</pre><pre class="diff" id="removed">- <span id="removedchars">INT c_indx</span>;
</pre><pre class="diff" id="added">+ <span id="addedchars">MSIPACKAGE *package = ilfs->package</span>;
+ MSIFEATURE *feature = ilfs->feature;
+ MSICOMPONENT *comp;
</pre><pre class="diff" id="context">
</pre><pre class="diff" id="removed">- c<span id="removedchars">_indx = load_component(ilfs->package,row</span>);
</pre><pre class="diff" id="added">+ c<span id="addedchars">omp = load_component( row </span>);
+ if (!comp)
+ return ERROR_FUNCTION_FAILED;
</pre><pre class="diff" id="context">
</pre><pre class="diff" id="removed">- ilfs->package->features[ilfs->index].Components[ilfs->cnt] = c_indx;
- ilfs->package->features[ilfs->index].ComponentCount ++;
- <span id="removedchars">TRACE("Loaded new component to index %i\n",c_indx</span>);
</pre><pre class="diff" id="added">+ <span id="addedchars">list_add_tail( &package->components, &comp->entry </span>);
+ add_feature_component( feature, comp );
</pre><pre class="diff" id="context">
</pre><pre class="diff" id="added">+ TRACE("Loaded new component %p\n", comp);
+
</pre><pre class="diff" id="context"> return ERROR_SUCCESS;
}
@@ -1038,8 +1050,7 @@
</pre><pre class="diff" id="context"> _ilfs* ilfs= (_ilfs*)param;
LPCWSTR component;
DWORD rc;
</pre><pre class="diff" id="removed">- INT c_indx;
- <span id="removedchars">INT cnt = ilfs->package->features[ilfs->index].ComponentCount</span>;
</pre><pre class="diff" id="added">+ <span id="addedchars">MSICOMPONENT *comp</span>;
</pre><pre class="diff" id="context"> MSIQUERY * view;
static const WCHAR Query[] =
{'S','E','L','E','C','T',' ','*',' ','F','R', 'O','M',' ',
@@ -1051,13 +1062,11 @@
</pre><pre class="diff" id="context"> component = MSI_RecordGetString(row,1);
/* check to see if the component is already loaded */
</pre><pre class="diff" id="removed">- c_indx = get_loaded_component(ilfs->package,component);
- <span id="removedchars">if (c_indx != -1)</span>
</pre><pre class="diff" id="added">+ <span id="addedchars">comp = get_loaded_component( ilfs->package, component );</span>
+ if (comp)
</pre><pre class="diff" id="context"> {
</pre><pre class="diff" id="removed">- TRACE("Component %s already loaded at %i\n", debugstr_w(component),
- c_indx);
- ilfs->package->features[ilfs->index].Components[cnt] = c_indx;
- <span id="removedchars">ilfs->package->features[ilfs->index].ComponentCount ++</span>;
</pre><pre class="diff" id="added">+ <span id="addedchars">TRACE("Component %s already loaded\n", debugstr_w(component) )</span>;
+ add_feature_component( ilfs->feature, comp );
</pre><pre class="diff" id="context"> return ERROR_SUCCESS;
}
@@ -1065,7 +1074,6 @@
</pre><pre class="diff" id="context"> if (rc != ERROR_SUCCESS)
return ERROR_SUCCESS;
</pre><pre class="diff" id="removed">- ilfs->cnt = cnt;
</pre><pre class="diff" id="context"> rc = MSI_IterateRecords(view, NULL, iterate_component_check, ilfs);
msiobj_release( &view->hdr );
@@ -1075,7 +1083,7 @@
</pre><pre class="diff" id="context"> static UINT load_feature(MSIRECORD * row, LPVOID param)
{
MSIPACKAGE* package = (MSIPACKAGE*)param;
</pre><pre class="diff" id="removed">- <span id="removedchars">int index = package->loaded_features</span>;
</pre><pre class="diff" id="added">+ <span id="addedchars">MSIFEATURE* feature</span>;
</pre><pre class="diff" id="context"> DWORD sz;
static const WCHAR Query1[] =
{'S','E','L','E','C','T',' ',
@@ -1088,59 +1096,57 @@
</pre><pre class="diff" id="context"> UINT rc;
_ilfs ilfs;
</pre><pre class="diff" id="removed">- ilfs.package = package;
- ilfs.index = index;
-
</pre><pre class="diff" id="context"> /* fill in the data */
</pre><pre class="diff" id="removed">- package->loaded_features ++;
- if (package->loaded_features == 1)
- package->features = HeapAlloc(GetProcessHeap(),0,sizeof(MSIFEATURE));
- else
- package->features = HeapReAlloc(GetProcessHeap(),0,package->features,
- <span id="removedchars"> package->loaded_features * sizeof(MSIFEATURE)</span>);
</pre><pre class="diff" id="added">+ <span id="addedchars">feature = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof (MSIFEATURE) </span>);
+ if (!feature)
+ return ERROR_NOT_ENOUGH_MEMORY;
</pre><pre class="diff" id="context">
</pre><pre class="diff" id="removed">- <span id="removedchars">memset(&package->features[index],0,sizeof(MSIFEATURE)</span>);
</pre><pre class="diff" id="added">+ <span id="addedchars">list_init( &feature->Components </span>);
</pre><pre class="diff" id="context">
sz = IDENTIFIER_SIZE;
</pre><pre class="diff" id="removed">- MSI_RecordGetStringW(row,1,<span id="removedchars">package->features[index].</span>Feature,&sz);
</pre><pre class="diff" id="added">+ MSI_RecordGetStringW(row,1,<span id="addedchars">feature-></span>Feature,&sz);
</pre><pre class="diff" id="context">
</pre><pre class="diff" id="removed">- TRACE("Loading feature %s\n",debugstr_w(<span id="removedchars">package->features[index].</span>Feature));
</pre><pre class="diff" id="added">+ TRACE("Loading feature %s\n",debugstr_w(<span id="addedchars">feature-></span>Feature));
</pre><pre class="diff" id="context">
sz = IDENTIFIER_SIZE;
if (!MSI_RecordIsNull(row,2))
</pre><pre class="diff" id="removed">- MSI_RecordGetStringW(row,2,<span id="removedchars">package->features[index].</span>Feature_Parent,&sz);
</pre><pre class="diff" id="added">+ MSI_RecordGetStringW(row,2,<span id="addedchars">feature-></span>Feature_Parent,&sz);
</pre><pre class="diff" id="context">
sz = 0x100;
</pre><pre class="diff" id="removed">- if (!MSI_RecordIsNull(row,3))
- <span id="removedchars"> MSI_RecordGetStringW(row,3,package->features[index].Title,&sz);</span>
</pre><pre class="diff" id="added">+ <span id="addedchars">if (!MSI_RecordIsNull(row,3))</span>
+ MSI_RecordGetStringW(row,3,feature->Title,&sz);
</pre><pre class="diff" id="context">
</pre><pre class="diff" id="removed">- sz = 0x100;
- if (!MSI_RecordIsNull(row,4))
- <span id="removedchars"> MSI_RecordGetStringW(row,4,package->features[index].Description,&sz)</span>;
</pre><pre class="diff" id="added">+ <span id="addedchars">sz = 0x100</span>;
+ if (!MSI_RecordIsNull(row,4))
+ MSI_RecordGetStringW(row,4,feature->Description,&sz);
</pre><pre class="diff" id="context">
if (!MSI_RecordIsNull(row,5))
</pre><pre class="diff" id="removed">- <span id="removedchars">package->features[index].</span>Display = MSI_RecordGetInteger(row,5);
</pre><pre class="diff" id="added">+ <span id="addedchars">feature-></span>Display = MSI_RecordGetInteger(row,5);
</pre><pre class="diff" id="context">
</pre><pre class="diff" id="removed">- <span id="removedchars">package->features[index].</span>Level= MSI_RecordGetInteger(row,6);
</pre><pre class="diff" id="added">+ <span id="addedchars">feature-></span>Level= MSI_RecordGetInteger(row,6);
</pre><pre class="diff" id="context">
</pre><pre class="diff" id="removed">- sz = IDENTIFIER_SIZE;
- if (!MSI_RecordIsNull(row,7))
- <span id="removedchars"> MSI_RecordGetStringW(row,7,package->features[index].Directory,&sz)</span>;
</pre><pre class="diff" id="added">+ <span id="addedchars">sz = IDENTIFIER_SIZE</span>;
+ if (!MSI_RecordIsNull(row,7))
+ MSI_RecordGetStringW(row,7,feature->Directory,&sz);
</pre><pre class="diff" id="context">
</pre><pre class="diff" id="removed">- <span id="removedchars">package->features[index].Attributes</span>= MSI_RecordGetInteger(row,8);
</pre><pre class="diff" id="added">+ <span id="addedchars">feature->Attributes </span>= MSI_RecordGetInteger(row,8);
</pre><pre class="diff" id="context">
</pre><pre class="diff" id="removed">- package->features[index].Installed = INSTALLSTATE_ABSENT;
- package->features[index].Action = INSTALLSTATE_UNKNOWN;
- <span id="removedchars">package->features[index].ActionRequest = INSTALLSTATE_UNKNOWN</span>;
</pre><pre class="diff" id="added">+ <span id="addedchars">feature->Installed = INSTALLSTATE_ABSENT</span>;
+ feature->Action = INSTALLSTATE_UNKNOWN;
+ feature->ActionRequest = INSTALLSTATE_UNKNOWN;
</pre><pre class="diff" id="context">
</pre><pre class="diff" id="added">+ list_add_tail( &package->features, &feature->entry );
+
</pre><pre class="diff" id="context"> /* load feature components */
</pre><pre class="diff" id="removed">- rc = MSI_OpenQuery(package->db, &view, Query1,
- <span id="removedchars"> package->features[index].Feature</span>);
</pre><pre class="diff" id="added">+ <span id="addedchars">rc = MSI_OpenQuery( package->db, &view, Query1, feature->Feature </span>);
</pre><pre class="diff" id="context"> if (rc != ERROR_SUCCESS)
return ERROR_SUCCESS;
</pre><pre class="diff" id="added">+ ilfs.package = package;
+ ilfs.feature = feature;
+
</pre><pre class="diff" id="context"> MSI_IterateRecords(view, NULL, iterate_load_featurecomponents , &ilfs);
msiobj_release(&view->hdr);
@@ -1150,45 +1156,41 @@
</pre><pre class="diff" id="context"> static UINT load_file(MSIRECORD *row, LPVOID param)
{
MSIPACKAGE* package = (MSIPACKAGE*)param;
</pre><pre class="diff" id="removed">- DWORD index = package->loaded_files;
</pre><pre class="diff" id="context"> LPCWSTR component;
</pre><pre class="diff" id="added">+ MSIFILE *file;
</pre><pre class="diff" id="context">
/* fill in the data */
</pre><pre class="diff" id="removed">- package->loaded_files++;
- if (package->loaded_files== 1)
- package->files = HeapAlloc(GetProcessHeap(),0,sizeof(MSIFILE));
- else
- package->files = HeapReAlloc(GetProcessHeap(),0,
- package->files , package->loaded_files * sizeof(MSIFILE));
-
- <span id="removedchars">memset(&package->files[index],0,sizeof(MSIFILE)</span>);
</pre><pre class="diff" id="added">+ <span id="addedchars">file = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof (MSIFILE) </span>);
+ if (!file)
+ return ERROR_NOT_ENOUGH_MEMORY;
</pre><pre class="diff" id="context">
</pre><pre class="diff" id="removed">- <span id="removedchars">package->files[index].File = load_dynamic_stringW(row, 1</span>);
</pre><pre class="diff" id="added">+ <span id="addedchars">file->File = load_dynamic_stringW( row, 1 </span>);
</pre><pre class="diff" id="context">
</pre><pre class="diff" id="removed">- component = MSI_RecordGetString(row, 2);
- package->files[index].ComponentIndex = get_loaded_component(package,
- <span id="removedchars"> component</span>);
</pre><pre class="diff" id="added">+ <span id="addedchars">component = MSI_RecordGetString( row, 2 </span>);
+ file->Component = get_loaded_component( package, component );
</pre><pre class="diff" id="context">
</pre><pre class="diff" id="removed">- if (<span id="removedchars">package->files[index].ComponentIndex == -1</span>)
</pre><pre class="diff" id="added">+ if (<span id="addedchars">!file->Component</span>)
</pre><pre class="diff" id="context"> ERR("Unfound Component %s\n",debugstr_w(component));
</pre><pre class="diff" id="removed">- package->files[index].FileName = load_dynamic_stringW(row,3);
- <span id="removedchars">reduce_to_longfilename(package->files[index].FileName</span>);
</pre><pre class="diff" id="added">+ <span id="addedchars">file->FileName = load_dynamic_stringW( row, 3 </span>);
+ reduce_to_longfilename( file->FileName );
</pre><pre class="diff" id="context">
</pre><pre class="diff" id="removed">- package->files[index].ShortName = load_dynamic_stringW(row,3);
- <span id="removedchars">reduce_to_shortfilename(package->files[index].ShortName</span>);
</pre><pre class="diff" id="added">+ <span id="addedchars">file->ShortName = load_dynamic_stringW( row, 3 </span>);
+ reduce_to_shortfilename( file->ShortName );
</pre><pre class="diff" id="context">
</pre><pre class="diff" id="removed">- package->files[index].FileSize = MSI_RecordGetInteger(row,4);
- package->files[index].Version = load_dynamic_stringW(row, 5);
- package->files[index].Language = load_dynamic_stringW(row, 6);
- package->files[index].Attributes= MSI_RecordGetInteger(row,7);
- <span id="removedchars">package->files[index].Sequence= MSI_RecordGetInteger(row,8</span>);
</pre><pre class="diff" id="added">+ <span id="addedchars">file->FileSize = MSI_RecordGetInteger( row, 4 </span>);
+ file->Version = load_dynamic_stringW( row, 5 );
+ file->Language = load_dynamic_stringW( row, 6 );
+ file->Attributes = MSI_RecordGetInteger( row, 7 );
+ file->Sequence = MSI_RecordGetInteger( row, 8 );
</pre><pre class="diff" id="context">
</pre><pre class="diff" id="removed">- package->files[index].Temporary = FALSE;
- <span id="removedchars">package->files[index].State = 0</span>;
</pre><pre class="diff" id="added">+ <span id="addedchars">file->Temporary = FALSE</span>;
+ file->State = 0;
</pre><pre class="diff" id="context">
</pre><pre class="diff" id="removed">- TRACE("File Loaded (%s)\n",debugstr_w(<span id="removedchars">package->files[index].</span>File));
</pre><pre class="diff" id="added">+ TRACE("File Loaded (%s)\n",debugstr_w(<span id="addedchars">file-></span>File));
+
+ list_add_tail( &package->files, &file->entry );
</pre><pre class="diff" id="context">
return ERROR_SUCCESS;
}
@@ -1292,7 +1294,7 @@
</pre><pre class="diff" id="context"> }
</pre><pre class="diff" id="removed">-static <span id="removedchars">INT load_folder(MSIPACKAGE *package, const WCHAR* dir</span>)
</pre><pre class="diff" id="added">+static <span id="addedchars">MSIFOLDER *load_folder( MSIPACKAGE *package, LPCWSTR dir </span>)
</pre><pre class="diff" id="context"> {
static const WCHAR Query[] =
{'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
@@ -1304,38 +1306,25 @@
</pre><pre class="diff" id="context"> LPCWSTR parent;
LPWSTR shortname = NULL;
MSIRECORD * row = 0;
</pre><pre class="diff" id="removed">- INT index = -1;
- <span id="removedchars">DWORD i</span>;
</pre><pre class="diff" id="added">+ <span id="addedchars">MSIFOLDER *folder</span>;
</pre><pre class="diff" id="context">
TRACE("Looking for dir %s\n",debugstr_w(dir));
</pre><pre class="diff" id="removed">- for (i = 0; i < package->loaded_folders; i++)
- {
- if (strcmpW(package->folders[i].Directory,dir)==0)
- {
- TRACE(" %s retuning on index %lu\n",debugstr_w(dir),i);
- return i;
- }
- <span id="removedchars">}</span>
</pre><pre class="diff" id="added">+ <span id="addedchars">folder = get_loaded_folder( package, dir );</span>
+ if (folder)
+ return folder;
</pre><pre class="diff" id="context">
TRACE("Working to load %s\n",debugstr_w(dir));
</pre><pre class="diff" id="removed">- index = package->loaded_folders++;
- if (package->loaded_folders==1)
- package->folders = HeapAlloc(GetProcessHeap(),0,
- sizeof(MSIFOLDER));
- else
- package->folders= HeapReAlloc(GetProcessHeap(),0,
- package->folders, package->loaded_folders*
- <span id="removedchars"> sizeof(MSIFOLDER)</span>);
</pre><pre class="diff" id="added">+ <span id="addedchars">folder = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof (MSIFOLDER) </span>);
+ if (!folder)
+ return NULL;
</pre><pre class="diff" id="context">
</pre><pre class="diff" id="removed">- <span id="removedchars">memset(&package->folders[index],0,sizeof(MSIFOLDER)</span>);
</pre><pre class="diff" id="added">+ <span id="addedchars">folder->Directory = strdupW(dir</span>);
</pre><pre class="diff" id="context">
</pre><pre class="diff" id="removed">- package->folders[index].Directory = strdupW(dir);
-
</pre><pre class="diff" id="context"> row = MSI_QueryGetRecord(package->db, Query, dir);
if (!row)
</pre><pre class="diff" id="removed">- return <span id="removedchars">-1</span>;
</pre><pre class="diff" id="added">+ return <span id="addedchars">NULL</span>;
</pre><pre class="diff" id="context">
ptargetdir = targetdir = load_dynamic_stringW(row,3);
@@ -1371,73 +1360,78 @@
</pre><pre class="diff" id="context"> if (targetdir)
{
TRACE(" TargetDefault = %s\n",debugstr_w(targetdir));
</pre><pre class="diff" id="removed">- HeapFree(GetProcessHeap(),0, package->folders[index].TargetDefault);
- <span id="removedchars">package->folders[index].TargetDefault = strdupW(targetdir</span>);
</pre><pre class="diff" id="added">+ <span id="addedchars">HeapFree(GetProcessHeap(),0, folder->TargetDefault</span>);
+ folder->TargetDefault = strdupW(targetdir);
</pre><pre class="diff" id="context"> }
if (srcdir)
</pre><pre class="diff" id="removed">- <span id="removedchars">package->folders[index].</span>SourceDefault = strdupW(srcdir);
</pre><pre class="diff" id="added">+ <span id="addedchars">folder-></span>SourceDefault = strdupW(srcdir);
</pre><pre class="diff" id="context"> else if (shortname)
</pre><pre class="diff" id="removed">- <span id="removedchars">package->folders[index].</span>SourceDefault = strdupW(shortname);
</pre><pre class="diff" id="added">+ <span id="addedchars">folder-></span>SourceDefault = strdupW(shortname);
</pre><pre class="diff" id="context"> else if (targetdir)
</pre><pre class="diff" id="removed">- <span id="removedchars">package->folders[index].</span>SourceDefault = strdupW(targetdir);
</pre><pre class="diff" id="added">+ <span id="addedchars">folder-></span>SourceDefault = strdupW(targetdir);
</pre><pre class="diff" id="context"> HeapFree(GetProcessHeap(), 0, ptargetdir);
</pre><pre class="diff" id="removed">- TRACE(" SourceDefault = %s\n",<span id="removedchars">debugstr_w(package->folders[index].SourceDefault</span>));
</pre><pre class="diff" id="added">+ TRACE(" SourceDefault = %s\n",<span id="addedchars"> debugstr_w( folder->SourceDefault </span>));
</pre><pre class="diff" id="context">
parent = MSI_RecordGetString(row,2);
if (parent)
{
</pre><pre class="diff" id="removed">- i = load_folder(package,parent);
- package->folders[index].ParentIndex = i;
- TRACE("Parent is index %i... %s %s\n",
- package->folders[index].ParentIndex,
- debugstr_w(package->folders[package->folders[index].ParentIndex].Directory),
- <span id="removedchars"> debugstr_w(parent)</span>);
</pre><pre class="diff" id="added">+ <span id="addedchars">folder->Parent = load_folder( package, parent </span>);
+ if ( folder->Parent )
+ TRACE("loaded parent %p %s\n", folder->Parent,
+ debugstr_w(folder->Parent->Directory));
+ else
+ ERR("failed to load parent folder %s\n", debugstr_w(parent));
</pre><pre class="diff" id="context"> }
</pre><pre class="diff" id="removed">- else
- package->folders[index].ParentIndex = -2;
</pre><pre class="diff" id="context">
</pre><pre class="diff" id="removed">- <span id="removedchars">package->folders[index].Property = load_dynamic_property(package, dir,NULL</span>);
</pre><pre class="diff" id="added">+ <span id="addedchars">folder->Property = load_dynamic_property( package, dir, NULL </span>);
</pre><pre class="diff" id="context">
msiobj_release(&row->hdr);
</pre><pre class="diff" id="removed">- TRACE(" %s retuning on index %i\n",debugstr_w(dir),index);
- return index;
</pre><pre class="diff" id="added">+
+ list_add_tail( &package->folders, &folder->entry );
+
+ TRACE("%s returning %p\n",debugstr_w(dir),folder);
+
+ return folder;
</pre><pre class="diff" id="context"> }
/* scan for and update current install states */
static void ACTION_UpdateInstallStates(MSIPACKAGE *package)
{
</pre><pre class="diff" id="removed">- <span id="removedchars">int i</span>;
</pre><pre class="diff" id="added">+ <span id="addedchars">MSICOMPONENT *comp</span>;
+ MSIFEATURE *feature;
</pre><pre class="diff" id="context">
</pre><pre class="diff" id="removed">- <span id="removedchars">for (i = 0; i < package->loaded_components; i++</span>)
</pre><pre class="diff" id="added">+ <span id="addedchars">LIST_FOR_EACH_ENTRY( comp, &package->components, MSICOMPONENT, entry </span>)
</pre><pre class="diff" id="context"> {
INSTALLSTATE res;
</pre><pre class="diff" id="removed">- res = MsiGetComponentPathW(package->ProductCode,
- <span id="removedchars"> package->components[i].ComponentId , NULL, NULL);</span>
</pre><pre class="diff" id="added">+ <span id="addedchars">res = MsiGetComponentPathW( package->ProductCode, </span>
+ comp->ComponentId, NULL, NULL);
</pre><pre class="diff" id="context"> if (res < 0)
res = INSTALLSTATE_ABSENT;
</pre><pre class="diff" id="removed">- <span id="removedchars">package->components[i].</span>Installed = res;
</pre><pre class="diff" id="added">+ <span id="addedchars">comp-></span>Installed = res;
</pre><pre class="diff" id="context"> }
</pre><pre class="diff" id="removed">- <span id="removedchars">for (i = 0; i < package->loaded_features; i++</span>)
</pre><pre class="diff" id="added">+ <span id="addedchars">LIST_FOR_EACH_ENTRY( feature, &package->features, MSIFEATURE, entry </span>)
</pre><pre class="diff" id="context"> {
</pre><pre class="diff" id="added">+ ComponentList *cl;
</pre><pre class="diff" id="context"> INSTALLSTATE res = -10;
</pre><pre class="diff" id="removed">- int j;
- for (j = 0; j < package->features[i].ComponentCount; j++)
</pre><pre class="diff" id="added">+
+ LIST_FOR_EACH_ENTRY( cl, &feature->Components, ComponentList, entry )
</pre><pre class="diff" id="context"> {
</pre><pre class="diff" id="removed">- MSICOMPONENT* component = &package->components[package->features[i].
- <span id="removedchars"> Components[j]]</span>;
</pre><pre class="diff" id="added">+ <span id="addedchars">comp= cl->component</span>;
+
</pre><pre class="diff" id="context"> if (res == -10)
</pre><pre class="diff" id="removed">- res = comp<span id="removedchars">onent</span>->Installed;
</pre><pre class="diff" id="added">+ res = comp->Installed;
</pre><pre class="diff" id="context"> else
{
</pre><pre class="diff" id="removed">- if (res == comp<span id="removedchars">onent</span>->Installed)
</pre><pre class="diff" id="added">+ if (res == comp->Installed)
</pre><pre class="diff" id="context"> continue;
</pre><pre class="diff" id="removed">- if (res != comp<span id="removedchars">onent</span>->Installed)
</pre><pre class="diff" id="added">+ if (res != comp->Installed)
</pre><pre class="diff" id="context"> res = INSTALLSTATE_INCOMPLETE;
}
}
</pre><pre class="diff" id="added">+ feature->Installed = res;
</pre><pre class="diff" id="context"> }
}
@@ -1446,19 +1440,19 @@
</pre><pre class="diff" id="context"> {
static const WCHAR all[]={'A','L','L',0};
LPWSTR override = NULL;
</pre><pre class="diff" id="removed">- INT i;
</pre><pre class="diff" id="context"> BOOL rc = FALSE;
</pre><pre class="diff" id="added">+ MSIFEATURE *feature;
</pre><pre class="diff" id="context">
override = load_dynamic_property(package, property, NULL);
if (override)
{
rc = TRUE;
</pre><pre class="diff" id="removed">- <span id="removedchars">for(i = 0; i < package->loaded_features; i++</span>)
</pre><pre class="diff" id="added">+ <span id="addedchars">LIST_FOR_EACH_ENTRY( feature, &package->features, MSIFEATURE, entry </span>)
</pre><pre class="diff" id="context"> {
if (strcmpiW(override,all)==0)
{
</pre><pre class="diff" id="removed">- package->features[i].ActionRequest= state;
- <span id="removedchars">package->features[i].Action </span>= state;
</pre><pre class="diff" id="added">+ <span id="addedchars">feature->ActionRequest</span>= state;
+ feature->Action = state;
</pre><pre class="diff" id="context"> }
else
{
@@ -1468,12 +1462,11 @@
</pre><pre class="diff" id="context"> while (ptr)
{
if ((ptr2 &&
</pre><pre class="diff" id="removed">- strncmpW(ptr,package->features[i].Feature, ptr2-ptr)==0)
- || (!ptr2 &&
- str<span id="removedchars">cmpW(ptr,package->features[i].Feature)==0)</span>)
</pre><pre class="diff" id="added">+ str<span id="addedchars">ncmpW(ptr,feature->Feature, ptr2-ptr)==0</span>)
+ || (!ptr2 && strcmpW(ptr,feature->Feature)==0))
</pre><pre class="diff" id="context"> {
</pre><pre class="diff" id="removed">- package->features[i].ActionRequest= state;
- <span id="removedchars">package->features[i].Action </span>= state;
</pre><pre class="diff" id="added">+ <span id="addedchars">feature->ActionRequest</span>= state;
+ feature->Action = state;
</pre><pre class="diff" id="context"> break;
}
if (ptr2)
@@ -1496,8 +1489,6 @@
</pre><pre class="diff" id="context"> {
LPWSTR level;
INT install_level;
</pre><pre class="diff" id="removed">- DWORD i;
- INT j;
</pre><pre class="diff" id="context"> static const WCHAR szlevel[] =
{'I','N','S','T','A','L','L','L','E','V','E','L',0};
static const WCHAR szAddLocal[] =
@@ -1505,7 +1496,10 @@
</pre><pre class="diff" id="context"> static const WCHAR szRemove[] =
{'R','E','M','O','V','E',0};
BOOL override = FALSE;
</pre><pre class="diff" id="added">+ MSICOMPONENT* component;
+ MSIFEATURE *feature;
</pre><pre class="diff" id="context">
</pre><pre class="diff" id="added">+
</pre><pre class="diff" id="context"> /* I do not know if this is where it should happen.. but */
TRACE("Checking Install Level\n");
@@ -1546,30 +1540,27 @@
</pre><pre class="diff" id="context">
if (!override)
{
</pre><pre class="diff" id="removed">- <span id="removedchars">for(i = 0; i < package->loaded_features; i++</span>)
</pre><pre class="diff" id="added">+ <span id="addedchars">LIST_FOR_EACH_ENTRY( feature, &package->features, MSIFEATURE, entry </span>)
</pre><pre class="diff" id="context"> {
</pre><pre class="diff" id="removed">- BOOL feature_state = ((package->features[i].Level > 0) &&
- <span id="removedchars"> (package->features[i].Level <= install_level));</span>
</pre><pre class="diff" id="added">+ <span id="addedchars">BOOL feature_state = ((feature->Level > 0) &&</span>
+ (feature->Level <= install_level));
</pre><pre class="diff" id="context">
</pre><pre class="diff" id="removed">- if ((feature_state) &&
- <span id="removedchars"> (package->features[i].</span>Action == INSTALLSTATE_UNKNOWN))
</pre><pre class="diff" id="added">+ <span id="addedchars">if ((feature_state) && (feature-></span>Action == INSTALLSTATE_UNKNOWN))
</pre><pre class="diff" id="context"> {
</pre><pre class="diff" id="removed">- if (package->features[i].Attributes &
- <span id="removedchars"> </span> msidbFeatureAttributesFavorSource)
</pre><pre class="diff" id="added">+ <span id="addedchars">if (feature->Attributes &</span> msidbFeatureAttributesFavorSource)
</pre><pre class="diff" id="context"> {
</pre><pre class="diff" id="removed">- package->features[i].ActionRequest = INSTALLSTATE_SOURCE;
- <span id="removedchars">package->features[i].Action</span> = INSTALLSTATE_SOURCE;
</pre><pre class="diff" id="added">+ <span id="addedchars">feature->ActionRequest</span> = INSTALLSTATE_SOURCE;
+ feature->Action = INSTALLSTATE_SOURCE;
</pre><pre class="diff" id="context"> }
</pre><pre class="diff" id="removed">- else if (package->features[i].Attributes &
- <span id="removedchars"> </span> msidbFeatureAttributesFavorAdvertise)
</pre><pre class="diff" id="added">+ <span id="addedchars">else if (feature->Attributes &</span> msidbFeatureAttributesFavorAdvertise)
</pre><pre class="diff" id="context"> {
</pre><pre class="diff" id="removed">- package->features[i].ActionRequest =INSTALLSTATE_ADVERTISED;
- <span id="removedchars">package->features[i].Action =</span>INSTALLSTATE_ADVERTISED;
</pre><pre class="diff" id="added">+ <span id="addedchars">feature->ActionRequest = </span>INSTALLSTATE_ADVERTISED;
+ feature->Action = INSTALLSTATE_ADVERTISED;
</pre><pre class="diff" id="context"> }
else
{
</pre><pre class="diff" id="removed">- package->features[i].ActionRequest = INSTALLSTATE_LOCAL;
- <span id="removedchars">package->features[i].Action</span> = INSTALLSTATE_LOCAL;
</pre><pre class="diff" id="added">+ <span id="addedchars">feature->ActionRequest</span> = INSTALLSTATE_LOCAL;
+ feature->Action = INSTALLSTATE_LOCAL;
</pre><pre class="diff" id="context"> }
}
}
@@ -1587,17 +1578,17 @@
</pre><pre class="diff" id="context"> * now we want to enable or disable components base on feature
*/
</pre><pre class="diff" id="removed">- <span id="removedchars">for(i = 0; i < package->loaded_features; i++</span>)
</pre><pre class="diff" id="added">+ <span id="addedchars">LIST_FOR_EACH_ENTRY( feature, &package->features, MSIFEATURE, entry </span>)
</pre><pre class="diff" id="context"> {
</pre><pre class="diff" id="removed">- <span id="removedchars">MSIFEATURE* feature = &package->features[i]</span>;
</pre><pre class="diff" id="added">+ <span id="addedchars">ComponentList *cl</span>;
+
</pre><pre class="diff" id="context"> TRACE("Examining Feature %s (Installed %i, Action %i, Request %i)\n",
debugstr_w(feature->Feature), feature->Installed, feature->Action,
feature->ActionRequest);
</pre><pre class="diff" id="removed">- <span id="removedchars">for( j = 0; j < feature->ComponentCount; j++</span>)
</pre><pre class="diff" id="added">+ <span id="addedchars">LIST_FOR_EACH_ENTRY( cl, &feature->Components, ComponentList, entry </span>)
</pre><pre class="diff" id="context"> {
</pre><pre class="diff" id="removed">- MSICOMPONENT* component = &package->components[
- <span id="removedchars"> feature->Components[j]]</span>;
</pre><pre class="diff" id="added">+ <span id="addedchars">component = cl->component</span>;
</pre><pre class="diff" id="context">
if (!component->Enabled)
{
@@ -1644,10 +1635,8 @@
</pre><pre class="diff" id="context"> }
}
</pre><pre class="diff" id="removed">- <span id="removedchars">for(i = 0; i < package->loaded_components; i++</span>)
</pre><pre class="diff" id="added">+ <span id="addedchars">LIST_FOR_EACH_ENTRY( component, &package->components, MSICOMPONENT, entry </span>)
</pre><pre class="diff" id="context"> {
</pre><pre class="diff" id="removed">- MSICOMPONENT* component= &package->components[i];
-
</pre><pre class="diff" id="context"> TRACE("Result: Component %s (Installed %i, Action %i, Request %i)\n",
debugstr_w(component->Component), component->Installed,
component->Action, component->ActionRequest);
@@ -1678,14 +1667,14 @@
</pre><pre class="diff" id="context"> static UINT ITERATE_CostFinalizeConditions(MSIRECORD *row, LPVOID param)
{
MSIPACKAGE *package = (MSIPACKAGE*)param;
</pre><pre class="diff" id="removed">- LPCWSTR Feature;
- <span id="removedchars">int feature_index</span>;
</pre><pre class="diff" id="added">+ <span id="addedchars">LPCWSTR name</span>;
+ MSIFEATURE *feature;
</pre><pre class="diff" id="context">
</pre><pre class="diff" id="removed">- <span id="removedchars">Feature = MSI_RecordGetString(row,1</span>);
</pre><pre class="diff" id="added">+ <span id="addedchars">name = MSI_RecordGetString( row, 1 </span>);
</pre><pre class="diff" id="context">
</pre><pre class="diff" id="removed">- feature_index = get_loaded_feature(package,Feature);
- if (feature_index < 0)
- <span id="removedchars"> ERR("FAILED to find loaded feature %s\n",debugstr_w(Feature)</span>);
</pre><pre class="diff" id="added">+ <span id="addedchars">feature = get_loaded_feature( package, name </span>);
+ if (!feature)
+ ERR("FAILED to find loaded feature %s\n",debugstr_w(name));
</pre><pre class="diff" id="context"> else
{
LPCWSTR Condition;
@@ -1694,9 +1683,8 @@
</pre><pre class="diff" id="context"> if (MSI_EvaluateConditionW(package,Condition) == MSICONDITION_TRUE)
{
int level = MSI_RecordGetInteger(row,2);
</pre><pre class="diff" id="removed">- TRACE("Reseting feature %s to level %i\n", debugstr_w(Feature),
- level);
- <span id="removedchars">package->features[feature_index].Level = level</span>;
</pre><pre class="diff" id="added">+ <span id="addedchars">TRACE("Reseting feature %s to level %i\n", debugstr_w(name), level)</span>;
+ feature->Level = level;
</pre><pre class="diff" id="context"> }
}
return ERROR_SUCCESS;
@@ -1722,9 +1710,10 @@
</pre><pre class="diff" id="context"> static const WCHAR szlevel[] =
{'I','N','S','T','A','L','L','L','E','V','E','L',0};
static const WCHAR szOne[] = { '1', 0 };
</pre><pre class="diff" id="added">+ MSICOMPONENT *comp;
+ MSIFILE *file;
</pre><pre class="diff" id="context"> UINT rc;
MSIQUERY * view;
</pre><pre class="diff" id="removed">- DWORD i;
</pre><pre class="diff" id="context"> LPWSTR level;
DWORD sz = 3;
WCHAR buffer[3];
@@ -1743,16 +1732,13 @@
</pre><pre class="diff" id="context"> msiobj_release(&view->hdr);
}
</pre><pre class="diff" id="removed">- TRACE("File calculations<span id="removedchars"> %i files\n",package->loaded_files</span>);
</pre><pre class="diff" id="added">+ TRACE("File calculations<span id="addedchars">\n"</span>);
</pre><pre class="diff" id="context">
</pre><pre class="diff" id="removed">- <span id="removedchars">for (i = 0; i < package->loaded_files; i++</span>)
</pre><pre class="diff" id="added">+ <span id="addedchars">LIST_FOR_EACH_ENTRY( file, &package->files, MSIFILE, entry </span>)
</pre><pre class="diff" id="context"> {
MSICOMPONENT* comp = NULL;
</pre><pre class="diff" id="removed">- MSIFILE* file= NULL;
</pre><pre class="diff" id="context">
</pre><pre class="diff" id="removed">- file = &package->files[i];
- if (file->ComponentIndex >= 0)
- <span id="removedchars"> comp = &package->components[file->ComponentIndex]</span>;
</pre><pre class="diff" id="added">+ <span id="addedchars">comp = file->Component</span>;
</pre><pre class="diff" id="context">
if (file->Temporary == TRUE)
continue;
@@ -1838,16 +1824,15 @@
</pre><pre class="diff" id="context"> }
TRACE("Enabling or Disabling Components\n");
</pre><pre class="diff" id="removed">- <span id="removedchars">for (i = 0; i < package->loaded_components; i++</span>)
</pre><pre class="diff" id="added">+ <span id="addedchars">LIST_FOR_EACH_ENTRY( comp, &package->components, MSICOMPONENT, entry </span>)
</pre><pre class="diff" id="context"> {
</pre><pre class="diff" id="removed">- if (<span id="removedchars">package->components[i].</span>Condition[0])
</pre><pre class="diff" id="added">+ if (<span id="addedchars">comp-></span>Condition[0])
</pre><pre class="diff" id="context"> {
if (MSI_EvaluateConditionW(package,
</pre><pre class="diff" id="removed">- <span id="removedchars">package->components[i].</span>Condition) == MSICONDITION_FALSE)
</pre><pre class="diff" id="added">+ <span id="addedchars">comp-></span>Condition) == MSICONDITION_FALSE)
</pre><pre class="diff" id="context"> {
</pre><pre class="diff" id="removed">- TRACE("Disabling component %s\n",
- debugstr_w(package->components[i].Component));
- <span id="removedchars">package->components[i].Enabled = FALSE</span>;
</pre><pre class="diff" id="added">+ <span id="addedchars">TRACE("Disabling component %s\n", debugstr_w(comp->Component))</span>;
+ comp->Enabled = FALSE;
</pre><pre class="diff" id="context"> }
}
}
@@ -1995,7 +1980,7 @@
</pre><pre class="diff" id="context"> DWORD type,size;
LPWSTR deformated;
LPCWSTR szRoot, component, name, key, value;
</pre><pre class="diff" id="removed">- <span id="removedchars">INT component_index</span>;
</pre><pre class="diff" id="added">+ <span id="addedchars">MSICOMPONENT *comp</span>;
</pre><pre class="diff" id="context"> MSIRECORD * uirow;
LPWSTR uikey;
INT root;
@@ -2010,21 +1995,21 @@
</pre><pre class="diff" id="context"> name = NULL;
component = MSI_RecordGetString(row, 6);
</pre><pre class="diff" id="removed">- comp<span id="removedchars">onent_index</span> = get_loaded_component(package,component);
</pre><pre class="diff" id="added">+ comp = get_loaded_component(package,component);
+ if (!comp)
+ return ERROR_SUCCESS;
</pre><pre class="diff" id="context">
</pre><pre class="diff" id="removed">- if (!ACTION_VerifyComponentForAction(package, component_index,
- <span id="removedchars"> </span> INSTALLSTATE_LOCAL))
</pre><pre class="diff" id="added">+ <span id="addedchars">if (!ACTION_VerifyComponentForAction(package, comp,</span> INSTALLSTATE_LOCAL))
</pre><pre class="diff" id="context"> {
TRACE("Skipping write due to disabled component %s\n",
debugstr_w(component));
</pre><pre class="diff" id="removed">- package->components[component_index].Action =
- <span id="removedchars"> package->components[component_index].</span>Installed;
</pre><pre class="diff" id="added">+ <span id="addedchars">comp->Action = comp-></span>Installed;
</pre><pre class="diff" id="context">
return ERROR_SUCCESS;
}
</pre><pre class="diff" id="removed">- <span id="removedchars">package->components[component_index].</span>Action = INSTALLSTATE_LOCAL;
</pre><pre class="diff" id="added">+ <span id="addedchars">comp-></span>Action = INSTALLSTATE_LOCAL;
</pre><pre class="diff" id="context">
name = MSI_RecordGetString(row, 4);
if( MSI_RecordIsNull(row,5) && name )
@@ -2192,6 +2177,7 @@
</pre><pre class="diff" id="context">
static UINT ACTION_InstallValidate(MSIPACKAGE *package)
{
</pre><pre class="diff" id="added">+ MSICOMPONENT *comp;
</pre><pre class="diff" id="context"> DWORD progress = 0;
DWORD total = 0;
static const WCHAR q1[]=
@@ -2200,7 +2186,8 @@
</pre><pre class="diff" id="context"> UINT rc;
MSIQUERY * view;
MSIRECORD * row = 0;
</pre><pre class="diff" id="removed">- <span id="removedchars">int i</span>;
</pre><pre class="diff" id="added">+ <span id="addedchars">MSIFEATURE *feature</span>;
+ MSIFILE *file;
</pre><pre class="diff" id="context">
TRACE(" InstallValidate \n");
@@ -2231,14 +2218,18 @@
</pre><pre class="diff" id="context"> msiobj_release(&view->hdr);
total = total + progress * REG_PROGRESS_VALUE;
</pre><pre class="diff" id="removed">- total = total + package->loaded_components * COMPONENT_PROGRESS_VALUE;
- for (i=0; i < package->loaded_files; i++)
- <span id="removedchars"> total += package->files[i].FileSize;</span>
</pre><pre class="diff" id="added">+ <span id="addedchars">LIST_FOR_EACH_ENTRY( comp, &package->components, MSICOMPONENT, entry )</span>
+ {
+ total += COMPONENT_PROGRESS_VALUE;
+ }
+ LIST_FOR_EACH_ENTRY( file, &package->files, MSIFILE, entry )
+ {
+ total += file->FileSize;
+ }
</pre><pre class="diff" id="context"> ui_progress(package,0,total,0,0);
</pre><pre class="diff" id="removed">- <span id="removedchars">for(i = 0; i < package->loaded_features; i++</span>)
</pre><pre class="diff" id="added">+ <span id="addedchars">LIST_FOR_EACH_ENTRY( feature, &package->features, MSIFEATURE, entry </span>)
</pre><pre class="diff" id="context"> {
</pre><pre class="diff" id="removed">- MSIFEATURE* feature = &package->features[i];
</pre><pre class="diff" id="context"> TRACE("Feature: %s; Installed: %i; Action %i; Request %i\n",
debugstr_w(feature->Feature), feature->Installed, feature->Action,
feature->ActionRequest);
@@ -2290,10 +2281,8 @@
</pre><pre class="diff" id="context"> return rc;
}
</pre><pre class="diff" id="removed">-static LPWSTR resolve_keypath( MSIPACKAGE* package, INT
-<span id="removedchars"> component_index</span>)
</pre><pre class="diff" id="added">+<span id="addedchars">static LPWSTR resolve_keypath( MSIPACKAGE* package, MSICOMPONENT *cmp </span>)
</pre><pre class="diff" id="context"> {
</pre><pre class="diff" id="removed">- MSICOMPONENT* cmp = &package->components[component_index];
</pre><pre class="diff" id="context">
if (cmp->KeyPath[0]==0)
{
@@ -2349,14 +2338,10 @@
</pre><pre class="diff" id="context"> }
else
{
</pre><pre class="diff" id="removed">- int j;
- <span id="removedchars">j = get_loaded_file(package,cmp->KeyPath</span>);
</pre><pre class="diff" id="added">+ <span id="addedchars">MSIFILE *file = get_loaded_file( package, cmp->KeyPath </span>);
</pre><pre class="diff" id="context">
</pre><pre class="diff" id="removed">- if (j>=0)
- {
- LPWSTR p = strdupW(package->files[j].TargetPath);
- return p;
- <span id="removedchars">}</span>
</pre><pre class="diff" id="added">+ <span id="addedchars">if (file)</span>
+ return strdupW( file->TargetPath );
</pre><pre class="diff" id="context"> }
return NULL;
}
@@ -2408,78 +2393,78 @@
</pre><pre class="diff" id="context"> /*
* Return TRUE if the count should be written out and FALSE if not
*/
</pre><pre class="diff" id="removed">-static void ACTION_RefCountComponent( MSIPACKAGE* package, <span id="removedchars">UINT index</span>)
</pre><pre class="diff" id="added">+static void ACTION_RefCountComponent( MSIPACKAGE* package, <span id="addedchars">MSICOMPONENT *comp </span>)
</pre><pre class="diff" id="context"> {
</pre><pre class="diff" id="added">+ MSIFEATURE *feature;
</pre><pre class="diff" id="context"> INT count = 0;
BOOL write = FALSE;
</pre><pre class="diff" id="removed">- INT j;
</pre><pre class="diff" id="context">
/* only refcount DLLs */
</pre><pre class="diff" id="removed">- if (package->components[index].KeyPath[0]==0 ||
- package->components[index].Attributes &
- msidbComponentAttributesRegistryKeyPath ||
- package->components[index].Attributes &
- <span id="removedchars"> msidbComponentAttributesODBCDataSource)</span>
</pre><pre class="diff" id="added">+ <span id="addedchars">if (comp->KeyPath[0]==0 || </span>
+ comp->Attributes & msidbComponentAttributesRegistryKeyPath ||
+ comp->Attributes & msidbComponentAttributesODBCDataSource)
</pre><pre class="diff" id="context"> write = FALSE;
else
{
</pre><pre class="diff" id="removed">- count = ACTION_GetSharedDLLsCount(package->components[index].
- <span id="removedchars"> </span>FullKeypath);
</pre><pre class="diff" id="added">+ <span id="addedchars">count = ACTION_GetSharedDLLsCount( comp-></span>FullKeypath);
</pre><pre class="diff" id="context"> write = (count > 0);
</pre><pre class="diff" id="removed">- if (package->components[index].Attributes &
- <span id="removedchars"> </span> msidbComponentAttributesSharedDllRefCount)
</pre><pre class="diff" id="added">+ <span id="addedchars">if (comp->Attributes &</span> msidbComponentAttributesSharedDllRefCount)
</pre><pre class="diff" id="context"> write = TRUE;
}
/* increment counts */
</pre><pre class="diff" id="removed">- <span id="removedchars">for (j = 0; j < package->loaded_features; j++</span>)
</pre><pre class="diff" id="added">+ <span id="addedchars">LIST_FOR_EACH_ENTRY( feature, &package->features, MSIFEATURE, entry </span>)
</pre><pre class="diff" id="context"> {
</pre><pre class="diff" id="removed">- <span id="removedchars">int i</span>;
</pre><pre class="diff" id="added">+ <span id="addedchars">ComponentList *cl</span>;
</pre><pre class="diff" id="context">
</pre><pre class="diff" id="removed">- if (!ACTION_VerifyFeatureForAction(<span id="removedchars">package,j,INSTALLSTATE_LOCAL</span>))
</pre><pre class="diff" id="added">+ if (!ACTION_VerifyFeatureForAction(<span id="addedchars"> feature, INSTALLSTATE_LOCAL </span>))
</pre><pre class="diff" id="context"> continue;
</pre><pre class="diff" id="removed">- <span id="removedchars">for (i = 0; i < package->features[j].ComponentCount; i++</span>)
</pre><pre class="diff" id="added">+ <span id="addedchars">LIST_FOR_EACH_ENTRY( cl, &feature->Components, ComponentList, entry </span>)
</pre><pre class="diff" id="context"> {
</pre><pre class="diff" id="removed">- if (<span id="removedchars">package->features[j].Components[i] == index</span>)
</pre><pre class="diff" id="added">+ if (<span id="addedchars"> cl->component == comp </span>)
</pre><pre class="diff" id="context"> count++;
}
}
</pre><pre class="diff" id="added">+
</pre><pre class="diff" id="context"> /* decrement counts */
</pre><pre class="diff" id="removed">- <span id="removedchars">for (j = 0; j < package->loaded_features; j++</span>)
</pre><pre class="diff" id="added">+ <span id="addedchars">LIST_FOR_EACH_ENTRY( feature, &package->features, MSIFEATURE, entry </span>)
</pre><pre class="diff" id="context"> {
</pre><pre class="diff" id="removed">- int i;
- <span id="removedchars">if (!ACTION_VerifyFeatureForAction(package,j,INSTALLSTATE_ABSENT))</span>
</pre><pre class="diff" id="added">+ <span id="addedchars">ComponentList *cl;</span>
+
+ if (!ACTION_VerifyFeatureForAction( feature, INSTALLSTATE_ABSENT ))
</pre><pre class="diff" id="context"> continue;
</pre><pre class="diff" id="removed">- <span id="removedchars">for (i = 0; i < package->features[j].ComponentCount; i++</span>)
</pre><pre class="diff" id="added">+ <span id="addedchars">LIST_FOR_EACH_ENTRY( cl, &feature->Components, ComponentList, entry </span>)
</pre><pre class="diff" id="context"> {
</pre><pre class="diff" id="removed">- if (<span id="removedchars">package->features[j].Components[i] == index</span>)
</pre><pre class="diff" id="added">+ if (<span id="addedchars"> cl->component == comp </span>)
</pre><pre class="diff" id="context"> count--;
}
}
/* ref count all the files in the component */
if (write)
</pre><pre class="diff" id="removed">- <span id="removedchars"> for (j = 0; j < package->loaded_files; j++)</span>
</pre><pre class="diff" id="added">+ <span id="addedchars">{</span>
+ MSIFILE *file;
+
+ LIST_FOR_EACH_ENTRY( file, &package->files, MSIFILE, entry )
</pre><pre class="diff" id="context"> {
</pre><pre class="diff" id="removed">- if (<span id="removedchars">package->files[j].</span>Temporary)
</pre><pre class="diff" id="added">+ if (<span id="addedchars">file-></span>Temporary)
</pre><pre class="diff" id="context"> continue;
</pre><pre class="diff" id="removed">- if (package->files[j].ComponentIndex == index)
- <span id="removedchars"> ACTION_WriteSharedDLLsCount(package->files[j].TargetPath,count);</span>
</pre><pre class="diff" id="added">+ <span id="addedchars">if (file->Component == comp)</span>
+ ACTION_WriteSharedDLLsCount( file->TargetPath, count );
</pre><pre class="diff" id="context"> }
</pre><pre class="diff" id="added">+ }
</pre><pre class="diff" id="context">
/* add a count for permenent */
</pre><pre class="diff" id="removed">- if (package->components[index].Attributes &
- <span id="removedchars"> </span> msidbComponentAttributesPermanent)
</pre><pre class="diff" id="added">+ <span id="addedchars">if (comp->Attributes &</span> msidbComponentAttributesPermanent)
</pre><pre class="diff" id="context"> count ++;
</pre><pre class="diff" id="removed">- <span id="removedchars">package->components[index].</span>RefCount = count;
</pre><pre class="diff" id="added">+ <span id="addedchars">comp-></span>RefCount = count;
</pre><pre class="diff" id="context">
if (write)
</pre><pre class="diff" id="removed">- ACTION_WriteSharedDLLsCount(package->components[index].FullKeypath,
- <span id="removedchars"> package->components[index].RefCount</span>);
</pre><pre class="diff" id="added">+ <span id="addedchars">ACTION_WriteSharedDLLsCount( comp->FullKeypath, comp->RefCount </span>);
</pre><pre class="diff" id="context"> }
/*
@@ -2494,7 +2479,7 @@
</pre><pre class="diff" id="context"> WCHAR squished_pc[GUID_SIZE];
WCHAR squished_cc[GUID_SIZE];
UINT rc;
</pre><pre class="diff" id="removed">- <span id="removedchars">DWORD i</span>;
</pre><pre class="diff" id="added">+ <span id="addedchars">MSICOMPONENT *comp</span>;
</pre><pre class="diff" id="context"> HKEY hkey=0,hkey2=0;
if (!package)
@@ -2508,32 +2493,33 @@
</pre><pre class="diff" id="context">
squash_guid(package->ProductCode,squished_pc);
ui_progress(package,1,COMPONENT_PROGRESS_VALUE,1,0);
</pre><pre class="diff" id="removed">- for (i = 0; i < package->loaded_components; i++)
</pre><pre class="diff" id="added">+
+ LIST_FOR_EACH_ENTRY( comp, &package->components, MSICOMPONENT, entry )
</pre><pre class="diff" id="context"> {
ui_progress(package,2,0,0,0);
</pre><pre class="diff" id="removed">- if (<span id="removedchars">package->components[i].</span>ComponentId[0]!=0)
</pre><pre class="diff" id="added">+ if (<span id="addedchars">comp-></span>ComponentId[0]!=0)
</pre><pre class="diff" id="context"> {
WCHAR *keypath = NULL;
MSIRECORD * uirow;
</pre><pre class="diff" id="removed">- squash_guid(<span id="removedchars">package->components[i].</span>ComponentId,squished_cc);
</pre><pre class="diff" id="added">+ squash_guid(<span id="addedchars">comp-></span>ComponentId,squished_cc);
</pre><pre class="diff" id="context">
</pre><pre class="diff" id="removed">- keypath = resolve_keypath(package,i);
- <span id="removedchars">package->components[i].FullKeypath = keypath</span>;
</pre><pre class="diff" id="added">+ <span id="addedchars">keypath = resolve_keypath( package, comp )</span>;
+ comp->FullKeypath = keypath;
</pre><pre class="diff" id="context">
/* do the refcounting */
</pre><pre class="diff" id="removed">- ACTION_RefCountComponent( package, <span id="removedchars">i</span>);
</pre><pre class="diff" id="added">+ ACTION_RefCountComponent( package, <span id="addedchars">comp </span>);
</pre>
<strong class="error">[truncated at 1000 lines; 4574 more skipped]</strong>
</div>
</body>
</html>