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
d15d1c4c
Commit
d15d1c4c
authored
Sep 07, 2005
by
Hans Leidekker
Committed by
Alexandre Julliard
Sep 07, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement ldap_escape_filter_element*.
parent
fa1dca30
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
78 additions
and
4 deletions
+78
-4
misc.c
dlls/wldap32/misc.c
+72
-0
winldap_private.h
dlls/wldap32/winldap_private.h
+2
-0
wldap32.spec
dlls/wldap32/wldap32.spec
+3
-3
winldap.h
include/winldap.h
+1
-1
No files found.
dlls/wldap32/misc.c
View file @
d15d1c4c
...
...
@@ -24,6 +24,7 @@
#include "wine/debug.h"
#include <stdarg.h>
#include <stdio.h>
#include "windef.h"
#include "winbase.h"
...
...
@@ -125,6 +126,77 @@ ULONG WLDAP32_ldap_count_references( WLDAP32_LDAP *ld, WLDAP32_LDAPMessage *res
return
ret
;
}
static
ULONG
get_escape_size
(
PCHAR
src
,
ULONG
srclen
)
{
ULONG
i
,
size
=
0
;
if
(
src
)
{
for
(
i
=
0
;
i
<
srclen
;
i
++
)
{
if
((
src
[
i
]
>=
'0'
&&
src
[
i
]
<=
'9'
)
||
(
src
[
i
]
>=
'A'
&&
src
[
i
]
<=
'Z'
)
||
(
src
[
i
]
>=
'a'
&&
src
[
i
]
<=
'z'
))
size
++
;
else
size
+=
3
;
}
}
return
size
+
1
;
}
static
void
escape_filter_element
(
PCHAR
src
,
ULONG
srclen
,
PCHAR
dst
)
{
ULONG
i
;
char
fmt
[]
=
"
\\
%02X"
;
char
*
d
=
dst
;
for
(
i
=
0
;
i
<
srclen
;
i
++
)
{
if
((
src
[
i
]
>=
'0'
&&
src
[
i
]
<=
'9'
)
||
(
src
[
i
]
>=
'A'
&&
src
[
i
]
<=
'Z'
)
||
(
src
[
i
]
>=
'a'
&&
src
[
i
]
<=
'z'
))
*
d
++
=
src
[
i
];
else
{
sprintf
(
d
,
fmt
,
(
unsigned
char
)
src
[
i
]
);
d
+=
3
;
}
}
*++
d
=
0
;
}
ULONG
ldap_escape_filter_elementA
(
PCHAR
src
,
ULONG
srclen
,
PCHAR
dst
,
ULONG
dstlen
)
{
ULONG
len
;
TRACE
(
"(%p, 0x%08lx, %p, 0x%08lx)
\n
"
,
src
,
srclen
,
dst
,
dstlen
);
len
=
get_escape_size
(
src
,
srclen
);
if
(
!
dst
)
return
len
;
if
(
!
src
||
dstlen
<
len
)
return
WLDAP32_LDAP_PARAM_ERROR
;
else
{
escape_filter_element
(
src
,
srclen
,
dst
);
return
LDAP_SUCCESS
;
}
}
ULONG
ldap_escape_filter_elementW
(
PCHAR
src
,
ULONG
srclen
,
PWCHAR
dst
,
ULONG
dstlen
)
{
ULONG
len
;
TRACE
(
"(%p, 0x%08lx, %p, 0x%08lx)
\n
"
,
src
,
srclen
,
dst
,
dstlen
);
len
=
get_escape_size
(
src
,
srclen
);
if
(
!
dst
)
return
len
;
/* no matter what you throw at it, this is what native returns */
return
WLDAP32_LDAP_PARAM_ERROR
;
}
PCHAR
ldap_first_attributeA
(
WLDAP32_LDAP
*
ld
,
WLDAP32_LDAPMessage
*
entry
,
WLDAP32_BerElement
**
ptr
)
{
...
...
dlls/wldap32/winldap_private.h
View file @
d15d1c4c
...
...
@@ -283,6 +283,8 @@ PCHAR ldap_dn2ufnA(PCHAR);
PWCHAR
ldap_dn2ufnW
(
PWCHAR
);
PCHAR
ldap_err2stringA
(
ULONG
);
PWCHAR
ldap_err2stringW
(
ULONG
);
ULONG
ldap_escape_filter_elementA
(
PCHAR
,
ULONG
,
PCHAR
,
ULONG
);
ULONG
ldap_escape_filter_elementW
(
PCHAR
,
ULONG
,
PWCHAR
,
ULONG
);
PCHAR
*
ldap_explode_dnA
(
PCHAR
,
ULONG
);
PWCHAR
*
ldap_explode_dnW
(
PWCHAR
,
ULONG
);
ULONG
ldap_extended_operationA
(
WLDAP32_LDAP
*
,
PCHAR
,
struct
WLDAP32_berval
*
,
PLDAPControlA
*
,
PLDAPControlA
*
,
ULONG
*
);
...
...
dlls/wldap32/wldap32.spec
View file @
d15d1c4c
...
...
@@ -95,9 +95,9 @@
@ cdecl ldap_err2string(long) ldap_err2stringA
@ cdecl ldap_err2stringA(long)
@ cdecl ldap_err2stringW(long)
@
stub ldap_escape_filter_element
@
stub ldap_escape_filter_elementA
@
stub ldap_escape_filter_elementW
@
cdecl ldap_escape_filter_element(str long ptr long) ldap_escape_filter_elementA
@
cdecl ldap_escape_filter_elementA(str long ptr long)
@
cdecl ldap_escape_filter_elementW(wstr long ptr long)
@ cdecl ldap_explode_dn(str long) ldap_explode_dnA
@ cdecl ldap_explode_dnA(str long)
@ cdecl ldap_explode_dnW(wstr long)
...
...
include/winldap.h
View file @
d15d1c4c
...
...
@@ -445,7 +445,7 @@ PCHAR ldap_err2stringA(ULONG);
PWCHAR
ldap_err2stringW
(
ULONG
);
#define ldap_err2string WINELIB_NAME_AW(ldap_err2string)
ULONG
ldap_escape_filter_elementA
(
PCHAR
,
ULONG
,
PCHAR
,
ULONG
);
ULONG
ldap_escape_filter_elementW
(
P
W
CHAR
,
ULONG
,
PWCHAR
,
ULONG
);
ULONG
ldap_escape_filter_elementW
(
PCHAR
,
ULONG
,
PWCHAR
,
ULONG
);
#define ldap_escape_filter_element WINELIB_NAME_AW(ldap_escape_filter_element)
PCHAR
*
ldap_explode_dnA
(
PCHAR
,
ULONG
);
PWCHAR
*
ldap_explode_dnW
(
PWCHAR
,
ULONG
);
...
...
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