ChangeLog: * dlls/winedos/int21.c * dlls/kernel/kernel32.spec * msdos/dosmem.c * msdos/int21.c * include/miscemu.h Move codepage functions of int21 to winedos. nog.
--- msdos/int21.c.a2 2002-11-09 07:30:39.000000000 +0200 +++ msdos/int21.c 2002-11-09 07:52:50.000000000 +0200 @@ -122,7 +122,6 @@ }; -WORD CodePage = 437; DWORD dpbsegptr; struct DosHeap { @@ -1747,67 +1746,6 @@ } break; - case 0x65:{/* GET EXTENDED COUNTRY INFORMATION */ - BYTE *dataptr=CTX_SEG_OFF_TO_LIN(context, context->SegEs,context->Edi); - TRACE("GET EXTENDED COUNTRY INFORMATION code page %d country %d\n", - BX_reg(context), DX_reg(context)); - switch (AL_reg(context)) { - case 0x01: - TRACE("\tget general internationalization info\n"); - dataptr[0] = 0x1; - *(WORD*)(dataptr+1) = 41; - *(WORD*)(dataptr+3) = GetSystemDefaultLangID(); - *(WORD*)(dataptr+5) = CodePage; - *(DWORD*)(dataptr+0x19) = 0; /* FIXME: ptr to case map routine */ - break; - case 0x06: - TRACE("\tget pointer to collating sequence table\n"); - dataptr[0] = 0x06; - *(DWORD*)(dataptr+1) = MAKELONG(DOSMEM_CollateTable & 0xFFFF,DOSMEM_AllocSelector(DOSMEM_CollateTable>>16)); - SET_CX( context, 258 );/*FIXME: size of table?*/ - break; - case 0x20: - TRACE("\tConvert char to uppercase\n"); - SET_DL( context, toupper(DL_reg(context)) ); - break; - case 0x21: - TRACE("\tconvert string to uppercase with length\n"); - { - char *ptr = (char *)CTX_SEG_OFF_TO_LIN(context,context->SegDs,context->Edx); - WORD len = CX_reg(context); - while (len--) { *ptr = toupper(*ptr); ptr++; } - } - break; - case 0x22: - TRACE("\tConvert ASCIIZ string to uppercase\n"); - _strupr( (LPSTR)CTX_SEG_OFF_TO_LIN(context,context->SegDs,context->Edx) ); - break; - default: - TRACE("\tunimplemented function %d\n",AL_reg(context)); - INT_BARF( context, 0x21 ); - SET_CFLAG(context); - break; - } - break; - } - case 0x66: /* GLOBAL CODE PAGE TABLE */ - switch (AL_reg(context)) - { - case 0x01: - TRACE("GET GLOBAL CODE PAGE TABLE\n"); - SET_BX( context, CodePage ); - SET_DX( context, CodePage ); - RESET_CFLAG(context); - break; - case 0x02: - TRACE("SET GLOBAL CODE PAGE TABLE active page %d system page %d\n", - BX_reg(context),DX_reg(context)); - CodePage = BX_reg(context); - RESET_CFLAG(context); - break; - } - break; - case 0x67: /* SET HANDLE COUNT */ TRACE("SET HANDLE COUNT to %d\n",BX_reg(context) ); SetHandleCount16( BX_reg(context) ); --- dlls/winedos/int21.c.a2 2002-11-09 07:31:07.000000000 +0200 +++ dlls/winedos/int21.c 2002-11-09 07:52:52.000000000 +0200 @@ -37,6 +37,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(int21); +WORD CodePage = 437; + void WINAPI DOSVM_Int21Handler_Ioctl( CONTEXT86 *context ) { static const WCHAR emmxxxx0W[] = {'E','M','M','X','X','X','X','0',0}; @@ -518,6 +520,75 @@ SET_CFLAG(context); break; + case 0x65: /* GET EXTENDED COUNTRY INFORMATION */ + { + BYTE *dataptr = CTX_SEG_OFF_TO_LIN(context, context->SegEs, + context->Edi); + TRACE("GET EXTENDED COUNTRY INFORMATION code page %d country %d\n", + BX_reg(context), DX_reg(context)); + switch (AL_reg(context)) { + case 0x01: + TRACE("\tget general internationalization info\n"); + dataptr[0] = 0x1; + *(WORD*)(dataptr+1) = 41; + *(WORD*)(dataptr+3) = GetSystemDefaultLangID(); + *(WORD*)(dataptr+5) = CodePage; + *(DWORD*)(dataptr+0x19) = 0; /* FIXME: ptr to case map routine */ + break; + case 0x06: + TRACE("\tget pointer to collating sequence table\n"); + dataptr[0] = 0x06; + *(DWORD*)(dataptr+1) = + MAKELONG(*DOSMEM_GetCollateTable() & 0xFFFF, + DOSMEM_AllocSelector(*DOSMEM_GetCollateTable() >> 16)); + SET_CX(context, 258);/*FIXME: size of table?*/ + break; + case 0x20: + TRACE("\tConvert char to uppercase\n"); + SET_DL(context, toupper(DL_reg(context))); + break; + case 0x21: + TRACE("\tconvert string to uppercase with length\n"); + { + char *ptr = (char *)CTX_SEG_OFF_TO_LIN(context, + context->SegDs, + context->Edx); + WORD len = CX_reg(context); + while (len--) { *ptr = toupper(*ptr); ptr++; } + } + break; + case 0x22: + TRACE("\tConvert ASCIIZ string to uppercase\n"); + _strupr((LPSTR)CTX_SEG_OFF_TO_LIN(context, context->SegDs, + context->Edx)); + break; + default: + TRACE("\tunimplemented function %d\n",AL_reg(context)); + INT_BARF(context, 0x21); + SET_CFLAG(context); + break; + } + break; + } + + case 0x66: /* GLOBAL CODE PAGE TABLE */ + switch (AL_reg(context)) + { + case 0x01: + TRACE("GET GLOBAL CODE PAGE TABLE\n"); + SET_BX( context, CodePage ); + SET_DX( context, CodePage ); + RESET_CFLAG(context); + break; + case 0x02: + TRACE("SET GLOBAL CODE PAGE TABLE active page %d system page %d\n", + BX_reg(context),DX_reg(context)); + CodePage = BX_reg(context); + RESET_CFLAG(context); + break; + } + break; + case 0x68: /* "FFLUSH" - COMMIT FILE */ case 0x6a: /* COMMIT FILE */ TRACE("FFLUSH/COMMIT handle %d\n",BX_reg(context)); --- dlls/kernel/kernel32.spec.a2 2002-11-09 06:22:51.000000000 +0200 +++ dlls/kernel/kernel32.spec 2002-11-09 07:50:08.000000000 +0200 @@ -1036,9 +1036,11 @@ # Wine dll separation hacks, these will go away, don't use them # @ cdecl DOSFS_GetDeviceByHandle(long) DOSFS_GetDeviceByHandle +@ cdecl DOSMEM_AllocSelector(long) DOSMEM_AllocSelector @ cdecl DOSMEM_Available() DOSMEM_Available @ cdecl DOSMEM_FreeBlock(ptr) DOSMEM_FreeBlock @ cdecl DOSMEM_GetBlock(long ptr) DOSMEM_GetBlock +@ cdecl DOSMEM_GetCollateTable() DOSMEM_GetCollateTable @ cdecl DOSMEM_GetDPMISegments() DOSMEM_GetDPMISegments @ cdecl DOSMEM_Init(long) DOSMEM_Init @ cdecl INT_GetPMHandler(long) INT_GetPMHandler Index: msdos/dosmem.c =================================================================== RCS file: /home/wine/wine/msdos/dosmem.c,v retrieving revision 1.44 diff -u -r1.44 dosmem.c --- msdos/dosmem.c 4 Nov 2002 22:35:15 -0000 1.44 +++ msdos/dosmem.c 9 Nov 2002 11:56:03 -0000 @@ -368,6 +368,16 @@ } /*********************************************************************** + * DOSMEM_GetCollateTable + * + * Returns a pointer to the collate table + */ +DWORD *DOSMEM_GetCollateTable() +{ + return &DOSMEM_CollateTable; +} + +/*********************************************************************** * DOSMEM_InitCollateTable * * Initialises the collate table (character sorting, language dependent) Index: include/miscemu.h =================================================================== RCS file: /home/wine/wine/include/miscemu.h,v retrieving revision 1.56 diff -u -r1.56 miscemu.h --- include/miscemu.h 29 Oct 2002 23:09:30 -0000 1.56 +++ include/miscemu.h 9 Nov 2002 12:00:39 -0000 @@ -162,7 +162,6 @@ extern WORD DOSMEM_0000H; extern WORD DOSMEM_BiosDataSeg; extern WORD DOSMEM_BiosSysSeg; -extern DWORD DOSMEM_CollateTable; /* various real-mode code stubs */ struct DPMI_segments @@ -188,6 +187,7 @@ extern void DOSMEM_Tick(WORD timer); extern WORD DOSMEM_AllocSelector(WORD); extern LPVOID DOSMEM_GetBlock(UINT size, WORD* p); +extern DWORD *DOSMEM_GetCollateTable(); extern BOOL DOSMEM_FreeBlock(void* ptr); extern LPVOID DOSMEM_ResizeBlock(void* ptr, UINT size, WORD* p); extern UINT DOSMEM_Available(void);