Quantcast
Channel: The Old New Thing
Browsing all 3085 articles
Browse latest View live
↧

Image may be NSFW.
Clik here to view.

Slim reader/writer locks don't remember who the owners are, so you'll have to...

The slim reader/writer lock is a very convenient synchronization facility, but one of the downsides is that it doesn't keep track of who the current owners are. When your thread is stuck waiting to...

View Article


Image may be NSFW.
Clik here to view.

The ways people mess up IUnknown::QueryInterface, episode 4

One of the rules for IUnknown::Query­Interface is so obvious that nobody even bothers to state it explicitly as a rule: "If somebody asks you for an interface, and you return S_OK, then the pointer...

View Article


Image may be NSFW.
Clik here to view.

ReadDirectoryChangesW reads directory changes, but what if the directory...

The Read­Directory­ChangesW function reads changes to a directory. But not all changes that happen to files in a directory result in changes to the directory. Now, it so happens that nearly all...

View Article

Image may be NSFW.
Clik here to view.

Why does the runas command require its command line to be quoted?

Commenter teo complained that the runas command requires its command line to be quoted. Well, if you think about it, why single out runas? Pretty much all programs require their command line to be...

View Article

Image may be NSFW.
Clik here to view.

Why does creating a shortcut to a file change its last-modified time......

A customer observed that sometimes, the last-modified timestamp on a file would change even though nobody modified the file, or at least consciously took any steps to modify the file. In particular,...

View Article


Image may be NSFW.
Clik here to view.

Starting up inside the box

the shell team received two customer questions about a month apart which seemed unrelated but had the same root cause. I found that in Windows Vista, the xcopy command is ten times slower than it was...

View Article

Image may be NSFW.
Clik here to view.

Why does IFileOperation skip junctions even though I passed...

The IFile­Operation::Set­Operation­Flags method accepts a number of flags to modify the file operation, among them today's subject FOFX_NO­SKIP­JUNCTIONS. A customer reported that they couldn't get...

View Article

Image may be NSFW.
Clik here to view.

Ow, I'm too safe!

One of my friends is a geek, and, naturally, fully researches everything he does, from cement pouring to bicycle parts, perhaps a bit obsessively. He made sure to get five-point restraints for his...

View Article


Image may be NSFW.
Clik here to view.

Why are the alignment requirements for SLIST_ENTRY so different on 64-bit...

The Interlocked­Push­Entry­SList function stipulates that all list items must be aligned on a MEMORY_ALLOCATION_ALIGNMENT boundary. For 32-bit Windows, MEMORY_ALLOCATION_ALIGNMENT is 8, but the...

View Article


Image may be NSFW.
Clik here to view.

Why doesn't the Open Files list in the Shared Folders snap-in show all my...

A customer wanted a way to determine which users were using specific files on their server. They fired up the Shared Folders MMC snap-in and went to the Open Files list. They found that the results...

View Article

Image may be NSFW.
Clik here to view.

What do SizeOfStackReserve and SizeOfStackCommit mean for a DLL?

Nothing. Those fields in the IMAGE_OPTIONAL_HEADER structure are meaningful only when they appear in the EXE. The values provided in DLLs are ignored. Size­Of­Heap­Reserve and Size­Of­Heap­Commit fall...

View Article

Image may be NSFW.
Clik here to view.

Magic dirt, the fate of former professional athletes, and other sports...

A sports-related (mostly baseball) link dump. A look at the special dirt that is used by Major League Baseball to prepare balls for use. As you might have expected, professional athletes don't fare...

View Article

Image may be NSFW.
Clik here to view.

Stupid command-line trick: Counting the number of lines in stdin

On unix, you can use wc -l to count the number of lines in stdin. Windows doesn't come with wc, but there's a sneaky way to count the number of lines anyway: some-command-that-generates-output | find...

View Article


Image may be NSFW.
Clik here to view.

Random musings on the introduction of long file names on FAT

Tom Keddie thinks that the format of long file names on FAT deserves an article. Fortunately, I don't have to write it; somebody else already did. So go read that article first. I'm just going to add...

View Article

Image may be NSFW.
Clik here to view.

Why can't I use PSGUID_STORAGE like a GUID?

The stgprop.h header file defines a GUID called PSGUID_STORAGE, but a customer was having trouble using it. GUID guid; ... // This generates a strange compiler error if (IsEqualGUID(guid,...

View Article


Image may be NSFW.
Clik here to view.

How can I get information about the items in the Recycle Bin?

For some reason, a lot of people are interested in programmatic access to the contents of the Recycle Bin. They never explain why they care, so it's possible that they are looking at their problem the...

View Article

Image may be NSFW.
Clik here to view.

Modernizing our simple program that retrieves information about the items in...

Last time, we wrote a simple program to print various properties of the items in the Recycle Bin, and we did so in the classical style, using item ID lists and IShell­Folders. One thing you may have...

View Article


Image may be NSFW.
Clik here to view.

Invoking commands on items in the Recycle Bin

Once you've found the items you want in the Recycle Bin, you may want to perform some operation on them. This brings us back to our old friend, IContextMenu. At this point, you're just snapping two...

View Article

Image may be NSFW.
Clik here to view.

What's the story with the parameters to the WM_INPUT_DEVICE_CHANGE message?

A customer found these strange macros in winuser.h: #if (_WIN32_WINNT >= 0x0601) #define GET_DEVICE_CHANGE_WPARAM(wParam) (LOWORD(wParam)) #elif (_WIN32_WINNT >= 0x0501) #define...

View Article

Image may be NSFW.
Clik here to view.

Thanks for letting me know what my ideal career and company are

When it's performance review season, all of a sudden you start getting mail about career management. What a coincidence. There are a variety of career management tools available, some mandatory, some...

View Article
Browsing all 3085 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>