MCPcopy Create free account
hub / github.com/abbeycode/UnrarKit / GetSysErrMsg

Method GetSysErrMsg

Libraries/unrar/errhnd.cpp:330–354  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

328
329
330bool ErrorHandler::GetSysErrMsg(wchar *Msg,size_t Size)
331{
332#ifndef SILENT
333#ifdef _WIN_ALL
334 int ErrType=GetLastError();
335 if (ErrType!=0)
336 return FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_IGNORE_INSERTS,
337 NULL,ErrType,MAKELANGID(LANG_NEUTRAL,SUBLANG_DEFAULT),
338 Msg,(DWORD)Size,NULL)!=0;
339#endif
340
341#if defined(_UNIX) || defined(_EMX)
342 if (errno!=0)
343 {
344 char *err=strerror(errno);
345 if (err!=NULL)
346 {
347 CharToWide(err,Msg,Size);
348 return true;
349 }
350 }
351#endif
352#endif
353 return false;
354}
355
356
357void ErrorHandler::SysErrMsg()

Callers

nothing calls this directly

Calls 1

CharToWideFunction · 0.85

Tested by

no test coverage detected