1992 meet 2009. 2009 say hello to 1992

August 25, 2009 at 11:51 PMJoshua Harley

I can still remember when I got my first computer. It was a Leading Edge computer running an Intel 8086 with a whopping 512 KB of RAM and an internal hard drive of 10MB! Now that was a kicking system! I quickly learned that HIMEM.SYS and EMM386.EXE only worked with Extended Memory (XMS) and Expanded Memory (EMS).

I quickly learned what things broke the system and which things don’t. format c: /y? Bad! Deletes the drive data! command.com? It’s ok, though it nests a shell.

Well, after installing the latest Windows 7, I started to feel a little nostalgic. I kind of miss those days, back where the operating system didn’t take care of you and you actually had to have an idea of what you were doing.

It got the better of me, so I managed to get Windows 3.11 online and running inside of Windows 7. They got to say hello over the network! It’s amazing that technology from 1992 can still operate in today’s world!

Without further ado, say hello again to Windows for Workgroups 3.11!

Windows for Workgroups 3.11

Posted in: Windows 7

Tags: ,

Explorer still limited by MAX_PATH

August 23, 2009 at 1:41 AMJoshua Harley

With the upcoming release of Windows 7 by Microsoft I am still surprised at a limitation of Explorer that has been around since explorer was first introduced with Windows 95. When Microsoft first introduced Windows 95 they included long filename support. This long filename support allowed Windows to store a filename of “up to 255 characters” while still maintaining compatibility with DOS and previous versions of Windows.

Remember filenames like LETTER~1.DOC and directories like PROGRA~1? Well, believe it or not they still exist by default in Windows 7! You can confirm this yourself by opening a command prompt and running the dir /x command. This will display files in the current directory with both their long filenames and DOS compatible filenames. Of course you can turn this filename generation off by setting the appropriate registry keys.

Back with Windows 95 the Windows API generally provided only ANSI functions. ANSI strings were either single-byte or a variable-width multi-byte arrays. When Windows NT came along with its new kernel, all of the internal strings were represented in Unicode (double-width) character arrays.

The string "HELLO" in ANSI:
Byte: 1 2 3 4 5 6
Data: H E L L O \0
The string "HELLO" in Unicode:
Byte: 1 2 3 4 5 6 7 8 9 10 11 12
Data: H \0 E \0 L \0 L \0 O \0 \0 \0

Along with the Unicode kernel, Windows NT also included updated APIs that used the new Unicode strings. So for every CreateFileA you now had a CreateFileW. To maintain backwards compatibility the original CreateFileA still had the limitation on the length of the path that Windows 95 did. Otherwise known by the macro of MAX_PATH which is defined as 260. Since CreateFileW was a new function, there was no backwards compatibility to maintain, so Microsoft provided a way to provide a path up to 32,676 characters. You can read more about the maximum path length on MSDN.

The drawback of still providing both APIs is that as applications pick and choose they can run into issues with the length of the path. Microsoft Word uses the CreateFileW function which allows them to create longer filenames than explorer can handle. I was hoping that in Windows 7 Explorer would finally be updated to use the Unicode CreateFile function… since Windows 95 was released over 14 years ago.

Unfortunately I ran into Explorer’s 260 character limitation just the other day. One of the deleted files resulted in a path of 273 characters long and the following dialog popped up:

The folder contains items whose names are too long for the Recycle Bin.