ReactOS 0.4.15-dev-8191-gbc6c731
search.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 search.c:

Go to the source code of this file.

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (wldap32)
 
ULONG CDECL ldap_searchA (WLDAP32_LDAP *ld, PCHAR base, ULONG scope, PCHAR filter, PCHAR attrs[], ULONG attrsonly)
 
ULONG CDECL ldap_searchW (WLDAP32_LDAP *ld, PWCHAR base, ULONG scope, PWCHAR filter, PWCHAR attrs[], ULONG attrsonly)
 
ULONG CDECL ldap_search_extA (WLDAP32_LDAP *ld, PCHAR base, ULONG scope, PCHAR filter, PCHAR attrs[], ULONG attrsonly, PLDAPControlA *serverctrls, PLDAPControlA *clientctrls, ULONG timelimit, ULONG sizelimit, ULONG *message)
 
ULONG CDECL ldap_search_extW (WLDAP32_LDAP *ld, PWCHAR base, ULONG scope, PWCHAR filter, PWCHAR attrs[], ULONG attrsonly, PLDAPControlW *serverctrls, PLDAPControlW *clientctrls, ULONG timelimit, ULONG sizelimit, ULONG *message)
 
ULONG CDECL ldap_search_ext_sA (WLDAP32_LDAP *ld, PCHAR base, ULONG scope, PCHAR filter, PCHAR attrs[], ULONG attrsonly, PLDAPControlA *serverctrls, PLDAPControlA *clientctrls, struct l_timeval *timeout, ULONG sizelimit, WLDAP32_LDAPMessage **res)
 
ULONG CDECL ldap_search_ext_sW (WLDAP32_LDAP *ld, PWCHAR base, ULONG scope, PWCHAR filter, PWCHAR attrs[], ULONG attrsonly, PLDAPControlW *serverctrls, PLDAPControlW *clientctrls, struct l_timeval *timeout, ULONG sizelimit, WLDAP32_LDAPMessage **res)
 
ULONG CDECL ldap_search_sA (WLDAP32_LDAP *ld, PCHAR base, ULONG scope, PCHAR filter, PCHAR attrs[], ULONG attrsonly, WLDAP32_LDAPMessage **res)
 
ULONG CDECL ldap_search_sW (WLDAP32_LDAP *ld, PWCHAR base, ULONG scope, PWCHAR filter, PWCHAR attrs[], ULONG attrsonly, WLDAP32_LDAPMessage **res)
 
ULONG CDECL ldap_search_stA (WLDAP32_LDAP *ld, const PCHAR base, ULONG scope, const PCHAR filter, PCHAR attrs[], ULONG attrsonly, struct l_timeval *timeout, WLDAP32_LDAPMessage **res)
 
ULONG CDECL ldap_search_stW (WLDAP32_LDAP *ld, const PWCHAR base, ULONG scope, const PWCHAR filter, PWCHAR attrs[], ULONG attrsonly, struct l_timeval *timeout, WLDAP32_LDAPMessage **res)
 

Function Documentation

◆ ldap_search_ext_sA()

ULONG CDECL ldap_search_ext_sA ( WLDAP32_LDAP ld,
PCHAR  base,
ULONG  scope,
PCHAR  filter,
PCHAR  attrs[],
ULONG  attrsonly,
PLDAPControlA serverctrls,
PLDAPControlA clientctrls,
struct l_timeval timeout,
ULONG  sizelimit,
WLDAP32_LDAPMessage **  res 
)

Definition at line 301 of file search.c.

