19{
28 ULONG HeaderBufferSize;
30
33 {
34 DPRINT(
"Failed to create buffer (Status 0x%lx)\n", InfStatus);
35 return InfStatus;
36 }
37
38
41 0,
44
49 0,
52 {
56 }
57
58 DPRINT(
"NtOpenFile() successful\n");
59
60 if (
NULL != HeaderComment && 0 != HeaderComment->
Length)
61 {
62
63 HeaderBufferSize = HeaderComment->
Length + 7 *
sizeof(
WCHAR);
64 HeaderBuffer =
MALLOC(HeaderBufferSize);
65 if (
NULL != HeaderBuffer)
66 {
69 {
71 }
79 HeaderBuffer,
80 HeaderBufferSize,
84 }
85 }
86
87
97
100
102 {
105 }
106
108}
#define FILE_NON_DIRECTORY_FILE
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
_Must_inspect_result_ _In_opt_ PFLT_INSTANCE _Out_ PHANDLE FileHandle
#define FILE_SYNCHRONOUS_IO_NONALERT
INFSTATUS InfpBuildFileBuffer(PINFCACHE InfHandle, PWCHAR *Buffer, PULONG BufferSize)
static OUT PIO_STATUS_BLOCK IoStatusBlock
#define InitializeObjectAttributes(p, n, a, r, s)
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 NTSTATUS NTAPI NtWriteFile(IN HANDLE hFile, IN HANDLE hEvent OPTIONAL, IN PIO_APC_ROUTINE IoApcRoutine OPTIONAL, IN PVOID IoApcContext OPTIONAL, OUT PIO_STATUS_BLOCK pIoStatusBlock, IN PVOID WriteBuffer, IN ULONG WriteBufferLength, IN PLARGE_INTEGER FileOffset OPTIONAL, IN PULONG LockOperationKey OPTIONAL)
NTSTATUS NTAPI NtClose(IN HANDLE Handle)
_In_ WDFCOLLECTION _In_ ULONG Index
_In_ WDFMEMORY _Out_opt_ size_t * BufferSize