ReactOS 0.4.15-dev-7711-g5627da4
modrdn.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 modrdn.c:

Go to the source code of this file.

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (wldap32)
 
ULONG CDECL ldap_modrdnA (WLDAP32_LDAP *ld, PCHAR dn, PCHAR newdn)
 
ULONG CDECL ldap_modrdnW (WLDAP32_LDAP *ld, PWCHAR dn, PWCHAR newdn)
 
ULONG CDECL ldap_modrdn2A (WLDAP32_LDAP *ld, PCHAR dn, PCHAR newdn, INT delete)
 
ULONG CDECL ldap_modrdn2W (WLDAP32_LDAP *ld, PWCHAR dn, PWCHAR newdn, INT delete)
 
ULONG CDECL ldap_modrdn2_sA (WLDAP32_LDAP *ld, PCHAR dn, PCHAR newdn, INT delete)
 
ULONG CDECL ldap_modrdn2_sW (WLDAP32_LDAP *ld, PWCHAR dn, PWCHAR newdn, INT delete)
 
ULONG CDECL ldap_modrdn_sA (WLDAP32_LDAP *ld, PCHAR dn, PCHAR newdn)
 
ULONG CDECL ldap_modrdn_sW (WLDAP32_LDAP *ld, PWCHAR dn, PWCHAR newdn)
 

Function Documentation

◆ ldap_modrdn2_sA()

ULONG CDECL ldap_modrdn2_sA ( WLDAP32_LDAP ld,
PCHAR  dn,
PCHAR  newdn,
INT  delete 
)

Definition at line 225 of file modrdn.c.

226{
228#ifdef HAVE_LDAP
229 WCHAR *dnW = NULL, *newdnW = NULL;
230
232
233 TRACE( "(%p, %s, %p, 0x%02x)\n", ld, debugstr_a(dn), newdn, delete );
234
235 if (!ld || !newdn) return WLDAP32_LDAP_PARAM_ERROR;
236
237 if (dn) {
238 dnW = strAtoW( dn );
239 if (!dnW) goto exit;
240 }
241
242 newdnW = strAtoW( newdn );
243 if (!newdnW) goto exit;
244
245 ret = ldap_modrdn2_sW( ld, dnW, newdnW, delete );
246
247exit:
248 strfreeW( dnW );
249 strfreeW( newdnW );
250
251#endif
252 return ret;
253}
#define NULL
Definition: types.h:112
static LPWSTR strAtoW(const char *str)
#define debugstr_a
Definition: kernel32.h:31
ULONG CDECL ldap_modrdn2_sW(WLDAP32_LDAP *ld, PWCHAR dn, PWCHAR newdn, INT delete)
Definition: modrdn.c:270
#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_modrdn2_sW()

ULONG CDECL ldap_modrdn2_sW ( WLDAP32_LDAP ld,
PWCHAR  dn,
PWCHAR  newdn,
INT  delete 
)

Definition at line 270 of file modrdn.c.

271{
273#ifdef HAVE_LDAP
274 char *dnU = NULL, *newdnU = NULL;
275
277
278 TRACE( "(%p, %s, %p, 0x%02x)\n", ld, debugstr_w(dn), newdn, delete );
279
280 if (!ld || !newdn) return WLDAP32_LDAP_PARAM_ERROR;
281
282 if (dn) {
283 dnU = strWtoU( dn );
284 if (!dnU) goto exit;
285 }
286
287 newdnU = strWtoU( newdn );
288 if (!newdnU) goto exit;
289
290 ret = map_error( ldap_rename_s( ld, dn ? dnU : "", newdnU, NULL, delete, NULL, NULL ));
291
292exit:
293 strfreeU( dnU );
294 strfreeU( newdnU );
295
296#endif
297 return ret;
298}
static UINT map_error(DWORD error)
Definition: service.c:35
#define debugstr_w
Definition: kernel32.h:32
#define ldap_rename_s
Definition: winldap.h:699
static void strfreeU(char *str)
Definition: wldap32.h:108
static char * strWtoU(LPCWSTR str)
Definition: wldap32.h:74

Referenced by ldap_modrdn2_sA().

◆ ldap_modrdn2A()

ULONG CDECL ldap_modrdn2A ( WLDAP32_LDAP ld,
PCHAR  dn,
PCHAR  newdn,
INT  delete 
)

Definition at line 134 of file modrdn.c.

135{
137#ifdef HAVE_LDAP
138 WCHAR *dnW = NULL, *newdnW = NULL;
139
141
142 TRACE( "(%p, %s, %p, 0x%02x)\n", ld, debugstr_a(dn), newdn, delete );
143
144 if (!ld || !newdn) return ~0u;
145
146 if (dn) {
147 dnW = strAtoW( dn );
148 if (!dnW) goto exit;
149 }
150
151 newdnW = strAtoW( newdn );
152 if (!newdnW) goto exit;
153
154 ret = ldap_modrdn2W( ld, dnW, newdnW, delete );
155
156exit:
157 strfreeW( dnW );
158 strfreeW( newdnW );
159
160#endif
161 return ret;
162}
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
ULONG CDECL ldap_modrdn2W(WLDAP32_LDAP *ld, PWCHAR dn, PWCHAR newdn, INT delete)
Definition: modrdn.c:184

◆ ldap_modrdn2W()

ULONG CDECL ldap_modrdn2W ( WLDAP32_LDAP ld,
PWCHAR  dn,
PWCHAR  newdn,
INT  delete 
)

Definition at line 184 of file modrdn.c.

