Tuesday, May 19, 2009

Shim Infrastructure for Windows 7

Along with Windows 7, Microsoft has released Microsoft Windows Application Compatibility Infrastructure also called as SHIMS to take care of application compatibility issues.

The Shim Infrastructure implements a form of API hooking. What it means is that it redirects API calls from Windows to Shim itself. Typically call to Windows looks like:
Application --> Import Table --> Windows.

With the Shim Infrastructure, the approach will be:
Application --> Import Table --> Shim --> Windows

Now, some of the interesting facts:
1. The code that runs a shim sits outside the Windows.
2. For Windows, the shim code is just like any application code. Thus you cannot bypass security mechanisms in Windows.
3. All the shims are stored in a shim database.
4. And yes, you cannot create a new shim. You have to get in touch with Microsoft and then Microsoft may release the shims with the HFs or SPs catering to general applications.

Shim is actually really powerful mode to resolve application compatibility issues and get going with Windows 7 deployment.

Cheers,
Amol

Relying on error messages in your application logic

This is a very simple thing but it makes lot of difference for the developers especially the new comers. When we dive deep into our applications/programs to deliver functionality, at times few developers rely on standard error messages thrown by .NET for example. For example, let’s say that you are trying to read a file (which is not present) using .NET base class library. You will get FileNotFound exception. In this case if you have written logic in your application in such a way that if error message is XYZ then do this. This may work with the current version of framework which you are using. However, in future if you install any hot fix or the newer version of .NET framework, the error message may not be the same. The error code may remain same but not the error message.

In simple words, do not rely on standard error messages in your application logic.

Cheers,
Amol

Wednesday, May 13, 2009

Omaha - From Google

Omaha also known as Google Update installs requested software and keep it up to date. So far it supported Google product but now that it is an open-source anybody should be able to leverage it on Windows 2000 (SP4) onwards.

This autoupdating engine is something to look for going forward. More to come…..
http://code.google.com/p/omaha/

Cheers,
Amol