What happens if you call VirtualAlloc to MEM_COMMIT a page you never...
A customer reported that while trying to solve a problem with their program, they noticed that they had been calling VirtualAlloc incorrectly for years. They were able to reduce it into a simple...
View ArticleHow does a shell namespace extension provide icons for virtual items that...
A customer asked, "What is the correct way to retrieve the icon associated with a file extension? We are writing a shell namespace extension that holds virtual file content, and we want to show the...
View ArticleLearning about farm animals from my niece
I was playing with my niece (three years old at the time of this story), and she taught me a lot about farm animals. You get eggs from cows and pigs. Cow eggs are black and taste like bananas. Pig...
View ArticleHow do I get the user-customed name of My Computer or Recycle Bin?
Today's Little Program displays the user-customized name of This PC (the folder formerly known as My Computer) or Recycle Bin. The basic principle here is that if you want to display something the...
View ArticleWhy do Saturation and Luminance go all the way to 240, but Hue goes only to...
If you open the common Color Picker dialog, the custom color picker lets you specify the color in one of three ways. Graphically, by clicking a color in the rainbow and using the slider to change the...
View ArticleThe MoveSecurityAttributes policy affects only how Explorer recalculates ACLs...
A customer reported that even though they were deploying MoveSecurityAttributes policy to all their machines, it wasn't working everywhere. "It works fine with the GUI but does not work (i.e., has...
View ArticleWhat's the difference between UuidFromString, IIDFromString, CLSIDFromString,...
A GUID and a CLSID and an IID are all the same as a UUID, but there are separate functions for converting a string into a GUID, CLSID, IID, and UUID. Are they all equivalent? If not, what's the...
View ArticleI have the handle to a file; how can I get the file name from the debugger?
Suppose you're debugging and you find yourself with the handle to a file, and you would like to know what file that handle corresponds to. Well, the way you would do this from code is to call...
View ArticleHow do I get the user-customized name of a mapped network drive?
Last time, we displayed the names of This PC and Recycle Bin. This time, we'll look at mapped volumes, because they are a little tricky. When you map a network drive, the name in Explorer defaults to...
View ArticleWhat is COM marshaling and how do I use it?
COM has this concept called "marshaling", with one L. Basically, marshaling is the mechanism by which an object that is accessible to one apartment can be made accessible to another apartment....
View ArticleWhat are the rules for CoMarshalInterThreadInterfaceInStream and...
Last time, we looked at the recommended ways of marshaling objects between apartments or between processes, but what if those mechanisms are not available to you? (Or if you're simply curious about...
View ArticleWhat are the rules for CoMarshalInterface and CoUnmarshalInterface?
Last time, we looked at the rules for CoMarshalInterThreadInterfaceInStream and CoGetInterfaceAndReleaseStream, the functions you use for sharing an object with another thread in the sample...
View ArticleCoGetInterfaceAndReleaseStream does not mix with smart pointers
One horrible gotcha of the CoGetInterfaceAndReleaseStream function is that it releases the stream. This is a holdover from the old days before smart pointers. The function released the stream to...
View ArticleAre there any negative consequences to having a ton of files on the desktop?
I tend to be a bit sloppy with my desktop folder. How bad is it to have a ton of files on your desktop? One consequence of having a ton of files on your desktop is that you're slowing down logon,...
View ArticleThe Redmond Reality Distortion Field: Analogies involving high-performance...
At the announcement of Windows 10, Joe Belfiore remarked, We want all these Windows 7 users to have the sentiment that yesterday they were driving a first-generation Prius... and now with Windows 10...
View ArticleHow do I create a wizard that contains none of the things that makes a wizard...
A customer asked We're using the PropertySheet function to create a wizard. We've been able to remove almost all of the wizard elements, but we can't figure out how to get rid of the footer area. Is...
View ArticleWhen you open a securable object, make sure you pass the security mask you...
There are two categories of "Access denied" errors. One occurs when you attempt to create the handle, and the other occurs when you attempt to use the handle. HANDLE hEvent = OpenEvent(SYNCHRONIZE,...
View ArticleWhy does the timestamp of a file increase by up to 2 seconds when I put it in...
We saw some time ago that the timestamp of a file increases by up to 2 seconds when you copy it to a USB thumb drive. The underlying reason is that USB thumb drives tend to be formatted with the FAT...
View ArticleHow can I make my custom namespace extension get categorized correctly in My...
A customer was developing a custom namespace extension and they found that when displayed in My Computer, it showed up in the Other category. NameType◢Hard Disk Drives (3)⏍OS (C:)Local Disk⏍DISK_1...
View ArticleMicrospeak: North star
I noted it in the interview with the Defrag Tools show, but I'll make a proper Microspeak for it. Today's term is North star. This term rose quickly to prominence in October 2015. My research suggests...
View Article