Showing tag results for History

Jan 9, 2004
Post comments count0
Post likes count1

Why do member functions need to be "static" to be used as a callback?

Raymond Chen
Raymond Chen

As we learned yesterday, nonstatic member functions take a secret "this" parameter, which makes them incompatible with the function signature required by Win32 callbacks. Fortunately, nearly all callbacks provide some way of providing context. You can shove the "this" pointer into the context so you can reconstruct the source object. Here's an ex...

History
Jan 8, 2004
Post comments count0
Post likes count4

The history of calling conventions, part 3

Raymond Chen
Raymond Chen

Okay, here we go: The 32-bit x86 calling conventions. (By the way, in case people didn't get it: I'm only talking in the context of calling conventions you're likely to encounter when doing Windows programming or which are used by Microsoft compilers. I do not intend to cover calling conventions for other operating systems or that are specific to a...

History
Jan 7, 2004
Post comments count0
Post likes count2

The history of calling conventions, part 2

Raymond Chen
Raymond Chen

Foreshadowing: This information will actually be useful in a future discussion. Well, not the fine details, but you may notice something that explains... um... it's hard to describe. Just wait for it. Curiously, it is only the 8086 and x86 platforms that have multiple calling conventions. All the others have only one! Now we're going deep into t...

History
Jan 2, 2004
Post comments count0
Post likes count3

The history of calling conventions, part 1

Raymond Chen
Raymond Chen

The great thing about calling conventions on the x86 platform is that there are so many to choose from! In the 16-bit world, part of the calling convention was fixed by the instruction set: The BP register defaults to the SS selector, whereas the other registers default to the DS selector. So the BP register was necessarily the register used for a...

History
Dec 24, 2003
Post comments count0
Post likes count1

Why not just block the apps that rely on undocumented behavior?

Raymond Chen
Raymond Chen

Because every app that gets blocked is another reason for people not to upgrade to the next version of Windows. Look at all these programs that would have stopped working when you upgraded from Windows 3.0 to Windows 3.1. Actually, this list is only partial. Many times, the compatibility fix is made inside the core component for all programs rath...

History
Dec 23, 2003
Post comments count0
Post likes count0

When programs grovel into undocumented structures…

Raymond Chen
Raymond Chen

Three examples off the top of my head of the consequences of grovelling into and relying on undocumented structures. Defragmenting things that can't be defragmented In Windows 2000, there are several categories of things that cannot be defragmented. Directories, exclusively-opened files, the MFT, the pagefile... That didn't stop a certain software...

History
Dec 19, 2003
Post comments count0
Post likes count0

Sometimes, an app just wants to crash

Raymond Chen
Raymond Chen

I think it was Internet Explorer 5.0, when we discovered that a thirdparty browser extension had a serious bug, the details of which aren't important. The point was that this bug was so vicious, it crashed IE pretty frequently. Not good. To protect the users from this horrible fate, we marked the object as "bad" so IE wouldn't load it. And then we...

History
Dec 16, 2003
Post comments count0
Post likes count0

The unsafe device removal dialog

Raymond Chen
Raymond Chen

In a comment, somebody asked what the deal was with the unsafe device removal dialog in Windows 2000 and why it's gone in Windows XP. I wasn't involved with that dialog, but here's what I remember: The device was indeed removed unsafely. If it was a USB storage device, for example, there may have been unflushed I/O buffers. If it were a printer, t...

History
Dec 12, 2003
Post comments count0
Post likes count0

Why are structure sizes checked strictly?

Raymond Chen
Raymond Chen

You may have noticed that Windows as a general rule checks structure sizes strictly. For example, consider the MENUITEMINFO structure: Notice that the size of this structure changes depending on whether WINVER >= 0x0500 (i.e., whether you are targetting Windows 2000 or higher). If you take the Windows 2000 version of this structure and pass ...

History