Welcome to MSDN Blogs Sign in | Join | Help

Syndication

Tags

    No tags have been created or used yet.

News

These postings are provided
"AS IS" with no warranties,
and confer no rights.
Synaptics touchpad drivers and Windows Vista

It seems a number of folks have been having problems finding touchpad drivers for Windows Vista. I recently started trying out Vista on a laptop at home which happens to have a Synaptics touchpad. Without the drivers and its enhancement programs, using the touchpad can be problematic. Eventually I found out that the latest Windows 2K/XP version of Synaptics' drivers from http://www.synaptics.com/support/drive.cfm works fine in Vista (at least on builds 5456+). Some of their older versions like the one that came with my laptop doesn't work in Vista but the on their site does, so perhaps they fixed the problems in the latest releases.

The other major touchpad vendor is Alps Electric. Unfortunately I cannot seem to find any publicly available driver downloads on their site. Hopefully their XP drivers also work on Vista. Anyone knows?

P.S. On build 5472 there is a bug in the built-in unzip which might cause problems with zipped downloads. Use a third party unzip tool like WinZip etc.

Posted Monday, July 31, 2006 9:41 PM by shivram | 45 Comments

They're putting Li-Ion batteries in cars! Are they nuts?!

At first I thought it was just the random person ... Now it seems there are lots of folks trying to soup up Hybrid electric cars with Lithium-Ion batteries! Are they nuts?! Li-Ion can be very very unstable and dangerous. Deform or puncture one and you'll have a very quick flash of fire and explosion.

You probably aren't going to throw around and mutilate your laptop so it's okay in there, but putting it in a car is just asking for trouble. Car's mean potential for accidents, which means potential for battery getting deformed, which means a big kabooom. And you can only wonder about adding gasoline to that situation. There is a reason no sane car manufacturer puts Li-Ion batteries in cars. Hybrid cars use NiMH batteries for a reason. So is the case with the more than a century old Lead Acid battery still used in normal cars.

Putting your own life in danger is one thing but driving around with what amounts to essentially a bomb and putting others' life in danger is totally irresponsible and should be against the law. Please do us all a favour and put a big sign saying "Li-Ion powered car" so I can stay far away from such things. Since most of these are being done on existing hybrid cars, I'm going to be wary of driving around one from now on. Especially Toyota Priuses.

Edit: There are safe versions of Li-Ion batteries in development but it doesn't look like its being used in some of these souped up hybrids being reported.

Posted Sunday, July 23, 2006 10:14 PM by shivram | 13 Comments

Get ready or get dragged kicking and screaming into the upcoming Non-Admin world

So you have been spoiled by years of running as an Administrator on Windows and used to being able to do whatever you want? Well you'd better start getting used to not running as Admin all the time otherwise Windows Vista is going to drag you into the Non-Admin world.

In case you aren't aware, in Vista even running as Admin doesn't mean you have Admin privileges. You still run with normal user privileges and only when you invoke a program requiring an action with an Admin privilege does Vista pop up dialog confirming it and optionally asking for credentials. This is called User Account Control UAC. I was just kidding about the kicking and screaming part :) Vista does try and make this as painless and easy as possible.

But today in Windows XP you might need to run as Admin for various reasons which might be beyond your control. So how then can you prepare yourself and get a similar effect? Enter SetSAFER (but don't download it yet from the link on that article, read on). This is an excellent tool that allows you to run individual applications as a normal user even if you are running as Admin. This way you can run your high risk and/or internet connected programs as a normal user and reduce your attack surface. I run IE, Office, Media Player, MSN Messenger etc through it without much issues. And on the odd chance that you do need to run them as Admin then a couple of clicks will allow you to do that easily (just don't forget to revert).

The version of SetSAFER in the original article was based on a Beta version of the .Net Framework 2.0 so it won't work for most people now. A while ago I did send mail to Michael Howard about what the problem was and he made an updated version of the binary available on his blog. After installing SetSAFER from the original MSDN article, just update the SetSAFER.exe it installs by the one from Michael Howard's blog. Or you can just comment line 20 in Program.cs and rebuild it with VS 2005.

Posted Saturday, July 22, 2006 8:56 PM by shivram | 0 Comments

