A trick for finding the correct internal mailing list
Suppose you have a problem and you want to report it to an internal mailing list, but you don't know the correct mailing list to use. Here's a trick that apparently is not that well-known, though...
View ArticleWhere is the full version of the music that plays when you start Windows 98...
A customer was presumably exercising the unlimited support part of their support contract when they asked, "Where is the full song for the music that plays when you start Windows 98 for the first...
View ArticleWindows 95 and Windows NT manage the TEB on x86 differently
Today, a historical note of no consequence. Just a story. The Win32 x86 ABI specifies that the FS register holds a selector which is based at the current thread's TEB. In other words, fs:[n] is the...
View ArticleParsing a string as a 64-bit integer, somehow
Today's Little Program takes a string and tries to parse it as a 64-bit integer in formats that a programmer would likely encounter. Here's a first stab: using System; using System.Globalization;...
View ArticleMicrospeak: Stretch goal
Recall that Microspeak is not merely for jargon exclusive to Microsoft, but also for jargon that you need to know. A project will set some goals, which are things it intends to accomplish. It may also...
View Article2015 mid-year link clearance
The semi-annual link clearance is here! Windows 8 comes with a data compression API. I was going to write a Little Program to demonstrate it, but it turns out the MSDN sample pretty much covers it, so...
View ArticleHow secure are GUIDs? Can I use it to generate passwords?
GUIDs are globally unique identifiers, and given their rather incomprehensible presentation, some people may be tempted to use them (or parts of them) as passwords. For example, one person wondered...
View ArticleIs a SID with zero subauthorities a valid SID? It depends whom you ask
Here's an interesting table. FunctionIs SubAuthorityCount=0 valid?IsValidSidYesConvertSidToStringSidYesConvertStringSidToSidNo That last entry creates the unfortunate situation where a SID...
View ArticleWhy does the BackupWrite function take a pointer to a modifiable buffer when...
The BackupWrite function takes a non-const pointer to the buffer to be written to the file being restored. Will it actually modify the buffer? Assuming it doesn't, why wasn't it declared const? It...
View ArticleTrying out all the different ways of recognizing different types of...
Today's Little Program takes a 64-bit integer and tries to interpret it in all the various timestamp formats. This comes in handy when you have extracted a timestamp from a crash dump and want to see...
View ArticleIntentionally making the suggestion look nothing like any scripting language,...
In an internal peer-to-peer discussion list for an internal tool I'll call Program Q, somebody asked, How can I query the number of free frobs in every table in my table repository? I suggested that...
View ArticleWhat would be the point of creating a product that can't do its job?
Yuhong Bao for some reason lamented that there is no 32-bit version of Windows Server 2008 R2. Well, duh. Why would anybody want a 32-bit version of a server product? You would run into address space...
View ArticleWhy is my x64 process getting heap address above 4GB on Windows 8?
A customer noticed that when they ran their program on Windows 8, memory allocations were being returned above the 4GB boundary. They included a simple test program: #include <stdio.h> #include...
View ArticleOn the various ways of creating large files in NTFS
For whatever reason, you may want to create a large file. The most basic way of doing this is to use SetFilePointer to move the pointer to a large position into the file (that doesn't exist yet),...
View ArticleGenerating different types of timestamps from quite a long way away
Today's Little Program does the reverse of what we had last time. It takes a point in time and then generates timestamps in various formats. using System; class Program { static void TryFormat(string...
View ArticleHazy memories of the Windows 95 ship party
One of the moments from the Windows 95 ship party (20 years ago today) was when one of the team members drove his motorcycle through the halls, leaving burns in the carpet. The funny part of that...
View ArticleWhy doesn't the Print command appear when I select 20 files and right-click?
This is explained in the MSDN documentation: When the number of items selected does not match the verb selection model or is greater than the default limits outlined in the following table, the verb...
View ArticleWhy do I get ERROR_INVALID_HANDLE from GetModuleFileNameEx when I know the...
Consider the following program: #define UNICODE #define _UNICODE #include <windows.h> #include <psapi.h> #include <stdio.h> // horrors! mixing C and C++! int __cdecl wmain(int,...
View ArticleWhat did the Ignore button do in Windows 3.1 when an application encountered...
In Windows 3.0, when an application encountered a general protection fault, you got an error message that looked like this: Application error CONTOSO caused a General Protection Fault in module...
View ArticleHow can I detect whether a keyboard is attached to the computer?
Today's Little Program tells you whether a keyboard is attached to the computer. The short answer is "Enumerate the raw input devices and see if any of them is a keyboard." Remember: Little Programs...
View Article