ReactOS  0.4.14-dev-49-gfb4591c
infpriv.h
Go to the documentation of this file.
1 /*
2  * PROJECT: .inf file parser
3  * LICENSE: GPL - See COPYING in the top level directory
4  * PROGRAMMER: Royce Mitchell III
5  * Eric Kohl
6  * Ge van Geldorp <gvg@reactos.org>
7  */
8 
9 #pragma once
10 
11 #ifndef FIELD_OFFSET
12 #define FIELD_OFFSET(t,f) ((ptrdiff_t)&(((t*)0)->f))
13 #endif
14 
15 #define INF_STATUS_INSUFFICIENT_RESOURCES ((INFSTATUS)0xC000009A)
16 #define INF_STATUS_BAD_SECTION_NAME_LINE ((INFSTATUS)0xC0700001)
17 #define INF_STATUS_SECTION_NAME_TOO_LONG ((INFSTATUS)0xC0700002)
18 #define INF_STATUS_WRONG_INF_STYLE ((INFSTATUS)0xC0700003)
19 #define INF_STATUS_NOT_ENOUGH_MEMORY ((INFSTATUS)0xC0700004)
20 
21 typedef struct _INFCACHEFIELD
22 {
23  struct _INFCACHEFIELD *Next;
24  struct _INFCACHEFIELD *Prev;
25 
26  WCHAR Data[1];
28 
29 typedef struct _INFCACHELINE
30 {
31  struct _INFCACHELINE *Next;
32  struct _INFCACHELINE *Prev;
34 
36 
38 
41 
43 
44 typedef struct _INFCACHESECTION
45 {
46  struct _INFCACHESECTION *Next;
47  struct _INFCACHESECTION *Prev;
48 
52 
55 
56  WCHAR Name[1];
58 
59 typedef struct _INFCACHE
60 {
65 
68 
69 typedef struct _INFCONTEXT
70 {
73  UINT Section;
74  UINT Line;
75 } INFCONTEXT;
76 
77 typedef int INFSTATUS;
78 
79 /* FUNCTIONS ****************************************************************/
80 
82  const WCHAR *buffer,
83  const WCHAR *end,
84  PULONG error_line);
87  PCWSTR Name);
90  PCWSTR Key);
92  PCWSTR Data);
94  PCWSTR Key);
96  PCWSTR Section);
97 
98 extern INFSTATUS InfpBuildFileBuffer(PINFCACHE InfHandle,
99  PWCHAR *Buffer,
101 
102 extern INFSTATUS InfpFindFirstLine(PINFCACHE InfHandle,
103  PCWSTR Section,
104  PCWSTR Key,
106 extern INFSTATUS InfpFindNextLine(PINFCONTEXT ContextIn,
107  PINFCONTEXT ContextOut);
109  PCWSTR Key,
110  PINFCONTEXT ContextOut);
112  PCWSTR Key,
113  PINFCONTEXT ContextOut);
114 extern LONG InfpGetLineCount(HINF InfHandle,
115  PCWSTR Section);
119  PUCHAR ReturnBuffer,
124  INT *IntegerValue);
127  PWSTR ReturnBuffer,
132  PWSTR ReturnBuffer,
136  PWCHAR *Key,
137  PWCHAR *Data);
140  PWCHAR *Data);
141 
143  PCWSTR Section,
147 
155 
156 /* EOF */
LONG LineCount
Definition: inffile.c:57
INFSTATUS InfpAddLineWithKey(PINFCONTEXT Context, PCWSTR Key)
Definition: infput.c:224
INFSTATUS InfpFindNextLine(PINFCONTEXT ContextIn, PINFCONTEXT ContextOut)
Definition: infget.c:224
const uint16_t * PCWSTR
Definition: typedefs.h:55
INFSTATUS InfpFindOrAddSection(PINFCACHE Cache, PCWSTR Section, PINFCONTEXT *Context)
Definition: infput.c:190
PVOID InfpAddFieldToLine(PINFCACHELINE Line, PCWSTR Data)
Definition: infcore.c:353
struct _INFCACHEFIELD * Prev
Definition: inffile.c:30
INFSTATUS InfpFindNextMatchLine(PINFCONTEXT ContextIn, PCWSTR Key, PINFCONTEXT ContextOut)
Definition: infget.c:289
Definition: fatfs.h:173
PINFCACHE Inf
Definition: infpriv.h:71
uint16_t * PWSTR
Definition: typedefs.h:54
INFSTATUS InfpFindFirstLine(PINFCACHE InfHandle, PCWSTR Section, PCWSTR Key, PINFCONTEXT *Context)
Definition: infget.c:173
struct _INFCACHEFIELD * Next
Definition: inffile.c:29
unsigned char * PUCHAR
Definition: retypes.h:3
LANGID LanguageId
Definition: infpriv.h:61
LONG InfpGetLineCount(HINF InfHandle, PCWSTR Section)
Definition: infget.c:327
_In_ DWORD _In_ DWORD ReturnBufferSize
Definition: setupapi.h:1892
INFSTATUS InfpAddField(PINFCONTEXT Context, PCWSTR Data)
Definition: infput.c:254
GLuint buffer
Definition: glext.h:5915
PWCHAR Key
Definition: infpriv.h:37
GLuint GLuint end
Definition: gl.h:1545
WORD LANGID
Definition: typedefs.h:79
PVOID InfpAddKeyToLine(PINFCACHELINE Line, PCWSTR Key)
Definition: infcore.c:324
uint16_t * PWCHAR
Definition: typedefs.h:54
PINFCACHESECTION InfpFindSection(PINFCACHE Cache, PCWSTR Section)
Definition: infcore.c:143
int INFSTATUS
Definition: infpriv.h:77
int32_t INT
Definition: typedefs.h:56
PINFCACHESECTION LastSection
Definition: inffile.c:65
struct _INFCACHELINE INFCACHELINE
struct _INFCACHESECTION * Next
Definition: inffile.c:51
DWORD Id
PINFCACHE CurrentInf
Definition: infpriv.h:72
struct _INFCACHEFIELD INFCACHEFIELD
PINFCACHEFIELD FirstField
Definition: inffile.c:44
PINFCACHELINE InfpGetLineForContext(PINFCONTEXT Context)
Definition: infcore.c:310
struct _INFCACHESECTION * PINFCACHESECTION
struct _INFCACHELINE * Prev
Definition: inffile.c:38
long LONG
Definition: pedump.c:60
INFSTATUS InfpBuildFileBuffer(PINFCACHE InfHandle, PWCHAR *Buffer, PULONG BufferSize)
Definition: infput.c:90
PINFCACHESECTION InfpFreeSection(PINFCACHESECTION Section)
Definition: infcore.c:119
INFSTATUS InfpGetIntField(PINFCONTEXT Context, ULONG FieldIndex, INT *IntegerValue)
Definition: infget.c:433
Definition: bufpool.h:45
struct _INFCACHELINE * PINFCACHELINE
_Inout_ PRTL_BUFFER _In_ SIZE_T RequiredSize
PINFCACHESECTION InfpGetSectionForContext(PINFCONTEXT Context)
Definition: infcore.c:273
INFSTATUS InfpGetStringField(PINFCONTEXT Context, ULONG FieldIndex, PWSTR ReturnBuffer, ULONG ReturnBufferSize, PULONG RequiredSize)
Definition: infget.c:545
PINFCACHELINE InfpFindLineById(PINFCACHESECTION Section, UINT Id)
Definition: infcore.c:292
struct _INFCACHESECTION * Prev
Definition: inffile.c:52
VOID InfpFreeContext(PINFCONTEXT Context)
Definition: infget.c:679
__wchar_t WCHAR
Definition: xmlstorage.h:180
PINFCACHEFIELD LastField
Definition: inffile.c:45
_In_ DWORD FieldIndex
Definition: setupapi.h:1890
PINFCACHELINE InfpAddLine(PINFCACHESECTION Section)
Definition: infcore.c:217
#define BufferSize
Definition: classpnp.h:419
INFSTATUS InfpGetBinaryField(PINFCONTEXT Context, ULONG FieldIndex, PUCHAR ReturnBuffer, ULONG ReturnBufferSize, PULONG RequiredSize)
Definition: infget.c:377
LONG InfpGetFieldCount(PINFCONTEXT Context)
Definition: infget.c:365
Definition: ncftp.h:79
UINT NextLineId
Definition: infpriv.h:54
INFSTATUS InfpGetMultiSzField(PINFCONTEXT Context, ULONG FieldIndex, PWSTR ReturnBuffer, ULONG ReturnBufferSize, PULONG RequiredSize)
Definition: infget.c:476
PINFCACHELINE FirstLine
Definition: inffile.c:54
PINFCACHELINE InfpFindKeyLine(PINFCACHESECTION Section, PCWSTR Key)
Definition: infcore.c:390
UINT NextSectionId
Definition: infpriv.h:64
INFSTATUS InfpFindFirstMatchLine(PINFCONTEXT ContextIn, PCWSTR Key, PINFCONTEXT ContextOut)
Definition: infget.c:251
INFSTATUS InfpGetData(PINFCONTEXT Context, PWCHAR *Key, PWCHAR *Data)
Definition: infget.c:610
UINT Section
Definition: infsupp.h:26
struct _INFCACHE INFCACHE
unsigned int * PULONG
Definition: retypes.h:1
INFSTATUS InfpParseBuffer(PINFCACHE file, const WCHAR *buffer, const WCHAR *end, PULONG error_line)
Definition: infcore.c:865
unsigned int UINT
Definition: ndis.h:50
PINFCACHESECTION FirstSection
Definition: inffile.c:64
PINFCACHESECTION InfpAddSection(PINFCACHE Cache, PCWSTR Name)
Definition: infcore.c:171
struct _INFCACHE * PINFCACHE
PINFCACHESECTION StringsSection
Definition: inffile.c:67
struct _INFCACHELINE * Next
Definition: inffile.c:37
struct _INFCACHEFIELD * PINFCACHEFIELD
PINFCACHELINE LastLine
Definition: inffile.c:55
LONG FieldCount
Definition: infpriv.h:35
unsigned int ULONG
Definition: retypes.h:1
struct _INFCACHESECTION INFCACHESECTION
INFSTATUS InfpGetDataField(PINFCONTEXT Context, ULONG FieldIndex, PWCHAR *Data)
Definition: infget.c:643
struct _INFCONTEXT INFCONTEXT
UINT Line
Definition: infsupp.h:27
Definition: fci.c:126