I am trying to get an IOCTL queue to work for non pnp drivers. I got this working with my mouse filter driver but cant with a generic driver. The point of this driver is that it needs me to manually start it each time I turn my VM on in order to avoid issues with BSOD. Anyways I am getting the following issue that is causing my DriverEntry function to not complete correctly WdfDeviceCreate failed with status 0xc0000079
. This seems to be an issue with my security descriptor but I can’t seem to find a solution.
NTSTATUS status = STATUS_SUCCESS;
WDFDRIVER driver;
PDEVICE_OBJECT deviceObject;
WDFDEVICE device = NULL;
WDF_DRIVER_CONFIG config;
WDF_IO_QUEUE_CONFIG ioQueueConfig;
WDF_OBJECT_ATTRIBUTES fdoAttributes;
DebugMessage("Start DriverEntry \n");
WDF_DRIVER_CONFIG_INIT(&config, NULL);
if (!NT_SUCCESS(status = WdfDriverCreate(DriverObject, RegistryPath, WDF_NO_OBJECT_ATTRIBUTES, &config, &driver))) { //WDF_NO_OBJECT_ATTRIBUTES
DebugMessage("WdfDriverCreate failed with status 0x%x\n", status);
return status;
}
if (driver == NULL) {
DebugMessage("Driver is null \n");
return STATUS_UNSUCCESSFUL;
}
PWDFDEVICE_INIT deviceInit = WdfControlDeviceInitAllocate(driver, &SDDL_DEVOBJ_SYS_ALL_ADM_RWX_WORLD_RW_RES_R); //&SDDL_DEVOBJ_KERNEL_ONLY);
if (deviceInit == NULL) { // Allocate a device initialization structure
DebugMessage("DeviceInit is null \n");
return STATUS_UNSUCCESSFUL;
}
WdfDeviceInitSetCharacteristics(deviceInit, FILE_DEVICE_SECURE_OPEN, FALSE); // Set the device characteristics
// Create a framework device object. This call will in turn create a WDM deviceobject, attach to the lower stack and set the appropriate flags and attributes.
if (!NT_SUCCESS(status = WdfDeviceCreate(&deviceInit, WDF_NO_OBJECT_ATTRIBUTES, &device))) {
DebugMessage("WdfDeviceCreate failed with status 0x%x\n", status);
return status;
}
if (status == STATUS_SUCCESS) {
WdfControlFinishInitializing(device); // Initialization of the framework device object is complete
deviceObject = WdfDeviceWdmGetDeviceObject(device); // Get the associated WDM device object
}
WDF_IO_QUEUE_CONFIG_INIT_DEFAULT_QUEUE(&ioQueueConfig, WdfIoQueueDispatchParallel);
if (!NT_SUCCESS(status = WdfIoQueueCreate(device, &ioQueueConfig, WDF_NO_OBJECT_ATTRIBUTES, WDF_NO_HANDLE))) {
DebugMessage("WdfIoQueueCreate failed 0x%x\n", status);
}
if (!NT_SUCCESS(status = CreateMouseInputControlDevice(driver))) { // This will actually initialize my queue
DebugMessage("CreateMouseInputControlDevice failed with status 0x%x\n", status);
return status;
}