Showing results for May 2011 - Page 2 of 3 - The Old New Thing

May 18, 2011
Post comments count0
Post likes count0

Watching the battle between Facebook and Facebook spammers

Raymond Chen
Raymond Chen

I am watching the continuing battle between Facebook and Facebook spammers with detached amusement. When I see a spam link posted to a friend's Facebook wall, I like to go and figure out how they got fooled. Internet Explorer's InPrivate Browsing comes in handy here, because I can switch to InPrivate mode before visiting the site, so that the site ...

Other
May 18, 2011
Post comments count0
Post likes count0

How long do taskbar notification balloons appear on the screen?

Raymond Chen
Raymond Chen

We saw some time ago that taskbar notification balloons don't penalize you for being away from the computer. But how long does the balloon stay up when the user is there? Originally, the balloon appeared for whatever amount of time the application specified in the member of the structure, subject to a system-imposed minimum of 10 seconds and ...

History
May 17, 2011
Post comments count0
Post likes count0

Why does Explorer show a thumbnail for my image that's different from the image?

Raymond Chen
Raymond Chen

A customer (via a customer liaison) reported that Explorer somestimes showed a thumbnail for an image file that didn't exactly match the image itself. I have an image that consists of a collage of other images. When I switch Explorer to Extra Large Icons mode, the thumbnail is a miniature representation of the image file. But in Large Icons and M...

Tips/Support
May 16, 2011
Post comments count0
Post likes count0

Multithreaded UI code may be just as hard as multithreaded non-UI code, but the consequences are different

Raymond Chen
Raymond Chen

Commenter Tim Smith claims that the problems with multithreaded UI code are not significantly more than plain multithreaded code. While that may be true on a theoretical level, the situations are quite different in practice. Regardless of whether your multithreaded code does UI or not, you have to deal with race conditions, synchronization, cache...

Code
May 13, 2011
Post comments count0
Post likes count0

If undecorated names are given in the DLL export table, why does link /dump /exports show me decorated names?

Raymond Chen
Raymond Chen

If you run the command on a DLL which exports only undecorated names, you may find that in addition to showing those undecorated names, it also shows the fully-decorated names. We're building a DLL and for some functions, we have chosen to suppress the names from the export table by using the NONAME keyword. When we dump the exports, we still ...

Other
May 12, 2011
Post comments count0
Post likes count0

Looking at the world through kernel-colored glasses

Raymond Chen
Raymond Chen

During a discussion of the proper way of cancelling I/O, the question was raised as to whether it was safe to free the I/O buffer, close the event handle, and free the structure immediately after the call to . The response from the kernel developer was telling. That's fine. We write back to the buffer under a try/except, so if the memory is free...

Code
May 11, 2011
Post comments count0
Post likes count0

Why double-null-terminated strings instead of an array of pointers to strings?

Raymond Chen
Raymond Chen

I mentioned this in passing in my description of the format of double-null-terminated strings, but I think it deserves calling out. Double-null-terminated strings may be difficult to create and modify, but they are very easy to serialize: You just write out the bytes as a blob. This property is very convenient when you have to copy around the lis...

Code
May 10, 2011
Post comments count0
Post likes count0

Why is hybrid sleep off by default on laptops? (and how do I turn it on?)

Raymond Chen
Raymond Chen

Hybrid sleep is a type of sleep state that combines sleep and hibernate. When you put the computer into a hybrid sleep state, it writes out all its RAM to the hard drive (just like a hibernate), and then goes into a low power state that keeps RAM refreshed (just like a sleep). The idea is that you can resume the computer quickly from sleep, but if...

HistoryTips/Support
May 9, 2011
Post comments count0
Post likes count0

Sorting is a state and a verb (and a floor wax and a dessert topping)

Raymond Chen
Raymond Chen

Cliff Barbier points out that after you sort an Explorer view by name, new items are not inserted in their sorted position. This goes back to the question of whether sorting is a state or a verb. If you take an Explorer folder and say Sort by Name, do you mean "From now on, always show the contents of this folder sorted by name"? Or do you mean...

Other
May 6, 2011
Post comments count0
Post likes count0

A function pointer cast is a bug waiting to happen

Raymond Chen
Raymond Chen

A customer reported an application compatibility bug in Windows. We have some code that manages a Win32 button control. During button creation, we subclass the window by calling . On the previous version of Windows, the subclass procedure receives the following messages, in order: We do not handle any of these messages and pass them thro...

Code