From: Kevin Provance on 3 Dec 2007 19:15 Is there some convenient way to determine the location of a SxS installed DLL (in this case, msvcr80.dll). Since it can no longer be installed in the app folder or the system folder, it must be installed as a SxS via a redist program. All I need to do now is to determine where on the hard drive it's installed, as there is a plethora of entries in the SxS folder. I peeked in the registry, but I need CLSIDs and whatnot to base my search on. Google isn't being much help either (anyone remember when Google was actually useful?) - Kev
From: Steve Easton on 4 Dec 2007 11:51 It lives here: C:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.762_x-ww_6b128700 and here: C:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.163_x-ww_681e29fb and here: C:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.42_x-ww_0de06acd each a different version. 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" <casey(a)tpasoft.com> wrote in message news:%23c6n6qgNIHA.1208(a)TK2MSFTNGP03.phx.gbl... > Is there some convenient way to determine the location of a SxS installed > DLL (in this case, msvcr80.dll). Since it can no longer be installed in the > app folder or the system folder, it must be installed as a SxS via a redist > program. All I need to do now is to determine where on the hard drive it's > installed, as there is a plethora of entries in the SxS folder. I peeked in > the registry, but I need CLSIDs and whatnot to base my search on. Google > isn't being much help either (anyone remember when Google was actually > useful?) > > - Kev > >
From: Kevin Provance on 4 Dec 2007 15:51 Thanks for the effort Steve. 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" <admin(a)95isalive.com> wrote in message news:OnbMJYpNIHA.4476(a)TK2MSFTNGP06.phx.gbl... | It lives here: | C:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.762_x-ww_6b128700 | and here: | C:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.163_x-ww_681e29fb | and here: | C:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.42_x-ww_0de06acd | each a different version. | | 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" <casey(a)tpasoft.com> wrote in message news:%23c6n6qgNIHA.1208(a)TK2MSFTNGP03.phx.gbl... | > Is there some convenient way to determine the location of a SxS installed | > DLL (in this case, msvcr80.dll). Since it can no longer be installed in the | > app folder or the system folder, it must be installed as a SxS via a redist | > program. All I need to do now is to determine where on the hard drive it's | > installed, as there is a plethora of entries in the SxS folder. I peeked in | > the registry, but I need CLSIDs and whatnot to base my search on. | > isn't being much help either (anyone remember when Google was actually | > useful?) | > | > - Kev | > | > | |
From: Kevin Provance on 4 Dec 2007 19:28 Here is the code for my workaround, should anyone want it. 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
|
Pages: 1 Prev: [VB5+MSINET.OCX] Err 13/Type Mismatch? Next: ListView FindItem |