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
455989fa
Commit
455989fa
authored
Jul 22, 2005
by
Hans Leidekker
Committed by
Alexandre Julliard
Jul 22, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add helper functions for converting LDAPControl structures.
parent
64329de2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
242 additions
and
0 deletions
+242
-0
winldap_private.h
dlls/wldap32/winldap_private.h
+20
-0
wldap32.h
dlls/wldap32/wldap32.h
+222
-0
No files found.
dlls/wldap32/winldap_private.h
View file @
455989fa
...
...
@@ -75,6 +75,26 @@ typedef struct ldapmsg
BOOLEAN
ConnectionReferenced
;
}
WLDAP32_LDAPMessage
,
*
WLDAP32_PLDAPMessage
;
typedef
struct
WLDAP32_berval
{
ULONG
bv_len
;
PCHAR
bv_val
;
}
LDAP_BERVAL
,
*
PLDAP_BERVAL
,
BERVAL
,
*
PBERVAL
,
WLDAP32_BerValue
;
typedef
struct
ldapcontrolA
{
PCHAR
ldctl_oid
;
struct
WLDAP32_berval
ldctl_value
;
BOOLEAN
ldctl_iscritical
;
}
LDAPControlA
,
*
PLDAPControlA
;
typedef
struct
ldapcontrolW
{
PWCHAR
ldctl_oid
;
struct
WLDAP32_berval
ldctl_value
;
BOOLEAN
ldctl_iscritical
;
}
LDAPControlW
,
*
PLDAPControlW
;
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
);
...
...
dlls/wldap32/wldap32.h
View file @
455989fa
...
...
@@ -223,3 +223,225 @@ static inline void strarrayfreeU( char **strarray )
HeapFree
(
GetProcessHeap
(),
0
,
strarray
);
}
}
#ifdef HAVE_LDAP
static
inline
LDAPControlW
*
controlAtoW
(
LDAPControlA
*
control
)
{
LDAPControlW
*
controlW
;
controlW
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
LDAPControlW
)
);
if
(
controlW
)
{
memcpy
(
controlW
,
control
,
sizeof
(
LDAPControlW
)
);
controlW
->
ldctl_oid
=
strAtoW
(
control
->
ldctl_oid
);
}
return
controlW
;
}
static
inline
LDAPControlA
*
controlWtoA
(
LDAPControlW
*
control
)
{
LDAPControlA
*
controlA
;
controlA
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
LDAPControl
)
);
if
(
controlA
)
{
memcpy
(
controlA
,
control
,
sizeof
(
LDAPControlA
)
);
controlA
->
ldctl_oid
=
strWtoA
(
control
->
ldctl_oid
);
}
return
controlA
;
}
static
inline
LDAPControl
*
controlWtoU
(
LDAPControlW
*
control
)
{
LDAPControl
*
controlU
;
controlU
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
LDAPControl
)
);
if
(
controlU
)
{
memcpy
(
controlU
,
control
,
sizeof
(
LDAPControl
)
);
controlU
->
ldctl_oid
=
strWtoU
(
control
->
ldctl_oid
);
}
return
controlU
;
}
static
inline
LDAPControlW
*
controlUtoW
(
LDAPControl
*
control
)
{
LDAPControlW
*
controlW
;
controlW
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
LDAPControlW
)
);
if
(
controlW
)
{
memcpy
(
controlW
,
control
,
sizeof
(
LDAPControlW
)
);
controlW
->
ldctl_oid
=
strUtoW
(
control
->
ldctl_oid
);
}
return
controlW
;
}
static
inline
void
controlfreeA
(
LDAPControlA
*
control
)
{
if
(
control
)
{
strfreeA
(
control
->
ldctl_oid
);
HeapFree
(
GetProcessHeap
(),
0
,
control
);
}
}
static
inline
void
controlfreeW
(
LDAPControlW
*
control
)
{
if
(
control
)
{
strfreeW
(
control
->
ldctl_oid
);
HeapFree
(
GetProcessHeap
(),
0
,
control
);
}
}
static
inline
void
controlfreeU
(
LDAPControl
*
control
)
{
if
(
control
)
{
strfreeU
(
control
->
ldctl_oid
);
HeapFree
(
GetProcessHeap
(),
0
,
control
);
}
}
static
inline
DWORD
controlarraylenA
(
LDAPControlA
**
controlarray
)
{
LDAPControlA
**
p
=
controlarray
;
while
(
*
p
)
p
++
;
return
p
-
controlarray
;
}
static
inline
DWORD
controlarraylenW
(
LDAPControlW
**
controlarray
)
{
LDAPControlW
**
p
=
controlarray
;
while
(
*
p
)
p
++
;
return
p
-
controlarray
;
}
static
inline
DWORD
controlarraylenU
(
LDAPControl
**
controlarray
)
{
LDAPControl
**
p
=
controlarray
;
while
(
*
p
)
p
++
;
return
p
-
controlarray
;
}
static
inline
LDAPControlW
**
controlarrayAtoW
(
LDAPControlA
**
controlarray
)
{
LDAPControlW
**
controlarrayW
=
NULL
;
DWORD
size
;
if
(
controlarray
)
{
size
=
sizeof
(
LDAPControlW
*
)
*
(
controlarraylenA
(
controlarray
)
+
1
);
controlarrayW
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
if
(
controlarrayW
)
{
LDAPControlA
**
p
=
controlarray
;
LDAPControlW
**
q
=
controlarrayW
;
while
(
*
p
)
*
q
++
=
controlAtoW
(
*
p
++
);
*
q
=
NULL
;
}
}
return
controlarrayW
;
}
static
inline
LDAPControlA
**
controlarrayWtoA
(
LDAPControlW
**
controlarray
)
{
LDAPControlA
**
controlarrayA
=
NULL
;
DWORD
size
;
if
(
controlarray
)
{
size
=
sizeof
(
LDAPControl
*
)
*
(
controlarraylenW
(
controlarray
)
+
1
);
controlarrayA
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
if
(
controlarrayA
)
{
LDAPControlW
**
p
=
controlarray
;
LDAPControlA
**
q
=
controlarrayA
;
while
(
*
p
)
*
q
++
=
controlWtoA
(
*
p
++
);
*
q
=
NULL
;
}
}
return
controlarrayA
;
}
static
inline
LDAPControl
**
controlarrayWtoU
(
LDAPControlW
**
controlarray
)
{
LDAPControl
**
controlarrayU
=
NULL
;
DWORD
size
;
if
(
controlarray
)
{
size
=
sizeof
(
LDAPControl
*
)
*
(
controlarraylenW
(
controlarray
)
+
1
);
controlarrayU
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
if
(
controlarrayU
)
{
LDAPControlW
**
p
=
controlarray
;
LDAPControl
**
q
=
controlarrayU
;
while
(
*
p
)
*
q
++
=
controlWtoU
(
*
p
++
);
*
q
=
NULL
;
}
}
return
controlarrayU
;
}
static
inline
LDAPControlW
**
controlarrayUtoW
(
LDAPControl
**
controlarray
)
{
LDAPControlW
**
controlarrayW
=
NULL
;
DWORD
size
;
if
(
controlarray
)
{
size
=
sizeof
(
LDAPControlW
*
)
*
(
controlarraylenU
(
controlarray
)
+
1
);
controlarrayW
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
if
(
controlarrayW
)
{
LDAPControl
**
p
=
controlarray
;
LDAPControlW
**
q
=
controlarrayW
;
while
(
*
p
)
*
q
++
=
controlUtoW
(
*
p
++
);
*
q
=
NULL
;
}
}
return
controlarrayW
;
}
static
inline
void
controlarrayfreeA
(
LDAPControlA
**
controlarray
)
{
if
(
controlarray
)
{
LDAPControlA
**
p
=
controlarray
;
while
(
*
p
)
controlfreeA
(
*
p
++
);
HeapFree
(
GetProcessHeap
(),
0
,
controlarray
);
}
}
static
inline
void
controlarrayfreeW
(
LDAPControlW
**
controlarray
)
{
if
(
controlarray
)
{
LDAPControlW
**
p
=
controlarray
;
while
(
*
p
)
controlfreeW
(
*
p
++
);
HeapFree
(
GetProcessHeap
(),
0
,
controlarray
);
}
}
static
inline
void
controlarrayfreeU
(
LDAPControl
**
controlarray
)
{
if
(
controlarray
)
{
LDAPControl
**
p
=
controlarray
;
while
(
*
p
)
controlfreeU
(
*
p
++
);
HeapFree
(
GetProcessHeap
(),
0
,
controlarray
);
}
}
#endif
/* HAVE_LDAP */
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