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
889e66c2
Commit
889e66c2
authored
Mar 26, 2020
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Mar 26, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adsldp: Implement IDirectorySearch::GetColumn().
Signed-off-by:
Dmitry Timoshkov
<
dmitry@baikal.ru
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
e53a0094
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
66 additions
and
2 deletions
+66
-2
adsldp.c
dlls/adsldp/adsldp.c
+49
-2
adsldp_private.h
dlls/adsldp/adsldp_private.h
+17
-0
No files found.
dlls/adsldp/adsldp.c
View file @
889e66c2
...
@@ -1301,11 +1301,58 @@ static HRESULT WINAPI search_GetNextColumnName(IDirectorySearch *iface, ADS_SEAR
...
@@ -1301,11 +1301,58 @@ static HRESULT WINAPI search_GetNextColumnName(IDirectorySearch *iface, ADS_SEAR
return
S_ADS_NOMORE_COLUMNS
;
return
S_ADS_NOMORE_COLUMNS
;
}
}
static
HRESULT
add_column_values
(
ADS_SEARCH_COLUMN
*
col
,
struct
berval
**
values
,
DWORD
count
)
{
DWORD
i
;
col
->
pADsValues
=
heap_alloc
(
count
*
sizeof
(
col
->
pADsValues
[
0
]));
if
(
!
col
->
pADsValues
)
return
E_OUTOFMEMORY
;
for
(
i
=
0
;
i
<
count
;
i
++
)
{
DWORD
outlen
;
TRACE
(
"=> %s
\n
"
,
debugstr_an
(
values
[
i
]
->
bv_val
,
values
[
i
]
->
bv_len
));
col
->
pADsValues
[
i
].
u
.
CaseIgnoreString
=
strnAtoW
(
values
[
i
]
->
bv_val
,
values
[
i
]
->
bv_len
,
&
outlen
);
if
(
!
col
->
pADsValues
[
i
].
u
.
CaseIgnoreString
)
{
heap_free
(
col
->
pADsValues
);
return
E_OUTOFMEMORY
;
}
}
col
->
dwADsType
=
ADSTYPE_CASE_IGNORE_STRING
;
col
->
dwNumValues
=
count
;
return
S_OK
;
}
static
HRESULT
WINAPI
search_GetColumn
(
IDirectorySearch
*
iface
,
ADS_SEARCH_HANDLE
res
,
static
HRESULT
WINAPI
search_GetColumn
(
IDirectorySearch
*
iface
,
ADS_SEARCH_HANDLE
res
,
LPWSTR
name
,
PADS_SEARCH_COLUMN
col
)
LPWSTR
name
,
PADS_SEARCH_COLUMN
col
)
{
{
FIXME
(
"%p,%p,%s,%p: stub
\n
"
,
iface
,
res
,
debugstr_w
(
name
),
col
);
LDAP_namespace
*
ldap
=
impl_from_IDirectorySearch
(
iface
);
return
E_NOTIMPL
;
struct
ldap_search_context
*
ldap_ctx
=
res
;
HRESULT
hr
;
struct
berval
**
values
;
ULONG
count
;
TRACE
(
"%p,%p,%s,%p
\n
"
,
iface
,
res
,
debugstr_w
(
name
),
col
);
if
(
!
ldap
->
ld
)
return
E_NOTIMPL
;
if
(
!
res
||
!
name
||
!
ldap_ctx
->
entry
)
return
E_ADS_BAD_PARAMETER
;
values
=
ldap_get_values_lenW
(
ldap
->
ld
,
ldap_ctx
->
entry
,
name
);
if
(
!
values
)
return
ERROR_DS_NO_ATTRIBUTE_OR_VALUE
;
count
=
ldap_count_values_len
(
values
);
hr
=
add_column_values
(
col
,
values
,
count
);
ldap_value_free_len
(
values
);
if
(
hr
==
S_OK
)
col
->
pszAttrName
=
strdupW
(
name
);
return
hr
;
}
}
static
HRESULT
WINAPI
search_FreeColumn
(
IDirectorySearch
*
iface
,
PADS_SEARCH_COLUMN
col
)
static
HRESULT
WINAPI
search_FreeColumn
(
IDirectorySearch
*
iface
,
PADS_SEARCH_COLUMN
col
)
...
...
dlls/adsldp/adsldp_private.h
View file @
889e66c2
...
@@ -29,6 +29,23 @@ static inline WCHAR *strdupW(const WCHAR *src)
...
@@ -29,6 +29,23 @@ static inline WCHAR *strdupW(const WCHAR *src)
return
dst
;
return
dst
;
}
}
static
inline
LPWSTR
strnAtoW
(
LPCSTR
str
,
DWORD
inlen
,
DWORD
*
outlen
)
{
LPWSTR
ret
=
NULL
;
*
outlen
=
0
;
if
(
str
)
{
DWORD
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
str
,
inlen
,
NULL
,
0
);
if
((
ret
=
heap_alloc
(
(
len
+
1
)
*
sizeof
(
WCHAR
)
)))
{
MultiByteToWideChar
(
CP_ACP
,
0
,
str
,
inlen
,
ret
,
len
);
ret
[
len
]
=
0
;
*
outlen
=
len
;
}
}
return
ret
;
}
DWORD
map_ldap_error
(
DWORD
)
DECLSPEC_HIDDEN
;
DWORD
map_ldap_error
(
DWORD
)
DECLSPEC_HIDDEN
;
#endif
#endif
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