ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
May 2005
----- 2025 -----
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
26 participants
814 discussions
Start a n
N
ew thread
[gvg] 15359: Add typecasts to avoid any possibility of signed/unsigned mismatch warnings
by gvg@svn.reactos.com
Add typecasts to avoid any possibility of signed/unsigned mismatch warnings Modified: branches/xen/reactos/boot/freeldr/freeldr/arch/i386/xenvideo.c _____ Modified: branches/xen/reactos/boot/freeldr/freeldr/arch/i386/xenvideo.c --- branches/xen/reactos/boot/freeldr/freeldr/arch/i386/xenvideo.c 2005-05-16 20:42:36 UTC (rev 15358) +++ branches/xen/reactos/boot/freeldr/freeldr/arch/i386/xenvideo.c 2005-05-16 21:20:48 UTC (rev 15359) @@ -84,7 +84,7 @@ { for (X = 0; X < COLS; X++) { - ShadowBuffer[2 * (Y * COLS + X)] = ' '; + ShadowBuffer[2 * (Y * COLS + X)] = (UCHAR) ' '; ShadowBuffer[2 * (Y * COLS + X) + 1] = Attr; } } @@ -124,7 +124,7 @@ } } - if (Ch != ShadowBuffer[2 * (Y * COLS + X)] + if ((UCHAR) Ch != ShadowBuffer[2 * (Y * COLS + X)] || Attr != ShadowBuffer[2 * (Y * COLS + X) + 1]) { if (X != CurrentX || Y != CurrentY) @@ -138,7 +138,7 @@ XenConsPutChar(Ch); CurrentX++; - ShadowBuffer[2 * (Y * COLS + X)] = Ch; + ShadowBuffer[2 * (Y * COLS + X)] = (UCHAR) Ch; ShadowBuffer[2 * (Y * COLS + X) + 1] = Attr; } }
19 years, 7 months
1
0
0
0
[greatlrd] 15358: Drop GDI version of dinput complete and add user hook version of dinput
by greatlrd@svn.reactos.com
Drop GDI version of dinput complete and add user hook version of dinput keyboard.c thx GvG for finding the problem in reactos with user hook and implement userhook mouse.c keep one gdi stuff left but rewrite it to userhook poll mouse poll mouse need to be rewrite so it fix last bug for user hook it is it move the mouse to another locations but it should stand still. when it insate. then we can share the code with wine Added: trunk/reactos/lib/dinput/keyboard.c Modified: trunk/reactos/lib/dinput/mouse.c _____ Added: trunk/reactos/lib/dinput/keyboard.c --- trunk/reactos/lib/dinput/keyboard.c 2005-05-16 20:36:26 UTC (rev 15357) +++ trunk/reactos/lib/dinput/keyboard.c 2005-05-16 20:42:36 UTC (rev 15358) @@ -0,0 +1,827 @@ +/* DirectInput Keyboard device + * + * Copyright 1998 Marcus Meissner + * Copyright 1998,1999 Lionel Ulmer + * Copyright 2000-2001 TransGaming Technologies Inc. + * Copyright 2005 Raphael Junqueira + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "config.h" +#include "wine/port.h" + +#include <stdarg.h> +#include <string.h> +#include "windef.h" +#include "winbase.h" +#include "winuser.h" +#include "winerror.h" +#include "dinput.h" + +#include "dinput_private.h" +#include "device_private.h" +#include "wine/debug.h" +#include "wine/unicode.h" + +WINE_DEFAULT_DEBUG_CHANNEL(dinput); + +#define WINE_DINPUT_KEYBOARD_MAX_KEYS 256 + +static IDirectInputDevice8AVtbl SysKeyboardAvt; +static IDirectInputDevice8WVtbl SysKeyboardWvt; + +typedef struct SysKeyboardImpl SysKeyboardImpl; +struct SysKeyboardImpl +{ + LPVOID lpVtbl; + DWORD ref; + GUID guid; + + IDirectInputImpl* dinput; + + HANDLE hEvent; + /* SysKeyboardAImpl */ + int acquired; + int buffersize; /* set in 'SetProperty' */ + LPDIDEVICEOBJECTDATA buffer; /* buffer for 'GetDeviceData'. + Alloc at 'Acquire', Free at + 'Unacquire' */ + int count; /* number of objects in use in + 'buffer' */ + int start; /* 'buffer' rotates. This is the + first in use (if count > 0) */ + BOOL overflow; /* return DI_BUFFEROVERFLOW in + 'GetDeviceData' */ + CRITICAL_SECTION crit; +}; + +static SysKeyboardImpl* current_lock = NULL; +/* Today's acquired device + * FIXME: currently this can be only one. + * Maybe this should be a linked list or st. + * I don't know what the rules are for multiple acquired keyboards, + * but 'DI_LOSTFOCUS' and 'DI_UNACQUIRED' exist for a reason. +*/ + +static BYTE DInputKeyState[WINE_DINPUT_KEYBOARD_MAX_KEYS]; /* array for 'GetDeviceState' */ + +static CRITICAL_SECTION keyboard_crit; +static CRITICAL_SECTION_DEBUG critsect_debug = +{ + 0, 0, &keyboard_crit, + { &critsect_debug.ProcessLocksList, &critsect_debug.ProcessLocksList }, + 0, 0, { 0, (DWORD)(__FILE__ ": keyboard_crit") } +}; +static CRITICAL_SECTION keyboard_crit = { &critsect_debug, -1, 0, 0, 0, 0 }; + +static DWORD keyboard_users = 0; +static HHOOK keyboard_hook = NULL; + +LRESULT CALLBACK KeyboardCallback( int code, WPARAM wparam, LPARAM lparam ) +{ + BYTE dik_code; + BOOL down; + DWORD timestamp; + KBDLLHOOKSTRUCT *hook = (KBDLLHOOKSTRUCT *)lparam; + BYTE new_diks; + + TRACE("(%d,%d,%ld)\n", code, wparam, lparam); + + /** returns now if not HC_ACTION */ + if (code != HC_ACTION) return CallNextHookEx(keyboard_hook, code, wparam, lparam); + + { + dik_code = hook->scanCode; + if (hook->flags & LLKHF_EXTENDED) dik_code |= 0x80; + down = !(hook->flags & LLKHF_UP); + timestamp = hook->time; + } + + /** returns now if key event already known */ + new_diks = (down ? 0x80 : 0); + /*if (new_diks != DInputKeyState[dik_code]) return CallNextHookEx(keyboard_hook, code, wparam, lparam); TO BE FIXED */ + + DInputKeyState[dik_code] = new_diks; + TRACE(" setting %02X to %02X\n", dik_code, DInputKeyState[dik_code]); + + if (current_lock != NULL) { + if (current_lock->hEvent) SetEvent(current_lock->hEvent); + + if (current_lock->buffer != NULL) { + int n; + + EnterCriticalSection(&(current_lock->crit)); + + n = (current_lock->start + current_lock->count) % current_lock->buffersize; + + current_lock->buffer[n].dwOfs = dik_code; + current_lock->buffer[n].dwData = down ? 0x80 : 0; + current_lock->buffer[n].dwTimeStamp = timestamp; + current_lock->buffer[n].dwSequence = current_lock->dinput->evsequence++; + + TRACE("Adding event at offset %d : %ld - %ld - %ld - %ld\n", n, + current_lock->buffer[n].dwOfs, current_lock->buffer[n].dwData, current_lock->buffer[n].dwTimeStamp, current_lock->buffer[n].dwSequence); + + if (current_lock->count == current_lock->buffersize) { + current_lock->start = ++current_lock->start % current_lock->buffersize; + current_lock->overflow = TRUE; + } else + current_lock->count++; + + LeaveCriticalSection(&(current_lock->crit)); + } + } + return CallNextHookEx(keyboard_hook, code, wparam, lparam); +} + +static GUID DInput_Wine_Keyboard_GUID = { /* 0ab8648a-7735-11d2-8c73-71df54a96441 */ + 0x0ab8648a, + 0x7735, + 0x11d2, + {0x8c, 0x73, 0x71, 0xdf, 0x54, 0xa9, 0x64, 0x41} +}; + +static void fill_keyboard_dideviceinstanceA(LPDIDEVICEINSTANCEA lpddi, int version) { + DWORD dwSize; + DIDEVICEINSTANCEA ddi; + + dwSize = lpddi->dwSize; + + TRACE("%ld %p\n", dwSize, lpddi); + + memset(lpddi, 0, dwSize); + memset(&ddi, 0, sizeof(ddi)); + + ddi.dwSize = dwSize; + ddi.guidInstance = GUID_SysKeyboard;/* DInput's GUID */ + ddi.guidProduct = DInput_Wine_Keyboard_GUID; /* Vendor's GUID */ + if (version >= 8) + ddi.dwDevType = DI8DEVTYPE_KEYBOARD | (DI8DEVTYPEKEYBOARD_UNKNOWN << 8); + else + ddi.dwDevType = DIDEVTYPE_KEYBOARD | (DIDEVTYPEKEYBOARD_UNKNOWN << 8); + strcpy(ddi.tszInstanceName, "Keyboard"); + strcpy(ddi.tszProductName, "Wine Keyboard"); + + memcpy(lpddi, &ddi, (dwSize < sizeof(ddi) ? dwSize : sizeof(ddi))); +} + +static void fill_keyboard_dideviceinstanceW(LPDIDEVICEINSTANCEW lpddi, int version) { + DWORD dwSize; + DIDEVICEINSTANCEW ddi; + + dwSize = lpddi->dwSize; + + TRACE("%ld %p\n", dwSize, lpddi); + + memset(lpddi, 0, dwSize); + memset(&ddi, 0, sizeof(ddi)); + + ddi.dwSize = dwSize; + ddi.guidInstance = GUID_SysKeyboard;/* DInput's GUID */ + ddi.guidProduct = DInput_Wine_Keyboard_GUID; /* Vendor's GUID */ + if (version >= 8) + ddi.dwDevType = DI8DEVTYPE_KEYBOARD | (DI8DEVTYPEKEYBOARD_UNKNOWN << 8); + else + ddi.dwDevType = DIDEVTYPE_KEYBOARD | (DIDEVTYPEKEYBOARD_UNKNOWN << 8); + MultiByteToWideChar(CP_ACP, 0, "Keyboard", -1, ddi.tszInstanceName, MAX_PATH); + MultiByteToWideChar(CP_ACP, 0, "Wine Keyboard", -1, ddi.tszProductName, MAX_PATH); + + memcpy(lpddi, &ddi, (dwSize < sizeof(ddi) ? dwSize : sizeof(ddi))); +} + +static BOOL keyboarddev_enum_deviceA(DWORD dwDevType, DWORD dwFlags, LPDIDEVICEINSTANCEA lpddi, int version, int id) +{ + if (id != 0) + return FALSE; + + if ((dwDevType == 0) || + ((dwDevType == DIDEVTYPE_KEYBOARD) && (version < 8)) || + (((dwDevType == DI8DEVCLASS_KEYBOARD) || (dwDevType == DI8DEVTYPE_KEYBOARD)) && (version >= 8))) { + TRACE("Enumerating the Keyboard device\n"); + + fill_keyboard_dideviceinstanceA(lpddi, version); + + return TRUE; + } + + return FALSE; +} + +static BOOL keyboarddev_enum_deviceW(DWORD dwDevType, DWORD dwFlags, LPDIDEVICEINSTANCEW lpddi, int version, int id) +{ + if (id != 0) + return FALSE; + + if ((dwDevType == 0) || + ((dwDevType == DIDEVTYPE_KEYBOARD) && (version < 8)) || + (((dwDevType == DI8DEVCLASS_KEYBOARD) || (dwDevType == DI8DEVTYPE_KEYBOARD)) && (version >= 8))) { + TRACE("Enumerating the Keyboard device\n"); + + fill_keyboard_dideviceinstanceW(lpddi, version); + + return TRUE; + } + + return FALSE; +} + +static SysKeyboardImpl *alloc_device(REFGUID rguid, LPVOID kvt, IDirectInputImpl *dinput) +{ + SysKeyboardImpl* newDevice; + DWORD kbd_users; + + newDevice = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(SysKeyboardImpl)); + newDevice->lpVtbl = kvt; + newDevice->ref = 1; + memcpy(&(newDevice->guid),rguid,sizeof(*rguid)); + newDevice->dinput = dinput; + InitializeCriticalSection(&(newDevice->crit)); + + EnterCriticalSection(&keyboard_crit); + kbd_users = InterlockedIncrement(&keyboard_users); + if (1 == kbd_users) { + keyboard_hook = SetWindowsHookExW( WH_KEYBOARD_LL, KeyboardCallback, DINPUT_instance, 0 ); + } + LeaveCriticalSection(&keyboard_crit); + + return newDevice; +} + + +static HRESULT keyboarddev_create_deviceA(IDirectInputImpl *dinput, REFGUID rguid, REFIID riid, LPDIRECTINPUTDEVICEA* pdev) +{ + if ((IsEqualGUID(&GUID_SysKeyboard,rguid)) || /* Generic Keyboard */ + (IsEqualGUID(&DInput_Wine_Keyboard_GUID,rguid))) { /* Wine Keyboard */ + if ((riid == NULL) || + IsEqualGUID(&IID_IDirectInputDeviceA,riid) || + IsEqualGUID(&IID_IDirectInputDevice2A,riid) || + IsEqualGUID(&IID_IDirectInputDevice7A,riid) || + IsEqualGUID(&IID_IDirectInputDevice8A,riid)) { + *pdev = (IDirectInputDeviceA*) alloc_device(rguid, &SysKeyboardAvt, dinput); + TRACE("Creating a Keyboard device (%p)\n", *pdev); + return DI_OK; + } else + return DIERR_NOINTERFACE; + } + return DIERR_DEVICENOTREG; +} + +static HRESULT keyboarddev_create_deviceW(IDirectInputImpl *dinput, REFGUID rguid, REFIID riid, LPDIRECTINPUTDEVICEW* pdev) +{ + if ((IsEqualGUID(&GUID_SysKeyboard,rguid)) || /* Generic Keyboard */ + (IsEqualGUID(&DInput_Wine_Keyboard_GUID,rguid))) { /* Wine Keyboard */ + if ((riid == NULL) || + IsEqualGUID(&IID_IDirectInputDeviceW,riid) || + IsEqualGUID(&IID_IDirectInputDevice2W,riid) || + IsEqualGUID(&IID_IDirectInputDevice7W,riid) || + IsEqualGUID(&IID_IDirectInputDevice8W,riid)) { + *pdev = (IDirectInputDeviceW*) alloc_device(rguid, &SysKeyboardWvt, dinput); + TRACE("Creating a Keyboard device (%p)\n", *pdev); + return DI_OK; + } else + return DIERR_NOINTERFACE; + } + return DIERR_DEVICENOTREG; +} + +const struct dinput_device keyboard_device = { + "Wine keyboard driver", + keyboarddev_enum_deviceA, + keyboarddev_enum_deviceW, + keyboarddev_create_deviceA, + keyboarddev_create_deviceW +}; + +static ULONG WINAPI SysKeyboardAImpl_Release(LPDIRECTINPUTDEVICE8A iface) +{ + SysKeyboardImpl *This = (SysKeyboardImpl *)iface; + ULONG ref; + DWORD kbd_users; + + ref = InterlockedDecrement(&(This->ref)); + if (ref) + return ref; + + EnterCriticalSection(&keyboard_crit); + kbd_users = InterlockedDecrement(&keyboard_users); + if (0 == kbd_users) { + UnhookWindowsHookEx( keyboard_hook ); + keyboard_hook = 0; + } + LeaveCriticalSection(&keyboard_crit); + + /* Free the data queue */ + HeapFree(GetProcessHeap(),0,This->buffer); + + DeleteCriticalSection(&(This->crit)); + + HeapFree(GetProcessHeap(),0,This); + return DI_OK; +} + +static HRESULT WINAPI SysKeyboardAImpl_SetProperty( + LPDIRECTINPUTDEVICE8A iface,REFGUID rguid,LPCDIPROPHEADER ph +) +{ + SysKeyboardImpl *This = (SysKeyboardImpl *)iface; + + TRACE("(this=%p,%s,%p)\n",This,debugstr_guid(rguid),ph); + TRACE("(size=%ld,headersize=%ld,obj=%ld,how=%ld\n", + ph->dwSize,ph->dwHeaderSize,ph->dwObj,ph->dwHow); + if (!HIWORD(rguid)) { + switch ((DWORD)rguid) { + case (DWORD) DIPROP_BUFFERSIZE: { + LPCDIPROPDWORD pd = (LPCDIPROPDWORD)ph; + + TRACE("(buffersize=%ld)\n",pd->dwData); + + if (This->acquired) + return DIERR_INVALIDPARAM; + + This->buffersize = pd->dwData; + + break; + } + default: + WARN("Unknown type %ld\n",(DWORD)rguid); + break; + } + } + return DI_OK; +} + +static HRESULT WINAPI SysKeyboardAImpl_GetProperty( + LPDIRECTINPUTDEVICE8A iface,REFGUID rguid,LPDIPROPHEADER ph +) +{ + SysKeyboardImpl *This = (SysKeyboardImpl *)iface; + + TRACE("(this=%p,%s,%p)\n",This,debugstr_guid(rguid),ph); + TRACE("(size=%ld,headersize=%ld,obj=%ld,how=%ld\n", + ph->dwSize,ph->dwHeaderSize,ph->dwObj,ph->dwHow); + if (!HIWORD(rguid)) { + switch ((DWORD)rguid) { + case (DWORD) DIPROP_BUFFERSIZE: { + LPDIPROPDWORD pd = (LPDIPROPDWORD)ph; + + TRACE("(buffersize=%ld)\n",pd->dwData); + + if (This->acquired) + return DIERR_INVALIDPARAM; + + pd->dwData = This->buffersize; + + break; + } + default: + WARN("Unknown type %ld\n",(DWORD)rguid); + break; + } + } + return DI_OK; +} + +static HRESULT WINAPI SysKeyboardAImpl_GetDeviceState( + LPDIRECTINPUTDEVICE8A iface,DWORD len,LPVOID ptr +) +{ + SysKeyboardImpl *This = (SysKeyboardImpl *)iface; + TRACE("(%p)->(%ld,%p)\n", This, len, ptr); + + /* Note: device does not need to be acquired */ + if (len != WINE_DINPUT_KEYBOARD_MAX_KEYS) + return DIERR_INVALIDPARAM; + + MsgWaitForMultipleObjectsEx(0, NULL, 0, QS_ALLINPUT, 0); + + EnterCriticalSection(&(This->crit)); + + if (TRACE_ON(dinput)) { + int i; + for (i = 0; i < WINE_DINPUT_KEYBOARD_MAX_KEYS; i++) { + if (DInputKeyState[i] != 0x00) { + TRACE(" - %02X: %02x\n", i, DInputKeyState[i]); + } + } + } + + memcpy(ptr, DInputKeyState, WINE_DINPUT_KEYBOARD_MAX_KEYS); + LeaveCriticalSection(&(This->crit)); + + return DI_OK; +} + +static HRESULT WINAPI SysKeyboardAImpl_GetDeviceData( + LPDIRECTINPUTDEVICE8A iface,DWORD dodsize,LPDIDEVICEOBJECTDATA dod, + LPDWORD entries,DWORD flags +) +{ + SysKeyboardImpl *This = (SysKeyboardImpl *)iface; + int ret = DI_OK, i = 0; + + TRACE("(this=%p,%ld,%p,%p(%ld)),0x%08lx)\n", + This,dodsize,dod,entries,entries?*entries:0,flags); + + if (This->acquired == 0) + return DIERR_NOTACQUIRED; + + if (This->buffer == NULL) + return DIERR_NOTBUFFERED; + + if (dodsize < sizeof(DIDEVICEOBJECTDATA_DX3)) + return DIERR_INVALIDPARAM; + + MsgWaitForMultipleObjectsEx(0, NULL, 0, QS_ALLINPUT, 0); + + EnterCriticalSection(&(This->crit)); + + /* Copy item at a time for the case dodsize > sizeof(buffer[n]) */ + while ((i < *entries || *entries == INFINITE) && i < This->count) + { + if (dod != NULL) + { + int n = (This->start + i) % This->buffersize; + LPDIDEVICEOBJECTDATA pd + = (LPDIDEVICEOBJECTDATA)((BYTE *)dod + dodsize * i); + pd->dwOfs = This->buffer[n].dwOfs; + pd->dwData = This->buffer[n].dwData; + pd->dwTimeStamp = This->buffer[n].dwTimeStamp; + pd->dwSequence = This->buffer[n].dwSequence; + } + i++; + } + + *entries = i; + + if (This->overflow) + ret = DI_BUFFEROVERFLOW; + + if (!(flags & DIGDD_PEEK)) + { + /* Empty buffer */ + This->count -= i; + This->start = (This->start + i) % This->buffersize; + This->overflow = FALSE; + } + + LeaveCriticalSection(&(This->crit)); + + TRACE("Returning %ld events queued\n", *entries); + + return ret; +} + +static HRESULT WINAPI SysKeyboardAImpl_EnumObjects( + LPDIRECTINPUTDEVICE8A iface, + LPDIENUMDEVICEOBJECTSCALLBACKA lpCallback, + LPVOID lpvRef, + DWORD dwFlags) +{ + SysKeyboardImpl *This = (SysKeyboardImpl *)iface; + DIDEVICEOBJECTINSTANCEA ddoi; + int i; + + TRACE("(this=%p,%p,%p,%08lx)\n", This, lpCallback, lpvRef, dwFlags); + if (TRACE_ON(dinput)) { + TRACE(" - flags = "); + _dump_EnumObjects_flags(dwFlags); + TRACE("\n"); + } + + /* Only the fields till dwFFMaxForce are relevant */ + memset(&ddoi, 0, sizeof(ddoi)); + ddoi.dwSize = FIELD_OFFSET(DIDEVICEOBJECTINSTANCEA, dwFFMaxForce); + + for (i = 0; i < WINE_DINPUT_KEYBOARD_MAX_KEYS; i++) { + /* Report 255 keys :-) */ + ddoi.guidType = GUID_Key; + ddoi.dwOfs = i; + ddoi.dwType = DIDFT_MAKEINSTANCE(i) | DIDFT_BUTTON; + GetKeyNameTextA(((i & 0x7f) << 16) | ((i & 0x80) << 17), ddoi.tszName, sizeof(ddoi.tszName)); + _dump_OBJECTINSTANCEA(&ddoi); + if (lpCallback(&ddoi, lpvRef) != DIENUM_CONTINUE) return DI_OK; + } + + return DI_OK; +} + +static HRESULT WINAPI SysKeyboardWImpl_EnumObjects(LPDIRECTINPUTDEVICE8W iface, + LPDIENUMDEVICEOBJECTSCALLBACKW lpCallback, + LPVOID lpvRef, + DWORD dwFlags) +{ + SysKeyboardImpl *This = (SysKeyboardImpl *)iface; + + device_enumobjects_AtoWcb_data data; + + data.lpCallBack = lpCallback; + data.lpvRef = lpvRef; + + return SysKeyboardAImpl_EnumObjects((LPDIRECTINPUTDEVICE8A) This, (LPDIENUMDEVICEOBJECTSCALLBACKA) DIEnumDevicesCallbackAtoW, (LPVOID) &data, dwFlags); +} + +static HRESULT WINAPI SysKeyboardAImpl_Unacquire(LPDIRECTINPUTDEVICE8A iface); + +static HRESULT WINAPI SysKeyboardAImpl_Acquire(LPDIRECTINPUTDEVICE8A iface) +{ + SysKeyboardImpl *This = (SysKeyboardImpl *)iface; + + TRACE("(this=%p)\n",This); + + if (This->acquired) + return S_FALSE; + + This->acquired = 1; + + if (current_lock != NULL) { + FIXME("Not more than one keyboard can be acquired at the same time.\n"); + SysKeyboardAImpl_Unacquire(iface); + } + + current_lock = This; + + if (This->buffersize > 0) { + This->buffer = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, + This->buffersize * sizeof(*(This->buffer))); + This->start = 0; + This->count = 0; + This->overflow = FALSE; + } else { + This->buffer = NULL; + } + + /*keyboard_hook = SetWindowsHookExW( WH_KEYBOARD_LL, KeyboardCallback, DINPUT_instance, 0 );*/ + + return DI_OK; +} + +static HRESULT WINAPI SysKeyboardAImpl_Unacquire(LPDIRECTINPUTDEVICE8A iface) +{ + SysKeyboardImpl *This = (SysKeyboardImpl *)iface; + TRACE("(this=%p)\n",This); + + if (This->acquired == 0) + return DI_NOEFFECT; + + /* No more locks */ + if (current_lock == This) + current_lock = NULL; + else + ERR("this != current_lock\n"); + + /* Unacquire device */ + This->acquired = 0; + + if (This->buffersize >= 0) { + HeapFree(GetProcessHeap(), 0, This->buffer); + This->buffer = NULL; + } + + return DI_OK; +} + +static HRESULT WINAPI SysKeyboardAImpl_SetEventNotification(LPDIRECTINPUTDEVICE8A iface, + HANDLE hnd) { + SysKeyboardImpl *This = (SysKeyboardImpl *)iface; + + TRACE("(this=%p,0x%08lx)\n",This,(DWORD)hnd); + + This->hEvent = hnd; + return DI_OK; +} + +/********************************************************************** ******** + * GetCapabilities : get the device capablitites + */ +static HRESULT WINAPI SysKeyboardAImpl_GetCapabilities( + LPDIRECTINPUTDEVICE8A iface, + LPDIDEVCAPS lpDIDevCaps) +{ + SysKeyboardImpl *This = (SysKeyboardImpl *)iface; + DIDEVCAPS devcaps; + + TRACE("(this=%p,%p)\n",This,lpDIDevCaps); + + if ((lpDIDevCaps->dwSize != sizeof(DIDEVCAPS)) && (lpDIDevCaps->dwSize != sizeof(DIDEVCAPS_DX3))) { + WARN("invalid parameter\n"); + return DIERR_INVALIDPARAM; + } + + devcaps.dwSize = lpDIDevCaps->dwSize; + devcaps.dwFlags = DIDC_ATTACHED; + if (This->dinput->version >= 8) + devcaps.dwDevType = DI8DEVTYPE_KEYBOARD | (DI8DEVTYPEKEYBOARD_UNKNOWN << 8); + else + devcaps.dwDevType = DIDEVTYPE_KEYBOARD | (DIDEVTYPEKEYBOARD_UNKNOWN << 8); + devcaps.dwAxes = 0; + devcaps.dwButtons = WINE_DINPUT_KEYBOARD_MAX_KEYS; + devcaps.dwPOVs = 0; + devcaps.dwFFSamplePeriod = 0; + devcaps.dwFFMinTimeResolution = 0; + devcaps.dwFirmwareRevision = 100; + devcaps.dwHardwareRevision = 100; + devcaps.dwFFDriverVersion = 0; + + memcpy(lpDIDevCaps, &devcaps, lpDIDevCaps->dwSize); + + return DI_OK; +} + +/********************************************************************** ******** + * GetObjectInfo : get information about a device object such as a button + * or axis + */ +static HRESULT WINAPI +SysKeyboardAImpl_GetObjectInfo( + LPDIRECTINPUTDEVICE8A iface, + LPDIDEVICEOBJECTINSTANCEA pdidoi, + DWORD dwObj, + DWORD dwHow) +{ + SysKeyboardImpl *This = (SysKeyboardImpl *)iface; + DIDEVICEOBJECTINSTANCEA ddoi; + DWORD dwSize = pdidoi->dwSize; + + TRACE("(this=%p,%p,%ld,0x%08lx)\n", This, pdidoi, dwObj, dwHow); + + if (dwHow == DIPH_BYID) { + WARN(" querying by id not supported yet...\n"); + return DI_OK; + } + + memset(pdidoi, 0, dwSize); + memset(&ddoi, 0, sizeof(ddoi)); + + ddoi.dwSize = dwSize; + ddoi.guidType = GUID_Key; + ddoi.dwOfs = dwObj; + ddoi.dwType = DIDFT_MAKEINSTANCE(dwObj) | DIDFT_BUTTON; + GetKeyNameTextA(((dwObj & 0x7f) << 16) | ((dwObj & 0x80) << 17), ddoi.tszName, sizeof(ddoi.tszName)); + + /* And return our just filled device object instance structure */ + memcpy(pdidoi, &ddoi, (dwSize < sizeof(ddoi) ? dwSize : sizeof(ddoi))); + + _dump_OBJECTINSTANCEA(pdidoi); + + return DI_OK; +} + +static HRESULT WINAPI SysKeyboardWImpl_GetObjectInfo(LPDIRECTINPUTDEVICE8W iface, + LPDIDEVICEOBJECTINSTANCEW pdidoi, + DWORD dwObj, + DWORD dwHow) +{ + SysKeyboardImpl *This = (SysKeyboardImpl *)iface; + DIDEVICEOBJECTINSTANCEW ddoi; + DWORD dwSize = pdidoi->dwSize; + + TRACE("(this=%p,%p,%ld,0x%08lx)\n", This, pdidoi, dwObj, dwHow); + + if (dwHow == DIPH_BYID) { + WARN(" querying by id not supported yet...\n"); + return DI_OK; + } + + memset(pdidoi, 0, dwSize); + memset(&ddoi, 0, sizeof(ddoi)); + + ddoi.dwSize = dwSize; + ddoi.guidType = GUID_Key; + ddoi.dwOfs = dwObj; + ddoi.dwType = DIDFT_MAKEINSTANCE(dwObj) | DIDFT_BUTTON; + GetKeyNameTextW(((dwObj & 0x7f) << 16) | ((dwObj & 0x80) << 17), ddoi.tszName, sizeof(ddoi.tszName)); + + /* And return our just filled device object instance structure */ + memcpy(pdidoi, &ddoi, (dwSize < sizeof(ddoi) ? dwSize : sizeof(ddoi))); + + _dump_OBJECTINSTANCEW(pdidoi); + + return DI_OK; +} + +/********************************************************************** ******** + * GetDeviceInfo : get information about a device's identity + */ +static HRESULT WINAPI SysKeyboardAImpl_GetDeviceInfo( + LPDIRECTINPUTDEVICE8A iface, + LPDIDEVICEINSTANCEA pdidi) +{ + SysKeyboardImpl *This = (SysKeyboardImpl *)iface; + TRACE("(this=%p,%p)\n", This, pdidi); + + if (pdidi->dwSize != sizeof(DIDEVICEINSTANCEA)) { + WARN(" dinput3 not supported yet...\n"); + return DI_OK; + } + + fill_keyboard_dideviceinstanceA(pdidi, This->dinput->version); + + return DI_OK; +} + +static HRESULT WINAPI SysKeyboardWImpl_GetDeviceInfo(LPDIRECTINPUTDEVICE8W iface, LPDIDEVICEINSTANCEW pdidi) +{ + SysKeyboardImpl *This = (SysKeyboardImpl *)iface; + TRACE("(this=%p,%p)\n", This, pdidi); + + if (pdidi->dwSize != sizeof(DIDEVICEINSTANCEW)) { + WARN(" dinput3 not supported yet...\n"); + return DI_OK; + } + + fill_keyboard_dideviceinstanceW(pdidi, This->dinput->version); + + return DI_OK; +} + +static IDirectInputDevice8AVtbl SysKeyboardAvt = +{ + IDirectInputDevice2AImpl_QueryInterface, + IDirectInputDevice2AImpl_AddRef, + SysKeyboardAImpl_Release, + SysKeyboardAImpl_GetCapabilities, + SysKeyboardAImpl_EnumObjects, + SysKeyboardAImpl_GetProperty, + SysKeyboardAImpl_SetProperty, + SysKeyboardAImpl_Acquire, + SysKeyboardAImpl_Unacquire, + SysKeyboardAImpl_GetDeviceState, + SysKeyboardAImpl_GetDeviceData, + IDirectInputDevice2AImpl_SetDataFormat, + SysKeyboardAImpl_SetEventNotification, + IDirectInputDevice2AImpl_SetCooperativeLevel, + SysKeyboardAImpl_GetObjectInfo, + SysKeyboardAImpl_GetDeviceInfo, + IDirectInputDevice2AImpl_RunControlPanel, + IDirectInputDevice2AImpl_Initialize, + IDirectInputDevice2AImpl_CreateEffect, + IDirectInputDevice2AImpl_EnumEffects, + IDirectInputDevice2AImpl_GetEffectInfo, + IDirectInputDevice2AImpl_GetForceFeedbackState, + IDirectInputDevice2AImpl_SendForceFeedbackCommand, + IDirectInputDevice2AImpl_EnumCreatedEffectObjects, + IDirectInputDevice2AImpl_Escape, + IDirectInputDevice2AImpl_Poll, + IDirectInputDevice2AImpl_SendDeviceData, + IDirectInputDevice7AImpl_EnumEffectsInFile, + IDirectInputDevice7AImpl_WriteEffectToFile, + IDirectInputDevice8AImpl_BuildActionMap, + IDirectInputDevice8AImpl_SetActionMap, + IDirectInputDevice8AImpl_GetImageInfo +}; + +#if !defined(__STRICT_ANSI__) && defined(__GNUC__) +# define XCAST(fun) (typeof(SysKeyboardWvt.fun)) +#else +# define XCAST(fun) (void*) +#endif + +static IDirectInputDevice8WVtbl SysKeyboardWvt = +{ + IDirectInputDevice2WImpl_QueryInterface, + XCAST(AddRef)IDirectInputDevice2AImpl_AddRef, + XCAST(Release)SysKeyboardAImpl_Release, + XCAST(GetCapabilities)SysKeyboardAImpl_GetCapabilities, + SysKeyboardWImpl_EnumObjects, + XCAST(GetProperty)SysKeyboardAImpl_GetProperty, + XCAST(SetProperty)SysKeyboardAImpl_SetProperty, + XCAST(Acquire)SysKeyboardAImpl_Acquire, + XCAST(Unacquire)SysKeyboardAImpl_Unacquire, + XCAST(GetDeviceState)SysKeyboardAImpl_GetDeviceState, + XCAST(GetDeviceData)SysKeyboardAImpl_GetDeviceData, + XCAST(SetDataFormat)IDirectInputDevice2AImpl_SetDataFormat, + XCAST(SetEventNotification)SysKeyboardAImpl_SetEventNotification, + XCAST(SetCooperativeLevel)IDirectInputDevice2AImpl_SetCooperativeLevel, + SysKeyboardWImpl_GetObjectInfo, + SysKeyboardWImpl_GetDeviceInfo, + XCAST(RunControlPanel)IDirectInputDevice2AImpl_RunControlPanel, + XCAST(Initialize)IDirectInputDevice2AImpl_Initialize, + XCAST(CreateEffect)IDirectInputDevice2AImpl_CreateEffect, + IDirectInputDevice2WImpl_EnumEffects, + IDirectInputDevice2WImpl_GetEffectInfo, + XCAST(GetForceFeedbackState)IDirectInputDevice2AImpl_GetForceFeedbackSta te, + XCAST(SendForceFeedbackCommand)IDirectInputDevice2AImpl_SendForceFeedbac kCommand, + XCAST(EnumCreatedEffectObjects)IDirectInputDevice2AImpl_EnumCreatedEffec tObjects, + XCAST(Escape)IDirectInputDevice2AImpl_Escape, + XCAST(Poll)IDirectInputDevice2AImpl_Poll, + XCAST(SendDeviceData)IDirectInputDevice2AImpl_SendDeviceData, + IDirectInputDevice7WImpl_EnumEffectsInFile, + IDirectInputDevice7WImpl_WriteEffectToFile, + IDirectInputDevice8WImpl_BuildActionMap, + IDirectInputDevice8WImpl_SetActionMap, + IDirectInputDevice8WImpl_GetImageInfo +}; +#undef XCAST _____ Modified: trunk/reactos/lib/dinput/mouse.c --- trunk/reactos/lib/dinput/mouse.c 2005-05-16 20:36:26 UTC (rev 15357) +++ trunk/reactos/lib/dinput/mouse.c 2005-05-16 20:42:36 UTC (rev 15358) @@ -256,9 +256,9 @@ newDevice = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(SysMouseImpl)); newDevice->ref = 1; newDevice->lpVtbl = mvt; -#ifndef __REACTOS__ + InitializeCriticalSection(&(newDevice->crit)); -#endif + memcpy(&(newDevice->guid),rguid,sizeof(*rguid)); /* Per default, Wine uses its internal data format */ @@ -338,20 +338,15 @@ /* Free the data queue */ HeapFree(GetProcessHeap(),0,This->data_queue); -#ifndef __REACTOS__ + if (This->hook) { UnhookWindowsHookEx( This->hook ); if (This->dwCoopLevel & DISCL_EXCLUSIVE) ShowCursor(TRUE); /* show cursor */ } DeleteCriticalSection(&(This->crit)); -#endif -#ifdef __REACTOS__ -if (This->dwCoopLevel & DISCL_EXCLUSIVE) - ShowCursor(TRUE); /* show cursor */ - -#endif + /* Free the DataFormat */ if (This->df != &(Wine_InternalMouseFormat)) { HeapFree(GetProcessHeap(), 0, This->df->rgodf); @@ -443,8 +438,9 @@ * This is to allow the cursor to start acceleration before * the warps happen. But if it involves a mouse button event we * allow it since we don't want to lose the clicks. + * in reactos 1ms instead for 10ms */ - if (((GetCurrentTime() - last_event) < 10) + if (((GetCurrentTime() - last_event) < 1) && wparam == WM_MOUSEMOVE) goto end; else last_event = GetCurrentTime(); @@ -583,7 +579,9 @@ MapWindowPoints(This->win, HWND_DESKTOP, &This->mapped_center, 1); } - +#ifdef __REACTOS__ +int poll_mouse=0; +#endif /*********************************************************************** ******* * Acquire : gets exclusive control of the mouse */ @@ -623,15 +621,15 @@ /* Install our mouse hook */ if (This->dwCoopLevel & DISCL_EXCLUSIVE) ShowCursor(FALSE); /* hide cursor */ -#ifndef __REACTOS__ + This->hook = SetWindowsHookExA( WH_MOUSE_LL, dinput_mouse_hook, DINPUT_instance, 0 ); -#endif - - /* Get the window dimension and find the center */ - GetWindowRect(This->win, &rect); + + /* Get the window dimension and find the center */ + GetWindowRect(This->win, &rect); This->win_centerX = (rect.right - rect.left) / 2; This->win_centerY = (rect.bottom - rect.top ) / 2; - + + /* Warp the mouse to the center of the window */ if (This->absolute == 0) { This->mapped_center.x = This->win_centerX; @@ -664,17 +662,12 @@ /* Reinstall previous mouse event handler */ if (This->hook) { -#ifndef __REACTOS__ + UnhookWindowsHookEx( This->hook ); This->hook = 0; if (This->dwCoopLevel & DISCL_EXCLUSIVE) ShowCursor(TRUE); /* show cursor */ -#endif -#ifdef __REACTOS__ - if (This->dwCoopLevel & DISCL_EXCLUSIVE) - ShowCursor(TRUE); /* show cursor */ -#endif } /* No more locks */ @@ -697,70 +690,25 @@ // if you call poll then to getdevicestate // it did not send back right value in windows -int poll_mouse=0; -#ifdef __REACTOS__ -void getmousesvalue(LPDIRECTINPUTDEVICE8A iface); -int filp=0; -void getmousesvalue(LPDIRECTINPUTDEVICE8A iface) -{ - static long last_event = 0; - POINT point; - SysMouseImpl *This = (SysMouseImpl *)iface; - This->m_state.rgbButtons[0] = ((GetKeyState(VK_LBUTTON) & 0x80) ? 0xFF : 0x00); - This->m_state.rgbButtons[1] = ((GetKeyState(VK_RBUTTON) & 0x80) ? 0xFF : 0x00); - This->m_state.rgbButtons[2] = ((GetKeyState(VK_MBUTTON) & 0x80) ? 0xFF : 0x00); - This->m_state.rgbButtons[3] = ((GetKeyState(VK_XBUTTON1) & 0x80) ? 0xFF : 0x00); - This->m_state.rgbButtons[4] = ((GetKeyState(VK_XBUTTON2) & 0x80) ? 0xFF : 0x00); - - - - - if (poll_mouse==1) filp=0; - if (filp==2) filp=0; - if (filp==0) { - GetCursorPos( &point ); - - if (This->prevX == point.x) This->m_state.lX = 0; - else { - This->prevX = point.x; - This->m_state.lX = point.x - This->org_coords.x; - } - - if (This->prevY == point.y) This->m_state.lY = 0; - else { - This->prevY = point.y; - This->m_state.lY = point.y - This->org_coords.y; - } - - } - else - { - This->m_state.lX = 0; - This->m_state.lY = 0; - } - filp++; - -// check see if buffer have been set - -} - -#endif - +/* wine does not implement poll but we do, this is from GDI patch from the mouse */ static HRESULT WINAPI SysMouseAImpl_Poll(LPDIRECTINPUTDEVICE8A iface) { int retValue = DI_OK; + SysMouseImpl *This = (SysMouseImpl *)iface; - if (poll_mouse==0) { - retValue=SysMouseAImpl_Acquire(iface); + [truncated at 1000 lines; 213 more skipped]
19 years, 7 months
1
0
0
0
[greatlrd] 15357: drop Keyboard.c gdi version
by greatlrd@svn.reactos.com
drop Keyboard.c gdi version Deleted: trunk/reactos/lib/dinput/keyboard.c _____ Deleted: trunk/reactos/lib/dinput/keyboard.c --- trunk/reactos/lib/dinput/keyboard.c 2005-05-16 20:17:42 UTC (rev 15356) +++ trunk/reactos/lib/dinput/keyboard.c 2005-05-16 20:36:26 UTC (rev 15357) @@ -1,898 +0,0 @@ -/* DirectInput Keyboard device - * - * Copyright 1998 Marcus Meissner - * Copyright 1998,1999 Lionel Ulmer - * Copyright 2000-2001 TransGaming Technologies Inc. - * Copyright 2005 Raphael Junqueira - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include "config.h" -#include "wine/port.h" - -#include <stdarg.h> -#include <string.h> -#include "windef.h" -#include "winbase.h" -#include "winuser.h" -#include "winerror.h" -#include "dinput.h" - -#include "dinput_private.h" -#include "device_private.h" -#include "wine/debug.h" -#include "wine/unicode.h" - -WINE_DEFAULT_DEBUG_CHANNEL(dinput); - -#define WINE_DINPUT_KEYBOARD_MAX_KEYS 256 - -static IDirectInputDevice8AVtbl SysKeyboardAvt; -static IDirectInputDevice8WVtbl SysKeyboardWvt; - -typedef struct SysKeyboardImpl SysKeyboardImpl; -struct SysKeyboardImpl -{ - LPVOID lpVtbl; - DWORD ref; - GUID guid; - - IDirectInputImpl* dinput; - - HANDLE hEvent; - /* SysKeyboardAImpl */ - int acquired; - int buffersize; /* set in 'SetProperty' */ - LPDIDEVICEOBJECTDATA buffer; /* buffer for 'GetDeviceData'. - Alloc at 'Acquire', Free at - 'Unacquire' */ - int count; /* number of objects in use in - 'buffer' */ - int start; /* 'buffer' rotates. This is the - first in use (if count > 0) */ - BOOL overflow; /* return DI_BUFFEROVERFLOW in - 'GetDeviceData' */ - CRITICAL_SECTION crit; -}; - -static SysKeyboardImpl* current_lock = NULL; -/* Today's acquired device - * FIXME: currently this can be only one. - * Maybe this should be a linked list or st. - * I don't know what the rules are for multiple acquired keyboards, - * but 'DI_LOSTFOCUS' and 'DI_UNACQUIRED' exist for a reason. -*/ - -static BYTE DInputKeyState[WINE_DINPUT_KEYBOARD_MAX_KEYS]; /* array for 'GetDeviceState' */ - -static CRITICAL_SECTION keyboard_crit; -static CRITICAL_SECTION_DEBUG critsect_debug = -{ - 0, 0, &keyboard_crit, - { &critsect_debug.ProcessLocksList, &critsect_debug.ProcessLocksList }, - 0, 0, { 0, (DWORD)(__FILE__ ": keyboard_crit") } -}; -static CRITICAL_SECTION keyboard_crit = { &critsect_debug, -1, 0, 0, 0, 0 }; - -static DWORD keyboard_users; - -#ifndef __REACTOS__ -static DWORD keyboard_users = 0; -static HHOOK keyboard_hook = NULL; -#endif - -#ifdef __REACTOS__ -void reactos_input_keyboard(); - -void reactos_input_keyboard() -{ - MSG msg; - BOOL fDone; - int disk_code = -1; - BOOL down; - BYTE oldDInputKeyState[256]; - int t; - - memcpy(&oldDInputKeyState,&DInputKeyState,256); - GetKeyboardState(DInputKeyState); - - for( t=0;t<255;t++) - { - if (oldDInputKeyState[t]!=DInputKeyState[t]) disk_code=t; - } - - - if (disk_code!=-1) { - if (current_lock->buffer != NULL) - { - int n; - n = (current_lock->start + current_lock->count) % current_lock->buffersize; - - current_lock->buffer[n].dwOfs = (BYTE) disk_code; - current_lock->buffer[n].dwData = DInputKeyState[disk_code]; - current_lock->buffer[n].dwTimeStamp = 10; - current_lock->buffer[n].dwSequence = current_lock->dinput->evsequence++; - - - if (current_lock->count == current_lock->buffersize) - { - current_lock->start = ++current_lock->start % current_lock->buffersize; - current_lock->overflow = TRUE; - } - else - current_lock->count++; - - } - } - - -} -#endif -#ifndef __REACTOS__ -LRESULT CALLBACK KeyboardCallback( int code, WPARAM wparam, LPARAM lparam ) -{ - BYTE dik_code; - BOOL down; - DWORD timestamp; - KBDLLHOOKSTRUCT *hook = (KBDLLHOOKSTRUCT *)lparam; - BYTE new_diks; - - TRACE("(%d,%d,%ld)\n", code, wparam, lparam); - - /** returns now if not HC_ACTION */ - if (code != HC_ACTION) return CallNextHookEx(keyboard_hook, code, wparam, lparam); - - { - dik_code = hook->scanCode; - if (hook->flags & LLKHF_EXTENDED) dik_code |= 0x80; - down = !(hook->flags & LLKHF_UP); - timestamp = hook->time; - } - - /** returns now if key event already known */ - new_diks = (down ? 0x80 : 0); - /*if (new_diks != DInputKeyState[dik_code]) return CallNextHookEx(keyboard_hook, code, wparam, lparam); TO BE FIXED */ - - DInputKeyState[dik_code] = new_diks; - TRACE(" setting %02X to %02X\n", dik_code, DInputKeyState[dik_code]); - - if (current_lock != NULL) { - if (current_lock->hEvent) SetEvent(current_lock->hEvent); - - if (current_lock->buffer != NULL) { - int n; - - EnterCriticalSection(&(current_lock->crit)); - - n = (current_lock->start + current_lock->count) % current_lock->buffersize; - - current_lock->buffer[n].dwOfs = dik_code; - current_lock->buffer[n].dwData = down ? 0x80 : 0; - current_lock->buffer[n].dwTimeStamp = timestamp; - current_lock->buffer[n].dwSequence = current_lock->dinput->evsequence++; - - TRACE("Adding event at offset %d : %ld - %ld - %ld - %ld\n", n, - current_lock->buffer[n].dwOfs, current_lock->buffer[n].dwData, current_lock->buffer[n].dwTimeStamp, current_lock->buffer[n].dwSequence); - - if (current_lock->count == current_lock->buffersize) { - current_lock->start = ++current_lock->start % current_lock->buffersize; - current_lock->overflow = TRUE; - } else - current_lock->count++; - - LeaveCriticalSection(&(current_lock->crit)); - } - } - return CallNextHookEx(keyboard_hook, code, wparam, lparam); -} -#endif - -static GUID DInput_Wine_Keyboard_GUID = { /* 0ab8648a-7735-11d2-8c73-71df54a96441 */ - 0x0ab8648a, - 0x7735, - 0x11d2, - {0x8c, 0x73, 0x71, 0xdf, 0x54, 0xa9, 0x64, 0x41} -}; - -static void fill_keyboard_dideviceinstanceA(LPDIDEVICEINSTANCEA lpddi, int version) { - DWORD dwSize; - DIDEVICEINSTANCEA ddi; - - dwSize = lpddi->dwSize; - - TRACE("%ld %p\n", dwSize, lpddi); - - memset(lpddi, 0, dwSize); - memset(&ddi, 0, sizeof(ddi)); - - ddi.dwSize = dwSize; - ddi.guidInstance = GUID_SysKeyboard;/* DInput's GUID */ - ddi.guidProduct = DInput_Wine_Keyboard_GUID; /* Vendor's GUID */ - if (version >= 8) - ddi.dwDevType = DI8DEVTYPE_KEYBOARD | (DI8DEVTYPEKEYBOARD_UNKNOWN << 8); - else - ddi.dwDevType = DIDEVTYPE_KEYBOARD | (DIDEVTYPEKEYBOARD_UNKNOWN << 8); - strcpy(ddi.tszInstanceName, "Keyboard"); - strcpy(ddi.tszProductName, "Wine Keyboard"); - - memcpy(lpddi, &ddi, (dwSize < sizeof(ddi) ? dwSize : sizeof(ddi))); -} - -static void fill_keyboard_dideviceinstanceW(LPDIDEVICEINSTANCEW lpddi, int version) { - DWORD dwSize; - DIDEVICEINSTANCEW ddi; - - dwSize = lpddi->dwSize; - - TRACE("%ld %p\n", dwSize, lpddi); - - memset(lpddi, 0, dwSize); - memset(&ddi, 0, sizeof(ddi)); - - ddi.dwSize = dwSize; - ddi.guidInstance = GUID_SysKeyboard;/* DInput's GUID */ - ddi.guidProduct = DInput_Wine_Keyboard_GUID; /* Vendor's GUID */ - if (version >= 8) - ddi.dwDevType = DI8DEVTYPE_KEYBOARD | (DI8DEVTYPEKEYBOARD_UNKNOWN << 8); - else - ddi.dwDevType = DIDEVTYPE_KEYBOARD | (DIDEVTYPEKEYBOARD_UNKNOWN << 8); - MultiByteToWideChar(CP_ACP, 0, "Keyboard", -1, ddi.tszInstanceName, MAX_PATH); - MultiByteToWideChar(CP_ACP, 0, "Wine Keyboard", -1, ddi.tszProductName, MAX_PATH); - - memcpy(lpddi, &ddi, (dwSize < sizeof(ddi) ? dwSize : sizeof(ddi))); -} - -static BOOL keyboarddev_enum_deviceA(DWORD dwDevType, DWORD dwFlags, LPDIDEVICEINSTANCEA lpddi, int version, int id) -{ - if (id != 0) - return FALSE; - - if ((dwDevType == 0) || - ((dwDevType == DIDEVTYPE_KEYBOARD) && (version < 8)) || - (((dwDevType == DI8DEVCLASS_KEYBOARD) || (dwDevType == DI8DEVTYPE_KEYBOARD)) && (version >= 8))) { - TRACE("Enumerating the Keyboard device\n"); - - fill_keyboard_dideviceinstanceA(lpddi, version); - - return TRUE; - } - - return FALSE; -} - -static BOOL keyboarddev_enum_deviceW(DWORD dwDevType, DWORD dwFlags, LPDIDEVICEINSTANCEW lpddi, int version, int id) -{ - if (id != 0) - return FALSE; - - if ((dwDevType == 0) || - ((dwDevType == DIDEVTYPE_KEYBOARD) && (version < 8)) || - (((dwDevType == DI8DEVCLASS_KEYBOARD) || (dwDevType == DI8DEVTYPE_KEYBOARD)) && (version >= 8))) { - TRACE("Enumerating the Keyboard device\n"); - - fill_keyboard_dideviceinstanceW(lpddi, version); - - return TRUE; - } - - return FALSE; -} - -static SysKeyboardImpl *alloc_device_keyboard(REFGUID rguid, LPVOID kvt, IDirectInputImpl *dinput) -{ - SysKeyboardImpl* newDevice; - DWORD kbd_users; - - newDevice = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(SysKeyboardImpl)); - newDevice->lpVtbl = kvt; - newDevice->ref = 1; - memcpy(&(newDevice->guid),rguid,sizeof(*rguid)); - newDevice->dinput = dinput; - InitializeCriticalSection(&(newDevice->crit)); - -#ifndef __REACTOS__ - EnterCriticalSection(&keyboard_crit); -<<<<<<< .working - - if (!keyboard_users++) - keyboard_hook = SetWindowsHookExW( WH_KEYBOARD_LL, KeyboardCallback, DINPUT_instance, 0 ); -======= - kbd_users = InterlockedIncrement(&keyboard_users); - if (1 == kbd_users) { - keyboard_hook = SetWindowsHookExW( WH_KEYBOARD_LL, KeyboardCallback, DINPUT_instance, 0 ); - } ->>>>>>> .merge-right.r14821 - - LeaveCriticalSection(&keyboard_crit); -#endif - return newDevice; -} - - -static HRESULT keyboarddev_create_deviceA(IDirectInputImpl *dinput, REFGUID rguid, REFIID riid, LPDIRECTINPUTDEVICEA* pdev) -{ - if ((IsEqualGUID(&GUID_SysKeyboard,rguid)) || /* Generic Keyboard */ - (IsEqualGUID(&DInput_Wine_Keyboard_GUID,rguid))) { /* Wine Keyboard */ - if ((riid == NULL) || - IsEqualGUID(&IID_IDirectInputDeviceA,riid) || - IsEqualGUID(&IID_IDirectInputDevice2A,riid) || - IsEqualGUID(&IID_IDirectInputDevice7A,riid) || - IsEqualGUID(&IID_IDirectInputDevice8A,riid)) { - *pdev = (IDirectInputDeviceA*) alloc_device_keyboard(rguid, &SysKeyboardAvt, dinput); - TRACE("Creating a Keyboard device (%p)\n", *pdev); - return DI_OK; - } else - return DIERR_NOINTERFACE; - } - return DIERR_DEVICENOTREG; -} - -static HRESULT keyboarddev_create_deviceW(IDirectInputImpl *dinput, REFGUID rguid, REFIID riid, LPDIRECTINPUTDEVICEW* pdev) -{ - if ((IsEqualGUID(&GUID_SysKeyboard,rguid)) || /* Generic Keyboard */ - (IsEqualGUID(&DInput_Wine_Keyboard_GUID,rguid))) { /* Wine Keyboard */ - if ((riid == NULL) || - IsEqualGUID(&IID_IDirectInputDeviceW,riid) || - IsEqualGUID(&IID_IDirectInputDevice2W,riid) || - IsEqualGUID(&IID_IDirectInputDevice7W,riid) || - IsEqualGUID(&IID_IDirectInputDevice8W,riid)) { - *pdev = (IDirectInputDeviceW*) alloc_device_keyboard(rguid, &SysKeyboardWvt, dinput); - TRACE("Creating a Keyboard device (%p)\n", *pdev); - return DI_OK; - } else - return DIERR_NOINTERFACE; - } - return DIERR_DEVICENOTREG; -} - -const struct dinput_device keyboard_device = { - "Wine keyboard driver", - keyboarddev_enum_deviceA, - keyboarddev_enum_deviceW, - keyboarddev_create_deviceA, - keyboarddev_create_deviceW -}; - -static ULONG WINAPI SysKeyboardAImpl_Release(LPDIRECTINPUTDEVICE8A iface) -{ - SysKeyboardImpl *This = (SysKeyboardImpl *)iface; - ULONG ref; - DWORD kbd_users; - - ref = InterlockedDecrement(&(This->ref)); - if (ref) - return ref; - -#ifndef __REACTOS__ - EnterCriticalSection(&keyboard_crit); - kbd_users = InterlockedDecrement(&keyboard_users); - if (0 == kbd_users) { - UnhookWindowsHookEx( keyboard_hook ); - keyboard_hook = 0; - } - LeaveCriticalSection(&keyboard_crit); -#endif - - /* Free the data queue */ - HeapFree(GetProcessHeap(),0,This->buffer); - - DeleteCriticalSection(&(This->crit)); - - HeapFree(GetProcessHeap(),0,This); - return DI_OK; -} - -static HRESULT WINAPI SysKeyboardAImpl_SetProperty( - LPDIRECTINPUTDEVICE8A iface,REFGUID rguid,LPCDIPROPHEADER ph -) -{ - SysKeyboardImpl *This = (SysKeyboardImpl *)iface; - - TRACE("(this=%p,%s,%p)\n",This,debugstr_guid(rguid),ph); - TRACE("(size=%ld,headersize=%ld,obj=%ld,how=%ld\n", - ph->dwSize,ph->dwHeaderSize,ph->dwObj,ph->dwHow); - if (!HIWORD(rguid)) { - switch ((DWORD)rguid) { - case (DWORD) DIPROP_BUFFERSIZE: { - LPCDIPROPDWORD pd = (LPCDIPROPDWORD)ph; - - TRACE("(buffersize=%ld)\n",pd->dwData); - - if (This->acquired) - return DIERR_INVALIDPARAM; - - This->buffersize = pd->dwData; - - break; - } - default: - WARN("Unknown type %ld\n",(DWORD)rguid); - break; - } - } - return DI_OK; -} - -static HRESULT WINAPI SysKeyboardAImpl_GetProperty( - LPDIRECTINPUTDEVICE8A iface,REFGUID rguid,LPDIPROPHEADER ph -) -{ - SysKeyboardImpl *This = (SysKeyboardImpl *)iface; - - TRACE("(this=%p,%s,%p)\n",This,debugstr_guid(rguid),ph); - TRACE("(size=%ld,headersize=%ld,obj=%ld,how=%ld\n", - ph->dwSize,ph->dwHeaderSize,ph->dwObj,ph->dwHow); - if (!HIWORD(rguid)) { - switch ((DWORD)rguid) { - case (DWORD) DIPROP_BUFFERSIZE: { - LPDIPROPDWORD pd = (LPDIPROPDWORD)ph; - - TRACE("(buffersize=%ld)\n",pd->dwData); - - if (This->acquired) - return DIERR_INVALIDPARAM; - - pd->dwData = This->buffersize; - - break; - } - default: - WARN("Unknown type %ld\n",(DWORD)rguid); - break; - } - } - return DI_OK; -} - -static HRESULT WINAPI SysKeyboardAImpl_GetDeviceState( - LPDIRECTINPUTDEVICE8A iface,DWORD len,LPVOID ptr -) -{ - SysKeyboardImpl *This = (SysKeyboardImpl *)iface; - TRACE("(%p)->(%ld,%p)\n", This, len, ptr); - -#ifdef __REACTOS__ - reactos_input_keyboard(); -#endif - - /* Note: device does not need to be acquired */ - if (len != WINE_DINPUT_KEYBOARD_MAX_KEYS) - return DIERR_INVALIDPARAM; - - MsgWaitForMultipleObjectsEx(0, NULL, 0, QS_ALLINPUT, 0); - - EnterCriticalSection(&(This->crit)); - - if (TRACE_ON(dinput)) { - int i; - for (i = 0; i < WINE_DINPUT_KEYBOARD_MAX_KEYS; i++) { - if (DInputKeyState[i] != 0x00) { - TRACE(" - %02X: %02x\n", i, DInputKeyState[i]); - } - } - } - - memcpy(ptr, DInputKeyState, WINE_DINPUT_KEYBOARD_MAX_KEYS); - LeaveCriticalSection(&(This->crit)); - - return DI_OK; -} - -static HRESULT WINAPI SysKeyboardAImpl_GetDeviceData( - LPDIRECTINPUTDEVICE8A iface,DWORD dodsize,LPDIDEVICEOBJECTDATA dod, - LPDWORD entries,DWORD flags -) -{ - - SysKeyboardImpl *This = (SysKeyboardImpl *)iface; - int ret = DI_OK, i = 0; -#ifdef __REACTOS__ - reactos_input_keyboard(); -#endif - - TRACE("(this=%p,%ld,%p,%p(%ld)),0x%08lx)\n", - This,dodsize,dod,entries,entries?*entries:0,flags); - - if (This->acquired == 0) - return DIERR_NOTACQUIRED; - - if (This->buffer == NULL) - return DIERR_NOTBUFFERED; - - if (dodsize < sizeof(DIDEVICEOBJECTDATA_DX3)) - return DIERR_INVALIDPARAM; - - MsgWaitForMultipleObjectsEx(0, NULL, 0, QS_ALLINPUT, 0); - - EnterCriticalSection(&(This->crit)); - - /* Copy item at a time for the case dodsize > sizeof(buffer[n]) */ - while ((i < *entries || *entries == INFINITE) && i < This->count) - { - if (dod != NULL) - { - int n = (This->start + i) % This->buffersize; - LPDIDEVICEOBJECTDATA pd - = (LPDIDEVICEOBJECTDATA)((BYTE *)dod + dodsize * i); - pd->dwOfs = This->buffer[n].dwOfs; - pd->dwData = This->buffer[n].dwData; - pd->dwTimeStamp = This->buffer[n].dwTimeStamp; - pd->dwSequence = This->buffer[n].dwSequence; - } - i++; - } - - *entries = i; - - if (This->overflow) - ret = DI_BUFFEROVERFLOW; - - if (!(flags & DIGDD_PEEK)) - { - /* Empty buffer */ - This->count -= i; - This->start = (This->start + i) % This->buffersize; - This->overflow = FALSE; - } - - LeaveCriticalSection(&(This->crit)); - - TRACE("Returning %ld events queued\n", *entries); - - return ret; -} - -static HRESULT WINAPI SysKeyboardAImpl_EnumObjects( - LPDIRECTINPUTDEVICE8A iface, - LPDIENUMDEVICEOBJECTSCALLBACKA lpCallback, - LPVOID lpvRef, - DWORD dwFlags) -{ - SysKeyboardImpl *This = (SysKeyboardImpl *)iface; - DIDEVICEOBJECTINSTANCEA ddoi; - int i; - - TRACE("(this=%p,%p,%p,%08lx)\n", This, lpCallback, lpvRef, dwFlags); - if (TRACE_ON(dinput)) { - TRACE(" - flags = "); - _dump_EnumObjects_flags(dwFlags); - TRACE("\n"); - } - - /* Only the fields till dwFFMaxForce are relevant */ - memset(&ddoi, 0, sizeof(ddoi)); - ddoi.dwSize = FIELD_OFFSET(DIDEVICEOBJECTINSTANCEA, dwFFMaxForce); - - for (i = 0; i < WINE_DINPUT_KEYBOARD_MAX_KEYS; i++) { - /* Report 255 keys :-) */ - ddoi.guidType = GUID_Key; - ddoi.dwOfs = i; - ddoi.dwType = DIDFT_MAKEINSTANCE(i) | DIDFT_BUTTON; - GetKeyNameTextA(((i & 0x7f) << 16) | ((i & 0x80) << 17), ddoi.tszName, sizeof(ddoi.tszName)); - _dump_OBJECTINSTANCEA(&ddoi); - if (lpCallback(&ddoi, lpvRef) != DIENUM_CONTINUE) return DI_OK; - } - - return DI_OK; -} - -static HRESULT WINAPI SysKeyboardWImpl_EnumObjects(LPDIRECTINPUTDEVICE8W iface, - LPDIENUMDEVICEOBJECTSCALLBACKW lpCallback, - LPVOID lpvRef, - DWORD dwFlags) -{ - SysKeyboardImpl *This = (SysKeyboardImpl *)iface; - - device_enumobjects_AtoWcb_data data; - - data.lpCallBack = lpCallback; - data.lpvRef = lpvRef; - - return SysKeyboardAImpl_EnumObjects((LPDIRECTINPUTDEVICE8A) This, (LPDIENUMDEVICEOBJECTSCALLBACKA) DIEnumDevicesCallbackAtoW, (LPVOID) &data, dwFlags); -} - -static HRESULT WINAPI SysKeyboardAImpl_Unacquire(LPDIRECTINPUTDEVICE8A iface); - -static HRESULT WINAPI SysKeyboardAImpl_Acquire(LPDIRECTINPUTDEVICE8A iface) -{ - SysKeyboardImpl *This = (SysKeyboardImpl *)iface; - - TRACE("(this=%p)\n",This); - - if (This->acquired) - return S_FALSE; - - This->acquired = 1; - - if (current_lock != NULL) { - FIXME("Not more than one keyboard can be acquired at the same time.\n"); - SysKeyboardAImpl_Unacquire(iface); - } - - current_lock = This; - - if (This->buffersize > 0) { - This->buffer = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, - This->buffersize * sizeof(*(This->buffer))); - This->start = 0; - This->count = 0; - This->overflow = FALSE; - } else { - This->buffer = NULL; - } - - /*keyboard_hook = SetWindowsHookExW( WH_KEYBOARD_LL, KeyboardCallback, DINPUT_instance, 0 );*/ - - return DI_OK; -} - -static HRESULT WINAPI SysKeyboardAImpl_Unacquire(LPDIRECTINPUTDEVICE8A iface) -{ - SysKeyboardImpl *This = (SysKeyboardImpl *)iface; - TRACE("(this=%p)\n",This); - - if (This->acquired == 0) - return DI_NOEFFECT; - - /* No more locks */ - if (current_lock == This) - current_lock = NULL; - else - ERR("this != current_lock\n"); - - /* Unacquire device */ - This->acquired = 0; - - if (This->buffersize >= 0) { - HeapFree(GetProcessHeap(), 0, This->buffer); - This->buffer = NULL; - } - - return DI_OK; -} - -static HRESULT WINAPI SysKeyboardAImpl_SetEventNotification(LPDIRECTINPUTDEVICE8A iface, - HANDLE hnd) { - SysKeyboardImpl *This = (SysKeyboardImpl *)iface; - - TRACE("(this=%p,0x%08lx)\n",This,(DWORD)hnd); - - This->hEvent = hnd; - return DI_OK; -} - -/********************************************************************** ******** - * GetCapabilities : get the device capablitites - */ -static HRESULT WINAPI SysKeyboardAImpl_GetCapabilities( - LPDIRECTINPUTDEVICE8A iface, - LPDIDEVCAPS lpDIDevCaps) -{ - SysKeyboardImpl *This = (SysKeyboardImpl *)iface; - DIDEVCAPS devcaps; - - TRACE("(this=%p,%p)\n",This,lpDIDevCaps); - - if ((lpDIDevCaps->dwSize != sizeof(DIDEVCAPS)) && (lpDIDevCaps->dwSize != sizeof(DIDEVCAPS_DX3))) { - WARN("invalid parameter\n"); - return DIERR_INVALIDPARAM; - } - - devcaps.dwSize = lpDIDevCaps->dwSize; - devcaps.dwFlags = DIDC_ATTACHED; - if (This->dinput->version >= 8) - devcaps.dwDevType = DI8DEVTYPE_KEYBOARD | (DI8DEVTYPEKEYBOARD_UNKNOWN << 8); - else - devcaps.dwDevType = DIDEVTYPE_KEYBOARD | (DIDEVTYPEKEYBOARD_UNKNOWN << 8); - devcaps.dwAxes = 0; - devcaps.dwButtons = WINE_DINPUT_KEYBOARD_MAX_KEYS; - devcaps.dwPOVs = 0; - devcaps.dwFFSamplePeriod = 0; - devcaps.dwFFMinTimeResolution = 0; - devcaps.dwFirmwareRevision = 100; - devcaps.dwHardwareRevision = 100; - devcaps.dwFFDriverVersion = 0; - - memcpy(lpDIDevCaps, &devcaps, lpDIDevCaps->dwSize); - - return DI_OK; -} - -/********************************************************************** ******** - * GetObjectInfo : get information about a device object such as a button - * or axis - */ -static HRESULT WINAPI -SysKeyboardAImpl_GetObjectInfo( - LPDIRECTINPUTDEVICE8A iface, - LPDIDEVICEOBJECTINSTANCEA pdidoi, - DWORD dwObj, - DWORD dwHow) -{ - SysKeyboardImpl *This = (SysKeyboardImpl *)iface; - DIDEVICEOBJECTINSTANCEA ddoi; - DWORD dwSize = pdidoi->dwSize; - - TRACE("(this=%p,%p,%ld,0x%08lx)\n", This, pdidoi, dwObj, dwHow); - - if (dwHow == DIPH_BYID) { - WARN(" querying by id not supported yet...\n"); - return DI_OK; - } - - memset(pdidoi, 0, dwSize); - memset(&ddoi, 0, sizeof(ddoi)); - - ddoi.dwSize = dwSize; - ddoi.guidType = GUID_Key; - ddoi.dwOfs = dwObj; - ddoi.dwType = DIDFT_MAKEINSTANCE(dwObj) | DIDFT_BUTTON; - GetKeyNameTextA(((dwObj & 0x7f) << 16) | ((dwObj & 0x80) << 17), ddoi.tszName, sizeof(ddoi.tszName)); - - /* And return our just filled device object instance structure */ - memcpy(pdidoi, &ddoi, (dwSize < sizeof(ddoi) ? dwSize : sizeof(ddoi))); - - _dump_OBJECTINSTANCEA(pdidoi); - - return DI_OK; -} - -static HRESULT WINAPI SysKeyboardWImpl_GetObjectInfo(LPDIRECTINPUTDEVICE8W iface, - LPDIDEVICEOBJECTINSTANCEW pdidoi, - DWORD dwObj, - DWORD dwHow) -{ - SysKeyboardImpl *This = (SysKeyboardImpl *)iface; - DIDEVICEOBJECTINSTANCEW ddoi; - DWORD dwSize = pdidoi->dwSize; - - TRACE("(this=%p,%p,%ld,0x%08lx)\n", This, pdidoi, dwObj, dwHow); - - if (dwHow == DIPH_BYID) { - WARN(" querying by id not supported yet...\n"); - return DI_OK; - } - - memset(pdidoi, 0, dwSize); - memset(&ddoi, 0, sizeof(ddoi)); - - ddoi.dwSize = dwSize; - ddoi.guidType = GUID_Key; - ddoi.dwOfs = dwObj; - ddoi.dwType = DIDFT_MAKEINSTANCE(dwObj) | DIDFT_BUTTON; - GetKeyNameTextW(((dwObj & 0x7f) << 16) | ((dwObj & 0x80) << 17), ddoi.tszName, sizeof(ddoi.tszName)); - - /* And return our just filled device object instance structure */ - memcpy(pdidoi, &ddoi, (dwSize < sizeof(ddoi) ? dwSize : sizeof(ddoi))); - - _dump_OBJECTINSTANCEW(pdidoi); - - return DI_OK; -} - -/********************************************************************** ******** - * GetDeviceInfo : get information about a device's identity - */ -static HRESULT WINAPI SysKeyboardAImpl_GetDeviceInfo( - LPDIRECTINPUTDEVICE8A iface, - LPDIDEVICEINSTANCEA pdidi) -{ - SysKeyboardImpl *This = (SysKeyboardImpl *)iface; - TRACE("(this=%p,%p)\n", This, pdidi); - - if (pdidi->dwSize != sizeof(DIDEVICEINSTANCEA)) { - WARN(" dinput3 not supported yet...\n"); - return DI_OK; - } - - fill_keyboard_dideviceinstanceA(pdidi, This->dinput->version); - - return DI_OK; -} - -static HRESULT WINAPI SysKeyboardWImpl_GetDeviceInfo(LPDIRECTINPUTDEVICE8W iface, LPDIDEVICEINSTANCEW pdidi) -{ - SysKeyboardImpl *This = (SysKeyboardImpl *)iface; - TRACE("(this=%p,%p)\n", This, pdidi); - - if (pdidi->dwSize != sizeof(DIDEVICEINSTANCEW)) { - WARN(" dinput3 not supported yet...\n"); - return DI_OK; - } - - fill_keyboard_dideviceinstanceW(pdidi, This->dinput->version); - - return DI_OK; -} - -static IDirectInputDevice8AVtbl SysKeyboardAvt = -{ - IDirectInputDevice2AImpl_QueryInterface, - IDirectInputDevice2AImpl_AddRef, - SysKeyboardAImpl_Release, - SysKeyboardAImpl_GetCapabilities, - SysKeyboardAImpl_EnumObjects, - SysKeyboardAImpl_GetProperty, - SysKeyboardAImpl_SetProperty, - SysKeyboardAImpl_Acquire, - SysKeyboardAImpl_Unacquire, - SysKeyboardAImpl_GetDeviceState, - SysKeyboardAImpl_GetDeviceData, - IDirectInputDevice2AImpl_SetDataFormat, - SysKeyboardAImpl_SetEventNotification, - IDirectInputDevice2AImpl_SetCooperativeLevel, - SysKeyboardAImpl_GetObjectInfo, - SysKeyboardAImpl_GetDeviceInfo, - IDirectInputDevice2AImpl_RunControlPanel, - IDirectInputDevice2AImpl_Initialize, - IDirectInputDevice2AImpl_CreateEffect, - IDirectInputDevice2AImpl_EnumEffects, - IDirectInputDevice2AImpl_GetEffectInfo, - IDirectInputDevice2AImpl_GetForceFeedbackState, - IDirectInputDevice2AImpl_SendForceFeedbackCommand, - IDirectInputDevice2AImpl_EnumCreatedEffectObjects, - IDirectInputDevice2AImpl_Escape, - IDirectInputDevice2AImpl_Poll, - IDirectInputDevice2AImpl_SendDeviceData, - IDirectInputDevice7AImpl_EnumEffectsInFile, - IDirectInputDevice7AImpl_WriteEffectToFile, - IDirectInputDevice8AImpl_BuildActionMap, - IDirectInputDevice8AImpl_SetActionMap, - IDirectInputDevice8AImpl_GetImageInfo -}; - -#if !defined(__STRICT_ANSI__) && defined(__GNUC__) -# define XCAST(fun) (typeof(SysKeyboardWvt.fun)) -#else -# define XCAST(fun) (void*) -#endif - -static IDirectInputDevice8WVtbl SysKeyboardWvt = -{ - IDirectInputDevice2WImpl_QueryInterface, - XCAST(AddRef)IDirectInputDevice2AImpl_AddRef, - XCAST(Release)SysKeyboardAImpl_Release, - XCAST(GetCapabilities)SysKeyboardAImpl_GetCapabilities, - SysKeyboardWImpl_EnumObjects, - XCAST(GetProperty)SysKeyboardAImpl_GetProperty, - XCAST(SetProperty)SysKeyboardAImpl_SetProperty, - XCAST(Acquire)SysKeyboardAImpl_Acquire, - XCAST(Unacquire)SysKeyboardAImpl_Unacquire, - XCAST(GetDeviceState)SysKeyboardAImpl_GetDeviceState, - XCAST(GetDeviceData)SysKeyboardAImpl_GetDeviceData, - XCAST(SetDataFormat)IDirectInputDevice2AImpl_SetDataFormat, - XCAST(SetEventNotification)SysKeyboardAImpl_SetEventNotification, - XCAST(SetCooperativeLevel)IDirectInputDevice2AImpl_SetCooperativeLevel, - SysKeyboardWImpl_GetObjectInfo, - SysKeyboardWImpl_GetDeviceInfo, - XCAST(RunControlPanel)IDirectInputDevice2AImpl_RunControlPanel, - XCAST(Initialize)IDirectInputDevice2AImpl_Initialize, - XCAST(CreateEffect)IDirectInputDevice2AImpl_CreateEffect, - IDirectInputDevice2WImpl_EnumEffects, - IDirectInputDevice2WImpl_GetEffectInfo, - XCAST(GetForceFeedbackState)IDirectInputDevice2AImpl_GetForceFeedbackSta te, - XCAST(SendForceFeedbackCommand)IDirectInputDevice2AImpl_SendForceFeedbac kCommand, - XCAST(EnumCreatedEffectObjects)IDirectInputDevice2AImpl_EnumCreatedEffec tObjects, - XCAST(Escape)IDirectInputDevice2AImpl_Escape, - XCAST(Poll)IDirectInputDevice2AImpl_Poll, - XCAST(SendDeviceData)IDirectInputDevice2AImpl_SendDeviceData, - IDirectInputDevice7WImpl_EnumEffectsInFile, - IDirectInputDevice7WImpl_WriteEffectToFile, - IDirectInputDevice8WImpl_BuildActionMap, - IDirectInputDevice8WImpl_SetActionMap, - IDirectInputDevice8WImpl_GetImageInfo -}; -#undef XCAST
19 years, 7 months
1
0
0
0
[hbirr] 15356:
by hbirr@svn.reactos.com
Added: branches/cache_manager_rewrite/reactos/lib/wininet/ _____ Copied: branches/cache_manager_rewrite/reactos/lib/wininet (from rev 14691, trunk/reactos/lib/wininet)
19 years, 7 months
1
0
0
0
[hbirr] 15355:
by hbirr@svn.reactos.com
Deleted: branches/cache_manager_rewrite/reactos/lib/wininet/
19 years, 7 months
1
0
0
0
[gvg] 15354: Optimize screen writing
by gvg@svn.reactos.com
Optimize screen writing Modified: branches/xen/reactos/boot/freeldr/freeldr/arch/i386/xenvideo.c Modified: branches/xen/reactos/boot/freeldr/freeldr/ui/tuimenu.c _____ Modified: branches/xen/reactos/boot/freeldr/freeldr/arch/i386/xenvideo.c --- branches/xen/reactos/boot/freeldr/freeldr/arch/i386/xenvideo.c 2005-05-16 19:46:56 UTC (rev 15353) +++ branches/xen/reactos/boot/freeldr/freeldr/arch/i386/xenvideo.c 2005-05-16 20:16:33 UTC (rev 15354) @@ -32,6 +32,7 @@ static unsigned CurrentY = (unsigned) -1; static UCHAR CurrentAttr = 0x07; +static UCHAR ShadowBuffer[ROWS * COLS * 2]; static VOID AnsiMoveToPos(unsigned X, unsigned Y) @@ -72,11 +73,21 @@ VOID XenVideoClearScreen(UCHAR Attr) { + unsigned X, Y; + if (Attr != CurrentAttr) { AnsiSetAttr(Attr); } AnsiClearScreen(); + for (Y = 0; Y < ROWS; Y++) + { + for (X = 0; X < COLS; X++) + { + ShadowBuffer[2 * (Y * COLS + X)] = ' '; + ShadowBuffer[2 * (Y * COLS + X) + 1] = Attr; + } + } } VOID @@ -113,16 +124,23 @@ } } - if (X != CurrentX || Y != CurrentY) + if (Ch != ShadowBuffer[2 * (Y * COLS + X)] + || Attr != ShadowBuffer[2 * (Y * COLS + X) + 1]) { - AnsiMoveToPos(X, Y); + if (X != CurrentX || Y != CurrentY) + { + AnsiMoveToPos(X, Y); + } + if (Attr != CurrentAttr) + { + AnsiSetAttr(Attr); + } + XenConsPutChar(Ch); + CurrentX++; + + ShadowBuffer[2 * (Y * COLS + X)] = Ch; + ShadowBuffer[2 * (Y * COLS + X) + 1] = Attr; } - if (Attr != CurrentAttr) - { - AnsiSetAttr(Attr); - } - XenConsPutChar(Ch); - CurrentX++; } VIDEODISPLAYMODE @@ -166,6 +184,7 @@ BufPtr += 2; } } + AnsiMoveToPos(COLS, ROWS); XenConsFlush(); } _____ Modified: branches/xen/reactos/boot/freeldr/freeldr/ui/tuimenu.c --- branches/xen/reactos/boot/freeldr/freeldr/ui/tuimenu.c 2005-05-16 19:46:56 UTC (rev 15353) +++ branches/xen/reactos/boot/freeldr/freeldr/ui/tuimenu.c 2005-05-16 20:16:33 UTC (rev 15354) @@ -196,7 +196,7 @@ // // Update the status bar // - UiDrawStatusText("Use \x18\x19 to select, then press ENTER."); + UiDrawStatusText("Use arrow keys to select, then press ENTER."); // // Draw the menu box
19 years, 7 months
1
0
0
0
[hbirr] 15353:
by hbirr@svn.reactos.com
Added: branches/cache_manager_rewrite/reactos/lib/msgina/ _____ Copied: branches/cache_manager_rewrite/reactos/lib/msgina (from rev 15352, trunk/reactos/lib/msgina)
19 years, 7 months
1
0
0
0
[hbirr] 15352:
by hbirr@svn.reactos.com
Deleted: branches/cache_manager_rewrite/reactos/lib/msgina/
19 years, 7 months
1
0
0
0
[hbirr] 15351: Merge 14269:14454 from trunk.
by hbirr@svn.reactos.com
Merge 14269:14454 from trunk. Modified: branches/cache_manager_rewrite/reactos/apps/testsets/loadlib/makefile Modified: branches/cache_manager_rewrite/reactos/apps/utils/Makefile Modified: branches/cache_manager_rewrite/reactos/apps/utils/net/ftp/makefile Modified: branches/cache_manager_rewrite/reactos/apps/utils/net/ping/makefile Modified: branches/cache_manager_rewrite/reactos/apps/utils/partinfo/makefile Modified: branches/cache_manager_rewrite/reactos/apps/utils/partinfo/partinfo.c Modified: branches/cache_manager_rewrite/reactos/apps/utils/pnpdump/makefile Modified: branches/cache_manager_rewrite/reactos/apps/utils/pnpdump/pnpdump.c Modified: branches/cache_manager_rewrite/reactos/apps/utils/ps/makefile Modified: branches/cache_manager_rewrite/reactos/apps/utils/sc/makefile Modified: branches/cache_manager_rewrite/reactos/boot/freeldr/Makefile Modified: branches/cache_manager_rewrite/reactos/boot/freeldr/bootsect/Makefile Added: branches/cache_manager_rewrite/reactos/boot/freeldr/bootsect/Makefile.i3 86 Added: branches/cache_manager_rewrite/reactos/boot/freeldr/bootsect/Makefile.po werpc Added: branches/cache_manager_rewrite/reactos/boot/freeldr/bootsect/ofwboot.s Added: branches/cache_manager_rewrite/reactos/boot/freeldr/freeldr/arch/powerpc / Modified: branches/cache_manager_rewrite/reactos/boot/freeldr/freeldr/fs/ntfs.c Modified: branches/cache_manager_rewrite/reactos/boot/freeldr/freeldr/math/libgcc2 .c Added: branches/cache_manager_rewrite/reactos/boot/freeldr/freeldr/math/powerpc .h Modified: branches/cache_manager_rewrite/reactos/boot/freeldr/freeldr/mm/mem.h Modified: branches/cache_manager_rewrite/reactos/boot/freeldr/freeldr/rtl/print.c Modified: branches/cache_manager_rewrite/reactos/boot/freeldr/freeldr/rtl/stdlib.c Modified: branches/cache_manager_rewrite/reactos/drivers/dd/serial/circularbuffer. c Modified: branches/cache_manager_rewrite/reactos/drivers/dd/serial/devctrl.c Modified: branches/cache_manager_rewrite/reactos/drivers/dd/serial/legacy.c Modified: branches/cache_manager_rewrite/reactos/drivers/dd/serial/misc.c Modified: branches/cache_manager_rewrite/reactos/drivers/dd/serial/pnp.c Modified: branches/cache_manager_rewrite/reactos/drivers/dd/serial/rw.c Modified: branches/cache_manager_rewrite/reactos/drivers/dd/serial/serial.c Modified: branches/cache_manager_rewrite/reactos/drivers/dd/serial/serial.h Modified: branches/cache_manager_rewrite/reactos/drivers/fs/np/create.c Modified: branches/cache_manager_rewrite/reactos/drivers/fs/np/fsctrl.c Modified: branches/cache_manager_rewrite/reactos/drivers/fs/np/npfs.c Modified: branches/cache_manager_rewrite/reactos/drivers/fs/np/npfs.h Modified: branches/cache_manager_rewrite/reactos/drivers/fs/np/rw.c Modified: branches/cache_manager_rewrite/reactos/drivers/fs/vfat/cleanup.c Modified: branches/cache_manager_rewrite/reactos/drivers/fs/vfat/close.c Modified: branches/cache_manager_rewrite/reactos/drivers/fs/vfat/fcb.c Modified: branches/cache_manager_rewrite/reactos/drivers/fs/vfat/fsctl.c Modified: branches/cache_manager_rewrite/reactos/drivers/fs/vfat/vfat.h Modified: branches/cache_manager_rewrite/reactos/drivers/lib/ip/network/ip.c Modified: branches/cache_manager_rewrite/reactos/drivers/net/ndis/ndis/protocol.c Modified: branches/cache_manager_rewrite/reactos/drivers/net/tcpip/include/dispatc h.h Modified: branches/cache_manager_rewrite/reactos/drivers/net/tcpip/include/ip.h Modified: branches/cache_manager_rewrite/reactos/drivers/net/tcpip/include/ticonst s.h Modified: branches/cache_manager_rewrite/reactos/drivers/net/tcpip/tcpip/dispatch. c Modified: branches/cache_manager_rewrite/reactos/drivers/net/tcpip/tcpip/iinfo.c Modified: branches/cache_manager_rewrite/reactos/drivers/net/tcpip/tcpip/main.c Modified: branches/cache_manager_rewrite/reactos/drivers/video/videoprt/dispatch.c Modified: branches/cache_manager_rewrite/reactos/drivers/video/videoprt/interrupt. c Modified: branches/cache_manager_rewrite/reactos/drivers/video/videoprt/resource.c Modified: branches/cache_manager_rewrite/reactos/drivers/video/videoprt/videoprt.h Modified: branches/cache_manager_rewrite/reactos/hal/hal/hal.c Modified: branches/cache_manager_rewrite/reactos/hal/hal/hal.def Modified: branches/cache_manager_rewrite/reactos/hal/halx86/generic/spinlock.c Deleted: branches/cache_manager_rewrite/reactos/include/WinDNS.h Deleted: branches/cache_manager_rewrite/reactos/include/WinError.h Deleted: branches/cache_manager_rewrite/reactos/include/WinFax.h Deleted: branches/cache_manager_rewrite/reactos/include/WinSCard.h Deleted: branches/cache_manager_rewrite/reactos/include/WinSmCrd.h Deleted: branches/cache_manager_rewrite/reactos/include/WinWlx.h Deleted: branches/cache_manager_rewrite/reactos/include/aclui.h Deleted: branches/cache_manager_rewrite/reactos/include/ascii.h Deleted: branches/cache_manager_rewrite/reactos/include/coff.h Modified: branches/cache_manager_rewrite/reactos/include/ddk/mmfuncs.h Modified: branches/cache_manager_rewrite/reactos/include/funcs.h Deleted: branches/cache_manager_rewrite/reactos/include/icmpapi.h Modified: branches/cache_manager_rewrite/reactos/include/ntos/rtl.h Modified: branches/cache_manager_rewrite/reactos/include/pe.h Modified: branches/cache_manager_rewrite/reactos/include/pseh/excpt.h Modified: branches/cache_manager_rewrite/reactos/include/pseh/framebased/internal. h Modified: branches/cache_manager_rewrite/reactos/include/pseh/framebased.h Added: branches/cache_manager_rewrite/reactos/include/pseh/native.h Modified: branches/cache_manager_rewrite/reactos/include/pseh/setjmp.h Modified: branches/cache_manager_rewrite/reactos/include/pseh.h Deleted: branches/cache_manager_rewrite/reactos/include/sockets.h Modified: branches/cache_manager_rewrite/reactos/include/tcpioctl.h Deleted: branches/cache_manager_rewrite/reactos/include/wine/cpl.h Deleted: branches/cache_manager_rewrite/reactos/include/wine/fci.h Deleted: branches/cache_manager_rewrite/reactos/include/wine/fdi.h Deleted: branches/cache_manager_rewrite/reactos/include/wine/heap.h Deleted: branches/cache_manager_rewrite/reactos/include/wine/ver.h Modified: branches/cache_manager_rewrite/reactos/lib/aclui/aclui.rc Added: branches/cache_manager_rewrite/reactos/lib/aclui/aclui_Sv.rc Modified: branches/cache_manager_rewrite/reactos/lib/advapi32/advapi32.def Modified: branches/cache_manager_rewrite/reactos/lib/advapi32/crypt/crypt.c Modified: branches/cache_manager_rewrite/reactos/lib/advapi32/misc/sysfunc.c Added: branches/cache_manager_rewrite/reactos/lib/comctl32/comctl_Sv.rc Modified: branches/cache_manager_rewrite/reactos/lib/comctl32/rsrc.rc Deleted: branches/cache_manager_rewrite/reactos/lib/commctrl/ Deleted: branches/cache_manager_rewrite/reactos/lib/coredll/ Modified: branches/cache_manager_rewrite/reactos/lib/cpl/desk/de.rc Modified: branches/cache_manager_rewrite/reactos/lib/cpl/desk/en.rc Modified: branches/cache_manager_rewrite/reactos/lib/cpl/desk/resource.h Modified: branches/cache_manager_rewrite/reactos/lib/cpl/desk/settings.c Added: branches/cache_manager_rewrite/reactos/lib/cpl/sysdm/dk.rc Added: branches/cache_manager_rewrite/reactos/lib/cpl/timedate/Sv.rc Modified: branches/cache_manager_rewrite/reactos/lib/cpl/timedate/timedate.rc Modified: branches/cache_manager_rewrite/reactos/lib/crt/except/matherr.c Modified: branches/cache_manager_rewrite/reactos/lib/crt/float/fpecode.c [truncated at 100 lines; 180 more skipped] _____ Modified: branches/cache_manager_rewrite/reactos/apps/testsets/loadlib/makefile --- branches/cache_manager_rewrite/reactos/apps/testsets/loadlib/makefile 2005-05-16 19:28:18 UTC (rev 15350) +++ branches/cache_manager_rewrite/reactos/apps/testsets/loadlib/makefile 2005-05-16 19:34:42 UTC (rev 15351) @@ -11,7 +11,7 @@ TARGET_NAME = loadlib -TARGET_CFLAGS = -Wall -Werror -D_USE_W32API -DUNICODE -D_UNICODE +TARGET_CFLAGS = -Wall -Werror -D__USE_W32API -DUNICODE -D_UNICODE TARGET_SDKLIBS = kernel32.a ntdll.a _____ Modified: branches/cache_manager_rewrite/reactos/apps/utils/Makefile --- branches/cache_manager_rewrite/reactos/apps/utils/Makefile 2005-05-16 19:28:18 UTC (rev 15350) +++ branches/cache_manager_rewrite/reactos/apps/utils/Makefile 2005-05-16 19:34:42 UTC (rev 15351) @@ -9,7 +9,7 @@ # Console system utilities # cabman cat net objdir partinfo pice ps sc stats -UTIL_APPS = cat objdir partinfo pnpdump sc shutdown stats tickcount ps +UTIL_APPS = cat objdir pnpdump sc shutdown stats tickcount ps UTIL_NET_APPS = arp finger ftp ipconfig netstat ping route telnet whois _____ Modified: branches/cache_manager_rewrite/reactos/apps/utils/net/ftp/makefile --- branches/cache_manager_rewrite/reactos/apps/utils/net/ftp/makefile 2005-05-16 19:28:18 UTC (rev 15350) +++ branches/cache_manager_rewrite/reactos/apps/utils/net/ftp/makefile 2005-05-16 19:34:42 UTC (rev 15351) @@ -8,6 +8,8 @@ TARGET_INSTALLDIR = system32 +TARGET_CFLAGS = -D__USE_W32API + TARGET_SDKLIBS = ws2_32.a iphlpapi.a # ntdll.a _____ Modified: branches/cache_manager_rewrite/reactos/apps/utils/net/ping/makefile --- branches/cache_manager_rewrite/reactos/apps/utils/net/ping/makefile 2005-05-16 19:28:18 UTC (rev 15350) +++ branches/cache_manager_rewrite/reactos/apps/utils/net/ping/makefile 2005-05-16 19:34:42 UTC (rev 15351) @@ -8,7 +8,7 @@ TARGET_INSTALLDIR = system32 -TARGET_CFLAGS = -D__USE_W32_SOCKETS +TARGET_CFLAGS = -D__USE_W32API -D__USE_W32_SOCKETS TARGET_SDKLIBS = ws2_32.a _____ Modified: branches/cache_manager_rewrite/reactos/apps/utils/partinfo/makefile --- branches/cache_manager_rewrite/reactos/apps/utils/partinfo/makefile 2005-05-16 19:28:18 UTC (rev 15350) +++ branches/cache_manager_rewrite/reactos/apps/utils/partinfo/makefile 2005-05-16 19:34:42 UTC (rev 15351) @@ -10,7 +10,7 @@ TARGET_NAME = partinfo -TARGET_CFLAGS = -Wall -Werror -Wno-format +TARGET_CFLAGS = -D__USE_W32API -Wall -Werror -Wno-format TARGET_SDKLIBS = ntdll.a kernel32.a _____ Modified: branches/cache_manager_rewrite/reactos/apps/utils/partinfo/partinfo.c --- branches/cache_manager_rewrite/reactos/apps/utils/partinfo/partinfo.c 2005-05-16 19:28:18 UTC (rev 15350) +++ branches/cache_manager_rewrite/reactos/apps/utils/partinfo/partinfo.c 2005-05-16 19:34:42 UTC (rev 15351) @@ -8,10 +8,12 @@ #include <stdio.h> #include <stdlib.h> +#include <ddk/ntddk.h> + //#define DUMP_DATA #define DUMP_SIZE_INFO +#define UNICODE - #ifdef DUMP_DATA void HexDump(char *buffer, ULONG size) { _____ Modified: branches/cache_manager_rewrite/reactos/apps/utils/pnpdump/makefile --- branches/cache_manager_rewrite/reactos/apps/utils/pnpdump/makefile 2005-05-16 19:28:18 UTC (rev 15350) +++ branches/cache_manager_rewrite/reactos/apps/utils/pnpdump/makefile 2005-05-16 19:34:42 UTC (rev 15351) @@ -10,7 +10,7 @@ TARGET_NAME = pnpdump -TARGET_CFLAGS = -Wall -Werror +TARGET_CFLAGS = -D__USE_W32API -Wall -Werror TARGET_SDKLIBS = ntdll.a kernel32.a _____ Modified: branches/cache_manager_rewrite/reactos/apps/utils/pnpdump/pnpdump.c --- branches/cache_manager_rewrite/reactos/apps/utils/pnpdump/pnpdump.c 2005-05-16 19:28:18 UTC (rev 15350) +++ branches/cache_manager_rewrite/reactos/apps/utils/pnpdump/pnpdump.c 2005-05-16 19:34:42 UTC (rev 15351) @@ -8,6 +8,8 @@ #include <stdlib.h> #include <conio.h> +#include <ddk/ntddk.h> + #include <pshpack1.h> typedef struct _CM_PNP_BIOS_DEVICE_NODE _____ Modified: branches/cache_manager_rewrite/reactos/apps/utils/ps/makefile --- branches/cache_manager_rewrite/reactos/apps/utils/ps/makefile 2005-05-16 19:28:18 UTC (rev 15350) +++ branches/cache_manager_rewrite/reactos/apps/utils/ps/makefile 2005-05-16 19:34:42 UTC (rev 15351) @@ -10,7 +10,7 @@ TARGET_NAME = ps -TARGET_CFLAGS = -DANONYMOUSUNIONS -Werror -Wall +TARGET_CFLAGS = -D__USE_W32API -DANONYMOUSUNIONS -Werror -Wall TARGET_SDKLIBS = ntdll.a kernel32.a user32.a _____ Modified: branches/cache_manager_rewrite/reactos/apps/utils/sc/makefile --- branches/cache_manager_rewrite/reactos/apps/utils/sc/makefile 2005-05-16 19:28:18 UTC (rev 15350) +++ branches/cache_manager_rewrite/reactos/apps/utils/sc/makefile 2005-05-16 19:34:42 UTC (rev 15351) @@ -13,7 +13,7 @@ TARGET_NAME = sc -TARGET_CFLAGS = -DDBG -Werror -Wall +TARGET_CFLAGS = -D__USE_W32API -DDBG -Werror -Wall TARGET_SDKLIBS = kernel32.a ntdll.a advapi32.a _____ Modified: branches/cache_manager_rewrite/reactos/boot/freeldr/Makefile --- branches/cache_manager_rewrite/reactos/boot/freeldr/Makefile 2005-05-16 19:28:18 UTC (rev 15350) +++ branches/cache_manager_rewrite/reactos/boot/freeldr/Makefile 2005-05-16 19:34:42 UTC (rev 15351) @@ -29,7 +29,7 @@ $(MAKE) -C fdebug test: - + clean: $(MAKE) -C bootsect clean $(MAKE) -C freeldr clean @@ -38,6 +38,7 @@ $(MAKE) -C tools clean bootcd: +ifeq ($(ARCH),i386) $(CP) bootsect/isoboot.bin ${BOOTCD_DIR}/../isoboot.bin $(CP) bootsect/dosmbr.bin ${BOOTCD_DIR}/loader/dosmbr.bin $(CP) bootsect/ext2.bin ${BOOTCD_DIR}/loader/ext2.bin @@ -46,5 +47,7 @@ $(CP) bootsect/isoboot.bin ${BOOTCD_DIR}/loader/isoboot.bin $(CP) freeldr/freeldr.sys ${BOOTCD_DIR}/loader/freeldr.sys $(CP) freeldr/setupldr.sys ${BOOTCD_DIR}/loader/setupldr.sys +endif .PHONY : clean + _____ Modified: branches/cache_manager_rewrite/reactos/boot/freeldr/bootsect/Makefile --- branches/cache_manager_rewrite/reactos/boot/freeldr/bootsect/Makefile 2005-05-16 19:28:18 UTC (rev 15350) +++ branches/cache_manager_rewrite/reactos/boot/freeldr/bootsect/Makefile 2005-05-16 19:34:42 UTC (rev 15351) @@ -25,56 +25,8 @@ .PHONY : clean bootcd -all: $(BIN2C) dosmbr.bin fat.bin fat32.bin isoboot.bin ext2.bin - - -$(BIN2C) : - @$(MAKE) --no-print-directory -C $(FREELDR_TOOLS_PATH) - -dosmbr.bin : dosmbr.asm - @echo freeldr: Assembling dosmbr - @$(NASM_CMD) $(NFLAGS) -o dosmbr.bin -f bin dosmbr.asm - -fat.bin : fat.asm $(BIN2C) - @echo freeldr: Assembling fat - @$(NASM_CMD) $(NFLAGS) -o fat.bin -f bin fat.asm - @$(BIN2C) fat.bin fat.h fat_data - - -fat32.bin : fat32.asm $(BIN2C) - @echo freeldr: Assembling fat32 - @$(NASM_CMD) $(NFLAGS) -o fat32.bin -f bin fat32.asm - @$(BIN2C) fat32.bin fat32.h fat32_data - -isoboot.bin : isoboot.asm - @echo freeldr: Assembling isoboot - @$(NASM_CMD) $(NFLAGS) -o isoboot.bin -f bin isoboot.asm - -ext2.bin : ext2.asm - @echo freeldr: Assembling ext2 - @$(NASM_CMD) $(NFLAGS) -o ext2.bin -f bin ext2.asm - @$(BIN2C) ext2.bin ext2.h ext2_data - - -.PHONY : bootcd -bootcd: bootcd_dirs isoboot.bin - $(CP) isoboot.bin $(BOOTCD_DIR) - $(CP) dosmbr.bin $(BOOTCD_DIR)/disk/loader - $(CP) ext2.bin $(BOOTCD_DIR)/disk/loader - $(CP) fat.bin $(BOOTCD_DIR)/disk/loader - $(CP) fat32.bin $(BOOTCD_DIR)/disk/loader - $(CP) isoboot.bin $(BOOTCD_DIR)/disk/loader - -.PHONY : bootcd_dirs -bootcd_dirs: - $(MKDIR) $(BOOTCD_DIR) - $(MKDIR) $(BOOTCD_DIR)/disk - $(MKDIR) $(BOOTCD_DIR)/disk/reactos - $(MKDIR) $(BOOTCD_DIR)/disk/install - $(MKDIR) $(BOOTCD_DIR)/disk/bootdisk - $(MKDIR) $(BOOTCD_DIR)/disk/loader - -clean: - @-$(RM) *.bin - @-$(RM) *.h - @echo freeldr: Clean ALL done. +ifeq ($(ARCH),powerpc) +include Makefile.powerpc +else +include Makefile.i386 +endif _____ Copied: branches/cache_manager_rewrite/reactos/boot/freeldr/bootsect/Makefile.i3 86 (from rev 14454, trunk/reactos/boot/freeldr/bootsect/Makefile.i386) _____ Copied: branches/cache_manager_rewrite/reactos/boot/freeldr/bootsect/Makefile.po werpc (from rev 14454, trunk/reactos/boot/freeldr/bootsect/Makefile.powerpc) _____ Copied: branches/cache_manager_rewrite/reactos/boot/freeldr/bootsect/ofwboot.s (from rev 14454, trunk/reactos/boot/freeldr/bootsect/ofwboot.s) _____ Copied: branches/cache_manager_rewrite/reactos/boot/freeldr/freeldr/arch/powerpc (from rev 14454, trunk/reactos/boot/freeldr/freeldr/arch/powerpc) _____ Modified: branches/cache_manager_rewrite/reactos/boot/freeldr/freeldr/fs/ntfs.c --- branches/cache_manager_rewrite/reactos/boot/freeldr/freeldr/fs/ntfs.c 2005-05-16 19:28:18 UTC (rev 15350) +++ branches/cache_manager_rewrite/reactos/boot/freeldr/freeldr/fs/ntfs.c 2005-05-16 19:34:42 UTC (rev 15351) @@ -21,7 +21,7 @@ * Limitations: * - No support for compressed files. * - No attribute list support. - * - May crash on currupted filesystem. + * - May crash on corrupted filesystem. */ #include <freeldr.h> _____ Modified: branches/cache_manager_rewrite/reactos/boot/freeldr/freeldr/math/libgcc2 .c --- branches/cache_manager_rewrite/reactos/boot/freeldr/freeldr/math/libgcc2 .c 2005-05-16 19:28:18 UTC (rev 15350) +++ branches/cache_manager_rewrite/reactos/boot/freeldr/freeldr/math/libgcc2 .c 2005-05-16 19:34:42 UTC (rev 15351) @@ -38,6 +38,8 @@ */ #ifdef __i386__ #include "i386.h" +#elif defined(_M_PPC) +#include "powerpc.h" #endif #define L_clz #define L_udivdi3 _____ Copied: branches/cache_manager_rewrite/reactos/boot/freeldr/freeldr/math/powerpc .h (from rev 14454, trunk/reactos/boot/freeldr/freeldr/math/powerpc.h) _____ Modified: branches/cache_manager_rewrite/reactos/boot/freeldr/freeldr/mm/mem.h --- branches/cache_manager_rewrite/reactos/boot/freeldr/freeldr/mm/mem.h 2005-05-16 19:28:18 UTC (rev 15350) +++ branches/cache_manager_rewrite/reactos/boot/freeldr/freeldr/mm/mem.h 2005-05-16 19:34:42 UTC (rev 15351) @@ -22,11 +22,11 @@ #define __MEM_H -#ifdef __i386__ +#if defined(__i386__) || defined(_PPC_) #define MM_PAGE_SIZE 4096 -#endif // defined __i386__ +#endif // defined __i386__ or _PPC_ typedef struct { _____ Modified: branches/cache_manager_rewrite/reactos/boot/freeldr/freeldr/rtl/print.c --- branches/cache_manager_rewrite/reactos/boot/freeldr/freeldr/rtl/print.c 2005-05-16 19:28:18 UTC (rev 15350) +++ branches/cache_manager_rewrite/reactos/boot/freeldr/freeldr/rtl/print.c 2005-05-16 19:34:42 UTC (rev 15351) @@ -20,6 +20,7 @@ #include <freeldr.h> #include <machine.h> #include <rtl.h> +#include <stdarg.h> /* * print() - prints unformatted text to stdout @@ -38,12 +39,11 @@ */ void printf(char *format, ... ) { - int *dataptr = (int *)(void *)&format; + va_list ap; + va_start(ap,format); char c, *ptr, str[16]; int ll; - dataptr++; - while ((c = *(format++))) { if (c != '%') @@ -66,11 +66,11 @@ case 'd': case 'u': case 'x': if (ll) { - *convert_i64_to_ascii(str, c, *((unsigned long long *) dataptr++)) = 0; + *convert_i64_to_ascii(str, c, va_arg(ap, unsigned long long)) = 0; } else { - *convert_to_ascii(str, c, *((unsigned long *) dataptr++)) = 0; + *convert_to_ascii(str, c, va_arg(ap, unsigned long)) = 0; } ptr = str; @@ -81,10 +81,10 @@ } break; - case 'c': MachConsPutChar((*(dataptr++))&0xff); break; + case 'c': MachConsPutChar((va_arg(ap,int))&0xff); break; case 's': - ptr = (char *)(*(dataptr++)); + ptr = va_arg(ap,char *); while ((c = *(ptr++))) { @@ -100,16 +100,18 @@ } } } + + va_end(ap); } void sprintf(char *buffer, char *format, ... ) { - int *dataptr = (int *)(void *)&format; + va_list ap; char c, *ptr, str[16]; char *p = buffer; int ll; - dataptr++; + va_start(ap,format); while ((c = *(format++))) { @@ -134,11 +136,11 @@ case 'd': case 'u': case 'x': if (ll) { - *convert_i64_to_ascii(str, c, *((unsigned long long*) dataptr++)) = 0; + *convert_i64_to_ascii(str, c, va_arg(ap, unsigned long long)) = 0; } else { - *convert_to_ascii(str, c, *((unsigned long *) dataptr++)) = 0; + *convert_to_ascii(str, c, va_arg(ap, unsigned long)) = 0; } ptr = str; @@ -151,12 +153,12 @@ break; case 'c': - *p = (*(dataptr++))&0xff; + *p = va_arg(ap,int)&0xff; p++; break; case 's': - ptr = (char *)(*(dataptr++)); + ptr = va_arg(ap,char *); while ((c = *(ptr++))) { @@ -174,5 +176,6 @@ } } } + va_end(ap); *p=0; } _____ Modified: branches/cache_manager_rewrite/reactos/boot/freeldr/freeldr/rtl/stdlib.c --- branches/cache_manager_rewrite/reactos/boot/freeldr/freeldr/rtl/stdlib.c 2005-05-16 19:28:18 UTC (rev 15350) +++ branches/cache_manager_rewrite/reactos/boot/freeldr/freeldr/rtl/stdlib.c 2005-05-16 19:34:42 UTC (rev 15351) @@ -17,16 +17,15 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ - /* * convert_to_ascii() - converts a number to it's ascii equivalent * from: * GRUB -- GRand Unified Bootloader * Copyright (C) 1996 Erich Boleyn <erich(a)uruk.org> */ -char *convert_to_ascii(char *buf, int c, ...) +char *convert_to_ascii(char *buf, int c, int num) { - unsigned long num = *((&c) + 1), mult = 10; + unsigned long mult = 10; char *ptr = buf; if (c == 'x') @@ -63,9 +62,8 @@ return ptr; } -char *convert_i64_to_ascii(char *buf, int c, ...) +char *convert_i64_to_ascii(char *buf, int c, unsigned long long num) { - unsigned long long num = *(long long*)((&c) + 1); int mult = 10; char *ptr = buf; _____ Modified: branches/cache_manager_rewrite/reactos/drivers/dd/serial/circularbuffer. c --- branches/cache_manager_rewrite/reactos/drivers/dd/serial/circularbuffer. c 2005-05-16 19:28:18 UTC (rev 15350) +++ branches/cache_manager_rewrite/reactos/drivers/dd/serial/circularbuffer. c 2005-05-16 19:34:42 UTC (rev 15351) @@ -8,7 +8,7 @@ * PROGRAMMERS: HervÚ Poussineau (poussine(a)freesurf.fr) */ -//#define NDEBUG +#define NDEBUG #include "serial.h" NTSTATUS @@ -16,7 +16,8 @@ IN PCIRCULAR_BUFFER pBuffer, IN ULONG BufferSize) { - pBuffer->Buffer = ExAllocatePoolWithTag(NonPagedPool, BufferSize * sizeof(UCHAR), SERIAL_TAG); + DPRINT("Serial: InitializeCircularBuffer(pBuffer %p, BufferSize %lu)\n", pBuffer, BufferSize); + pBuffer->Buffer = (PUCHAR)ExAllocatePoolWithTag(NonPagedPool, BufferSize * sizeof(UCHAR), SERIAL_TAG); if (!pBuffer->Buffer) return STATUS_INSUFFICIENT_RESOURCES; pBuffer->Length = BufferSize; @@ -28,6 +29,7 @@ FreeCircularBuffer( IN PCIRCULAR_BUFFER pBuffer) { + DPRINT("Serial: FreeCircularBuffer(pBuffer %p)\n", pBuffer); ExFreePoolWithTag(pBuffer->Buffer, SERIAL_TAG); return STATUS_SUCCESS; } @@ -36,6 +38,7 @@ IsCircularBufferEmpty( IN PCIRCULAR_BUFFER pBuffer) { + DPRINT("Serial: IsCircularBufferEmpty(pBuffer %p)\n", pBuffer); return (pBuffer->ReadPosition == pBuffer->WritePosition); } @@ -44,6 +47,7 @@ IN PCIRCULAR_BUFFER pBuffer, IN UCHAR Entry) { + DPRINT("Serial: PushCircularBufferEntry(pBuffer %p, Entry 0x%x)\n", pBuffer, Entry); ASSERT(pBuffer->Length); ULONG NextPosition = (pBuffer->WritePosition + 1) % pBuffer->Length; if (NextPosition == pBuffer->ReadPosition) @@ -58,6 +62,7 @@ IN PCIRCULAR_BUFFER pBuffer, OUT PUCHAR Entry) { + DPRINT("Serial: PopCircularBufferEntry(pBuffer %p)\n", pBuffer); ASSERT(pBuffer->Length); if (IsCircularBufferEmpty(pBuffer)) return STATUS_ARRAY_BOUNDS_EXCEEDED; @@ -65,3 +70,27 @@ pBuffer->ReadPosition = (pBuffer->ReadPosition + 1) % pBuffer->Length; return STATUS_SUCCESS; } + +NTSTATUS +IncreaseCircularBufferSize( + IN PCIRCULAR_BUFFER pBuffer, + IN ULONG NewBufferSize) +{ + PUCHAR NewBuffer; + + DPRINT("Serial: IncreaseCircularBufferSize(pBuffer %p, NewBufferSize %lu)\n", pBuffer, NewBufferSize); + ASSERT(pBuffer->Length); + if (pBuffer->Length > NewBufferSize) + return STATUS_INVALID_PARAMETER; + else if (pBuffer->Length == NewBufferSize) + return STATUS_SUCCESS; + + NewBuffer = (PUCHAR)ExAllocatePoolWithTag(NonPagedPool, NewBufferSize * sizeof(UCHAR), SERIAL_TAG); + if (!NewBuffer) + return STATUS_INSUFFICIENT_RESOURCES; + RtlCopyMemory(NewBuffer, pBuffer->Buffer, pBuffer->Length * sizeof(UCHAR)); + ExFreePoolWithTag(pBuffer->Buffer, SERIAL_TAG); + pBuffer->Buffer = NewBuffer; + pBuffer->Length = NewBufferSize; + return STATUS_SUCCESS; +} _____ Modified: branches/cache_manager_rewrite/reactos/drivers/dd/serial/devctrl.c --- branches/cache_manager_rewrite/reactos/drivers/dd/serial/devctrl.c 2005-05-16 19:28:18 UTC (rev 15350) +++ branches/cache_manager_rewrite/reactos/drivers/dd/serial/devctrl.c 2005-05-16 19:34:42 UTC (rev 15351) @@ -7,11 +7,42 @@ * * PROGRAMMERS: HervÚ Poussineau (poussine(a)freesurf.fr) */ -/* FIXME: call IoAcquireRemoveLock/IoReleaseRemoveLock around each I/O operation */ #define NDEBUG #include "serial.h" +#define IO_METHOD_FROM_CTL_CODE(ctlCode) (ctlCode&0x00000003) + +static VOID +SerialGetUserBuffers( + IN PIRP Irp, + IN ULONG IoControlCode, + OUT PVOID* BufferIn, + OUT PVOID* BufferOut) +{ + ASSERT(Irp); + ASSERT(BufferIn); + ASSERT(BufferOut); + + switch (IO_METHOD_FROM_CTL_CODE(IoControlCode)) + { + case METHOD_BUFFERED: + *BufferIn = *BufferOut = Irp->AssociatedIrp.SystemBuffer; + return; + case METHOD_IN_DIRECT: + case METHOD_OUT_DIRECT: + *BufferIn = Irp->AssociatedIrp.SystemBuffer; + *BufferOut = MmGetSystemAddressForMdl(Irp->MdlAddress); + return; + case METHOD_NEITHER: + *BufferIn = IoGetCurrentIrpStackLocation(Irp)->Parameters.DeviceIoControl.Type3Input Buffer; + *BufferOut = Irp->UserBuffer; + return; + } + + /* Should never happen */ +} + NTSTATUS STDCALL SerialSetBaudRate( IN PSERIAL_DEVICE_EXTENSION DeviceExtension, @@ -60,16 +91,13 @@ { UCHAR Lcr; DPRINT("Serial: SerialSetBaudRate(COM%lu, %lu Bauds)\n", DeviceExtension->ComPort, BaudRate); - /* FIXME: update DeviceExtension->LowerDevice when modifying LCR? */ /* Set Bit 7 of LCR to expose baud registers */ Lcr = READ_PORT_UCHAR(SER_LCR(ComPortBase)); - Lcr |= SR_LCR_DLAB; - WRITE_PORT_UCHAR(SER_LCR(ComPortBase), Lcr); + WRITE_PORT_UCHAR(SER_LCR(ComPortBase), Lcr | SR_LCR_DLAB); /* Write the baud rate */ WRITE_PORT_UCHAR(SER_DLL(ComPortBase), divisor & 0xff); WRITE_PORT_UCHAR(SER_DLM(ComPortBase), divisor >> 8); /* Switch back to normal registers */ - Lcr ^= SR_LCR_DLAB; WRITE_PORT_UCHAR(SER_LCR(ComPortBase), Lcr); IoReleaseRemoveLock(&DeviceExtension->RemoveLock, (PVOID)DeviceExtension->ComPort); @@ -77,7 +105,7 @@ } if (NT_SUCCESS(Status)) - DeviceExtension->BaudRate = NewBaudRate; + DeviceExtension->BaudRate = BaudRate; return Status; } @@ -190,22 +218,30 @@ pCommProp->ServiceMask = SERIAL_SP_SERIALCOMM; pCommProp->MaxTxQueue = pCommProp->CurrentTxQueue = DeviceExtension->OutputBuffer.Length - 1; pCommProp->MaxRxQueue = pCommProp->CurrentRxQueue = DeviceExtension->InputBuffer.Length - 1; - pCommProp->MaxBaud = SERIAL_BAUD_115200; pCommProp->ProvSubType = 1; // PST_RS232; - /* FIXME: ProvCapabilities may be related to Uart type */ pCommProp->ProvCapabilities = SERIAL_PCF_DTRDSR | SERIAL_PCF_INTTIMEOUTS | SERIAL_PCF_PARITY_CHECK | SERIAL_PCF_RTSCTS | SERIAL_PCF_SETXCHAR | SERIAL_PCF_SPECIALCHARS | SERIAL_PCF_TOTALTIMEOUTS | SERIAL_PCF_XONXOFF; - /* FIXME: SettableParams may be related to Uart type */ pCommProp->SettableParams = SERIAL_SP_BAUD | SERIAL_SP_DATABITS | SERIAL_SP_HANDSHAKING | SERIAL_SP_PARITY | SERIAL_SP_PARITY_CHECK | SERIAL_SP_STOPBITS; - /* FIXME: SettableBaud may be related to Uart type */ + + /* SettableBaud is related to Uart type */ pCommProp->SettableBaud = SERIAL_BAUD_075 | SERIAL_BAUD_110 | SERIAL_BAUD_134_5 | SERIAL_BAUD_150 | SERIAL_BAUD_300 | SERIAL_BAUD_600 | SERIAL_BAUD_1200 | SERIAL_BAUD_1800 | SERIAL_BAUD_2400 | SERIAL_BAUD_4800 | SERIAL_BAUD_7200 - | SERIAL_BAUD_9600 | SERIAL_BAUD_14400 | SERIAL_BAUD_19200 | SERIAL_BAUD_38400 - | SERIAL_BAUD_56K | SERIAL_BAUD_57600 | SERIAL_BAUD_115200 | SERIAL_BAUD_128K - | SERIAL_BAUD_USER; + | SERIAL_BAUD_9600 | SERIAL_BAUD_USER; + pCommProp->MaxBaud = SERIAL_BAUD_9600; + if (DeviceExtension->UartType >= Uart16450) + { + pCommProp->SettableBaud |= SERIAL_BAUD_14400 | SERIAL_BAUD_19200 | SERIAL_BAUD_38400; + pCommProp->MaxBaud = SERIAL_BAUD_38400; + } + if (DeviceExtension->UartType >= Uart16550) + { + pCommProp->SettableBaud |= SERIAL_BAUD_56K | SERIAL_BAUD_57600 | SERIAL_BAUD_115200 | SERIAL_BAUD_128K; + pCommProp->MaxBaud = SERIAL_BAUD_115200; + } + pCommProp->SettableData = SERIAL_DATABITS_5 | SERIAL_DATABITS_6 | SERIAL_DATABITS_7 | SERIAL_DATABITS_8; pCommProp->SettableStopParity = SERIAL_STOPBITS_10 | SERIAL_STOPBITS_15 | SERIAL_STOPBITS_20 | SERIAL_PARITY_NONE | SERIAL_PARITY_ODD | SERIAL_PARITY_EVEN | SERIAL_PARITY_MARK | SERIAL_PARITY_SPACE; @@ -213,33 +249,61 @@ return STATUS_SUCCESS; } +NTSTATUS +SerialGetCommStatus( + OUT PSERIAL_STATUS pSerialStatus, + IN PSERIAL_DEVICE_EXTENSION DeviceExtension) +{ + KIRQL Irql; + + RtlZeroMemory(pSerialStatus, sizeof(SERIAL_STATUS)); + + pSerialStatus->Errors = 0; /* FIXME */ + pSerialStatus->HoldReasons = 0; /* FIXME */ + + KeAcquireSpinLock(&DeviceExtension->InputBufferLock, &Irql); + pSerialStatus->AmountInInQueue = (DeviceExtension->InputBuffer.WritePosition + DeviceExtension->InputBuffer.Length + - DeviceExtension->InputBuffer.ReadPosition) % DeviceExtension->InputBuffer.Length; + KeReleaseSpinLock(&DeviceExtension->InputBufferLock, Irql); + + KeAcquireSpinLock(&DeviceExtension->OutputBufferLock, &Irql); + pSerialStatus->AmountInOutQueue = (DeviceExtension->OutputBuffer.WritePosition + DeviceExtension->OutputBuffer.Length + - DeviceExtension->OutputBuffer.ReadPosition) % DeviceExtension->OutputBuffer.Length; + KeReleaseSpinLock(&DeviceExtension->OutputBufferLock, Irql); + + pSerialStatus->EofReceived = FALSE; /* always FALSE */ + pSerialStatus->WaitForImmediate = FALSE; /* always FALSE */ + + return STATUS_SUCCESS; +} + NTSTATUS STDCALL SerialDeviceControl( IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp) { PIO_STACK_LOCATION Stack; + ULONG IoControlCode; PSERIAL_DEVICE_EXTENSION DeviceExtension; ULONG LengthIn, LengthOut; ULONG Information = 0; - PUCHAR Buffer; + PVOID BufferIn, BufferOut; PUCHAR ComPortBase; NTSTATUS Status; DPRINT("Serial: IRP_MJ_DEVICE_CONTROL dispatch\n"); - /* FIXME: pend operation if possible */ - Stack = IoGetCurrentIrpStackLocation(Irp); LengthIn = Stack->Parameters.DeviceIoControl.InputBufferLength; LengthOut = Stack->Parameters.DeviceIoControl.OutputBufferLength; - Buffer = Irp->AssociatedIrp.SystemBuffer; DeviceExtension = (PSERIAL_DEVICE_EXTENSION)DeviceObject->DeviceExtension; ComPortBase = (PUCHAR)DeviceExtension->BaseAddress; + IoControlCode = Stack->Parameters.DeviceIoControl.IoControlCode; + SerialGetUserBuffers(Irp, IoControlCode, &BufferIn, &BufferOut); /* FIXME: need to probe buffers */ /* FIXME: see
http://www.osronline.com/ddkx/serial/serref_61bm.htm
*/ - switch (Stack->Parameters.DeviceIoControl.IoControlCode) + switch (IoControlCode) { case IOCTL_SERIAL_CLEAR_STATS: { @@ -256,9 +320,13 @@ DPRINT("Serial: IOCTL_SERIAL_CLR_DTR\n"); /* FIXME: If the handshake flow control of the device is configured to * automatically use DTR, return STATUS_INVALID_PARAMETER */ - DeviceExtension->MCR &= ~SR_MCR_DTR; - WRITE_PORT_UCHAR(SER_MCR(ComPortBase), DeviceExtension->MCR); - Status = STATUS_SUCCESS; + Status = IoAcquireRemoveLock(&DeviceExtension->RemoveLock, (PVOID)DeviceExtension->ComPort); + if (NT_SUCCESS(Status)) + { + DeviceExtension->MCR &= ~SR_MCR_DTR; + WRITE_PORT_UCHAR(SER_MCR(ComPortBase), DeviceExtension->MCR); + IoReleaseRemoveLock(&DeviceExtension->RemoveLock, (PVOID)DeviceExtension->ComPort); + } break; } case IOCTL_SERIAL_CLR_RTS: @@ -266,9 +334,13 @@ DPRINT("Serial: IOCTL_SERIAL_CLR_RTS\n"); /* FIXME: If the handshake flow control of the device is configured to * automatically use RTS, return STATUS_INVALID_PARAMETER */ - DeviceExtension->MCR &= ~SR_MCR_RTS; - WRITE_PORT_UCHAR(SER_MCR(ComPortBase), DeviceExtension->MCR); - Status = STATUS_SUCCESS; + Status = IoAcquireRemoveLock(&DeviceExtension->RemoveLock, (PVOID)DeviceExtension->ComPort); + if (NT_SUCCESS(Status)) + { + DeviceExtension->MCR &= ~SR_MCR_RTS; + WRITE_PORT_UCHAR(SER_MCR(ComPortBase), DeviceExtension->MCR); + IoReleaseRemoveLock(&DeviceExtension->RemoveLock, (PVOID)DeviceExtension->ComPort); + } break; } case IOCTL_SERIAL_CONFIG_SIZE: @@ -276,11 +348,11 @@ /* Obsolete on Microsoft Windows 2000+ */ PULONG pConfigSize; DPRINT("Serial: IOCTL_SERIAL_CONFIG_SIZE\n"); - if (LengthOut != sizeof(ULONG) || Buffer == NULL) + if (LengthOut != sizeof(ULONG) || BufferOut == NULL) Status = STATUS_INVALID_PARAMETER; else { - pConfigSize = (PULONG)Buffer; + pConfigSize = (PULONG)BufferOut; *pConfigSize = 0; Status = STATUS_SUCCESS; } @@ -291,14 +363,15 @@ DPRINT("Serial: IOCTL_SERIAL_GET_BAUD_RATE\n"); if (LengthOut < sizeof(SERIAL_BAUD_RATE)) Status = STATUS_BUFFER_TOO_SMALL; - else if (Buffer == NULL) + else if (BufferOut == NULL) Status = STATUS_INVALID_PARAMETER; else { - ((PSERIAL_BAUD_RATE)Buffer)->BaudRate = DeviceExtension->BaudRate; + ((PSERIAL_BAUD_RATE)BufferOut)->BaudRate = DeviceExtension->BaudRate; Information = sizeof(SERIAL_BAUD_RATE); Status = STATUS_SUCCESS; } + break; } case IOCTL_SERIAL_GET_CHARS: { @@ -309,20 +382,33 @@ } case IOCTL_SERIAL_GET_COMMSTATUS: { - /* FIXME */ - DPRINT1("Serial: IOCTL_SERIAL_GET_COMMSTATUS not implemented.\n"); - Status = STATUS_NOT_IMPLEMENTED; + DPRINT("Serial: IOCTL_SERIAL_GET_COMMSTATUS\n"); + if (LengthOut < sizeof(SERIAL_STATUS)) + { + DPRINT("Serial: return STATUS_BUFFER_TOO_SMALL\n"); + Status = STATUS_BUFFER_TOO_SMALL; + } + else if (BufferOut == NULL) + { + DPRINT("Serial: return STATUS_INVALID_PARAMETER\n"); + Status = STATUS_INVALID_PARAMETER; + } + else + { + Status = SerialGetCommStatus((PSERIAL_STATUS)BufferOut, DeviceExtension); + Information = sizeof(SERIAL_STATUS); + } break; } case IOCTL_SERIAL_GET_DTRRTS: { PULONG pDtrRts; DPRINT("Serial: IOCTL_SERIAL_GET_DTRRTS\n"); - if (LengthOut != sizeof(ULONG) || Buffer == NULL) + if (LengthOut != sizeof(ULONG) || BufferOut == NULL) Status = STATUS_INVALID_PARAMETER; else { - pDtrRts = (PULONG)Buffer; + pDtrRts = (PULONG)BufferOut; *pDtrRts = 0; if (DeviceExtension->MCR & SR_MCR_DTR) *pDtrRts |= SERIAL_DTR_STATE; @@ -344,11 +430,11 @@ DPRINT("Serial: IOCTL_SERIAL_GET_LINE_CONTROL\n"); if (LengthOut < sizeof(SERIAL_LINE_CONTROL)) Status = STATUS_BUFFER_TOO_SMALL; - else if (Buffer == NULL) + else if (BufferOut == NULL) Status = STATUS_INVALID_PARAMETER; else { - *((PSERIAL_LINE_CONTROL)Buffer) = DeviceExtension->SerialLineControl; + *((PSERIAL_LINE_CONTROL)BufferOut) = DeviceExtension->SerialLineControl; Information = sizeof(SERIAL_LINE_CONTROL); Status = STATUS_SUCCESS; } @@ -358,11 +444,11 @@ { PULONG pMCR; DPRINT("Serial: IOCTL_SERIAL_GET_MODEM_CONTROL\n"); - if (LengthOut != sizeof(ULONG) || Buffer == NULL) + if (LengthOut != sizeof(ULONG) || BufferOut == NULL) Status = STATUS_INVALID_PARAMETER; else { - pMCR = (PULONG)Buffer; + pMCR = (PULONG)BufferOut; *pMCR = DeviceExtension->MCR; Status = STATUS_SUCCESS; } @@ -372,11 +458,11 @@ { PULONG pMSR; DPRINT("Serial: IOCTL_SERIAL_GET_MODEMSTATUS\n"); - if (LengthOut != sizeof(ULONG) || Buffer == NULL) + if (LengthOut != sizeof(ULONG) || BufferOut == NULL) Status = STATUS_INVALID_PARAMETER; else { - pMSR = (PULONG)Buffer; + pMSR = (PULONG)BufferOut; *pMSR = DeviceExtension->MSR; Status = STATUS_SUCCESS; } @@ -390,14 +476,14 @@ DPRINT("Serial: return STATUS_BUFFER_TOO_SMALL\n"); Status = STATUS_BUFFER_TOO_SMALL; } - else if (Buffer == NULL) + else if (BufferOut == NULL) { DPRINT("Serial: return STATUS_INVALID_PARAMETER\n"); Status = STATUS_INVALID_PARAMETER; } else { - Status = SerialGetCommProp((PSERIAL_COMMPROP)Buffer, DeviceExtension); + Status = SerialGetCommProp((PSERIAL_COMMPROP)BufferOut, DeviceExtension); Information = sizeof(SERIAL_COMMPROP); } break; @@ -410,7 +496,7 @@ DPRINT("Serial: return STATUS_BUFFER_TOO_SMALL\n"); Status = STATUS_BUFFER_TOO_SMALL; } - else if (Buffer == NULL) + else if (BufferOut == NULL) { DPRINT("Serial: return STATUS_INVALID_PARAMETER\n"); Status = STATUS_INVALID_PARAMETER; @@ -427,11 +513,11 @@ case IOCTL_SERIAL_GET_TIMEOUTS: { DPRINT("Serial: IOCTL_SERIAL_GET_TIMEOUTS\n"); - if (LengthOut != sizeof(SERIAL_TIMEOUTS) || Buffer == NULL) + if (LengthOut != sizeof(SERIAL_TIMEOUTS) || BufferOut == NULL) Status = STATUS_INVALID_PARAMETER; else { - *(PSERIAL_TIMEOUTS)Buffer = DeviceExtension->SerialTimeOuts; + *(PSERIAL_TIMEOUTS)BufferOut = DeviceExtension->SerialTimeOuts; Status = STATUS_SUCCESS; } break; @@ -440,11 +526,11 @@ { PULONG pWaitMask; DPRINT("Serial: IOCTL_SERIAL_GET_WAIT_MASK\n"); - if (LengthOut != sizeof(ULONG) || Buffer == NULL) + if (LengthOut != sizeof(ULONG) || BufferOut == NULL) Status = STATUS_INVALID_PARAMETER; else { - pWaitMask = (PULONG)Buffer; + pWaitMask = (PULONG)BufferOut; *pWaitMask = DeviceExtension->WaitMask; Status = STATUS_SUCCESS; } @@ -466,9 +552,27 @@ } case IOCTL_SERIAL_PURGE: { - /* FIXME */ - DPRINT1("Serial: IOCTL_SERIAL_PURGE not implemented.\n"); - Status = STATUS_NOT_IMPLEMENTED; + KIRQL Irql1, Irql2; + DPRINT("Serial: IOCTL_SERIAL_PURGE\n"); + KeAcquireSpinLock(&DeviceExtension->InputBufferLock, &Irql1); + KeAcquireSpinLock(&DeviceExtension->OutputBufferLock, &Irql2); + DeviceExtension->InputBuffer.ReadPosition = DeviceExtension->InputBuffer.WritePosition = 0; + DeviceExtension->OutputBuffer.ReadPosition = DeviceExtension->OutputBuffer.WritePosition = 0; + /* Clear receive/transmit buffers */ + if (DeviceExtension->UartType >= Uart16550A) + { + /* 16550 UARTs also have FIFO queues, but they are unusable due to a bug */ + Status = IoAcquireRemoveLock(&DeviceExtension->RemoveLock, (PVOID)DeviceExtension->ComPort); + if (NT_SUCCESS(Status)) + { + WRITE_PORT_UCHAR(SER_FCR(ComPortBase), SR_FCR_CLEAR_RCVR | SR_FCR_CLEAR_XMIT); + IoReleaseRemoveLock(&DeviceExtension->RemoveLock, (PVOID)DeviceExtension->ComPort); + } + } + else + Status = STATUS_SUCCESS; + KeReleaseSpinLock(&DeviceExtension->OutputBufferLock, Irql2); + KeReleaseSpinLock(&DeviceExtension->InputBufferLock, Irql1); break; } case IOCTL_SERIAL_RESET_DEVICE: @@ -482,11 +586,11 @@ { PULONG pNewBaudRate; DPRINT("Serial: IOCTL_SERIAL_SET_BAUD_RATE\n"); - if (LengthIn != sizeof(ULONG) || Buffer == NULL) + if (LengthIn != sizeof(ULONG) || BufferIn == NULL) Status = STATUS_INVALID_PARAMETER; else { - pNewBaudRate = (PULONG)Buffer; + pNewBaudRate = (PULONG)BufferIn; Status = SerialSetBaudRate(DeviceExtension, *pNewBaudRate); } break; @@ -519,21 +623,31 @@ DPRINT("Serial: IOCTL_SERIAL_SET_DTR\n"); if (!(DeviceExtension->MCR & SR_MCR_DTR)) { - DeviceExtension->MCR |= SR_MCR_DTR; - WRITE_PORT_UCHAR(SER_MCR(ComPortBase), DeviceExtension->MCR); + Status = IoAcquireRemoveLock(&DeviceExtension->RemoveLock, (PVOID)DeviceExtension->ComPort); + if (NT_SUCCESS(Status)) + { + DeviceExtension->MCR |= SR_MCR_DTR; + WRITE_PORT_UCHAR(SER_MCR(ComPortBase), DeviceExtension->MCR); + IoReleaseRemoveLock(&DeviceExtension->RemoveLock, (PVOID)DeviceExtension->ComPort); + } } - Status = STATUS_SUCCESS; + else + Status = STATUS_SUCCESS; break; } case IOCTL_SERIAL_SET_FIFO_CONTROL: { DPRINT("Serial: IOCTL_SERIAL_SET_FIFO_CONTROL\n"); - if (LengthIn != sizeof(ULONG) || Buffer == NULL) + if (LengthIn != sizeof(ULONG) || BufferIn == NULL) Status = STATUS_INVALID_PARAMETER; else { - WRITE_PORT_UCHAR(SER_FCR(ComPortBase), (UCHAR)((*(PULONG)Buffer) & 0xff)); - Status = STATUS_SUCCESS; + Status = IoAcquireRemoveLock(&DeviceExtension->RemoveLock, (PVOID)DeviceExtension->ComPort); + if (NT_SUCCESS(Status)) + { + WRITE_PORT_UCHAR(SER_FCR(ComPortBase), (UCHAR)((*(PULONG)BufferIn) & 0xff)); + IoReleaseRemoveLock(&DeviceExtension->RemoveLock, (PVOID)DeviceExtension->ComPort); + } } break; } @@ -549,32 +663,55 @@ DPRINT("Serial: IOCTL_SERIAL_SET_LINE_CONTROL\n"); if (LengthIn < sizeof(SERIAL_LINE_CONTROL)) Status = STATUS_BUFFER_TOO_SMALL; - else if (Buffer == NULL) + else if (BufferIn == NULL) Status = STATUS_INVALID_PARAMETER; else - Status = SerialSetLineControl(DeviceExtension, (PSERIAL_LINE_CONTROL)Buffer); + Status = SerialSetLineControl(DeviceExtension, (PSERIAL_LINE_CONTROL)BufferIn); break; } case IOCTL_SERIAL_SET_MODEM_CONTROL: { PULONG pMCR; DPRINT("Serial: IOCTL_SERIAL_SET_MODEM_CONTROL\n"); - if (LengthIn != sizeof(ULONG) || Buffer == NULL) + if (LengthIn != sizeof(ULONG) || BufferIn == NULL) Status = STATUS_INVALID_PARAMETER; else { - pMCR = (PULONG)Buffer; - DeviceExtension->MCR = (UCHAR)(*pMCR & 0xff); - WRITE_PORT_UCHAR(SER_MCR(ComPortBase), DeviceExtension->MCR); - Status = STATUS_SUCCESS; + Status = IoAcquireRemoveLock(&DeviceExtension->RemoveLock, (PVOID)DeviceExtension->ComPort); + if (NT_SUCCESS(Status)) + { + pMCR = (PULONG)BufferIn; [truncated at 1000 lines; 41370 more skipped]
19 years, 7 months
1
0
0
0
[gvg] 15350: Implement time functions (in GMT, really should be in local time)
by gvg@svn.reactos.com
Implement time functions (in GMT, really should be in local time) Modified: branches/xen/reactos/boot/freeldr/freeldr/Makefile Modified: branches/xen/reactos/boot/freeldr/freeldr/arch/i386/machxen.c Added: branches/xen/reactos/boot/freeldr/freeldr/arch/i386/xenrtc.c _____ Modified: branches/xen/reactos/boot/freeldr/freeldr/Makefile --- branches/xen/reactos/boot/freeldr/freeldr/Makefile 2005-05-16 19:24:15 UTC (rev 15349) +++ branches/xen/reactos/boot/freeldr/freeldr/Makefile 2005-05-16 19:28:18 UTC (rev 15350) @@ -177,6 +177,7 @@ xenentry.o \ xenevtchn.o \ xenmem.o \ + xenrtc.o \ xenvideo.o \ _alloca.o # For Mingw32 builds _____ Modified: branches/xen/reactos/boot/freeldr/freeldr/arch/i386/machxen.c --- branches/xen/reactos/boot/freeldr/freeldr/arch/i386/machxen.c 2005-05-16 19:24:15 UTC (rev 15349) +++ branches/xen/reactos/boot/freeldr/freeldr/arch/i386/machxen.c 2005-05-16 19:28:18 UTC (rev 15350) @@ -256,13 +256,6 @@ } VOID -XenRTCGetCurrentDateTime(PULONG Year, PULONG Month, PULONG Day, - PULONG Hour, PULONG Minute, PULONG Second) - { - XEN_UNIMPLEMENTED("XenRTCGetCurrentDateTime"); - } - -VOID XenHwDetect(VOID) { XEN_UNIMPLEMENTED("XenHwDetect"); _____ Added: branches/xen/reactos/boot/freeldr/freeldr/arch/i386/xenrtc.c --- branches/xen/reactos/boot/freeldr/freeldr/arch/i386/xenrtc.c 2005-05-16 19:24:15 UTC (rev 15349) +++ branches/xen/reactos/boot/freeldr/freeldr/arch/i386/xenrtc.c 2005-05-16 19:28:18 UTC (rev 15350) @@ -0,0 +1,124 @@ +/* $Id$ + * + * FreeLoader + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include "freeldr.h" +#include "arch.h" +#include "machine.h" +#include "machxen.h" + +#define SECSPERMIN 60 +#define MINSPERHOUR 60 +#define HOURSPERDAY 24 +#define DAYSPERWEEK 7 +#define DAYSPERNYEAR 365 +#define DAYSPERLYEAR 366 +#define SECSPERHOUR (SECSPERMIN * MINSPERHOUR) +#define SECSPERDAY ((long) SECSPERHOUR * HOURSPERDAY) +#define MONSPERYEAR 12 +#define EPOCH_YEAR 1970 + +#define IsLeap(Yr) ((0 == ((Yr) % 4) && 0 != ((Yr) % 100)) || 0 == ((Yr) % 400)) + +static const int MonLengths[2][MONSPERYEAR] = { +{ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }, +{ 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 } +}; +static const int YearLengths[2] = { +DAYSPERNYEAR, DAYSPERLYEAR +}; + +static void +TimeSub(ULONG Time, LONG Offset, + PULONG Year, PULONG Month, PULONG Day, + PULONG Hour, PULONG Minute, PULONG Second) +{ + long Days; + long Rem; + int Yr; + int Yleap; + const int * ip; + + Days = Time / SECSPERDAY; + Rem = Time % SECSPERDAY + Offset; + while (Rem < 0) + { + Rem += SECSPERDAY; + Days--; + } + while (SECSPERDAY <= Rem) + { + Rem -= SECSPERDAY; + Days++; + } + *Hour = (ULONG) (Rem / SECSPERHOUR); + Rem = Rem % SECSPERHOUR; + *Minute = (ULONG) (Rem / SECSPERMIN); + *Second = (ULONG) (Rem % SECSPERMIN); + Yr = EPOCH_YEAR; + if (0 <= Days) + { + while (TRUE) + { + Yleap = IsLeap(Yr); + if (Days < (long) YearLengths[Yleap]) + { + break; + } + ++Yr; + Days = Days - (long) YearLengths[Yleap]; + } + } + else + { + do + { + --Yr; + Yleap = IsLeap(Yr); + Days = Days + (long) YearLengths[Yleap]; + } + while (Days < 0); + } + *Year = Yr; + ip = MonLengths[Yleap]; + for (*Month = 0; Days >= (long) ip[*Month]; ++(*Month)) + { + Days = Days - (long) ip[*Month]; + } + (*Month)++; + *Day = (ULONG) (Days + 1); +} + +VOID +XenRTCGetCurrentDateTime(PULONG Year, PULONG Month, PULONG Day, + PULONG Hour, PULONG Minute, PULONG Second) +{ + ULONG Time; + ULONG ShadowTimeVersion; + + do + { + ShadowTimeVersion = XenSharedInfo->time_version2; + Time = XenSharedInfo->wc_sec; + } + while (ShadowTimeVersion != XenSharedInfo->time_version1); + + TimeSub(Time, 0, Year, Month, Day, Hour, Minute, Second); +} + +/* EOF */ Property changes on: branches/xen/reactos/boot/freeldr/freeldr/arch/i386/xenrtc.c ___________________________________________________________________ Name: svn:keywords + Author Date Id Revision Name: svn:eol-style + native
19 years, 7 months
1
0
0
0
← Newer
1
...
33
34
35
36
37
38
39
...
82
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
Results per page:
10
25
50
100
200