Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
05f18059
Commit
05f18059
authored
Jul 22, 2005
by
Hans Leidekker
Committed by
Alexandre Julliard
Jul 22, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement ldap_search* functions.
parent
b8585b8d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
267 additions
and
1 deletion
+267
-1
Makefile.in
dlls/wldap32/Makefile.in
+2
-1
search.c
dlls/wldap32/search.c
+222
-0
winldap_private.h
dlls/wldap32/winldap_private.h
+34
-0
wldap32.spec
dlls/wldap32/wldap32.spec
+9
-0
No files found.
dlls/wldap32/Makefile.in
View file @
05f18059
...
...
@@ -11,7 +11,8 @@ C_SRCS = \
ber.c
\
bind.c
\
init.c
\
main.c
main.c
\
search.c
@MAKE_DLL_RULES@
...
...
dlls/wldap32/search.c
0 → 100644
View file @
05f18059
/*
* WLDAP32 - LDAP support for Wine
*
* Copyright 2005 Hans Leidekker
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "config.h"
#include "wine/port.h"
#include "wine/debug.h"
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winnls.h"
#ifdef HAVE_LDAP
#include <ldap.h>
#else
#define LDAP_SUCCESS 0x00
#define LDAP_NOT_SUPPORTED 0x5c
#endif
#include "winldap_private.h"
#include "wldap32.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
wldap32
);
ULONG
ldap_searchA
(
WLDAP32_LDAP
*
ld
,
PCHAR
base
,
ULONG
scope
,
PCHAR
filter
,
PCHAR
attrs
[],
ULONG
attrsonly
)
{
ULONG
ret
=
LDAP_NOT_SUPPORTED
;
#ifdef HAVE_LDAP
WCHAR
*
baseW
,
*
filterW
,
**
attrsW
;
TRACE
(
"(%p, %s, 0x%08lx, %s, %p, 0x%08lx)
\n
"
,
ld
,
debugstr_a
(
base
),
scope
,
debugstr_a
(
filter
),
attrs
,
attrsonly
);
baseW
=
strAtoW
(
base
);
if
(
!
baseW
)
return
LDAP_NO_MEMORY
;
filterW
=
strAtoW
(
filter
);
if
(
!
filterW
)
return
LDAP_NO_MEMORY
;
attrsW
=
strarrayAtoW
(
attrs
);
if
(
!
attrsW
)
return
LDAP_NO_MEMORY
;
ret
=
ldap_searchW
(
ld
,
baseW
,
scope
,
filterW
,
attrsW
,
attrsonly
);
strfreeW
(
baseW
);
strfreeW
(
filterW
);
strarrayfreeW
(
attrsW
);
#endif
return
ret
;
}
ULONG
ldap_searchW
(
WLDAP32_LDAP
*
ld
,
PWCHAR
base
,
ULONG
scope
,
PWCHAR
filter
,
PWCHAR
attrs
[],
ULONG
attrsonly
)
{
ULONG
ret
=
LDAP_NOT_SUPPORTED
;
#ifdef HAVE_LDAP
char
*
baseU
,
*
filterU
,
**
attrsU
;
TRACE
(
"(%p, %s, 0x%08lx, %s, %p, 0x%08lx)
\n
"
,
ld
,
debugstr_w
(
base
),
scope
,
debugstr_w
(
filter
),
attrs
,
attrsonly
);
baseU
=
strWtoU
(
base
);
if
(
!
baseU
)
return
LDAP_NO_MEMORY
;
filterU
=
strWtoU
(
filter
);
if
(
!
filterU
)
return
LDAP_NO_MEMORY
;
attrsU
=
strarrayWtoU
(
attrs
);
if
(
!
attrsU
)
return
LDAP_NO_MEMORY
;
ret
=
ldap_search
(
ld
,
baseU
,
scope
,
filterU
,
attrsU
,
attrsonly
);
strfreeU
(
baseU
);
strfreeU
(
filterU
);
strarrayfreeU
(
attrsU
);
#endif
return
ret
;
}
ULONG
ldap_search_sA
(
WLDAP32_LDAP
*
ld
,
PCHAR
base
,
ULONG
scope
,
PCHAR
filter
,
PCHAR
attrs
[],
ULONG
attrsonly
,
WLDAP32_LDAPMessage
**
res
)
{
ULONG
ret
=
LDAP_NOT_SUPPORTED
;
#ifdef HAVE_LDAP
WCHAR
*
baseW
,
*
filterW
,
**
attrsW
;
TRACE
(
"(%p, %s, 0x%08lx, %s, %p, 0x%08lx, %p)
\n
"
,
ld
,
debugstr_a
(
base
),
scope
,
debugstr_a
(
filter
),
attrs
,
attrsonly
,
res
);
baseW
=
strAtoW
(
base
);
if
(
!
baseW
)
return
LDAP_NO_MEMORY
;
filterW
=
strAtoW
(
filter
);
if
(
!
filterW
)
return
LDAP_NO_MEMORY
;
attrsW
=
strarrayAtoW
(
attrs
);
if
(
!
attrsW
)
return
LDAP_NO_MEMORY
;
ret
=
ldap_search_sW
(
ld
,
baseW
,
scope
,
filterW
,
attrsW
,
attrsonly
,
res
);
strfreeW
(
baseW
);
strfreeW
(
filterW
);
strarrayfreeW
(
attrsW
);
#endif
return
ret
;
}
ULONG
ldap_search_sW
(
WLDAP32_LDAP
*
ld
,
PWCHAR
base
,
ULONG
scope
,
PWCHAR
filter
,
PWCHAR
attrs
[],
ULONG
attrsonly
,
WLDAP32_LDAPMessage
**
res
)
{
ULONG
ret
=
LDAP_NOT_SUPPORTED
;
#ifdef HAVE_LDAP
char
*
baseU
,
*
filterU
,
**
attrsU
;
TRACE
(
"(%p, %s, 0x%08lx, %s, %p, 0x%08lx, %p)
\n
"
,
ld
,
debugstr_w
(
base
),
scope
,
debugstr_w
(
filter
),
attrs
,
attrsonly
,
res
);
baseU
=
strWtoU
(
base
);
if
(
!
baseU
)
return
LDAP_NO_MEMORY
;
filterU
=
strWtoU
(
filter
);
if
(
!
filterU
)
return
LDAP_NO_MEMORY
;
attrsU
=
strarrayWtoU
(
attrs
);
if
(
!
attrsU
)
return
LDAP_NO_MEMORY
;
ret
=
ldap_search_s
(
ld
,
baseU
,
scope
,
filterU
,
attrsU
,
attrsonly
,
res
);
strfreeU
(
baseU
);
strfreeU
(
filterU
);
strarrayfreeU
(
attrsU
);
#endif
return
ret
;
}
ULONG
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
ret
=
LDAP_NOT_SUPPORTED
;
#ifdef HAVE_LDAP
WCHAR
*
baseW
,
*
filterW
,
**
attrsW
;
TRACE
(
"(%p, %s, 0x%08lx, %s, %p, 0x%08lx, %p, %p)
\n
"
,
ld
,
debugstr_a
(
base
),
scope
,
debugstr_a
(
filter
),
attrs
,
attrsonly
,
timeout
,
res
);
baseW
=
strAtoW
(
base
);
if
(
!
baseW
)
return
LDAP_NO_MEMORY
;
filterW
=
strAtoW
(
filter
);
if
(
!
filterW
)
return
LDAP_NO_MEMORY
;
attrsW
=
strarrayAtoW
(
attrs
);
if
(
!
attrsW
)
return
LDAP_NO_MEMORY
;
ret
=
ldap_search_stW
(
ld
,
baseW
,
scope
,
filterW
,
attrsW
,
attrsonly
,
timeout
,
res
);
strfreeW
(
baseW
);
strfreeW
(
filterW
);
strarrayfreeW
(
attrsW
);
#endif
return
ret
;
}
ULONG
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
)
{
ULONG
ret
=
LDAP_NOT_SUPPORTED
;
#ifdef HAVE_LDAP
char
*
baseU
,
*
filterU
,
**
attrsU
;
TRACE
(
"(%p, %s, 0x%08lx, %s, %p, 0x%08lx, %p, %p)
\n
"
,
ld
,
debugstr_w
(
base
),
scope
,
debugstr_w
(
filter
),
attrs
,
attrsonly
,
timeout
,
res
);
baseU
=
strWtoU
(
base
);
if
(
!
baseU
)
return
LDAP_NO_MEMORY
;
filterU
=
strWtoU
(
filter
);
if
(
!
filterU
)
return
LDAP_NO_MEMORY
;
attrsU
=
strarrayWtoU
(
attrs
);
if
(
!
attrsU
)
return
LDAP_NO_MEMORY
;
ret
=
ldap_search_st
(
ld
,
baseU
,
scope
,
filterU
,
attrsU
,
attrsonly
,
(
struct
timeval
*
)
timeout
,
res
);
strfreeU
(
baseU
);
strfreeU
(
filterU
);
strarrayfreeU
(
attrsU
);
#endif
return
ret
;
}
dlls/wldap32/winldap_private.h
View file @
05f18059
...
...
@@ -49,6 +49,32 @@ typedef struct ldap
ULONG
ld_options
;
}
WLDAP32_LDAP
,
*
WLDAP32_PLDAP
;
typedef
struct
l_timeval
{
LONG
tv_sec
;
LONG
tv_usec
;
}
LDAP_TIMEVAL
,
*
PLDAP_TIMEVAL
;
typedef
struct
ldapmsg
{
ULONG
lm_msgid
;
ULONG
lm_msgtype
;
PVOID
lm_ber
;
struct
ldapmsg
*
lm_chain
;
struct
ldapmsg
*
lm_next
;
ULONG
lm_time
;
WLDAP32_PLDAP
Connection
;
PVOID
Request
;
ULONG
lm_returncode
;
USHORT
lm_referral
;
BOOLEAN
lm_chased
;
BOOLEAN
lm_eom
;
BOOLEAN
ConnectionReferenced
;
}
WLDAP32_LDAPMessage
,
*
WLDAP32_PLDAPMessage
;
ULONG
ldap_bindA
(
WLDAP32_LDAP
*
,
PCHAR
,
PCHAR
,
ULONG
);
ULONG
ldap_bindW
(
WLDAP32_LDAP
*
,
PWCHAR
,
PWCHAR
,
ULONG
);
ULONG
ldap_bind_sA
(
WLDAP32_LDAP
*
,
PCHAR
,
PCHAR
,
ULONG
);
...
...
@@ -57,6 +83,14 @@ WLDAP32_LDAP *ldap_initA(const PCHAR,ULONG);
WLDAP32_LDAP
*
ldap_initW
(
const
PWCHAR
,
ULONG
);
WLDAP32_LDAP
*
ldap_openA
(
PCHAR
,
ULONG
);
WLDAP32_LDAP
*
ldap_openW
(
PWCHAR
,
ULONG
);
ULONG
ldap_searchA
(
WLDAP32_LDAP
*
,
PCHAR
,
ULONG
,
PCHAR
,
PCHAR
[],
ULONG
);
ULONG
ldap_searchW
(
WLDAP32_LDAP
*
,
PWCHAR
,
ULONG
,
PWCHAR
,
PWCHAR
[],
ULONG
);
ULONG
ldap_search_sA
(
WLDAP32_LDAP
*
,
PCHAR
,
ULONG
,
PCHAR
,
PCHAR
[],
ULONG
,
WLDAP32_LDAPMessage
**
);
ULONG
ldap_search_sW
(
WLDAP32_LDAP
*
,
PWCHAR
,
ULONG
,
PWCHAR
,
PWCHAR
[],
ULONG
,
WLDAP32_LDAPMessage
**
);
ULONG
ldap_search_stA
(
WLDAP32_LDAP
*
,
const
PCHAR
,
ULONG
,
const
PCHAR
,
PCHAR
[],
ULONG
,
struct
l_timeval
*
,
WLDAP32_LDAPMessage
**
);
ULONG
ldap_search_stW
(
WLDAP32_LDAP
*
,
const
PWCHAR
,
ULONG
,
const
PWCHAR
,
PWCHAR
[],
ULONG
,
struct
l_timeval
*
,
WLDAP32_LDAPMessage
**
);
ULONG
ldap_simple_bindA
(
WLDAP32_LDAP
*
,
PCHAR
,
PCHAR
);
ULONG
ldap_simple_bindW
(
WLDAP32_LDAP
*
,
PWCHAR
,
PWCHAR
);
ULONG
ldap_simple_bind_sA
(
WLDAP32_LDAP
*
,
PCHAR
,
PCHAR
);
...
...
dlls/wldap32/wldap32.spec
View file @
05f18059
...
...
@@ -25,6 +25,15 @@
@ cdecl ldap_open(str long) ldap_openA
@ cdecl ldap_openA(str long)
@ cdecl ldap_openW(wstr long)
@ cdecl ldap_search(ptr str long str ptr long) ldap_searchA
@ cdecl ldap_searchA(ptr str long str ptr long)
@ cdecl ldap_searchW(ptr wstr long wstr ptr long)
@ cdecl ldap_search_s(ptr str long str ptr long) ldap_search_sA
@ cdecl ldap_search_sA(ptr str long str ptr long)
@ cdecl ldap_search_sW(ptr wstr long wstr ptr long)
@ cdecl ldap_search_st(ptr str long str ptr long ptr ptr) ldap_search_stA
@ cdecl ldap_search_stA(ptr str long str ptr long ptr ptr)
@ cdecl ldap_search_stW(ptr wstr long wstr ptr long ptr ptr)
@ cdecl ldap_simple_bind(ptr str str) ldap_simple_bindA
@ cdecl ldap_simple_bindA(ptr str str)
@ cdecl ldap_simple_bindW(ptr wstr wstr)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment