From: Jacek Caban jacek@codeweavers.com
Based on patch by Rémi Bernon. --- include/msvcrt/intrin.h | 4 ++++ include/winnt.h | 21 +++++++++++++++++++++ 2 files changed, 25 insertions(+)
diff --git a/include/msvcrt/intrin.h b/include/msvcrt/intrin.h index 178c85ff59e..35762483313 100644 --- a/include/msvcrt/intrin.h +++ b/include/msvcrt/intrin.h @@ -98,6 +98,10 @@ unsigned char _BitScanForward(unsigned long*,unsigned long); unsigned char _BitScanForward64(unsigned long*,unsigned __int64); #endif
+#if defined(_MSC_VER) && defined(__x86_64__) +unsigned __int64 _umul128(unsigned __int64, unsigned __int64, unsigned __int64*); +#endif + #ifdef __cplusplus } #endif diff --git a/include/winnt.h b/include/winnt.h index 31ee273d11d..223db81576f 100644 --- a/include/winnt.h +++ b/include/winnt.h @@ -7436,6 +7436,27 @@ static FORCEINLINE void YieldProcessor(void) #endif }
+#if defined(__x86_64__) +# if defined(__arm64ec__) +# define _umul128 UnsignedMultiply128 +# else +# define UnsignedMultiply128 _umul128 +# if defined(_MSC_VER) +DWORD64 _umul128(DWORD64,DWORD64,DWORD64*); +# pragma intrinsic(_umul128) +# endif +# endif +#endif + +#if (defined(__x86_64__) && !defined(_MSC_VER)) || defined(__aarch64__) || defined(__arm64ec__) +static FORCEINLINE DWORD64 UnsignedMultiply128( DWORD64 a, DWORD64 b, DWORD64 *hi ) +{ + unsigned __int128 v = (unsigned __int128)a * b; + *hi = v >> 64; + return (DWORD64)v; +} +#endif + #ifdef __cplusplus } #endif
From: Jacek Caban jacek@codeweavers.com
Based on patch by Rémi Bernon. --- include/msvcrt/intrin.h | 1 + include/winnt.h | 9 +++++++++ 2 files changed, 10 insertions(+)
diff --git a/include/msvcrt/intrin.h b/include/msvcrt/intrin.h index 35762483313..b20fb1b56d0 100644 --- a/include/msvcrt/intrin.h +++ b/include/msvcrt/intrin.h @@ -99,6 +99,7 @@ unsigned char _BitScanForward64(unsigned long*,unsigned __int64); #endif
#if defined(_MSC_VER) && defined(__x86_64__) +unsigned __int64 __shiftright128(unsigned __int64, unsigned __int64, unsigned char); unsigned __int64 _umul128(unsigned __int64, unsigned __int64, unsigned __int64*); #endif
diff --git a/include/winnt.h b/include/winnt.h index 223db81576f..722d2c3a542 100644 --- a/include/winnt.h +++ b/include/winnt.h @@ -7438,17 +7438,26 @@ static FORCEINLINE void YieldProcessor(void)
#if defined(__x86_64__) # if defined(__arm64ec__) +# define __shiftright128 ShiftRight128 # define _umul128 UnsignedMultiply128 # else +# define ShiftRight128 __shiftright128 # define UnsignedMultiply128 _umul128 # if defined(_MSC_VER) +DWORD64 __shiftright128(DWORD64,DWORD64,BYTE); DWORD64 _umul128(DWORD64,DWORD64,DWORD64*); +# pragma intrinsic(__shiftright128) # pragma intrinsic(_umul128) # endif # endif #endif
#if (defined(__x86_64__) && !defined(_MSC_VER)) || defined(__aarch64__) || defined(__arm64ec__) +static FORCEINLINE DWORD64 ShiftRight128( DWORD64 lo, DWORD64 hi, BYTE shift ) +{ + return ((unsigned __int128)hi << 64 | lo) >> shift; +} + static FORCEINLINE DWORD64 UnsignedMultiply128( DWORD64 a, DWORD64 b, DWORD64 *hi ) { unsigned __int128 v = (unsigned __int128)a * b;
From: Jacek Caban jacek@codeweavers.com
--- dlls/scrrun/scrrun.idl | 4 ---- dlls/scrrun/tests/scrrun.idl | 4 ---- include/winbase.h | 20 +++++++++++++------- 3 files changed, 13 insertions(+), 15 deletions(-)
diff --git a/dlls/scrrun/scrrun.idl b/dlls/scrrun/scrrun.idl index f369f2d985a..b803fd2df12 100644 --- a/dlls/scrrun/scrrun.idl +++ b/dlls/scrrun/scrrun.idl @@ -22,10 +22,6 @@ import "unknwn.idl"; import "objidl.idl"; import "oaidl.idl";
-cpp_quote("#ifdef WINE_NO_UNICODE_MACROS") -cpp_quote("#undef CopyFile") -cpp_quote("#undef MoveFile") -cpp_quote("#endif") /* this is not defined in public headers */ cpp_quote("#define CTL_E_ENDOFFILE STD_CTL_SCODE(62)") cpp_quote("#define CTL_E_KEY_ALREADY_EXISTS STD_CTL_SCODE(457)") diff --git a/dlls/scrrun/tests/scrrun.idl b/dlls/scrrun/tests/scrrun.idl index 9b65aff1d5b..d615de71854 100644 --- a/dlls/scrrun/tests/scrrun.idl +++ b/dlls/scrrun/tests/scrrun.idl @@ -22,10 +22,6 @@ import "unknwn.idl"; import "objidl.idl"; import "oaidl.idl";
-cpp_quote("#ifdef WINE_NO_UNICODE_MACROS") -cpp_quote("#undef CopyFile") -cpp_quote("#undef MoveFile") -cpp_quote("#endif") /* this is not defined in public headers */ cpp_quote("#define CTL_E_ENDOFFILE STD_CTL_SCODE(62)") cpp_quote("#define CTL_E_KEY_ALREADY_EXISTS STD_CTL_SCODE(457)") diff --git a/include/winbase.h b/include/winbase.h index 692c13ed13a..6f609176148 100644 --- a/include/winbase.h +++ b/include/winbase.h @@ -1898,7 +1898,12 @@ WINBASEAPI HANDLE WINAPI ConvertToGlobalHandle(HANDLE hSrc); WINBASEAPI BOOL WINAPI CopyContext(CONTEXT*, DWORD, CONTEXT*); WINBASEAPI BOOL WINAPI CopyFileA(LPCSTR,LPCSTR,BOOL); WINBASEAPI BOOL WINAPI CopyFileW(LPCWSTR,LPCWSTR,BOOL); -#define CopyFile WINELIB_NAME_AW(CopyFile) +#ifndef WINE_NO_UNICODE_MACROS +static inline BOOL CopyFile( LPCTSTR source, LPCTSTR dest, BOOL fail_if_exists ) +{ + return WINELIB_NAME_AW(CopyFile)( source, dest, fail_if_exists ); +} +#endif WINBASEAPI HRESULT WINAPI CopyFile2(PCWSTR,PCWSTR,COPYFILE2_EXTENDED_PARAMETERS*); WINBASEAPI BOOL WINAPI CopyFileExA(LPCSTR, LPCSTR, LPPROGRESS_ROUTINE, LPVOID, LPBOOL, DWORD); WINBASEAPI BOOL WINAPI CopyFileExW(LPCWSTR, LPCWSTR, LPPROGRESS_ROUTINE, LPVOID, LPBOOL, DWORD); @@ -2017,11 +2022,7 @@ WINBASEAPI BOOL WINAPI DeleteFileW(LPCWSTR); #ifndef WINE_NO_UNICODE_MACROS static inline BOOL DeleteFile( LPCTSTR file_name ) { -#ifdef UNICODE - return DeleteFileW( file_name ); -#else - return DeleteFileA( file_name ); -#endif + return WINELIB_NAME_AW(DeleteFile)( file_name ); } #endif WINBASEAPI void WINAPI DeleteProcThreadAttributeList(struct _PROC_THREAD_ATTRIBUTE_LIST*); @@ -2570,7 +2571,12 @@ WINBASEAPI LPVOID WINAPI MapViewOfFileEx(HANDLE,DWORD,DWORD,DWORD,SIZE_T,LP WINBASEAPI LPVOID WINAPI MapViewOfFileFromApp(HANDLE,ULONG,ULONG64,SIZE_T); WINBASEAPI BOOL WINAPI MoveFileA(LPCSTR,LPCSTR); WINBASEAPI BOOL WINAPI MoveFileW(LPCWSTR,LPCWSTR); -#define MoveFile WINELIB_NAME_AW(MoveFile) +#ifndef WINE_NO_UNICODE_MACROS +static inline BOOL MoveFile( LPCTSTR source, LPCTSTR dest) +{ + return WINELIB_NAME_AW(MoveFile)( source, dest ); +} +#endif WINBASEAPI BOOL WINAPI MoveFileExA(LPCSTR,LPCSTR,DWORD); WINBASEAPI BOOL WINAPI MoveFileExW(LPCWSTR,LPCWSTR,DWORD); #define MoveFileEx WINELIB_NAME_AW(MoveFileEx)
This merge request was approved by Jacek Caban.
From: Rémi Bernon rbernon@codeweavers.com
--- include/combaseapi.h | 9 +++++++++ 1 file changed, 9 insertions(+)
diff --git a/include/combaseapi.h b/include/combaseapi.h index 41461f22e98..7343a72fbbb 100644 --- a/include/combaseapi.h +++ b/include/combaseapi.h @@ -53,6 +53,15 @@ enum AgileReferenceOptions HRESULT WINAPI CoDecodeProxy(DWORD client_pid, UINT64 proxy_addr, ServerInformation *server_info); HRESULT WINAPI RoGetAgileReference(enum AgileReferenceOptions options, REFIID riid, IUnknown *obj, IAgileReference **agile_reference);
+#ifdef __cplusplus +extern "C++" template<typename T> void **IID_PPV_ARGS_Helper(T **obj) +{ + (void)static_cast<IUnknown *>(*obj); + return reinterpret_cast<void **>(obj); +} +#define IID_PPV_ARGS(obj) __uuidof(**(obj)), IID_PPV_ARGS_Helper(obj) +#endif /* __cplusplus */ + #ifdef __cplusplus } #endif
From: Rémi Bernon rbernon@codeweavers.com
--- include/winuser.h | 1 + 1 file changed, 1 insertion(+)
diff --git a/include/winuser.h b/include/winuser.h index 3514de75def..bc65e8a19d0 100644 --- a/include/winuser.h +++ b/include/winuser.h @@ -3844,6 +3844,7 @@ WINUSERAPI BOOL WINAPI EnumDisplaySettingsExW(LPCWSTR,DWORD,LPDEVMODEW,DW WINUSERAPI LONG WINAPI GetDisplayConfigBufferSizes(UINT32,UINT32*,UINT32*); WINUSERAPI BOOL WINAPI UpdateLayeredWindow(HWND,HDC,POINT*,SIZE*,HDC,POINT*,COLORREF,BLENDFUNCTION*,DWORD); WINUSERAPI BOOL WINAPI UpdateLayeredWindowIndirect(HWND,UPDATELAYEREDWINDOWINFO const*); +WINUSERAPI LONG WINAPI QueryDisplayConfig(UINT32,UINT32*,DISPLAYCONFIG_PATH_INFO*,UINT32*,DISPLAYCONFIG_MODE_INFO*,DISPLAYCONFIG_TOPOLOGY_ID*); #endif /* defined(_WINGDI_) && !defined(NOGDI) */
WINUSERAPI HKL WINAPI ActivateKeyboardLayout(HKL,UINT);