ReactOS 0.4.15-dev-7924-g5949c20
modify.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 modify.c:

Go to the source code of this file.

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (wldap32)
 
ULONG CDECL ldap_modifyA (WLDAP32_LDAP *ld, PCHAR dn, LDAPModA *mods[])
 
ULONG CDECL ldap_modifyW (WLDAP32_LDAP *ld, PWCHAR dn, LDAPModW *mods[])
 
ULONG CDECL ldap_modify_extA (WLDAP32_LDAP *ld, PCHAR dn, LDAPModA *mods[], PLDAPControlA *serverctrls, PLDAPControlA *clientctrls, ULONG *message)
 
ULONG CDECL ldap_modify_extW (WLDAP32_LDAP *ld, PWCHAR dn, LDAPModW *mods[], PLDAPControlW *serverctrls, PLDAPControlW *clientctrls, ULONG *message)
 
ULONG CDECL ldap_modify_ext_sA (WLDAP32_LDAP *ld, PCHAR dn, LDAPModA *mods[], PLDAPControlA *serverctrls, PLDAPControlA *clientctrls)
 
ULONG CDECL ldap_modify_ext_sW (WLDAP32_LDAP *ld, PWCHAR dn, LDAPModW *mods[], PLDAPControlW *serverctrls, PLDAPControlW *clientctrls)
 
ULONG CDECL ldap_modify_sA (WLDAP32_LDAP *ld, PCHAR dn, LDAPModA *mods[])
 
ULONG CDECL ldap_modify_sW (WLDAP32_LDAP *ld, PWCHAR dn, LDAPModW *mods[])
 

Function Documentation

◆ ldap_modify_ext_sA()

ULONG CDECL ldap_modify_ext_sA ( WLDAP32_LDAP ld,
PCHAR  dn,
LDAPModA mods[],
PLDAPControlA serverctrls,
PLDAPControlA clientctrls 
)

Definition at line 264 of file modify.c.

266{
268#ifdef HAVE_LDAP
269 WCHAR *dnW = NULL;
270 LDAPModW **modsW = NULL;
271 LDAPControlW **serverctrlsW = NULL, **clientctrlsW = NULL;
272
274
275 TRACE( "(%p, %s, %p, %p, %p)\n", ld, debugstr_a(dn), mods,
276 serverctrls, clientctrls );
277
278 if (!ld) return WLDAP32_LDAP_PARAM_ERROR;
279
280 if (dn) {
281 dnW = strAtoW( dn );
282 if (!dnW) goto exit;
283 }
284 if (mods) {
285 modsW = modarrayAtoW( mods );
286 if (!modsW) goto exit;
287 }
288 if (serverctrls) {
289 serverctrlsW = controlarrayAtoW( serverctrls );
290 if (!serverctrlsW) goto exit;
291 }
292 if (clientctrls) {
293 clientctrlsW = controlarrayAtoW( clientctrls );
294 if (!clientctrlsW) goto exit;
295 }
296
297 ret = ldap_modify_ext_sW( ld, dnW, modsW, serverctrlsW, clientctrlsW );
298
299exit:
300 strfreeW( dnW );
301 modarrayfreeW( modsW );
302 controlarrayfreeW( serverctrlsW );
303 controlarrayfreeW( clientctrlsW );
304
305#endif
306 return ret;
307}
#define NULL
Definition: types.h:112
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
ULONG CDECL ldap_modify_ext_sW(WLDAP32_LDAP *ld, PWCHAR dn, LDAPModW *mods[], PLDAPControlW *serverctrls, PLDAPControlW *clientctrls)
Definition: modify.c:330
static void strfreeW(LPWSTR str)
Definition: wldap32.h:103
__wchar_t WCHAR
Definition: xmlstorage.h:180

◆ ldap_modify_ext_sW()

ULONG CDECL ldap_modify_ext_sW ( WLDAP32_LDAP ld,
PWCHAR  dn,
LDAPModW mods[],
PLDAPControlW serverctrls,
PLDAPControlW clientctrls 
)

Definition at line 330 of file modify.c.

