89afe6de3224553e830765a9b0095ab289ec9f26
[reactos.git] / reactos / boot / freeldr / freeldr / include / inffile.h
1 /*
2 * ReactOS kernel
3 * Copyright (C) 2002, 2003 ReactOS Team
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 */
19 /* $Id$
20 * COPYRIGHT: See COPYING in the top level directory
21 * PROJECT: ReactOS text-mode setup
22 * FILE: subsys/system/usetup/infcache.h
23 * PURPOSE: INF file parser that caches contents of INF file in memory
24 * PROGRAMMER: Royce Mitchell III
25 * Eric Kohl
26 */
27
28 #pragma once
29
30 #define STATUS_BAD_SECTION_NAME_LINE (0xC0700001)
31 #define STATUS_SECTION_NAME_TOO_LONG (0xC0700002)
32 #define STATUS_WRONG_INF_STYLE (0xC0700003)
33 #define STATUS_NOT_ENOUGH_MEMORY (0xC0700004)
34
35 #define MAX_INF_STRING_LENGTH 512
36
37 typedef PULONG HINF, *PHINF;
38
39 typedef struct _INFCONTEXT
40 {
41 PVOID Inf;
42 // PVOID CurrentInf;
43 PVOID Section;
44 PVOID Line;
45 } INFCONTEXT, *PINFCONTEXT;
46
47
48 /* FUNCTIONS ****************************************************************/
49
50 BOOLEAN
51 InfOpenFile (PHINF InfHandle,
52 PCSTR FileName,
53 PULONG ErrorLine);
54
55 VOID
56 InfCloseFile (HINF InfHandle);
57
58
59 BOOLEAN
60 InfFindFirstLine (HINF InfHandle,
61 PCSTR Section,
62 PCSTR Key,
63 PINFCONTEXT Context);
64
65 BOOLEAN
66 InfFindNextLine (PINFCONTEXT ContextIn,
67 PINFCONTEXT ContextOut);
68
69 BOOLEAN
70 InfFindFirstMatchLine (PINFCONTEXT ContextIn,
71 PCHAR Key,
72 PINFCONTEXT ContextOut);
73
74 BOOLEAN
75 InfFindNextMatchLine (PINFCONTEXT ContextIn,
76 PCHAR Key,
77 PINFCONTEXT ContextOut);
78
79
80 LONG
81 InfGetLineCount (HINF InfHandle,
82 PCHAR Section);
83
84 LONG
85 InfGetFieldCount (PINFCONTEXT Context);
86
87
88 BOOLEAN
89 InfGetBinaryField (PINFCONTEXT Context,
90 ULONG FieldIndex,
91 PUCHAR ReturnBuffer,
92 ULONG ReturnBufferSize,
93 PULONG RequiredSize);
94
95 BOOLEAN
96 InfGetIntField (PINFCONTEXT Context,
97 ULONG FieldIndex,
98 LONG *IntegerValue);
99
100 BOOLEAN
101 InfGetMultiSzField (PINFCONTEXT Context,
102 ULONG FieldIndex,
103 PCHAR ReturnBuffer,
104 ULONG ReturnBufferSize,
105 PULONG RequiredSize);
106
107 BOOLEAN
108 InfGetStringField (PINFCONTEXT Context,
109 ULONG FieldIndex,
110 PCHAR ReturnBuffer,
111 ULONG ReturnBufferSize,
112 PULONG RequiredSize);
113
114
115
116 BOOLEAN
117 InfGetData (PINFCONTEXT Context,
118 PCHAR *Key,
119 PCHAR *Data);
120
121 BOOLEAN
122 InfGetDataField (PINFCONTEXT Context,
123 ULONG FieldIndex,
124 PCSTR *Data);
125
126 /* EOF */