May, 2004

  • The Old New Thing

    Broadcasting user-defined messages


    When you broadcast a message (via HWND_BROADCAST) remember that the message you broadcast must have global meaning. I discussed earlier what the various message ranges mean. Notice that only the system-defined range (0..WM_USER-1) and the registered message range (MAXINTATOM .. MAXWORD) have global meaning. The other two ranges have class-specifc or application-specific meanings.

    In other words, you can't broadcast a message in the WM_USER range since that message has a different meaning for each window class. Similarly, a message in the WM_APP range has a different meaning for each application.

    We ran into this problem in Windows 95. There were programs that decided to broadcast private messages like WM_USER+0x0100, intending them to be delivered to other instances of that program. Of course, when those messages reached some other windows, they interpreted WM_USER+0x0100 as some other private message and either acted funny or crashed.

    On the other hand, the programs really wanted the message to reach the windows of other copies of itself, so we couldn't just block the broadcast of the programs would stop working. Progams were relying on the system not trying to stop them from crashing other programs!

    The solution was to split the difference. If you broadcast a message that was not safe to broadcast, Windows 95 would send it only to old-style programs. New-style programs (marked as version 4.0 or higher) would not receive the messages.

    That way, old programs continued to affect each other as they always did, but new programs followed the new rules.

    Moral of the story: When you broadcast a message, make sure it's one that every receiving window will be able to handle.

  • The Old New Thing

    Dead man running


    The plight of the legally dead (but physically alive) in India has been taken up by - of course - a legally dead man. And now he's running for public office. Though apparently this isn't the first time.

    (People are usually declared dead by conniving relatives who want to claim their inheritance prematurely.)

    I wish him luck. If it works in Missouri it can work in India.

  • The Old New Thing

    Is open source the new monoculture?


    Okay I know I'm going to get into a lot of trouble for even bringing up this topic...

    This past weekend, Ulf Harnhammar discovered two buffer overflow and two directory traversal vulnerabilities in LHA, a library of data compression functions.

    Since the code for this is public, it has been copied all over the place. At least one commercial archive management program and at least one commercial mail antivirus program are vulnerable. A denial of service attack is already under way against the mail antivirus program; all you have to do is attach a malformed LHA file to a message, causing the scanner to crash when it attempts to scan the attachment. When the administrator restarts the mail server, the scanner will resume where it left off... and crash again. (Somebody with more time on their hands could craft a more clever LHA file attack that takes over the mail server itself.)

    The fact that the code itself was public meant that everybody didn't have to write their own LHA functions. This is a good thing. However, it also means that everybody has the same security vulnerabilities. This is a bad thing.

    So we have one bug that can take down large numbers of machines, even though they're all running different software.

    How do you track all the versions? Is there a solution to this? Is it even a problem?

  • The Old New Thing

    Truckers block highway to protest high gas prices


    To protest rising gasoline prices, a group of truckers abandoned their vehicles in the middle of the highway. It struck me as odd that a country that brims with anti-French rhetoric would adopt one of their protest techniques.

    Presumably they don't want French gasoline prices either.

  • The Old New Thing

    Why does my hard drive light flash every few second?


    Back in Windows 95, people would notice that their hard drive light would blink every few seconds. What's that all about?

    Actually, it wasn't the hard drive light after all.

    Windows 95 was polling your CD-ROM drive to see whether you had inserted a new CD. Some computers wired up the "hard drive light" not to the hard drive but rather to the SCSI and/or IDE bus. So the light didn't indicate hard drive activity necessarily. It turned on for any bus activity.

    Fortunately, motherboard manufacturers discovered their mistake and nowadays you don't find any of them that miswire the hard drive access light.

    Or do you? I keep my computer under my desk so I never see the hard drive light anyway. I'm just surmising that in the past seven years, motherboard manufacturers have gotten their act together.

  • The Old New Thing

    Today is Swedish tax day


    Of course, in Sweden, every day is tax day.

    By now, it's too late to fill out your tax form, which the Swedish tax agency permits you to file on paper, via Internet, over the phone, or even via SMS.

    They even have what I wish the US tax agency had: An online tax form calculator.

  • The Old New Thing

    You wanted Extreme Crochet?


    Keith Moore thought I was writing about Extreme Crochet in my previous post about Extreme Croquet.

    No, Keith, if I had wanted to write about Extreme Crochet, I would have used this link.

Page 5 of 5 (47 items) 12345