Welcome to MSDN Blogs Sign in | Join | Help

Browse by Tags

All Tags » WDM » KMDF   (RSS)
Let's say that you allocated a PIRP and sent it down your device stack. You free the PIRP in the completion routine and then return STATUS_MORE_PROCESSING_REQUIRED. To make life more fun, you decide that you want to be able to cancel the sent IRP after Read More...
First, I have to say that I don't agree with this design pattern at all . I think it leads to too many problems and complications that are not worth the pain. The only reason I am writing this entry is that I have seen so many people get this wrong or Read More...
Setting the security descriptor allows you to control who can open a handle to the device object. Typically you can call IoCreateDeviceSecure to create the device object and have the correct DACL from the start. One issue with IoCreateDeviceSecure is Read More...
This problem falls into the category being hidden by a macro that does not indicate in its name what it touches. If you call IoMarkIrpPending on an IRP that you allocated in your driver, chances are that you are corrupting memory. First, let's look at Read More...
Over the past 3 years or so, I have been casually referring to KMDF as the ultimate driver compat layer. Just like Windows has an application compatibility layer which shields applications from OS changes, KMDF provides the same type of compatibility Read More...
A small but important rule in WDM is that while a PDO is in D0, the parent must be in D0 as well. A very simple statement that can cause a lot of trouble ;). What I have seen is that very few WDM drivers enforce this rule (while KMDF does implement this Read More...
Hindsite in this case is 20/20, but arming your device for wake can open yourself up to multitude of race conditions and hard problems. Some of them you can solve in your driver, some of them you must accept that they are there and leave them be. Arming Read More...
In my previous post , I talked about how state changing PnP IRPs (refered to from now own as just PnP IRPs) are serialized against each other and briefly mentioned which power IRPs they were synchronized against. This merits its own entry. In short, PnP Read More...
KMDF is built on top of public interfaces. This means that it uses only APIs found in the WDK (or what was the DDK). This creates a dilemma. On the one hand we want to add features to the framework that are compelling and add value, but on the other we Read More...
A very common pattern is to allow a caller to ask for the number bytes (or elements) required and then ask for the data, many user mode Win32 APIs (like RegQueryValueEx ) and kernel mode (like IoGetDeviceProperty ) implement it. You first ask for the Read More...
We have been working on this one for the last couple of weeks. There is now a WDM to KMDF porting guide on WHDC. There are 2 documents in the download. The first is a very in depth document which goes into great detail about each function, IRP major code, Read More...
Let's say your device supports two interfaces and you want to expose both of them on the same device object. Furthermore, let's say that the I/O interface to each device interface is different. For instance, let's say that one interface allows only one Read More...
IoRegisterPlugPlayNotification() is a pretty scary looking function at first glance. The documentation is not that simple either. So what does this function do and why do you want to use it? IoRegisterPlugPlayNotification() does 2 things (OK 3, but the Read More...
Sometimes as a bus driver you need to access the PDO's Device Parameters key of its device node (to set a value for a class installer for instance) or register a device interface for a raw PDO. These are actually instances of a bigger problem, when is Read More...
Certain devices are exclusive access, or in simpler terms, only one handle can be opened for a particular device. A serial port is an example of an exclusive device; it would make no sense for 2 applications to have the port open because each would expect Read More...
 
Page view tracker