| 115 | } |
| 116 | |
| 117 | bool CCGetCallBack(void* pCallbackMsg) |
| 118 | { |
| 119 | // Assuming we want to Run only callresults as we're returning its callresult ID by the interfaces functions. |
| 120 | Thread.lock(); |
| 121 | if (pCallbackMsg > NULL) |
| 122 | { |
| 123 | CurrentCB = ResultsBuffer.begin(); |
| 124 | |
| 125 | if (CurrentCB != ResultsBuffer.end() && !ResultsBuffer.empty()) |
| 126 | { |
| 127 | void* Buffer = nullptr; |
| 128 | CCallbackMsg_t* CBM = (CCallbackMsg_t*)pCallbackMsg; |
| 129 | if (Buffer == nullptr) |
| 130 | Buffer = std::malloc(sizeof(CCSteamAPICallCompleted_t)); |
| 131 | // We return a random item from our callresult vector to run |
| 132 | int randomCB = std::rand() % ResultsBuffer.size(); |
| 133 | std::advance(CurrentCB, randomCB); |
| 134 | |
| 135 | if (CurrentCB != ResultsBuffer.end() && randomCB <= ResultsBuffer.size()) |
| 136 | { |
| 137 | CSteamAPIResult_t cresC = *CurrentCB; |
| 138 | |
| 139 | if (Buffer > nullptr) { |
| 140 | CCSteamAPICallCompleted_t* cst = (CCSteamAPICallCompleted_t*)Buffer; |
| 141 | cst->m_cubParam = cresC.Size; |
| 142 | cst->m_hAsyncCall = cresC.Call; |
| 143 | cst->m_iCallback = cresC.Type; |
| 144 | } |
| 145 | CBM->m_iCallback = 703; |
| 146 | CBM->m_cubParam = cresC.Size; |
| 147 | CBM->m_hSteamUser = 1; |
| 148 | CBM->m_pubParam = (unsigned char*)Buffer; |
| 149 | |
| 150 | Thread.unlock(); |
| 151 | return true; |
| 152 | } |
| 153 | } |
| 154 | } |
| 155 | Thread.unlock(); |
| 156 | return false; |
| 157 | } |
| 158 | bool CCGetAPICallResult(uint64_t hSteamAPICall, void* pCallback, int cubCallback, int iCallbackExpected, bool* pbFailed) |
| 159 | { |
| 160 | Thread.lock(); |
no outgoing calls
no test coverage detected