From 42057b458d58f3ad09e619c99765e0924c000a44 Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Sun, 26 Feb 2017 16:00:58 +0000 Subject: [PATCH] [CABINET] Sync with Wine Staging 2.2. CORE-12823 a663fe94 cabinet: Set index of folder in FDICopy callback. 1f7d144 cabinet: Make Extract fail on read-only files. af86bdc cabinet: Make Extract overwrite existing files. 3273dff cabinet: Properly initialize internal fci structure (Valgrind). svn path=/trunk/; revision=73929 --- reactos/dll/win32/cabinet/cabinet_main.c | 6 ++---- reactos/dll/win32/cabinet/fci.c | 19 +------------------ reactos/media/doc/README.WINE | 2 +- 3 files changed, 4 insertions(+), 23 deletions(-) diff --git a/reactos/dll/win32/cabinet/cabinet_main.c b/reactos/dll/win32/cabinet/cabinet_main.c index c9ed96f1b1a..a329e4d8de0 100644 --- a/reactos/dll/win32/cabinet/cabinet_main.c +++ b/reactos/dll/win32/cabinet/cabinet_main.c @@ -237,11 +237,9 @@ static INT_PTR CDECL fdi_notify_extract(FDINOTIFICATIONTYPE fdint, PFDINOTIFICAT } hFile = CreateFileA(szFullPath, GENERIC_READ | GENERIC_WRITE, 0, NULL, - CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL); + CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); - if (hFile == INVALID_HANDLE_VALUE) - hFile = 0; - else if (node) + if (hFile != INVALID_HANDLE_VALUE && node) node->DoExtract = FALSE; } diff --git a/reactos/dll/win32/cabinet/fci.c b/reactos/dll/win32/cabinet/fci.c index 8139dcd807d..9930f08c386 100644 --- a/reactos/dll/win32/cabinet/fci.c +++ b/reactos/dll/win32/cabinet/fci.c @@ -1024,6 +1024,7 @@ HFCI __cdecl FCICreate( return NULL; } + memset(p_fci_internal, 0, sizeof(FCI_Int)); p_fci_internal->magic = FCI_INT_MAGIC; p_fci_internal->perf = perf; p_fci_internal->fileplaced = pfnfiledest; @@ -1038,26 +1039,8 @@ HFCI __cdecl FCICreate( p_fci_internal->gettemp = pfnfcigtf; p_fci_internal->ccab = *pccab; p_fci_internal->pccab = pccab; - p_fci_internal->fPrevCab = FALSE; - p_fci_internal->fNextCab = FALSE; - p_fci_internal->fSplitFolder = FALSE; - p_fci_internal->fGetNextCabInVain = FALSE; p_fci_internal->pv = pv; - p_fci_internal->cdata_in = 0; - p_fci_internal->cCompressedBytesInFolder = 0; - p_fci_internal->cFolders = 0; - p_fci_internal->cFiles = 0; - p_fci_internal->cDataBlocks = 0; p_fci_internal->data.handle = -1; - p_fci_internal->fNewPrevious = FALSE; - p_fci_internal->estimatedCabinetSize = 0; - p_fci_internal->statusFolderTotal = 0; - p_fci_internal->folders_size = 0; - p_fci_internal->files_size = 0; - p_fci_internal->placed_files_size = 0; - p_fci_internal->pending_data_size = 0; - p_fci_internal->folders_data_size = 0; - p_fci_internal->compression = tcompTYPE_NONE; p_fci_internal->compress = compress_NONE; list_init( &p_fci_internal->folders_list ); diff --git a/reactos/media/doc/README.WINE b/reactos/media/doc/README.WINE index 8f60802ee67..9853bc5a420 100644 --- a/reactos/media/doc/README.WINE +++ b/reactos/media/doc/README.WINE @@ -51,7 +51,7 @@ reactos/dll/win32/atl100 # Synced to WineStaging-1.9.11 reactos/dll/win32/avifil32 # Synced to WineStaging-1.9.23 reactos/dll/win32/bcrypt # Synced to WineStaging-1.9.23 reactos/dll/win32/browseui # Out of sync -reactos/dll/win32/cabinet # Synced to WineStaging-1.9.23 +reactos/dll/win32/cabinet # Synced to WineStaging-2.2 reactos/dll/win32/clusapi # Synced to WineStaging-1.9.11 reactos/dll/win32/comcat # Synced to WineStaging-1.9.11 reactos/dll/win32/comctl32 # Synced to WineStaging-1.9.23 -- 2.17.1