Welcome to MSDN Blogs Sign in | Join | Help

Browse by Tags

All Tags » Coding Thoughts   (RSS)
I was going to write about how to do this, but the awesome folks at WHDC got to it before I did.  I did get to review it before it was published, so I did have some influence in what is in the tip ;). So on this one my job is easy, just go read the Read More...
During my sophomore year at Cal Poly , I decided that I wanted to learn about threads, synchronization techniques and other topics associated modern operating systems. Windows 95 had made its debut (yes, it is not a modern OS, but I didn't know that at Read More...
I figured that I had a good deal of empathy for a developer who had to write a driver. I have spent nearly 5 years creating and supporting WDF, learning from the community and drawing on my own experience in how drivers are written. Two of the most common Read More...
Michael Howard has a great posting on improvements made in the compiler with respect to the /GS flag (stack checking using a "canary" on function exit). Before these changes, #pragmas to explicitly turn the functionality on or off, the compiler itself Read More...
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 Read More...
I found this one out the hard way today. I was experimenting with the KMDF loader driver (wdfldr.sys). I added the following #define to my sources file so that I could share code between wdfldr and another component and control some functionality based Read More...
Yesterday I wrote about the two methods I use to refactor a virtual function and make sure that I find all of the derived implementations. In the entry I lamented that I would like to have the C# keyword override implemented in C++. Well, apparently it Read More...
As with many development projects, I had to refactor some code in KMDF. This refactor involved changing the signature of a virtual function to take additional parameters. The problem I faced is that C++ makes no distinction between declaring a new virtual Read More...
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 Read More...
Accidental fall throughs in a switch statement can lead to some nasty bugs. I have used the following banner for quite a long time to indicate that the fall through is intentional and not an oversite (this banner is also a part of the KMDF coding guidelines). Read More...
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 Read More...
While I don't write apps or drivers for the Macintosh, some of you out there probably do. If you have not already seen it, they posted a Secure Coding Guide ( PDF ) which is focused on OS X, but has generic recommendations as well. I just started reading Read More...
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 I feel Read More...
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 Read More...
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 Read More...
More Posts Next page »
 
Page view tracker