ReactOS 0.4.15-dev-8241-g63935f8
rename.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 rename.c:

Go to the source code of this file.

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (wldap32)
 
ULONG CDECL ldap_rename_extA (WLDAP32_LDAP *ld, PCHAR dn, PCHAR newrdn, PCHAR newparent, INT delete, PLDAPControlA *serverctrls, PLDAPControlA *clientctrls, ULONG *message)
 
ULONG CDECL ldap_rename_extW (WLDAP32_LDAP *ld, PWCHAR dn, PWCHAR newrdn, PWCHAR newparent, INT delete, PLDAPControlW *serverctrls, PLDAPControlW *clientctrls, ULONG *message)
 
ULONG CDECL ldap_rename_ext_sA (WLDAP32_LDAP *ld, PCHAR dn, PCHAR newrdn, PCHAR newparent, INT delete, PLDAPControlA *serverctrls, PLDAPControlA *clientctrls)
 
ULONG CDECL ldap_rename_ext_sW (WLDAP32_LDAP *ld, PWCHAR dn, PWCHAR newrdn, PWCHAR newparent, INT delete, PLDAPControlW *serverctrls, PLDAPControlW *clientctrls)
 

Function Documentation

◆ ldap_rename_ext_sA()

ULONG CDECL ldap_rename_ext_sA ( WLDAP32_LDAP ld,
PCHAR  dn,
PCHAR  newrdn,
PCHAR  newparent,
INT  delete,
PLDAPControlA serverctrls,
PLDAPControlA clientctrls 
)

Definition at line 177 of file rename.c.

180{
182#ifdef HAVE_LDAP
183 WCHAR *dnW = NULL, *newrdnW = NULL, *newparentW = NULL;
184 LDAPControlW **serverctrlsW = NULL, **clientctrlsW = NULL;
185
187
188 TRACE( "(%p, %s, %s, %s, 0x%02x, %p, %p)\n", ld, debugstr_a(dn),
189 debugstr_a(newrdn), debugstr_a(newparent), delete,
190 serverctrls, clientctrls );
191
192 if (!ld) return WLDAP32_LDAP_PARAM_ERROR;
193
194 if (dn) {
195 dnW = strAtoW( dn );
196 if (!dnW) goto exit;
197 }
198 if (newrdn) {
199 newrdnW = strAtoW( newrdn );
200 if (!newrdnW) goto exit;
201 }
202 if (newparent) {
203 newparentW = strAtoW( newparent );
204 if (!newparentW) goto exit;
205 }
206 if (serverctrls) {
207 serverctrlsW = controlarrayAtoW( serverctrls );
208 if (!serverctrlsW) goto exit;
209 }
210 if (clientctrls) {
211 clientctrlsW = controlarrayAtoW( clientctrls );
212 if (!clientctrlsW) goto exit;
213 }
214
215 ret = ldap_rename_ext_sW( ld, dnW, newrdnW, newparentW, delete,
216 serverctrlsW, clientctrlsW );
217
218exit:
219 strfreeW( dnW );
220 strfreeW( newrdnW );
221 strfreeW( newparentW );
222 controlarrayfreeW( serverctrlsW );
223 controlarrayfreeW( clientctrlsW );
224
225#endif
226 return ret;
227}
#define NULL
Definition: types.h:112
static LPWSTR strAtoW(const char *str)
#define debugstr_a
Definition: kernel32.h:31
ULONG CDECL ldap_rename_ext_sW(WLDAP32_LDAP *ld, PWCHAR dn, PWCHAR newrdn, PWCHAR newparent, INT delete, PLDAPControlW *serverctrls, PLDAPControlW *clientctrls)
Definition: rename.c:246
#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_rename_ext_sW()

ULONG CDECL ldap_rename_ext_sW ( WLDAP32_LDAP ld,
PWCHAR  dn,
PWCHAR  newrdn,
PWCHAR  newparent,
INT  delete,
PLDAPControlW serverctrls,
PLDAPControlW clientctrls 
)

Definition at line 246 of file rename.c.

249{
251#ifdef HAVE_LDAP
252 char *dnU = NULL, *newrdnU = NULL, *newparentU = NULL;
253 LDAPControl **serverctrlsU = NULL, **clientctrlsU = NULL;
254
256
257 TRACE( "(%p, %s, %s, %s, 0x%02x, %p, %p)\n", ld, debugstr_w(dn),
258 debugstr_w(newrdn), debugstr_w(newparent), delete,
259 serverctrls, clientctrls );
260
261 if (!ld) return WLDAP32_LDAP_PARAM_ERROR;
262
263 if (dn) {
264 dnU = strWtoU( dn );
265 if (!dnU) goto exit;
266 }
267 if (newrdn) {
268 newrdnU = strWtoU( newrdn );
269 if (!newrdnU) goto exit;
270 }
271 if (newparent) {
272 newparentU = strWtoU( newparent );
273 if (!newparentU) goto exit;
274 }
275 if (serverctrls) {
276 serverctrlsU = controlarrayWtoU( serverctrls );
277 if (!serverctrlsU) goto exit;
278 }
279 if (clientctrls) {
280 clientctrlsU = controlarrayWtoU( clientctrls );
281 if (!clientctrlsU) goto exit;
282 }
283
284 ret = map_error( ldap_rename_s( ld, dn ? dnU : "", newrdn ? newrdnU : "", newparentU,
285 delete, serverctrlsU, clientctrlsU ));
286
287exit:
288 strfreeU( dnU );
289 strfreeU( newrdnU );
290 strfreeU( newparentU );
291 controlarrayfreeU( serverctrlsU );
292 controlarrayfreeU( clientctrlsU );
293
294#endif
295 return ret;
296}
static UINT map_error(DWORD error)
Definition: service.c:35
#define debugstr_w
Definition: kernel32.h:32
#define LDAPControl
Definition: winldap.h:620
#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_rename_ext_sA().

