Back to index

nordugrid-arc-nox  1.1.0~rc6
Functions
win32.cpp File Reference
#include "win32.h"

Go to the source code of this file.

Functions

std::string GetOsErrorMessage (void)

Function Documentation

std::string GetOsErrorMessage ( void  )

Definition at line 9 of file win32.cpp.

                                  {
  std::string rv;
  LPVOID lpMsgBuf;
  if (FormatMessage(
        FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
        NULL,
        GetLastError(),
        MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
        (LPTSTR)&lpMsgBuf,
        0,
        NULL))
    rv.assign(reinterpret_cast<const char*>(lpMsgBuf));
  else
    rv.assign("FormatMessage API failed");
  LocalFree(lpMsgBuf);
  return rv;
}

Here is the caller graph for this function: