ReactOS  0.4.15-dev-439-g292f67a
wldap32.h File Reference
#include "wine/heap.h"
#include "wine/unicode.h"
Include dependency graph for wldap32.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

ULONG map_error (int) DECLSPEC_HIDDEN
 
static charstrdupU (const char *src)
 
static WCHARstrdupW (const WCHAR *src)
 
static LPWSTR strAtoW (LPCSTR str)
 
static LPSTR strWtoA (LPCWSTR str)
 
static charstrWtoU (LPCWSTR str)
 
static LPWSTR strUtoW (char *str)
 
static void strfreeA (LPSTR str)
 
static void strfreeW (LPWSTR str)
 
static void strfreeU (char *str)
 
static DWORD strarraylenA (LPSTR *strarray)
 
static DWORD strarraylenW (LPWSTR *strarray)
 
static DWORD strarraylenU (char **strarray)
 
static LPWSTRstrarrayAtoW (LPSTR *strarray)
 
static LPSTRstrarrayWtoA (LPWSTR *strarray)
 
static char ** strarrayWtoU (LPWSTR *strarray)
 
static LPWSTRstrarrayUtoW (char **strarray)
 
static void strarrayfreeA (LPSTR *strarray)
 
static void strarrayfreeW (LPWSTR *strarray)
 
static void strarrayfreeU (char **strarray)
 

Variables

HINSTANCE hwldap32 DECLSPEC_HIDDEN
 

Function Documentation

◆ map_error()

ULONG map_error ( int  )

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

◆ strarrayAtoW()

static LPWSTR* strarrayAtoW ( LPSTR strarray)
inlinestatic

Definition at line 134 of file wldap32.h.

135 {
136  LPWSTR *strarrayW = NULL;
137  DWORD size;
138 
139  if (strarray)
140  {
141  size = sizeof(WCHAR*) * (strarraylenA( strarray ) + 1);
142  if ((strarrayW = heap_alloc( size )))
143  {
144  LPSTR *p = strarray;
145  LPWSTR *q = strarrayW;
146 
147  while (*p) *q++ = strAtoW( *p++ );
148  *q = NULL;
149  }
150  }
151  return strarrayW;
152 }
char * LPSTR
Definition: xmlstorage.h:182
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
smooth NULL
Definition: ftsmooth.c:416
static LPWSTR strAtoW(LPCSTR str)
Definition: wldap32.h:50
GLsizeiptr size
Definition: glext.h:5919
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
GLdouble GLdouble GLdouble GLdouble q
Definition: gl.h:2063
static DWORD strarraylenA(LPSTR *strarray)
Definition: wldap32.h:113
GLfloat GLfloat p
Definition: glext.h:8902
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by ldap_count_valuesA(), ldap_search_ext_sA(), ldap_search_extA(), ldap_search_sA(), ldap_search_stA(), and ldap_searchA().

◆ strarrayfreeA()

static void strarrayfreeA ( LPSTR strarray)
inlinestatic

Definition at line 214 of file wldap32.h.

215 {
216  if (strarray)
217  {
218  LPSTR *p = strarray;
219  while (*p) strfreeA( *p++ );
220  heap_free( strarray );
221  }
222 }
static void strfreeA(LPSTR str)
Definition: wldap32.h:98
char * LPSTR
Definition: xmlstorage.h:182
GLfloat GLfloat p
Definition: glext.h:8902
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by ldap_value_freeA().

◆ strarrayfreeU()

static void strarrayfreeU ( char **  strarray)
inlinestatic

Definition at line 234 of file wldap32.h.

235 {
236  if (strarray)
237  {
238  char **p = strarray;
239  while (*p) strfreeU( *p++ );
240  heap_free( strarray );
241  }
242 }
static void strfreeU(char *str)
Definition: wldap32.h:108
GLfloat GLfloat p
Definition: glext.h:8902
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by ldap_get_valuesW(), ldap_search_ext_sW(), ldap_search_extW(), ldap_search_stW(), ldap_search_sW(), and ldap_searchW().

◆ strarrayfreeW()

static void strarrayfreeW ( LPWSTR strarray)
inlinestatic

