The Old New Thing

Applications and DLLs don't have privileges; users do

I can't believe you people are actually asking for backdoors. If an end user can do it, then so can a bad guy. In response to the requirement that all drivers on 64-bit Windows be signed, one commenter suggested adding a backdoor that permits unsigned drivers, using some "obscure registry key". Before somebody can jump up and shouts "...

Why can't I see all of the 4GB of RAM in my machine?

Here's a question that came from a customer: I have set my boot options to /3GB /NOPAE. Even though the server has 4GB of physical memory, we see only 3.5GB of physical memory on the server after it boots up. However, when we change the boot options to /PAE, we can observe 4GB of memory. Furthermore, when I enable only /PAE, even though the ...

Candidate for most obscure keyboard shortcut: Shift+F8

One of the most obscure keyboard shortcuts has got to be Shift+F8, which is used for listbox discontiguous extended selection. Man, what a mouthful. KB article Q301583 doesn't help matters by listing this keyboard shortcut under "Dialog box keyboard shortcuts" even though it isn't a dialog box keyboard shortcut. It's a listbox keyboard ...

Even more about C# anonymous methods, from the source

If you want to know still more about C# anonymous methods, you can check out the web site of Grant Richins who has an entire category devoted to anonymous methods, and he should know, since he actually implemented them. Now that CLR week is over, I'm curious what you all thought of it. Would you like to see another CLR week at some point...

Just because I don't write about .NET doesn't mean that I don't like it

Some people have inferred that I don't write about .NET because I don't like it. That's not true. I use it myself. The reason I don't write about .NET is because I'm not an expert on it and there are plenty of other .NET blogs out there, written by people who are actual experts. (Such as Maoni Stephens, whose little finger contains more ...

The efficiency of ordinal-based imports while still being name-based

Reader Tom brought up the interesting point that ordinal-based imports are slightly faster than name-based, though not by much. But if even that tiny fraction of a percentage bothers you, you can still get the benefits of ordinal-based imports while still being name-based. People are more familiar with the first half of the "rebase and bind...

Names in the import library are decorated for a reason

When I wrote that the symbolic name for the imported function table entry for a function is called , the statement was "true enough" for the discussion at hand, but the reality is messier, and the reason for the messy reality is function name decoration. When a naive compiler generates a reference to a function, the reference is decorated in...

What happens when you get dllimport wrong?

Now that we've learned what the declaration specifier does, what if you get it wrong? If you forget to declare a function as , then you're basically making the compiler act like a naive compiler that doesn't understand . When the linker goes to resolve the external reference for the function, it will use the stub from the import library, and...