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
17021e53
Commit
17021e53
authored
Sep 19, 2022
by
Hans Leidekker
Committed by
Alexandre Julliard
Nov 15, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wldap32: Add a prefix to definitions that conflict with OpenLDAP headers.
parent
bf88332c
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
402 additions
and
251 deletions
+402
-251
add.c
dlls/wldap32/add.c
+12
-12
ber.c
dlls/wldap32/ber.c
+3
-3
bind.c
dlls/wldap32/bind.c
+31
-31
compare.c
dlls/wldap32/compare.c
+12
-12
control.c
dlls/wldap32/control.c
+19
-19
delete.c
dlls/wldap32/delete.c
+12
-12
dn.c
dlls/wldap32/dn.c
+7
-7
error.c
dlls/wldap32/error.c
+22
-22
extended.c
dlls/wldap32/extended.c
+13
-13
init.c
dlls/wldap32/init.c
+8
-9
misc.c
dlls/wldap32/misc.c
+10
-10
modify.c
dlls/wldap32/modify.c
+10
-10
modrdn.c
dlls/wldap32/modrdn.c
+12
-12
option.c
dlls/wldap32/option.c
+0
-0
page.c
dlls/wldap32/page.c
+28
-28
parse.c
dlls/wldap32/parse.c
+26
-26
rename.c
dlls/wldap32/rename.c
+8
-8
search.c
dlls/wldap32/search.c
+14
-14
value.c
dlls/wldap32/value.c
+3
-3
winldap_private.h
dlls/wldap32/winldap_private.h
+152
-0
No files found.
dlls/wldap32/add.c
View file @
17021e53
...
...
@@ -34,7 +34,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(wldap32);
*/
ULONG
CDECL
ldap_addA
(
LDAP
*
ld
,
char
*
dn
,
LDAPModA
**
attrs
)
{
ULONG
ret
=
LDAP_NO_MEMORY
;
ULONG
ret
=
WLDAP32_
LDAP_NO_MEMORY
;
WCHAR
*
dnW
=
NULL
;
LDAPModW
**
attrsW
=
NULL
;
...
...
@@ -63,7 +63,7 @@ ULONG CDECL ldap_addW( LDAP *ld, WCHAR *dn, LDAPModW **attrs )
TRACE
(
"(%p, %s, %p)
\n
"
,
ld
,
debugstr_w
(
dn
),
attrs
);
ret
=
ldap_add_extW
(
ld
,
dn
,
attrs
,
NULL
,
NULL
,
&
msg
);
if
(
ret
==
LDAP_SUCCESS
)
return
msg
;
if
(
ret
==
WLDAP32_
LDAP_SUCCESS
)
return
msg
;
return
~
0u
;
}
...
...
@@ -73,14 +73,14 @@ ULONG CDECL ldap_addW( LDAP *ld, WCHAR *dn, LDAPModW **attrs )
ULONG
CDECL
ldap_add_extA
(
LDAP
*
ld
,
char
*
dn
,
LDAPModA
**
attrs
,
LDAPControlA
**
serverctrls
,
LDAPControlA
**
clientctrls
,
ULONG
*
message
)
{
ULONG
ret
=
LDAP_NO_MEMORY
;
ULONG
ret
=
WLDAP32_
LDAP_NO_MEMORY
;
WCHAR
*
dnW
=
NULL
;
LDAPModW
**
attrsW
=
NULL
;
LDAPControlW
**
serverctrlsW
=
NULL
,
**
clientctrlsW
=
NULL
;
TRACE
(
"(%p, %s, %p, %p, %p, %p)
\n
"
,
ld
,
debugstr_a
(
dn
),
attrs
,
serverctrls
,
clientctrls
,
message
);
if
(
!
ld
)
return
LDAP_PARAM_ERROR
;
if
(
!
ld
)
return
WLDAP32_
LDAP_PARAM_ERROR
;
if
(
dn
&&
!
(
dnW
=
strAtoW
(
dn
)))
goto
exit
;
if
(
attrs
&&
!
(
attrsW
=
modarrayAtoW
(
attrs
)))
goto
exit
;
...
...
@@ -103,14 +103,14 @@ exit:
ULONG
CDECL
ldap_add_extW
(
LDAP
*
ld
,
WCHAR
*
dn
,
LDAPModW
**
attrs
,
LDAPControlW
**
serverctrls
,
LDAPControlW
**
clientctrls
,
ULONG
*
message
)
{
ULONG
ret
=
LDAP_NO_MEMORY
;
ULONG
ret
=
WLDAP32_
LDAP_NO_MEMORY
;
char
*
dnU
=
NULL
;
LDAPModU
**
attrsU
=
NULL
;
LDAPControlU
**
serverctrlsU
=
NULL
,
**
clientctrlsU
=
NULL
;
TRACE
(
"(%p, %s, %p, %p, %p, %p)
\n
"
,
ld
,
debugstr_w
(
dn
),
attrs
,
serverctrls
,
clientctrls
,
message
);
if
(
!
ld
)
return
LDAP_PARAM_ERROR
;
if
(
!
ld
)
return
WLDAP32_
LDAP_PARAM_ERROR
;
if
(
dn
&&
!
(
dnU
=
strWtoU
(
dn
)))
goto
exit
;
if
(
attrs
&&
!
(
attrsU
=
modarrayWtoU
(
attrs
)))
goto
exit
;
...
...
@@ -136,14 +136,14 @@ exit:
ULONG
CDECL
ldap_add_ext_sA
(
LDAP
*
ld
,
char
*
dn
,
LDAPModA
**
attrs
,
LDAPControlA
**
serverctrls
,
LDAPControlA
**
clientctrls
)
{
ULONG
ret
=
LDAP_NO_MEMORY
;
ULONG
ret
=
WLDAP32_
LDAP_NO_MEMORY
;
WCHAR
*
dnW
=
NULL
;
LDAPModW
**
attrsW
=
NULL
;
LDAPControlW
**
serverctrlsW
=
NULL
,
**
clientctrlsW
=
NULL
;
TRACE
(
"(%p, %s, %p, %p, %p)
\n
"
,
ld
,
debugstr_a
(
dn
),
attrs
,
serverctrls
,
clientctrls
);
if
(
!
ld
)
return
LDAP_PARAM_ERROR
;
if
(
!
ld
)
return
WLDAP32_
LDAP_PARAM_ERROR
;
if
(
dn
&&
!
(
dnW
=
strAtoW
(
dn
)))
goto
exit
;
if
(
attrs
&&
!
(
attrsW
=
modarrayAtoW
(
attrs
)))
goto
exit
;
...
...
@@ -166,14 +166,14 @@ exit:
ULONG
CDECL
ldap_add_ext_sW
(
LDAP
*
ld
,
WCHAR
*
dn
,
LDAPModW
**
attrs
,
LDAPControlW
**
serverctrls
,
LDAPControlW
**
clientctrls
)
{
ULONG
ret
=
LDAP_NO_MEMORY
;
ULONG
ret
=
WLDAP32_
LDAP_NO_MEMORY
;
char
*
dnU
=
NULL
;
LDAPModU
**
attrsU
=
NULL
;
LDAPControlU
**
serverctrlsU
=
NULL
,
**
clientctrlsU
=
NULL
;
TRACE
(
"(%p, %s, %p, %p, %p)
\n
"
,
ld
,
debugstr_w
(
dn
),
attrs
,
serverctrls
,
clientctrls
);
if
(
!
ld
)
return
LDAP_PARAM_ERROR
;
if
(
!
ld
)
return
WLDAP32_
LDAP_PARAM_ERROR
;
if
(
dn
&&
!
(
dnU
=
strWtoU
(
dn
)))
goto
exit
;
if
(
attrs
&&
!
(
attrsU
=
modarrayWtoU
(
attrs
)))
goto
exit
;
...
...
@@ -198,13 +198,13 @@ exit:
*/
ULONG
CDECL
ldap_add_sA
(
LDAP
*
ld
,
char
*
dn
,
LDAPModA
**
attrs
)
{
ULONG
ret
=
LDAP_NO_MEMORY
;
ULONG
ret
=
WLDAP32_
LDAP_NO_MEMORY
;
WCHAR
*
dnW
=
NULL
;
LDAPModW
**
attrsW
=
NULL
;
TRACE
(
"(%p, %s, %p)
\n
"
,
ld
,
debugstr_a
(
dn
),
attrs
);
if
(
!
ld
)
return
LDAP_PARAM_ERROR
;
if
(
!
ld
)
return
WLDAP32_
LDAP_PARAM_ERROR
;
if
(
dn
&&
!
(
dnW
=
strAtoW
(
dn
)))
goto
exit
;
if
(
attrs
&&
!
(
attrsW
=
modarrayAtoW
(
attrs
)))
goto
exit
;
...
...
dlls/wldap32/ber.c
View file @
17021e53
...
...
@@ -92,11 +92,11 @@ int CDECL WLDAP32_ber_flatten( WLDAP32_BerElement *ber, BERVAL **berval )
struct
berval
*
bervalW
;
struct
ber_flatten_params
params
=
{
BER
(
ber
),
&
bervalU
};
if
(
LDAP_CALL
(
ber_flatten
,
&
params
))
return
LBER_ERROR
;
if
(
LDAP_CALL
(
ber_flatten
,
&
params
))
return
WLDAP32_
LBER_ERROR
;
if
(
!
(
bervalW
=
bervalUtoW
(
bervalU
)))
return
LBER_ERROR
;
if
(
!
(
bervalW
=
bervalUtoW
(
bervalU
)))
return
WLDAP32_
LBER_ERROR
;
LDAP_CALL
(
ber_bvfree
,
bervalU
);
if
(
!
bervalW
)
return
LBER_ERROR
;
if
(
!
bervalW
)
return
WLDAP32_
LBER_ERROR
;
*
berval
=
bervalW
;
return
0
;
}
...
...
dlls/wldap32/bind.c
View file @
17021e53
...
...
@@ -36,7 +36,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(wldap32);
*/
ULONG
CDECL
ldap_bindA
(
LDAP
*
ld
,
char
*
dn
,
char
*
cred
,
ULONG
method
)
{
ULONG
ret
=
LDAP_NO_MEMORY
;
ULONG
ret
=
WLDAP32_
LDAP_NO_MEMORY
;
WCHAR
*
dnW
=
NULL
,
*
credW
=
NULL
;
TRACE
(
"(%p, %s, %p, %#lx)
\n
"
,
ld
,
debugstr_a
(
dn
),
cred
,
method
);
...
...
@@ -59,7 +59,7 @@ exit:
*/
ULONG
CDECL
ldap_bindW
(
LDAP
*
ld
,
WCHAR
*
dn
,
WCHAR
*
cred
,
ULONG
method
)
{
ULONG
ret
=
LDAP_NO_MEMORY
;
ULONG
ret
=
WLDAP32_
LDAP_NO_MEMORY
;
char
*
dnU
=
NULL
,
*
credU
=
NULL
;
struct
bervalU
pwd
=
{
0
,
NULL
};
int
msg
;
...
...
@@ -67,7 +67,7 @@ ULONG CDECL ldap_bindW( LDAP *ld, WCHAR *dn, WCHAR *cred, ULONG method )
TRACE
(
"(%p, %s, %p, %#lx)
\n
"
,
ld
,
debugstr_w
(
dn
),
cred
,
method
);
if
(
!
ld
)
return
~
0u
;
if
(
method
!=
LDAP_AUTH_SIMPLE
)
return
LDAP_PARAM_ERROR
;
if
(
method
!=
WLDAP32_LDAP_AUTH_SIMPLE
)
return
WLDAP32_
LDAP_PARAM_ERROR
;
if
(
dn
&&
!
(
dnU
=
strWtoU
(
dn
)))
goto
exit
;
if
(
cred
)
...
...
@@ -81,7 +81,7 @@ ULONG CDECL ldap_bindW( LDAP *ld, WCHAR *dn, WCHAR *cred, ULONG method )
struct
ldap_sasl_bind_params
params
=
{
CTX
(
ld
),
dnU
,
0
,
&
pwd
,
NULL
,
NULL
,
&
msg
};
ret
=
map_error
(
LDAP_CALL
(
ldap_sasl_bind
,
&
params
));
}
if
(
ret
==
LDAP_SUCCESS
)
if
(
ret
==
WLDAP32_
LDAP_SUCCESS
)
ret
=
msg
;
else
ret
=
~
0u
;
...
...
@@ -97,17 +97,17 @@ exit:
*/
ULONG
CDECL
ldap_bind_sA
(
LDAP
*
ld
,
char
*
dn
,
char
*
cred
,
ULONG
method
)
{
ULONG
ret
=
LDAP_NO_MEMORY
;
ULONG
ret
=
WLDAP32_
LDAP_NO_MEMORY
;
WCHAR
*
dnW
=
NULL
,
*
credW
=
NULL
;
TRACE
(
"(%p, %s, %p, %#lx)
\n
"
,
ld
,
debugstr_a
(
dn
),
cred
,
method
);
if
(
!
ld
)
return
LDAP_PARAM_ERROR
;
if
(
!
ld
)
return
WLDAP32_
LDAP_PARAM_ERROR
;
if
(
dn
&&
!
(
dnW
=
strAtoW
(
dn
)))
goto
exit
;
if
(
cred
)
{
if
(
method
==
LDAP_AUTH_SIMPLE
)
if
(
method
==
WLDAP32_
LDAP_AUTH_SIMPLE
)
{
if
(
!
(
credW
=
strAtoW
(
cred
)))
goto
exit
;
}
...
...
@@ -127,15 +127,15 @@ exit:
*/
ULONG
CDECL
ldap_bind_sW
(
LDAP
*
ld
,
WCHAR
*
dn
,
WCHAR
*
cred
,
ULONG
method
)
{
ULONG
ret
=
LDAP_NO_MEMORY
;
ULONG
ret
=
WLDAP32_
LDAP_NO_MEMORY
;
char
*
dnU
=
NULL
,
*
credU
=
NULL
;
struct
bervalU
pwd
=
{
0
,
NULL
};
TRACE
(
"(%p, %s, %p, %#lx)
\n
"
,
ld
,
debugstr_w
(
dn
),
cred
,
method
);
if
(
!
ld
)
return
LDAP_PARAM_ERROR
;
if
(
!
ld
)
return
WLDAP32_
LDAP_PARAM_ERROR
;
if
(
method
==
LDAP_AUTH_SIMPLE
)
if
(
method
==
WLDAP32_
LDAP_AUTH_SIMPLE
)
{
if
(
dn
&&
!
(
dnU
=
strWtoU
(
dn
)))
goto
exit
;
if
(
cred
)
...
...
@@ -150,7 +150,7 @@ ULONG CDECL ldap_bind_sW( LDAP *ld, WCHAR *dn, WCHAR *cred, ULONG method )
ret
=
map_error
(
LDAP_CALL
(
ldap_sasl_bind_s
,
&
params
));
}
}
else
if
(
method
==
LDAP_AUTH_NEGOTIATE
)
else
if
(
method
==
WLDAP32_
LDAP_AUTH_NEGOTIATE
)
{
SEC_WINNT_AUTH_IDENTITY_A
idU
;
SEC_WINNT_AUTH_IDENTITY_W
idW
;
...
...
@@ -194,7 +194,7 @@ ULONG CDECL ldap_bind_sW( LDAP *ld, WCHAR *dn, WCHAR *cred, ULONG method )
else
{
FIXME
(
"method %#lx not supported
\n
"
,
method
);
return
LDAP_PARAM_ERROR
;
return
WLDAP32_
LDAP_PARAM_ERROR
;
}
exit:
...
...
@@ -209,14 +209,14 @@ exit:
ULONG
CDECL
ldap_sasl_bindA
(
LDAP
*
ld
,
const
PCHAR
dn
,
const
PCHAR
mechanism
,
const
BERVAL
*
cred
,
LDAPControlA
**
serverctrls
,
LDAPControlA
**
clientctrls
,
int
*
message
)
{
ULONG
ret
=
LDAP_NO_MEMORY
;
ULONG
ret
=
WLDAP32_
LDAP_NO_MEMORY
;
WCHAR
*
dnW
,
*
mechanismW
=
NULL
;
LDAPControlW
**
serverctrlsW
=
NULL
,
**
clientctrlsW
=
NULL
;
TRACE
(
"(%p, %s, %s, %p, %p, %p, %p)
\n
"
,
ld
,
debugstr_a
(
dn
),
debugstr_a
(
mechanism
),
cred
,
serverctrls
,
clientctrls
,
message
);
if
(
!
ld
||
!
dn
||
!
mechanism
||
!
cred
||
!
message
)
return
LDAP_PARAM_ERROR
;
if
(
!
ld
||
!
dn
||
!
mechanism
||
!
cred
||
!
message
)
return
WLDAP32_
LDAP_PARAM_ERROR
;
if
(
!
(
dnW
=
strAtoW
(
dn
)))
goto
exit
;
if
(
!
(
mechanismW
=
strAtoW
(
mechanism
)))
goto
exit
;
...
...
@@ -239,7 +239,7 @@ exit:
ULONG
CDECL
ldap_sasl_bindW
(
LDAP
*
ld
,
const
PWCHAR
dn
,
const
PWCHAR
mechanism
,
const
BERVAL
*
cred
,
LDAPControlW
**
serverctrls
,
LDAPControlW
**
clientctrls
,
int
*
message
)
{
ULONG
ret
=
LDAP_NO_MEMORY
;
ULONG
ret
=
WLDAP32_
LDAP_NO_MEMORY
;
char
*
dnU
,
*
mechanismU
=
NULL
;
LDAPControlU
**
serverctrlsU
=
NULL
,
**
clientctrlsU
=
NULL
;
struct
bervalU
credU
;
...
...
@@ -247,7 +247,7 @@ ULONG CDECL ldap_sasl_bindW( LDAP *ld, const PWCHAR dn, const PWCHAR mechanism,
TRACE
(
"(%p, %s, %s, %p, %p, %p, %p)
\n
"
,
ld
,
debugstr_w
(
dn
),
debugstr_w
(
mechanism
),
cred
,
serverctrls
,
clientctrls
,
message
);
if
(
!
ld
||
!
dn
||
!
mechanism
||
!
cred
||
!
message
)
return
LDAP_PARAM_ERROR
;
if
(
!
ld
||
!
dn
||
!
mechanism
||
!
cred
||
!
message
)
return
WLDAP32_
LDAP_PARAM_ERROR
;
if
(
!
(
dnU
=
strWtoU
(
dn
)))
goto
exit
;
if
(
!
(
mechanismU
=
strWtoU
(
mechanism
)))
goto
exit
;
...
...
@@ -275,14 +275,14 @@ exit:
ULONG
CDECL
ldap_sasl_bind_sA
(
LDAP
*
ld
,
const
PCHAR
dn
,
const
PCHAR
mechanism
,
const
BERVAL
*
cred
,
LDAPControlA
**
serverctrls
,
LDAPControlA
**
clientctrls
,
BERVAL
**
serverdata
)
{
ULONG
ret
=
LDAP_NO_MEMORY
;
ULONG
ret
=
WLDAP32_
LDAP_NO_MEMORY
;
WCHAR
*
dnW
,
*
mechanismW
=
NULL
;
LDAPControlW
**
serverctrlsW
=
NULL
,
**
clientctrlsW
=
NULL
;
TRACE
(
"(%p, %s, %s, %p, %p, %p, %p)
\n
"
,
ld
,
debugstr_a
(
dn
),
debugstr_a
(
mechanism
),
cred
,
serverctrls
,
clientctrls
,
serverdata
);
if
(
!
ld
||
!
dn
||
!
mechanism
||
!
cred
||
!
serverdata
)
return
LDAP_PARAM_ERROR
;
if
(
!
ld
||
!
dn
||
!
mechanism
||
!
cred
||
!
serverdata
)
return
WLDAP32_
LDAP_PARAM_ERROR
;
if
(
!
(
dnW
=
strAtoW
(
dn
)))
goto
exit
;
if
(
!
(
mechanismW
=
strAtoW
(
mechanism
)))
goto
exit
;
...
...
@@ -305,7 +305,7 @@ exit:
ULONG
CDECL
ldap_sasl_bind_sW
(
LDAP
*
ld
,
const
PWCHAR
dn
,
const
PWCHAR
mechanism
,
const
BERVAL
*
cred
,
LDAPControlW
**
serverctrls
,
LDAPControlW
**
clientctrls
,
BERVAL
**
serverdata
)
{
ULONG
ret
=
LDAP_NO_MEMORY
;
ULONG
ret
=
WLDAP32_
LDAP_NO_MEMORY
;
char
*
dnU
,
*
mechanismU
=
NULL
;
LDAPControlU
**
serverctrlsU
=
NULL
,
**
clientctrlsU
=
NULL
;
struct
bervalU
*
dataU
,
credU
;
...
...
@@ -313,7 +313,7 @@ ULONG CDECL ldap_sasl_bind_sW( LDAP *ld, const PWCHAR dn, const PWCHAR mechanism
TRACE
(
"(%p, %s, %s, %p, %p, %p, %p)
\n
"
,
ld
,
debugstr_w
(
dn
),
debugstr_w
(
mechanism
),
cred
,
serverctrls
,
clientctrls
,
serverdata
);
if
(
!
ld
||
!
dn
||
!
mechanism
||
!
cred
||
!
serverdata
)
return
LDAP_PARAM_ERROR
;
if
(
!
ld
||
!
dn
||
!
mechanism
||
!
cred
||
!
serverdata
)
return
WLDAP32_
LDAP_PARAM_ERROR
;
if
(
!
(
dnU
=
strWtoU
(
dn
)))
goto
exit
;
if
(
!
(
mechanismU
=
strWtoU
(
mechanism
)))
goto
exit
;
...
...
@@ -327,10 +327,10 @@ ULONG CDECL ldap_sasl_bind_sW( LDAP *ld, const PWCHAR dn, const PWCHAR mechanism
struct
ldap_sasl_bind_s_params
params
=
{
CTX
(
ld
),
dnU
,
mechanismU
,
&
credU
,
serverctrlsU
,
clientctrlsU
,
&
dataU
};
ret
=
map_error
(
LDAP_CALL
(
ldap_sasl_bind_s
,
&
params
));
}
if
(
ret
==
LDAP_SUCCESS
)
if
(
ret
==
WLDAP32_
LDAP_SUCCESS
)
{
BERVAL
*
ptr
;
if
(
!
(
ptr
=
bervalUtoW
(
dataU
)))
ret
=
LDAP_NO_MEMORY
;
if
(
!
(
ptr
=
bervalUtoW
(
dataU
)))
ret
=
WLDAP32_
LDAP_NO_MEMORY
;
else
*
serverdata
=
ptr
;
LDAP_CALL
(
ber_bvfree
,
dataU
);
}
...
...
@@ -348,7 +348,7 @@ exit:
*/
ULONG
CDECL
ldap_simple_bindA
(
LDAP
*
ld
,
char
*
dn
,
char
*
passwd
)
{
ULONG
ret
=
LDAP_NO_MEMORY
;
ULONG
ret
=
WLDAP32_
LDAP_NO_MEMORY
;
WCHAR
*
dnW
=
NULL
,
*
passwdW
=
NULL
;
TRACE
(
"(%p, %s, %p)
\n
"
,
ld
,
debugstr_a
(
dn
),
passwd
);
...
...
@@ -371,7 +371,7 @@ exit:
*/
ULONG
CDECL
ldap_simple_bindW
(
LDAP
*
ld
,
WCHAR
*
dn
,
WCHAR
*
passwd
)
{
ULONG
ret
=
LDAP_NO_MEMORY
;
ULONG
ret
=
WLDAP32_
LDAP_NO_MEMORY
;
char
*
dnU
=
NULL
,
*
passwdU
=
NULL
;
struct
bervalU
pwd
=
{
0
,
NULL
};
int
msg
;
...
...
@@ -392,7 +392,7 @@ ULONG CDECL ldap_simple_bindW( LDAP *ld, WCHAR *dn, WCHAR *passwd )
struct
ldap_sasl_bind_params
params
=
{
CTX
(
ld
),
dnU
,
0
,
&
pwd
,
NULL
,
NULL
,
&
msg
};
ret
=
map_error
(
LDAP_CALL
(
ldap_sasl_bind
,
&
params
));
}
if
(
ret
==
LDAP_SUCCESS
)
if
(
ret
==
WLDAP32_
LDAP_SUCCESS
)
ret
=
msg
;
else
ret
=
~
0u
;
...
...
@@ -408,12 +408,12 @@ exit:
*/
ULONG
CDECL
ldap_simple_bind_sA
(
LDAP
*
ld
,
char
*
dn
,
char
*
passwd
)
{
ULONG
ret
=
LDAP_NO_MEMORY
;
ULONG
ret
=
WLDAP32_
LDAP_NO_MEMORY
;
WCHAR
*
dnW
=
NULL
,
*
passwdW
=
NULL
;
TRACE
(
"(%p, %s, %p)
\n
"
,
ld
,
debugstr_a
(
dn
),
passwd
);
if
(
!
ld
)
return
LDAP_PARAM_ERROR
;
if
(
!
ld
)
return
WLDAP32_
LDAP_PARAM_ERROR
;
if
(
dn
&&
!
(
dnW
=
strAtoW
(
dn
)))
goto
exit
;
if
(
passwd
&&
!
(
passwdW
=
strAtoW
(
passwd
)))
goto
exit
;
...
...
@@ -431,13 +431,13 @@ exit:
*/
ULONG
CDECL
ldap_simple_bind_sW
(
LDAP
*
ld
,
WCHAR
*
dn
,
WCHAR
*
passwd
)
{
ULONG
ret
=
LDAP_NO_MEMORY
;
ULONG
ret
=
WLDAP32_
LDAP_NO_MEMORY
;
char
*
dnU
=
NULL
,
*
passwdU
=
NULL
;
struct
bervalU
pwd
=
{
0
,
NULL
};
TRACE
(
"(%p, %s, %p)
\n
"
,
ld
,
debugstr_w
(
dn
),
passwd
);
if
(
!
ld
)
return
LDAP_PARAM_ERROR
;
if
(
!
ld
)
return
WLDAP32_
LDAP_PARAM_ERROR
;
if
(
dn
&&
!
(
dnU
=
strWtoU
(
dn
)))
goto
exit
;
if
(
passwd
)
...
...
@@ -472,7 +472,7 @@ ULONG CDECL WLDAP32_ldap_unbind( LDAP *ld )
struct
ldap_unbind_ext_params
params
=
{
CTX
(
ld
),
NULL
,
NULL
};
ret
=
map_error
(
LDAP_CALL
(
ldap_unbind_ext
,
&
params
));
}
else
return
LDAP_PARAM_ERROR
;
else
return
WLDAP32_
LDAP_PARAM_ERROR
;
if
(
SERVER_CTRLS
(
ld
))
LDAP_CALL
(
ldap_value_free_len
,
SERVER_CTRLS
(
ld
)
);
...
...
@@ -494,7 +494,7 @@ ULONG CDECL WLDAP32_ldap_unbind_s( LDAP *ld )
struct
ldap_unbind_ext_s_params
params
=
{
CTX
(
ld
),
NULL
,
NULL
};
ret
=
map_error
(
LDAP_CALL
(
ldap_unbind_ext_s
,
&
params
));
}
else
return
LDAP_PARAM_ERROR
;
else
return
WLDAP32_
LDAP_PARAM_ERROR
;
if
(
SERVER_CTRLS
(
ld
))
LDAP_CALL
(
ldap_value_free_len
,
SERVER_CTRLS
(
ld
)
);
...
...
dlls/wldap32/compare.c
View file @
17021e53
...
...
@@ -64,7 +64,7 @@ ULONG CDECL ldap_compareW( LDAP *ld, WCHAR *dn, WCHAR *attr, WCHAR *value )
TRACE
(
"(%p, %s, %s, %s)
\n
"
,
ld
,
debugstr_w
(
dn
),
debugstr_w
(
attr
),
debugstr_w
(
value
)
);
ret
=
ldap_compare_extW
(
ld
,
dn
,
attr
,
value
,
NULL
,
NULL
,
NULL
,
&
msg
);
if
(
ret
==
LDAP_SUCCESS
)
return
msg
;
if
(
ret
==
WLDAP32_
LDAP_SUCCESS
)
return
msg
;
return
~
0u
;
}
...
...
@@ -75,14 +75,14 @@ ULONG CDECL ldap_compare_extA( LDAP *ld, char *dn, char *attr, char *value,
struct
berval
*
data
,
LDAPControlA
**
serverctrls
,
LDAPControlA
**
clientctrls
,
ULONG
*
message
)
{
ULONG
ret
=
LDAP_NO_MEMORY
;
ULONG
ret
=
WLDAP32_
LDAP_NO_MEMORY
;
WCHAR
*
dnW
=
NULL
,
*
attrW
=
NULL
,
*
valueW
=
NULL
;
LDAPControlW
**
serverctrlsW
=
NULL
,
**
clientctrlsW
=
NULL
;
TRACE
(
"(%p, %s, %s, %s, %p, %p, %p, %p)
\n
"
,
ld
,
debugstr_a
(
dn
),
debugstr_a
(
attr
),
debugstr_a
(
value
),
data
,
serverctrls
,
clientctrls
,
message
);
if
(
!
ld
||
!
message
)
return
LDAP_PARAM_ERROR
;
if
(
!
ld
||
!
message
)
return
WLDAP32_
LDAP_PARAM_ERROR
;
if
(
dn
&&
!
(
dnW
=
strAtoW
(
dn
)))
goto
exit
;
if
(
attr
&&
!
(
attrW
=
strAtoW
(
attr
)))
goto
exit
;
...
...
@@ -107,7 +107,7 @@ exit:
ULONG
CDECL
ldap_compare_extW
(
LDAP
*
ld
,
WCHAR
*
dn
,
WCHAR
*
attr
,
WCHAR
*
value
,
struct
berval
*
data
,
LDAPControlW
**
serverctrls
,
LDAPControlW
**
clientctrls
,
ULONG
*
message
)
{
ULONG
ret
=
LDAP_NO_MEMORY
;
ULONG
ret
=
WLDAP32_
LDAP_NO_MEMORY
;
char
*
dnU
=
NULL
,
*
attrU
=
NULL
,
*
valueU
=
NULL
;
LDAPControlU
**
serverctrlsU
=
NULL
,
**
clientctrlsU
=
NULL
;
struct
bervalU
*
dataU
=
NULL
,
val
=
{
0
,
NULL
};
...
...
@@ -115,8 +115,8 @@ ULONG CDECL ldap_compare_extW( LDAP *ld, WCHAR *dn, WCHAR *attr, WCHAR *value, s
TRACE
(
"(%p, %s, %s, %s, %p, %p, %p, %p)
\n
"
,
ld
,
debugstr_w
(
dn
),
debugstr_w
(
attr
),
debugstr_w
(
value
),
data
,
serverctrls
,
clientctrls
,
message
);
if
(
!
ld
||
!
message
)
return
LDAP_PARAM_ERROR
;
if
(
!
attr
)
return
LDAP_NO_MEMORY
;
if
(
!
ld
||
!
message
)
return
WLDAP32_
LDAP_PARAM_ERROR
;
if
(
!
attr
)
return
WLDAP32_
LDAP_NO_MEMORY
;
if
(
dn
&&
!
(
dnU
=
strWtoU
(
dn
)))
goto
exit
;
if
(
!
(
attrU
=
strWtoU
(
attr
)))
goto
exit
;
...
...
@@ -155,14 +155,14 @@ exit:
ULONG
CDECL
ldap_compare_ext_sA
(
LDAP
*
ld
,
char
*
dn
,
char
*
attr
,
char
*
value
,
struct
berval
*
data
,
LDAPControlA
**
serverctrls
,
LDAPControlA
**
clientctrls
)
{
ULONG
ret
=
LDAP_NO_MEMORY
;
ULONG
ret
=
WLDAP32_
LDAP_NO_MEMORY
;
WCHAR
*
dnW
=
NULL
,
*
attrW
=
NULL
,
*
valueW
=
NULL
;
LDAPControlW
**
serverctrlsW
=
NULL
,
**
clientctrlsW
=
NULL
;
TRACE
(
"(%p, %s, %s, %s, %p, %p, %p)
\n
"
,
ld
,
debugstr_a
(
dn
),
debugstr_a
(
attr
),
debugstr_a
(
value
),
data
,
serverctrls
,
clientctrls
);
if
(
!
ld
)
return
LDAP_PARAM_ERROR
;
if
(
!
ld
)
return
WLDAP32_
LDAP_PARAM_ERROR
;
if
(
dn
&&
!
(
dnW
=
strAtoW
(
dn
)))
goto
exit
;
if
(
attr
&&
!
(
attrW
=
strAtoW
(
attr
)))
goto
exit
;
...
...
@@ -187,7 +187,7 @@ exit:
ULONG
CDECL
ldap_compare_ext_sW
(
LDAP
*
ld
,
WCHAR
*
dn
,
WCHAR
*
attr
,
WCHAR
*
value
,
struct
berval
*
data
,
LDAPControlW
**
serverctrls
,
LDAPControlW
**
clientctrls
)
{
ULONG
ret
=
LDAP_NO_MEMORY
;
ULONG
ret
=
WLDAP32_
LDAP_NO_MEMORY
;
char
*
dnU
=
NULL
,
*
attrU
=
NULL
,
*
valueU
=
NULL
;
LDAPControlU
**
serverctrlsU
=
NULL
,
**
clientctrlsU
=
NULL
;
struct
bervalU
*
dataU
=
NULL
,
val
=
{
0
,
NULL
};
...
...
@@ -195,7 +195,7 @@ ULONG CDECL ldap_compare_ext_sW( LDAP *ld, WCHAR *dn, WCHAR *attr, WCHAR *value,
TRACE
(
"(%p, %s, %s, %s, %p, %p, %p)
\n
"
,
ld
,
debugstr_w
(
dn
),
debugstr_w
(
attr
),
debugstr_w
(
value
),
data
,
serverctrls
,
clientctrls
);
if
(
!
ld
)
return
LDAP_PARAM_ERROR
;
if
(
!
ld
)
return
WLDAP32_
LDAP_PARAM_ERROR
;
if
(
dn
&&
!
(
dnU
=
strWtoU
(
dn
)))
goto
exit
;
if
(
attr
&&
!
(
attrU
=
strWtoU
(
attr
)))
goto
exit
;
...
...
@@ -232,12 +232,12 @@ exit:
*/
ULONG
CDECL
ldap_compare_sA
(
LDAP
*
ld
,
PCHAR
dn
,
PCHAR
attr
,
PCHAR
value
)
{
ULONG
ret
=
LDAP_NO_MEMORY
;
ULONG
ret
=
WLDAP32_
LDAP_NO_MEMORY
;
WCHAR
*
dnW
=
NULL
,
*
attrW
=
NULL
,
*
valueW
=
NULL
;
TRACE
(
"(%p, %s, %s, %s)
\n
"
,
ld
,
debugstr_a
(
dn
),
debugstr_a
(
attr
),
debugstr_a
(
value
)
);
if
(
!
ld
)
return
LDAP_PARAM_ERROR
;
if
(
!
ld
)
return
WLDAP32_
LDAP_PARAM_ERROR
;
if
(
dn
&&
!
(
dnW
=
strAtoW
(
dn
)))
goto
exit
;
if
(
attr
&&
!
(
attrW
=
strAtoW
(
attr
)))
goto
exit
;
...
...
dlls/wldap32/control.c
View file @
17021e53
...
...
@@ -36,7 +36,7 @@ ULONG CDECL ldap_control_freeA( LDAPControlA *control )
{
TRACE
(
"(%p)
\n
"
,
control
);
controlfreeA
(
control
);
return
LDAP_SUCCESS
;
return
WLDAP32_
LDAP_SUCCESS
;
}
/***********************************************************************
...
...
@@ -46,7 +46,7 @@ ULONG CDECL ldap_control_freeW( LDAPControlW *control )
{
TRACE
(
"(%p)
\n
"
,
control
);
controlfreeW
(
control
);
return
LDAP_SUCCESS
;
return
WLDAP32_
LDAP_SUCCESS
;
}
/***********************************************************************
...
...
@@ -56,7 +56,7 @@ ULONG CDECL ldap_controls_freeA( LDAPControlA **controls )
{
TRACE
(
"(%p)
\n
"
,
controls
);
controlarrayfreeA
(
controls
);
return
LDAP_SUCCESS
;
return
WLDAP32_
LDAP_SUCCESS
;
}
/***********************************************************************
...
...
@@ -66,7 +66,7 @@ ULONG CDECL ldap_controls_freeW( LDAPControlW **controls )
{
TRACE
(
"(%p)
\n
"
,
controls
);
controlarrayfreeW
(
controls
);
return
LDAP_SUCCESS
;
return
WLDAP32_
LDAP_SUCCESS
;
}
/***********************************************************************
...
...
@@ -80,16 +80,16 @@ ULONG CDECL ldap_create_sort_controlA( LDAP *ld, LDAPSortKeyA **sortkey, UCHAR c
TRACE
(
"(%p, %p, 0x%02x, %p)
\n
"
,
ld
,
sortkey
,
critical
,
control
);
if
(
!
ld
||
!
sortkey
||
!
control
)
return
LDAP_PARAM_ERROR
;
if
(
!
ld
||
!
sortkey
||
!
control
)
return
WLDAP32_
LDAP_PARAM_ERROR
;
if
(
!
(
sortkeyW
=
sortkeyarrayAtoW
(
sortkey
)))
return
LDAP_NO_MEMORY
;
if
(
!
(
sortkeyW
=
sortkeyarrayAtoW
(
sortkey
)))
return
WLDAP32_
LDAP_NO_MEMORY
;
ret
=
ldap_create_sort_controlW
(
ld
,
sortkeyW
,
critical
,
&
controlW
);
if
(
ret
==
LDAP_SUCCESS
)
if
(
ret
==
WLDAP32_
LDAP_SUCCESS
)
{
LDAPControlA
*
controlA
=
controlWtoA
(
controlW
);
if
(
controlA
)
*
control
=
controlA
;
else
ret
=
LDAP_NO_MEMORY
;
else
ret
=
WLDAP32_
LDAP_NO_MEMORY
;
ldap_control_freeW
(
controlW
);
}
...
...
@@ -108,20 +108,20 @@ ULONG CDECL ldap_create_sort_controlW( LDAP *ld, LDAPSortKeyW **sortkey, UCHAR c
TRACE
(
"(%p, %p, 0x%02x, %p)
\n
"
,
ld
,
sortkey
,
critical
,
control
);
if
(
!
ld
||
!
sortkey
||
!
control
)
return
LDAP_PARAM_ERROR
;
if
(
!
ld
||
!
sortkey
||
!
control
)
return
WLDAP32_
LDAP_PARAM_ERROR
;
if
((
sortkeyU
=
sortkeyarrayWtoU
(
sortkey
)))
{
struct
ldap_create_sort_control_params
params
=
{
CTX
(
ld
),
sortkeyU
,
critical
,
&
controlU
};
ret
=
map_error
(
LDAP_CALL
(
ldap_create_sort_control
,
&
params
));
}
else
return
LDAP_NO_MEMORY
;
else
return
WLDAP32_
LDAP_NO_MEMORY
;
if
(
ret
==
LDAP_SUCCESS
)
if
(
ret
==
WLDAP32_
LDAP_SUCCESS
)
{
LDAPControlW
*
controlW
=
controlUtoW
(
controlU
);
if
(
controlW
)
*
control
=
controlW
;
else
ret
=
LDAP_NO_MEMORY
;
else
ret
=
WLDAP32_
LDAP_NO_MEMORY
;
LDAP_CALL
(
ldap_control_free
,
controlU
);
}
...
...
@@ -142,11 +142,11 @@ INT CDECL ldap_create_vlv_controlA( LDAP *ld, LDAPVLVInfo *info, UCHAR critical,
if
(
!
ld
||
!
control
)
return
~
0u
;
ret
=
ldap_create_vlv_controlW
(
ld
,
info
,
critical
,
&
controlW
);
if
(
ret
==
LDAP_SUCCESS
)
if
(
ret
==
WLDAP32_
LDAP_SUCCESS
)
{
LDAPControlA
*
controlA
=
controlWtoA
(
controlW
);
if
(
controlA
)
*
control
=
controlA
;
else
ret
=
LDAP_NO_MEMORY
;
else
ret
=
WLDAP32_
LDAP_NO_MEMORY
;
ldap_control_freeW
(
controlW
);
}
...
...
@@ -166,17 +166,17 @@ INT CDECL ldap_create_vlv_controlW( LDAP *ld, LDAPVLVInfo *info, UCHAR critical,
if
(
!
ld
||
!
control
)
return
~
0u
;
if
(
info
&&
!
(
infoU
=
vlvinfoWtoU
(
info
)))
return
LDAP_NO_MEMORY
;
if
(
info
&&
!
(
infoU
=
vlvinfoWtoU
(
info
)))
return
WLDAP32_
LDAP_NO_MEMORY
;
else
{
struct
ldap_create_vlv_control_params
params
=
{
CTX
(
ld
),
infoU
,
&
controlU
};
ret
=
map_error
(
LDAP_CALL
(
ldap_create_vlv_control
,
&
params
));
}
if
(
ret
==
LDAP_SUCCESS
)
if
(
ret
==
WLDAP32_
LDAP_SUCCESS
)
{
LDAPControlW
*
controlW
=
controlUtoW
(
controlU
);
if
(
controlW
)
*
control
=
controlW
;
else
ret
=
LDAP_NO_MEMORY
;
else
ret
=
WLDAP32_
LDAP_NO_MEMORY
;
LDAP_CALL
(
ldap_control_free
,
controlU
);
}
...
...
@@ -203,7 +203,7 @@ ULONG CDECL ldap_encode_sort_controlA( LDAP *ld, LDAPSortKeyA **sortkeys, LDAPCo
LDAPControlA
*
control
;
ULONG
result
;
if
((
result
=
ldap_create_sort_controlA
(
ld
,
sortkeys
,
critical
,
&
control
))
==
LDAP_SUCCESS
)
if
((
result
=
ldap_create_sort_controlA
(
ld
,
sortkeys
,
critical
,
&
control
))
==
WLDAP32_
LDAP_SUCCESS
)
{
ret
->
ldctl_oid
=
strdupU
(
control
->
ldctl_oid
);
bv_val_dup
(
&
control
->
ldctl_value
,
&
ret
->
ldctl_value
);
...
...
@@ -221,7 +221,7 @@ ULONG CDECL ldap_encode_sort_controlW( LDAP *ld, LDAPSortKeyW **sortkeys, LDAPCo
LDAPControlW
*
control
;
ULONG
result
;
if
((
result
=
ldap_create_sort_controlW
(
ld
,
sortkeys
,
critical
,
&
control
))
==
LDAP_SUCCESS
)
if
((
result
=
ldap_create_sort_controlW
(
ld
,
sortkeys
,
critical
,
&
control
))
==
WLDAP32_
LDAP_SUCCESS
)
{
ret
->
ldctl_oid
=
strdupW
(
control
->
ldctl_oid
);
bv_val_dup
(
&
control
->
ldctl_value
,
&
ret
->
ldctl_value
);
...
...
dlls/wldap32/delete.c
View file @
17021e53
...
...
@@ -40,7 +40,7 @@ ULONG CDECL ldap_deleteA( LDAP *ld, char *dn )
TRACE
(
"(%p, %s)
\n
"
,
ld
,
debugstr_a
(
dn
)
);
if
(
!
ld
)
return
~
0u
;
if
(
dn
&&
!
(
dnW
=
strAtoW
(
dn
)))
return
LDAP_NO_MEMORY
;
if
(
dn
&&
!
(
dnW
=
strAtoW
(
dn
)))
return
WLDAP32_
LDAP_NO_MEMORY
;
ret
=
ldap_deleteW
(
ld
,
dnW
);
free
(
dnW
);
...
...
@@ -57,7 +57,7 @@ ULONG CDECL ldap_deleteW( LDAP *ld, WCHAR *dn )
TRACE
(
"(%p, %s)
\n
"
,
ld
,
debugstr_w
(
dn
)
);
ret
=
ldap_delete_extW
(
ld
,
dn
,
NULL
,
NULL
,
&
msg
);
if
(
ret
==
LDAP_SUCCESS
)
return
msg
;
if
(
ret
==
WLDAP32_
LDAP_SUCCESS
)
return
msg
;
return
~
0u
;
}
...
...
@@ -67,13 +67,13 @@ ULONG CDECL ldap_deleteW( LDAP *ld, WCHAR *dn )
ULONG
CDECL
ldap_delete_extA
(
LDAP
*
ld
,
char
*
dn
,
LDAPControlA
**
serverctrls
,
LDAPControlA
**
clientctrls
,
ULONG
*
message
)
{
ULONG
ret
=
LDAP_NO_MEMORY
;
ULONG
ret
=
WLDAP32_
LDAP_NO_MEMORY
;
WCHAR
*
dnW
=
NULL
;
LDAPControlW
**
serverctrlsW
=
NULL
,
**
clientctrlsW
=
NULL
;
TRACE
(
"(%p, %s, %p, %p, %p)
\n
"
,
ld
,
debugstr_a
(
dn
),
serverctrls
,
clientctrls
,
message
);
if
(
!
ld
)
return
LDAP_PARAM_ERROR
;
if
(
!
ld
)
return
WLDAP32_
LDAP_PARAM_ERROR
;
if
(
dn
&&
!
(
dnW
=
strAtoW
(
dn
)))
goto
exit
;
if
(
serverctrls
&&
!
(
serverctrlsW
=
controlarrayAtoW
(
serverctrls
)))
goto
exit
;
...
...
@@ -94,13 +94,13 @@ exit:
ULONG
CDECL
ldap_delete_extW
(
LDAP
*
ld
,
WCHAR
*
dn
,
LDAPControlW
**
serverctrls
,
LDAPControlW
**
clientctrls
,
ULONG
*
message
)
{
ULONG
ret
=
LDAP_NO_MEMORY
;
ULONG
ret
=
WLDAP32_
LDAP_NO_MEMORY
;
char
*
dnU
=
NULL
;
LDAPControlU
**
serverctrlsU
=
NULL
,
**
clientctrlsU
=
NULL
;
TRACE
(
"(%p, %s, %p, %p, %p)
\n
"
,
ld
,
debugstr_w
(
dn
),
serverctrls
,
clientctrls
,
message
);
if
(
!
ld
)
return
LDAP_PARAM_ERROR
;
if
(
!
ld
)
return
WLDAP32_
LDAP_PARAM_ERROR
;
if
(
dn
&&
!
(
dnU
=
strWtoU
(
dn
)))
goto
exit
;
if
(
serverctrls
&&
!
(
serverctrlsU
=
controlarrayWtoU
(
serverctrls
)))
goto
exit
;
...
...
@@ -123,13 +123,13 @@ exit:
*/
ULONG
CDECL
ldap_delete_ext_sA
(
LDAP
*
ld
,
char
*
dn
,
LDAPControlA
**
serverctrls
,
LDAPControlA
**
clientctrls
)
{
ULONG
ret
=
LDAP_NO_MEMORY
;
ULONG
ret
=
WLDAP32_
LDAP_NO_MEMORY
;
WCHAR
*
dnW
=
NULL
;
LDAPControlW
**
serverctrlsW
=
NULL
,
**
clientctrlsW
=
NULL
;
TRACE
(
"(%p, %s, %p, %p)
\n
"
,
ld
,
debugstr_a
(
dn
),
serverctrls
,
clientctrls
);
if
(
!
ld
)
return
LDAP_PARAM_ERROR
;
if
(
!
ld
)
return
WLDAP32_
LDAP_PARAM_ERROR
;
if
(
dn
&&
!
(
dnW
=
strAtoW
(
dn
)))
goto
exit
;
if
(
serverctrls
&&
!
(
serverctrlsW
=
controlarrayAtoW
(
serverctrls
)))
goto
exit
;
...
...
@@ -149,13 +149,13 @@ exit:
*/
ULONG
CDECL
ldap_delete_ext_sW
(
LDAP
*
ld
,
WCHAR
*
dn
,
LDAPControlW
**
serverctrls
,
LDAPControlW
**
clientctrls
)
{
ULONG
ret
=
LDAP_NO_MEMORY
;
ULONG
ret
=
WLDAP32_
LDAP_NO_MEMORY
;
char
*
dnU
=
NULL
;
LDAPControlU
**
serverctrlsU
=
NULL
,
**
clientctrlsU
=
NULL
;
TRACE
(
"(%p, %s, %p, %p)
\n
"
,
ld
,
debugstr_w
(
dn
),
serverctrls
,
clientctrls
);
if
(
!
ld
)
return
LDAP_PARAM_ERROR
;
if
(
!
ld
)
return
WLDAP32_
LDAP_PARAM_ERROR
;
if
(
dn
&&
!
(
dnU
=
strWtoU
(
dn
)))
goto
exit
;
if
(
serverctrls
&&
!
(
serverctrlsU
=
controlarrayWtoU
(
serverctrls
)))
goto
exit
;
...
...
@@ -183,8 +183,8 @@ ULONG CDECL ldap_delete_sA( LDAP *ld, char *dn )
TRACE
(
"(%p, %s)
\n
"
,
ld
,
debugstr_a
(
dn
)
);
if
(
!
ld
)
return
LDAP_PARAM_ERROR
;
if
(
dn
&&
!
(
dnW
=
strAtoW
(
dn
)))
return
LDAP_NO_MEMORY
;
if
(
!
ld
)
return
WLDAP32_
LDAP_PARAM_ERROR
;
if
(
dn
&&
!
(
dnW
=
strAtoW
(
dn
)))
return
WLDAP32_
LDAP_NO_MEMORY
;
ret
=
ldap_delete_sW
(
ld
,
dnW
);
free
(
dnW
);
...
...
dlls/wldap32/dn.c
View file @
17021e53
...
...
@@ -164,16 +164,16 @@ ULONG CDECL ldap_ufn2dnA( char *ufn, char **dn )
TRACE
(
"(%s, %p)
\n
"
,
debugstr_a
(
ufn
),
dn
);
if
(
!
dn
)
return
LDAP_PARAM_ERROR
;
if
(
!
dn
)
return
WLDAP32_
LDAP_PARAM_ERROR
;
*
dn
=
NULL
;
if
(
ufn
&&
!
(
ufnW
=
strAtoW
(
ufn
)))
return
LDAP_NO_MEMORY
;
if
(
ufn
&&
!
(
ufnW
=
strAtoW
(
ufn
)))
return
WLDAP32_
LDAP_NO_MEMORY
;
ret
=
ldap_ufn2dnW
(
ufnW
,
&
dnW
);
if
(
dnW
)
{
char
*
str
;
if
(
!
(
str
=
strWtoA
(
dnW
)))
ret
=
LDAP_NO_MEMORY
;
if
(
!
(
str
=
strWtoA
(
dnW
)))
ret
=
WLDAP32_
LDAP_NO_MEMORY
;
else
*
dn
=
str
;
}
...
...
@@ -187,21 +187,21 @@ ULONG CDECL ldap_ufn2dnA( char *ufn, char **dn )
*/
ULONG
CDECL
ldap_ufn2dnW
(
WCHAR
*
ufn
,
WCHAR
**
dn
)
{
ULONG
ret
=
LDAP_SUCCESS
;
ULONG
ret
=
WLDAP32_
LDAP_SUCCESS
;
char
*
ufnU
=
NULL
;
TRACE
(
"(%s, %p)
\n
"
,
debugstr_w
(
ufn
),
dn
);
if
(
!
dn
)
return
LDAP_PARAM_ERROR
;
if
(
!
dn
)
return
WLDAP32_
LDAP_PARAM_ERROR
;
*
dn
=
NULL
;
if
(
ufn
)
{
WCHAR
*
str
;
if
(
!
(
ufnU
=
strWtoU
(
ufn
)))
return
LDAP_NO_MEMORY
;
if
(
!
(
ufnU
=
strWtoU
(
ufn
)))
return
WLDAP32_
LDAP_NO_MEMORY
;
/* FIXME: do more than just a copy */
if
(
!
(
str
=
strUtoW
(
ufnU
)))
ret
=
LDAP_NO_MEMORY
;
if
(
!
(
str
=
strUtoW
(
ufnU
)))
ret
=
WLDAP32_
LDAP_NO_MEMORY
;
else
*
dn
=
str
;
}
...
...
dlls/wldap32/error.c
View file @
17021e53
...
...
@@ -36,24 +36,24 @@ ULONG map_error( int error )
{
switch
(
error
)
{
case
0
:
return
LDAP_SUCCESS
;
case
-
1
:
return
LDAP_SERVER_DOWN
;
case
-
2
:
return
LDAP_LOCAL_ERROR
;
case
-
3
:
return
LDAP_ENCODING_ERROR
;
case
-
4
:
return
LDAP_DECODING_ERROR
;
case
-
5
:
return
LDAP_TIMEOUT
;
case
-
6
:
return
LDAP_AUTH_UNKNOWN
;
case
-
7
:
return
LDAP_FILTER_ERROR
;
case
-
8
:
return
LDAP_USER_CANCELLED
;
case
-
9
:
return
LDAP_PARAM_ERROR
;
case
-
10
:
return
LDAP_NO_MEMORY
;
case
-
11
:
return
LDAP_CONNECT_ERROR
;
case
-
12
:
return
LDAP_NOT_SUPPORTED
;
case
-
13
:
return
LDAP_CONTROL_NOT_FOUND
;
case
-
14
:
return
LDAP_NO_RESULTS_RETURNED
;
case
-
15
:
return
LDAP_MORE_RESULTS_TO_RETURN
;
case
-
16
:
return
LDAP_CLIENT_LOOP
;
case
-
17
:
return
LDAP_REFERRAL_LIMIT_EXCEEDED
;
case
0
:
return
WLDAP32_
LDAP_SUCCESS
;
case
-
1
:
return
WLDAP32_
LDAP_SERVER_DOWN
;
case
-
2
:
return
WLDAP32_
LDAP_LOCAL_ERROR
;
case
-
3
:
return
WLDAP32_
LDAP_ENCODING_ERROR
;
case
-
4
:
return
WLDAP32_
LDAP_DECODING_ERROR
;
case
-
5
:
return
WLDAP32_
LDAP_TIMEOUT
;
case
-
6
:
return
WLDAP32_
LDAP_AUTH_UNKNOWN
;
case
-
7
:
return
WLDAP32_
LDAP_FILTER_ERROR
;
case
-
8
:
return
WLDAP32_
LDAP_USER_CANCELLED
;
case
-
9
:
return
WLDAP32_
LDAP_PARAM_ERROR
;
case
-
10
:
return
WLDAP32_
LDAP_NO_MEMORY
;
case
-
11
:
return
WLDAP32_
LDAP_CONNECT_ERROR
;
case
-
12
:
return
WLDAP32_
LDAP_NOT_SUPPORTED
;
case
-
13
:
return
WLDAP32_
LDAP_CONTROL_NOT_FOUND
;
case
-
14
:
return
WLDAP32_
LDAP_NO_RESULTS_RETURNED
;
case
-
15
:
return
WLDAP32_
LDAP_MORE_RESULTS_TO_RETURN
;
case
-
16
:
return
WLDAP32_
LDAP_CLIENT_LOOP
;
case
-
17
:
return
WLDAP32_
LDAP_REFERRAL_LIMIT_EXCEEDED
;
default:
return
error
;
}
}
...
...
@@ -67,10 +67,10 @@ char * CDECL ldap_err2stringA( ULONG err )
TRACE
(
"(%#lx)
\n
"
,
err
);
if
(
err
<=
LDAP_REFERRAL_LIMIT_EXCEEDED
)
if
(
err
<=
WLDAP32_
LDAP_REFERRAL_LIMIT_EXCEEDED
)
LoadStringA
(
hwldap32
,
err
,
buf
,
256
);
else
LoadStringA
(
hwldap32
,
LDAP_LOCAL_ERROR
,
buf
,
256
);
LoadStringA
(
hwldap32
,
WLDAP32_
LDAP_LOCAL_ERROR
,
buf
,
256
);
return
buf
;
}
...
...
@@ -84,10 +84,10 @@ WCHAR * CDECL ldap_err2stringW( ULONG err )
TRACE
(
"(%#lx)
\n
"
,
err
);
if
(
err
<=
LDAP_REFERRAL_LIMIT_EXCEEDED
)
if
(
err
<=
WLDAP32_
LDAP_REFERRAL_LIMIT_EXCEEDED
)
LoadStringW
(
hwldap32
,
err
,
buf
,
256
);
else
LoadStringW
(
hwldap32
,
LDAP_LOCAL_ERROR
,
buf
,
256
);
LoadStringW
(
hwldap32
,
WLDAP32_
LDAP_LOCAL_ERROR
,
buf
,
256
);
return
buf
;
}
...
...
dlls/wldap32/extended.c
View file @
17021e53
...
...
@@ -36,8 +36,8 @@ ULONG CDECL ldap_close_extended_op( LDAP *ld, ULONG msgid )
{
TRACE
(
"(%p, %#lx)
\n
"
,
ld
,
msgid
);
if
(
!
ld
)
return
LDAP_PARAM_ERROR
;
return
LDAP_SUCCESS
;
if
(
!
ld
)
return
WLDAP32_
LDAP_PARAM_ERROR
;
return
WLDAP32_
LDAP_SUCCESS
;
}
/***********************************************************************
...
...
@@ -46,13 +46,13 @@ ULONG CDECL ldap_close_extended_op( LDAP *ld, ULONG msgid )
ULONG
CDECL
ldap_extended_operationA
(
LDAP
*
ld
,
char
*
oid
,
struct
berval
*
data
,
LDAPControlA
**
serverctrls
,
LDAPControlA
**
clientctrls
,
ULONG
*
message
)
{
ULONG
ret
=
LDAP_NO_MEMORY
;
ULONG
ret
=
WLDAP32_
LDAP_NO_MEMORY
;
WCHAR
*
oidW
=
NULL
;
LDAPControlW
**
serverctrlsW
=
NULL
,
**
clientctrlsW
=
NULL
;
TRACE
(
"(%p, %s, %p, %p, %p, %p)
\n
"
,
ld
,
debugstr_a
(
oid
),
data
,
serverctrls
,
clientctrls
,
message
);
if
(
!
ld
||
!
message
)
return
LDAP_PARAM_ERROR
;
if
(
!
ld
||
!
message
)
return
WLDAP32_
LDAP_PARAM_ERROR
;
if
(
oid
&&
!
(
oidW
=
strAtoW
(
oid
)))
goto
exit
;
if
(
serverctrls
&&
!
(
serverctrlsW
=
controlarrayAtoW
(
serverctrls
)))
goto
exit
;
...
...
@@ -73,14 +73,14 @@ exit:
ULONG
CDECL
ldap_extended_operationW
(
LDAP
*
ld
,
WCHAR
*
oid
,
struct
berval
*
data
,
LDAPControlW
**
serverctrls
,
LDAPControlW
**
clientctrls
,
ULONG
*
message
)
{
ULONG
ret
=
LDAP_NO_MEMORY
;
ULONG
ret
=
WLDAP32_
LDAP_NO_MEMORY
;
char
*
oidU
=
NULL
;
LDAPControlU
**
serverctrlsU
=
NULL
,
**
clientctrlsU
=
NULL
;
struct
bervalU
*
dataU
=
NULL
;
TRACE
(
"(%p, %s, %p, %p, %p, %p)
\n
"
,
ld
,
debugstr_w
(
oid
),
data
,
serverctrls
,
clientctrls
,
message
);
if
(
!
ld
||
!
message
)
return
LDAP_PARAM_ERROR
;
if
(
!
ld
||
!
message
)
return
WLDAP32_
LDAP_PARAM_ERROR
;
if
(
oid
&&
!
(
oidU
=
strWtoU
(
oid
)))
goto
exit
;
if
(
data
&&
!
(
dataU
=
bervalWtoU
(
data
)))
goto
exit
;
...
...
@@ -106,13 +106,13 @@ exit:
ULONG
CDECL
ldap_extended_operation_sA
(
LDAP
*
ld
,
char
*
oid
,
struct
berval
*
data
,
LDAPControlA
**
serverctrls
,
LDAPControlA
**
clientctrls
,
char
**
retoid
,
struct
berval
**
retdata
)
{
ULONG
ret
=
LDAP_NO_MEMORY
;
ULONG
ret
=
WLDAP32_
LDAP_NO_MEMORY
;
WCHAR
*
oidW
=
NULL
,
*
retoidW
=
NULL
;
LDAPControlW
**
serverctrlsW
=
NULL
,
**
clientctrlsW
=
NULL
;
TRACE
(
"(%p, %s, %p, %p, %p, %p, %p)
\n
"
,
ld
,
debugstr_a
(
oid
),
data
,
serverctrls
,
clientctrls
,
retoid
,
retdata
);
if
(
!
ld
)
return
LDAP_PARAM_ERROR
;
if
(
!
ld
)
return
WLDAP32_
LDAP_PARAM_ERROR
;
if
(
oid
&&
!
(
oidW
=
strAtoW
(
oid
)))
goto
exit
;
if
(
serverctrls
&&
!
(
serverctrlsW
=
controlarrayAtoW
(
serverctrls
)))
goto
exit
;
...
...
@@ -123,7 +123,7 @@ ULONG CDECL ldap_extended_operation_sA( LDAP *ld, char *oid, struct berval *data
{
char
*
str
=
strWtoA
(
retoidW
);
if
(
str
)
*
retoid
=
str
;
else
ret
=
LDAP_NO_MEMORY
;
else
ret
=
WLDAP32_
LDAP_NO_MEMORY
;
ldap_memfreeW
(
retoidW
);
}
...
...
@@ -140,14 +140,14 @@ exit:
ULONG
CDECL
ldap_extended_operation_sW
(
LDAP
*
ld
,
WCHAR
*
oid
,
struct
berval
*
data
,
LDAPControlW
**
serverctrls
,
LDAPControlW
**
clientctrls
,
WCHAR
**
retoid
,
struct
berval
**
retdata
)
{
ULONG
ret
=
LDAP_NO_MEMORY
;
ULONG
ret
=
WLDAP32_
LDAP_NO_MEMORY
;
char
*
oidU
=
NULL
,
*
retoidU
=
NULL
;
LDAPControlU
**
serverctrlsU
=
NULL
,
**
clientctrlsU
=
NULL
;
struct
bervalU
*
retdataU
,
*
dataU
=
NULL
;
TRACE
(
"(%p, %s, %p, %p, %p, %p, %p)
\n
"
,
ld
,
debugstr_w
(
oid
),
data
,
serverctrls
,
clientctrls
,
retoid
,
retdata
);
if
(
!
ld
)
return
LDAP_PARAM_ERROR
;
if
(
!
ld
)
return
WLDAP32_
LDAP_PARAM_ERROR
;
if
(
oid
&&
!
(
oidU
=
strWtoU
(
oid
)))
goto
exit
;
if
(
data
&&
!
(
dataU
=
bervalWtoU
(
data
)))
goto
exit
;
...
...
@@ -163,14 +163,14 @@ ULONG CDECL ldap_extended_operation_sW( LDAP *ld, WCHAR *oid, struct berval *dat
{
WCHAR
*
str
=
strUtoW
(
retoidU
);
if
(
str
)
*
retoid
=
str
;
else
ret
=
LDAP_NO_MEMORY
;
else
ret
=
WLDAP32_
LDAP_NO_MEMORY
;
LDAP_CALL
(
ldap_memfree
,
retoidU
);
}
if
(
retdata
&&
retdataU
)
{
struct
berval
*
bv
=
bervalUtoW
(
retdataU
);
if
(
bv
)
*
retdata
=
bv
;
else
ret
=
LDAP_NO_MEMORY
;
else
ret
=
WLDAP32_
LDAP_NO_MEMORY
;
LDAP_CALL
(
ber_bvfree
,
retdataU
);
}
...
...
dlls/wldap32/init.c
View file @
17021e53
...
...
@@ -190,19 +190,18 @@ static char *urlify_hostnames( const char *scheme, char *hostnames, ULONG port )
return
url
;
}
static
LDAP
*
create_context
(
const
char
*
url
)
{
LDAP
*
ld
;
int
version
=
LDAP_VERSION3
;
int
version
=
WLDAP32_
LDAP_VERSION3
;
struct
ldap_initialize_params
params
;
if
(
!
(
ld
=
calloc
(
1
,
sizeof
(
*
ld
))))
return
NULL
;
params
.
ld
=
&
CTX
(
ld
);
params
.
url
=
url
;
if
(
map_error
(
LDAP_CALL
(
ldap_initialize
,
&
params
))
==
LDAP_SUCCESS
)
if
(
map_error
(
LDAP_CALL
(
ldap_initialize
,
&
params
))
==
WLDAP32_
LDAP_SUCCESS
)
{
struct
ldap_set_option_params
opt_params
=
{
CTX
(
ld
),
LDAP_OPT_PROTOCOL_VERSION
,
&
version
};
struct
ldap_set_option_params
opt_params
=
{
CTX
(
ld
),
WLDAP32_
LDAP_OPT_PROTOCOL_VERSION
,
&
version
};
LDAP_CALL
(
ldap_set_option
,
&
opt_params
);
return
ld
;
}
...
...
@@ -256,8 +255,8 @@ ULONG CDECL WLDAP32_ldap_connect( LDAP *ld, struct l_timeval *timeout )
{
TRACE
(
"(%p, %p)
\n
"
,
ld
,
timeout
);
if
(
!
ld
)
return
LDAP_PARAM_ERROR
;
return
LDAP_SUCCESS
;
/* FIXME: do something, e.g. ping the host */
if
(
!
ld
)
return
WLDAP32_
LDAP_PARAM_ERROR
;
return
WLDAP32_
LDAP_SUCCESS
;
/* FIXME: do something, e.g. ping the host */
}
/***********************************************************************
...
...
@@ -388,7 +387,7 @@ exit:
ULONG
CDECL
ldap_start_tls_sA
(
LDAP
*
ld
,
ULONG
*
retval
,
LDAPMessage
**
result
,
LDAPControlA
**
serverctrls
,
LDAPControlA
**
clientctrls
)
{
ULONG
ret
=
LDAP_NO_MEMORY
;
ULONG
ret
=
WLDAP32_
LDAP_NO_MEMORY
;
LDAPControlW
**
serverctrlsW
=
NULL
,
**
clientctrlsW
=
NULL
;
TRACE
(
"(%p, %p, %p, %p, %p)
\n
"
,
ld
,
retval
,
result
,
serverctrls
,
clientctrls
);
...
...
@@ -412,7 +411,7 @@ exit:
ULONG
CDECL
ldap_start_tls_sW
(
LDAP
*
ld
,
ULONG
*
retval
,
LDAPMessage
**
result
,
LDAPControlW
**
serverctrls
,
LDAPControlW
**
clientctrls
)
{
ULONG
ret
=
LDAP_NO_MEMORY
;
ULONG
ret
=
WLDAP32_
LDAP_NO_MEMORY
;
LDAPControlU
**
serverctrlsU
=
NULL
,
**
clientctrlsU
=
NULL
;
TRACE
(
"(%p, %p, %p, %p, %p)
\n
"
,
ld
,
retval
,
result
,
serverctrls
,
clientctrls
);
...
...
@@ -444,7 +443,7 @@ exit:
ULONG
CDECL
ldap_startup
(
LDAP_VERSION_INFO
*
version
,
HANDLE
*
instance
)
{
TRACE
(
"(%p, %p)
\n
"
,
version
,
instance
);
return
LDAP_SUCCESS
;
return
WLDAP32_
LDAP_SUCCESS
;
}
/***********************************************************************
...
...
dlls/wldap32/misc.c
View file @
17021e53
...
...
@@ -55,8 +55,8 @@ ULONG CDECL ldap_check_filterA( LDAP *ld, char *filter )
TRACE
(
"(%p, %s)
\n
"
,
ld
,
debugstr_a
(
filter
)
);
if
(
!
ld
)
return
LDAP_PARAM_ERROR
;
if
(
filter
&&
!
(
filterW
=
strAtoW
(
filter
)))
return
LDAP_NO_MEMORY
;
if
(
!
ld
)
return
WLDAP32_
LDAP_PARAM_ERROR
;
if
(
filter
&&
!
(
filterW
=
strAtoW
(
filter
)))
return
WLDAP32_
LDAP_NO_MEMORY
;
ret
=
ldap_check_filterW
(
ld
,
filterW
);
...
...
@@ -71,8 +71,8 @@ ULONG CDECL ldap_check_filterW( LDAP *ld, WCHAR *filter )
{
TRACE
(
"(%p, %s)
\n
"
,
ld
,
debugstr_w
(
filter
)
);
if
(
!
ld
)
return
LDAP_PARAM_ERROR
;
return
LDAP_SUCCESS
;
/* FIXME: do some checks */
if
(
!
ld
)
return
WLDAP32_
LDAP_PARAM_ERROR
;
return
WLDAP32_
LDAP_SUCCESS
;
/* FIXME: do some checks */
}
/***********************************************************************
...
...
@@ -81,7 +81,7 @@ ULONG CDECL ldap_check_filterW( LDAP *ld, WCHAR *filter )
ULONG
CDECL
ldap_cleanup
(
HANDLE
instance
)
{
TRACE
(
"(%p)
\n
"
,
instance
);
return
LDAP_SUCCESS
;
return
WLDAP32_
LDAP_SUCCESS
;
}
/***********************************************************************
...
...
@@ -172,10 +172,10 @@ ULONG CDECL ldap_escape_filter_elementA( char *src, ULONG srclen, char *dst, ULO
TRACE
(
"(%p, %#lx, %p, %#lx)
\n
"
,
src
,
srclen
,
dst
,
dstlen
);
if
(
!
dst
)
return
len
;
if
(
!
src
||
dstlen
<
len
)
return
LDAP_PARAM_ERROR
;
if
(
!
src
||
dstlen
<
len
)
return
WLDAP32_
LDAP_PARAM_ERROR
;
escape_filter_element
(
src
,
srclen
,
dst
);
return
LDAP_SUCCESS
;
return
WLDAP32_
LDAP_SUCCESS
;
}
/***********************************************************************
...
...
@@ -190,7 +190,7 @@ ULONG CDECL ldap_escape_filter_elementW( char *src, ULONG srclen, WCHAR *dst, UL
if
(
!
dst
)
return
len
;
/* no matter what you throw at it, this is what native returns */
return
LDAP_PARAM_ERROR
;
return
WLDAP32_
LDAP_PARAM_ERROR
;
}
/***********************************************************************
...
...
@@ -314,7 +314,7 @@ ULONG CDECL WLDAP32_ldap_msgfree( LDAPMessage *res )
TRACE
(
"(%p)
\n
"
,
res
);
if
(
!
res
)
return
LDAP_SUCCESS
;
if
(
!
res
)
return
WLDAP32_
LDAP_SUCCESS
;
LDAP_CALL
(
ldap_msgfree
,
MSG
(
res
)
);
while
(
list
)
...
...
@@ -324,7 +324,7 @@ ULONG CDECL WLDAP32_ldap_msgfree( LDAPMessage *res )
free
(
entry
);
}
return
LDAP_SUCCESS
;
return
WLDAP32_
LDAP_SUCCESS
;
}
/***********************************************************************
...
...
dlls/wldap32/modify.c
View file @
17021e53
...
...
@@ -34,7 +34,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(wldap32);
*/
ULONG
CDECL
ldap_modifyA
(
LDAP
*
ld
,
char
*
dn
,
LDAPModA
**
mods
)
{
ULONG
ret
=
LDAP_NO_MEMORY
;
ULONG
ret
=
WLDAP32_
LDAP_NO_MEMORY
;
WCHAR
*
dnW
=
NULL
;
LDAPModW
**
modsW
=
NULL
;
...
...
@@ -63,7 +63,7 @@ ULONG CDECL ldap_modifyW( LDAP *ld, WCHAR *dn, LDAPModW **mods )
TRACE
(
"(%p, %s, %p)
\n
"
,
ld
,
debugstr_w
(
dn
),
mods
);
ret
=
ldap_modify_extW
(
ld
,
dn
,
mods
,
NULL
,
NULL
,
&
msg
);
if
(
ret
==
LDAP_SUCCESS
)
return
msg
;
if
(
ret
==
WLDAP32_
LDAP_SUCCESS
)
return
msg
;
return
~
0u
;
}
...
...
@@ -73,7 +73,7 @@ ULONG CDECL ldap_modifyW( LDAP *ld, WCHAR *dn, LDAPModW **mods )
ULONG
CDECL
ldap_modify_extA
(
LDAP
*
ld
,
char
*
dn
,
LDAPModA
**
mods
,
LDAPControlA
**
serverctrls
,
LDAPControlA
**
clientctrls
,
ULONG
*
message
)
{
ULONG
ret
=
LDAP_NO_MEMORY
;
ULONG
ret
=
WLDAP32_
LDAP_NO_MEMORY
;
WCHAR
*
dnW
=
NULL
;
LDAPModW
**
modsW
=
NULL
;
LDAPControlW
**
serverctrlsW
=
NULL
,
**
clientctrlsW
=
NULL
;
...
...
@@ -103,7 +103,7 @@ exit:
ULONG
CDECL
ldap_modify_extW
(
LDAP
*
ld
,
WCHAR
*
dn
,
LDAPModW
**
mods
,
LDAPControlW
**
serverctrls
,
LDAPControlW
**
clientctrls
,
ULONG
*
message
)
{
ULONG
ret
=
LDAP_NO_MEMORY
;
ULONG
ret
=
WLDAP32_
LDAP_NO_MEMORY
;
char
*
dnU
=
NULL
;
LDAPModU
**
modsU
=
NULL
;
LDAPControlU
**
serverctrlsU
=
NULL
,
**
clientctrlsU
=
NULL
;
...
...
@@ -136,14 +136,14 @@ exit:
ULONG
CDECL
ldap_modify_ext_sA
(
LDAP
*
ld
,
char
*
dn
,
LDAPModA
**
mods
,
LDAPControlA
**
serverctrls
,
LDAPControlA
**
clientctrls
)
{
ULONG
ret
=
LDAP_NO_MEMORY
;
ULONG
ret
=
WLDAP32_
LDAP_NO_MEMORY
;
WCHAR
*
dnW
=
NULL
;
LDAPModW
**
modsW
=
NULL
;
LDAPControlW
**
serverctrlsW
=
NULL
,
**
clientctrlsW
=
NULL
;
TRACE
(
"(%p, %s, %p, %p, %p)
\n
"
,
ld
,
debugstr_a
(
dn
),
mods
,
serverctrls
,
clientctrls
);
if
(
!
ld
)
return
LDAP_PARAM_ERROR
;
if
(
!
ld
)
return
WLDAP32_
LDAP_PARAM_ERROR
;
if
(
dn
&&
!
(
dnW
=
strAtoW
(
dn
)))
goto
exit
;
if
(
mods
&&
!
(
modsW
=
modarrayAtoW
(
mods
)))
goto
exit
;
...
...
@@ -166,14 +166,14 @@ exit:
ULONG
CDECL
ldap_modify_ext_sW
(
LDAP
*
ld
,
WCHAR
*
dn
,
LDAPModW
**
mods
,
LDAPControlW
**
serverctrls
,
LDAPControlW
**
clientctrls
)
{
ULONG
ret
=
LDAP_NO_MEMORY
;
ULONG
ret
=
WLDAP32_
LDAP_NO_MEMORY
;
char
*
dnU
=
NULL
;
LDAPModU
**
modsU
=
NULL
;
LDAPControlU
**
serverctrlsU
=
NULL
,
**
clientctrlsU
=
NULL
;
TRACE
(
"(%p, %s, %p, %p, %p)
\n
"
,
ld
,
debugstr_w
(
dn
),
mods
,
serverctrls
,
clientctrls
);
if
(
!
ld
)
return
LDAP_PARAM_ERROR
;
if
(
!
ld
)
return
WLDAP32_
LDAP_PARAM_ERROR
;
if
(
dn
&&
!
(
dnU
=
strWtoU
(
dn
)))
goto
exit
;
if
(
mods
&&
!
(
modsU
=
modarrayWtoU
(
mods
)))
goto
exit
;
...
...
@@ -198,13 +198,13 @@ exit:
*/
ULONG
CDECL
ldap_modify_sA
(
LDAP
*
ld
,
char
*
dn
,
LDAPModA
**
mods
)
{
ULONG
ret
=
LDAP_NO_MEMORY
;
ULONG
ret
=
WLDAP32_
LDAP_NO_MEMORY
;
WCHAR
*
dnW
=
NULL
;
LDAPModW
**
modsW
=
NULL
;
TRACE
(
"(%p, %s, %p)
\n
"
,
ld
,
debugstr_a
(
dn
),
mods
);
if
(
!
ld
)
return
LDAP_PARAM_ERROR
;
if
(
!
ld
)
return
WLDAP32_
LDAP_PARAM_ERROR
;
if
(
dn
&&
!
(
dnW
=
strAtoW
(
dn
)))
goto
exit
;
if
(
mods
&&
!
(
modsW
=
modarrayAtoW
(
mods
)))
goto
exit
;
...
...
dlls/wldap32/modrdn.c
View file @
17021e53
...
...
@@ -34,7 +34,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(wldap32);
*/
ULONG
CDECL
ldap_modrdnA
(
LDAP
*
ld
,
char
*
dn
,
char
*
newdn
)
{
ULONG
ret
=
LDAP_NO_MEMORY
;
ULONG
ret
=
WLDAP32_
LDAP_NO_MEMORY
;
WCHAR
*
dnW
=
NULL
,
*
newdnW
=
NULL
;
TRACE
(
"(%p, %s, %s)
\n
"
,
ld
,
debugstr_a
(
dn
),
debugstr_a
(
newdn
)
);
...
...
@@ -66,7 +66,7 @@ ULONG CDECL ldap_modrdnW( LDAP *ld, WCHAR *dn, WCHAR *newdn )
*/
ULONG
CDECL
ldap_modrdn2A
(
LDAP
*
ld
,
char
*
dn
,
char
*
newdn
,
int
delete
)
{
ULONG
ret
=
LDAP_NO_MEMORY
;
ULONG
ret
=
WLDAP32_
LDAP_NO_MEMORY
;
WCHAR
*
dnW
=
NULL
,
*
newdnW
=
NULL
;
TRACE
(
"(%p, %s, %p, 0x%02x)
\n
"
,
ld
,
debugstr_a
(
dn
),
newdn
,
delete
);
...
...
@@ -89,7 +89,7 @@ exit:
*/
ULONG
CDECL
ldap_modrdn2W
(
LDAP
*
ld
,
WCHAR
*
dn
,
WCHAR
*
newdn
,
int
delete
)
{
ULONG
ret
=
LDAP_NO_MEMORY
;
ULONG
ret
=
WLDAP32_
LDAP_NO_MEMORY
;
char
*
dnU
=
NULL
,
*
newdnU
=
NULL
;
ULONG
msg
;
...
...
@@ -97,13 +97,13 @@ ULONG CDECL ldap_modrdn2W( LDAP *ld, WCHAR *dn, WCHAR *newdn, int delete )
if
(
!
ld
||
!
newdn
)
return
~
0u
;
if
(
dn
&&
!
(
dnU
=
strWtoU
(
dn
)))
return
LDAP_NO_MEMORY
;
if
(
dn
&&
!
(
dnU
=
strWtoU
(
dn
)))
return
WLDAP32_
LDAP_NO_MEMORY
;
if
((
newdnU
=
strWtoU
(
newdn
)))
{
struct
ldap_rename_params
params
=
{
CTX
(
ld
),
dnU
,
newdnU
,
NULL
,
delete
,
NULL
,
NULL
,
&
msg
};
ret
=
LDAP_CALL
(
ldap_rename
,
&
params
);
if
(
ret
==
LDAP_SUCCESS
)
if
(
ret
==
WLDAP32_
LDAP_SUCCESS
)
ret
=
msg
;
else
ret
=
~
0u
;
...
...
@@ -118,12 +118,12 @@ ULONG CDECL ldap_modrdn2W( LDAP *ld, WCHAR *dn, WCHAR *newdn, int delete )
*/
ULONG
CDECL
ldap_modrdn2_sA
(
LDAP
*
ld
,
char
*
dn
,
char
*
newdn
,
int
delete
)
{
ULONG
ret
=
LDAP_NO_MEMORY
;
ULONG
ret
=
WLDAP32_
LDAP_NO_MEMORY
;
WCHAR
*
dnW
=
NULL
,
*
newdnW
=
NULL
;
TRACE
(
"(%p, %s, %p, 0x%02x)
\n
"
,
ld
,
debugstr_a
(
dn
),
newdn
,
delete
);
if
(
!
ld
||
!
newdn
)
return
LDAP_PARAM_ERROR
;
if
(
!
ld
||
!
newdn
)
return
WLDAP32_
LDAP_PARAM_ERROR
;
if
(
dn
&&
!
(
dnW
=
strAtoW
(
dn
)))
goto
exit
;
if
(
!
(
newdnW
=
strAtoW
(
newdn
)))
goto
exit
;
...
...
@@ -141,14 +141,14 @@ exit:
*/
ULONG
CDECL
ldap_modrdn2_sW
(
LDAP
*
ld
,
WCHAR
*
dn
,
WCHAR
*
newdn
,
int
delete
)
{
ULONG
ret
=
LDAP_NO_MEMORY
;
ULONG
ret
=
WLDAP32_
LDAP_NO_MEMORY
;
char
*
dnU
=
NULL
,
*
newdnU
=
NULL
;
TRACE
(
"(%p, %s, %p, 0x%02x)
\n
"
,
ld
,
debugstr_w
(
dn
),
newdn
,
delete
);
if
(
!
ld
||
!
newdn
)
return
LDAP_PARAM_ERROR
;
if
(
!
ld
||
!
newdn
)
return
WLDAP32_
LDAP_PARAM_ERROR
;
if
(
dn
&&
!
(
dnU
=
strWtoU
(
dn
)))
return
LDAP_NO_MEMORY
;
if
(
dn
&&
!
(
dnU
=
strWtoU
(
dn
)))
return
WLDAP32_
LDAP_NO_MEMORY
;
if
((
newdnU
=
strWtoU
(
newdn
)))
{
...
...
@@ -165,12 +165,12 @@ ULONG CDECL ldap_modrdn2_sW( LDAP *ld, WCHAR *dn, WCHAR *newdn, int delete )
*/
ULONG
CDECL
ldap_modrdn_sA
(
LDAP
*
ld
,
char
*
dn
,
char
*
newdn
)
{
ULONG
ret
=
LDAP_NO_MEMORY
;
ULONG
ret
=
WLDAP32_
LDAP_NO_MEMORY
;
WCHAR
*
dnW
=
NULL
,
*
newdnW
=
NULL
;
TRACE
(
"(%p, %s, %p)
\n
"
,
ld
,
debugstr_a
(
dn
),
newdn
);
if
(
!
ld
||
!
newdn
)
return
LDAP_PARAM_ERROR
;
if
(
!
ld
||
!
newdn
)
return
WLDAP32_
LDAP_PARAM_ERROR
;
if
(
dn
&&
!
(
dnW
=
strAtoW
(
dn
)))
goto
exit
;
if
(
!
(
newdnW
=
strAtoW
(
newdn
)))
goto
exit
;
...
...
dlls/wldap32/option.c
View file @
17021e53
This diff is collapsed.
Click to expand it.
dlls/wldap32/page.c
View file @
17021e53
...
...
@@ -45,10 +45,10 @@ ULONG CDECL ldap_create_page_controlA( LDAP *ld, ULONG pagesize, struct berval *
TRACE
(
"(%p, %#lx, %p, 0x%02x, %p)
\n
"
,
ld
,
pagesize
,
cookie
,
critical
,
control
);
if
(
!
ld
||
!
control
||
pagesize
>
INT_MAX
)
return
LDAP_PARAM_ERROR
;
if
(
!
ld
||
!
control
||
pagesize
>
INT_MAX
)
return
WLDAP32_
LDAP_PARAM_ERROR
;
ret
=
ldap_create_page_controlW
(
ld
,
pagesize
,
cookie
,
critical
,
&
controlW
);
if
(
ret
==
LDAP_SUCCESS
)
if
(
ret
==
WLDAP32_
LDAP_SUCCESS
)
{
*
control
=
controlWtoA
(
controlW
);
ldap_control_freeW
(
controlW
);
...
...
@@ -65,7 +65,7 @@ static ULONG create_page_control( ULONG pagesize, struct berval *cookie, UCHAR c
int
ret
,
len
;
char
*
val
;
if
(
!
(
ber
=
WLDAP32_ber_alloc_t
(
LBER_USE_DER
)))
return
LDAP_NO_MEMORY
;
if
(
!
(
ber
=
WLDAP32_ber_alloc_t
(
LBER_USE_DER
)))
return
WLDAP32_
LDAP_NO_MEMORY
;
vec
[
1
]
=
NULL
;
if
(
cookie
)
...
...
@@ -77,11 +77,11 @@ static ULONG create_page_control( ULONG pagesize, struct berval *cookie, UCHAR c
ret
=
WLDAP32_ber_flatten
(
ber
,
&
berval
);
WLDAP32_ber_free
(
ber
,
1
);
if
(
len
==
LBER_ERROR
)
return
LDAP_ENCODING_ERROR
;
if
(
ret
==
-
1
)
return
LDAP_NO_MEMORY
;
if
(
len
==
WLDAP32_LBER_ERROR
)
return
WLDAP32_
LDAP_ENCODING_ERROR
;
if
(
ret
==
-
1
)
return
WLDAP32_
LDAP_NO_MEMORY
;
/* copy the berval so it can be properly freed by the caller */
if
(
!
(
val
=
malloc
(
berval
->
bv_len
)))
return
LDAP_NO_MEMORY
;
if
(
!
(
val
=
malloc
(
berval
->
bv_len
)))
return
WLDAP32_
LDAP_NO_MEMORY
;
len
=
berval
->
bv_len
;
memcpy
(
val
,
berval
->
bv_val
,
len
);
...
...
@@ -90,20 +90,20 @@ static ULONG create_page_control( ULONG pagesize, struct berval *cookie, UCHAR c
if
(
!
(
ctrl
=
malloc
(
sizeof
(
*
ctrl
)
)))
{
free
(
val
);
return
LDAP_NO_MEMORY
;
return
WLDAP32_
LDAP_NO_MEMORY
;
}
if
(
!
(
ctrl
->
ldctl_oid
=
strAtoW
(
LDAP_PAGED_RESULT_OID_STRING
)))
{
free
(
val
);
free
(
ctrl
);
return
LDAP_NO_MEMORY
;
return
WLDAP32_
LDAP_NO_MEMORY
;
}
ctrl
->
ldctl_value
.
bv_len
=
len
;
ctrl
->
ldctl_value
.
bv_val
=
val
;
ctrl
->
ldctl_iscritical
=
critical
;
*
control
=
ctrl
;
return
LDAP_SUCCESS
;
return
WLDAP32_
LDAP_SUCCESS
;
}
/***********************************************************************
...
...
@@ -114,7 +114,7 @@ ULONG CDECL ldap_create_page_controlW( LDAP *ld, ULONG pagesize, struct berval *
{
TRACE
(
"(%p, %#lx, %p, 0x%02x, %p)
\n
"
,
ld
,
pagesize
,
cookie
,
critical
,
control
);
if
(
!
ld
||
!
control
||
pagesize
>
INT_MAX
)
return
LDAP_PARAM_ERROR
;
if
(
!
ld
||
!
control
||
pagesize
>
INT_MAX
)
return
WLDAP32_
LDAP_PARAM_ERROR
;
return
create_page_control
(
pagesize
,
cookie
,
critical
,
control
);
}
...
...
@@ -123,7 +123,7 @@ ULONG CDECL ldap_get_next_page( LDAP *ld, LDAPSearch *search, ULONG pagesize, UL
FIXME
(
"(%p, %p, %#lx, %p)
\n
"
,
ld
,
search
,
pagesize
,
message
);
if
(
!
ld
)
return
~
0u
;
return
LDAP_NOT_SUPPORTED
;
return
WLDAP32_
LDAP_NOT_SUPPORTED
;
}
ULONG
CDECL
ldap_get_next_page_s
(
LDAP
*
ld
,
LDAPSearch
*
search
,
struct
l_timeval
*
timeout
,
ULONG
pagesize
,
...
...
@@ -140,7 +140,7 @@ ULONG CDECL ldap_get_next_page_s( LDAP *ld, LDAPSearch *search, struct l_timeval
/* end of paged results */
*
count
=
0
;
*
results
=
NULL
;
return
LDAP_NO_RESULTS_RETURNED
;
return
WLDAP32_
LDAP_NO_RESULTS_RETURNED
;
}
if
(
search
->
serverctrls
[
0
])
...
...
@@ -151,12 +151,12 @@ ULONG CDECL ldap_get_next_page_s( LDAP *ld, LDAPSearch *search, struct l_timeval
TRACE
(
"search->cookie: %s
\n
"
,
search
->
cookie
?
debugstr_an
(
search
->
cookie
->
bv_val
,
search
->
cookie
->
bv_len
)
:
"NULL"
);
ret
=
ldap_create_page_controlW
(
ld
,
pagesize
,
search
->
cookie
,
1
,
&
search
->
serverctrls
[
0
]
);
if
(
ret
!=
LDAP_SUCCESS
)
return
ret
;
if
(
ret
!=
WLDAP32_
LDAP_SUCCESS
)
return
ret
;
ret
=
ldap_search_ext_sW
(
ld
,
search
->
dn
,
search
->
scope
,
search
->
filter
,
search
->
attrs
,
search
->
attrsonly
,
search
->
serverctrls
,
search
->
clientctrls
,
search
->
timeout
.
tv_sec
?
&
search
->
timeout
:
NULL
,
search
->
sizelimit
,
results
);
if
(
ret
!=
LDAP_SUCCESS
)
return
ret
;
if
(
ret
!=
WLDAP32_
LDAP_SUCCESS
)
return
ret
;
return
ldap_get_paged_count
(
ld
,
search
,
count
,
*
results
);
}
...
...
@@ -168,24 +168,24 @@ ULONG CDECL ldap_get_paged_count( LDAP *ld, LDAPSearch *search, ULONG *count, LD
TRACE
(
"(%p, %p, %p, %p)
\n
"
,
ld
,
search
,
count
,
results
);
if
(
!
ld
||
!
count
||
!
results
)
return
LDAP_PARAM_ERROR
;
if
(
!
ld
||
!
count
||
!
results
)
return
WLDAP32_
LDAP_PARAM_ERROR
;
*
count
=
0
;
ret
=
ldap_parse_resultW
(
ld
,
results
,
NULL
,
NULL
,
NULL
,
NULL
,
&
server_ctrls
,
0
);
if
(
ret
!=
LDAP_SUCCESS
)
return
ret
;
if
(
ret
!=
WLDAP32_
LDAP_SUCCESS
)
return
ret
;
if
(
!
server_ctrls
)
/* assume end of paged results */
{
search
->
cookie
=
&
null_cookieW
;
return
LDAP_SUCCESS
;
return
WLDAP32_
LDAP_SUCCESS
;
}
free
(
search
->
cookie
);
search
->
cookie
=
NULL
;
ret
=
ldap_parse_page_controlW
(
ld
,
server_ctrls
,
count
,
&
search
->
cookie
);
if
(
ret
==
LDAP_SUCCESS
)
if
(
ret
==
WLDAP32_
LDAP_SUCCESS
)
TRACE
(
"new search->cookie: %s, count %lu
\n
"
,
debugstr_an
(
search
->
cookie
->
bv_val
,
search
->
cookie
->
bv_len
),
*
count
);
...
...
@@ -203,9 +203,9 @@ ULONG CDECL ldap_parse_page_controlA( LDAP *ld, LDAPControlA **ctrls, ULONG *cou
TRACE
(
"(%p, %p, %p, %p)
\n
"
,
ld
,
ctrls
,
count
,
cookie
);
if
(
!
ld
||
!
ctrls
||
!
count
||
!
cookie
)
return
LDAP_PARAM_ERROR
;
if
(
!
ld
||
!
ctrls
||
!
count
||
!
cookie
)
return
WLDAP32_
LDAP_PARAM_ERROR
;
if
(
!
(
ctrlsW
=
controlarrayAtoW
(
ctrls
)))
return
LDAP_NO_MEMORY
;
if
(
!
(
ctrlsW
=
controlarrayAtoW
(
ctrls
)))
return
WLDAP32_
LDAP_NO_MEMORY
;
ret
=
ldap_parse_page_controlW
(
ld
,
ctrlsW
,
count
,
cookie
);
controlarrayfreeW
(
ctrlsW
);
return
ret
;
...
...
@@ -225,24 +225,24 @@ ULONG CDECL ldap_parse_page_controlW( LDAP *ld, LDAPControlW **ctrls, ULONG *ret
TRACE
(
"(%p, %p, %p, %p)
\n
"
,
ld
,
ctrls
,
ret_count
,
ret_cookie
);
if
(
!
ld
||
!
ctrls
||
!
ret_count
||
!
ret_cookie
)
return
LDAP_PARAM_ERROR
;
if
(
!
ld
||
!
ctrls
||
!
ret_count
||
!
ret_cookie
)
return
WLDAP32_
LDAP_PARAM_ERROR
;
for
(
i
=
0
;
ctrls
[
i
];
i
++
)
{
if
(
!
wcscmp
(
LDAP_PAGED_RESULT_OID_STRING_W
,
ctrls
[
i
]
->
ldctl_oid
))
control
=
ctrls
[
i
];
}
if
(
!
control
)
return
LDAP_CONTROL_NOT_FOUND
;
if
(
!
control
)
return
WLDAP32_
LDAP_CONTROL_NOT_FOUND
;
if
(
!
(
ber
=
WLDAP32_ber_init
(
&
control
->
ldctl_value
)))
return
LDAP_NO_MEMORY
;
if
(
!
(
ber
=
WLDAP32_ber_init
(
&
control
->
ldctl_value
)))
return
WLDAP32_
LDAP_NO_MEMORY
;
tag
=
WLDAP32_ber_scanf
(
ber
,
(
char
*
)
"{iO}"
,
&
count
,
&
cookie
);
if
(
tag
==
LBER_ERROR
)
ret
=
LDAP_DECODING_ERROR
;
if
(
tag
==
WLDAP32_LBER_ERROR
)
ret
=
WLDAP32_
LDAP_DECODING_ERROR
;
else
{
*
ret_count
=
count
;
*
ret_cookie
=
cookie
;
ret
=
LDAP_SUCCESS
;
ret
=
WLDAP32_
LDAP_SUCCESS
;
}
WLDAP32_ber_free
(
ber
,
1
);
...
...
@@ -269,7 +269,7 @@ ULONG CDECL ldap_search_abandon_page( LDAP *ld, LDAPSearch *search )
if
(
search
->
cookie
&&
search
->
cookie
!=
&
null_cookieW
)
free
(
search
->
cookie
);
free
(
search
);
return
LDAP_SUCCESS
;
return
WLDAP32_
LDAP_SUCCESS
;
}
LDAPSearch
*
CDECL
ldap_search_init_pageA
(
LDAP
*
ld
,
char
*
dn
,
ULONG
scope
,
char
*
filter
,
char
**
attrs
,
...
...
@@ -293,7 +293,7 @@ LDAPSearch * CDECL ldap_search_init_pageW( LDAP *ld, WCHAR *dn, ULONG scope, WCH
if
(
!
(
search
=
calloc
(
1
,
sizeof
(
*
search
)
)))
{
ld
->
ld_errno
=
LDAP_NO_MEMORY
;
ld
->
ld_errno
=
WLDAP32_
LDAP_NO_MEMORY
;
return
NULL
;
}
...
...
@@ -330,6 +330,6 @@ LDAPSearch * CDECL ldap_search_init_pageW( LDAP *ld, WCHAR *dn, ULONG scope, WCH
fail:
ldap_search_abandon_page
(
ld
,
search
);
ld
->
ld_errno
=
LDAP_NO_MEMORY
;
ld
->
ld_errno
=
WLDAP32_
LDAP_NO_MEMORY
;
return
NULL
;
}
dlls/wldap32/parse.c
View file @
17021e53
...
...
@@ -40,15 +40,15 @@ ULONG CDECL ldap_parse_extended_resultA( LDAP *ld, LDAPMessage *result, char **o
TRACE
(
"(%p, %p, %p, %p, 0x%02x)
\n
"
,
ld
,
result
,
oid
,
data
,
free
);
if
(
!
ld
)
return
LDAP_PARAM_ERROR
;
if
(
!
result
)
return
LDAP_NO_RESULTS_RETURNED
;
if
(
!
ld
)
return
WLDAP32_
LDAP_PARAM_ERROR
;
if
(
!
result
)
return
WLDAP32_
LDAP_NO_RESULTS_RETURNED
;
ret
=
ldap_parse_extended_resultW
(
ld
,
result
,
&
oidW
,
data
,
free
);
if
(
oid
&&
oidW
)
{
char
*
str
;
if
((
str
=
strWtoA
(
oidW
)))
*
oid
=
str
;
else
ret
=
LDAP_NO_MEMORY
;
else
ret
=
WLDAP32_
LDAP_NO_MEMORY
;
ldap_memfreeW
(
oidW
);
}
return
ret
;
...
...
@@ -66,8 +66,8 @@ ULONG CDECL ldap_parse_extended_resultW( LDAP *ld, LDAPMessage *result, WCHAR **
TRACE
(
"(%p, %p, %p, %p, 0x%02x)
\n
"
,
ld
,
result
,
oid
,
data
,
free
);
if
(
!
ld
)
return
LDAP_PARAM_ERROR
;
if
(
!
result
)
return
LDAP_NO_RESULTS_RETURNED
;
if
(
!
ld
)
return
WLDAP32_
LDAP_PARAM_ERROR
;
if
(
!
result
)
return
WLDAP32_
LDAP_NO_RESULTS_RETURNED
;
else
{
struct
ldap_parse_extended_result_params
params
=
{
CTX
(
ld
),
result
,
&
oidU
,
&
dataU
,
free
};
...
...
@@ -77,14 +77,14 @@ ULONG CDECL ldap_parse_extended_resultW( LDAP *ld, LDAPMessage *result, WCHAR **
{
WCHAR
*
str
;
if
((
str
=
strUtoW
(
oidU
)))
*
oid
=
str
;
else
ret
=
LDAP_NO_MEMORY
;
else
ret
=
WLDAP32_
LDAP_NO_MEMORY
;
LDAP_CALL
(
ldap_memfree
,
oidU
);
}
if
(
data
&&
dataU
)
{
struct
berval
*
bv
;
if
((
bv
=
bervalUtoW
(
dataU
)))
*
data
=
bv
;
else
ret
=
LDAP_NO_MEMORY
;
else
ret
=
WLDAP32_
LDAP_NO_MEMORY
;
LDAP_CALL
(
ber_bvfree
,
dataU
);
}
...
...
@@ -108,7 +108,7 @@ ULONG CDECL ldap_parse_referenceA( LDAP *ld, LDAPMessage *message, char ***refer
{
char
**
ref
;
if
((
ref
=
strarrayWtoA
(
referralsW
)))
*
referrals
=
ref
;
else
ret
=
LDAP_NO_MEMORY
;
else
ret
=
WLDAP32_
LDAP_NO_MEMORY
;
ldap_value_freeW
(
referralsW
);
}
return
ret
;
...
...
@@ -133,7 +133,7 @@ ULONG CDECL ldap_parse_referenceW( LDAP *ld, LDAPMessage *message, WCHAR ***refe
{
WCHAR
**
ref
;
if
((
ref
=
strarrayUtoW
(
referralsU
)))
*
referrals
=
ref
;
else
ret
=
LDAP_NO_MEMORY
;
else
ret
=
WLDAP32_
LDAP_NO_MEMORY
;
LDAP_CALL
(
ldap_memfree
,
referralsU
);
}
return
ret
;
...
...
@@ -152,7 +152,7 @@ ULONG CDECL ldap_parse_resultA( LDAP *ld, LDAPMessage *result, ULONG *retcode, c
TRACE
(
"(%p, %p, %p, %p, %p, %p, %p, 0x%02x)
\n
"
,
ld
,
result
,
retcode
,
matched
,
error
,
referrals
,
serverctrls
,
free
);
if
(
!
ld
)
return
LDAP_PARAM_ERROR
;
if
(
!
ld
)
return
WLDAP32_
LDAP_PARAM_ERROR
;
ret
=
ldap_parse_resultW
(
ld
,
result
,
retcode
,
&
matchedW
,
&
errorW
,
&
referralsW
,
&
serverctrlsW
,
free
);
...
...
@@ -187,7 +187,7 @@ ULONG CDECL ldap_parse_resultW( LDAP *ld, LDAPMessage *result, ULONG *retcode, W
&
errorU
,
&
referralsU
,
&
serverctrlsU
,
free
};
ret
=
map_error
(
LDAP_CALL
(
ldap_parse_result
,
&
params
));
}
else
return
LDAP_PARAM_ERROR
;
else
return
WLDAP32_
LDAP_PARAM_ERROR
;
if
(
matched
)
*
matched
=
strUtoW
(
matchedU
);
if
(
error
)
*
error
=
strUtoW
(
errorU
);
...
...
@@ -212,9 +212,9 @@ ULONG CDECL ldap_parse_sort_controlA( LDAP *ld, LDAPControlA **control, ULONG *r
TRACE
(
"(%p, %p, %p, %p)
\n
"
,
ld
,
control
,
result
,
attr
);
if
(
!
ld
)
return
LDAP_PARAM_ERROR
;
if
(
!
control
)
return
LDAP_CONTROL_NOT_FOUND
;
if
(
!
(
controlW
=
controlarrayAtoW
(
control
)))
return
LDAP_NO_MEMORY
;
if
(
!
ld
)
return
WLDAP32_
LDAP_PARAM_ERROR
;
if
(
!
control
)
return
WLDAP32_
LDAP_CONTROL_NOT_FOUND
;
if
(
!
(
controlW
=
controlarrayAtoW
(
control
)))
return
WLDAP32_
LDAP_NO_MEMORY
;
ret
=
ldap_parse_sort_controlW
(
ld
,
controlW
,
result
,
&
attrW
);
...
...
@@ -236,9 +236,9 @@ ULONG CDECL ldap_parse_sort_controlW( LDAP *ld, LDAPControlW **control, ULONG *r
TRACE
(
"(%p, %p, %p, %p)
\n
"
,
ld
,
control
,
result
,
attr
);
if
(
!
ld
)
return
LDAP_PARAM_ERROR
;
if
(
!
control
)
return
LDAP_CONTROL_NOT_FOUND
;
if
(
!
(
controlU
=
controlarrayWtoU
(
control
)))
return
LDAP_NO_MEMORY
;
if
(
!
ld
)
return
WLDAP32_
LDAP_PARAM_ERROR
;
if
(
!
control
)
return
WLDAP32_
LDAP_CONTROL_NOT_FOUND
;
if
(
!
(
controlU
=
controlarrayWtoU
(
control
)))
return
WLDAP32_
LDAP_NO_MEMORY
;
for
(
i
=
0
;
controlU
[
i
];
i
++
)
{
...
...
@@ -248,14 +248,14 @@ ULONG CDECL ldap_parse_sort_controlW( LDAP *ld, LDAPControlW **control, ULONG *r
if
(
!
sortcontrol
)
{
controlarrayfreeU
(
controlU
);
return
LDAP_CONTROL_NOT_FOUND
;
return
WLDAP32_
LDAP_CONTROL_NOT_FOUND
;
}
else
{
struct
ldap_parse_sortresponse_control_params
params
=
{
CTX
(
ld
),
sortcontrol
,
&
res
,
&
attrU
};
ret
=
map_error
(
LDAP_CALL
(
ldap_parse_sortresponse_control
,
&
params
));
}
if
(
ret
==
LDAP_SUCCESS
)
if
(
ret
==
WLDAP32_
LDAP_SUCCESS
)
{
WCHAR
*
str
;
if
((
str
=
strUtoW
(
attrU
)))
...
...
@@ -263,7 +263,7 @@ ULONG CDECL ldap_parse_sort_controlW( LDAP *ld, LDAPControlW **control, ULONG *r
*
attr
=
str
;
*
result
=
res
;
}
else
ret
=
LDAP_NO_MEMORY
;
else
ret
=
WLDAP32_
LDAP_NO_MEMORY
;
LDAP_CALL
(
ldap_memfree
,
attrU
);
}
...
...
@@ -275,7 +275,7 @@ ULONG CDECL ldap_parse_sort_controlW( LDAP *ld, LDAPControlW **control, ULONG *r
* ldap_parse_vlv_controlA (WLDAP32.@)
*/
int
CDECL
ldap_parse_vlv_controlA
(
LDAP
*
ld
,
LDAPControlA
**
control
,
ULONG
*
targetpos
,
ULONG
*
listcount
,
struct
berval
**
context
,
int
*
errcode
)
struct
berval
**
context
,
int
*
errcode
)
{
int
ret
;
LDAPControlW
**
controlW
=
NULL
;
...
...
@@ -284,7 +284,7 @@ int CDECL ldap_parse_vlv_controlA( LDAP *ld, LDAPControlA **control, ULONG *targ
if
(
!
ld
)
return
~
0u
;
if
(
control
&&
!
(
controlW
=
controlarrayAtoW
(
control
)))
return
LDAP_NO_MEMORY
;
if
(
control
&&
!
(
controlW
=
controlarrayAtoW
(
control
)))
return
WLDAP32_
LDAP_NO_MEMORY
;
ret
=
ldap_parse_vlv_controlW
(
ld
,
controlW
,
targetpos
,
listcount
,
context
,
errcode
);
controlarrayfreeW
(
controlW
);
return
ret
;
...
...
@@ -305,7 +305,7 @@ int CDECL ldap_parse_vlv_controlW( LDAP *ld, LDAPControlW **control, ULONG *targ
if
(
!
ld
||
!
control
)
return
~
0u
;
if
(
!
(
controlU
=
controlarrayWtoU
(
control
)))
return
LDAP_NO_MEMORY
;
if
(
!
(
controlU
=
controlarrayWtoU
(
control
)))
return
WLDAP32_
LDAP_NO_MEMORY
;
for
(
i
=
0
;
controlU
[
i
];
i
++
)
{
...
...
@@ -315,14 +315,14 @@ int CDECL ldap_parse_vlv_controlW( LDAP *ld, LDAPControlW **control, ULONG *targ
if
(
!
vlvcontrolU
)
{
controlarrayfreeU
(
controlU
);
return
LDAP_CONTROL_NOT_FOUND
;
return
WLDAP32_
LDAP_CONTROL_NOT_FOUND
;
}
else
{
struct
ldap_parse_vlvresponse_control_params
params
=
{
CTX
(
ld
),
vlvcontrolU
,
&
pos
,
&
count
,
&
ctxU
,
errcode
};
ret
=
map_error
(
LDAP_CALL
(
ldap_parse_vlvresponse_control
,
&
params
));
}
if
(
ret
==
LDAP_SUCCESS
)
if
(
ret
==
WLDAP32_
LDAP_SUCCESS
)
{
struct
berval
*
bv
;
if
((
bv
=
bervalUtoW
(
ctxU
)))
...
...
@@ -331,7 +331,7 @@ int CDECL ldap_parse_vlv_controlW( LDAP *ld, LDAPControlW **control, ULONG *targ
*
targetpos
=
pos
;
*
listcount
=
count
;
}
else
ret
=
LDAP_NO_MEMORY
;
else
ret
=
WLDAP32_
LDAP_NO_MEMORY
;
LDAP_CALL
(
ber_bvfree
,
ctxU
);
}
...
...
dlls/wldap32/rename.c
View file @
17021e53
...
...
@@ -35,14 +35,14 @@ WINE_DEFAULT_DEBUG_CHANNEL(wldap32);
ULONG
CDECL
ldap_rename_extA
(
LDAP
*
ld
,
char
*
dn
,
char
*
newrdn
,
char
*
newparent
,
int
delete
,
LDAPControlA
**
serverctrls
,
LDAPControlA
**
clientctrls
,
ULONG
*
message
)
{
ULONG
ret
=
LDAP_NO_MEMORY
;
ULONG
ret
=
WLDAP32_
LDAP_NO_MEMORY
;
WCHAR
*
dnW
=
NULL
,
*
newrdnW
=
NULL
,
*
newparentW
=
NULL
;
LDAPControlW
**
serverctrlsW
=
NULL
,
**
clientctrlsW
=
NULL
;
TRACE
(
"(%p, %s, %s, %s, 0x%02x, %p, %p, %p)
\n
"
,
ld
,
debugstr_a
(
dn
),
debugstr_a
(
newrdn
),
debugstr_a
(
newparent
),
delete
,
serverctrls
,
clientctrls
,
message
);
if
(
!
ld
||
!
message
)
return
LDAP_PARAM_ERROR
;
if
(
!
ld
||
!
message
)
return
WLDAP32_
LDAP_PARAM_ERROR
;
if
(
dn
&&
!
(
dnW
=
strAtoW
(
dn
)))
goto
exit
;
if
(
newrdn
&&
!
(
newrdnW
=
strAtoW
(
newrdn
)))
goto
exit
;
...
...
@@ -67,14 +67,14 @@ exit:
ULONG
CDECL
ldap_rename_extW
(
LDAP
*
ld
,
WCHAR
*
dn
,
WCHAR
*
newrdn
,
WCHAR
*
newparent
,
int
delete
,
LDAPControlW
**
serverctrls
,
LDAPControlW
**
clientctrls
,
ULONG
*
message
)
{
ULONG
ret
=
LDAP_NO_MEMORY
;
ULONG
ret
=
WLDAP32_
LDAP_NO_MEMORY
;
char
*
dnU
=
NULL
,
*
newrdnU
=
NULL
,
*
newparentU
=
NULL
;
LDAPControlU
**
serverctrlsU
=
NULL
,
**
clientctrlsU
=
NULL
;
TRACE
(
"(%p, %s, %s, %s, 0x%02x, %p, %p, %p)
\n
"
,
ld
,
debugstr_w
(
dn
),
debugstr_w
(
newrdn
),
debugstr_w
(
newparent
),
delete
,
serverctrls
,
clientctrls
,
message
);
if
(
!
ld
||
!
message
)
return
LDAP_PARAM_ERROR
;
if
(
!
ld
||
!
message
)
return
WLDAP32_
LDAP_PARAM_ERROR
;
if
(
dn
&&
!
(
dnU
=
strWtoU
(
dn
)))
goto
exit
;
if
(
newrdn
&&
!
(
newrdnU
=
strWtoU
(
newrdn
)))
goto
exit
;
...
...
@@ -101,14 +101,14 @@ exit:
ULONG
CDECL
ldap_rename_ext_sA
(
LDAP
*
ld
,
char
*
dn
,
char
*
newrdn
,
char
*
newparent
,
int
delete
,
LDAPControlA
**
serverctrls
,
LDAPControlA
**
clientctrls
)
{
ULONG
ret
=
LDAP_NO_MEMORY
;
ULONG
ret
=
WLDAP32_
LDAP_NO_MEMORY
;
WCHAR
*
dnW
=
NULL
,
*
newrdnW
=
NULL
,
*
newparentW
=
NULL
;
LDAPControlW
**
serverctrlsW
=
NULL
,
**
clientctrlsW
=
NULL
;
TRACE
(
"(%p, %s, %s, %s, 0x%02x, %p, %p)
\n
"
,
ld
,
debugstr_a
(
dn
),
debugstr_a
(
newrdn
),
debugstr_a
(
newparent
),
delete
,
serverctrls
,
clientctrls
);
if
(
!
ld
)
return
LDAP_PARAM_ERROR
;
if
(
!
ld
)
return
WLDAP32_
LDAP_PARAM_ERROR
;
if
(
dn
&&
!
(
dnW
=
strAtoW
(
dn
)))
goto
exit
;
if
(
newrdn
&&
!
(
newrdnW
=
strAtoW
(
newrdn
)))
goto
exit
;
...
...
@@ -133,14 +133,14 @@ exit:
ULONG
CDECL
ldap_rename_ext_sW
(
LDAP
*
ld
,
WCHAR
*
dn
,
WCHAR
*
newrdn
,
WCHAR
*
newparent
,
int
delete
,
LDAPControlW
**
serverctrls
,
LDAPControlW
**
clientctrls
)
{
ULONG
ret
=
LDAP_PARAM_ERROR
;
ULONG
ret
=
WLDAP32_
LDAP_PARAM_ERROR
;
char
*
dnU
=
NULL
,
*
newrdnU
=
NULL
,
*
newparentU
=
NULL
;
LDAPControlU
**
serverctrlsU
=
NULL
,
**
clientctrlsU
=
NULL
;
TRACE
(
"(%p, %s, %s, %s, 0x%02x, %p, %p)
\n
"
,
ld
,
debugstr_w
(
dn
),
debugstr_w
(
newrdn
),
debugstr_w
(
newparent
),
delete
,
serverctrls
,
clientctrls
);
if
(
!
ld
)
return
LDAP_PARAM_ERROR
;
if
(
!
ld
)
return
WLDAP32_
LDAP_PARAM_ERROR
;
if
(
dn
&&
!
(
dnU
=
strWtoU
(
dn
)))
goto
exit
;
if
(
newrdn
&&
!
(
newrdnU
=
strWtoU
(
newrdn
)))
goto
exit
;
...
...
dlls/wldap32/search.c
View file @
17021e53
...
...
@@ -35,7 +35,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(wldap32);
*/
ULONG
CDECL
ldap_searchA
(
LDAP
*
ld
,
char
*
base
,
ULONG
scope
,
char
*
filter
,
char
**
attrs
,
ULONG
attrsonly
)
{
ULONG
ret
=
LDAP_NO_MEMORY
;
ULONG
ret
=
WLDAP32_
LDAP_NO_MEMORY
;
WCHAR
*
baseW
=
NULL
,
*
filterW
=
NULL
,
**
attrsW
=
NULL
;
TRACE
(
"(%p, %s, %#lx, %s, %p, %#lx)
\n
"
,
ld
,
debugstr_a
(
base
),
scope
,
debugstr_a
(
filter
),
attrs
,
attrsonly
);
...
...
@@ -64,7 +64,7 @@ ULONG CDECL ldap_searchW( LDAP *ld, WCHAR *base, ULONG scope, WCHAR *filter, WCH
TRACE
(
"(%p, %s, %#lx, %s, %p, %#lx)
\n
"
,
ld
,
debugstr_w
(
base
),
scope
,
debugstr_w
(
filter
),
attrs
,
attrsonly
);
ret
=
ldap_search_extW
(
ld
,
base
,
scope
,
filter
,
attrs
,
attrsonly
,
NULL
,
NULL
,
0
,
0
,
&
msg
);
if
(
ret
==
LDAP_SUCCESS
)
return
msg
;
if
(
ret
==
WLDAP32_
LDAP_SUCCESS
)
return
msg
;
return
~
0u
;
}
...
...
@@ -74,14 +74,14 @@ ULONG CDECL ldap_searchW( LDAP *ld, WCHAR *base, ULONG scope, WCHAR *filter, WCH
ULONG
CDECL
ldap_search_extA
(
LDAP
*
ld
,
char
*
base
,
ULONG
scope
,
char
*
filter
,
char
**
attrs
,
ULONG
attrsonly
,
LDAPControlA
**
serverctrls
,
LDAPControlA
**
clientctrls
,
ULONG
timelimit
,
ULONG
sizelimit
,
ULONG
*
message
)
{
ULONG
ret
=
LDAP_NO_MEMORY
;
ULONG
ret
=
WLDAP32_
LDAP_NO_MEMORY
;
WCHAR
*
baseW
=
NULL
,
*
filterW
=
NULL
,
**
attrsW
=
NULL
;
LDAPControlW
**
serverctrlsW
=
NULL
,
**
clientctrlsW
=
NULL
;
TRACE
(
"(%p, %s, %#lx, %s, %p, %#lx, %p, %p, %#lx, %#lx, %p)
\n
"
,
ld
,
debugstr_a
(
base
),
scope
,
debugstr_a
(
filter
),
attrs
,
attrsonly
,
serverctrls
,
clientctrls
,
timelimit
,
sizelimit
,
message
);
if
(
!
ld
)
return
LDAP_PARAM_ERROR
;
if
(
!
ld
)
return
WLDAP32_
LDAP_PARAM_ERROR
;
if
(
base
&&
!
(
baseW
=
strAtoW
(
base
)))
goto
exit
;
if
(
filter
&&
!
(
filterW
=
strAtoW
(
filter
)))
goto
exit
;
...
...
@@ -108,7 +108,7 @@ ULONG CDECL ldap_search_extW( LDAP *ld, WCHAR *base, ULONG scope, WCHAR *filter,
ULONG
attrsonly
,
LDAPControlW
**
serverctrls
,
LDAPControlW
**
clientctrls
,
ULONG
timelimit
,
ULONG
sizelimit
,
ULONG
*
message
)
{
ULONG
ret
=
LDAP_NO_MEMORY
;
ULONG
ret
=
WLDAP32_
LDAP_NO_MEMORY
;
char
*
baseU
=
NULL
,
*
filterU
=
NULL
,
**
attrsU
=
NULL
;
LDAPControlU
**
serverctrlsU
=
NULL
,
**
clientctrlsU
=
NULL
;
struct
timevalU
timevalU
;
...
...
@@ -148,14 +148,14 @@ ULONG CDECL ldap_search_ext_sA( LDAP *ld, char *base, ULONG scope, char *filter,
ULONG
attrsonly
,
LDAPControlA
**
serverctrls
,
LDAPControlA
**
clientctrls
,
struct
l_timeval
*
timeout
,
ULONG
sizelimit
,
LDAPMessage
**
res
)
{
ULONG
ret
=
LDAP_NO_MEMORY
;
ULONG
ret
=
WLDAP32_
LDAP_NO_MEMORY
;
WCHAR
*
baseW
=
NULL
,
*
filterW
=
NULL
,
**
attrsW
=
NULL
;
LDAPControlW
**
serverctrlsW
=
NULL
,
**
clientctrlsW
=
NULL
;
TRACE
(
"(%p, %s, %#lx, %s, %p, %#lx, %p, %p, %p, %#lx, %p)
\n
"
,
ld
,
debugstr_a
(
base
),
scope
,
debugstr_a
(
filter
),
attrs
,
attrsonly
,
serverctrls
,
clientctrls
,
timeout
,
sizelimit
,
res
);
if
(
!
ld
||
!
res
)
return
LDAP_PARAM_ERROR
;
if
(
!
ld
||
!
res
)
return
WLDAP32_
LDAP_PARAM_ERROR
;
if
(
base
&&
!
(
baseW
=
strAtoW
(
base
)))
goto
exit
;
if
(
filter
&&
!
(
filterW
=
strAtoW
(
filter
)))
goto
exit
;
...
...
@@ -182,7 +182,7 @@ ULONG CDECL ldap_search_ext_sW( LDAP *ld, WCHAR *base, ULONG scope, WCHAR *filte
ULONG
attrsonly
,
LDAPControlW
**
serverctrls
,
LDAPControlW
**
clientctrls
,
struct
l_timeval
*
timeout
,
ULONG
sizelimit
,
LDAPMessage
**
res
)
{
ULONG
ret
=
LDAP_NO_MEMORY
;
ULONG
ret
=
WLDAP32_
LDAP_NO_MEMORY
;
char
*
baseU
=
NULL
,
*
filterU
=
NULL
,
**
attrsU
=
NULL
;
LDAPControlU
**
serverctrlsU
=
NULL
,
**
clientctrlsU
=
NULL
;
struct
timevalU
timevalU
;
...
...
@@ -191,7 +191,7 @@ ULONG CDECL ldap_search_ext_sW( LDAP *ld, WCHAR *base, ULONG scope, WCHAR *filte
TRACE
(
"(%p, %s, %#lx, %s, %p, %#lx, %p, %p, %p, %#lx, %p)
\n
"
,
ld
,
debugstr_w
(
base
),
scope
,
debugstr_w
(
filter
),
attrs
,
attrsonly
,
serverctrls
,
clientctrls
,
timeout
,
sizelimit
,
res
);
if
(
!
ld
||
!
res
)
return
LDAP_PARAM_ERROR
;
if
(
!
ld
||
!
res
)
return
WLDAP32_
LDAP_PARAM_ERROR
;
if
(
base
&&
!
(
baseU
=
strWtoU
(
base
)))
goto
exit
;
if
(
filter
&&
!
(
filterU
=
strWtoU
(
filter
)))
goto
exit
;
...
...
@@ -222,7 +222,7 @@ ULONG CDECL ldap_search_ext_sW( LDAP *ld, WCHAR *base, ULONG scope, WCHAR *filte
else
{
LDAP_CALL
(
ldap_msgfree
,
msgU
);
ret
=
LDAP_NO_MEMORY
;
ret
=
WLDAP32_
LDAP_NO_MEMORY
;
}
}
...
...
@@ -241,13 +241,13 @@ exit:
ULONG
CDECL
ldap_search_sA
(
LDAP
*
ld
,
char
*
base
,
ULONG
scope
,
char
*
filter
,
char
**
attrs
,
ULONG
attrsonly
,
LDAPMessage
**
res
)
{
ULONG
ret
=
LDAP_NO_MEMORY
;
ULONG
ret
=
WLDAP32_
LDAP_NO_MEMORY
;
WCHAR
*
baseW
=
NULL
,
*
filterW
=
NULL
,
**
attrsW
=
NULL
;
TRACE
(
"(%p, %s, %#lx, %s, %p, %#lx, %p)
\n
"
,
ld
,
debugstr_a
(
base
),
scope
,
debugstr_a
(
filter
),
attrs
,
attrsonly
,
res
);
if
(
!
ld
||
!
res
)
return
LDAP_PARAM_ERROR
;
if
(
!
ld
||
!
res
)
return
WLDAP32_
LDAP_PARAM_ERROR
;
if
(
base
&&
!
(
baseW
=
strAtoW
(
base
)))
goto
exit
;
if
(
filter
&&
!
(
filterW
=
strAtoW
(
filter
)))
goto
exit
;
...
...
@@ -279,13 +279,13 @@ ULONG CDECL ldap_search_sW( LDAP *ld, WCHAR *base, ULONG scope, WCHAR *filter, W
ULONG
CDECL
ldap_search_stA
(
LDAP
*
ld
,
const
PCHAR
base
,
ULONG
scope
,
const
PCHAR
filter
,
char
**
attrs
,
ULONG
attrsonly
,
struct
l_timeval
*
timeout
,
LDAPMessage
**
res
)
{
ULONG
ret
=
LDAP_NO_MEMORY
;
ULONG
ret
=
WLDAP32_
LDAP_NO_MEMORY
;
WCHAR
*
baseW
=
NULL
,
*
filterW
=
NULL
,
**
attrsW
=
NULL
;
TRACE
(
"(%p, %s, %#lx, %s, %p, %#lx, %p, %p)
\n
"
,
ld
,
debugstr_a
(
base
),
scope
,
debugstr_a
(
filter
),
attrs
,
attrsonly
,
timeout
,
res
);
if
(
!
ld
||
!
res
)
return
LDAP_PARAM_ERROR
;
if
(
!
ld
||
!
res
)
return
WLDAP32_
LDAP_PARAM_ERROR
;
if
(
base
&&
!
(
baseW
=
strAtoW
(
base
)))
goto
exit
;
if
(
filter
&&
!
(
filterW
=
strAtoW
(
filter
)))
goto
exit
;
...
...
dlls/wldap32/value.c
View file @
17021e53
...
...
@@ -218,7 +218,7 @@ ULONG CDECL WLDAP32_ldap_value_free_len( struct berval **values )
TRACE
(
"(%p)
\n
"
,
values
);
bvarrayfreeW
(
values
);
return
LDAP_SUCCESS
;
return
WLDAP32_
LDAP_SUCCESS
;
}
/***********************************************************************
...
...
@@ -229,7 +229,7 @@ ULONG CDECL ldap_value_freeA( char **values )
TRACE
(
"(%p)
\n
"
,
values
);
strarrayfreeA
(
values
);
return
LDAP_SUCCESS
;
return
WLDAP32_
LDAP_SUCCESS
;
}
/***********************************************************************
...
...
@@ -240,5 +240,5 @@ ULONG CDECL ldap_value_freeW( WCHAR **values )
TRACE
(
"(%p)
\n
"
,
values
);
strarrayfreeW
(
values
);
return
LDAP_SUCCESS
;
return
WLDAP32_
LDAP_SUCCESS
;
}
dlls/wldap32/winldap_private.h
View file @
17021e53
...
...
@@ -24,6 +24,158 @@
#include "winnls.h"
#include "libldap.h"
#define WLDAP32_LBER_ERROR (~0l)
typedef
enum
{
WLDAP32_LDAP_SUCCESS
=
0x00
,
WLDAP32_LDAP_OPERATIONS_ERROR
=
0x01
,
WLDAP32_LDAP_PROTOCOL_ERROR
=
0x02
,
WLDAP32_LDAP_TIMELIMIT_EXCEEDED
=
0x03
,
WLDAP32_LDAP_SIZELIMIT_EXCEEDED
=
0x04
,
WLDAP32_LDAP_COMPARE_FALSE
=
0x05
,
WLDAP32_LDAP_COMPARE_TRUE
=
0x06
,
WLDAP32_LDAP_AUTH_METHOD_NOT_SUPPORTED
=
0x07
,
WLDAP32_LDAP_STRONG_AUTH_REQUIRED
=
0x08
,
WLDAP32_LDAP_REFERRAL_V2
=
0x09
,
WLDAP32_LDAP_PARTIAL_RESULTS
=
0x09
,
WLDAP32_LDAP_REFERRAL
=
0x0a
,
WLDAP32_LDAP_ADMIN_LIMIT_EXCEEDED
=
0x0b
,
WLDAP32_LDAP_UNAVAILABLE_CRIT_EXTENSION
=
0x0c
,
WLDAP32_LDAP_CONFIDENTIALITY_REQUIRED
=
0x0d
,
WLDAP32_LDAP_SASL_BIND_IN_PROGRESS
=
0x0e
,
WLDAP32_LDAP_NO_SUCH_ATTRIBUTE
=
0x10
,
WLDAP32_LDAP_UNDEFINED_TYPE
=
0x11
,
WLDAP32_LDAP_INAPPROPRIATE_MATCHING
=
0x12
,
WLDAP32_LDAP_CONSTRAINT_VIOLATION
=
0x13
,
WLDAP32_LDAP_ATTRIBUTE_OR_VALUE_EXISTS
=
0x14
,
WLDAP32_LDAP_INVALID_SYNTAX
=
0x15
,
WLDAP32_LDAP_NO_SUCH_OBJECT
=
0x20
,
WLDAP32_LDAP_ALIAS_PROBLEM
=
0x21
,
WLDAP32_LDAP_INVALID_DN_SYNTAX
=
0x22
,
WLDAP32_LDAP_IS_LEAF
=
0x23
,
WLDAP32_LDAP_ALIAS_DEREF_PROBLEM
=
0x24
,
WLDAP32_LDAP_INAPPROPRIATE_AUTH
=
0x30
,
WLDAP32_LDAP_INVALID_CREDENTIALS
=
0x31
,
WLDAP32_LDAP_INSUFFICIENT_RIGHTS
=
0x32
,
WLDAP32_LDAP_BUSY
=
0x33
,
WLDAP32_LDAP_UNAVAILABLE
=
0x34
,
WLDAP32_LDAP_UNWILLING_TO_PERFORM
=
0x35
,
WLDAP32_LDAP_LOOP_DETECT
=
0x36
,
WLDAP32_LDAP_SORT_CONTROL_MISSING
=
0x3C
,
WLDAP32_LDAP_OFFSET_RANGE_ERROR
=
0x3D
,
WLDAP32_LDAP_NAMING_VIOLATION
=
0x40
,
WLDAP32_LDAP_OBJECT_CLASS_VIOLATION
=
0x41
,
WLDAP32_LDAP_NOT_ALLOWED_ON_NONLEAF
=
0x42
,
WLDAP32_LDAP_NOT_ALLOWED_ON_RDN
=
0x43
,
WLDAP32_LDAP_ALREADY_EXISTS
=
0x44
,
WLDAP32_LDAP_NO_OBJECT_CLASS_MODS
=
0x45
,
WLDAP32_LDAP_RESULTS_TOO_LARGE
=
0x46
,
WLDAP32_LDAP_AFFECTS_MULTIPLE_DSAS
=
0x47
,
WLDAP32_LDAP_VIRTUAL_LIST_VIEW_ERROR
=
0x4c
,
WLDAP32_LDAP_OTHER
=
0x50
,
WLDAP32_LDAP_SERVER_DOWN
=
0x51
,
WLDAP32_LDAP_LOCAL_ERROR
=
0x52
,
WLDAP32_LDAP_ENCODING_ERROR
=
0x53
,
WLDAP32_LDAP_DECODING_ERROR
=
0x54
,
WLDAP32_LDAP_TIMEOUT
=
0x55
,
WLDAP32_LDAP_AUTH_UNKNOWN
=
0x56
,
WLDAP32_LDAP_FILTER_ERROR
=
0x57
,
WLDAP32_LDAP_USER_CANCELLED
=
0x58
,
WLDAP32_LDAP_PARAM_ERROR
=
0x59
,
WLDAP32_LDAP_NO_MEMORY
=
0x5a
,
WLDAP32_LDAP_CONNECT_ERROR
=
0x5b
,
WLDAP32_LDAP_NOT_SUPPORTED
=
0x5c
,
WLDAP32_LDAP_CONTROL_NOT_FOUND
=
0x5d
,
WLDAP32_LDAP_NO_RESULTS_RETURNED
=
0x5e
,
WLDAP32_LDAP_MORE_RESULTS_TO_RETURN
=
0x5f
,
WLDAP32_LDAP_CLIENT_LOOP
=
0x60
,
WLDAP32_LDAP_REFERRAL_LIMIT_EXCEEDED
=
0x61
}
WLDAP32_LDAP_RETCODE
;
#define WLDAP32_LDAP_SCOPE_BASE 0x00
#define WLDAP32_LDAP_SCOPE_ONELEVEL 0x01
#define WLDAP32_LDAP_SCOPE_SUBTREE 0x02
#define WLDAP32_LBER_USE_DER 0x01
#define WLDAP32_LDAP_OPT_API_INFO 0x00
#define WLDAP32_LDAP_OPT_DESC 0x01
#define WLDAP32_LDAP_OPT_DEREF 0x02
#define WLDAP32_LDAP_OPT_SIZELIMIT 0x03
#define WLDAP32_LDAP_OPT_TIMELIMIT 0x04
#define WLDAP32_LDAP_OPT_THREAD_FN_PTRS 0x05
#define WLDAP32_LDAP_OPT_REBIND_FN 0x06
#define WLDAP32_LDAP_OPT_REBIND_ARG 0x07
#define WLDAP32_LDAP_OPT_REFERRALS 0x08
#define WLDAP32_LDAP_OPT_RESTART 0x09
#define WLDAP32_LDAP_OPT_SSL 0x0a
#define WLDAP32_LDAP_OPT_IO_FN_PTRS 0x0b
#define WLDAP32_LDAP_OPT_CACHE_FN_PTRS 0x0d
#define WLDAP32_LDAP_OPT_CACHE_STRATEGY 0x0e
#define WLDAP32_LDAP_OPT_CACHE_ENABLE 0x0f
#define WLDAP32_LDAP_OPT_REFERRAL_HOP_LIMIT 0x10
#define WLDAP32_LDAP_OPT_PROTOCOL_VERSION 0x11
#define WLDAP32_LDAP_OPT_VERSION 0x11
#define WLDAP32_LDAP_OPT_SERVER_CONTROLS 0x12
#define WLDAP32_LDAP_OPT_API_FEATURE_INFO 0x15
#define WLDAP32_LDAP_OPT_HOST_NAME 0x30
#define WLDAP32_LDAP_OPT_ERROR_NUMBER 0x31
#define WLDAP32_LDAP_OPT_ERROR_STRING 0x32
#define WLDAP32_LDAP_OPT_SERVER_ERROR 0x33
#define WLDAP32_LDAP_OPT_SERVER_EXT_ERROR 0x34
#define WLDAP32_LDAP_OPT_PING_KEEP_ALIVE 0x36
#define WLDAP32_LDAP_OPT_PING_WAIT_TIME 0x37
#define WLDAP32_LDAP_OPT_PING_LIMIT 0x38
#define WLDAP32_LDAP_OPT_DNSDOMAIN_NAME 0x3b
#define WLDAP32_LDAP_OPT_GETDSNAME_FLAGS 0x3d
#define WLDAP32_LDAP_OPT_HOST_REACHABLE 0x3e
#define WLDAP32_LDAP_OPT_PROMPT_CREDENTIALS 0x3f
#define WLDAP32_LDAP_OPT_TCP_KEEPALIVE 0x40
#define WLDAP32_LDAP_OPT_FAST_CONCURRENT_BIND 0x41
#define WLDAP32_LDAP_OPT_SEND_TIMEOUT 0x42
#define WLDAP32_LDAP_OPT_REFERRAL_CALLBACK 0x70
#define WLDAP32_LDAP_OPT_CLIENT_CERTIFICATE 0x80
#define WLDAP32_LDAP_OPT_SERVER_CERTIFICATE 0x81
#define WLDAP32_LDAP_OPT_AUTO_RECONNECT 0x91
#define WLDAP32_LDAP_OPT_SSPI_FLAGS 0x92
#define WLDAP32_LDAP_OPT_SSL_INFO 0x93
#define WLDAP32_LDAP_OPT_REF_DEREF_CONN_PER_MSG 0x94
#define WLDAP32_LDAP_OPT_TLS LDAP_OPT_SSL
#define WLDAP32_LDAP_OPT_TLS_INFO LDAP_OPT_SSL_INFO
#define WLDAP32_LDAP_OPT_SIGN 0x95
#define WLDAP32_LDAP_OPT_ENCRYPT 0x96
#define WLDAP32_LDAP_OPT_SASL_METHOD 0x97
#define WLDAP32_LDAP_OPT_AREC_EXCLUSIVE 0x98
#define WLDAP32_LDAP_OPT_SECURITY_CONTEXT 0x99
#define WLDAP32_LDAP_OPT_ROOTDSE_CACHE 0x9a
#define WLDAP32_LDAP_OPT_ON ((void *)1)
#define WLDAP32_LDAP_OPT_OFF ((void *)0)
#define WLDAP32_LDAP_VERSION1 1
#define WLDAP32_LDAP_VERSION2 2
#define WLDAP32_LDAP_VERSION3 3
#define WLDAP32_LDAP_VERSION WLDAP32_LDAP_VERSION2
#define WLDAP32_LDAP_AUTH_SIMPLE 0x80
#define WLDAP32_LDAP_AUTH_SASL 0x83
#define WLDAP32_LDAP_AUTH_OTHERKIND 0x86
#define WLDAP32_LDAP_AUTH_EXTERNAL (WLDAP32_LDAP_AUTH_OTHERKIND | 0x0020)
#define WLDAP32_LDAP_AUTH_SICILY (WLDAP32_LDAP_AUTH_OTHERKIND | 0x0200)
#define WLDAP32_LDAP_AUTH_NEGOTIATE (WLDAP32_LDAP_AUTH_OTHERKIND | 0x0400)
#define WLDAP32_LDAP_AUTH_MSN (WLDAP32_LDAP_AUTH_OTHERKIND | 0x0800)
#define WLDAP32_LDAP_AUTH_NTLM (WLDAP32_LDAP_AUTH_OTHERKIND | 0x1000)
#define WLDAP32_LDAP_AUTH_DPA (WLDAP32_LDAP_AUTH_OTHERKIND | 0x2000)
#define WLDAP32_LDAP_AUTH_DIGEST (WLDAP32_LDAP_AUTH_OTHERKIND | 0x4000)
typedef
struct
WLDAP32_berelement
{
char
*
opaque
;
...
...
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