The Old New Thing

Why does the Recycle Bin have different file system names on FAT and NTFS?

On FAT drives, the directory that stores files in the Recycle Bin is called C:\RECYCLED, but on NTFS drives, its name is C:\RECYCLER. Why the name change? The FAT and NTFS Recycle Bins have different internal structure because NTFS has this thing called "security" and FAT doesn't. All recycled files on FAT drives are dumped into a single C:\...

Waiting for all handles with MsgWaitForMultipleObjects is a bug waiting to happen

The MsgWaitForMultipleObjects and MsgWaitForMultipleObjectsEx functions allow you to specify whether you want to want for any or all of the handles (either by passing bWaitAll = TRUE or by passing dwFlags = MWMO_WAITALL, accordingly). But you never want to wait for all handles. Waiting for all handles means that the call does not return ...
Comments are closed.0 0
Code

Stephen Tolouse's reminiscences of Windows 95 RTM day

Stephen Tolouse (known around Microsoft as "stepto", pronounced "step-toe") from the Microsoft Security Response Center reminisces about Windows 95 RTM. Stephen mentions that "the build numbers were artificially inflated to reach 950". There's actually a technical reason for this inflation, which I intend to write about when I have the ...

Pumping messages while waiting for a period of time

We can use the MsgWaitForMultipleObjects function (or its superset MsgWaitForMultipleObjectsEx) to carry out a non-polling "sleep while processing messages". #define MSGF_SLEEPMSG 0x5300 BOOL SleepMsg(DWORD dwTimeout) { DWORD dwStart = GetTickCount(); DWORD dwElapsed; while ((dwElapsed = GetTickCount() - dwStart) < dwTimeout) { ...
Comments are closed.0 0
Code

Welcome to the United States, unless you're a Canadian technologist who is an invited guest at a Microsoft conference, in which case, keep out

Vancouver technologist Darren Barefoot was invited to Redmond by the MSN Search team but was stopped by Immigration and denied entry. Ultimately, the customs agents concluded that because Microsoft was covering my flight and accommodation, I was being compensated for consulting activities. In order to enter the country, I'd need a work ...

You can call MsgWaitForMultipleObjects with zero handles

There is no WaitMessageTimeout function, but you can create your own with the assistance of the MsgWaitForMultipleObjects function. BOOL WaitMessageTimeout(DWORD dwTimeout) { return MsgWaitForMultipleObjects( 0, NULL, FALSE, dwTimeout, QS_ALLINPUT) == WAIT_TIMEOUT; } To wait for a message with timeout, we use the ...
Comments are closed.0 0
Code