win-capture: Make sure we don't try to hook ourselves

Can trigger when using "Hook any fullscreen application" is enabled and
the projector is active.
master
Richard Stanway 2016-04-25 23:46:20 +02:00
parent 853ec3cba0
commit e5e5189c7b
No known key found for this signature in database
GPG Key ID: AAC1E5265D71B3FD
1 changed files with 4 additions and 0 deletions

View File

@ -831,6 +831,10 @@ static void try_hook(struct game_capture *gc)
gc->thread_id = GetWindowThreadProcessId(gc->next_window,
&gc->process_id);
// Make sure we never try to hook ourselves (projector)
if (gc->process_id == GetCurrentProcessId())
return;
if (!gc->thread_id || !gc->process_id) {
warn("error acquiring, failed to get window "
"thread/process ids: %lu",