mirror of
https://github.com/tnodir/fort
synced 2024-11-15 09:59:38 +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;
|
NTSTATUS status;
|
||||||
|
|
||||||
UNUSED(context);
|
|
||||||
UNUSED(count);
|
UNUSED(count);
|
||||||
|
|
||||||
DbgPrintEx(DPFLTR_IHVNETWORK_ID, DPFLTR_ERROR_LEVEL, "FORT: Loader Init: %d\n", 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);
|
status = fort_file_open(context, &fileHandle);
|
||||||
|
|
||||||
DbgPrintEx(DPFLTR_IHVNETWORK_ID, DPFLTR_ERROR_LEVEL,
|
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)) {
|
if (NT_SUCCESS(status)) {
|
||||||
status = fort_file_read(fileHandle, FORT_LOADER_POOL_TAG, &data, &dataSize);
|
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);
|
ExFreePool(context);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Prepare the driver image
|
/* Prepare the driver image */
|
||||||
PUCHAR image = NULL;
|
PUCHAR image = NULL;
|
||||||
|
DWORD imageSize = 0;
|
||||||
if (NT_SUCCESS(status)) {
|
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 */
|
/* Free the driver file's allocated data */
|
||||||
fort_mem_free(data, FORT_LOADER_POOL_TAG);
|
fort_mem_free(data, FORT_LOADER_POOL_TAG);
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
#include "fortimg.h"
|
#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;
|
NTSTATUS status;
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#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
|
#ifdef __cplusplus
|
||||||
} // extern "C"
|
} // extern "C"
|
||||||
|
Loading…
Reference in New Issue
Block a user