MCPcopy Create free account
hub / github.com/OGSR/OGSR-Engine / invalid_parameter_handler

Function invalid_parameter_handler

ogsr_engine/xrCore/xrDebugNew.cpp:408–434  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

406static void handler_base(const char* reason_string) { Debug.backend("error handler is invoked!", reason_string, nullptr, nullptr, DEBUG_INFO); }
407
408static void invalid_parameter_handler(const wchar_t* expression, const wchar_t* function, const wchar_t* file, unsigned int line, uintptr_t reserved)
409{
410 string4096 expression_;
411 string4096 function_;
412 string4096 file_;
413 size_t converted_chars = 0;
414
415 if (expression)
416 wcstombs_s(&converted_chars, expression_, sizeof(expression_), expression, (wcslen(expression) + 1) * 2 * sizeof(char));
417 else
418 strcpy_s(expression_, "");
419
420 if (function)
421 wcstombs_s(&converted_chars, function_, sizeof(function_), function, (wcslen(function) + 1) * 2 * sizeof(char));
422 else
423 strcpy_s(function_, __FUNCTION__);
424
425 if (file)
426 wcstombs_s(&converted_chars, file_, sizeof(file_), file, (wcslen(file) + 1) * 2 * sizeof(char));
427 else
428 {
429 line = __LINE__;
430 strcpy_s(file_, __FILE__);
431 }
432
433 Debug.backend("error handler is invoked!", expression_, nullptr, nullptr, file_, line, function_);
434}
435
436static void std_out_of_memory_handler() { handler_base("std: out of memory"); }
437

Callers

nothing calls this directly

Calls 1

backendMethod · 0.80

Tested by

no test coverage detected