]> git.sur5r.net Git - openldap/blob - libraries/liblutil/nt_err.c
Regarding previous commit:
[openldap] / libraries / liblutil / nt_err.c
1 #include <windows.h>
2 #include <winerror.h>
3
4 char *GetErrorString( int err )
5 {
6         static char msgBuf[1024];
7
8         FormatMessage(
9                 FORMAT_MESSAGE_FROM_SYSTEM,
10                 NULL,
11                 err, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
12                 msgBuf, 1024, NULL );
13         return msgBuf;
14 }
15
16 char *GetLastErrorString( void )
17 {
18         return GetErrorString( GetLastError() );
19 }
20
21 #undef __RETSTR