Commit a72b534d authored by Fabian Maurer's avatar Fabian Maurer Committed by Alexandre Julliard

coml2: Move ReadClassStm from ole32.

parent c6f049fc
......@@ -16,7 +16,7 @@
@ stdcall GetHGlobalFromILockBytes(ptr ptr)
@ stub PropStgNameToFmtId
@ stub ReadClassStg
@ stub ReadClassStm
@ stdcall ReadClassStm(ptr ptr)
@ stub StgCreateDocfile
@ stub StgCreateDocfileOnILockBytes
@ stub StgCreatePropSetStg
......
......@@ -50,6 +50,33 @@
WINE_DEFAULT_DEBUG_CHANNEL(storage);
/***********************************************************************
* ReadClassStm (coml2.@)
*/
HRESULT WINAPI ReadClassStm(IStream *pStm, CLSID *pclsid)
{
ULONG nbByte;
HRESULT res;
TRACE("(%p,%p)\n", pStm, pclsid);
if (!pStm || !pclsid)
return E_INVALIDARG;
/* clear the output args */
*pclsid = CLSID_NULL;
res = IStream_Read(pStm, pclsid, sizeof(CLSID), &nbByte);
if (FAILED(res))
return res;
if (nbByte != sizeof(CLSID))
return STG_E_READFAULT;
else
return S_OK;
}
enum stream_1ole_flags {
OleStream_LinkedObject = 0x00000001,
OleStream_Convert = 0x00000004
......
......@@ -9484,44 +9484,6 @@ HRESULT WINAPI WriteClassStm(IStream *pStm,REFCLSID rclsid)
return IStream_Write(pStm,rclsid,sizeof(CLSID),NULL);
}
/***********************************************************************
* ReadClassStm (OLE32.@)
*
* Reads a CLSID from a stream.
*
* PARAMS
* pStm [I] Stream to read from.
* rclsid [O] CLSID to read.
*
* RETURNS
* Success: S_OK.
* Failure: HRESULT code.
*/
HRESULT WINAPI ReadClassStm(IStream *pStm,CLSID *pclsid)
{
ULONG nbByte;
HRESULT res;
TRACE("(%p,%p)\n",pStm,pclsid);
if (!pStm || !pclsid)
return E_INVALIDARG;
/* clear the output args */
*pclsid = CLSID_NULL;
res = IStream_Read(pStm, pclsid, sizeof(CLSID), &nbByte);
if (FAILED(res))
return res;
if (nbByte != sizeof(CLSID))
return STG_E_READFAULT;
else
return S_OK;
}
/************************************************************************
* OleConvert Functions
***********************************************************************/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment