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

Go to the source code of this file.

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (wldap32)
 
ULONG CDECL ldap_addA (WLDAP32_LDAP *ld, PCHAR dn, LDAPModA *attrs[])
 
ULONG CDECL ldap_addW (WLDAP32_LDAP *ld, PWCHAR dn, LDAPModW *attrs[])
 
ULONG CDECL ldap_add_extA (WLDAP32_LDAP *ld, PCHAR dn, LDAPModA *attrs[], PLDAPControlA *serverctrls, PLDAPControlA *clientctrls, ULONG *message)
 
ULONG CDECL ldap_add_extW (WLDAP32_LDAP *ld, PWCHAR dn, LDAPModW *attrs[], PLDAPControlW *serverctrls, PLDAPControlW *clientctrls, ULONG *message)
 
ULONG CDECL ldap_add_ext_sA (WLDAP32_LDAP *ld, PCHAR dn, LDAPModA *attrs[], PLDAPControlA *serverctrls, PLDAPControlA *clientctrls)
 
ULONG CDECL ldap_add_ext_sW (WLDAP32_LDAP *ld, PWCHAR dn, LDAPModW *attrs[], PLDAPControlW *serverctrls, PLDAPControlW *clientctrls)
 
ULONG CDECL ldap_add_sA (WLDAP32_LDAP *ld, PCHAR dn, LDAPModA *attrs[])
 
ULONG CDECL ldap_add_sW (WLDAP32_LDAP *ld, PWCHAR dn, LDAPModW *attrs[])
 

Function Documentation

◆ ldap_add_ext_sA()

ULONG CDECL ldap_add_ext_sA ( WLDAP32_LDAP ld,
PCHAR  dn,
LDAPModA attrs[],
PLDAPControlA serverctrls,
PLDAPControlA clientctrls 
)

Definition at line 263 of file add.c.

265{
267#ifdef HAVE_LDAP
268 WCHAR *dnW = NULL;
269 LDAPModW **attrsW = NULL;
270 LDAPControlW **serverctrlsW = NULL, **clientctrlsW = NULL;
271
273
274 TRACE( "(%p, %s, %p, %p, %p)\n", ld, debugstr_a(dn), attrs,
275 serverctrls, clientctrls );
276
277 if (!ld) return WLDAP32_LDAP_PARAM_ERROR;
278
279 if (dn) {
280 dnW = strAtoW( dn );
281 if (!dnW) goto exit;
282 }
283 if (attrs) {
284 attrsW = modarrayAtoW( attrs );
285 if (!attrsW) goto exit;
286 }
287 if (serverctrls) {
288 serverctrlsW = controlarrayAtoW( serverctrls );
289 if (!serverctrlsW) goto exit;
290 }
291 if (clientctrls) {
292 clientctrlsW = controlarrayAtoW( clientctrls );
293 if (!clientctrlsW) goto exit;
294 }
295
296 ret = ldap_add_ext_sW( ld, dnW, attrsW, serverctrlsW, clientctrlsW );
297
298exit:
299 strfreeW( dnW );
300 modarrayfreeW( attrsW );
301 controlarrayfreeW( serverctrlsW );
302 controlarrayfreeW( clientctrlsW );
303
304#endif
305 return ret;
306}
#define NULL
Definition: types.h:112
ULONG CDECL ldap_add_ext_sW(WLDAP32_LDAP *ld, PWCHAR dn, LDAPModW *attrs[], PLDAPControlW *serverctrls, PLDAPControlW *clientctrls)
Definition: add.c:329
static LPWSTR strAtoW(const char *str)
#define debugstr_a
Definition: kernel32.h:31
#define exit(n)
Definition: config.h:202
#define TRACE(s)
Definition: solgame.cpp:4
uint32_t ULONG
Definition: typedefs.h:59
int ret
@ WLDAP32_LDAP_PARAM_ERROR
@ WLDAP32_LDAP_NOT_SUPPORTED
@ WLDAP32_LDAP_NO_MEMORY
static void strfreeW(LPWSTR str)
Definition: wldap32.h:103
__wchar_t WCHAR
Definition: xmlstorage.h:180

◆ ldap_add_ext_sW()

ULONG CDECL ldap_add_ext_sW ( WLDAP32_LDAP ld,
PWCHAR  dn,
LDAPModW attrs[],
PLDAPControlW serverctrls,
PLDAPControlW clientctrls 
)

Definition at line 329 of file add.c.

