Why is there a 64KB no-man's land near the end of the user-mode address space?
We learned some time ago that there is a 64KB no-man's land near the 2GB boundary to accommodate a quirk of the Alpha AXP processor architecture. But that's not the only reason why it's there. The...
View ArticleSome parts of an interface can change but others can't
When I wrote about asking the compiler to answer calling convention questions, some people were concerned about whether this was a reliable mechanism or whether it was relying on something that can...
View ArticleEnumerating notification icons via UI Automation
Today's Little Program uses accessibility to enumerate the current notification icons (and possibly click on one of them). This could be done manually via IAccessible, but the BCL folks conveniently...
View ArticleIs there a way to disable a specific balloon notification without disabling...
There is a group policy called Turn off all balloon notifications, but what if you want to turn off only one specific notification? The taskbar does not offer fine-grained policy control over balloon...
View ArticleThe GetCurrentThread function is like a check payable to Bearer: What it...
The GetĀCurrentĀThread function returns a pseudo-handle to the current thread. The documentation goes into significant detail on what this means, but I fear that it may have fallen into the trap of...
View ArticleIf only DLLs can get DllMain notifications, how can an EXE receive a...
When a DLL is loaded, it receives a DLL_PROCESS_ATTACH notification, and when it is unloaded (or when the process terminates), it gets a DLL_PROCESS_DETACH notification. DLLs also receive...
View ArticleWhen are global objects constructed and destructed by Visual C++?
Today we're going to fill in the following chart: When does it run?ConstructorDestructorGlobal object in EXEGlobal object in DLL The C++ language specification provides some leeway to implementations...
View ArticleScripting an Internet Explorer window
Today's Little Program takes a random walk through MSDN by starting at the CreateĀProcess page and randomly clicking links. The exercise is not as important as the technique it demonstrates. function...
View ArticleThe great thing about regular expression languages is that there are so many...
Before you ask a question about regular expressions, you should make sure you and your audience agree on which regular expression language you are talking about. Here is a handy table of which...
View ArticleHow do I disable Windows 8 touch contact visualizations for my application?
You might have an application (like a game) where the default touch contact visualizations are a distraction. In WinRT, you can disable the contact visualizations by simply saying // JavaScript...
View ArticleHow can I detect programmatically whether the /3GB switch is enabled?
A customer was doing some diagnostic work and wanted a way to detect whether the /3GB switch was enabled. (Remember that the /3GB switch is meaningful only for 32-bit versions of Windows.) The way to...
View ArticleDebugging a hang: Chasing the wait chain inside a process
Today we're going to debug a hang. Here are some of the (redacted) stacks of the process. I left some red herrings and other frustrations. 0: kd> !process ffffe000045ef940 7 PROCESS...
View ArticleEnumerating the ways of distributing n balls into k boxes
Suppose you had n indistinguishable balls and k distinguishable boxes. Enumerate the ways of distributing the balls into boxes. Some boxes may be empty. We can represent each distribution in the form...
View ArticleA question about preventing the system from going to the idle state turns out...
A customer asked how they could have their program prevent the system from going to the idle state. Specifically, when the system goes idle, the application gets into a weird state where it starts...
View ArticleThe contents of the Start page are not programmatically accessible
A customer wanted to know if is possible for an application to edit the user's Start page. No, there is no interface for editing the user's Start page or even knowing what is on it. The Start page is...
View ArticleWhy is the FAT driver called FASTFAT? Why would anybody ever write SLOWFAT?
Anon is interested in why the FAT driver is called FASTFAT.SYS. "Was there an earlier slower FAT driver? What could you possibly get so wrong with a FAT implementation that it needed to be chucked...
View ArticleThe case of the file that won't copy because of an Invalid Handle error message
A customer reported that they had a file that was "haunted" on their machine: Explorer was unable to copy the file. If you did a copy/paste, the copy dialog displayed an error. 1 Interrupted...
View ArticleApplying a filter to the contents of an Explorer Browser
Today's Little Program hosts an Explorer Browser but filters the contents to remove DLL files. You can, of course, substitute your own filter. (For example, maybe you want to show only files that...
View ArticleMicrospeak: Line of sight
I first encountered this term in a meeting I attended. Q: We would like to be able to reverse the polarity of the neutron flow without requiring a reboot. A: Yes, that is something we've been thinking...
View ArticlePassing the incorrect object type for a handle, how bad is it?
A customer asked a somewhat strange question: "We are calling SetĀEvent but passing the handle to a waitable timer. Application Verifier reports, "Incorrect object type for handle." But the code works...
View Article