ReactOS 0.4.16-dev-109-gf4cb10f
extended.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 extended.c:

Go to the source code of this file.

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (wldap32)
 
ULONG CDECL ldap_close_extended_op (WLDAP32_LDAP *ld, ULONG msgid)
 
ULONG CDECL ldap_extended_operationA (WLDAP32_LDAP *ld, PCHAR oid, struct WLDAP32_berval *data, PLDAPControlA *serverctrls, PLDAPControlA *clientctrls, ULONG *message)
 
ULONG CDECL ldap_extended_operationW (WLDAP32_LDAP *ld, PWCHAR oid, struct WLDAP32_berval *data, PLDAPControlW *serverctrls, PLDAPControlW *clientctrls, ULONG *message)
 
ULONG CDECL ldap_extended_operation_sA (WLDAP32_LDAP *ld, PCHAR oid, struct WLDAP32_berval *data, PLDAPControlA *serverctrls, PLDAPControlA *clientctrls, PCHAR *retoid, struct WLDAP32_berval **retdata)
 
ULONG CDECL ldap_extended_operation_sW (WLDAP32_LDAP *ld, PWCHAR oid, struct WLDAP32_berval *data, PLDAPControlW *serverctrls, PLDAPControlW *clientctrls, PWCHAR *retoid, struct WLDAP32_berval **retdata)
 

Function Documentation

◆ ldap_close_extended_op()

ULONG CDECL ldap_close_extended_op ( WLDAP32_LDAP ld,
ULONG  msgid 
)

Definition at line 56 of file extended.c.

57{
58 TRACE( "(%p, 0x%08x)\n", ld, msgid );
59
60 if (!ld) return WLDAP32_LDAP_PARAM_ERROR;
62}
#define TRACE(s)
Definition: solgame.cpp:4
@ WLDAP32_LDAP_PARAM_ERROR
@ WLDAP32_LDAP_SUCCESS

◆ ldap_extended_operation_sA()

ULONG CDECL ldap_extended_operation_sA ( WLDAP32_LDAP ld,
PCHAR  oid,
struct WLDAP32_berval data,
PLDAPControlA serverctrls,
PLDAPControlA clientctrls,
PCHAR retoid,
struct WLDAP32_berval **  retdata 
)

Definition at line 178 of file extended.c.

181{
183#ifdef HAVE_LDAP
184 WCHAR *oidW = NULL, *retoidW = NULL;
185 LDAPControlW **serverctrlsW = NULL, **clientctrlsW = NULL;
186
188
189 TRACE( "(%p, %s, %p, %p, %p, %p, %p)\n", ld, debugstr_a(oid), data, serverctrls,
190 clientctrls, retoid, retdata );
191
192 if (!ld) return WLDAP32_LDAP_PARAM_ERROR;
193
194 if (oid) {
195 oidW = strAtoW( oid );
196 if (!oidW) goto exit;
197 }
198 if (serverctrls) {
199 serverctrlsW = controlarrayAtoW( serverctrls );
200 if (!serverctrlsW) goto exit;
201 }
202 if (clientctrls) {
203 clientctrlsW = controlarrayAtoW( clientctrls );
204 if (!clientctrlsW) goto exit;
205 }
206
207 ret = ldap_extended_operation_sW( ld, oidW, data, serverctrlsW, clientctrlsW,
208 &retoidW, retdata );
209
210 if (retoid && retoidW) {
211 *retoid = strWtoA( retoidW );
212 if (!*retoid) ret = WLDAP32_LDAP_NO_MEMORY;
213 ldap_memfreeW( retoidW );
214 }
215
216exit:
217 strfreeW( oidW );
218 controlarrayfreeW( serverctrlsW );
219 controlarrayfreeW( clientctrlsW );
220
221#endif
222 return ret;
223}
#define NULL
Definition: types.h:112
void CDECL ldap_memfreeW(PWCHAR block)
Definition: misc.c:421
ULONG CDECL ldap_extended_operation_sW(WLDAP32_LDAP *ld, PWCHAR oid, struct WLDAP32_berval *data, PLDAPControlW *serverctrls, PLDAPControlW *clientctrls, PWCHAR *retoid, struct WLDAP32_berval **retdata)
Definition: extended.c:249
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
static LPWSTR strAtoW(const char *str)
#define debugstr_a
Definition: kernel32.h:31
#define exit(n)
Definition: config.h:202
uint32_t ULONG
Definition: typedefs.h:59
int ret
@ WLDAP32_LDAP_NOT_SUPPORTED
@ WLDAP32_LDAP_NO_MEMORY
static LPSTR strWtoA(LPCWSTR str)
Definition: wldap32.h:62
static void strfreeW(LPWSTR str)
Definition: wldap32.h:103
__wchar_t WCHAR
Definition: xmlstorage.h:180

◆ ldap_extended_operation_sW()

ULONG CDECL ldap_extended_operation_sW ( WLDAP32_LDAP ld,
PWCHAR  oid,
struct WLDAP32_berval data,
PLDAPControlW serverctrls,
PLDAPControlW clientctrls,
PWCHAR retoid,
struct WLDAP32_berval **  retdata 
)

Definition at line 249 of file extended.c.

