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

Image may be NSFW.
Clik here to view.

The format of data and custom resources

Continuing the highly-sporadic series of Win32 resource formats, today we'll look at the format of RT_DATA resources, which are declared in resource files as RCDATA. Also the format of custom...

View Article


Image may be NSFW.
Clik here to view.

How can I write to a file only as long as nobody's looking?

A customer wanted to know how to detect that the user has opened Notepad to view a particular file. They had come up with method based on polling and sniffing the Notepad title bar, but they found...

View Article


Image may be NSFW.
Clik here to view.

Can an x64 function repurpose parameter home space as general scratch space?

We saw some time ago that the x64 calling convention in Windows reserves space for the register parameters on the stack, in case the called function wants to spill them. But can the called function...

View Article

Image may be NSFW.
Clik here to view.

What is the official name of the most popular work visa in the United States?

The most popular work visa in the United States is the H1-B visa. But have you looked at its official name? H-1B Specialty Occupations, DOD Cooperative Research and Development Project Workers, and...

View Article

Image may be NSFW.
Clik here to view.

If you had to deal with preschoolers all day, you'd need a nap too

Today, I'm turning it around: This is a dream that one of my friends had about me! She dreamed that she took her camera to school to take some pictures, possibly for the yearbook. She was somewhat...

View Article


Image may be NSFW.
Clik here to view.

If your product is client-managed, how do you sell the server?

A friend of mine told me about a project he worked on two decades (and three employers) ago. Let's call it Project Nosebleed. Their project used a client-managed database: You have a central file...

View Article

Image may be NSFW.
Clik here to view.

How permanent is the "Remove from this list" action on the Start menu?

From Windows XP to Windows 7, the Start menu showed the programs it thinks you've run most frequently, by employing a conceptually simple but complicated-in-practice algorithm. You can right-click an...

View Article

Image may be NSFW.
Clik here to view.

Why are my posted messages getting lost when the user drags my window around?

This question was inspired by an actual customer question, but I changed a lot of it around to make for a more interesting story. (Trust me, the original story was even more boring.) A customer's...

View Article


Image may be NSFW.
Clik here to view.

How to rescue a broken stack trace on x64: Recovering the stack pointer

Recovering a broken stack on x64 machines on Windows is trickier because the x64 uses unwind codes for stack walking rather than a frame pointer chain. When you dump the stack, all you're going to see...

View Article


Image may be NSFW.
Clik here to view.

Programmatically editing the metadata of an audio file

Today's Little Program edits the metadata of an audio file, ostensibly to correct a spelling error, but really just to show how it's done. Today's smart pointer class library is... (rolls dice)......

View Article

Image may be NSFW.
Clik here to view.

Mom and dad's event-filled first day of school

I dreamed that my wife and I had dropped our daughter off at her new school for the first time, and I made a wrong turn and ended up going the wrong way. We got off at an exit for highway I-5, and the...

View Article

Image may be NSFW.
Clik here to view.

Early versions of Aero Peek: Aladdin, Bat Signal, and Squeegee

The feature now known as Aero Peek wasn't born that way. It went through several iterations before becoming what eventually shipped in Windows 7. At the MIX09 conference, Stephan Hoefnagels showed...

View Article

Image may be NSFW.
Clik here to view.

Why does Internet Explorer put tab stops at 8-character intervals instead of...

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...

View Article


Image may be NSFW.
Clik here to view.

It rather involved being on the other side of this airtight hatchway:...

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...

View Article

Image may be NSFW.
Clik here to view.

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...

View Article


Image may be NSFW.
Clik here to view.

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. int __cdecl wmain(int argc, wchar_t **argv) { FILE_INFO_3...

View Article

Image may be NSFW.
Clik here to view.

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...

View Article


Image may be NSFW.
Clik here to view.

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...

View Article

Image may be NSFW.
Clik here to view.

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...

View Article

Image may be NSFW.
Clik here to view.

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

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...

View Article
Browsing all 3085 articles
Browse latest View live