Consider the following registry export:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\WinSock2\Parameters\Protocol_Catalog9\Catalog_Entries\000000000001]
;...
"ProtocolName"="@%SystemRoot%\\System32\\wshtcpip.dll,-60100"
The intention here appears to be for someone to load the DLL in question, and use some form of API retrieve the actual name. But I don’t know what that API is :/
I’d like to avoid loading the DLL into my address space (and thus call DLL_PROCESS_ATTACH) if at all possible; can’t really trust third party DLLs to be trustworthy.
RegLoadMUIStringwill do the necessary for you. Note however, that it was introduced in Vista so won’t help if you need to support XP.If you want to avoid code in the DLL running whilst you extract resources, use
LoadLibraryExpassingLOAD_LIBRARY_AS_IMAGE_RESOURCE | LOAD_LIBRARY_AS_DATAFILE, or possiblyLOAD_LIBRARY_AS_DATAFILE_EXCLUSIVE. Once you have done that, you can callLoadStringto extract the MUI value.