65 *ErrorLine = (
ULONG)-1;
69 FileBuffer =
MALLOC(FileBufferSize);
70 if (FileBuffer ==
NULL)
86 DPRINT(
"MALLOC() failed\n");
95 Cache->LanguageId = LanguageId;
112 if (new_buff !=
NULL)
116 FileBufferSize *
sizeof(
WCHAR),
118 (
char *)FileBuffer +
offset,
134 if (*new_buff == 0xfeff)
137 FileBufferSize -=
sizeof(
WCHAR);
141 (
WCHAR*)((
char*)new_buff + FileBufferSize),
173 ULONG FileBufferLength;
180 *ErrorLine = (
ULONG)-1;
201 DPRINT(
"NtOpenFile() successful\n");
211 DPRINT(
"NtQueryInformationFile() failed (Status %lx)\n",
Status);
222 FileBuffer =
MALLOC(FileBufferLength);
223 if (FileBuffer ==
NULL)
259 DPRINT(
"MALLOC() failed\n");
268 Cache->LanguageId = LanguageId;
284 new_buff =
MALLOC(FileBufferLength *
sizeof(
WCHAR));
285 if (new_buff !=
NULL)
289 FileBufferLength *
sizeof(
WCHAR),
291 (
char *)FileBuffer +
offset,
292 FileBufferLength -
offset);
307 if (*new_buff == 0xfeff)
310 FileBufferLength -=
sizeof(
WCHAR);
314 (
WCHAR*)((
char*)new_buff + FileBufferLength),
#define FILE_NON_DIRECTORY_FILE
#define ZEROMEMORY(Area, Size)
_In_ PFCB _In_ LONGLONG FileOffset
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
_Must_inspect_result_ _In_opt_ PFLT_INSTANCE _Out_ PHANDLE FileHandle
#define FILE_SYNCHRONOUS_IO_NONALERT
PINFCACHESECTION InfpFreeSection(PINFCACHESECTION Section)
static BOOLEAN InfpParseBuffer(PINFCACHE file, PCCHAR buffer, PCCHAR end, PULONG error_line)
struct _INFCACHE * PINFCACHE
#define INF_STATUS_INSUFFICIENT_RESOURCES
VOID InfSetHeap(PVOID Heap)
NTSTATUS InfOpenFile(PHINF InfHandle, PUNICODE_STRING FileName, LANGID LanguageId, PULONG ErrorLine)
static int InfpHeapRefCount
VOID InfCloseFile(HINF InfHandle)
static VOID CheckHeap(VOID)
NTSTATUS InfOpenBufferedFile(PHINF InfHandle, PVOID Buffer, ULONG BufferSize, LANGID LanguageId, PULONG ErrorLine)
#define MEMCPY(DST, SRC, BYTES)
static OUT PIO_STATUS_BLOCK IoStatusBlock
#define InitializeObjectAttributes(p, n, a, r, s)
_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)
NTSYSAPI PVOID NTAPI RtlDestroyHeap(IN PVOID HeapHandle)
NTSYSAPI NTSTATUS NTAPI NtOpenFile(OUT PHANDLE phFile, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes, OUT PIO_STATUS_BLOCK pIoStatusBlock, IN ULONG ShareMode, IN ULONG OpenMode)
NTSYSAPI PVOID NTAPI RtlCreateHeap(IN ULONG Flags, IN PVOID HeapBase OPTIONAL, IN ULONG ReserveSize OPTIONAL, IN ULONG CommitSize OPTIONAL, IN PVOID Lock OPTIONAL, IN PRTL_HEAP_PARAMETERS Parameters OPTIONAL)
NTSYSAPI NTSTATUS NTAPI NtQueryInformationFile(IN HANDLE hFile, OUT PIO_STATUS_BLOCK pIoStatusBlock, OUT PVOID FileInformationBuffer, IN ULONG FileInformationBufferLength, IN FILE_INFORMATION_CLASS FileInfoClass)
NTSTATUS NTAPI NtClose(IN HANDLE Handle)
#define FileStandardInformation
NTSTATUS NTAPI NtReadFile(HANDLE FileHandle, HANDLE Event, PIO_APC_ROUTINE ApcRoutine, PVOID ApcContext, PIO_STATUS_BLOCK IoStatusBlock, PVOID Buffer, ULONG Length, PLARGE_INTEGER ByteOffset, PULONG Key)
_In_ WDFMEMORY _Out_opt_ size_t * BufferSize