Index: cleanup.c =================================================================== --- reactos/drivers/filesystems/fastfat/cleanup.c (revision 74045) +++ reactos/drivers/filesystems/fastfat/cleanup.c (working copy) @@ -24,6 +24,7 @@ PVFAT_IRP_CONTEXT IrpContext) { PVFATFCB pFcb; + PVFATCCB pCcb; PDEVICE_EXTENSION DeviceExt = IrpContext->DeviceExt; PFILE_OBJECT FileObject = IrpContext->FileObject; @@ -58,6 +59,12 @@ return STATUS_PENDING; } + pCcb = FileObject->FsContext2; + if (pCcb->Flags & CCB_DELETE_ON_CLOSE) + { + pFcb->Flags |= FCB_DELETE_PENDING; + } + /* Notify about the cleanup */ FsRtlNotifyCleanup(IrpContext->DeviceExt->NotifySync, &(IrpContext->DeviceExt->NotifyList), Index: create.c =================================================================== --- reactos/drivers/filesystems/fastfat/create.c (revision 74045) +++ reactos/drivers/filesystems/fastfat/create.c (working copy) @@ -394,6 +394,7 @@ ULONG RequestedDisposition, RequestedOptions; PVFATFCB pFcb = NULL; PVFATFCB ParentFcb = NULL; + PVFATCCB pCcb = NULL; PWCHAR c, last; BOOLEAN PagingFileCreate; BOOLEAN Dots; @@ -657,6 +658,12 @@ } } + pCcb = FileObject->FsContext2; + if (BooleanFlagOn(RequestedOptions, FILE_DELETE_ON_CLOSE)) + { + pCcb->Flags |= CCB_DELETE_ON_CLOSE; + } + pFcb->OpenHandleCount++; DeviceExt->OpenHandleCount++; } @@ -906,6 +913,12 @@ &pFcb->FCBShareAccess); } + pCcb = FileObject->FsContext2; + if (RequestedOptions & FILE_DELETE_ON_CLOSE) + { + pCcb->Flags |= CCB_DELETE_ON_CLOSE; + } + if (Irp->IoStatus.Information == FILE_CREATED) { FsRtlNotifyFullReportChange(DeviceExt->NotifySync, Index: vfat.h =================================================================== --- reactos/drivers/filesystems/fastfat/vfat.h (revision 74045) +++ reactos/drivers/filesystems/fastfat/vfat.h (working copy) @@ -486,9 +486,12 @@ ULONG LastOffset; } VFATFCB, *PVFATFCB; +#define CCB_DELETE_ON_CLOSE 0x0001 + typedef struct _VFATCCB { LARGE_INTEGER CurrentByteOffset; + ULONG Flags; /* for DirectoryControl */ ULONG Entry; /* for DirectoryControl */ Index: reactos/sdk/include/reactos/wine/test.h =================================================================== --- reactos/sdk/include/reactos/wine/test.h (revision 74432) +++ reactos/sdk/include/reactos/wine/test.h (working copy) @@ -64,6 +64,7 @@ extern int winetest_loop_todo(void); extern void winetest_end_todo(void); extern int winetest_get_mainargs( char*** pargv ); +extern LONG winetest_get_successes(void); extern LONG winetest_get_failures(void); extern void winetest_add_failures( LONG new_failures ); extern void winetest_wait_child_process( HANDLE process ); @@ -474,6 +475,11 @@ return winetest_argc; } +LONG winetest_get_successes(void) +{ + return successes; +} + LONG winetest_get_failures(void) { return failures; Index: rostests/winetests/kernel32/file.c =================================================================== --- rostests/winetests/kernel32/file.c (revision 74432) +++ rostests/winetests/kernel32/file.c (working copy) @@ -4807,56 +4807,108 @@ InitFunctionPointers(); test__hread( ); + printf("%d: %d\n", __LINE__, winetest_get_successes()); test__hwrite( ); + printf("%d: %d\n", __LINE__, winetest_get_successes()); test__lclose( ); + printf("%d: %d\n", __LINE__, winetest_get_successes()); test__lcreat( ); + printf("%d: %d\n", __LINE__, winetest_get_successes()); test__llseek( ); + printf("%d: %d\n", __LINE__, winetest_get_successes()); test__llopen( ); + printf("%d: %d\n", __LINE__, winetest_get_successes()); test__lread( ); + printf("%d: %d\n", __LINE__, winetest_get_successes()); test__lwrite( ); + printf("%d: %d\n", __LINE__, winetest_get_successes()); test_GetTempFileNameA(); + printf("%d: %d\n", __LINE__, winetest_get_successes()); test_CopyFileA(); + printf("%d: %d\n", __LINE__, winetest_get_successes()); test_CopyFileW(); + printf("%d: %d\n", __LINE__, winetest_get_successes()); test_CopyFile2(); + printf("%d: %d\n", __LINE__, winetest_get_successes()); test_CopyFileEx(); + printf("%d: %d\n", __LINE__, winetest_get_successes()); test_CreateFile(); + printf("%d: %d\n", __LINE__, winetest_get_successes()); test_CreateFileA(); + printf("%d: %d\n", __LINE__, winetest_get_successes()); test_CreateFileW(); + printf("%d: %d\n", __LINE__, winetest_get_successes()); test_CreateFile2(); + printf("%d: %d\n", __LINE__, winetest_get_successes()); test_DeleteFileA(); + printf("%d: %d\n", __LINE__, winetest_get_successes()); test_DeleteFileW(); + printf("%d: %d\n", __LINE__, winetest_get_successes()); test_MoveFileA(); + printf("%d: %d\n", __LINE__, winetest_get_successes()); test_MoveFileW(); + printf("%d: %d\n", __LINE__, winetest_get_successes()); test_FindFirstFileA(); + printf("%d: %d\n", __LINE__, winetest_get_successes()); test_FindNextFileA(); + printf("%d: %d\n", __LINE__, winetest_get_successes()); test_FindFirstFileExA(FindExInfoStandard, 0, 0); + printf("%d: %d\n", __LINE__, winetest_get_successes()); test_FindFirstFileExA(FindExInfoStandard, 0, FIND_FIRST_EX_CASE_SENSITIVE); + printf("%d: %d\n", __LINE__, winetest_get_successes()); test_FindFirstFileExA(FindExInfoStandard, 0, FIND_FIRST_EX_LARGE_FETCH); + printf("%d: %d\n", __LINE__, winetest_get_successes()); test_FindFirstFileExA(FindExInfoBasic, 0, 0); + printf("%d: %d\n", __LINE__, winetest_get_successes()); /* FindExLimitToDirectories is ignored if the file system doesn't support directory filtering */ test_FindFirstFileExA(FindExInfoStandard, FindExSearchLimitToDirectories, 0); + printf("%d: %d\n", __LINE__, winetest_get_successes()); test_FindFirstFileExA(FindExInfoStandard, FindExSearchLimitToDirectories, FIND_FIRST_EX_CASE_SENSITIVE); + printf("%d: %d\n", __LINE__, winetest_get_successes()); test_FindFirstFileExA(FindExInfoStandard, FindExSearchLimitToDirectories, FIND_FIRST_EX_LARGE_FETCH); + printf("%d: %d\n", __LINE__, winetest_get_successes()); test_FindFirstFileExA(FindExInfoBasic, FindExSearchLimitToDirectories, 0); + printf("%d: %d\n", __LINE__, winetest_get_successes()); test_LockFile(); + printf("%d: %d\n", __LINE__, winetest_get_successes()); test_file_sharing(); + printf("%d: %d\n", __LINE__, winetest_get_successes()); test_offset_in_overlapped_structure(); + printf("%d: %d\n", __LINE__, winetest_get_successes()); test_MapFile(); + printf("%d: %d\n", __LINE__, winetest_get_successes()); test_GetFileType(); + printf("%d: %d\n", __LINE__, winetest_get_successes()); test_async_file_errors(); + printf("%d: %d\n", __LINE__, winetest_get_successes()); test_read_write(); + printf("%d: %d\n", __LINE__, winetest_get_successes()); test_OpenFile(); + printf("%d: %d\n", __LINE__, winetest_get_successes()); test_overlapped(); + printf("%d: %d\n", __LINE__, winetest_get_successes()); test_RemoveDirectory(); + printf("%d: %d\n", __LINE__, winetest_get_successes()); test_ReplaceFileA(); + printf("%d: %d\n", __LINE__, winetest_get_successes()); test_ReplaceFileW(); + printf("%d: %d\n", __LINE__, winetest_get_successes()); test_GetFileInformationByHandleEx(); + printf("%d: %d\n", __LINE__, winetest_get_successes()); test_OpenFileById(); + printf("%d: %d\n", __LINE__, winetest_get_successes()); test_SetFileValidData(); + printf("%d: %d\n", __LINE__, winetest_get_successes()); test_WriteFileGather(); + printf("%d: %d\n", __LINE__, winetest_get_successes()); test_file_access(); + printf("%d: %d\n", __LINE__, winetest_get_successes()); test_GetFinalPathNameByHandleA(); + printf("%d: %d\n", __LINE__, winetest_get_successes()); test_GetFinalPathNameByHandleW(); + printf("%d: %d\n", __LINE__, winetest_get_successes()); test_SetFileInformationByHandle(); + printf("%d: %d\n", __LINE__, winetest_get_successes()); test_GetFileAttributesExW(); + printf("%d: %d\n", __LINE__, winetest_get_successes()); }