331{
333#ifdef HAVE_LDAP
334 char *dnU = NULL;
335 LDAPMod **attrsU = NULL;
336 LDAPControl **serverctrlsU = NULL, **clientctrlsU = NULL;
337
339
340 TRACE( "(%p, %s, %p, %p, %p)\n", ld, debugstr_w(dn), attrs,
341 serverctrls, clientctrls );
342
343 if (!ld) return WLDAP32_LDAP_PARAM_ERROR;
344
345 if (dn) {
346 dnU = strWtoU( dn );
347 if (!dnU) goto exit;
348 }
349 if (attrs) {
350 attrsU = modarrayWtoU( attrs );
351 if (!attrsU) goto exit;
352 }
353 if (serverctrls) {
354 serverctrlsU = controlarrayWtoU( serverctrls );
355 if (!serverctrlsU) goto exit;
356 }
357 if (clientctrls) {
358 clientctrlsU = controlarrayWtoU( clientctrls );
359 if (!clientctrlsU) goto exit;
360 }
361
362 ret = map_error( ldap_add_ext_s( ld, dn ? dnU : "", attrs ? attrsU : nullattrs,
363 serverctrlsU, clientctrlsU ));
364
365exit:
366 strfreeU( dnU );
367 modarrayfreeU( attrsU );
368 controlarrayfreeU( serverctrlsU );
369 controlarrayfreeU( clientctrlsU );
370
371#endif
372 return ret;
373}
static UINT map_error(DWORD error)
Definition: service.c:35
#define debugstr_w
Definition: kernel32.h:32
#define LDAPControl
Definition: winldap.h:620
#define LDAPMod
Definition: winldap.h:622
#define ldap_add_ext_s
Definition: winldap.h:646
static void strfreeU(char *str)
Definition: wldap32.h:108
static char * strWtoU(LPCWSTR str)
Definition: wldap32.h:74

Referenced by ldap_add_ext_sA().

◆ ldap_add_extA()

ULONG CDECL ldap_add_extA ( WLDAP32_LDAP ld,
PCHAR  dn,
LDAPModA attrs[],
PLDAPControlA serverctrls,
PLDAPControlA clientctrls,
ULONG message 
)

Definition at line 143 of file add.c.

145{
147#ifdef HAVE_LDAP
148 WCHAR *dnW = NULL;
149 LDAPModW **attrsW = NULL;
150 LDAPControlW **serverctrlsW = NULL, **clientctrlsW = NULL;
151
153
154 TRACE( "(%p, %s, %p, %p, %p, %p)\n", ld, debugstr_a(dn), attrs,
155 serverctrls, clientctrls, message );
156
157 if (!ld) return WLDAP32_LDAP_PARAM_ERROR;
158
159 if (dn) {
160 dnW = strAtoW( dn );
161 if (!dnW) goto exit;
162 }
163 if (attrs) {
164 attrsW = modarrayAtoW( attrs );
165 if (!attrsW) goto exit;
166 }
167 if (serverctrls) {
168 serverctrlsW = controlarrayAtoW( serverctrls );
169 if (!serverctrlsW) goto exit;
170 }
171 if (clientctrls) {
172 clientctrlsW = controlarrayAtoW( clientctrls );
173 if (!clientctrlsW) goto exit;
174 }
175
176 ret = ldap_add_extW( ld, dnW, attrsW, serverctrlsW, clientctrlsW, message );
177
178exit:
179 strfreeW( dnW );
180 modarrayfreeW( attrsW );
181 controlarrayfreeW( serverctrlsW );
182 controlarrayfreeW( clientctrlsW );
183
184#endif
185 return ret;
186}
ULONG CDECL ldap_add_extW(WLDAP32_LDAP *ld, PWCHAR dn, LDAPModW *attrs[], PLDAPControlW *serverctrls, PLDAPControlW *clientctrls, ULONG *message)
Definition: add.c:211
Definition: tftpd.h:60

◆ ldap_add_extW()

ULONG CDECL ldap_add_extW ( WLDAP32_LDAP ld,
PWCHAR  dn,
LDAPModW attrs[],
PLDAPControlW serverctrls,
PLDAPControlW clientctrls,
ULONG message 
)

Definition at line 211 of file add.c.

213{
215#ifdef HAVE_LDAP
216 char *dnU = NULL;
217 LDAPMod **attrsU = NULL;
218 LDAPControl **serverctrlsU = NULL, **clientctrlsU = NULL;
219 int dummy;
220
222
223 TRACE( "(%p, %s, %p, %p, %p, %p)\n", ld, debugstr_w(dn), attrs,
224 serverctrls, clientctrls, message );
225
226 if (!ld) return WLDAP32_LDAP_PARAM_ERROR;
227
228 if (dn) {
229 dnU = strWtoU( dn );
230 if (!dnU) goto exit;
231 }
232 if (attrs) {
233 attrsU = modarrayWtoU( attrs );
234 if (!attrsU) goto exit;
235 }
236 if (serverctrls) {
237 serverctrlsU = controlarrayWtoU( serverctrls );
238 if (!serverctrlsU) goto exit;
239 }
240 if (clientctrls) {
241 clientctrlsU = controlarrayWtoU( clientctrls );
242 if (!clientctrlsU) goto exit;
243 }
244
245 ret = map_error( ldap_add_ext( ld, dn ? dnU : "", attrs ? attrsU : nullattrs, serverctrlsU,
246 clientctrlsU, message ? (int *)message : &dummy ));
247
248exit:
249 strfreeU( dnU );
250 modarrayfreeU( attrsU );
251 controlarrayfreeU( serverctrlsU );
252 controlarrayfreeU( clientctrlsU );
253
254#endif
255 return ret;
256}
#define ldap_add_ext
Definition: winldap.h:644

