From 6671999847d98ba8a9970c11daa17bf0d06f1e87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Mon, 11 Aug 2014 15:37:01 +0000 Subject: [PATCH] [CONSRV]: Support reverse video bit COMMON_LVB_REVERSE_VIDEO svn path=/branches/condrv_restructure/; revision=63865 --- win32ss/user/winsrv/consrv/include/settings.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/win32ss/user/winsrv/consrv/include/settings.h b/win32ss/user/winsrv/consrv/include/settings.h index be00e502073..fcef0f18b58 100644 --- a/win32ss/user/winsrv/consrv/include/settings.h +++ b/win32ss/user/winsrv/consrv/include/settings.h @@ -51,10 +51,14 @@ typedef struct _CONSOLE_INFO WCHAR ConsoleTitle[MAX_PATH + 1]; } CONSOLE_INFO, *PCONSOLE_INFO; +/* + * BYTE Foreground = LOBYTE(Attributes) & 0x0F; + * BYTE Background = (LOBYTE(Attributes) & 0xF0) >> 4; + */ #define RGBFromAttrib(Console, Attribute) ((Console)->Colors[(Attribute) & 0xF]) -#define TextAttribFromAttrib(Attribute) ((Attribute) & 0xF) -#define BkgdAttribFromAttrib(Attribute) (((Attribute) >> 4) & 0xF) -#define MakeAttrib(TextAttrib, BkgdAttrib) (DWORD)((((BkgdAttrib) & 0xF) << 4) | ((TextAttrib) & 0xF)) +#define TextAttribFromAttrib(Attribute) ( !((Attribute) & COMMON_LVB_REVERSE_VIDEO) ? (Attribute) & 0xF : ((Attribute) >> 4) & 0xF ) +#define BkgdAttribFromAttrib(Attribute) ( !((Attribute) & COMMON_LVB_REVERSE_VIDEO) ? ((Attribute) >> 4) & 0xF : (Attribute) & 0xF ) +#define MakeAttrib(TextAttrib, BkgdAttrib) (USHORT)((((BkgdAttrib) & 0xF) << 4) | ((TextAttrib) & 0xF)) /* * Structure used to communicate with console.dll