Definition at line 224 of file wldap32.h.

225 {
226  if (strarray)
227  {
228  LPWSTR *p = strarray;
229  while (*p) strfreeW( *p++ );
230  heap_free( strarray );
231  }
232 }
static void strfreeW(LPWSTR str)
Definition: wldap32.h:103
GLfloat GLfloat p
Definition: glext.h:8902
WCHAR * LPWSTR
Definition: xmlstorage.h:184
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by ldap_count_valuesA(), ldap_search_ext_sA(), ldap_search_extA(), ldap_search_sA(), ldap_search_stA(), ldap_searchA(), and ldap_value_freeW().

◆ strarraylenA()

static DWORD strarraylenA ( LPSTR strarray)
inlinestatic

Definition at line 113 of file wldap32.h.

114 {
115  LPSTR *p = strarray;
116  while (*p) p++;
117  return p - strarray;
118 }
char * LPSTR
Definition: xmlstorage.h:182
GLfloat GLfloat p
Definition: glext.h:8902

Referenced by strarrayAtoW().

◆ strarraylenU()

static DWORD strarraylenU ( char **  strarray)
inlinestatic

Definition at line 127 of file wldap32.h.

128 {
129  char **p = strarray;
130  while (*p) p++;
131  return p - strarray;
132 }
GLfloat GLfloat p
Definition: glext.h:8902

Referenced by strarrayUtoW().

◆ strarraylenW()

static DWORD strarraylenW ( LPWSTR strarray)
inlinestatic

Definition at line 120 of file wldap32.h.

121 {
122  LPWSTR *p = strarray;
123  while (*p) p++;
124  return p - strarray;
125 }
GLfloat GLfloat p
Definition: glext.h:8902
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by strarrayWtoA(), and strarrayWtoU().

◆ strarrayUtoW()

static LPWSTR* strarrayUtoW ( char **  strarray)
inlinestatic

Definition at line 194 of file wldap32.h.

195 {
196  LPWSTR *strarrayW = NULL;
197  DWORD size;
198 
199  if (strarray)
200  {
201  size = sizeof(WCHAR*) * (strarraylenU( strarray ) + 1);
202  if ((strarrayW = heap_alloc( size )))
203  {
204  char **p = strarray;
205  LPWSTR *q = strarrayW;
206 
207  while (*p) *q++ = strUtoW( *p++ );
208  *q = NULL;
209  }
210  }
211  return strarrayW;
212 }
static LPWSTR strUtoW(char *str)
Definition: wldap32.h:86
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
smooth NULL
Definition: ftsmooth.c:416
GLsizeiptr size
Definition: glext.h:5919
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
GLdouble GLdouble GLdouble GLdouble q
Definition: gl.h:2063
static DWORD strarraylenU(char **strarray)
Definition: wldap32.h:127
GLfloat GLfloat p
Definition: glext.h:8902
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by ldap_explode_dnW(), ldap_get_optionW(), ldap_get_valuesW(), ldap_parse_referenceW(), and ldap_parse_resultW().

◆ strarrayWtoA()

static LPSTR* strarrayWtoA ( LPWSTR strarray)
inlinestatic

Definition at line 154 of file wldap32.h.

155 {
156  LPSTR *strarrayA = NULL;
157  DWORD size;
158 
159  if (strarray)
160  {
161  size = sizeof(LPSTR) * (strarraylenW( strarray ) + 1);
162  if ((strarrayA = heap_alloc( size )))
163  {
164  LPWSTR *p = strarray;
165  LPSTR *q = strarrayA;
166 
167  while (*p) *q++ = strWtoA( *p++ );
168  *q = NULL;
169  }
170  }
171  return strarrayA;
172 }
char * LPSTR
Definition: xmlstorage.h:182
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
static LPSTR strWtoA(LPCWSTR str)
Definition: wldap32.h:62
smooth NULL
Definition: ftsmooth.c:416
GLsizeiptr size
Definition: glext.h:5919
unsigned long DWORD
Definition: ntddk_ex.h:95
GLdouble GLdouble GLdouble GLdouble q
Definition: gl.h:2063
static DWORD strarraylenW(LPWSTR *strarray)
Definition: wldap32.h:120
GLfloat GLfloat p
Definition: glext.h:8902
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by ldap_explode_dnA(), ldap_get_optionA(), ldap_get_valuesA(), ldap_parse_referenceA(), and ldap_parse_resultA().

