Explorar o código

win-capture: Make open_process_proc static

Seems like the original intention and avoids repeatedly calling
GetProcAddress. Detected by PVS Studio.
Richard Stanway %!s(int64=3) %!d(string=hai) anos
pai
achega
ecf8c1239d
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      plugins/win-capture/game-capture.c

+ 1 - 1
plugins/win-capture/game-capture.c

@@ -286,7 +286,7 @@ static inline HANDLE open_process(DWORD desired_access, bool inherit_handle,
 				  DWORD process_id)
 {
 	typedef HANDLE(WINAPI * PFN_OpenProcess)(DWORD, BOOL, DWORD);
-	PFN_OpenProcess open_process_proc = NULL;
+	static PFN_OpenProcess open_process_proc = NULL;
 	if (!open_process_proc)
 		open_process_proc = (PFN_OpenProcess)get_obfuscated_func(
 			kernel32(), "NuagUykjcxr", 0x1B694B59451ULL);