[DEVMGR]
[reactos.git] / reactos / dll / win32 / devmgr_new / api.cpp
1 /*
2 *
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)
9 * NOTES:
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
14 *
15 * UPDATE HISTORY:
16 * 04-04-2004 Created
17 */
18
19 #include "precomp.h"
20 #include <devmgr/devmgr.h>
21 #include "devmgmt/MainWindow.h"
22
23 HINSTANCE hDllInstance = NULL;
24
25 WINE_DEFAULT_DEBUG_CHANNEL(devmgr);
26
27
28 /***************************************************************************
29 * NAME EXPORTED
30 * DeviceManager_ExecuteA
31 *
32 * DESCRIPTION
33 * Starts the Device Manager
34 *
35 * ARGUMENTS
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
40 *
41 * RETURN VALUE
42 * TRUE: if no errors occured
43 * FALSE: if the device manager could not be executed
44 *
45 * REVISIONS
46 *
47 * NOTE
48 * - Win runs the device manager in a separate process, so hWndParent is somehow
49 * obsolete.
50 *
51 * @unimplemented
52 */
53 BOOL
54 WINAPI
55 DeviceManager_ExecuteA(HWND hWndParent,
56 HINSTANCE hInst,
57 LPCSTR lpMachineName,
58 int nCmdShow)
59 {
60 UNIMPLEMENTED;
61 return FALSE;
62 }
63
64
65 /***************************************************************************
66 * NAME EXPORTED
67 * DeviceManager_ExecuteW
68 *
69 * DESCRIPTION
70 * Starts the Device Manager
71 *
72 * ARGUMENTS
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
77 *
78 * RETURN VALUE
79 * TRUE: if no errors occured
80 * FALSE: if the device manager could not be executed
81 *
82 * REVISIONS
83 *
84 * NOTE
85 * - Win runs the device manager in a separate process, so hWndParent is somehow
86 * obsolete.
87 *
88 * @unimplemented
89 */
90 BOOL
91 WINAPI
92 DeviceManager_ExecuteW(HWND hWndParent,
93 HINSTANCE hInst,
94 LPCWSTR lpMachineName,
95 int nCmdShow)
96 {
97 // FIXME: Call mmc with devmgmt.msc
98
99 CDeviceManager DevMgr;
100 return DevMgr.Create(hWndParent, hInst, lpMachineName, nCmdShow);
101 }
102
103
104 /***************************************************************************
105 * NAME EXPORTED
106 * DeviceProblemWizard_RunDLLA
107 *
108 * DESCRIPTION
109 * Calls the device problem wizard
110 *
111 * ARGUMENTS
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,
115 * also see NOTEs
116 * nCmdShow: Specifies how the window should be shown
117 *
118 * RETURN VALUE
119 *
120 * REVISIONS
121 *
122 * NOTE
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().
128 *
129 * @unimplemented
130 */
131 VOID
132 WINAPI
133 DeviceProblemWizard_RunDLLA(HWND hWndParent,
134 HINSTANCE hInst,
135 LPCSTR lpDeviceCmd,
136 int nCmdShow)
137 {
138 UNIMPLEMENTED;
139 }
140
141
142 /***************************************************************************
143 * NAME EXPORTED
144 * DeviceProblemWizard_RunDLLW
145 *
146 * DESCRIPTION
147 * Calls the device problem wizard
148 *
149 * ARGUMENTS
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,
153 * also see NOTEs
154 * nCmdShow: Specifies how the window should be shown
155 *
156 * RETURN VALUE
157 *
158 * REVISIONS
159 *
160 * NOTE
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().
166 *
167 * @unimplemented
168 */
169 VOID
170 WINAPI
171 DeviceProblemWizard_RunDLLW(HWND hWndParent,
172 HINSTANCE hInst,
173 LPCWSTR lpDeviceCmd,
174 int nCmdShow)
175 {
176 UNIMPLEMENTED;
177 }
178
179
180 /***************************************************************************
181 * NAME EXPORTED
182 * DeviceManagerPrintA
183 *
184 * DESCRIPTION
185 * Calls the device problem wizard
186 *
187 * ARGUMENTS
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
195 * system devices
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
200 *
201 * RETURN VALUE
202 * TRUE: if no errors occured
203 * FALSE: if errors occured
204 *
205 * REVISIONS
206 *
207 * NOTE
208 *
209 * @unimplemented
210 */
211 BOOL
212 WINAPI
213 DeviceManagerPrintA(LPCSTR lpMachineName,
214 LPCSTR lpPrinter,
215 int nPrintMode,
216 UINT uNumberOfGuids,
217 LPGUID lpGuids)
218 {
219 UNIMPLEMENTED;
220 return FALSE;
221 }
222
223
224 /***************************************************************************
225 * NAME EXPORTED
226 * DeviceManagerPrintW
227 *
228 * DESCRIPTION
229 * Calls the device problem wizard
230 *
231 * ARGUMENTS
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
239 * system devices
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
244 *
245 * RETURN VALUE
246 * TRUE: if no errors occured
247 * FALSE: if errors occured
248 *
249 * REVISIONS
250 *
251 * NOTE
252 *
253 * @unimplemented
254 */
255 BOOL
256 WINAPI
257 DeviceManagerPrintW(LPCWSTR lpMachineName,
258 LPCWSTR lpPrinter,
259 int nPrintMode,
260 UINT uNumberOfGuids,
261 LPGUID lpGuids)
262 {
263 UNIMPLEMENTED;
264 return FALSE;
265 }
266
267
268 BOOL
269 WINAPI
270 DllMain(IN HINSTANCE hinstDLL,
271 IN DWORD dwReason,
272 IN LPVOID lpvReserved)
273 {
274 switch (dwReason)
275 {
276 case DLL_PROCESS_ATTACH:
277 DisableThreadLibraryCalls(hinstDLL);
278 hDllInstance = hinstDLL;
279 break;
280 }
281
282 return TRUE;
283 }
284
285 class CDevMgrUIModule : public CComModule
286 {
287 public:
288 };
289
290 CDevMgrUIModule gModule;
291
292 STDAPI DllCanUnloadNow()
293 {
294 return gModule.DllCanUnloadNow();
295 }
296
297 STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
298 {
299 return gModule.DllGetClassObject(rclsid, riid, ppv);
300 }
301
302 STDAPI DllRegisterServer()
303 {
304 return gModule.DllRegisterServer(FALSE);
305 }
306
307 STDAPI DllUnregisterServer()
308 {
309 return gModule.DllUnregisterServer(FALSE);
310 }