The Old New Thing

Practical development throughout the evolution of Windows.

Latest posts

What's the difference between LastWriteTime and ChangeTime in FILE_BASIC_INFO?
Jul 9, 2010
Post comments count 0
Post likes count 0

What's the difference between LastWriteTime and ChangeTime in FILE_BASIC_INFO?

Raymond Chen
Raymond Chen

The structure contains a number of fields which record the last time a particular action occurred. Two of the fields seem to describe the same thing. Last­Write­Time The time the file was last written to. Change­Time The time the file was changed. What's the difference between writing to a file and changing it? I'm told that the difference is metadata. The Last­Write­Time covers writes to the file's data stream (which you accomplish via the function). On the other hand, the Change­Time also includes changes to the file metadata, such as changing its file attributes (hidden, read-...

How do I configure a Remote Desktop Connection shortcut to open on a specific monitor?
Jul 8, 2010
Post comments count 0
Post likes count 0

How do I configure a Remote Desktop Connection shortcut to open on a specific monitor?

Raymond Chen
Raymond Chen

A customer wanted to know how to configure a Remote Desktop Connection shortcut so that the session appears on the monitor of choice. "I have two RDP shortcuts, and each one displays on a different monitor, but I want them all to display on my 20-inch monitor. How do I tell the bad shortcut, 'Hey, use that monitor over there please'?" Normal shell shortcuts (LNK files) do not encode monitor information. It is up to the application to decide where to display its windows. Many applications save the window position when you exit and restore it when you restart. If you have one of these types of programs, then the ...

Crackpots in computer security: The neighbors are looking at me weird
Jul 7, 2010
Post comments count 0
Post likes count 0

Crackpots in computer security: The neighbors are looking at me weird

Raymond Chen
Raymond Chen

The security team gets all sorts of email to report security issues. Nearly 200,000 each year. And of course the reports vary in quality greatly. The ones I'm fascinated by are the crackpots. IMMEDIATE HELP NEEDED, PHONES  PHONE NUMBERS DELETED, EM XXXXXXXX@ GMAIL,HOTMAIL,LIVE,AOL.YAHOO. IM ALMOST POSITIVE HE IS USING BLUETOOTH.  BUT HE CAN INTRUDE AT WILL. HE COULD  BE VERY DANGEROUS. LAST FRIDAY YOUR DEPT HAS GPS SEARCHING, BUT THE HACKER CUT US OFF. THEN TRASHED 4 OF MY PCS.PLEASE ON CONTACT ME IMMEDEDIATLY, LOOK IN THE RECORDS.  HE MAY BE IN MY AREA, THE NEIGHB ORS ARE LOOKING AT ME WE...

Hardware backward compatibility: The firmware that missed one tiny detail
Jul 6, 2010
Post comments count 0
Post likes count 0

Hardware backward compatibility: The firmware that missed one tiny detail

Raymond Chen
Raymond Chen

The person responsible for the floppy disk driver in Windows 95 also was responsible for the low-level CD-ROM drivers. (Not to be confused with the CDFS file system, which was handled by the file system team, not the hardware driver folks.) And I remember a story about one particularly strange CD-ROM drive. This drive was produced by a name-brand manufacturer. The box that the drive comes in proudly announces that it is an IDE ATAPI drive. And they did a fantastic job. They implemented all the ATAPI commands that were defined at the time, with one tiny exception. They forgot to implement the "Are you an AT...

One small silver lining of moving Boeing headquarters to Chicago
Jul 5, 2010
Post comments count 0
Post likes count 0

One small silver lining of moving Boeing headquarters to Chicago

Raymond Chen
Raymond Chen

In 2001, Boeing moved their corporate headquarters from Seattle to Chicago. This resulted in much wailing and consternation in Seattle, where Boeing had been since its founding in 1915. But every cloud has a silver lining. Seattle is the home of Boeing's passenger jet division, and the presence of corporate executives had added an extra layer of management annoyance to the already-stressful job of building airplanes. As the story goes, one of the Corporate Vice Presidents from some other division of Boeing had an office that overlooked Boeing Field, giving him a vantage point from which to watch each airplane t...

The commutative law for postage and its limitations
Jul 2, 2010
Post comments count 0
Post likes count 0

The commutative law for postage and its limitations

Raymond Chen
Raymond Chen

The college professor who carried on a letter exchange with a kind pensioner who proved that the speed of light could be exceeded told me of another letter exchange, this time with another professional mathematician. The letter came from England, and it accompanied some sort of document or artifact that the correspondent wanted the college professor to look over and return. The mathematician took the effort of including a stamped return envelope with the remark, "By the commutative law for postage, I have placed the same amount of postage on the return envelope as I have on the outgoing envelope." The profess...

Instead of trying to figure out what shortcut class to use, just ask the shell to do it for you
Jul 2, 2010
Post comments count 0
Post likes count 0

Instead of trying to figure out what shortcut class to use, just ask the shell to do it for you

Raymond Chen
Raymond Chen

If a shell namespace item has the attribute, then it is a shortcut to another location. The most common type of shortcut is the file, which you can load by creating the object and using , but what if you have some other type of shortcut? How do you know what CLSID to use? Since anybody can create their own shortcut file types, a hard-coded list mapping file extensions to CLSIDs is not going to work for long. But fortunately, you don't have to know how to look up the CLSID for a particular shortcut; you can just ask the namespace to do it for you by asking for the UI object. I've limited myself to files ...

What Raymond listens to: KCRW's The Business
Jul 1, 2010
Post comments count 0
Post likes count 0

What Raymond listens to: KCRW's The Business

Raymond Chen
Raymond Chen

KCRW's The Business reveals how the sausage of the entertainment industry is made. Here are some of my favorites:

What is the lpClass member of SHELLEXECUTEINFO used for?
Jul 1, 2010
Post comments count 0
Post likes count 0

What is the lpClass member of SHELLEXECUTEINFO used for?

Raymond Chen
Raymond Chen

A customer reported problems launching the default Web browser with the function: This fails with . If you don't pass the flag and leave , then the function will try to figure out what your refers to, looking at the file extension, looking for the file on the , and if all else fails, trying some autocorrection. In this case, the customer was relying on the autocorrection, since they left the prefix off their URL. One of the default autocorrection rules is that if the item that couldn't be launched begins with , then try again with in front. On the other hand, if you pass an explicit , then no name ...