ReactOS  0.4.14-dev-317-g96040ec
inffile.h
Go to the documentation of this file.
1 /*
2  * PROJECT: FreeLoader
3  * LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
4  * PURPOSE: INF file parser that caches contents of INF file in memory.
5  * COPYRIGHT: Copyright 2002-2006 Royce Mitchell III
6  * Copyright 2003-2019 Eric Kohl
7  */
8 
9 #pragma once
10 
11 #define STATUS_BAD_SECTION_NAME_LINE (0xC0700001)
12 #define STATUS_SECTION_NAME_TOO_LONG (0xC0700002)
13 #define STATUS_WRONG_INF_STYLE (0xC0700003)
14 #define STATUS_NOT_ENOUGH_MEMORY (0xC0700004)
15 
16 #define MAX_INF_STRING_LENGTH 512
17 
18 typedef PULONG HINF, *PHINF;
19 
20 typedef struct _INFCONTEXT
21 {
27 
28 
29 /* FUNCTIONS ****************************************************************/
30 
31 BOOLEAN
32 InfOpenFile (PHINF InfHandle,
34  PULONG ErrorLine);
35 
36 VOID
37 InfCloseFile (HINF InfHandle);
38 
39 
40 BOOLEAN
41 InfFindFirstLine (HINF InfHandle,
42  PCSTR Section,
43  PCSTR Key,
45 
46 BOOLEAN
47 InfFindNextLine (PINFCONTEXT ContextIn,
48  PINFCONTEXT ContextOut);
49 
50 BOOLEAN
52  PCHAR Key,
53  PINFCONTEXT ContextOut);
54 
55 BOOLEAN
57  PCHAR Key,
58  PINFCONTEXT ContextOut);
59 
60 
61 LONG
62 InfGetLineCount (HINF InfHandle,
63  PCHAR Section);
64 
65 LONG
67 
68 
69 BOOLEAN
72  PUCHAR ReturnBuffer,
75 
76 BOOLEAN
79  LONG *IntegerValue);
80 
81 BOOLEAN
84  PCHAR ReturnBuffer,
87 
88 BOOLEAN
91  PCHAR ReturnBuffer,
94 
95 
96 
97 BOOLEAN
99  PCHAR *Key,
100  PCHAR *Data);
101 
102 BOOLEAN
105  PCSTR *Data);
106 
107 /* EOF */
BOOLEAN InfGetDataField(PINFCONTEXT Context, ULONG FieldIndex, PCSTR *Data)
Definition: inffile.c:1525
signed char * PCHAR
Definition: retypes.h:7
struct _INFCONTEXT * PINFCONTEXT
LONG InfGetLineCount(HINF InfHandle, PCHAR Section)
Definition: inffile.c:1209
unsigned char * PUCHAR
Definition: retypes.h:3
BOOLEAN InfFindNextMatchLine(PINFCONTEXT ContextIn, PCHAR Key, PINFCONTEXT ContextOut)
Definition: inffile.c:1172
_In_ DWORD _In_ DWORD ReturnBufferSize
Definition: setupapi.h:1892
PVOID CurrentInf
Definition: inffile.h:23
PULONG * PHINF
Definition: inffile.h:18
long LONG
Definition: pedump.c:60
BOOLEAN InfGetIntField(PINFCONTEXT Context, ULONG FieldIndex, LONG *IntegerValue)
BOOLEAN InfGetBinaryField(PINFCONTEXT Context, ULONG FieldIndex, PUCHAR ReturnBuffer, ULONG ReturnBufferSize, PULONG RequiredSize)
Definition: inffile.c:1260
BOOLEAN InfGetMultiSzField(PINFCONTEXT Context, ULONG FieldIndex, PCHAR ReturnBuffer, ULONG ReturnBufferSize, PULONG RequiredSize)
Definition: inffile.c:1361
unsigned char BOOLEAN
BOOLEAN InfFindNextLine(PINFCONTEXT ContextIn, PINFCONTEXT ContextOut)
Definition: inffile.c:1107
VOID InfCloseFile(HINF InfHandle)
Definition: inffile.c:1028
PVOID Section
Definition: inffile.h:24
_Inout_ PRTL_BUFFER _In_ SIZE_T RequiredSize
BOOLEAN InfFindFirstLine(HINF InfHandle, PCSTR Section, PCSTR Key, PINFCONTEXT Context)
Definition: inffile.c:1050
BOOLEAN InfOpenFile(PHINF InfHandle, PCSTR FileName, PULONG ErrorLine)
Definition: inffile.c:918
_In_ DWORD FieldIndex
Definition: setupapi.h:1890
struct _INFCONTEXT INFCONTEXT
PULONG HINF
Definition: inffile.h:18
PVOID Line
Definition: inffile.h:25
BOOLEAN InfGetData(PINFCONTEXT Context, PCHAR *Key, PCHAR *Data)
Definition: inffile.c:1491
unsigned int * PULONG
Definition: retypes.h:1
BOOLEAN InfGetStringField(PINFCONTEXT Context, ULONG FieldIndex, PCHAR ReturnBuffer, ULONG ReturnBufferSize, PULONG RequiredSize)
Definition: inffile.c:1431
BOOLEAN InfFindFirstMatchLine(PINFCONTEXT ContextIn, PCHAR Key, PINFCONTEXT ContextOut)
Definition: inffile.c:1135
LONG InfGetFieldCount(PINFCONTEXT Context)
Definition: inffile.c:1250
unsigned int ULONG
Definition: retypes.h:1
PVOID Inf
Definition: inffile.h:22
const char * PCSTR
Definition: typedefs.h:51