Showing results for History - The Old New Thing

Mar 10, 2004
Post comments count0
Post likes count0

Why do operations on "byte" result in "int"?

Raymond Chen
Raymond Chen

(The following discussion applies equally to C/C++/C#, so I'll use C#, since I talk about it so rarely.) People complain that the following code elicits a warning: "The result of an operation on 'byte' should be another 'byte', not an 'int'," they claim. Be careful what you ask for. You might not like it. Suppose we lived in a fantasy world ...

History
Mar 5, 2004
Post comments count0
Post likes count0

Defrauding the WHQL driver certification process

Raymond Chen
Raymond Chen

In a comment to one of my earlier entries, someone mentioned a driver that bluescreened under normal conditions, but once you enabled the Driver Verifier (to try to catch the driver doing whatever bad thing it was doing), the problem went away. Another commenter bemoaned that WHQL certification didn't seem to improve the quality of the dri...

History
Mar 2, 2004
Post comments count0
Post likes count1

Why are HANDLE return values so inconsistent?

Raymond Chen
Raymond Chen

If you look at the various functions that return s, you'll see that some of them return (like ) and some of them return (like ). You have to check the documentation to see what each particular function returns on failure. Why are the return values so inconsistent? The reasons, as you may suspect, are historical. The values were chosen to be c...

History
Mar 1, 2004
Post comments count0
Post likes count2

Why 16-bit DOS and Windows are still with us

Raymond Chen
Raymond Chen

Many people are calling for the abandonment of 16-bit DOS and 16-bit Windows compatibility subsystems. And trust me, when it comes time to pull the plug, I'll be fighting to be the one to throw the lever. (How's that for a mixed metaphor.) But that time is not yet here. You see, folks over in the Setup and Deployment group have gone and visi...

History
Feb 26, 2004
Post comments count0
Post likes count1

Why do timestamps change when I copy files to a floppy?

Raymond Chen
Raymond Chen

Floppy disks use the FAT filesystem, as do DOS-based and Windows 95-based operating systems. On the other hand, Windows NT-based systems (Windows 2000, XP, 2003, ...) tend to use the NTFS filesystem. (Although you can format a drive as FAT on Windows NT-based systems, it is not the default option.) The NTFS and FAT filesystems store times...

HistoryTime
Feb 25, 2004
Post comments count0
Post likes count0

Why can't I put hotlinks in notification icon balloon tips?

Raymond Chen
Raymond Chen

The short answer: "Because there is no NIF_PARSELINKS flag." The long answer: When balloon tips were first developed, there was no ability to embed links. Consequently, programs were free to put insecure text in balloon tips, since there was no risk that they would become "live". So, for example, a virus scanner might say "The document 'XYZ' has...

History
Feb 19, 2004
Post comments count0
Post likes count1

No code is an island

Raymond Chen
Raymond Chen

Norman Diamond noted in a comment that on Windows 2003 Server, the Display Adapter Troubleshooting slider still lists "full acceleration" as the recommended setting even though the default for Server is "full minus one". This is one of those "Oh, that's an easy change" bugs. The discussion probably went like this: Some guy whose idea this was...

History
Feb 18, 2004
Post comments count0
Post likes count1

Why are RECTs endpoint-exclusive?

Raymond Chen
Raymond Chen

Endpoint-exclusive RECTs and lines are much easier to work with. For example, the width of a rectangle is , and its height is . If rectangles were endpoint-inclusive, then there would be annoying +1's everywhere. End-point exclusive rectangles also scale properly. For example, suppose you have two rectangles (0,0)-(100,100) and (100,100)-(200,20...

History
Feb 16, 2004
Post comments count0
Post likes count2

The arms race between programs and users

Raymond Chen
Raymond Chen

There is a constant struggle between people who write programs and the people who actually use them. For example, you often see questions like, "How do I make my program so the user can't kill it?" Now, imagine if there were a way to do this. Ask yourself, "What would the world be like if this were possible?" Well, then there would be some progra...

History
Feb 13, 2004
Post comments count0
Post likes count3

Bad version number checks

Raymond Chen
Raymond Chen

Version numbers. Very important. And so many people check them wrong. This is why Windows 95's GetVersion function returned 3.95 instead of 4.0. A lot of code checked the version number like this: Now consider what happens when the version number is reported as 4.0. The major version check passes, but the minor version check fails since 0 is l...

History