ReactOS  0.4.15-dev-499-g1f31905
error.c File Reference
#include "config.h"
#include "wine/port.h"
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "winnls.h"
#include "winldap_private.h"
#include "wldap32.h"
#include "wine/debug.h"
Include dependency graph for error.c:

Go to the source code of this file.

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (wldap32)
 
ULONG map_error (int error)
 
PCHAR CDECL ldap_err2stringA (ULONG err)
 
PWCHAR CDECL ldap_err2stringW (ULONG err)
 
void CDECL WLDAP32_ldap_perror (WLDAP32_LDAP *ld, const PCHAR msg)
 
ULONG CDECL WLDAP32_ldap_result2error (WLDAP32_LDAP *ld, WLDAP32_LDAPMessage *res, ULONG free)
 
ULONG CDECL LdapGetLastError (void)
 
ULONG CDECL LdapMapErrorToWin32 (ULONG err)
 

Variables

static const ULONG WLDAP32_errormap []
 

Function Documentation

◆ ldap_err2stringA()

PCHAR CDECL ldap_err2stringA ( ULONG  err)

Definition at line 71 of file error.c.

72 {
73  static char buf[256] = "";
74 
75  TRACE( "(0x%08x)\n", err );
76 
78  LoadStringA( hwldap32, err, buf, 256 );
79  else
81 
82  return buf;
83 }
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
int WINAPI LoadStringA(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPSTR lpBuffer, _In_ int cchBufferMax)
#define TRACE(s)
Definition: solgame.cpp:4
#define err(...)
HINSTANCE hwldap32
Definition: main.c:29

Referenced by idmap_query_attrs(), and nfs41_idmap_create().

◆ ldap_err2stringW()

PWCHAR CDECL ldap_err2stringW ( ULONG  err)

Definition at line 101 of file error.c.

102 {
103  static WCHAR buf[256] = { 0 };
104 
105  TRACE( "(0x%08x)\n", err );
106 
108  LoadStringW( hwldap32, err, buf, 256 );
109  else
111 
112  return buf;
113 }
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define err(...)
HINSTANCE hwldap32
Definition: main.c:29

◆ LdapGetLastError()

ULONG CDECL LdapGetLastError ( void  )

Definition at line 184 of file error.c.

185 {
186  TRACE( "\n" );
187  return GetLastError();
188 }
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
#define TRACE(s)
Definition: solgame.cpp:4

Referenced by nfs41_idmap_create().

◆ LdapMapErrorToWin32()

ULONG CDECL LdapMapErrorToWin32 ( ULONG  err)

Definition at line 302 of file error.c.

303 {
304  TRACE( "(0x%08x)\n", err );
305 
306  if (err >= ARRAY_SIZE( WLDAP32_errormap ))
307  return ERROR_DS_GENERIC_ERROR;
308  return WLDAP32_errormap[err];
309 }
#define TRACE(s)
Definition: solgame.cpp:4
static const ULONG WLDAP32_errormap[]
Definition: error.c:190
#define ERROR_DS_GENERIC_ERROR
Definition: winerror.h:1575
#define err(...)
#define ARRAY_SIZE(a)
Definition: main.h:24

Referenced by idmap_query_attrs(), and nfs41_idmap_create().

◆ map_error()

ULONG map_error ( int  error)

Definition at line 40 of file error.c.

41 {
42  switch (error)
43  {
44 #ifdef HAVE_LDAP_H
61 #endif
62  default: return error;
63  }
64 }
#define LDAP_AUTH_UNKNOWN
Definition: winldap.h:106
#define LDAP_DECODING_ERROR
Definition: winldap.h:104
#define LDAP_PARAM_ERROR
Definition: winldap.h:109
#define LDAP_CONNECT_ERROR
Definition: winldap.h:111
#define LDAP_CONTROL_NOT_FOUND
Definition: winldap.h:113
#define LDAP_TIMEOUT
Definition: winldap.h:105
#define LDAP_CLIENT_LOOP
Definition: winldap.h:116
#define LDAP_NO_RESULTS_RETURNED
Definition: winldap.h:114
#define LDAP_USER_CANCELLED
Definition: winldap.h:108
#define LDAP_NO_MEMORY
Definition: winldap.h:110
#define LDAP_FILTER_ERROR
Definition: winldap.h:107
#define LDAP_SERVER_DOWN
Definition: winldap.h:101
#define LDAP_REFERRAL_LIMIT_EXCEEDED
Definition: winldap.h:117
#define LDAP_MORE_RESULTS_TO_RETURN
Definition: winldap.h:115
#define LDAP_NOT_SUPPORTED
Definition: winldap.h:112
#define LDAP_LOCAL_ERROR
Definition: winldap.h:102
EXPORT int error(char *fmt, va_alist)
Definition: error.c:46

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( wldap32  )

◆ WLDAP32_ldap_perror()

void CDECL WLDAP32_ldap_perror ( WLDAP32_LDAP ld,
const PCHAR  msg 
)

Definition at line 130 of file error.c.

131 {
132  TRACE( "(%p, %s)\n", ld, debugstr_a(msg) );
133 }
#define TRACE(s)
Definition: solgame.cpp:4
#define debugstr_a
Definition: kernel32.h:31
#define msg(x)
Definition: auth_time.c:54

◆ WLDAP32_ldap_result2error()

ULONG CDECL WLDAP32_ldap_result2error ( WLDAP32_LDAP ld,
WLDAP32_LDAPMessage res,
ULONG  free 
)

Definition at line 152 of file error.c.

153 {
155 #ifdef HAVE_LDAP
156  int error;
157 
158  TRACE( "(%p, %p, 0x%08x)\n", ld, res, free );
159 
160  if (!ld || !res) return ~0u;
161 
162  ret = ldap_parse_result( ld, res, &error, NULL, NULL, NULL, NULL, free );
163 
164  if (ret == LDAP_SUCCESS)
165  ret = error;
166  else
167  ret = ~0u;
168 
169 #endif
170  return ret;
171 }
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
Definition: glfuncs.h:240
#define free
Definition: debug_ros.c:5
#define ldap_parse_result
Definition: winldap.h:675
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
int ret
#define LDAP_SUCCESS
Definition: winldap.h:59
GLuint res
Definition: glext.h:9613
unsigned int ULONG
Definition: retypes.h:1
EXPORT int error(char *fmt, va_alist)
Definition: error.c:46

Variable Documentation

◆ WLDAP32_errormap

const ULONG WLDAP32_errormap[]
static

Definition at line 190 of file error.c.

Referenced by LdapMapErrorToWin32().