Tuesday, January 15, 2008

The registry

Just finished reading the comments in my 'Big changes' post; there are some interesting comments about the registry in there.

Could the registry be replaced? Sure, in software, pretty much any change is possible.
In practice though...If you were to replace the registry, you would end up with something that pretty much looks exactly like the registry.

Go take a look at all the programs on your hard disk that use the registry APIs in [consults wikipedia] in advapi32.dll. (There is a way to dump the APIs that a binary uses with link.exe; wish I could remember the command right now.)

Pretty much every executable file uses the registry, and expects keys to be in certain places in the registry. The APIs for getting/setting stuff in the registry are not going to go away for the next 10 years.

What about making a brand new son-of-registry, with new APIs, that new apps will use?
This will fix a bunch of problems (because you would be able to sidestep the mistakes you made while designing the current registry; add more metadata to keys to not roam, etc)

...but it would be decades before application developers will use it. (Because nobody is going to target their apps to Windows 7 only; they would wait before Windows 7 was the oldest OS out there before relying on that API. A lot of our external application developers only use APIs that have been in since Windows 2000. Sigh.)

I don't think...

...I've ever been this insulted.

Take a look at the 'marketing' coming out of the Microsoft marketing guys in the past couple of years. Not the brightest bulbs in the box.

Saturday, January 12, 2008

Big changes

In almost every Windows OS release so far, we've changed something major in the OS subsystems, to improve the Windows infrastructure. And that generally screws up application or driver compatibility:

Windows 95
Long file names - Application developers had to fix their applications to support long file names. (A good thing, though: What is in 1NTINPRS.AVI?)

Windows NT
Driver developers had to write drivers for a new driver framework because of the hardware abstraction layer. Actually, most of them just stayed away, and supported Win9x only.

Windows 2000
A major annoyance for driver developers, who could ignore the NT driver models up to this point. Win2k ran on NTFS, and had locked-down permissions - developers couldn't install their application's files in \windows\system anymore.

We were telling corporations to set up their users as non-admins on their machines, and for the first time, corporate users in were logging in without admin rights, breaking all sorts of enterprise apps.

Consumers just sailed past, on to:

Windows XP
Installed on NTFS on default - breaking lots of applications that were used to the wide-open, unsecured world of FAT32.
We were telling the dads (or moms) of the world to run as administrator, and set up non-administrator accounts for everybody else in the household. Pretty much nobody did that - they all just logged on as Administrator. A situation that almost every bit of spyware exploited.

