127{
128 const WCHAR wszMonitorsPath[] =
L"SYSTEM\\CurrentControlSet\\Control\\Print\\Monitors";
130
132 DWORD cchPrintMonitorName;
144
145 TRACE(
"InitializePrintMonitorList()\n");
146
147
149
150
153 {
154 ERR(
"RegOpenKeyExW failed with status %lu!\n", dwErrorCode);
156 }
157
158
159 dwErrorCode = (
DWORD)
RegQueryInfoKeyW(
hKey,
NULL,
NULL,
NULL, &dwSubKeys, &cchMaxSubKey,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL);
161 {
162 ERR(
"RegQueryInfoKeyW failed with status %lu!\n", dwErrorCode);
164 }
165
166
167 for (
i = 0;
i < dwSubKeys;
i++)
168 {
169
170 if (hSubKey)
171 {
174 }
175
176 if (pwszRegistryPath)
177 {
179 pwszRegistryPath =
NULL;
180 }
181
182 if (pPrintMonitor)
183 {
186
189
191 pPrintMonitor =
NULL;
192 }
193
194
196 if (!pPrintMonitor)
197 {
199 ERR(
"DllAllocSplMem failed!\n");
201 }
202
204
205
208 {
210 ERR(
"DllAllocSplMem failed!\n");
212 }
213
214
215 cchPrintMonitorName = cchMaxSubKey + 1;
218 {
219 ERR(
"RegEnumKeyExW failed for iteration %lu with status %lu!\n",
i, dwErrorCode);
220 continue;
221 }
222
223
226 {
227 ERR(
"RegOpenKeyExW failed for Print Provider \"%S\" with status %lu!\n", pPrintMonitor->
pwszName, dwErrorCode);
228 continue;
229 }
230
231
234 continue;
235
236
238 if (!hinstPrintMonitor)
239 {
241 continue;
242 }
243
244 pPrintMonitor->
hModule = hinstPrintMonitor;
245
246
248 if (pfnInitializePrintMonitor2)
249 {
250
253
254
257
258
261 {
263 continue;
264 }
265 FIXME(
"InitializePrintMonitor2 loaded.\n");
267 }
268 else
269 {
270
272 if (pfnInitializePrintMonitor)
273 {
274
275 pwszRegistryPath =
DllAllocSplMem((cchMonitorsPath + 1 + cchPrintMonitorName + 1) *
sizeof(
WCHAR));
276 if (!pwszRegistryPath)
277 {
279 ERR(
"DllAllocSplMem failed!\n");
281 }
282
283 CopyMemory(pwszRegistryPath, wszMonitorsPath, cchMonitorsPath *
sizeof(
WCHAR));
284 pwszRegistryPath[cchMonitorsPath] =
L'\\';
285 CopyMemory(&pwszRegistryPath[cchMonitorsPath + 1], pPrintMonitor->
pwszName, (cchPrintMonitorName + 1) *
sizeof(
WCHAR));
286
287
290 {
292 continue;
293 }
294 }
295 else
296 {
297 ERR(
"No initialization routine found for \"%S\"!\n", pPrintMonitor->
pwszFileName);
298 continue;
299 }
300 }
301
302
304 FIXME(
"InitializePrintMonitorList Handle %p\n",pPrintMonitor->
hMonitor);
306
307
308 pPrintMonitor =
NULL;
309 }
310
312
314
315 if (hSubKey)
317
318 if (pwszRegistryPath)
320
321 if (pPrintMonitor)
322 {
325
328
330 }
331
332
335
338}
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
LONG WINAPI RegEnumKeyExW(_In_ HKEY hKey, _In_ DWORD dwIndex, _Out_ LPWSTR lpName, _Inout_ LPDWORD lpcbName, _Reserved_ LPDWORD lpReserved, _Out_opt_ LPWSTR lpClass, _Inout_opt_ LPDWORD lpcbClass, _Out_opt_ PFILETIME lpftLastWriteTime)
LONG WINAPI RegQueryInfoKeyW(HKEY hKey, LPWSTR lpClass, LPDWORD lpcClass, LPDWORD lpReserved, LPDWORD lpcSubKeys, LPDWORD lpcMaxSubKeyLen, LPDWORD lpcMaxClassLen, LPDWORD lpcValues, LPDWORD lpcMaxValueNameLen, LPDWORD lpcMaxValueLen, LPDWORD lpcbSecurityDescriptor, PFILETIME lpftLastWriteTime)
#define InitializeListHead(ListHead)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
PWSTR AllocAndRegQueryWSZ(HKEY hKey, PCWSTR pwszValueName)