Unable to open the Raw PDO using createfile

Hi,

I am following the KbFiltr Sample to create a Raw PDO for a USB Bluetooth Device.

I have used DeviceInterface so that the application can talk to the device. F

status = WdfDeviceCreateDeviceInterface( hChild, &GUID_DEVINTERFACE_IxBtUsbFilter, NULL );

The device drivers loads successfully. However when I plug in an USB bluetooth Device I am able to see 2 enumerations in the Device Manager under Other Devices[IxBtUSBFilter00 & IxBtUSBFilter01]. Why would that be the case for a raw PDO?
Also, I checked WinObj, their symbolic links are getting created. But I am not able to open the handle using CreateFile. It gives error 2, The system cannot find the file specified.

//Open the device hDeviceHandle = CreateFile ( "\\\\.\\000000d0", GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_ALWAYS, FILE_FLAG_OVERLAPPED, NULL);if (hDeviceHandle == INVALID_HANDLE_VALUE) { //Error. ErrorExit(TEXT("Create File")); printf("\nCould not open the device: Error %d.\n", GetLastError()); goto done; }

I am not able to figure out why this is happening even after successfully creating the symbolic links for a raw PDO. . .

Please help me debug it. . .

Thanks,

Use the symlink name as the filename to createfile, not the name of the pdo (which is an NT name not visible to user mode which is why symbolic link names exist). Look at the enum exe in the toaster sample on how to enumerate instances of the device interface and open them.

d

debt from my phone


From: xxxxx@usc.edu
Sent: 3/7/2012 2:47 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Unable to open the Raw PDO using createfile

Hi,

I am following the KbFiltr Sample to create a Raw PDO for a USB Bluetooth Device.

I have used DeviceInterface so that the application can talk to the device. F

status = WdfDeviceCreateDeviceInterface( hChild, &GUID_DEVINTERFACE_IxBtUsbFilter, NULL );

The device drivers loads successfully. However when I plug in an USB bluetooth Device I am able to see 2 enumerations in the Device Manager under Other Devices[IxBtUSBFilter00 & IxBtUSBFilter01]. Why would that be the case for a raw PDO?
Also, I checked WinObj, their symbolic links are getting created. But I am not able to open the handle using CreateFile. It gives error 2, The system cannot find the file specified.

//Open the device hDeviceHandle = CreateFile ( "\\\\.\\000000d0", GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_ALWAYS, FILE_FLAG_OVERLAPPED, NULL);if (hDeviceHandle == INVALID_HANDLE_VALUE) { //Error. ErrorExit(TEXT("Create File"));printf("\nCould not open the device: Error %d.\n", GetLastError()); goto done; }

I am not able to figure out why this is happening even after successfully creating the symbolic links for a raw PDO. . .

Please help me debug it. . .

Thanks,


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer