From 81887909461d35f5d209f5632c007f0b95855bd0 Mon Sep 17 00:00:00 2001 From: Matthew Mastracci Date: Thu, 5 May 2005 16:44:05 +0000 Subject: [PATCH] Replace StgCreateStorageEx stub with call to StgCreateDocfile and add required STGFMT_* enumerations. --- dlls/ole32/storage32.c | 28 +++++++++++++++++++++++++++- include/objbase.h | 5 +++++ 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/dlls/ole32/storage32.c b/dlls/ole32/storage32.c index 97b651e80b3..388ed4195be 100644 --- a/dlls/ole32/storage32.c +++ b/dlls/ole32/storage32.c @@ -5585,7 +5585,33 @@ HRESULT WINAPI StgCreateStorageEx(const WCHAR* pwcsName, DWORD grfMode, DWORD st { TRACE("(%s, %lx, %lx, %lx, %p, %p, %p, %p)\n", debugstr_w(pwcsName), grfMode, stgfmt, grfAttrs, pStgOptions, reserved, riid, ppObjectOpen); - return STG_E_UNIMPLEMENTEDFUNCTION; + + if (stgfmt != STGFMT_FILE && grfAttrs != 0) + { + ERR("grfAttrs must be 0 if stgfmt != STGFMT_FILE\n"); + return STG_E_INVALIDPARAMETER; + } + + if (stgfmt != STGFMT_FILE && grfAttrs != 0 && grfAttrs != FILE_FLAG_NO_BUFFERING) + { + ERR("grfAttrs must be 0 or FILE_FLAG_NO_BUFFERING if stgfmt == STGFMT_FILE\n"); + return STG_E_INVALIDPARAMETER; + } + + if (stgfmt == STGFMT_FILE) + { + ERR("Cannot use STGFMT_FILE - this is NTFS only\n"); + return STG_E_INVALIDPARAMETER; + } + + if (stgfmt == STGFMT_STORAGE || stgfmt == STGFMT_DOCFILE) + { + FIXME("Stub: calling StgCreateDocfile, but ignoring pStgOptions and grfAttrs\n"); + return StgCreateDocfile(pwcsName, grfMode, 0, (IStorage **)ppObjectOpen); + } + + ERR("Invalid stgfmt argument\n"); + return STG_E_INVALIDPARAMETER; } /****************************************************************************** diff --git a/include/objbase.h b/include/objbase.h index f552dbe7e68..8bad522c58c 100644 --- a/include/objbase.h +++ b/include/objbase.h @@ -463,6 +463,11 @@ HRESULT WINAPI MonikerRelativePathTo(LPMONIKER pmkSrc, LPMONIKER pmkDest, LPMONI #define STGM_NOSNAPSHOT 0x00200000 #define STGM_DIRECT_SWMR 0x00400000 +#define STGFMT_STORAGE 0 +#define STGFMT_FILE 3 +#define STGFMT_ANY 4 +#define STGFMT_DOCFILE 5 + typedef struct tagSTGOPTIONS { USHORT usVersion;