3 * COPYRIGHT: See COPYING in the top level directory
4 * PROJECT: ReactOS devmgr.dll
5 * FILE: dll/win32/devmgr/api.cpp
6 * PURPOSE: devmgr.dll stubs
7 * PROGRAMMER: Thomas Weidenmueller (w3seek@users.sourceforge.net)
8 * Ged Murphy (gedmurphy@reactos.org)
10 * Some helpful resources:
11 * http://support.microsoft.com/default.aspx?scid=kb;%5BLN%5D;815320
12 * http://www.jsiinc.com/SUBO/tip7400/rh7482.htm
13 * http://www.jsiinc.com/SUBM/tip6400/rh6490.htm
20 #include <devmgr/devmgr.h>
21 #include "devmgmt/MainWindow.h"
23 HINSTANCE hDllInstance
= NULL
;
25 WINE_DEFAULT_DEBUG_CHANNEL(devmgr
);
28 /***************************************************************************
30 * DeviceManager_ExecuteA
33 * Starts the Device Manager
36 * hWndParent: Handle to the parent window
37 * hInst: Handle to the application instance
38 * lpMachineName: Machine Name, NULL is the local machine
39 * nCmdShow: Specifies how the window should be shown
42 * TRUE: if no errors occured
43 * FALSE: if the device manager could not be executed
48 * - Win runs the device manager in a separate process, so hWndParent is somehow
55 DeviceManager_ExecuteA(HWND hWndParent
,
65 /***************************************************************************
67 * DeviceManager_ExecuteW
70 * Starts the Device Manager
73 * hWndParent: Handle to the parent window
74 * hInst: Handle to the application instance
75 * lpMachineName: Machine Name, NULL is the local machine
76 * nCmdShow: Specifies how the window should be shown
79 * TRUE: if no errors occured
80 * FALSE: if the device manager could not be executed
85 * - Win runs the device manager in a separate process, so hWndParent is somehow
92 DeviceManager_ExecuteW(HWND hWndParent
,
94 LPCWSTR lpMachineName
,
97 // FIXME: Call mmc with devmgmt.msc
99 CDeviceManager DevMgr
;
100 return DevMgr
.Create(hWndParent
, hInst
, lpMachineName
, nCmdShow
);
104 /***************************************************************************
106 * DeviceProblemWizard_RunDLLA
109 * Calls the device problem wizard
112 * hWndParent: Handle to the parent window
113 * hInst: Handle to the application instance
114 * lpDeviceCmd: A command that includes the DeviceID of the properties to be shown,
116 * nCmdShow: Specifies how the window should be shown
123 * - Win XP exports this function as DeviceProblenWizard_RunDLLA, apparently it's
124 * a typo so we additionally export an alias function
125 * - lpDeviceCmd is a string in the form of "/MachineName MACHINE /DeviceID DEVICEPATH"
126 * (/MachineName is optional). This function only parses this string and eventually
127 * calls DeviceProperties().
133 DeviceProblemWizard_RunDLLA(HWND hWndParent
,
142 /***************************************************************************
144 * DeviceProblemWizard_RunDLLW
147 * Calls the device problem wizard
150 * hWndParent: Handle to the parent window
151 * hInst: Handle to the application instance
152 * lpDeviceCmd: A command that includes the DeviceID of the properties to be shown,
154 * nCmdShow: Specifies how the window should be shown
161 * - Win XP exports this function as DeviceProblenWizard_RunDLLA, apparently it's
162 * a typo so we additionally export an alias function
163 * - lpDeviceCmd is a string in the form of "/MachineName MACHINE /DeviceID DEVICEPATH"
164 * (/MachineName is optional). This function only parses this string and eventually
165 * calls DeviceProperties().
171 DeviceProblemWizard_RunDLLW(HWND hWndParent
,
180 /***************************************************************************
182 * DeviceManagerPrintA
185 * Calls the device problem wizard
188 * lpMachineName: Machine Name, NULL is the local machine
189 * lpPrinter: Filename of the printer where it should be printed on
190 * nPrintMode: Specifies what kind of information is to be printed
191 * DEV_PRINT_ABSTRACT: Prints an abstract of system information, the parameters
192 * uNumberOfGuids, Guids are ignored
193 * DEV_PRINT_SELECTED: Prints information about the devices listed in Guids
194 * DEV_PRINT_ALL: Prints an abstract of system information and all
196 * uNumberOfGuids: Numbers of guids in the Guids array, this parameter is ignored unless
197 * nPrintMode is DEV_PRINT_SELECTED
198 * lpGuids: Array of device guids, this parameter is ignored unless
199 * nPrintMode is DEV_PRINT_SELECTED
202 * TRUE: if no errors occured
203 * FALSE: if errors occured
213 DeviceManagerPrintA(LPCSTR lpMachineName
,
224 /***************************************************************************
226 * DeviceManagerPrintW
229 * Calls the device problem wizard
232 * lpMachineName: Machine Name, NULL is the local machine
233 * lpPrinter: Filename of the printer where it should be printed on
234 * nPrintMode: Specifies what kind of information is to be printed
235 * DEV_PRINT_ABSTRACT: Prints an abstract of system information, the parameters
236 * uNumberOfGuids, Guids are ignored
237 * DEV_PRINT_SELECTED: Prints information about the devices listed in Guids
238 * DEV_PRINT_ALL: Prints an abstract of system information and all
240 * uNumberOfGuids: Numbers of guids in the Guids array, this parameter is ignored unless
241 * nPrintMode is DEV_PRINT_SELECTED
242 * lpGuids: Array of device guids, this parameter is ignored unless
243 * nPrintMode is DEV_PRINT_SELECTED
246 * TRUE: if no errors occured
247 * FALSE: if errors occured
257 DeviceManagerPrintW(LPCWSTR lpMachineName
,
270 DllMain(IN HINSTANCE hinstDLL
,
272 IN LPVOID lpvReserved
)
276 case DLL_PROCESS_ATTACH
:
277 DisableThreadLibraryCalls(hinstDLL
);
278 hDllInstance
= hinstDLL
;
285 class CDevMgrUIModule
: public CComModule
290 CDevMgrUIModule gModule
;
292 STDAPI
DllCanUnloadNow()
294 return gModule
.DllCanUnloadNow();
297 STDAPI
DllGetClassObject(REFCLSID rclsid
, REFIID riid
, LPVOID
*ppv
)
299 return gModule
.DllGetClassObject(rclsid
, riid
, ppv
);
302 STDAPI
DllRegisterServer()
304 return gModule
.DllRegisterServer(FALSE
);
307 STDAPI
DllUnregisterServer()
309 return gModule
.DllUnregisterServer(FALSE
);