304{
306#ifdef HAVE_LDAP
307 WCHAR *baseW = NULL, *filterW = NULL, **attrsW = NULL;
308 LDAPControlW **serverctrlsW = NULL, **clientctrlsW = NULL;
309
311
312 TRACE( "(%p, %s, 0x%08x, %s, %p, 0x%08x, %p, %p, %p, 0x%08x, %p)\n",
313 ld, debugstr_a(base), scope, debugstr_a(filter), attrs, attrsonly,
314 serverctrls, clientctrls, timeout, sizelimit, res );
315
316 if (!ld || !res) return WLDAP32_LDAP_PARAM_ERROR;
317
318 if (base) {
319 baseW = strAtoW( base );
320 if (!baseW) goto exit;
321 }
322 if (filter) {
323 filterW = strAtoW( filter );
324 if (!filterW) goto exit;
325 }
326 if (attrs) {
327 attrsW = strarrayAtoW( attrs );
328 if (!attrsW) goto exit;
329 }
330 if (serverctrls) {
331 serverctrlsW = controlarrayAtoW( serverctrls );
332 if (!serverctrlsW) goto exit;
333 }
334 if (clientctrls) {
335 clientctrlsW = controlarrayAtoW( clientctrls );
336 if (!clientctrlsW) goto exit;
337 }
338
339 ret = ldap_search_ext_sW( ld, baseW, scope, filterW, attrsW, attrsonly,
340 serverctrlsW, clientctrlsW, timeout, sizelimit, res );
341
342exit:
343 strfreeW( baseW );
344 strfreeW( filterW );
345 strarrayfreeW( attrsW );
346 controlarrayfreeW( serverctrlsW );
347 controlarrayfreeW( clientctrlsW );
348
349#endif
350 return ret;
351}
static WCHAR baseW[MAX_PATH]
Definition: FindFiles.c:24
#define NULL
Definition: types.h:112
ULONG CDECL ldap_search_ext_sW(WLDAP32_LDAP *ld, PWCHAR base, ULONG scope, PWCHAR filter, PWCHAR attrs[], ULONG attrsonly, PLDAPControlW *serverctrls, PLDAPControlW *clientctrls, struct l_timeval *timeout, ULONG sizelimit, WLDAP32_LDAPMessage **res)
Definition: search.c:379
GLuint res
Definition: glext.h:9613
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
Definition: glext.h:7005
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
Definition: dhcpd.h:245
uint32_t ULONG
Definition: typedefs.h:59
int ret
@ WLDAP32_LDAP_PARAM_ERROR
@ WLDAP32_LDAP_NOT_SUPPORTED
@ WLDAP32_LDAP_NO_MEMORY
static void strarrayfreeW(LPWSTR *strarray)
Definition: wldap32.h:224
static void strfreeW(LPWSTR str)
Definition: wldap32.h:103
static LPWSTR * strarrayAtoW(LPSTR *strarray)
Definition: wldap32.h:134
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by test_ldap_parse_sort_control().

◆ ldap_search_ext_sW()

ULONG CDECL ldap_search_ext_sW ( WLDAP32_LDAP ld,
PWCHAR  base,
ULONG  scope,
PWCHAR  filter,
PWCHAR  attrs[],
ULONG  attrsonly,
PLDAPControlW serverctrls,
PLDAPControlW clientctrls,
struct l_timeval timeout,
ULONG  sizelimit,
WLDAP32_LDAPMessage **  res 
)

Definition at line 379 of file search.c.

