32 *ErrorLine = (
ULONG)-1;
36 FileBuffer =
MALLOC(FileBufferSize);
37 if (FileBuffer ==
NULL)
62 Cache->LanguageId = LanguageId;
83 FileBufferSize *
sizeof(
WCHAR),
85 (
char *)FileBuffer +
offset,
101 if (*new_buff == 0xfeff)
104 FileBufferSize -=
sizeof(
WCHAR);
108 (
WCHAR*)((
char*)new_buff + FileBufferSize),
136 ULONG FileBufferLength;
141 *ErrorLine = (
ULONG)-1;
151 DPRINT(
"fopen() successful\n");
180 FileBuffer =
MALLOC(FileBufferLength);
181 if (FileBuffer ==
NULL)
216 Cache->LanguageId = LanguageId;
232 new_buff =
MALLOC(FileBufferLength *
sizeof(
WCHAR));
233 if (new_buff !=
NULL)
237 FileBufferLength *
sizeof(
WCHAR),
239 (
char *)FileBuffer +
offset,
240 FileBufferLength -
offset);
256 if (*new_buff == 0xfeff)
259 FileBufferLength -=
sizeof(
WCHAR);
263 (
WCHAR*)((
char*)new_buff + FileBufferLength),
#define INF_STATUS_SUCCESS
#define ZEROMEMORY(Area, Size)
_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)
PINFCACHESECTION InfpFreeSection(PINFCACHESECTION Section)
static BOOLEAN InfpParseBuffer(PINFCACHE file, PCCHAR buffer, PCCHAR end, PULONG error_line)
struct _INFCACHE * PINFCACHE
int InfHostOpenFile(PHINF InfHandle, const CHAR *FileName, LANGID LanguageId, ULONG *ErrorLine)
int InfHostOpenBufferedFile(PHINF InfHandle, void *Buffer, ULONG BufferSize, LANGID LanguageId, ULONG *ErrorLine)
void InfHostCloseFile(HINF InfHandle)
#define INF_STATUS_INSUFFICIENT_RESOURCES
#define MEMCPY(DST, SRC, BYTES)
_Out_ PNDIS_HANDLE _Out_ PUINT FileLength
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