Mike V commented that maybe I need a tool to do the DirectX assembly differences for me. Interestingly enough that's what I worked on yesterday.

The process I go through is not all manual and generally the changes between SDK versions are small so its relatively easy e.g. Feb 05 changes. I start by installing the assemblies to a VirtualPC that I have set up with a pure version of Windows XP. That way I don't have to worry about any old versions and other things getting in the way and I can see exactly what files get put where. Then I take a copy of the assemblies and the framework code so that I can 'diff' them at any time in the future.

Of course you can't just use WinDiff or other similar programs on assemblies and get useful output. So I use a tool called TxRef to generate an textual outline of the assembly. If you've ever used .Net Reflector then imagine taking the tree structure for all the classes, methods and parameters and writing it out to a text file. TxRef is something that I acquired while working at Microsoft. Its created somewhere deep in the .Net team and is an internal only tool. Normally I would not even have mentioned it here because I know people will just ask for a copy that I can't and won't give out. However yesterday I found out how you can get a copy for yourselves. Just go and buy Framework Design Guidelines (yes there's an affiliate link in there - send a few $$$ to the Zman) and there is a copy, source and all, of the same TxRef tool I borrowed.

Now once you have the TxRef output for the before and after images you can use WinDiff (comes with Visual Studio) or my new favourite Beyond Compare to see what has changed.

This time however had a few challenges.

Firstly TxRef works on a single file at a time. The Managed DirectX team has merged all the code into a single DLL so how to compare the new single file with the 5 old ones. For the most part I could create individual files by cutting at the namespace boundaries, but D3DX.dll actually puts its stuff in the Direct3D namespace. So I had to manually merge the classes into a single file - keeping the alphabetical order so that WinDiff would have a slight chance of finding matches.

Secondly, the changes were so great that none of the WinDiff tools could match the 2 files. There are just too many line that have either a { or a } and the windiff tool matches them even if it shouldn't. This is where Beyond Compare came into its own. I can look at the 2 files side my side and mark the correct left and right matches and it automatically lines everything else up.

After this its just a case of scanning down the files for relevant changes and typing them into a useful format. This is the manual part of it that can go wrong - after a few hours your eyes start to bleed and you can miss stuff!

But its still too much hard work and lets face it I would rather be coding than typing. So after a bit of thought I've started on a project to automate the whole process. I figure I have spent 20+ hours creating the diffs you have seen so far, with another 2-4 still to go, and I know I will have to do it all again in December when the next SDK comes out. So logic says if I can write something in less than 24 hours I will be in profit. Even if it takes longer I get more .Net programming practise and hey maybe someone will pay me $20 for the program in the future.

There's nothing to show yet other than the fact that I decided to call it AssDiff - for no other reason than it makes me laugh every time I type it.

Published 12 October 2005 11:53 PM by zman


No Comments



This Blog