issues with WS2_32.dll behavior between windows 10

2019-08-25 02:45发布

问题:

Did not find any suitable solution with existing questions so asking new question here. We use log4cxx which has WS2_32.LIB as dependency. WS2_32.LIB is present in Windows SDK version 10.0.16299.0. When using this log4cxx.dll on windows7 WS2_32.dll and all its dependencies gets loaded properly and application start normally.

but in windows 10 environment WS2_32.dll expects dependent dll's like API-MS-WIN-CORE-CRT-L1-1-0.DLL which are not part of windows10 or any of the microsoft visual c++ Redistributable which results in application error.

difference in WS2_32.dll and its dependencies between Windows7 and windows10 are clearly visible via dependency walker.

WS2_32.dll on windows 10:

whereas WS2_32.dll on windows7 is

as shown here API-MS-WIN-CORE-CRT-L1-1-0.DLL is not a dependent dll in windows7 where as its in windows 10 which is not present in the system resulting in application error.

So what should be the way to make the application run successfully? what alternate dependency should be provided instead of WS2_32.LIB while compiling log4cxx.dll to avoid this issue in windows 10? Also where to find documentation about such changes between windows OS versions? Please suggest.

回答1:

The old depends.exe doesn't support those API sets and shows wrong data.

use the open source replacement called Dependencies:

Dependencies is a rewrite of the legacy software Dependency Walker which was shipped along Windows SDKs, but whose developement stopped around 2006. Dependencies can help Windows developers troubleshooting their dll load dependencies issues.