why ioregisterdeviceinterface failed? RRS feed

  • Question

  • My driver is a filter driver. In adddevice(), I use ioregisterdeviceinterface.

    status = IoCreateDevice(
    	if (!NT_SUCCESS(status))
    	{						// can't create device object
    		KdPrint((DRIVERNAME " - IoCreateDevice failed - %X\n", status));
    		return status;
    	}						// can't create device object
    	KdPrint(("device type %x",GetDeviceTypeToUse(pdo)));
    	RtlInitUnicodeString( &symbolicLinkName, SYMBOLIC_NAME_STRING );
        status = IoRegisterDeviceInterface(fido, NULL, NULL, &symbolicLinkName);

    ioregisterdeviceinterface returns 0xc0000010, means status_invalid_device_request.

    device type is 0x22, file_device_unknown. so I give the 2nd parameter a NULL.

    can anyone tell me the bugs in my code? Thanks for your help!

    Sunday, May 22, 2016 1:59 AM

All replies

  • you need to pass in the PDO to the API. the same pdo that was passed as a parameter to your AddDevice() routine. Why are you not using KMDF?

    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Sunday, May 22, 2016 3:17 AM
  • Besides the PDO that Doron mentions, you need to have a GUID for the device interface NOT NULL.  Also, the last argument is returned by the kernel, if you have a constant string for SYMBOLIC_NAME_STRING then the call will fail when the system tries to write to the read-only memory that holds the string.

    Don Burn Windows Driver Consulting Website:

    Sunday, May 22, 2016 12:44 PM