Where are the WDF files in the WDK?

The WDF (both UMDF and KMDF) files in the WDK are not found in a single directory, rather they are spread out across the entire WDK directory tree. Why? Because the WDK is not just WDF J and the WDK has directories for different purposes, so replicating a specifically purposed directory (like redistributables) under a…

0

Should I use the chk or fre KMDF coinstaller?

This has been asked quite a few times and is a major point of confusion for KMDF developers.  The KMDF coinstaller comes in 2 flavors, chk and fre.  Both flavors reside in the same directory in the WDK (winddk\6000\redist\wdf\<arch>) and have their own unique filenames (fre is WdfCoInstaller01005.dll, chk is WdfCoInstaller01005_chk.dll). You have to decide which…

3

How to return the number of bytes required for a subsequent operation

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 number of bytes needed (passing NULL and a pointer to a size),…

7

Creating your own InterlockedXxx operation

Sometimes your design requires an Interlocked operation that is not currently supported by the OS, runtime libraries, or the compiler (as an intrinsic). You then have a choice to make. Either remove all Interlocked operations for that particular field and use a lock or roll you own Interlocked function. Roll your own Interlocked function? Sounded…

7

Why you want to use POBJECT_TYPEs when converting handles to objects

This post concludes my trilogy (see parts 1 and 2) on PBOJECT_TYPE (although I do reserve the right to pull a George Lucas and add more episodes later 🙂 ). Today we shall cover why passing the PBOJECT_TYPE to ObReferenceObjectByHandle, ObReferenceObjectByPointer, or ObOpenObjectByPointer is important. Let’s take the following snippet NTSTATUS status; PKEVENT pEvent; status…

0

What is POBJECT_TYPE?

In a previous post I wrote about the newly documented POBJECT_TYPE variables for Vista. You can pass these exports to ObReferenceObjectByHandle, ObReferenceObjectByPointer, or ObOpenObjectByPointer. Talking about the new exports without talking about the type itself was a little bit of putting the cart before the horse and I wanted to fix that ;). So, what…

1