fixing bug #16694. fixes crash bug in the select components dialog in the windows installer. r=sgehani. Affects only windows platform.
git-svn-id: svn://10.0.0.236/trunk@51021 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
068b895d74
commit
ef93fdf802
@ -685,19 +685,18 @@ void ToggleCheck(HWND hwndListBox, DWORD dwIndex)
|
||||
|
||||
// Checks to see if the checkbox is checked or not checked, and
|
||||
// toggles the node attributes appropriately.
|
||||
if(SiCNodeGetAttributes(dwIndex) & SIC_SELECTED)
|
||||
{
|
||||
SiCNodeSetAttributes(dwIndex, SIC_SELECTED, FALSE);
|
||||
}
|
||||
else
|
||||
{
|
||||
SiCNodeSetAttributes(dwIndex, SIC_SELECTED, TRUE);
|
||||
bMoreToResolve = ResolveDependencies(dwIndex);
|
||||
while(bMoreToResolve)
|
||||
if(SiCNodeGetAttributes(dwIndex, FALSE) & SIC_SELECTED)
|
||||
{
|
||||
bMoreToResolve = ResolveDependencies(-1);
|
||||
SiCNodeSetAttributes(dwIndex, SIC_SELECTED, FALSE, FALSE);
|
||||
}
|
||||
else
|
||||
{
|
||||
SiCNodeSetAttributes(dwIndex, SIC_SELECTED, TRUE, FALSE);
|
||||
bMoreToResolve = ResolveDependencies(dwIndex);
|
||||
|
||||
while(bMoreToResolve)
|
||||
bMoreToResolve = ResolveDependencies(-1);
|
||||
}
|
||||
}
|
||||
|
||||
InvalidateLBCheckbox(hwndListBox);
|
||||
}
|
||||
@ -796,17 +795,20 @@ LRESULT CALLBACK DlgProcSelectComponents(HWND hDlg, UINT msg, WPARAM wParam, LON
|
||||
siCTemp = siComponents;
|
||||
if(siCTemp != NULL)
|
||||
{
|
||||
lbAddItem(hwndLBComponents, siCTemp);
|
||||
if(!(siCTemp->dwAttributes & SIC_INVISIBLE))
|
||||
lbAddItem(hwndLBComponents, siCTemp);
|
||||
|
||||
siCTemp = siCTemp->Next;
|
||||
while((siCTemp != siComponents) && (siCTemp != NULL))
|
||||
{
|
||||
lbAddItem(hwndLBComponents, siCTemp);
|
||||
if(!(siCTemp->dwAttributes & SIC_INVISIBLE))
|
||||
lbAddItem(hwndLBComponents, siCTemp);
|
||||
|
||||
siCTemp = siCTemp->Next;
|
||||
}
|
||||
SetFocus(hwndLBComponents);
|
||||
SendMessage(hwndLBComponents, LB_SETCURSEL, 0, 0);
|
||||
SetDlgItemText(hDlg, IDC_STATIC_DESCRIPTION, SiCNodeGetDescriptionLong(0));
|
||||
SetDlgItemText(hDlg, IDC_STATIC_DESCRIPTION, SiCNodeGetDescriptionLong(0, FALSE));
|
||||
}
|
||||
|
||||
if(GetClientRect(hDlg, &rDlg))
|
||||
@ -945,7 +947,7 @@ LRESULT CALLBACK DlgProcSelectComponents(HWND hDlg, UINT msg, WPARAM wParam, LON
|
||||
case IDC_LIST_COMPONENTS:
|
||||
/* to update the long description for each component the user selected */
|
||||
if((dwIndex = SendMessage(hwndLBComponents, LB_GETCURSEL, 0, 0)) != LB_ERR)
|
||||
SetDlgItemText(hDlg, IDC_STATIC_DESCRIPTION, SiCNodeGetDescriptionLong(dwIndex));
|
||||
SetDlgItemText(hDlg, IDC_STATIC_DESCRIPTION, SiCNodeGetDescriptionLong(dwIndex, FALSE));
|
||||
break;
|
||||
|
||||
case ID_WIZNEXT:
|
||||
|
||||
@ -1249,58 +1249,74 @@ void SiCDepNodeDelete(siCD *siCDepTemp)
|
||||
}
|
||||
}
|
||||
|
||||
HRESULT SiCNodeGetAttributes(DWORD dwIndex)
|
||||
HRESULT SiCNodeGetAttributes(DWORD dwIndex, BOOL bIncludeInvisible)
|
||||
{
|
||||
DWORD dwCount = 0;
|
||||
siC *siCTemp = siComponents;
|
||||
|
||||
if(siCTemp != NULL)
|
||||
{
|
||||
if(dwIndex == 0)
|
||||
return(siCTemp->dwAttributes);
|
||||
if((bIncludeInvisible == TRUE) || ((bIncludeInvisible == FALSE) && (!(siCTemp->dwAttributes & SIC_INVISIBLE))))
|
||||
{
|
||||
if(dwIndex == 0)
|
||||
return(siCTemp->dwAttributes);
|
||||
|
||||
++dwCount;
|
||||
}
|
||||
|
||||
++dwCount;
|
||||
siCTemp = siCTemp->Next;
|
||||
while((siCTemp != NULL) && (siCTemp != siComponents))
|
||||
{
|
||||
if(dwIndex == dwCount)
|
||||
return(siCTemp->dwAttributes);
|
||||
if((bIncludeInvisible == TRUE) || ((bIncludeInvisible == FALSE) && (!(siCTemp->dwAttributes & SIC_INVISIBLE))))
|
||||
{
|
||||
if(dwIndex == dwCount)
|
||||
return(siCTemp->dwAttributes);
|
||||
|
||||
++dwCount;
|
||||
}
|
||||
|
||||
++dwCount;
|
||||
siCTemp = siCTemp->Next;
|
||||
}
|
||||
}
|
||||
return(-1);
|
||||
}
|
||||
|
||||
void SiCNodeSetAttributes(DWORD dwIndex, DWORD dwAttributes, BOOL bSet)
|
||||
void SiCNodeSetAttributes(DWORD dwIndex, DWORD dwAttributes, BOOL bSet, BOOL bIncludeInvisible)
|
||||
{
|
||||
DWORD dwCount = 0;
|
||||
siC *siCTemp = siComponents;
|
||||
|
||||
if(siCTemp != NULL)
|
||||
{
|
||||
if(dwIndex == 0)
|
||||
if((bIncludeInvisible == TRUE) || ((bIncludeInvisible == FALSE) && (!(siCTemp->dwAttributes & SIC_INVISIBLE))))
|
||||
{
|
||||
if(bSet)
|
||||
siCTemp->dwAttributes |= dwAttributes;
|
||||
else
|
||||
siCTemp->dwAttributes &= ~dwAttributes;
|
||||
if(dwIndex == 0)
|
||||
{
|
||||
if(bSet)
|
||||
siCTemp->dwAttributes |= dwAttributes;
|
||||
else
|
||||
siCTemp->dwAttributes &= ~dwAttributes;
|
||||
}
|
||||
|
||||
++dwCount;
|
||||
}
|
||||
|
||||
++dwCount;
|
||||
siCTemp = siCTemp->Next;
|
||||
while((siCTemp != NULL) && (siCTemp != siComponents))
|
||||
{
|
||||
if(dwIndex == dwCount)
|
||||
if((bIncludeInvisible == TRUE) || ((bIncludeInvisible == FALSE) && (!(siCTemp->dwAttributes & SIC_INVISIBLE))))
|
||||
{
|
||||
if(bSet)
|
||||
siCTemp->dwAttributes |= dwAttributes;
|
||||
else
|
||||
siCTemp->dwAttributes &= ~dwAttributes;
|
||||
if(dwIndex == dwCount)
|
||||
{
|
||||
if(bSet)
|
||||
siCTemp->dwAttributes |= dwAttributes;
|
||||
else
|
||||
siCTemp->dwAttributes &= ~dwAttributes;
|
||||
}
|
||||
|
||||
++dwCount;
|
||||
}
|
||||
|
||||
++dwCount;
|
||||
|
||||
siCTemp = siCTemp->Next;
|
||||
}
|
||||
}
|
||||
@ -1356,48 +1372,64 @@ void SiCNodeSetItemsSelected(DWORD dwItems, DWORD *dwItemsSelected)
|
||||
}
|
||||
}
|
||||
|
||||
char *SiCNodeGetDescriptionLong(DWORD dwIndex)
|
||||
char *SiCNodeGetDescriptionLong(DWORD dwIndex, BOOL bIncludeInvisible)
|
||||
{
|
||||
DWORD dwCount = 0;
|
||||
siC *siCTemp = siComponents;
|
||||
|
||||
if(siCTemp != NULL)
|
||||
{
|
||||
if(dwIndex == 0)
|
||||
return(siCTemp->szDescriptionLong);
|
||||
if((bIncludeInvisible == TRUE) || ((bIncludeInvisible == FALSE) && (!(siCTemp->dwAttributes & SIC_INVISIBLE))))
|
||||
{
|
||||
if(dwIndex == 0)
|
||||
return(siCTemp->szDescriptionLong);
|
||||
|
||||
++dwCount;
|
||||
}
|
||||
|
||||
++dwCount;
|
||||
siCTemp = siCTemp->Next;
|
||||
while((siCTemp != NULL) && (siCTemp != siComponents))
|
||||
{
|
||||
if(dwIndex == dwCount)
|
||||
return(siCTemp->szDescriptionLong);
|
||||
if((bIncludeInvisible == TRUE) || ((bIncludeInvisible == FALSE) && (!(siCTemp->dwAttributes & SIC_INVISIBLE))))
|
||||
{
|
||||
if(dwIndex == dwCount)
|
||||
return(siCTemp->szDescriptionLong);
|
||||
|
||||
++dwCount;
|
||||
++dwCount;
|
||||
}
|
||||
|
||||
siCTemp = siCTemp->Next;
|
||||
}
|
||||
}
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
ULONGLONG SiCNodeGetInstallSize(DWORD dwIndex)
|
||||
ULONGLONG SiCNodeGetInstallSize(DWORD dwIndex, BOOL bIncludeInvisible)
|
||||
{
|
||||
DWORD dwCount = 0;
|
||||
siC *siCTemp = siComponents;
|
||||
|
||||
if(siCTemp != NULL)
|
||||
{
|
||||
if(dwIndex == 0)
|
||||
return(siCTemp->ullInstallSize);
|
||||
if((bIncludeInvisible == TRUE) || ((bIncludeInvisible == FALSE) && (!(siCTemp->dwAttributes & SIC_INVISIBLE))))
|
||||
{
|
||||
if(dwIndex == 0)
|
||||
return(siCTemp->ullInstallSize);
|
||||
|
||||
++dwCount;
|
||||
++dwCount;
|
||||
}
|
||||
|
||||
siCTemp = siCTemp->Next;
|
||||
while((siCTemp != NULL) && (siCTemp != siComponents))
|
||||
{
|
||||
if(dwIndex == dwCount)
|
||||
return(siCTemp->ullInstallSize);
|
||||
if((bIncludeInvisible == TRUE) || ((bIncludeInvisible == FALSE) && (!(siCTemp->dwAttributes & SIC_INVISIBLE))))
|
||||
{
|
||||
if(dwIndex == dwCount)
|
||||
return(siCTemp->ullInstallSize);
|
||||
|
||||
++dwCount;
|
||||
}
|
||||
|
||||
++dwCount;
|
||||
siCTemp = siCTemp->Next;
|
||||
}
|
||||
}
|
||||
@ -1933,10 +1965,10 @@ BOOL ResolveComponentDependency(siCD *siCDInDependency)
|
||||
{
|
||||
if((dwIndex = SiCNodeGetIndexDS(siCDepTemp->szDescriptionShort)) != -1)
|
||||
{
|
||||
if((SiCNodeGetAttributes(dwIndex) & SIC_SELECTED) == FALSE)
|
||||
if((SiCNodeGetAttributes(dwIndex, TRUE) & SIC_SELECTED) == FALSE)
|
||||
{
|
||||
bMoreToResolve = TRUE;
|
||||
SiCNodeSetAttributes(dwIndex, SIC_SELECTED, TRUE);
|
||||
SiCNodeSetAttributes(dwIndex, SIC_SELECTED, TRUE, TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1945,10 +1977,10 @@ BOOL ResolveComponentDependency(siCD *siCDInDependency)
|
||||
{
|
||||
if((dwIndex = SiCNodeGetIndexDS(siCDepTemp->szDescriptionShort)) != -1)
|
||||
{
|
||||
if((SiCNodeGetAttributes(dwIndex) & SIC_SELECTED) == FALSE)
|
||||
if((SiCNodeGetAttributes(dwIndex, TRUE) & SIC_SELECTED) == FALSE)
|
||||
{
|
||||
bMoreToResolve = TRUE;
|
||||
SiCNodeSetAttributes(dwIndex, SIC_SELECTED, TRUE);
|
||||
SiCNodeSetAttributes(dwIndex, SIC_SELECTED, TRUE, TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1969,7 +2001,7 @@ BOOL ResolveDependencies(DWORD dwIndex)
|
||||
/* can resolve specific component or all components (-1) */
|
||||
if((dwIndex == dwCount) || (dwIndex == -1))
|
||||
{
|
||||
if(SiCNodeGetAttributes(dwCount) & SIC_SELECTED)
|
||||
if(SiCNodeGetAttributes(dwCount, TRUE) & SIC_SELECTED)
|
||||
{
|
||||
bMoreToResolve = ResolveComponentDependency(siCTemp->siCDDependencies);
|
||||
if(dwIndex == dwCount)
|
||||
@ -1986,7 +2018,7 @@ BOOL ResolveDependencies(DWORD dwIndex)
|
||||
/* can resolve specific component or all components (-1) */
|
||||
if((dwIndex == dwCount) || (dwIndex == -1))
|
||||
{
|
||||
if(SiCNodeGetAttributes(dwCount) & SIC_SELECTED)
|
||||
if(SiCNodeGetAttributes(dwCount, TRUE) & SIC_SELECTED)
|
||||
{
|
||||
bMoreToResolve = ResolveComponentDependency(siCTemp->siCDDependencies);
|
||||
if(dwIndex == dwCount)
|
||||
|
||||
@ -54,12 +54,12 @@ void SiCNodeDelete(siC *siCTemp);
|
||||
siCD *CreateSiCDepNode(void);
|
||||
void SiCDepNodeDelete(siCD *siCDepTemp);
|
||||
void SiCDepNodeInsert(siCD **siCDepHead, siCD *siCDepTemp);
|
||||
HRESULT SiCNodeGetAttributes(DWORD dwIndex);
|
||||
void SiCNodeSetAttributes(DWORD dwIndex, DWORD dwAttributes, BOOL bSet);
|
||||
HRESULT SiCNodeGetAttributes(DWORD dwIndex, BOOL bIncludeInvisible);
|
||||
void SiCNodeSetAttributes(DWORD dwIndex, DWORD dwAttributes, BOOL bSet, BOOL bIncludeInvisible);
|
||||
void SiCNodeSetItemsSelected(DWORD dwItems, DWORD *dwItemsSelected);
|
||||
char *SiCNodeGetDescriptionLong(DWORD dwIndex);
|
||||
char *SiCNodeGetDescriptionLong(DWORD dwIndex, BOOL bIncludeInvisible);
|
||||
siC *SiCNodeGetObject(DWORD dwIndex, BOOL bIncludeInvisibleObjs);
|
||||
ULONGLONG SiCNodeGetInstallSize(DWORD dwIndex);
|
||||
ULONGLONG SiCNodeGetInstallSize(DWORD dwIndex, BOOL bIncludeInvisible);
|
||||
void InitSiComponents(char *szFileIni);
|
||||
HRESULT ParseComponentAttributes(char *szBuf);
|
||||
void InitSiComponents(char *szFileIni);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user