A good resource for all your scripting needs

Ever notice how you sometimes write a small batch file to automate something and then it starts growing and soon you start hitting the limits of what the batch file language can do and everything becomes an unmaintainable mess?

The natural solution then is to use Windows Scripting Host (WSH) and write a script in VBScript or JScript (or the many other languages it supports), since whipping out the VS IDE to code it in C# might be overkill for every little thing. The problem with WSH is that, as someone not very familiar with it, typically you don't know much about how to do particular things in WSH even if you pick up the basic VBScript or JScript language quickly. Even if you understand that most COM components can easily be accessed in WSH you still have the problem of knowing which COM components and/or interfaces to use for a particular task. For example there is a whole Scripting.FilesystemObject interface to help with common file operations and if you didn't know that then you'd be kind of lost.

So what do you do? Luckily there is an excellent resource which lists many scripting tasks neatly categorized with sample scripts. Its the Script Repository on the Windows Scripting site and all you need to do is look at some sample scripts for how to do a particular task. For example look under the Storage category for most file system tasks. One minor nit pick is that most of the examples are in VBScript. I personally prefer JScript, as I suspect most developers do, since its also a curly brace language like C/C++/C#. The scripting folks on the Windows Scripting site claim that most sysadmin type folks prefer VBScript hence the bias. But its not too difficult to convert the examples to JScript. If you are stuck then take a look at the JScript section of the additional language examples for some JScript samples that will give you some idea about how the same thing looks in JScript.

So chart your escape from batch file land and Happy scripting ...

Posted Sunday, July 16, 2006 10:37 PM by shivram | 0 Comments

Amazing how fast search engines have made one of my blog posts the top result for "slow notepad"

It's amazing and funny how fast my post about the slow notepad issue has become the top result when you do a web search for slow notepad :)

MSN Search, Yahoo and Google all show that blog post as the top result (at least as of now). Ironically enough the day I got really frustrated with notepad taking too long open large log files I did search the web and nothing much came up so I went about investigating it, and now that post is the top result. Perhaps this means that no one else has written anything about it on the web. I suppose it's comforting to know that if you post something which is a reasonably accurate solution to some problem and enough people find it useful, it's going to show up in a web search pretty quickly.

Hmm ... I wonder if I should indulge in some narcissistic pleasure by telling people to reach my blog by doing a search for "slow notepad" :) ... But I wonder how long its going to be top result ...

Posted Saturday, July 15, 2006 11:18 PM by shivram | 0 Comments

An easy way of doing .Net debugging in production environments

Say you want to debug your .Net application on some production enviroment, customer site/server and remote debugging is not an option due to various network issues like firewall, latency, cordoned off network etc. Installing Visual Studio might just take too long even with a minimal install. So what can you do with the least effort? This is a problem I have faced many times as we deploy our in-development servers at our customer sites for testing etc and many a times you'd have to debug issues that show up only in such environments. You don't need something fancy but just enough to be able to load your PDBs and do source level debugging.

Well it turns out that there is an easy low-effort option available instead of installing VS. All you need to do is install the .Net Framework SDK and use the CLR Debugger. Installing the .Net SDK is easier since its faster, smaller and you can always download it off the web if you have connectivity. You will find it as DbgCLR.exe in the GuiDebug directory within the SDK install location.

A couple of tips. You can load PDB files without copying them into the directory from where the process started. Open the modules window (Debug->Window->Modules) and then right click and choose Load Symbols (you can do this only after you have attached the debugger to the process). Using the 2.0 SDK is better since the CLR Debugger in that easily allows you to set the path to look for sources etc and save it in a solution. The CLR Debugger will allow you to do full source level debugging with breakpoints, watches etc. It is a good subset of the VS Debugger.

The only downside is that you can use this only for managed (.Net) debugging and not native Win32 debugging.

Posted Thursday, July 13, 2006 4:40 PM by shivram | 2 Comments

End of the Win9x era and what we should be thankful to Win9x for

