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
af0d9236
Commit
af0d9236
authored
Feb 11, 2020
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Feb 12, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
activeds: Implement ADsOpenObject.
Signed-off-by:
Dmitry Timoshkov
<
dmitry@baikal.ru
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
b4e2ece8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
91 additions
and
4 deletions
+91
-4
Makefile.in
dlls/activeds/Makefile.in
+1
-0
activeds_main.c
dlls/activeds/activeds_main.c
+76
-4
iads.idl
include/iads.idl
+14
-0
No files found.
dlls/activeds/Makefile.in
View file @
af0d9236
MODULE
=
activeds.dll
IMPORTLIB
=
activeds
IMPORTS
=
advapi32 ole32 oleaut32
EXTRADLLFLAGS
=
-mno-cygwin
...
...
dlls/activeds/activeds_main.c
View file @
af0d9236
...
...
@@ -2,6 +2,7 @@
* Implementation of the Active Directory Service Interface
*
* Copyright 2005 Detlef Riekenberg
* Copyright 2019 Dmitry Timoshkov
*
* This file contains only stubs to get the printui.dll up and running
* activeds.dll is much much more than this
...
...
@@ -30,8 +31,10 @@
#include "winuser.h"
#include "objbase.h"
#include "initguid.h"
#include "iads.h"
#include "adshlp.h"
#include "adserr.h"
#include "wine/debug.h"
...
...
@@ -112,11 +115,80 @@ HRESULT WINAPI ADsBuildVarArrayInt(LPDWORD lpdwObjectTypes, DWORD dwObjectTypes,
/*****************************************************
* ADsOpenObject [ACTIVEDS.9]
*/
HRESULT
WINAPI
ADsOpenObject
(
LPCWSTR
lpszPathName
,
LPCWSTR
lpszUserName
,
LPCWSTR
lpszPassword
,
DWORD
dwReserved
,
REFIID
riid
,
VOID
**
ppObject
)
HRESULT
WINAPI
ADsOpenObject
(
LPCWSTR
path
,
LPCWSTR
user
,
LPCWSTR
password
,
DWORD
reserved
,
REFIID
riid
,
void
**
obj
)
{
FIXME
(
"(%s,%s,%u,%s,%p)!stub
\n
"
,
debugstr_w
(
lpszPathName
),
debugstr_w
(
lpszUserName
),
dwReserved
,
debugstr_guid
(
riid
),
ppObject
);
return
E_NOTIMPL
;
HRESULT
hr
;
HKEY
hkey
,
hprov
;
WCHAR
provider
[
MAX_PATH
],
progid
[
MAX_PATH
];
DWORD
idx
=
0
;
TRACE
(
"(%s,%s,%u,%s,%p)
\n
"
,
debugstr_w
(
path
),
debugstr_w
(
user
),
reserved
,
debugstr_guid
(
riid
),
obj
);
if
(
!
path
||
!
riid
||
!
obj
)
return
E_INVALIDARG
;
if
(
RegOpenKeyExW
(
HKEY_LOCAL_MACHINE
,
L"Software
\\
Microsoft
\\
ADs
\\
Providers"
,
0
,
KEY_READ
,
&
hkey
))
return
E_ADS_BAD_PATHNAME
;
hr
=
E_ADS_BAD_PATHNAME
;
for
(;;)
{
if
(
RegEnumKeyW
(
hkey
,
idx
++
,
provider
,
ARRAY_SIZE
(
provider
)))
break
;
TRACE
(
"provider %s
\n
"
,
debugstr_w
(
provider
));
if
(
!
wcsnicmp
(
path
,
provider
,
wcslen
(
provider
))
&&
path
[
wcslen
(
provider
)]
==
':'
)
{
LONG
size
;
if
(
RegOpenKeyExW
(
hkey
,
provider
,
0
,
KEY_READ
,
&
hprov
))
break
;
size
=
ARRAY_SIZE
(
progid
);
if
(
!
RegQueryValueW
(
hprov
,
NULL
,
progid
,
&
size
))
{
CLSID
clsid
;
if
(
CLSIDFromProgID
(
progid
,
&
clsid
)
==
S_OK
)
{
IADsOpenDSObject
*
adsopen
;
IDispatch
*
disp
;
TRACE
(
"ns %s => clsid %s
\n
"
,
debugstr_w
(
progid
),
wine_dbgstr_guid
(
&
clsid
));
if
(
CoCreateInstance
(
&
clsid
,
0
,
CLSCTX_INPROC_SERVER
,
&
IID_IADsOpenDSObject
,
(
void
**
)
&
adsopen
)
==
S_OK
)
{
BSTR
bpath
,
buser
,
bpassword
;
bpath
=
SysAllocString
(
path
);
buser
=
SysAllocString
(
user
);
bpassword
=
SysAllocString
(
password
);
hr
=
IADsOpenDSObject_OpenDSObject
(
adsopen
,
bpath
,
buser
,
bpassword
,
reserved
,
&
disp
);
if
(
hr
==
S_OK
)
{
hr
=
IDispatch_QueryInterface
(
disp
,
riid
,
obj
);
IDispatch_Release
(
disp
);
}
SysFreeString
(
bpath
);
SysFreeString
(
buser
);
SysFreeString
(
bpassword
);
IADsOpenDSObject_Release
(
adsopen
);
}
}
}
RegCloseKey
(
hprov
);
break
;
}
}
RegCloseKey
(
hkey
);
return
hr
;
}
/*****************************************************
...
...
include/iads.idl
View file @
af0d9236
...
...
@@ -795,6 +795,20 @@ interface IDirectorySearch : IUnknown
}
/*****************************************************************************
*
IID_IADsOpenDSObject
interface
*/
[
odl
,
uuid
(
ddf2891e
-
0
f9c
-
11
d0
-
8
ad4
-
00
c04fd8d503
),
dual
,
oleautomation
]
interface
IADsOpenDSObject
:
IDispatch
{
HRESULT
OpenDSObject
(
[
in
]
BSTR
path
,
[
in
]
BSTR
user
,
[
in
]
BSTR
password
,
[
in
]
long
reserved
,
[
out
,
retval
]
IDispatch
**
obj
)
;
}
/*****************************************************************************
*
IADsADSystemInfo
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