问题
I am trying to find out where IFileOperation
is implemented in Windows 7.
As far as I understand from the MSDN page it is in shell32.dll.
So, I checked all the COM objects in shell32.dll using a DLL export viewer (from NirSoft) and IFileOperation is not one of them.
I searched the registry for the CLSID_FileOperation
{3ad05575-8857-4850-9277-11b85bdb8e09} and I found (as far as I understand) that it is in shell32.dll.
But how can that be if I couldn't find that COM export using DLL export?
回答1:
A DLL doesn't need to export anything special to implement that interface. The registry tells the OS what DLL implements the interface. When a program calls CoCreateInstance
, the OS can look up the given CLSID in the registry. The OS then loads the associated DLL and calls its DllGetClassObject
function to get an IClassFactory
object. The OS then uses that interface to get something that implements the requested interface.
来源:https://stackoverflow.com/questions/5010620/where-is-ifileoperation-implemented-and-how-can-i-verify-this