So it comes to pass. The beginning of the end of the Win9x era with the (official) end of support for Windows 98 and ME. Its been a long time from the heady days of Windows 95 for the Win9x line and nowadays most people probably don't think much of it other than it being outdated etc. But we shouldn't forget that there are quite a few things we should be thankful to it for. Yes Win9x has its limitations and the Windows NT line (which includes Win2K/XP/2K3) has most certainly been a better OS for many uses for quite some time now. But without the Win9x the NT line wouldn't probably have taken of to the extent that it has nor as quickly as it has.

So what did Win9x help NT with? Here are some that I am aware of -

  1. Plug and Play. Plug and play was first implemented and popularized on the Win9x line starting with Windows 95 and didn't make it to the NT line till Windows 2000. Adding and configuring newer hardware is much easier thanks to Win9x.
  2. Power Management. Proper Power management with ACPI started with Windows 98 and was introduced in NT with Win2K. I suppose using NT 4.0 on a laptop wouldn't have been easy.
  3. Direct X. Direct X technology finally brought games out of the DOS era. For a long time after Windows 95 many games were still DOS based. Direct X was instrumental in getting game developers to start using Direct X and hence Windows. NT 4.0 had basic Direct X support and it wasn't till Windows 2000 (again) that NT line became a serious alternative for gaming. Without this a lot of the gaming enthusiast types wouldn't have moved to the NT line. This one alone is very important in making NT mainstream with consumers.
  4. WDM driver model and better wider availability of device drivers for the NT line. Windows 98 introduced the WDM driver model which was common with Windows 2000 and hence improved driver support for Windows 2000 because a lot of new drivers for the much more widely deployed Windows 98 could be used in Windows 2000.
  5. Popularized the Win32 programming model. A legion of programmers including yours truly got their first real exposure to Win32 (and Windows) programming with Win9x. This was mostly upwards compatible with NT so it improved the application support for NT immensly. In fact Win9x was the preferred development platform for games before Windows 2000.

BTW in case you are wondering I'm not in the Windows team and have never been. These are just my observations on how important Win9x has been for Windows and Microsoft. I still remember the day in college when we had the first Windows 95 install and there were a whole bunch of us excitedly huddled around it. Few people were able to run Windows NT those days with its 16 MB RAM requirement. Quite a few folks had NT on dual boot but we'd mostly boot into for stuff like SQL Server etc.

Win9x had its flaws but it served its purpose. Its time to bid it good bye now. So long Win9x ...

Posted Tuesday, July 11, 2006 11:43 PM by shivram | 2 Comments

How to get in on the HDTV (r)evolution without breaking your bank

Time for a post related to the division I work in (MSTV). I'm sure most of you would have heard about HDTV and depending on your perspective its a revolution or an evolution. If you care about picture quality and you are one of those folks who would never be happy with a plain vanilla XGA resolution (on computers not TVs) then HDTV is revolutionary. You owe it to yourself to go an see an HDTV (showing HD content!) for some time if you haven't already, and see what a difference it can make. So lets say you are sold and you want one, but what to buy? Especially without spending exorbitantly.

You have quite a few options for buying an HDTV. Most people normally think about those huge big screens costing thousands when they think HDTV, but there are other options. Those big screens HDTVs are usually LCD, rear projection, DLP (Digital Light Projection) or plasma. Apart from costing quite a bit and probably being larger than what your TV size should be based on your room size, some of these solutions have other technical problems. Like for example LCDs have issues with viewing angle, color reproduction, fast motion scenes. Rear projection in general has lower quality compared to the others. DLP and Plasma are better and if your budget allows it you should consider them.

However these is one more alternative that is little talked about. These are Direct View HDTVs which are like your normal Cathode Ray Tube based TV but naturally with a higher HDTV resolution. Actually these are just really big high resolution computer monitors. Technically speaking these have the best color reproduction of all the HDTV technologies (decades of CRT technology evolution) and the picture quality is stunning. The downside is of course that they are bigger and much heavier but most American homes can accomodate these and you probably aren't going to move your TV that often (you should negotiate a free/low priced home delivery with that purchase). What's more these days some manufacturers have these Slim Line Direct View HDTVs which are only half as deep as the normal ones and these are quite reasonable. The big advantage is price. These are much much cheaper. You can get a good 30+ inch widescreen HDTV for around a thousand dollars or less depending on the exact specs. Even if you are tempted by the other cool new technology HDTVs keep in mind that these are maturing technologies that keep falling in price and becoming better. It might be better to take a taste of HDTV using the inexpensive direct view option and go for the others once things improve and the various competing technologies battle it out.

