From c2330178eba94ea96db8a1bb03f2a34cc93290b5 Mon Sep 17 00:00:00 2001 From: Dan Kegel Date: Sat, 3 Nov 2007 16:46:46 -0700 Subject: [PATCH] cabinet: FCIAddFile: Set defaults in case callback doesn't set some fields. --- dlls/cabinet/fci.c | 4 ++++ dlls/cabinet/tests/fdi.c | 3 +++ 2 files changed, 7 insertions(+) diff --git a/dlls/cabinet/fci.c b/dlls/cabinet/fci.c index b5e6c9c23f6..34ab2307209 100644 --- a/dlls/cabinet/fci.c +++ b/dlls/cabinet/fci.c @@ -2416,6 +2416,10 @@ BOOL __cdecl FCIAddFile( } /* get information about the file */ + /* set defaults in case callback doesn't set one or more fields */ + cffile.attribs=0; + cffile.date=0; + cffile.time=0; file_handle=(*pfnfcigoi)(pszSourceFile, &(cffile.date), &(cffile.time), &(cffile.attribs), &err, p_fci_internal->pv); /* check file_handle */ diff --git a/dlls/cabinet/tests/fdi.c b/dlls/cabinet/tests/fdi.c index d3b252c6c30..7c10b3d1663 100644 --- a/dlls/cabinet/tests/fdi.c +++ b/dlls/cabinet/tests/fdi.c @@ -436,6 +436,9 @@ static INT_PTR get_open_info(char *pszName, USHORT *pdate, USHORT *ptime, attrs = GetFileAttributes(pszName); ok(attrs != INVALID_FILE_ATTRIBUTES, "Failed to GetFileAttributes\n"); + /* fixme: should convert attrs to *pattribs, make sure + * have a test that catches the fact that we don't? + */ return (INT_PTR)handle; }