Last active
August 29, 2015 14:06
-
-
Save jiulongw/beb39e2eae4cebce1279 to your computer and use it in GitHub Desktop.
COM interface finder
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
foreach (Assembly a in AppDomain.CurrentDomain.GetAssemblies()) | |
{ | |
try | |
{ | |
foreach (Type t in a.GetExportedTypes()) | |
{ | |
try | |
{ | |
IntPtr pUnk = Marshal.GetIUnknownForObject(ProjectCfgObject); | |
Guid iid = t.GUID; | |
IntPtr ppv; | |
Marshal.QueryInterface(pUnk, ref iid, out ppv); | |
if(ppv != IntPtr.Zero) | |
{ | |
System.Diagnostics.Debug.WriteLine(t.FullName); | |
} | |
} | |
catch { } | |
} | |
} | |
catch { } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment