[PATCH] ntdll/tests: Clean up temp file.

Daniel Lehman dlehman25 at gmail.com
Thu Jan 14 20:35:27 CST 2021


Signed-off-by: Daniel Lehman <dlehman25 at gmail.com>
---
DeleteFile errors with sharing violation leaving files in %TEMP%
---
 dlls/ntdll/tests/om.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/dlls/ntdll/tests/om.c b/dlls/ntdll/tests/om.c
index c92b780541f..701980e1a5f 100644
--- a/dlls/ntdll/tests/om.c
+++ b/dlls/ntdll/tests/om.c
@@ -1435,9 +1435,8 @@ static void test_query_object(void)
 
     GetTempPathA(MAX_PATH, tmp_path);
     GetTempFileNameA(tmp_path, "foo", 0, file1);
-    handle = CreateFileA(file1, GENERIC_WRITE | DELETE, 0, NULL, CREATE_ALWAYS, 0, 0);
+    handle = CreateFileA(file1, GENERIC_WRITE | DELETE, 0, NULL, CREATE_ALWAYS, FILE_FLAG_DELETE_ON_CLOSE, 0);
     test_object_type(handle, L"File");
-    DeleteFileA( file1 );
     test_file_info( handle );
     pNtClose( handle );
 
-- 
2.25.1




More information about the wine-devel mailing list