Which brings us to the OS everybody loves to hate (that isn't actually that bad) - the fustercluck known as:

Windows Vista
This time round, punch-drunk from all our security issues, the Windows team said: Fuck it, let's just lock it all down:

AUC: All your applications will run as non-administrator, even if you have an administrator account. No excuses. We've been telling you that you should do this since 1999.

A new graphics driver infrastructure: We had to protect the system from video driver crashes, as graphics card companies care only about performance, not stability.

Session 0 Isolation: No system service can directly create a UI. Lots of drivers and antivirus apps broke, but we fixed up a major security design flaw in Windows.

At this point, I can't think of any subsystem in Windows that needs a major change. *

Of course, with every new Windows release, subsystems are tuned up and cleaned up, but as far as I can see, it does not seem like there is a major bit of architecture that we need to change radically (as far as you application and driver developers are concerned). 

And that would be a good thing - your applications and drivers should then hopefully just keep on working in Windows 7. (And it does seem that we got bit in the ass a bit too hard with all the Vista appcompat issues.)

*as far as I can see. Who knows, a SuperUAC might be in the works. They might remove all security feature from the OS. They might make the UAC prompt pop up every five minutes. They might require driver writers to rewrite their drivers in Cobol.

In this Slashdot post...

...about Firefox in large corporations:

Only this comment is worth reading.

I used to read Slashdot every day. Now it is more like once a year.

iPhone and Exchange and Microsoft

This is interesting - Apple is hiring people to work on Exchange support in iPhone...

This will, obviously, make the iPhone much more palatable to your corporate IT department...

(This is interesting, because it probably means that Apple has been listening to their corporate customers, for once. It this keeps up, Windows is screwed.)

...but keep in mind that your IT department now has their grubby fingers on your iPhone. From what I've heard, most corporations won't allow employees to sync their phones with Exchange servers unless they support the Exchange 'remote wipe' protocol - If your phone gets stolen (or you left it in a cab after an evening of deal-making and sake) your IT department can wipe it remotely. Yikes!

I don't trust my IT department with that kind of power. But I can understand the corporate security dilemma.

The other interesting thing about Exchange on iPhone is that is validates my opinion that Microsoft employees have been living in a fog for a while:

Every Windows Smartphone owner I know, outside the company, hates their phone - they got lured into buying one on the appealing prospect of having their phone be their digital butler - It sounds great to have a device that wakes you up in the morning, reminds you of meetings, gets your email from anywhere, and allows you to browse the web from the back of the cab (Googling Sake+Strippers+Manhatten)

Instead, what they got it a phone from a shitty also-ran cellphone manufacturer, with a generic Windows OS, tied to a cell company that nickel and dimes them to death. With a alarm clock that works half the time. With an email setup process that is horrendously difficult. With a web browser that is close to useless.

Every Windows Smartphone owner I know, inside the company, loves their phone - because the average Microsoft employee loves to dink around with something until it mostly works.

The alarm clock problem? Jonny Q. MSEmployee researches the problem, downloads the new firmware or Beta Windows Mobile OS off company servers, and great! the problem is fixed.

The email setup problem? Jonny Q. MSEmployee loves tinkering and investigating until he figures out how to get it to work.

The crappy web browser problem? Jonny Q. MSEmployee updates the OS, gets a new browser off the internet, etc, etc.

Jonny doesn't mind all this effort (it's fun! look how much better my Windows Smartphone is now!) but the average consumer? Not so much.

This disconnect has a lot of Microsoft employees thinking that their Smartphones are actually good, and a viable competitor to the iPhone. They are not.

Friday, January 11, 2008

Another one?

We're building yet another UI platform?

According to istartedsomething.com, we have:

  • Windows Presentation Foundation (WPF) - A managed UI platform. Bloated, slow. We spent a bunch of time in 2006 trying to reduce the working set and startup time.
  • Silverlight - A rewrite of WPF in unmanaged code; small, fast, excellently written. But probably too little, too late to make WPF and XAML relevant to the internet.
  • Windows Forms - A workhorse: a bunch of enterprise apps run on this .Net 1.0 and 2.0 technology.
  • Win32 - The oldest one. Ancient technology. And no developer wants to work with this.
  • Media Center Markup Language - Written by the MC team; flashy. But it doesn't do a lot - just enough to draw the MC UI. You can't use it as a UI platform for all of Windows.
We actually have another one - DirectUI - an internal-only UI platform that is used in XP and Vista to draw control panels, and bits and pieces of the Windows Shell. It was a pre-XAML version of XAML. As far as I know Windows 7 will still have it.

This means that we have 6 teams that work on the same thing - a bit of code that draws the user interface for applications on the screen.

If we were a sane company, we would have the following (from oldest to newest):

Win32 (the oldest one)
Windows Forms (the replacement, to make programming UI better)
(A flashy and fast) unmanaged WPF for Silverlight and Media Center

Wednesday, January 9, 2008

Want your Windows Vista bug fixed?



Do you hit the same annoying Windows Vista crashing bug day after day?

Please, please, please click the 'Send information' button when you see this crash dialog.

Why?

If in the very unlikely event that you are the first person to encounter and report this bug, a new entry in our bug database is entered automatically.

If anybody else encounters the same bug, and reports it, our automated crash reporting system finds the correct bug in our database, and then updates a counter. (Basically, there is a field in the bug that indicates that X people on the internet have encountered this bug.)

If you don't report the crash, that counter is not updated.

Why is that important?

Our ship room (a bunch of guys who decide which bugs should get fixed and added to SP1, and which bugs are too minor to be fixed) rely a lot on this counter. If the counter reaches more than [redacted], we fix it.

So, every time you encounter any crash - hit that 'Send information' button. Please.