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 ArticleMicrospeak: spend
Remember, Microspeak is not merely for jargon exclusive to Microsoft, but it's jargon you need to know. We don't encounter the term spend much in the engineering side of the company, but it's in...
View ArticlePoor man's comments: Inserting text that has no effect into a configuration file
Consider a program which has a configuration file, but the configuration file format does not have provisions for comments. Maybe the program has a "list of authorized users", where each line takes...
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 ArticleI marked my parameter as [optional], so why do I get an RPC error when I pass...
Consider the following interface declaration in an IDL file: // Code in italics is wrong interface IFoo : IUnknown { HRESULT Cancel([in, optional, string] LPCWSTR pszReason); }; The idea here is that...
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 Article