252{
254#ifdef HAVE_LDAP
255 char *oidU = NULL, *retoidU = NULL;
256 LDAPControl **serverctrlsU = NULL, **clientctrlsU = NULL;
257
259
260 TRACE( "(%p, %s, %p, %p, %p, %p, %p)\n", ld, debugstr_w(oid), data, serverctrls,
261 clientctrls, retoid, retdata );
262
263 if (!ld) return WLDAP32_LDAP_PARAM_ERROR;
264
265 if (oid) {
266 oidU = strWtoU( oid );
267 if (!oidU) goto exit;
268 }
269 if (serverctrls) {
270 serverctrlsU = controlarrayWtoU( serverctrls );
271 if (!serverctrlsU) goto exit;
272 }
273 if (clientctrls) {
274 clientctrlsU = controlarrayWtoU( clientctrls );
275 if (!clientctrlsU) goto exit;
276 }
277
278 ret = map_error( ldap_extended_operation_s( ld, oid ? oidU : "", (struct berval *)data, serverctrlsU,
279 clientctrlsU, &retoidU, (struct berval **)retdata ));
280
281 if (retoid && retoidU) {
282 *retoid = strUtoW( retoidU );
283 if (!*retoid) ret = WLDAP32_LDAP_NO_MEMORY;
284 ldap_memfree( retoidU );
285 }
286
287exit:
288 strfreeU( oidU );
289 controlarrayfreeU( serverctrlsU );
290 controlarrayfreeU( clientctrlsU );
291
292#endif
293 return ret;
294}
static UINT map_error(DWORD error)
Definition: service.c:35
#define debugstr_w
Definition: kernel32.h:32
Definition: winber.h:32
#define LDAPControl
Definition: winldap.h:620
#define ldap_memfree
Definition: winldap.h:688
#define ldap_extended_operation_s
Definition: winldap.h:655
static void strfreeU(char *str)
Definition: wldap32.h:108
static char * strWtoU(LPCWSTR str)
Definition: wldap32.h:74
static LPWSTR strUtoW(char *str)
Definition: wldap32.h:86

Referenced by ldap_extended_operation_sA().

◆ ldap_extended_operationA()

ULONG CDECL ldap_extended_operationA ( WLDAP32_LDAP ld,
PCHAR  oid,
struct WLDAP32_berval data,
PLDAPControlA serverctrls,
PLDAPControlA clientctrls,
ULONG message 
)

Definition at line 69 of file extended.c.

71{
73#ifdef HAVE_LDAP
74 WCHAR *oidW = NULL;
75 LDAPControlW **serverctrlsW = NULL, **clientctrlsW = NULL;
76
78
79 TRACE( "(%p, %s, %p, %p, %p, %p)\n", ld, debugstr_a(oid), data, serverctrls,
80 clientctrls, message );
81
82 if (!ld || !message) return WLDAP32_LDAP_PARAM_ERROR;
83
84 if (oid) {
85 oidW = strAtoW( oid );
86 if (!oidW) goto exit;
87 }
88 if (serverctrls) {
89 serverctrlsW = controlarrayAtoW( serverctrls );
90 if (!serverctrlsW) goto exit;
91 }
92 if (clientctrls) {
93 clientctrlsW = controlarrayAtoW( clientctrls );
94 if (!clientctrlsW) goto exit;
95 }
96
97 ret = ldap_extended_operationW( ld, oidW, data, serverctrlsW, clientctrlsW, message );
98
99exit:
100 strfreeW( oidW );
101 controlarrayfreeW( serverctrlsW );
102 controlarrayfreeW( clientctrlsW );
103
104#endif
105 return ret;
106}
ULONG CDECL ldap_extended_operationW(WLDAP32_LDAP *ld, PWCHAR oid, struct WLDAP32_berval *data, PLDAPControlW *serverctrls, PLDAPControlW *clientctrls, ULONG *message)
Definition: extended.c:133
Definition: tftpd.h:60

◆ ldap_extended_operationW()

ULONG CDECL ldap_extended_operationW ( WLDAP32_LDAP ld,
PWCHAR  oid,
struct WLDAP32_berval data,
PLDAPControlW serverctrls,
PLDAPControlW clientctrls,
ULONG message 
)

Definition at line 133 of file extended.c.

135{
137#ifdef HAVE_LDAP
138 char *oidU = NULL;
139 LDAPControl **serverctrlsU = NULL, **clientctrlsU = NULL;
140
142
143 TRACE( "(%p, %s, %p, %p, %p, %p)\n", ld, debugstr_w(oid), data, serverctrls,
144 clientctrls, message );
145
146 if (!ld || !message) return WLDAP32_LDAP_PARAM_ERROR;
147
148 if (oid) {
149 oidU = strWtoU( oid );
150 if (!oidU) goto exit;
151 }
152 if (serverctrls) {
153 serverctrlsU = controlarrayWtoU( serverctrls );
154 if (!serverctrlsU) goto exit;
155 }
156 if (clientctrls) {
157 clientctrlsU = controlarrayWtoU( clientctrls );
158 if (!clientctrlsU) goto exit;
159 }
160
161 ret = map_error( ldap_extended_operation( ld, oid ? oidU : "", (struct berval *)data,
162 serverctrlsU, clientctrlsU, (int *)message ));
163
164exit:
165 strfreeU( oidU );
166 controlarrayfreeU( serverctrlsU );
167 controlarrayfreeU( clientctrlsU );
168
169#endif
170 return ret;
171}
#define ldap_extended_operation
Definition: winldap.h:656

Referenced by ldap_extended_operationA().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( wldap32  )