382{
384#ifdef HAVE_LDAP
385 char *baseU = NULL, *filterU = NULL, **attrsU = NULL;
386 LDAPControl **serverctrlsU = NULL, **clientctrlsU = NULL;
387
389
390 TRACE( "(%p, %s, 0x%08x, %s, %p, 0x%08x, %p, %p, %p, 0x%08x, %p)\n",
391 ld, debugstr_w(base), scope, debugstr_w(filter), attrs, attrsonly,
392 serverctrls, clientctrls, timeout, sizelimit, res );
393
394 if (!ld || !res) return WLDAP32_LDAP_PARAM_ERROR;
395
396 if (base) {
397 baseU = strWtoU( base );
398 if (!baseU) goto exit;
399 }
400 if (filter) {
401 filterU = strWtoU( filter );
402 if (!filterU) goto exit;
403 }
404 if (attrs) {
405 attrsU = strarrayWtoU( attrs );
406 if (!attrsU) goto exit;
407 }
408 if (serverctrls) {
409 serverctrlsU = controlarrayWtoU( serverctrls );
410 if (!serverctrlsU) goto exit;
411 }
412 if (clientctrls) {
413 clientctrlsU = controlarrayWtoU( clientctrls );
414 if (!clientctrlsU) goto exit;
415 }
416
417 ret = map_error( ldap_search_ext_s( ld, baseU, scope, filterU, attrsU, attrsonly,
418 serverctrlsU, clientctrlsU, (struct timeval *)timeout,
419 sizelimit, res ));
420
421exit:
422 strfreeU( baseU );
423 strfreeU( filterU );
424 strarrayfreeU( attrsU );
425 controlarrayfreeU( serverctrlsU );
426 controlarrayfreeU( clientctrlsU );
427
428#endif
429 return ret;
430}
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_search_ext_s
Definition: winldap.h:682
static void strfreeU(char *str)
Definition: wldap32.h:108
static void strarrayfreeU(char **strarray)
Definition: wldap32.h:234
static char * strWtoU(LPCWSTR str)
Definition: wldap32.h:74
static char ** strarrayWtoU(LPWSTR *strarray)
Definition: wldap32.h:174

Referenced by ldap_search_ext_sA().

◆ ldap_search_extA()

ULONG CDECL ldap_search_extA ( WLDAP32_LDAP ld,
PCHAR  base,
ULONG  scope,
PCHAR  filter,
PCHAR  attrs[],
ULONG  attrsonly,
PLDAPControlA serverctrls,
PLDAPControlA clientctrls,
ULONG  timelimit,
ULONG  sizelimit,
ULONG message 
)

Definition at line 155 of file search.c.

158{
160#ifdef HAVE_LDAP
161 WCHAR *baseW = NULL, *filterW = NULL, **attrsW = NULL;
162 LDAPControlW **serverctrlsW = NULL, **clientctrlsW = NULL;
163
165
166 TRACE( "(%p, %s, 0x%08x, %s, %p, 0x%08x, %p, %p, 0x%08x, 0x%08x, %p)\n",
167 ld, debugstr_a(base), scope, debugstr_a(filter), attrs, attrsonly,
168 serverctrls, clientctrls, timelimit, sizelimit, message );
169
170 if (!ld) return WLDAP32_LDAP_PARAM_ERROR;
171
172 if (base) {
173 baseW = strAtoW( base );
174 if (!baseW) goto exit;
175 }
176 if (filter)
177 {
178 filterW = strAtoW( filter );
179 if (!filterW) goto exit;
180 }
181 if (attrs) {
182 attrsW = strarrayAtoW( attrs );
183 if (!attrsW) goto exit;
184 }
185 if (serverctrls) {
186 serverctrlsW = controlarrayAtoW( serverctrls );
187 if (!serverctrlsW) goto exit;
188 }
189 if (clientctrls) {
190 clientctrlsW = controlarrayAtoW( clientctrls );
191 if (!clientctrlsW) goto exit;
192 }
193
194 ret = ldap_search_extW( ld, baseW, scope, filterW, attrsW, attrsonly,
195 serverctrlsW, clientctrlsW, timelimit, sizelimit, message );
196
197exit:
198 strfreeW( baseW );
199 strfreeW( filterW );
200 strarrayfreeW( attrsW );
201 controlarrayfreeW( serverctrlsW );
202 controlarrayfreeW( clientctrlsW );
203
204#endif
205 return ret;
206}
ULONG CDECL ldap_search_extW(WLDAP32_LDAP *ld, PWCHAR base, ULONG scope, PWCHAR filter, PWCHAR attrs[], ULONG attrsonly, PLDAPControlW *serverctrls, PLDAPControlW *clientctrls, ULONG timelimit, ULONG sizelimit, ULONG *message)
Definition: search.c:236
Definition: tftpd.h:60

◆ ldap_search_extW()

ULONG CDECL ldap_search_extW ( WLDAP32_LDAP ld,
PWCHAR  base,
ULONG  scope,
PWCHAR  filter,
PWCHAR  attrs[],
ULONG  attrsonly,
PLDAPControlW serverctrls,
PLDAPControlW clientctrls,
ULONG  timelimit,
ULONG  sizelimit,
ULONG message 
)

