Showing archive results for 2011

Mar 23, 2011
Post comments count0
Post likes count1

Function requirements are cumulative: If you fail to meet any of them, then all bets are off

Raymond Chen

A customer was having problems with the function: We are looking for a clarification of the behavior of . We have a thread that waits on two handles (call them and ) with , . Under certain conditions, we signal and close from another thread while the wait is in progress. This results in being returned from the wait call. MSDN is not clear o...

Code
Mar 22, 2011
Post comments count0
Post likes count4

Why is there the message '!Do not use this registry key' in the registry?

Raymond Chen

Under , there is a message to registry snoopers: The first value is called "!Do not use this registry key" and the associated data is the message "Use the SH­Get­Folder­Path or SH­Get­Known­Folder­Path function instead." I added that message. The long and sad story of the Shell Folders key explains that the registry k...

History
Mar 21, 2011
Post comments count0
Post likes count1

How does the C runtime know whether to use the static-linking or dynamic-linking version of the header file?

Raymond Chen

In response to a description of what happens when you get wrong, nksingh asks, "This seems like a problem for the CRT. As far as I know, VC gives you the option of statically or dynamically linking the CRT. But it seems like the headers will have to make a choice to support one thing better than the other. Conditional compilation would work, but ...

Other
Mar 18, 2011
Post comments count0
Post likes count1

You can extend the PROPSHEETPAGE structure with your own bonus data

Raymond Chen

... for when regular strength lParam just isn't enough. A little-known and even less-used feature of the shell property sheet is that you can hang custom data off the end of the structure, and the shell will carry it around for you. Mind you, the shell carries it around by means of and destroys it by just freeing the underlying memory, so what...

Code
Mar 17, 2011
Post comments count0
Post likes count1

What does the "l" in lstrcmp stand for?

Raymond Chen

If you ask Michael Kaplan, he'd probably say that it stands for lame. In his article, Michael presents a nice chart of the various L-functions and their sort-of counterparts. There are other L-functions not on his list, not because he missed them, but because they don't have anything to do with characters or encodings. On the other hand, those o...

History
Mar 16, 2011
Post comments count0
Post likes count1

What’s up with the mysterious inc bp in function prologues of 16-bit code?

Raymond Chen

A little while ago, we learned about the EBP chain. The EBP chain in 32-bit code is pretty straightforward because there is only one type of function call. But in 16-bit code there are two types of function calls, the near call and the far call. A near call pushes a 16-bit return address on the stack before branching to the function entry point, ...

History
Mar 15, 2011
Post comments count0
Post likes count0

Raymond's highly scientific predictions for the 2011 NCAA men's basketball tournament

Raymond Chen

Once again, it's time for Raymond to come up with an absurd, arbitrary criterion for filling out his NCAA bracket. This year, I look at the strength of the school's football team, on the theory that a school with a strong football team and a strong basketball team has clearly invested a lot in its athletics program. My ranking of football teams ...

Non-ComputerHighly scientific
Mar 15, 2011
Post comments count0
Post likes count1

Why can't Explorer decide what size a file is?

Raymond Chen

If you open Explorer and highlight a file whose size is a few kilobytes, you can find some file sizes where the Explorer Size column shows a size different from the value shown in the Details pane. What's the deal? Why can't Explorer decide what size a file is? The two displays use different algorithms. The values in the Size column are always gi...

Other
Mar 14, 2011
Post comments count0
Post likes count1

The old DEBUG program can load COM files bigger than 64KB, but that doesn't mean they actually load as a program

Raymond Chen

Some times ago, I described why a corrupted binary sometimes results in the error "Program too big to fit in memory". Commenter Neil was under the impression that nonrelocatable programs files could be larger than 64KB and used the DEBUG command to verify this assertion. While it's true that DEBUG can load files bigger than 64KB, that doesn't me...

History
Mar 11, 2011
Post comments count0
Post likes count1

Why does my TIME_ZONE_INFORMATION have the wrong DST cutover date?

Raymond Chen

Public Service Announcement: Daylight Saving Time begins in most parts of the United States this weekend. Other parts of the world may change on a different day from the United States. A customer reported that they were getting incorrect values from the function. I have a program that calls , and it looks like it's returning incorrect DST trans...

CodeTime