winedos: Don't import kernel 16-bit version functions.

This commit is contained in:
Alexandre Julliard 2009-10-07 18:05:22 +02:00
parent 4496f281d8
commit 3b3112cb4d
1 changed files with 54 additions and 2 deletions

View File

@ -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 */