ReactOS  0.4.15-dev-1197-g8081ba9
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;
61  return WLDAP32_LDAP_SUCCESS;
62 }
#define TRACE(s)
Definition: solgame.cpp:4

◆ 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 
216 exit:
217  strfreeW( oidW );
218  controlarrayfreeW( serverctrlsW );
219  controlarrayfreeW( clientctrlsW );
220 
221 #endif
222  return ret;
223 }
static void strfreeW(LPWSTR str)
Definition: wldap32.h:103
static LPSTR strWtoA(LPCWSTR str)
Definition: wldap32.h:62
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define debugstr_a
Definition: kernel32.h:31
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
int ret
static LPWSTR strAtoW(const char *str)
unsigned int ULONG
Definition: retypes.h:1
void CDECL ldap_memfreeW(PWCHAR block)
Definition: misc.c:421
void exit(int exitcode)
Definition: _exit.c:33

◆ 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 
287 exit:
288  strfreeU( oidU );
289  controlarrayfreeU( serverctrlsU );
290  controlarrayfreeU( clientctrlsU );
291 
292 #endif
293  return ret;
294 }
static char * strWtoU(LPCWSTR str)
Definition: wldap32.h:74
static void strfreeU(char *str)
Definition: wldap32.h:108
#define LDAPControl
Definition: winldap.h:620
#define ldap_memfree
Definition: winldap.h:688
Definition: winber.h:32
static LPWSTR strUtoW(char *str)
Definition: wldap32.h:86
#define ldap_extended_operation_s
Definition: winldap.h:655
#define debugstr_w
Definition: kernel32.h:32
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
int ret
unsigned int ULONG
Definition: retypes.h:1
static UINT map_error(DWORD error)
Definition: service.c:35
void exit(int exitcode)
Definition: _exit.c:33

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 
99 exit:
100  strfreeW( oidW );
101  controlarrayfreeW( serverctrlsW );
102  controlarrayfreeW( clientctrlsW );
103 
104 #endif
105  return ret;
106 }
Definition: tftpd.h:59
static void strfreeW(LPWSTR str)
Definition: wldap32.h:103
ULONG CDECL ldap_extended_operationW(WLDAP32_LDAP *ld, PWCHAR oid, struct WLDAP32_berval *data, PLDAPControlW *serverctrls, PLDAPControlW *clientctrls, ULONG *message)
Definition: extended.c:133
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define debugstr_a
Definition: kernel32.h:31
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
int ret
static LPWSTR strAtoW(const char *str)
unsigned int ULONG
Definition: retypes.h:1
void exit(int exitcode)
Definition: _exit.c:33

◆ 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 
164 exit:
165  strfreeU( oidU );
166  controlarrayfreeU( serverctrlsU );
167  controlarrayfreeU( clientctrlsU );
168 
169 #endif
170  return ret;
171 }
Definition: tftpd.h:59
static char * strWtoU(LPCWSTR str)
Definition: wldap32.h:74
static void strfreeU(char *str)
Definition: wldap32.h:108
#define LDAPControl
Definition: winldap.h:620
Definition: winber.h:32
#define debugstr_w
Definition: kernel32.h:32
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
int ret
#define ldap_extended_operation
Definition: winldap.h:656
unsigned int ULONG
Definition: retypes.h:1
static UINT map_error(DWORD error)
Definition: service.c:35
void exit(int exitcode)
Definition: _exit.c:33

Referenced by ldap_extended_operationA().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( wldap32  )