Showing results for June 2012 - The Old New Thing

Jun 29, 2012
0
0

2012 mid-year link clearance

Raymond Chen
Raymond Chen

Another round of the semi-annual link clearance. And, as always, the obligatory plug for my column in TechNet Magazine...

Other
Jun 29, 2012
0
0

How did real-mode Windows patch up return addresses to discarded code segments?

Raymond Chen
Raymond Chen

Last week, I described how real-mode Windows fixed up jumps to functions that got discarded. But what about return addresses to functions that got discarded? The naïve solution would be to allocate a special "return address recovery" function for each return address you found, but that idea comes with its own problems: You are patching ...

History
Jun 28, 2012
0
0

You still need the "safe" functions even if you check string lengths ahead of time

Raymond Chen
Raymond Chen

Commenter POKE53280,0 claims, "If one validates parameters before using string functions (which quality programmers should do), the 'safe' functions have no reason to exist." Consider the following function: What could possibly go wrong? You check the length of the string, and if it doesn't fit in the buffer, then you reject it. Therefore, ...

Code
Jun 27, 2012
0
0

How did my hard drive turn into a TARDIS?

Raymond Chen
Raymond Chen

A customer observed that the entry for a network drive looked liked this in My Computer, well, except that there was a network drive icon instead of ASCII art. How is it possible for a 2.5GB drive to have 3.81TB free? While there have certainly been examples of Explorer showing confusing values the reason for the strange results was, at least ...

Other
Jun 26, 2012
0
0

Thanks for reminding me what to do when the elevator is out of order

Raymond Chen
Raymond Chen

Every few years, the building maintenance people have to perform tests on the elevators to ensure they meet safety regulations. And the real estate department sends out the usual notice informing the building occupants that the elevators in the building will be taken out of service at various times during the day. They were kind enough to include...

Non-Computer
Jun 25, 2012
0
0

How does Explorer determine the delay between clicking on an item and initiating an edit?

Raymond Chen
Raymond Chen

Ian Boyd wants to know why the specific value of 500ms was chosen as the edit delay in Windows Explorer. Because it's your double-click time. Since the double-click action (execute) is not an extension of the single-click action (edit), Explorer (and more generally, list view) waits for the double-click timeout before entering edit mode so it ...

Tips/Support
Jun 22, 2012
0
1

How did real-mode Windows fix up jumps to functions that got discarded?

Raymond Chen
Raymond Chen

In a discussion of how real-mode Windows walked stacks, commenter Matt wonders about fixing jumps in the rest of the code to the discarded functions. I noted in the original article that "there are multiple parts to the solution" and that stack-walking was just one piece. Today, we'll look at another piece: Inter-segment fixups. Recall that ...

History
Jun 21, 2012
0
0

When the default pushbutton is invoked, the invoke goes to the top-level dialog

Raymond Chen
Raymond Chen

One quirk of nested dialogs lies in what happens when the user presses Enter to invoke the default pushbutton: The resulting message goes to the top-level dialog, even if the default pushbutton belongs to a sub-dialog. Why doesn't it send the to the parent of the default pushbutton? I mean, the dialog manager knows the handle of the button, so...

Code
Jun 20, 2012
0
0

Counting down to the last day of school, as students do it

Raymond Chen
Raymond Chen

Today is the last day of school in Seattle public school. My friend the seventh-grade teacher told me that students count down to the last day of school in a rather unusual way. Some people might count the number of calendar days until the end of school. For example, if there are 35 days between today and the last day of school, we say that it's ...

Non-Computer

Feedback