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
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
April 2011
----- 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
19 participants
296 discussions
Start a n
N
ew thread
[gadamopoulos] 51483: [win32k] - Store the initial desktop handle and use it evey time a new thread is created.
by gadamopoulos@svn.reactos.org
Author: gadamopoulos Date: Thu Apr 28 20:33:16 2011 New Revision: 51483 URL:
http://svn.reactos.org/svn/reactos?rev=51483&view=rev
Log: [win32k] - Store the initial desktop handle and use it evey time a new thread is created. Modified: trunk/reactos/subsystems/win32/win32k/main/dllmain.c Modified: trunk/reactos/subsystems/win32/win32k/main/dllmain.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ma…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/main/dllmain.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/main/dllmain.c [iso-8859-1] Thu Apr 28 20:33:16 2011 @@ -154,6 +154,13 @@ LogonProcess = NULL; } + /* Close the startup desktop */ + ASSERT(Win32Process->rpdeskStartup); + ASSERT(Win32Process->hdeskStartup); + ObDereferenceObject(Win32Process->rpdeskStartup); + ZwClose(Win32Process->hdeskStartup); + + /* Close the current window station */ UserSetProcessWindowStation(NULL); /* Destroy GDI pools */ @@ -211,6 +218,7 @@ HDESK hDesk = NULL; NTSTATUS Status; PUNICODE_STRING DesktopPath; + PDESKTOP pdesk; PRTL_USER_PROCESS_PARAMETERS ProcessParams = (Process->Peb ? Process->Peb->ProcessParameters : NULL); DPRINT("Creating W32 thread TID:%d at IRQ level: %lu\n", Thread->Cid.UniqueThread, KeGetCurrentIrql()); @@ -223,37 +231,6 @@ InitializeListHead(&Win32Thread->aphkStart[i]); } - /* - * inherit the thread desktop and process window station (if not yet inherited) from the process startup - * info structure. See documentation of CreateProcess() - */ - DesktopPath = (ProcessParams ? ((ProcessParams->DesktopInfo.Length > 0) ? &ProcessParams->DesktopInfo : NULL) : NULL); - Status = IntParseDesktopPath(Process, - DesktopPath, - &hWinSta, - &hDesk); - if(NT_SUCCESS(Status)) - { - if(hWinSta != NULL) - { - if(!UserSetProcessWindowStation(hWinSta)) - { - DPRINT1("Failed to set process window station\n"); - } - } - - if (hDesk != NULL) - { - if (!IntSetThreadDesktop(hDesk, FALSE)) - { - DPRINT1("Unable to set thread desktop\n"); - } - } - } - else - { - DPRINT1("No Desktop handle for this Thread!\n"); - } Win32Thread->TIF_flags &= ~TIF_INCLEANUP; co_IntDestroyCaret(Win32Thread); Win32Thread->ppi = PsGetCurrentProcessWin32Process(); @@ -266,6 +243,58 @@ } Win32Thread->MessageQueue = MsqCreateMessageQueue(Thread); Win32Thread->KeyboardLayout = W32kGetDefaultKeyLayout(); + + /* HAAAAAAAACK! This should go to Win32kProcessCallback */ + if(Win32Thread->ppi->hdeskStartup == NULL) + { + /* + * inherit the thread desktop and process window station (if not yet inherited) from the process startup + * info structure. See documentation of CreateProcess() + */ + DesktopPath = (ProcessParams ? ((ProcessParams->DesktopInfo.Length > 0) ? &ProcessParams->DesktopInfo : NULL) : NULL); + Status = IntParseDesktopPath(Process, + DesktopPath, + &hWinSta, + &hDesk); + if(NT_SUCCESS(Status)) + { + if(hWinSta != NULL) + { + if(!UserSetProcessWindowStation(hWinSta)) + { + DPRINT1("Failed to set process window station\n"); + } + } + + if (hDesk != NULL) + { + /* Validate the new desktop. */ + Status = IntValidateDesktopHandle(hDesk, + UserMode, + 0, + &pdesk); + + if(NT_SUCCESS(Status)) + { + Win32Thread->ppi->hdeskStartup = hDesk; + Win32Thread->ppi->rpdeskStartup = pdesk; + } + } + } + else + { + DPRINT1("No Desktop handle for this Thread!\n"); + } + } + + if (Win32Thread->ppi->hdeskStartup != NULL) + { + if (!IntSetThreadDesktop(Win32Thread->ppi->hdeskStartup, FALSE)) + { + DPRINT1("Unable to set thread desktop\n"); + } + } + pTeb = NtCurrentTeb(); if (pTeb) { /* Attempt to startup client support which should have been initialized in IntSetThreadDesktop. */
13 years, 7 months
1
0
0
0
[gschneider] 51482: [calc] Fix degree to radians conversion See issue #3018 for more details.
by gschneider@svn.reactos.org
Author: gschneider Date: Thu Apr 28 20:17:14 2011 New Revision: 51482 URL:
http://svn.reactos.org/svn/reactos?rev=51482&view=rev
Log: [calc] Fix degree to radians conversion See issue #3018 for more details. Modified: trunk/reactos/base/applications/calc/convert.c Modified: trunk/reactos/base/applications/calc/convert.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/calc/con…
============================================================================== --- trunk/reactos/base/applications/calc/convert.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/calc/convert.c [iso-8859-1] Thu Apr 28 20:17:14 2011 @@ -50,7 +50,7 @@ static const conv_t conv_ANGLE[] = { DECLARE_CONV_UNIT(ANGLE, DEGREES, "$", "$") DECLARE_CONV_UNIT(ANGLE, GRADIANS, "$*0.9", "$/0.9") - DECLARE_CONV_UNIT(ANGLE, RADIANS, "$*180/P", "$*P/180") + DECLARE_CONV_UNIT(ANGLE, RADIANS, "$/P*180", "$*P/180") DECLARE_CONV_END };
13 years, 7 months
1
0
0
0
[gschneider] 51481: [win32csr] Implement routines to allow copy, paste and select all on console windows See issue #4068 for more details.
by gschneider@svn.reactos.org
Author: gschneider Date: Thu Apr 28 19:59:16 2011 New Revision: 51481 URL:
http://svn.reactos.org/svn/reactos?rev=51481&view=rev
Log: [win32csr] Implement routines to allow copy, paste and select all on console windows See issue #4068 for more details. Modified: trunk/reactos/subsystems/win32/csrss/win32csr/guiconsole.c Modified: trunk/reactos/subsystems/win32/csrss/win32csr/guiconsole.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/csrss/win…
============================================================================== --- trunk/reactos/subsystems/win32/csrss/win32csr/guiconsole.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/csrss/win32csr/guiconsole.c [iso-8859-1] Thu Apr 28 19:59:16 2011 @@ -1371,6 +1371,109 @@ } static VOID +GuiConsoleCopy(HWND hWnd, PCSRSS_CONSOLE Console) +{ + if (OpenClipboard(hWnd) == TRUE) + { + HANDLE hData; + PBYTE ptr; + LPSTR data, dstPos; + ULONG selWidth, selHeight; + ULONG xPos, yPos, size; + + selWidth = Console->Selection.srSelection.Right - Console->Selection.srSelection.Left + 1; + selHeight = Console->Selection.srSelection.Bottom - Console->Selection.srSelection.Top + 1; + DPRINT("Selection is (%d|%d) to (%d|%d)\n", + Console->Selection.srSelection.Left, + Console->Selection.srSelection.Top, + Console->Selection.srSelection.Right, + Console->Selection.srSelection.Bottom); + + /* Basic size for one line and termination */ + size = selWidth + 1; + if (selHeight > 0) + { + /* Multiple line selections have to get \r\n appended */ + size += ((selWidth + 2) * (selHeight - 1)); + } + + /* Allocate memory, it will be passed to the system and may not be freed here */ + hData = GlobalAlloc(GMEM_MOVEABLE | GMEM_ZEROINIT, size); + if (hData == NULL) + { + CloseClipboard(); + return; + } + data = GlobalLock(hData); + if (data == NULL) + { + CloseClipboard(); + return; + } + + DPRINT("Copying %dx%d selection\n", selWidth, selHeight); + dstPos = data; + + for (yPos = 0; yPos < selHeight; yPos++) + { + ptr = ConioCoordToPointer(Console->ActiveBuffer, + Console->Selection.srSelection.Left, + yPos + Console->Selection.srSelection.Top); + /* Copy only the characters, leave attributes alone */ + for (xPos = 0; xPos < selWidth; xPos++) + { + dstPos[xPos] = ptr[xPos * 2]; + } + dstPos += selWidth; + if (yPos != (selHeight - 1)) + { + strcat(data, "\r\n"); + dstPos += 2; + } + } + + DPRINT("Setting data <%s> to clipboard\n", data); + GlobalUnlock(hData); + + EmptyClipboard(); + SetClipboardData(CF_TEXT, hData); + CloseClipboard(); + } +} + +static VOID +GuiConsolePaste(HWND hWnd, PCSRSS_CONSOLE Console) +{ + if (OpenClipboard(hWnd) == TRUE) + { + HANDLE hData; + LPSTR str; + size_t len; + + hData = GetClipboardData(CF_TEXT); + if (hData == NULL) + { + CloseClipboard(); + return; + } + + str = GlobalLock(hData); + if (str == NULL) + { + CloseClipboard(); + return; + } + DPRINT("Got data <%s> from clipboard\n", str); + len = strlen(str); + + ConioWriteConsole(Console, Console->ActiveBuffer, str, len, TRUE); + + GlobalUnlock(hData); + CloseClipboard(); + } +} + +static VOID GuiConsoleRightMouseDown(HWND hWnd) { PCSRSS_CONSOLE Console; @@ -1381,12 +1484,13 @@ if (!(Console->Selection.dwFlags & CONSOLE_SELECTION_NOT_EMPTY)) { - /* FIXME - paste text from clipboard */ + GuiConsolePaste(hWnd, Console); } else { - /* FIXME - copy selection to clipboard */ - + GuiConsoleCopy(hWnd, Console); + + /* Clear the selection */ GuiConsoleUpdateSelection(Console, NULL); } @@ -1466,18 +1570,41 @@ CPLFunc(hWnd, CPL_DBLCLK, (LPARAM)&SharedInfo, Defaults); } static LRESULT -GuiConsoleHandleSysMenuCommand(HWND hWnd, WPARAM wParam, LPARAM lParam, PGUI_CONSOLE_DATA GuiData) +GuiConsoleHandleSysMenuCommand(HWND hWnd, WPARAM wParam, LPARAM lParam) { LRESULT Ret = TRUE; + PCSRSS_CONSOLE Console; + PGUI_CONSOLE_DATA GuiData; + COORD bottomRight = { 0, 0 }; + + GuiConsoleGetDataPointers(hWnd, &Console, &GuiData); switch(wParam) { case ID_SYSTEM_EDIT_MARK: + DPRINT1("Marking not handled yet\n"); + break; + case ID_SYSTEM_EDIT_COPY: + GuiConsoleCopy(hWnd, Console); + break; + case ID_SYSTEM_EDIT_PASTE: + GuiConsolePaste(hWnd, Console); + break; + case ID_SYSTEM_EDIT_SELECTALL: + bottomRight.X = Console->Size.X - 1; + bottomRight.Y = Console->Size.Y - 1; + GuiConsoleUpdateSelection(Console, &bottomRight); + break; + case ID_SYSTEM_EDIT_SCROLL: + DPRINT1("Scrolling is not handled yet\n"); + break; + case ID_SYSTEM_EDIT_FIND: + DPRINT1("Finding is not handled yet\n"); break; case ID_SYSTEM_DEFAULTS: @@ -1895,7 +2022,7 @@ GuiConsoleMouseMove(hWnd, wParam, lParam); break; case WM_SYSCOMMAND: - Result = GuiConsoleHandleSysMenuCommand(hWnd, wParam, lParam, GuiData); + Result = GuiConsoleHandleSysMenuCommand(hWnd, wParam, lParam); break; case WM_HSCROLL: case WM_VSCROLL:
13 years, 7 months
1
0
0
0
[gadamopoulos] 51480: [win32k] - Use ObCloseHandle instead of ZwClose when closing window station handles
by gadamopoulos@svn.reactos.org
Author: gadamopoulos Date: Thu Apr 28 19:52:23 2011 New Revision: 51480 URL:
http://svn.reactos.org/svn/reactos?rev=51480&view=rev
Log: [win32k] - Use ObCloseHandle instead of ZwClose when closing window station handles Modified: trunk/reactos/subsystems/win32/win32k/ntuser/winsta.c Modified: trunk/reactos/subsystems/win32/win32k/ntuser/winsta.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/winsta.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/winsta.c [iso-8859-1] Thu Apr 28 19:52:23 2011 @@ -621,7 +621,7 @@ DPRINT("Closing window station handle (0x%X)\n", hWinSta); - Status = ZwClose(hWinSta); + Status = ObCloseHandle(hWinSta, UserMode); if (!NT_SUCCESS(Status)) { SetLastNtError(Status); @@ -975,7 +975,7 @@ if(hwinstaOld != NULL) { - ZwClose(hwinstaOld); + ObCloseHandle(hwinstaOld, UserMode); } return TRUE;
13 years, 7 months
1
0
0
0
[gadamopoulos] 51479: [win32k] - Call update_input_key_state correctly
by gadamopoulos@svn.reactos.org
Author: gadamopoulos Date: Thu Apr 28 19:26:09 2011 New Revision: 51479 URL:
http://svn.reactos.org/svn/reactos?rev=51479&view=rev
Log: [win32k] - Call update_input_key_state correctly Modified: trunk/reactos/subsystems/win32/win32k/ntuser/msgqueue.c Modified: trunk/reactos/subsystems/win32/win32k/ntuser/msgqueue.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/msgqueue.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/msgqueue.c [iso-8859-1] Thu Apr 28 19:26:09 2011 @@ -52,8 +52,7 @@ if( key < 0x100 ) { - ret = ((DWORD)(MessageQueue->KeyState[key] & KS_DOWN_BIT) << 8 ) | - (MessageQueue->KeyState[key] & KS_LOCK_BIT); + ret = (DWORD)MessageQueue->KeyState[key]; } return ret; @@ -62,6 +61,8 @@ /* change the input key state for a given key */ static void set_input_key_state( PUSER_MESSAGE_QUEUE MessageQueue, UCHAR key, BOOL down ) { + DPRINT("set_input_key_state key:%d, down:%d\n", key, down); + if (down) { if (!(MessageQueue->KeyState[key] & KS_DOWN_BIT)) @@ -81,6 +82,8 @@ { UCHAR key; BOOL down = 0; + + DPRINT("update_input_key_state message:%d\n", msg->message); switch (msg->message) { @@ -1465,7 +1468,7 @@ if (Remove) { - update_input_key_state(MessageQueue, pMsg); + update_input_key_state(MessageQueue, &msg); RemoveEntryList(&CurrentMessage->ListEntry); ClearMsgBitsMask(MessageQueue, CurrentMessage->QS_Flags); MsqDestroyMessage(CurrentMessage);
13 years, 7 months
1
0
0
0
[janderwald] 51478: [USBEHCI_NEW] - Implement retrieving device / configuration descriptor for usb devices - Based on mjmartin usbehci driver - Mass storage device found wizard now pops up (fails t...
by janderwald@svn.reactos.org
Author: janderwald Date: Thu Apr 28 17:45:32 2011 New Revision: 51478 URL:
http://svn.reactos.org/svn/reactos?rev=51478&view=rev
Log: [USBEHCI_NEW] - Implement retrieving device / configuration descriptor for usb devices - Based on mjmartin usbehci driver - Mass storage device found wizard now pops up (fails to install - WIP) Modified: branches/usb-bringup/drivers/usb/usbehci_new/hub_controller.cpp branches/usb-bringup/drivers/usb/usbehci_new/interfaces.h branches/usb-bringup/drivers/usb/usbehci_new/usb_device.cpp Modified: branches/usb-bringup/drivers/usb/usbehci_new/hub_controller.cpp URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup/drivers/usb/usbehci…
============================================================================== --- branches/usb-bringup/drivers/usb/usbehci_new/hub_controller.cpp [iso-8859-1] (original) +++ branches/usb-bringup/drivers/usb/usbehci_new/hub_controller.cpp [iso-8859-1] Thu Apr 28 17:45:32 2011 @@ -1080,6 +1080,8 @@ NTSTATUS Status = STATUS_NOT_IMPLEMENTED; PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor; PUCHAR Buffer; + PUSBDEVICE UsbDevice; + ULONG Length; // // check descriptor type @@ -1092,6 +1094,7 @@ // sanity check // PC_ASSERT(Urb->UrbControlDescriptorRequest.TransferBufferLength >= sizeof(USB_DEVICE_DESCRIPTOR)); + PC_ASSERT(Urb->UrbControlDescriptorRequest.TransferBuffer); if (Urb->UrbHeader.UsbdDeviceHandle == NULL) { @@ -1100,7 +1103,24 @@ // RtlCopyMemory((PUCHAR)Urb->UrbControlDescriptorRequest.TransferBuffer, &m_DeviceDescriptor, sizeof(USB_DEVICE_DESCRIPTOR)); Status = STATUS_SUCCESS; - break; + } + else + { + // + // check if this is a valid usb device handle + // + PC_ASSERT(ValidateUsbDevice(PUSBDEVICE(Urb->UrbHeader.UsbdDeviceHandle))); + + // + // get device + // + UsbDevice = PUSBDEVICE(Urb->UrbHeader.UsbdDeviceHandle); + + // + // retrieve device descriptor from device + // + UsbDevice->GetDeviceDescriptor((PUSB_DEVICE_DESCRIPTOR)Urb->UrbControlDescriptorRequest.TransferBuffer); + Status = STATUS_SUCCESS; } break; } @@ -1112,52 +1132,95 @@ PC_ASSERT(Urb->UrbControlDescriptorRequest.TransferBuffer); PC_ASSERT(Urb->UrbControlDescriptorRequest.TransferBufferLength >= sizeof(USB_CONFIGURATION_DESCRIPTOR)); - // - // FIXME: support devices - // - PC_ASSERT(Urb->UrbHeader.UsbdDeviceHandle == NULL); - - // - // copy configuration descriptor template - // - C_ASSERT(sizeof(ROOTHUB2_CONFIGURATION_DESCRIPTOR) == sizeof(USB_CONFIGURATION_DESCRIPTOR)); - RtlCopyMemory(Urb->UrbControlDescriptorRequest.TransferBuffer, ROOTHUB2_CONFIGURATION_DESCRIPTOR, sizeof(USB_CONFIGURATION_DESCRIPTOR)); - - // - // get configuration descriptor, very retarded! - // - ConfigurationDescriptor = (PUSB_CONFIGURATION_DESCRIPTOR)Urb->UrbControlDescriptorRequest.TransferBuffer; - - // - // check if buffer can hold interface and endpoint descriptor - // - if (ConfigurationDescriptor->wTotalLength > Urb->UrbControlDescriptorRequest.TransferBufferLength) + if (Urb->UrbHeader.UsbdDeviceHandle == NULL) { // - // buffer too small + // request is for the root bus controller + // + C_ASSERT(sizeof(ROOTHUB2_CONFIGURATION_DESCRIPTOR) == sizeof(USB_CONFIGURATION_DESCRIPTOR)); + RtlCopyMemory(Urb->UrbControlDescriptorRequest.TransferBuffer, ROOTHUB2_CONFIGURATION_DESCRIPTOR, sizeof(USB_CONFIGURATION_DESCRIPTOR)); + + // + // get configuration descriptor, very retarded! + // + ConfigurationDescriptor = (PUSB_CONFIGURATION_DESCRIPTOR)Urb->UrbControlDescriptorRequest.TransferBuffer; + + // + // check if buffer can hold interface and endpoint descriptor + // + if (ConfigurationDescriptor->wTotalLength > Urb->UrbControlDescriptorRequest.TransferBufferLength) + { + // + // buffer too small + // + Status = STATUS_SUCCESS; + break; + } + + // + // copy interface descriptor template + // + Buffer = (PUCHAR)(ConfigurationDescriptor + 1); + C_ASSERT(sizeof(ROOTHUB2_INTERFACE_DESCRIPTOR) == sizeof(USB_INTERFACE_DESCRIPTOR)); + RtlCopyMemory(Buffer, ROOTHUB2_INTERFACE_DESCRIPTOR, sizeof(USB_INTERFACE_DESCRIPTOR)); + + // + // copy end point descriptor template + // + Buffer += sizeof(USB_INTERFACE_DESCRIPTOR); + C_ASSERT(sizeof(ROOTHUB2_ENDPOINT_DESCRIPTOR) == sizeof(USB_ENDPOINT_DESCRIPTOR)); + RtlCopyMemory(Buffer, ROOTHUB2_ENDPOINT_DESCRIPTOR, sizeof(USB_ENDPOINT_DESCRIPTOR)); + + // + // done // Status = STATUS_SUCCESS; - break; + } - - // - // copy interface descriptor template - // - Buffer = (PUCHAR)(ConfigurationDescriptor + 1); - C_ASSERT(sizeof(ROOTHUB2_INTERFACE_DESCRIPTOR) == sizeof(USB_INTERFACE_DESCRIPTOR)); - RtlCopyMemory(Buffer, ROOTHUB2_INTERFACE_DESCRIPTOR, sizeof(USB_INTERFACE_DESCRIPTOR)); - - // - // copy end point descriptor template - // - Buffer += sizeof(USB_INTERFACE_DESCRIPTOR); - C_ASSERT(sizeof(ROOTHUB2_ENDPOINT_DESCRIPTOR) == sizeof(USB_ENDPOINT_DESCRIPTOR)); - RtlCopyMemory(Buffer, ROOTHUB2_ENDPOINT_DESCRIPTOR, sizeof(USB_ENDPOINT_DESCRIPTOR)); - - // - // done - // - Status = STATUS_SUCCESS; + else + { + DPRINT1("Length %u\n", Urb->UrbControlDescriptorRequest.TransferBufferLength); + + // + // check if this is a valid usb device handle + // + PC_ASSERT(ValidateUsbDevice(PUSBDEVICE(Urb->UrbHeader.UsbdDeviceHandle))); + + // + // get device + // + UsbDevice = PUSBDEVICE(Urb->UrbHeader.UsbdDeviceHandle); + + if (UsbDevice->GetConfigurationDescriptorsLength() > Urb->UrbControlDescriptorRequest.TransferBufferLength) + { + // + // buffer too small + // + Urb->UrbControlDescriptorRequest.TransferBufferLength = UsbDevice->GetConfigurationDescriptorsLength(); + + // + // bail out + // + Status = STATUS_SUCCESS; + break; + } + + // + // perform work in IUSBDevice + // + UsbDevice->GetConfigurationDescriptors((PUSB_CONFIGURATION_DESCRIPTOR)Urb->UrbControlDescriptorRequest.TransferBuffer, Urb->UrbControlDescriptorRequest.TransferBufferLength, &Length); + + // + // sanity check + // + PC_ASSERT(UsbDevice->GetConfigurationDescriptorsLength() == Length); + + // + // store result size + // + Urb->UrbControlDescriptorRequest.TransferBufferLength = Length; + Status = STATUS_SUCCESS; + } break; } default: Modified: branches/usb-bringup/drivers/usb/usbehci_new/interfaces.h URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup/drivers/usb/usbehci…
============================================================================== --- branches/usb-bringup/drivers/usb/usbehci_new/interfaces.h [iso-8859-1] (original) +++ branches/usb-bringup/drivers/usb/usbehci_new/interfaces.h [iso-8859-1] Thu Apr 28 17:45:32 2011 @@ -795,6 +795,13 @@ virtual VOID GetConfigurationDescriptors(IN PUSB_CONFIGURATION_DESCRIPTOR ConfigDescriptorBuffer, IN ULONG BufferLength, OUT PULONG OutBufferLength) = 0; + +//---------------------------------------------------------------------------------------- +// +// Description: returns length of configuration descriptors +// + virtual ULONG GetConfigurationDescriptorsLength() = 0; + }; typedef IUSBDevice *PUSBDEVICE; Modified: branches/usb-bringup/drivers/usb/usbehci_new/usb_device.cpp URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup/drivers/usb/usbehci…
============================================================================== --- branches/usb-bringup/drivers/usb/usbehci_new/usb_device.cpp [iso-8859-1] (original) +++ branches/usb-bringup/drivers/usb/usbehci_new/usb_device.cpp [iso-8859-1] Thu Apr 28 17:45:32 2011 @@ -66,7 +66,7 @@ virtual UCHAR GetConfigurationValue(); virtual NTSTATUS SubmitIrp(PIRP Irp); virtual VOID GetConfigurationDescriptors(IN PUSB_CONFIGURATION_DESCRIPTOR ConfigDescriptorBuffer, IN ULONG BufferLength, OUT PULONG OutBufferLength); - + virtual ULONG GetConfigurationDescriptorsLength(); // local function virtual NTSTATUS CommitIrp(PIRP Irp); @@ -74,6 +74,7 @@ virtual NTSTATUS CreateConfigurationDescriptor(ULONG ConfigurationIndex); virtual NTSTATUS CreateDeviceDescriptor(); virtual VOID DumpDeviceDescriptor(PUSB_DEVICE_DESCRIPTOR DeviceDescriptor); + virtual VOID DumpConfigurationDescriptor(PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor); // constructor / destructor CUSBDevice(IUnknown *OuterUnknown){} @@ -753,6 +754,11 @@ ConfigurationDescriptor = (PUSB_CONFIGURATION_DESCRIPTOR)Buffer; // + // informal debug print + // + DumpConfigurationDescriptor(ConfigurationDescriptor); + + // // sanity check // PC_ASSERT(ConfigurationDescriptor->bLength == sizeof(USB_CONFIGURATION_DESCRIPTOR)); @@ -867,6 +873,9 @@ IN ULONG BufferLength, OUT PULONG OutBufferLength) { + PVOID Buffer; + ULONG InterfaceIndex, EndpointIndex; + // // sanity check // @@ -875,6 +884,11 @@ PC_ASSERT(OutBufferLength); // + // reset copied length + // + *OutBufferLength = 0; + + // // FIXME: support multiple configurations // PC_ASSERT(m_DeviceDescriptor.bNumConfigurations == 1); @@ -885,12 +899,87 @@ RtlCopyMemory(ConfigDescriptorBuffer, &m_ConfigurationDescriptors[0].ConfigurationDescriptor, sizeof(USB_CONFIGURATION_DESCRIPTOR)); // - // store length - // - *OutBufferLength = sizeof(USB_CONFIGURATION_DESCRIPTOR); -} - - + // subtract length + // + BufferLength -= sizeof(USB_CONFIGURATION_DESCRIPTOR); + *OutBufferLength += sizeof(USB_CONFIGURATION_DESCRIPTOR); + + // + // increment offset + // + Buffer = (PVOID)(ConfigDescriptorBuffer + 1); + + for(InterfaceIndex = 0; InterfaceIndex < m_ConfigurationDescriptors[0].ConfigurationDescriptor.bNumInterfaces; InterfaceIndex++) + { + if (BufferLength < sizeof(USB_INTERFACE_DESCRIPTOR)) + { + // + // no more room in buffer + // + return; + } + + // + // copy interface descriptor + // + RtlCopyMemory(Buffer, &m_ConfigurationDescriptors[0].Interfaces[InterfaceIndex].InterfaceDescriptor, sizeof(USB_INTERFACE_DESCRIPTOR)); + + // + // increment offset + // + Buffer = (PVOID)((ULONG_PTR)Buffer + sizeof(USB_INTERFACE_DESCRIPTOR)); + BufferLength -= sizeof(USB_INTERFACE_DESCRIPTOR); + *OutBufferLength += sizeof(USB_INTERFACE_DESCRIPTOR); + + // + // does the interface have endpoints + // + if (m_ConfigurationDescriptors[0].Interfaces[InterfaceIndex].InterfaceDescriptor.bNumEndpoints) + { + // + // is enough space available + // + if (BufferLength < sizeof(USB_ENDPOINT_DESCRIPTOR) * m_ConfigurationDescriptors[0].Interfaces[InterfaceIndex].InterfaceDescriptor.bNumEndpoints) + { + // + // no buffer + // + return; + } + + // + // copy end points + // + for(EndpointIndex = 0; EndpointIndex < m_ConfigurationDescriptors[0].Interfaces[InterfaceIndex].InterfaceDescriptor.bNumEndpoints; EndpointIndex++) + { + // + // copy endpoint + // + RtlCopyMemory(Buffer, &m_ConfigurationDescriptors[0].Interfaces[InterfaceIndex].EndPoints[EndpointIndex].EndPointDescriptor, sizeof(USB_ENDPOINT_DESCRIPTOR)); + + // + // increment buffer offset + // + Buffer = (PVOID)((ULONG_PTR)Buffer + sizeof(USB_ENDPOINT_DESCRIPTOR)); + BufferLength -= sizeof(USB_ENDPOINT_DESCRIPTOR); + *OutBufferLength += sizeof(USB_ENDPOINT_DESCRIPTOR); + } + } + } +} + +//---------------------------------------------------------------------------------------- +ULONG +CUSBDevice::GetConfigurationDescriptorsLength() +{ + // + // FIXME: support multiple configurations + // + PC_ASSERT(m_DeviceDescriptor.bNumConfigurations == 1); + + return m_ConfigurationDescriptors[0].ConfigurationDescriptor.wTotalLength; +} +//---------------------------------------------------------------------------------------- VOID CUSBDevice::DumpDeviceDescriptor(PUSB_DEVICE_DESCRIPTOR DeviceDescriptor) { @@ -912,6 +1001,20 @@ } //---------------------------------------------------------------------------------------- +VOID +CUSBDevice::DumpConfigurationDescriptor(PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor) +{ + DPRINT1("Dumping ConfigurationDescriptor %x\n", ConfigurationDescriptor); + DPRINT1("bLength %x\n", ConfigurationDescriptor->bLength); + DPRINT1("bDescriptorType %x\n", ConfigurationDescriptor->bDescriptorType); + DPRINT1("wTotalLength %x\n", ConfigurationDescriptor->wTotalLength); + DPRINT1("bNumInterfaces %x\n", ConfigurationDescriptor->bNumInterfaces); + DPRINT1("bConfigurationValue %x\n", ConfigurationDescriptor->bConfigurationValue); + DPRINT1("iConfiguration %x\n", ConfigurationDescriptor->iConfiguration); + DPRINT1("bmAttributes %x\n", ConfigurationDescriptor->bmAttributes); + DPRINT1("MaxPower %x\n", ConfigurationDescriptor->MaxPower); +} +//---------------------------------------------------------------------------------------- NTSTATUS CreateUSBDevice( PUSBDEVICE *OutDevice)
13 years, 8 months
1
0
0
0
[janderwald] 51477: [USBEHCI_NEW] - Move error checking if controller reported an error inside the door bell ring check block - Extend interface of IUSBRequest to include DeviceAddress, which is ne...
by janderwald@svn.reactos.org
Author: janderwald Date: Thu Apr 28 16:40:07 2011 New Revision: 51477 URL:
http://svn.reactos.org/svn/reactos?rev=51477&view=rev
Log: [USBEHCI_NEW] - Move error checking if controller reported an error inside the door bell ring check block - Extend interface of IUSBRequest to include DeviceAddress, which is needed to retrieve configuration descriptor of newly set address - Allocate CtrlSetup from nonpaged pool - Release setup packet on cleanup - Devices now receive an device address - Currently asserts while retrieving configuration descriptor as this code path is not yet existant *** Assertion failed: Urb->UrbHeader.UsbdDeviceHandle == NULL *** Source File: d:\usb-bringup\drivers\usb\usbehci_new\hub_controller.cpp, line 1118 Modified: branches/usb-bringup/drivers/usb/usbehci_new/hardware.cpp branches/usb-bringup/drivers/usb/usbehci_new/interfaces.h branches/usb-bringup/drivers/usb/usbehci_new/usb_device.cpp branches/usb-bringup/drivers/usb/usbehci_new/usb_request.cpp Modified: branches/usb-bringup/drivers/usb/usbehci_new/hardware.cpp URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup/drivers/usb/usbehci…
============================================================================== --- branches/usb-bringup/drivers/usb/usbehci_new/hardware.cpp [iso-8859-1] (original) +++ branches/usb-bringup/drivers/usb/usbehci_new/hardware.cpp [iso-8859-1] Thu Apr 28 16:40:07 2011 @@ -1003,20 +1003,20 @@ // if (CStatus & (EHCI_STS_RECL| EHCI_STS_INT | EHCI_ERROR_INT)) { - if (CStatus & EHCI_ERROR_INT) - { - // - // controller reported error - // - Status = STATUS_UNSUCCESSFUL; - PC_ASSERT(FALSE); - } - // // check if there is a door bell ring in progress // if (This->m_DoorBellRingInProgress == FALSE) { + if (CStatus & EHCI_ERROR_INT) + { + // + // controller reported error + // + Status = STATUS_UNSUCCESSFUL; + PC_ASSERT(FALSE); + } + // // inform IUSBQueue of a completed queue head // Modified: branches/usb-bringup/drivers/usb/usbehci_new/interfaces.h URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup/drivers/usb/usbehci…
============================================================================== --- branches/usb-bringup/drivers/usb/usbehci_new/interfaces.h [iso-8859-1] (original) +++ branches/usb-bringup/drivers/usb/usbehci_new/interfaces.h [iso-8859-1] Thu Apr 28 16:40:07 2011 @@ -385,6 +385,7 @@ virtual NTSTATUS InitializeWithSetupPacket(IN PDMAMEMORYMANAGER DmaManager, IN PUSB_DEFAULT_PIPE_SETUP_PACKET SetupPacket, + IN UCHAR DeviceAddress, IN OUT ULONG TransferBufferLength, IN OUT PMDL TransferBuffer) = 0; Modified: branches/usb-bringup/drivers/usb/usbehci_new/usb_device.cpp URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup/drivers/usb/usbehci…
============================================================================== --- branches/usb-bringup/drivers/usb/usbehci_new/usb_device.cpp [iso-8859-1] (original) +++ branches/usb-bringup/drivers/usb/usbehci_new/usb_device.cpp [iso-8859-1] Thu Apr 28 16:40:07 2011 @@ -310,26 +310,37 @@ CUSBDevice::SetDeviceAddress( UCHAR DeviceAddress) { - USB_DEFAULT_PIPE_SETUP_PACKET CtrlSetup; + PUSB_DEFAULT_PIPE_SETUP_PACKET CtrlSetup; NTSTATUS Status; UCHAR OldAddress; ULONG Index; + DPRINT1("CUSBDevice::SetDeviceAddress Address %d\n", DeviceAddress); + + CtrlSetup = (PUSB_DEFAULT_PIPE_SETUP_PACKET)ExAllocatePoolWithTag(NonPagedPool, sizeof(USB_DEFAULT_PIPE_SETUP_PACKET), TAG_USBEHCI); + if (!CtrlSetup) + return STATUS_INSUFFICIENT_RESOURCES; + // // zero request // - RtlZeroMemory(&CtrlSetup, sizeof(USB_DEFAULT_PIPE_SETUP_PACKET)); + RtlZeroMemory(CtrlSetup, sizeof(USB_DEFAULT_PIPE_SETUP_PACKET)); // // initialize request // - CtrlSetup.bRequest = USB_REQUEST_SET_ADDRESS; - CtrlSetup.wValue.W = (USHORT)DeviceAddress; + CtrlSetup->bRequest = USB_REQUEST_SET_ADDRESS; + CtrlSetup->wValue.W = (USHORT)DeviceAddress; // // set device address // - Status = CommitSetupPacket(&CtrlSetup, 0, 0); + Status = CommitSetupPacket(CtrlSetup, 0, 0); + + // + // free setup packet + // + ExFreePoolWithTag(CtrlSetup, TAG_USBEHCI); // // check for success @@ -367,7 +378,7 @@ // // failed to retrieve device descriptor // - DPRINT1("CUSBbDevice::SetDeviceAddress> failed to set new device address %d, falling back to %d Error %x\n", DeviceAddress, OldAddress, Status); + DPRINT1("CUSBbDevice::SetDeviceAddress> failed to retrieve device descriptor with device address set Error %x\n", Status); m_DeviceAddress = OldAddress; // @@ -375,8 +386,6 @@ // return Status; } - - PC_ASSERT(FALSE); // // sanity checks @@ -547,7 +556,7 @@ // // initialize request // - Status = Request->InitializeWithSetupPacket(m_DmaManager, Packet, BufferLength, Mdl); + Status = Request->InitializeWithSetupPacket(m_DmaManager, Packet, m_DeviceAddress, BufferLength, Mdl); if (!NT_SUCCESS(Status)) { // Modified: branches/usb-bringup/drivers/usb/usbehci_new/usb_request.cpp URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup/drivers/usb/usbehci…
============================================================================== --- branches/usb-bringup/drivers/usb/usbehci_new/usb_request.cpp [iso-8859-1] (original) +++ branches/usb-bringup/drivers/usb/usbehci_new/usb_request.cpp [iso-8859-1] Thu Apr 28 16:40:07 2011 @@ -36,7 +36,7 @@ } // IUSBRequest interface functions - virtual NTSTATUS InitializeWithSetupPacket(IN PDMAMEMORYMANAGER DmaManager, IN PUSB_DEFAULT_PIPE_SETUP_PACKET SetupPacket, IN OUT ULONG TransferBufferLength, IN OUT PMDL TransferBuffer); + virtual NTSTATUS InitializeWithSetupPacket(IN PDMAMEMORYMANAGER DmaManager, IN PUSB_DEFAULT_PIPE_SETUP_PACKET SetupPacket, IN UCHAR DeviceAddress, IN OUT ULONG TransferBufferLength, IN OUT PMDL TransferBuffer); virtual NTSTATUS InitializeWithIrp(IN PDMAMEMORYMANAGER DmaManager, IN OUT PIRP Irp); virtual VOID CompletionCallback(IN NTSTATUS NtStatusCode, IN ULONG UrbStatusCode, IN struct _QUEUE_HEAD *QueueHead); virtual VOID CancelCallback(IN NTSTATUS NtStatusCode, IN struct _QUEUE_HEAD *QueueHead); @@ -57,7 +57,7 @@ NTSTATUS BuildBulkTransferQueueHead(PQUEUE_HEAD * OutHead); NTSTATUS CreateDescriptor(PQUEUE_TRANSFER_DESCRIPTOR *OutDescriptor); NTSTATUS CreateQueueHead(PQUEUE_HEAD *OutQueueHead); - ULONG GetDeviceAddress(); + UCHAR GetDeviceAddress(); NTSTATUS BuildSetupPacket(); NTSTATUS BuildSetupPacketFromURB(); @@ -97,6 +97,11 @@ // completion event for callers who initialized request with setup packet // PKEVENT m_CompletionEvent; + + // + // device address for callers who initialized it with device address + // + UCHAR m_DeviceAddress; // // DMA queue head @@ -137,6 +142,7 @@ CUSBRequest::InitializeWithSetupPacket( IN PDMAMEMORYMANAGER DmaManager, IN PUSB_DEFAULT_PIPE_SETUP_PACKET SetupPacket, + IN UCHAR DeviceAddress, IN OUT ULONG TransferBufferLength, IN OUT PMDL TransferBuffer) { @@ -153,6 +159,7 @@ m_SetupPacket = SetupPacket; m_TransferBufferLength = TransferBufferLength; m_TransferBufferMDL = TransferBuffer; + m_DeviceAddress = DeviceAddress; // // allocate completion event @@ -796,7 +803,7 @@ } //---------------------------------------------------------------------------------------- -ULONG +UCHAR CUSBRequest::GetDeviceAddress() { PIO_STACK_LOCATION IoStack; @@ -809,9 +816,9 @@ if (!m_Irp) { // - // no irp is provided - // assume it is for device address 0 - return 0; + // used provided address + // + return m_DeviceAddress; } // @@ -1158,6 +1165,14 @@ m_DmaManager->Release(m_TransferDescriptors[2], sizeof(QUEUE_TRANSFER_DESCRIPTOR)); m_TransferDescriptors[2] = 0; } + + if (m_DescriptorPacket) + { + // + // release packet descriptor + // + m_DmaManager->Release(m_DescriptorPacket, sizeof(USB_DEFAULT_PIPE_SETUP_PACKET)); + } } //-----------------------------------------------------------------------------------------
13 years, 8 months
1
0
0
0
[janderwald] 51476: [USBEHCI_NEW] - Change interface to return real async queue head - Set the async queue head register after the controller has been started - Enable async queue in StartControlle...
by janderwald@svn.reactos.org
Author: janderwald Date: Thu Apr 28 15:16:33 2011 New Revision: 51476 URL:
http://svn.reactos.org/svn/reactos?rev=51476&view=rev
Log: [USBEHCI_NEW] - Change interface to return real async queue head - Set the async queue head register after the controller has been started - Enable async queue in StartController - Port DumpDeviceDescriptor from mjmartin usbehci driver - Remove pseudo queue head from usb queue, instead use the real async queue head exported from IUSBHardwareDevice - Get physical address for transfer data in BuildControlTransferQueueHead - Retrieving device descriptor now ~works, currently stops at setting device address (needs more work) Modified: branches/usb-bringup/drivers/usb/usbehci_new/hardware.cpp branches/usb-bringup/drivers/usb/usbehci_new/interfaces.h branches/usb-bringup/drivers/usb/usbehci_new/usb_device.cpp branches/usb-bringup/drivers/usb/usbehci_new/usb_queue.cpp branches/usb-bringup/drivers/usb/usbehci_new/usb_request.cpp Modified: branches/usb-bringup/drivers/usb/usbehci_new/hardware.cpp URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup/drivers/usb/usbehci…
============================================================================== --- branches/usb-bringup/drivers/usb/usbehci_new/hardware.cpp [iso-8859-1] (original) +++ branches/usb-bringup/drivers/usb/usbehci_new/hardware.cpp [iso-8859-1] Thu Apr 28 15:16:33 2011 @@ -68,7 +68,7 @@ VOID SetAsyncListRegister(ULONG PhysicalAddress); VOID SetPeriodicListRegister(ULONG PhysicalAddress); - ULONG GetAsyncListRegister(); + struct _QUEUE_HEAD * GetAsyncListQueueHead(); ULONG GetPeriodicListRegister(); VOID SetStatusChangeEndpointCallBack(PVOID CallBack, PVOID Context); @@ -423,8 +423,6 @@ InitializeListHead(&AsyncQueueHead->LinkedQueueHeads); - SetAsyncListRegister(AsyncQueueHead->PhysicalAddr); - // // Initialize the UsbQueue now that we have an AdapterObject. // @@ -439,7 +437,24 @@ // Start the controller // DPRINT1("Starting Controller\n"); - return StartController(); + Status = StartController(); + + // + // check for success + // + if (NT_SUCCESS(Status)) + { + // + // set async list head + // + SetAsyncListRegister(AsyncQueueHead->PhysicalAddr); + } + + + // + // done + // + return Status; } NTSTATUS @@ -553,7 +568,7 @@ // GetCommandRegister(&UsbCmd); UsbCmd.PeriodicEnable = FALSE; - UsbCmd.AsyncEnable = FALSE; //FIXME: Need USB Memory Manager + UsbCmd.AsyncEnable = TRUE; //FIXME: Need USB Memory Manager UsbCmd.IntThreshold = 1; // FIXME: Set framelistsize when periodic is implemented. @@ -876,10 +891,10 @@ EHCI_WRITE_REGISTER_ULONG(EHCI_PERIODICLISTBASE, PhysicalAddress); } -ULONG -CUSBHardwareDevice::GetAsyncListRegister() -{ - return AsyncQueueHead->PhysicalAddr; +struct _QUEUE_HEAD * +CUSBHardwareDevice::GetAsyncListQueueHead() +{ + return AsyncQueueHead; } ULONG CUSBHardwareDevice::GetPeriodicListRegister() @@ -994,6 +1009,7 @@ // controller reported error // Status = STATUS_UNSUCCESSFUL; + PC_ASSERT(FALSE); } // Modified: branches/usb-bringup/drivers/usb/usbehci_new/interfaces.h URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup/drivers/usb/usbehci…
============================================================================== --- branches/usb-bringup/drivers/usb/usbehci_new/interfaces.h [iso-8859-1] (original) +++ branches/usb-bringup/drivers/usb/usbehci_new/interfaces.h [iso-8859-1] Thu Apr 28 15:16:33 2011 @@ -268,7 +268,7 @@ // // Description: Returns the memory address used in the Asynchronous Register // - virtual ULONG GetAsyncListRegister() = 0; + virtual struct _QUEUE_HEAD * GetAsyncListQueueHead() = 0; //----------------------------------------------------------------------------------------- // Modified: branches/usb-bringup/drivers/usb/usbehci_new/usb_device.cpp URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup/drivers/usb/usbehci…
============================================================================== --- branches/usb-bringup/drivers/usb/usbehci_new/usb_device.cpp [iso-8859-1] (original) +++ branches/usb-bringup/drivers/usb/usbehci_new/usb_device.cpp [iso-8859-1] Thu Apr 28 15:16:33 2011 @@ -73,6 +73,7 @@ virtual NTSTATUS CommitSetupPacket(PUSB_DEFAULT_PIPE_SETUP_PACKET Packet, IN ULONG BufferLength, IN OUT PMDL Mdl); virtual NTSTATUS CreateConfigurationDescriptor(ULONG ConfigurationIndex); virtual NTSTATUS CreateDeviceDescriptor(); + virtual VOID DumpDeviceDescriptor(PUSB_DEVICE_DESCRIPTOR DeviceDescriptor); // constructor / destructor CUSBDevice(IUnknown *OuterUnknown){} @@ -343,6 +344,11 @@ } // + // lets have a short nap + // + KeStallExecutionProcessor(300); + + // // back up old address // OldAddress = m_DeviceAddress; @@ -369,6 +375,8 @@ // return Status; } + + PC_ASSERT(FALSE); // // sanity checks @@ -628,6 +636,14 @@ // now free the mdl // IoFreeMdl(Mdl); + + if (NT_SUCCESS(Status)) + { + // + // informal dbg print + // + DumpDeviceDescriptor(&m_DeviceDescriptor); + } // // done @@ -866,6 +882,26 @@ } +VOID +CUSBDevice::DumpDeviceDescriptor(PUSB_DEVICE_DESCRIPTOR DeviceDescriptor) +{ + DPRINT1("Dumping Device Descriptor %x\n", DeviceDescriptor); + DPRINT1("bLength %x\n", DeviceDescriptor->bLength); + DPRINT1("bDescriptorType %x\n", DeviceDescriptor->bDescriptorType); + DPRINT1("bcdUSB %x\n", DeviceDescriptor->bcdUSB); + DPRINT1("bDeviceClass %x\n", DeviceDescriptor->bDeviceClass); + DPRINT1("bDeviceSubClass %x\n", DeviceDescriptor->bDeviceSubClass); + DPRINT1("bDeviceProtocol %x\n", DeviceDescriptor->bDeviceProtocol); + DPRINT1("bMaxPacketSize0 %x\n", DeviceDescriptor->bMaxPacketSize0); + DPRINT1("idVendor %x\n", DeviceDescriptor->idVendor); + DPRINT1("idProduct %x\n", DeviceDescriptor->idProduct); + DPRINT1("bcdDevice %x\n", DeviceDescriptor->bcdDevice); + DPRINT1("iManufacturer %x\n", DeviceDescriptor->iManufacturer); + DPRINT1("iProduct %x\n", DeviceDescriptor->iProduct); + DPRINT1("iSerialNumber %x\n", DeviceDescriptor->iSerialNumber); + DPRINT1("bNumConfigurations %x\n", DeviceDescriptor->bNumConfigurations); +} + //---------------------------------------------------------------------------------------- NTSTATUS CreateUSBDevice( Modified: branches/usb-bringup/drivers/usb/usbehci_new/usb_queue.cpp URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup/drivers/usb/usbehci…
============================================================================== --- branches/usb-bringup/drivers/usb/usbehci_new/usb_queue.cpp [iso-8859-1] (original) +++ branches/usb-bringup/drivers/usb/usbehci_new/usb_queue.cpp [iso-8859-1] Thu Apr 28 15:16:33 2011 @@ -51,7 +51,6 @@ KSPIN_LOCK m_Lock; PDMA_ADAPTER m_Adapter; PQUEUE_HEAD AsyncListQueueHead; - PQUEUE_HEAD PendingListQueueHead; LIST_ENTRY m_CompletedRequestAsyncList; // queue head manipulation functions @@ -109,33 +108,17 @@ // // Get the AsyncQueueHead // - AsyncListQueueHead = (PQUEUE_HEAD)Hardware->GetAsyncListRegister(); - - // - // Create the PendingListQueueHead from NONPAGEDPOOL. It will never be linked into the Asynclist Schedule - // - PendingListQueueHead = (PQUEUE_HEAD)ExAllocatePoolWithTag(NonPagedPool, sizeof(QUEUE_HEAD), TAG_USBEHCI); - if (!PendingListQueueHead) - { - DPRINT1("Pool Allocation failed!\n"); - return STATUS_INSUFFICIENT_RESOURCES; - } + AsyncListQueueHead = (PQUEUE_HEAD)Hardware->GetAsyncListQueueHead(); // // Initialize the List Head // - InitializeListHead(&PendingListQueueHead->LinkedQueueHeads); - - // - // fake the queue head as the first queue head - // - PendingListQueueHead->PhysicalAddr = ((ULONG_PTR)AsyncListQueueHead | QH_TYPE_QH); + InitializeListHead(&AsyncListQueueHead->LinkedQueueHeads); // // Initialize completed async list head // InitializeListHead(&m_CompletedRequestAsyncList); - return Status; } @@ -223,7 +206,7 @@ // // Add it to the pending list // - LinkQueueHead(PendingListQueueHead, QueueHead); + LinkQueueHead(AsyncListQueueHead, QueueHead); } @@ -300,7 +283,7 @@ Entry = NewQueueHead->LinkedQueueHeads.Flink; NextQueueHead = CONTAINING_RECORD(Entry, QUEUE_HEAD, LinkedQueueHeads); ASSERT(NextQueueHead == HeadQueueHead); - NewQueueHead->HorizontalLinkPointer = NextQueueHead->PhysicalAddr; + NewQueueHead->HorizontalLinkPointer = (NextQueueHead->PhysicalAddr | QH_TYPE_QH); } // @@ -520,7 +503,7 @@ // // add to pending list // - LinkQueueHead(PendingListQueueHead, NewQueueHead); + LinkQueueHead(AsyncListQueueHead, NewQueueHead); } else { @@ -549,9 +532,9 @@ // // walk async list // - Entry = PendingListQueueHead->LinkedQueueHeads.Flink; - - while(Entry != &PendingListQueueHead->LinkedQueueHeads) + Entry = AsyncListQueueHead->LinkedQueueHeads.Flink; + + while(Entry != &AsyncListQueueHead->LinkedQueueHeads) { // // get queue head structure @@ -573,6 +556,8 @@ // move to next entry // Entry = Entry->Flink; + + DPRINT1("Request %p QueueHead %p Complete %d\n", Request, QueueHead, Request->IsQueueHeadComplete(QueueHead)); // // check if queue head is complete @@ -604,6 +589,9 @@ IN NTSTATUS Status, OUT PULONG ShouldRingDoorBell) { + + DPRINT1("CUSBQueue::InterruptCallback\n"); + // // iterate asynchronous list // @@ -671,6 +659,8 @@ PLIST_ENTRY Entry; PQUEUE_HEAD CurrentQH; + DPRINT1("CUSBQueue::CompleteAsyncRequests\n"); + // // first acquire request lock // Modified: branches/usb-bringup/drivers/usb/usbehci_new/usb_request.cpp URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup/drivers/usb/usbehci…
============================================================================== --- branches/usb-bringup/drivers/usb/usbehci_new/usb_request.cpp [iso-8859-1] (original) +++ branches/usb-bringup/drivers/usb/usbehci_new/usb_request.cpp [iso-8859-1] Thu Apr 28 15:16:33 2011 @@ -604,6 +604,12 @@ m_TransferDescriptors[1]->Token.Bits.TotalBytesToTransfer = m_TransferBufferLength; // + // FIXME: check if the request spawns over a page -> fill other members + // + PC_ASSERT(m_TransferBufferLength <= PAGE_SIZE); + m_TransferDescriptors[1]->BufferPointer[0] = MmGetPhysicalAddress(MmGetMdlVirtualAddress(m_TransferBufferMDL)).LowPart; + + // // setup out descriptor // m_TransferDescriptors[2]->Token.Bits.PIDCode = PID_CODE_OUT_TOKEN; @@ -845,12 +851,11 @@ CUSBRequest::BuildSetupPacket() { NTSTATUS Status; - PHYSICAL_ADDRESS PhysicalAddress; // // allocate common buffer setup packet // - Status = m_DmaManager->Allocate(sizeof(USB_DEFAULT_PIPE_SETUP_PACKET), (PVOID*)&m_DescriptorPacket, &PhysicalAddress); + Status = m_DmaManager->Allocate(sizeof(USB_DEFAULT_PIPE_SETUP_PACKET), (PVOID*)&m_DescriptorPacket, &m_DescriptorSetupPacket); if (!NT_SUCCESS(Status)) { // @@ -865,7 +870,6 @@ // copy setup packet // RtlCopyMemory(m_DescriptorPacket, m_SetupPacket, sizeof(USB_DEFAULT_PIPE_SETUP_PACKET)); - m_DescriptorSetupPacket = PhysicalAddress; } else {
13 years, 8 months
1
0
0
0
[tkreuzer] 51475: [WIN32K] - Don't use exclusive locks for pens - Don't try to delete the window update region - Don't ignore pid in GreIsHandleValid - Check if handle is valid before deleting it i...
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Thu Apr 28 14:29:47 2011 New Revision: 51475 URL:
http://svn.reactos.org/svn/reactos?rev=51475&view=rev
Log: [WIN32K] - Don't use exclusive locks for pens - Don't try to delete the window update region - Don't ignore pid in GreIsHandleValid - Check if handle is valid before deleting it in DC_Cleanup - Silence a DPRINT Modified: trunk/reactos/subsystems/win32/win32k/include/pen.h trunk/reactos/subsystems/win32/win32k/ntuser/painting.c trunk/reactos/subsystems/win32/win32k/objects/arc.c trunk/reactos/subsystems/win32/win32k/objects/dclife.c trunk/reactos/subsystems/win32/win32k/objects/fillshap.c trunk/reactos/subsystems/win32/win32k/objects/gdiobj.c trunk/reactos/subsystems/win32/win32k/objects/pen.c Modified: trunk/reactos/subsystems/win32/win32k/include/pen.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/include/pen.h [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/include/pen.h [iso-8859-1] Thu Apr 28 14:29:47 2011 @@ -11,8 +11,6 @@ #define PEN_FreePen(pBMObj) GDIOBJ_FreeObj((POBJ) pBMObj, GDIObjType_BRUSH_TYPE) #define PEN_FreePenByHandle(hBMObj) GDIOBJ_FreeObjByHandle((HGDIOBJ) hBMObj, GDI_OBJECT_TYPE_PEN) -//#define PEN_LockPen(hBMObj) ((PBRUSH)GDIOBJ_LockObj((HGDIOBJ) hBMObj, GDI_OBJECT_TYPE_PEN)) - #define PEN_AllocExtPen() ((PBRUSH)GDIOBJ_AllocObj(GDIObjType_BRUSH_TYPE)) #define PEN_AllocExtPenWithHandle() ((PBRUSH)GDIOBJ_AllocObjWithHandle(GDI_OBJECT_TYPE_EXTPEN, sizeof(BRUSH))) @@ -25,8 +23,6 @@ #define PEN_ShareUnlockPen(ppen) GDIOBJ_vDereferenceObject((POBJ)ppen) - -PBRUSH FASTCALL PEN_LockPen(HGDIOBJ); PBRUSH FASTCALL PEN_ShareLockPen(HGDIOBJ); INT APIENTRY PEN_GetObject(PBRUSH pPen, INT Count, PLOGPEN Buffer); Modified: trunk/reactos/subsystems/win32/win32k/ntuser/painting.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/painting.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/painting.c [iso-8859-1] Thu Apr 28 14:29:47 2011 @@ -242,12 +242,6 @@ MsqDecPaintCountQueue(Wnd->head.pti->MessageQueue); co_IntSendMessage(hWnd, WM_NCPAINT, (WPARAM)TempRegion, 0); - if ( (HANDLE) 1 != TempRegion && - NULL != TempRegion) - { - /* NOTE: The region can already be deleted! */ - GreDeleteObject(TempRegion); - } } if (Wnd->state & WNDS_ERASEBACKGROUND) Modified: trunk/reactos/subsystems/win32/win32k/objects/arc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/arc.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/objects/arc.c [iso-8859-1] Thu Apr 28 14:29:47 2011 @@ -46,7 +46,7 @@ { PDC_ATTR pdcattr; RECTL RectBounds, RectSEpts; - PBRUSH pbrushPen; + PBRUSH pbrPen; SURFACE *psurf; BOOL ret = TRUE; LONG PenWidth, PenOrigWidth; @@ -71,18 +71,18 @@ pdcattr = dc->pdcattr; - pbrushPen = PEN_LockPen(pdcattr->hpen); - if (!pbrushPen) + pbrPen = PEN_ShareLockPen(pdcattr->hpen); + if (!pbrPen) { DPRINT1("Arc Fail 1\n"); EngSetLastError(ERROR_INTERNAL_ERROR); return FALSE; } - PenOrigWidth = PenWidth = pbrushPen->ptPenWidth.x; - if (pbrushPen->ulPenStyle == PS_NULL) PenWidth = 0; - - if (pbrushPen->ulPenStyle == PS_INSIDEFRAME) + PenOrigWidth = PenWidth = pbrPen->ptPenWidth.x; + if (pbrPen->ulPenStyle == PS_NULL) PenWidth = 0; + + if (pbrPen->ulPenStyle == PS_INSIDEFRAME) { if (2*PenWidth > (Right - Left)) PenWidth = (Right -Left + 1)/2; if (2*PenWidth > (Bottom - Top)) PenWidth = (Bottom -Top + 1)/2; @@ -93,7 +93,7 @@ } if (!PenWidth) PenWidth = 1; - pbrushPen->ptPenWidth.x = PenWidth; + pbrPen->ptPenWidth.x = PenWidth; RectBounds.left = Left; RectBounds.right = Right; @@ -156,13 +156,13 @@ AngleStart, AngleEnd, arctype, - pbrushPen); + pbrPen); psurf = dc->dclevel.pSurface; if (NULL == psurf) { DPRINT1("Arc Fail 2\n"); - PEN_UnlockPen(pbrushPen); + PEN_ShareUnlockPen(pbrPen); EngSetLastError(ERROR_INTERNAL_ERROR); return FALSE; } @@ -175,8 +175,8 @@ if (arctype == GdiTypeChord) PUTLINE(EfCx + CenterX, EfCy + CenterY, SfCx + CenterX, SfCy + CenterY, dc->eboLine); - pbrushPen->ptPenWidth.x = PenOrigWidth; - PEN_UnlockPen(pbrushPen); + pbrPen->ptPenWidth.x = PenOrigWidth; + PEN_ShareUnlockPen(pbrPen); DPRINT("IntArc Exit.\n"); return ret; } Modified: trunk/reactos/subsystems/win32/win32k/objects/dclife.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/dclife.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/objects/dclife.c [iso-8859-1] Thu Apr 28 14:29:47 2011 @@ -368,13 +368,13 @@ EBRUSHOBJ_vCleanup(&pdc->eboBackground); /* Free regions */ - if (pdc->rosdc.hClipRgn) + if (pdc->rosdc.hClipRgn && GreIsHandleValid(pdc->rosdc.hClipRgn)) GreDeleteObject(pdc->rosdc.hClipRgn); if (pdc->prgnVis) { REGION_Delete(pdc->prgnVis); } - if (pdc->rosdc.hGCClipRgn) + if (pdc->rosdc.hGCClipRgn && GreIsHandleValid(pdc->rosdc.hGCClipRgn)) { GreDeleteObject(pdc->rosdc.hGCClipRgn); } Modified: trunk/reactos/subsystems/win32/win32k/objects/fillshap.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/fillshap.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/objects/fillshap.c [iso-8859-1] Thu Apr 28 14:29:47 2011 @@ -248,7 +248,7 @@ if (pdcattr->ulDirty_ & (DIRTY_LINE | DC_PEN_DIRTY)) DC_vUpdateLineBrush(dc); - pbrush = PEN_LockPen(pdcattr->hpen); + pbrush = PEN_ShareLockPen(pdcattr->hpen); if (!pbrush) { DPRINT1("Ellipse Fail 1\n"); @@ -329,7 +329,7 @@ pbrush); pbrush->ptPenWidth.x = PenOrigWidth; - PEN_UnlockPen(pbrush); + PEN_ShareUnlockPen(pbrush); DC_UnlockDc(dc); DPRINT("Ellipse Exit.\n"); return ret; @@ -714,7 +714,7 @@ int yCurveDiameter) { PDC_ATTR pdcattr; - PBRUSH pbrushLine, pbrushFill; + PBRUSH pbrLine, pbrFill; RECTL RectBounds; LONG PenWidth, PenOrigWidth; BOOL ret = TRUE; // default to success @@ -748,18 +748,18 @@ if (pdcattr->ulDirty_ & (DIRTY_LINE | DC_PEN_DIRTY)) DC_vUpdateLineBrush(dc); - pbrushLine = PEN_LockPen(pdcattr->hpen); - if (!pbrushLine) + pbrLine = PEN_ShareLockPen(pdcattr->hpen); + if (!pbrLine) { /* Nothing to do, as we don't have a bitmap */ EngSetLastError(ERROR_INTERNAL_ERROR); return FALSE; } - PenOrigWidth = PenWidth = pbrushLine->ptPenWidth.x; - if (pbrushLine->ulPenStyle == PS_NULL) PenWidth = 0; - - if (pbrushLine->ulPenStyle == PS_INSIDEFRAME) + PenOrigWidth = PenWidth = pbrLine->ptPenWidth.x; + if (pbrLine->ulPenStyle == PS_NULL) PenWidth = 0; + + if (pbrLine->ulPenStyle == PS_INSIDEFRAME) { if (2*PenWidth > (Right - Left)) PenWidth = (Right -Left + 1)/2; if (2*PenWidth > (Bottom - Top)) PenWidth = (Bottom -Top + 1)/2; @@ -770,7 +770,7 @@ } if (!PenWidth) PenWidth = 1; - pbrushLine->ptPenWidth.x = PenWidth; + pbrLine->ptPenWidth.x = PenWidth; RectBounds.left = Left; RectBounds.top = Top; @@ -784,8 +784,8 @@ RectBounds.right += dc->ptlDCOrig.x; RectBounds.bottom += dc->ptlDCOrig.y; - pbrushFill = BRUSH_ShareLockBrush(pdcattr->hbrush); - if (NULL == pbrushFill) + pbrFill = BRUSH_ShareLockBrush(pdcattr->hbrush); + if (!pbrFill) { DPRINT1("FillRound Fail\n"); EngSetLastError(ERROR_INTERNAL_ERROR); @@ -793,7 +793,7 @@ } else { - RtlCopyMemory(&brushTemp, pbrushFill, sizeof(brushTemp)); + RtlCopyMemory(&brushTemp, pbrFill, sizeof(brushTemp)); brushTemp.ptOrigin.x += RectBounds.left - Left; brushTemp.ptOrigin.y += RectBounds.top - Top; ret = IntFillRoundRect( dc, @@ -804,7 +804,7 @@ xCurveDiameter, yCurveDiameter, &brushTemp); - BRUSH_ShareUnlockBrush(pbrushFill); + BRUSH_ShareUnlockBrush(pbrFill); } if (ret) @@ -815,10 +815,10 @@ RectBounds.bottom, xCurveDiameter, yCurveDiameter, - pbrushLine); - - pbrushLine->ptPenWidth.x = PenOrigWidth; - PEN_UnlockPen(pbrushLine); + pbrLine); + + pbrLine->ptPenWidth.x = PenOrigWidth; + PEN_ShareUnlockPen(pbrLine); return ret; } Modified: trunk/reactos/subsystems/win32/win32k/objects/gdiobj.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/gdiobj.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/objects/gdiobj.c [iso-8859-1] Thu Apr 28 14:29:47 2011 @@ -368,9 +368,8 @@ pentry->ObjectOwner.ulObj != GDI_OBJ_HMGR_PUBLIC && pentry->ObjectOwner.ulObj != PtrToUlong(PsGetCurrentProcessId())) { - DPRINT1("GDIOBJ: Cannot reference foreign handle %p, pentry=%p:%lx.\n", + DPRINT("GDIOBJ: Cannot reference foreign handle %p, pentry=%p:%lx.\n", hobj, pentry, pentry->ObjectOwner.ulObj); - //ASSERT(FALSE); return NULL; } @@ -892,7 +891,7 @@ { PENTRY pentry; - pentry = ENTRY_ReferenceEntryByHandle(hobj, GDIOBJFLAG_IGNOREPID); + pentry = ENTRY_ReferenceEntryByHandle(hobj, 0); if (!pentry) return FALSE; GDIOBJ_vDereferenceObject(pentry->einfo.pobj); return TRUE; Modified: trunk/reactos/subsystems/win32/win32k/objects/pen.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/pen.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/objects/pen.c [iso-8859-1] Thu Apr 28 14:29:47 2011 @@ -29,22 +29,15 @@ PBRUSH FASTCALL -PEN_LockPen(HGDIOBJ hobj) +PEN_ShareLockPen(HGDIOBJ hobj) { if (GDI_HANDLE_GET_TYPE(hobj) != GDILoObjType_LO_PEN_TYPE && - GDI_HANDLE_GET_TYPE(hobj) != GDILoObjType_LO_EXTPEN_TYPE) return NULL; - - return GDIOBJ_LockObject(hobj, GDIObjType_BRUSH_TYPE); -} - -PBRUSH -FASTCALL -PEN_ShareLockPen(HGDIOBJ hBMObj) -{ - if (GDI_HANDLE_GET_TYPE(hBMObj) == GDI_OBJECT_TYPE_EXTPEN) - return GDIOBJ_ShareLockObj( hBMObj, GDI_OBJECT_TYPE_EXTPEN); - else - return GDIOBJ_ShareLockObj( hBMObj, GDI_OBJECT_TYPE_PEN); + GDI_HANDLE_GET_TYPE(hobj) != GDILoObjType_LO_EXTPEN_TYPE) + { + return NULL; + } + + return (PBRUSH)GDIOBJ_ReferenceObjectByHandle(hobj, GDIObjType_BRUSH_TYPE); } HPEN APIENTRY @@ -196,16 +189,16 @@ VOID FASTCALL IntGdiSetSolidPenColor(HPEN hPen, COLORREF Color) { - PBRUSH pbrushPen; - - pbrushPen = PEN_LockPen(hPen); - if (pbrushPen) + PBRUSH pbrPen; + + pbrPen = PEN_ShareLockPen(hPen); + if (pbrPen) { - if (pbrushPen->flAttrs & GDIBRUSH_IS_SOLID) + if (pbrPen->flAttrs & GDIBRUSH_IS_SOLID) { - pbrushPen->BrushAttr.lbColor = Color & 0xFFFFFF; + pbrPen->BrushAttr.lbColor = Color & 0xFFFFFF; } - PEN_UnlockPen(pbrushPen); + PEN_ShareUnlockPen(pbrPen); } }
13 years, 8 months
1
0
0
0
[janderwald] 51474: [USBEHCI_NEW] - Check if the current request type is supported (currently only control is supported, bulk will be implemented soon) - Fix bug in IUSBRequest::CreateQueueHead - C...
by janderwald@svn.reactos.org
Author: janderwald Date: Thu Apr 28 13:13:13 2011 New Revision: 51474 URL:
http://svn.reactos.org/svn/reactos?rev=51474&view=rev
Log: [USBEHCI_NEW] - Check if the current request type is supported (currently only control is supported, bulk will be implemented soon) - Fix bug in IUSBRequest::CreateQueueHead - Code runs now until first device descriptor get request (async / periodic queue not yet enabled) - mjmartin usbehci status not yet reached - Let the fun now begin ;) Modified: branches/usb-bringup/drivers/usb/usbehci_new/usb_device.cpp branches/usb-bringup/drivers/usb/usbehci_new/usb_queue.cpp branches/usb-bringup/drivers/usb/usbehci_new/usb_request.cpp Modified: branches/usb-bringup/drivers/usb/usbehci_new/usb_device.cpp URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup/drivers/usb/usbehci…
============================================================================== --- branches/usb-bringup/drivers/usb/usbehci_new/usb_device.cpp [iso-8859-1] (original) +++ branches/usb-bringup/drivers/usb/usbehci_new/usb_device.cpp [iso-8859-1] Thu Apr 28 13:13:13 2011 @@ -550,7 +550,6 @@ return Status; } - // // now add the request // Modified: branches/usb-bringup/drivers/usb/usbehci_new/usb_queue.cpp URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup/drivers/usb/usbehci…
============================================================================== --- branches/usb-bringup/drivers/usb/usbehci_new/usb_queue.cpp [iso-8859-1] (original) +++ branches/usb-bringup/drivers/usb/usbehci_new/usb_queue.cpp [iso-8859-1] Thu Apr 28 13:13:13 2011 @@ -157,19 +157,81 @@ IUSBRequest * Request) { PQUEUE_HEAD QueueHead; + NTSTATUS Status; + ULONG Type; + + // + // sanity check + // ASSERT(Request != NULL); - Request->GetQueueHead(&QueueHead); - - // - // Add it to the pending list - // - LinkQueueHead(PendingListQueueHead, QueueHead); + // + // get request type + // + Type = Request->GetTransferType(); + + // + // check if supported + // + switch(Type) + { + case USB_ENDPOINT_TYPE_ISOCHRONOUS: + case USB_ENDPOINT_TYPE_INTERRUPT: + /* NOT IMPLEMENTED IN QUEUE */ + Status = STATUS_NOT_SUPPORTED; + break; + case USB_ENDPOINT_TYPE_BULK: + case USB_ENDPOINT_TYPE_CONTROL: + Status = STATUS_SUCCESS; + break; + default: + /* BUG */ + PC_ASSERT(FALSE); + } + + // + // check for success + // + if (!NT_SUCCESS(Status)) + { + // + // request not supported, please try later + // + return Status; + } + + if (Type == USB_ENDPOINT_TYPE_BULK || Type == USB_ENDPOINT_TYPE_CONTROL) + { + // + // get queue head + // + Status = Request->GetQueueHead(&QueueHead); + + // + // check for success + // + if (!NT_SUCCESS(Status)) + { + // + // failed to get queue head + // + return Status; + } + + DPRINT1("Request %p QueueHead %p inserted into AsyncQueue\n", Request, QueueHead); + + // + // Add it to the pending list + // + LinkQueueHead(PendingListQueueHead, QueueHead); + } + // // add extra reference which is released when the request is completed // Request->AddRef(); + return STATUS_SUCCESS; } Modified: branches/usb-bringup/drivers/usb/usbehci_new/usb_request.cpp URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup/drivers/usb/usbehci…
============================================================================== --- branches/usb-bringup/drivers/usb/usbehci_new/usb_request.cpp [iso-8859-1] (original) +++ branches/usb-bringup/drivers/usb/usbehci_new/usb_request.cpp [iso-8859-1] Thu Apr 28 13:13:13 2011 @@ -539,6 +539,11 @@ } // + // sanity check + // + PC_ASSERT(QueueHead); + + // // create setup packet // Status = BuildSetupPacket(); @@ -772,6 +777,11 @@ // FIXME check if that is really needed // QueueHead->PhysicalAddr = QueueHeadPhysicalAddress.LowPart; + + // + // output queue head + // + *OutQueueHead = QueueHead; // // done
13 years, 8 months
1
0
0
0
← Newer
1
2
3
4
5
6
7
...
30
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
Results per page:
10
25
50
100
200