- Implement the add new hardware wizard
- fix stray header
CORE-10363

svn path=/trunk/; revision=69619
This commit is contained in:
Ged Murphy 2015-10-19 13:52:12 +00:00
parent fd2dad4bcd
commit ae23c43fe8
9 changed files with 32 additions and 41 deletions

View file

@ -17,7 +17,6 @@
*/
#include "precomp.h"
#include <devmgr/devmgr.h>
#include "devmgmt/MainWindow.h"
#include "properties/properties.h"

View file

@ -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 @@ CDeviceView::OnAction(
case IDC_ADD_HARDWARE:
{
MessageBox(m_hMainWnd, L"Not yet implemented", L"Add Hardware", MB_OK);
RunAddHardwareWizard();
break;
}
}
@ -295,24 +285,6 @@ CDeviceView::OnAction(
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 @@ CDeviceView::DisplayPropertySheet()
1,//DPF_EXTENDED,
FALSE);
}
#ifndef __REACTOS__
FreeLibrary(hModule);
#endif
}
void
@ -781,6 +749,29 @@ CDeviceView::UninstallSelectedDevice(
return Node->UninstallDevice();
}
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,

View file

@ -122,6 +122,9 @@ private:
bool UninstallSelectedDevice(
);
bool RunAddHardwareWizard(
);
bool GetChildDevice(
_In_ DEVINST ParentDevInst,
_Out_ PDEVINST DevInst

View file

@ -22,6 +22,8 @@
#include <strsafe.h>
#include <devmgr/devmgr.h>
#define ERR printf
#define FIXME printf
#define UNIMPLEMENTED
@ -68,6 +70,7 @@ OUT LPDWORD lpReboot);
#include <atlstr.h>
#include <atlcoll.h>
#include <devmgr/devmgr.h>
#include <wine/debug.h>
//WINE_DEFAULT_DEBUG_CHANNEL(devmgr);

View file

@ -28,7 +28,6 @@
*/
#include "precomp.h"
#include <devmgr/devmgr.h>
#include "properties.h"
#include "resource.h"

View file

@ -26,7 +26,6 @@
*/
#include "precomp.h"
#include <devmgr/devmgr.h>
#include "properties.h"
#include "resource.h"

View file

@ -26,7 +26,6 @@
*/
#include "precomp.h"
#include <devmgr/devmgr.h>
#include "properties.h"
#include "resource.h"

View file

@ -8,7 +8,6 @@
*/
#include "precomp.h"
#include <devmgr/devmgr.h>
#include "properties.h"
#include "resource.h"

View file

@ -26,7 +26,6 @@
*/
#include "precomp.h"
#include <devmgr/devmgr.h>
#include "properties.h"
#include "resource.h"