Questions for me


During the last few months I’ve received many driver-related questions either as emails or as comments in my posts. Since many people might have the same or similar problems, I would like to use this post as a way for you to ask me any questions that might be related to drivers, debugging, low-level windows programming, etc. Of course, since the nature of this blog is introductory, I would prefer it, if the questions are of the same level. Of course, I’ll try to do my best and answer your questions as accurately as I can, however keep in mind that for mode advanced questions you can ask Peter Wieland (for user-mode drivers) or Doron Holan (for kernel-mode drivers). Finally, keep in mind, that my main area of focus is UMDF 🙂


Comments (34)

  1. Sai Laxmi says:

    Hi Ilias,

     I’m a new bee to driver development and your blog was most helpful. I was almost lost figuring out the basics for driver writing. Thank you very much for your wonderful blog. I need one help from you. Can DDK be used for WDF model too? Or do we need something else? Thanks for taking your time.

  2. iliast says:

    Hi Sai,

    I’m glad that you find my blog helpful. In order to use the WDF, you need to download the WDK (Windows Driver Kit), which is the “successor” of the DDK. You can download the WDK for free by following the instructions at http://www.microsoft.com/whdc/devtools/wdk/betawdk.mspx

    Just keep in mind that it’s around 3gb (so you need a broadband internet connection).

    Also, you can look at http://blogs.msdn.com/doronh/archive/2006/12/21/where-are-the-wdf-files-in-the-wdk.aspx in order to find the location of the WDF files in the WDK.

  3. Sai Laxmi says:

    Thanks a lot Ilias. Thanks for taking time for answering my question.

  4. Victor says:

    Hi Ilias,

    Our product has several kernel mode drivers – file system drivers, process monitors, network redirectors, etc., because of which installing our product requires a reboot. For Longhorn certification, we need to eliminate reboots. Is there a way to do that? Will porting our drivers to KMDF or any other model help eliminate reboots?

    Thanks.

  5. Amit Hegde says:

    Hi,

    I am trying to execute the Device Path Exerciser v 3.2 with the Active Control Test option and I get the message

    Invalid Active File Name <fileName>

    where <fileName> is the name of the input file supplied by be

    Thanks & regards

    Amit Hegde

  6. iliast says:

    Hi Amit,

    According to http://www.osronline.com/article.cfm?id=319 (you need to register for free), the <filename> is actually the NT device name, e.g. Devicenull. Alternatively you can try using the “/dr <drivername>” option. The above link provides good information and I suggest that you read it first. If you have more questions/problems, then I’ll be glad to help.

  7. iliast says:

    Hi Viktor,

    I think that your question was answered by Doron Holan at http://blogs.msdn.com/doronh/archive/2006/07/10/661475.aspx

  8. Stephen Paterson says:

    Hello Ilias,

    Do you have any IDE recommendations for driver development?  I’m moving from VC6 and DriverWorks to VS2005, WDF and OSR’s DDKBUILD and I’m finding that I really miss VC6 help and browse integration.

    Is it possible to integrate WDK help in VS2005?

    Is there a trick to getting VS2005 to work with Build-generated browse info.  The method recommended by Hollis (add .bsc to project) works… but not very well.  VS2005 keeps the .bsc file open so Build can’t update it.  The .bsc must be manually removed from the project before each build and re-added after.

    Thanks for your help and advice.

    Cheers,

       Steve

  9. iliast says:

    Hi Stephen,

    Unfortunately, right now the DDKBUILD (http://www.hollistech.com/Resources/ddkbuild/ddkbuild.htm) is your best shot, if you want to use Visual Studio. Just keep in mind the addition that is discussed at http://www.osronline.com/ShowThread.cfm?link=102025. I don’t know of any tricks that might help with the browse integration or the WDK integration. These are 2 valid needs, though, and hopefully the Visual Studio developers will take them into consideration, while planning their next releases.

    I still haven’t finalized my opinion about my preffered IDE. I’ve tried a few editors, however my 2 final choices were Visual Studio (too heavy) and Source Insight (much lighter, but some VS features might not be there). Right now I’m leaning towards Source Insight, so I also open a seperate console to do the compilation and a seperate window with the WDK. I’m still open for change, though 🙂

  10. stephen.paterson@rogers.com says:

    Thanks Ilias, I’ll check out Source Insight.  

    I’m using OSR’s version of DDKBUILD (http://www.osronline.com/article.cfm?article=43).  It’s got the fix you mention and other helpful features as well.

    I’m trying out Visual Assist X (http://www.wholetomato.com) and quite like it so far.  If I come across a way to integrate WDK help in VS2005 I’ll pass it along.

    Cheers,

       Steve

  11. iliast says:

    Sure, that would be great. I think that the topic might be interesting in finding out, what IDEs are being used for driver development, so I created a poll at http://blogs.msdn.com/iliast/archive/2007/02/15/poll-which-ides-are-being-used-by-driver-developers.aspx

  12. ... says:

    luogo interessante, soddisfare interessante, buon!

  13. ... says:

    E evidente che il luogo e stato fatto dalla persona che realmente conosce il mestiere!

  14. ayday says:

    nice site!

  15. I’m very interested in learning Windows driver development, are you going to write a book on this topic? I trust you’ll do a fantastic job!

  16. iliast says:

    Hi googlexp,

    I still have a really long (and hard) way to go, before being able to write a book about driver development. Thanks a lot for your good words, though 🙂

  17. yday says:

    your site is very good

  18. I’ve been reading all the WDK documentation on how the operating system decides which driver to use with a device, and I still have a question.  Does the device have to transmit some kind of device ID?

    I’m trying to interface an aircraft cursor control device to Windows XP so we can test it for possible spacecraft use.  So the hardware was never designed to work with Windows.

  19. iliast says:

    Hi Samme,

    the way that each device is discovered depends on the bus that it is connected to. For example, the USB devices have a certain discovery protocol. More specifically (and possibly a bit simplified), the windows USB bus driver discovers each new USB device, the moment that it gets connected to the USB bus (or when Windows boots). Afterwards, the USB bus driver asks for the Hardware ID of the device, as well as the compatible ids. The Hardware ID corresponds to the exact ID that identifies the particular model. The compatible IDs correspond to other models that are very compatible. (if you go to device manager -> right click on almost any device, e.g. your graphics card -> properties -> Details -> you can check the list and look at the hardware ID and the compatible IDs of your device). So, windows gets all these ids and goes through its internal database of device IDs and tries to find if either the hardware id or the compatible ids are found in it. If it finds any of them, then it loads the corresponding driver. If not, then it asks the user to install a driver. If you open a .inf file, then you’ll see inside it, it includes references to hardware ids and compatible ids. So, when you install an .inf file, you actually populate the OS’ database that includes the device IDs and you link each id with the file that includes the corresponding driver.

    The above description was a bit simplified, but you can find a very good presentation of the subject at http://channel9.msdn.com/ShowPost.aspx?PostID=156316

  20. Floris says:

    Hello,

    you’ve really got a nice blog! It already helped me a lot. I’ve got a problem now though.

    I built a very simple IR receiver which triggers interrupts on the parallel port when it receives signals. I wanted to write a driver which handles those interrupts and calculates the time between them, to find out which button was pressed on the remote control. Before this project, I didn’t know anything about writing drivers, so it took me some time to learn the basics, and I still don’t know everything about it, but at least I know a lot more than when I started. 🙂

    Now my problem. It seems that in order to get it working correctly, I have to call several functions in my DriverEntry routine in a specific order. I think they are: IoReportResourceForDetection – IoCreateDevice – IoCreateSymbolicLink – IoInitializeDpcRequest – IoConnectInterrupt.

    The problem is I’m not sure which parameters to pass to IoReportResourceForDetection (what I should put in the PCM_RESOURCE_LIST struct and how I should get that information) and I couldn’t find anything on internet about it.

    Also, someone suggested that I should use KeInitializeDpc instead of IoInitializeDpcRequest for reasons I don’t understand. Maybe you know that?

    I just hope you could give me some information and tips about writing such a driver. It has to be able to handle interrupts coming from the parallel port and to measure the time between interrupts.

    Also, do you know how (and if) it is possible for Windows to detect it when I plug my IR receiver into to parallel port? I read a bit about it and it seems that plug and play hardware gets detected automatically, but that the parallel port does not support that (and my very simple IR receiver also probably not). But the parallel port has an option in the Device Manager ‘Enable legacy plug and play support’, so it should be able to detect something. Do you know how I could modify my IR receiver so it will be detected by my computer? Currently it is only connected to the Acknowledgement (interrupt) pin and one of the ground pins. Do I need to connect it to several other pins for that?

    I really appreciate you put so much time and effort in helping people out. I hope you can also help me out with my problem. I’d really like to get this IR receiver working 🙂

    Floris

  21. chunhua says:

    Hi,

     I’m a new bee to driver development, my question is shall I learn WDM before learn WDF?

    And where I can download WDK? Thank you.

  22. Philip says:

    I am planning to write a remote HTTP transport virtual file system application and from what I have read the UMDF architecture may be a good choice.  I will of course NOT have the usual hardware specific considerations which may a KMDF a better choice when real hardware is involved.

    What do you think.  Is the UMDF architecture a good choice for a remote HTTP transport virtual file syetm application, assuming I can live with only XP and Vista support ???

  23. Hatish says:

    Hi,

    Im wondering if you can tell me how useful WDK is to my problem. I want to write an application that accesses the unused HDD space on multiple machines on the network, and combines them to show as a "drive" on the local machine. It will be controlled by a service, which controls all the read/write calls to the "drive". I’ve written the back-end which keeps track of the files and where they are located on the network. Currently the front end only allows one to upload/download files to this "Network Drive". I want to now upgrade that to a show as a "drive" on everyones local machine. From what research I’ve done, I understand that I need a driver to be able to show the drive, and to redirect the read/write calls accordingly. Will I be able to create such a driver using WDK? Is a driver even necessary (not 100% sure)? Any help is appreciated… (BTW, never done driver dev before, and project is in C#, .NET 2.0)

  24. Suresh P says:

    Hi

    I would like to know usage of Static Driver Verifier) and Driver Verified. My questions are

    1. For KMDF driver testing we need to use both driver and SDV ?

    2. Can i use driver verfier for UMDF based drivers ?

    3. If driver passes thru SDV  what are the chances it works with driver verifier ?

  25. Amit says:

    Hi Ilias, can you suggest me some book on dealing with vista device drive, especially its display driver model.Thanx

  26. Memmorium says:

         Good idea!

    P.S. A U realy girl?

  27. Ben Myers says:

    I think I lost my driver for the CDROM. When I boot up, the message says: CDROM not recognized or something like that. To me, that says the PC knows that there was once a CDROM and now there is none. Otherwise, why would it even bother?

    I have a HP Omnibook 5700 with  Win98ME and a TEAC CDROM 224E.

    Do you have any idea what I should do?

    Thanks. Ben Myers  bemye@hotmail.com

  28. Ashish Gupta says:

    I am inserting a pcie driver with Pnp and first time i insert i see the log messages in Windbg for the driver. If i make some change, remove and reinsert the driver i see log message of the old driver without any of my changes. I suspect the inf file is using some stale copy of driver. My Inf file is coping at system32drivers. I even deleted from all locations where i found copy of my driver and reinserted still it shows the old logs without changes i did. When i reboot the system i see log corresponding to my changes. Any hints on whats going wrong shall re very useful

    My email is ashish.gupta@xilinx.com

    Thanks

  29. Harsh Kumar says:

    Hi,

    I am trying to make a WebCam Driver for Creative WebCam VendorID: 0AC8

    ProductID: 307B.

    I am able to install the driver and am also able to attach the device

    successfully. Then I set Alternate Setting and endpoint. After this i try do perform Isochronous Transfer using

    lpusb->lpIssueIsochTransfer

    The hTransfer is successful, but when I try to save the data which is present in the Data Buffer in a file of bmp format, it says 0 bytes written.

    Then I tried to print the Data Buffer directly and it also shows 0.

    Can you please point me in the directtion by which I can successfully capture my first frame.

    **Data Buffer is the internal memory which I have allocated using LocalAlloc.

    Harsh

  30. Randall says:

    I’m perplexed about driver naming when the vista driver installer pops up.  In my INF file I have a "Provider=ACME" directive.  My device is a USB device I call the "Rocket", thus my device driver is called rocket.dll.   When vista pops up, I would expect to see:

    Name: ACME Rocket    <<– or just plain ACME

    Publisher: ACME, Inc.(Test)

    Instead I see:

    Name: ACME Universal Serial Bus controller

    Publisher: AMCE, Inc.(Test)

    Where is the "Universial Serial Bus controller" tag coming from?  Its not in my INF, and its not part of the coinstaller DLLs that I can see.

    When someone plugs in the Rocket, I want them to see a warning for install drivers for "ACME Rocket", not some "ACME Universal Serial Bus controller".

    Any help would be appreciated.  From anyone.

    Email: r.barber ‘at’ mw-inc.com

  31. Hardy says:

    I am trying to Map physical address of my aureal sound card to a virtual address using MmMapIoSpace. I am using the code below which is not working as expected. The MmMapIoSpace always returns a 00000000 pointer. Logs from DebugView are also given..

    ———————————–CODE————————————

      NTSTATUS

    CAdapterCommon::Init

    (

       IN  PRESOURCELIST   ResourceList,

       IN  PDEVICE_OBJECT  DeviceObject

    )

    {

       PAGED_CODE();

       ASSERT(ResourceList);

       ASSERT(DeviceObject);

       NTSTATUS  ntStatus = STATUS_SUCCESS;

       DPF_ENTER(("[CAdapterCommon::Aureal Init]"));

       PDWORD         m_pCodecBase;        // The Aureal I/O port address.

       PUCHAR         m_pBusMasterBase;    // The Aureal 2nd I/O port address.

       PDWORD         m_pmmio;        // The Aureal Memory range mapped to virtual memory.

       m_pDeviceObject = DeviceObject;

       ASSERT (ResourceList->FindTranslatedPort (0));

       m_pCodecBase = (PDWORD)ResourceList->FindTranslatedPort (0)->

                              u.Port.Start.QuadPart;

       ASSERT (ResourceList->FindTranslatedPort (1));

       m_pBusMasterBase = (PUCHAR)ResourceList->FindTranslatedPort (1)->

                                 u.Port.Start.QuadPart;

       PCM_PARTIAL_RESOURCE_DESCRIPTOR resource;

       PHYSICAL_ADDRESS PhysAddr;

       resource=ResourceList->FindTranslatedMemory(0);

       //resource=ResourceList->FindUntranslatedMemory(0);

       PhysAddr=resource->u.Memory.Start;

       m_pmmio=(PDWORD) MmMapIoSpace(resource->u.Memory.Start, resource->u.Memory.Length, MmNonCached);

       //MmCached MmNonCached

       DPF_ENTER (("Aureal Configuration:n"

                      "   Bus Master = 0x%pn"

                      "   Codec      = 0x%pn"

    "   Physical Add= 0x%pn"

    "   Virtual Add= 0x%pn",

                           m_pBusMasterBase, m_pCodecBase, PhysAddr, m_pmmio));

    ———————————–CODE————————————

    ———————————–LOGS————————————

    00000000 0.00000000 MSVAD:

    00000001 0.00000482 [DriverEntry]

    00000002 0.00000693

    00000003 0.00025595 MSVAD:

    00000004 0.00025957 [AddDevice]

    00000005 0.00026108

    00000006 0.02436720 MSVAD:

    00000007 0.02437443 [StartDevice]

    00000008 0.02437655

    00000009 0.02437926 MSVAD:

    00000010 0.02438197 [ValidateResources]

    00000011 0.02438378

    00000012 0.02438680 MSVAD:

    00000013 0.02439493 Aureal configuration:     IO  count: 2

    00000014 0.02439554    IRQ count: 1

    00000015 0.02439614    DMA count: 0

    00000016 0.02439674    Memories count: 1

    00000017 0.02439735    BusNumbers count: 0

    00000018 0.02439795    DevicePrivates count: 0

    00000019 0.02439855

    00000020 0.02440036

    00000021 0.02441483 MSVAD:

    00000022 0.02442056 [CAdapterCommon::Aureal Init]

    00000023 0.02442267

    00000024 0.02443322 MSVAD:

    00000025 0.02444196 Aureal Configuration:

    00000026 0.02444257   Bus Master = 0x00001040

    00000027 0.02444317   Codec      = 0x00001048

    00000028 0.02444408   Physical Add= 0x90000000

    00000029 0.02444468   Virtual Add= 0x00000000

    00000030 0.02444649

    00000031 0.02444890 MSVAD:

    00000032 0.02445191 [CAdapterCommon::InitAurealHW]

    ———————————–LOGS————————————

    The properties of the pci card AU8810 are (As seen from Device Manager)

    Memory Range 90000000 – 9003FFFF

    I/O Range 1048 – 104F

    I/O Range 1040 – 1047

    resource->u.Memory.Start is Ok 90000000

    resource->u.Memory.Length is OK 262144 (256K)

    Virtual Add= 0x00000000 is always not Ok.

    Anybody please help….

  32. Aleksandr says:

    Hi Ilias,

    I would like to modify a kmdf smart card reader driver that is available in WDK to work over Bluetooth. As I understand, it can be done by using L2CAP or SCO, but I need a higher level RfComm protocol. Is it possible to create RfComm connection in kmdf? Can it be done in umdf? Does Winsock Kernel support Bluetooth or is it limited to IPv4 and IPv6 only?

    Are there any examples of using Winsock for Bluetooth in umdf?

    Please correct me if I understand something wrong.

    Thanks.

  33. suraj says:

    How to merge UMDF v2.0 Drivers and what are the complications introduces

Skip to main content