Referenced by ldap_add_extA().

◆ ldap_add_sA()

ULONG CDECL ldap_add_sA ( WLDAP32_LDAP ld,
PCHAR  dn,
LDAPModA attrs[] 
)

Definition at line 380 of file add.c.

381{
383#ifdef HAVE_LDAP
384 WCHAR *dnW = NULL;
385 LDAPModW **attrsW = NULL;
386
388
389 TRACE( "(%p, %s, %p)\n", ld, debugstr_a(dn), attrs );
390
391 if (!ld) return WLDAP32_LDAP_PARAM_ERROR;
392
393 if (dn) {
394 dnW = strAtoW( dn );
395 if (!dnW) goto exit;
396 }
397 if (attrs) {
398 attrsW = modarrayAtoW( attrs );
399 if (!attrsW) goto exit;
400 }
401
402 ret = ldap_add_sW( ld, dnW, attrsW );
403
404exit:
405 strfreeW( dnW );
406 modarrayfreeW( attrsW );
407
408#endif
409 return ret;
410}
ULONG CDECL ldap_add_sW(WLDAP32_LDAP *ld, PWCHAR dn, LDAPModW *attrs[])
Definition: add.c:427

◆ ldap_add_sW()

ULONG CDECL ldap_add_sW ( WLDAP32_LDAP ld,
PWCHAR  dn,
LDAPModW attrs[] 
)

Definition at line 427 of file add.c.

428{
430#ifdef HAVE_LDAP
431 char *dnU = NULL;
432 LDAPMod **attrsU = NULL;
433
435
436 TRACE( "(%p, %s, %p)\n", ld, debugstr_w(dn), attrs );
437
438 if (!ld) return WLDAP32_LDAP_PARAM_ERROR;
439
440 if (dn) {
441 dnU = strWtoU( dn );
442 if (!dnU) goto exit;
443 }
444 if (attrs) {
445 attrsU = modarrayWtoU( attrs );
446 if (!attrsU) goto exit;
447 }
448
449 ret = map_error( ldap_add_ext_s( ld, dn ? dnU : "", attrs ? attrsU : nullattrs, NULL, NULL ));
450
451exit:
452 strfreeU( dnU );
453 modarrayfreeU( attrsU );
454
455#endif
456 return ret;
457}

Referenced by ldap_add_sA().

◆ ldap_addA()

ULONG CDECL ldap_addA ( WLDAP32_LDAP ld,
PCHAR  dn,
LDAPModA attrs[] 
)

Definition at line 48 of file add.c.

49{
51#ifdef HAVE_LDAP
52 WCHAR *dnW = NULL;
53 LDAPModW **attrsW = NULL;
54
56
57 TRACE( "(%p, %s, %p)\n", ld, debugstr_a(dn), attrs );
58
59 if (!ld) return ~0u;
60
61 if (dn) {
62 dnW = strAtoW( dn );
63 if (!dnW) goto exit;
64 }
65 if (attrs) {
66 attrsW = modarrayAtoW( attrs );
67 if (!attrsW) goto exit;
68 }
69
70 ret = ldap_addW( ld, dnW, attrsW );
71
72exit:
73 strfreeW( dnW );
74 modarrayfreeW( attrsW );
75
76#endif
77 return ret;
78}
ULONG CDECL ldap_addW(WLDAP32_LDAP *ld, PWCHAR dn, LDAPModW *attrs[])
Definition: add.c:100
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

◆ ldap_addW()

ULONG CDECL ldap_addW ( WLDAP32_LDAP ld,
PWCHAR  dn,
LDAPModW attrs[] 
)

Definition at line 100 of file add.c.

101{
103#ifdef HAVE_LDAP
104 char *dnU = NULL;
105 LDAPMod **attrsU = NULL;
106 int msg;
107
109
110 TRACE( "(%p, %s, %p)\n", ld, debugstr_w(dn), attrs );
111
112 if (!ld) return WLDAP32_LDAP_PARAM_ERROR;
113
114 if (dn) {
115 dnU = strWtoU( dn );
116 if (!dnU) goto exit;
117 }
118 if (attrs) {
119 attrsU = modarrayWtoU( attrs );
120 if (!attrsU) goto exit;
121 }
122
123 ret = ldap_add_ext( ld, dn ? dnU : "", attrs ? attrsU : nullattrs, NULL, NULL, &msg );
124
125 if (ret == LDAP_SUCCESS)
126 ret = msg;
127 else
128 ret = ~0u;
129
130exit:
131 strfreeU( dnU );
132 modarrayfreeU( attrsU );
133
134#endif
135 return ret;
136}
#define msg(x)
Definition: auth_time.c:54
#define LDAP_SUCCESS
Definition: winldap.h:59

Referenced by ldap_addA().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( wldap32  )