ReactOS 0.4.16-dev-297-gc569aee
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}
HINSTANCE hwldap32
Definition: main.c:29
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define err(...)
#define TRACE(s)
Definition: solgame.cpp:4
@ WLDAP32_LDAP_LOCAL_ERROR
@ WLDAP32_LDAP_REFERRAL_LIMIT_EXCEEDED
int WINAPI LoadStringA(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPSTR lpBuffer, _In_ int cchBufferMax)

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}
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
__wchar_t WCHAR
Definition: xmlstorage.h:180

◆ 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:1042

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
308 return WLDAP32_errormap[err];
309}
#define ARRAY_SIZE(A)
Definition: main.h:20
static const ULONG WLDAP32_errormap[]
Definition: error.c:190
#define ERROR_DS_GENERIC_ERROR
Definition: winerror.h:1575

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 error(str)
Definition: mkdosfs.c:1605
#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_USER_CANCELLED
Definition: winldap.h:108
#define LDAP_DECODING_ERROR
Definition: winldap.h:104
#define LDAP_TIMEOUT
Definition: winldap.h:105
#define LDAP_LOCAL_ERROR
Definition: winldap.h:102
#define LDAP_CLIENT_LOOP
Definition: winldap.h:116
#define LDAP_AUTH_UNKNOWN
Definition: winldap.h:106
#define LDAP_PARAM_ERROR
Definition: winldap.h:109
#define LDAP_NO_MEMORY
Definition: winldap.h:110
#define LDAP_NO_RESULTS_RETURNED
Definition: winldap.h:114
#define LDAP_CONTROL_NOT_FOUND
Definition: winldap.h:113
#define LDAP_NOT_SUPPORTED
Definition: winldap.h:112
#define LDAP_CONNECT_ERROR
Definition: winldap.h:111
#define LDAP_FILTER_ERROR
Definition: winldap.h:107
@ WLDAP32_LDAP_USER_CANCELLED
@ WLDAP32_LDAP_DECODING_ERROR
@ WLDAP32_LDAP_MORE_RESULTS_TO_RETURN
@ WLDAP32_LDAP_AUTH_UNKNOWN
@ WLDAP32_LDAP_PARAM_ERROR
@ WLDAP32_LDAP_NOT_SUPPORTED
@ WLDAP32_LDAP_NO_RESULTS_RETURNED
@ WLDAP32_LDAP_NO_MEMORY
@ WLDAP32_LDAP_CLIENT_LOOP
@ WLDAP32_LDAP_FILTER_ERROR
@ WLDAP32_LDAP_SERVER_DOWN
@ WLDAP32_LDAP_TIMEOUT
@ WLDAP32_LDAP_CONTROL_NOT_FOUND
@ WLDAP32_LDAP_CONNECT_ERROR

◆ 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 msg(x)
Definition: auth_time.c:54
#define debugstr_a
Definition: kernel32.h:31

◆ 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
163
164 if (ret == LDAP_SUCCESS)
165 ret = error;
166 else
167 ret = ~0u;
168
169#endif
170 return ret;
171}
#define free
Definition: debug_ros.c:5
#define NULL
Definition: types.h:112
GLuint res
Definition: glext.h:9613
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
uint32_t ULONG
Definition: typedefs.h:59
int ret
#define ldap_parse_result
Definition: winldap.h:675
#define LDAP_SUCCESS
Definition: winldap.h:59

Variable Documentation

◆ WLDAP32_errormap

const ULONG WLDAP32_errormap[]
static

Definition at line 190 of file error.c.

Referenced by LdapMapErrorToWin32().