Răsfoiți Sursa

win-capture: Make open_process_proc static

Seems like the original intention and avoids repeatedly calling
GetProcAddress. Detected by PVS Studio.
Richard Stanway 3 ani în urmă
părinte
comite
ecf8c1239d
1 a modificat fișierele cu 1 adăugiri și 1 ștergeri
  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)
 				  DWORD process_id)
 {
 {
 	typedef HANDLE(WINAPI * PFN_OpenProcess)(DWORD, BOOL, DWORD);
 	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)
 	if (!open_process_proc)
 		open_process_proc = (PFN_OpenProcess)get_obfuscated_func(
 		open_process_proc = (PFN_OpenProcess)get_obfuscated_func(
 			kernel32(), "NuagUykjcxr", 0x1B694B59451ULL);
 			kernel32(), "NuagUykjcxr", 0x1B694B59451ULL);