Showing tag results for Code

Aug 21, 2006
Post comments count0
Post likes count1

Sucking the exception pointers out of a stack trace

Raymond Chen

Often, you find yourself staring at a stack trace for a caught exception and want to see the original exception. (You too can get symbols for operating system binaries, either by using the symbol server to get the symbols on-demand or, if you have a gigabyte of disk space, you can download symbol packages to get them all at one go. Even if yo...

Code
Aug 17, 2006
Post comments count0
Post likes count1

Don't trust the return address, no really

Raymond Chen

In the discussion of how to prevent non-"trusted" DLLs from using private OS resources, more than one person suggested having the or function behave differently depending on who the caller is. But we already saw that you can't trust the return address and that you definitely shouldn't use the return address to make a security decision (which i...

Code
Aug 16, 2006
Post comments count0
Post likes count1

Accessibility is not just for people with disabilities

Raymond Chen

When the topic of accessibility comes up, most people think it's all about people with disabilities. While it's true that people with disabilities were the original target audience for accessibility, more recent developments have highlighted the value of accessible technologies to everyone. For one thing, making your program accessible means that ...

Code
Aug 15, 2006
Post comments count0
Post likes count1

Do not change program semantics in the debug build

Raymond Chen

What you don't want is a problem that goes away when you debug it. It is expected that a program have additional debugging code inside blocks. After all, that's why it's a debug build. But what you definitely don't want to do is have that debugging to fundamentally change the program's behavior. You can perform additional validation. You can ra...

Code
Aug 1, 2006
Post comments count0
Post likes count0

C# nested classes are like C++ nested classes, not Java inner classes

Raymond Chen

When you declare a class inside another class, the inner class still acts like a regular class. The nesting controls access and visibility, but not behavior. In other words, all the rules you learned about regular classes also apply to nested classes. The keyword in an instance methods of a class (nested or not) can be used to access members of...

Code
Jul 10, 2006
Post comments count0
Post likes count0

Before you can learn to recognize what's wrong, you must learn to recognize what's right

Raymond Chen

Sometimes, when I'm debugging a problem, I'll ignore a particular thread and somebody will ask, "What is that thread doing, and how did you know to ignore it?" My reply: "I have no idea what it's doing, but whatever it's doing, it's normal." Tess has been running an excellent series of posts on debugging the CLR, but one of the most important le...

Code
Jul 6, 2006
Post comments count0
Post likes count0

Is the maximum size of the environment 32K or 64K?

Raymond Chen

There appears to be some confusion over whether the maximum size of the environment is 32K or 64K. Which is it? Both. The limit is 32,767 Unicode characters, which equals 65,534 bytes. Call it 32K or 64K as you wish, but make sure you include the units in your statement if it isn't clear from context.

Code