If you are thinking of HDTV then it behooves you to take a look at the Direct View option. It may not be as cool sounding as the other new technologies but it is quite a pragmatic approach. Naturally TV mfrs and retailers don't push them as much since it doesn't make them as much money but then you are smarter than them :)

Posted Sunday, January 22, 2006 5:16 PM by shivram | 3 Comments

As guilty as a million abandoned blogs...

Hmm ... So I've fallen into the same trap as so many other bloggers who start something and then it peters out. Life happens in between ... But as a new year resolution I plan to start blogging a bit more consistently and frequently.  But don't hold me to this in case life becomes too hectic :)

Posted Sunday, January 22, 2006 5:04 PM by shivram | 5 Comments

Diagnosing device driver problems leading to system freezes

Recently I started having some device driver related problems on my laptop. Sometimes when I would leave my laptop in a standby power state and come back, the system would have strange problems after coming out of standby. IE would hang trying to load a page and then no matter what I did the IE process would not get killed. Opening more IE instances did the same thing. The system would not respond to a restart and the only way of recovering was to do a power reset (remove batteries). Now I knew that to get Windows XP into such a bad state it had to be some device driver related issues. At first I thought its probably some obscure bug related to power management and ignored it as I had important work to do. But then it happened again. Twice isn't a coincidence and I decided that I would investigate it the next time it happened.  

So I installed the kernel debuggers by installing the Debugging Tools for Windows package. As I was heading to the excellent Sysinternals site to download their live kernel debugging utility LiveKD to use with the kernel debuggers, what a coincidence that I came across a new blog post by Mark Russinovich which talked about the very same issue of unkillable hung apps. Turns out it happens due to driver bugs causing hung IRPs. Aha so this is exactly what's going in my case and the device driver suspicion of mine turned out to be correct. The interesting thing is which device eventually truned out to be causing the problem as I thought that its likely to be the Wireless Adapter driver as that's certainly one driver being used by IE to download pages. This was disturbing as the Wireless Adapter on my laptop is made by a large company with a good reputation. It wasn't long before it happened again and I fired up windbg using LiveKD -

kd> !process 91c
Searching for Process with Cid == 91c
PROCESS f93d27a0  SessionId: 0  Cid: 091c    Peb: 7ffde000  ParentCid: 008c
    DirBase: 038d2000  ObjectTable: e2425ad8  HandleCount: 356.
    Image: IEXPLORE.EXE
    VadRoot fb283f70 Vads 210 Clone 0 Private 2686. Modified 113. Locked 0.
    DeviceMap e243d2b0
    Token                             e12e0980
    ElapsedTime                       00:04:12.463
    UserTime                          00:00:00.360
    KernelTime                        00:00:00.280
    QuotaPoolUsage[PagedPool]         73840
    QuotaPoolUsage[NonPagedPool]      10160
    Working Set Sizes (now,min,max)  (5922, 50, 345) (23688KB, 200KB, 1380KB)
    PeakWorkingSetSize                5936
    VirtualSize                       105 Mb
    PeakVirtualSize                   106 Mb
    PageFaultCount                    6718
    MemoryPriority                    BACKGROUND
    BasePriority                      8
    CommitCharge                      2761

        THREAD f8e69400  Cid 091c.06a4  Teb: 7ffdd000 Win32Thread: e2ac6838 WAIT: (Executive) KernelMode Non-Alertable
            ba902140  Mutant - owning thread ffa3da70
        IRP List:
            f8de6008: (0006,01b4) Flags: 00000070  Mdl: 00000000
        Not impersonating
        DeviceMap                 e243d2b0
        Owning Process            f93d27a0       Image:         IEXPLORE.EXE
        Wait Start TickCount      22193499       Ticks: 23399 (0:00:03:54.326)
        Context Switch Count      1964                 LargeStack
        UserTime                  00:00:00.0280
        KernelTime                00:00:00.0290
        Start Address kernel32!BaseProcessStartThunk (0x7c810867)
        Win32 Start Address 0x00402451
        Stack Init ba97c000 Current ba97bbb0 Base ba97c000 Limit ba975000 Call 0
        Priority 10 BasePriority 8 PriorityDecrement 0 DecrementCount 16
        ChildEBP RetAddr 
        ba97bbc8 804dc0f7 nt!KiSwapContext+0x2e (FPO: [Uses EBP] [0,0,4])
        ba97bbd4 804dc143 nt!KiSwapThread+0x46 (FPO: [0,0,0])
        ba97bbfc ba8ff4c4 nt!KeWaitForSingleObject+0x1c2 (FPO: [Non-Fpo])
        ba97bc14 ba90234c wdmaud!WdmaGrabMutex+0x17 (FPO: [1,0,0])
        ba97bc34 804e37f7 wdmaud!SoundDispatch+0x66 (FPO: [Non-Fpo])
        ba97bc44 8056a101 nt!IopfCallDriver+0x31 (FPO: [0,0,0])
        ba97bc58 80579a8a nt!IopSynchronousServiceTail+0x60 (FPO: [Non-Fpo])
        ba97bd00 8057bfa5 nt!IopXxxControlFile+0x611 (FPO: [Non-Fpo])
        ba97bd34 804de7ec nt!NtDeviceIoControlFile+0x2a (FPO: [Non-Fpo])
        ba97bd34 7c90eb94 nt!KiFastCallEntry+0xf8 (FPO: [0,0] TrapFrame @ ba97bd64)
        0013b6e8 00000000 ntdll!KiFastSystemCallRet (FPO: [0,0,0])

