Re: W32API fixes + ddk/kbdmou.h
Bart Oldeman <[email protected]> Wed, 12 May 2004 12:33:20 +0100 (BST)
| Newsgroups | gmane.comp.gnu.mingw.patches |
|---|---|
| Message-ID | <[email protected]> |
This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. Send mail to mime-oOUblnuQwHKola3qYQ6TW/IULO3mGbRi9nwVQlTi/[email protected] for more info. --------------050809070804000808050001 Content-Type: TEXT/PLAIN; CHARSET=US-ASCII; FORMAT=flowed Content-ID: <Pine.LNX.4.44.0405121226492.21032-DZH5PN12C3fu5xyx1z5Pl7VCufUGDwFn@public.gmane.org> On Tue, 11 May 2004, Filip Navara wrote: +/* FIXME: What to do with WATCOM? */ +#ifndef DECLSPEC_ALIGN +#ifdef __GNUC__ +#define DECLSPEC_ALIGN(x) __attribute__((aligned(x))) +#else +#define DECLSPEC_ALIGN(x) +#endif +#endif just to answer this one: currently that's only possible using #pragma pack. Anyway, not so important since Open Watcom can't use the ddk right now for other reasons. I did have to do some changes for the directx files, because they use __attribute__ unconditionally -- I'll feed them back at some later stage but this is not so urgent, it's just in the interest of both MingW and OW to keep the differences as small as possible. Bart --------------050809070804000808050001 Content-Type: TEXT/PLAIN; NAME="patch1.diff" Content-ID: <Pine.LNX.4.44.0405121226493.21032-DZH5PN12C3fu5xyx1z5Pl7VCufUGDwFn@public.gmane.org> Content-Description: Content-Disposition: INLINE; FILENAME="patch1.diff" 2004-05-11 Filip Navara <xnavara-VIXq6x/[email protected]> * include/winnt.h (DECLSPEC_ALIGN): Define. (LARGE_INTEGER): Correct alignment. * include/ddk/kbdmou.h: New file. * lib/ddk/videoprt.def (VideoPortMapBankedMemory, VideoPortMapDmaMemory, VideoPortMapMemory): Correct suffix. * lib/ddk/ntoskrnl.def (_snprintf, _snwprintf, _vsnprintf, _vsnwprintf, sprintf, swprintf): Export. --- include/winnt.h Sat Feb 21 10:20:34 2004 +++ include/winnt.h Tue May 11 12:38:16 2004 @@ -43,6 +43,15 @@ #define UNALIGNED #endif +/* FIXME: What to do with WATCOM? */ +#ifndef DECLSPEC_ALIGN +#ifdef __GNUC__ +#define DECLSPEC_ALIGN(x) __attribute__((aligned(x))) +#else +#define DECLSPEC_ALIGN(x) +#endif +#endif + #ifndef VOID #define VOID void #endif @@ -1962,7 +1973,7 @@ PEXCEPTION_RECORD ExceptionRecord; PCONTEXT ContextRecord; } EXCEPTION_POINTERS,*PEXCEPTION_POINTERS,*LPEXCEPTION_POINTERS; -typedef union _LARGE_INTEGER { +typedef union DECLSPEC_ALIGN(8) _LARGE_INTEGER { struct { DWORD LowPart; LONG HighPart; --- /dev/null Tue May 11 13:13:44 2004 +++ include/ddk/kbdmou.h Sat May 8 15:14:52 2004 @@ -0,0 +1,91 @@ +/* + * kbdmou.h + * + * Structures and definitions for Keyboard/Mouse class and port drivers. + * + * This file is part of the w32api package. + * + * Contributors: + * Created by Filip Navara <xnavara-VIXq6x/[email protected]> + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + */ + +#ifndef __KBDMOU_H +#define __KBDMOU_H + +#include <ddk/ntddkbd.h> +#include <ddk/ntddmou.h> + +#define DD_KEYBOARD_PORT_DEVICE_NAME "\\Device\\KeyboardPort" +#define DD_KEYBOARD_PORT_DEVICE_NAME_U L"\\Device\\KeyboardPort" +#define DD_KEYBOARD_PORT_BASE_NAME_U L"KeyboardPort" +#define DD_POINTER_PORT_DEVICE_NAME "\\Device\\PointerPort" +#define DD_POINTER_PORT_DEVICE_NAME_U L"\\Device\\PointerPort" +#define DD_POINTER_PORT_BASE_NAME_U L"PointerPort" + +#define DD_KEYBOARD_CLASS_BASE_NAME_U L"KeyboardClass" +#define DD_POINTER_CLASS_BASE_NAME_U L"PointerClass" + +#define DD_KEYBOARD_RESOURCE_CLASS_NAME_U L"Keyboard" +#define DD_POINTER_RESOURCE_CLASS_NAME_U L"Pointer" +#define DD_KEYBOARD_MOUSE_COMBO_RESOURCE_CLASS_NAME_U L"Keyboard/Pointer" + +#define POINTER_PORTS_MAXIMUM 8 +#define KEYBOARD_PORTS_MAXIMUM 8 + +#define KBDMOU_COULD_NOT_SEND_COMMAND 0x0000 +#define KBDMOU_COULD_NOT_SEND_PARAM 0x0001 +#define KBDMOU_NO_RESPONSE 0x0002 +#define KBDMOU_INCORRECT_RESPONSE 0x0004 + +#define I8042_ERROR_VALUE_BASE 1000 +#define INPORT_ERROR_VALUE_BASE 2000 +#define SERIAL_MOUSE_ERROR_VALUE_BASE 3000 + +#define IOCTL_INTERNAL_KEYBOARD_CONNECT \ + CTL_CODE(FILE_DEVICE_KEYBOARD, 0x0080, METHOD_NEITHER, FILE_ANY_ACCESS) + +#define IOCTL_INTERNAL_KEYBOARD_DISCONNECT \ + CTL_CODE(FILE_DEVICE_KEYBOARD,0x0100, METHOD_NEITHER, FILE_ANY_ACCESS) + +#define IOCTL_INTERNAL_KEYBOARD_ENABLE \ + CTL_CODE(FILE_DEVICE_KEYBOARD, 0x0200, METHOD_NEITHER, FILE_ANY_ACCESS) + +#define IOCTL_INTERNAL_KEYBOARD_DISABLE \ + CTL_CODE(FILE_DEVICE_KEYBOARD, 0x0400, METHOD_NEITHER, FILE_ANY_ACCESS) + +#define IOCTL_INTERNAL_MOUSE_CONNECT \ + CTL_CODE(FILE_DEVICE_MOUSE, 0x0080, METHOD_NEITHER, FILE_ANY_ACCESS) + +#define IOCTL_INTERNAL_MOUSE_DISCONNECT \ + CTL_CODE(FILE_DEVICE_MOUSE, 0x0100, METHOD_NEITHER, FILE_ANY_ACCESS) + +#define IOCTL_INTERNAL_MOUSE_ENABLE \ + CTL_CODE(FILE_DEVICE_MOUSE, 0x0200, METHOD_NEITHER, FILE_ANY_ACCESS) + +#define IOCTL_INTERNAL_MOUSE_DISABLE \ + CTL_CODE(FILE_DEVICE_MOUSE, 0x0400, METHOD_NEITHER, FILE_ANY_ACCESS) + +typedef struct _CONNECT_DATA { + PDEVICE_OBJECT ClassDeviceObject; + PVOID ClassService; +} CONNECT_DATA, *PCONNECT_DATA; + +typedef VOID +(STDAPICALLTYPE *PSERVICE_CALLBACK_ROUTINE)( + IN PVOID NormalContext, + IN PVOID SystemArgument1, + IN PVOID SystemArgument2, + IN OUT PVOID SystemArgument3); + +#endif /* __KBDMOU_H */ --- lib/ddk/videoprt.def Tue May 11 13:07:42 2004 +++ lib/ddk/videoprt.def Tue May 11 12:11:56 2004 @@ -53,9 +53,9 @@ VideoPortLockBuffer@16 VideoPortLockPages@20 VideoPortLogError@16 -VideoPortMapBankedMemory@36 -VideoPortMapDmaMemory@32 -VideoPortMapMemory@20 +VideoPortMapBankedMemory@40 +VideoPortMapDmaMemory@36 +VideoPortMapMemory@24 VideoPortMoveMemory@12 VideoPortPutDmaAdapter@8 VideoPortQueryPerformanceCounter@8 --- lib/ddk/ntoskrnl.def Tue May 11 13:06:38 2004 +++ lib/ddk/ntoskrnl.def Tue May 11 12:13:24 2004 @@ -1390,8 +1390,8 @@ ;_itow ;_local_unwind2 ;_purecall -;_snprintf -;_snwprintf +_snprintf +_snwprintf _stricmp _strlwr _strnicmp @@ -1399,8 +1399,8 @@ _strrev _strset _strupr -;_vsnprintf -;_vsnwprintf +_vsnprintf +_vsnwprintf _wcsicmp@8 _wcslwr@4 _wcsnicmp@12 @@ -1423,7 +1423,7 @@ memset ;qsort ;rand -;sprintf +sprintf ;srand strcat strchr @@ -1436,7 +1436,7 @@ strrchr strspn strstr -;swprintf +swprintf ;tolower ;toupper ;towlower --------------050809070804000808050001-- ------------------------------------------------------- This SF.Net email is sponsored by Sleepycat Software Learn developer strategies Cisco, Motorola, Ericsson & Lucent use to deliver higher performing products faster, at low TCO. http://www.sleepycat.com/telcomwpreg.php?From=osdnemail3