IStorage* vs. LPSTORAGE vs. winapi_check

Francois Gouget fgouget at free.fr
Tue Aug 16 09:33:36 CDT 2005


I checked the prototypes of OleDoAutoConvert() and GetConvertStg() and 
they use LPSTORAGE rather than IStorage* so I think the 16bit versions 
should match. This would avoid introducing ISTorage* in win16.api.

However one could probably also argue that these functions (which are 
currently just stubs) should take a SEGPTR anyway...

This brings me to OleLoad16() and ReadClassStg16() which were causing 
winapi_check to complain because they have comments in their prototypes 
that look like documentation to it. I think the right way to handle 
those is use the regular documentation to document the real type of 
these pointers, i.e. do it as follows:


/***********************************************************************
  *    ReadClassStg (OLE2.18)
  *
  * This method reads the CLSID previously written to a storage object with
  * the WriteClassStg.
  *
  * PARAMS
  *  pstg Segmented LPSTORAGE pointer.
  */
HRESULT WINAPI ReadClassStg16(SEGPTR pstg, CLSID *pclsid)


So here's a patch for this.


Changelog:

  * dlls/ole32/ole2.c
    dlls/ole32/ole2_16.c
    dlls/ole32/storage.c
    tools/winapi/win16.api

    Francois Gouget <fgouget at free.fr>
    Use LPSTORAGE to better match the PSDK.
    Document the real SEGPTR type using the standard documentation 
mechanisms. Fixes winapi_check warnings.

-- 
Francois Gouget         fgouget at free.fr        http://fgouget.free.fr/
   Good judgment comes from experience, and experience comes from bad judgment
                                -- Barry LePatner
-------------- next part --------------
Index: dlls/ole32/ole2.c
===================================================================
RCS file: /var/cvs/wine/dlls/ole32/ole2.c,v
retrieving revision 1.72
diff -u -p -r1.72 ole2.c
--- dlls/ole32/ole2.c	10 Aug 2005 09:53:47 -0000	1.72
+++ dlls/ole32/ole2.c	10 Aug 2005 10:06:53 -0000
@@ -2322,7 +2322,7 @@ done:
 /******************************************************************************
  *              OleDoAutoConvert        [OLE32.@]
  */
-HRESULT WINAPI OleDoAutoConvert(IStorage *pStg, LPCLSID pClsidNew)
+HRESULT WINAPI OleDoAutoConvert(LPSTORAGE pStg, LPCLSID pClsidNew)
 {
     FIXME("(%p,%p) : stub\n",pStg,pClsidNew);
     return E_NOTIMPL;
@@ -2331,7 +2331,7 @@ HRESULT WINAPI OleDoAutoConvert(IStorage
 /******************************************************************************
  *              OleDoAutoConvert        [OLE2.79]
  */
-HRESULT WINAPI OleDoAutoConvert16(IStorage *pStg, LPCLSID pClsidNew)
+HRESULT WINAPI OleDoAutoConvert16(LPSTORAGE pStg, LPCLSID pClsidNew)
 {
     FIXME("(%p,%p) : stub\n",pStg,pClsidNew);
     return E_NOTIMPL;
Index: dlls/ole32/ole2_16.c
===================================================================
RCS file: /var/cvs/wine/dlls/ole32/ole2_16.c,v
retrieving revision 1.8
diff -u -p -r1.8 ole2_16.c
--- dlls/ole32/ole2_16.c	15 Aug 2005 09:46:51 -0000	1.8
+++ dlls/ole32/ole2_16.c	16 Aug 2005 09:05:24 -0000
@@ -195,12 +195,16 @@ BOOL WINAPI IsValidInterface16(SEGPTR pu
 
 /******************************************************************************
  *              OleLoad        [OLE2.12]
+ *
+ * PARAMS
+ *  pStg Segmented LPSTORAGE pointer.
+ *  pClientSite Segmented LPOLECLIENTSITE pointer.
  */
 HRESULT WINAPI OleLoad16(
-  /*LPSTORAGE16*/	SEGPTR		pStg,
-  REFIID            			riid,
-  /*LPOLECLIENTSITE16*/	SEGPTR		pClientSite,
-  LPVOID*				ppvObj)
+    SEGPTR		pStg,
+    REFIID            	riid,
+    SEGPTR		pClientSite,
+    LPVOID*		ppvObj)
 {
   FIXME("(%lx,%s,%lx,%p), stub!\n", pStg, debugstr_guid(riid), pClientSite, ppvObj);
   return E_NOTIMPL;
Index: dlls/ole32/storage.c
===================================================================
RCS file: /var/cvs/wine/dlls/ole32/storage.c,v
retrieving revision 1.50
diff -u -p -r1.50 storage.c
--- dlls/ole32/storage.c	10 Aug 2005 10:59:20 -0000	1.50
+++ dlls/ole32/storage.c	16 Aug 2005 11:39:23 -0000
@@ -2223,9 +2223,14 @@ HRESULT WINAPI StgOpenStorageOnILockByte
 /***********************************************************************
  *    ReadClassStg (OLE2.18)
  *
- * This method reads the CLSID previously written to a storage object with the WriteClassStg.
+ * This method reads the CLSID previously written to a storage object with
+ * the WriteClassStg.
+ *
+ * PARAMS
+ *  pstg Segmented LPSTORAGE pointer.
  */
-HRESULT WINAPI ReadClassStg16(SEGPTR /*IStorage **/pstg,CLSID *pclsid){
+HRESULT WINAPI ReadClassStg16(SEGPTR pstg, CLSID *pclsid)
+{
 	STATSTG16 statstg;
 	HANDLE16 hstatstg;
 	HRESULT	hres;
@@ -2268,7 +2273,7 @@ HRESULT WINAPI ReadClassStg16(SEGPTR /*I
 /***********************************************************************
  *              GetConvertStg (OLE2.82)
  */
-HRESULT WINAPI GetConvertStg16(IStorage *stg) {
+HRESULT WINAPI GetConvertStg16(LPSTORAGE stg) {
     FIXME("unimplemented stub!\n");
     return E_FAIL;
 }
Index: tools/winapi/win16.api
===================================================================
RCS file: /var/cvs/wine/tools/winapi/win16.api,v
retrieving revision 1.17
diff -u -p -r1.17 win16.api
--- tools/winapi/win16.api	10 Aug 2005 09:48:43 -0000	1.17
+++ tools/winapi/win16.api	10 Aug 2005 10:08:49 -0000
@@ -762,7 +763,6 @@ CLSID *
 IDataObject *
 IDataObject **
 ILockBytes16 *
-IStorage *
 LPCLSID
 LPDROPTARGET
 LPLOCKBYTES16 *
@@ -770,6 +770,7 @@ LPMONIKER *
 LPOLEINPLACEACTIVEOBJECT
 LPOLEINPLACEFRAME
 LPRUNNINGOBJECTTABLE *
+LPSTORAGE
 LPVOID
 LPVOID *
 REFIID


More information about the wine-patches mailing list