Grabbing the IRP and looking it up shows  -


kd> !irp f8de6008
Irp is active with 2 stacks 2 is current (= 0xf8de609c)
 No Mdl System buffer = ff901d08 Thread f8e69400:  Irp stack trace. 
     cmd  flg cl Device   File     Completion-Context
 [  0, 0]   0  0 00000000 00000000 00000000-00000000   

   Args: 00000000 00000000 00000000 00000000
>[  e, 0]   5  0 822d5b00 82207028 00000000-00000000   
        \Driver\wdmaud
   Args: 00000064 00000086 001d8000 00000000

Now the wdmaud.sys driver is part of the Audio driver infrastructure. So it turns out the problem is with the audio device drivers not the Wireless Adaptor. I'm no device driver expert but I assumed that the audio drivers are also split into a miniport like model and the real culprit was probably the device specific driver and not the wdmaud.sys. So I went to my laptop manufacturer's site looking for updated audio drivers and installed them. So far I haven't had the problem come back again. No wonder that Windows Server 2003 disables audio hardware acceleration by default and doesn't include drivers for many audio devices. Basically operating system stability depends a lot on good device drivers and it's unfortunate that things like these happen. In Windows Vista drivers are being made more reliable by moving more things into common driver infrastructure and having the device manufaturer write very little device specific code. In fact some things like printer drivers are being moved into user mode.

Posted Thursday, September 15, 2005 4:09 PM by shivram | 0 Comments

C# 3.0 finally provides some competition to COBOL/xBase

Well PDC is underway and for all the nice Vista, WinFX and Office 12 news, what really excites me most is LINQ (Language INtegrated Query). This is huge. Finally COBOL and xBase have some serious competition in terms of language integrated data capabilities. I've always been tickled by the fact that even though COBOL is a horrible programming language by many measures, it's persisted data handling features are unmatched by most modern programming languges. Do not argue about that with me. I was made to suffer a semester of COBOL plus a mini project in my Engineering and I am intimately aware of it benefits and deficiencies :) That's precisely why a large proportion of business software (esp. on Mainframes etc) is still in COBOL! Heck .Net was a huge blessing for the COBOL folks who promptly became modern by implementing COBOL in .Net and automagically being able to use all the .Net features. That should also tell you that there is enough money to be made in that. It's nice that finally I will have some of the ease of data use features in C# that was available decades ago in COBOL. To be fair the xBase languages also had integrated data handling features but there are significant differences. For one the xBase products weren't true Relational Databases. For another, none of those languages managed to become widely used general purpose programming languages. xBase languages were nice for their days but can't hold against modern languages. The nice thing here is that you now have Query support in general purpose programming languages and the base programming framework. Trust me that's a huge thing.

