Showing archive results for 2013

Oct 8, 2013
Post comments count0
Post likes count1

I wrote FAT on an airplane, for heaven’s sake

Raymond Chen

When you wrote code for 16-bit Windows, one of the things you spent time doing as part of performance tuning was deciding which functions should be grouped together in which segments. Code in 16-bit Windows executed out of code segments, each of which could be up to 64KB in size. When a code segment was loaded from disk, the entire segment was loa...

History
Oct 7, 2013
Post comments count0
Post likes count1

But instead, they decided to build the Great Wheel

Raymond Chen

I dreamed that Seattle was building its own version of the Eiffel Tower. Just like the original, except that it was also a thrill ride similar to Round Up but you are seated. It turns out that the city of Seattle accepted my subconscious's instructions to replicate another city's famous landmark, but the message wasn't received loud and clear. I...

Non-ComputerDream
Oct 7, 2013
Post comments count0
Post likes count1

Printing the contents of the clipboard as text to stdout

Raymond Chen

The takes its stdin and puts it on the clipboard. But how do you get it out? That's today's Little Program. (I guess we could call it .) Okay, what do we have here? We open the clipboard and try to get the Unicode text on it. We then look for the null terminator within the first 0x10000000 bytes. Why do I stop at 256MB? Because I'm lazy and ...

Code
Oct 4, 2013
Post comments count0
Post likes count1

What's the difference between CopyIcon and DuplicateIcon?

Raymond Chen

There are two functions that can be used to create one icon that is identical to another. One of them is . The other is . What's the difference? There isn't any difference. Both functions clone an icon. In fact, their implementations are basically line-for-line identical. Originally, there was just one function to clone an icon: . Windows 3...

Code
Oct 3, 2013
Post comments count0
Post likes count1

The relationship between module resources and resource-derived objects in 32-bit Windows

Raymond Chen

Last time, we saw how 16-bit Windows converted resources attached to an EXE or DLL file (which I called module resources for lack of a better term) to user interface resources. As a refresher: During the conversion from 16-bit Windows to 32-bit Windows, some of these rules changed. Specifically, icons, cursors, and accelerator tables are no long...

Code
Oct 2, 2013
Post comments count0
Post likes count1

The relationship between module resources and resource-derived objects in 16-bit Windows

Raymond Chen

As we saw last time, in 16-bit Windows, resources attached to an EXE or DLL file (which I called module resources for lack of a better term) were recorded in memory as discardable global memory blocks, and the window manager accessed them directly as needed. For example, if you had an icon or a cursor, the or was really a resource handle, and wh...

Code
Oct 1, 2013
Post comments count0
Post likes count1

The management of memory for resources in 16-bit Windows, redux

Raymond Chen

Some time ago, I briefly ran down how 16-bit Windows managed memory for resources. But there's a detail that I neglected to mention: Ownership. As we saw, a resource handle was really a pointer to the resource directory entry of the resource from the corresponding module. This could be done with a 16-bit pointer because the segment portion of th...

History
Sep 30, 2013
Post comments count0
Post likes count1

Playing a sound every time the foreground window changes

Raymond Chen

Today's Little Program plays a little sound every time the foreground window changes. One of my colleagues wondered if such a program was possible, "so that I stop accidentally typing the second halves of paragraphs into windows that pop up and steal focus." It's not clear whether this program will actually solve the bigger problem, but it was fun...

Code
Sep 27, 2013
Post comments count0
Post likes count1

2013 Q3 link clearance: Microsoft blogger edition

Raymond Chen

It's that time again: Linking to other Microsoft bloggers, and once again, the links are all from the excellent NT Debugging blog.

Other