Are there alternatives to _lock and _unlock in Visual Studio 2015?
A customer was using the _lock and _unlock functions in the C runtime library to take internal locks in order to avoid deadlocking with a thread they were suspending. They included this demonstration...
View ArticleHow can I control the directory from which my delay-loaded DLL is loaded?
A customer had a DLL that is a COM in-process server. This DLL gets loaded by arbitrary client applications, and it also uses the /DELAYLOAD linker flag to delay-load many of the DLLs which it depends...
View ArticleHow can a COM local server keep itself alive even though there are no active...
Suppose you have a COM local server, which means that the COM object is provided by a process different from the clients. And suppose you have a method which triggers some sort of background...
View ArticleCreating an object on the other side of the airtight hatchway isn’t yet a...
A security vulnerability report came in that went something like this: UAC can be trivially circumvented as follows. Sign in as a user who is a member of the Administrators group. Run Task Manager. Go...
View ArticleWhy does my Surface power brick keep blinking on and off?
If you try to charge your phone and your Surface from the same power brick, keep a close eye on the charger: See if the charging light is blinking. Here's the deal. There's an issue with some phones...
View ArticleHow am I supposed to free the information passed to the SetSecurityInfo...
Some time ago, we discussed how you're supposed to free the information returned by the GetSecurityInfo function. But what about the information passed to the SetSecurityInfo function? "How do I...
View ArticleI wasn’t fooled into thinking the Star Wars trench run was along the...
The Internet appears to have awakened to the surprise that the trench run that serves as the climax of the original Star Wars movie doesn't take place along the Death Star's equatorial trench, but...
View ArticleAre DDE and WM_COPYDATA related as IPC mechanisms?
A customer liaison asked whether DDE and the WM_COPYDATA message were related as IPC mechanisms. Specifically, are they dependent on each other, or are they independent? The two communications...
View ArticleSome friendly advice from the Redmond Public Safety department on nighttime...
Just sharing a public service message. Redmond Public Safety Monday, January 30, 2017 Friendly Police Department Tip #001 - Nightly Nude Jogging: On Jan 27th at 3:30am, an officer on the south side of...
View ArticleWhy am I getting a crash at shutdown inside the thread pool?
A customer reported a crash in WinHTTP when their application shuts down a WebSocket. Specifically, it occurs when one of their DLL's global objects is being destructed. The customer sent us a...
View ArticleIt is a great deal and not a great deal, both at the same time
Alas, Schrödinger's cat carrier is sold out. Is it a real product or a fake product? Or is it both real and fake at the same time, up until the moment you open the box and look inside?
View ArticleWhy does a Microsoft mouse accept two batteries even though it works just...
Many mouse devices from Microsoft have a battery compartment that accepts two batteries. But the mouse still works even if you insert only one battery. What's going on here? Yes, the mouse works just...
View ArticleMy proposal for an episode of the new Star Trek series
There's a new Star Trek series starting up. Here's my proposal for an episode: The crew discover a long-dead planet. The away team manages to figure out how the the extinct civilization's computer...
View ArticleMicrospeak: Placemat review
A term that is gaining currency at Microsoft is placemat review. I was unfamiliar with this term, so I asked around. A placemat review is a meeting which gives upper management detailed status on a...
View ArticleWhy are all Windows drivers dated June 21, 2006? Don’t you ever update drivers?
Why are all Windows drivers dated June 21, 2006? Don't you ever update drivers? Are you just a bunch of slackers? What's more, the date of June 21, 2006 applies even to drivers like Storage Spaces,...
View ArticleSuspicious memory leak in std::basic_string
A customer asked for assistance debugging a memory leak. Their memory leak detection tool was reporting a leak in the following call stack: ntdll!RtlAllocateHeap Contoso!malloc...
View ArticleHow do I do an interlocked exchange of a hat pointer?
If you work with C++/CX, then you spend a lot of time working with types that wear hats. These are basically super-smart pointers. In addition to performing automatic AddRef and Release, they also...
View ArticleSometimes you get so worked up about the compatibility consequences of a...
During the course of investigating a bug that resulted in the system crashing with a bluescreen, the question arose, "What are the compatibility consequences of making this change? Are there any...
View ArticleAdvertisement for ink cartridges doesn’t do all the math
I saw an advertisement for manufacturer-authorized ink cartridges. It said, approximately, "Our ink cartridges print up to 2× longer than third-party refills." "For only 4× the price" the...
View ArticlePipelining your laundry, and the ensuing silliness
One of my colleagues told us that her seven-year-old niece discovered the concept of pipelining while contemplating how her grandmother could have laundry in both the washing machine and dryer...
View Article