Showing results for November 2004 - Page 3 of 3 - The Old New Thing

Nov 8, 2004
0
0

Ein hundert Dinge, die in den Vereinigten Staaten besser bleiben

Raymond Chen
Raymond Chen

I think it is a trait common to many people that they are fascinated by how their country is viewed by others. The leftist Die Tageszeitung from Germany reacted to the result of the most recent U.S. presidential election with their list of one hundred things that are still better in the United States. Those who cannot read German can use a tra...

Non-Computer
Nov 5, 2004
0
0

A history of GlobalLock, part 2: Selectors

Raymond Chen
Raymond Chen

With the advent of the 80286, Windows could take advantage of that processor's "protected mode". processor. There was still no virtual memory, but you did have memory protection. Global handles turned into "descriptors", more commonly known as "selectors". Architectural note: The 80286 did have support for both a "local descriptor table" and a ...

History
Nov 4, 2004
0
0

A history of GlobalLock, part 1: The early years

Raymond Chen
Raymond Chen

Once upon a time, there was Windows 1.0. This was truly The Before Time. 640K. Segments. Near and far pointers. No virtual memory. Co-operative multitasking. Since there was no virtual memory, swapping had to be done with the co-operation of the application. When there was an attempt to allocate memory (either for code or data) and insuffici...

History
Nov 3, 2004
0
0

Why do I sometimes see redundant casts before casting to LPARAM?

Raymond Chen
Raymond Chen

If you read through old code, you will often find casts that seem redundant. SendMessage(hwndListBox, LB_ADDSTRING, 0, (LPARAM)(LPSTR)"string"); Why was "string" cast to LPSTR? It's already an LPSTR! These are leftovers from 16-bit Windows. Recall that in 16-bit Windows, pointers were near by default. Consequently, "string" was a near pointe...

History
Nov 2, 2004
0
0

And to think they let me get away with it for five years

Raymond Chen
Raymond Chen

According to the Constitution of the State of New Jersey, Article II, paragraph 6: No idiot or insane person shall enjoy the right of suffrage. Why are constitutional articles labelled with Roman numerals? Makes it sound like the Super Bowl or something. The state appellate court did rule a few years ago that being hospitalized...

Non-Computer
Nov 2, 2004
0
0

What was the point of the GMEM_SHARE flag?

Raymond Chen
Raymond Chen

The GlobalAlloc function has a GMEM_SHARE flag. What was it for? In 16-bit Windows, the GMEM_SHARE flag controlled whether the memory should outlive the process that allocated it. By default, all memory allocated by a process was automatically freed when that process exited. Passing the GMEM_SHARE flag suppressed this automatic cleanup. That's...

History
Nov 1, 2004
0
0

What was the difference between LocalAlloc and GlobalAlloc?

Raymond Chen
Raymond Chen

Back in the days of 16-bit Windows, the difference was significant. In 16-bit Windows, memory was accessed through values called "selectors", each of which could address up to 64K. There was a default selector called the "data selector"; operations on so-called "near pointers" were performed relative to the data selector. For example, if you had ...

History