Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
6e459129
Commit
6e459129
authored
Apr 17, 2020
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Apr 17, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wldap32: Implement ldap_search_init_pageW.
Signed-off-by:
Dmitry Timoshkov
<
dmitry@baikal.ru
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
06d36b1a
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
138 additions
and
3 deletions
+138
-3
page.c
dlls/wldap32/page.c
+62
-2
winldap_private.h
dlls/wldap32/winldap_private.h
+10
-1
wldap32.h
dlls/wldap32/wldap32.h
+66
-0
No files found.
dlls/wldap32/page.c
View file @
6e459129
...
...
@@ -281,7 +281,67 @@ PLDAPSearch CDECL ldap_search_init_pageW( WLDAP32_LDAP *ld, PWCHAR dn, ULONG sco
PWCHAR
filter
,
PWCHAR
attrs
[],
ULONG
attrsonly
,
PLDAPControlW
*
serverctrls
,
PLDAPControlW
*
clientctrls
,
ULONG
timelimit
,
ULONG
sizelimit
,
PLDAPSortKeyW
*
sortkeys
)
{
FIXME
(
"(%p, %s, 0x%08x, %s, %p, 0x%08x)
\n
"
,
ld
,
debugstr_w
(
dn
),
scope
,
debugstr_w
(
filter
),
attrs
,
attrsonly
);
#ifdef HAVE_LDAP
LDAPSearch
*
search
;
DWORD
i
,
len
;
TRACE
(
"(%p, %s, 0x%08x, %s, %p, 0x%08x, %p, %p, 0x%08x, 0x%08x, %p)
\n
"
,
ld
,
debugstr_w
(
dn
),
scope
,
debugstr_w
(
filter
),
attrs
,
attrsonly
,
serverctrls
,
clientctrls
,
timelimit
,
sizelimit
,
sortkeys
);
search
=
heap_alloc_zero
(
sizeof
(
*
search
)
);
if
(
!
search
)
{
ld
->
ld_errno
=
WLDAP32_LDAP_NO_MEMORY
;
return
NULL
;
}
if
(
dn
)
{
search
->
dn
=
strdupW
(
dn
);
if
(
!
search
->
dn
)
goto
fail
;
}
if
(
filter
)
{
search
->
filter
=
strdupW
(
filter
);
if
(
!
search
->
filter
)
goto
fail
;
}
if
(
attrs
)
{
search
->
attrs
=
strarraydupW
(
attrs
);
if
(
!
search
->
attrs
)
goto
fail
;
}
len
=
serverctrls
?
controlarraylenW
(
serverctrls
)
:
0
;
search
->
serverctrls
=
heap_alloc
(
sizeof
(
LDAPControl
*
)
*
(
len
+
2
)
);
if
(
!
search
->
serverctrls
)
goto
fail
;
search
->
serverctrls
[
0
]
=
NULL
;
/* reserve 0 for page control */
for
(
i
=
0
;
i
<
len
;
i
++
)
{
search
->
serverctrls
[
i
+
1
]
=
controldupW
(
serverctrls
[
i
]
);
if
(
!
search
->
serverctrls
[
i
+
1
])
goto
fail
;
}
search
->
serverctrls
[
len
+
1
]
=
NULL
;
if
(
clientctrls
)
{
search
->
clientctrls
=
controlarraydupW
(
clientctrls
);
if
(
!
search
->
clientctrls
)
goto
fail
;
}
search
->
scope
=
scope
;
search
->
attrsonly
=
attrsonly
;
search
->
timeout
.
tv_sec
=
timelimit
;
search
->
timeout
.
tv_usec
=
0
;
search
->
sizelimit
=
sizelimit
;
search
->
cookie
=
NULL
;
return
search
;
fail:
ldap_search_abandon_page
(
ld
,
search
);
ld
->
ld_errno
=
WLDAP32_LDAP_NO_MEMORY
;
#endif
return
NULL
;
}
dlls/wldap32/winldap_private.h
View file @
6e459129
...
...
@@ -234,7 +234,16 @@ typedef struct WLDAP32_ldapvlvinfo
VOID
*
ldvlv_extradata
;
}
WLDAP32_LDAPVLVInfo
,
*
WLDAP32_PLDAPVLVInfo
;
typedef
struct
ldapsearch
LDAPSearch
,
*
PLDAPSearch
;
typedef
struct
ldapsearch
{
WCHAR
*
dn
,
*
filter
,
**
attrs
;
ULONG
scope
,
attrsonly
;
LDAPControlW
**
serverctrls
;
LDAPControlW
**
clientctrls
;
struct
l_timeval
timeout
;
ULONG
sizelimit
;
struct
berval
*
cookie
;
}
LDAPSearch
,
*
PLDAPSearch
;
typedef
struct
ldapsortkeyA
{
...
...
dlls/wldap32/wldap32.h
View file @
6e459129
...
...
@@ -241,6 +241,26 @@ static inline LPWSTR *strarrayUtoW( char **strarray )
return
strarrayW
;
}
static
inline
LPWSTR
*
strarraydupW
(
LPWSTR
*
strarray
)
{
LPWSTR
*
strarrayW
=
NULL
;
DWORD
size
;
if
(
strarray
)
{
size
=
sizeof
(
WCHAR
*
)
*
(
strarraylenW
(
strarray
)
+
1
);
if
((
strarrayW
=
heap_alloc
(
size
)))
{
LPWSTR
*
p
=
strarray
;
LPWSTR
*
q
=
strarrayW
;
while
(
*
p
)
*
q
++
=
strdupW
(
*
p
++
);
*
q
=
NULL
;
}
}
return
strarrayW
;
}
static
inline
void
strarrayfreeA
(
LPSTR
*
strarray
)
{
if
(
strarray
)
...
...
@@ -553,6 +573,32 @@ static inline LDAPControlW *controlUtoW( LDAPControl *control )
return
controlW
;
}
static
inline
LDAPControlW
*
controldupW
(
LDAPControlW
*
control
)
{
LDAPControlW
*
controlW
;
DWORD
len
=
control
->
ldctl_value
.
bv_len
;
char
*
val
=
NULL
;
if
(
control
->
ldctl_value
.
bv_val
)
{
if
(
!
(
val
=
heap_alloc
(
len
)))
return
NULL
;
memcpy
(
val
,
control
->
ldctl_value
.
bv_val
,
len
);
}
if
(
!
(
controlW
=
heap_alloc
(
sizeof
(
LDAPControlW
)
)))
{
heap_free
(
val
);
return
NULL
;
}
controlW
->
ldctl_oid
=
strdupW
(
control
->
ldctl_oid
);
controlW
->
ldctl_value
.
bv_len
=
len
;
controlW
->
ldctl_value
.
bv_val
=
val
;
controlW
->
ldctl_iscritical
=
control
->
ldctl_iscritical
;
return
controlW
;
}
static
inline
void
controlfreeA
(
LDAPControlA
*
control
)
{
if
(
control
)
...
...
@@ -684,6 +730,26 @@ static inline LDAPControlW **controlarrayUtoW( LDAPControl **controlarray )
return
controlarrayW
;
}
static
inline
LDAPControlW
**
controlarraydupW
(
LDAPControlW
**
controlarray
)
{
LDAPControlW
**
controlarrayW
=
NULL
;
DWORD
size
;
if
(
controlarray
)
{
size
=
sizeof
(
LDAPControlW
*
)
*
(
controlarraylenW
(
controlarray
)
+
1
);
if
((
controlarrayW
=
heap_alloc
(
size
)))
{
LDAPControlW
**
p
=
controlarray
;
LDAPControlW
**
q
=
controlarrayW
;
while
(
*
p
)
*
q
++
=
controldupW
(
*
p
++
);
*
q
=
NULL
;
}
}
return
controlarrayW
;
}
static
inline
void
controlarrayfreeA
(
LDAPControlA
**
controlarray
)
{
if
(
controlarray
)
...
...
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