◆ strarrayWtoU()

static char** strarrayWtoU ( LPWSTR strarray)
inlinestatic

Definition at line 174 of file wldap32.h.

175 {
176  char **strarrayU = NULL;
177  DWORD size;
178 
179  if (strarray)
180  {
181  size = sizeof(char*) * (strarraylenW( strarray ) + 1);
182  if ((strarrayU = heap_alloc( size )))
183  {
184  LPWSTR *p = strarray;
185  char **q = strarrayU;
186 
187  while (*p) *q++ = strWtoU( *p++ );
188  *q = NULL;
189  }
190  }
191  return strarrayU;
192 }
static char * strWtoU(LPCWSTR str)
Definition: wldap32.h:74
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
smooth NULL
Definition: ftsmooth.c:416
GLsizeiptr size
Definition: glext.h:5919
unsigned long DWORD
Definition: ntddk_ex.h:95
GLdouble GLdouble GLdouble GLdouble q
Definition: gl.h:2063
static DWORD strarraylenW(LPWSTR *strarray)
Definition: wldap32.h:120
GLfloat GLfloat p
Definition: glext.h:8902
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by ldap_search_ext_sW(), ldap_search_extW(), ldap_search_stW(), ldap_search_sW(), and ldap_searchW().

◆ strAtoW()

static LPWSTR strAtoW ( LPCSTR  str)
inlinestatic

Definition at line 50 of file wldap32.h.

51 {
52  LPWSTR ret = NULL;
53  if (str)
54  {
55  DWORD len = MultiByteToWideChar( CP_ACP, 0, str, -1, NULL, 0 );
56  if ((ret = heap_alloc( len * sizeof(WCHAR) )))
57  MultiByteToWideChar( CP_ACP, 0, str, -1, ret, len );
58  }
59  return ret;
60 }
#define CP_ACP
Definition: compat.h:99
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
GLenum GLsizei len
Definition: glext.h:6722
#define MultiByteToWideChar
Definition: compat.h:100
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by strarrayAtoW().

◆ strdupU()

static char* strdupU ( const char src)
inlinestatic

Definition at line 34 of file wldap32.h.

35 {
36  char *dst;
37  if (!src) return NULL;
38  if ((dst = heap_alloc( (strlen( src ) + 1) * sizeof(char) ))) strcpy( dst, src );
39  return dst;
40 }
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
smooth NULL
Definition: ftsmooth.c:416
GLenum src
Definition: glext.h:6340
GLenum GLenum dst
Definition: glext.h:6340
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388

Referenced by ldap_encode_sort_controlA().

◆ strdupW()

static WCHAR* strdupW ( const WCHAR src)
inlinestatic

Definition at line 42 of file wldap32.h.

43 {
44  WCHAR *dst;
45  if (!src) return NULL;
46  if ((dst = heap_alloc( (strlenW( src ) + 1) * sizeof(WCHAR) ))) strcpyW( dst, src );
47  return dst;
48 }
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
smooth NULL
Definition: ftsmooth.c:416
__wchar_t WCHAR
Definition: xmlstorage.h:180
GLenum src
Definition: glext.h:6340
WINE_UNICODE_INLINE WCHAR * strcpyW(WCHAR *dst, const WCHAR *src)
Definition: unicode.h:219
GLenum GLenum dst
Definition: glext.h:6340

◆ strfreeA()

static void strfreeA ( LPSTR  str)
inlinestatic

Definition at line 98 of file wldap32.h.

99 {
100  heap_free( str );
101 }
const WCHAR * str
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by ldap_memfreeA(), and strarrayfreeA().

◆ strfreeU()

◆ strfreeW()

◆ strUtoW()

static LPWSTR strUtoW ( char str)
inlinestatic

Definition at line 86 of file wldap32.h.

