MCPcopy Create free account
hub / github.com/bwapi/bwapi / _CreateThread

Function _CreateThread

bwapi/BWAPI/Source/Detours.cpp:154–170  ·  view source on GitHub ↗

--------------------------------------------- CREATE THREAD ------------------------------------------------

Source from the content-addressed store, hash-verified

152
153//--------------------------------------------- CREATE THREAD ------------------------------------------------
154HANDLE WINAPI _CreateThread(LPSECURITY_ATTRIBUTES lpThreadAttributes, SIZE_T dwStackSize,LPTHREAD_START_ROUTINE lpStartAddress, LPVOID lpParameter, DWORD dwCreationFlags, LPDWORD lpThreadId)
155{
156 auto CreateThreadProc = _CreateThreadOld ? _CreateThreadOld : &CreateThread;
157
158 DWORD dwThreadId = 0; // Local thread ID for thread labelling
159 HANDLE rval = CreateThreadProc(lpThreadAttributes, dwStackSize, lpStartAddress, lpParameter, dwCreationFlags, &dwThreadId);
160
161 // Register the created thread
162 if ( rval != nullptr )
163 RegisterThreadName("Starcraft Broodwar", dwThreadId );
164
165 // Perform the expected behaviour if lpThreadId was provided
166 if ( lpThreadId )
167 *lpThreadId = dwThreadId;
168
169 return rval;
170}
171
172//------------------------------------------------ SLEEP ----------------------------------------------------
173VOID WINAPI _Sleep(DWORD dwMilliseconds)

Callers

nothing calls this directly

Calls 1

RegisterThreadNameFunction · 0.85

Tested by

no test coverage detected