mirror of
https://github.com/reactos/reactos.git
synced 2025-08-04 03:46:38 +00:00
fixed call to SetupDiGetClassDevPropertySheets
svn path=/trunk/; revision=19782
This commit is contained in:
parent
03ed25518a
commit
72aa8c78c4
1 changed files with 17 additions and 44 deletions
|
@ -169,23 +169,12 @@ DisplayDeviceAdvancedProperties(IN HWND hWndParent,
|
||||||
PROPSHEETHEADER psh = {0};
|
PROPSHEETHEADER psh = {0};
|
||||||
PROPSHEETPAGE pspGeneral = {0};
|
PROPSHEETPAGE pspGeneral = {0};
|
||||||
DWORD nPropSheets = 0;
|
DWORD nPropSheets = 0;
|
||||||
DWORD nDevSheetsStart = 0;
|
|
||||||
PPROPERTYSHEETW pPropertySheetW;
|
PPROPERTYSHEETW pPropertySheetW;
|
||||||
PCREATEPROPERTYSHEETPAGEW pCreatePropertySheetPageW;
|
PCREATEPROPERTYSHEETPAGEW pCreatePropertySheetPageW;
|
||||||
PDESTROYPROPERTYSHEETPAGE pDestroyPropertySheetPage;
|
PDESTROYPROPERTYSHEETPAGE pDestroyPropertySheetPage;
|
||||||
PDEVADVPROP_INFO DevAdvPropInfo;
|
PDEVADVPROP_INFO DevAdvPropInfo;
|
||||||
DWORD PropertySheetType;
|
DWORD PropertySheetType;
|
||||||
HANDLE hMachine = NULL;
|
HANDLE hMachine = NULL;
|
||||||
UINT nPages = 0;
|
|
||||||
union
|
|
||||||
{
|
|
||||||
ULONG Mask;
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
ULONG General : 1;
|
|
||||||
ULONG Device : 1;
|
|
||||||
} Page;
|
|
||||||
} DelPropSheets = {0};
|
|
||||||
INT_PTR Ret = -1;
|
INT_PTR Ret = -1;
|
||||||
|
|
||||||
/* we don't want to statically link against comctl32, so find the
|
/* we don't want to statically link against comctl32, so find the
|
||||||
|
@ -283,60 +272,44 @@ DisplayDeviceAdvancedProperties(IN HWND hWndParent,
|
||||||
psh.phpage[0] = pCreatePropertySheetPageW(&pspGeneral);
|
psh.phpage[0] = pCreatePropertySheetPageW(&pspGeneral);
|
||||||
if (psh.phpage[0] != NULL)
|
if (psh.phpage[0] != NULL)
|
||||||
{
|
{
|
||||||
DelPropSheets.Page.General = TRUE;
|
psh.nPages++;
|
||||||
nDevSheetsStart++;
|
|
||||||
nPages++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nPropSheets != 0)
|
if (nPropSheets != 0)
|
||||||
{
|
{
|
||||||
/* create the device property sheets but don't overwrite
|
/* create the device property sheets */
|
||||||
the "General" property sheet handle */
|
|
||||||
psh.phpage += nDevSheetsStart;
|
|
||||||
if (!SetupDiGetClassDevPropertySheets(DeviceInfoSet,
|
if (!SetupDiGetClassDevPropertySheets(DeviceInfoSet,
|
||||||
DeviceInfoData,
|
DeviceInfoData,
|
||||||
&psh,
|
&psh,
|
||||||
nPropSheets,
|
nPropSheets + psh.nPages,
|
||||||
NULL,
|
NULL,
|
||||||
PropertySheetType))
|
PropertySheetType))
|
||||||
{
|
{
|
||||||
goto Cleanup;
|
goto Cleanup;
|
||||||
}
|
}
|
||||||
psh.phpage -= nDevSheetsStart;
|
|
||||||
|
|
||||||
DelPropSheets.Page.Device = TRUE;
|
|
||||||
nPages += nPropSheets;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
psh.nPages = nPages;
|
|
||||||
|
|
||||||
/* FIXME - add the "Driver" property sheet if necessary */
|
/* FIXME - add the "Driver" property sheet if necessary */
|
||||||
|
|
||||||
Ret = pPropertySheetW(&psh);
|
if (psh.nPages != 0)
|
||||||
|
{
|
||||||
|
Ret = pPropertySheetW(&psh);
|
||||||
|
|
||||||
/* no need to destroy the property sheets anymore */
|
/* NOTE: no need to destroy the property sheets anymore! */
|
||||||
DelPropSheets.Mask = 0;
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
UINT i;
|
||||||
|
|
||||||
Cleanup:
|
Cleanup:
|
||||||
/* in case of failure the property sheets must be destroyed */
|
/* in case of failure the property sheets must be destroyed */
|
||||||
if (DelPropSheets.Mask != 0)
|
for (i = 0;
|
||||||
{
|
i < psh.nPages;
|
||||||
if (DelPropSheets.Page.General && psh.phpage[0] != NULL)
|
i++)
|
||||||
{
|
{
|
||||||
pDestroyPropertySheetPage(psh.phpage[0]);
|
if (psh.phpage[i] != NULL)
|
||||||
}
|
|
||||||
|
|
||||||
if (DelPropSheets.Page.Device)
|
|
||||||
{
|
|
||||||
UINT i;
|
|
||||||
for (i = 0;
|
|
||||||
i < nPropSheets;
|
|
||||||
i++)
|
|
||||||
{
|
{
|
||||||
if (psh.phpage[i + 1] != NULL)
|
pDestroyPropertySheetPage(psh.phpage[i]);
|
||||||
{
|
|
||||||
pDestroyPropertySheetPage(psh.phpage[i + 1]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue