How to find a DLL given a CLSID?
Asked Answered
A

4

30

I have a situation in which a managed DLL calls some unmanaged DLL. I know the CLSID of the unmanaged DLL, is there any way to find out what binary file houses that CLSID?

Algar answered 22/5, 2009 at 13:7 Comment(1)
Are you trying to do this programatically, or ad hoc? I.e., do you need a program to be doing this itself, or is this something you occasionally need to do as a developer?Soggy
D
37

Normaly, you can just go to:

HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\"GUID"

And find a key called "InProcServer32" for instance and there will be the default value that has the DLL. This is one simple way to do it.

Diplocardiac answered 22/5, 2009 at 13:13 Comment(3)
Worth noting that, depending on how it was installed, you might find it in HKEY_CURRENT_USER\SOFTWARE\Classes\CLSID instead.Wellesley
Which means that HKEY_CLASSES_ROOT\CLSID is what should be used.Unbend
Or HKEY_CLASSES_ROOT\WOW6432Node\CLSIDCaloric
P
7

Can you not just search for it in the registry using regedit and look for the binary path.

Paludal answered 22/5, 2009 at 13:11 Comment(0)
D
3

Based on BobbyShaftoe reply we can build a simple vbs script that reads that registry for us:

Dll_RegPath = "HKEY_CLASSES_ROOT\CLSID\<GUID>\InProcServer32\"

Paste the following to "test.vbs"

Sub Main

    ' used to find location of "System.Collections.ArrayList" progid dll
    Const csGUID = "{6896B49D-7AFB-34DC-934E-5ADD38EEEE39}"

    MsgBox srGetDllPathByGUID(csGUID)

End Sub

Function srGetDllPathByGUID( sGUID )
    Const csRegPath = "HKEY_CLASSES_ROOT\CLSID\<GUID>\InProcServer32\"

    Dim oShell: Set oShell = CreateObject("WScript.Shell")
    Dim sReg: sReg = Replace( csRegPath, "<GUID>", sGUID ) ' build str

    srGetDllPathByGUID = oShell.RegRead(sReg)

    Set oShell = Nothing ' clean up
End Function

Call Main

You can also find ProgId by:

ProgID_RegPath = "HKEY_CLASSES_ROOT\CLSID\<GUID>\ProgID\"
Disfigure answered 8/2, 2015 at 9:5 Comment(0)
M
0

I've found this question because I was troubleshooting some incorrectly installed application and my objective was to find and register ActiveX dll given the CLSID (which I've got from app sources). Hence my a little bit hacky approach.

I've issued a search in the directory where I believed the dll is located looking for CLSID in file contents. That did the trick, because it was stored in plain text in resources. I believe it's not always the case, but my problem was solved.

Meatman answered 19/4, 2021 at 9:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.