Author: ekohl Date: Mon Oct 6 18:35:17 2014 New Revision: 64566
URL: http://svn.reactos.org/svn/reactos?rev=64566&view=rev Log: [DEVMGR] - Replace the call to DevInstallW by InstallDevInst in the device properties. - Also call InstallDevInst from the device problem wizard. CORE-6350 #resolve
Modified: trunk/reactos/dll/win32/devmgr/advprop.c trunk/reactos/dll/win32/devmgr/devprblm.c trunk/reactos/dll/win32/devmgr/precomp.h
Modified: trunk/reactos/dll/win32/devmgr/advprop.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/devmgr/advprop.c?... ============================================================================== --- trunk/reactos/dll/win32/devmgr/advprop.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/devmgr/advprop.c [iso-8859-1] Mon Oct 6 18:35:17 2014 @@ -399,13 +399,6 @@ return Ret; }
-BOOL -WINAPI -DevInstallW( - IN HWND hWndParent, - IN HINSTANCE hInstance, - IN LPCWSTR InstanceId, - IN INT Show);
static VOID @@ -415,6 +408,7 @@ { TOKEN_PRIVILEGES Privileges; HANDLE hToken; + DWORD dwReboot; BOOL NeedReboot = FALSE;
// Better use InstallDevInst: @@ -426,7 +420,8 @@ // BOOL bUpdate, // DWORD *dwReboot); // See: http://comp.os.ms-windows.programmer.win32.narkive.com/J8FTd4KK/signature-of... - if (!DevInstallW(hwndDlg, NULL, dap->szDeviceID, SW_SHOWNOACTIVATE)) + + if (!InstallDevInst(hwndDlg, dap->szDeviceID, TRUE, &dwReboot)) return;
if (NeedReboot == FALSE) @@ -1619,6 +1614,8 @@ DWORD nDriverPages = 0; BOOL RecalcPages = FALSE;
+ TRACE("UpdateDevInfo()\n"); + hPropSheetDlg = GetParent(hwndDlg);
if (dap->PageInitialized) @@ -2014,6 +2011,7 @@ dap->PropertySheetType) && nDriverPages != 0 && GetLastError() == ERROR_INSUFFICIENT_BUFFER) { +TRACE("Count %d additional pages!\n", nDriverPages); dap->nDevPropSheets += nDriverPages; } else @@ -2035,6 +2033,7 @@ /* 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 @@ { /* 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;
Modified: trunk/reactos/dll/win32/devmgr/devprblm.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/devmgr/devprblm.c... ============================================================================== --- trunk/reactos/dll/win32/devmgr/devprblm.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/devmgr/devprblm.c [iso-8859-1] Mon Oct 6 18:35:17 2014 @@ -34,9 +34,19 @@ 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, @@ -62,6 +72,7 @@ case CM_PROB_UNKNOWN_RESOURCE: { /* FIXME - display the update driver wizard */ + InstallDevInst(hWndParent, szDeviceInstanceId, TRUE, &dwReboot); break; }
@@ -78,6 +89,7 @@ case CM_PROB_FAILED_INSTALL: { /* FIXME - display the driver (re)installation wizard */ + InstallDevInst(hWndParent, szDeviceInstanceId, TRUE, &dwReboot); break; }
Modified: trunk/reactos/dll/win32/devmgr/precomp.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/devmgr/precomp.h?... ============================================================================== --- trunk/reactos/dll/win32/devmgr/precomp.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/devmgr/precomp.h [iso-8859-1] Mon Oct 6 18:35:17 2014 @@ -13,6 +13,7 @@ #include <regstr.h> #include <setupapi.h> #include <cfgmgr32.h> +#include <dll/newdevp.h> #include <dll/devmgr/devmgr.h> #include <wine/debug.h>