Sign in
A Hole In My Head
Doron Holan's musings on drivers and other nibbles and bits
Translate This Page
Translate this page
Powered by
Microsoft® Translator
Options
About
Email Blog Author
RSS for posts
Atom
RSS for comments
OK
Search
Tags
Coding Thoughts
Design Patterns
KMDF
WDF
WDK Docs
WDM
WinDBG/KD Fun
Archive
Archives
December 2010
(1)
August 2010
(1)
May 2010
(3)
February 2010
(2)
March 2009
(2)
February 2009
(1)
January 2009
(2)
June 2008
(1)
April 2008
(4)
March 2008
(6)
December 2007
(1)
November 2007
(2)
October 2007
(8)
July 2007
(2)
June 2007
(4)
May 2007
(3)
April 2007
(5)
March 2007
(6)
February 2007
(6)
January 2007
(7)
December 2006
(6)
November 2006
(11)
October 2006
(9)
September 2006
(8)
August 2006
(17)
July 2006
(15)
June 2006
(9)
May 2006
(16)
March 2006
(20)
February 2006
(17)
Posts
Subscribe via RSS
Sort by:
Most Recent
|
Most Views
|
Most Comments
Excerpt View
|
Full Post View
A Hole In My Head
\Device\QuestionsForMe
Posted
over 7 years ago
by
Doron Holan [MSFT]
388
Comments
I have been getting quite a few personal emails with specific questions on how to write a driver or how to a specific technology works or how to fix a particular problem. I welcome the emails, but I want these discussions to be public so that they are...
A Hole In My Head
\Device\Suggestions
Posted
over 7 years ago
by
Doron Holan [MSFT]
34
Comments
If you would like me to write about a topic that relates to WDM, the kernel, debugging, WDF, KMDF, UMDF, or anything that I have refered to in other entries, please add a comment to this entry. Comments will be cleared out periodically if there is enough...
A Hole In My Head
Avoiding #defines for constant data and using enums instead
Posted
over 7 years ago
by
Doron Holan [MSFT]
27
Comments
I think that the C preprocessor is a very powerful tool, but I like to limit my use of #defines. I have already touched on this when i talked about why I liked FORCEINLINE and I want to talk about it some more. I realize I can't eliminate the use of #defines...
A Hole In My Head
What is IRQL?
Posted
over 3 years ago
by
Doron Holan [MSFT]
15
Comments
Jake Oshins wanted to write about IRQLs and I am gladly letting him use my blog as a platform. Here it is… I’ve found myself explaining IRQL a lot lately, sometimes to people who want to know because they’re trying to write Windows drivers and sometimes...
A Hole In My Head
I like FORCEINLINE
Posted
over 7 years ago
by
Doron Holan [MSFT]
14
Comments
For kernel mode code, if I have choice between using a #define or a FORCEINLINE function, the FORCEINLINE function wins every time. #defines have their place, especially for quotifying (the # operator) or concatenating (the ## operator), but they have...
A Hole In My Head
String buffers and IRQL
Posted
over 7 years ago
by
Doron Holan [MSFT]
13
Comments
If you look at the docs for many Rtl string functions, you will see that they are callable only at IRQL == PASSIVE_LEVEL. This applies to not only Rtl functions but also to CRT functions Why is that? Well, there are a few resaons The Rtl functions...
A Hole In My Head
Using ntintsafe.h is a great idea, but I don't know how readable the results are
Posted
over 7 years ago
by
Doron Holan [MSFT]
13
Comments
The addition of ntintsafe.h for detecting integer overflow/underflow is a great addition to the WDK. It unifies how everyone detects these math errors, leading to common code that anyone can pickup and see what it does...BUT, I have found it does have...
A Hole In My Head
Not a big fan of #ifdef or #ifndef
Posted
over 7 years ago
by
Doron Holan [MSFT]
12
Comments
I am not a big fan of the C/C++ preprocessor directives #ifdef or #ifndef . I am not denying that they certainly have their place and usage in the language. I'll first write about where I think they are useful and then about the situations where...
A Hole In My Head
I want my sleep key back! (or how to hibernate a machine from your app)
Posted
over 7 years ago
by
Doron Holan [MSFT]
11
Comments
One of the first things I do when I get a new desktop machine or install a new build of Windows is to map the Sleep button on my keyboard to hibernate instead of suspend. Hibernate makes more sense for these machines because they will never run on...
A Hole In My Head
Hindsight is 20/20, EvtDriverUnload should have not been in KMDF
Posted
over 7 years ago
by
Doron Holan [MSFT]
10
Comments
The KMDF model evolved over the entire development cycle. It was refined and refactored multiple times. A lot of WDM abstractions leak through the to the KMDF model. These leaks usually forced their way into the model because without them, KMDF cannot...
A Hole In My Head
Debugger commands (stack frame navigation) that makes my life easier
Posted
over 7 years ago
by
Doron Holan [MSFT]
9
Comments
One thing that I have always found clunky is stack frame navigation in windbg/kd. Previously, I thought you had only a couple of options. The first option, if you are using WinDBG, is that you can bring up the call stack window. I have found that...
A Hole In My Head
How to create an exclusive device or debug why your device is exclusive
Posted
over 7 years ago
by
Doron Holan [MSFT]
8
Comments
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...
A Hole In My Head
How to break in at the call site that invokes the break point
Posted
over 7 years ago
by
Doron Holan [MSFT]
8
Comments
I think everyone at some point in time wants to embed a break point in there code, whether it be for debugging purposes, path tracing, or detecting edge conditions that have not yet been tested. When I hit a break point, I would prefer that the debugger...
A Hole In My Head
How to debug missing imports at driver load time
Posted
over 7 years ago
by
Doron Holan [MSFT]
8
Comments
Debugging when your driver fails to load can be exasperating, especially if it is due to a missing import. Windows 2000 would put up a dialog box telling the user which import was missing, but the user can't do anything about it (unless she is the driver...
A Hole In My Head
Why is there an Ex and Io work item in WDM?
Posted
over 7 years ago
by
Doron Holan [MSFT]
8
Comments
Have you ever looked at the work item APIs and wondered why there are two different types of work items? Or for that matter, why are there so many work item APIs? As Paul wrote last week, the work item API set has grown for Vista. Today I will try...
A Hole In My Head
Device installation on Vista failing when it used to work?
Posted
over 6 years ago
by
Doron Holan [MSFT]
8
Comments
There is a hotfix for setupapi.dll, read the KB article http://support.microsoft.com/kb/937187 and see if it applies to your machine
A Hole In My Head
Debugger command (!list) that makes my life easier
Posted
over 7 years ago
by
Doron Holan [MSFT]
7
Comments
Yesterday I introduced the dl command and demonstrated some of its limitations. Today I will talk about !list . Let's take yesterday's data structure, MY_DATA. What if the LIST_ENTRY is at the end of the structure or there is more data in your structure...
A Hole In My Head
How are power buttons reported in Windows?
Posted
over 7 years ago
by
Doron Holan [MSFT]
7
Comments
There are a few different possible types of power related buttons on a PC. There is the button on the case itself. If you have a laptop, there is a lid switch to detect state change in the lid. There are also power keys on a keyboard. All of these buttons...
A Hole In My Head
Creating your own InterlockedXxx operation
Posted
over 7 years ago
by
Doron Holan [MSFT]
7
Comments
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...
A Hole In My Head
How to return the number of bytes required for a subsequent operation
Posted
over 7 years ago
by
Doron Holan [MSFT]
7
Comments
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...
A Hole In My Head
Beware the shiny light that is MmIsAddressValid
Posted
over 7 years ago
by
Doron Holan [MSFT]
7
Comments
This came up on NTDEV today and has come up in the past (both in the community and internally on the KMDF team). MmIsAddressValid appears to be a great function given its name. You pass in a kernel virtual address (VA from now on) and it returns TRUE...
A Hole In My Head
Loading your driver in user mode
Posted
over 7 years ago
by
Doron Holan [MSFT]
6
Comments
One of the very cool features of windbg/kd is that you can load any PE file as a dump file. That means that you can load an exe, dll, or sys file as a dump file in the debugger. Your driver won't run ;), but you can look at alot of things in it. All you...
A Hole In My Head
Real life usage of loading a driver as a dump file
Posted
over 7 years ago
by
Doron Holan [MSFT]
6
Comments
Today I got a callstack via email (from the NTDEV list), but no dump file. I needed to determine if the bugcheck was due to a KMDF or a USB core bug. Since I had no dump file, I had to work purely on what the message contained. The callstack did have...
A Hole In My Head
Do I have to handle IRP_MN_SURPRISE_REMOVAL?
Posted
over 7 years ago
by
Doron Holan [MSFT]
6
Comments
You might think that just because your device is root enumerated or is plugged into fix slot (llike PCI) and not in a hot plug bus (like USB or PCCARD/PCMCIA) that your driver will not get a IRP_MN_SURPRISE_REMOVAL irp. This would be a bad assumption...
A Hole In My Head
Threaded and non-threaded PIRPs
Posted
over 7 years ago
by
Doron Holan [MSFT]
6
Comments
Broadly speaking, there are two (*) types of PIRPs in Windows. By "type" I do not mean the MajorFunction (e.g. IRP_MJ_Xxx) of the PIRP. Rather, a PIRP can be categorized as either threaded or non-threaded. Hopefully I will be able to introduce and clearly...
Page 1 of 8 (195 items)
1
2
3
4
5
»