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
18631864
Commit
18631864
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/tests: Add some IADsPathname tests.
Signed-off-by:
Dmitry Timoshkov
<
dmitry@baikal.ru
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
8af510ea
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
121 additions
and
0 deletions
+121
-0
activeds.c
dlls/activeds/tests/activeds.c
+98
-0
iads.idl
include/iads.idl
+23
-0
No files found.
dlls/activeds/tests/activeds.c
View file @
18631864
...
...
@@ -19,15 +19,20 @@
#include <stdarg.h>
#include <stdio.h>
#define COBJMACROS
#include "windef.h"
#include "winbase.h"
#include "objbase.h"
#include "initguid.h"
#include "iads.h"
#include "adshlp.h"
#include "adserr.h"
#include "wine/test.h"
DEFINE_GUID
(
CLSID_Pathname
,
0x080d0d78
,
0xf421
,
0x11d0
,
0xa3
,
0x6e
,
0x00
,
0xc0
,
0x4f
,
0xb9
,
0x50
,
0xdc
);
static
void
test_ADsBuildVarArrayStr
(
void
)
{
const
WCHAR
*
props
[]
=
{
L"prop1"
,
L"prop2"
};
...
...
@@ -79,7 +84,100 @@ static void test_ADsBuildVarArrayStr(void)
VariantClear
(
&
var
);
}
static
void
test_Pathname
(
void
)
{
static
const
WCHAR
*
const
elem
[
3
]
=
{
L"a=b"
,
L"c=d"
,
L"e=f"
};
HRESULT
hr
;
IADsPathname
*
path
;
BSTR
bstr
;
LONG
count
,
i
;
hr
=
CoCreateInstance
(
&
CLSID_Pathname
,
0
,
CLSCTX_INPROC_SERVER
,
&
IID_IADsPathname
,
(
void
**
)
&
path
);
ok
(
hr
==
S_OK
,
"got %#x
\n
"
,
hr
);
count
=
0xdeadbeef
;
hr
=
IADsPathname_GetNumElements
(
path
,
&
count
);
todo_wine
ok
(
hr
==
S_OK
,
"got %#x
\n
"
,
hr
);
todo_wine
ok
(
count
==
0
,
"got %d
\n
"
,
count
);
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
));
SysFreeString
(
bstr
);
bstr
=
SysAllocString
(
L"LDAP://sample"
);
hr
=
IADsPathname_Set
(
path
,
bstr
,
ADS_SETTYPE_FULL
);
ok
(
hr
==
S_OK
,
"got %#x
\n
"
,
hr
);
SysFreeString
(
bstr
);
count
=
0xdeadbeef
;
hr
=
IADsPathname_GetNumElements
(
path
,
&
count
);
todo_wine
ok
(
hr
==
S_OK
,
"got %#x
\n
"
,
hr
);
todo_wine
ok
(
count
==
0
,
"got %d
\n
"
,
count
);
hr
=
IADsPathname_GetElement
(
path
,
0
,
&
bstr
);
todo_wine
ok
(
hr
==
HRESULT_FROM_WIN32
(
ERROR_INVALID_INDEX
),
"got %#x
\n
"
,
hr
);
SysFreeString
(
bstr
);
bstr
=
SysAllocString
(
L"LDAP://sample:123/a=b,c=d,e=f"
);
hr
=
IADsPathname_Set
(
path
,
bstr
,
ADS_SETTYPE_FULL
);
ok
(
hr
==
S_OK
,
"got %#x
\n
"
,
hr
);
SysFreeString
(
bstr
);
count
=
0xdeadbeef
;
hr
=
IADsPathname_GetNumElements
(
path
,
&
count
);
todo_wine
ok
(
hr
==
S_OK
,
"got %#x
\n
"
,
hr
);
todo_wine
ok
(
count
==
3
,
"got %d
\n
"
,
count
);
for
(
i
=
0
;
i
<
count
;
i
++
)
{
hr
=
IADsPathname_GetElement
(
path
,
i
,
&
bstr
);
ok
(
hr
==
S_OK
,
"got %#x
\n
"
,
hr
);
ok
(
!
wcscmp
(
bstr
,
elem
[
i
]),
"%u: %s
\n
"
,
i
,
wine_dbgstr_w
(
bstr
));
SysFreeString
(
bstr
);
}
hr
=
IADsPathname_Retrieve
(
path
,
ADS_FORMAT_X500
,
&
bstr
);
ok
(
hr
==
S_OK
,
"got %#x
\n
"
,
hr
);
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
);
hr
=
IADsPathname_Retrieve
(
path
,
ADS_FORMAT_SERVER
,
&
bstr
);
ok
(
hr
==
S_OK
,
"got %#x
\n
"
,
hr
);
todo_wine
ok
(
!
wcscmp
(
bstr
,
L"sample:123"
),
"got %s
\n
"
,
wine_dbgstr_w
(
bstr
));
SysFreeString
(
bstr
);
hr
=
IADsPathname_Retrieve
(
path
,
ADS_FORMAT_LEAF
,
&
bstr
);
ok
(
hr
==
S_OK
,
"got %#x
\n
"
,
hr
);
todo_wine
ok
(
!
wcscmp
(
bstr
,
L"a=b"
),
"got %s
\n
"
,
wine_dbgstr_w
(
bstr
));
SysFreeString
(
bstr
);
IADsPathname_Release
(
path
);
}
START_TEST
(
activeds
)
{
CoInitialize
(
NULL
);
test_Pathname
();
test_ADsBuildVarArrayStr
();
CoUninitialize
();
}
include/iads.idl
View file @
18631864
...
...
@@ -370,6 +370,29 @@ typedef enum
ADS_SECURITY_INFO_SACL
=
0
x8
}
ADS_SECURITY_INFO_ENUM
;
typedef
enum
{
ADS_SETTYPE_FULL
=
1
,
ADS_SETTYPE_PROVIDER
=
2
,
ADS_SETTYPE_SERVER
=
3
,
ADS_SETTYPE_DN
=
4
}
ADS_SETTYPE_ENUM
;
typedef
enum
{
ADS_FORMAT_WINDOWS
=
1
,
ADS_FORMAT_WINDOWS_NO_SERVER
=
2
,
ADS_FORMAT_WINDOWS_DN
=
3
,
ADS_FORMAT_WINDOWS_PARENT
=
4
,
ADS_FORMAT_X500
=
5
,
ADS_FORMAT_X500_NO_SERVER
=
6
,
ADS_FORMAT_X500_DN
=
7
,
ADS_FORMAT_X500_PARENT
=
8
,
ADS_FORMAT_SERVER
=
9
,
ADS_FORMAT_PROVIDER
=
10
,
ADS_FORMAT_LEAF
=
11
}
ADS_FORMAT_ENUM
;
/*****************************************************************************
*
IADsContainer
interface
*/
...
...
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