<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 &lt;fgouget@free.fr&gt;
- Change some Dll* functions so they are exported by name like on
 &nbsp;Windows.
 &nbsp;Update the documentation accordingly.
Johan Dahlin &lt;jdahlin@async.com.br&gt;
- Implemented MsiSetComponentState*.
- Added stubs for MsiSetComponentStateA and MsiSetComponentStateW.
- Added a null check for component.
Alexandre Julliard &lt;julliard@winehq.org&gt;
- Don't prefix the functions DllCanUnloadNow, DllGetClassObject and
 &nbsp;Dll(Un)RegisterServer with the dll name so that the compiler can check
 &nbsp;the prototypes.
Vincent Beron &lt;vberon@mecano.gme.usherb.ca&gt;
- Correct mismatches between spec files and comments about export
 &nbsp;number.
Aric Stewart &lt;aric@codeweavers.com&gt;
- Display the correct text string in the action text field for the
 &nbsp;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
 &nbsp;an install is begun but the media is not in the drive, such as in
 &nbsp;install-on-demand cases.
- The file name used in the ui messages is the target name not the
 &nbsp;source name.
Yuri Kozlov &lt;kozlov.y@gmail.com&gt;
- Remove duplicate declaration of MSI_SetPropertyW.
Mike McCormack &lt;mike@codeweavers.com&gt;
- 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 &lt;steven_ed4153@yahoo.com&gt;
- 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"> &nbsp; &nbsp; WCHAR timet[0x100];
 &nbsp; &nbsp; MSIRECORD * row = 0;
 &nbsp; &nbsp; LPCWSTR ActionText;
</pre><pre class="diff" id="added">+ &nbsp; &nbsp;LPWSTR deformated;
</pre><pre class="diff" id="context"> 
 &nbsp; &nbsp; GetTimeFormatW(LOCALE_USER_DEFAULT, 0, NULL, format, timet, 0x100);
 
@@ -387,8 +388,10 @@
</pre><pre class="diff" id="context"> &nbsp; &nbsp; &nbsp; &nbsp; return;
 
 &nbsp; &nbsp; ActionText = MSI_RecordGetString(row,2);
</pre><pre class="diff" id="added">+ &nbsp; &nbsp;deformat_string(package, ActionText, &amp;deformated);
</pre><pre class="diff" id="context"> 
</pre><pre class="diff" id="removed">- &nbsp; &nbsp;sprintfW(message,template_s,timet,action,<span id="removedchars">ActionText</span>);
</pre><pre class="diff" id="added">+ &nbsp; &nbsp;sprintfW(message,template_s,timet,action,<span id="addedchars">deformated</span>);
+ &nbsp; &nbsp;ce_actiontext(package, deformated);
</pre><pre class="diff" id="context"> &nbsp; &nbsp; msiobj_release(&amp;row-&gt;hdr);
 
 &nbsp; &nbsp; row = MSI_CreateRecord(1);
@@ -396,6 +399,7 @@
</pre><pre class="diff" id="context"> &nbsp;
 &nbsp; &nbsp; MSI_ProcessMessage(package, INSTALLMESSAGE_ACTIONSTART, row);
 &nbsp; &nbsp; msiobj_release(&amp;row-&gt;hdr);
</pre><pre class="diff" id="added">+ &nbsp; &nbsp;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"> &nbsp; &nbsp; {
 &nbsp; &nbsp; &nbsp; &nbsp; if (strcmpW(StandardActions[i].action, action)==0)
 &nbsp; &nbsp; &nbsp; &nbsp; {
</pre><pre class="diff" id="removed">- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ce_actiontext(package, action);
</pre><pre class="diff" id="context"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (!run)
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ui_actioninfo(package, action, TRUE, 0);
@@ -965,71 +968,80 @@
</pre><pre class="diff" id="context"> &nbsp; &nbsp; 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">- &nbsp; &nbsp;<span id="removedchars">int index = package-&gt;loaded_components</span>;
</pre><pre class="diff" id="added">+ &nbsp; &nbsp;<span id="addedchars">MSICOMPONENT *comp</span>;
</pre><pre class="diff" id="context"> &nbsp; &nbsp; DWORD sz;
 
</pre><pre class="diff" id="added">+ &nbsp; &nbsp;comp = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(MSICOMPONENT) );
+ &nbsp; &nbsp;if (!comp)
+ &nbsp; &nbsp; &nbsp; &nbsp;return comp;
+
</pre><pre class="diff" id="context"> &nbsp; &nbsp; /* fill in the data */
</pre><pre class="diff" id="removed">-
- &nbsp; &nbsp;package-&gt;loaded_components++;
- &nbsp; &nbsp;if (package-&gt;loaded_components == 1)
- &nbsp; &nbsp; &nbsp; &nbsp;package-&gt;components = HeapAlloc(GetProcessHeap(),0,
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;sizeof(MSICOMPONENT));
- &nbsp; &nbsp;else
- &nbsp; &nbsp; &nbsp; &nbsp;package-&gt;components = HeapReAlloc(GetProcessHeap(),0,
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;package-&gt;components, package-&gt;loaded_components * 
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;sizeof(MSICOMPONENT));
-
- &nbsp; &nbsp;memset(&amp;package-&gt;components[index],0,sizeof(MSICOMPONENT));
-
</pre><pre class="diff" id="context"> &nbsp; &nbsp; sz = IDENTIFIER_SIZE; &nbsp; &nbsp; &nbsp; 
</pre><pre class="diff" id="removed">- &nbsp; &nbsp;MSI_RecordGetStringW(row,1,<span id="removedchars">package-&gt;components[index].</span>Component,&amp;sz);
</pre><pre class="diff" id="added">+ &nbsp; &nbsp;MSI_RecordGetStringW(row,1,<span id="addedchars">comp-&gt;</span>Component,&amp;sz);
</pre><pre class="diff" id="context"> 
 &nbsp; &nbsp; TRACE(&quot;Loading Component %s\n&quot;,
</pre><pre class="diff" id="removed">- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; debugstr_w(<span id="removedchars">package-&gt;components[index].</span>Component));
</pre><pre class="diff" id="added">+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; debugstr_w(<span id="addedchars">comp-&gt;</span>Component));
</pre><pre class="diff" id="context"> 
 &nbsp; &nbsp; sz = 0x100;
 &nbsp; &nbsp; if (!MSI_RecordIsNull(row,2))
</pre><pre class="diff" id="removed">- &nbsp; &nbsp; &nbsp; &nbsp;MSI_RecordGetStringW(row,2,<span id="removedchars">package-&gt;components[index].</span>ComponentId,&amp;sz);
</pre><pre class="diff" id="added">+ &nbsp; &nbsp; &nbsp; &nbsp;MSI_RecordGetStringW(row,2,<span id="addedchars">comp-&gt;</span>ComponentId,&amp;sz);
</pre><pre class="diff" id="context"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
 &nbsp; &nbsp; sz = IDENTIFIER_SIZE; &nbsp; &nbsp; &nbsp; 
</pre><pre class="diff" id="removed">- &nbsp; &nbsp;MSI_RecordGetStringW(row,3,<span id="removedchars">package-&gt;components[index].</span>Directory,&amp;sz);
</pre><pre class="diff" id="added">+ &nbsp; &nbsp;MSI_RecordGetStringW(row,3,<span id="addedchars">comp-&gt;</span>Directory,&amp;sz);
</pre><pre class="diff" id="context"> 
</pre><pre class="diff" id="removed">- &nbsp; &nbsp;<span id="removedchars">package-&gt;components[index].</span>Attributes = MSI_RecordGetInteger(row,4);
</pre><pre class="diff" id="added">+ &nbsp; &nbsp;<span id="addedchars">comp-&gt;</span>Attributes = MSI_RecordGetInteger(row,4);
</pre><pre class="diff" id="context"> 
 &nbsp; &nbsp; sz = 0x100; &nbsp; &nbsp; &nbsp; 
</pre><pre class="diff" id="removed">- &nbsp; &nbsp;MSI_RecordGetStringW(row,5,<span id="removedchars">package-&gt;components[index].</span>Condition,&amp;sz);
</pre><pre class="diff" id="added">+ &nbsp; &nbsp;MSI_RecordGetStringW(row,5,<span id="addedchars">comp-&gt;</span>Condition,&amp;sz);
</pre><pre class="diff" id="context"> 
 &nbsp; &nbsp; sz = IDENTIFIER_SIZE; &nbsp; &nbsp; &nbsp; 
</pre><pre class="diff" id="removed">- &nbsp; &nbsp;MSI_RecordGetStringW(row,6,<span id="removedchars">package-&gt;components[index].</span>KeyPath,&amp;sz);
</pre><pre class="diff" id="added">+ &nbsp; &nbsp;MSI_RecordGetStringW(row,6,<span id="addedchars">comp-&gt;</span>KeyPath,&amp;sz);
</pre><pre class="diff" id="context"> 
</pre><pre class="diff" id="removed">- &nbsp; &nbsp;package-&gt;components[index].Installed = INSTALLSTATE_ABSENT;
- &nbsp; &nbsp;package-&gt;components[index].Action = INSTALLSTATE_UNKNOWN;
- &nbsp; &nbsp;<span id="removedchars">package-&gt;components[index].ActionRequest = INSTALLSTATE_UNKNOWN</span>;
</pre><pre class="diff" id="added">+ &nbsp; &nbsp;<span id="addedchars">comp-&gt;Installed = INSTALLSTATE_ABSENT</span>;
+ &nbsp; &nbsp;comp-&gt;Action = INSTALLSTATE_UNKNOWN;
+ &nbsp; &nbsp;comp-&gt;ActionRequest = INSTALLSTATE_UNKNOWN;
</pre><pre class="diff" id="context"> 
</pre><pre class="diff" id="removed">- &nbsp; &nbsp;<span id="removedchars">package-&gt;components[index].</span>Enabled = TRUE;
</pre><pre class="diff" id="added">+ &nbsp; &nbsp;<span id="addedchars">comp-&gt;</span>Enabled = TRUE;
</pre><pre class="diff" id="context"> 
</pre><pre class="diff" id="removed">- &nbsp; &nbsp;return <span id="removedchars">index</span>;
</pre><pre class="diff" id="added">+ &nbsp; &nbsp;return <span id="addedchars">comp</span>;
</pre><pre class="diff" id="context"> }
 
 typedef struct {
 &nbsp; &nbsp; MSIPACKAGE *package;
</pre><pre class="diff" id="removed">- &nbsp; &nbsp;INT index;
- &nbsp; &nbsp;<span id="removedchars">INT cnt</span>;
</pre><pre class="diff" id="added">+ &nbsp; &nbsp;<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">+ &nbsp; &nbsp;ComponentList *cl;
+
+ &nbsp; &nbsp;cl = HeapAlloc( GetProcessHeap(), 0, sizeof (*cl) );
+ &nbsp; &nbsp;if ( !cl )
+ &nbsp; &nbsp; &nbsp; &nbsp;return ERROR_NOT_ENOUGH_MEMORY;
+ &nbsp; &nbsp;cl-&gt;component = comp;
+ &nbsp; &nbsp;list_add_tail( &amp;feature-&gt;Components, &amp;cl-&gt;entry );
+
+ &nbsp; &nbsp;return ERROR_SUCCESS;
+}
+
+static UINT iterate_component_check( MSIRECORD *row, LPVOID param )
+{
</pre><pre class="diff" id="context"> &nbsp; &nbsp; _ilfs* ilfs= (_ilfs*)param;
</pre><pre class="diff" id="removed">- &nbsp; &nbsp;<span id="removedchars">INT c_indx</span>;
</pre><pre class="diff" id="added">+ &nbsp; &nbsp;<span id="addedchars">MSIPACKAGE *package = ilfs-&gt;package</span>;
+ &nbsp; &nbsp;MSIFEATURE *feature = ilfs-&gt;feature;
+ &nbsp; &nbsp;MSICOMPONENT *comp;
</pre><pre class="diff" id="context"> 
</pre><pre class="diff" id="removed">- &nbsp; &nbsp;c<span id="removedchars">_indx = load_component(ilfs-&gt;package,row</span>);
</pre><pre class="diff" id="added">+ &nbsp; &nbsp;c<span id="addedchars">omp = load_component( row </span>);
+ &nbsp; &nbsp;if (!comp)
+ &nbsp; &nbsp; &nbsp; &nbsp;return ERROR_FUNCTION_FAILED;
</pre><pre class="diff" id="context"> 
</pre><pre class="diff" id="removed">- &nbsp; &nbsp;ilfs-&gt;package-&gt;features[ilfs-&gt;index].Components[ilfs-&gt;cnt] = c_indx;
- &nbsp; &nbsp;ilfs-&gt;package-&gt;features[ilfs-&gt;index].ComponentCount ++;
- &nbsp; &nbsp;<span id="removedchars">TRACE(&quot;Loaded new component to index %i\n&quot;,c_indx</span>);
</pre><pre class="diff" id="added">+ &nbsp; &nbsp;<span id="addedchars">list_add_tail( &amp;package-&gt;components, &amp;comp-&gt;entry </span>);
+ &nbsp; &nbsp;add_feature_component( feature, comp );
</pre><pre class="diff" id="context"> 
</pre><pre class="diff" id="added">+ &nbsp; &nbsp;TRACE(&quot;Loaded new component %p\n&quot;, comp);
+
</pre><pre class="diff" id="context"> &nbsp; &nbsp; return ERROR_SUCCESS;
 }
 
