[DEVMGR]
[reactos.git] / reactos / dll / win32 / devmgr / precomp.h
1 #ifndef __DEVMGR_H
2 #define __DEVMGR_H
3
4 #include <stdarg.h>
5
6 #define WIN32_NO_STATUS
7 #include <windef.h>
8 #include <winbase.h>
9 #include <winreg.h>
10 #include <winnls.h>
11 #include <winuser.h>
12 #include <wchar.h>
13 #include <regstr.h>
14 #include <setupapi.h>
15 #include <cfgmgr32.h>
16 #include <dll/newdevp.h>
17 #include <dll/devmgr/devmgr.h>
18 #include <wine/debug.h>
19
20 #include "resource.h"
21
22 WINE_DEFAULT_DEBUG_CHANNEL(devmgr);
23
24 extern HINSTANCE hDllInstance;
25
26 typedef INT_PTR (WINAPI *PPROPERTYSHEETW)(LPCPROPSHEETHEADERW);
27 typedef HPROPSHEETPAGE (WINAPI *PCREATEPROPERTYSHEETPAGEW)(LPCPROPSHEETPAGEW);
28 typedef BOOL (WINAPI *PDESTROYPROPERTYSHEETPAGE)(HPROPSHEETPAGE);
29
30 typedef struct _DEVADVPROP_INFO
31 {
32 HWND hWndGeneralPage;
33 HWND hWndParent;
34 WNDPROC ParentOldWndProc;
35 HICON hDevIcon;
36
37 HDEVINFO DeviceInfoSet;
38 SP_DEVINFO_DATA DeviceInfoData;
39 HDEVINFO CurrentDeviceInfoSet;
40 SP_DEVINFO_DATA CurrentDeviceInfoData;
41 DEVINST ParentDevInst;
42 HMACHINE hMachine;
43 LPCWSTR lpMachineName;
44
45 HINSTANCE hComCtl32;
46 PCREATEPROPERTYSHEETPAGEW pCreatePropertySheetPageW;
47 PDESTROYPROPERTYSHEETPAGE pDestroyPropertySheetPage;
48
49 DWORD PropertySheetType;
50 DWORD nDevPropSheets;
51 HPROPSHEETPAGE *DevPropSheets;
52
53 union
54 {
55 UINT Flags;
56 struct
57 {
58 UINT Extended : 1;
59 UINT FreeDevPropSheets : 1;
60 UINT CanDisable : 1;
61 UINT DeviceStarted : 1;
62 UINT DeviceUsageChanged : 1;
63 UINT CloseDevInst : 1;
64 UINT IsAdmin : 1;
65 UINT DoDefaultDevAction : 1;
66 UINT PageInitialized : 1;
67 UINT ShowRemotePages : 1;
68 UINT HasDriverPage : 1;
69 UINT HasResourcePage : 1;
70 UINT HasPowerPage : 1;
71 };
72 };
73
74 WCHAR szDevName[255];
75 WCHAR szTemp[255];
76 WCHAR szDeviceID[1];
77 /* struct may be dynamically expanded here! */
78 } DEVADVPROP_INFO, *PDEVADVPROP_INFO;
79
80
81 typedef struct _ENUMDRIVERFILES_CONTEXT
82 {
83 HWND hDriversListView;
84 UINT nCount;
85 } ENUMDRIVERFILES_CONTEXT, *PENUMDRIVERFILES_CONTEXT;
86
87 #define PM_INITIALIZE (WM_APP + 0x101)
88
89
90
91 /* HWRESOURCE.C */
92
93 INT_PTR
94 CALLBACK
95 ResourcesProcDriverDlgProc(IN HWND hwndDlg,
96 IN UINT uMsg,
97 IN WPARAM wParam,
98 IN LPARAM lParam);
99
100 /* ADVPROP.C */
101
102 INT_PTR
103 DisplayDeviceAdvancedProperties(IN HWND hWndParent,
104 IN LPCWSTR lpDeviceID OPTIONAL,
105 IN HDEVINFO DeviceInfoSet,
106 IN PSP_DEVINFO_DATA DeviceInfoData,
107 IN HINSTANCE hComCtl32,
108 IN LPCWSTR lpMachineName,
109 IN DWORD dwFlags);
110
111 /* DEVPRBLM.C */
112
113 BOOL
114 ShowDeviceProblemWizard(IN HWND hWndParent OPTIONAL,
115 IN HDEVINFO hDevInfo,
116 IN PSP_DEVINFO_DATA DevInfoData,
117 IN HMACHINE hMachine OPTIONAL);
118
119 /* MISC.C */
120
121
122 INT
123 LengthOfStrResource(IN HINSTANCE hInst,
124 IN UINT uID);
125
126 DWORD
127 LoadAndFormatString(IN HINSTANCE hInstance,
128 IN UINT uID,
129 OUT LPWSTR *lpTarget,
130 ...);
131
132 DWORD
133 LoadAndFormatStringsCat(IN HINSTANCE hInstance,
134 IN UINT *uID,
135 IN UINT nIDs,
136 OUT LPWSTR *lpTarget,
137 ...);
138
139 LPARAM
140 ListViewGetSelectedItemData(IN HWND hwnd);
141
142 LPWSTR
143 ConvertMultiByteToUnicode(IN LPCSTR lpMultiByteStr,
144 IN UINT uCodePage);
145
146 HINSTANCE
147 LoadAndInitComctl32(VOID);
148
149 BOOL
150 GetDeviceManufacturerString(IN HDEVINFO DeviceInfoSet,
151 IN PSP_DEVINFO_DATA DeviceInfoData,
152 OUT LPWSTR szBuffer,
153 IN DWORD BufferSize);
154
155 BOOL
156 GetDeviceLocationString(IN HDEVINFO DeviceInfoSet,
157 IN PSP_DEVINFO_DATA DeviceInfoData,
158 IN DEVINST dnParentDevInst OPTIONAL,
159 OUT LPWSTR szBuffer,
160 IN DWORD BufferSize);
161
162 BOOL
163 GetDeviceStatusString(IN DEVINST DevInst,
164 IN HMACHINE hMachine,
165 OUT LPWSTR szBuffer,
166 IN DWORD BufferSize);
167
168 BOOL
169 GetDriverProviderString(IN HDEVINFO DeviceInfoSet,
170 IN PSP_DEVINFO_DATA DeviceInfoData,
171 OUT LPWSTR szBuffer,
172 IN DWORD BufferSize);
173
174 BOOL
175 GetDriverVersionString(IN HDEVINFO DeviceInfoSet,
176 IN PSP_DEVINFO_DATA DeviceInfoData,
177 OUT LPWSTR szBuffer,
178 IN DWORD BufferSize);
179
180 BOOL
181 GetDriverDateString(IN HDEVINFO DeviceInfoSet,
182 IN PSP_DEVINFO_DATA DeviceInfoData,
183 OUT LPWSTR szBuffer,
184 IN DWORD BufferSize);
185
186 BOOL
187 IsDeviceHidden(IN DEVINST DevInst,
188 IN HMACHINE hMachine,
189 OUT BOOL *IsHidden);
190
191 BOOL
192 IsDriverInstalled(IN DEVINST DevInst,
193 IN HMACHINE hMachine,
194 OUT BOOL *Installed);
195
196 BOOL
197 CanDisableDevice(IN DEVINST DevInst,
198 IN HMACHINE hMachine,
199 OUT BOOL *CanDisable);
200
201 BOOL
202 IsDeviceStarted(IN DEVINST DevInst,
203 IN HMACHINE hMachine,
204 OUT BOOL *IsStarted);
205
206 BOOL
207 EnableDevice(IN HDEVINFO DeviceInfoSet,
208 IN PSP_DEVINFO_DATA DevInfoData OPTIONAL,
209 IN BOOL bEnable,
210 IN DWORD HardwareProfile OPTIONAL,
211 OUT BOOL *bNeedReboot OPTIONAL);
212
213 BOOL
214 GetDeviceTypeString(IN PSP_DEVINFO_DATA DeviceInfoData,
215 OUT LPWSTR szBuffer,
216 IN DWORD BufferSize);
217
218 BOOL
219 GetDeviceDescriptionString(IN HDEVINFO DeviceInfoSet,
220 IN PSP_DEVINFO_DATA DeviceInfoData,
221 OUT LPWSTR szBuffer,
222 IN DWORD BufferSize);
223
224 BOOL
225 FindCurrentDriver(IN HDEVINFO DeviceInfoSet,
226 IN PSP_DEVINFO_DATA DeviceInfoData,
227 OUT PSP_DRVINFO_DATA DriverInfoData);
228
229 #endif /* __DEVMGR_H */