Driver Problems? Questions? Issues?
Put OSR's experience to work for you! Contact us for assistance with:
  • Creating the right design for your requirements
  • Reviewing your existing driver code
  • Analyzing driver reliability/performance issues
  • Custom training mixed with consulting and focused directly on your specific areas of interest/concern.
Check us out. OSR, the Windows driver experts.

Monthly Seminars at OSR Headquarters

East Coast USA
Windows Internals and SW Drivers, Dulles (Sterling) VA, 13 November 2017

Kernel Debugging & Crash Analysis for Windows, Nashua (Amherst) NH, 4 December 2017

Writing WDF Drivers I: Core Concepts, Nashua (Amherst) NH, 8 January 2018

WDF Drivers II: Advanced Implementation Techniques, Nashua (Amherst) NH, 15 January 2018


Go Back   OSR Online Lists > ntdev
Welcome, Guest
You must login to post to this list
  Message 1 of 13  
09 Feb 18 11:16
makrurisan makkeln
xxxxxx@x-publisher.com
Join Date: 12 Jan 2018
Posts To This List: 55
Sending IOCTL Request ioTarget

I want to make an WdfIoTargetSendIoctlSynchronously call. All is clear but the only thing left is how to get the "ioTarget" inside of EvtDeviceAdd in the filter driver. I know that the most of you know that but for me it is not clear how to get the IoTarget. There are so many functions.
  Message 2 of 13  
09 Feb 18 11:40
Doron Holan
xxxxxx@microsoft.com
Join Date: 08 Sep 2005
Posts To This List: 10157
Sending IOCTL Request ioTarget

Are you sending it down the stack? WdfDeviceGetIoTarget will return the target for down the stack. If elsewhere, you need create your own and open it. d -----Original Message----- From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@x-publisher.com Sent: Friday, February 9, 2018 8:16 AM To: Windows System Software Devs Interest List <xxxxx@lists.osr.com> Subject: [ntdev] Sending IOCTL Request ioTarget I want to make an WdfIoTargetSendIoctlSynchronously call. All is clear but the only thing left is how to get the "ioTarget" inside of EvtDeviceAdd in the filter driver. I know that the most of you know that but for me it is not clear how to get the IoTarget. There are so many functions. --- NTDEV is sponsored by OSR Visit the list online at: <https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.osronline.co m%2Fshowlists.cfm%3Flist%3Dntdev&data=04%7C01%7CDoron.Holan%40microsoft.com%7Ca45 cface517a484e2a9208d56fd86b8a%7Cee3303d7fb734b0c8589bcd847f1c277%7C1%7C0%7C636537 897663511681%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6 Ik1haWwifQ%3D%3D%7C-1&sdata=kI1tMvjijlpGGUI%2BRg%2FWMbGJ8Th0n3uYxtpp%2BuMTJuc%3D& reserved=0> MONTHLY seminars on crash dump analysis, WDF, Windows internals and software drivers! Details at <https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.osr.com%2Fse minars&data=04%7C01%7CDoron.Holan%40microsoft.com%7Ca45cface517a484e2a9208d56fd86 b8a%7Cee3303d7fb734b0c8589bcd847f1c277%7C1%7C0%7C636537897663511681%7CUnknown%7CT WFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwifQ%3D%3D%7C-1&sdat a=dgIr5MnxmxFklTSz3Z3H6sCRyjwNlCDR5BYbye2bI8o%3D&reserved=0> To unsubscribe, visit the List Server section of OSR Online at <https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.osronline.co m%2Fpage.cfm%3Fname%3DListServer&data=04%7C01%7CDoron.Holan%40microsoft.com%7Ca45 cface517a484e2a9208d56fd86b8a%7Cee3303d7fb734b0c8589bcd847f1c277%7C1%7C0%7C636537 897663511681%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6 Ik1haWwifQ%3D%3D%7C-1&sdata=C42GP7CifMHjyL8AlrnwL5KMC2IvBKugYm4IJK8llQI%3D&reserv ed=0>
  Message 3 of 13  
09 Feb 18 11:44
makrurisan makkeln
xxxxxx@x-publisher.com
Join Date: 12 Jan 2018
Posts To This List: 55
Sending IOCTL Request ioTarget

I want the KEYBOARD_EXTENDED_ATTRIBUTES from the actual keyboard. Thank you.
  Message 4 of 13  
09 Feb 18 12:07
Peter Viscarola (OSR)
xxxxxx@osr.com
Join Date:
Posts To This List: 5985
List Moderator
Sending IOCTL Request ioTarget

