Login    
   Windows Server to Workstation
   Convert Windows Server 2008/2008 R2/2012 to a Workstation!
    Register FAQ  •  Search    
It is currently Sat May 25, 2013 5:30 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Class Enumerator
PostPosted: Sun Jan 03, 2010 8:31 pm 
Offline
Win2008Workstation Admin
Win2008Workstation Admin
User avatar

Joined: Sat Mar 08, 2008 5:10 pm
Posts: 1065
Location: The Netherlands
Why?
I had some spare time during the vacation and wanted to know how the CLSIDs, AppIDs, Interfaces and TypeLibs in the registry work and are connected to each other (image, also .vsd in attachment) and to the files on disk. This is also very useful information when trying to port applications and features from Windows 7 and Vista to Windows Server 2008 [R2]. :) No comments about variable names and other coding constructions; I don't code that often! :P

Description
This code will loop through the subkeys of the following HKEY_CLASSES_ROOT branches in the Windows 64bit registry enumerating all FileTypes, CLSIDs, AppIDs, Interfaces and TypeLibs:
HKEY_CLASSES_ROOT (64bit)
HKEY_CLASSES_ROOT\Wow6432Node (32bit)
HKEY_LOCAL_MACHINE\SOFTWARE\Classes (64bit)
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Classes (32bit)
After all keys have been enumerated they will be connected to each other whereafter you get a big web of connected keys and files. :geek: I have not tested it on a x86 (32bit) Windows version, but I think you just have to remove the references to the Wow6432Node keys in the RootKeys variable and the KeyType enum.

How to use
Attached is the Visual Studio 2008 Solution. I haven't made any graphical interface yet, so the only way to get the information is by running the Solution and setting a breakpoint somewhere at the end so you can view all information using the QuickWatch. The enumeration will take some time (I think about 10 minutes on my PC, specs in sig).

If you want to see the Classes/TypeLibs and/or AppIDs that depend on a certain file, set a breakpoint at the line after
Code:
string fileToFind = string.Empty;
open the QuickWatch and enter for example:
Code:
fileToFind = "C:\\Windows\\System32\\WinSATAPI.dll"
Now close the QuickWatch and do a "Step Over" (F10) whereafter you can view whatever you want by opening the foundFile variable in the QuickWatch (image). If you want to view an other file, drag the Execution Pointer back and repeat the instructions above.

Modifications/Feedback
Modifying/copying the file is fine as long as you keep some credits to me. Any feedback is welcome as I haven't worked with any Windows classes ever! :) Any improvements to the code are also more than welcome! :geek: If you have any questions you can also leave a comment here.

I hope it is useful and have fun with it! ;)


You do not have the required permissions to view the files attached to this post.

_________________
|[ Mainboard: Gigabyte GA-M56S-S3 ]|[ CPU: AMD Athlon 64 X2 6000+ ]|[ RAM: 4096 MB (DDR2-800 SDRAM) ]|[ GPU: NVIDIA GeForce 8600 GT (256 MB) ]|[ OS: Microsoft Windows Server 2008 R2 Enterprise ]|


 Profile  
 Post subject: Re: Class Enumerator
PostPosted: Mon Jan 04, 2010 4:14 pm 
Offline
Win2008Workstation Expert
Win2008Workstation Expert
User avatar

Joined: Wed Dec 10, 2008 9:09 pm
Posts: 250
Location: Czech Republic
this app looks really great!
Good job Arris!

_________________
Image


 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
phpBB skin developed by: John Olson
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
[ Time : 0.056s | 11 Queries | GZIP : Off ]