The Old New Thing

How can I tell that I have a shell folder that represents My Computer?

You have in your hands an IShell­Folder, and you want to know whether this is an IShell­Folder that represents My Computer. There are a few ideas that may occur to you. One is to ask the folder for its current location and compare it to CSIDL_DRIVES. Okay, we have a lot of moving parts here. Let's look at them one at a time. The Get­...
Comments are closed.0 0
Code

Raymond's subjective, biased, unfair, and completely wrong characterization of the sounds of several East Asian (and one Southeast Asian) languages

Hokkien: This is the language I learned first, so to me it sounds perfectly normal and is in fact how languages should sound. I find it odd that people describe it as one of the more difficult languages to learn. I mean, sure it has a large tone repertoire (eight theoretical, though only seven in practice) and extensive tone sandhi, but that's...

When a program is launched via DDE, and there are multiple servers, which one is used?

Although you are more than welcome to stop using DDE (please oh please stop using it), there are still many applications which still use it (cough), and as a result, customers still have questions about it. One customer wanted to know why, if multiple copies of a DDE-based application are running, Windows 7 will send the command to the ...
Comments are closed.0 0
Code

SubtractRect doesn't always give you the exact difference

The Subtract­Rect function takes a source rectangle and subtracts out the portion which intersects a second rectangle, returning the result in a third rectangle. But wait a second, the result of subtracting one rectangle from another need not be another rectangle. It might be an L-shape, or it might be a rectangle with a rectangular hole...
Comments are closed.0 0
Code

Facilities jargon: Energize

Over in the product engineering groups, we aren't often exposed to the jargon employed by our Facilities group. But once in a while, it leaks through and then we get to puzzle it out. Emergency Electrical Outage and Restoral Due to a transformer failure, power to building NNN was shut down from 6:00am to 6:30am on MMMM-DD. Occupants may ...

Entering the world of competitive Ring-Around-the-Rosie

I dreamed that a friend and I were in line at some sort of summer camp to get into the cafeteria. We noticed a glass cabinet with food out in the dining area and asked about it. Turns out that it was available for people to eat, as an alternative to standing in line. We decided to go for it. (Another example of how being lucky is observing ...

Forcing a file handle closed when it has been opened remotely

Today's Little Program closes a file handle that was opened remotely. It builds on previous discussion on how to use the Net­Xxx functions. Forcing a network file handle closed does not actually close the handle. This makes it very different from the various "force handle closed" utilities out there. Rather, forcing a network file ...
Comments are closed.0 0
Code

How does InterlockedIncrement work internally?

The Interlocked family of functions perform atomic operations on memory. How do they do it? It depends on the underlying CPU architecture. For some CPUs, it's easy: The x86, for example, has direct support for many interlocked operations by means of the LOCK prefix (with the bonus feature that LOCK is implied for the XCHG opcode.) The ...

It rather involved being on the other side of this airtight hatchway: Creating problematic files in a directory that requires administrative access

A security vulnerability report came in that said, "If you create a file with ⟨specific name⟩ in ⟨specific directory⟩, then ⟨denial of service⟩ happens the next time somebody does ⟨specific operation⟩, and the machine must be rebooted." Yes, it's true that creating that specific file in the very ...

Why does Internet Explorer put tab stops at 8-character intervals instead of 4, like all right-thinking people?

When you embed a TAB character (U+0009) in a <PRE> block (or more precisely, an element whose white-space CSS property is computed to be pre or pre-wrap), Internet Explorer will move the current position to the next multiple of eight characters. Many people prefer four. (Some insist that only four is the correct value and anybody who ...

Feedback usabilla icon