<quote> I want the KEYBOARD_EXTENDED_ATTRIBUTES from the actual keyboard. </quote> That's nice, but it doesn't answer the question: To which device in the system do you want to send your IOCTL? If its the Device Object directly below you, you want your Local I/O Target, which you retrieve (as Doron said) with WdfDeviceGetIoTarget. If you want to send your IOCTL to a DIFFERENT device in the system, you can open an I/O Target to that device by name or using a given WDM Device Object pointer. Peter OSR @OSRDrivers
  Message 5 of 13  
09 Feb 18 13:58
makrurisan makkeln
xxxxxx@x-publisher.com
Join Date: 12 Jan 2018
Posts To This List: 55
Sending IOCTL Request ioTarget

Ok, I thought it was clear because I wrote "EvtDeviceAdd". As I know this function is called for each keyboard, virtual or physical in the system. I think it is clear now. Thank you.
  Message 6 of 13  
09 Feb 18 14:56
Tim Roberts
xxxxxx@probo.com
Join Date: 28 Jan 2005
Posts To This List: 11795
Sending IOCTL Request ioTarget

xxxxx@x-publisher.com wrote: > I want to make an WdfIoTargetSendIoctlSynchronously call. All is clear but the only thing left is how to get the "ioTarget" inside of EvtDeviceAdd in the filter driver. > I know that the most of you know that but for me it is not clear how to get the IoTarget. There are so many functions. The KMDF designers have done an excellent job of naming their methods, so many times it is quite possible to guess what you need.  KMDF is a tree of objects, where each node has stored a copy of the its parents/owners/associates.  So, in a case like this, you need to ask yourself, "what information do I need, and what resources do I have?"  You need a WDFIOTARGET.  You have a WDFDEVICE.  When you need to ask an X for a Y, the KMDF rule is that the routine is called XGetY.  So, look for WdfDeviceGetIoTarget, and there it is. Sometimes you have to go through several steps.  For example, to get a WDFDEVICE from a WDFREQUEST, you have to go through the WDFQUEUE (WdfRequestGetIoQueue, WdfIoQueueGetDevice). -- Tim Roberts, xxxxx@probo.com Providenza & Boekelheide, Inc.
  Message 7 of 13  
09 Feb 18 16:00
makrurisan makkeln
xxxxxx@x-publisher.com
Join Date: 12 Jan 2018
Posts To This List: 55
Sending IOCTL Request ioTarget