Definition at line 236 of file search.c.

239{
241#ifdef HAVE_LDAP
242 char *baseU = NULL, *filterU = NULL, **attrsU = NULL;
243 LDAPControl **serverctrlsU = NULL, **clientctrlsU = NULL;
244 struct timeval tv, *tvp = NULL;
245
247
248 TRACE( "(%p, %s, 0x%08x, %s, %p, 0x%08x, %p, %p, 0x%08x, 0x%08x, %p)\n",
249 ld, debugstr_w(base), scope, debugstr_w(filter), attrs, attrsonly,
250 serverctrls, clientctrls, timelimit, sizelimit, message );
251
252 if (!ld) return ~0u;
253
254 if (base) {
255 baseU = strWtoU( base );
256 if (!baseU) goto exit;
257 }
258 if (filter) {
259 filterU = strWtoU( filter );
260 if (!filterU) goto exit;
261 }
262 if (attrs) {
263 attrsU = strarrayWtoU( attrs );
264 if (!attrsU) goto exit;
265 }
266 if (serverctrls) {
267 serverctrlsU = controlarrayWtoU( serverctrls );
268 if (!serverctrlsU) goto exit;
269 }
270 if (clientctrls) {
271 clientctrlsU = controlarrayWtoU( clientctrls );
272 if (!clientctrlsU) goto exit;
273 }
274
275 if (timelimit)
276 {
277 tv.tv_sec = timelimit;
278 tv.tv_usec = 0;
279 tvp = &tv;
280 }
281
282 ret = map_error( ldap_search_ext( ld, baseU, scope, filterU, attrsU, attrsonly,
283 serverctrlsU, clientctrlsU, tvp, sizelimit, (int *)message ));
284
285exit:
286 strfreeU( baseU );
287 strfreeU( filterU );
288 strarrayfreeU( attrsU );
289 controlarrayfreeU( serverctrlsU );
290 controlarrayfreeU( clientctrlsU );
291
292#endif
293 return ret;
294}
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
#define ldap_search_ext
Definition: winldap.h:681

Referenced by ldap_search_extA(), and test_ldap_search_extW().

◆ ldap_search_sA()

ULONG CDECL ldap_search_sA ( WLDAP32_LDAP ld,
PCHAR  base,
ULONG  scope,
PCHAR  filter,
PCHAR  attrs[],
ULONG  attrsonly,
WLDAP32_LDAPMessage **  res 
)

Definition at line 437 of file search.c.

439{
441#ifdef HAVE_LDAP
442 WCHAR *baseW = NULL, *filterW = NULL, **attrsW = NULL;
443
445
446 TRACE( "(%p, %s, 0x%08x, %s, %p, 0x%08x, %p)\n", ld, debugstr_a(base),
447 scope, debugstr_a(filter), attrs, attrsonly, res );
448
449 if (!ld || !res) return WLDAP32_LDAP_PARAM_ERROR;
450
451 if (base) {
452 baseW = strAtoW( base );
453 if (!baseW) goto exit;
454 }
455 if (filter) {
456 filterW = strAtoW( filter );
457 if (!filterW) goto exit;
458 }
459 if (attrs) {
460 attrsW = strarrayAtoW( attrs );
461 if (!attrsW) goto exit;
462 }
463
464 ret = ldap_search_sW( ld, baseW, scope, filterW, attrsW, attrsonly, res );
465
466exit:
467 strfreeW( baseW );
468 strfreeW( filterW );
469 strarrayfreeW( attrsW );
470
471#endif
472 return ret;
473}
ULONG CDECL ldap_search_sW(WLDAP32_LDAP *ld, PWCHAR base, ULONG scope, PWCHAR filter, PWCHAR attrs[], ULONG attrsonly, WLDAP32_LDAPMessage **res)
Definition: search.c:497

◆ ldap_search_stA()

