ReactOS  0.4.14-dev-115-g4576127
hardware.c File Reference
#include "precomp.h"
Include dependency graph for hardware.c:

Go to the source code of this file.

Typedefs

typedef BOOL(WINAPIPDEVMGREXEC) (HWND hWndParent, HINSTANCE hInst, PVOID Unknown, int nCmdShow)
 

Functions

static BOOL LaunchDeviceManager (HWND hWndParent)
 
static VOID LaunchHardwareWizard (HWND hWndParent)
 
INT_PTR CALLBACK HardwarePageProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 

Typedef Documentation

◆ PDEVMGREXEC

typedef BOOL(WINAPI * PDEVMGREXEC) (HWND hWndParent, HINSTANCE hInst, PVOID Unknown, int nCmdShow)

Definition at line 13 of file hardware.c.

Function Documentation

◆ HardwarePageProc()

INT_PTR CALLBACK HardwarePageProc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 68 of file hardware.c.

72 {
74 
75  switch (uMsg)
76  {
77  case WM_INITDIALOG:
78  break;
79 
80  case WM_COMMAND:
81  switch (LOWORD(wParam))
82  {
84  if (!LaunchDeviceManager(hwndDlg))
85  {
86  /* FIXME */
87  }
88  return TRUE;
89 
91  LaunchHardwareWizard(hwndDlg);
92  return TRUE;
93 
97  hwndDlg,
99  return TRUE;
100  }
101  break;
102  }
103 
104  return FALSE;
105 }
#define MAKEINTRESOURCE
Definition: winuser.h:591
#define TRUE
Definition: types.h:120
static VOID LaunchHardwareWizard(HWND hWndParent)
Definition: hardware.c:45
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
HINSTANCE hApplet
Definition: access.c:17
WPARAM wParam
Definition: combotst.c:138
#define DialogBox
Definition: winuser.h:5662
#define IDC_HARDWARE_DEVICE_MANAGER
Definition: resource.h:84
#define IDC_HARDWARE_WIZARD
Definition: resource.h:81
#define WM_COMMAND
Definition: winuser.h:1722
INT_PTR CALLBACK HardProfDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: hardprof.c:735
#define IDC_HARDWARE_PROFILE
Definition: resource.h:82
#define IDD_HARDWAREPROFILES
Definition: resource.h:172
static BOOL LaunchDeviceManager(HWND hWndParent)
Definition: hardware.c:16
#define WM_INITDIALOG
Definition: winuser.h:1721
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82

Referenced by SystemApplet().

◆ LaunchDeviceManager()

static BOOL LaunchDeviceManager ( HWND  hWndParent)
static

Definition at line 16 of file hardware.c.

17 {
18 /* Hack for ROS to start our devmgmt until we have MMC */
19 #ifdef __REACTOS__
20  return ((INT_PTR)ShellExecuteW(NULL, L"open", L"devmgmt.exe", NULL, NULL, SW_SHOWNORMAL) > 32);
21 #else
22  HMODULE hDll;
23  PDEVMGREXEC DevMgrExec;
24  BOOL Ret;
25 
26  hDll = LoadLibrary(_TEXT("devmgr.dll"));
27  if(!hDll)
28  return FALSE;
29 
30  DevMgrExec = (PDEVMGREXEC)GetProcAddress(hDll, "DeviceManager_ExecuteW");
31  if(!DevMgrExec)
32  {
33  FreeLibrary(hDll);
34  return FALSE;
35  }
36 
37  /* Run the Device Manager */
38  Ret = DevMgrExec(hWndParent, hApplet, NULL /* ??? */, SW_SHOW);
39  FreeLibrary(hDll);
40  return Ret;
41 #endif /* __REACTOS__ */
42 }
#define LoadLibrary
Definition: winbase.h:3686
HINSTANCE hApplet
Definition: access.c:17
int32_t INT_PTR
Definition: typedefs.h:62
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
#define _TEXT(x)
Definition: tchar.h:1543
#define SW_SHOW
Definition: winuser.h:769
BOOL(WINAPI * PDEVMGREXEC)(HWND hWndParent, HINSTANCE hInst, PVOID Unknown, int nCmdShow)
Definition: hardware.c:13
#define FreeLibrary(x)
Definition: compat.h:405
static const WCHAR L[]
Definition: oid.c:1250
#define SW_SHOWNORMAL
Definition: winuser.h:764
HINSTANCE WINAPI ShellExecuteW(HWND hwnd, LPCWSTR lpVerb, LPCWSTR lpFile, LPCWSTR lpParameters, LPCWSTR lpDirectory, INT nShowCmd)
Definition: shlexec.cpp:2208
#define GetProcAddress(x, y)
Definition: compat.h:410

Referenced by HardwarePageProc().

◆ LaunchHardwareWizard()

static VOID LaunchHardwareWizard ( HWND  hWndParent)
static

Definition at line 45 of file hardware.c.

46 {
47  SHELLEXECUTEINFO shInputDll;
48 
49  memset(&shInputDll, 0x0, sizeof(SHELLEXECUTEINFO));
50 
51  shInputDll.cbSize = sizeof(shInputDll);
52  shInputDll.hwnd = hWndParent;
53  shInputDll.lpVerb = _T("open");
54  shInputDll.lpFile = _T("rundll32.exe");
55  shInputDll.lpParameters = _T("shell32.dll,Control_RunDLL hdwwiz.cpl");
56 
57  if (ShellExecuteEx(&shInputDll) == 0)
58  {
60  _T("Can't start hdwwiz.cpl"),
61  NULL,
63  }
64 }
#define ShellExecuteEx
Definition: shellapi.h:690
GLint x0
Definition: linetemp.h:95
smooth NULL
Definition: ftsmooth.c:416
#define _T(x)
Definition: vfdio.h:22
LPCSTR lpParameters
Definition: shellapi.h:314
#define MB_ICONERROR
Definition: winuser.h:781
#define MessageBox
Definition: winuser.h:5723
#define MB_OK
Definition: winuser.h:784
#define memset(x, y, z)
Definition: compat.h:39

Referenced by HardwarePageProc().