Edit: Added links to the relevant technologies being discussed.

Posted Tuesday, September 13, 2005 4:32 PM by shivram | 3 Comments

Why notepad is sometimes slow opening large files and how to make it fast

Ever notice how notepad can be really slow opening large files? Yeah I know why use notepad at all? For the simple reason that it might be the only editor on some random server that you logon to look at logs etc. Well there is Wordpad too but the default association for text and log files is to notepad and by the time you've double clicked a log file it might be too late. Also Wordpad is more heavyweight and can be lot slower scolling through and searching for text etc.

So you open some really large log file (in notepad) and notice the excruciatingly long time it takes. One day I got really frustrated and decided to investigate a bit. After a while I realized that even actions like maximizing or changing the size of the window took very long and a light bulb turned on that somehow notepad is redoing the whole layout of the text again so perhaps the word wrap feature is responsible. After all the word wrap feature (menu Format->Word Wrap) causes notepad to break lines at the visible width so that must be taking some time. Turns out that indeed if you switch word wrap off notepad becomes lightning fast. I tested with two log files of 11 MB and 103 MB on a Dual P4 3.2 GHz with HyperThreading on. For the 11 MB file I got times of around 16 s with word wrap on and 1.5 s with word wrap off! For the 103 MB it was 135 s and 15 s! I couldn't believe it was so simple and hadn't heard about this anywhere so I asked the people in my team if anyone knew about this. Apparently no one knew. I wonder how many people have realized this.

Now the problem is that at some point in time you've probably turned on word wrap in notepad and then forgottten all about it. It stays on and you keep suffering slow notepad file open times. I wish notepad had an option to turn word wrap off for files above a certain size. After all most text files you are going to use word wrap on wouldn't be too big. My suggestion is to keep word wrap off all the time and just make the default size of notepad as big as your screen allows. And if you really do need to use it then don't forget to turn it off lest you find yourself cursing the next time you open a large file :)

Posted Monday, September 12, 2005 12:36 PM by shivram | 5 Comments

Hello blogging world!

So I thought I'd finally start a blog and start sharing some of my views, ideas, tips and tidbits related to computers with the rest of the world. I'm Shiv (Shiv Shankar Ramakrishnan) and my job at Microsoft is to watch TV :) Well not really but kind of ... You see I work in the Microsoft TV division and that means apart from computers we folks also get to have TV's in our rooms.

So Microsoft TV, what's that you might ask? Well we do a whole bunch of software for the TV world. If you've subscribed to Digital Cable or Satellite TV then you must have seen what are called as Set Top Boxes which are essentially embedded computers systems (I wonder if one can still call them embedded anymore) attached to the TV and contains software that allows you to do interactive things with the TV like see which program is at what time (called EPG or Electronic Program Guide in TV industry lingo), record TV programs (called DVR Digital Video Recording) etc etc. Essentially its a computer whose output is the TV screen instead of a monitor as with regular computers, the user interacts with it using a Remote and the whole purpose of the software on the box is to enhance the viewer's TV experience. For example it makes things like Video On Demand, Pay Per View etc possible. We also do a lot of back end server work to support all these boxes. Where do you think the EPG information on the boxes comes from? Yup some backend server. We are also doing some pioneering and leading edge work on what is called IPTV. IPTV is to TV as VoIP (Voice over IP) is to telephony. Basically TV over IP networks. Turns out you can do some really interesting things with the TV viewing experience and paradigm when you do TV over IP. Anyway let me not bore you with too much information about MSTV. You can find more information at the official Microsoft TV site.

This blog is not going to be about MSTV but rather my personal views and thoughts about computers in general based on my experience in the industry, though at times I may talk about MSTV. Over the years as any computer professional would, I've also accumulated my own set of tips and tricks, ideas, viewpoints etc about computers. Perhaps now is the time to use this blogging phenomenon to start sharing some of it with the rest of the world. Who knows, I may find people who share my ideas and I can learn of other interesting things.

Posted Friday, September 09, 2005 2:10 PM by shivram | 1 Comments

Page view tracker