ULONG CDECL ldap_search_stA ( WLDAP32_LDAP ld,
const PCHAR  base,
ULONG  scope,
const PCHAR  filter,
PCHAR  attrs[],
ULONG  attrsonly,
struct l_timeval timeout,
WLDAP32_LDAPMessage **  res 
)

Definition at line 541 of file search.c.

544{
546#ifdef HAVE_LDAP
547 WCHAR *baseW = NULL, *filterW = NULL, **attrsW = NULL;
548
550
551 TRACE( "(%p, %s, 0x%08x, %s, %p, 0x%08x, %p, %p)\n", ld,
552 debugstr_a(base), scope, debugstr_a(filter), attrs,
553 attrsonly, timeout, res );
554
555 if (!ld || !res) return WLDAP32_LDAP_PARAM_ERROR;
556
557 if (base) {
558 baseW = strAtoW( base );
559 if (!baseW) goto exit;
560 }
561 if (filter) {
562 filterW = strAtoW( filter );
563 if (!filterW) goto exit;
564 }
565 if (attrs) {
566 attrsW = strarrayAtoW( attrs );
567 if (!attrsW) goto exit;
568 }
569
570 ret = ldap_search_stW( ld, baseW, scope, filterW, attrsW, attrsonly,
571 timeout, res );
572
573exit:
574 strfreeW( baseW );
575 strfreeW( filterW );
576 strarrayfreeW( attrsW );
577
578#endif
579 return ret;
580}
ULONG CDECL ldap_search_stW(WLDAP32_LDAP *ld, const PWCHAR base, ULONG scope, const PWCHAR filter, PWCHAR attrs[], ULONG attrsonly, struct l_timeval *timeout, WLDAP32_LDAPMessage **res)
Definition: search.c:605

◆ ldap_search_stW()

ULONG CDECL ldap_search_stW ( WLDAP32_LDAP ld,
const PWCHAR  base,
ULONG  scope,
const PWCHAR  filter,
PWCHAR  attrs[],
ULONG  attrsonly,
struct l_timeval timeout,
WLDAP32_LDAPMessage **  res 
)

Definition at line 605 of file search.c.

608{
610#ifdef HAVE_LDAP
611 char *baseU = NULL, *filterU = NULL, **attrsU = NULL;
612
614
615 TRACE( "(%p, %s, 0x%08x, %s, %p, 0x%08x, %p, %p)\n", ld,
616 debugstr_w(base), scope, debugstr_w(filter), attrs,
617 attrsonly, timeout, res );
618
619 if (!ld || !res) return WLDAP32_LDAP_PARAM_ERROR;
620
621 if (base) {
622 baseU = strWtoU( base );
623 if (!baseU) goto exit;
624 }
625 if (filter) {
626 filterU = strWtoU( filter );
627 if (!filterU) goto exit;
628 }
629 if (attrs) {
630 attrsU = strarrayWtoU( attrs );
631 if (!attrsU) goto exit;
632 }
633
634 ret = map_error( ldap_search_ext_s( ld, baseU, scope, filterU, attrsU, attrsonly,
635 NULL, NULL, (struct timeval *)timeout, 0, res ));
636
637exit:
638 strfreeU( baseU );
639 strfreeU( filterU );
640 strarrayfreeU( attrsU );
641
642#endif
643 return ret;
644}

Referenced by ldap_search_stA().

◆ ldap_search_sW()

ULONG CDECL ldap_search_sW ( WLDAP32_LDAP ld,
PWCHAR  base,
ULONG  scope,
PWCHAR  filter,
PWCHAR  attrs[],
ULONG  attrsonly,
WLDAP32_LDAPMessage **  res 
)

Definition at line 497 of file search.c.

