WindowCapturerWin: properly check return value of GetClassName
In debug mode I hit the assert so this function can return 0. So just skip the window in that case like for other desktop elements Bug: None Change-Id: I92abf2a1f450b677632f5eb4332ca218cfd850ec Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/143860 Commit-Queue: Tommi <tommi@webrtc.org> Reviewed-by: Tommi <tommi@webrtc.org> Cr-Commit-Position: refs/heads/master@{#28408}
This commit is contained in:
parent
9407776aa2
commit
71809c67ce
@ -186,9 +186,8 @@ bool WindowCaptureHelperWin::IsWindowChromeNotification(HWND hwnd) {
|
||||
const size_t kClassLength = 256;
|
||||
WCHAR class_name[kClassLength];
|
||||
const int class_name_length = GetClassNameW(hwnd, class_name, kClassLength);
|
||||
RTC_DCHECK(class_name_length)
|
||||
<< "Error retrieving the application's class name";
|
||||
if (wcsncmp(class_name, kChromeWindowClassPrefix,
|
||||
if (class_name_length < 1 ||
|
||||
wcsncmp(class_name, kChromeWindowClassPrefix,
|
||||
wcsnlen_s(kChromeWindowClassPrefix, kClassLength)) != 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -54,8 +54,8 @@ BOOL CALLBACK WindowsEnumerationHandler(HWND hwnd, LPARAM param) {
|
||||
const size_t kClassLength = 256;
|
||||
WCHAR class_name[kClassLength];
|
||||
const int class_name_length = GetClassNameW(hwnd, class_name, kClassLength);
|
||||
RTC_DCHECK(class_name_length)
|
||||
<< "Error retrieving the application's class name";
|
||||
if (class_name_length < 1)
|
||||
return TRUE;
|
||||
|
||||
// Skip Program Manager window and the Start button. This is the same logic
|
||||
// that's used in Win32WindowPicker in libjingle. Consider filtering other
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user