[ros-diffs] [khornicek] 46098: [SHELL32] - partial Wine sync, fixes crashing shlfileop winetest: Use the current directory when copying to an empty destination. Fix a memory leak in SHFileOperationW. Vincent Povirk <vincent at codeweavers dot com>
khornicek at svn.reactos.org
khornicek at svn.reactos.org
Thu Mar 11 15:57:05 CET 2010
- Previous message: [ros-diffs] [tkreuzer] 46097: [FREELDR] Include ntddk.h instead of winddk.h [RAMDISK] Add missing DO_XIP definition (not in WDK/DDK) [FASTFAT] Remove duplicate VOLUME_IS_DIRTY definition [HAL] Add case stubs for missing HAL_QUERY_INFORMATION_CLASS members [NDK] Fix DbgPrompt prototype [NTDDK] - Move from winddk.h: _KUSER_SHARED_DATA (updated), pHalIoAssignDriveLetters, PHAL_RESET_DISPLAY_PARAMETERS, HAL_DISPATCH, HalDispatchTable, PCREATE_PROCESS_NOTIFY_ROUTINE, PCREATE_THREAD_NOTIFY_ROUTINE, IMAGE_INFO, PLOAD_IMAGE_NOTIFY_ROUTINE, BUS_DATA_TYPE (updated), PROCESSINFOCLASS (updated), THREADINFOCLASS (updated), DISK_SIGNATURE, PTIMER_APC_ROUTINE, Exfi386InterlockedIncrementLong, Exfi386InterlockedDecrementLong, Exfi386InterlockedExchangeUlong - Add pHalGetAcpiTable, PCI_ERROR_HANDLER_CALLBACK, pHalSetPciErrorHandlerCallback [WDM] Add _DECL_HAL_KE_IMPORT, Reorder sections (types before functions)
- Next message: [ros-diffs] [spetreolle] 46099: [WLANSVC] Correctly start and report status to the service manager.
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Author: khornicek
Date: Thu Mar 11 15:57:05 2010
New Revision: 46098
URL: http://svn.reactos.org/svn/reactos?rev=46098&view=rev
Log:
[SHELL32]
- partial Wine sync, fixes crashing shlfileop winetest:
Use the current directory when copying to an empty destination.
Fix a memory leak in SHFileOperationW.
Vincent Povirk <vincent at codeweavers dot com>
Modified:
trunk/reactos/dll/win32/shell32/shlfileop.c
Modified: trunk/reactos/dll/win32/shell32/shlfileop.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shlfileop.c?rev=46098&r1=46097&r2=46098&view=diff
==============================================================================
--- trunk/reactos/dll/win32/shell32/shlfileop.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/shlfileop.c [iso-8859-1] Thu Mar 11 15:57:05 2010
@@ -1087,6 +1087,20 @@
if (flFrom->bAnyDontExist)
return ERROR_SHELL_INTERNAL_FILE_NOT_FOUND;
+ if (flTo->dwNumFiles == 0)
+ {
+ /* If the destination is empty, SHFileOperation should use the current directory */
+ WCHAR curdir[MAX_PATH+1];
+
+ GetCurrentDirectoryW(MAX_PATH, curdir);
+ curdir[lstrlenW(curdir)+1] = 0;
+
+ destroy_file_list(flTo);
+ ZeroMemory(flTo, sizeof(FILE_LIST));
+ parse_file_list(flTo, curdir);
+ fileDest = &flTo->feFiles[0];
+ }
+
if (op->req->fFlags & FOF_MULTIDESTFILES)
{
if (flFrom->bAnyFromWildcard)
@@ -1096,6 +1110,14 @@
{
if (flFrom->dwNumFiles != 1 && !IsAttribDir(fileDest->attributes))
return ERROR_CANCELLED;
+
+ /* Free all but the first entry. */
+ for (i = 1; i < flTo->dwNumFiles; i++)
+ {
+ HeapFree(GetProcessHeap(), 0, flTo->feFiles[i].szDirectory);
+ HeapFree(GetProcessHeap(), 0, flTo->feFiles[i].szFilename);
+ HeapFree(GetProcessHeap(), 0, flTo->feFiles[i].szFullPath);
+ }
flTo->dwNumFiles = 1;
}
- Previous message: [ros-diffs] [tkreuzer] 46097: [FREELDR] Include ntddk.h instead of winddk.h [RAMDISK] Add missing DO_XIP definition (not in WDK/DDK) [FASTFAT] Remove duplicate VOLUME_IS_DIRTY definition [HAL] Add case stubs for missing HAL_QUERY_INFORMATION_CLASS members [NDK] Fix DbgPrompt prototype [NTDDK] - Move from winddk.h: _KUSER_SHARED_DATA (updated), pHalIoAssignDriveLetters, PHAL_RESET_DISPLAY_PARAMETERS, HAL_DISPATCH, HalDispatchTable, PCREATE_PROCESS_NOTIFY_ROUTINE, PCREATE_THREAD_NOTIFY_ROUTINE, IMAGE_INFO, PLOAD_IMAGE_NOTIFY_ROUTINE, BUS_DATA_TYPE (updated), PROCESSINFOCLASS (updated), THREADINFOCLASS (updated), DISK_SIGNATURE, PTIMER_APC_ROUTINE, Exfi386InterlockedIncrementLong, Exfi386InterlockedDecrementLong, Exfi386InterlockedExchangeUlong - Add pHalGetAcpiTable, PCI_ERROR_HANDLER_CALLBACK, pHalSetPciErrorHandlerCallback [WDM] Add _DECL_HAL_KE_IMPORT, Reorder sections (types before functions)
- Next message: [ros-diffs] [spetreolle] 46099: [WLANSVC] Correctly start and report status to the service manager.
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Ros-diffs
mailing list