185{
187#ifdef HAVE_LDAP
188 char *dnU = NULL, *newdnU = NULL;
189 int msg;
190
192
193 TRACE( "(%p, %s, %p, 0x%02x)\n", ld, debugstr_w(dn), newdn, delete );
194
195 if (!ld || !newdn) return ~0u;
196
197 if (dn) {
198 dnU = strWtoU( dn );
199 if (!dnU) goto exit;
200 }
201
202 newdnU = strWtoU( newdn );
203 if (!newdnU) goto exit;
204
205 ret = ldap_rename( ld, dn ? dnU : "", newdnU, NULL, delete, NULL, NULL, &msg );
206
207 if (ret == LDAP_SUCCESS)
208 ret = msg;
209 else
210 ret = ~0u;
211
212exit:
213 strfreeU( dnU );
214 strfreeU( newdnU );
215
216#endif
217 return ret;
218}
#define msg(x)
Definition: auth_time.c:54
#define ldap_rename
Definition: winldap.h:698
#define LDAP_SUCCESS
Definition: winldap.h:59

Referenced by ldap_modrdn2A().

◆ ldap_modrdn_sA()

ULONG CDECL ldap_modrdn_sA ( WLDAP32_LDAP ld,
PCHAR  dn,
PCHAR  newdn 
)

Definition at line 305 of file modrdn.c.

306{
308#ifdef HAVE_LDAP
309 WCHAR *dnW = NULL, *newdnW = NULL;
310
312
313 TRACE( "(%p, %s, %p)\n", ld, debugstr_a(dn), newdn );
314
315 if (!ld || !newdn) return WLDAP32_LDAP_PARAM_ERROR;
316
317 if (dn) {
318 dnW = strAtoW( dn );
319 if (!dnW) goto exit;
320 }
321
322 newdnW = strAtoW( newdn );
323 if (!newdnW) goto exit;
324
325 ret = ldap_modrdn_sW( ld, dnW, newdnW );
326
327exit:
328 strfreeW( dnW );
329 strfreeW( newdnW );
330
331#endif
332 return ret;
333}
ULONG CDECL ldap_modrdn_sW(WLDAP32_LDAP *ld, PWCHAR dn, PWCHAR newdn)
Definition: modrdn.c:349

◆ ldap_modrdn_sW()

ULONG CDECL ldap_modrdn_sW ( WLDAP32_LDAP ld,
PWCHAR  dn,
PWCHAR  newdn 
)

Definition at line 349 of file modrdn.c.

350{
352#ifdef HAVE_LDAP
353 char *dnU = NULL, *newdnU = NULL;
354
356
357 TRACE( "(%p, %s, %p)\n", ld, debugstr_w(dn), newdn );
358
359 if (!ld || !newdn) return WLDAP32_LDAP_PARAM_ERROR;
360
361 if (dn) {
362 dnU = strWtoU( dn );
363 if (!dnU) goto exit;
364 }
365
366 newdnU = strWtoU( newdn );
367 if (!newdnU) goto exit;
368
369 ret = map_error( ldap_rename_s( ld, dn ? dnU : "", newdnU, NULL, 1, NULL, NULL ));
370
371exit:
372 strfreeU( dnU );
373 strfreeU( newdnU );
374
375#endif
376 return ret;
377}

Referenced by ldap_modrdn_sA().

◆ ldap_modrdnA()

ULONG CDECL ldap_modrdnA ( WLDAP32_LDAP ld,
PCHAR  dn,
PCHAR  newdn 
)

Definition at line 44 of file modrdn.c.

45{
47#ifdef HAVE_LDAP
48 WCHAR *dnW = NULL, *newdnW = NULL;
49
51
52 TRACE( "(%p, %s, %s)\n", ld, debugstr_a(dn), debugstr_a(newdn) );
53
54 if (!ld || !newdn) return ~0u;
55
56 if (dn) {
57 dnW = strAtoW( dn );
58 if (!dnW) goto exit;
59 }
60
61 newdnW = strAtoW( newdn );
62 if (!newdnW) goto exit;
63
64 ret = ldap_modrdnW( ld, dnW, newdnW );
65
66exit:
67 strfreeW( dnW );
68 strfreeW( newdnW );
69
70#endif
71 return ret;
72}
ULONG CDECL ldap_modrdnW(WLDAP32_LDAP *ld, PWCHAR dn, PWCHAR newdn)
Definition: modrdn.c:93

◆ ldap_modrdnW()

ULONG CDECL ldap_modrdnW ( WLDAP32_LDAP ld,
PWCHAR  dn,
PWCHAR  newdn 
)

Definition at line 93 of file modrdn.c.

94{
96#ifdef HAVE_LDAP
97 char *dnU = NULL, *newdnU = NULL;
98 int msg;
99
101
102 TRACE( "(%p, %s, %s)\n", ld, debugstr_w(dn), debugstr_w(newdn) );
103
104 if (!ld || !newdn) return ~0u;
105
106 if (dn) {
107 dnU = strWtoU( dn );
108 if (!dnU) goto exit;
109 }
110
111 newdnU = strWtoU( newdn );
112 if (!newdnU) goto exit;
113
114 ret = ldap_rename( ld, dn ? dnU : "", newdnU, NULL, 1, NULL, NULL, &msg );
115
116 if (ret == LDAP_SUCCESS)
117 ret = msg;
118 else
119 ret = ~0u;
120
121exit:
122 strfreeU( dnU );
123 strfreeU( newdnU );
124
125#endif
126 return ret;
127}

Referenced by ldap_modrdnA().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( wldap32  )