MCPcopy Create free account
hub / github.com/Rat431/ColdAPI_Steam / CCGetAPICallResult

Function CCGetAPICallResult

src/ColdAPI_Steam/CSteamCallbacks.cpp:158–187  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

156 return false;
157 }
158 bool CCGetAPICallResult(uint64_t hSteamAPICall, void* pCallback, int cubCallback, int iCallbackExpected, bool* pbFailed)
159 {
160 Thread.lock();
161
162 if (hSteamAPICall && pCallback > NULL)
163 {
164 // Loop to our stored callresults.
165 auto criter = ResultsBuffer.begin();
166 while (criter != ResultsBuffer.end())
167 {
168 CSteamAPIResult_t cresC = *criter;
169 if (cresC.Call == hSteamAPICall && cresC.Type == iCallbackExpected && cresC.Size == cubCallback)
170 {
171 // Copy our callback data in the requested buffer
172 std::memcpy(pCallback, cresC.Data, cresC.Size);
173 if(pbFailed > NULL)
174 *pbFailed = false;
175
176 Thread.unlock();
177 return true;
178 }
179 ++criter;
180 }
181 }
182 if (pbFailed > NULL)
183 *pbFailed = true;
184
185 Thread.unlock();
186 return false;
187 }
188 void FreeCB()
189 {
190 Thread.lock();

Callers 1

Steam_GetAPICallResultFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected