#include "inflib.h"
#include <debug.h>
Go to the source code of this file.
|
static size_t | InfpSubstituteString (PINFCACHE Inf, const WCHAR *text, WCHAR *buffer, size_t size) |
|
static void | ShortToHex (PWCHAR Buffer, USHORT Value) |
|
static PCWSTR | InfpGetSubstitutionString (PINFCACHE Inf, PCWSTR str, size_t *len, BOOL no_trailing_slash) |
|
static size_t | InfpSubstituteString (PINFCACHE Inf, PCWSTR text, PWSTR buffer, size_t size) |
|
INFSTATUS | InfpFindFirstLine (PINFCACHE Cache, PCWSTR Section, PCWSTR Key, PINFCONTEXT *Context) |
|
INFSTATUS | InfpFindNextLine (PINFCONTEXT ContextIn, PINFCONTEXT ContextOut) |
|
INFSTATUS | InfpFindFirstMatchLine (PINFCONTEXT ContextIn, PCWSTR Key, PINFCONTEXT ContextOut) |
|
INFSTATUS | InfpFindNextMatchLine (PINFCONTEXT ContextIn, PCWSTR Key, PINFCONTEXT ContextOut) |
|
LONG | InfpGetLineCount (HINF InfHandle, PCWSTR Section) |
|
LONG | InfpGetFieldCount (PINFCONTEXT Context) |
|
INFSTATUS | InfpGetBinaryField (PINFCONTEXT Context, ULONG FieldIndex, PUCHAR ReturnBuffer, ULONG ReturnBufferSize, PULONG RequiredSize) |
|
INFSTATUS | InfpGetIntField (PINFCONTEXT Context, ULONG FieldIndex, INT *IntegerValue) |
|
INFSTATUS | InfpGetMultiSzField (PINFCONTEXT Context, ULONG FieldIndex, PWSTR ReturnBuffer, ULONG ReturnBufferSize, PULONG RequiredSize) |
|
INFSTATUS | InfpGetStringField (PINFCONTEXT Context, ULONG FieldIndex, PWSTR ReturnBuffer, ULONG ReturnBufferSize, PULONG RequiredSize) |
|
INFSTATUS | InfpGetData (PINFCONTEXT Context, PWCHAR *Key, PWCHAR *Data) |
|
INFSTATUS | InfpGetDataField (PINFCONTEXT Context, ULONG FieldIndex, PWCHAR *Data) |
|
VOID | InfpFreeContext (PINFCONTEXT Context) |
|
◆ NDEBUG
◆ InfpFindFirstLine()
Definition at line 173 of file infget.c.
177{
180
182 {
183 DPRINT1(
"Invalid parameter\n");
185 }
186
188 if (
NULL == CacheSection)
189 {
190 DPRINT(
"Section not found\n");
192 }
193
195 {
197 }
198 else
199 {
201 }
202
203 if (
NULL == CacheLine)
204 {
205 DPRINT(
"Key not found\n");
207 }
208
211 {
214 }
216 (*Context)->Section = CacheSection->
Id;
217 (*Context)->Line = CacheLine->
Id;
218
220}
#define INF_STATUS_INVALID_PARAMETER
#define INF_STATUS_SUCCESS
#define INF_STATUS_NO_MEMORY
#define INF_STATUS_NOT_FOUND
PINFCACHESECTION InfpFindSection(PINFCACHE Cache, PCWSTR Name)
PINFCACHELINE InfpFindKeyLine(PINFCACHESECTION Section, PCWSTR Key)
Referenced by InfFindFirstLine(), InfHostFindFirstLine(), and InfpGetSubstitutionString().
◆ InfpFindFirstMatchLine()
Definition at line 251 of file infget.c.
254{
257
260
264
266 while (CacheLine !=
NULL)
267 {
269 {
270
271 if (ContextIn != ContextOut)
272 {
273 ContextOut->
Inf = ContextIn->
Inf;
275 }
276 ContextOut->
Line = CacheLine->
Id;
277
279 }
280
281 CacheLine = CacheLine->
Next;
282 }
283
285}
PINFCACHESECTION InfpGetSectionForContext(PINFCONTEXT Context)
struct _INFCACHELINE * Next
Referenced by InfFindFirstMatchLine(), and InfHostFindFirstMatchLine().
◆ InfpFindNextLine()
Definition at line 224 of file infget.c.
226{
228
229 if (ContextIn ==
NULL || ContextOut ==
NULL)
231
233 if (CacheLine ==
NULL)
235
238
239 if (ContextIn != ContextOut)
240 {
241 ContextOut->
Inf = ContextIn->
Inf;
243 }
244 ContextOut->
Line = CacheLine->
Next->Id;
245
247}
PINFCACHELINE InfpGetLineForContext(PINFCONTEXT Context)
Referenced by InfFindNextLine(), and InfHostFindNextLine().
◆ InfpFindNextMatchLine()
◆ InfpFreeContext()
◆ InfpGetBinaryField()
Definition at line 377 of file infget.c.
382{
388
390 {
391 DPRINT(
"Invalid parameter\n");
393 }
394
397
399
402
405 CacheField = CacheField->
Next;
406
408
411
412 if (ReturnBuffer !=
NULL)
413 {
416
417
419 while (CacheField !=
NULL)
420 {
422
424 CacheField = CacheField->
Next;
425 }
426 }
427
429}
#define INF_STATUS_BUFFER_OVERFLOW
_Must_inspect_result_ _In_ PFSRTL_PER_STREAM_CONTEXT Ptr
#define strtoulW(s1, s2, b)
_In_ DWORD _In_ DWORD ReturnBufferSize
struct _INFCACHEFIELD * Next
PINFCACHEFIELD FirstField
_In_ WDFCOLLECTION _In_ ULONG Index
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ ULONG _Out_ PVOID _Out_ PULONG RequiredSize
Referenced by InfGetBinaryField(), and InfHostGetBinaryField().
◆ InfpGetData()
◆ InfpGetDataField()
◆ InfpGetFieldCount()
◆ InfpGetIntField()
◆ InfpGetLineCount()
Definition at line 327 of file infget.c.
329{
332
333 if (InfHandle ==
NULL || Section ==
NULL)
334 {
335 DPRINT(
"Invalid parameter\n");
336 return -1;
337 }
338
340
341
342 CacheSection =
Cache->FirstSection;
343 while (CacheSection !=
NULL)
344 {
345
347 {
349 }
350
351
352 CacheSection = CacheSection->
Next;
353 }
354
355 DPRINT(
"Section not found\n");
356
357 return -1;
358}
struct _INFCACHE * PINFCACHE
struct _INFCACHESECTION * Next
Referenced by InfGetLineCount(), and InfHostGetLineCount().
◆ InfpGetMultiSzField()
Definition at line 476 of file infget.c.
481{
488
490 {
491 DPRINT(
"Invalid parameter\n");
493 }
494
497
499
502
505 CacheField = CacheField->
Next;
506
507
508 FieldPtr = CacheField;
511 {
513 FieldPtr = FieldPtr->
Next;
514 }
516
519
520 if (ReturnBuffer !=
NULL)
521 {
524
525
527 FieldPtr = CacheField;
528 while (FieldPtr !=
NULL)
529 {
531
533
535 FieldPtr = FieldPtr->
Next;
536 }
538 }
539
541}
while(CdLookupNextInitialFileDirent(IrpContext, Fcb, FileContext))
Referenced by InfGetMultiSzField(), and InfHostGetMultiSzField().
◆ InfpGetStringField()
Definition at line 545 of file infget.c.
550{
556
558 {
559 DPRINT(
"Invalid parameter\n");
561 }
562
565
567
570
572 {
574 }
575 else
576 {
579 CacheField = CacheField->
Next;
580
582 }
583
584
588 0);
589
592
593 if (ReturnBuffer !=
NULL)
594 {
597
598
601 ReturnBuffer,
603 }
604
606}
static size_t InfpSubstituteString(PINFCACHE Inf, const WCHAR *text, WCHAR *buffer, size_t size)
Referenced by InfGetStringField(), and InfHostGetStringField().
◆ InfpGetSubstitutionString()
Definition at line 37 of file infget.c.
41{
42 static const WCHAR percent =
'%';
43
48 WCHAR StringLangId[] =
L"Strings.XXXX";
49
51 {
53 return &percent;
54 }
55
58
60
62 {
63 ShortToHex(&StringLangId[
sizeof(
"Strings.") - 1],
65
67 StringLangId,
71 {
72 ShortToHex(&StringLangId[
sizeof(
"Strings.") - 1],
74
76 StringLangId,
80 {
85 }
86 }
87 }
88 else
89 {
94 }
95
98
102
104
106 {
110 }
111
113}
INFSTATUS InfpFindFirstLine(PINFCACHE Cache, PCWSTR Section, PCWSTR Key, PINFCONTEXT *Context)
VOID InfpFreeContext(PINFCONTEXT Context)
INFSTATUS InfpGetData(PINFCONTEXT Context, PWCHAR *Key, PWCHAR *Data)
static void ShortToHex(PWCHAR Buffer, USHORT Value)
#define MAX_INF_STRING_LENGTH
#define memcpy(s1, s2, n)
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING ValueName
Referenced by InfpSubstituteString().
◆ InfpSubstituteString() [1/2]
◆ InfpSubstituteString() [2/2]
Definition at line 120 of file infget.c.
124{
127 int inside = 0;
128
131 {
132 if (*
p !=
'%')
continue;
133 inside = !inside;
134 if (inside)
135 {
142 }
143 else
144 {
147 if (!subst)
148 {
151 }
157 }
158 }
159
161 {
166 }
169}
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
static PCWSTR InfpGetSubstitutionString(PINFCACHE Inf, PCWSTR str, size_t *len, BOOL no_trailing_slash)
◆ ShortToHex()
Definition at line 23 of file infget.c.
25{
26 WCHAR HexDigits[] =
L"0123456789abcdef";
27
32}
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
Referenced by InfpGetSubstitutionString().