DriverLoader: Minor fixes.

This commit is contained in:
Nodir Temirkhodjaev 2021-11-04 10:59:56 +03:00
parent ba810a1ae3
commit 4fcaea6c50
3 changed files with 6 additions and 6 deletions

View File

@ -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);

View File

@ -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;

View File

@ -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"