Yet another! :D
I got my driver / device list.
I'm trying to get a DEVICE_OBJECT with the device name
The 2 are defined the same way, but only IoDriverObjectType works...
I got my driver / device list.
I'm trying to get a DEVICE_OBJECT with the device name
Code: Select all
It returns STATUS_OBJECT_TYPE_MISMATCH...InitializeObjectAttributes( &attributes, &deviceUnicodeString, 0, 0, NULL );
status = ObOpenObjectByName( &attributes, *IoDeviceObjectType, KernelMode, NULL, 0x80000000, NULL, &handle );
if (!NT_SUCCESS(status))
{
DbgPrint("Error : %ws : 0x%x\n", name.Buffer, status);
continue;
}
ObReferenceObjectByHandle( handle, FILE_ALL_ACCESS, NULL, KernelMode, &pDev, NULL );
ZwClose( handle );
The 2 are defined the same way, but only IoDriverObjectType works...
Code: Select all
extern POBJECT_TYPE* IoDriverObjectType;
extern POBJECT_TYPE* IoDeviceObjectType;