| 45 | } |
| 46 | |
| 47 | bool ErrorUtils::ShowErrorDialog(wchar_t const * msg) |
| 48 | { |
| 49 | if (EoCClient == nullptr |
| 50 | || EoCClientHandleError == nullptr) { |
| 51 | return false; |
| 52 | } |
| 53 | |
| 54 | unsigned retries{ 0 }; |
| 55 | while (!CanShowError() && retries < 600) { |
| 56 | Sleep(100); |
| 57 | retries++; |
| 58 | } |
| 59 | |
| 60 | if (retries >= 300) { |
| 61 | return false; |
| 62 | } |
| 63 | |
| 64 | STDWString str; |
| 65 | str.Size = wcslen(msg); |
| 66 | str.Capacity = 0xfff; // Used to bypass 7-character inline buffer check |
| 67 | str.BufPtr = const_cast<wchar_t *>(msg); |
| 68 | EoCClientHandleError(*EoCClient, &str, false, &str); |
| 69 | return true; |
| 70 | } |
| 71 | |
| 72 | bool ErrorUtils::CanShowError() |
| 73 | { |
nothing calls this directly
no outgoing calls
no test coverage detected