views:

60

answers:

3

I'm trying to find a way to identify a newly registered or unregistered (via regsvr32) COM servers, which are added to the registry (CLSID). Is there any callback function I can use? I don't really want to poll the registry...

+1  A: 

What you're looking for in that case is if you can get callbacks for writes to certain parts of the registry. It's perfectly valid for a COM server to be registered by just writing the data manually to the registry so I can't think of any other way of doing it.

I'm not sure how to do that, but there might be some way since there is the regmon tool on Sysinternals that logs all registry accesses.

Edit: Actually here's a question that seems to be about monitoring registry access, so you might be able to adapt that code:

http://stackoverflow.com/questions/826971/registry-watcher-c

ho1
+1  A: 

You can take a look at the RegNotifyChangeKeyValue windows API. It can be used to recieve notifications about changes to the contents of a regitry key.

http://msdn.microsoft.com/en-us/library/ms724892(v=VS.85).aspx

Garett
A: 

Hi

Be aware that you may still have to somehow handle "registration free COM"

For more information read here and here.

Best

Vagaus