Author: gedmurphy Date: Mon Oct 19 13:52:12 2015 New Revision: 69619
URL: http://svn.reactos.org/svn/reactos?rev=69619&view=rev Log: [DEVMGR] - Implement the add new hardware wizard - fix stray header CORE-10363
Modified: trunk/reactos/dll/win32/devmgr/api.cpp trunk/reactos/dll/win32/devmgr/devmgmt/DeviceView.cpp trunk/reactos/dll/win32/devmgr/devmgmt/DeviceView.h trunk/reactos/dll/win32/devmgr/precomp.h trunk/reactos/dll/win32/devmgr/properties/advprop.cpp trunk/reactos/dll/win32/devmgr/properties/devprblm.cpp trunk/reactos/dll/win32/devmgr/properties/hwpage.cpp trunk/reactos/dll/win32/devmgr/properties/hwresource.cpp trunk/reactos/dll/win32/devmgr/properties/misc.cpp
Modified: trunk/reactos/dll/win32/devmgr/api.cpp URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/devmgr/api.cpp?re... ============================================================================== --- trunk/reactos/dll/win32/devmgr/api.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/devmgr/api.cpp [iso-8859-1] Mon Oct 19 13:52:12 2015 @@ -17,7 +17,6 @@ */
#include "precomp.h" -#include <devmgr/devmgr.h> #include "devmgmt/MainWindow.h" #include "properties/properties.h"
Modified: trunk/reactos/dll/win32/devmgr/devmgmt/DeviceView.cpp URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/devmgr/devmgmt/De... ============================================================================== --- trunk/reactos/dll/win32/devmgr/devmgmt/DeviceView.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/devmgr/devmgmt/DeviceView.cpp [iso-8859-1] Mon Oct 19 13:52:12 2015 @@ -19,18 +19,8 @@ #define CLASS_DESC_LEN 256 #define ROOT_NAME_SIZE MAX_COMPUTERNAME_LENGTH + 1
-extern "C" { -INT_PTR -WINAPI -DevicePropertiesExW( - IN HWND hWndParent OPTIONAL, - IN LPCWSTR lpMachineName OPTIONAL, - IN LPCWSTR lpDeviceID OPTIONAL, - IN DWORD dwFlags OPTIONAL, - IN BOOL bShowDevMgr -); -} -typedef INT_PTR(WINAPI *pDevicePropertiesExW)(HWND,LPCWSTR,LPCWSTR,DWORD,BOOL); + +typedef VOID(WINAPI *PADDHARDWAREWIZARD)(HWND hwnd, LPWSTR lpName);
struct RefreshThreadData { @@ -284,7 +274,7 @@
case IDC_ADD_HARDWARE: { - MessageBox(m_hMainWnd, L"Not yet implemented", L"Add Hardware", MB_OK); + RunAddHardwareWizard(); break; } } @@ -295,24 +285,6 @@ void CDeviceView::DisplayPropertySheet() { - // - // In ReactOS we can link to DevicePropertiesEx but - // not in windows as it's not part of the SDK - -#ifndef __REACTOS__ - HMODULE hModule = LoadLibraryW(L"devmgr.dll"); - if (hModule == NULL) return; - - pDevicePropertiesExW DevicePropertiesExW; - DevicePropertiesExW = (pDevicePropertiesExW)GetProcAddress(hModule, - "DevicePropertiesExW"); - if (DevicePropertiesExW == NULL) - { - FreeLibrary(hModule); - return; - } -#endif - CNode *Node = GetSelectedNode(); if (Node && Node->HasProperties()) { @@ -322,10 +294,6 @@ 1,//DPF_EXTENDED, FALSE); } - -#ifndef __REACTOS__ - FreeLibrary(hModule); -#endif }
void @@ -782,6 +750,29 @@ }
bool +CDeviceView::RunAddHardwareWizard() +{ + PADDHARDWAREWIZARD pAddHardwareWizard; + HMODULE hModule; + + hModule = LoadLibraryW(L"hdwwiz.cpl"); + if (hModule == NULL) return false; + + pAddHardwareWizard = (PADDHARDWAREWIZARD)GetProcAddress(hModule, + "AddHardwareWizard"); + if (pAddHardwareWizard == NULL) + { + FreeLibrary(hModule); + return false; + } + + pAddHardwareWizard(m_hMainWnd, NULL); + + FreeLibrary(hModule); + return true; +} + +bool CDeviceView::GetChildDevice( _In_ DEVINST ParentDevInst, _Out_ PDEVINST DevInst
Modified: trunk/reactos/dll/win32/devmgr/devmgmt/DeviceView.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/devmgr/devmgmt/De... ============================================================================== --- trunk/reactos/dll/win32/devmgr/devmgmt/DeviceView.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/devmgr/devmgmt/DeviceView.h [iso-8859-1] Mon Oct 19 13:52:12 2015 @@ -122,6 +122,9 @@ bool UninstallSelectedDevice( );
+ bool RunAddHardwareWizard( + ); + bool GetChildDevice( _In_ DEVINST ParentDevInst, _Out_ PDEVINST DevInst
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 19 13:52:12 2015 @@ -21,6 +21,8 @@ #include <atlcoll.h>
#include <strsafe.h> + +#include <devmgr/devmgr.h>
#define ERR printf #define FIXME printf @@ -68,6 +70,7 @@ #include <atlstr.h> #include <atlcoll.h>
+#include <devmgr/devmgr.h> #include <wine/debug.h>
//WINE_DEFAULT_DEBUG_CHANNEL(devmgr);
Modified: trunk/reactos/dll/win32/devmgr/properties/advprop.cpp URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/devmgr/properties... ============================================================================== --- trunk/reactos/dll/win32/devmgr/properties/advprop.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/devmgr/properties/advprop.cpp [iso-8859-1] Mon Oct 19 13:52:12 2015 @@ -28,7 +28,6 @@ */
#include "precomp.h" -#include <devmgr/devmgr.h> #include "properties.h" #include "resource.h"
Modified: trunk/reactos/dll/win32/devmgr/properties/devprblm.cpp URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/devmgr/properties... ============================================================================== --- trunk/reactos/dll/win32/devmgr/properties/devprblm.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/devmgr/properties/devprblm.cpp [iso-8859-1] Mon Oct 19 13:52:12 2015 @@ -26,7 +26,6 @@ */
#include "precomp.h" -#include <devmgr/devmgr.h> #include "properties.h" #include "resource.h"
Modified: trunk/reactos/dll/win32/devmgr/properties/hwpage.cpp URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/devmgr/properties... ============================================================================== --- trunk/reactos/dll/win32/devmgr/properties/hwpage.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/devmgr/properties/hwpage.cpp [iso-8859-1] Mon Oct 19 13:52:12 2015 @@ -26,7 +26,6 @@ */
#include "precomp.h" -#include <devmgr/devmgr.h> #include "properties.h" #include "resource.h"
Modified: trunk/reactos/dll/win32/devmgr/properties/hwresource.cpp URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/devmgr/properties... ============================================================================== --- trunk/reactos/dll/win32/devmgr/properties/hwresource.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/devmgr/properties/hwresource.cpp [iso-8859-1] Mon Oct 19 13:52:12 2015 @@ -8,7 +8,6 @@ */
#include "precomp.h" -#include <devmgr/devmgr.h> #include "properties.h" #include "resource.h"
Modified: trunk/reactos/dll/win32/devmgr/properties/misc.cpp URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/devmgr/properties... ============================================================================== --- trunk/reactos/dll/win32/devmgr/properties/misc.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/devmgr/properties/misc.cpp [iso-8859-1] Mon Oct 19 13:52:12 2015 @@ -26,7 +26,6 @@ */
#include "precomp.h" -#include <devmgr/devmgr.h> #include "properties.h" #include "resource.h"