Showing archive results for 2004

Nov 22, 2004
Post comments count0
Post likes count0

When people ask for security holes as features: World-writable files

Raymond Chen

If I had a nickel each time somebody asked for a feature that was a security hole... I'd have a lot of nickels. For example, "I want a file that all users can write to. My program will use it as a common database of goodies." This is a security hole. For a start, there's an obvious denial of service attack by having a user open the file in ...

HistoryWhen people ask for security holes as features
Nov 19, 2004
Post comments count0
Post likes count0

The various ways of sending a message

Raymond Chen

There are several variations on the SendMessage function, but some are special cases of others. The simplest version is SendMessage itself, which sends a message and waits indefinitely for the response. The next level up is SendMessageTimeout which sends a message and waits for the response or until a certain amount of time has elapsed. Send...

Code
Nov 18, 2004
Post comments count0
Post likes count0

Am I sorry or not?

Raymond Chen

One of the consequences of the New Internet World Order is that it is very easy to set up a web site like www.sorryeverybody.com and equally easy to set up a response like www.notsorryeverybody.com. This state of affairs clearly calls out for some sort of competition between the two. At dinner last night, someone suggested that there should be a ...

Nov 18, 2004
Post comments count0
Post likes count0

If a program and a folder have the same name, the shell prefers the program

Raymond Chen

If you have both a folder named, say, and a program named and you type into the Start.Run dialog, you get the program and not the folder. Why is that? Because it is common to have where there is a setup program in the root, as well as a setup folder containing files needed by the setup program. Before Windows 95, you couldn't open...

History
Nov 17, 2004
Post comments count0
Post likes count0

Poking at diploma mills: Kennedy-Western University

Raymond Chen

I enjoy poking around diploma mills. Especially the ones that spam my inbox. Like Kennedy-Western University, which describes itself like so: Since 1984 Kennedy-Western University (KWU) has provided distance and online degree programs to over 30,000 students. KWU is one of the largest non-accredited online universities in the United States. ... ...

Non-Computer
Nov 17, 2004
Post comments count0
Post likes count0

How do I break an integer into its component bytes?

Raymond Chen

Warning: .NET content ahead. For some reason, this gets asked a lot. To break an integer into its component bytes, you can use the BitConverter.GetBytes method: int i = 123456; byte[] bytes = BitConverter.GetBytes(i); After this code fragment, the byte array contains { 0x40, 0xE2, 0x01, 0x00 }. Update 11am: The endian-ness of th...

Code
Nov 16, 2004
Post comments count0
Post likes count0

Exploiting the inattentive

Raymond Chen

The makers of a certain major brand of detergent which I will not name (but which for the purposes of this discussion will be called "Snide") appears to take every step to exploit inattentive customers. A box of Snide detergent powder comes with instructions indicating that for a normal-sized load, you should use 3/8 cup of detergent; for a large...

Non-ComputerExploiting the inattentive
Nov 16, 2004
Post comments count0
Post likes count0

What is this Xerox directory doing in Program Files?

Raymond Chen

If you go snooping around, you may find an empty directory. What's that for? This directory is being watched by Windows File Protection, because it needs to protect the file should it ever show up. (Why does the directory have to exist in order for Windows File Protection to be able to watch it? I'm told it's a limitation of the Windows File Pr...

Tips/Support
Nov 15, 2004
Post comments count0
Post likes count0

Asking questions where the answer is unreliable anyway

Raymond Chen

Here are some questions and then explanations why you can't do anything meaningful with the answer anyway even if you could get an answer in the first place. "How can I find out how many outstanding references there are to a shared memory object?" Even if there were a way to find out, the answer you get would be instantly wrong anyway because th...

Other
Nov 12, 2004
Post comments count0
Post likes count0

Will dragging a file result in a move or a copy?

Raymond Chen

Some people are confused by the seemingly random behavior when you drag a file. Do you get a move or a copy? And you're right to be confused because it's not obvious until you learn the secret. Mind you, this secret hasn't changed since 1989, but an old secret is still a secret just the same. (Worse: An old secret is a compatibility constraint.)...

Tips/Support