Do not loop if a ProgId's Parent Index it itself.

Add a VersionIndIndex for tracking version independent fields for the
ProgIds properly.
This commit is contained in:
Aric Stewart 2005-06-02 20:06:11 +00:00 committed by Alexandre Julliard
parent 20ad4d174e
commit a96e1cef9f
2 changed files with 13 additions and 8 deletions

View File

@ -4558,9 +4558,11 @@ static INT load_progid(MSIPACKAGE* package, MSIRECORD *row)
} }
package->progids[index].CurVerIndex = -1; package->progids[index].CurVerIndex = -1;
package->progids[index].VersionIndIndex = -1;
/* if we have a parent then we may be that parents CurVer */ /* if we have a parent then we may be that parents CurVer */
if (package->progids[index].ParentIndex >= 0) if (package->progids[index].ParentIndex >= 0 &&
package->progids[index].ParentIndex != index)
{ {
int pindex = package->progids[index].ParentIndex; int pindex = package->progids[index].ParentIndex;
while (package->progids[pindex].ParentIndex>= 0) while (package->progids[pindex].ParentIndex>= 0)
@ -4569,6 +4571,7 @@ static INT load_progid(MSIPACKAGE* package, MSIRECORD *row)
FIXME("BAD BAD need to determing if we are really the CurVer\n"); FIXME("BAD BAD need to determing if we are really the CurVer\n");
package->progids[index].CurVerIndex = pindex; package->progids[index].CurVerIndex = pindex;
package->progids[pindex].VersionIndIndex = index;
} }
return index; return index;
@ -5441,16 +5444,17 @@ static UINT ACTION_RegisterClassInfo(MSIPACKAGE *package)
RegCloseKey(hkey3); RegCloseKey(hkey3);
if (package->classes[i].ProgIDIndex >= 0 && if (package->classes[i].ProgIDIndex >= 0 &&
package->progids[package->classes[i].ProgIDIndex].ParentIndex package->progids[package->classes[i].ProgIDIndex].
>= 0) VersionIndIndex >= 0)
{ {
progid = package->progids[package->progids[ LPWSTR viprogid = strdupW(package->progids[package->progids[
package->classes[i].ProgIDIndex].ParentIndex].ProgID; package->classes[i].ProgIDIndex].VersionIndIndex].
ProgID);
RegCreateKeyW(hkey2,szVIProgID,&hkey3); RegCreateKeyW(hkey2,szVIProgID,&hkey3);
RegSetValueExW(hkey3,NULL,0,REG_SZ,(LPVOID)progid, RegSetValueExW(hkey3,NULL,0,REG_SZ,(LPVOID)viprogid,
(strlenW(progid)+1) *sizeof(WCHAR)); (strlenW(viprogid)+1) *sizeof(WCHAR));
RegCloseKey(hkey3); RegCloseKey(hkey3);
HeapFree(GetProcessHeap(), 0, viprogid);
} }
} }

View File

@ -147,6 +147,7 @@ typedef struct tagMSIPROGID
/* not in the table, set during installation */ /* not in the table, set during installation */
BOOL InstallMe; BOOL InstallMe;
INT CurVerIndex; INT CurVerIndex;
INT VersionIndIndex;
} MSIPROGID; } MSIPROGID;
typedef struct tagMSIVERB typedef struct tagMSIVERB