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
Programming Note
Posted
over 7 years ago
by
Doron Holan [MSFT]
1
Comments
I will be on parental leave for the month of April :). While I have written up articles to post ahead of time, there is no guarantee I will have time to post them though. I will try for around 3 articles a week, but the pace might be slower then...
A Hole In My Head
Debugger commands (!bpid) that make my life easier (part 6)
Posted
over 7 years ago
by
Doron Holan [MSFT]
2
Comments
Today's kernel debugger command is "!bpid", break on process id. This command will break into an application in the application context from within the kernel debugger. Why would you want to do this? Well, you are not always in the right user mode...
A Hole In My Head
Debugger commands (dps, dpp) that make my life easier (part 5)
Posted
over 7 years ago
by
Doron Holan [MSFT]
3
Comments
Today's debugger command is "dps" (display pointers and symbols). You might be familiar with the "dds" command. While dds will always dump a DWORD, dps will dump pointers, where the pointer size is determined by the target. (I used to use dds because...
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
Debugger commands (!sd) that make my life easier (part 3.1)
Posted
over 7 years ago
by
Doron Holan [MSFT]
2
Comments
Peter Wieland informed me that you can actually find the security descriptor (SD) using !object, you just have to work harder to get at it. It relies on an undocumented structure, but since this is not being used at runtime and !object also uses it, I...
A Hole In My Head
Debugger commands (dt, ??) that make my life easier (part 4)
Posted
over 7 years ago
by
Doron Holan [MSFT]
4
Comments
Today I will cover how to look at type information from the command line of windbg/kd. You can do all of this in the UI with a mouse, but that takes too long ;). I like to keep my hands on the keyboard and not move around. More importantly, by learning...
A Hole In My Head
Debugger commands (!object) that make my life easier (part 3)
Posted
over 7 years ago
by
Doron Holan [MSFT]
0
Comments
Today I am going to write about !object. One of the tools you can get from sysinternals is WinObj.exe. This allows you to traverse the internal object hierarchy in Windows. It's a neat tool, but it uses internal undocumented APIs which means that when...
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
Debugger commands (!poaction, !poreqlist) that make my life easier (part 2)
Posted
over 7 years ago
by
Doron Holan [MSFT]
3
Comments
Today's commands are related to power, they are: !poreqlist !poaction !podev (covered in the last topic) !poreqlist will list all outstanding PIRPs on the machine that are a result of any driver calling PoRequestPowerIrp(). Remember how in the...
A Hole In My Head
Debugger commands (!drvobj, !devobj, !podev, !devstack) that make my life easier (part 1)
Posted
over 7 years ago
by
Doron Holan [MSFT]
2
Comments
Over the next few days I'll talk about different debugger commands which I use to make driver development easier, especially when debugging my driver. Today I'll talk about how to find your driver, the devices you created and any device object that any...
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
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
Great articles on DMA
Posted
over 7 years ago
by
Doron Holan [MSFT]
2
Comments
Peter Wieland has started a blog . Peter sits around the corner from me and works on UMDF (which exists under the WDF banner alongside KMDF). He has written 4 (so far) excellent entries on DMA, part 1 is here . DMA is one of the aspects of writing a driver...
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
A KLOCK_QUEUE_HANDLE cannot be shared across multiple threads
Posted
over 7 years ago
by
Doron Holan [MSFT]
0
Comments
Folks like to write wrappers. One very popular wrapper is for a KSPIN_LOCK . An example wrapper would be typedef struct _MY_LOCK { KSPIN_LOCK Lock; KIRQL LockIrql; } MY_LOCK, *PMY_LOCK; VOID FORCEINLINE AcquireMyLock(PMY_LOCK Lock) { KeAcquireSpinLock...
A Hole In My Head
The return value from RtlCompareMemory and memcmp do not mean the same thing!
Posted
over 7 years ago
by
Doron Holan [MSFT]
3
Comments
When I was working on the Bluetooth core, I got this mistake the first time I tried to compare 2 bluetooth addresses (a bluetooth address is 48 bits wide and at the time we were not using a ULONGLONG to represent the address, so we were doing structure...
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
WinHEC registration is open
Posted
over 7 years ago
by
Doron Holan [MSFT]
0
Comments
http://www.microsoft.com/whdc/winhec/ I will definitely be there. I will be at the KMDF and UMDF talks (I don't think I am presenting this year) as well as all the WDF (KMDF, UMDF, prefast, SDV) related labs and just hanging out in general. In previous...
A Hole In My Head
When is string constant not really constant?
Posted
over 7 years ago
by
Doron Holan [MSFT]
0
Comments
While this is not necessarily specific to a driver, the affects can be, so read on. A string constant (e.g. "Foo") all by itself is harmless, but if you use the string constant when initializing a variable, it depends on how you declar the variable...
A Hole In My Head
How can a NULL terminated string be misinterpreted in a UNICODE_STRING?
Posted
over 7 years ago
by
Doron Holan [MSFT]
2
Comments
A NULL terminated string can be mismisinterpreted if the Length field contains the NULL part of the string. Let's look at the the definition of DECLARE_CONST_UNICODE_STRING again before I go into how it can be misinterpreted. #define DECLARE_CONST_UNICODE_STRING...
Page 1 of 1 (20 items)