Add iads.idl, adshlp.h headers

Francois Gouget fgouget at free.fr
Sun Sep 25 13:15:17 CDT 2005


Activeds was using LPVOIDs instead of the proper type for some of its 
function prototypes. So I set out to add the proper types.

It turns out they are defined in iads.h which is an midl-generated 
header, although the PSDK does not have a corresponding .idl file. 
Writing the header by hand did not seem to make sense since it was 
clearly midl-generated in the PSDK. So I wrote a .idl file defining the 
one interface I needed: IADsContainer.

Then I added the adshlp.h header which is where the activeds functions 
are supposed to be declared, and while doing so I discovered that the 
ADsOpenObject() prototype was completely wrong (most likely a 
copy/paste error). So I fixed it too.

And finally I updated win32.api to match. So here's the patch.

Changelog:

  * dlls/activeds/activeds.spec
    dlls/activeds/activeds_main.c
    include/Makefile.in
    tools/winapi/win32.api
    include/iads.idl
    include/adshlp.h

    Francois Gouget <fgouget at free.fr>
    Add iads.idl to define the IADsContainer interface.
    Add adshlp.h to declare the ADs* functions.
    Fix the ADsOpenObject() prototype.
    Update win32.api to match.

-- 
Francois Gouget         fgouget at free.fr        http://fgouget.free.fr/
                               145 = 1! + 4! + 5!
-------------- next part --------------
Index: dlls/activeds/activeds.spec
===================================================================
RCS file: /var/cvs/wine/dlls/activeds/activeds.spec,v
retrieving revision 1.1
diff -u -p -r1.1 activeds.spec
--- dlls/activeds/activeds.spec	13 Jun 2005 11:47:46 -0000	1.1
+++ dlls/activeds/activeds.spec	25 Sep 2005 16:47:38 -0000
@@ -4,7 +4,7 @@
 6 stdcall ADsEnumerateNext(ptr long ptr ptr)
 7 stub ADsBuildVarArrayStr
 8 stub ADsBuildVarArrayInt
-9 stdcall ADsOpenObject(wstr ptr ptr)
+9 stdcall ADsOpenObject(wstr wstr wstr long ptr ptr)
 12 stub ADsSetLastError
 13 stub ADsGetLastError
 14 stub AllocADsMem
Index: dlls/activeds/activeds_main.c
===================================================================
RCS file: /var/cvs/wine/dlls/activeds/activeds_main.c,v
retrieving revision 1.2
diff -u -p -r1.2 activeds_main.c
--- dlls/activeds/activeds_main.c	17 Jun 2005 20:56:21 -0000	1.2
+++ dlls/activeds/activeds_main.c	25 Sep 2005 16:40:43 -0000
@@ -33,6 +33,10 @@
 #include "winver.h"
 #include "winnls.h"
 
+#include "objbase.h"
+#include "iads.h"
+#include "adshlp.h"
+
 #include "wine/unicode.h"
 #include "wine/debug.h"
 
@@ -41,7 +45,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(activeds);
 /*****************************************************
  * DllMain
  */
