16#define CONTROL_Z '\x1a'
17#define MAX_SECTION_NAME_LEN 255
18#define MAX_FIELD_LEN 511
20#define MAX_STRING_LEN (MAX_INF_STRING_LENGTH+1)
106 Field =
Line->FirstField->Next;
108 Line->FirstField = Field;
129 Next = Section->
Next;
154 Section =
Cache->FirstSection;
155 while (Section !=
NULL)
163 Section = Section->
Next;
179 DPRINT(
"Invalid parameter\n");
189 DPRINT(
"MALLOC() failed\n");
194 Section->
Id = ++
Cache->NextSectionId;
202 Cache->FirstSection = Section;
203 Cache->LastSection = Section;
207 Cache->LastSection->Next = Section;
209 Cache->LastSection = Section;
223 DPRINT(
"Invalid parameter\n");
230 DPRINT(
"MALLOC() failed\n");
259 for (Section =
Cache->FirstSection;
261 Section = Section->
Next)
263 if (Section->
Id ==
Id)
335 DPRINT1(
"Line already has a key\n");
374 Line->FirstField = Field;
375 Line->LastField = Field;
379 Line->LastField->Next = Field;
381 Line->LastField = Field;
448 (*
ptr ==
'\r' && *(
ptr + 1) ==
'\n') ||
512 return (
PVOID)Section;
638 if (*
p ==
',')
break;
#define INF_STATUS_SUCCESS
#define ZEROMEMORY(Area, Size)
static const WCHAR * key_name_state(struct parser *parser, const WCHAR *pos)
static struct field * add_field_from_token(struct parser *parser, int is_key)
static const WCHAR * value_name_state(struct parser *parser, const WCHAR *pos)
PINFCACHESECTION InfpFindSection(PINFCACHE Cache, PCWSTR Name)
PINFCACHELINE InfpFindLineById(PINFCACHESECTION Section, UINT Id)
PINFCACHELINE InfpGetLineForContext(PINFCONTEXT Context)
static __inline enum parser_state set_state(struct parser *parser, enum parser_state state)
PINFCACHESECTION InfpFreeSection(PINFCACHESECTION Section)
PVOID InfpAddKeyToLine(PINFCACHELINE Line, PCWSTR Key)
static const WCHAR * section_name_state(struct parser *parser, const WCHAR *pos)
INFSTATUS InfpParseBuffer(PINFCACHE file, const WCHAR *buffer, const WCHAR *end, PULONG error_line)
static PINFCACHELINE InfpFreeLine(PINFCACHELINE Line)
static const WCHAR * leading_spaces_state(struct parser *parser, const WCHAR *pos)
static void close_current_line(struct parser *parser)
PINFCACHELINE InfpFindKeyLine(PINFCACHESECTION Section, PCWSTR Key)
static __inline int is_eof(struct parser *parser, const WCHAR *ptr)
static PVOID add_section_from_token(struct parser *parser)
static __inline int is_eol(struct parser *parser, const WCHAR *ptr)
static const WCHAR * line_start_state(struct parser *parser, const WCHAR *pos)
const WCHAR *(* parser_state_func)(struct parser *parser, const WCHAR *pos)
static __inline void push_state(struct parser *parser, enum parser_state state)
PVOID InfpAddFieldToLine(PINFCACHELINE Line, PCWSTR Data)
PINFCACHESECTION InfpGetSectionForContext(PINFCONTEXT Context)
static const WCHAR * eol_backslash_state(struct parser *parser, const WCHAR *pos)
static __inline void pop_state(struct parser *parser)
static const WCHAR * quotes_state(struct parser *parser, const WCHAR *pos)
PINFCACHELINE InfpAddLine(PINFCACHESECTION Section)
static const WCHAR * comment_state(struct parser *parser, const WCHAR *pos)
static int push_token(struct parser *parser, const WCHAR *pos)
#define MAX_SECTION_NAME_LEN
PINFCACHESECTION InfpFindSectionById(PINFCACHE Cache, UINT Id)
static const WCHAR * trailing_spaces_state(struct parser *parser, const WCHAR *pos)
PINFCACHESECTION InfpAddSection(PINFCACHE Cache, PCWSTR Name)
static const parser_state_func parser_funcs[NB_PARSER_STATES]
struct _INFCACHEFIELD * PINFCACHEFIELD
struct _INFCACHESECTION * PINFCACHESECTION
struct _INFCACHELINE * PINFCACHELINE
struct _INFCACHE * PINFCACHE
#define INF_STATUS_BAD_SECTION_NAME_LINE
#define INF_STATUS_SECTION_NAME_TOO_LONG
#define INF_STATUS_WRONG_INF_STYLE
#define INF_STATUS_NOT_ENOUGH_MEMORY
struct _INFCACHEFIELD * Prev
struct _INFCACHELINE * Next
struct _INFCACHESECTION * Prev
struct _INFCACHESECTION * Next
PINFCACHESECTION cur_section
CHAR token[MAX_FIELD_LEN+1]
enum parser_state stack[4]
#define FIELD_OFFSET(t, f)
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size