87 {
88  LPWSTR ret = NULL;
89  if (str)
90  {
91  DWORD len = MultiByteToWideChar( CP_UTF8, 0, str, -1, NULL, 0 );
92  if ((ret = heap_alloc( len * sizeof(WCHAR) )))
93  MultiByteToWideChar( CP_UTF8, 0, str, -1, ret, len );
94  }
95  return ret;
96 }
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
#define CP_UTF8
Definition: nls.h:20
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
GLenum GLsizei len
Definition: glext.h:6722
#define MultiByteToWideChar
Definition: compat.h:100
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by ldap_dn2ufnW(), ldap_extended_operation_sW(), ldap_first_attributeW(), ldap_get_dnW(), ldap_get_optionW(), ldap_next_attributeW(), ldap_parse_extended_resultW(), ldap_parse_resultW(), ldap_parse_sort_controlW(), ldap_ufn2dnW(), and strarrayUtoW().

◆ strWtoA()

static LPSTR strWtoA ( LPCWSTR  str)
inlinestatic

Definition at line 62 of file wldap32.h.

63 {
64  LPSTR ret = NULL;
65  if (str)
66  {
67  DWORD len = WideCharToMultiByte( CP_ACP, 0, str, -1, NULL, 0, NULL, NULL );
68  if ((ret = heap_alloc( len )))
69  WideCharToMultiByte( CP_ACP, 0, str, -1, ret, len, NULL, NULL );
70  }
71  return ret;
72 }
#define WideCharToMultiByte
Definition: compat.h:101
#define CP_ACP
Definition: compat.h:99
char * LPSTR
Definition: xmlstorage.h:182
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
GLenum GLsizei len
Definition: glext.h:6722

Referenced by ldap_dn2ufnA(), ldap_extended_operation_sA(), ldap_first_attributeA(), ldap_get_dnA(), ldap_get_optionA(), ldap_next_attributeA(), ldap_parse_extended_resultA(), ldap_parse_resultA(), ldap_parse_sort_controlA(), ldap_ufn2dnA(), and strarrayWtoA().

◆ strWtoU()

static char* strWtoU ( LPCWSTR  str)
inlinestatic

Definition at line 74 of file wldap32.h.

75 {
76  LPSTR ret = NULL;
77  if (str)
78  {
79  DWORD len = WideCharToMultiByte( CP_UTF8, 0, str, -1, NULL, 0, NULL, NULL );
80  if ((ret = heap_alloc( len )))
82  }
83  return ret;
84 }
#define WideCharToMultiByte
Definition: compat.h:101
char * LPSTR
Definition: xmlstorage.h:182
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
#define CP_UTF8
Definition: nls.h:20
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
GLenum GLsizei len
Definition: glext.h:6722

Referenced by cldap_openW(), ldap_add_ext_sW(), ldap_add_extW(), ldap_add_sW(), ldap_addW(), ldap_bind_sW(), ldap_bindW(), ldap_compare_ext_sW(), ldap_compare_extW(), ldap_compare_sW(), ldap_compareW(), ldap_delete_ext_sW(), ldap_delete_extW(), ldap_delete_sW(), ldap_deleteW(), ldap_dn2ufnW(), ldap_explode_dnW(), ldap_extended_operation_sW(), ldap_extended_operationW(), ldap_get_optionW(), ldap_get_values_lenW(), ldap_get_valuesW(), ldap_initW(), ldap_modify_ext_sW(), ldap_modify_extW(), ldap_modify_sW(), ldap_modifyW(), ldap_modrdn2_sW(), ldap_modrdn2W(), ldap_modrdn_sW(), ldap_modrdnW(), ldap_openW(), ldap_rename_ext_sW(), ldap_rename_extW(), ldap_sasl_bind_sW(), ldap_sasl_bindW(), ldap_search_ext_sW(), ldap_search_extW(), ldap_search_stW(), ldap_search_sW(), ldap_searchW(), ldap_simple_bind_sW(), ldap_simple_bindW(), ldap_sslinitW(), ldap_ufn2dnW(), and strarrayWtoU().

Variable Documentation

◆ DECLSPEC_HIDDEN

HINSTANCE hwldap32 DECLSPEC_HIDDEN

Definition at line 155 of file crypt32_private.h.