The RWLockWin::Create() function returns NULL on some Windows platforms because it cannot load kernel32.dll. This causes a crash.
RWLockWin tries to load kernel32.dll to check if the Slim Reader/Writer Lock APIs are present in kernel32.dll but on newer Windows platforms, kernel32.dll does not exist and the APIs are exported by kernelbase.dll instead.
The fix is quite simple: There is no need to try to load any DLL to check if the Slim Reader/Writer Lock APIs are present, because these APIs
are always present in all Windows versions since Windows Vista.
I am removing the code that attempts to load kernel32.dll. This prevents the crash on platforms that use kernelbase.dll.
If the WINUWP preprocessor symbol is defined, RWLockWin was already doing the right thing. But this issue is not limited to WINUWP and in
some scenarios, building for WINUWP is not the right solution because it causes other problems. So, my fix is essentially to use the WINUWP
code path for all Windows builds.
The only version of Windows which does not have the Slim Reader/Writer Lock APIs is Windows XP (and older ones, of course.)
However, since the current code does not fall back to an alternative implementation when the Slim Reader/Writer Lock APIs are missing,
WebRTC is already broken on such old versions of Windows.
Bug: webrtc:11186
Change-Id: I34aad066e18b924792d47c244ecee00669e86c4d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/161472
Commit-Queue: Tommi <tommi@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30044}
This moves it from an API directory (system_wrappers/include/) to a
non-API directory, which is exactly what we want for utilities like
this.
BUG=webrtc:8445
NOPRESUBMIT=true
Change-Id: Ie2879aca5fc1667e4222499d2a8fc2bba9ae2425
Reviewed-on: https://webrtc-review.googlesource.com/21328
Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22587}
2018-03-23 19:47:08 +00:00
Renamed from system_wrappers/source/rw_lock_win.h (Browse further)