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
3656d57a
Commit
3656d57a
authored
Apr 10, 2020
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Apr 10, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
activeds: Implement IADsPathname::Set(ADS_SETTYPE_FULL).
Signed-off-by:
Dmitry Timoshkov
<
dmitry@baikal.ru
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
18631864
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
85 additions
and
8 deletions
+85
-8
pathname.c
dlls/activeds/pathname.c
+84
-6
activeds.c
dlls/activeds/tests/activeds.c
+1
-2
No files found.
dlls/activeds/pathname.c
View file @
3656d57a
...
...
@@ -26,6 +26,7 @@
#include "windef.h"
#include "winbase.h"
#include "iads.h"
#include "adserr.h"
#include "wine/heap.h"
#include "wine/debug.h"
...
...
@@ -39,7 +40,7 @@ typedef struct
{
IADsPathname
IADsPathname_iface
;
LONG
ref
;
BSTR
adspath
;
BSTR
provider
,
server
,
dn
;
}
Pathname
;
static
inline
Pathname
*
impl_from_IADsPathname
(
IADsPathname
*
iface
)
...
...
@@ -80,6 +81,9 @@ static ULONG WINAPI path_Release(IADsPathname *iface)
if
(
!
ref
)
{
TRACE
(
"destroying %p
\n
"
,
iface
);
SysFreeString
(
path
->
provider
);
SysFreeString
(
path
->
server
);
SysFreeString
(
path
->
dn
);
heap_free
(
path
);
}
...
...
@@ -113,16 +117,88 @@ static HRESULT WINAPI path_Invoke(IADsPathname *iface, DISPID dispid, REFIID rii
return
E_NOTIMPL
;
}
static
HRESULT
parse_path
(
BSTR
path
,
BSTR
*
provider
,
BSTR
*
server
,
BSTR
*
dn
)
{
WCHAR
*
p
,
*
p_server
;
int
server_len
;
*
provider
=
NULL
;
*
server
=
NULL
;
*
dn
=
NULL
;
if
(
wcsnicmp
(
path
,
L"LDAP:"
,
5
)
!=
0
)
return
E_ADS_BAD_PATHNAME
;
*
provider
=
SysAllocStringLen
(
path
,
4
);
if
(
!*
provider
)
return
E_OUTOFMEMORY
;
p
=
path
+
5
;
if
(
!*
p
)
return
S_OK
;
if
(
*
p
++
!=
'/'
||
*
p
++
!=
'/'
||
!*
p
)
return
E_ADS_BAD_PATHNAME
;
p_server
=
p
;
server_len
=
0
;
while
(
*
p
&&
*
p
!=
'/'
)
{
p
++
;
server_len
++
;
}
if
(
server_len
==
0
)
return
E_ADS_BAD_PATHNAME
;
*
server
=
SysAllocStringLen
(
p_server
,
server_len
);
if
(
!*
server
)
{
SysFreeString
(
*
provider
);
return
E_OUTOFMEMORY
;
}
if
(
!*
p
)
return
S_OK
;
if
(
*
p
++
!=
'/'
||
!*
p
)
{
SysFreeString
(
*
provider
);
SysFreeString
(
*
server
);
return
E_ADS_BAD_PATHNAME
;
}
*
dn
=
SysAllocString
(
p
);
if
(
!*
dn
)
{
SysFreeString
(
*
provider
);
SysFreeString
(
*
server
);
return
E_OUTOFMEMORY
;
}
return
S_OK
;
}
static
HRESULT
WINAPI
path_Set
(
IADsPathname
*
iface
,
BSTR
adspath
,
LONG
type
)
{
Pathname
*
path
=
impl_from_IADsPathname
(
iface
);
HRESULT
hr
;
BSTR
provider
,
server
,
dn
;
FIXME
(
"%p,%s,%d: stub
\n
"
,
iface
,
debugstr_w
(
adspath
),
type
);
TRACE
(
"%p,%s,%d
\n
"
,
iface
,
debugstr_w
(
adspath
),
type
);
if
(
!
adspath
)
return
E_INVALIDARG
;
path
->
adspath
=
SysAllocString
(
adspath
);
return
path
->
adspath
?
S_OK
:
E_OUTOFMEMORY
;
if
(
type
!=
ADS_SETTYPE_FULL
)
FIXME
(
"type %d not implemented
\n
"
,
type
);
hr
=
parse_path
(
adspath
,
&
provider
,
&
server
,
&
dn
);
if
(
hr
==
S_OK
)
{
SysFreeString
(
path
->
provider
);
SysFreeString
(
path
->
server
);
SysFreeString
(
path
->
dn
);
path
->
provider
=
provider
;
path
->
server
=
server
;
path
->
dn
=
dn
;
}
return
hr
;
}
static
HRESULT
WINAPI
path_SetDisplayType
(
IADsPathname
*
iface
,
LONG
type
)
...
...
@@ -139,7 +215,7 @@ static HRESULT WINAPI path_Retrieve(IADsPathname *iface, LONG type, BSTR *adspat
if
(
!
adspath
)
return
E_INVALIDARG
;
*
adspath
=
SysAllocString
(
path
->
adspath
);
*
adspath
=
SysAllocString
(
path
->
provider
);
return
*
adspath
?
S_OK
:
E_OUTOFMEMORY
;
}
...
...
@@ -223,7 +299,9 @@ static HRESULT Pathname_create(REFIID riid, void **obj)
path
->
IADsPathname_iface
.
lpVtbl
=
&
IADsPathname_vtbl
;
path
->
ref
=
1
;
path
->
adspath
=
NULL
;
path
->
provider
=
SysAllocString
(
L"LDAP"
);
path
->
server
=
NULL
;
path
->
dn
=
NULL
;
hr
=
IADsPathname_QueryInterface
(
&
path
->
IADsPathname_iface
,
riid
,
obj
);
IADsPathname_Release
(
&
path
->
IADsPathname_iface
);
...
...
dlls/activeds/tests/activeds.c
View file @
3656d57a
...
...
@@ -104,7 +104,6 @@ todo_wine
bstr
=
NULL
;
hr
=
IADsPathname_Retrieve
(
path
,
ADS_FORMAT_X500
,
&
bstr
);
todo_wine
ok
(
hr
==
S_OK
,
"got %#x
\n
"
,
hr
);
todo_wine
ok
(
bstr
&&
!
wcscmp
(
bstr
,
L"LDAP://"
),
"got %s
\n
"
,
wine_dbgstr_w
(
bstr
));
...
...
@@ -148,12 +147,12 @@ todo_wine
hr
=
IADsPathname_Retrieve
(
path
,
ADS_FORMAT_X500
,
&
bstr
);
ok
(
hr
==
S_OK
,
"got %#x
\n
"
,
hr
);
todo_wine
ok
(
!
wcscmp
(
bstr
,
L"LDAP://sample:123/a=b,c=d,e=f"
),
"got %s
\n
"
,
wine_dbgstr_w
(
bstr
));
SysFreeString
(
bstr
);
hr
=
IADsPathname_Retrieve
(
path
,
ADS_FORMAT_PROVIDER
,
&
bstr
);
ok
(
hr
==
S_OK
,
"got %#x
\n
"
,
hr
);
todo_wine
ok
(
!
wcscmp
(
bstr
,
L"LDAP"
),
"got %s
\n
"
,
wine_dbgstr_w
(
bstr
));
SysFreeString
(
bstr
);
...
...
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