- Kev
There's a registry entry here:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\SideBySide\PatchedComponents
which shows this CLSID for all of the versions:
{9B2AF11A-A6B3-11EE-B01F-C8B3B9A1E18E}
However neither the dll or the CLSID are registered anywhere else in the registry,
such as HKCR
hth
--
Steve Easton
"Kevin Provance" <ca...@tpasoft.com> wrote in message news:%23c6n6qg...@TK2MSFTNGP03.phx.gbl...
I came up with a different workaround using the PSAPI.dll. I was able to
enumerate the module handles from the process handle of my own program
(since it loads the dll in question), then using GetModuleFileNameEx I
obtained the path of the loaded dll.
If anyone wants me to post the code, I'd be happy to.
- Kev
"Steve Easton" <ad...@95isalive.com> wrote in message
news:OnbMJYpN...@TK2MSFTNGP06.phx.gbl...
Option Explicit
Private Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess
As Long, _
ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long
Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long)
As Long
Private Declare Function EnumProcesses Lib "PSAPI.DLL" (lpidProcess As Long,
_
ByVal cb As Long, cbNeeded As Long) As Long
Private Declare Function EnumProcessModules Lib "PSAPI.DLL" (ByVal hProcess
As Long, _
lphModule As Long, ByVal cb As Long, lpcbNeeded As Long) As Long
Private Declare Function GetModuleBaseName Lib "PSAPI.DLL" Alias _
"GetModuleBaseNameA" (ByVal hProcess As Long, ByVal hModule As Long, _
ByVal lpFileName As String, ByVal nSize As Long) As Long
Private Declare Function GetModuleFileNameEx Lib "PSAPI.DLL" _
Alias "GetModuleFileNameExA" (ByVal hProcess As Long, ByVal hModule As Long,
_
ByVal lpFileName As String, ByVal nSize As Long) As Long
Private Const PROCESS_VM_READ As Long = &H10
Private Const PROCESS_QUERY_INFORMATION As Long = &H400
Public Function GetDllPathFromProcess(ByVal sDll As String, ByVal sProcess
As String) As String
'sDll is the name of the DLL you want the path to
'sProcess is the name of the program that loads the DLL. Typically this
will be your own EXE
Dim lProcesses() As Long
Dim cbNeeded As Long
Dim cProcesses As Long
Dim lProcessCount As Long
Dim lCount As Long
Dim lProcessID As Long
Dim lLen As Long
Dim hProcess As Long
Dim hMod(0 To 1023) As Long
Dim lR As Long
Dim lMax As Long
Dim sProcessName As String
Dim sDllPath As String
ReDim lProcesses(0 To 1023) As Long
sDllPath = vbNullString
sDll = LCase$(sDll)
sProcess = LCase$(sProcess)
If (EnumProcesses(lProcesses(0), 1024 * 4, cbNeeded) <> 0) Then
cProcesses = cbNeeded / 4
For lProcessCount = 0 To cProcesses - 1
If sDllPath <> vbNullString Then
Exit For
End If
lProcessID = lProcesses(lProcessCount)
lLen = 260
hProcess = OpenProcess(PROCESS_QUERY_INFORMATION _
Or PROCESS_VM_READ, 0, lProcessID)
If lProcessID > 0 Then 'System = 2
If (hProcess <> 0) Then
If (EnumProcessModules(hProcess, hMod(0), 1024 * 4,
cbNeeded)) Then
'itmX.SubItems(4) = cbNeeded \ 4
sProcessName = String$(lLen, 0)
lR = GetModuleBaseName(hProcess, hMod(0), sProcessName,
lLen)
sProcessName = LCase$(Mid$(sProcessName, 1, lR))
If sProcessName = sProcess Then
lMax = cbNeeded \ 4
For lCount = 1 To lMax - 1
sProcessName = String$(lLen, 0)
lR = GetModuleBaseName(hProcess, hMod(lCount),
sProcessName, lLen)
sProcessName = LCase$(Mid$(sProcessName, 1, lR))
If sProcessName = sDll Then
sProcessName = String$(lLen, 0)
lR = GetModuleFileNameEx(hProcess,
hMod(lCount), sProcessName, lLen)
sProcessName = Mid$(sProcessName, 1, lR)
sDllPath = sProcessName
Exit For
End If 'sProcessName = sDll
Next 'lCount
End If 'sProcessName = sProcess
End If 'EnumProcessModules
End If 'hProcess <> 0
End If 'lProcessID = 0
CloseHandle hProcess
Next 'i
End If 'EnumProcesses<>0
GetDllPathFromProcess = sDllPath
End Function