Showing results for January 2010 - Page 3 of 4 - The Old New Thing

Jan 11, 2010
0
0

Why aren't compatibility workarounds disabled when a debugger is attached?

Raymond Chen
Raymond Chen

Ken Hagan wonders why compatibility workarounds aren't simply disabled when a debugger is attached. As I noted earlier, many compatibility workarounds are actually quicker than the code that detects whether the workaround would be needed. Now suppose you find a compatibility problem with some applications that expect the function to return ...

Other
Jan 8, 2010
0
0

What is the hSection parameter to CreateDIBSection for?

Raymond Chen
Raymond Chen

The function creates a special type of bitmap known as a DIB section. We've worked with these guys before: The feature of DIB sections that is by far the most interesting is that the raw pixels in the bitmap are mapped into your process space as if they were normal memory, which you can read from and write to directly. But what is the deal with...

Code
Jan 7, 2010
0
0

Learning how to cheat at Candy Land

Raymond Chen
Raymond Chen

My young niece received the game Candy Land and wants to play it several times a day. Naturally, I am frequently drafted as an opponent. I discovered that my niece cheats rampantly. Sometimes, she will advance three green squares instead of two. Or if a yellow card will take her to a licorice square (lose a turn), she will ignore it and go to the...

Non-Computer
Jan 7, 2010
0
0

How to change the debugger attached to a process

Raymond Chen
Raymond Chen

Suppose your application crashes and debugger X is automatically connected because that's how the system happened to be configured. But you would prefer to use debugger Y. After installing debugger Y, how do you switch the debugger from X to Y? If you try to connect debugger Y to the process, you get the error code , b...

Other
Jan 6, 2010
0
0

The wisdom of seventh graders: Success

Raymond Chen
Raymond Chen

Seventh grade students (ages 12 to 13, roughly) were asked to write an essay on what success is and how you know when you've achieved it. The assignment was given under standardized test conditions: 90 minutes with nothing but pencil and paper, with an additional hour available upon request. (In practice, few students ask for the extra hour.) Rem...

Non-Computer
Jan 6, 2010
0
0

Can you get rotating an array to run faster than O(n²)?

Raymond Chen
Raymond Chen

Some follow-up remarks to my old posting on rotating a two-dimensional array: Some people noticed that the article I linked to purporting to rotate the array actually transposes it. I was wondering how many people would pick up on that. I was surprised that people confused rotating an array (or matrix) with creating a rotation matrix. They ar...

Other
Jan 5, 2010
0
0

Thanks for coming together to enjoy the holiday together, now get off my lawn

Raymond Chen
Raymond Chen

Due to a confluence of circumstances involving parents on an overseas vacation and other older relatives choosing not to attend (probably related to parents being out of town), I ended up being the oldest person at the extended family holiday dinner table. This was a first for me, and I resisted the urge to shout "Get off my lawn!" to the assemble...

Non-Computer
Jan 5, 2010
0
0

Microspeak: Engagement

Raymond Chen
Raymond Chen

Meetings are so passé. You no longer have a meeting with a customer; you have an engagement: I have a customer engagement tomorrow and they have a question surrounding Feature X. Note that this use of the phrase customer engagement is different from the process known as customer engagement. The process is an ongoing interaction, a lo...

Other
Jan 4, 2010
0
0

How about not granting debug privileges to users?

Raymond Chen
Raymond Chen

Commenter Yuhong Bao suggests, "How about not granting debug privileges on the user? This will make bypassing the protection impossible." This is such a great idea that Windows has worked that way for years. Normal non-administrative users do not have debug privilege. They can only debug processes that they already have to. In other words, non-...

Other