From: Fabian Maurer dark.shadow4@web.de
--- dlls/coml2/coml2.spec | 2 +- dlls/coml2/storage32.c | 22 ++++++++++++++++++++++ dlls/ole32/storage32.c | 22 ---------------------- 3 files changed, 23 insertions(+), 23 deletions(-)
diff --git a/dlls/coml2/coml2.spec b/dlls/coml2/coml2.spec index 9f20fdd525b..d6b24669f22 100644 --- a/dlls/coml2/coml2.spec +++ b/dlls/coml2/coml2.spec @@ -23,7 +23,7 @@ @ stub StgCreatePropStg @ stub StgCreateStorageEx @ stub StgIsStorageFile -@ stub StgIsStorageILockBytes +@ stdcall StgIsStorageILockBytes(ptr) @ stub StgOpenPropStg @ stub StgOpenStorage @ stub StgOpenStorageEx diff --git a/dlls/coml2/storage32.c b/dlls/coml2/storage32.c index 8ce9f68524f..873e9fea0e1 100644 --- a/dlls/coml2/storage32.c +++ b/dlls/coml2/storage32.c @@ -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; +} diff --git a/dlls/ole32/storage32.c b/dlls/ole32/storage32.c index 3335186ff90..496159773a3 100644 --- a/dlls/ole32/storage32.c +++ b/dlls/ole32/storage32.c @@ -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.@) *