ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
August 2022
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
11 participants
86 discussions
Start a n
N
ew thread
[reactos] 04/06: [NTOSKRNL] Implement KiXmmExceptionHandler
by Timo Kreuzer
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=92c798c657d5f0a315624…
commit 92c798c657d5f0a315624b864e3d0b0c03715f6d Author: Timo Kreuzer <timo.kreuzer(a)reactos.org> AuthorDate: Wed Jul 13 20:26:42 2022 +0200 Commit: Timo Kreuzer <timo.kreuzer(a)reactos.org> CommitDate: Mon Aug 22 11:22:08 2022 +0200 [NTOSKRNL] Implement KiXmmExceptionHandler --- ntoskrnl/ke/amd64/except.c | 48 +++++++++++++++++++++++++++++++++++++++++++--- ntoskrnl/ke/amd64/trap.S | 4 +++- 2 files changed, 48 insertions(+), 4 deletions(-) diff --git a/ntoskrnl/ke/amd64/except.c b/ntoskrnl/ke/amd64/except.c index de8e2b01697..8410fa4acc6 100644 --- a/ntoskrnl/ke/amd64/except.c +++ b/ntoskrnl/ke/amd64/except.c @@ -672,7 +672,49 @@ NTAPI KiXmmExceptionHandler( IN PKTRAP_FRAME TrapFrame) { - UNIMPLEMENTED; - KeBugCheckWithTf(TRAP_CAUSE_UNKNOWN, 13, 0, 0, 1, TrapFrame); - return -1; + ULONG ExceptionCode; + + if ((TrapFrame->MxCsr & _MM_EXCEPT_INVALID) && + !(TrapFrame->MxCsr & _MM_MASK_INVALID)) + { + /* Invalid operation */ + ExceptionCode = STATUS_FLOAT_INVALID_OPERATION; + } + else if ((TrapFrame->MxCsr & _MM_EXCEPT_DENORM) && + !(TrapFrame->MxCsr & _MM_MASK_DENORM)) + { + /* Denormalized operand. Yes, this is what Windows returns. */ + ExceptionCode = STATUS_FLOAT_INVALID_OPERATION; + } + else if ((TrapFrame->MxCsr & _MM_EXCEPT_DIV_ZERO) && + !(TrapFrame->MxCsr & _MM_MASK_DIV_ZERO)) + { + /* Divide by zero */ + ExceptionCode = STATUS_FLOAT_DIVIDE_BY_ZERO; + } + else if ((TrapFrame->MxCsr & _MM_EXCEPT_OVERFLOW) && + !(TrapFrame->MxCsr & _MM_MASK_OVERFLOW)) + { + /* Overflow */ + ExceptionCode = STATUS_FLOAT_OVERFLOW; + } + else if ((TrapFrame->MxCsr & _MM_EXCEPT_UNDERFLOW) && + !(TrapFrame->MxCsr & _MM_MASK_UNDERFLOW)) + { + /* Underflow */ + ExceptionCode = STATUS_FLOAT_UNDERFLOW; + } + else if ((TrapFrame->MxCsr & _MM_EXCEPT_INEXACT) && + !(TrapFrame->MxCsr & _MM_MASK_INEXACT)) + { + /* Precision */ + ExceptionCode = STATUS_FLOAT_INEXACT_RESULT; + } + else + { + /* Should not happen */ + ASSERT(FALSE); + } + + return ExceptionCode; } diff --git a/ntoskrnl/ke/amd64/trap.S b/ntoskrnl/ke/amd64/trap.S index 73470363a23..9d694518d0f 100644 --- a/ntoskrnl/ke/amd64/trap.S +++ b/ntoskrnl/ke/amd64/trap.S @@ -543,7 +543,9 @@ FUNC KiXmmException jge KiXmmExit /* Dispatch the exception */ - DispatchException eax, 3, 0, 0, 0 + DispatchException eax, 2, 0, [rbp+KTRAP_FRAME_MxCsr], 0 + + // FIXME: STATUS_FLOAT_MULTIPLE_TRAPS / STATUS_FLOAT_MULTIPLE_FAULTS KiXmmExit: /* Return */
2 years, 4 months
1
0
0
0
[reactos] 03/06: [CRT] Fix amd64 floating point control functions
by Timo Kreuzer
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=76086220fa4c0d8a7e7ac…
commit 76086220fa4c0d8a7e7ac88cf1d01cdbeb445df5 Author: Timo Kreuzer <timo.kreuzer(a)reactos.org> AuthorDate: Wed Jul 13 20:27:42 2022 +0200 Commit: Timo Kreuzer <timo.kreuzer(a)reactos.org> CommitDate: Mon Aug 22 11:22:08 2022 +0200 [CRT] Fix amd64 floating point control functions --- sdk/include/crt/float.h | 4 ++ sdk/lib/crt/float/amd64/_clearfp.c | 23 ++++++++ sdk/lib/crt/float/amd64/_control87.c | 39 ++++++++++++ sdk/lib/crt/float/amd64/_controlfp.c | 13 ++++ sdk/lib/crt/float/amd64/_fpreset.c | 14 +++++ sdk/lib/crt/float/amd64/_statusfp.c | 33 +++++++++++ sdk/lib/crt/float/amd64/clearfp.S | 15 ----- sdk/lib/crt/float/amd64/fpreset.S | 13 ---- sdk/lib/crt/float/amd64/machfpcw.c | 111 +++++++++++++++++++++++++++++++++++ sdk/lib/crt/float/float.cmake | 10 ++-- 10 files changed, 243 insertions(+), 32 deletions(-) diff --git a/sdk/include/crt/float.h b/sdk/include/crt/float.h index b5681293421..8c42b3f9d04 100644 --- a/sdk/include/crt/float.h +++ b/sdk/include/crt/float.h @@ -59,6 +59,10 @@ #define _PC_24 0x00020000 #define _PC_53 0x00010000 #define _PC_64 0x00000000 +#define _DN_SAVE 0x00000000 +#define _DN_FLUSH 0x01000000 +#define _DN_FLUSH_OPERANDS_SAVE_RESULTS 0x02000000 +#define _DN_SAVE_OPERANDS_FLUSH_RESULTS 0x03000000 /* These are also defined in Mingw math.h, needed to work around GCC build issues. */ diff --git a/sdk/lib/crt/float/amd64/_clearfp.c b/sdk/lib/crt/float/amd64/_clearfp.c new file mode 100644 index 00000000000..b03b3f10f79 --- /dev/null +++ b/sdk/lib/crt/float/amd64/_clearfp.c @@ -0,0 +1,23 @@ +/* + * PROJECT: ReactOS CRT + * LICENSE: MIT (
https://spdx.org/licenses/MIT
) + * PURPOSE: x64 implementation of _clearfp + * COPYRIGHT: Copyright 2022 Timo Kreuzer <timo.kreuzer(a)reactos.org> + */ + +#include <float.h> +#include <xmmintrin.h> + +unsigned int __cdecl _clearfp(void) +{ + unsigned int retval; + + /* Get current status value */ + retval = _statusfp(); + + /* Clear the exception mask */ + _mm_setcsr(_mm_getcsr() & ~_MM_EXCEPT_MASK); + + /* Return the previous state */ + return retval; +} diff --git a/sdk/lib/crt/float/amd64/_control87.c b/sdk/lib/crt/float/amd64/_control87.c new file mode 100644 index 00000000000..a9f07cf0836 --- /dev/null +++ b/sdk/lib/crt/float/amd64/_control87.c @@ -0,0 +1,39 @@ +/* + * PROJECT: ReactOS CRT + * LICENSE: MIT (
https://spdx.org/licenses/MIT
) + * PURPOSE: Implementation of _control87 + * COPYRIGHT: Copyright 2022 Timo Kreuzer <timo.kreuzer(a)reactos.org> + */ + +#include <xmmintrin.h> +#include <float.h> + +unsigned int _get_native_fpcw(void); +void _set_native_fpcw(unsigned int value); +unsigned int _fpcw_native_to_abstract(unsigned int native); +unsigned int _fpcw_abstract_to_native(unsigned int abstract); + +unsigned int __cdecl _control87(unsigned int newval, unsigned int mask) +{ + unsigned int native, oldval, updated; + + /* Sanatize the mask */ + mask &= _MCW_DN | _MCW_EM | _MCW_RC; + + /* Get native control word */ + native = _get_native_fpcw(); + + /* Convert to abstract */ + oldval = _fpcw_native_to_abstract(native); + + /* Update it according to the given parameters */ + updated = (oldval & ~mask) | (newval & mask); + + /* Convert back to native */ + native = _fpcw_abstract_to_native(updated); + + /* Set the native value */ + _set_native_fpcw(native); + + return updated; +} diff --git a/sdk/lib/crt/float/amd64/_controlfp.c b/sdk/lib/crt/float/amd64/_controlfp.c new file mode 100644 index 00000000000..f0ac11548ab --- /dev/null +++ b/sdk/lib/crt/float/amd64/_controlfp.c @@ -0,0 +1,13 @@ +/* + * PROJECT: ReactOS CRT + * LICENSE: MIT (
https://spdx.org/licenses/MIT
) + * PURPOSE: x64 implementation of _controlfp + * COPYRIGHT: Copyright 2022 Timo Kreuzer <timo.kreuzer(a)reactos.org> + */ + +#include <float.h> + +unsigned int __cdecl _controlfp(unsigned int newval, unsigned int mask) +{ + return _control87(newval, mask & ~_EM_DENORMAL); +} diff --git a/sdk/lib/crt/float/amd64/_fpreset.c b/sdk/lib/crt/float/amd64/_fpreset.c new file mode 100644 index 00000000000..b03885527a9 --- /dev/null +++ b/sdk/lib/crt/float/amd64/_fpreset.c @@ -0,0 +1,14 @@ +/* + * PROJECT: ReactOS CRT + * LICENSE: MIT (
https://spdx.org/licenses/MIT
) + * PURPOSE: x64 implementation of _fpreset + * COPYRIGHT: Copyright 2022 Timo Kreuzer <timo.kreuzer(a)reactos.org> + */ + +#include <xmmintrin.h> + +void __cdecl _fpreset(void) +{ + /* Mask everything */ + _mm_setcsr(_MM_MASK_MASK); +} diff --git a/sdk/lib/crt/float/amd64/_statusfp.c b/sdk/lib/crt/float/amd64/_statusfp.c new file mode 100644 index 00000000000..760e9bfe4be --- /dev/null +++ b/sdk/lib/crt/float/amd64/_statusfp.c @@ -0,0 +1,33 @@ +/* + * PROJECT: ReactOS CRT + * LICENSE: MIT (
https://spdx.org/licenses/MIT
) + * PURPOSE: x64 implementation of _statusfp + * COPYRIGHT: Copyright 2022 Timo Kreuzer <timo.kreuzer(a)reactos.org> + */ + +#include <float.h> +#include <xmmintrin.h> + +unsigned int __cdecl _statusfp(void) +{ + unsigned int mxcsr, status = 0; + + /* Get MXCSR */ + mxcsr = _mm_getcsr(); + + /* Convert to abstract status flags */ + if (mxcsr & _MM_EXCEPT_INVALID) + status |= _SW_INVALID; + if (mxcsr & _MM_EXCEPT_DENORM) + status |= _SW_DENORMAL; + if (mxcsr & _MM_EXCEPT_DIV_ZERO) + status |= _SW_ZERODIVIDE; + if (mxcsr & _MM_EXCEPT_OVERFLOW) + status |= _SW_OVERFLOW; + if (mxcsr & _MM_EXCEPT_UNDERFLOW) + status |= _SW_UNDERFLOW; + if (mxcsr & _MM_EXCEPT_INEXACT) + status |= _SW_INEXACT; + + return status; +} diff --git a/sdk/lib/crt/float/amd64/clearfp.S b/sdk/lib/crt/float/amd64/clearfp.S deleted file mode 100644 index 2df94a9b383..00000000000 --- a/sdk/lib/crt/float/amd64/clearfp.S +++ /dev/null @@ -1,15 +0,0 @@ - - - -#include <asm.inc> - -.code64 - -PUBLIC _clearfp -FUNC _clearfp - .ENDPROLOG - fnclex - -ENDFUNC - -END diff --git a/sdk/lib/crt/float/amd64/fpreset.S b/sdk/lib/crt/float/amd64/fpreset.S deleted file mode 100644 index bae9ed4c856..00000000000 --- a/sdk/lib/crt/float/amd64/fpreset.S +++ /dev/null @@ -1,13 +0,0 @@ - -#include <asm.inc> - -.code64 - -PUBLIC _fpreset -FUNC _fpreset - .endprolog - fninit - ret -ENDFUNC - -END diff --git a/sdk/lib/crt/float/amd64/machfpcw.c b/sdk/lib/crt/float/amd64/machfpcw.c new file mode 100644 index 00000000000..f74c7c5e1d9 --- /dev/null +++ b/sdk/lib/crt/float/amd64/machfpcw.c @@ -0,0 +1,111 @@ +/* + * PROJECT: ReactOS CRT + * LICENSE: MIT (
https://spdx.org/licenses/MIT
) + * PURPOSE: Implementation of x64 floating point control word helper functions + * COPYRIGHT: Copyright 2022 Timo Kreuzer <timo.kreuzer(a)reactos.org> + */ + +#include <float.h> +#include <xmmintrin.h> + +#define _MM_DENORMALS_ARE_ZERO 0x0040 + +unsigned int _get_native_fpcw(void) +{ + return _mm_getcsr(); +} + +void _set_native_fpcw(unsigned int value) +{ + _mm_setcsr(value); +} + +unsigned int _fpcw_native_to_abstract(unsigned int native) +{ + unsigned int rounding_mask, abstract = 0; + + /* Handle exception mask */ + if (native & _MM_MASK_INVALID) + abstract |= _EM_INVALID; + if (native & _MM_MASK_DENORM) + abstract |= _EM_DENORMAL; + if (native & _MM_MASK_DIV_ZERO) + abstract |= _EM_ZERODIVIDE; + if (native & _MM_MASK_OVERFLOW) + abstract |= _EM_OVERFLOW; + if (native & _MM_MASK_UNDERFLOW) + abstract |= _EM_UNDERFLOW; + if (native & _MM_MASK_INEXACT) + abstract |= _EM_INEXACT; + + /* Handle rounding mode */ + rounding_mask = (native & _MM_ROUND_MASK); + if (rounding_mask == _MM_ROUND_DOWN) + abstract |= _RC_DOWN; + else if(rounding_mask == _MM_ROUND_UP) + abstract |= _RC_UP; + else if (rounding_mask == _MM_ROUND_TOWARD_ZERO) + abstract |= _RC_CHOP; + + /* Handle denormal control */ + if (native & _MM_DENORMALS_ARE_ZERO) + { + if (native & _MM_FLUSH_ZERO_MASK) + abstract |= _DN_FLUSH; + else + abstract |= _DN_FLUSH_OPERANDS_SAVE_RESULTS; + } + else + { + if (native & _MM_FLUSH_ZERO_MASK) + abstract |= _DN_SAVE_OPERANDS_FLUSH_RESULTS; + else + abstract |= _DN_SAVE; + } + + return abstract; +} + +unsigned int _fpcw_abstract_to_native(unsigned int abstract) +{ + unsigned int rounding_mask, native = 0; + + /* Handle exception mask */ + if (abstract & _EM_INVALID) + native |= _MM_MASK_INVALID; + if (abstract & _EM_DENORMAL) + native |= _MM_MASK_DENORM; + if (abstract & _EM_ZERODIVIDE) + native |= _MM_MASK_DIV_ZERO; + if (abstract & _EM_OVERFLOW) + native |= _MM_MASK_OVERFLOW; + if (abstract & _EM_UNDERFLOW) + native |= _MM_MASK_UNDERFLOW; + if (abstract & _EM_INEXACT) + native |= _MM_MASK_INEXACT; + + /* Handle rounding mode */ + rounding_mask = (abstract & _MCW_RC); + if (rounding_mask == _RC_DOWN) + native |= _MM_ROUND_DOWN; + else if (rounding_mask == _RC_UP) + native |= _MM_ROUND_UP; + else if (rounding_mask == _RC_CHOP) + native |= _MM_ROUND_TOWARD_ZERO; + + /* Handle Denormal Control */ + if ((abstract & _MCW_DN) == _DN_FLUSH) + { + native |= _MM_DENORMALS_ARE_ZERO | _MM_FLUSH_ZERO_MASK; + } + else if ((abstract & _MCW_DN) == _DN_FLUSH_OPERANDS_SAVE_RESULTS) + { + native |= _MM_DENORMALS_ARE_ZERO; + } + else if ((abstract & _MCW_DN) == _DN_SAVE_OPERANDS_FLUSH_RESULTS) + { + native |= _MM_FLUSH_ZERO_MASK; + } + + return native; +} diff --git a/sdk/lib/crt/float/float.cmake b/sdk/lib/crt/float/float.cmake index 8f16c995a09..e4189362f64 100644 --- a/sdk/lib/crt/float/float.cmake +++ b/sdk/lib/crt/float/float.cmake @@ -23,13 +23,15 @@ if(ARCH STREQUAL "i386") ) elseif(ARCH STREQUAL "amd64") list(APPEND CRT_FLOAT_SOURCE - float/i386/cntrlfp.c - float/i386/statfp.c + float/amd64/_clearfp.c + float/amd64/_control87.c + float/amd64/_controlfp.c + float/amd64/_fpreset.c + float/amd64/_statusfp.c + float/amd64/machfpcw.c ) list(APPEND CRT_FLOAT_ASM_SOURCE - float/amd64/clearfp.S float/amd64/getsetfpcw.S - float/amd64/fpreset.S float/amd64/logb.S ) elseif(ARCH STREQUAL "arm")
2 years, 4 months
1
0
0
0
[reactos] 02/06: [NTOS][RTL] Initialize MxCsr where missing
by Timo Kreuzer
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=39f11249ff93f3a362a89…
commit 39f11249ff93f3a362a89694de0cbe43ef52a158 Author: Timo Kreuzer <timo.kreuzer(a)reactos.org> AuthorDate: Sat Jul 23 13:31:27 2022 +0200 Commit: Timo Kreuzer <timo.kreuzer(a)reactos.org> CommitDate: Mon Aug 22 11:22:08 2022 +0200 [NTOS][RTL] Initialize MxCsr where missing --- dll/win32/kernel32/client/utils.c | 3 +++ ntoskrnl/ke/amd64/context.c | 6 +++--- ntoskrnl/ke/amd64/cpu.c | 4 ++-- ntoskrnl/ke/amd64/kiinit.c | 6 ++++++ sdk/lib/rtl/amd64/stubs.c | 7 +++++-- 5 files changed, 19 insertions(+), 7 deletions(-) diff --git a/dll/win32/kernel32/client/utils.c b/dll/win32/kernel32/client/utils.c index c10d2d45004..54a6f05fa5c 100644 --- a/dll/win32/kernel32/client/utils.c +++ b/dll/win32/kernel32/client/utils.c @@ -600,6 +600,9 @@ BaseInitializeContext(IN PCONTEXT Context, /* Set the EFLAGS */ Context->EFlags = 0x3000 | EFLAGS_INTERRUPT_MASK; /* IOPL 3 */ + /* Set MXCSR */ + Context->MxCsr = INITIAL_MXCSR; + if (ContextType == 1) /* For Threads */ { Context->Rip = (ULONG_PTR)BaseThreadStartup; diff --git a/ntoskrnl/ke/amd64/context.c b/ntoskrnl/ke/amd64/context.c index 0decbde88f9..1e9900af11f 100644 --- a/ntoskrnl/ke/amd64/context.c +++ b/ntoskrnl/ke/amd64/context.c @@ -56,7 +56,7 @@ KeContextToTrapFrame(IN PCONTEXT Context, } /* Handle floating point registers */ - if ((ContextFlags & CONTEXT_FLOATING_POINT)) + if (ContextFlags & CONTEXT_FLOATING_POINT) { TrapFrame->MxCsr = Context->MxCsr; TrapFrame->Xmm0 = Context->Xmm0; @@ -207,9 +207,9 @@ KeTrapFrameToContext(IN PKTRAP_FRAME TrapFrame, } /* Handle floating point registers */ - if ((ContextFlags & CONTEXT_FLOATING_POINT) && - ((TrapFrame->SegCs & MODE_MASK) != KernelMode)) + if (ContextFlags & CONTEXT_FLOATING_POINT) { + Context->MxCsr = TrapFrame->MxCsr; Context->Xmm0 = TrapFrame->Xmm0; Context->Xmm1 = TrapFrame->Xmm1; Context->Xmm2 = TrapFrame->Xmm2; diff --git a/ntoskrnl/ke/amd64/cpu.c b/ntoskrnl/ke/amd64/cpu.c index d4a8888c664..0967411e644 100644 --- a/ntoskrnl/ke/amd64/cpu.c +++ b/ntoskrnl/ke/amd64/cpu.c @@ -375,7 +375,7 @@ KiRestoreProcessorControlState(PKPROCESSOR_STATE ProcessorState) // __ltr(&ProcessorState->SpecialRegisters.Tr); __lidt(&ProcessorState->SpecialRegisters.Idtr.Limit); -// __ldmxcsr(&ProcessorState->SpecialRegisters.MxCsr); // FIXME + _mm_setcsr(ProcessorState->SpecialRegisters.MxCsr); // ProcessorState->SpecialRegisters.DebugControl // ProcessorState->SpecialRegisters.LastBranchToRip // ProcessorState->SpecialRegisters.LastBranchFromRip @@ -417,7 +417,7 @@ KiSaveProcessorControlState(OUT PKPROCESSOR_STATE ProcessorState) __str(&ProcessorState->SpecialRegisters.Tr); __sidt(&ProcessorState->SpecialRegisters.Idtr.Limit); -// __stmxcsr(&ProcessorState->SpecialRegisters.MxCsr); + ProcessorState->SpecialRegisters.MxCsr = _mm_getcsr(); // ProcessorState->SpecialRegisters.DebugControl = // ProcessorState->SpecialRegisters.LastBranchToRip = // ProcessorState->SpecialRegisters.LastBranchFromRip = diff --git a/ntoskrnl/ke/amd64/kiinit.c b/ntoskrnl/ke/amd64/kiinit.c index d9c8807bf34..310810475ea 100644 --- a/ntoskrnl/ke/amd64/kiinit.c +++ b/ntoskrnl/ke/amd64/kiinit.c @@ -152,6 +152,9 @@ KiInitializePcr(IN PKIPCR Pcr, Pcr->Prcb.ProcessorState.SpecialRegisters.KernelDr6 = 0; Pcr->Prcb.ProcessorState.SpecialRegisters.KernelDr7 = 0; + /* Initialize MXCSR (all exceptions masked) */ + Pcr->Prcb.MxCsr = INITIAL_MXCSR; + /* Set the Current Thread */ Pcr->Prcb.CurrentThread = IdleThread; @@ -231,6 +234,9 @@ KiInitializeCpu(PKIPCR Pcr) Pat = (PAT_WB << 0) | (PAT_WC << 8) | (PAT_UCM << 16) | (PAT_UC << 24) | (PAT_WB << 32) | (PAT_WC << 40) | (PAT_UCM << 48) | (PAT_UC << 56); __writemsr(MSR_PAT, Pat); + + /* Initialize MXCSR */ + _mm_setcsr(INITIAL_MXCSR); } VOID diff --git a/sdk/lib/rtl/amd64/stubs.c b/sdk/lib/rtl/amd64/stubs.c index 7ffc4fb9658..0f02e60a41a 100644 --- a/sdk/lib/rtl/amd64/stubs.c +++ b/sdk/lib/rtl/amd64/stubs.c @@ -23,7 +23,7 @@ NTAPI RtlInitializeContext( _Reserved_ HANDLE ProcessHandle, _Out_ PCONTEXT ThreadContext, - _In_ PVOID ThreadStartParam OPTIONAL, + _In_opt_ PVOID ThreadStartParam, _In_ PTHREAD_START_ROUTINE ThreadStartAddress, _In_ PINITIAL_TEB StackBase) { @@ -66,10 +66,13 @@ RtlInitializeContext( ThreadContext->SegSs = KGDT64_R3_DATA | RPL_MASK; } + ThreadContext->MxCsr = INITIAL_MXCSR; + /* Only the basic Context is initialized */ ThreadContext->ContextFlags = CONTEXT_CONTROL | CONTEXT_INTEGER | - CONTEXT_SEGMENTS; + CONTEXT_SEGMENTS | + CONTEXT_FLOATING_POINT; return; }
2 years, 4 months
1
0
0
0
[reactos] 01/06: [CRT_APITEST] Add tests for floating point control and status functions
by Timo Kreuzer
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=a82e46e521e34fc220667…
commit a82e46e521e34fc220667956a9b7d9f43bf73ac2 Author: Timo Kreuzer <timo.kreuzer(a)reactos.org> AuthorDate: Thu Jul 14 19:31:31 2022 +0200 Commit: Timo Kreuzer <timo.kreuzer(a)reactos.org> CommitDate: Mon Aug 22 11:22:08 2022 +0200 [CRT_APITEST] Add tests for floating point control and status functions --- modules/rostests/apitests/crt/fpcontrol.c | 285 +++++++++++++++++++++ .../rostests/apitests/crt/msvcrt_crt_apitest.cmake | 7 +- .../rostests/apitests/crt/static_crt_apitest.cmake | 1 + modules/rostests/apitests/crt/testlist.c | 4 + 4 files changed, 291 insertions(+), 6 deletions(-) diff --git a/modules/rostests/apitests/crt/fpcontrol.c b/modules/rostests/apitests/crt/fpcontrol.c new file mode 100644 index 00000000000..d86d989bd67 --- /dev/null +++ b/modules/rostests/apitests/crt/fpcontrol.c @@ -0,0 +1,285 @@ +/* + * PROJECT: ReactOS api tests + * LICENSE: MIT (
https://spdx.org/licenses/MIT
) + * PURPOSE: Tests for fp control functions + * COPYRIGHT: Copyright 2022 Timo Kreuzer <timo.kreuzer(a)reactos.org> + */ + +#include <ntstatus.h> +#define WIN32_NO_STATUS +#include <windows.h> + +#include <apitest.h> +#include <xmmintrin.h> +#include <float.h> +#include <pseh/pseh2.h> + + +unsigned int get_native_fpcw(void) +{ +#ifdef _M_AMD64 + return _mm_getcsr(); +#elif defined (_M_IX86) + unsigned short fpcw; +#if defined(_MSC_VER) + __asm fstsw[fpcw]; +#else + __asm__ __volatile__("fstsw %0" : "=m" (fpcw) : ); +#endif + return fpcw; +#else + #error "Unsupported architecture" + return 0; +#endif +} + +void set_native_fpcw(unsigned int value) +{ +#ifdef _M_AMD64 + _mm_setcsr(value); +#elif defined (_M_IX86) + unsigned short fpcw = (unsigned short)value; +#if defined(_MSC_VER) + __asm fldcw[fpcw]; +#else + __asm__ __volatile__("fldcw %0" : : "m" (fpcw)); +#endif +#else +#error "Unsupported architecture" +#endif +} + +/* + _clear87 + _clearfp + _controlfp_s + _set_controlfp + _statusfp + __control87_2 +*/ + +#ifdef _M_IX86 +#define ON_IX86(x) x +#else +#define ON_IX86(x) +#endif + +#ifdef _M_AMD64 +#define ON_AMD64(x) x +#else +#define ON_AMD64(x) +#endif + +#ifdef _M_ARM +#define ON_ARM(x) x +#else +#define ON_ARM(x) +#endif + +struct +{ + unsigned int Value; + unsigned int Mask; + unsigned int Result; + unsigned int Native; +} g_controlfp_Testcases[] = +{ + { 0xffffffff, 0xffffffff, ON_IX86(0x30e031f) ON_AMD64(0x308031f) ON_ARM(0), ON_IX86(0) ON_AMD64(0xff80) ON_ARM(0) }, + { 0, 0xffffffff, 0x80000, ON_IX86(0) ON_AMD64(0x100) ON_ARM(0) }, + { 0xffffffff, 0x14, 0x80014, ON_IX86(0) ON_AMD64(0x580) ON_ARM(0) }, + { _EM_INEXACT, 0xffffffff, _EM_INEXACT | _EM_DENORMAL, ON_IX86(0) ON_AMD64(_MM_MASK_INEXACT | _MM_MASK_DENORM) ON_ARM(0) }, + { _EM_UNDERFLOW, 0xffffffff, _EM_UNDERFLOW | _EM_DENORMAL, ON_IX86(0) ON_AMD64(_MM_MASK_UNDERFLOW | _MM_MASK_DENORM) ON_ARM(0) }, + { _EM_OVERFLOW, 0xffffffff, _EM_OVERFLOW | _EM_DENORMAL, ON_IX86(0) ON_AMD64(_MM_MASK_OVERFLOW | _MM_MASK_DENORM) ON_ARM(0) }, + { _EM_ZERODIVIDE, 0xffffffff, _EM_ZERODIVIDE | _EM_DENORMAL, ON_IX86(0) ON_AMD64(_MM_MASK_DIV_ZERO | _MM_MASK_DENORM) ON_ARM(0) }, + { _EM_INVALID, 0xffffffff, _EM_INVALID | _EM_DENORMAL, ON_IX86(0) ON_AMD64(_MM_MASK_INVALID | _MM_MASK_DENORM) ON_ARM(0) }, + { _RC_NEAR, 0xffffffff, _RC_NEAR | _EM_DENORMAL, ON_IX86(0) ON_AMD64(_MM_ROUND_NEAREST | _MM_MASK_DENORM) ON_ARM(0) }, + { _RC_DOWN, 0xffffffff, _RC_DOWN | _EM_DENORMAL, ON_IX86(0) ON_AMD64(_MM_ROUND_DOWN | _MM_MASK_DENORM) ON_ARM(0) }, + { _RC_UP, 0xffffffff, _RC_UP | _EM_DENORMAL, ON_IX86(0) ON_AMD64(_MM_ROUND_UP | _MM_MASK_DENORM) ON_ARM(0) }, + { _RC_CHOP, 0xffffffff, _RC_CHOP | _EM_DENORMAL, ON_IX86(0) ON_AMD64(_MM_ROUND_TOWARD_ZERO | _MM_MASK_DENORM) ON_ARM(0) }, + { _IC_AFFINE, 0xffffffff, _EM_DENORMAL ON_IX86(| _IC_AFFINE), ON_IX86(0) ON_AMD64(_MM_MASK_DENORM) ON_ARM(0)}, + { _IC_PROJECTIVE, 0xffffffff, _IC_PROJECTIVE | _EM_DENORMAL, ON_IX86(0) ON_AMD64(_MM_MASK_DENORM) ON_ARM(0) }, + { _DN_SAVE, 0xffffffff, _DN_SAVE | _EM_DENORMAL, ON_IX86(0) ON_AMD64(_MM_MASK_DENORM) ON_ARM(0) }, + { _DN_FLUSH, 0xffffffff, _DN_FLUSH | _EM_DENORMAL, ON_IX86(0) ON_AMD64(_MM_FLUSH_ZERO_ON | 0x40 | _MM_MASK_DENORM) ON_ARM(0) }, + { _DN_FLUSH_OPERANDS_SAVE_RESULTS, 0xffffffff, _DN_FLUSH_OPERANDS_SAVE_RESULTS | _EM_DENORMAL, ON_IX86(0) ON_AMD64(0x40 | _MM_MASK_DENORM) ON_ARM(0) }, + { _DN_SAVE_OPERANDS_FLUSH_RESULTS, 0xffffffff, _DN_SAVE_OPERANDS_FLUSH_RESULTS | _EM_DENORMAL, ON_IX86(0) ON_AMD64(_MM_FLUSH_ZERO_ON | _MM_MASK_DENORM) ON_ARM(0) }, +}; + +void Test_controlfp(void) +{ + unsigned int i, native_fpcw, fpcw; + + for (i = 0; i < _countof(g_controlfp_Testcases); i++) + { + fpcw = _controlfp(g_controlfp_Testcases[i].Value, g_controlfp_Testcases[i].Mask); + ok(fpcw == g_controlfp_Testcases[i].Result, "[%u] _controlfp failed: expected 0x%x, got 0x%x\n", i, g_controlfp_Testcases[i].Result, fpcw); + native_fpcw = get_native_fpcw(); + ok(native_fpcw == g_controlfp_Testcases[i].Native, "[%u] wrong native_fpcw: expected 0x%x, got 0x%x\n", i, g_controlfp_Testcases[i].Native, native_fpcw); + } + + /* Restore sane state */ + _fpreset(); +} + +#if defined(_M_IX86) || defined(_M_AMD64) +void Test_control87(void) +{ + unsigned int native_fpcw, fpcw; + + fpcw = _control87(0, 0xffffffff); + ok(fpcw == 0, "_control87 failed: expected 0x%x, got 0x%x\n", 0, fpcw); + native_fpcw = get_native_fpcw(); + ok_hex(native_fpcw, ON_IX86(0) ON_AMD64(0)); + + /* Restore sane state */ + _fpreset(); +} +#endif + +typedef enum _FP_OP +{ + OP_Inexact, + OP_Underflow, + OP_Overflow, + OP_ZeroDivide, + OP_Invalid, + OP_Denormal +} FP_OP; + +struct +{ + FP_OP Operation; + unsigned int Fpcw; + unsigned int FpStatus; + unsigned int ExceptionCode; + unsigned int Native; +} g_exception_Testcases[] = +{ + { OP_Inexact, 0xffffffff, _SW_UNDERFLOW | _SW_INEXACT ON_IX86(| _SW_DENORMAL), 0, ON_IX86(0x32) ON_AMD64(0xffb0) ON_ARM(0)}, + { OP_Inexact, ~_EM_INEXACT, _SW_INEXACT ON_AMD64(| _SW_UNDERFLOW), STATUS_FLOAT_INEXACT_RESULT, ON_IX86(0x3800) ON_AMD64(0xefb0) ON_ARM(0)}, + { OP_Inexact, ~_MCW_EM, _SW_INEXACT ON_AMD64(| _SW_UNDERFLOW), ON_IX86(STATUS_FLOAT_INEXACT_RESULT) ON_AMD64(STATUS_FLOAT_UNDERFLOW) ON_ARM(STATUS_FLOAT_UNDERFLOW), ON_IX86(0x3800) ON_AMD64(0xe130) ON_ARM(0) }, + { OP_Underflow, 0xffffffff, _SW_UNDERFLOW | _SW_INEXACT, 0, ON_IX86(0x30) ON_AMD64(0xffb0) ON_ARM(0)}, + { OP_Underflow, ~_EM_UNDERFLOW, _SW_UNDERFLOW | _SW_INEXACT, STATUS_FLOAT_UNDERFLOW, ON_IX86(0x3800) ON_AMD64(0xf7b0) ON_ARM(0) }, + { OP_Underflow, ~_MCW_EM, _SW_INEXACT ON_AMD64(| _SW_UNDERFLOW), ON_IX86(STATUS_FLOAT_INEXACT_RESULT) ON_AMD64(STATUS_FLOAT_UNDERFLOW) ON_ARM(STATUS_FLOAT_UNDERFLOW), ON_IX86(0x3800) ON_AMD64(0xe130) ON_ARM(0) }, + { OP_Overflow, 0xffffffff, _SW_OVERFLOW | _SW_INEXACT, 0, ON_IX86(0x28) ON_AMD64(0xffa8) ON_ARM(0) }, + { OP_Overflow, ~_EM_OVERFLOW, _SW_OVERFLOW | _SW_INEXACT, STATUS_FLOAT_OVERFLOW, ON_IX86(0x3800) ON_AMD64(0xfba8) ON_ARM(0) }, + { OP_Overflow, ~_MCW_EM, _SW_INEXACT ON_AMD64(| _SW_OVERFLOW), ON_IX86(STATUS_FLOAT_INEXACT_RESULT) ON_AMD64(STATUS_FLOAT_OVERFLOW) ON_ARM(STATUS_FLOAT_OVERFLOW), ON_IX86(0x3800) ON_AMD64(0xe128) ON_ARM(0)}, + { OP_ZeroDivide, 0xffffffff, _SW_ZERODIVIDE, 0, ON_IX86(0x4) ON_AMD64(0xff84) ON_ARM(0) }, + { OP_ZeroDivide, ~_EM_ZERODIVIDE, _SW_ZERODIVIDE, STATUS_FLOAT_DIVIDE_BY_ZERO, ON_IX86(0x3000) ON_AMD64(0xfd84) ON_ARM(0) }, + { OP_ZeroDivide, ~_MCW_EM, _SW_ZERODIVIDE, STATUS_FLOAT_DIVIDE_BY_ZERO, ON_IX86(0x3000) ON_AMD64(0xe104) ON_ARM(0) }, + { OP_Invalid, 0xffffffff, _SW_INVALID, 0, ON_IX86(0x1) ON_AMD64(0xff81) ON_ARM(0) }, + { OP_Invalid, ~_EM_INVALID, _SW_INVALID, STATUS_FLOAT_INVALID_OPERATION, ON_IX86(0) ON_AMD64(0xff01) ON_ARM(0) }, + { OP_Invalid, ~_MCW_EM, _SW_INVALID, STATUS_FLOAT_INVALID_OPERATION, ON_IX86(0) ON_AMD64(0xe101) ON_ARM(0) }, +#if defined(_M_IX86) || defined(_M_AMD64) // || defined(_M_ARM64) ? + { OP_Denormal, 0xffffffff, _SW_DENORMAL | _SW_INEXACT ON_AMD64(| _SW_UNDERFLOW), 0, ON_IX86(0x22) ON_AMD64(0xffb2) ON_ARM(0)}, + { OP_Denormal, ~_EM_DENORMAL, _SW_DENORMAL, STATUS_FLOAT_INVALID_OPERATION, ON_IX86(0x3800) ON_AMD64(0xfe82) ON_ARM(0) }, + { OP_Denormal, ~_MCW_EM, _SW_DENORMAL, STATUS_FLOAT_INVALID_OPERATION, ON_IX86(0x3800) ON_AMD64(0xe002) ON_ARM(0) }, +#endif +}; + +void Test_exceptions(void) +{ + volatile double a, b; + unsigned long long ull; + volatile long status = 0; + + unsigned int i, exp_fpstatus, native_fpcw, statusfp; + + for (i = 0; i < _countof(g_exception_Testcases); i++) + { + /* Start clean */ + status = 0; + _fpreset(); + _clearfp(); + ok_hex(_statusfp(), 0); + + _controlfp(g_exception_Testcases[i].Fpcw, 0xffffffff); +#if defined(_M_IX86) || defined(_M_AMD64) // || defined(_M_ARM64) ? + if (g_exception_Testcases[i].Operation == OP_Denormal) + _control87(g_exception_Testcases[i].Fpcw, 0xffffffff); +#endif + + _SEH2_TRY + { + switch (g_exception_Testcases[i].Operation) + { + case OP_Inexact: + a = 1e-40; + b = (float)(a + 1e-40); + break; + case OP_Underflow: + a = DBL_MIN; + b = a / 3.0e16; + break; + case OP_Overflow: + a = DBL_MAX; + b = a * 3.0; + break; + case OP_ZeroDivide: + a = 0.0; + b = 1.0 / a; + break; + case OP_Invalid: + ull = 0x7FF0000000000001ull; + a = *(double*)&ull; + b = a * 2; + break; + case OP_Denormal: + a = DBL_MIN; + b = a - 4.9406564584124654e-324; + break; + default: + (void)b; + } + native_fpcw = get_native_fpcw(); + statusfp = _clearfp(); + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { +#ifdef _M_IX86 + /* On x86 we need to clear before doing any other fp operations, otherwise it will throw again */ + statusfp = _clearfp(); + native_fpcw = get_native_fpcw(); +#else + native_fpcw = get_native_fpcw(); + statusfp = _clearfp(); +#endif + status = _SEH2_GetExceptionCode(); + } + _SEH2_END; + + exp_fpstatus = g_exception_Testcases[i].FpStatus; + ok(statusfp == exp_fpstatus, "[%u] Wrong value for _statusfp(). Expected 0x%lx, got 0x%lx\n", i, exp_fpstatus, statusfp); + ok(status == g_exception_Testcases[i].ExceptionCode, "[%u] Wrong value for status. Expected 0x%lx, got 0x%lx\n", i, g_exception_Testcases[i].ExceptionCode, status); + ok(native_fpcw == g_exception_Testcases[i].Native, "[%u] wrong native_fpcw: expected 0x%x, got 0x%x\n", i, g_exception_Testcases[i].Native, native_fpcw); + } +} + +START_TEST(fpcontrol) +{ + unsigned int native_fpcw, fpcw, fpstatus; + + /* Test native start fpcw */ + native_fpcw = get_native_fpcw(); + ok_hex(native_fpcw, ON_IX86(0) ON_AMD64(0x1f80) ON_ARM(0) ); + + /* Test start fpcw */ + fpcw = _controlfp(0, 0); + ok_hex(fpcw, ON_IX86(0x9001f) ON_AMD64(0x8001f) ON_ARM(0)); + + /* Test start status */ + fpstatus = _statusfp(); + ok_hex(fpstatus, 0); + + /* Test _fpreset */ + fpcw = _controlfp(0, 0xffffffff); + ok_hex(fpcw, 0x80000); + _fpreset(); + fpcw = _controlfp(0, 0); + ok_hex(fpcw, ON_IX86(0x9001f) ON_AMD64(0x8001f) ON_ARM(0)); + + Test_controlfp(); +#if defined(_M_IX86) || defined(_M_AMD64) + Test_control87(); +#endif + Test_exceptions(); +} diff --git a/modules/rostests/apitests/crt/msvcrt_crt_apitest.cmake b/modules/rostests/apitests/crt/msvcrt_crt_apitest.cmake index 58a598bb6fb..87fe0a611a2 100644 --- a/modules/rostests/apitests/crt/msvcrt_crt_apitest.cmake +++ b/modules/rostests/apitests/crt/msvcrt_crt_apitest.cmake @@ -1,5 +1,6 @@ list(APPEND SOURCE_MSVCRT + fpcontrol.c # _CrtCheckMemory.c # _CrtDbgBreak.c # _CrtDbgReport.c @@ -168,13 +169,9 @@ list(APPEND SOURCE_MSVCRT # _chsize_s # _chvalidator # _chvalidator_l -# _clearfp.c # _close.c # _commit.c # _commode -# _control87.c -# _controlfp.c -# _controlfp_s.c # _copysign.c # _cprintf.c # _cprintf_l @@ -665,7 +662,6 @@ list(APPEND SOURCE_MSVCRT # _searchenv.c # _searchenv_s.c # _set_SSE2_enable -# _set_controlfp # _set_doserrno.c # _set_errno.c # _set_error_mode.c @@ -717,7 +713,6 @@ list(APPEND SOURCE_MSVCRT # _stat.c # _stat64.c # _stati64.c -# _statusfp.c # _strcmpi.c # _strcoll_l # _strdate.c diff --git a/modules/rostests/apitests/crt/static_crt_apitest.cmake b/modules/rostests/apitests/crt/static_crt_apitest.cmake index cb1cfaac48e..a6c905d9396 100644 --- a/modules/rostests/apitests/crt/static_crt_apitest.cmake +++ b/modules/rostests/apitests/crt/static_crt_apitest.cmake @@ -8,6 +8,7 @@ list(APPEND SOURCE_STATIC _vsnwprintf.c atexit.c fabs.c + fpcontrol.c mbstowcs.c mbtowc.c sprintf.c diff --git a/modules/rostests/apitests/crt/testlist.c b/modules/rostests/apitests/crt/testlist.c index 16a3a9d394c..e85222f671c 100644 --- a/modules/rostests/apitests/crt/testlist.c +++ b/modules/rostests/apitests/crt/testlist.c @@ -18,6 +18,7 @@ extern void func___64tof(void); #if defined(TEST_NTDLL) extern void func__vscwprintf(void); #endif +extern void func_fpcontrol(void); extern void func_fabs(void); extern void func_fputc(void); extern void func_fputwc(void); @@ -61,6 +62,9 @@ const struct test winetest_testlist[] = // ... #endif #if defined(TEST_STATIC_CRT) || defined(TEST_MSVCRT) +#ifdef _M_AMD64 // x86 / arm need fixing + { "fpcontrol", func_fpcontrol }, +#endif { "fabs", func_fabs }, #if defined(_M_ARM) { "__rt_div", func___rt_div },
2 years, 4 months
1
0
0
0
[reactos] 01/01: [DRWTSN32] Add Russian (ru-RU) translation (#4617)
by Artyom Ovsyannikov
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=5a9efc4081a9ba47c6292…
commit 5a9efc4081a9ba47c629234fe6c8251faa1975f8 Author: Artyom Ovsyannikov <artemka6834(a)gmail.com> AuthorDate: Sun Aug 21 14:26:51 2022 +0300 Commit: Stanislav Motylkov <x86corez(a)gmail.com> CommitDate: Mon Aug 22 01:54:03 2022 +0300 [DRWTSN32] Add Russian (ru-RU) translation (#4617) Reviewed-by: Stanislav Motylkov <x86corez(a)gmail.com> --- base/applications/drwtsn32/drwtsn32.rc | 3 +++ base/applications/drwtsn32/lang/ru-RU.rc | 15 +++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/base/applications/drwtsn32/drwtsn32.rc b/base/applications/drwtsn32/drwtsn32.rc index 8713b425f54..6206e4c7243 100644 --- a/base/applications/drwtsn32/drwtsn32.rc +++ b/base/applications/drwtsn32/drwtsn32.rc @@ -46,6 +46,9 @@ #ifdef LANGUAGE_RO_RO #include "lang/ro-RO.rc" #endif +#ifdef LANGUAGE_RU_RU + #include "lang/ru-RU.rc" +#endif #ifdef LANGUAGE_ZH_CN #include "lang/zh-CN.rc" #endif diff --git a/base/applications/drwtsn32/lang/ru-RU.rc b/base/applications/drwtsn32/lang/ru-RU.rc new file mode 100644 index 00000000000..fb7c6672bca --- /dev/null +++ b/base/applications/drwtsn32/lang/ru-RU.rc @@ -0,0 +1,15 @@ +/* + * PROJECT: Dr. Watson crash reporter + * LICENSE: GPL-2.0+ (
https://spdx.org/licenses/GPL-2.0+
) + * PURPOSE: Russian resource file + * TRANSLATORS: Copyright 2022 Artyom Ovsyannikov <artemka6834(a)gmail.com> + * Copyright 2022 Stanislav Motylkov <binarymaster(a)mail.ru> + */ + +LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT + +STRINGTABLE +BEGIN + IDS_APP_TITLE "Сообщение о сбоях ReactOS" + IDS_USER_ALERT_MESSAGE "В приложении %ls произошла ошибка. Информация об этой ошибке сохранена в:\n\n%ls" +END
2 years, 4 months
1
0
0
0
[reactos] 01/01: [TRANSLATION] Improve Russian (ru-RU) translation (#4615)
by Artyom Ovsyannikov
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=3dd5599fc4b8446f0ae9d…
commit 3dd5599fc4b8446f0ae9d6295083b24551c37dd2 Author: Artyom Ovsyannikov <artemka6834(a)gmail.com> AuthorDate: Sat Aug 20 16:50:47 2022 +0300 Commit: Stanislav Motylkov <x86corez(a)gmail.com> CommitDate: Mon Aug 22 01:42:24 2022 +0300 [TRANSLATION] Improve Russian (ru-RU) translation (#4615) [WINEMINE][INF] Improve Russian translation for Minesweeper [TIMEDATE] Improve Russian translation --- base/applications/games/winmine/lang/ru-RU.rc | 2 +- dll/cpl/timedate/lang/ru-RU.rc | 2 +- media/inf/shortcuts.inf | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/base/applications/games/winmine/lang/ru-RU.rc b/base/applications/games/winmine/lang/ru-RU.rc index 3656b02c544..0c3091e1841 100644 --- a/base/applications/games/winmine/lang/ru-RU.rc +++ b/base/applications/games/winmine/lang/ru-RU.rc @@ -2,7 +2,7 @@ LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT STRINGTABLE BEGIN - IDS_APPNAME "WineMine" + IDS_APPNAME "Сапёр" IDS_NOBODY "Игрок" IDS_ABOUT "Copyright 2000 Joshua Thielen" END diff --git a/dll/cpl/timedate/lang/ru-RU.rc b/dll/cpl/timedate/lang/ru-RU.rc index 4b5ca07cf5c..bf767051ea9 100644 --- a/dll/cpl/timedate/lang/ru-RU.rc +++ b/dll/cpl/timedate/lang/ru-RU.rc @@ -52,7 +52,7 @@ BEGIN IDS_TIMEZONEUNKNOWN "Неизвестная" IDS_INETTIMESUCSYNC "Время было успешно синхронизировано с %s на %s в %s" IDS_INETTIMENEXTSYNC "Следующая синхронизация через: %s в %s" - IDS_INETTIMESYNCING "Подождите, пока РеактОС синхронизирует время с %s" + IDS_INETTIMESYNCING "Подождите, пока ReactOS синхронизирует время с %s" IDS_INETTIMEERROR "Возникла ошибка во время синхронизации с %s" IDS_INETTIMESUCFILL "Пожалуйста введите имя NTP сервера для синхронизации времени" IDS_INETTIMEWELCOME "Выберите NTP сервер из списка, либо введите имя NTP сервера для синхронизации времени компьютера" diff --git a/media/inf/shortcuts.inf b/media/inf/shortcuts.inf index 8d016283570..a12f7f481dc 100644 --- a/media/inf/shortcuts.inf +++ b/media/inf/shortcuts.inf @@ -1430,8 +1430,8 @@ SNDREC32_TITLE=Звукозапись SNDREC32_DESC=Запишите звук и сохраните его на своем компьютере. SOL_TITLE=Пасьянс Косынка SOL_DESC=Пасьянс Косынка -WINMINE_TITLE=Сапер -WINMINE_DESC=Сапер +WINMINE_TITLE=Сапёр +WINMINE_DESC=Сапёр SPIDER_TITLE=Пасьянс Паук SPIDER_DESC=Пасьянс Паук UTILMAN_TITLE=Диспетчер служебных программ
2 years, 4 months
1
0
0
0
[reactos] 01/01: [OSK] Update Russian (ru-RU) translation (#4611)
by Artyom Ovsyannikov
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=e59e6ba017ad7451b8ba3…
commit e59e6ba017ad7451b8ba39665b1aae342aefd3d5 Author: Artyom Ovsyannikov <artemka6834(a)gmail.com> AuthorDate: Tue Aug 16 15:45:16 2022 +0300 Commit: Stanislav Motylkov <x86corez(a)gmail.com> CommitDate: Sun Aug 21 23:46:38 2022 +0300 [OSK] Update Russian (ru-RU) translation (#4611) Reviewed-by: Stanislav Motylkov <x86corez(a)gmail.com> --- base/applications/osk/lang/ru-RU.rc | 54 ++++++++++++++++++------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/base/applications/osk/lang/ru-RU.rc b/base/applications/osk/lang/ru-RU.rc index 49331bf89d7..99c48709633 100644 --- a/base/applications/osk/lang/ru-RU.rc +++ b/base/applications/osk/lang/ru-RU.rc @@ -1,67 +1,67 @@ /* - * PROJECT: ReactOS On-Screen Keyboard - * LICENSE: GPL - See COPYING in the top level directory - * FILE: base/applications/osk/lang/ru-RU.rc - * PURPOSE: On screen keyboard (Russian resources) - * PROGRAMMERS: Denis ROBERT + * PROJECT: ReactOS On-Screen Keyboard + * LICENSE: GPL-2.0-or-later (
https://spdx.org/licenses/GPL-2.0-or-later
) + * PURPOSE: Russian resource file + * TRANSLATORS: Copyright 2022 Artyom Ovsyannikov <artemka6834(a)gmail.com> + * Copyright 2022 Stanislav Motylkov <binarymaster(a)mail.ru> */ LANGUAGE LANG_RUSSIAN, SUBLANG_NEUTRAL IDR_OSK_MENU MENU DISCARDABLE BEGIN - POPUP "File" + POPUP "Файл" BEGIN - MENUITEM "&Exit", IDM_EXIT + MENUITEM "&Выход", IDM_EXIT END - POPUP "Keyboard" + POPUP "Клавиатура" BEGIN - MENUITEM "Enhanced Keyboard", IDM_ENHANCED_KB, CHECKED - MENUITEM "Standard Keyboard", IDM_STANDARD_KB + MENUITEM "Расширенная клавиатура", IDM_ENHANCED_KB, CHECKED + MENUITEM "Стандартная клавиатура", IDM_STANDARD_KB MENUITEM SEPARATOR - MENUITEM "Regular Layout", IDM_REG_LAYOUT, CHECKED, GRAYED - MENUITEM "Block Layout", IDM_BLOCK_LAYOUT, GRAYED + MENUITEM "Обычная раскладка", IDM_REG_LAYOUT, CHECKED, GRAYED + MENUITEM "Блочная раскладка", IDM_BLOCK_LAYOUT, GRAYED MENUITEM SEPARATOR - MENUITEM "101 keys", IDM_101_KEYS, CHECKED, GRAYED - MENUITEM "102 keys", IDM_102_KEYS, GRAYED - MENUITEM "106 keys", IDM_106_KEYS, GRAYED + MENUITEM "101 клавиша", IDM_101_KEYS, CHECKED, GRAYED + MENUITEM "102 клавиши", IDM_102_KEYS, GRAYED + MENUITEM "106 клавиш", IDM_106_KEYS, GRAYED END - POPUP "Settings" + POPUP "Настройки" BEGIN - MENUITEM "Always on Top", IDM_ON_TOP, CHECKED + MENUITEM "Поверх остальных окон", IDM_ON_TOP, CHECKED MENUITEM SEPARATOR - MENUITEM "&Use Click Sound", IDM_CLICK_SOUND + MENUITEM "&Звук нажатия", IDM_CLICK_SOUND MENUITEM SEPARATOR - MENUITEM "&Typing Mode...", IDM_TYPE_MODE, GRAYED + MENUITEM "&Режим ввода...", IDM_TYPE_MODE, GRAYED MENUITEM SEPARATOR - MENUITEM "&Font...", IDM_FONT + MENUITEM "&Шрифт...", IDM_FONT END - POPUP "Help" + POPUP "Справка" BEGIN - MENUITEM "&Help Topics", IDM_HELP_TOPICS, GRAYED + MENUITEM "&Справка", IDM_HELP_TOPICS, GRAYED MENUITEM SEPARATOR - MENUITEM "&About On-Screen Keyboard...", IDM_ABOUT + MENUITEM "&О программе ""Экранная клавиатура""", IDM_ABOUT END END IDD_WARNINGDIALOG_OSK DIALOGEX 0, 0, 250, 97 STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION -CAPTION "On-Screen Keyboard" +CAPTION "Экранная клавиатура" FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN DEFPUSHBUTTON "OK", IDOK, 193, 76, 50, 14 ICON IDI_OSK, IDC_STATIC, 7, 17, 20, 20 - LTEXT "On-Screen Keyboard provides a minimum level of functionality for mobility-impaired users. Mobility-impaired users will need a utility program with higher functionality for daily use.", IDC_STATIC, 36, 7, 207, 33 - CONTROL "Do not show this message again", IDC_SHOWWARNINGCHECK, "Button", + LTEXT "Экранная клавиатура обеспечивает минимальный функционал для пользователей с ограниченными физическими возможностями. Пользователям с ограниченными физическими возможностями нужны более функциональные программы.", IDC_STATIC, 36, 7, 207, 33 + CONTROL "Не показывать это сообщение снова", IDC_SHOWWARNINGCHECK, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 43, 80, 137, 10 END STRINGTABLE BEGIN - IDS_OSK "On-Screen Keyboard" + IDS_OSK "Экранная клавиатура" IDS_AUTHORS "Copyright Denis Robert" IDS_NUMLOCK "Num" IDS_CAPSLOCK "Caps"
2 years, 4 months
1
0
0
0
[reactos] 01/01: [NTUSER] Rewrite NtUserUnloadKeyboardLayout (#4613)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=6c748ca8a9253d3e4241e…
commit 6c748ca8a9253d3e4241ec0bc945b16dec39e15e Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Sat Aug 20 09:45:06 2022 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Sat Aug 20 09:45:06 2022 +0900 [NTUSER] Rewrite NtUserUnloadKeyboardLayout (#4613) - Add co_IntUnloadKeyboardLayoutEx (Win: xxxInternalUnloadKeyboardLayout), IntUnloadKeyboardLayout (Win: xxxUnloadKeyboardLayout) helper functions. - Rewrite NtUserUnloadKeyboardLayout function. CORE-11700 --- win32ss/user/ntuser/kbdlayout.c | 75 ++++++++++++++++++++++++++++++++++++----- 1 file changed, 67 insertions(+), 8 deletions(-) diff --git a/win32ss/user/ntuser/kbdlayout.c b/win32ss/user/ntuser/kbdlayout.c index 90ad390cac4..fde11969f9b 100644 --- a/win32ss/user/ntuser/kbdlayout.c +++ b/win32ss/user/ntuser/kbdlayout.c @@ -23,6 +23,7 @@ PKL gspklBaseLayout = NULL; /* FIXME: Please move this to pWinSta->spklList */ PKBDFILE gpkfList = NULL; DWORD gSystemFS = 0; UINT gSystemCPCharSet = 0; +DWORD gLCIDSentToShell = 0; typedef PVOID (*PFN_KBDLAYERDESCRIPTOR)(VOID); @@ -774,6 +775,67 @@ co_IntActivateKeyboardLayout( return co_UserActivateKeyboardLayout(pKL, uFlags, pWnd); } +// Win: xxxInternalUnloadKeyboardLayout +static BOOL APIENTRY +co_IntUnloadKeyboardLayoutEx( + _Inout_ PWINSTATION_OBJECT pWinSta, + _Inout_ PKL pKL, + _In_ DWORD dwFlags) +{ + PKL pNextKL; + USER_REFERENCE_ENTRY Ref1, Ref2; + PTHREADINFO pti = gptiCurrent; + + if (pKL == gspklBaseLayout && !(dwFlags & 0x80000000)) + return FALSE; + + UserRefObjectCo(pKL, &Ref1); /* Add reference */ + + /* Regard as unloaded */ + UserMarkObjectDestroy(pKL); + pKL->dwKL_Flags |= KLF_UNLOAD; + + if (!(dwFlags & 0x80000000) && pti->KeyboardLayout == pKL) + { + pNextKL = IntHKLtoPKL(pti, (HKL)(ULONG_PTR)HKL_NEXT); + if (pNextKL) + { + UserRefObjectCo(pNextKL, &Ref2); /* Add reference */ + co_UserActivateKeyboardLayout(pNextKL, dwFlags, NULL); + UserDerefObjectCo(pNextKL); /* Release reference */ + } + } + + if (gspklBaseLayout == pKL && pKL != pKL->pklNext) + { + /* Set next layout as default (FIXME: Use UserAssignmentLock?) */ + gspklBaseLayout = pKL->pklNext; + } + + UserDerefObjectCo(pKL); /* Release reference */ + + if (pti->pDeskInfo->fsHooks) + { + co_IntShellHookNotify(HSHELL_LANGUAGE, 0, 0); + gLCIDSentToShell = 0; + } + + return TRUE; +} + +// Win: xxxUnloadKeyboardLayout +static BOOL APIENTRY +IntUnloadKeyboardLayout(_Inout_ PWINSTATION_OBJECT pWinSta, _In_ HKL hKL) +{ + PKL pKL = IntHKLtoPKL(gptiCurrent, hKL); + if (!pKL) + { + ERR("Invalid HKL %p!\n", hKL); + return FALSE; + } + return co_IntUnloadKeyboardLayoutEx(pWinSta, pKL, 0); +} + /* EXPORTS *******************************************************************/ /* @@ -1081,19 +1143,16 @@ APIENTRY NtUserUnloadKeyboardLayout( HKL hKl) { - PKL pKl; - BOOL bRet = FALSE; + BOOL ret; + PWINSTATION_OBJECT pWinSta; UserEnterExclusive(); - pKl = UserHklToKbl(hKl); - if (pKl) - bRet = UserUnloadKbl(pKl); - else - ERR("Invalid HKL %p!\n", hKl); + pWinSta = IntGetProcessWindowStation(NULL); + ret = IntUnloadKeyboardLayout(pWinSta, hKl); UserLeave(); - return bRet; + return ret; } /* EOF */
2 years, 4 months
1
0
0
0
[reactos] 01/01: [USER32] Adjustment for IME/IMM (#4610)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=c06cccea22fc038d82198…
commit c06cccea22fc038d821989da27ad8c38f44bf141 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Thu Aug 18 10:55:11 2022 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Thu Aug 18 10:55:11 2022 +0900 [USER32] Adjustment for IME/IMM (#4610) - Add IS_CICERO_MODE() macro. - Append DWORD dwLastStatus to IMEUI structure. - Modify ImeWndProc_common, ImeWnd_OnCreate, ImeWnd_OnImeSelect, and ImeWnd_OnImeControl functions. CORE-11700 --- win32ss/include/ntuser.h | 2 ++ win32ss/user/user32/misc/imm.c | 44 +++++++++++++++++++++++++++++++++--------- 2 files changed, 37 insertions(+), 9 deletions(-) diff --git a/win32ss/include/ntuser.h b/win32ss/include/ntuser.h index 2b122059318..2a6194841e0 100644 --- a/win32ss/include/ntuser.h +++ b/win32ss/include/ntuser.h @@ -1201,6 +1201,7 @@ typedef enum IMEINFOEXCLASS } IMEINFOEXCLASS; #define IS_IME_HKL(hkl) ((((ULONG_PTR)(hkl)) & 0xF0000000) == 0xE0000000) +#define IS_CICERO_MODE() (gpsi->dwSRVIFlags & SRVINFO_CICERO_ENABLED) typedef struct tagIMEUI { @@ -1219,6 +1220,7 @@ typedef struct tagIMEUI UINT fCtrlShowStatus:1; UINT fFreeActiveEvent:1; }; + DWORD dwLastStatus; } IMEUI, *PIMEUI; /* Window Extra data container. */ diff --git a/win32ss/user/user32/misc/imm.c b/win32ss/user/user32/misc/imm.c index 017e9f2e384..0bf16913d54 100644 --- a/win32ss/user/user32/misc/imm.c +++ b/win32ss/user/user32/misc/imm.c @@ -340,13 +340,13 @@ Quit: /* Initializes the default IME window. */ /* Win: ImeWndCreateHandler */ -static BOOL ImeWnd_OnCreate(PIMEUI pimeui, LPCREATESTRUCT lpCS) +static INT ImeWnd_OnCreate(PIMEUI pimeui, LPCREATESTRUCT lpCS) { PWND pParentWnd, pWnd = pimeui->spwnd; HIMC hIMC = NULL; if (!pWnd || (pWnd->style & (WS_DISABLED | WS_POPUP)) != (WS_DISABLED | WS_POPUP)) - return FALSE; + return -1; pParentWnd = ValidateHwnd(lpCS->hwndParent); if (pParentWnd) @@ -365,12 +365,9 @@ static BOOL ImeWnd_OnCreate(PIMEUI pimeui, LPCREATESTRUCT lpCS) pimeui->hwndIMC = NULL; pimeui->hKL = GetWin32ClientInfo()->hKL; pimeui->fCtrlShowStatus = TRUE; + pimeui->dwLastStatus = 0; - IMM_FN(ImmLoadIME)(pimeui->hKL); - - pimeui->hwndUI = NULL; - - return TRUE; + return 0; } /* Destroys the IME UI window. */ @@ -399,6 +396,10 @@ static VOID ImeWnd_OnImeSelect(PIMEUI pimeui, WPARAM wParam, LPARAM lParam) if (wParam) { pimeui->hKL = hKL = (HKL)lParam; + + if (!pimeui->fActivate) + return; + pimeui->hwndUI = hwndUI = User32CreateImeUIWindow(pimeui, hKL); if (hwndUI) User32SendImeUIMessage(pimeui, WM_IME_SELECT, wParam, lParam, TRUE); @@ -429,6 +430,19 @@ ImeWnd_OnImeControl(PIMEUI pimeui, WPARAM wParam, LPARAM lParam, BOOL unicode) DWORD dwConversion, dwSentence; POINT pt; + if (IS_CICERO_MODE()) + { + if (wParam == IMC_OPENSTATUSWINDOW) + { + IMM_FN(CtfImmRestoreToolbarWnd)(pimeui->dwLastStatus); + pimeui->dwLastStatus = 0; + } + else if (wParam == IMC_CLOSESTATUSWINDOW) + { + pimeui->dwLastStatus = IMM_FN(CtfImmHideToolbarWnd)(); + } + } + if (!hIMC) return 0; @@ -922,10 +936,18 @@ ImeWndProc_common(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam, BOOL unicod { PWND pWnd; PIMEUI pimeui; + LRESULT ret; pWnd = ValidateHwnd(hwnd); if (pWnd) { + if (IS_CICERO_MODE()) + { + ret = IMM_FN(CtfImmDispatchDefImeMessage)(hwnd, msg, wParam, lParam); + if (ret) + return ret; + } + if (!pWnd->fnid) { if (msg != WM_NCCREATE) @@ -961,7 +983,6 @@ ImeWndProc_common(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam, BOOL unicod case WM_IME_CHAR: case WM_IME_COMPOSITIONFULL: case WM_IME_CONTROL: - case WM_IME_NOTIFY: case WM_IME_REQUEST: case WM_IME_SELECT: case WM_IME_SETCONTEXT: @@ -970,6 +991,11 @@ ImeWndProc_common(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam, BOOL unicod case WM_IME_ENDCOMPOSITION: return 0; + case WM_IME_NOTIFY: + if (wParam < IMN_PRIVATE || IS_IME_HKL(pimeui->hKL) || !IS_CICERO_MODE()) + return 0; + break; + case WM_IME_SYSTEM: switch (wParam) { @@ -995,7 +1021,7 @@ ImeWndProc_common(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam, BOOL unicod switch (msg) { case WM_CREATE: - return (ImeWnd_OnCreate(pimeui, (LPCREATESTRUCT)lParam) ? 0 : -1); + return ImeWnd_OnCreate(pimeui, (LPCREATESTRUCT)lParam); case WM_DESTROY: User32DestroyImeUIWindow(pimeui);
2 years, 4 months
1
0
0
0
[reactos] 01/01: [NTUSER][USER32] Define NtUserSetWindowLongPtr for non-Win64 (#4612)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=93955f37de34d25161d00…
commit 93955f37de34d25161d0034c8f0f6917c82ef93e Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Wed Aug 17 17:23:40 2022 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Wed Aug 17 17:23:40 2022 +0900 [NTUSER][USER32] Define NtUserSetWindowLongPtr for non-Win64 (#4612) - Add NtUserSetWindowLongPtr macro on non-Win64. - Use NtUserSetWindowLongPtr instead of NtUserSetWindowLong. CORE-11700 --- win32ss/include/ntuser.h | 2 ++ win32ss/user/user32/misc/imm.c | 2 +- win32ss/user/user32/windows/class.c | 6 +++--- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/win32ss/include/ntuser.h b/win32ss/include/ntuser.h index 3f0449d2ee6..2b122059318 100644 --- a/win32ss/include/ntuser.h +++ b/win32ss/include/ntuser.h @@ -3365,6 +3365,8 @@ NtUserSetWindowLongPtr( DWORD Index, LONG_PTR NewValue, BOOL Ansi); +#else +#define NtUserSetWindowLongPtr NtUserSetWindowLong #endif // _WIN64 BOOL diff --git a/win32ss/user/user32/misc/imm.c b/win32ss/user/user32/misc/imm.c index 0433e3cff0c..017e9f2e384 100644 --- a/win32ss/user/user32/misc/imm.c +++ b/win32ss/user/user32/misc/imm.c @@ -331,7 +331,7 @@ static HWND User32CreateImeUIWindow(PIMEUI pimeui, HKL hKL) } if (hwndUI) - NtUserSetWindowLong(hwndUI, IMMGWLP_IMC, (LONG_PTR)pimeui->hIMC, FALSE); + NtUserSetWindowLongPtr(hwndUI, IMMGWLP_IMC, (LONG_PTR)pimeui->hIMC, FALSE); Quit: IMM_FN(ImmUnlockImeDpi)(pImeDpi); diff --git a/win32ss/user/user32/windows/class.c b/win32ss/user/user32/windows/class.c index 376c91c3122..95b9c262315 100644 --- a/win32ss/user/user32/windows/class.c +++ b/win32ss/user/user32/windows/class.c @@ -1829,7 +1829,7 @@ SetWindowWord ( HWND hWnd,int nIndex,WORD wNewWord ) } break; } - return NtUserSetWindowLong( hWnd, nIndex, wNewWord, FALSE ); + return (WORD)NtUserSetWindowLongPtr(hWnd, nIndex, wNewWord, FALSE); } /* @@ -1843,7 +1843,7 @@ SetWindowLongA( int nIndex, LONG dwNewLong) { - return NtUserSetWindowLong(hWnd, nIndex, dwNewLong, TRUE); + return (LONG)NtUserSetWindowLongPtr(hWnd, nIndex, dwNewLong, TRUE); } /* @@ -1856,7 +1856,7 @@ SetWindowLongW( int nIndex, LONG dwNewLong) { - return NtUserSetWindowLong(hWnd, nIndex, dwNewLong, FALSE); + return (LONG)NtUserSetWindowLongPtr(hWnd, nIndex, dwNewLong, FALSE); } #ifdef _WIN64
2 years, 4 months
1
0
0
0
← Newer
1
2
3
4
5
6
7
8
9
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
Results per page:
10
25
50
100
200