Yes, I see there is a systematic but I know that I must know more. For example: If I call now WdfDeviceGetIoTarget with the device handle I get that this device does not support this IOCTL and therefore I thought. Ok, I remembered that there is a connection and in this connection I have done: devExt->UpperConnectData = *connectData; and here I looked at PDEVICE_OBJECT ClassDeviceObject; If I look in PDEVICE_OBJECT I see struct _DRIVER_OBJECT *DriverObject; struct _DEVICE_OBJECT *NextDevice; struct _DEVICE_OBJECT *AttachedDevice; Which one should I use now? Questions after questions! :-(
  Message 8 of 13  
09 Feb 18 16:26
Tim Roberts
xxxxxx@probo.com
Join Date: 28 Jan 2005
Posts To This List: 11795
Sending IOCTL Request ioTarget

xxxxx@x-publisher.com wrote: > Yes, I see there is a systematic but I know that I must know more. > For example: If I call now WdfDeviceGetIoTarget with the device handle I get that this device does not support this IOCTL and therefore I thought. > Ok, I remembered that there is a connection and in this connection I have done: > devExt->UpperConnectData = *connectData; > and here I looked at > PDEVICE_OBJECT ClassDeviceObject; > If I look in PDEVICE_OBJECT I see > struct _DRIVER_OBJECT *DriverObject; > struct _DEVICE_OBJECT *NextDevice; > struct _DEVICE_OBJECT *AttachedDevice; <...excess quoted lines suppressed...> None of them.  Those are all going the wrong direction -- upward.  The hardware is below you, at WdfDeviceGetIoTarget(hDevice). Are you trying to send IOCTL_KEYBOARD_QUERY_EXTENDED_ATTRIBUTES?  What operating system are you using for testing?  That ioctl was not added until Windows 10. -- Tim Roberts, xxxxx@probo.com Providenza & Boekelheide, Inc.
  Message 9 of 13  
09 Feb 18 16:42
makrurisan makkeln
xxxxxx@x-publisher.com
Join Date: 12 Jan 2018
Posts To This List: 55
Sending IOCTL Request ioTarget

Oh! Yes, I want this IOCTL_KEYBOARD_QUERY_EXTENDED_ATTRIBUTES. I work with the latest win10.
  Message 10 of 13  
10 Feb 18 02:52
makrurisan makkeln
xxxxxx@x-publisher.com
Join Date: 12 Jan 2018
Posts To This List: 55
Sending IOCTL Request ioTarget

I tried with other Ioctl like IOCTL_KEYBOARD_SET_INDICATORS and always get error 0xc0000010. status = WdfIoTargetSendIoctlSynchronously( WdfDeviceGetIoTarget(device), WDF_NO_HANDLE, // Request WDF_NO_HANDLE IoctlControlCode, pInputDesc, pOutputDesc, NULL, // PWDF_REQUEST_SEND_OPTIONS NULL); Any ideas?
  Message 11 of 13  
10 Feb 18 09:42
makrurisan makkeln
xxxxxx@x-publisher.com
Join Date: 12 Jan 2018
Posts To This List: 55
Sending IOCTL Request ioTarget

The filter driver is above kbdclass as Upperfilter. This is the reason that I get 0xc0000010. If I set it below kbdclass the function works. Now I tried WDF_IO_TARGET_OPEN_PARAMS_INIT_OPEN_BY_NAME. Is this the way to go?
  Message 12 of 13  
10 Feb 18 11:34
Doron Holan
xxxxxx@microsoft.com
Join Date: 08 Sep 2005
Posts To This List: 10157
Sending IOCTL Request ioTarget

Open by name will open the top of the stack , essentially opening your driver if you are above kbdclass. The recommended location is below kbdclass because it is rather restrictive about who can open it and what io gets through. Bent from my phone ________________________________ From: xxxxx@lists.osr.com <xxxxx@lists.osr.com> on behalf of xxxxx@x-publisher.com <xxxxx@lists.osr.com> Sent: Saturday, February 10, 2018 6:42:16 AM To: Windows System Software Devs Interest List Subject: RE:[ntdev] Sending IOCTL Request ioTarget The filter driver is above kbdclass as Upperfilter. This is the reason that I get 0xc0000010. If I set it below kbdclass the function works. Now I tried WDF_IO_TARGET_OPEN_PARAMS_INIT_OPEN_BY_NAME. Is this the way to go? --- NTDEV is sponsored by OSR Visit the list online at: <https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.osronline.co m%2Fshowlists.cfm%3Flist%3Dntdev&data=04%7C01%7CDoron.Holan%40microsoft.com%7Cb49 c1a1478da44a0e4aa08d570947c02%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636538 705394621235%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6 Ik1haWwifQ%3D%3D%7C-1&sdata=D448WLGWP%2FXp%2ByScDFLLI5AKNzmm2N6BjvrPp3yMGYk%3D&re served=0> MONTHLY seminars on crash dump analysis, WDF, Windows internals and software drivers! Details at <https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.osr.com%2Fse minars&data=04%7C01%7CDoron.Holan%40microsoft.com%7Cb49c1a1478da44a0e4aa08d570947 c02%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636538705394621235%7CUnknown%7CT WFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwifQ%3D%3D%7C-1&sdat a=IiKhHWuESUEjCHahVf%2BqBOhac%2Bn09IXxIDiyKBruB%2Fk%3D&reserved=0> To unsubscribe, visit the List Server section of OSR Online at <https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.osronline.co m%2Fpage.cfm%3Fname%3DListServer&data=04%7C01%7CDoron.Holan%40microsoft.com%7Cb49 c1a1478da44a0e4aa08d570947c02%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636538 705394621235%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6 Ik1haWwifQ%3D%3D%7C-1&sdata=bvP5SGvG5dJhr2e16hlgMPxqc5ibK36HUL05eKhENuU%3D&reserv ed=0> --
  Message 13 of 13  
11 Feb 18 08:45
makrurisan makkeln
xxxxxx@x-publisher.com
Join Date: 12 Jan 2018
Posts To This List: 55
Sending IOCTL Request ioTarget

English is not my first language therefore I ask the following questions for my better understanding. My filter driver modifies the keyboard data. Can this also be done if the filter driver is below kbdclass? I tested it without modification and it do not work below kdbdclass. Is it right that a filter driver which is above can not set keyboard indicators? If I can't set the indicators it is not so easy to change the input data because I must know for example the state of the capslock.
Posting Rules  
You may not post new threads
You may not post replies
You may not post attachments
You must login to OSR Online AND be a member of the ntdev list to be able to post.

All times are GMT -5. The time now is 06:33.


Copyright ©2015, OSR Open Systems Resources, Inc.
Based on vBulletin Copyright ©2000 - 2005, Jelsoft Enterprises Ltd.
Modified under license