1
0
Fork 0
mirror of synced 2025-03-07 03:53:26 +01:00

coml2: Move StgIsStorageILockBytes from ole32.

This commit is contained in:
Fabian Maurer 2023-12-03 23:15:08 +01:00 committed by Alexandre Julliard
parent 5a0321ac8c
commit eab7899eb5
3 changed files with 23 additions and 23 deletions

View file

@ -23,7 +23,7 @@
@ stub StgCreatePropStg
@ stub StgCreateStorageEx
@ stub StgIsStorageFile
@ stub StgIsStorageILockBytes
@ stdcall StgIsStorageILockBytes(ptr)
@ stub StgOpenPropStg
@ stub StgOpenStorage
@ stub StgOpenStorageEx

View file

@ -50,6 +50,8 @@
WINE_DEFAULT_DEBUG_CHANNEL(storage);
static const BYTE STORAGE_magic[8] ={0xd0,0xcf,0x11,0xe0,0xa1,0xb1,0x1a,0xe1};
/***********************************************************************
* WriteClassStg [coml2.@]
*/
@ -162,3 +164,23 @@ HRESULT WINAPI GetConvertStg(IStorage *stg)
return header[1] & OleStream_Convert ? S_OK : S_FALSE;
}
/******************************************************************************
* StgIsStorageILockBytes [coml2.@]
*/
HRESULT WINAPI StgIsStorageILockBytes(ILockBytes *plkbyt)
{
BYTE sig[sizeof(STORAGE_magic)];
ULARGE_INTEGER offset;
ULONG read = 0;
offset.HighPart = 0;
offset.LowPart = 0;
ILockBytes_ReadAt(plkbyt, offset, sig, sizeof(sig), &read);
if (read == sizeof(sig) && memcmp(sig, STORAGE_magic, sizeof(sig)) == 0)
return S_OK;
return S_FALSE;
}

View file

@ -9004,28 +9004,6 @@ HRESULT WINAPI StgSetTimes(OLECHAR const *str, FILETIME const *pctime,
return r;
}
/******************************************************************************
* StgIsStorageILockBytes [OLE32.@]
*
* Determines if the ILockBytes contains a storage object.
*/
HRESULT WINAPI StgIsStorageILockBytes(ILockBytes *plkbyt)
{
BYTE sig[sizeof(STORAGE_magic)];
ULARGE_INTEGER offset;
ULONG read = 0;
offset.HighPart = 0;
offset.LowPart = 0;
ILockBytes_ReadAt(plkbyt, offset, sig, sizeof(sig), &read);
if (read == sizeof(sig) && memcmp(sig, STORAGE_magic, sizeof(sig)) == 0)
return S_OK;
return S_FALSE;
}
/***********************************************************************
* OleLoadFromStream (OLE32.@)
*