coml2: Move ReadClassStg from ole32.

This commit is contained in:
Fabian Maurer 2023-11-16 05:04:10 +01:00 committed by Alexandre Julliard
parent a72b534dc9
commit fae825276a
3 changed files with 25 additions and 36 deletions

View file

@ -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

View file

@ -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.@)
*/

View file

@ -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.@)
*