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