mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-02-17 14:00:30 +08:00
Moved GetLastErrorString to ntservice.c. I missed it before, thought it
was unused but it's needed in ntservice.c
This commit is contained in:
parent
58cede64c1
commit
237b00049a
@ -83,30 +83,3 @@ char *ber_pvt_wsa_err2string( int err )
|
||||
}
|
||||
|
||||
#undef __RETSTR
|
||||
|
||||
#if 0 /* No one seems to be using these */
|
||||
char *ber_pvt_wsa_last_errstring( void )
|
||||
{
|
||||
return ber_pvt_wsa_err2string( WSAGetLastError() );
|
||||
}
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
char *GetErrorString( int err )
|
||||
{
|
||||
static char msgBuf[1024];
|
||||
|
||||
FormatMessage(
|
||||
FORMAT_MESSAGE_FROM_SYSTEM,
|
||||
NULL,
|
||||
err, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
|
||||
msgBuf, 1024, NULL );
|
||||
|
||||
return msgBuf;
|
||||
}
|
||||
|
||||
char *GetLastErrorString( void )
|
||||
{
|
||||
return GetErrorString( GetLastError() );
|
||||
}
|
||||
#endif
|
||||
|
@ -43,7 +43,6 @@ ldap_pvt_thread_t start_status_tid, stop_status_tid;
|
||||
|
||||
void (*stopfunc)(int);
|
||||
|
||||
/* in nt_err.c */
|
||||
char *GetLastErrorString( void );
|
||||
|
||||
int srv_install(LPCTSTR lpszServiceName, LPCTSTR lpszDisplayName,
|
||||
@ -429,4 +428,21 @@ void ReportSlapdShutdownComplete( )
|
||||
}
|
||||
}
|
||||
|
||||
char *GetErrorString( int err )
|
||||
{
|
||||
static char msgBuf[1024];
|
||||
|
||||
FormatMessage(
|
||||
FORMAT_MESSAGE_FROM_SYSTEM,
|
||||
NULL,
|
||||
err, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
|
||||
msgBuf, 1024, NULL );
|
||||
|
||||
return msgBuf;
|
||||
}
|
||||
|
||||
char *GetLastErrorString( void )
|
||||
{
|
||||
return GetErrorString( GetLastError() );
|
||||
}
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user