-
 BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
 {
     TRACE("(%p, %ld, %p)\n",hinstDLL, fdwReason, lpvReserved);
@@ -52,8 +55,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, 
 /*****************************************************
  * ADsGetObject     [ACTIVEDS.3]
  */
-
-HRESULT WINAPI ADsGetObject(LPWSTR lpszPathName, REFIID riid, VOID** ppObject)
+HRESULT WINAPI ADsGetObject(LPCWSTR lpszPathName, REFIID riid, VOID** ppObject)
 {
     FIXME("(%s)->(%s,%p)!stub\n",debugstr_w(lpszPathName), debugstr_guid(riid), ppObject);
     return E_NOTIMPL;
@@ -62,9 +64,7 @@ HRESULT WINAPI ADsGetObject(LPWSTR lpszP
 /*****************************************************
  * ADsBuildEnumerator    [ACTIVEDS.4]
  */
-
-/* HRESULT WINAPI ADsBuildEnumerator(IADsContainer * pADsContainer, IEnumVariant ** ppEnumVariant) */
-HRESULT WINAPI ADsBuildEnumerator(LPVOID * pADsContainer, LPVOID ** ppEnumVariant)
+HRESULT WINAPI ADsBuildEnumerator(IADsContainer * pADsContainer, IEnumVARIANT** ppEnumVariant)
 {
     FIXME("(%p)->(%p)!stub\n",pADsContainer, ppEnumVariant);
     return E_NOTIMPL;
@@ -73,9 +73,7 @@ HRESULT WINAPI ADsBuildEnumerator(LPVOID
 /*****************************************************
  * ADsEnumerateNext     [ACTIVEDS.6]
  */
-
-/* HRESULT WINAPI ADsEnumerateNext(IEnumVariant * pEnumVariant, ULONG cElements, VARIANT * pvar, ULONG * pcElementsFetched) */
-HRESULT WINAPI ADsEnumerateNext(LPVOID * pEnumVariant, ULONG cElements, LPVOID * pvar, ULONG * pcElementsFetched)
+HRESULT WINAPI ADsEnumerateNext(IEnumVARIANT* pEnumVariant, ULONG cElements, VARIANT* pvar, ULONG * pcElementsFetched)
 {
     FIXME("(%p)->(%lu, %p, %p)!stub\n",pEnumVariant, cElements, pvar, pcElementsFetched);
     return E_NOTIMPL;
@@ -84,10 +82,10 @@ HRESULT WINAPI ADsEnumerateNext(LPVOID *
 /*****************************************************
  * ADsOpenObject     [ACTIVEDS.9]
  */
-
-HRESULT WINAPI ADsOpenObject(LPWSTR lpszPathName, REFIID riid, VOID** ppObject)
+HRESULT WINAPI ADsOpenObject(LPCWSTR lpszPathName, LPCWSTR lpszUserName, LPCWSTR lpszPassword, DWORD dwReserved, REFIID riid, VOID** ppObject)
 {
-    FIXME("(%s)->(%s,%p)!stub\n",debugstr_w(lpszPathName), debugstr_guid(riid), ppObject);
+    FIXME("(%s,%s,%lu,%p,%p)!stub\n", debugstr_w(lpszPathName),
+          debugstr_w(lpszUserName), dwReserved, debugstr_guid(riid), ppObject);
     return E_NOTIMPL;
 }
 
Index: include/Makefile.in
===================================================================
RCS file: /var/cvs/wine/include/Makefile.in,v
retrieving revision 1.189
diff -u -p -r1.189 Makefile.in
--- include/Makefile.in	23 Sep 2005 17:22:12 -0000	1.189
+++ include/Makefile.in	25 Sep 2005 16:17:00 -0000
@@ -17,7 +17,8 @@ WINDOWS_IDL_SRCS = \
 	downloadmgr.idl \
 	exdisp.idl \
 	hlink.idl \
+	iads.idl \
 	mediaobj.idl \
 	mimeinfo.idl \
 	mlang.idl \
Index: tools/winapi/win32.api
===================================================================
RCS file: /var/cvs/wine/tools/winapi/win32.api,v
retrieving revision 1.46
diff -u -p -r1.46 win32.api
--- tools/winapi/win32.api	9 Sep 2005 09:11:23 -0000	1.46
+++ tools/winapi/win32.api	25 Sep 2005 17:13:51 -0000
@@ -3,22 +3,25 @@
 %long
 
 BOOL
+DWORD
 HRESULT
 ULONG
 
 %ptr
 
+IADsContainer *
+IEnumVARIANT *
+IEnumVARIANT **
 LPVOID
-LPVOID *
-LPVOID **
 REFIID
 ULONG *
+VARIANT *
 VOID **
 
 %wstr
 
-LPWSTR
+LPCWSTR
 
 %%advapi32.dll
 
--- /dev/null	2005-07-04 23:40:04.000000000 +0200
+++ include/iads.idl	2005-09-25 18:25:13.000000000 +0200
@@ -0,0 +1,62 @@
+/*
+ * Copyright 2005 Francois Gouget
+ *
+ * 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+import "oaidl.idl";
+
+
+/*****************************************************************************
+ *    IADsContainer interface
+ */
+[
+    object,
+    uuid(001677d0-fd16-11ce-abc4-02608c9e7553)
+]
+interface IADsContainer: IDispatch
+{
+    [propget] HRESULT Count(
+        [out, retval] long *retval);
+    [propget, restricted] HRESULT _NewEnum(
+        [out, retval] IUnknown **retval);
+    [propget] HRESULT Filter(
+        [out, retval] VARIANT *pvFilter);
+    [propput] HRESULT Filter(
+        [in] VARIANT vFilter);
+    [propget] HRESULT Hints(
+        [out, retval] VARIANT *pvHints);
+    [propput] HRESULT Hints(
+        [in] VARIANT vHints);
+    HRESULT GetObject(
+        [in] BSTR bstrClassName,
+        [in] BSTR bstrRelativeName,
+        [out, retval] IDispatch **ppObject);
+    HRESULT Create(
+        [in] BSTR bstrClassName,
+        [in] BSTR bstrRelativeName,
+        [out, retval] IDispatch **ppObject);
+    HRESULT Delete(
+        [in] BSTR bstrClassName,
+        [in] BSTR bstrRelativeName);
+    HRESULT CopyHere(
+        [in] BSTR bstrSourceName,
+        [in] BSTR bstrNewName,
+        [out, retval] IDispatch **ppObject);
+    HRESULT MoveHere(
+        [in] BSTR bstrSourceName,
+        [in] BSTR bstrNewName,
+        [out, retval] IDispatch **ppObject);
+}
--- /dev/null	2005-07-04 23:40:04.000000000 +0200
+++ include/adshlp.h	2005-09-25 18:37:15.000000000 +0200
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2005 Francois Gouget
+ *
+ * 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#ifndef __WINE_ADSHLP_H
+#define __WINE_ADSHLP_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+HRESULT WINAPI ADsBuildEnumerator(IADsContainer*,IEnumVARIANT**);
+HRESULT WINAPI ADsEnumerateNext(IEnumVARIANT*,ULONG,VARIANT*,ULONG*);
+HRESULT WINAPI ADsGetObject(LPCWSTR,REFIID,VOID**);
+HRESULT WINAPI ADsOpenObject(LPCWSTR,LPCWSTR,LPCWSTR,DWORD,REFIID,VOID**);
+BOOL    WINAPI FreeADsMem(LPVOID);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif


More information about the wine-patches mailing list