Go to the source code of this file.
|
int | InfHostOpenBufferedFile (PHINF InfHandle, void *Buffer, ULONG BufferSize, LANGID LanguageId, ULONG *ErrorLine) |
|
int | InfHostOpenFile (PHINF InfHandle, const CHAR *FileName, LANGID LanguageId, ULONG *ErrorLine) |
|
int | InfHostWriteFile (HINF InfHandle, const CHAR *FileName, const CHAR *HeaderComment) |
|
void | InfHostCloseFile (HINF InfHandle) |
|
int | InfHostFindFirstLine (HINF InfHandle, const WCHAR *Section, const WCHAR *Key, PINFCONTEXT *Context) |
|
int | InfHostFindNextLine (PINFCONTEXT ContextIn, PINFCONTEXT ContextOut) |
|
int | InfHostFindFirstMatchLine (PINFCONTEXT ContextIn, const WCHAR *Key, PINFCONTEXT ContextOut) |
|
int | InfHostFindNextMatchLine (PINFCONTEXT ContextIn, const WCHAR *Key, PINFCONTEXT ContextOut) |
|
LONG | InfHostGetLineCount (HINF InfHandle, const WCHAR *Section) |
|
LONG | InfHostGetFieldCount (PINFCONTEXT Context) |
|
int | InfHostGetBinaryField (PINFCONTEXT Context, ULONG FieldIndex, UCHAR *ReturnBuffer, ULONG ReturnBufferSize, ULONG *RequiredSize) |
|
int | InfHostGetIntField (PINFCONTEXT Context, ULONG FieldIndex, INT *IntegerValue) |
|
int | InfHostGetMultiSzField (PINFCONTEXT Context, ULONG FieldIndex, WCHAR *ReturnBuffer, ULONG ReturnBufferSize, ULONG *RequiredSize) |
|
int | InfHostGetStringField (PINFCONTEXT Context, ULONG FieldIndex, WCHAR *ReturnBuffer, ULONG ReturnBufferSize, ULONG *RequiredSize) |
|
int | InfHostGetData (PINFCONTEXT Context, WCHAR **Key, WCHAR **Data) |
|
int | InfHostGetDataField (PINFCONTEXT Context, ULONG FieldIndex, WCHAR **Data) |
|
int | InfHostFindOrAddSection (HINF InfHandle, const WCHAR *Section, PINFCONTEXT *Context) |
|
int | InfHostAddLine (PINFCONTEXT Context, const WCHAR *Key) |
|
int | InfHostAddField (PINFCONTEXT Context, const WCHAR *Data) |
|
void | InfHostFreeContext (PINFCONTEXT Context) |
|
◆ InfHostAddField()
Definition at line 99 of file infhostput.c.
100{
102
105 {
106 return 0;
107 }
108 else
109 {
111 return -1;
112 }
113}
INFSTATUS InfpAddField(PINFCONTEXT Context, PCWSTR Data)
◆ InfHostAddLine()
Definition at line 82 of file infhostput.c.
83{
85
88 {
89 return 0;
90 }
91 else
92 {
94 return -1;
95 }
96}
INFSTATUS InfpAddLineWithKey(PINFCONTEXT Context, PCWSTR Key)
◆ InfHostCloseFile()
Definition at line 283 of file infhostgen.c.
284{
286
288
290 {
291 return;
292 }
293
295 {
297 }
299
301}
PINFCACHESECTION InfpFreeSection(PINFCACHESECTION Section)
struct _INFCACHE * PINFCACHE
Referenced by ImportRegistryFile().
◆ InfHostFindFirstLine()
Definition at line 18 of file infhostget.c.
22{
24
27 {
28 return 0;
29 }
30 else
31 {
33 return -1;
34 }
35}
INFSTATUS InfpFindFirstLine(PINFCACHE Cache, PCWSTR Section, PCWSTR Key, PINFCONTEXT *Context)
Referenced by registry_callback().
◆ InfHostFindFirstMatchLine()
Definition at line 58 of file infhostget.c.
61{
63
66 {
67 return 0;
68 }
69 else
70 {
72 return -1;
73 }
74}
INFSTATUS InfpFindFirstMatchLine(PINFCONTEXT ContextIn, PCWSTR Key, PINFCONTEXT ContextOut)
◆ InfHostFindNextLine()
Definition at line 39 of file infhostget.c.
41{
43
46 {
47 return 0;
48 }
49 else
50 {
52 return -1;
53 }
54}
INFSTATUS InfpFindNextLine(PINFCONTEXT ContextIn, PINFCONTEXT ContextOut)
Referenced by registry_callback().
◆ InfHostFindNextMatchLine()
Definition at line 78 of file infhostget.c.
81{
83
86 {
87 return 0;
88 }
89 else
90 {
92 return -1;
93 }
94}
INFSTATUS InfpFindNextMatchLine(PINFCONTEXT ContextIn, PCWSTR Key, PINFCONTEXT ContextOut)
◆ InfHostFindOrAddSection()
Definition at line 63 of file infhostput.c.
66{
68
71 {
72 return 0;
73 }
74 else
75 {
77 return -1;
78 }
79}
INFSTATUS InfpFindOrAddSection(PINFCACHE Cache, PCWSTR Section, PINFCONTEXT *Context)
◆ InfHostFreeContext()
◆ InfHostGetBinaryField()
Definition at line 116 of file infhostget.c.
121{
123
127 {
128 return 0;
129 }
130 else
131 {
133 return -1;
134 }
135}
INFSTATUS InfpGetBinaryField(PINFCONTEXT Context, ULONG FieldIndex, PUCHAR ReturnBuffer, ULONG ReturnBufferSize, PULONG RequiredSize)
_In_ DWORD _In_ DWORD ReturnBufferSize
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ ULONG _Out_ PVOID _Out_ PULONG RequiredSize
Referenced by do_reg_operation().
◆ InfHostGetData()
Definition at line 205 of file infhostget.c.
208{
210
213 {
214 return 0;
215 }
216 else
217 {
219 return -1;
220 }
221}
INFSTATUS InfpGetData(PINFCONTEXT Context, PWCHAR *Key, PWCHAR *Data)
◆ InfHostGetDataField()
Definition at line 225 of file infhostget.c.
228{
230
233 {
234 return 0;
235 }
236 else
237 {
239 return -1;
240 }
241}
INFSTATUS InfpGetDataField(PINFCONTEXT Context, ULONG FieldIndex, PWCHAR *Data)
◆ InfHostGetFieldCount()
◆ InfHostGetIntField()
Definition at line 139 of file infhostget.c.
142{
144
147 {
148 return 0;
149 }
150 else
151 {
153 return -1;
154 }
155}
INFSTATUS InfpGetIntField(PINFCONTEXT Context, ULONG FieldIndex, INT *IntegerValue)
Referenced by registry_callback().
◆ InfHostGetLineCount()
◆ InfHostGetMultiSzField()
Definition at line 159 of file infhostget.c.
164{
166
170 {
171 return 0;
172 }
173 else
174 {
176 return -1;
177 }
178}
INFSTATUS InfpGetMultiSzField(PINFCONTEXT Context, ULONG FieldIndex, PWSTR ReturnBuffer, ULONG ReturnBufferSize, PULONG RequiredSize)
Referenced by do_reg_operation().
◆ InfHostGetStringField()
Definition at line 182 of file infhostget.c.
187{
189
193 {
194 return 0;
195 }
196 else
197 {
199 return -1;
200 }
201}
INFSTATUS InfpGetStringField(PINFCONTEXT Context, ULONG FieldIndex, PWSTR ReturnBuffer, ULONG ReturnBufferSize, PULONG RequiredSize)
Referenced by do_reg_operation(), and registry_callback().
◆ InfHostOpenBufferedFile()
Definition at line 20 of file infhostgen.c.
25{
30
32 *ErrorLine = (
ULONG)-1;
33
34
36 FileBuffer =
MALLOC(FileBufferSize);
37 if (FileBuffer ==
NULL)
38 {
41 }
42
44
45
48
49
52 {
56 }
57
58
61
62 Cache->LanguageId = LanguageId;
63
64
66 {
67
69
71
72
73
74
75
76
77
80 {
83 FileBufferSize *
sizeof(
WCHAR),
85 (
char *)FileBuffer +
offset,
87
89 new_buff,
91 ErrorLine);
93 }
94 else
96 }
97 else
98 {
100
101 if (*new_buff == 0xfeff)
102 {
103 new_buff++;
104 FileBufferSize -=
sizeof(
WCHAR);
105 }
107 new_buff,
108 (
WCHAR*)((
char*)new_buff + FileBufferSize),
109 ErrorLine);
110 }
111
113 {
116 }
117
118
120
122
124}
#define ZEROMEMORY(Area, Size)
static BOOLEAN InfpParseBuffer(PINFCACHE file, PCCHAR buffer, PCCHAR end, PULONG error_line)
#define INF_STATUS_INSUFFICIENT_RESOURCES
#define MEMCPY(DST, SRC, BYTES)
NTSYSAPI BOOLEAN NTAPI RtlIsTextUnicode(_In_ CONST VOID *Buffer, _In_ INT Size, _Inout_opt_ INT *Flags)
_Use_decl_annotations_ NTSTATUS NTAPI RtlMultiByteToUnicodeN(_Out_ PWCH UnicodeString, _In_ ULONG UnicodeSize, _Out_opt_ PULONG ResultSize, _In_ PCCH MbString, _In_ ULONG MbSize)
_In_ WDFMEMORY _Out_opt_ size_t * BufferSize
◆ InfHostOpenFile()
Definition at line 128 of file infhostgen.c.
132{
136 ULONG FileBufferLength;
139
141 *ErrorLine = (
ULONG)-1;
142
143
146 {
148 return -1;
149 }
150
151 DPRINT(
"fopen() successful\n");
152
153
155 {
158 return -1;
159 }
160
163 {
166 return -1;
167 }
169
170
172 {
175 return -1;
176 }
177
178
180 FileBuffer =
MALLOC(FileBufferLength);
181 if (FileBuffer ==
NULL)
182 {
185 return -1;
186 }
187
188
190 {
194 return -1;
195 }
196
198
199
202
203
206 {
209 return -1;
210 }
211
212
215
216 Cache->LanguageId = LanguageId;
217
218
220 {
221
223
225
226
227
228
229
230
231
232 new_buff =
MALLOC(FileBufferLength *
sizeof(
WCHAR));
233 if (new_buff !=
NULL)
234 {
237 FileBufferLength *
sizeof(
WCHAR),
239 (
char *)FileBuffer +
offset,
240 FileBufferLength -
offset);
241
243 new_buff,
245 ErrorLine);
246
248 }
249 else
251 }
252 else
253 {
255
256 if (*new_buff == 0xfeff)
257 {
258 new_buff++;
259 FileBufferLength -=
sizeof(
WCHAR);
260 }
262 new_buff,
263 (
WCHAR*)((
char*)new_buff + FileBufferLength),
264 ErrorLine);
265 }
266
268 {
271 }
272
273
275
277
279}
#define INF_STATUS_SUCCESS
_Check_return_opt_ _CRTIMP size_t __cdecl fread(_Out_writes_bytes_(_ElementSize *_Count) void *_DstBuf, _In_ size_t _ElementSize, _In_ size_t _Count, _Inout_ FILE *_File)
_Check_return_ _CRTIMP FILE *__cdecl fopen(_In_z_ const char *_Filename, _In_z_ const char *_Mode)
_Check_return_opt_ _CRTIMP int __cdecl fseek(_Inout_ FILE *_File, _In_ long _Offset, _In_ int _Origin)
_Check_return_opt_ _CRTIMP int __cdecl fclose(_Inout_ FILE *_File)
_Check_return_ _CRTIMP long __cdecl ftell(_Inout_ FILE *_File)
_Out_ PNDIS_HANDLE _Out_ PUINT FileLength
Referenced by ImportRegistryFile().
◆ InfHostWriteFile()
Definition at line 16 of file infhostput.c.
19{
24
27 {
29 return -1;
30 }
31
34 {
37 return -1;
38 }
39
40 DPRINT(
"fopen() successful\n");
41
42 if (
NULL != HeaderComment &&
'\0' != *HeaderComment)
43 {
44
45 }
46
48 {
52 return -1;
53 }
54
56
58
59 return 0;
60}
_Check_return_opt_ _CRTIMP size_t __cdecl fwrite(_In_reads_bytes_(_Size *_Count) const void *_Str, _In_ size_t _Size, _In_ size_t _Count, _Inout_ FILE *_File)
INFSTATUS InfpBuildFileBuffer(PINFCACHE InfHandle, PWCHAR *Buffer, PULONG BufferSize)