[PATCH] storage.dll16: Set OpenStorage/OpenStream output to NULL on failure.

Zebediah Figura z.figura12 at gmail.com
Sat Feb 11 17:40:11 CST 2017


As per MSDN: https://msdn.microsoft.com/en-us/library/windows/desktop/aa380025(v=vs.85).aspx

Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
---
 dlls/storage.dll16/storage.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/dlls/storage.dll16/storage.c b/dlls/storage.dll16/storage.c
index 4c74ba5..405e4db 100644
--- a/dlls/storage.dll16/storage.c
+++ b/dlls/storage.dll16/storage.c
@@ -1871,11 +1871,13 @@ HRESULT CDECL IStorage16_fnOpenStorage(IStorage16 *iface, LPCOLESTR16 pwcsName,
 	newpps = STORAGE_look_for_named_pps(&lpstg->str,This->stde.pps_dir,name);
 	if (newpps==-1) {
 		IStorage16_fnRelease(&lpstg->IStorage16_iface);
+		*ppstg = NULL;
 		return E_FAIL;
 	}
 
 	if (1!=STORAGE_get_pps_entry(&lpstg->str,newpps,&(lpstg->stde))) {
 		IStorage16_fnRelease(&lpstg->IStorage16_iface);
+		*ppstg = NULL;
 		return E_FAIL;
 	}
 	lpstg->ppsent		= newpps;
@@ -1911,11 +1913,13 @@ HRESULT CDECL IStorage16_fnOpenStream(IStorage16 *iface, LPCOLESTR16 pwcsName, v
 	newpps = STORAGE_look_for_named_pps(&lpstr->str,This->stde.pps_dir,name);
 	if (newpps==-1) {
 		IStream16_fnRelease(&lpstr->IStream16_iface);
+		*ppstm = NULL;
 		return E_FAIL;
 	}
 
 	if (1!=STORAGE_get_pps_entry(&lpstr->str,newpps,&(lpstr->stde))) {
 		IStream16_fnRelease(&lpstr->IStream16_iface);
+		*ppstm = NULL;
 		return E_FAIL;
 	}
 	lpstr->offset.u.LowPart		= 0;
-- 
2.7.4




More information about the wine-patches mailing list