mirror of
https://github.com/tnodir/fort
synced 2024-11-15 07:38:16 +00:00
DriverLoader: Minor fixes.
This commit is contained in:
parent
ba810a1ae3
commit
4fcaea6c50
@ -10,7 +10,6 @@ static void fortdl_init(PDRIVER_OBJECT driver, PVOID context, ULONG count)
|
||||
{
|
||||
NTSTATUS status;
|
||||
|
||||
UNUSED(context);
|
||||
UNUSED(count);
|
||||
|
||||
DbgPrintEx(DPFLTR_IHVNETWORK_ID, DPFLTR_ERROR_LEVEL, "FORT: Loader Init: %d\n", count);
|
||||
@ -23,7 +22,7 @@ static void fortdl_init(PDRIVER_OBJECT driver, PVOID context, ULONG count)
|
||||
status = fort_file_open(context, &fileHandle);
|
||||
|
||||
DbgPrintEx(DPFLTR_IHVNETWORK_ID, DPFLTR_ERROR_LEVEL,
|
||||
"FORT: Loader File Load: %w status=%d\n", (PCWSTR) context, status);
|
||||
"FORT: Loader File Open: %w status=%d\n", (PCWSTR) context, status);
|
||||
|
||||
if (NT_SUCCESS(status)) {
|
||||
status = fort_file_read(fileHandle, FORT_LOADER_POOL_TAG, &data, &dataSize);
|
||||
@ -38,10 +37,11 @@ static void fortdl_init(PDRIVER_OBJECT driver, PVOID context, ULONG count)
|
||||
ExFreePool(context);
|
||||
}
|
||||
|
||||
// Prepare the driver image
|
||||
/* Prepare the driver image */
|
||||
PUCHAR image = NULL;
|
||||
DWORD imageSize = 0;
|
||||
if (NT_SUCCESS(status)) {
|
||||
status = fort_image_load(data, dataSize, &image);
|
||||
status = fort_image_load(data, dataSize, &image, &imageSize);
|
||||
|
||||
/* Free the driver file's allocated data */
|
||||
fort_mem_free(data, FORT_LOADER_POOL_TAG);
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
#include "fortimg.h"
|
||||
|
||||
FORT_API NTSTATUS fort_image_load(const PUCHAR data, DWORD dataSize, PUCHAR *image)
|
||||
FORT_API NTSTATUS fort_image_load(const PUCHAR data, DWORD dataSize, PUCHAR *image, DWORD *outSize)
|
||||
{
|
||||
NTSTATUS status;
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
FORT_API NTSTATUS fort_image_load(const PUCHAR data, DWORD dataSize, PUCHAR *image);
|
||||
FORT_API NTSTATUS fort_image_load(const PUCHAR data, DWORD dataSize, PUCHAR *image, DWORD *outSize);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
|
Loading…
Reference in New Issue
Block a user