Opening the classic folder browser dialog with a specific folder preselected
Today's Little Program shows how to set the initial selection in the SHBrowseForFolder dialog. The design of the SHBrowseForFolder function had a defect: The BROWSEINFO structure doesn't have a...
View ArticleThe details of the major incident were not clearly articulated, but whatever...
When a server is taken offline, be it a planned unplanned outage or an unplanned unplanned outage or something else, the operations team send out a series of messages alerting customers to the issue....
View ArticleWhy is the System.DateCreated property off by a few seconds?
If you ask for the System.DateCreated property of a shell item, the timestamp that comes back is up to two seconds different from the file's actual timestamp. (Similarly for System.DateModified and...
View ArticleIf more than one object causes a WaitForMultipleObjects to return, how do I...
There is often confusion about the case where you call WaitForMultipleObjects (or its variants), passing bWaitAll = FALSE, and more than one object satisfies the wait. When bWaitAll is FALSE, this...
View ArticleOn the ways of creating a GUID that looks pretty
A customer had what at first appeared to be a question born of curiousity. Is it possible that a GUID can be generated with all ASCII characters for bytes? In other words, is it possible that a GUID...
View ArticleAfter I encrypt memory with CryptProtectMemory, can I move it around?
A customer had a question about the the CryptProtectMemory function. After using it to encrypt a memory block, can the memory block be moved to another location and decrypted there? Or does the...
View ArticleIn the Seattle area, people treat you nicer once they learn your last name is...
One of the team members during the days of Windows 95 happens to have the last name Gates, no relation. She says that it's surprising how nice salespeople are to you once they learn what your last...
View ArticleWhen I set the "force X off" policy to Disabled, why doesn't it force X on?
A customer was using one of the many "force X off" policies, but instead of using it to force X off, they were trying to use it to force X on by setting the policy to Disabled. For example, there is a...
View ArticleWhy did the original code for FIND.COM use lop as a label instead of loop?
A few years ago, I left you with an exercise: Given the code mov dx,st_length ;length of the string arg. dec dx ;adjust for later use mov di, line_buffer lop: inc dx mov si,offset st_buffer ;pointer...
View ArticleWhy are there both TMP and TEMP environment variables, and which one is right?
If you snoop around your environment variables, you may notice that there are two variables that propose to specify the location of temporary files. There is one called TMP and another called TEMP....
View ArticleHow to find the IP address of a hacker, according to CSI: Cyber
The episode of the television documentary CSI: Cyber which aired on CBS last Wednesday demonstrated an elite trick to obtaining a hacker's IP address: Extract it from the email header. Here's a screen...
View ArticleWhat was the starting point for the Panther Win32 kernel?
When I presented a list of cat-related code names from Windows 95, commenter dave wanted to know whether the Panther kernel was derived from the 32-bit DOS kernel or the Windows/386 kernel. Neither....
View ArticleIt rather involved being on the other side of this airtight hatchway: Invalid...
It's the bogus vulnerability that keeps on giving. This time a security researcher found a horrible security flaw in SysAllocStringLen: The SysAllocStringLen function is vulnerable to a...
View ArticleHow did the scopes for the CryptProtectMemory function end up in a strange...
A few weeks ago, I left an exercise: Propose a theory as to why the names and values of the scopes for the CryptProtectMemory function are the way they are. I didn't know the answer when I posed the...
View ArticleWhy can't I have variadic COM methods?
COM methods cannot be variadic. Why not? Answer: Because the marshaler doesn't know when to stop. Suppose variadic COM methods were possible. And then you wrote this code: interface IVariadic {...
View ArticleHow do I extract the path to Control Panel from this shortcut so I can launch...
A customer explained that they had a program that used the IShellLink::GetPath method to extract the program that is the target of a shortcut. They found that this didn't work for certain shortcuts,...
View ArticleWow, they really crammed a lot into those 410 transistors
A colleague of mine pointed out that in yesterday's Seattle Times, there was an article about Moore's Law. To illustrate the progress of technology, they included some highlights, including the...
View ArticleAccess to a file's attributes is controlled by two things
We saw some time ago that permission to delete a file is granted either if you have DELETE access on the file, or if you have FILE_DELETE_CHILD access on the containing directory. File attributes...
View ArticleIs the atom returned by RegisterClass(Ex) a "real" atom?
A customer was debugging some code that calls RegisterClass on a class that's already been registered. In this case, it was registered by another DLL in the same process. Normally, this wouldn't be a...
View ArticleHow can I tell if a file is an image of some type?
A customer wanted to know if there is some standard way of determining from the full path to a file whether it is a photo or image. They are writing a program that transfers a bunch of files to a...
View Article