From: Jacek Caban jacek@codeweavers.com
Avoids conflict with FILE_DISPOSITION_INFO and matches Windows SDK. --- dlls/kernel32/tests/file.c | 2 -- dlls/scrrun/scrrun.idl | 1 - dlls/scrrun/tests/scrrun.idl | 1 - include/winbase.h | 11 ++++++++++- 4 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/dlls/kernel32/tests/file.c b/dlls/kernel32/tests/file.c index b651fc1a1ba..68b9f53700e 100644 --- a/dlls/kernel32/tests/file.c +++ b/dlls/kernel32/tests/file.c @@ -35,8 +35,6 @@ #include "winnls.h" #include "fileapi.h"
-#undef DeleteFile /* needed for FILE_DISPOSITION_INFO */ - static HANDLE (WINAPI *pFindFirstFileExA)(LPCSTR,FINDEX_INFO_LEVELS,LPVOID,FINDEX_SEARCH_OPS,LPVOID,DWORD); static BOOL (WINAPI *pReplaceFileW)(LPCWSTR, LPCWSTR, LPCWSTR, DWORD, LPVOID, LPVOID); static UINT (WINAPI *pGetSystemWindowsDirectoryA)(LPSTR, UINT); diff --git a/dlls/scrrun/scrrun.idl b/dlls/scrrun/scrrun.idl index 061d924d162..f369f2d985a 100644 --- a/dlls/scrrun/scrrun.idl +++ b/dlls/scrrun/scrrun.idl @@ -24,7 +24,6 @@ import "oaidl.idl";
cpp_quote("#ifdef WINE_NO_UNICODE_MACROS") cpp_quote("#undef CopyFile") -cpp_quote("#undef DeleteFile") cpp_quote("#undef MoveFile") cpp_quote("#endif") /* this is not defined in public headers */ diff --git a/dlls/scrrun/tests/scrrun.idl b/dlls/scrrun/tests/scrrun.idl index 86ac9e320d7..9b65aff1d5b 100644 --- a/dlls/scrrun/tests/scrrun.idl +++ b/dlls/scrrun/tests/scrrun.idl @@ -24,7 +24,6 @@ import "oaidl.idl";
cpp_quote("#ifdef WINE_NO_UNICODE_MACROS") cpp_quote("#undef CopyFile") -cpp_quote("#undef DeleteFile") cpp_quote("#undef MoveFile") cpp_quote("#endif") /* this is not defined in public headers */ diff --git a/include/winbase.h b/include/winbase.h index 40d973dd546..5ccf9551ece 100644 --- a/include/winbase.h +++ b/include/winbase.h @@ -2012,7 +2012,16 @@ WINBASEAPI void WINAPI DeleteCriticalSection(CRITICAL_SECTION *lpCrit); WINBASEAPI void WINAPI DeleteFiber(LPVOID); WINBASEAPI BOOL WINAPI DeleteFileA(LPCSTR); WINBASEAPI BOOL WINAPI DeleteFileW(LPCWSTR); -#define DeleteFile WINELIB_NAME_AW(DeleteFile) +#ifndef WINE_NO_UNICODE_MACROS +static inline BOOL DeleteFile( LPCTSTR file_name ) +{ +#ifdef UNICODE + return DeleteFileW( file_name ); +#else + return DeleteFileA( file_name ); +#endif +} +#endif WINBASEAPI void WINAPI DeleteProcThreadAttributeList(struct _PROC_THREAD_ATTRIBUTE_LIST*); WINBASEAPI BOOL WINAPI DeleteTimerQueue(HANDLE); WINBASEAPI BOOL WINAPI DeleteTimerQueueEx(HANDLE,HANDLE);