#include "inflib.h"
#include "infhost.h"
#include <debug.h>
Go to the source code of this file.
◆ NDEBUG
◆ 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().
◆ 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().