[PATCH 2/2] adsldp: Add IDirectoryObject stubs.

Dmitry Timoshkov dmitry at baikal.ru
Wed Apr 1 05:18:39 CDT 2020


Signed-off-by: Dmitry Timoshkov <dmitry at baikal.ru>
---
 dlls/adsldp/adsldp.c | 89 ++++++++++++++++++++++++++++++++++++++++++++
 include/iads.idl     | 35 +++++++++++++++++
 2 files changed, 124 insertions(+)

diff --git a/dlls/adsldp/adsldp.c b/dlls/adsldp/adsldp.c
index c4557667cc..9a3ac63407 100644
--- a/dlls/adsldp/adsldp.c
+++ b/dlls/adsldp/adsldp.c
@@ -383,6 +383,7 @@ typedef struct
     IADs IADs_iface;
     IADsOpenDSObject IADsOpenDSObject_iface;
     IDirectorySearch IDirectorySearch_iface;
+    IDirectoryObject IDirectoryObject_iface;
     LONG ref;
     LDAP *ld;
     BSTR host;
@@ -445,6 +446,13 @@ static HRESULT WINAPI ldapns_QueryInterface(IADs *iface, REFIID riid, void **obj
         return S_OK;
     }
 
+    if (IsEqualGUID(riid, &IID_IDirectoryObject))
+    {
+        IADs_AddRef(iface);
+        *obj = &ldap->IDirectoryObject_iface;
+        return S_OK;
+    }
+
     FIXME("interface %s is not implemented\n", debugstr_guid(riid));
     return E_NOINTERFACE;
 }
@@ -1558,6 +1566,86 @@ static const IDirectorySearchVtbl IDirectorySearch_vtbl =
     search_CloseSearchHandle
 };
 
+static inline LDAP_namespace *impl_from_IDirectoryObject(IDirectoryObject *iface)
+{
+    return CONTAINING_RECORD(iface, LDAP_namespace, IDirectoryObject_iface);
+}
+
+static HRESULT WINAPI dirobj_QueryInterface(IDirectoryObject *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_IDirectoryObject) ||
+        IsEqualGUID(riid, &IID_IUnknown))
+    {
+        IDirectoryObject_AddRef(iface);
+        *obj = iface;
+        return S_OK;
+    }
+
+    FIXME("interface %s is not implemented\n", debugstr_guid(riid));
+    return E_NOINTERFACE;
+}
+
+static ULONG WINAPI dirobj_AddRef(IDirectoryObject *iface)
+{
+    LDAP_namespace *ldap = impl_from_IDirectoryObject(iface);
+    return IADs_AddRef(&ldap->IADs_iface);
+}
+
+static ULONG WINAPI dirobj_Release(IDirectoryObject *iface)
+{
+    LDAP_namespace *ldap = impl_from_IDirectoryObject(iface);
+    return IADs_Release(&ldap->IADs_iface);
+}
+
+static HRESULT WINAPI dirobj_GetObjectInformation(IDirectoryObject *iface, PADS_OBJECT_INFO *info)
+{
+    FIXME("%p,%p: stub\n", iface, info);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI dirobj_GetObjectAttributes(IDirectoryObject *iface, LPWSTR *names,
+                                                 DWORD count, PADS_ATTR_INFO *attrs, DWORD *count_returned)
+{
+    FIXME("%p,%p,%u,%p,%p: stub\n", iface, names, count, attrs, count_returned);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI dirobj_SetObjectAttributes(IDirectoryObject *iface, PADS_ATTR_INFO attrs,
+                                                 DWORD count, DWORD *count_set)
+{
+    FIXME("%p,%p,%u,%p: stub\n", iface, attrs, count, count_set);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI dirobj_CreateDSObject(IDirectoryObject *iface, LPWSTR name,
+                                            PADS_ATTR_INFO attrs, DWORD count, IDispatch **obj)
+{
+    FIXME("%p,%s,%p,%u,%p: stub\n", iface, debugstr_w(name), attrs, count, obj);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI dirobj_DeleteDSObject(IDirectoryObject *iface, LPWSTR name)
+{
+    FIXME("%p,%s: stub\n", iface, debugstr_w(name));
+    return E_NOTIMPL;
+}
+
+static const IDirectoryObjectVtbl IDirectoryObject_vtbl =
+{
+    dirobj_QueryInterface,
+    dirobj_AddRef,
+    dirobj_Release,
+    dirobj_GetObjectInformation,
+    dirobj_GetObjectAttributes,
+    dirobj_SetObjectAttributes,
+    dirobj_CreateDSObject,
+    dirobj_DeleteDSObject
+};
+
 static HRESULT LDAPNamespace_create(REFIID riid, void **obj)
 {
     LDAP_namespace *ldap;
@@ -1569,6 +1657,7 @@ static HRESULT LDAPNamespace_create(REFIID riid, void **obj)
     ldap->IADs_iface.lpVtbl = &IADs_vtbl;
     ldap->IADsOpenDSObject_iface.lpVtbl = &IADsOpenDSObject_vtbl;
     ldap->IDirectorySearch_iface.lpVtbl = &IDirectorySearch_vtbl;
+    ldap->IDirectoryObject_iface.lpVtbl = &IDirectoryObject_vtbl;
     ldap->ref = 1;
     ldap->ld = NULL;
     ldap->host = NULL;
diff --git a/include/iads.idl b/include/iads.idl
index c9d1687524..b04ed0846a 100644
--- a/include/iads.idl
+++ b/include/iads.idl
@@ -344,6 +344,24 @@ typedef struct ads_search_column
     HANDLE hReserved;
 } ADS_SEARCH_COLUMN, *PADS_SEARCH_COLUMN;
 
+typedef struct _ads_object_info
+{
+    LPWSTR pszRDN;
+    LPWSTR pszObjectDN;
+    LPWSTR pszParentDN;
+    LPWSTR pszSchemaDN;
+    LPWSTR pszClassName;
+} ADS_OBJECT_INFO, *PADS_OBJECT_INFO;
+
+typedef struct _ads_attr_info
+{
+    LPWSTR pszAttrName;
+    DWORD dwControlCode;
+    ADSTYPE dwADsType;
+    PADSVALUE pADsValues;
+    DWORD dwNumValues;
+} ADS_ATTR_INFO, *PADS_ATTR_INFO;
+
 /*****************************************************************************
  *    IADsContainer interface
  */
@@ -799,6 +817,23 @@ interface IDirectorySearch : IUnknown
     HRESULT CloseSearchHandle([in] ADS_SEARCH_HANDLE hSearchResult);
 }
 
+/*****************************************************************************
+ *    IDirectoryObject interface
+ */
+[
+    odl,
+    local,
+    uuid(e798de2c-22e4-11d0-84fe-00c04fd8d503)
+]
+interface IDirectoryObject : IUnknown
+{
+    HRESULT GetObjectInformation(PADS_OBJECT_INFO *info);
+    HRESULT GetObjectAttributes(LPWSTR *names, DWORD count, PADS_ATTR_INFO *attrs, DWORD *count_returned);
+    HRESULT SetObjectAttributes(PADS_ATTR_INFO attrs, DWORD count, DWORD *count_set);
+    HRESULT CreateDSObject(LPWSTR name, PADS_ATTR_INFO attrs, DWORD count, IDispatch **obj);
+    HRESULT DeleteDSObject(LPWSTR name);
+}
+
 /*****************************************************************************
  *    IID_IADsOpenDSObject interface
  */
-- 
2.25.1




More information about the wine-devel mailing list