The Old New Thing

Practical development throughout the evolution of Windows.

Latest posts

The mysterious ways of the params keyword in C#
Aug 6, 2013
Post comments count 0
Post likes count 0

The mysterious ways of the params keyword in C#

Raymond Chen
Raymond Chen

If a parameter to a C# method is declared with the keyword, then it can match either itself or a comma-separated list of um itselves(?). Consider: This program prints The first call to does not take advantage of the keyword and passes the array explicitly (formally known as normal form). The second call, however, specifies the integers directly as if they were separate parameters. The compiler generates a call to the function in what the language specification calls expanded form. Normally, there is no conflict between these two styles of calling a function with a parameter because only one form act...

A practical reason for shutting down for the Mayan apocalyse
Aug 5, 2013
Post comments count 0
Post likes count 0

A practical reason for shutting down for the Mayan apocalyse

Raymond Chen
Raymond Chen

I dreamed that Costco announced that they were closing for the Mayan apocalypse and would reopen two weeks later. Not because they believed in it. Rather, because that was their estimate as to how long it would take people to get through their stockpiles and be ready to go shopping again. Curiously, I had this dream several weeks after the apocalypse date had passed.

Why does BitConverter.LittleEndian return false on my x86 machine?
Aug 5, 2013
Post comments count 0
Post likes count 0

Why does BitConverter.LittleEndian return false on my x86 machine?

Raymond Chen
Raymond Chen

Welcome to CLR Week 2013, returned from its two-year hiatus. A customer reported that when they checked with the debugger, reported even though they were running on an x86 machine, which is a little-endian architecture. The bytes are extracted in little-endian order, despite the claim that the machine is big-endian. "I don't get it." I didn't know the answer, but I knew how to use a search engine, and a simple search quickly found this explanation: Reading a member from the debugger merely reads the value of the member from memory. That simple statement hides the answer by saying what happens and l...

It rather involved being on the other side of this airtight hatchway: Open access to the application directory
Aug 2, 2013
Post comments count 0
Post likes count 0

It rather involved being on the other side of this airtight hatchway: Open access to the application directory

Raymond Chen
Raymond Chen

You can't just let anybody into your safety bubble.

The case of the auto-hide taskbar
Aug 1, 2013
Post comments count 0
Post likes count 0

The case of the auto-hide taskbar

Raymond Chen
Raymond Chen

A customer reported that their taskbar would sometimes spontaneously go into auto-hide mode. What made this particularly insidious was that they had deployed a group policy to prevent users from changing the auto-hide state (because they never wanted the taskbar to auto-hide), so when the taskbar went into auto-hide mode, there was no way to get it out of that mode! The customer's first investigation was to find out where the auto-hide state was recorded. A little bit of registry spelunking (because as far as these people are concerned, everything is in the registry) showed that a single bit in the registry v...

Why does Explorer sometimes show my server name in parentheses?
Jul 31, 2013
Post comments count 0
Post likes count 0

Why does Explorer sometimes show my server name in parentheses?

Raymond Chen
Raymond Chen

A customer wanted to know why Explorer showed one of their servers in the folder list the normal way: ⊞ servername but another server showed up "where the server name is parentheses and the node name is in front." ⊞ nodename (servername) "Where is Explorer getting that information, and why are the two servers showing up in different ways?" It's all in the server comment. From the command line, you can view the server comment by typing . For example, You can set the comment with the command line If a server has a comment, then the comment is shown to the user on the expectation tha...

Sometimes people can be so helpless: Finding the owner of a Web page
Jul 30, 2013
Post comments count 0
Post likes count 0

Sometimes people can be so helpless: Finding the owner of a Web page

Raymond Chen
Raymond Chen

Internal to Microsoft are thousands of Web sites. This is a story about one of them. On an internal discussion list, somebody asked We just created a new Flurb. Does anyone know how to get listed on http://internalsite/newflurbs? I hadn't heard of that site before, but I checked it out. Neat, it's basically a blog which announces new Flurbs. I can see how somebody would want their Flurb to be listed there. I also saw lots of pieces of information on the page which the person appears not to have noticed. I replied, Um, how about the Email link in the navigation bar? Or did you try that and it didn't work? ...

I'm sure that Star Trek-themed parties exist, so why has no one ever scheduled one as a Microsoft holiday party?
Jul 29, 2013
Post comments count 0
Post likes count 0

I'm sure that Star Trek-themed parties exist, so why has no one ever scheduled one as a Microsoft holiday party?

Raymond Chen
Raymond Chen

I dreamed that I was attending a Star Trek-themed company party. Nobody was dressed as a Starfleet officer or anything exotic. Half of the people ignored the party theme and came in cocktail attire, and half were dressed in Renaissance or Elizabethan clothes, but they represented Star Trek aliens because they were not all white Europeans, and some of them had funny hair. And because we were told that it was a Star Trek-themed party, and in dreams you don't question this sort of thing. I recognized some of the aliens as staff members from the previous Star Trek-themed party and concluded that most of the aliens w...

A program for my nieces: The ABCs, part 4
Jul 29, 2013
Post comments count 0
Post likes count 0

A program for my nieces: The ABCs, part 4

Raymond Chen
Raymond Chen

Disabling autorepeat in my ABC program was largely sufficient to keep my nieces happy, given their instructions to press only one key at a time. Once in a while, though, they would hit the context menu key in the bottom right corner of the keyboard, and then they'd get stuck because they didn't know how to dismiss it. So let's disable that key outright. Well, that was awfully anticlimactic, wasn't it.