@@ -1038,8 +1050,7 @@
</pre><pre class="diff" id="context"> &nbsp; &nbsp; _ilfs* ilfs= (_ilfs*)param;
 &nbsp; &nbsp; LPCWSTR component;
 &nbsp; &nbsp; DWORD rc;
</pre><pre class="diff" id="removed">- &nbsp; &nbsp;INT c_indx;
- &nbsp; &nbsp;<span id="removedchars">INT cnt = ilfs-&gt;package-&gt;features[ilfs-&gt;index].ComponentCount</span>;
</pre><pre class="diff" id="added">+ &nbsp; &nbsp;<span id="addedchars">MSICOMPONENT *comp</span>;
</pre><pre class="diff" id="context"> &nbsp; &nbsp; MSIQUERY * view;
 &nbsp; &nbsp; static const WCHAR Query[] = 
 &nbsp; &nbsp; &nbsp; &nbsp; {'S','E','L','E','C','T',' ','*',' ','F','R', 'O','M',' ', 
@@ -1051,13 +1062,11 @@
</pre><pre class="diff" id="context"> &nbsp; &nbsp; component = MSI_RecordGetString(row,1);
 
 &nbsp; &nbsp; /* check to see if the component is already loaded */
</pre><pre class="diff" id="removed">- &nbsp; &nbsp;c_indx = get_loaded_component(ilfs-&gt;package,component);
- &nbsp; &nbsp;<span id="removedchars">if (c_indx != -1)</span>
</pre><pre class="diff" id="added">+ &nbsp; &nbsp;<span id="addedchars">comp = get_loaded_component( ilfs-&gt;package, component );</span>
+ &nbsp; &nbsp;if (comp)
</pre><pre class="diff" id="context"> &nbsp; &nbsp; {
</pre><pre class="diff" id="removed">- &nbsp; &nbsp; &nbsp; &nbsp;TRACE(&quot;Component %s already loaded at %i\n&quot;, debugstr_w(component),
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;c_indx);
- &nbsp; &nbsp; &nbsp; &nbsp;ilfs-&gt;package-&gt;features[ilfs-&gt;index].Components[cnt] = c_indx;
- &nbsp; &nbsp; &nbsp; &nbsp;<span id="removedchars">ilfs-&gt;package-&gt;features[ilfs-&gt;index].ComponentCount ++</span>;
</pre><pre class="diff" id="added">+ &nbsp; &nbsp; &nbsp; &nbsp;<span id="addedchars">TRACE(&quot;Component %s already loaded\n&quot;, debugstr_w(component) )</span>;
+ &nbsp; &nbsp; &nbsp; &nbsp;add_feature_component( ilfs-&gt;feature, comp );
</pre><pre class="diff" id="context"> &nbsp; &nbsp; &nbsp; &nbsp; return ERROR_SUCCESS;
 &nbsp; &nbsp; }
 
@@ -1065,7 +1074,6 @@
</pre><pre class="diff" id="context"> &nbsp; &nbsp; if (rc != ERROR_SUCCESS)
 &nbsp; &nbsp; &nbsp; &nbsp; return ERROR_SUCCESS;
 
</pre><pre class="diff" id="removed">- &nbsp; &nbsp;ilfs-&gt;cnt = cnt;
</pre><pre class="diff" id="context"> &nbsp; &nbsp; rc = MSI_IterateRecords(view, NULL, iterate_component_check, ilfs);
 &nbsp; &nbsp; msiobj_release( &amp;view-&gt;hdr );
 
@@ -1075,7 +1083,7 @@
</pre><pre class="diff" id="context"> static UINT load_feature(MSIRECORD * row, LPVOID param)
 {
 &nbsp; &nbsp; MSIPACKAGE* package = (MSIPACKAGE*)param;
</pre><pre class="diff" id="removed">- &nbsp; &nbsp;<span id="removedchars">int index = package-&gt;loaded_features</span>;
</pre><pre class="diff" id="added">+ &nbsp; &nbsp;<span id="addedchars">MSIFEATURE* feature</span>;
</pre><pre class="diff" id="context"> &nbsp; &nbsp; DWORD sz;
 &nbsp; &nbsp; static const WCHAR Query1[] = 
 &nbsp; &nbsp; &nbsp; &nbsp; {'S','E','L','E','C','T',' ',
@@ -1088,59 +1096,57 @@
</pre><pre class="diff" id="context"> &nbsp; &nbsp; UINT &nbsp; &nbsp;rc;
 &nbsp; &nbsp; _ilfs ilfs;
 
</pre><pre class="diff" id="removed">- &nbsp; &nbsp;ilfs.package = package;
- &nbsp; &nbsp;ilfs.index = index;
-
</pre><pre class="diff" id="context"> &nbsp; &nbsp; /* fill in the data */
 
</pre><pre class="diff" id="removed">- &nbsp; &nbsp;package-&gt;loaded_features ++;
- &nbsp; &nbsp;if (package-&gt;loaded_features == 1)
- &nbsp; &nbsp; &nbsp; &nbsp;package-&gt;features = HeapAlloc(GetProcessHeap(),0,sizeof(MSIFEATURE));
- &nbsp; &nbsp;else
- &nbsp; &nbsp; &nbsp; &nbsp;package-&gt;features = HeapReAlloc(GetProcessHeap(),0,package-&gt;features,
- &nbsp; &nbsp;<span id="removedchars"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;package-&gt;loaded_features * sizeof(MSIFEATURE)</span>);
</pre><pre class="diff" id="added">+ &nbsp; &nbsp;<span id="addedchars">feature = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof (MSIFEATURE) </span>);
+ &nbsp; &nbsp;if (!feature)
+ &nbsp; &nbsp; &nbsp; &nbsp;return ERROR_NOT_ENOUGH_MEMORY;
</pre><pre class="diff" id="context"> 
</pre><pre class="diff" id="removed">- &nbsp; &nbsp;<span id="removedchars">memset(&amp;package-&gt;features[index],0,sizeof(MSIFEATURE)</span>);
</pre><pre class="diff" id="added">+ &nbsp; &nbsp;<span id="addedchars">list_init( &amp;feature-&gt;Components </span>);
</pre><pre class="diff" id="context"> &nbsp; &nbsp; 
 &nbsp; &nbsp; sz = IDENTIFIER_SIZE; &nbsp; &nbsp; &nbsp; 
</pre><pre class="diff" id="removed">- &nbsp; &nbsp;MSI_RecordGetStringW(row,1,<span id="removedchars">package-&gt;features[index].</span>Feature,&amp;sz);
</pre><pre class="diff" id="added">+ &nbsp; &nbsp;MSI_RecordGetStringW(row,1,<span id="addedchars">feature-&gt;</span>Feature,&amp;sz);
</pre><pre class="diff" id="context"> 
</pre><pre class="diff" id="removed">- &nbsp; &nbsp;TRACE(&quot;Loading feature %s\n&quot;,debugstr_w(<span id="removedchars">package-&gt;features[index].</span>Feature));
</pre><pre class="diff" id="added">+ &nbsp; &nbsp;TRACE(&quot;Loading feature %s\n&quot;,debugstr_w(<span id="addedchars">feature-&gt;</span>Feature));
</pre><pre class="diff" id="context"> 
 &nbsp; &nbsp; sz = IDENTIFIER_SIZE;
 &nbsp; &nbsp; if (!MSI_RecordIsNull(row,2))
</pre><pre class="diff" id="removed">- &nbsp; &nbsp; &nbsp; &nbsp;MSI_RecordGetStringW(row,2,<span id="removedchars">package-&gt;features[index].</span>Feature_Parent,&amp;sz);
</pre><pre class="diff" id="added">+ &nbsp; &nbsp; &nbsp; &nbsp;MSI_RecordGetStringW(row,2,<span id="addedchars">feature-&gt;</span>Feature_Parent,&amp;sz);
</pre><pre class="diff" id="context"> 
 &nbsp; &nbsp; sz = 0x100;
</pre><pre class="diff" id="removed">- &nbsp; &nbsp; if (!MSI_RecordIsNull(row,3))
- &nbsp; &nbsp;<span id="removedchars"> &nbsp; &nbsp;MSI_RecordGetStringW(row,3,package-&gt;features[index].Title,&amp;sz);</span>
</pre><pre class="diff" id="added">+ &nbsp; &nbsp;<span id="addedchars">if (!MSI_RecordIsNull(row,3))</span>
+ &nbsp; &nbsp; &nbsp; &nbsp;MSI_RecordGetStringW(row,3,feature-&gt;Title,&amp;sz);
</pre><pre class="diff" id="context"> 
</pre><pre class="diff" id="removed">- &nbsp; &nbsp; sz = 0x100;
- &nbsp; &nbsp; if (!MSI_RecordIsNull(row,4))
- &nbsp; &nbsp;<span id="removedchars"> &nbsp; &nbsp;MSI_RecordGetStringW(row,4,package-&gt;features[index].Description,&amp;sz)</span>;
</pre><pre class="diff" id="added">+ &nbsp; &nbsp;<span id="addedchars">sz = 0x100</span>;
+ &nbsp; &nbsp;if (!MSI_RecordIsNull(row,4))
+ &nbsp; &nbsp; &nbsp; &nbsp;MSI_RecordGetStringW(row,4,feature-&gt;Description,&amp;sz);
</pre><pre class="diff" id="context"> 
 &nbsp; &nbsp; if (!MSI_RecordIsNull(row,5))
</pre><pre class="diff" id="removed">- &nbsp; &nbsp; &nbsp; &nbsp;<span id="removedchars">package-&gt;features[index].</span>Display = MSI_RecordGetInteger(row,5);
</pre><pre class="diff" id="added">+ &nbsp; &nbsp; &nbsp; &nbsp;<span id="addedchars">feature-&gt;</span>Display = MSI_RecordGetInteger(row,5);
</pre><pre class="diff" id="context"> &nbsp; 
</pre><pre class="diff" id="removed">- &nbsp; &nbsp;<span id="removedchars">package-&gt;features[index].</span>Level= MSI_RecordGetInteger(row,6);
</pre><pre class="diff" id="added">+ &nbsp; &nbsp;<span id="addedchars">feature-&gt;</span>Level= MSI_RecordGetInteger(row,6);
</pre><pre class="diff" id="context"> 
</pre><pre class="diff" id="removed">- &nbsp; &nbsp; sz = IDENTIFIER_SIZE;
- &nbsp; &nbsp; if (!MSI_RecordIsNull(row,7))
- &nbsp; &nbsp;<span id="removedchars"> &nbsp; &nbsp;MSI_RecordGetStringW(row,7,package-&gt;features[index].Directory,&amp;sz)</span>;
</pre><pre class="diff" id="added">+ &nbsp; &nbsp;<span id="addedchars">sz = IDENTIFIER_SIZE</span>;
+ &nbsp; &nbsp;if (!MSI_RecordIsNull(row,7))
+ &nbsp; &nbsp; &nbsp; &nbsp;MSI_RecordGetStringW(row,7,feature-&gt;Directory,&amp;sz);
</pre><pre class="diff" id="context"> 
</pre><pre class="diff" id="removed">- &nbsp; &nbsp;<span id="removedchars">package-&gt;features[index].Attributes</span>= MSI_RecordGetInteger(row,8);
</pre><pre class="diff" id="added">+ &nbsp; &nbsp;<span id="addedchars">feature-&gt;Attributes </span>= MSI_RecordGetInteger(row,8);
</pre><pre class="diff" id="context"> 
</pre><pre class="diff" id="removed">- &nbsp; &nbsp;package-&gt;features[index].Installed = INSTALLSTATE_ABSENT;
- &nbsp; &nbsp;package-&gt;features[index].Action = INSTALLSTATE_UNKNOWN;
- &nbsp; &nbsp;<span id="removedchars">package-&gt;features[index].ActionRequest = INSTALLSTATE_UNKNOWN</span>;
</pre><pre class="diff" id="added">+ &nbsp; &nbsp;<span id="addedchars">feature-&gt;Installed = INSTALLSTATE_ABSENT</span>;
+ &nbsp; &nbsp;feature-&gt;Action = INSTALLSTATE_UNKNOWN;
+ &nbsp; &nbsp;feature-&gt;ActionRequest = INSTALLSTATE_UNKNOWN;
</pre><pre class="diff" id="context"> 
</pre><pre class="diff" id="added">+ &nbsp; &nbsp;list_add_tail( &amp;package-&gt;features, &amp;feature-&gt;entry );
+
</pre><pre class="diff" id="context"> &nbsp; &nbsp; /* load feature components */
 
</pre><pre class="diff" id="removed">- &nbsp; &nbsp;rc = MSI_OpenQuery(package-&gt;db, &amp;view, Query1, 
- &nbsp; &nbsp;<span id="removedchars"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;package-&gt;features[index].Feature</span>);
</pre><pre class="diff" id="added">+ &nbsp; &nbsp;<span id="addedchars">rc = MSI_OpenQuery( package-&gt;db, &amp;view, Query1, feature-&gt;Feature </span>);
</pre><pre class="diff" id="context"> &nbsp; &nbsp; if (rc != ERROR_SUCCESS)
 &nbsp; &nbsp; &nbsp; &nbsp; return ERROR_SUCCESS;
 
</pre><pre class="diff" id="added">+ &nbsp; &nbsp;ilfs.package = package;
+ &nbsp; &nbsp;ilfs.feature = feature;
+
</pre><pre class="diff" id="context"> &nbsp; &nbsp; MSI_IterateRecords(view, NULL, iterate_load_featurecomponents , &amp;ilfs);
 &nbsp; &nbsp; msiobj_release(&amp;view-&gt;hdr);
 
@@ -1150,45 +1156,41 @@
</pre><pre class="diff" id="context"> static UINT load_file(MSIRECORD *row, LPVOID param)
 {
 &nbsp; &nbsp; MSIPACKAGE* package = (MSIPACKAGE*)param;
</pre><pre class="diff" id="removed">- &nbsp; &nbsp;DWORD index = package-&gt;loaded_files;
</pre><pre class="diff" id="context"> &nbsp; &nbsp; LPCWSTR component;
</pre><pre class="diff" id="added">+ &nbsp; &nbsp;MSIFILE *file;
</pre><pre class="diff" id="context"> 
 &nbsp; &nbsp; /* fill in the data */
 
</pre><pre class="diff" id="removed">- &nbsp; &nbsp;package-&gt;loaded_files++;
- &nbsp; &nbsp;if (package-&gt;loaded_files== 1)
- &nbsp; &nbsp; &nbsp; &nbsp;package-&gt;files = HeapAlloc(GetProcessHeap(),0,sizeof(MSIFILE));
- &nbsp; &nbsp;else
- &nbsp; &nbsp; &nbsp; &nbsp;package-&gt;files = HeapReAlloc(GetProcessHeap(),0,
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;package-&gt;files , package-&gt;loaded_files * sizeof(MSIFILE));
-
- &nbsp; &nbsp;<span id="removedchars">memset(&amp;package-&gt;files[index],0,sizeof(MSIFILE)</span>);
</pre><pre class="diff" id="added">+ &nbsp; &nbsp;<span id="addedchars">file = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof (MSIFILE) </span>);
+ &nbsp; &nbsp;if (!file)
+ &nbsp; &nbsp; &nbsp; &nbsp;return ERROR_NOT_ENOUGH_MEMORY;
</pre><pre class="diff" id="context"> &nbsp;
</pre><pre class="diff" id="removed">- &nbsp; &nbsp;<span id="removedchars">package-&gt;files[index].File = load_dynamic_stringW(row, 1</span>);
</pre><pre class="diff" id="added">+ &nbsp; &nbsp;<span id="addedchars">file-&gt;File = load_dynamic_stringW( row, 1 </span>);
</pre><pre class="diff" id="context"> 
</pre><pre class="diff" id="removed">- &nbsp; &nbsp;component = MSI_RecordGetString(row, 2);
- &nbsp; &nbsp;package-&gt;files[index].ComponentIndex = get_loaded_component(package,
- &nbsp; &nbsp;<span id="removedchars"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;component</span>);
</pre><pre class="diff" id="added">+ &nbsp; &nbsp;<span id="addedchars">component = MSI_RecordGetString( row, 2 </span>);
+ &nbsp; &nbsp;file-&gt;Component = get_loaded_component( package, component );
</pre><pre class="diff" id="context"> 
</pre><pre class="diff" id="removed">- &nbsp; &nbsp;if (<span id="removedchars">package-&gt;files[index].ComponentIndex == -1</span>)
</pre><pre class="diff" id="added">+ &nbsp; &nbsp;if (<span id="addedchars">!file-&gt;Component</span>)
</pre><pre class="diff" id="context"> &nbsp; &nbsp; &nbsp; &nbsp; ERR(&quot;Unfound Component %s\n&quot;,debugstr_w(component));
 
</pre><pre class="diff" id="removed">- &nbsp; &nbsp;package-&gt;files[index].FileName = load_dynamic_stringW(row,3);
- &nbsp; &nbsp;<span id="removedchars">reduce_to_longfilename(package-&gt;files[index].FileName</span>);
</pre><pre class="diff" id="added">+ &nbsp; &nbsp;<span id="addedchars">file-&gt;FileName = load_dynamic_stringW( row, 3 </span>);
+ &nbsp; &nbsp;reduce_to_longfilename( file-&gt;FileName );
</pre><pre class="diff" id="context"> 
</pre><pre class="diff" id="removed">- &nbsp; &nbsp;package-&gt;files[index].ShortName = load_dynamic_stringW(row,3);
- &nbsp; &nbsp;<span id="removedchars">reduce_to_shortfilename(package-&gt;files[index].ShortName</span>);
</pre><pre class="diff" id="added">+ &nbsp; &nbsp;<span id="addedchars">file-&gt;ShortName = load_dynamic_stringW( row, 3 </span>);
+ &nbsp; &nbsp;reduce_to_shortfilename( file-&gt;ShortName );
</pre><pre class="diff" id="context"> &nbsp; &nbsp; 
</pre><pre class="diff" id="removed">- &nbsp; &nbsp;package-&gt;files[index].FileSize = MSI_RecordGetInteger(row,4);
- &nbsp; &nbsp;package-&gt;files[index].Version = load_dynamic_stringW(row, 5);
- &nbsp; &nbsp;package-&gt;files[index].Language = load_dynamic_stringW(row, 6);
- &nbsp; &nbsp;package-&gt;files[index].Attributes= MSI_RecordGetInteger(row,7);
- &nbsp; &nbsp;<span id="removedchars">package-&gt;files[index].Sequence= MSI_RecordGetInteger(row,8</span>);
</pre><pre class="diff" id="added">+ &nbsp; &nbsp;<span id="addedchars">file-&gt;FileSize = MSI_RecordGetInteger( row, 4 </span>);
+ &nbsp; &nbsp;file-&gt;Version = load_dynamic_stringW( row, 5 );
+ &nbsp; &nbsp;file-&gt;Language = load_dynamic_stringW( row, 6 );
+ &nbsp; &nbsp;file-&gt;Attributes = MSI_RecordGetInteger( row, 7 );
+ &nbsp; &nbsp;file-&gt;Sequence = MSI_RecordGetInteger( row, 8 );
</pre><pre class="diff" id="context"> 
</pre><pre class="diff" id="removed">- &nbsp; &nbsp;package-&gt;files[index].Temporary = FALSE;
- &nbsp; &nbsp;<span id="removedchars">package-&gt;files[index].State = 0</span>;
</pre><pre class="diff" id="added">+ &nbsp; &nbsp;<span id="addedchars">file-&gt;Temporary = FALSE</span>;
+ &nbsp; &nbsp;file-&gt;State = 0;
</pre><pre class="diff" id="context"> 
</pre><pre class="diff" id="removed">- &nbsp; &nbsp;TRACE(&quot;File Loaded (%s)\n&quot;,debugstr_w(<span id="removedchars">package-&gt;files[index].</span>File)); &nbsp;
</pre><pre class="diff" id="added">+ &nbsp; &nbsp;TRACE(&quot;File Loaded (%s)\n&quot;,debugstr_w(<span id="addedchars">file-&gt;</span>File)); &nbsp;
+
+ &nbsp; &nbsp;list_add_tail( &amp;package-&gt;files, &amp;file-&gt;entry );
</pre><pre class="diff" id="context"> &nbsp;
 &nbsp; &nbsp; 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"> {
 &nbsp; &nbsp; static const WCHAR Query[] =
 &nbsp; &nbsp; &nbsp; &nbsp; {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
@@ -1304,38 +1306,25 @@
</pre><pre class="diff" id="context"> &nbsp; &nbsp; LPCWSTR parent;
 &nbsp; &nbsp; LPWSTR shortname = NULL;
 &nbsp; &nbsp; MSIRECORD * row = 0;
</pre><pre class="diff" id="removed">- &nbsp; &nbsp;INT index = -1;
- &nbsp; &nbsp;<span id="removedchars">DWORD i</span>;
</pre><pre class="diff" id="added">+ &nbsp; &nbsp;<span id="addedchars">MSIFOLDER *folder</span>;
</pre><pre class="diff" id="context"> 
 &nbsp; &nbsp; TRACE(&quot;Looking for dir %s\n&quot;,debugstr_w(dir));
 
</pre><pre class="diff" id="removed">- &nbsp; &nbsp;for (i = 0; i &lt; package-&gt;loaded_folders; i++)
- &nbsp; &nbsp;{
- &nbsp; &nbsp; &nbsp; &nbsp;if (strcmpW(package-&gt;folders[i].Directory,dir)==0)
- &nbsp; &nbsp; &nbsp; &nbsp;{
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;TRACE(&quot; %s retuning on index %lu\n&quot;,debugstr_w(dir),i);
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;return i;
- &nbsp; &nbsp; &nbsp; &nbsp;}
- &nbsp; &nbsp;<span id="removedchars">}</span>
</pre><pre class="diff" id="added">+ &nbsp; &nbsp;<span id="addedchars">folder = get_loaded_folder( package, dir );</span>
+ &nbsp; &nbsp;if (folder)
+ &nbsp; &nbsp; &nbsp; &nbsp;return folder;
</pre><pre class="diff" id="context"> 
 &nbsp; &nbsp; TRACE(&quot;Working to load %s\n&quot;,debugstr_w(dir));
 
</pre><pre class="diff" id="removed">- &nbsp; &nbsp;index = package-&gt;loaded_folders++;
- &nbsp; &nbsp;if (package-&gt;loaded_folders==1)
- &nbsp; &nbsp; &nbsp; &nbsp;package-&gt;folders = HeapAlloc(GetProcessHeap(),0,
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;sizeof(MSIFOLDER));
- &nbsp; &nbsp;else
- &nbsp; &nbsp; &nbsp; &nbsp;package-&gt;folders= HeapReAlloc(GetProcessHeap(),0,
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;package-&gt;folders, package-&gt;loaded_folders* 
- &nbsp; &nbsp;<span id="removedchars"> &nbsp; &nbsp; &nbsp; &nbsp;sizeof(MSIFOLDER)</span>);
</pre><pre class="diff" id="added">+ &nbsp; &nbsp;<span id="addedchars">folder = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof (MSIFOLDER) </span>);
+ &nbsp; &nbsp;if (!folder)
+ &nbsp; &nbsp; &nbsp; &nbsp;return NULL;
</pre><pre class="diff" id="context"> 
</pre><pre class="diff" id="removed">- &nbsp; &nbsp;<span id="removedchars">memset(&amp;package-&gt;folders[index],0,sizeof(MSIFOLDER)</span>);
</pre><pre class="diff" id="added">+ &nbsp; &nbsp;<span id="addedchars">folder-&gt;Directory = strdupW(dir</span>);
</pre><pre class="diff" id="context"> 
</pre><pre class="diff" id="removed">- &nbsp; &nbsp;package-&gt;folders[index].Directory = strdupW(dir);
-
</pre><pre class="diff" id="context"> &nbsp; &nbsp; row = MSI_QueryGetRecord(package-&gt;db, Query, dir);
 &nbsp; &nbsp; if (!row)
</pre><pre class="diff" id="removed">- &nbsp; &nbsp; &nbsp; &nbsp;return <span id="removedchars">-1</span>;
</pre><pre class="diff" id="added">+ &nbsp; &nbsp; &nbsp; &nbsp;return <span id="addedchars">NULL</span>;
</pre><pre class="diff" id="context"> 
 &nbsp; &nbsp; ptargetdir = targetdir = load_dynamic_stringW(row,3);
 
@@ -1371,73 +1360,78 @@
</pre><pre class="diff" id="context"> &nbsp; &nbsp; if (targetdir)
 &nbsp; &nbsp; {
 &nbsp; &nbsp; &nbsp; &nbsp; TRACE(&quot; &nbsp; TargetDefault = %s\n&quot;,debugstr_w(targetdir));
</pre><pre class="diff" id="removed">- &nbsp; &nbsp; &nbsp; &nbsp;HeapFree(GetProcessHeap(),0, package-&gt;folders[index].TargetDefault);
- &nbsp; &nbsp; &nbsp; &nbsp;<span id="removedchars">package-&gt;folders[index].TargetDefault = strdupW(targetdir</span>);
</pre><pre class="diff" id="added">+ &nbsp; &nbsp; &nbsp; &nbsp;<span id="addedchars">HeapFree(GetProcessHeap(),0, folder-&gt;TargetDefault</span>);
+ &nbsp; &nbsp; &nbsp; &nbsp;folder-&gt;TargetDefault = strdupW(targetdir);
</pre><pre class="diff" id="context"> &nbsp; &nbsp; }
 
 &nbsp; &nbsp; if (srcdir)
</pre><pre class="diff" id="removed">- &nbsp; &nbsp; &nbsp; &nbsp;<span id="removedchars">package-&gt;folders[index].</span>SourceDefault = strdupW(srcdir);
</pre><pre class="diff" id="added">+ &nbsp; &nbsp; &nbsp; &nbsp;<span id="addedchars">folder-&gt;</span>SourceDefault = strdupW(srcdir);
</pre><pre class="diff" id="context"> &nbsp; &nbsp; else if (shortname)
</pre><pre class="diff" id="removed">- &nbsp; &nbsp; &nbsp; &nbsp;<span id="removedchars">package-&gt;folders[index].</span>SourceDefault = strdupW(shortname);
</pre><pre class="diff" id="added">+ &nbsp; &nbsp; &nbsp; &nbsp;<span id="addedchars">folder-&gt;</span>SourceDefault = strdupW(shortname);
</pre><pre class="diff" id="context"> &nbsp; &nbsp; else if (targetdir)
</pre><pre class="diff" id="removed">- &nbsp; &nbsp; &nbsp; &nbsp;<span id="removedchars">package-&gt;folders[index].</span>SourceDefault = strdupW(targetdir);
</pre><pre class="diff" id="added">+ &nbsp; &nbsp; &nbsp; &nbsp;<span id="addedchars">folder-&gt;</span>SourceDefault = strdupW(targetdir);
</pre><pre class="diff" id="context"> &nbsp; &nbsp; HeapFree(GetProcessHeap(), 0, ptargetdir);
</pre><pre class="diff" id="removed">- &nbsp; &nbsp; &nbsp; &nbsp;TRACE(&quot; &nbsp; SourceDefault = %s\n&quot;,<span id="removedchars">debugstr_w(package-&gt;folders[index].SourceDefault</span>));
</pre><pre class="diff" id="added">+ &nbsp; &nbsp; &nbsp; &nbsp;TRACE(&quot; &nbsp; SourceDefault = %s\n&quot;,<span id="addedchars"> debugstr_w( folder-&gt;SourceDefault </span>));
</pre><pre class="diff" id="context"> 
 &nbsp; &nbsp; parent = MSI_RecordGetString(row,2);
 &nbsp; &nbsp; if (parent) 
 &nbsp; &nbsp; {
</pre><pre class="diff" id="removed">- &nbsp; &nbsp; &nbsp; &nbsp;i = load_folder(package,parent);
- &nbsp; &nbsp; &nbsp; &nbsp;package-&gt;folders[index].ParentIndex = i;
- &nbsp; &nbsp; &nbsp; &nbsp;TRACE(&quot;Parent is index %i... %s %s\n&quot;,
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;package-&gt;folders[index].ParentIndex,
- &nbsp; &nbsp; &nbsp; &nbsp;debugstr_w(package-&gt;folders[package-&gt;folders[index].ParentIndex].Directory),
- &nbsp; &nbsp; &nbsp; &nbsp;<span id="removedchars"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;debugstr_w(parent)</span>);
</pre><pre class="diff" id="added">+ &nbsp; &nbsp; &nbsp; &nbsp;<span id="addedchars">folder-&gt;Parent = load_folder( package, parent </span>);
+ &nbsp; &nbsp; &nbsp; &nbsp;if ( folder-&gt;Parent )
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;TRACE(&quot;loaded parent %p %s\n&quot;, folder-&gt;Parent,
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;debugstr_w(folder-&gt;Parent-&gt;Directory));
+ &nbsp; &nbsp; &nbsp; &nbsp;else
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ERR(&quot;failed to load parent folder %s\n&quot;, debugstr_w(parent));
</pre><pre class="diff" id="context"> &nbsp; &nbsp; }
</pre><pre class="diff" id="removed">- &nbsp; &nbsp;else
- &nbsp; &nbsp; &nbsp; &nbsp;package-&gt;folders[index].ParentIndex = -2;
</pre><pre class="diff" id="context"> 
</pre><pre class="diff" id="removed">- &nbsp; &nbsp;<span id="removedchars">package-&gt;folders[index].Property = load_dynamic_property(package, dir,NULL</span>);
</pre><pre class="diff" id="added">+ &nbsp; &nbsp;<span id="addedchars">folder-&gt;Property = load_dynamic_property( package, dir, NULL </span>);
</pre><pre class="diff" id="context"> 
 &nbsp; &nbsp; msiobj_release(&amp;row-&gt;hdr);
</pre><pre class="diff" id="removed">- &nbsp; &nbsp;TRACE(&quot; %s retuning on index %i\n&quot;,debugstr_w(dir),index);
- &nbsp; &nbsp;return index;
</pre><pre class="diff" id="added">+
+ &nbsp; &nbsp;list_add_tail( &amp;package-&gt;folders, &amp;folder-&gt;entry );
+
+ &nbsp; &nbsp;TRACE(&quot;%s returning %p\n&quot;,debugstr_w(dir),folder);
+
+ &nbsp; &nbsp;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">- &nbsp; &nbsp;<span id="removedchars">int i</span>;
</pre><pre class="diff" id="added">+ &nbsp; &nbsp;<span id="addedchars">MSICOMPONENT *comp</span>;
+ &nbsp; &nbsp;MSIFEATURE *feature;
</pre><pre class="diff" id="context"> 
</pre><pre class="diff" id="removed">- &nbsp; &nbsp;<span id="removedchars">for (i = 0; i &lt; package-&gt;loaded_components; i++</span>)
</pre><pre class="diff" id="added">+ &nbsp; &nbsp;<span id="addedchars">LIST_FOR_EACH_ENTRY( comp, &amp;package-&gt;components, MSICOMPONENT, entry </span>)
</pre><pre class="diff" id="context"> &nbsp; &nbsp; {
 &nbsp; &nbsp; &nbsp; &nbsp; INSTALLSTATE res;
</pre><pre class="diff" id="removed">- &nbsp; &nbsp; &nbsp; &nbsp;res = MsiGetComponentPathW(package-&gt;ProductCode, 
- &nbsp; &nbsp; &nbsp; &nbsp;<span id="removedchars"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;package-&gt;components[i].ComponentId , NULL, NULL);</span>
</pre><pre class="diff" id="added">+ &nbsp; &nbsp; &nbsp; &nbsp;<span id="addedchars">res = MsiGetComponentPathW( package-&gt;ProductCode, </span>
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;comp-&gt;ComponentId, NULL, NULL);
</pre><pre class="diff" id="context"> &nbsp; &nbsp; &nbsp; &nbsp; if (res &lt; 0)
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; res = INSTALLSTATE_ABSENT;
</pre><pre class="diff" id="removed">- &nbsp; &nbsp; &nbsp; &nbsp;<span id="removedchars">package-&gt;components[i].</span>Installed = res;
</pre><pre class="diff" id="added">+ &nbsp; &nbsp; &nbsp; &nbsp;<span id="addedchars">comp-&gt;</span>Installed = res;
</pre><pre class="diff" id="context"> &nbsp; &nbsp; }
 
</pre><pre class="diff" id="removed">- &nbsp; &nbsp;<span id="removedchars">for (i = 0; i &lt; package-&gt;loaded_features; i++</span>)
</pre><pre class="diff" id="added">+ &nbsp; &nbsp;<span id="addedchars">LIST_FOR_EACH_ENTRY( feature, &amp;package-&gt;features, MSIFEATURE, entry </span>)
</pre><pre class="diff" id="context"> &nbsp; &nbsp; {
</pre><pre class="diff" id="added">+ &nbsp; &nbsp; &nbsp; &nbsp;ComponentList *cl;
</pre><pre class="diff" id="context"> &nbsp; &nbsp; &nbsp; &nbsp; INSTALLSTATE res = -10;
</pre><pre class="diff" id="removed">- &nbsp; &nbsp; &nbsp; &nbsp;int j;
- &nbsp; &nbsp; &nbsp; &nbsp;for (j = 0; j &lt; package-&gt;features[i].ComponentCount; j++)
</pre><pre class="diff" id="added">+
+ &nbsp; &nbsp; &nbsp; &nbsp;LIST_FOR_EACH_ENTRY( cl, &amp;feature-&gt;Components, ComponentList, entry )
</pre><pre class="diff" id="context"> &nbsp; &nbsp; &nbsp; &nbsp; {
</pre><pre class="diff" id="removed">- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;MSICOMPONENT* component = &amp;package-&gt;components[package-&gt;features[i].
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span id="removedchars"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Components[j]]</span>;
</pre><pre class="diff" id="added">+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span id="addedchars">comp= cl-&gt;component</span>;
+
</pre><pre class="diff" id="context"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (res == -10)
</pre><pre class="diff" id="removed">- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;res = comp<span id="removedchars">onent</span>-&gt;Installed;
</pre><pre class="diff" id="added">+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;res = comp-&gt;Installed;
</pre><pre class="diff" id="context"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {
</pre><pre class="diff" id="removed">- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if (res == comp<span id="removedchars">onent</span>-&gt;Installed)
</pre><pre class="diff" id="added">+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if (res == comp-&gt;Installed)
</pre><pre class="diff" id="context"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; continue;
 
</pre><pre class="diff" id="removed">- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if (res != comp<span id="removedchars">onent</span>-&gt;Installed)
</pre><pre class="diff" id="added">+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if (res != comp-&gt;Installed)
</pre><pre class="diff" id="context"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; res = INSTALLSTATE_INCOMPLETE;
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }
 &nbsp; &nbsp; &nbsp; &nbsp; }
</pre><pre class="diff" id="added">+ &nbsp; &nbsp; &nbsp; &nbsp;feature-&gt;Installed = res;
</pre><pre class="diff" id="context"> &nbsp; &nbsp; }
 }
 
@@ -1446,19 +1440,19 @@
</pre><pre class="diff" id="context"> {
 &nbsp; &nbsp; static const WCHAR all[]={'A','L','L',0};
 &nbsp; &nbsp; LPWSTR override = NULL;
</pre><pre class="diff" id="removed">- &nbsp; &nbsp;INT i;
</pre><pre class="diff" id="context"> &nbsp; &nbsp; BOOL rc = FALSE;
</pre><pre class="diff" id="added">+ &nbsp; &nbsp;MSIFEATURE *feature;
</pre><pre class="diff" id="context"> 
 &nbsp; &nbsp; override = load_dynamic_property(package, property, NULL);
 &nbsp; &nbsp; if (override)
 &nbsp; &nbsp; {
 &nbsp; &nbsp; &nbsp; &nbsp; rc = TRUE;
</pre><pre class="diff" id="removed">- &nbsp; &nbsp; &nbsp; &nbsp;<span id="removedchars">for(i = 0; i &lt; package-&gt;loaded_features; i++</span>)
</pre><pre class="diff" id="added">+ &nbsp; &nbsp; &nbsp; &nbsp;<span id="addedchars">LIST_FOR_EACH_ENTRY( feature, &amp;package-&gt;features, MSIFEATURE, entry </span>)
</pre><pre class="diff" id="context"> &nbsp; &nbsp; &nbsp; &nbsp; {
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (strcmpiW(override,all)==0)
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {
</pre><pre class="diff" id="removed">- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;package-&gt;features[i].ActionRequest= state;
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span id="removedchars">package-&gt;features[i].Action </span>= state;
</pre><pre class="diff" id="added">+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span id="addedchars">feature-&gt;ActionRequest</span>= state;
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;feature-&gt;Action = state;
</pre><pre class="diff" id="context"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {
@@ -1468,12 +1462,11 @@
</pre><pre class="diff" id="context"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; while (ptr)
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ((ptr2 &amp;&amp; 
</pre><pre class="diff" id="removed">- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;strncmpW(ptr,package-&gt;features[i].Feature, ptr2-ptr)==0)
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|| (!ptr2 &amp;&amp;
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;str<span id="removedchars">cmpW(ptr,package-&gt;features[i].Feature)==0)</span>)
</pre><pre class="diff" id="added">+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;str<span id="addedchars">ncmpW(ptr,feature-&gt;Feature, ptr2-ptr)==0</span>)
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|| (!ptr2 &amp;&amp; strcmpW(ptr,feature-&gt;Feature)==0))
</pre><pre class="diff" id="context"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {
</pre><pre class="diff" id="removed">- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;package-&gt;features[i].ActionRequest= state;
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span id="removedchars">package-&gt;features[i].Action </span>= state;
</pre><pre class="diff" id="added">+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span id="addedchars">feature-&gt;ActionRequest</span>= state;
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;feature-&gt;Action = state;
</pre><pre class="diff" id="context"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (ptr2)
@@ -1496,8 +1489,6 @@
</pre><pre class="diff" id="context"> {
 &nbsp; &nbsp; LPWSTR level;
 &nbsp; &nbsp; INT install_level;
</pre><pre class="diff" id="removed">- &nbsp; &nbsp;DWORD i;
- &nbsp; &nbsp;INT j;
</pre><pre class="diff" id="context"> &nbsp; &nbsp; static const WCHAR szlevel[] =
 &nbsp; &nbsp; &nbsp; &nbsp; {'I','N','S','T','A','L','L','L','E','V','E','L',0};
 &nbsp; &nbsp; static const WCHAR szAddLocal[] =
@@ -1505,7 +1496,10 @@
</pre><pre class="diff" id="context"> &nbsp; &nbsp; static const WCHAR szRemove[] =
 &nbsp; &nbsp; &nbsp; &nbsp; {'R','E','M','O','V','E',0};
 &nbsp; &nbsp; BOOL override = FALSE;
</pre><pre class="diff" id="added">+ &nbsp; &nbsp;MSICOMPONENT* component;
+ &nbsp; &nbsp;MSIFEATURE *feature;
</pre><pre class="diff" id="context"> 
</pre><pre class="diff" id="added">+
</pre><pre class="diff" id="context"> &nbsp; &nbsp; /* I do not know if this is where it should happen.. but */
 
 &nbsp; &nbsp; TRACE(&quot;Checking Install Level\n&quot;);
@@ -1546,30 +1540,27 @@
</pre><pre class="diff" id="context"> 
 &nbsp; &nbsp; if (!override)
 &nbsp; &nbsp; {
</pre><pre class="diff" id="removed">- &nbsp; &nbsp; &nbsp; &nbsp;<span id="removedchars">for(i = 0; i &lt; package-&gt;loaded_features; i++</span>)
</pre><pre class="diff" id="added">+ &nbsp; &nbsp; &nbsp; &nbsp;<span id="addedchars">LIST_FOR_EACH_ENTRY( feature, &amp;package-&gt;features, MSIFEATURE, entry </span>)
</pre><pre class="diff" id="context"> &nbsp; &nbsp; &nbsp; &nbsp; {
</pre><pre class="diff" id="removed">- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;BOOL feature_state = ((package-&gt;features[i].Level &gt; 0) &amp;&amp;
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span id="removedchars"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (package-&gt;features[i].Level &lt;= install_level));</span>
</pre><pre class="diff" id="added">+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span id="addedchars">BOOL feature_state = ((feature-&gt;Level &gt; 0) &amp;&amp;</span>
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (feature-&gt;Level &lt;= install_level));
</pre><pre class="diff" id="context"> 
</pre><pre class="diff" id="removed">- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if ((feature_state) &amp;&amp; 
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span id="removedchars"> &nbsp; (package-&gt;features[i].</span>Action == INSTALLSTATE_UNKNOWN))
</pre><pre class="diff" id="added">+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span id="addedchars">if ((feature_state) &amp;&amp; (feature-&gt;</span>Action == INSTALLSTATE_UNKNOWN))
</pre><pre class="diff" id="context"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {
</pre><pre class="diff" id="removed">- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if (package-&gt;features[i].Attributes &amp; 
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span id="removedchars"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span> msidbFeatureAttributesFavorSource)
</pre><pre class="diff" id="added">+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span id="addedchars">if (feature-&gt;Attributes &amp;</span> msidbFeatureAttributesFavorSource)
</pre><pre class="diff" id="context"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {
</pre><pre class="diff" id="removed">- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;package-&gt;features[i].ActionRequest = INSTALLSTATE_SOURCE;
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span id="removedchars">package-&gt;features[i].Action</span> = INSTALLSTATE_SOURCE;
</pre><pre class="diff" id="added">+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span id="addedchars">feature-&gt;ActionRequest</span> = INSTALLSTATE_SOURCE;
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;feature-&gt;Action = INSTALLSTATE_SOURCE;
</pre><pre class="diff" id="context"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }
</pre><pre class="diff" id="removed">- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;else if (package-&gt;features[i].Attributes &amp;
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span id="removedchars"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span> msidbFeatureAttributesFavorAdvertise)
</pre><pre class="diff" id="added">+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span id="addedchars">else if (feature-&gt;Attributes &amp;</span> msidbFeatureAttributesFavorAdvertise)
</pre><pre class="diff" id="context"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {
</pre><pre class="diff" id="removed">- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;package-&gt;features[i].ActionRequest =INSTALLSTATE_ADVERTISED;
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span id="removedchars">package-&gt;features[i].Action =</span>INSTALLSTATE_ADVERTISED;
</pre><pre class="diff" id="added">+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span id="addedchars">feature-&gt;ActionRequest = </span>INSTALLSTATE_ADVERTISED;
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;feature-&gt;Action = INSTALLSTATE_ADVERTISED;
</pre><pre class="diff" id="context"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {
</pre><pre class="diff" id="removed">- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;package-&gt;features[i].ActionRequest = INSTALLSTATE_LOCAL;
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span id="removedchars">package-&gt;features[i].Action</span> = INSTALLSTATE_LOCAL;
</pre><pre class="diff" id="added">+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span id="addedchars">feature-&gt;ActionRequest</span> = INSTALLSTATE_LOCAL;
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;feature-&gt;Action = INSTALLSTATE_LOCAL;
</pre><pre class="diff" id="context"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }
 &nbsp; &nbsp; &nbsp; &nbsp; }
@@ -1587,17 +1578,17 @@
</pre><pre class="diff" id="context"> &nbsp; &nbsp; &nbsp;* now we want to enable or disable components base on feature 
 &nbsp; &nbsp; */
 
</pre><pre class="diff" id="removed">- &nbsp; &nbsp;<span id="removedchars">for(i = 0; i &lt; package-&gt;loaded_features; i++</span>)
</pre><pre class="diff" id="added">+ &nbsp; &nbsp;<span id="addedchars">LIST_FOR_EACH_ENTRY( feature, &amp;package-&gt;features, MSIFEATURE, entry </span>)
</pre><pre class="diff" id="context"> &nbsp; &nbsp; {
</pre><pre class="diff" id="removed">- &nbsp; &nbsp; &nbsp; &nbsp;<span id="removedchars">MSIFEATURE* feature = &amp;package-&gt;features[i]</span>;
</pre><pre class="diff" id="added">+ &nbsp; &nbsp; &nbsp; &nbsp;<span id="addedchars">ComponentList *cl</span>;
+
</pre><pre class="diff" id="context"> &nbsp; &nbsp; &nbsp; &nbsp; TRACE(&quot;Examining Feature %s (Installed %i, Action %i, Request %i)\n&quot;,
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; debugstr_w(feature-&gt;Feature), feature-&gt;Installed, feature-&gt;Action,
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; feature-&gt;ActionRequest);
 
</pre><pre class="diff" id="removed">- &nbsp; &nbsp; &nbsp; &nbsp;<span id="removedchars">for( j = 0; j &lt; feature-&gt;ComponentCount; j++</span>)
</pre><pre class="diff" id="added">+ &nbsp; &nbsp; &nbsp; &nbsp;<span id="addedchars">LIST_FOR_EACH_ENTRY( cl, &amp;feature-&gt;Components, ComponentList, entry </span>)
</pre><pre class="diff" id="context"> &nbsp; &nbsp; &nbsp; &nbsp; {
</pre><pre class="diff" id="removed">- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;MSICOMPONENT* component = &amp;package-&gt;components[
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span id="removedchars"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;feature-&gt;Components[j]]</span>;
</pre><pre class="diff" id="added">+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span id="addedchars">component = cl-&gt;component</span>;
</pre><pre class="diff" id="context"> 
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (!component-&gt;Enabled)
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {
@@ -1644,10 +1635,8 @@
</pre><pre class="diff" id="context"> &nbsp; &nbsp; &nbsp; &nbsp; }
 &nbsp; &nbsp; } 
 
</pre><pre class="diff" id="removed">- &nbsp; &nbsp;<span id="removedchars">for(i = 0; i &lt; package-&gt;loaded_components; i++</span>)
</pre><pre class="diff" id="added">+ &nbsp; &nbsp;<span id="addedchars">LIST_FOR_EACH_ENTRY( component, &amp;package-&gt;components, MSICOMPONENT, entry </span>)
</pre><pre class="diff" id="context"> &nbsp; &nbsp; {
</pre><pre class="diff" id="removed">- &nbsp; &nbsp; &nbsp; &nbsp;MSICOMPONENT* component= &amp;package-&gt;components[i];
-
</pre><pre class="diff" id="context"> &nbsp; &nbsp; &nbsp; &nbsp; TRACE(&quot;Result: Component %s (Installed %i, Action %i, Request %i)\n&quot;,
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; debugstr_w(component-&gt;Component), component-&gt;Installed, 
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; component-&gt;Action, component-&gt;ActionRequest);
@@ -1678,14 +1667,14 @@
</pre><pre class="diff" id="context"> static UINT ITERATE_CostFinalizeConditions(MSIRECORD *row, LPVOID param)
 {
 &nbsp; &nbsp; MSIPACKAGE *package = (MSIPACKAGE*)param;
</pre><pre class="diff" id="removed">- &nbsp; &nbsp;LPCWSTR Feature;
- &nbsp; &nbsp;<span id="removedchars">int feature_index</span>;
</pre><pre class="diff" id="added">+ &nbsp; &nbsp;<span id="addedchars">LPCWSTR name</span>;
+ &nbsp; &nbsp;MSIFEATURE *feature;
</pre><pre class="diff" id="context"> 
</pre><pre class="diff" id="removed">- &nbsp; &nbsp;<span id="removedchars">Feature = MSI_RecordGetString(row,1</span>);
</pre><pre class="diff" id="added">+ &nbsp; &nbsp;<span id="addedchars">name = MSI_RecordGetString( row, 1 </span>);
</pre><pre class="diff" id="context"> 
</pre><pre class="diff" id="removed">- &nbsp; &nbsp;feature_index = get_loaded_feature(package,Feature);
- &nbsp; &nbsp;if (feature_index &lt; 0)
- &nbsp; &nbsp;<span id="removedchars"> &nbsp; &nbsp;ERR(&quot;FAILED to find loaded feature %s\n&quot;,debugstr_w(Feature)</span>);
</pre><pre class="diff" id="added">+ &nbsp; &nbsp;<span id="addedchars">feature = get_loaded_feature( package, name </span>);
+ &nbsp; &nbsp;if (!feature)
+ &nbsp; &nbsp; &nbsp; &nbsp;ERR(&quot;FAILED to find loaded feature %s\n&quot;,debugstr_w(name));
</pre><pre class="diff" id="context"> &nbsp; &nbsp; else
 &nbsp; &nbsp; {
 &nbsp; &nbsp; &nbsp; &nbsp; LPCWSTR Condition;
@@ -1694,9 +1683,8 @@
</pre><pre class="diff" id="context"> &nbsp; &nbsp; &nbsp; &nbsp; if (MSI_EvaluateConditionW(package,Condition) == MSICONDITION_TRUE)
 &nbsp; &nbsp; &nbsp; &nbsp; {
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; int level = MSI_RecordGetInteger(row,2);
</pre><pre class="diff" id="removed">- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;TRACE(&quot;Reseting feature %s to level %i\n&quot;, debugstr_w(Feature),
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;level);
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span id="removedchars">package-&gt;features[feature_index].Level = level</span>;
</pre><pre class="diff" id="added">+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span id="addedchars">TRACE(&quot;Reseting feature %s to level %i\n&quot;, debugstr_w(name), level)</span>;
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;feature-&gt;Level = level;
</pre><pre class="diff" id="context"> &nbsp; &nbsp; &nbsp; &nbsp; }
 &nbsp; &nbsp; }
 &nbsp; &nbsp; return ERROR_SUCCESS;
@@ -1722,9 +1710,10 @@
</pre><pre class="diff" id="context"> &nbsp; &nbsp; static const WCHAR szlevel[] =
 &nbsp; &nbsp; &nbsp; &nbsp; {'I','N','S','T','A','L','L','L','E','V','E','L',0};
 &nbsp; &nbsp; static const WCHAR szOne[] = { '1', 0 };
</pre><pre class="diff" id="added">+ &nbsp; &nbsp;MSICOMPONENT *comp;
+ &nbsp; &nbsp;MSIFILE *file;
</pre><pre class="diff" id="context"> &nbsp; &nbsp; UINT rc;
 &nbsp; &nbsp; MSIQUERY * view;
</pre><pre class="diff" id="removed">- &nbsp; &nbsp;DWORD i;
</pre><pre class="diff" id="context"> &nbsp; &nbsp; LPWSTR level;
 &nbsp; &nbsp; DWORD sz = 3;
 &nbsp; &nbsp; WCHAR buffer[3];
@@ -1743,16 +1732,13 @@
</pre><pre class="diff" id="context"> &nbsp; &nbsp; &nbsp; &nbsp; msiobj_release(&amp;view-&gt;hdr);
 &nbsp; &nbsp; }
 
</pre><pre class="diff" id="removed">- &nbsp; &nbsp;TRACE(&quot;File calculations<span id="removedchars"> %i files\n&quot;,package-&gt;loaded_files</span>);
</pre><pre class="diff" id="added">+ &nbsp; &nbsp;TRACE(&quot;File calculations<span id="addedchars">\n&quot;</span>);
</pre><pre class="diff" id="context"> 
</pre><pre class="diff" id="removed">- &nbsp; &nbsp;<span id="removedchars">for (i = 0; i &lt; package-&gt;loaded_files; i++</span>)
</pre><pre class="diff" id="added">+ &nbsp; &nbsp;<span id="addedchars">LIST_FOR_EACH_ENTRY( file, &amp;package-&gt;files, MSIFILE, entry </span>)
</pre><pre class="diff" id="context"> &nbsp; &nbsp; {
 &nbsp; &nbsp; &nbsp; &nbsp; MSICOMPONENT* comp = NULL;
</pre><pre class="diff" id="removed">- &nbsp; &nbsp; &nbsp; &nbsp;MSIFILE* file= NULL;
</pre><pre class="diff" id="context"> 
</pre><pre class="diff" id="removed">- &nbsp; &nbsp; &nbsp; &nbsp;file = &amp;package-&gt;files[i];
- &nbsp; &nbsp; &nbsp; &nbsp;if (file-&gt;ComponentIndex &gt;= 0)
- &nbsp; &nbsp; &nbsp; &nbsp;<span id="removedchars"> &nbsp; &nbsp;comp = &amp;package-&gt;components[file-&gt;ComponentIndex]</span>;
</pre><pre class="diff" id="added">+ &nbsp; &nbsp; &nbsp; &nbsp;<span id="addedchars">comp = file-&gt;Component</span>;
</pre><pre class="diff" id="context"> 
 &nbsp; &nbsp; &nbsp; &nbsp; if (file-&gt;Temporary == TRUE)
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; continue;
@@ -1838,16 +1824,15 @@
</pre><pre class="diff" id="context"> &nbsp; &nbsp; }
 
 &nbsp; &nbsp; TRACE(&quot;Enabling or Disabling Components\n&quot;);
</pre><pre class="diff" id="removed">- &nbsp; &nbsp;<span id="removedchars">for (i = 0; i &lt; package-&gt;loaded_components; i++</span>)
</pre><pre class="diff" id="added">+ &nbsp; &nbsp;<span id="addedchars">LIST_FOR_EACH_ENTRY( comp, &amp;package-&gt;components, MSICOMPONENT, entry </span>)
</pre><pre class="diff" id="context"> &nbsp; &nbsp; {
</pre><pre class="diff" id="removed">- &nbsp; &nbsp; &nbsp; &nbsp;if (<span id="removedchars">package-&gt;components[i].</span>Condition[0])
</pre><pre class="diff" id="added">+ &nbsp; &nbsp; &nbsp; &nbsp;if (<span id="addedchars">comp-&gt;</span>Condition[0])
</pre><pre class="diff" id="context"> &nbsp; &nbsp; &nbsp; &nbsp; {
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (MSI_EvaluateConditionW(package,
</pre><pre class="diff" id="removed">- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span id="removedchars">package-&gt;components[i].</span>Condition) == MSICONDITION_FALSE)
</pre><pre class="diff" id="added">+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span id="addedchars">comp-&gt;</span>Condition) == MSICONDITION_FALSE)
</pre><pre class="diff" id="context"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {
</pre><pre class="diff" id="removed">- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;TRACE(&quot;Disabling component %s\n&quot;,
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;debugstr_w(package-&gt;components[i].Component));
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span id="removedchars">package-&gt;components[i].Enabled = FALSE</span>;
</pre><pre class="diff" id="added">+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span id="addedchars">TRACE(&quot;Disabling component %s\n&quot;, debugstr_w(comp-&gt;Component))</span>;
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;comp-&gt;Enabled = FALSE;
</pre><pre class="diff" id="context"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }
 &nbsp; &nbsp; &nbsp; &nbsp; }
 &nbsp; &nbsp; }
@@ -1995,7 +1980,7 @@
</pre><pre class="diff" id="context"> &nbsp; &nbsp; DWORD type,size;
 &nbsp; &nbsp; LPWSTR &nbsp;deformated;
 &nbsp; &nbsp; LPCWSTR szRoot, component, name, key, value;
</pre><pre class="diff" id="removed">- &nbsp; &nbsp;<span id="removedchars">INT component_index</span>;
</pre><pre class="diff" id="added">+ &nbsp; &nbsp;<span id="addedchars">MSICOMPONENT *comp</span>;
</pre><pre class="diff" id="context"> &nbsp; &nbsp; MSIRECORD * uirow;
 &nbsp; &nbsp; LPWSTR uikey;
 &nbsp; &nbsp; INT &nbsp; root;
@@ -2010,21 +1995,21 @@
</pre><pre class="diff" id="context"> &nbsp; &nbsp; name = NULL;
 
 &nbsp; &nbsp; component = MSI_RecordGetString(row, 6);
</pre><pre class="diff" id="removed">- &nbsp; &nbsp;comp<span id="removedchars">onent_index</span> = get_loaded_component(package,component);
</pre><pre class="diff" id="added">+ &nbsp; &nbsp;comp = get_loaded_component(package,component);
+ &nbsp; &nbsp;if (!comp)
+ &nbsp; &nbsp; &nbsp; &nbsp;return ERROR_SUCCESS;
</pre><pre class="diff" id="context"> 
</pre><pre class="diff" id="removed">- &nbsp; &nbsp;if (!ACTION_VerifyComponentForAction(package, component_index,
- &nbsp; &nbsp;<span id="removedchars"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span> INSTALLSTATE_LOCAL))
</pre><pre class="diff" id="added">+ &nbsp; &nbsp;<span id="addedchars">if (!ACTION_VerifyComponentForAction(package, comp,</span> INSTALLSTATE_LOCAL))
</pre><pre class="diff" id="context"> &nbsp; &nbsp; {
 &nbsp; &nbsp; &nbsp; &nbsp; TRACE(&quot;Skipping write due to disabled component %s\n&quot;,
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; debugstr_w(component));
 
</pre><pre class="diff" id="removed">- &nbsp; &nbsp; &nbsp; &nbsp;package-&gt;components[component_index].Action =
- &nbsp; &nbsp; &nbsp; &nbsp;<span id="removedchars"> &nbsp; &nbsp; &nbsp; &nbsp;package-&gt;components[component_index].</span>Installed;
</pre><pre class="diff" id="added">+ &nbsp; &nbsp; &nbsp; &nbsp;<span id="addedchars">comp-&gt;Action = comp-&gt;</span>Installed;
</pre><pre class="diff" id="context"> 
 &nbsp; &nbsp; &nbsp; &nbsp; return ERROR_SUCCESS;
 &nbsp; &nbsp; }
 
</pre><pre class="diff" id="removed">- &nbsp; &nbsp;<span id="removedchars">package-&gt;components[component_index].</span>Action = INSTALLSTATE_LOCAL;
</pre><pre class="diff" id="added">+ &nbsp; &nbsp;<span id="addedchars">comp-&gt;</span>Action = INSTALLSTATE_LOCAL;
</pre><pre class="diff" id="context"> 
 &nbsp; &nbsp; name = MSI_RecordGetString(row, 4);
 &nbsp; &nbsp; if( MSI_RecordIsNull(row,5) &amp;&amp; name )
@@ -2192,6 +2177,7 @@
</pre><pre class="diff" id="context"> 
 static UINT ACTION_InstallValidate(MSIPACKAGE *package)
 {
</pre><pre class="diff" id="added">+ &nbsp; &nbsp;MSICOMPONENT *comp;
</pre><pre class="diff" id="context"> &nbsp; &nbsp; DWORD progress = 0;
 &nbsp; &nbsp; DWORD total = 0;
 &nbsp; &nbsp; static const WCHAR q1[]=
@@ -2200,7 +2186,8 @@
</pre><pre class="diff" id="context"> &nbsp; &nbsp; UINT rc;
 &nbsp; &nbsp; MSIQUERY * view;
 &nbsp; &nbsp; MSIRECORD * row = 0;
</pre><pre class="diff" id="removed">- &nbsp; &nbsp;<span id="removedchars">int i</span>;
</pre><pre class="diff" id="added">+ &nbsp; &nbsp;<span id="addedchars">MSIFEATURE *feature</span>;
+ &nbsp; &nbsp;MSIFILE *file;
</pre><pre class="diff" id="context"> 
 &nbsp; &nbsp; TRACE(&quot; InstallValidate \n&quot;);
 
@@ -2231,14 +2218,18 @@
</pre><pre class="diff" id="context"> &nbsp; &nbsp; msiobj_release(&amp;view-&gt;hdr);
 
 &nbsp; &nbsp; total = total + progress * REG_PROGRESS_VALUE;
</pre><pre class="diff" id="removed">- &nbsp; &nbsp;total = total + package-&gt;loaded_components * COMPONENT_PROGRESS_VALUE;
- &nbsp; &nbsp;for (i=0; i &lt; package-&gt;loaded_files; i++)
- &nbsp; &nbsp;<span id="removedchars"> &nbsp; &nbsp;total += package-&gt;files[i].FileSize;</span>
</pre><pre class="diff" id="added">+ &nbsp; &nbsp;<span id="addedchars">LIST_FOR_EACH_ENTRY( comp, &amp;package-&gt;components, MSICOMPONENT, entry )</span>
+ &nbsp; &nbsp;{
+ &nbsp; &nbsp; &nbsp; &nbsp;total += COMPONENT_PROGRESS_VALUE;
+ &nbsp; &nbsp;}
+ &nbsp; &nbsp;LIST_FOR_EACH_ENTRY( file, &amp;package-&gt;files, MSIFILE, entry )
+ &nbsp; &nbsp;{
+ &nbsp; &nbsp; &nbsp; &nbsp;total += file-&gt;FileSize;
+ &nbsp; &nbsp;}
</pre><pre class="diff" id="context"> &nbsp; &nbsp; ui_progress(package,0,total,0,0);
 
</pre><pre class="diff" id="removed">- &nbsp; &nbsp;<span id="removedchars">for(i = 0; i &lt; package-&gt;loaded_features; i++</span>)
</pre><pre class="diff" id="added">+ &nbsp; &nbsp;<span id="addedchars">LIST_FOR_EACH_ENTRY( feature, &amp;package-&gt;features, MSIFEATURE, entry </span>)
</pre><pre class="diff" id="context"> &nbsp; &nbsp; {
</pre><pre class="diff" id="removed">- &nbsp; &nbsp; &nbsp; &nbsp;MSIFEATURE* feature = &amp;package-&gt;features[i];
</pre><pre class="diff" id="context"> &nbsp; &nbsp; &nbsp; &nbsp; TRACE(&quot;Feature: %s; Installed: %i; Action %i; Request %i\n&quot;,
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; debugstr_w(feature-&gt;Feature), feature-&gt;Installed, feature-&gt;Action,
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; feature-&gt;ActionRequest);
@@ -2290,10 +2281,8 @@
</pre><pre class="diff" id="context"> &nbsp; &nbsp; return rc;
 }
 
</pre><pre class="diff" id="removed">-static LPWSTR resolve_keypath( MSIPACKAGE* package, INT
-<span id="removedchars"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;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">- &nbsp; &nbsp;MSICOMPONENT* cmp = &amp;package-&gt;components[component_index];
</pre><pre class="diff" id="context"> 
 &nbsp; &nbsp; if (cmp-&gt;KeyPath[0]==0)
 &nbsp; &nbsp; {
@@ -2349,14 +2338,10 @@
</pre><pre class="diff" id="context"> &nbsp; &nbsp; }
 &nbsp; &nbsp; else
 &nbsp; &nbsp; {
</pre><pre class="diff" id="removed">- &nbsp; &nbsp; &nbsp; &nbsp;int j;
- &nbsp; &nbsp; &nbsp; &nbsp;<span id="removedchars">j = get_loaded_file(package,cmp-&gt;KeyPath</span>);
</pre><pre class="diff" id="added">+ &nbsp; &nbsp; &nbsp; &nbsp;<span id="addedchars">MSIFILE *file = get_loaded_file( package, cmp-&gt;KeyPath </span>);
</pre><pre class="diff" id="context"> 
</pre><pre class="diff" id="removed">- &nbsp; &nbsp; &nbsp; &nbsp;if (j&gt;=0)
- &nbsp; &nbsp; &nbsp; &nbsp;{
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;LPWSTR p = strdupW(package-&gt;files[j].TargetPath);
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;return p;
- &nbsp; &nbsp; &nbsp; &nbsp;<span id="removedchars">}</span>
</pre><pre class="diff" id="added">+ &nbsp; &nbsp; &nbsp; &nbsp;<span id="addedchars">if (file)</span>
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;return strdupW( file-&gt;TargetPath );
</pre><pre class="diff" id="context"> &nbsp; &nbsp; }
 &nbsp; &nbsp; return NULL;
 }
@@ -2408,78 +2393,78 @@
</pre><pre class="diff" id="context"> /*
 &nbsp;* Return TRUE if the count should be written out and FALSE if not
 &nbsp;*/
</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">+ &nbsp; &nbsp;MSIFEATURE *feature;
</pre><pre class="diff" id="context"> &nbsp; &nbsp; INT count = 0;
 &nbsp; &nbsp; BOOL write = FALSE;
</pre><pre class="diff" id="removed">- &nbsp; &nbsp;INT j;
</pre><pre class="diff" id="context"> 
 &nbsp; &nbsp; /* only refcount DLLs */
</pre><pre class="diff" id="removed">- &nbsp; &nbsp;if (package-&gt;components[index].KeyPath[0]==0 || 
- &nbsp; &nbsp; &nbsp; &nbsp;package-&gt;components[index].Attributes &amp; 
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;msidbComponentAttributesRegistryKeyPath || 
- &nbsp; &nbsp; &nbsp; &nbsp;package-&gt;components[index].Attributes &amp; 
- &nbsp; &nbsp;<span id="removedchars"> &nbsp; &nbsp; &nbsp; &nbsp;msidbComponentAttributesODBCDataSource)</span>
</pre><pre class="diff" id="added">+ &nbsp; &nbsp;<span id="addedchars">if (comp-&gt;KeyPath[0]==0 || </span>
+ &nbsp; &nbsp; &nbsp; &nbsp;comp-&gt;Attributes &amp; msidbComponentAttributesRegistryKeyPath || 
+ &nbsp; &nbsp; &nbsp; &nbsp;comp-&gt;Attributes &amp; msidbComponentAttributesODBCDataSource)
</pre><pre class="diff" id="context"> &nbsp; &nbsp; &nbsp; &nbsp; write = FALSE;
 &nbsp; &nbsp; else
 &nbsp; &nbsp; {
</pre><pre class="diff" id="removed">- &nbsp; &nbsp; &nbsp; &nbsp;count = ACTION_GetSharedDLLsCount(package-&gt;components[index].
- &nbsp; &nbsp; &nbsp; &nbsp;<span id="removedchars"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span>FullKeypath);
</pre><pre class="diff" id="added">+ &nbsp; &nbsp; &nbsp; &nbsp;<span id="addedchars">count = ACTION_GetSharedDLLsCount( comp-&gt;</span>FullKeypath);
</pre><pre class="diff" id="context"> &nbsp; &nbsp; &nbsp; &nbsp; write = (count &gt; 0);
 
</pre><pre class="diff" id="removed">- &nbsp; &nbsp; &nbsp; &nbsp;if (package-&gt;components[index].Attributes &amp; 
- &nbsp; &nbsp; &nbsp; &nbsp;<span id="removedchars"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span> msidbComponentAttributesSharedDllRefCount)
</pre><pre class="diff" id="added">+ &nbsp; &nbsp; &nbsp; &nbsp;<span id="addedchars">if (comp-&gt;Attributes &amp;</span> msidbComponentAttributesSharedDllRefCount)
</pre><pre class="diff" id="context"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; write = TRUE;
 &nbsp; &nbsp; }
 
 &nbsp; &nbsp; /* increment counts */
</pre><pre class="diff" id="removed">- &nbsp; &nbsp;<span id="removedchars">for (j = 0; j &lt; package-&gt;loaded_features; j++</span>)
</pre><pre class="diff" id="added">+ &nbsp; &nbsp;<span id="addedchars">LIST_FOR_EACH_ENTRY( feature, &amp;package-&gt;features, MSIFEATURE, entry </span>)
</pre><pre class="diff" id="context"> &nbsp; &nbsp; {
</pre><pre class="diff" id="removed">- &nbsp; &nbsp; &nbsp; &nbsp;<span id="removedchars">int i</span>;
</pre><pre class="diff" id="added">+ &nbsp; &nbsp; &nbsp; &nbsp;<span id="addedchars">ComponentList *cl</span>;
</pre><pre class="diff" id="context"> 
</pre><pre class="diff" id="removed">- &nbsp; &nbsp; &nbsp; &nbsp;if (!ACTION_VerifyFeatureForAction(<span id="removedchars">package,j,INSTALLSTATE_LOCAL</span>))
</pre><pre class="diff" id="added">+ &nbsp; &nbsp; &nbsp; &nbsp;if (!ACTION_VerifyFeatureForAction(<span id="addedchars"> feature, INSTALLSTATE_LOCAL </span>))
</pre><pre class="diff" id="context"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; continue;
 
</pre><pre class="diff" id="removed">- &nbsp; &nbsp; &nbsp; &nbsp;<span id="removedchars">for (i = 0; i &lt; package-&gt;features[j].ComponentCount; i++</span>)
</pre><pre class="diff" id="added">+ &nbsp; &nbsp; &nbsp; &nbsp;<span id="addedchars">LIST_FOR_EACH_ENTRY( cl, &amp;feature-&gt;Components, ComponentList, entry </span>)
</pre><pre class="diff" id="context"> &nbsp; &nbsp; &nbsp; &nbsp; {
</pre><pre class="diff" id="removed">- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if (<span id="removedchars">package-&gt;features[j].Components[i] == index</span>)
</pre><pre class="diff" id="added">+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if (<span id="addedchars"> cl-&gt;component == comp </span>)
</pre><pre class="diff" id="context"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; count++;
 &nbsp; &nbsp; &nbsp; &nbsp; }
 &nbsp; &nbsp; }
</pre><pre class="diff" id="added">+
</pre><pre class="diff" id="context"> &nbsp; &nbsp; /* decrement counts */
</pre><pre class="diff" id="removed">- &nbsp; &nbsp;<span id="removedchars">for (j = 0; j &lt; package-&gt;loaded_features; j++</span>)
</pre><pre class="diff" id="added">+ &nbsp; &nbsp;<span id="addedchars">LIST_FOR_EACH_ENTRY( feature, &amp;package-&gt;features, MSIFEATURE, entry </span>)
</pre><pre class="diff" id="context"> &nbsp; &nbsp; {
</pre><pre class="diff" id="removed">- &nbsp; &nbsp; &nbsp; &nbsp;int i;
- &nbsp; &nbsp; &nbsp; &nbsp;<span id="removedchars">if (!ACTION_VerifyFeatureForAction(package,j,INSTALLSTATE_ABSENT))</span>
</pre><pre class="diff" id="added">+ &nbsp; &nbsp; &nbsp; &nbsp;<span id="addedchars">ComponentList *cl;</span>
+
+ &nbsp; &nbsp; &nbsp; &nbsp;if (!ACTION_VerifyFeatureForAction( feature, INSTALLSTATE_ABSENT ))
</pre><pre class="diff" id="context"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; continue;
 
</pre><pre class="diff" id="removed">- &nbsp; &nbsp; &nbsp; &nbsp;<span id="removedchars">for (i = 0; i &lt; package-&gt;features[j].ComponentCount; i++</span>)
</pre><pre class="diff" id="added">+ &nbsp; &nbsp; &nbsp; &nbsp;<span id="addedchars">LIST_FOR_EACH_ENTRY( cl, &amp;feature-&gt;Components, ComponentList, entry </span>)
</pre><pre class="diff" id="context"> &nbsp; &nbsp; &nbsp; &nbsp; {
</pre><pre class="diff" id="removed">- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if (<span id="removedchars">package-&gt;features[j].Components[i] == index</span>)
</pre><pre class="diff" id="added">+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if (<span id="addedchars"> cl-&gt;component == comp </span>)
</pre><pre class="diff" id="context"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; count--;
 &nbsp; &nbsp; &nbsp; &nbsp; }
 &nbsp; &nbsp; }
 
 &nbsp; &nbsp; /* ref count all the files in the component */
 &nbsp; &nbsp; if (write)
</pre><pre class="diff" id="removed">- &nbsp; &nbsp;<span id="removedchars"> &nbsp; &nbsp;for (j = 0; j &lt; package-&gt;loaded_files; j++)</span>
</pre><pre class="diff" id="added">+ &nbsp; &nbsp;<span id="addedchars">{</span>
+ &nbsp; &nbsp; &nbsp; &nbsp;MSIFILE *file;
+
+ &nbsp; &nbsp; &nbsp; &nbsp;LIST_FOR_EACH_ENTRY( file, &amp;package-&gt;files, MSIFILE, entry )
</pre><pre class="diff" id="context"> &nbsp; &nbsp; &nbsp; &nbsp; {
</pre><pre class="diff" id="removed">- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if (<span id="removedchars">package-&gt;files[j].</span>Temporary)
</pre><pre class="diff" id="added">+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if (<span id="addedchars">file-&gt;</span>Temporary)
</pre><pre class="diff" id="context"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; continue;
</pre><pre class="diff" id="removed">- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if (package-&gt;files[j].ComponentIndex == index)
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span id="removedchars"> &nbsp; &nbsp;ACTION_WriteSharedDLLsCount(package-&gt;files[j].TargetPath,count);</span>
</pre><pre class="diff" id="added">+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span id="addedchars">if (file-&gt;Component == comp)</span>
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ACTION_WriteSharedDLLsCount( file-&gt;TargetPath, count );
</pre><pre class="diff" id="context"> &nbsp; &nbsp; &nbsp; &nbsp; }
</pre><pre class="diff" id="added">+ &nbsp; &nbsp;}
</pre><pre class="diff" id="context"> &nbsp; &nbsp; 
 &nbsp; &nbsp; /* add a count for permenent */
</pre><pre class="diff" id="removed">- &nbsp; &nbsp;if (package-&gt;components[index].Attributes &amp;
- &nbsp; &nbsp;<span id="removedchars"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span> msidbComponentAttributesPermanent)
</pre><pre class="diff" id="added">+ &nbsp; &nbsp;<span id="addedchars">if (comp-&gt;Attributes &amp;</span> msidbComponentAttributesPermanent)
</pre><pre class="diff" id="context"> &nbsp; &nbsp; &nbsp; &nbsp; count ++;
 &nbsp; &nbsp; 
</pre><pre class="diff" id="removed">- &nbsp; &nbsp;<span id="removedchars">package-&gt;components[index].</span>RefCount = count;
</pre><pre class="diff" id="added">+ &nbsp; &nbsp;<span id="addedchars">comp-&gt;</span>RefCount = count;
</pre><pre class="diff" id="context"> 
 &nbsp; &nbsp; if (write)
</pre><pre class="diff" id="removed">- &nbsp; &nbsp; &nbsp; &nbsp;ACTION_WriteSharedDLLsCount(package-&gt;components[index].FullKeypath,
- &nbsp; &nbsp; &nbsp; &nbsp;<span id="removedchars"> &nbsp; &nbsp;package-&gt;components[index].RefCount</span>);
</pre><pre class="diff" id="added">+ &nbsp; &nbsp; &nbsp; &nbsp;<span id="addedchars">ACTION_WriteSharedDLLsCount( comp-&gt;FullKeypath, comp-&gt;RefCount </span>);
</pre><pre class="diff" id="context"> }
 
 /*
@@ -2494,7 +2479,7 @@
</pre><pre class="diff" id="context"> &nbsp; &nbsp; WCHAR squished_pc[GUID_SIZE];
 &nbsp; &nbsp; WCHAR squished_cc[GUID_SIZE];
 &nbsp; &nbsp; UINT rc;
</pre><pre class="diff" id="removed">- &nbsp; &nbsp;<span id="removedchars">DWORD i</span>;
</pre><pre class="diff" id="added">+ &nbsp; &nbsp;<span id="addedchars">MSICOMPONENT *comp</span>;
</pre><pre class="diff" id="context"> &nbsp; &nbsp; HKEY hkey=0,hkey2=0;
 
 &nbsp; &nbsp; if (!package)
@@ -2508,32 +2493,33 @@
</pre><pre class="diff" id="context"> &nbsp; &nbsp; &nbsp; 
 &nbsp; &nbsp; squash_guid(package-&gt;ProductCode,squished_pc);
 &nbsp; &nbsp; ui_progress(package,1,COMPONENT_PROGRESS_VALUE,1,0);
</pre><pre class="diff" id="removed">- &nbsp; &nbsp;for (i = 0; i &lt; package-&gt;loaded_components; i++)
</pre><pre class="diff" id="added">+
+ &nbsp; &nbsp;LIST_FOR_EACH_ENTRY( comp, &amp;package-&gt;components, MSICOMPONENT, entry )
</pre><pre class="diff" id="context"> &nbsp; &nbsp; {
 &nbsp; &nbsp; &nbsp; &nbsp; ui_progress(package,2,0,0,0);
</pre><pre class="diff" id="removed">- &nbsp; &nbsp; &nbsp; &nbsp;if (<span id="removedchars">package-&gt;components[i].</span>ComponentId[0]!=0)
</pre><pre class="diff" id="added">+ &nbsp; &nbsp; &nbsp; &nbsp;if (<span id="addedchars">comp-&gt;</span>ComponentId[0]!=0)
</pre><pre class="diff" id="context"> &nbsp; &nbsp; &nbsp; &nbsp; {
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; WCHAR *keypath = NULL;
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MSIRECORD * uirow;
 
</pre><pre class="diff" id="removed">- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;squash_guid(<span id="removedchars">package-&gt;components[i].</span>ComponentId,squished_cc);
</pre><pre class="diff" id="added">+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;squash_guid(<span id="addedchars">comp-&gt;</span>ComponentId,squished_cc);
</pre><pre class="diff" id="context"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
</pre><pre class="diff" id="removed">- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;keypath = resolve_keypath(package,i);
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span id="removedchars">package-&gt;components[i].FullKeypath = keypath</span>;
</pre><pre class="diff" id="added">+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span id="addedchars">keypath = resolve_keypath( package, comp )</span>;
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;comp-&gt;FullKeypath = keypath;
</pre><pre class="diff" id="context"> 
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /* do the refcounting */
</pre><pre class="diff" id="removed">- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ACTION_RefCountComponent( package, <span id="removedchars">i</span>);
</pre><pre class="diff" id="added">+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ACTION_RefCountComponent( package, <span id="addedchars">comp </span>);
</pre>
<strong class="error">[truncated at 1000 lines; 4574 more skipped]</strong>
</div>

</body>
</html>