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