msi [1/3]: Revert "msi: Perform button control events in greatest to least order." [RESEND]

James Hawkins truiken at gmail.com
Mon Oct 16 17:49:03 CDT 2006


Hi,

Resending because I didn't see it on wine-patches.

Unfortunately the patch in question is wrong.  Concerning the order of
events in the ControlEvent table in the America's Army installer,
there were two possible solutions: the events are run in reverse
order, or SetProperty events are run before all other events, no
matter what the order is.  Extensive testing in Windows has shown the
latter to be true.  This functionality is implemented in the second
patch of this series.

Changelog:

Revert "msi: Perform button control events in greatest to least order."

This reverts commit f721a24a13bf250f0794b7249ffa863619b0b450.

 dlls/msi/dialog.c   |    2 +
 dlls/msi/msipriv.h  |    1 -
 dlls/msi/msiquery.c |   77 ---------------------------------------------------
 3 files changed, 1 insertions(+), 79 deletions(-)

--
James Hawkins
-------------- next part --------------
From ac4412830f66a1d5232789fcff20a6a25910afcb Mon Sep 17 00:00:00 2001
From: James Hawkins <jhawkins at sphere.smo.corp.google.com>
Date: Mon, 16 Oct 2006 11:32:33 -0700
Subject: [PATCH] Revert "msi: Perform button control events in greatest to least order."

This reverts commit f721a24a13bf250f0794b7249ffa863619b0b450.
---
 dlls/msi/dialog.c   |    2 +
 dlls/msi/msipriv.h  |    1 -
 dlls/msi/msiquery.c |   77 ---------------------------------------------------
 3 files changed, 1 insertions(+), 79 deletions(-)

diff --git a/dlls/msi/dialog.c b/dlls/msi/dialog.c
index 06558de..f40ed76 100644
--- a/dlls/msi/dialog.c
+++ b/dlls/msi/dialog.c
@@ -2912,7 +2912,7 @@ static UINT msi_dialog_button_handler( m
         return 0;
     }
 
-    r = MSI_ReverseIterateRecords( view, 0, msi_dialog_control_event, dialog );
+    r = MSI_IterateRecords( view, 0, msi_dialog_control_event, dialog );
     msiobj_release( &view->hdr );
 
     return r;
diff --git a/dlls/msi/msipriv.h b/dlls/msi/msipriv.h
index d65e0ab..94edb23 100644
--- a/dlls/msi/msipriv.h
+++ b/dlls/msi/msipriv.h
@@ -601,7 +601,6 @@ extern UINT MSI_OpenDatabaseW( LPCWSTR, 
 extern UINT MSI_DatabaseOpenViewW(MSIDATABASE *, LPCWSTR, MSIQUERY ** );
 extern UINT MSI_OpenQuery( MSIDATABASE *, MSIQUERY **, LPCWSTR, ... );
 typedef UINT (*record_func)( MSIRECORD *, LPVOID );
-extern UINT MSI_ReverseIterateRecords( MSIQUERY *, DWORD *, record_func, LPVOID );
 extern UINT MSI_IterateRecords( MSIQUERY *, DWORD *, record_func, LPVOID );
 extern MSIRECORD *MSI_QueryGetRecord( MSIDATABASE *db, LPCWSTR query, ... );
 extern UINT MSI_DatabaseImport( MSIDATABASE *, LPCWSTR, LPCWSTR );
diff --git a/dlls/msi/msiquery.c b/dlls/msi/msiquery.c
index 1346969..f91a123 100644
--- a/dlls/msi/msiquery.c
+++ b/dlls/msi/msiquery.c
@@ -27,7 +27,6 @@ #include "winbase.h"
 #include "winerror.h"
 #include "wine/debug.h"
 #include "wine/unicode.h"
-#include "wine/list.h"
 #include "msi.h"
 #include "msiquery.h"
 #include "objbase.h"
@@ -167,82 +166,6 @@ UINT MSI_OpenQuery( MSIDATABASE *db, MSI
     return r;
 }
 
-struct rec_list
-{
-    struct list entry;
-    MSIRECORD *rec;
-};
-
-UINT MSI_ReverseIterateRecords( MSIQUERY *view, DWORD *count,
-                                record_func func, LPVOID param )
-{
-    MSIRECORD *rec = NULL;
-    struct rec_list *add_rec; 
-    struct list records;
-    UINT r, n = 0, max = 0;
-
-    r = MSI_ViewExecute( view, NULL );
-    if( r != ERROR_SUCCESS )
-        return r;
-
-    list_init( &records );
-
-    if( count )
-        max = *count;
-
-    /* reverse the query */
-    for( n = 0; (max == 0) || (n < max); n++ )
-    {
-        r = MSI_ViewFetch( view, &rec );
-        if( r != ERROR_SUCCESS )
-        {
-            if ( r == ERROR_NO_MORE_ITEMS )
-                break;
-            else
-                goto done;
-        }
-
-        add_rec = msi_alloc( sizeof( *add_rec ) );
-        if (!add_rec)
-            goto done;
-
-        add_rec->rec = rec;
-        list_add_head( &records, &add_rec->entry );
-    }
-
-    /* iterate over the reversed records */
-    n = 0;
-    LIST_FOR_EACH_ENTRY( add_rec, &records, struct rec_list, entry )
-    {
-        if (func)
-            r = func( add_rec->rec, param );
-
-        msiobj_release( &add_rec->rec->hdr );
-        if ( r != ERROR_SUCCESS )
-            goto done;
-
-        n++;
-    }
-
-done:
-    MSI_ViewClose( view );
-
-    while ( !list_empty( &records ) )
-    {
-        add_rec = LIST_ENTRY( list_head( &records ), struct rec_list, entry );
-        list_remove( &add_rec->entry );
-        msi_free( add_rec );
-    }
-
-    if( count )
-        *count = n;
-
-    if( r == ERROR_NO_MORE_ITEMS )
-        r = ERROR_SUCCESS;
-
-    return r;
-}
-
 UINT MSI_IterateRecords( MSIQUERY *view, DWORD *count,
                          record_func func, LPVOID param )
 {
-- 
1.4.2.1


More information about the wine-patches mailing list