233 | | The nature of this structured exception is different than most as they specifically coded it so that it will not engage the BOINC Runtime Debugger and it'll display a dialog box asking the user if they wish to debug the error. If the user cancels the error code 0xc000000d is returned without any more information. |
234 | | |
235 | | To get more information with this error you'll need to create a function like this: |
236 | | |
237 | | {{{ |
238 | | #ifdef _WIN32 |
239 | | void AppInvalidParameterHandler(const wchar_t* expression, const wchar_t* function, const wchar_t* file, unsigned int line, uintptr_t pReserved ) { |
240 | | fprintf( |
241 | | stderr, |
242 | | "Invalid parameter detected in function %s. File: %s Line: %d\n", |
243 | | function, |
244 | | file, |
245 | | line |
246 | | ); |
247 | | fprintf( |
248 | | stderr, |
249 | | "Expression: %s\n", |
250 | | expression |
251 | | ); |
252 | | // Cause a Debug Breakpoint. |
253 | | DebugBreak(); |
254 | | } |
255 | | #endif |
256 | | }}} |
257 | | |
258 | | The following code block should be added after the call to boinc_diagnostics_init(): |
259 | | |
260 | | {{{ |
261 | | #ifdef _WIN32 |
262 | | // Every once and awhile something looks at a std::vector or some other |
263 | | // CRT/STL construct that throws an exception when an invalid parameter |
264 | | // is detected. In this case we should dump whatever information we |
265 | | // can and then bail. When we bail we should dump as much data as |
266 | | // possible. |
267 | | _set_invalid_parameter_handler(AppInvalidParameterHandler); |
268 | | #endif |
269 | | }}} |
270 | | |