499{
501#ifdef HAVE_LDAP
502 char *baseU = NULL, *filterU = NULL, **attrsU = NULL;
503
505
506 TRACE( "(%p, %s, 0x%08x, %s, %p, 0x%08x, %p)\n", ld, debugstr_w(base),
507 scope, debugstr_w(filter), attrs, attrsonly, res );
508
509 if (!ld || !res) return WLDAP32_LDAP_PARAM_ERROR;
510
511 if (base) {
512 baseU = strWtoU( base );
513 if (!baseU) goto exit;
514 }
515 if (filter) {
516 filterU = strWtoU( filter );
517 if (!filterU) goto exit;
518 }
519 if (attrs) {
520 attrsU = strarrayWtoU( attrs );
521 if (!attrsU) goto exit;
522 }
523
524 ret = map_error( ldap_search_ext_s( ld, baseU, scope, filterU, attrsU, attrsonly,
525 NULL, NULL, NULL, 0, res ));
526
527exit:
528 strfreeU( baseU );
529 strfreeU( filterU );
530 strarrayfreeU( attrsU );
531
532#endif
533 return ret;
534}

Referenced by ldap_search_sA().

◆ ldap_searchA()

ULONG CDECL ldap_searchA ( WLDAP32_LDAP ld,
PCHAR  base,
ULONG  scope,
PCHAR  filter,
PCHAR  attrs[],
ULONG  attrsonly 
)

Definition at line 44 of file search.c.

46{
48#ifdef HAVE_LDAP
49 WCHAR *baseW = NULL, *filterW = NULL, **attrsW = NULL;
50
52
53 TRACE( "(%p, %s, 0x%08x, %s, %p, 0x%08x)\n", ld, debugstr_a(base),
54 scope, debugstr_a(filter), attrs, attrsonly );
55
56 if (!ld) return ~0u;
57
58 if (base) {
59 baseW = strAtoW( base );
60 if (!baseW) goto exit;
61 }
62 if (filter) {
63 filterW = strAtoW( filter );
64 if (!filterW) goto exit;
65 }
66 if (attrs) {
67 attrsW = strarrayAtoW( attrs );
68 if (!attrsW) goto exit;
69 }
70
71 ret = ldap_searchW( ld, baseW, scope, filterW, attrsW, attrsonly );
72
73exit:
74 strfreeW( baseW );
75 strfreeW( filterW );
76 strarrayfreeW( attrsW );
77
78#endif
79 return ret;
80}
ULONG CDECL ldap_searchW(WLDAP32_LDAP *ld, PWCHAR base, ULONG scope, PWCHAR filter, PWCHAR attrs[], ULONG attrsonly)
Definition: search.c:105

◆ ldap_searchW()

ULONG CDECL ldap_searchW ( WLDAP32_LDAP ld,
PWCHAR  base,
ULONG  scope,
PWCHAR  filter,
PWCHAR  attrs[],
ULONG  attrsonly 
)

Definition at line 105 of file search.c.

107{
109#ifdef HAVE_LDAP
110 char *baseU = NULL, *filterU = NULL, **attrsU = NULL;
111 int msg;
112
114
115 TRACE( "(%p, %s, 0x%08x, %s, %p, 0x%08x)\n", ld, debugstr_w(base),
116 scope, debugstr_w(filter), attrs, attrsonly );
117
118 if (!ld) return ~0u;
119
120 if (base) {
121 baseU = strWtoU( base );
122 if (!baseU) goto exit;
123 }
124 if (filter) {
125 filterU = strWtoU( filter );
126 if (!filterU) goto exit;
127 }
128 if (attrs) {
129 attrsU = strarrayWtoU( attrs );
130 if (!attrsU) goto exit;
131 }
132
133 ret = ldap_search_ext( ld, baseU, scope, filterU, attrsU, attrsonly,
134 NULL, NULL, NULL, 0, &msg );
135
136 if (ret == LDAP_SUCCESS)
137 ret = msg;
138 else
139 ret = ~0u;
140
141exit:
142 strfreeU( baseU );
143 strfreeU( filterU );
144 strarrayfreeU( attrsU );
145
146#endif
147 return ret;
148}
#define msg(x)
Definition: auth_time.c:54
#define LDAP_SUCCESS
Definition: winldap.h:59

Referenced by ldap_searchA().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( wldap32  )