ReactOS 0.4.15-dev-7924-g5949c20
query.c
Go to the documentation of this file.
1/*
2 * setupapi query functions
3 *
4 * Copyright 2006 James Hawkins
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 */
20
21#include "setupapi_private.h"
22
23static const WCHAR source_disks_names[] =
24 {'S','o','u','r','c','e','D','i','s','k','s','N','a','m','e','s',0};
25static const WCHAR source_disks_files[] =
26 {'S','o','u','r','c','e','D','i','s','k','s','F','i','l','e','s',0};
27
28/* fills the PSP_INF_INFORMATION struct fill_info is TRUE
29 * always returns the required size of the information
30 */
32{
34 DWORD total_size = FIELD_OFFSET(SP_INF_INFORMATION, VersionData)
35 + (lstrlenW(filename) + 1) * sizeof(WCHAR);
36
37 if (required) *required = total_size;
38
39 /* FIXME: we need to parse the INF file to find the correct version info */
40 if (buffer)
41 {
42 if (size < total_size)
43 {
45 return FALSE;
46 }
47 buffer->InfStyle = INF_STYLE_WIN4;
48 buffer->InfCount = 1;
49 /* put the filename in buffer->VersionData */
50 lstrcpyW((LPWSTR)&buffer->VersionData[0], filename);
51 }
52 return TRUE;
53}
54
56{
58 WCHAR inf_path[MAX_PATH];
59
60 static const WCHAR infW[] = {'\\','i','n','f','\\',0};
61 static const WCHAR system32W[] = {'\\','s','y','s','t','e','m','3','2','\\',0};
62
64 {
66 lstrcatW(inf_path, system32W);
67 lstrcatW(inf_path, InfSpec);
68
69 hInf = SetupOpenInfFileW(inf_path, NULL,
71 if (hInf != INVALID_HANDLE_VALUE)
72 return hInf;
73
75 lstrcpyW(inf_path, infW);
76 lstrcatW(inf_path, InfSpec);
77
78 return SetupOpenInfFileW(inf_path, NULL,
80 }
81
83}
84
85/***********************************************************************
86 * SetupGetInfInformationA (SETUPAPI.@)
87 *
88 */
90 PSP_INF_INFORMATION ReturnBuffer,
92{
93 LPWSTR inf = (LPWSTR)InfSpec;
94 DWORD len;
95 BOOL ret;
96
98 {
99 len = MultiByteToWideChar(CP_ACP, 0, InfSpec, -1, NULL, 0);
100 inf = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
101 if (!inf)
102 {
104 return FALSE;
105 }
106 MultiByteToWideChar(CP_ACP, 0, InfSpec, -1, inf, len);
107 }
108
109 ret = SetupGetInfInformationW(inf, SearchControl, ReturnBuffer,
111
113 HeapFree(GetProcessHeap(), 0, inf);
114
115 return ret;
116}
117
118/***********************************************************************
119 * SetupGetInfInformationW (SETUPAPI.@)
120 *
121 * BUGS
122 * Only handles the case when InfSpec is an INF handle.
123 */
125 PSP_INF_INFORMATION ReturnBuffer,
127{
128 HINF inf;
129 BOOL ret;
130 DWORD infSize;
131
132 TRACE("(%p, %d, %p, %d, %p)\n", InfSpec, SearchControl, ReturnBuffer,
134
135 if (!InfSpec)
136 {
139 else
141
142 return FALSE;
143 }
144
145 switch (SearchControl)
146 {
148 inf = (HINF)InfSpec;
149 break;
152 inf = SetupOpenInfFileW(InfSpec, NULL,
154 break;
156 inf = search_for_inf(InfSpec, SearchControl);
157 break;
159 FIXME("Unhandled search control: %d\n", SearchControl);
160
161 if (RequiredSize)
162 *RequiredSize = 0;
163
164 return FALSE;
165 default:
167 return FALSE;
168 }
169
170 if (inf == INVALID_HANDLE_VALUE)
171 {
173 return FALSE;
174 }
175
176 ret = fill_inf_info(inf, ReturnBuffer, ReturnBufferSize, &infSize);
177 if (!ReturnBuffer && (ReturnBufferSize >= infSize))
178 {
180 ret = FALSE;
181 }
182 if (RequiredSize) *RequiredSize = infSize;
183
186
187 return ret;
188}
189
190/***********************************************************************
191 * SetupQueryInfFileInformationA (SETUPAPI.@)
192 */
194 UINT InfIndex, PSTR ReturnBuffer,
196{
198 DWORD size;
199 BOOL ret;
200
201 ret = SetupQueryInfFileInformationW(InfInformation, InfIndex, NULL, 0, &size);
202 if (!ret)
203 return FALSE;
204
205 filenameW = HeapAlloc(GetProcessHeap(), 0, size * sizeof(WCHAR));
206
207 ret = SetupQueryInfFileInformationW(InfInformation, InfIndex,
208 filenameW, size, &size);
209 if (!ret)
210 {
212 return FALSE;
213 }
214
215 if (RequiredSize)
217
218 if (!ReturnBuffer)
219 {
222 {
224 return FALSE;
225 }
226
227 return TRUE;
228 }
229
231 {
234 return FALSE;
235 }
236
237 WideCharToMultiByte(CP_ACP, 0, filenameW, -1, ReturnBuffer, size, NULL, NULL);
239
240 return ret;
241}
242
243/***********************************************************************
244 * SetupQueryInfFileInformationW (SETUPAPI.@)
245 */
247 UINT InfIndex, PWSTR ReturnBuffer,
249{
250 DWORD len;
251 LPWSTR ptr;
252
253 TRACE("(%p, %u, %p, %d, %p) Stub!\n", InfInformation, InfIndex,
254 ReturnBuffer, ReturnBufferSize, RequiredSize);
255
256 if (!InfInformation)
257 {
259 return FALSE;
260 }
261
262 if (InfIndex != 0)
263 FIXME("Appended INF files are not handled\n");
264
265 ptr = (LPWSTR)InfInformation->VersionData;
266 len = lstrlenW(ptr);
267
268 if (RequiredSize)
269 *RequiredSize = len + 1;
270
271 if (!ReturnBuffer)
272 return TRUE;
273
274 if (ReturnBufferSize < len)
275 {
277 return FALSE;
278 }
279
280 lstrcpyW(ReturnBuffer, ptr);
281 return TRUE;
282}
283
284/***********************************************************************
285 * SetupGetSourceFileLocationA (SETUPAPI.@)
286 */
287
290 PDWORD required_size )
291{
292 BOOL ret = FALSE;
293 WCHAR *filenameW = NULL, *bufferW = NULL;
294 DWORD required;
295 INT size;
296
297 TRACE("%p, %p, %s, %p, %p, 0x%08x, %p\n", hinf, context, debugstr_a(filename), source_id,
298 buffer, buffer_size, required_size);
299
300 if (filename && *filename && !(filenameW = strdupAtoW( filename )))
301 return FALSE;
302
303 if (!SetupGetSourceFileLocationW( hinf, context, filenameW, source_id, NULL, 0, &required ))
304 goto done;
305
306 if (!(bufferW = HeapAlloc( GetProcessHeap(), 0, required * sizeof(WCHAR) )))
307 goto done;
308
309 if (!SetupGetSourceFileLocationW( hinf, context, filenameW, source_id, bufferW, required, NULL ))
310 goto done;
311
312 size = WideCharToMultiByte( CP_ACP, 0, bufferW, -1, NULL, 0, NULL, NULL );
313 if (required_size) *required_size = size;
314
315 if (buffer)
316 {
317 if (buffer_size >= size)
318 WideCharToMultiByte( CP_ACP, 0, bufferW, -1, buffer, buffer_size, NULL, NULL );
319 else
320 {
322 goto done;
323 }
324 }
325 ret = TRUE;
326
327 done:
329 HeapFree( GetProcessHeap(), 0, bufferW );
330 return ret;
331}
332
334{
335 WCHAR Section[MAX_PATH];
336 DWORD size;
338
340 return NULL;
341
342 if (!SetupFindFirstLineW( hinf, Section, filename, context ) &&
344 return NULL;
345
346 if (!SetupGetStringFieldW( context, 1, NULL, 0, &size ))
347 return NULL;
348
349 if (!(source_id = HeapAlloc( GetProcessHeap(), 0, size * sizeof(WCHAR) )))
350 return NULL;
351
353 {
355 return NULL;
356 }
357
359 {
361 return NULL;
362 }
363
364 if (!SetupFindFirstLineW( hinf, Section, source_id, context ) &&
366 {
368 return NULL;
369 }
370 return source_id;
371}
372
373/***********************************************************************
374 * SetupGetSourceFileLocationW (SETUPAPI.@)
375 */
376
379 PDWORD required_size )
380{
382 WCHAR *end, *source_id_str;
383
384 TRACE("%p, %p, %s, %p, %p, 0x%08x, %p\n", hinf, context, debugstr_w(filename), source_id,
385 buffer, buffer_size, required_size);
386
387 if (!context) context = &ctx;
388
389 if (!(source_id_str = get_source_id( hinf, context, filename )))
390 return FALSE;
391
392 *source_id = strtolW( source_id_str, &end, 10 );
393 if (end == source_id_str || *end)
394 {
395 HeapFree( GetProcessHeap(), 0, source_id_str );
396 return FALSE;
397 }
398 HeapFree( GetProcessHeap(), 0, source_id_str );
399
400 if (SetupGetStringFieldW( context, 4, buffer, buffer_size, required_size ))
401 return TRUE;
402
403 if (required_size) *required_size = 1;
404 if (buffer)
405 {
406 if (buffer_size >= 1) buffer[0] = 0;
407 else
408 {
410 return FALSE;
411 }
412 }
413 return TRUE;
414}
415
416/***********************************************************************
417 * SetupGetSourceInfoA (SETUPAPI.@)
418 */
419
421 PSTR buffer, DWORD buffer_size, LPDWORD required_size )
422{
423 BOOL ret = FALSE;
424 WCHAR *bufferW = NULL;
425 DWORD required;
426 INT size;
427
428 TRACE("%p, %d, %d, %p, %d, %p\n", hinf, source_id, info, buffer, buffer_size,
429 required_size);
430
431 if (!SetupGetSourceInfoW( hinf, source_id, info, NULL, 0, &required ))
432 return FALSE;
433
434 if (!(bufferW = HeapAlloc( GetProcessHeap(), 0, required * sizeof(WCHAR) )))
435 return FALSE;
436
437 if (!SetupGetSourceInfoW( hinf, source_id, info, bufferW, required, NULL ))
438 goto done;
439
440 size = WideCharToMultiByte( CP_ACP, 0, bufferW, -1, NULL, 0, NULL, NULL );
441 if (required_size) *required_size = size;
442
443 if (buffer)
444 {
445 if (buffer_size >= size)
446 WideCharToMultiByte( CP_ACP, 0, bufferW, -1, buffer, buffer_size, NULL, NULL );
447 else
448 {
450 goto done;
451 }
452 }
453 ret = TRUE;
454
455 done:
456 HeapFree( GetProcessHeap(), 0, bufferW );
457 return ret;
458}
459
460/***********************************************************************
461 * SetupGetSourceInfoW (SETUPAPI.@)
462 */
463
465 PWSTR buffer, DWORD buffer_size, LPDWORD required_size )
466{
467 WCHAR Section[MAX_PATH];
469 WCHAR source_id_str[11];
470 static const WCHAR fmt[] = {'%','d',0};
471 DWORD index;
472
473 TRACE("%p, %d, %d, %p, %d, %p\n", hinf, source_id, info, buffer, buffer_size,
474 required_size);
475
476 sprintfW( source_id_str, fmt, source_id );
477
479 return FALSE;
480
481 if (!SetupFindFirstLineW( hinf, Section, source_id_str, &ctx ) &&
482 !SetupFindFirstLineW( hinf, source_disks_names, source_id_str, &ctx ))
483 return FALSE;
484
485 switch (info)
486 {
487 case SRCINFO_PATH: index = 4; break;
488 case SRCINFO_TAGFILE: index = 2; break;
489 case SRCINFO_DESCRIPTION: index = 1; break;
490 default:
491 WARN("unknown info level: %d\n", info);
492 return FALSE;
493 }
494
495 if (SetupGetStringFieldW( &ctx, index, buffer, buffer_size, required_size ))
496 return TRUE;
497
498 if (required_size) *required_size = 1;
499 if (buffer)
500 {
501 if (buffer_size >= 1) buffer[0] = 0;
502 else
503 {
505 return FALSE;
506 }
507 }
508 return TRUE;
509}
510
511/***********************************************************************
512 * SetupGetTargetPathA (SETUPAPI.@)
513 */
514
516 DWORD buffer_size, PDWORD required_size )
517{
518 BOOL ret = FALSE;
519 WCHAR *sectionW = NULL, *bufferW = NULL;
520 DWORD required;
521 INT size;
522
523 TRACE("%p, %p, %s, %p, 0x%08x, %p\n", hinf, context, debugstr_a(section), buffer,
524 buffer_size, required_size);
525
526 if (section && !(sectionW = strdupAtoW( section )))
527 return FALSE;
528
529 if (!SetupGetTargetPathW( hinf, context, sectionW, NULL, 0, &required ))
530 goto done;
531
532 if (!(bufferW = HeapAlloc( GetProcessHeap(), 0, required * sizeof(WCHAR) )))
533 goto done;
534
535 if (!SetupGetTargetPathW( hinf, context, sectionW, bufferW, required, NULL ))
536 goto done;
537
538 size = WideCharToMultiByte( CP_ACP, 0, bufferW, -1, NULL, 0, NULL, NULL );
539 if (required_size) *required_size = size;
540
541 if (buffer)
542 {
543 if (buffer_size >= size)
544 WideCharToMultiByte( CP_ACP, 0, bufferW, -1, buffer, buffer_size, NULL, NULL );
545 else
546 {
548 goto done;
549 }
550 }
551 ret = TRUE;
552
553 done:
554 HeapFree( GetProcessHeap(), 0, sectionW );
555 HeapFree( GetProcessHeap(), 0, bufferW );
556 return ret;
557}
558
559/***********************************************************************
560 * SetupGetTargetPathW (SETUPAPI.@)
561 */
562
564 DWORD buffer_size, PDWORD required_size )
565{
566 static const WCHAR destination_dirs[] =
567 {'D','e','s','t','i','n','a','t','i','o','n','D','i','r','s',0};
568 static const WCHAR default_dest_dir[] =
569 {'D','e','f','a','u','l','t','D','e','s','t','D','i','r',0};
570
572 WCHAR *dir, systemdir[MAX_PATH];
573 unsigned int size;
574 BOOL ret = FALSE;
575
576 TRACE("%p, %p, %s, %p, 0x%08x, %p\n", hinf, context, debugstr_w(section), buffer,
577 buffer_size, required_size);
578
579 if (context) ret = SetupFindFirstLineW( hinf, destination_dirs, NULL, context );
580 else if (section)
581 {
582 if (!(ret = SetupFindFirstLineW( hinf, destination_dirs, section, &ctx )))
583 ret = SetupFindFirstLineW( hinf, destination_dirs, default_dest_dir, &ctx );
584 }
585 if (!ret || !(dir = PARSER_get_dest_dir( context ? context : &ctx )))
586 {
587 GetSystemDirectoryW( systemdir, MAX_PATH );
588 dir = systemdir;
589 }
590 size = strlenW( dir ) + 1;
591 if (required_size) *required_size = size;
592
593 if (buffer)
594 {
595 if (buffer_size >= size)
596 lstrcpyW( buffer, dir );
597 else
598 {
600 if (dir != systemdir) HeapFree( GetProcessHeap(), 0, dir );
601 return FALSE;
602 }
603 }
604 if (dir != systemdir) HeapFree( GetProcessHeap(), 0, dir );
605 return TRUE;
606}
607
608/***********************************************************************
609 * SetupQueryInfOriginalFileInformationA (SETUPAPI.@)
610 */
612 PSP_INF_INFORMATION InfInformation, UINT InfIndex,
613 PSP_ALTPLATFORM_INFO AlternativePlatformInfo,
614 PSP_ORIGINAL_FILE_INFO_A OriginalFileInfo)
615{
616 BOOL ret;
617 SP_ORIGINAL_FILE_INFO_W OriginalFileInfoW;
618
619 TRACE("(%p, %d, %p, %p)\n", InfInformation, InfIndex,
620 AlternativePlatformInfo, OriginalFileInfo);
621
622 if (OriginalFileInfo->cbSize != sizeof(*OriginalFileInfo))
623 {
624 WARN("incorrect OriginalFileInfo->cbSize of %d\n", OriginalFileInfo->cbSize);
626 return FALSE;
627 }
628
629 OriginalFileInfoW.cbSize = sizeof(OriginalFileInfoW);
630 ret = SetupQueryInfOriginalFileInformationW(InfInformation, InfIndex,
631 AlternativePlatformInfo, &OriginalFileInfoW);
632 if (ret)
633 {
634 WideCharToMultiByte(CP_ACP, 0, OriginalFileInfoW.OriginalInfName, -1,
635 OriginalFileInfo->OriginalInfName, MAX_PATH, NULL, NULL);
636 WideCharToMultiByte(CP_ACP, 0, OriginalFileInfoW.OriginalCatalogName, -1,
637 OriginalFileInfo->OriginalCatalogName, MAX_PATH, NULL, NULL);
638 }
639
640 return ret;
641}
642
643/***********************************************************************
644 * SetupQueryInfOriginalFileInformationW (SETUPAPI.@)
645 */
647 PSP_INF_INFORMATION InfInformation, UINT InfIndex,
648 PSP_ALTPLATFORM_INFO AlternativePlatformInfo,
649 PSP_ORIGINAL_FILE_INFO_W OriginalFileInfo)
650{
651 LPCWSTR inf_name;
652 LPCWSTR inf_path;
653 HINF hinf;
654 static const WCHAR wszVersion[] = { 'V','e','r','s','i','o','n',0 };
655 static const WCHAR wszCatalogFile[] = { 'C','a','t','a','l','o','g','F','i','l','e',0 };
656
657 FIXME("(%p, %d, %p, %p): semi-stub\n", InfInformation, InfIndex,
658 AlternativePlatformInfo, OriginalFileInfo);
659
660 if (OriginalFileInfo->cbSize != sizeof(*OriginalFileInfo))
661 {
662 WARN("incorrect OriginalFileInfo->cbSize of %d\n", OriginalFileInfo->cbSize);
664 return FALSE;
665 }
666
667 inf_path = (LPWSTR)InfInformation->VersionData;
668
669 /* FIXME: we should get OriginalCatalogName from CatalogFile line in
670 * the original inf file and cache it, but that would require building a
671 * .pnf file. */
672 hinf = SetupOpenInfFileW(inf_path, NULL, INF_STYLE_WIN4, NULL);
673 if (hinf == INVALID_HANDLE_VALUE) return FALSE;
674
675 if (!SetupGetLineTextW(NULL, hinf, wszVersion, wszCatalogFile,
676 OriginalFileInfo->OriginalCatalogName,
677 sizeof(OriginalFileInfo->OriginalCatalogName)/sizeof(OriginalFileInfo->OriginalCatalogName[0]),
678 NULL))
679 {
680 OriginalFileInfo->OriginalCatalogName[0] = '\0';
681 }
682 SetupCloseInfFile(hinf);
683
684 /* FIXME: not quite correct as we just return the same file name as
685 * destination (copied) inf file, not the source (original) inf file.
686 * to fix it properly would require building a .pnf file */
687 /* file name is stored in VersionData field of InfInformation */
688 inf_name = strrchrW(inf_path, '\\');
689 if (inf_name) inf_name++;
690 else inf_name = inf_path;
691
692 strcpyW(OriginalFileInfo->OriginalInfName, inf_name);
693
694 return TRUE;
695}
unsigned int dir
Definition: maze.c:112
static const WCHAR infW[]
Definition: axinstall.c:35
#define index(s, c)
Definition: various.h:29
#define FIXME(fmt,...)
Definition: debug.h:111
#define WARN(fmt,...)
Definition: debug.h:112
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
#define ERROR_INSUFFICIENT_BUFFER
Definition: dderror.h:10
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
static WCHAR * strdupAtoW(const char *str)
Definition: main.c:65
#define GetProcessHeap()
Definition: compat.h:736
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define CP_ACP
Definition: compat.h:109
#define SetLastError(x)
Definition: compat.h:752
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define HeapAlloc
Definition: compat.h:733
#define MAX_PATH
Definition: compat.h:34
#define HeapFree(x, y, z)
Definition: compat.h:735
#define ERROR_INVALID_HANDLE
Definition: compat.h:98
#define lstrcpyW
Definition: compat.h:749
#define WideCharToMultiByte
Definition: compat.h:111
#define MultiByteToWideChar
Definition: compat.h:110
#define lstrlenW
Definition: compat.h:750
UINT WINAPI GetSystemDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: path.c:2313
UINT WINAPI GetWindowsDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: path.c:2352
BOOL WINAPI SetupDiGetActualSectionToInstallW(HINF InfHandle, PCWSTR InfSectionName, PWSTR InfSectionWithExt, DWORD InfSectionWithExtSize, PDWORD RequiredSize, PWSTR *Extension)
Definition: devinst.c:1980
const WCHAR * PARSER_get_inf_filename(HINF hinf)
Definition: parser.c:1084
HINF WINAPI SetupOpenInfFileW(PCWSTR name, PCWSTR class, DWORD style, UINT *error)
Definition: parser.c:1229
WCHAR * PARSER_get_dest_dir(INFCONTEXT *context)
Definition: parser.c:1116
BOOL WINAPI SetupGetLineTextW(PINFCONTEXT context, HINF hinf, PCWSTR section_name, PCWSTR key_name, PWSTR buffer, DWORD size, PDWORD required)
Definition: parser.c:1756
BOOL WINAPI SetupGetInfInformationA(LPCVOID InfSpec, DWORD SearchControl, PSP_INF_INFORMATION ReturnBuffer, DWORD ReturnBufferSize, PDWORD RequiredSize)
Definition: query.c:89
static const WCHAR source_disks_names[]
Definition: query.c:23
BOOL WINAPI SetupGetInfInformationW(LPCVOID InfSpec, DWORD SearchControl, PSP_INF_INFORMATION ReturnBuffer, DWORD ReturnBufferSize, PDWORD RequiredSize)
Definition: query.c:124
BOOL WINAPI SetupGetTargetPathW(HINF hinf, PINFCONTEXT context, PCWSTR section, PWSTR buffer, DWORD buffer_size, PDWORD required_size)
Definition: query.c:563
BOOL WINAPI SetupQueryInfFileInformationA(PSP_INF_INFORMATION InfInformation, UINT InfIndex, PSTR ReturnBuffer, DWORD ReturnBufferSize, PDWORD RequiredSize)
Definition: query.c:193
BOOL WINAPI SetupGetTargetPathA(HINF hinf, PINFCONTEXT context, PCSTR section, PSTR buffer, DWORD buffer_size, PDWORD required_size)
Definition: query.c:515
BOOL WINAPI SetupQueryInfOriginalFileInformationW(PSP_INF_INFORMATION InfInformation, UINT InfIndex, PSP_ALTPLATFORM_INFO AlternativePlatformInfo, PSP_ORIGINAL_FILE_INFO_W OriginalFileInfo)
Definition: query.c:646
static LPWSTR get_source_id(HINF hinf, PINFCONTEXT context, PCWSTR filename)
Definition: query.c:333
BOOL WINAPI SetupQueryInfOriginalFileInformationA(PSP_INF_INFORMATION InfInformation, UINT InfIndex, PSP_ALTPLATFORM_INFO AlternativePlatformInfo, PSP_ORIGINAL_FILE_INFO_A OriginalFileInfo)
Definition: query.c:611
static HINF search_for_inf(LPCVOID InfSpec, DWORD SearchControl)
Definition: query.c:55
static const WCHAR source_disks_files[]
Definition: query.c:25
BOOL WINAPI SetupQueryInfFileInformationW(PSP_INF_INFORMATION InfInformation, UINT InfIndex, PWSTR ReturnBuffer, DWORD ReturnBufferSize, PDWORD RequiredSize)
Definition: query.c:246
BOOL WINAPI SetupGetSourceFileLocationA(HINF hinf, PINFCONTEXT context, PCSTR filename, PUINT source_id, PSTR buffer, DWORD buffer_size, PDWORD required_size)
Definition: query.c:288
BOOL WINAPI SetupGetSourceFileLocationW(HINF hinf, PINFCONTEXT context, PCWSTR filename, PUINT source_id, PWSTR buffer, DWORD buffer_size, PDWORD required_size)
Definition: query.c:377
BOOL WINAPI SetupGetSourceInfoA(HINF hinf, UINT source_id, UINT info, PSTR buffer, DWORD buffer_size, LPDWORD required_size)
Definition: query.c:420
static BOOL fill_inf_info(HINF inf, PSP_INF_INFORMATION buffer, DWORD size, DWORD *required)
Definition: query.c:31
BOOL WINAPI SetupGetSourceInfoW(HINF hinf, UINT source_id, UINT info, PWSTR buffer, DWORD buffer_size, LPDWORD required_size)
Definition: query.c:464
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
GLuint GLuint end
Definition: gl.h:1545
GLsizeiptr size
Definition: glext.h:5919
GLuint buffer
Definition: glext.h:5915
GLuint index
Definition: glext.h:6031
GLenum GLsizei len
Definition: glext.h:6722
#define INF_STYLE_OLDNT
Definition: infsupp.h:37
#define INF_STYLE_WIN4
Definition: infsupp.h:41
PVOID HINF
Definition: infsupp.h:21
const char * filename
Definition: ioapi.h:137
#define debugstr_a
Definition: kernel32.h:31
#define debugstr_w
Definition: kernel32.h:32
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:274
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
static PVOID ptr
Definition: dispmode.c:27
static const WCHAR filenameW[]
Definition: amstream.c:41
unsigned int * PUINT
Definition: ndis.h:50
unsigned int UINT
Definition: ndis.h:50
DWORD * PDWORD
Definition: pedump.c:68
#define strlenW(s)
Definition: unicode.h:28
#define strrchrW(s, c)
Definition: unicode.h:35
#define sprintfW
Definition: unicode.h:58
#define strtolW(s, e, b)
Definition: unicode.h:33
#define strcpyW(d, s)
Definition: unicode.h:29
#define SRCINFO_DESCRIPTION
Definition: setupapi.h:642
#define INFINFO_INF_NAME_IS_ABSOLUTE
Definition: setupapi.h:449
#define INFINFO_DEFAULT_SEARCH
Definition: setupapi.h:450
#define SRCINFO_TAGFILE
Definition: setupapi.h:641
#define SRCINFO_PATH
Definition: setupapi.h:640
#define INFINFO_REVERSE_DEFAULT_SEARCH
Definition: setupapi.h:451
#define INFINFO_INF_PATH_LIST_SEARCH
Definition: setupapi.h:452
_In_ DWORD SearchControl
Definition: setupapi.h:1954
#define INFINFO_INF_SPEC_IS_HINF
Definition: setupapi.h:448
_In_ DWORD _In_ DWORD ReturnBufferSize
Definition: setupapi.h:1897
#define TRACE(s)
Definition: solgame.cpp:4
static int source_id
Definition: solundo.cpp:15
BYTE VersionData[ANYSIZE_ARRAY]
Definition: setupapi.h:693
CHAR OriginalCatalogName[MAX_PATH]
Definition: setupapi.h:739
CHAR OriginalInfName[MAX_PATH]
Definition: setupapi.h:738
WCHAR OriginalCatalogName[MAX_PATH]
Definition: setupapi.h:744
WCHAR OriginalInfName[MAX_PATH]
Definition: setupapi.h:743
Definition: http.c:7252
Definition: dsound.c:943
Definition: parser.c:56
static void buffer_size(GLcontext *ctx, GLuint *width, GLuint *height)
Definition: swimpl.c:888
uint16_t * PWSTR
Definition: typedefs.h:56
char * PSTR
Definition: typedefs.h:51
const uint16_t * PCWSTR
Definition: typedefs.h:57
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255
uint32_t * LPDWORD
Definition: typedefs.h:59
int32_t INT
Definition: typedefs.h:58
const char * PCSTR
Definition: typedefs.h:52
BOOL WINAPI SetupGetStringFieldW(IN PINFCONTEXT Context, IN ULONG FieldIndex, OUT PWSTR ReturnBuffer, IN ULONG ReturnBufferSize, OUT PULONG RequiredSize)
Definition: infsupp.c:186
BOOL WINAPI SetupFindFirstLineW(IN HINF InfHandle, IN PCWSTR Section, IN PCWSTR Key, IN OUT PINFCONTEXT Context)
Definition: infsupp.c:56
VOID WINAPI SetupCloseInfFile(IN HINF InfHandle)
Definition: infsupp.c:45
int ret
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ ULONG _Out_ PVOID _Out_ PULONG RequiredSize
Definition: wdfdevice.h:4439
CONST void * LPCVOID
Definition: windef.h:191
#define WINAPI
Definition: msvc.h:6
#define ERROR_INVALID_USER_BUFFER
Definition: winerror.h:1091
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185