MCPcopy Create free account
hub / github.com/SFML/SFML / getErrorString

Function getErrorString

src/SFML/Window/Win32/Utils.hpp:35–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33namespace sf::priv
34{
35inline std::string getErrorString(DWORD error)
36{
37 PTCHAR buffer = nullptr;
38 if (FormatMessage(FORMAT_MESSAGE_MAX_WIDTH_MASK | FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
39 nullptr,
40 error,
41 0,
42 reinterpret_cast<PTCHAR>(&buffer),
43 0,
44 nullptr) == 0)
45 {
46 return "Unknown error.";
47 }
48
49 const sf::String message = buffer;
50 LocalFree(buffer);
51 return message.toAnsiString();
52}
53} // namespace sf::priv

Callers 11

getStringMethod · 0.85
setStringMethod · 0.85
getDeviceNameFunction · 0.85
makeCurrentMethod · 0.85
selectBestPixelFormatMethod · 0.85
setDevicePixelFormatMethod · 0.85
createSurfaceMethod · 0.85
createContextMethod · 0.85
loadSystemCertificatesFunction · 0.85

Calls 1

toAnsiStringMethod · 0.80

Tested by

no test coverage detected