◆ ldap_rename_extA()

ULONG CDECL ldap_rename_extA ( WLDAP32_LDAP ld,
PCHAR  dn,
PCHAR  newrdn,
PCHAR  newparent,
INT  delete,
PLDAPControlA serverctrls,
PLDAPControlA clientctrls,
ULONG message 
)

Definition at line 44 of file rename.c.

47{
49#ifdef HAVE_LDAP
50 WCHAR *dnW = NULL, *newrdnW = NULL, *newparentW = NULL;
51 LDAPControlW **serverctrlsW = NULL, **clientctrlsW = NULL;
52
54
55 TRACE( "(%p, %s, %s, %s, 0x%02x, %p, %p, %p)\n", ld, debugstr_a(dn),
56 debugstr_a(newrdn), debugstr_a(newparent), delete,
57 serverctrls, clientctrls, message );
58
59 if (!ld || !message) return WLDAP32_LDAP_PARAM_ERROR;
60
61 if (dn) {
62 dnW = strAtoW( dn );
63 if (!dnW) goto exit;
64 }
65 if (newrdn) {
66 newrdnW = strAtoW( newrdn );
67 if (!newrdnW) goto exit;
68 }
69 if (newparent) {
70 newparentW = strAtoW( newparent );
71 if (!newparentW) goto exit;
72 }
73 if (serverctrls) {
74 serverctrlsW = controlarrayAtoW( serverctrls );
75 if (!serverctrlsW) goto exit;
76 }
77 if (clientctrls) {
78 clientctrlsW = controlarrayAtoW( clientctrls );
79 if (!clientctrlsW) goto exit;
80 }
81
82 ret = ldap_rename_extW( ld, dnW, newrdnW, newparentW, delete,
83 serverctrlsW, clientctrlsW, message );
84
85exit:
86 strfreeW( dnW );
87 strfreeW( newrdnW );
88 strfreeW( newparentW );
89 controlarrayfreeW( serverctrlsW );
90 controlarrayfreeW( clientctrlsW );
91
92#endif
93 return ret;
94}
ULONG CDECL ldap_rename_extW(WLDAP32_LDAP *ld, PWCHAR dn, PWCHAR newrdn, PWCHAR newparent, INT delete, PLDAPControlW *serverctrls, PLDAPControlW *clientctrls, ULONG *message)
Definition: rename.c:120
Definition: tftpd.h:60

◆ ldap_rename_extW()

ULONG CDECL ldap_rename_extW ( WLDAP32_LDAP ld,
PWCHAR  dn,
PWCHAR  newrdn,
PWCHAR  newparent,
INT  delete,
PLDAPControlW serverctrls,
PLDAPControlW clientctrls,
ULONG message 
)

Definition at line 120 of file rename.c.

123{
125#ifdef HAVE_LDAP
126 char *dnU = NULL, *newrdnU = NULL, *newparentU = NULL;
127 LDAPControl **serverctrlsU = NULL, **clientctrlsU = NULL;
128
130
131 TRACE( "(%p, %s, %s, %s, 0x%02x, %p, %p, %p)\n", ld, debugstr_w(dn),
132 debugstr_w(newrdn), debugstr_w(newparent), delete,
133 serverctrls, clientctrls, message );
134
135 if (!ld || !message) return WLDAP32_LDAP_PARAM_ERROR;
136
137 if (dn) {
138 dnU = strWtoU( dn );
139 if (!dnU) goto exit;
140 }
141 if (newrdn) {
142 newrdnU = strWtoU( newrdn );
143 if (!newrdnU) goto exit;
144 }
145 if (newparent) {
146 newparentU = strWtoU( newparent );
147 if (!newparentU) goto exit;
148 }
149 if (serverctrls) {
150 serverctrlsU = controlarrayWtoU( serverctrls );
151 if (!serverctrlsU) goto exit;
152 }
153 if (clientctrls) {
154 clientctrlsU = controlarrayWtoU( clientctrls );
155 if (!clientctrlsU) goto exit;
156 }
157
158 ret = map_error( ldap_rename( ld, dn ? dnU : "", newrdn ? newrdnU : "", newparentU,
159 delete, serverctrlsU, clientctrlsU, (int *)message ));
160
161exit:
162 strfreeU( dnU );
163 strfreeU( newrdnU );
164 strfreeU( newparentU );
165 controlarrayfreeU( serverctrlsU );
166 controlarrayfreeU( clientctrlsU );
167
168#endif
169 return ret;
170}
#define ldap_rename
Definition: winldap.h:698

Referenced by ldap_rename_extA().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( wldap32  )