Commit a391a98a authored by Mike McCormack's avatar Mike McCormack Committed by Alexandre Julliard

- build a standard Wine list of classes instead of using an array

- use class pointers instead of array indexes
parent 80fdebbb
...@@ -133,6 +133,7 @@ typedef struct tagMSIAPPID ...@@ -133,6 +133,7 @@ typedef struct tagMSIAPPID
typedef struct tagMSICLASS typedef struct tagMSICLASS
{ {
struct list entry;
WCHAR CLSID[IDENTIFIER_SIZE]; /* Primary Key */ WCHAR CLSID[IDENTIFIER_SIZE]; /* Primary Key */
WCHAR Context[IDENTIFIER_SIZE]; /* Primary Key */ WCHAR Context[IDENTIFIER_SIZE]; /* Primary Key */
MSICOMPONENT *Component; MSICOMPONENT *Component;
...@@ -169,7 +170,7 @@ typedef struct tagMSIPROGID ...@@ -169,7 +170,7 @@ typedef struct tagMSIPROGID
{ {
LPWSTR ProgID; /* Primary Key */ LPWSTR ProgID; /* Primary Key */
INT ParentIndex; INT ParentIndex;
INT ClassIndex; MSICLASS *Class;
LPWSTR Description; LPWSTR Description;
LPWSTR IconPath; LPWSTR IconPath;
/* not in the table, set during installation */ /* not in the table, set during installation */
...@@ -192,7 +193,7 @@ typedef struct tagMSIMIME ...@@ -192,7 +193,7 @@ typedef struct tagMSIMIME
LPWSTR ContentType; /* Primary Key */ LPWSTR ContentType; /* Primary Key */
INT ExtensionIndex; INT ExtensionIndex;
WCHAR CLSID[IDENTIFIER_SIZE]; WCHAR CLSID[IDENTIFIER_SIZE];
INT ClassIndex; MSICLASS *Class;
/* not in the table, set during installation */ /* not in the table, set during installation */
BOOL InstallMe; BOOL InstallMe;
} MSIMIME; } MSIMIME;
......
...@@ -486,19 +486,19 @@ void ACTION_free_package_structures( MSIPACKAGE* package) ...@@ -486,19 +486,19 @@ void ACTION_free_package_structures( MSIPACKAGE* package)
} }
/* clean up extension, progid, class and verb structures */ /* clean up extension, progid, class and verb structures */
for (i = 0; i < package->loaded_classes; i++) LIST_FOR_EACH_SAFE( item, cursor, &package->classes )
{ {
HeapFree(GetProcessHeap(),0,package->classes[i].Description); MSICLASS *cls = LIST_ENTRY( item, MSICLASS, entry );
HeapFree(GetProcessHeap(),0,package->classes[i].FileTypeMask);
HeapFree(GetProcessHeap(),0,package->classes[i].IconPath);
HeapFree(GetProcessHeap(),0,package->classes[i].DefInprocHandler);
HeapFree(GetProcessHeap(),0,package->classes[i].DefInprocHandler32);
HeapFree(GetProcessHeap(),0,package->classes[i].Argument);
HeapFree(GetProcessHeap(),0,package->classes[i].ProgIDText);
}
if (package->classes && package->loaded_classes > 0) list_remove( &cls->entry );
HeapFree(GetProcessHeap(),0,package->classes); HeapFree( GetProcessHeap(), 0, cls->Description );
HeapFree( GetProcessHeap(), 0, cls->FileTypeMask );
HeapFree( GetProcessHeap(), 0, cls->IconPath );
HeapFree( GetProcessHeap(), 0, cls->DefInprocHandler );
HeapFree( GetProcessHeap(), 0, cls->DefInprocHandler32 );
HeapFree( GetProcessHeap(), 0, cls->Argument );
HeapFree( GetProcessHeap(), 0, cls->ProgIDText );
}
for (i = 0; i < package->loaded_extensions; i++) for (i = 0; i < package->loaded_extensions; i++)
{ {
......
...@@ -192,8 +192,7 @@ typedef struct tagMSIPACKAGE ...@@ -192,8 +192,7 @@ typedef struct tagMSIPACKAGE
LPWSTR ActionFormat; LPWSTR ActionFormat;
LPWSTR LastAction; LPWSTR LastAction;
struct tagMSICLASS *classes; struct list classes;
UINT loaded_classes;
struct tagMSIEXTENSION *extensions; struct tagMSIEXTENSION *extensions;
UINT loaded_extensions; UINT loaded_extensions;
struct tagMSIPROGID *progids; struct tagMSIPROGID *progids;
......
...@@ -387,6 +387,7 @@ MSIPACKAGE *MSI_CreatePackage( MSIDATABASE *db ) ...@@ -387,6 +387,7 @@ MSIPACKAGE *MSI_CreatePackage( MSIDATABASE *db )
package->next_dialog = NULL; package->next_dialog = NULL;
list_init( &package->subscriptions ); list_init( &package->subscriptions );
list_init( &package->appids ); list_init( &package->appids );
list_init( &package->classes );
/* OK, here is where we do a slew of things to the database to /* OK, here is where we do a slew of things to the database to
* prep for all that is to come as a package */ * prep for all that is to come as a package */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment