Showing archive results for 2011

Jan 14, 2011
Post comments count0
Post likes count1

What's the difference between an asynchronous PIPE_WAIT pipe and a PIPE_NOWAIT pipe?

Raymond Chen
Raymond Chen

When you operate on named pipes, you have a choice of opening them in mode or mode. When you read from a pipe, the read blocks until data becomes available in the pipe. When you read from a pipe, then the read completes immediately even if there is no data in the pipe. But how is this different from a pipe opened in asynchronous mode by passin...

Code
Jan 13, 2011
Post comments count0
Post likes count1

The MARGINS parameter to the DwmExtendFrameIntoClientArea function controls how far the frame extends into the client area

Raymond Chen
Raymond Chen

A customer wrote a program that calls to extend the frame over the entire client area, but then discovered that this made programming difficult: I have a window which I want to have a glassy border but an opaque body. I made my entire window transparent by calling , and I understand that this means that I am now responsible for managing the alpha...

Code
Jan 12, 2011
Post comments count0
Post likes count1

My, what strange NOPs you have!

Raymond Chen
Raymond Chen

While cleaning up my office, I ran across some old documents which reminded me that there are a lot of weird NOP instructions in Windows 95. Certain early versions of the 80386 processor (manufactured prior to 1987) are known as B1 stepping chips. These early versions of the 80386 had some obscure bugs that affected Windows. For example, if...

History
Jan 11, 2011
Post comments count0
Post likes count1

The message text limit for the Marquee screen saver is 255, even if you bypass the dialog box that prevents you from entering more than 255 characters

Raymond Chen
Raymond Chen

If you find an old Windows XP machine and fire up the configuration dialog for the Marquee screen saver, you'll see that the text field for entering the message won't let you type more than 255 characters. That's because the Marquee screen saver uses a 255-character buffer to hold the message, and the dialog box figure there's no point in lett...

Tips/Support
Jan 10, 2011
Post comments count0
Post likes count1

Why does pasting a string containing an illegal filename character into a rename edit box delete the characters from the clipboard, too?

Raymond Chen
Raymond Chen

Ane asks why, if you have a string with an illegal filename character on the clipboard, and you paste that string into a rename edit box, do the illegal characters get deleted not just from the edit box but also the clipboard? Basically, it's a bug, the result of a poor choice of default in an internal helper class. There is an internal helper c...

History
Jan 7, 2011
Post comments count0
Post likes count1

When does a process ID become available for reuse?

Raymond Chen
Raymond Chen

A customer wanted some information about process IDs: I'm writing some code that depends on process IDs and I'd like to understand better problem of process ID reuse. When can PIDs be reused? Does it happen when the process handle becomes signaled (but before the zombie object is removed from the system) or does it happen only after last handle...

Other
Jan 6, 2011
Post comments count0
Post likes count1

Processes, commit, RAM, threads, and how high can you go?

Raymond Chen
Raymond Chen

Back in 2008, Igor Levicki made a boatload of incorrect assumptions in an attempt to calculate the highest a process ID can go on Windows NT. Let's look at them one at a time. So if you can't create more than 2,028 threads in one process (because of 2GB per process limit) and each process needs at least one thread, that means you are cappe...

Other
Jan 5, 2011
Post comments count0
Post likes count1

Why does SHGetSpecialFolderPath take such a long time before returning a network error?

Raymond Chen
Raymond Chen

A customer reported that their program was failing to start up because the call to was taking a long time and then eventually returning with . The account that was experiencing this problem had a redirected network profile, "but even if he's redirecting, why would we get the bad net path error? Does calling actually touch the folder/network? If s...

Code
Jan 4, 2011
Post comments count0
Post likes count1

From inside the Redmond Reality Distortion Field: Why publish documents in PDF?

Raymond Chen
Raymond Chen

A few years ago, the Windows 7 team developed a document to introduce technology writers to the features of Windows 7. The document was released in PDF format, which created quite a stir among certain people trapped inside the Redmond Reality Distortion Field, who indignantly complained, Why are we releasing this document in PDF format?...

Other
Jan 3, 2011
Post comments count0
Post likes count1

Begin feeling

Raymond Chen
Raymond Chen

A few years ago, the gas station near Microsoft's main campus (the one which had been run by my colleague in a previous stage of his career) appeared to have suffered some problems with the LCD unit on one of its pumps. Instead of "Please insert card", it said "@leace incebd cabd". As a geek, I quickly determined that bit 4 got wiped out in the A...

Other