| 1171 | } |
| 1172 | |
| 1173 | static cell_t FrameIterator_GetFilePath(IPluginContext *pContext, const cell_t *params) |
| 1174 | { |
| 1175 | Handle_t hndl = (Handle_t)params[1]; |
| 1176 | HandleError err; |
| 1177 | SafeFrameIterator *iterator; |
| 1178 | |
| 1179 | HandleSecurity sec; |
| 1180 | sec.pIdentity = g_pCoreIdent; |
| 1181 | sec.pOwner = pContext->GetIdentity(); |
| 1182 | |
| 1183 | if ((err=handlesys->ReadHandle(hndl, g_FrameIter, &sec, (void **)&iterator)) != HandleError_None) |
| 1184 | { |
| 1185 | return pContext->ThrowNativeError("Could not read Handle %x (error %d)", hndl, err); |
| 1186 | } |
| 1187 | |
| 1188 | const char* filePath = iterator->FilePath(); |
| 1189 | if (!filePath) |
| 1190 | { |
| 1191 | return pContext->ThrowNativeError("Iterator out of bounds. Check return value of FrameIterator.Next"); |
| 1192 | } |
| 1193 | |
| 1194 | char* buffer; |
| 1195 | pContext->LocalToString(params[2], &buffer); |
| 1196 | size_t size = static_cast<size_t>(params[3]); |
| 1197 | |
| 1198 | ke::SafeStrcpy(buffer, size, filePath); |
| 1199 | return 0; |
| 1200 | } |
| 1201 | |
| 1202 | static cell_t LogStackTrace(IPluginContext *pContext, const cell_t *params) |
| 1203 | { |
nothing calls this directly
no test coverage detected