diff --git a/reactos/dll/win32/devmgr/advprop.c b/reactos/dll/win32/devmgr/advprop.c index ee74caeebe4..5761752e56a 100644 --- a/reactos/dll/win32/devmgr/advprop.c +++ b/reactos/dll/win32/devmgr/advprop.c @@ -399,13 +399,6 @@ DriverDetailsDlgProc(IN HWND hwndDlg, return Ret; } -BOOL -WINAPI -DevInstallW( - IN HWND hWndParent, - IN HINSTANCE hInstance, - IN LPCWSTR InstanceId, - IN INT Show); static VOID @@ -415,6 +408,7 @@ UpdateDriver( { TOKEN_PRIVILEGES Privileges; HANDLE hToken; + DWORD dwReboot; BOOL NeedReboot = FALSE; // Better use InstallDevInst: @@ -426,7 +420,8 @@ UpdateDriver( // BOOL bUpdate, // DWORD *dwReboot); // See: http://comp.os.ms-windows.programmer.win32.narkive.com/J8FTd4KK/signature-of-undocumented-installdevinstex - if (!DevInstallW(hwndDlg, NULL, dap->szDeviceID, SW_SHOWNOACTIVATE)) + + if (!InstallDevInst(hwndDlg, dap->szDeviceID, TRUE, &dwReboot)) return; if (NeedReboot == FALSE) @@ -1619,6 +1614,8 @@ UpdateDevInfo(IN HWND hwndDlg, DWORD nDriverPages = 0; BOOL RecalcPages = FALSE; + TRACE("UpdateDevInfo()\n"); + hPropSheetDlg = GetParent(hwndDlg); if (dap->PageInitialized) @@ -2014,6 +2011,7 @@ GetParentNode: dap->PropertySheetType) && nDriverPages != 0 && GetLastError() == ERROR_INSUFFICIENT_BUFFER) { +TRACE("Count %d additional pages!\n", nDriverPages); dap->nDevPropSheets += nDriverPages; } else @@ -2035,6 +2033,7 @@ GetParentNode: /* add the device property sheets */ if (dap->nDevPropSheets != 0) { +TRACE("Show %d pages!\n", dap->nDevPropSheets); dap->DevPropSheets = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, dap->nDevPropSheets * sizeof(HPROPSHEETPAGE)); @@ -2054,20 +2053,28 @@ GetParentNode: { /* add the property sheets */ for (iPage = 0; - iPage != nDriverPages; + iPage < nDriverPages; iPage++) { +TRACE("Add page %d\n", iPage); +TRACE("Sheet %p\n", dap->DevPropSheets[iPage]); + if (PropSheet_AddPage(hPropSheetDlg, dap->DevPropSheets[iPage])) { RecalcPages = TRUE; } + else + { +TRACE("PropSheet_AddPage() failed\n"); + } } dap->FreeDevPropSheets = TRUE; } else { +TRACE("SetupDiGetClassDevPropertySheets() failed\n"); /* cleanup, we were unable to get the device property sheets */ iPage = nDriverPages; dap->nDevPropSheets -= nDriverPages; diff --git a/reactos/dll/win32/devmgr/devprblm.c b/reactos/dll/win32/devmgr/devprblm.c index e27174749c9..6265f500b00 100644 --- a/reactos/dll/win32/devmgr/devprblm.c +++ b/reactos/dll/win32/devmgr/devprblm.c @@ -34,10 +34,20 @@ ShowDeviceProblemWizard(IN HWND hWndParent OPTIONAL, IN PSP_DEVINFO_DATA DevInfoData, IN HMACHINE hMachine OPTIONAL) { + WCHAR szDeviceInstanceId[256]; CONFIGRET cr; ULONG Status, ProblemNumber; + DWORD dwReboot; BOOL Ret = FALSE; + /* Get the device instance id */ + if (!SetupDiGetDeviceInstanceId(hDevInfo, + DevInfoData, + szDeviceInstanceId, + 256, + NULL)) + return FALSE; + cr = CM_Get_DevNode_Status_Ex(&Status, &ProblemNumber, DevInfoData->DevInst, @@ -62,6 +72,7 @@ ShowDeviceProblemWizard(IN HWND hWndParent OPTIONAL, case CM_PROB_UNKNOWN_RESOURCE: { /* FIXME - display the update driver wizard */ + InstallDevInst(hWndParent, szDeviceInstanceId, TRUE, &dwReboot); break; } @@ -78,6 +89,7 @@ ShowDeviceProblemWizard(IN HWND hWndParent OPTIONAL, case CM_PROB_FAILED_INSTALL: { /* FIXME - display the driver (re)installation wizard */ + InstallDevInst(hWndParent, szDeviceInstanceId, TRUE, &dwReboot); break; } diff --git a/reactos/dll/win32/devmgr/precomp.h b/reactos/dll/win32/devmgr/precomp.h index 2bf42669701..29f46314533 100644 --- a/reactos/dll/win32/devmgr/precomp.h +++ b/reactos/dll/win32/devmgr/precomp.h @@ -13,6 +13,7 @@ #include #include #include +#include #include #include