ReactOS  0.4.14-dev-114-gc8cbd56
infhostget.c
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 /* INCLUDES *****************************************************************/
10 
11 #include "inflib.h"
12 #include "infhost.h"
13 
14 #define NDEBUG
15 #include <debug.h>
16 
17 int
19  const WCHAR *Section,
20  const WCHAR *Key,
22 {
24 
25  Status = InfpFindFirstLine(InfHandle, Section, Key, Context);
26  if (INF_SUCCESS(Status))
27  {
28  return 0;
29  }
30  else
31  {
32  errno = Status;
33  return -1;
34  }
35 }
36 
37 
38 int
40  PINFCONTEXT ContextOut)
41 {
43 
44  Status = InfpFindNextLine(ContextIn, ContextOut);
45  if (INF_SUCCESS(Status))
46  {
47  return 0;
48  }
49  else
50  {
51  errno = Status;
52  return -1;
53  }
54 }
55 
56 
57 int
59  const WCHAR *Key,
60  PINFCONTEXT ContextOut)
61 {
63 
64  Status = InfpFindFirstMatchLine(ContextIn, Key, ContextOut);
65  if (INF_SUCCESS(Status))
66  {
67  return 0;
68  }
69  else
70  {
71  errno = Status;
72  return -1;
73  }
74 }
75 
76 
77 int
79  const WCHAR *Key,
80  PINFCONTEXT ContextOut)
81 {
83 
84  Status = InfpFindNextMatchLine(ContextIn, Key, ContextOut);
85  if (INF_SUCCESS(Status))
86  {
87  return 0;
88  }
89  else
90  {
91  errno = Status;
92  return -1;
93  }
94 }
95 
96 
97 LONG
99  PCWSTR Section)
100 {
101  return InfpGetLineCount(InfHandle, Section);
102 }
103 
104 
105 /* InfGetLineText */
106 
107 
108 LONG
110 {
111  return InfpGetFieldCount(Context);
112 }
113 
114 
115 int
118  UCHAR *ReturnBuffer,
121 {
123 
124  Status = InfpGetBinaryField(Context, FieldIndex, ReturnBuffer,
126  if (INF_SUCCESS(Status))
127  {
128  return 0;
129  }
130  else
131  {
132  errno = Status;
133  return -1;
134  }
135 }
136 
137 
138 int
141  INT *IntegerValue)
142 {
144 
145  Status = InfpGetIntField(Context, FieldIndex, IntegerValue);
146  if (INF_SUCCESS(Status))
147  {
148  return 0;
149  }
150  else
151  {
152  errno = Status;
153  return -1;
154  }
155 }
156 
157 
158 int
161  WCHAR *ReturnBuffer,
164 {
166 
167  Status = InfpGetMultiSzField(Context, FieldIndex, ReturnBuffer,
169  if (INF_SUCCESS(Status))
170  {
171  return 0;
172  }
173  else
174  {
175  errno = Status;
176  return -1;
177  }
178 }
179 
180 
181 int
184  WCHAR *ReturnBuffer,
187 {
189 
190  Status = InfpGetStringField(Context, FieldIndex, ReturnBuffer,
192  if (INF_SUCCESS(Status))
193  {
194  return 0;
195  }
196  else
197  {
198  errno = Status;
199  return -1;
200  }
201 }
202 
203 
204 int
206  WCHAR **Key,
207  WCHAR **Data)
208 {
210 
212  if (INF_SUCCESS(Status))
213  {
214  return 0;
215  }
216  else
217  {
218  errno = Status;
219  return -1;
220  }
221 }
222 
223 
224 int
227  WCHAR **Data)
228 {
230 
232  if (INF_SUCCESS(Status))
233  {
234  return 0;
235  }
236  else
237  {
238  errno = Status;
239  return -1;
240  }
241 }
242 
243 VOID
245 {
247 }
248 
249 /* EOF */
#define INF_SUCCESS(x)
Definition: builddep.h:82
LONG InfHostGetFieldCount(PINFCONTEXT Context)
Definition: infhostget.c:109
const uint16_t * PCWSTR
Definition: typedefs.h:55
INFSTATUS InfpGetBinaryField(PINFCONTEXT Context, ULONG FieldIndex, PUCHAR ReturnBuffer, ULONG ReturnBufferSize, PULONG RequiredSize)
Definition: infget.c:377
int InfHostFindFirstLine(HINF InfHandle, const WCHAR *Section, const WCHAR *Key, PINFCONTEXT *Context)
Definition: infhostget.c:18
int InfHostGetMultiSzField(PINFCONTEXT Context, ULONG FieldIndex, WCHAR *ReturnBuffer, ULONG ReturnBufferSize, ULONG *RequiredSize)
Definition: infhostget.c:159
INFSTATUS InfpFindFirstLine(PINFCACHE Cache, PCWSTR Section, PCWSTR Key, PINFCONTEXT *Context)
Definition: infget.c:173
int InfHostFindFirstMatchLine(PINFCONTEXT ContextIn, const WCHAR *Key, PINFCONTEXT ContextOut)
Definition: infhostget.c:58
_In_ DWORD _In_ DWORD ReturnBufferSize
Definition: setupapi.h:1892
LONG InfHostGetLineCount(HINF InfHandle, PCWSTR Section)
Definition: infhostget.c:98
INFSTATUS InfpGetData(PINFCONTEXT Context, PWCHAR *Key, PWCHAR *Data)
Definition: infget.c:610
int InfHostFindNextMatchLine(PINFCONTEXT ContextIn, const WCHAR *Key, PINFCONTEXT ContextOut)
Definition: infhostget.c:78
int errno
int InfHostGetBinaryField(PINFCONTEXT Context, ULONG FieldIndex, UCHAR *ReturnBuffer, ULONG ReturnBufferSize, ULONG *RequiredSize)
Definition: infhostget.c:116
INFSTATUS InfpGetStringField(PINFCONTEXT Context, ULONG FieldIndex, PWSTR ReturnBuffer, ULONG ReturnBufferSize, PULONG RequiredSize)
Definition: infget.c:545
INFSTATUS InfpGetDataField(PINFCONTEXT Context, ULONG FieldIndex, PWCHAR *Data)
Definition: infget.c:643
int INFSTATUS
Definition: infpriv.h:77
int32_t INT
Definition: typedefs.h:56
int InfHostGetIntField(PINFCONTEXT Context, ULONG FieldIndex, INT *IntegerValue)
Definition: infhostget.c:139
long LONG
Definition: pedump.c:60
int InfHostGetDataField(PINFCONTEXT Context, ULONG FieldIndex, WCHAR **Data)
Definition: infhostget.c:225
int InfHostFindNextLine(PINFCONTEXT ContextIn, PINFCONTEXT ContextOut)
Definition: infhostget.c:39
_Inout_ PRTL_BUFFER _In_ SIZE_T RequiredSize
VOID InfHostFreeContext(PINFCONTEXT Context)
Definition: infhostget.c:244
INFSTATUS InfpFindNextLine(PINFCONTEXT ContextIn, PINFCONTEXT ContextOut)
Definition: infget.c:224
__wchar_t WCHAR
Definition: xmlstorage.h:180
_In_ DWORD FieldIndex
Definition: setupapi.h:1890
INFSTATUS InfpGetMultiSzField(PINFCONTEXT Context, ULONG FieldIndex, PWSTR ReturnBuffer, ULONG ReturnBufferSize, PULONG RequiredSize)
Definition: infget.c:476
INFSTATUS InfpFindNextMatchLine(PINFCONTEXT ContextIn, PCWSTR Key, PINFCONTEXT ContextOut)
Definition: infget.c:289
unsigned char UCHAR
Definition: xmlstorage.h:181
LONG InfpGetFieldCount(PINFCONTEXT Context)
Definition: infget.c:365
Status
Definition: gdiplustypes.h:24
LONG InfpGetLineCount(HINF InfHandle, PCWSTR Section)
Definition: infget.c:327
VOID InfpFreeContext(PINFCONTEXT Context)
Definition: infget.c:679
unsigned int ULONG
Definition: retypes.h:1
int InfHostGetStringField(PINFCONTEXT Context, ULONG FieldIndex, WCHAR *ReturnBuffer, ULONG ReturnBufferSize, ULONG *RequiredSize)
Definition: infhostget.c:182
INFSTATUS InfpFindFirstMatchLine(PINFCONTEXT ContextIn, PCWSTR Key, PINFCONTEXT ContextOut)
Definition: infget.c:251
INFSTATUS InfpGetIntField(PINFCONTEXT Context, ULONG FieldIndex, INT *IntegerValue)
Definition: infget.c:433
int InfHostGetData(PINFCONTEXT Context, WCHAR **Key, WCHAR **Data)
Definition: infhostget.c:205