MCPcopy Create free account
hub / github.com/SpecialKO/SpecialK / SK_GetWindowThreadProcessId

Function SK_GetWindowThreadProcessId

src/window.cpp:9812–9850  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9810
9811
9812DWORD
9813WINAPI
9814SK_GetWindowThreadProcessId ( _In_ HWND hWnd,
9815 _Out_opt_ LPDWORD lpdwProcessId )
9816{
9817 static
9818 concurrency::concurrent_unordered_map <
9819 HWND, std::pair <DWORD, DWORD>
9820 > _WindowThreadProcessIdCache;
9821
9822 if (_WindowThreadProcessIdCache.count (hWnd) == 0)
9823 {
9824 DWORD dwProcId;
9825 DWORD dwThreadId =
9826 GetWindowThreadProcessId_Original != nullptr ?
9827 GetWindowThreadProcessId_Original (hWnd, &dwProcId) :
9828 GetWindowThreadProcessId (hWnd, &dwProcId);
9829
9830 _WindowThreadProcessIdCache [hWnd] = std::make_pair (dwThreadId, dwProcId);
9831
9832 if (lpdwProcessId != nullptr)
9833 *lpdwProcessId = dwProcId;
9834
9835 return dwThreadId;
9836 }
9837
9838 else
9839 {
9840 auto& thread_proc_id = _WindowThreadProcessIdCache [hWnd];
9841
9842 if (lpdwProcessId != nullptr)
9843 *lpdwProcessId = thread_proc_id.second;
9844
9845 return thread_proc_id.first;
9846 }
9847
9848 SK_ReleaseAssert (!L"Invalid Code Control Flow");
9849 return 0;
9850}
9851
9852
9853

Callers 15

ActivateWindowFunction · 0.85
SK_EnumWindowsFunction · 0.85
SetWindowPos_DetourFunction · 0.85
SK_SetWindowLongPtrAFunction · 0.85
SK_SetWindowLongPtrWFunction · 0.85
GetFocus_DetourFunction · 0.85
GetGUIThreadInfo_DetourFunction · 0.85
GetActiveWindow_DetourFunction · 0.85
SK_DetourWindowProcFunction · 0.85

Calls 2

make_pairFunction · 0.85
countMethod · 0.45

Tested by

no test coverage detected