MCPcopy Create free account
hub / github.com/mhammond/pywin32 / FormatSysError

Function FormatSysError

isapi/src/Utils.cpp:86–106  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

84// Formats a system error code
85
86char *FormatSysError(const DWORD nErrNo)
87{
88 // This should never happen, so we can be a little brutal.
89 char *result = (char *)malloc(1024);
90 if (!result) return NULL;
91 result[0] = '\0';
92 int nLen =FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM,
93 NULL,
94 nErrNo,
95 MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
96 result,
97 1024,
98 NULL);
99 if (nLen > 2) {
100 if ( result[nLen - 1] == '\n')
101 result[nLen - 1] = 0;
102 if (result[nLen - 2] == '\r')
103 result[nLen - 2] = 0;
104 }
105 return result;
106}
107
108// format an error
109char *HTMLErrorResp(const char *msg)

Callers 2

ExtensionErrorFunction · 0.85
FilterErrorFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected