Changing the conditions under which ReadFile produces fewer bytes than requested
In response to an article on hierarchical storage management, Karellen suggests that the problem could be ameliorated by having the hierarchical storage manager keep the first 4KB of the file online,...
View ArticleSometimes a function returns NULL because NULL really is the answer
A customer reported that sometimes the GetGUIThreadInfo function returned a valid window handle, but sometimes it returned all NULLs. DWORD dwThreadId = GetWindowThreadProcessId(hwnd, NULL);...
View ArticleWhy does the access violation error message put the operation in quotation...
Following up on Why does the access violation error message put the operation in quotation marks? Is it some sort of euphemism? Recall that when an application crashes with an access violation, the...
View ArticleSome helper functions for interlocked pointer operations
The pointer-related Interlocked functions all operate on void*. In practice, though, you are operating on typed pointers. Here are some helper functions to save you a bunch of typing....
View ArticleI cloned a project, but the new project still groups with the old project on...
Alternate title from a non-programmer point of view: When I copy an executable to another name, sometimes it groups separately, and sometimes it groups with the original. A customer had a product,...
View ArticleIt's called "proofreading", give it a shot why don't you, episode 2
A Reuters article from last week includes the sentence That annual regulatory filing also introduced a so-called "anti-pledging" provision that prevented further loans to company directors, executives...
View ArticleOh, that's probably why I'm in the Quake credits
Back in 2012, I couldn't remember why I was in the Quake credits. But then the comment from Kristaps pinpointed the most likely reason: The Sys_PageIn function. void Sys_PageIn (void *ptr, int size)...
View ArticleWhy is January 1 being reported as the last week of the previous year?
A customer (via the customer liaison) reported a problem that occurred when their program was run in Germany. Ah, those pesky Germans. Always causing trouble. In Germany, we find that the week numbers...
View ArticleDiagnosing high CPU by studying profiling results, example
A customer asked for assistance determining why their program demonstrated sporadic high CPU. It occurred only at a client location, so they couldn't set up a full debugging environment. They were...
View ArticleExploring the Supercute World of Hello Kitty
There's still time to get to the Hello Kitty Supercute Opening Party at the Experience Music Project, kicking off a four-month exhibition of Everything Hello Kitty. (Here are pictures from the Los...
View ArticleHow can I get notified when the cursor changes?
Today's Little Program tracks changs to the cursor. You might want to do this as part of instrumentation, in order to see how often the user is staring at an hourglass, for example. (It's easier to...
View ArticleThe ritual of choosing your next office
The joke at Microsoft is "Don't like your office? Don't worry. You'll be moved to a different one soon." It's not actually that bad, at least not in my experience, but the joke still stands. When a...
View ArticleWhy is the StartRunNOHOMEPATH policy so very specific about what it does?
The StartRunNoHOMEPATH policy affects whether the user's HOME path is the current directory when you run a program from the Run dialog. But that's all it does. DWalker asks, "I wonder why the...
View ArticleIf You Are The One: The crazy Chinese dating show
My wife watches 非誠勿擾, a Chinese dating game show. The title literally translates as "If not sincere, then do not bother", but that doesn't really convey what the title means. It follows in the Chinese...
View ArticleStupid JavaScript debugging tricks: Abusing the conditional breakpoint
Your favorite JavaScript debugger may very well have a conditional breakpoint facility, and if it does, you can abuse it to do things unrelated to conditional breakpoints. Since conditional...
View ArticleInvestigating a problem constructing a security descriptor to deny...
A customer had a question about how to set up a security access mask. How can I deny thread-specific access rights to Everyone? Specifically, I want to deny the Everyone group the following rights...
View ArticlePlaying with synchroninzation barriers
A synchronization barrier is a synchronization object that works like this: A synchronization barrier knows how many threads it is managing. Each thread that calls EnterSynchronizationBarrier...
View ArticleWe got around three
In this story about Restoration Hardware's mail order extravagance, there is a little statistic: Industry surveys from groups like the Direct Marketing Association estimate that catalogues get average...
View ArticleClarifying the documentation on wildcards accepted by...
A customer asked for clarification in the documentation for FindFirstFile and related functions, such as FindFirstFileEx and FindFirstFileTransacted Does FindFirstFileEx support multiple...
View ArticleThe increasing urgency of a request to fill out a survey
Here are some email messages I received from an automated system. October 20: "This survey must be completed no later than November 14." October 31: "Reminder, this survey must be completed no later...
View Article