Alexandre Julliard : winedos: Don't import kernel 16-bit version functions.
Alexandre Julliard
julliard at winehq.org
Thu Oct 8 08:57:11 CDT 2009
Module: wine
Branch: master
Commit: 3b3112cb4dc46b847467c512b33d30179521b18e
URL: http://source.winehq.org/git/wine.git/?a=commit;h=3b3112cb4dc46b847467c512b33d30179521b18e
Author: Alexandre Julliard <julliard at winehq.org>
Date: Wed Oct 7 18:05:22 2009 +0200
winedos: Don't import kernel 16-bit version functions.
---
dlls/winedos/int2f.c | 56 ++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 54 insertions(+), 2 deletions(-)
diff --git a/dlls/winedos/int2f.c b/dlls/winedos/int2f.c
index c5b620f..d5353ab 100644
--- a/dlls/winedos/int2f.c
+++ b/dlls/winedos/int2f.c
@@ -63,6 +63,58 @@ typedef struct
static void do_int2f_16( CONTEXT86 *context );
static void MSCDEX_Handler( CONTEXT86 *context );
+/***********************************************************************
+ * GetVersion (KERNEL.3)
+ *
+ * FIXME: Duplicated from kernel since it's a 16-bit function.
+ */
+DWORD WINAPI GetVersion16(void)
+{
+ static WORD dosver, winver;
+
+ if (!dosver) /* not determined yet */
+ {
+ RTL_OSVERSIONINFOEXW info;
+
+ info.dwOSVersionInfoSize = sizeof(info);
+ if (RtlGetVersion( &info )) return 0;
+
+ if (info.dwMajorVersion <= 3)
+ winver = MAKEWORD( info.dwMajorVersion, info.dwMinorVersion );
+ else
+ winver = MAKEWORD( 3, 95 );
+
+ switch(info.dwPlatformId)
+ {
+ case VER_PLATFORM_WIN32s:
+ switch(MAKELONG( info.dwMinorVersion, info.dwMajorVersion ))
+ {
+ case 0x0200:
+ dosver = 0x0303; /* DOS 3.3 for Windows 2.0 */
+ break;
+ case 0x0300:
+ dosver = 0x0500; /* DOS 5.0 for Windows 3.0 */
+ break;
+ default:
+ dosver = 0x0616; /* DOS 6.22 for Windows 3.1 and later */
+ break;
+ }
+ break;
+ case VER_PLATFORM_WIN32_WINDOWS:
+ /* DOS 8.0 for WinME, 7.0 for Win95/98 */
+ if (info.dwMinorVersion >= 90) dosver = 0x0800;
+ else dosver = 0x0700;
+ break;
+ case VER_PLATFORM_WIN32_NT:
+ dosver = 0x0500; /* always DOS 5.0 for NT */
+ break;
+ }
+ TRACE( "DOS %d.%02d Win %d.%02d\n",
+ HIBYTE(dosver), LOBYTE(dosver), LOBYTE(winver), HIBYTE(winver) );
+ }
+ return MAKELONG( winver, dosver );
+}
+
/**********************************************************************
* DOSVM_Int2fHandler (WINEDOS16.147)
*
@@ -327,13 +379,13 @@ static void do_int2f_16( CONTEXT86 *context )
switch(LOBYTE(context->Eax))
{
case 0x00: /* Windows enhanced mode installation check */
- SET_AX( context, (GetWinFlags16() & WF_ENHANCED) ? LOWORD(GetVersion16()) : 0 );
+ SET_AX( context, LOWORD(GetVersion16()) );
break;
case 0x0a: /* Get Windows version and type */
SET_AX( context, 0 );
SET_BX( context, (LOWORD(GetVersion16()) << 8) | (LOWORD(GetVersion16()) >> 8) );
- SET_CX( context, (GetWinFlags16() & WF_ENHANCED) ? 3 : 2 );
+ SET_CX( context, 3 );
break;
case 0x0b: /* Identify Windows-aware TSRs */
More information about the wine-cvs
mailing list