332{
334#ifdef HAVE_LDAP
335 char *dnU = NULL;
336 LDAPMod **modsU = NULL;
337 LDAPControl **serverctrlsU = NULL, **clientctrlsU = NULL;
338
340
341 TRACE( "(%p, %s, %p, %p, %p)\n", ld, debugstr_w(dn), mods,
342 serverctrls, clientctrls );
343
344 if (!ld) return WLDAP32_LDAP_PARAM_ERROR;
345
346 if (dn) {
347 dnU = strWtoU( dn );
348 if (!dnU) goto exit;
349 }
350 if (mods) {
351 modsU = modarrayWtoU( mods );
352 if (!modsU) goto exit;
353 }
354 if (serverctrls) {
355 serverctrlsU = controlarrayWtoU( serverctrls );
356 if (!serverctrlsU) goto exit;
357 }
358 if (clientctrls) {
359 clientctrlsU = controlarrayWtoU( clientctrls );
360 if (!clientctrlsU) goto exit;
361 }
362
363 ret = map_error( ldap_modify_ext_s( ld, dn ? dnU : "", mods ? modsU : nullmods,
364 serverctrlsU, clientctrlsU ));
365
366exit:
367 strfreeU( dnU );
368 modarrayfreeU( modsU );
369 controlarrayfreeU( serverctrlsU );
370 controlarrayfreeU( clientctrlsU );
371
372#endif
373 return ret;
374}
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_modify_ext_s
Definition: winldap.h:660
static void strfreeU(char *str)
Definition: wldap32.h:108
static char * strWtoU(LPCWSTR str)
Definition: wldap32.h:74

Referenced by ldap_modify_ext_sA().

◆ ldap_modify_extA()

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

Definition at line 144 of file modify.c.

146{
148#ifdef HAVE_LDAP
149 WCHAR *dnW = NULL;
150 LDAPModW **modsW = NULL;
151 LDAPControlW **serverctrlsW = NULL, **clientctrlsW = NULL;
152
154
155 TRACE( "(%p, %s, %p, %p, %p, %p)\n", ld, debugstr_a(dn), mods,
156 serverctrls, clientctrls, message );
157
158 if (!ld) return ~0u;
159
160 if (dn) {
161 dnW = strAtoW( dn );
162 if (!dnW) goto exit;
163 }
164 if (mods) {
165 modsW = modarrayAtoW( mods );
166 if (!modsW) goto exit;
167 }
168 if (serverctrls) {
169 serverctrlsW = controlarrayAtoW( serverctrls );
170 if (!serverctrlsW) goto exit;
171 }
172 if (clientctrls) {
173 clientctrlsW = controlarrayAtoW( clientctrls );
174 if (!clientctrlsW) goto exit;
175 }
176
177 ret = ldap_modify_extW( ld, dnW, modsW, serverctrlsW, clientctrlsW, message );
178
179exit:
180 strfreeW( dnW );
181 modarrayfreeW( modsW );
182 controlarrayfreeW( serverctrlsW );
183 controlarrayfreeW( clientctrlsW );
184
185#endif
186 return ret;
187}
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
Definition: tftpd.h:60
ULONG CDECL ldap_modify_extW(WLDAP32_LDAP *ld, PWCHAR dn, LDAPModW *mods[], PLDAPControlW *serverctrls, PLDAPControlW *clientctrls, ULONG *message)
Definition: modify.c:212

◆ ldap_modify_extW()

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

Definition at line 212 of file modify.c.

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

Referenced by ldap_modify_extA().

◆ ldap_modify_sA()

ULONG CDECL ldap_modify_sA ( WLDAP32_LDAP ld,
PCHAR  dn,
LDAPModA mods[] 
)

Definition at line 381 of file modify.c.

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

◆ ldap_modify_sW()

ULONG CDECL ldap_modify_sW ( WLDAP32_LDAP ld,
PWCHAR  dn,
LDAPModW mods[] 
)

Definition at line 428 of file modify.c.

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

Referenced by ldap_modify_sA().

◆ ldap_modifyA()

ULONG CDECL ldap_modifyA ( WLDAP32_LDAP ld,
PCHAR  dn,
LDAPModA mods[] 
)

Definition at line 48 of file modify.c.

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

◆ ldap_modifyW()

ULONG CDECL ldap_modifyW ( WLDAP32_LDAP ld,
PWCHAR  dn,
LDAPModW mods[] 
)

Definition at line 100 of file modify.c.

101{
103#ifdef HAVE_LDAP
104 char *dnU = NULL;
105 LDAPMod **modsU = NULL;
106 int msg;
107
109
110 TRACE( "(%p, %s, %p)\n", ld, debugstr_w(dn), mods );
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 (mods) {
119 modsU = modarrayWtoU( mods );
120 if (!modsU) goto exit;
121 }
122
123 ret = ldap_modify_ext( ld, dn ? dnU : "", mods ? modsU : nullmods,
124 NULL, NULL, &msg );
125
126 if (ret == LDAP_SUCCESS)
127 ret = msg;
128 else
129 ret = ~0u;
130
131exit:
132 strfreeU( dnU );
133 modarrayfreeU( modsU );
134
135#endif
136 return ret;
137}
#define msg(x)
Definition: auth_time.c:54
#define LDAP_SUCCESS
Definition: winldap.h:59

Referenced by ldap_modifyA().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( wldap32  )