Module: wine Branch: master Commit: fae825276a446f72e1d6793df0227076bb87aa92 URL: https://gitlab.winehq.org/wine/wine/-/commit/fae825276a446f72e1d6793df022707...
Author: Fabian Maurer dark.shadow4@web.de Date: Thu Nov 16 05:04:10 2023 +0100
coml2: Move ReadClassStg from ole32.
---
dlls/coml2/coml2.spec | 2 +- dlls/coml2/storage32.c | 24 ++++++++++++++++++++++++ dlls/ole32/storage32.c | 35 ----------------------------------- 3 files changed, 25 insertions(+), 36 deletions(-)
diff --git a/dlls/coml2/coml2.spec b/dlls/coml2/coml2.spec index 9cac5f9d01f..a41482bc46e 100644 --- a/dlls/coml2/coml2.spec +++ b/dlls/coml2/coml2.spec @@ -15,7 +15,7 @@ @ stdcall GetConvertStg(ptr) @ stdcall GetHGlobalFromILockBytes(ptr ptr) @ stub PropStgNameToFmtId -@ stub ReadClassStg +@ stdcall ReadClassStg(ptr ptr) @ stdcall ReadClassStm(ptr ptr) @ stub StgCreateDocfile @ stub StgCreateDocfileOnILockBytes diff --git a/dlls/coml2/storage32.c b/dlls/coml2/storage32.c index 051555566ef..06a58749c5d 100644 --- a/dlls/coml2/storage32.c +++ b/dlls/coml2/storage32.c @@ -50,6 +50,30 @@
WINE_DEFAULT_DEBUG_CHANNEL(storage);
+/*********************************************************************** + * ReadClassStg (coml2.@) + */ +HRESULT WINAPI ReadClassStg(IStorage *pstg, CLSID *pclsid) +{ + STATSTG pstatstg; + HRESULT hRes; + + TRACE("(%p, %p)\n", pstg, pclsid); + + if (!pstg || !pclsid) + return E_INVALIDARG; + + /* + * read a STATSTG structure (contains the clsid) from the storage + */ + hRes = IStorage_Stat(pstg, &pstatstg, STATFLAG_NONAME); + + if (SUCCEEDED(hRes)) + *pclsid = pstatstg.clsid; + + return hRes; +} + /*********************************************************************** * ReadClassStm (coml2.@) */ diff --git a/dlls/ole32/storage32.c b/dlls/ole32/storage32.c index e463400d2bb..33586de5e68 100644 --- a/dlls/ole32/storage32.c +++ b/dlls/ole32/storage32.c @@ -9042,41 +9042,6 @@ HRESULT WINAPI WriteClassStg(IStorage* pStg, REFCLSID rclsid) return IStorage_SetClass(pStg, rclsid); }
-/*********************************************************************** - * ReadClassStg (OLE32.@) - * - * This method reads the CLSID previously written to a storage object with - * the WriteClassStg. - * - * PARAMS - * pstg [I] IStorage pointer - * pclsid [O] Pointer to where the CLSID is written - * - * RETURNS - * Success: S_OK. - * Failure: HRESULT code. - */ -HRESULT WINAPI ReadClassStg(IStorage *pstg,CLSID *pclsid){ - - STATSTG pstatstg; - HRESULT hRes; - - TRACE("(%p, %p)\n", pstg, pclsid); - - if(!pstg || !pclsid) - return E_INVALIDARG; - - /* - * read a STATSTG structure (contains the clsid) from the storage - */ - hRes=IStorage_Stat(pstg,&pstatstg,STATFLAG_NONAME); - - if(SUCCEEDED(hRes)) - *pclsid=pstatstg.clsid; - - return hRes; -} - /*********************************************************************** * OleLoadFromStream (OLE32.@) *