From: Dmitry Timoshkov dmitry@baikal.ru
Signed-off-by: Dmitry Timoshkov dmitry@baikal.ru --- dlls/activeds/activeds.idl | 10 +++++++--- dlls/activeds/pathname.c | 23 ++++++++++------------- dlls/activeds/tests/activeds.c | 2 -- include/iads.idl | 11 +++++++++++ 4 files changed, 28 insertions(+), 18 deletions(-)
diff --git a/dlls/activeds/activeds.idl b/dlls/activeds/activeds.idl index 561c47ce0ea..69f85b87172 100644 --- a/dlls/activeds/activeds.idl +++ b/dlls/activeds/activeds.idl @@ -19,9 +19,13 @@ #pragma makedep register
[ + threading(both), helpstring("ADs LDAP Pathname Descriptor Object"), - progid("Pathname"), uuid(080d0d78-f421-11d0-a36e-00c04fb950dc), - threading(both) + progid("Pathname"), + version(1.0) ] -coclass Pathname { interface IADsPathname; } +coclass Pathname +{ + interface IADsPathname; +} diff --git a/dlls/activeds/pathname.c b/dlls/activeds/pathname.c index 8142e47e244..556b0674471 100644 --- a/dlls/activeds/pathname.c +++ b/dlls/activeds/pathname.c @@ -32,19 +32,16 @@
WINE_DEFAULT_DEBUG_CHANNEL(activeds);
-#include "initguid.h" -DEFINE_GUID(CLSID_Pathname,0x080d0d78,0xf421,0x11d0,0xa3,0x6e,0x00,0xc0,0x4f,0xb9,0x50,0xdc); - typedef struct { IADsPathname IADsPathname_iface; LONG ref; BSTR provider, server, dn; -} Pathname; +} ADsPathname;
-static inline Pathname *impl_from_IADsPathname(IADsPathname *iface) +static inline ADsPathname *impl_from_IADsPathname(IADsPathname *iface) { - return CONTAINING_RECORD(iface, Pathname, IADsPathname_iface); + return CONTAINING_RECORD(iface, ADsPathname, IADsPathname_iface); }
static HRESULT WINAPI path_QueryInterface(IADsPathname *iface, REFIID riid, void **obj) @@ -68,13 +65,13 @@ static HRESULT WINAPI path_QueryInterface(IADsPathname *iface, REFIID riid, void
static ULONG WINAPI path_AddRef(IADsPathname *iface) { - Pathname *path = impl_from_IADsPathname(iface); + ADsPathname *path = impl_from_IADsPathname(iface); return InterlockedIncrement(&path->ref); }
static ULONG WINAPI path_Release(IADsPathname *iface) { - Pathname *path = impl_from_IADsPathname(iface); + ADsPathname *path = impl_from_IADsPathname(iface); LONG ref = InterlockedDecrement(&path->ref);
if (!ref) @@ -182,7 +179,7 @@ static HRESULT parse_path(BSTR path, BSTR *provider, BSTR *server, BSTR *dn)
static HRESULT WINAPI path_Set(IADsPathname *iface, BSTR adspath, LONG type) { - Pathname *path = impl_from_IADsPathname(iface); + ADsPathname *path = impl_from_IADsPathname(iface); HRESULT hr; BSTR provider, server, dn;
@@ -239,7 +236,7 @@ static HRESULT WINAPI path_SetDisplayType(IADsPathname *iface, LONG type)
static HRESULT WINAPI path_Retrieve(IADsPathname *iface, LONG type, BSTR *adspath) { - Pathname *path = impl_from_IADsPathname(iface); + ADsPathname *path = impl_from_IADsPathname(iface); int len;
TRACE("%p,%ld,%p\n", iface, type, adspath); @@ -299,7 +296,7 @@ static HRESULT WINAPI path_Retrieve(IADsPathname *iface, LONG type, BSTR *adspat
static HRESULT WINAPI path_GetNumElements(IADsPathname *iface, LONG *count) { - Pathname *path = impl_from_IADsPathname(iface); + ADsPathname *path = impl_from_IADsPathname(iface); WCHAR *p;
TRACE("%p,%p\n", iface, count); @@ -321,7 +318,7 @@ static HRESULT WINAPI path_GetNumElements(IADsPathname *iface, LONG *count)
static HRESULT WINAPI path_GetElement(IADsPathname *iface, LONG index, BSTR *element) { - Pathname *path = impl_from_IADsPathname(iface); + ADsPathname *path = impl_from_IADsPathname(iface); HRESULT hr; WCHAR *p, *end; LONG count; @@ -412,7 +409,7 @@ static const IADsPathnameVtbl IADsPathname_vtbl =
static HRESULT Pathname_create(REFIID riid, void **obj) { - Pathname *path; + ADsPathname *path; HRESULT hr;
path = malloc(sizeof(*path)); diff --git a/dlls/activeds/tests/activeds.c b/dlls/activeds/tests/activeds.c index 024a2153c65..4f2c399b0cf 100644 --- a/dlls/activeds/tests/activeds.c +++ b/dlls/activeds/tests/activeds.c @@ -31,8 +31,6 @@
#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" }; diff --git a/include/iads.idl b/include/iads.idl index 6dfafce3a87..8be96a729b3 100644 --- a/include/iads.idl +++ b/include/iads.idl @@ -903,6 +903,17 @@ interface IADsPathname : IDispatch HRESULT put_EscapedMode(long mode); }
+[ + helpstring("ADs LDAP Pathname Descriptor Object"), + uuid(080d0d78-f421-11d0-a36e-00c04fb950dc), + progid("Pathname"), + version(1.0) +] +coclass Pathname +{ + interface IADsPathname; +} + /***************************************************************************** * IADsADSystemInfo interface */
From: Dmitry Timoshkov dmitry@baikal.ru
Signed-off-by: Dmitry Timoshkov dmitry@baikal.ru --- dlls/adsldp/adsldp.idl | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-)
diff --git a/dlls/adsldp/adsldp.idl b/dlls/adsldp/adsldp.idl index 85190bc6936..2130ef75106 100644 --- a/dlls/adsldp/adsldp.idl +++ b/dlls/adsldp/adsldp.idl @@ -21,24 +21,35 @@ #pragma makedep register
[ + threading(both), helpstring("LDAP Provider Object"), progid("LDAP"), - uuid(228d9a81-c302-11cf-9aa4-00aa004a5691), - threading(both) + uuid(228d9a81-c302-11cf-9aa4-00aa004a5691) ] -coclass LDAP { interface IParseDisplayName; } +coclass LDAP +{ + interface IParseDisplayName; +}
[ + threading(both), helpstring("LDAP Namespace Object"), progid("LDAPNamespace"), uuid(228d9a82-c302-11cf-9aa4-00aa004a5691), - threading(both) ] -coclass ADs { } +coclass ADs +{ + interface IADs; +}
[ + threading(both), helpstring("AD System Info Object"), uuid(50b6327f-afd1-11d2-9cb9-0000f87a369e), - threading(both) + progid("ADSystemInfo"), + version(1.0) ] -coclass ADSystemInfo { } +coclass ADSystemInfo +{ + interface IADsADSystemInfo; +}
From: Dmitry Timoshkov dmitry@baikal.ru
Signed-off-by: Dmitry Timoshkov dmitry@baikal.ru --- include/iads.idl | 64 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+)
diff --git a/include/iads.idl b/include/iads.idl index 8be96a729b3..c7bba43111e 100644 --- a/include/iads.idl +++ b/include/iads.idl @@ -964,4 +964,68 @@ coclass ADSystemInfo interface IADsADSystemInfo; }
+/***************************************************************************** + * IADsDNWithBinary interface + */ +[ + odl, + uuid(7e99c0a2-f935-11d2-ba96-00c04fb6d0d1), + dual, + oleautomation +] +interface IADsDNWithBinary : IDispatch +{ + [id(0x00000002), propget] + HRESULT BinaryValue([out, retval] VARIANT *value); + [id(0x00000002), propput] + HRESULT BinaryValue([in] VARIANT value); + [id(0x00000003), propget] + HRESULT DNString([out, retval] BSTR *value); + [id(0x00000003), propput] + HRESULT DNString([in] BSTR value); +} + +[ + helpstring("ADs DN With Binary Object"), + uuid(7e99c0a3-f935-11d2-ba96-00c04fb6d0d1), + progid("DNWithBinary"), + version(1.0) +] +coclass DNWithBinary +{ + interface IADsDNWithBinary; +} + +/***************************************************************************** + * IADsDNWithString interface + */ +[ + odl, + uuid(370df02e-f934-11d2-ba96-00c04fb6d0d1), + dual, + oleautomation +] +interface IADsDNWithString : IDispatch +{ + [id(0x00000002), propget] + HRESULT StringValue([out, retval] BSTR *value); + [id(0x00000002), propput] + HRESULT StringValue([in] BSTR value); + [id(0x00000003), propget] + HRESULT DNString([out, retval] BSTR *value); + [id(0x00000003), propput] + HRESULT DNString([in] BSTR value); +} + +[ + helpstring("ADs DN With String Object"), + uuid(334857cc-f934-11d2-ba96-00c04fb6d0d1), + progid("DNWithString"), + version(1.0) +] +coclass DNWithString +{ + interface IADsDNWithString; +} + } /* library */
From: Dmitry Timoshkov dmitry@baikal.ru
Signed-off-by: Dmitry Timoshkov dmitry@baikal.ru --- dlls/activeds/Makefile.in | 1 + dlls/activeds/dnwithbinary.c | 189 +++++++++++++++++++++++++++++++++++ dlls/activeds/pathname.c | 5 +- 3 files changed, 194 insertions(+), 1 deletion(-) create mode 100644 dlls/activeds/dnwithbinary.c
diff --git a/dlls/activeds/Makefile.in b/dlls/activeds/Makefile.in index 819f736f988..5f2b3e1ef7c 100644 --- a/dlls/activeds/Makefile.in +++ b/dlls/activeds/Makefile.in @@ -7,4 +7,5 @@ EXTRADLLFLAGS = -Wb,--prefer-native SOURCES = \ activeds.idl \ activeds_main.c \ + dnwithbinary.c \ pathname.c diff --git a/dlls/activeds/dnwithbinary.c b/dlls/activeds/dnwithbinary.c new file mode 100644 index 00000000000..6d482ba6bd2 --- /dev/null +++ b/dlls/activeds/dnwithbinary.c @@ -0,0 +1,189 @@ +/* + * Copyright 2023 Dmitry Timoshkov + * + * This file contains only stubs to get the printui.dll up and running + * activeds.dll is much much more than this + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include <stdarg.h> + +#define COBJMACROS + +#include "windef.h" +#include "winbase.h" +#include "iads.h" +#include "adserr.h" + +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(activeds); + +typedef struct +{ + IADsDNWithBinary IADsDNWithBinary_iface; + LONG ref; + BSTR dn; + VARIANT bin; +} ADsDNWithBinary; + +static inline ADsDNWithBinary *impl_from_IADsDNWithBinary(IADsDNWithBinary *iface) +{ + return CONTAINING_RECORD(iface, ADsDNWithBinary, IADsDNWithBinary_iface); +} + +static HRESULT WINAPI dnb_QueryInterface(IADsDNWithBinary *iface, REFIID riid, void **obj) +{ + TRACE("%p,%s,%p\n", iface, debugstr_guid(riid), obj); + + if (!riid || !obj) return E_INVALIDARG; + + if (IsEqualGUID(riid, &IID_IUnknown) || + IsEqualGUID(riid, &IID_IDispatch) || + IsEqualGUID(riid, &IID_IADsDNWithBinary)) + { + IADsDNWithBinary_AddRef(iface); + *obj = iface; + return S_OK; + } + + FIXME("interface %s is not implemented\n", debugstr_guid(riid)); + return E_NOINTERFACE; +} + +static ULONG WINAPI dnb_AddRef(IADsDNWithBinary *iface) +{ + ADsDNWithBinary *path = impl_from_IADsDNWithBinary(iface); + return InterlockedIncrement(&path->ref); +} + +static ULONG WINAPI dnb_Release(IADsDNWithBinary *iface) +{ + ADsDNWithBinary *dnb = impl_from_IADsDNWithBinary(iface); + LONG ref = InterlockedDecrement(&dnb->ref); + + if (!ref) + { + TRACE("destroying %p\n", iface); + SysFreeString(dnb->dn); + VariantClear(&dnb->bin); + free(dnb); + } + + return ref; +} + +static HRESULT WINAPI dnb_GetTypeInfoCount(IADsDNWithBinary *iface, UINT *count) +{ + FIXME("%p,%p: stub\n", iface, count); + return E_NOTIMPL; +} + +static HRESULT WINAPI dnb_GetTypeInfo(IADsDNWithBinary *iface, UINT index, LCID lcid, ITypeInfo **info) +{ + FIXME("%p,%u,%#lx,%p: stub\n", iface, index, lcid, info); + return E_NOTIMPL; +} + +static HRESULT WINAPI dnb_GetIDsOfNames(IADsDNWithBinary *iface, REFIID riid, LPOLESTR *names, + UINT count, LCID lcid, DISPID *dispid) +{ + FIXME("%p,%s,%p,%u,%lu,%p: stub\n", iface, debugstr_guid(riid), names, count, lcid, dispid); + return E_NOTIMPL; +} + +static HRESULT WINAPI dnb_Invoke(IADsDNWithBinary *iface, DISPID dispid, REFIID riid, LCID lcid, WORD flags, + DISPPARAMS *params, VARIANT *result, EXCEPINFO *excepinfo, UINT *argerr) +{ + FIXME("%p,%ld,%s,%04lx,%04x,%p,%p,%p,%p: stub\n", iface, dispid, debugstr_guid(riid), lcid, flags, + params, result, excepinfo, argerr); + return E_NOTIMPL; +} + +static HRESULT WINAPI dnb_get_BinaryValue(IADsDNWithBinary *iface, VARIANT *value) +{ + ADsDNWithBinary *dnb = impl_from_IADsDNWithBinary(iface); + + TRACE("%p,%p\n", iface, value); + + VariantInit(value); + return VariantCopy(value, &dnb->bin); +} + +static HRESULT WINAPI dnb_put_BinaryValue(IADsDNWithBinary *iface, VARIANT value) +{ + ADsDNWithBinary *dnb = impl_from_IADsDNWithBinary(iface); + + TRACE("%p,%s\n", iface, wine_dbgstr_variant(&value)); + + VariantClear(&dnb->bin); + return VariantCopy(&dnb->bin, &value); +} + +static HRESULT WINAPI dnb_get_DNString(IADsDNWithBinary *iface, BSTR *value) +{ + ADsDNWithBinary *dnb = impl_from_IADsDNWithBinary(iface); + + TRACE("%p,%p\n", iface, value); + + *value = SysAllocString(dnb->dn); + return *value ? S_OK : E_OUTOFMEMORY; +} + +static HRESULT WINAPI dnb_put_DNString(IADsDNWithBinary *iface, BSTR value) +{ + ADsDNWithBinary *dnb = impl_from_IADsDNWithBinary(iface); + + TRACE("%p,%s\n", iface, debugstr_w(value)); + + SysFreeString(dnb->dn); + dnb->dn = SysAllocString(value); + return dnb->dn ? S_OK : E_OUTOFMEMORY; +} + +static const IADsDNWithBinaryVtbl IADsDNWithBinary_vtbl = +{ + dnb_QueryInterface, + dnb_AddRef, + dnb_Release, + dnb_GetTypeInfoCount, + dnb_GetTypeInfo, + dnb_GetIDsOfNames, + dnb_Invoke, + dnb_get_BinaryValue, + dnb_put_BinaryValue, + dnb_get_DNString, + dnb_put_DNString +}; + +HRESULT ADsDNWithBinary_create(REFIID riid, void **obj) +{ + ADsDNWithBinary *dnb; + HRESULT hr; + + dnb = malloc(sizeof(*dnb)); + if (!dnb) return E_OUTOFMEMORY; + + dnb->IADsDNWithBinary_iface.lpVtbl = &IADsDNWithBinary_vtbl; + dnb->ref = 1; + dnb->dn = NULL; + VariantInit(&dnb->bin); + + hr = IADsDNWithBinary_QueryInterface(&dnb->IADsDNWithBinary_iface, riid, obj); + IADsDNWithBinary_Release(&dnb->IADsDNWithBinary_iface); + + return hr; +} diff --git a/dlls/activeds/pathname.c b/dlls/activeds/pathname.c index 556b0674471..ba32609b599 100644 --- a/dlls/activeds/pathname.c +++ b/dlls/activeds/pathname.c @@ -427,13 +427,16 @@ static HRESULT Pathname_create(REFIID riid, void **obj) return hr; }
+HRESULT ADsDNWithBinary_create(REFIID riid, void **obj); + static const struct class_info { const CLSID *clsid; HRESULT (*constructor)(REFIID, void **); } class_info[] = { - { &CLSID_Pathname, Pathname_create } + { &CLSID_Pathname, Pathname_create }, + { &CLSID_DNWithBinary, ADsDNWithBinary_create } };
typedef struct