[PATCH 1/2] [WProcs]: let vxd.c be independant of code/file for winedos.dll
Eric Pouech
eric.pouech at orange.fr
Sun Oct 18 06:22:55 CDT 2009
A+
---
dlls/winedos/vxd.c | 40 ++++++++++++++++++++++++++++++++++++++--
1 files changed, 38 insertions(+), 2 deletions(-)
diff --git a/dlls/winedos/vxd.c b/dlls/winedos/vxd.c
index a719c30..fa66691 100644
--- a/dlls/winedos/vxd.c
+++ b/dlls/winedos/vxd.c
@@ -41,11 +41,39 @@
#include "wingdi.h"
#include "winuser.h"
#include "wine/winbase16.h"
-#include "dosexe.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(vxd);
+#define AX_reg(context) ((WORD)(context)->Eax)
+#define BX_reg(context) ((WORD)(context)->Ebx)
+#define CX_reg(context) ((WORD)(context)->Ecx)
+#define DX_reg(context) ((WORD)(context)->Edx)
+#define SI_reg(context) ((WORD)(context)->Esi)
+#define DI_reg(context) ((WORD)(context)->Edi)
+
+#define SET_AX(context,val) ((void)((context)->Eax = ((context)->Eax & ~0xffff) | (WORD)(val)))
+#define SET_BX(context,val) ((void)((context)->Ebx = ((context)->Ebx & ~0xffff) | (WORD)(val)))
+#define SET_CX(context,val) ((void)((context)->Ecx = ((context)->Ecx & ~0xffff) | (WORD)(val)))
+#define SET_DX(context,val) ((void)((context)->Edx = ((context)->Edx & ~0xffff) | (WORD)(val)))
+#define SET_SI(context,val) ((void)((context)->Esi = ((context)->Esi & ~0xffff) | (WORD)(val)))
+#define SET_DI(context,val) ((void)((context)->Edi = ((context)->Edi & ~0xffff) | (WORD)(val)))
+
+#define SET_AL(context,val) ((void)((context)->Eax = ((context)->Eax & ~0xff) | (BYTE)(val)))
+#define SET_BL(context,val) ((void)((context)->Ebx = ((context)->Ebx & ~0xff) | (BYTE)(val)))
+#define SET_CL(context,val) ((void)((context)->Ecx = ((context)->Ecx & ~0xff) | (BYTE)(val)))
+#define SET_DL(context,val) ((void)((context)->Edx = ((context)->Edx & ~0xff) | (BYTE)(val)))
+
+#define SET_AH(context,val) ((void)((context)->Eax = ((context)->Eax & ~0xff00) | (((BYTE)(val)) << 8)))
+#define SET_BH(context,val) ((void)((context)->Ebx = ((context)->Ebx & ~0xff00) | (((BYTE)(val)) << 8)))
+#define SET_CH(context,val) ((void)((context)->Ecx = ((context)->Ecx & ~0xff00) | (((BYTE)(val)) << 8)))
+#define SET_DH(context,val) ((void)((context)->Edx = ((context)->Edx & ~0xff00) | (((BYTE)(val)) << 8)))
+
+#define SET_CFLAG(context) ((context)->EFlags |= 0x0001)
+#define RESET_CFLAG(context) ((context)->EFlags &= ~0x0001)
+#define SET_ZFLAG(context) ((context)->EFlags |= 0x0040)
+#define RESET_ZFLAG(context) ((context)->EFlags &= ~0x0040)
+
#define W32S_APP2WINE(addr) ((addr)? (DWORD)(addr) + W32S_offset : 0)
#define W32S_WINE2APP(addr) ((addr)? (DWORD)(addr) - W32S_offset : 0)
@@ -61,7 +89,15 @@ static UINT W32S_offset;
static WORD VXD_WinVersion(void)
{
- WORD version = LOWORD(GetVersion16());
+ RTL_OSVERSIONINFOEXW info;
+ WORD version;
+
+ info.dwOSVersionInfoSize = sizeof(info);
+ if (!RtlGetVersion(&info) && info.dwMajorVersion <= 3)
+ version = MAKEWORD(info.dwMajorVersion, info.dwMinorVersion);
+ else
+ version = MAKEWORD(3, 95);
+
return (version >> 8) | (version << 8);
}
More information about the wine-patches
mailing list