My driver is being blocked for some reason on testing virtual box with windows 10. It throws me this error - https://prnt.sc/r2raz4 Quite confused about that, because more complex driver works fine by the same loader.
The source is quite basic. It only creates the IOCTL device and symlink (Yea. Starting to implement that :D)
#include <ntddk.h>
#include <wdf.h>
#include <wdm.h>
#include <windot11.h>
#include "C:\\Users\\Raitis\\Desktop\\VS Projects\\KMDF Driver1\\KMDF Driver1\\Mod_NtIfs.h"
#include <ntdef.h>
DRIVER_INITIALIZE DriverEntry;
UNICODE_STRING DeviceName = RTL_CONSTANT_STRING(L"\\Device\\TestDevice");
PDEVICE_OBJECT DeviceObject;
UNICODE_STRING SymLinkName = RTL_CONSTANT_STRING("\\??\\MyLink");
VOID Unload(PDRIVER_OBJECT DriverObject)
{
IoDeleteSymbolicLink(&SymLinkName);
IoDeleteDevice(DeviceObject);
KdPrint(("Driver Unloaded"));
}
NTSTATUS DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath)
{
NTSTATUS status;
DriverObject->DriverUnload = Unload;
status = IoCreateDevice(DriverObject, 0, &DeviceName, FILE_DEVICE_UNKNOWN, FILE_DEVICE_SECURE_OPEN, 0, &DeviceObject);
if (!NT_SUCCESS(status))
{
KdPrint(("Creating Device Has Failed"));
return status;
}
status = IoCreateSymbolicLink(&SymLinkName, &DeviceName);
if (!NT_SUCCESS(status));
{
KdPrint(("Creating Symlink Failed \r\n"));
IoDeleteDevice(DeviceObject);
return status;
}
KdPrint(("Driver Loaded\r\n"));
return status;
}