Author: hbelusca
Date: Sun Jun 8 23:02:40 2014
New Revision: 63573
URL:
http://svn.reactos.org/svn/reactos?rev=63573&view=rev
Log:
[CONSRV]: Use InterlockedExchange16 to exchange Begin and End COORD structure members.
Modified:
trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/conwnd.c
Modified: trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/conwnd.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
==============================================================================
--- trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/conwnd.c [iso-8859-1]
(original)
+++ trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/conwnd.c [iso-8859-1] Sun Jun
8 23:02:40 2014
@@ -12,7 +12,7 @@
/* INCLUDES *******************************************************************/
#include <consrv.h>
-
+#include <intrin.h>
#include <windowsx.h>
#define NDEBUG
@@ -694,17 +694,8 @@
/* Exchange Begin / End if Begin > End lexicographically */
if (Begin->Y > End->Y || (Begin->Y == End->Y && Begin->X
> End->X))
{
- SHORT tmp;
-
- // End->X = InterlockedExchange16(&Begin->X, End->X);
- tmp = Begin->X;
- Begin->X = End->X;
- End->X = tmp;
-
- // End->Y = InterlockedExchange16(&Begin->Y, End->Y);
- tmp = Begin->Y;
- Begin->Y = End->Y;
- End->Y = tmp;
+ End->X = _InterlockedExchange16(&Begin->X, End->X);
+ End->Y = _InterlockedExchange16(&Begin->Y, End->Y);
}
}