If I have a modeless dialog box with custom accelerators, which should I call...
A customer had a modeless dialog box with custom accelerators. If their window had been a modeless dialog box without custom accelerators, then their message dispatch would be if...
View ArticleIs it okay to call TryAcquireSRWLock from a thread that has already acquired...
A customer found the MSDN documentation ambiguous. Wouldn't be the first time. In the description of Slim Reader/Writer Locks: An SRW lock is the size of a pointer. The advantage is that it is fast to...
View ArticleAdventures in application compatibility: The bogus memory calculation
One of my colleagues shared with me one of his application compatibility stories. There was a program that would fail on some computers but not others, and it wasn't clear why. The problem was traced...
View ArticleWaitOnAddress lets you create a synchronization object out of any data...
The WaitOnAddress function is a funny little guy. It lets you create a synchronization object out of 1, 2, 4, or 8 bytes of memory. And you even control the contents of the memory, so the...
View ArticleImplementing a synchronization barrier in terms of WaitOnAddress
Last time, I promised to reimplement existing synchronization objects in terms of WaitOnAddress. Note that these are academic exercises rather than recommendations, because you should probably just...
View ArticleThe International Fair Play Committee announces the Rio 2016 Fair Play...
The International Fair Play Committee announced the winners of the Rio 2016 Fair Play Awards, though you'll be hard-pressed to find those winners because the press release spends over 300 words...
View ArticleImplementing a critical section in terms of WaitOnAddress
Last time, we built a synchronization barrier out of WaitOnAddress. Today, we'll build a critical section. Remember that this is an exercise just to demonstrate ways of using WaitOnAddress; in...
View ArticleSoarin’ over California + Seattle = Wings over Washington
We already have a giant Ferris wheel. And opening today, right next door to the Great Wheel, we get Wings over Washington, a Washington-themed version of Soarin' over California Around the World,...
View ArticleSpurious wakes, race conditions, and bogus FIFO claims: A peek behind the...
We spent the past few days looking at the WaitOnAddress function. Today we're going to peek behind the curtain. Reminder: These are undocumented implementation details and are subject to change at...
View ArticleDetecting what language or script a run of text is written in, redux
Some time ago, I discussed the confusion surrounding the question, "How can I detect the language a run of text is in?" because the person asking the question was from an East Asian country, and in...
View ArticleWhat is the NTDiskQuotaSidCache.ndx file for?
A customer was looking for information about the file %LOCALAPPDATA%\Microsoft\Windows NT\DiskQuota\NTDiskQuotaSidCache.ndx. All they could find is this KB article. The...
View ArticleThe ship date predictor: Redux
Last year, I shared the ship date predictor. My colleague who created the chart contacted me last year and told me what happened when he tried to apply the ship date predictor to subsequent projects....
View ArticleDiscardability in drivers has nothing to do with discardability in user-mode...
Some time ago we discussed what the DISCARDABLE keyword means. In summary: It has no effect in user mode, and in kernel mode, it means that the memory should be thrown away after initialization is...
View ArticleA customer question about shortcuts that don’t have a target path
A customer had a question about the Minesweeper shortcut on Windows 7: We found something strange when we tried to retrieve target path information from the Minesweeper shortcut, specifically, the...
View ArticleThe complicated engineering behind an ice cream social
Moving offices is a time-honored tradition at Microsoft. Some time ago, several teams (including my own) moved into a new building, and my local team had an ice cream social as a housewarming party....
View ArticleHow to get people who installed a leaked build to stop using that build?
Back in the days before the Windows Insider Program, one of the problems that frustrated the product team was build leaks. These were builds not intended for public consumption, and their existence...
View ArticleIf I zero out my memory pages, does that make them page in faster?
In an earlier discussion of discardability, I noted that if you allocate some zero-initialized pages and never modify them, then the memory manager can just throw the memory away because it can...
View ArticleHow can I change a registry key from within the debugger?
If you are using a debugger based on the Windows debugging engine, you can use the !dreg command to dump a registry key, but what if you want to modify a registry key? I don't know how often it...
View ArticleHow can I get the memory manager to prefetch bigger chunks of data from my...
A customer had a memory-mapped file and they found that when they accessed a page in the mapping, Windows paged in 32KB of memory, even though the documentation says that only 4KB gets paged in. The...
View ArticleHow can I have a window that rejects activation but still receives pointer...
A customer had a dedicated system with two touch screens. One screen was covered by the main app window, and the other was covered by a secondary window. They needed focus to remain on the main app...
View Article