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
February 2012
----- 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
22 participants
577 discussions
Start a n
N
ew thread
[janderwald] 55536: [USBEHCI] - Store configuration index in the setup packet - Perform retrieving the configuration request before storing the configuration details. Perform the same action for th...
by janderwald@svn.reactos.org
Author: janderwald Date: Sat Feb 11 02:10:20 2012 New Revision: 55536 URL:
http://svn.reactos.org/svn/reactos?rev=55536&view=rev
Log: [USBEHCI] - Store configuration index in the setup packet - Perform retrieving the configuration request before storing the configuration details. Perform the same action for the select interface request - EHCI now supports selecting configuration & interface on devices with more than one configuration (previously only one configuration was supported) - Code has not yet been tested, as no available usb device has such feature Modified: branches/usb-bringup-trunk/drivers/usb/usbehci/usb_device.cpp Modified: branches/usb-bringup-trunk/drivers/usb/usbehci/usb_device.cpp URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup-trunk/drivers/usb/u…
============================================================================== --- branches/usb-bringup-trunk/drivers/usb/usbehci/usb_device.cpp [iso-8859-1] (original) +++ branches/usb-bringup-trunk/drivers/usb/usbehci/usb_device.cpp [iso-8859-1] Sat Feb 11 02:10:20 2012 @@ -58,7 +58,7 @@ // local function virtual NTSTATUS CommitIrp(PIRP Irp); virtual NTSTATUS CommitSetupPacket(PUSB_DEFAULT_PIPE_SETUP_PACKET Packet, IN OPTIONAL PUSB_ENDPOINT EndpointDescriptor, IN ULONG BufferLength, IN OUT PMDL Mdl); - virtual NTSTATUS CreateConfigurationDescriptor(ULONG ConfigurationIndex); + virtual NTSTATUS CreateConfigurationDescriptor(UCHAR ConfigurationIndex); virtual NTSTATUS CreateDeviceDescriptor(); virtual VOID DumpDeviceDescriptor(PUSB_DEVICE_DESCRIPTOR DeviceDescriptor); virtual VOID DumpConfigurationDescriptor(PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor); @@ -302,7 +302,7 @@ PUSB_DEFAULT_PIPE_SETUP_PACKET CtrlSetup; NTSTATUS Status; UCHAR OldAddress; - ULONG Index; + UCHAR Index; DPRINT1("CUSBDevice::SetDeviceAddress Address %d\n", DeviceAddress); @@ -685,7 +685,7 @@ //---------------------------------------------------------------------------------------- NTSTATUS CUSBDevice::CreateConfigurationDescriptor( - ULONG Index) + UCHAR Index) { PVOID Buffer; USB_DEFAULT_PIPE_SETUP_PACKET CtrlSetup; @@ -722,14 +722,10 @@ CtrlSetup.bmRequestType._BM.Reserved = 0; CtrlSetup.bmRequestType._BM.Dir = BMREQUEST_DEVICE_TO_HOST; CtrlSetup.bRequest = USB_REQUEST_GET_DESCRIPTOR; - CtrlSetup.wValue.LowByte = 0; + CtrlSetup.wValue.LowByte = Index; CtrlSetup.wValue.HiByte = USB_CONFIGURATION_DESCRIPTOR_TYPE; CtrlSetup.wIndex.W = 0; CtrlSetup.wLength = PAGE_SIZE; - - // - // FIXME: where put configuration index? - // // // now build MDL describing the buffer @@ -1077,21 +1073,54 @@ IN PUSBD_INTERFACE_INFORMATION InterfaceInfo, OUT USBD_CONFIGURATION_HANDLE *ConfigurationHandle) { - ULONG ConfigurationIndex = 0; ULONG InterfaceIndex, PipeIndex; USB_DEFAULT_PIPE_SETUP_PACKET CtrlSetup; NTSTATUS Status; // - // FIXME: support multiple configurations - // - PC_ASSERT(m_DeviceDescriptor.bNumConfigurations == 1); - PC_ASSERT(ConfigurationDescriptor->iConfiguration == m_ConfigurationDescriptors[ConfigurationIndex].ConfigurationDescriptor.iConfiguration); + // sanity checks + // + ASSERT(ConfigurationDescriptor->iConfiguration < m_DeviceDescriptor.bNumConfigurations); + ASSERT(ConfigurationDescriptor->iConfiguration == m_ConfigurationDescriptors[ConfigurationDescriptor->iConfiguration].ConfigurationDescriptor.iConfiguration); // // sanity check // - PC_ASSERT(ConfigurationDescriptor->bNumInterfaces <= m_ConfigurationDescriptors[ConfigurationIndex].ConfigurationDescriptor.bNumInterfaces); + ASSERT(ConfigurationDescriptor->bNumInterfaces <= m_ConfigurationDescriptors[ConfigurationDescriptor->iConfiguration].ConfigurationDescriptor.bNumInterfaces); + + // + // now build setup packet + // + RtlZeroMemory(&CtrlSetup, sizeof(USB_DEFAULT_PIPE_SETUP_PACKET)); + CtrlSetup.bRequest = USB_REQUEST_SET_CONFIGURATION; + CtrlSetup.wValue.W = ConfigurationDescriptor->bConfigurationValue; + + // + // select configuration + // + Status = CommitSetupPacket(&CtrlSetup, 0, 0, 0); + + // + // informal debug print + // + DPRINT1("CUsbDevice::SelectConfiguration New Configuration %x Old Configuration %x Result %x\n", ConfigurationDescriptor->iConfiguration, m_ConfigurationIndex, Status); + if (!NT_SUCCESS(Status)) + { + // + // failed + // + return Status; + } + + // + // store configuration device index + // + m_ConfigurationIndex = ConfigurationDescriptor->iConfiguration; + + // + // store configuration handle + // + *ConfigurationHandle = &m_ConfigurationDescriptors[ConfigurationDescriptor->iConfiguration]; // // copy interface info and pipe info @@ -1101,7 +1130,7 @@ // // sanity check: is the info pre-layed out // - PC_ASSERT(InterfaceInfo->NumberOfPipes == m_ConfigurationDescriptors[ConfigurationIndex].Interfaces[InterfaceIndex].InterfaceDescriptor.bNumEndpoints); + PC_ASSERT(InterfaceInfo->NumberOfPipes == m_ConfigurationDescriptors[ConfigurationDescriptor->iConfiguration].Interfaces[InterfaceIndex].InterfaceDescriptor.bNumEndpoints); PC_ASSERT(InterfaceInfo->Length != 0); #ifdef _MSC_VER PC_ASSERT(InterfaceInfo->Length == FIELD_OFFSET(USBD_INTERFACE_INFORMATION, Pipes[InterfaceInfo->NumberOfPipes])); @@ -1110,10 +1139,10 @@ // // copy interface info // - InterfaceInfo->InterfaceHandle = (USBD_INTERFACE_HANDLE)&m_ConfigurationDescriptors[ConfigurationIndex].Interfaces[InterfaceIndex]; - InterfaceInfo->Class = m_ConfigurationDescriptors[ConfigurationIndex].Interfaces[InterfaceIndex].InterfaceDescriptor.bInterfaceClass; - InterfaceInfo->SubClass = m_ConfigurationDescriptors[ConfigurationIndex].Interfaces[InterfaceIndex].InterfaceDescriptor.bInterfaceSubClass; - InterfaceInfo->Protocol = m_ConfigurationDescriptors[ConfigurationIndex].Interfaces[InterfaceIndex].InterfaceDescriptor.bInterfaceProtocol; + InterfaceInfo->InterfaceHandle = (USBD_INTERFACE_HANDLE)&m_ConfigurationDescriptors[ConfigurationDescriptor->iConfiguration].Interfaces[InterfaceIndex]; + InterfaceInfo->Class = m_ConfigurationDescriptors[ConfigurationDescriptor->iConfiguration].Interfaces[InterfaceIndex].InterfaceDescriptor.bInterfaceClass; + InterfaceInfo->SubClass = m_ConfigurationDescriptors[ConfigurationDescriptor->iConfiguration].Interfaces[InterfaceIndex].InterfaceDescriptor.bInterfaceSubClass; + InterfaceInfo->Protocol = m_ConfigurationDescriptors[ConfigurationDescriptor->iConfiguration].Interfaces[InterfaceIndex].InterfaceDescriptor.bInterfaceProtocol; InterfaceInfo->Reserved = 0; // @@ -1124,47 +1153,22 @@ // // copy pipe info // - InterfaceInfo->Pipes[PipeIndex].MaximumPacketSize = m_ConfigurationDescriptors[ConfigurationIndex].Interfaces[InterfaceIndex].EndPoints[PipeIndex].EndPointDescriptor.wMaxPacketSize; - InterfaceInfo->Pipes[PipeIndex].EndpointAddress = m_ConfigurationDescriptors[ConfigurationIndex].Interfaces[InterfaceIndex].EndPoints[PipeIndex].EndPointDescriptor.bEndpointAddress; - InterfaceInfo->Pipes[PipeIndex].Interval = m_ConfigurationDescriptors[ConfigurationIndex].Interfaces[InterfaceIndex].EndPoints[PipeIndex].EndPointDescriptor.bInterval; - InterfaceInfo->Pipes[PipeIndex].PipeType = (USBD_PIPE_TYPE)m_ConfigurationDescriptors[ConfigurationIndex].Interfaces[InterfaceIndex].EndPoints[PipeIndex].EndPointDescriptor.bmAttributes; - InterfaceInfo->Pipes[PipeIndex].PipeHandle = (PVOID)&m_ConfigurationDescriptors[ConfigurationIndex].Interfaces[InterfaceIndex].EndPoints[PipeIndex].EndPointDescriptor; + InterfaceInfo->Pipes[PipeIndex].MaximumPacketSize = m_ConfigurationDescriptors[ConfigurationDescriptor->iConfiguration].Interfaces[InterfaceIndex].EndPoints[PipeIndex].EndPointDescriptor.wMaxPacketSize; + InterfaceInfo->Pipes[PipeIndex].EndpointAddress = m_ConfigurationDescriptors[ConfigurationDescriptor->iConfiguration].Interfaces[InterfaceIndex].EndPoints[PipeIndex].EndPointDescriptor.bEndpointAddress; + InterfaceInfo->Pipes[PipeIndex].Interval = m_ConfigurationDescriptors[ConfigurationDescriptor->iConfiguration].Interfaces[InterfaceIndex].EndPoints[PipeIndex].EndPointDescriptor.bInterval; + InterfaceInfo->Pipes[PipeIndex].PipeType = (USBD_PIPE_TYPE)m_ConfigurationDescriptors[ConfigurationDescriptor->iConfiguration].Interfaces[InterfaceIndex].EndPoints[PipeIndex].EndPointDescriptor.bmAttributes; + InterfaceInfo->Pipes[PipeIndex].PipeHandle = (PVOID)&m_ConfigurationDescriptors[ConfigurationDescriptor->iConfiguration].Interfaces[InterfaceIndex].EndPoints[PipeIndex].EndPointDescriptor; + + // + // data toggle is reset on configuration requests + // + m_ConfigurationDescriptors[ConfigurationDescriptor->iConfiguration].Interfaces[InterfaceIndex].EndPoints[PipeIndex].DataToggle = FALSE; } // // move offset // InterfaceInfo = (PUSBD_INTERFACE_INFORMATION)((ULONG_PTR)PtrToUlong(InterfaceInfo) + InterfaceInfo->Length); - } - - // - // now build setup packet - // - RtlZeroMemory(&CtrlSetup, sizeof(USB_DEFAULT_PIPE_SETUP_PACKET)); - CtrlSetup.bRequest = USB_REQUEST_SET_CONFIGURATION; - CtrlSetup.wValue.W = ConfigurationDescriptor->bConfigurationValue; - - // - // select configuration - // - Status = CommitSetupPacket(&CtrlSetup, 0, 0, 0); - - // - // informal debug print - // - DPRINT1("CUsbDevice::SelectConfiguration New Configuration %x Old Configuration %x Result %x\n", ConfigurationDescriptor->iConfiguration, m_ConfigurationIndex, Status); - - if (NT_SUCCESS(Status)) - { - // - // store configuration device index - // - m_ConfigurationIndex = ConfigurationDescriptor->iConfiguration; - - // - // store configuration handle - // - *ConfigurationHandle = &m_ConfigurationDescriptors[ConfigurationIndex]; } // @@ -1179,21 +1183,50 @@ IN USBD_CONFIGURATION_HANDLE ConfigurationHandle, IN OUT PUSBD_INTERFACE_INFORMATION InterfaceInfo) { - ULONG ConfigurationIndex = 0; PUSB_CONFIGURATION Configuration; ULONG PipeIndex; USB_DEFAULT_PIPE_SETUP_PACKET CtrlSetup; NTSTATUS Status; // - // FIXME support multiple configurations - // - PC_ASSERT(&m_ConfigurationDescriptors[ConfigurationIndex] == (PUSB_CONFIGURATION)ConfigurationHandle); - - // // get configuration struct // Configuration = (PUSB_CONFIGURATION)ConfigurationHandle; + + // + // sanity check + // + ASSERT(Configuration->ConfigurationDescriptor.bDescriptorType == USB_CONFIGURATION_DESCRIPTOR_TYPE); + ASSERT(Configuration->ConfigurationDescriptor.bLength == sizeof(USB_CONFIGURATION_DESCRIPTOR)); + ASSERT(Configuration->ConfigurationDescriptor.iConfiguration < m_DeviceDescriptor.bNumConfigurations); + ASSERT(&m_ConfigurationDescriptors[Configuration->ConfigurationDescriptor.iConfiguration] == Configuration); + + // + // initialize setup packet + // + RtlZeroMemory(&CtrlSetup, sizeof(USB_DEFAULT_PIPE_SETUP_PACKET)); + CtrlSetup.bRequest = USB_REQUEST_SET_INTERFACE; + CtrlSetup.wValue.W = Configuration->Interfaces[InterfaceInfo->InterfaceNumber].InterfaceDescriptor.bAlternateSetting; + CtrlSetup.wIndex.W = Configuration->Interfaces[InterfaceInfo->InterfaceNumber].InterfaceDescriptor.bInterfaceNumber; + CtrlSetup.bmRequestType.B = 0x01; + + // + // issue request + // + Status = CommitSetupPacket(&CtrlSetup, 0, 0, 0); + + // + // informal debug print + // + DPRINT1("CUSBDevice::SelectInterface AlternateSetting %x InterfaceNumber %x Status %x\n", InterfaceInfo->AlternateSetting, InterfaceInfo->InterfaceNumber, Status); + if (!NT_SUCCESS(Status)) + { + // + // failed to select interface + // + return Status; + } + // // sanity checks @@ -1224,6 +1257,11 @@ InterfaceInfo->Pipes[PipeIndex].PipeHandle = &Configuration->Interfaces[InterfaceInfo->InterfaceNumber].EndPoints[PipeIndex].EndPointDescriptor; + // + // data toggle is reset on select interface requests + // + m_ConfigurationDescriptors[Configuration->ConfigurationDescriptor.iConfiguration].Interfaces[InterfaceInfo->InterfaceNumber].EndPoints[PipeIndex].DataToggle = FALSE; + if (Configuration->Interfaces[InterfaceInfo->InterfaceNumber].EndPoints[PipeIndex].EndPointDescriptor.bmAttributes & (USB_ENDPOINT_TYPE_ISOCHRONOUS | USB_ENDPOINT_TYPE_INTERRUPT)) { // @@ -1232,24 +1270,6 @@ } } - // - // initialize setup packet - // - RtlZeroMemory(&CtrlSetup, sizeof(USB_DEFAULT_PIPE_SETUP_PACKET)); - CtrlSetup.bRequest = USB_REQUEST_SET_INTERFACE; - CtrlSetup.wValue.W = Configuration->Interfaces[InterfaceInfo->InterfaceNumber].InterfaceDescriptor.bAlternateSetting; - CtrlSetup.wIndex.W = Configuration->Interfaces[InterfaceInfo->InterfaceNumber].InterfaceDescriptor.bInterfaceNumber; - CtrlSetup.bmRequestType.B = 0x01; - - // - // issue request - // - Status = CommitSetupPacket(&CtrlSetup, 0, 0, 0); - - // - // informal debug print - // - DPRINT1("CUSBDevice::SelectInterface AlternateSetting %x InterfaceNumber %x Status %x\n", InterfaceInfo->AlternateSetting, InterfaceInfo->InterfaceNumber, Status); // // done
12 years, 10 months
1
0
0
0
[cgutman] 55535: [HAL] - Print a message when a PCI device requires an interrupt but has none assigned
by cgutman@svn.reactos.org
Author: cgutman Date: Sat Feb 11 01:11:47 2012 New Revision: 55535 URL:
http://svn.reactos.org/svn/reactos?rev=55535&view=rev
Log: [HAL] - Print a message when a PCI device requires an interrupt but has none assigned Modified: branches/usb-bringup-trunk/hal/halx86/legacy/bussupp.c Modified: branches/usb-bringup-trunk/hal/halx86/legacy/bussupp.c URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup-trunk/hal/halx86/le…
============================================================================== --- branches/usb-bringup-trunk/hal/halx86/legacy/bussupp.c [iso-8859-1] (original) +++ branches/usb-bringup-trunk/hal/halx86/legacy/bussupp.c [iso-8859-1] Sat Feb 11 01:11:47 2012 @@ -802,6 +802,7 @@ if (PciData->u.type0.InterruptPin != 0 && PciData->u.type0.InterruptLine != 0 && PciData->u.type0.InterruptLine != 0xFF) DbgPrint(", IRQ %02d", PciData->u.type0.InterruptLine); + else if (PciData->u.type0.InterruptPin != 0) DbgPrint(", IRQ assignment required"); DbgPrint("\n"); /* Scan addresses */
12 years, 10 months
1
0
0
0
[jimtabor] 55534: Alexandre Julliard : Draw the mask with SRCCOPY in DrawIcon when the image isn't being drawn.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Sat Feb 11 01:09:41 2012 New Revision: 55534 URL:
http://svn.reactos.org/svn/reactos?rev=55534&view=rev
Log: Alexandre Julliard : Draw the mask with SRCCOPY in DrawIcon when the image isn't being drawn. Modified: trunk/reactos/subsystems/win32/win32k/ntuser/cursoricon.c Modified: trunk/reactos/subsystems/win32/win32k/ntuser/cursoricon.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/cursoricon.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/cursoricon.c [iso-8859-1] Sat Feb 11 01:09:41 2012 @@ -1222,6 +1222,7 @@ if (diFlags & DI_MASK) { + DWORD rop = (diFlags & DI_IMAGE) ? SRCAND : SRCCOPY; hTmpBmp = NtGdiSelectBitmap(hMemDC, hbmMask); NtGdiStretchBlt(hDestDC, x, @@ -1233,7 +1234,7 @@ 0, pIcon->Size.cx, pIcon->Size.cy, - SRCAND, + rop, 0); NtGdiSelectBitmap(hMemDC, hTmpBmp); }
12 years, 10 months
1
0
0
0
[jimtabor] 55533: Dmitry Timoshkov : user32: RealChildWindowFromPoint should skip invisible windows.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Sat Feb 11 00:44:16 2012 New Revision: 55533 URL:
http://svn.reactos.org/svn/reactos?rev=55533&view=rev
Log: Dmitry Timoshkov : user32: RealChildWindowFromPoint should skip invisible windows. Modified: trunk/reactos/dll/win32/user32/windows/window.c Modified: trunk/reactos/dll/win32/user32/windows/window.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/windows/w…
============================================================================== --- trunk/reactos/dll/win32/user32/windows/window.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/user32/windows/window.c [iso-8859-1] Sat Feb 11 00:44:16 2012 @@ -1688,7 +1688,7 @@ RealChildWindowFromPoint(HWND hwndParent, POINT ptParentClientCoords) { - return ChildWindowFromPointEx(hwndParent, ptParentClientCoords, CWP_SKIPTRANSPARENT); + return ChildWindowFromPointEx(hwndParent, ptParentClientCoords, CWP_SKIPTRANSPARENT | CWP_SKIPINVISIBLE); } /*
12 years, 10 months
1
0
0
0
[cgutman] 55532: [IPHLPAPI] - Forward ICMP function calls to icmp.dll (for XP and higher)
by cgutman@svn.reactos.org
Author: cgutman Date: Fri Feb 10 22:16:03 2012 New Revision: 55532 URL:
http://svn.reactos.org/svn/reactos?rev=55532&view=rev
Log: [IPHLPAPI] - Forward ICMP function calls to icmp.dll (for XP and higher) Modified: trunk/reactos/dll/win32/iphlpapi/iphlpapi.spec Modified: trunk/reactos/dll/win32/iphlpapi/iphlpapi.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/iphlpapi/iphlpap…
============================================================================== --- trunk/reactos/dll/win32/iphlpapi/iphlpapi.spec [iso-8859-1] (original) +++ trunk/reactos/dll/win32/iphlpapi/iphlpapi.spec [iso-8859-1] Fri Feb 10 22:16:03 2012 @@ -84,11 +84,11 @@ @ stub Icmp6CreateFile @ stub Icmp6ParseReplies @ stub Icmp6SendEcho2 -@ stub IcmpCloseHandle -@ stub IcmpCreateFile -@ stub IcmpParseReplies -@ stub IcmpSendEcho -@ stub IcmpSendEcho2 +@ stdcall IcmpCloseHandle(ptr) icmp.IcmpCloseHandle +@ stdcall IcmpCreateFile() icmp.IcmpCreateFile +@ stdcall IcmpParseReplies(ptr long) icmp.IcmpParseReplies +@ stdcall IcmpSendEcho(ptr long ptr long ptr ptr long long) icmp.IcmpSendEcho +@ stdcall IcmpSendEcho2(ptr ptr ptr ptr long ptr long ptr ptr long long) icmp.IcmpSendEcho2 @ stub InternalCreateIpForwardEntry @ stub InternalCreateIpNetEntry @ stub InternalDeleteIpForwardEntry
12 years, 10 months
1
0
0
0
[janderwald] 55531: [USBSTOR] - Read Capacity cmd length is 10 bytes
by janderwald@svn.reactos.org
Author: janderwald Date: Fri Feb 10 21:42:42 2012 New Revision: 55531 URL:
http://svn.reactos.org/svn/reactos?rev=55531&view=rev
Log: [USBSTOR] - Read Capacity cmd length is 10 bytes Modified: branches/usb-bringup-trunk/drivers/usb/usbstor/scsi.c branches/usb-bringup-trunk/drivers/usb/usbstor/usbstor.h Modified: branches/usb-bringup-trunk/drivers/usb/usbstor/scsi.c URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup-trunk/drivers/usb/u…
============================================================================== --- branches/usb-bringup-trunk/drivers/usb/usbstor/scsi.c [iso-8859-1] (original) +++ branches/usb-bringup-trunk/drivers/usb/usbstor/scsi.c [iso-8859-1] Fri Feb 10 21:42:42 2012 @@ -819,7 +819,7 @@ // // send request, response will be freed in completion routine // - return USBSTOR_SendRequest(DeviceObject, Irp, NULL, UFI_INQUIRY_CMD_LEN, (PUCHAR)&Cmd, sizeof(UFI_CAPACITY_RESPONSE), (PUCHAR)Response); + return USBSTOR_SendRequest(DeviceObject, Irp, NULL, UFI_READ_CAPACITY_CMD_LEN, (PUCHAR)&Cmd, sizeof(UFI_CAPACITY_RESPONSE), (PUCHAR)Response); } NTSTATUS @@ -1167,7 +1167,7 @@ // ASSERT(Request->DataBuffer); - DPRINT("SCSIOP_READ_CAPACITY Length %\n", Request->DataTransferLength); + DPRINT("SCSIOP_READ_CAPACITY Length %lu\n", Request->DataTransferLength); Status = USBSTOR_SendCapacityCmd(DeviceObject, Irp); } else if (pCDB->MODE_SENSE.OperationCode == SCSIOP_MODE_SENSE) Modified: branches/usb-bringup-trunk/drivers/usb/usbstor/usbstor.h URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup-trunk/drivers/usb/u…
============================================================================== --- branches/usb-bringup-trunk/drivers/usb/usbstor/usbstor.h [iso-8859-1] (original) +++ branches/usb-bringup-trunk/drivers/usb/usbstor/usbstor.h [iso-8859-1] Fri Feb 10 21:42:42 2012 @@ -198,6 +198,7 @@ ULONG BlockLength; // block length in bytes }UFI_CAPACITY_RESPONSE, *PUFI_CAPACITY_RESPONSE; +#define UFI_READ_CAPACITY_CMD_LEN 0xA C_ASSERT(sizeof(UFI_CAPACITY_RESPONSE) == 8); //--------------------------------------------------------------------------------------------------------------------------------------------
12 years, 10 months
1
0
0
0
[janderwald] 55530: [USBEHCI] - Partly revert 55516, as the memory bug got fixed
by janderwald@svn.reactos.org
Author: janderwald Date: Fri Feb 10 20:15:39 2012 New Revision: 55530 URL:
http://svn.reactos.org/svn/reactos?rev=55530&view=rev
Log: [USBEHCI] - Partly revert 55516, as the memory bug got fixed Modified: branches/usb-bringup-trunk/drivers/usb/usbehci/hardware.cpp branches/usb-bringup-trunk/drivers/usb/usbehci/hardware.h branches/usb-bringup-trunk/drivers/usb/usbehci/hub_controller.cpp branches/usb-bringup-trunk/drivers/usb/usbehci/interfaces.h branches/usb-bringup-trunk/drivers/usb/usbehci/usb_device.cpp branches/usb-bringup-trunk/drivers/usb/usbehci/usb_queue.cpp branches/usb-bringup-trunk/drivers/usb/usbehci/usb_request.cpp branches/usb-bringup-trunk/drivers/usb/usbehci/usbehci.h Modified: branches/usb-bringup-trunk/drivers/usb/usbehci/hardware.cpp URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup-trunk/drivers/usb/u…
============================================================================== --- branches/usb-bringup-trunk/drivers/usb/usbehci/hardware.cpp [iso-8859-1] (original) +++ branches/usb-bringup-trunk/drivers/usb/usbehci/hardware.cpp [iso-8859-1] Fri Feb 10 20:15:39 2012 @@ -1339,6 +1339,7 @@ // controller reported error // DPRINT1("CStatus %x\n", CStatus); + ASSERT(FALSE); } // Modified: branches/usb-bringup-trunk/drivers/usb/usbehci/hardware.h URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup-trunk/drivers/usb/u…
============================================================================== --- branches/usb-bringup-trunk/drivers/usb/usbehci/hardware.h [iso-8859-1] (original) +++ branches/usb-bringup-trunk/drivers/usb/usbehci/hardware.h [iso-8859-1] Fri Feb 10 20:15:39 2012 @@ -148,7 +148,7 @@ //Software ULONG PhysicalAddr; - LIST_ENTRY LinkedDescriptors; + LIST_ENTRY DescriptorEntry; ULONG TotalBytesToTransfer; } QUEUE_TRANSFER_DESCRIPTOR, *PQUEUE_TRANSFER_DESCRIPTOR; @@ -216,9 +216,21 @@ //Software ULONG PhysicalAddr; LIST_ENTRY LinkedQueueHeads; + LIST_ENTRY TransferDescriptorListHead; PVOID Request; } QUEUE_HEAD, *PQUEUE_HEAD; +C_ASSERT(sizeof(END_POINT_CHARACTERISTICS) == 4); +C_ASSERT(sizeof(END_POINT_CAPABILITIES) == 4); + +C_ASSERT(FIELD_OFFSET(QUEUE_HEAD, HorizontalLinkPointer) == 0x00); +C_ASSERT(FIELD_OFFSET(QUEUE_HEAD, EndPointCharacteristics) == 0x04); +C_ASSERT(FIELD_OFFSET(QUEUE_HEAD, EndPointCapabilities) == 0x08); +C_ASSERT(FIELD_OFFSET(QUEUE_HEAD, CurrentLinkPointer) == 0xC); +C_ASSERT(FIELD_OFFSET(QUEUE_HEAD, NextPointer) == 0x10); +C_ASSERT(FIELD_OFFSET(QUEUE_HEAD, AlternateNextPointer) == 0x14); +C_ASSERT(FIELD_OFFSET(QUEUE_HEAD, Token) == 0x18); +C_ASSERT(FIELD_OFFSET(QUEUE_HEAD, BufferPointer) == 0x1C); C_ASSERT(FIELD_OFFSET(QUEUE_HEAD, PhysicalAddr) == 0x30); @@ -292,3 +304,4 @@ ULONG PortChange; }EHCI_PORT_STATUS; + Modified: branches/usb-bringup-trunk/drivers/usb/usbehci/hub_controller.cpp URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup-trunk/drivers/usb/u…
============================================================================== --- branches/usb-bringup-trunk/drivers/usb/usbehci/hub_controller.cpp [iso-8859-1] (original) +++ branches/usb-bringup-trunk/drivers/usb/usbehci/hub_controller.cpp [iso-8859-1] Fri Feb 10 20:15:39 2012 @@ -70,6 +70,9 @@ NTSTATUS HandleClassEndpoint(IN OUT PIRP Irp, PURB Urb); NTSTATUS HandleBulkOrInterruptTransfer(IN OUT PIRP Irp, PURB Urb); NTSTATUS HandleIsochronousTransfer(IN OUT PIRP Irp, PURB Urb); + NTSTATUS HandleClearStall(IN OUT PIRP Irp, PURB Urb); + NTSTATUS HandleSyncResetAndClearStall(IN OUT PIRP Irp, PURB Urb); + NTSTATUS HandleAbortPipe(IN OUT PIRP Irp, PURB Urb); friend VOID StatusChangeEndpointCallBack(PVOID Context); @@ -1675,12 +1678,21 @@ // // initialize setup packet // - CtrlSetup.bmRequestType.B = 0xa2; //FIXME: Const. + CtrlSetup.bmRequestType.B = 0x22; //FIXME: Const. CtrlSetup.bRequest = Urb->UrbControlVendorClassRequest.Request; CtrlSetup.wValue.W = Urb->UrbControlVendorClassRequest.Value; CtrlSetup.wIndex.W = Urb->UrbControlVendorClassRequest.Index; CtrlSetup.wLength = Urb->UrbControlVendorClassRequest.TransferBufferLength; + if (Urb->UrbControlVendorClassRequest.TransferFlags & USBD_TRANSFER_DIRECTION_IN) + { + // + // data direction is device to host + // + CtrlSetup.bmRequestType.B |= 0x80; + } + + // // issue request // @@ -1697,6 +1709,185 @@ // return Status; } + +NTSTATUS +CHubController::HandleSyncResetAndClearStall( + IN OUT PIRP Irp, + IN OUT PURB Urb) +{ + NTSTATUS Status = STATUS_SUCCESS; + PUSB_ENDPOINT EndpointDescriptor; + ULONG Type; + + // + // sanity check + // + PC_ASSERT(Urb->UrbHeader.UsbdDeviceHandle); + PC_ASSERT(Urb->UrbHeader.Length == sizeof(struct _URB_PIPE_REQUEST)); + PC_ASSERT(Urb->UrbPipeRequest.PipeHandle); + + // + // check if this is a valid usb device handle + // + if (!ValidateUsbDevice(PUSBDEVICE(Urb->UrbHeader.UsbdDeviceHandle))) + { + DPRINT1("HandleAbortPipe invalid device handle %p\n", Urb->UrbHeader.UsbdDeviceHandle); + + // + // invalid device handle + // + return STATUS_DEVICE_NOT_CONNECTED; + } + + // + // get endpoint descriptor + // + EndpointDescriptor = (PUSB_ENDPOINT)Urb->UrbPipeRequest.PipeHandle; + + // + // get type + // + Type = (EndpointDescriptor->EndPointDescriptor.bmAttributes & USB_ENDPOINT_TYPE_MASK); + if (Type != USB_ENDPOINT_TYPE_ISOCHRONOUS) + { + // + // clear stall + // + Status = HandleClearStall(Irp, Urb); + } + DPRINT1("URB_FUNCTION_SYNC_RESET_PIPE_AND_CLEAR_STALL Status %x\n", Status); + + // + // reset data toggle + // + ASSERT(NT_SUCCESS(Status)); + EndpointDescriptor->DataToggle = 0x0; + + // + // done + // + return Status; +} + +NTSTATUS +CHubController::HandleAbortPipe( + IN OUT PIRP Irp, + IN OUT PURB Urb) +{ + NTSTATUS Status; + PUSBDEVICE UsbDevice; + PUSB_ENDPOINT_DESCRIPTOR EndpointDescriptor; + + // + // sanity check + // + PC_ASSERT(Urb->UrbHeader.UsbdDeviceHandle); + PC_ASSERT(Urb->UrbHeader.Length == sizeof(struct _URB_PIPE_REQUEST)); + PC_ASSERT(Urb->UrbPipeRequest.PipeHandle); + + // + // check if this is a valid usb device handle + // + if (!ValidateUsbDevice(PUSBDEVICE(Urb->UrbHeader.UsbdDeviceHandle))) + { + DPRINT1("HandleAbortPipe invalid device handle %p\n", Urb->UrbHeader.UsbdDeviceHandle); + + // + // invalid device handle + // + return STATUS_DEVICE_NOT_CONNECTED; + } + + // + // get endpoint descriptor + // + EndpointDescriptor = (PUSB_ENDPOINT_DESCRIPTOR)Urb->UrbPipeRequest.PipeHandle; + + // + // get device + // + UsbDevice = PUSBDEVICE(Urb->UrbHeader.UsbdDeviceHandle); + + + // + // issue request + // + Status = UsbDevice->AbortPipe(EndpointDescriptor); + DPRINT1("URB_FUNCTION_ABORT_PIPE Status %x\n", Status); + + // + // done + // + return Status; +} + + +//----------------------------------------------------------------------------------------- +NTSTATUS +CHubController::HandleClearStall( + IN OUT PIRP Irp, + IN OUT PURB Urb) +{ + USB_DEFAULT_PIPE_SETUP_PACKET CtrlSetup; + NTSTATUS Status; + PUSBDEVICE UsbDevice; + PUSB_ENDPOINT_DESCRIPTOR EndpointDescriptor; + + + // + // sanity check + // + PC_ASSERT(Urb->UrbHeader.UsbdDeviceHandle); + PC_ASSERT(Urb->UrbHeader.Length == sizeof(struct _URB_PIPE_REQUEST)); + PC_ASSERT(Urb->UrbPipeRequest.PipeHandle); + + // + // check if this is a valid usb device handle + // + if (!ValidateUsbDevice(PUSBDEVICE(Urb->UrbHeader.UsbdDeviceHandle))) + { + DPRINT1("HandleClearStall invalid device handle %p\n", Urb->UrbHeader.UsbdDeviceHandle); + + // + // invalid device handle + // + return STATUS_DEVICE_NOT_CONNECTED; + } + + // + // get endpoint descriptor + // + EndpointDescriptor = (PUSB_ENDPOINT_DESCRIPTOR)Urb->UrbPipeRequest.PipeHandle; + + // + // get device + // + UsbDevice = PUSBDEVICE(Urb->UrbHeader.UsbdDeviceHandle); + DPRINT1("URB_FUNCTION_SYNC_CLEAR_STALL\n"); + + // + // initialize setup packet + // + CtrlSetup.bmRequestType.B = 0x02; + CtrlSetup.bRequest = USB_REQUEST_CLEAR_FEATURE; + CtrlSetup.wValue.W = USB_FEATURE_ENDPOINT_STALL; + CtrlSetup.wIndex.W = EndpointDescriptor->bEndpointAddress; + CtrlSetup.wLength = 0; + CtrlSetup.wValue.W = 0; + + // + // issue request + // + Status = UsbDevice->SubmitSetupPacket(&CtrlSetup, 0, 0); + + DPRINT1("URB_FUNCTION_CLEAR_STALL Status %x\n", Status); + + // + // done + // + return Status; +} + //----------------------------------------------------------------------------------------- NTSTATUS @@ -1747,12 +1938,20 @@ // // initialize setup packet // - CtrlSetup.bmRequestType.B = 0xa1; //FIXME: Const. + CtrlSetup.bmRequestType.B = 0x21; CtrlSetup.bRequest = Urb->UrbControlVendorClassRequest.Request; CtrlSetup.wValue.W = Urb->UrbControlVendorClassRequest.Value; CtrlSetup.wIndex.W = Urb->UrbControlVendorClassRequest.Index; CtrlSetup.wLength = Urb->UrbControlVendorClassRequest.TransferBufferLength; + if (Urb->UrbControlVendorClassRequest.TransferFlags & USBD_TRANSFER_DIRECTION_IN) + { + // + // data direction is device to host + // + CtrlSetup.bmRequestType.B |= 0x80; + } + // // issue request // @@ -1761,8 +1960,13 @@ // // assert on failure // - PC_ASSERT(NT_SUCCESS(Status)); - + if (!NT_SUCCESS(Status)) + { + // + // display error + // + DPRINT1("URB_FUNCTION_CLASS_INTERFACE failed with Urb Status %x\n", Urb->UrbHeader.Status); + } // // done @@ -1806,6 +2010,16 @@ switch (Urb->UrbHeader.Function) { + case URB_FUNCTION_SYNC_RESET_PIPE: + case URB_FUNCTION_SYNC_RESET_PIPE_AND_CLEAR_STALL: + Status = HandleSyncResetAndClearStall(Irp, Urb); + break; + case URB_FUNCTION_ABORT_PIPE: + Status = HandleAbortPipe(Irp, Urb); + break; + case URB_FUNCTION_SYNC_CLEAR_STALL: + Status = HandleClearStall(Irp, Urb); + break; case URB_FUNCTION_GET_DESCRIPTOR_FROM_INTERFACE: Status = HandleGetDescriptorFromInterface(Irp, Urb); break; Modified: branches/usb-bringup-trunk/drivers/usb/usbehci/interfaces.h URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup-trunk/drivers/usb/u…
============================================================================== --- branches/usb-bringup-trunk/drivers/usb/usbehci/interfaces.h [iso-8859-1] (original) +++ branches/usb-bringup-trunk/drivers/usb/usbehci/interfaces.h [iso-8859-1] Fri Feb 10 20:15:39 2012 @@ -379,6 +379,7 @@ // struct _QUEUE_HEAD; +struct _USB_ENDPOINT; DECLARE_INTERFACE_(IUSBRequest, IUnknown) { @@ -395,7 +396,7 @@ virtual NTSTATUS InitializeWithSetupPacket(IN PDMAMEMORYMANAGER DmaManager, IN PUSB_DEFAULT_PIPE_SETUP_PACKET SetupPacket, IN UCHAR DeviceAddress, - IN OPTIONAL PUSB_ENDPOINT_DESCRIPTOR EndpointDescriptor, + IN OPTIONAL struct _USB_ENDPOINT *EndpointDescriptor, IN OUT ULONG TransferBufferLength, IN OUT PMDL TransferBuffer) = 0; @@ -588,6 +589,15 @@ // This function gets called by IUSBHardware after it the Interrupt on Async Advance bit has been set virtual VOID CompleteAsyncRequests() = 0; + +//----------------------------------------------------------------------------------------- +// +// AbortDevicePipe +// +// Description: aborts all pending requsts of an device + + virtual NTSTATUS AbortDevicePipe(UCHAR DeviceAddress, IN PUSB_ENDPOINT_DESCRIPTOR EndpointDescriptor) = 0; + }; typedef IUSBQueue *PUSBQUEUE; @@ -841,6 +851,15 @@ virtual NTSTATUS SelectInterface(IN USBD_CONFIGURATION_HANDLE ConfigurationHandle, IN OUT PUSBD_INTERFACE_INFORMATION Interface) = 0; + +//----------------------------------------------------------------------------------------- +// +// AbortPipe +// +// Description: aborts all pending requsts + + virtual NTSTATUS AbortPipe(IN PUSB_ENDPOINT_DESCRIPTOR EndpointDescriptor) = 0; + }; typedef IUSBDevice *PUSBDEVICE; Modified: branches/usb-bringup-trunk/drivers/usb/usbehci/usb_device.cpp URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup-trunk/drivers/usb/u…
============================================================================== --- branches/usb-bringup-trunk/drivers/usb/usbehci/usb_device.cpp [iso-8859-1] (original) +++ branches/usb-bringup-trunk/drivers/usb/usbehci/usb_device.cpp [iso-8859-1] Fri Feb 10 20:15:39 2012 @@ -10,24 +10,6 @@ #define INITGUID #include "usbehci.h" - -typedef struct _USB_ENDPOINT -{ - USB_ENDPOINT_DESCRIPTOR EndPointDescriptor; -} USB_ENDPOINT, *PUSB_ENDPOINT; - -typedef struct _USB_INTERFACE -{ - USB_INTERFACE_DESCRIPTOR InterfaceDescriptor; - USB_ENDPOINT *EndPoints; -} USB_INTERFACE, *PUSB_INTERFACE; - -typedef struct _USB_CONFIGURATION -{ - USB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor; - USB_INTERFACE *Interfaces; -} USB_CONFIGURATION, *PUSB_CONFIGURATION; - class CUSBDevice : public IUSBDevice { @@ -70,10 +52,12 @@ virtual NTSTATUS SubmitSetupPacket(IN PUSB_DEFAULT_PIPE_SETUP_PACKET SetupPacket, OUT ULONG BufferLength, OUT PVOID Buffer); virtual NTSTATUS SelectConfiguration(IN PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor, IN PUSBD_INTERFACE_INFORMATION Interface, OUT USBD_CONFIGURATION_HANDLE *ConfigurationHandle); virtual NTSTATUS SelectInterface(IN USBD_CONFIGURATION_HANDLE ConfigurationHandle, IN OUT PUSBD_INTERFACE_INFORMATION Interface); + virtual NTSTATUS AbortPipe(IN PUSB_ENDPOINT_DESCRIPTOR EndpointDescriptor); + // local function virtual NTSTATUS CommitIrp(PIRP Irp); - virtual NTSTATUS CommitSetupPacket(PUSB_DEFAULT_PIPE_SETUP_PACKET Packet, IN OPTIONAL PUSB_ENDPOINT_DESCRIPTOR EndpointDescriptor, IN ULONG BufferLength, IN OUT PMDL Mdl); + virtual NTSTATUS CommitSetupPacket(PUSB_DEFAULT_PIPE_SETUP_PACKET Packet, IN OPTIONAL PUSB_ENDPOINT EndpointDescriptor, IN ULONG BufferLength, IN OUT PMDL Mdl); virtual NTSTATUS CreateConfigurationDescriptor(ULONG ConfigurationIndex); virtual NTSTATUS CreateDeviceDescriptor(); virtual VOID DumpDeviceDescriptor(PUSB_DEVICE_DESCRIPTOR DeviceDescriptor); @@ -537,7 +521,7 @@ NTSTATUS CUSBDevice::CommitSetupPacket( IN PUSB_DEFAULT_PIPE_SETUP_PACKET Packet, - IN OPTIONAL PUSB_ENDPOINT_DESCRIPTOR EndpointDescriptor, + IN OPTIONAL PUSB_ENDPOINT EndpointDescriptor, IN ULONG BufferLength, IN OUT PMDL Mdl) { @@ -1273,6 +1257,23 @@ return Status; } +NTSTATUS +CUSBDevice::AbortPipe( + IN PUSB_ENDPOINT_DESCRIPTOR EndpointDescriptor) +{ + // + // let it handle usb queue + // + ASSERT(m_Queue); + ASSERT(m_DeviceAddress); + + // + // done + // + return m_Queue->AbortDevicePipe(m_DeviceAddress, EndpointDescriptor); +} + + //---------------------------------------------------------------------------------------- NTSTATUS CreateUSBDevice( Modified: branches/usb-bringup-trunk/drivers/usb/usbehci/usb_queue.cpp URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup-trunk/drivers/usb/u…
============================================================================== --- branches/usb-bringup-trunk/drivers/usb/usbehci/usb_queue.cpp [iso-8859-1] (original) +++ branches/usb-bringup-trunk/drivers/usb/usbehci/usb_queue.cpp [iso-8859-1] Fri Feb 10 20:15:39 2012 @@ -41,6 +41,8 @@ virtual NTSTATUS CreateUSBRequest(IUSBRequest **OutRequest); virtual VOID InterruptCallback(IN NTSTATUS Status, OUT PULONG ShouldRingDoorBell); virtual VOID CompleteAsyncRequests(); + virtual NTSTATUS AbortDevicePipe(UCHAR DeviceAddress, IN PUSB_ENDPOINT_DESCRIPTOR EndpointDescriptor); + // constructor / destructor CUSBQueue(IUnknown *OuterUnknown){} @@ -499,11 +501,6 @@ // remove software link // RemoveEntryList(&QueueHead->LinkedQueueHeads); - - // - // FIXME: clear failure - // - QueueHead->Token.Bits.Halted = FALSE; } // @@ -629,6 +626,7 @@ // // walk async list // + ASSERT(AsyncListQueueHead); Entry = AsyncListQueueHead->LinkedQueueHeads.Flink; while(Entry != &AsyncListQueueHead->LinkedQueueHeads) @@ -637,6 +635,7 @@ // get queue head structure // QueueHead = (PQUEUE_HEAD)CONTAINING_RECORD(Entry, QUEUE_HEAD, LinkedQueueHeads); + ASSERT(QueueHead); // // sanity check @@ -658,7 +657,7 @@ // IsQueueHeadComplete = Request->IsQueueHeadComplete(QueueHead); - DPRINT1("Request %p QueueHead %p Complete %d\n", Request, QueueHead, IsQueueHeadComplete); + DPRINT("Request %p QueueHead %p Complete %d\n", Request, QueueHead, IsQueueHeadComplete); // // check if queue head is complete @@ -930,6 +929,16 @@ } NTSTATUS +CUSBQueue::AbortDevicePipe( + IN UCHAR DeviceAddress, + IN PUSB_ENDPOINT_DESCRIPTOR EndpointDescriptor) +{ + UNIMPLEMENTED + return STATUS_NOT_IMPLEMENTED; +} + + +NTSTATUS CreateUSBQueue( PUSBQUEUE *OutUsbQueue) { @@ -962,3 +971,4 @@ // return STATUS_SUCCESS; } + Modified: branches/usb-bringup-trunk/drivers/usb/usbehci/usb_request.cpp URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup-trunk/drivers/usb/u…
============================================================================== --- branches/usb-bringup-trunk/drivers/usb/usbehci/usb_request.cpp [iso-8859-1] (original) +++ branches/usb-bringup-trunk/drivers/usb/usbehci/usb_request.cpp [iso-8859-1] Fri Feb 10 20:15:39 2012 @@ -36,7 +36,7 @@ } // IUSBRequest interface functions - virtual NTSTATUS InitializeWithSetupPacket(IN PDMAMEMORYMANAGER DmaManager, IN PUSB_DEFAULT_PIPE_SETUP_PACKET SetupPacket, IN UCHAR DeviceAddress, IN OPTIONAL PUSB_ENDPOINT_DESCRIPTOR EndpointDescriptor, 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 OPTIONAL PUSB_ENDPOINT EndpointDescriptor, 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); @@ -62,6 +62,10 @@ NTSTATUS BuildSetupPacket(); NTSTATUS BuildSetupPacketFromURB(); ULONG InternalCalculateTransferLength(); + NTSTATUS BuildTransferDescriptorChain(IN PQUEUE_HEAD QueueHead, IN PVOID TransferBuffer, IN ULONG TransferBufferLength, IN UCHAR PidCode, IN UCHAR InitialDataToggle, OUT PQUEUE_TRANSFER_DESCRIPTOR * OutFirstDescriptor, OUT PQUEUE_TRANSFER_DESCRIPTOR * OutLastDescriptor, OUT PUCHAR OutDataToggle, OUT PULONG OutTransferBufferOffset); + VOID InitDescriptor(IN PQUEUE_TRANSFER_DESCRIPTOR CurrentDescriptor, IN PVOID TransferBuffer, IN ULONG TransferBufferLength, IN UCHAR PidCode, IN UCHAR DataToggle, OUT PULONG OutDescriptorLength); + VOID DumpQueueHead(IN PQUEUE_HEAD QueueHead); + // constructor / destructor CUSBRequest(IUnknown *OuterUnknown){} @@ -118,17 +122,12 @@ // // store end point address // - PUSB_ENDPOINT_DESCRIPTOR m_EndpointDescriptor; + PUSB_ENDPOINT m_EndpointDescriptor; // // DMA queue head // PQUEUE_HEAD m_QueueHead; - - // - // DMA transfer descriptors linked to the queue head - // - PQUEUE_TRANSFER_DESCRIPTOR m_TransferDescriptors[4]; // // allocated setup packet from the DMA pool @@ -141,6 +140,8 @@ // NTSTATUS m_NtStatusCode; ULONG m_UrbStatusCode; + + PVOID m_Base; }; @@ -160,7 +161,7 @@ IN PDMAMEMORYMANAGER DmaManager, IN PUSB_DEFAULT_PIPE_SETUP_PACKET SetupPacket, IN UCHAR DeviceAddress, - IN OPTIONAL PUSB_ENDPOINT_DESCRIPTOR EndpointDescriptor, + IN OPTIONAL PUSB_ENDPOINT EndpointDescriptor, IN OUT ULONG TransferBufferLength, IN OUT PMDL TransferBuffer) { @@ -321,7 +322,7 @@ // // get endpoint descriptor // - m_EndpointDescriptor = (PUSB_ENDPOINT_DESCRIPTOR)Urb->UrbBulkOrInterruptTransfer.PipeHandle; + m_EndpointDescriptor = (PUSB_ENDPOINT)Urb->UrbBulkOrInterruptTransfer.PipeHandle; } break; @@ -587,7 +588,7 @@ // // end point is defined in the low byte of bmAttributes // - TransferType = (m_EndpointDescriptor->bmAttributes & USB_ENDPOINT_TYPE_MASK); + TransferType = (m_EndpointDescriptor->EndPointDescriptor.bmAttributes & USB_ENDPOINT_TYPE_MASK); } else { @@ -595,6 +596,7 @@ // initialized with setup packet, must be a control transfer // TransferType = USB_ENDPOINT_TYPE_CONTROL; + ASSERT(m_EndpointDescriptor == FALSE); } // @@ -606,13 +608,243 @@ UCHAR CUSBRequest::InternalGetPidDirection() { - ASSERT(m_Irp); - ASSERT(m_EndpointDescriptor); - - // - // end point is defined in the low byte of bEndpointAddress - // - return (m_EndpointDescriptor->bEndpointAddress & USB_ENDPOINT_DIRECTION_MASK) >> 7; + if (m_EndpointDescriptor) + { + // + // end point direction is highest bit in bEndpointAddress + // + return (m_EndpointDescriptor->EndPointDescriptor.bEndpointAddress & USB_ENDPOINT_DIRECTION_MASK) >> 7; + } + else + { + // + // request arrives on the control pipe, extract direction from setup packet + // + ASSERT(m_DescriptorPacket); + return (m_DescriptorPacket->bmRequestType.B >> 7); + } +} + +VOID +CUSBRequest::InitDescriptor( + IN PQUEUE_TRANSFER_DESCRIPTOR CurrentDescriptor, + IN PVOID TransferBuffer, + IN ULONG TransferBufferLength, + IN UCHAR PidCode, + IN UCHAR DataToggle, + OUT PULONG OutDescriptorLength) +{ + ULONG Index, Length = 0, PageOffset, BufferLength; + + // + // init transfer descriptor + // + CurrentDescriptor->Token.Bits.PIDCode = PidCode; + CurrentDescriptor->Token.Bits.TotalBytesToTransfer = 0; + CurrentDescriptor->Token.Bits.DataToggle = DataToggle; + + // + // sanity check + // + ASSERT(TransferBufferLength); + + // + // store buffers + // + Index = 0; + do + { + // + // use physical address + // + CurrentDescriptor->BufferPointer[Index] = MmGetPhysicalAddress(TransferBuffer).LowPart; + + // + // Get the offset from page size + // + PageOffset = BYTE_OFFSET(CurrentDescriptor->BufferPointer[Index]); + if (PageOffset != 0) + { + // + // move to next page + // + TransferBuffer = (PVOID)ROUND_TO_PAGES(TransferBuffer); + } + else + { + // + // move to next page + // + TransferBuffer = (PVOID)((ULONG_PTR)TransferBuffer + PAGE_SIZE); + } + + // + // calculate buffer length + // + BufferLength = min(TransferBufferLength, PAGE_SIZE - PageOffset); + + // + // increment transfer bytes + // + CurrentDescriptor->Token.Bits.TotalBytesToTransfer += BufferLength; + CurrentDescriptor->TotalBytesToTransfer += BufferLength; + Length += BufferLength; + DPRINT("Index %lu TransferBufferLength %lu PageOffset %x BufferLength %lu Buffer Phy %p TransferBuffer %p\n", Index, TransferBufferLength, PageOffset, BufferLength, CurrentDescriptor->BufferPointer[Index], TransferBuffer); + + // + // decrement available byte count + // + TransferBufferLength -= BufferLength; + if (TransferBufferLength == 0) + { + // + // end reached + // + break; + } + + // + // sanity check + // + if (Index > 1) + { + // + // no equal buffers + // + ASSERT(CurrentDescriptor->BufferPointer[Index] != CurrentDescriptor->BufferPointer[Index-1]); + } + + // + // next descriptor index + // + Index++; + }while(Index < 5); + + // + // store result + // + *OutDescriptorLength = Length; +} + + +NTSTATUS +CUSBRequest::BuildTransferDescriptorChain( + IN PQUEUE_HEAD QueueHead, + IN PVOID TransferBuffer, + IN ULONG TransferBufferLength, + IN UCHAR PidCode, + IN UCHAR InitialDataToggle, + OUT PQUEUE_TRANSFER_DESCRIPTOR * OutFirstDescriptor, + OUT PQUEUE_TRANSFER_DESCRIPTOR * OutLastDescriptor, + OUT PUCHAR OutDataToggle, + OUT PULONG OutTransferBufferOffset) +{ + PQUEUE_TRANSFER_DESCRIPTOR FirstDescriptor = NULL, CurrentDescriptor, LastDescriptor = NULL; + NTSTATUS Status; + ULONG DescriptorLength, TransferBufferOffset = 0; + + do + { + // + // allocate transfer descriptor + // + Status = CreateDescriptor(&CurrentDescriptor); + if (!NT_SUCCESS(Status)) + { + // + // failed to allocate transfer descriptor + // + ASSERT(FALSE); + return Status; + } + + // + // now init the descriptor + // + InitDescriptor(CurrentDescriptor, + (PVOID)((ULONG_PTR)TransferBuffer + TransferBufferOffset), + TransferBufferLength - TransferBufferOffset, + PidCode, + InitialDataToggle, + &DescriptorLength); + + // + // insert into queue head + // + InsertTailList(&QueueHead->TransferDescriptorListHead, &CurrentDescriptor->DescriptorEntry); + + // + // adjust offset + // + TransferBufferOffset += DescriptorLength; + + if (LastDescriptor) + { + // + // link to current descriptor + // + LastDescriptor->AlternateNextPointer = CurrentDescriptor->PhysicalAddr; + LastDescriptor->NextPointer = CurrentDescriptor->PhysicalAddr; + LastDescriptor = CurrentDescriptor; + } + else + { + // + // first descriptor in chain + // + LastDescriptor = FirstDescriptor = CurrentDescriptor; + } + + if(TransferBufferLength == TransferBufferOffset) + { + // + // end reached + // + break; + } + }while(TRUE); + + if (OutFirstDescriptor) + { + // + // store first descriptor + // + *OutFirstDescriptor = FirstDescriptor; + } + + if (OutLastDescriptor) + { + // + // store last descriptor + // + *OutLastDescriptor = CurrentDescriptor; + } + + if (OutDataToggle) + { + // + // flip data toggle + // + InitialDataToggle = !InitialDataToggle; + + // + // store result data toggle + // + *OutDataToggle = InitialDataToggle; + } + + if (OutTransferBufferOffset) + { + // + // store offset + // + *OutTransferBufferOffset = TransferBufferOffset; + } + + // + // done + // + return STATUS_SUCCESS; } //---------------------------------------------------------------------------------------- @@ -621,8 +853,9 @@ PQUEUE_HEAD * OutHead) { NTSTATUS Status; - ULONG NumTransferDescriptors, Index; + ULONG DescriptorChainLength; PQUEUE_HEAD QueueHead; + PQUEUE_TRANSFER_DESCRIPTOR SetupDescriptor, StatusDescriptor, FirstDescriptor, LastDescriptor; // // first allocate the queue head @@ -650,30 +883,34 @@ // // failed to allocate setup packet // + ASSERT(FALSE); return STATUS_INSUFFICIENT_RESOURCES; } // - // calculate num of transfer descriptors - // - NumTransferDescriptors = m_TransferBufferMDL != 0 ? 3 : 2; - - // - // allocate transfer descriptors - // - for(Index = 0; Index < NumTransferDescriptors; Index++) - { - // - // allocate transfer descriptor - // - Status = CreateDescriptor(&m_TransferDescriptors[Index]); - if (!NT_SUCCESS(Status)) - { - // - // failed to allocate transfer descriptor - // - return Status; - } + // create setup descriptor + // + Status = CreateDescriptor(&SetupDescriptor); + if (!NT_SUCCESS(Status)) + { + // + // failed to allocate transfer descriptor + // + ASSERT(FALSE); + return Status; + } + + // + // create status descriptor + // + Status = CreateDescriptor(&StatusDescriptor); + if (!NT_SUCCESS(Status)) + { + // + // failed to allocate transfer descriptor + // + ASSERT(FALSE); + return Status; } // @@ -686,102 +923,86 @@ // // set endpoint address and max packet length // - QueueHead->EndPointCharacteristics.EndPointNumber = m_EndpointDescriptor->bEndpointAddress & 0x0F; - QueueHead->EndPointCharacteristics.MaximumPacketLength = m_EndpointDescriptor->wMaxPacketSize; - } - - // - // setup descriptors - // - m_TransferDescriptors[0]->Token.Bits.PIDCode = PID_CODE_SETUP_TOKEN; - m_TransferDescriptors[0]->Token.Bits.TotalBytesToTransfer = sizeof(USB_DEFAULT_PIPE_SETUP_PACKET); - m_TransferDescriptors[0]->Token.Bits.DataToggle = FALSE; - m_TransferDescriptors[0]->BufferPointer[0] = (ULONG)PtrToUlong(m_DescriptorSetupPacket.LowPart); - m_TransferDescriptors[0]->NextPointer = m_TransferDescriptors[1]->PhysicalAddr; - m_TransferDescriptors[0]->AlternateNextPointer = m_TransferDescriptors[1]->PhysicalAddr; - - if (m_TransferBufferMDL) - { - // - // setup in descriptor - // - m_TransferDescriptors[1]->Token.Bits.PIDCode = PID_CODE_IN_TOKEN; - m_TransferDescriptors[1]->Token.Bits.TotalBytesToTransfer = m_TransferBufferLength; - m_TransferDescriptors[1]->NextPointer = m_TransferDescriptors[2]->PhysicalAddr; - m_TransferDescriptors[1]->Token.Bits.DataToggle = TRUE; - m_TransferDescriptors[1]->AlternateNextPointer = m_TransferDescriptors[2]->PhysicalAddr; - - // - // 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; - m_TransferDescriptors[2]->Token.Bits.TotalBytesToTransfer = 0; - m_TransferDescriptors[2]->Token.Bits.DataToggle = TRUE; - - // - // special case, setup alternative next descriptor in case of error - // HAIKU links to dead descriptor - // - - // - // interrupt on completion - // - m_TransferDescriptors[2]->Token.Bits.InterruptOnComplete = TRUE; + QueueHead->EndPointCharacteristics.EndPointNumber = m_EndpointDescriptor->EndPointDescriptor.bEndpointAddress & 0x0F; + QueueHead->EndPointCharacteristics.MaximumPacketLength = m_EndpointDescriptor->EndPointDescriptor.wMaxPacketSize; + } + + // + // init setup descriptor + // + SetupDescriptor->Token.Bits.PIDCode = PID_CODE_SETUP_TOKEN; + SetupDescriptor->Token.Bits.TotalBytesToTransfer = sizeof(USB_DEFAULT_PIPE_SETUP_PACKET); + SetupDescriptor->Token.Bits.DataToggle = FALSE; + SetupDescriptor->BufferPointer[0] = (ULONG)PtrToUlong(m_DescriptorSetupPacket.LowPart); + InsertTailList(&QueueHead->TransferDescriptorListHead, &SetupDescriptor->DescriptorEntry); + + + // + // init status descriptor + // + StatusDescriptor->Token.Bits.TotalBytesToTransfer = 0; + StatusDescriptor->Token.Bits.DataToggle = TRUE; + StatusDescriptor->Token.Bits.InterruptOnComplete = TRUE; + + // + // is there data + // + if (m_TransferBufferLength) + { + Status = BuildTransferDescriptorChain(QueueHead, + MmGetMdlVirtualAddress(m_TransferBufferMDL), + m_TransferBufferLength, + InternalGetPidDirection(), + TRUE, + &FirstDescriptor, + &LastDescriptor, + NULL, + &DescriptorChainLength); + + // + // FIXME handle errors + // + ASSERT(Status == STATUS_SUCCESS); + ASSERT(DescriptorChainLength == m_TransferBufferLength); + + // + // now link the descriptors + // + SetupDescriptor->NextPointer = FirstDescriptor->PhysicalAddr; + SetupDescriptor->AlternateNextPointer = FirstDescriptor->PhysicalAddr; + LastDescriptor->NextPointer = StatusDescriptor->PhysicalAddr; + LastDescriptor->AlternateNextPointer = StatusDescriptor->PhysicalAddr; + + + // + // pid code is flipped for ops with data stage + // + StatusDescriptor->Token.Bits.PIDCode = !InternalGetPidDirection(); } else { // - // no buffer, setup in descriptor - // - m_TransferDescriptors[1]->Token.Bits.PIDCode = PID_CODE_IN_TOKEN; - m_TransferDescriptors[1]->Token.Bits.TotalBytesToTransfer = 0; - m_TransferDescriptors[1]->Token.Bits.DataToggle = TRUE; - - // - // interrupt on completion - // - m_TransferDescriptors[1]->Token.Bits.InterruptOnComplete = TRUE; - } + // direct link + // + SetupDescriptor->NextPointer = StatusDescriptor->PhysicalAddr; + SetupDescriptor->AlternateNextPointer = StatusDescriptor->PhysicalAddr; + + // + // retrieve result of operation + // + StatusDescriptor->Token.Bits.PIDCode = PID_CODE_IN_TOKEN; + } + + // + // insert status descriptor + // + InsertTailList(&QueueHead->TransferDescriptorListHead, &StatusDescriptor->DescriptorEntry); + // // link transfer descriptors to queue head // - QueueHead->NextPointer = m_TransferDescriptors[0]->PhysicalAddr; - - DPRINT("QueueHead %p Addr %x\n", QueueHead, QueueHead->PhysicalAddr); - DPRINT("NumDescriptors %lu\n", NumTransferDescriptors); - DPRINT("QueueHead AlternateNextPointer %x\n", QueueHead->AlternateNextPointer); - DPRINT("QueueHead NextPointer %x\n", QueueHead->NextPointer); - DPRINT("m_DescriptorSetupPacket HiPart %x LoPart %x\n", m_DescriptorSetupPacket.HighPart, m_DescriptorSetupPacket.LowPart); - - - DPRINT("TransferDescriptor 0 Addr %x\n", m_TransferDescriptors[0]->PhysicalAddr); - DPRINT("TransferDescriptor 0 Next %x\n", m_TransferDescriptors[0]->NextPointer); - DPRINT("TransferDescriptor 0 AlternativeNext %x\n", m_TransferDescriptors[0]->AlternateNextPointer); - DPRINT("TransferDescriptor 0 Buffer Pointer %x\n", m_TransferDescriptors[0]->BufferPointer[0]); - DPRINT("TransferDescriptor 0 TotalBytesToTransfer 0x%x\n", m_TransferDescriptors[0]->Token.Bits.TotalBytesToTransfer); - - DPRINT("TransferDescriptor 1 Addr %x\n", m_TransferDescriptors[1]->PhysicalAddr); - DPRINT("TransferDescriptor 1 Next %x\n", m_TransferDescriptors[1]->NextPointer); - DPRINT("TransferDescriptor 1 AlternativeNext %x\n", m_TransferDescriptors[1]->AlternateNextPointer); - DPRINT("TransferDescriptor 1 Buffer Pointer %x\n", m_TransferDescriptors[1]->BufferPointer[0]); - DPRINT("TransferDescriptor 1 TotalBytesToTransfer 0x%x\n", m_TransferDescriptors[1]->Token.Bits.TotalBytesToTransfer); - - if (NumTransferDescriptors == 3) - { - DPRINT("TransferDescriptor 2 Addr %x\n", m_TransferDescriptors[2]->PhysicalAddr); - DPRINT("TransferDescriptor 2 Next %x\n", m_TransferDescriptors[2]->NextPointer); - DPRINT("TransferDescriptor 2 AlternativeNext %x\n", m_TransferDescriptors[2]->AlternateNextPointer); - DPRINT("TransferDescriptor 2 Buffer Pointer %x\n", m_TransferDescriptors[2]->BufferPointer[0]); - DPRINT("TransferDescriptor 2 TotalBytesToTransfer 0x%x\n", m_TransferDescriptors[2]->Token.Bits.TotalBytesToTransfer); - } - + QueueHead->NextPointer = SetupDescriptor->PhysicalAddr; // // store result @@ -789,10 +1010,80 @@ *OutHead = QueueHead; // + // displays the current request + // + //DumpQueueHead(QueueHead); + + DPRINT1("BuildControlTransferQueueHead done\n"); + // // done // return STATUS_SUCCESS; } + +VOID +CUSBRequest::DumpQueueHead( + IN PQUEUE_HEAD QueueHead) +{ + PLIST_ENTRY Entry; + PQUEUE_TRANSFER_DESCRIPTOR Descriptor; + ULONG Index = 0; + + DPRINT1("QueueHead %p Addr %x\n", QueueHead, QueueHead->PhysicalAddr); + DPRINT1("QueueHead AlternateNextPointer %x\n", QueueHead->AlternateNextPointer); + DPRINT1("QueueHead NextPointer %x\n", QueueHead->NextPointer); + + DPRINT1("QueueHead HubAddr %x\n", QueueHead->EndPointCharacteristics.ControlEndPointFlag); + DPRINT1("QueueHead DeviceAddress %x\n", QueueHead->EndPointCharacteristics.DeviceAddress); + DPRINT1("QueueHead EndPointNumber %x\n", QueueHead->EndPointCharacteristics.EndPointNumber); + DPRINT1("QueueHead EndPointSpeed %x\n", QueueHead->EndPointCharacteristics.EndPointSpeed); + DPRINT1("QueueHead HeadOfReclamation %x\n", QueueHead->EndPointCharacteristics.HeadOfReclamation); + DPRINT1("QueueHead InactiveOnNextTransaction %x\n", QueueHead->EndPointCharacteristics.InactiveOnNextTransaction); + DPRINT1("QueueHead MaximumPacketLength %x\n", QueueHead->EndPointCharacteristics.MaximumPacketLength); + DPRINT1("QueueHead NakCountReload %x\n", QueueHead->EndPointCharacteristics.NakCountReload); + DPRINT1("QueueHead QEDTDataToggleControl %x\n", QueueHead->EndPointCharacteristics.QEDTDataToggleControl); + DPRINT1("QueueHead HubAddr %x\n", QueueHead->EndPointCapabilities.HubAddr); + DPRINT1("QueueHead InterruptScheduleMask %x\n", QueueHead->EndPointCapabilities.InterruptScheduleMask); + DPRINT1("QueueHead NumberOfTransactionPerFrame %x\n", QueueHead->EndPointCapabilities.NumberOfTransactionPerFrame); + DPRINT1("QueueHead PortNumber %x\n", QueueHead->EndPointCapabilities.PortNumber); + DPRINT1("QueueHead SplitCompletionMask %x\n", QueueHead->EndPointCapabilities.SplitCompletionMask); + + Entry = QueueHead->TransferDescriptorListHead.Flink; + while(Entry != &QueueHead->TransferDescriptorListHead) + { + // + // get transfer descriptor + // + Descriptor = (PQUEUE_TRANSFER_DESCRIPTOR)CONTAINING_RECORD(Entry, QUEUE_TRANSFER_DESCRIPTOR, DescriptorEntry); + + DPRINT1("TransferDescriptor %lu Addr %x\n", Index, Descriptor->PhysicalAddr); + DPRINT1("TransferDescriptor %lu Next %x\n", Index, Descriptor->NextPointer); + DPRINT1("TransferDescriptor %lu AlternateNextPointer %x\n", Index, Descriptor->AlternateNextPointer); + DPRINT1("TransferDescriptor %lu Active %lu\n", Index, Descriptor->Token.Bits.Active); + DPRINT1("TransferDescriptor %lu BabbleDetected %lu\n", Index, Descriptor->Token.Bits.BabbleDetected); + DPRINT1("TransferDescriptor %lu CurrentPage %lu\n", Index, Descriptor->Token.Bits.CurrentPage); + DPRINT1("TransferDescriptor %lu DataBufferError %lu\n", Index, Descriptor->Token.Bits.DataBufferError); + DPRINT1("TransferDescriptor %lu DataToggle %lu\n", Index, Descriptor->Token.Bits.DataToggle); + DPRINT1("TransferDescriptor %lu ErrorCounter %lu\n", Index, Descriptor->Token.Bits.ErrorCounter); + DPRINT1("TransferDescriptor %lu Halted %lu\n", Index, Descriptor->Token.Bits.Halted); + DPRINT1("TransferDescriptor %lu InterruptOnComplete %x\n", Index, Descriptor->Token.Bits.InterruptOnComplete); + DPRINT1("TransferDescriptor %lu MissedMicroFrame %lu\n", Index, Descriptor->Token.Bits.MissedMicroFrame); + DPRINT1("TransferDescriptor %lu PIDCode %lu\n", Index, Descriptor->Token.Bits.PIDCode); + DPRINT1("TransferDescriptor %lu PingState %lu\n", Index, Descriptor->Token.Bits.PingState); + DPRINT1("TransferDescriptor %lu SplitTransactionState %lu\n", Index, Descriptor->Token.Bits.SplitTransactionState); + DPRINT1("TransferDescriptor %lu TotalBytesToTransfer %lu\n", Index, Descriptor->Token.Bits.TotalBytesToTransfer); + DPRINT1("TransferDescriptor %lu TransactionError %lu\n", Index, Descriptor->Token.Bits.TransactionError); + + DPRINT1("TransferDescriptor %lu Buffer Pointer 0 %x\n", Index, Descriptor->BufferPointer[0]); + DPRINT1("TransferDescriptor %lu Buffer Pointer 1 %x\n", Index, Descriptor->BufferPointer[1]); + DPRINT1("TransferDescriptor %lu Buffer Pointer 2 %x\n", Index, Descriptor->BufferPointer[2]); + DPRINT1("TransferDescriptor %lu Buffer Pointer 3 %x\n", Index, Descriptor->BufferPointer[3]); + DPRINT1("TransferDescriptor %lu Buffer Pointer 4 %x\n", Index, Descriptor->BufferPointer[4]); + Entry = Entry->Flink; + Index++; + } +} + //---------------------------------------------------------------------------------------- NTSTATUS @@ -801,11 +1092,9 @@ { NTSTATUS Status; PQUEUE_HEAD QueueHead; - ULONG TransferDescriptorCount, Index; - ULONG BytesAvailable, BufferIndex; PVOID Base; - ULONG PageOffset, CurrentTransferBufferLength; - UCHAR DataToggle; + ULONG ChainDescriptorLength; + PQUEUE_TRANSFER_DESCRIPTOR FirstDescriptor, LastDescriptor; // // Allocate the queue head @@ -826,279 +1115,81 @@ PC_ASSERT(QueueHead); PC_ASSERT(m_TransferBufferLength); - // - // Max default of 3 descriptors - // - TransferDescriptorCount = 3; - - // - // get virtual base of mdl - // - Base = MmGetSystemAddressForMdlSafe(m_TransferBufferMDL, NormalPagePriority); + if (!m_Base) + { + // + // get virtual base of mdl + // + m_Base = MmGetSystemAddressForMdlSafe(m_TransferBufferMDL, NormalPagePriority); + } // // Increase the size of last transfer, 0 in case this is the first // - Base = (PVOID)((ULONG_PTR)Base + m_TransferBufferLengthCompleted); + Base = (PVOID)((ULONG_PTR)m_Base + m_TransferBufferLengthCompleted); PC_ASSERT(m_EndpointDescriptor); PC_ASSERT(Base); // - // Get the offset from page size - // - PageOffset = BYTE_OFFSET(Base); - - // - // PageOffset should only be > 0 if this is the first transfer for this requests - // - if ((PageOffset != 0) && (m_TransferBufferLengthCompleted != 0)) - { - ASSERT(FALSE); - } - - // - // Calculate the size of this transfer - // - if ((PageOffset != 0) && ((m_TransferBufferLength - m_TransferBufferLengthCompleted) >= (PAGE_SIZE * 4) + PageOffset)) - { - CurrentTransferBufferLength = (PAGE_SIZE * 4) + PageOffset; - } - else if ((m_TransferBufferLength - m_TransferBufferLengthCompleted) >= PAGE_SIZE * 5) - { - CurrentTransferBufferLength = PAGE_SIZE * 5; - } - else - CurrentTransferBufferLength = (m_TransferBufferLength - m_TransferBufferLengthCompleted); - - // - // Add current transfer length to transfer length completed - // - m_TransferBufferLengthCompleted += CurrentTransferBufferLength; - BytesAvailable = CurrentTransferBufferLength; - - DPRINT1("BuildBulkTransferQueueHead\n"); - DPRINT("CurrentTransferBufferLength %x, m_TransferBufferLengthCompleted %x\n", CurrentTransferBufferLength, m_TransferBufferLengthCompleted); - - DPRINT("EndPointAddress %x\n", m_EndpointDescriptor->bEndpointAddress); - DPRINT("EndPointDirection %x\n", USB_ENDPOINT_DIRECTION_IN(m_EndpointDescriptor->bEndpointAddress)); - - DPRINT("Request %p Base Address %p TransferBytesLength %lu MDL %p\n", this, Base, BytesAvailable, m_TransferBufferMDL); - DPRINT("InternalGetPidDirection() %d EndPointAddress %x\n", InternalGetPidDirection(), m_EndpointDescriptor->bEndpointAddress & 0x0F); - DPRINT("Irp %p QueueHead %p\n", m_Irp, QueueHead); - - //PC_ASSERT(InternalGetPidDirection() == USB_ENDPOINT_DIRECTION_IN(m_EndpointDescriptor->bEndpointAddress)); - - // - // DataToggle - // - DataToggle = FALSE; - - // - // Allocated transfer descriptors - // - for (Index = 0; Index < TransferDescriptorCount; Index++) - { - Status = CreateDescriptor(&m_TransferDescriptors[Index]); - if (!NT_SUCCESS(Status)) - { - // - // Failed to allocate transfer descriptors - // - - // - // Free QueueHead - // - FreeQueueHead(QueueHead); - - // - // Free Descriptors - // FIXME: Implement FreeDescriptors - // - return Status; - } - - // - // sanity check - // - PC_ASSERT(BytesAvailable); - - // - // now setup transfer buffers - // - for(BufferIndex = 0; BufferIndex < 5; BufferIndex++) - { - // - // If this is the first buffer of the first descriptor and there is a PageOffset - // - if ((BufferIndex == 0) && (PageOffset != 0) && (Index == 0)) - { - // - // use physical address - // - m_TransferDescriptors[Index]->BufferPointer[0] = MmGetPhysicalAddress(Base).LowPart; - - // - // move to next page - // - Base = (PVOID)ROUND_TO_PAGES(Base); - - // - // increment transfer bytes - // - if (CurrentTransferBufferLength > PAGE_SIZE - PageOffset) - m_TransferDescriptors[Index]->Token.Bits.TotalBytesToTransfer = PAGE_SIZE - PageOffset; - else - m_TransferDescriptors[Index]->Token.Bits.TotalBytesToTransfer = CurrentTransferBufferLength; - - // - // decrement available byte count - // - BytesAvailable -= m_TransferDescriptors[Index]->Token.Bits.TotalBytesToTransfer; - - DPRINT1("TransferDescriptor %p Index %lu BufferPointer %p BufferIndex %lu TotalBytes %lu Remaining %lu\n", m_TransferDescriptors[Index], Index, m_TransferDescriptors[Index]->BufferPointer[BufferIndex], - BufferIndex, m_TransferDescriptors[Index]->Token.Bits.TotalBytesToTransfer, BytesAvailable); - } - else - { - // - // the following pages always start on byte zero of each page - // - PC_ASSERT(((ULONG_PTR)Base & (PAGE_SIZE-1)) == 0); - - if (BytesAvailable >= PAGE_SIZE) - { - // - // store address - // - m_TransferDescriptors[Index]->BufferPointer[BufferIndex] = MmGetPhysicalAddress(Base).LowPart; - - // - // move to next page - // - Base = (PVOID)((ULONG_PTR)Base + PAGE_SIZE); - - // - // increment transfer descriptor bytes - // - m_TransferDescriptors[Index]->Token.Bits.TotalBytesToTransfer += PAGE_SIZE; - - // - // decrement available byte count - // - BytesAvailable -= PAGE_SIZE; - - DPRINT1("TransferDescriptor %p Index %lu BufferPointer %p BufferIndex %lu TotalBytes %lu Remaining %lu\n", m_TransferDescriptors[Index], Index, m_TransferDescriptors[Index]->BufferPointer[BufferIndex], - BufferIndex, m_TransferDescriptors[Index]->Token.Bits.TotalBytesToTransfer, BytesAvailable); - } - else - { - PC_ASSERT(BytesAvailable); - - if (BytesAvailable) - { - // - // store address - // - m_TransferDescriptors[Index]->BufferPointer[BufferIndex] = MmGetPhysicalAddress(Base).LowPart; - - // - // increment transfer descriptor bytes - // - m_TransferDescriptors[Index]->Token.Bits.TotalBytesToTransfer += BytesAvailable; - - // - // decrement available byte count - // - BytesAvailable -= BytesAvailable; - - // - // done as this is the last partial or full page - // - } - DPRINT1("TransferDescriptor %p Index %lu BufferPointer %p BufferIndex %lu TotalBytes %lu Remaining %lu\n", m_TransferDescriptors[Index], Index, m_TransferDescriptors[Index]->BufferPointer[BufferIndex], - BufferIndex, m_TransferDescriptors[Index]->Token.Bits.TotalBytesToTransfer, BytesAvailable); - - break; - } - } - - // - // Check if all bytes have been consumed - // - if (BytesAvailable == 0) - break; - } - - // - // Go ahead and link descriptors - // - if (Index > 0) - { - m_TransferDescriptors[Index - 1]->NextPointer = m_TransferDescriptors[Index]->PhysicalAddr; - } - - - // - // status descriptor - // - m_TransferDescriptors[Index]->Token.Bits.InterruptOnComplete = TRUE; - - // - // FIXME: need status descriptor? - // - - // - // setup direction - // - m_TransferDescriptors[Index]->Token.Bits.PIDCode = InternalGetPidDirection(); - - // - // set data toggle - // - m_TransferDescriptors[Index]->Token.Bits.DataToggle = DataToggle; - DataToggle = !DataToggle; - - // - // Check if all bytes have been consumed - // - if (BytesAvailable == 0) - break; - } - - // - // all bytes should have been consumed - // - PC_ASSERT(BytesAvailable == 0); - - // - // Initialize the QueueHead + // sanity check + // + ASSERT(m_EndpointDescriptor); + + // + // build bulk transfer descriptor chain + // + Status = BuildTransferDescriptorChain(QueueHead, + Base, + m_TransferBufferLength - m_TransferBufferLengthCompleted, + InternalGetPidDirection(), + m_EndpointDescriptor->DataToggle, + &FirstDescriptor, + &LastDescriptor, + &m_EndpointDescriptor->DataToggle, + &ChainDescriptorLength); + + // + // FIXME: handle errors + // + ASSERT(ChainDescriptorLength == m_TransferBufferLength); + + // + // move to next offset + // + m_TransferBufferLengthCompleted += ChainDescriptorLength; + + ASSERT(Status == STATUS_SUCCESS); + + // + // init queue head // QueueHead->EndPointCharacteristics.DeviceAddress = GetDeviceAddress(); - - if (m_EndpointDescriptor) - { - // - // Set endpoint address and max packet length - // - QueueHead->EndPointCharacteristics.EndPointNumber = m_EndpointDescriptor->bEndpointAddress & 0x0F; - QueueHead->EndPointCharacteristics.MaximumPacketLength = m_EndpointDescriptor->wMaxPacketSize; - } - - // - // store number of transactions - // - QueueHead->EndPointCapabilities.NumberOfTransactionPerFrame = min(Index, 1); - - // - // link descriptor with queue head - // - QueueHead->NextPointer = m_TransferDescriptors[0]->PhysicalAddr; + QueueHead->EndPointCharacteristics.EndPointNumber = m_EndpointDescriptor->EndPointDescriptor.bEndpointAddress & 0x0F; + QueueHead->EndPointCharacteristics.MaximumPacketLength = m_EndpointDescriptor->EndPointDescriptor.wMaxPacketSize; + QueueHead->NextPointer = FirstDescriptor->PhysicalAddr; + QueueHead->CurrentLinkPointer = FirstDescriptor->PhysicalAddr; + QueueHead->AlternateNextPointer = TERMINATE_POINTER; + + ASSERT(QueueHead->EndPointCharacteristics.DeviceAddress); + ASSERT(QueueHead->EndPointCharacteristics.EndPointNumber); + ASSERT(QueueHead->EndPointCharacteristics.MaximumPacketLength); + ASSERT(QueueHead->NextPointer); + + // + // interrupt on last descriptor + // + LastDescriptor->Token.Bits.InterruptOnComplete = TRUE; // // store result // *OutHead = QueueHead; + + // + // dump status + // + //DumpQueueHead(QueueHead); // // done @@ -1176,6 +1267,7 @@ QueueHead->HorizontalLinkPointer = TERMINATE_POINTER; QueueHead->AlternateNextPointer = TERMINATE_POINTER; QueueHead->NextPointer = TERMINATE_POINTER; + InitializeListHead(&QueueHead->TransferDescriptorListHead); // // 1 for non high speed, 0 for high speed device @@ -1536,12 +1628,50 @@ CUSBRequest::FreeQueueHead( IN struct _QUEUE_HEAD * QueueHead) { - LONG DescriptorCount; - - // - // FIXME: support chained queue heads - // - //PC_ASSERT(QueueHead == m_QueueHead); + PLIST_ENTRY Entry; + PQUEUE_TRANSFER_DESCRIPTOR Descriptor; + + // + // sanity checks + // + ASSERT(m_DmaManager); + ASSERT(QueueHead); + ASSERT(!IsListEmpty(&QueueHead->TransferDescriptorListHead)); + + do + { + // + // get transfer descriptors + // + Entry = RemoveHeadList(&QueueHead->TransferDescriptorListHead); + ASSERT(Entry); + + // + // obtain descriptor from entry + // + Descriptor = (PQUEUE_TRANSFER_DESCRIPTOR)CONTAINING_RECORD(Entry, QUEUE_TRANSFER_DESCRIPTOR, DescriptorEntry); + ASSERT(Descriptor); + + // + // add transfer count + // + m_TotalBytesTransferred += (Descriptor->TotalBytesToTransfer - Descriptor->Token.Bits.TotalBytesToTransfer); + DPRINT("TotalBytes Transferred in Descriptor %p Phys Addr %x TotalBytesSoftware %lu Length %lu\n", Descriptor, Descriptor->PhysicalAddr, Descriptor->TotalBytesToTransfer, Descriptor->TotalBytesToTransfer - Descriptor->Token.Bits.TotalBytesToTransfer); + + // + // release transfer descriptors + // + m_DmaManager->Release(Descriptor, sizeof(QUEUE_TRANSFER_DESCRIPTOR)); + + }while(!IsListEmpty(&QueueHead->TransferDescriptorListHead)); + + if (m_DescriptorPacket) + { + // + // release packet descriptor + // + m_DmaManager->Release(m_DescriptorPacket, sizeof(USB_DEFAULT_PIPE_SETUP_PACKET)); + } // // release queue head @@ -1549,57 +1679,10 @@ m_DmaManager->Release(QueueHead, sizeof(QUEUE_HEAD)); // - // nullify pointer + // nullify pointers // m_QueueHead = 0; - - // - // release transfer descriptors - // - for (DescriptorCount = 0; DescriptorCount < 3; DescriptorCount++) - { - if (m_TransferDescriptors[DescriptorCount]) - { - // - // Calculate Total Bytes Transferred - // FIXME: Is this the correct method of determine bytes transferred? - // - if (USB_ENDPOINT_TYPE_BULK == GetTransferType()) - { - // - // sanity check - // - ASSERT(m_EndpointDescriptor); - - if (USB_ENDPOINT_DIRECTION_IN(m_EndpointDescriptor->bEndpointAddress)) - { - DPRINT("m_TotalBytesTransferred %x, %x - %x\n", - m_TotalBytesTransferred, - m_TransferDescriptors[DescriptorCount]->TotalBytesToTransfer, - m_TransferDescriptors[DescriptorCount]->Token.Bits.TotalBytesToTransfer); - - m_TotalBytesTransferred += - m_TransferDescriptors[DescriptorCount]->TotalBytesToTransfer - - m_TransferDescriptors[DescriptorCount]->Token.Bits.TotalBytesToTransfer; - } - } - - // - // release transfer descriptors - // - m_DmaManager->Release(m_TransferDescriptors[DescriptorCount], sizeof(QUEUE_TRANSFER_DESCRIPTOR)); - m_TransferDescriptors[DescriptorCount] = 0; - } - } - - if (m_DescriptorPacket) - { - // - // release packet descriptor - // - m_DmaManager->Release(m_DescriptorPacket, sizeof(USB_DEFAULT_PIPE_SETUP_PACKET)); - m_DescriptorPacket = 0; - } + m_DescriptorPacket = 0; } //----------------------------------------------------------------------------------------- @@ -1607,7 +1690,8 @@ CUSBRequest::IsQueueHeadComplete( struct _QUEUE_HEAD * QueueHead) { - ULONG Index; + PLIST_ENTRY Entry; + PQUEUE_TRANSFER_DESCRIPTOR Descriptor; // // first check - is the queue head currently active @@ -1617,39 +1701,50 @@ // // queue head is active (currently processed) // - ASSERT(QueueHead->Token.Bits.Halted == FALSE); - //return FALSE; - } - - // - // FIXME: support chained queue heads - // - for(Index = 0; Index < 3; Index++) - { - // - // check transfer descriptors for completion - // - if (m_TransferDescriptors[Index]) + return FALSE; + } + + if (QueueHead->Token.Bits.Halted) + { + // + // error occured + // + DPRINT1("Found halted queue head %p\n", QueueHead); + DumpQueueHead(QueueHead); + ASSERT(FALSE); + return TRUE; + } + + // + // loop list and see if there are any active descriptors + // + Entry = QueueHead->TransferDescriptorListHead.Flink; + while(Entry != &QueueHead->TransferDescriptorListHead) + { + // + // obtain descriptor from entry + // + Descriptor = (PQUEUE_TRANSFER_DESCRIPTOR)CONTAINING_RECORD(Entry, QUEUE_TRANSFER_DESCRIPTOR, DescriptorEntry); + ASSERT(Descriptor); + if (Descriptor->Token.Bits.Active) { // - // check for serious error - // - DPRINT("Descriptor Addr %x\n", m_TransferDescriptors[Index]->PhysicalAddr); - DPRINT("Descriptor BabbleDetected %x\n", m_TransferDescriptors[Index]->Token.Bits.BabbleDetected); - DPRINT("Descriptor DataBufferError %x\n", m_TransferDescriptors[Index]->Token.Bits.DataBufferError); - DPRINT("Descriptor DataToggle %x\n", m_TransferDescriptors[Index]->Token.Bits.DataToggle); - DPRINT("Descriptor ErrorCounter %x\n", m_TransferDescriptors[Index]->Token.Bits.ErrorCounter); - DPRINT("Descriptor TransactionError %x\n", m_TransferDescriptors[Index]->Token.Bits.TransactionError); - - - // - // the transfer descriptor should be in the same state as the queue head - // - //PC_ASSERT(m_TransferDescriptors[Index]->Token.Bits.Active == 0); + // descriptor is still active + // + return FALSE; } - } - //ASSERT(FALSE); - + + // + // move to next entry + // + Entry = Entry->Flink; + } + + DPRINT("QueueHead %p Addr %x is complete\n", QueueHead, QueueHead->PhysicalAddr); + + // + // no active descriptors found, queue head is finished + // return TRUE; } @@ -1682,8 +1777,7 @@ // sanity check // ASSERT(m_EndpointDescriptor); - - if (USB_ENDPOINT_DIRECTION_IN(m_EndpointDescriptor->bEndpointAddress)) + if (USB_ENDPOINT_DIRECTION_IN(m_EndpointDescriptor->EndPointDescriptor.bEndpointAddress)) { // // bulk in request Modified: branches/usb-bringup-trunk/drivers/usb/usbehci/usbehci.h URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup-trunk/drivers/usb/u…
============================================================================== --- branches/usb-bringup-trunk/drivers/usb/usbehci/usbehci.h [iso-8859-1] (original) +++ branches/usb-bringup-trunk/drivers/usb/usbehci/usbehci.h [iso-8859-1] Fri Feb 10 20:15:39 2012 @@ -38,6 +38,28 @@ #define C_PORT_SUSPEND 18 #define C_PORT_OVER_CURRENT 19 #define C_PORT_RESET 20 + +typedef struct _USB_ENDPOINT +{ + USB_ENDPOINT_DESCRIPTOR EndPointDescriptor; + UCHAR HubAddress; + UCHAR HubPort; + UCHAR DataToggle; +} USB_ENDPOINT, *PUSB_ENDPOINT; + +typedef struct _USB_INTERFACE +{ + USB_INTERFACE_DESCRIPTOR InterfaceDescriptor; + USB_ENDPOINT *EndPoints; +} USB_INTERFACE, *PUSB_INTERFACE; + +typedef struct _USB_CONFIGURATION +{ + USB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor; + USB_INTERFACE *Interfaces; +} USB_CONFIGURATION, *PUSB_CONFIGURATION; + + typedef struct {
12 years, 10 months
1
0
0
0
[tkreuzer] 55529: [FREELDR] Fix 64 bit warnings Patch by Samuel Serapion, slightly modified by me
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Fri Feb 10 19:10:17 2012 New Revision: 55529 URL:
http://svn.reactos.org/svn/reactos?rev=55529&view=rev
Log: [FREELDR] Fix 64 bit warnings Patch by Samuel Serapion, slightly modified by me Modified: trunk/reactos/boot/freeldr/freeldr/arch/amd64/winldr.c trunk/reactos/boot/freeldr/freeldr/arch/arm/winldr.c trunk/reactos/boot/freeldr/freeldr/arch/i386/pcvideo.c trunk/reactos/boot/freeldr/freeldr/arch/i386/winldr.c trunk/reactos/boot/freeldr/freeldr/cache/blocklist.c trunk/reactos/boot/freeldr/freeldr/cache/cache.c trunk/reactos/boot/freeldr/freeldr/fs/fs.c trunk/reactos/boot/freeldr/freeldr/include/cache.h trunk/reactos/boot/freeldr/freeldr/include/mm.h trunk/reactos/boot/freeldr/freeldr/include/winldr.h trunk/reactos/boot/freeldr/freeldr/inifile/parse.c trunk/reactos/boot/freeldr/freeldr/mm/heap.c trunk/reactos/boot/freeldr/freeldr/mm/meminit.c trunk/reactos/boot/freeldr/freeldr/mm/mm.c trunk/reactos/boot/freeldr/freeldr/reactos/archwsup.c trunk/reactos/boot/freeldr/freeldr/reactos/registry.c trunk/reactos/boot/freeldr/freeldr/ui/tui.c trunk/reactos/boot/freeldr/freeldr/ui/tuimenu.c trunk/reactos/boot/freeldr/freeldr/ui/ui.c trunk/reactos/boot/freeldr/freeldr/windows/peloader.c trunk/reactos/boot/freeldr/freeldr/windows/wlmemory.c trunk/reactos/boot/freeldr/freeldr/windows/wlregistry.c Modified: trunk/reactos/boot/freeldr/freeldr/arch/amd64/winldr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/arch/amd64/winldr.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/arch/amd64/winldr.c [iso-8859-1] Fri Feb 10 19:10:17 2012 @@ -145,10 +145,10 @@ return TRUE; } -ULONG -MempMapRangeOfPages(ULONG64 VirtualAddress, ULONG64 PhysicalAddress, ULONG cPages) -{ - ULONG i; +PFN_NUMBER +MempMapRangeOfPages(ULONG64 VirtualAddress, ULONG64 PhysicalAddress, PFN_NUMBER cPages) +{ + PFN_NUMBER i; for (i = 0; i < cPages; i++) { @@ -165,8 +165,8 @@ } BOOLEAN -MempSetupPaging(IN ULONG StartPage, - IN ULONG NumberOfPages, +MempSetupPaging(IN PFN_NUMBER StartPage, + IN PFN_NUMBER NumberOfPages, IN BOOLEAN KernelMapping) { TRACE(">>> MempSetupPaging(0x%lx, %ld, %p)\n", @@ -196,7 +196,7 @@ } VOID -MempUnmapPage(ULONG Page) +MempUnmapPage(PFN_NUMBER Page) { // TRACE(">>> MempUnmapPage\n"); } Modified: trunk/reactos/boot/freeldr/freeldr/arch/arm/winldr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/arch/arm/winldr.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/arch/arm/winldr.c [iso-8859-1] Fri Feb 10 19:10:17 2012 @@ -80,14 +80,14 @@ /* FUNCTIONS **************************************************************/ BOOLEAN -MempSetupPaging(IN ULONG StartPage, - IN ULONG NumberOfPages) +MempSetupPaging(IN PFN_NUMBER StartPage, + IN PFN_COUNT NumberOfPages) { return TRUE; } VOID -MempUnmapPage(IN ULONG Page) +MempUnmapPage(IN PFN_NUMBER Page) { return; } Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/pcvideo.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/arch/i386/pcvideo.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/arch/i386/pcvideo.c [iso-8859-1] Fri Feb 10 19:10:17 2012 @@ -416,7 +416,7 @@ CRTC = (CRTC | 0xE2); /* (write) */ - WRITE_PORT_UCHAR((PUCHAR)0x03C2, CRTC); + WRITE_PORT_UCHAR((PUCHAR)0x03C2, (UCHAR)CRTC); } static VOID Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/winldr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/arch/i386/winldr.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/arch/i386/winldr.c [iso-8859-1] Fri Feb 10 19:10:17 2012 @@ -143,13 +143,13 @@ } BOOLEAN -MempSetupPaging(IN ULONG StartPage, - IN ULONG NumberOfPages, +MempSetupPaging(IN PFN_NUMBER StartPage, + IN PFN_COUNT NumberOfPages, IN BOOLEAN KernelMapping) { PHARDWARE_PTE PhysicalPT; PHARDWARE_PTE KernelPT; - ULONG Entry, Page; + PFN_COUNT Entry, Page; TRACE("MempSetupPaging: SP 0x%X, Number: 0x%X, Kernel: %s\n", StartPage, NumberOfPages, KernelMapping ? "yes" : "no"); @@ -199,10 +199,10 @@ } VOID -MempUnmapPage(ULONG Page) +MempUnmapPage(PFN_NUMBER Page) { PHARDWARE_PTE KernelPT; - ULONG Entry = (Page >> 10) + (KSEG0_BASE >> 22); + PFN_NUMBER Entry = (Page >> 10) + (KSEG0_BASE >> 22); /* Don't unmap hyperspace or HAL entries */ if (Entry == HYPER_SPACE_ENTRY || Entry == 1023) Modified: trunk/reactos/boot/freeldr/freeldr/cache/blocklist.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/cache…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/cache/blocklist.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/cache/blocklist.c [iso-8859-1] Fri Feb 10 19:10:17 2012 @@ -175,7 +175,7 @@ VOID CacheInternalCheckCacheSizeLimits(PCACHE_DRIVE CacheDrive) { - ULONG NewCacheSize; + SIZE_T NewCacheSize; TRACE("CacheInternalCheckCacheSizeLimits()\n"); Modified: trunk/reactos/boot/freeldr/freeldr/cache/cache.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/cache…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/cache/cache.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/cache/cache.c [iso-8859-1] Fri Feb 10 19:10:17 2012 @@ -31,8 +31,8 @@ BOOLEAN CacheManagerInitialized = FALSE; BOOLEAN CacheManagerDataInvalid = FALSE; ULONG CacheBlockCount = 0; -ULONG CacheSizeLimit = 0; -ULONG CacheSizeCurrent = 0; +SIZE_T CacheSizeLimit = 0; +SIZE_T CacheSizeCurrent = 0; BOOLEAN CacheInitializeDrive(UCHAR DriveNumber) { Modified: trunk/reactos/boot/freeldr/freeldr/fs/fs.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/fs/fs…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/fs/fs.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/fs/fs.c [iso-8859-1] Fri Feb 10 19:10:17 2012 @@ -248,14 +248,14 @@ LONG ArcOpen(CHAR* Path, OPENMODE OpenMode, ULONG* FileId) { - ULONG i, ret; + ULONG Count, i, ret; PLIST_ENTRY pEntry; DEVICE* pDevice; CHAR* DeviceName; CHAR* FileName; CHAR* p; CHAR* q; - ULONG dwCount, dwLength; + SIZE_T Length; OPENMODE DeviceOpenMode; ULONG DeviceId; @@ -271,16 +271,16 @@ FileName++; /* Count number of "()", which needs to be replaced by "(0)" */ - dwCount = 0; + Count = 0; for (p = Path; p != FileName; p++) if (*p == '(' && *(p + 1) == ')') - dwCount++; + Count++; /* Duplicate device name, and replace "()" by "(0)" (if required) */ - dwLength = FileName - Path + dwCount; - if (dwCount != 0) + Length = FileName - Path + Count; + if (Count != 0) { - DeviceName = MmHeapAlloc(FileName - Path + dwCount); + DeviceName = MmHeapAlloc(FileName - Path + Count); if (!DeviceName) return ENOMEM; for (p = Path, q = DeviceName; p != FileName; p++) @@ -302,7 +302,7 @@ while (pEntry != &DeviceListHead) { pDevice = CONTAINING_RECORD(pEntry, DEVICE, ListEntry); - if (strncmp(pDevice->Prefix, DeviceName, dwLength) == 0) + if (strncmp(pDevice->Prefix, DeviceName, Length) == 0) { /* OK, device found. It is already opened? */ if (pDevice->ReferenceCount == 0) @@ -412,18 +412,18 @@ VOID FsRegisterDevice(CHAR* Prefix, const DEVVTBL* FuncTable) { DEVICE* pNewEntry; - ULONG dwLength; + SIZE_T Length; TRACE("FsRegisterDevice() Prefix = %s\n", Prefix); - dwLength = strlen(Prefix) + 1; - pNewEntry = MmHeapAlloc(sizeof(DEVICE) + dwLength); + Length = strlen(Prefix) + 1; + pNewEntry = MmHeapAlloc(sizeof(DEVICE) + Length); if (!pNewEntry) return; pNewEntry->FuncTable = FuncTable; pNewEntry->ReferenceCount = 0; pNewEntry->Prefix = (CHAR*)(pNewEntry + 1); - memcpy(pNewEntry->Prefix, Prefix, dwLength); + memcpy(pNewEntry->Prefix, Prefix, Length); InsertHeadList(&DeviceListHead, &pNewEntry->ListEntry); } Modified: trunk/reactos/boot/freeldr/freeldr/include/cache.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/inclu…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/include/cache.h [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/include/cache.h [iso-8859-1] Fri Feb 10 19:10:17 2012 @@ -67,8 +67,8 @@ extern CACHE_DRIVE CacheManagerDrive; extern BOOLEAN CacheManagerInitialized; extern ULONG CacheBlockCount; -extern ULONG CacheSizeLimit; -extern ULONG CacheSizeCurrent; +extern SIZE_T CacheSizeLimit; +extern SIZE_T CacheSizeCurrent; /////////////////////////////////////////////////////////////////////////////////////// // Modified: trunk/reactos/boot/freeldr/freeldr/include/mm.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/inclu…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/include/mm.h [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/include/mm.h [iso-8859-1] Fri Feb 10 19:10:17 2012 @@ -60,7 +60,7 @@ typedef struct { TYPE_OF_MEMORY PageAllocated; // Type of allocated memory (LoaderFree if this memory is free) - ULONG PageAllocationLength; // Number of pages allocated (or zero if this isn't the first page in the chain) + PFN_NUMBER PageAllocationLength; // Number of pages allocated (or zero if this isn't the first page in the chain) } PAGE_LOOKUP_TABLE_ITEM, *PPAGE_LOOKUP_TABLE_ITEM; #include <poppack.h> @@ -72,38 +72,38 @@ #define DUMP_MEM_MAP_ON_VERIFY 0 extern PVOID PageLookupTableAddress; -extern ULONG TotalPagesInLookupTable; -extern ULONG FreePagesInLookupTable; -extern ULONG LastFreePageHint; +extern PFN_NUMBER TotalPagesInLookupTable; +extern PFN_NUMBER FreePagesInLookupTable; +extern PFN_NUMBER LastFreePageHint; #if DBG PCSTR MmGetSystemMemoryMapTypeString(TYPE_OF_MEMORY Type); #endif -ULONG MmGetPageNumberFromAddress(PVOID Address); // Returns the page number that contains a linear address -ULONG MmGetAddressablePageCountIncludingHoles(VOID); // Returns the count of addressable pages from address zero including any memory holes and reserved memory regions -PVOID MmFindLocationForPageLookupTable(ULONG TotalPageCount); // Returns the address for a memory chunk big enough to hold the page lookup table (starts search from end of memory) -VOID MmInitPageLookupTable(PVOID PageLookupTable, ULONG TotalPageCount); // Inits the page lookup table according to the memory types in the memory map -VOID MmMarkPagesInLookupTable(PVOID PageLookupTable, ULONG StartPage, ULONG PageCount, TYPE_OF_MEMORY PageAllocated); // Marks the specified pages as allocated or free in the lookup table -VOID MmAllocatePagesInLookupTable(PVOID PageLookupTable, ULONG StartPage, ULONG PageCount, TYPE_OF_MEMORY MemoryType); // Allocates the specified pages in the lookup table -ULONG MmCountFreePagesInLookupTable(PVOID PageLookupTable, ULONG TotalPageCount); // Returns the number of free pages in the lookup table -ULONG MmFindAvailablePages(PVOID PageLookupTable, ULONG TotalPageCount, ULONG PagesNeeded, BOOLEAN FromEnd); // Returns the page number of the first available page range from the beginning or end of memory -ULONG MmFindAvailablePagesBeforePage(PVOID PageLookupTable, ULONG TotalPageCount, ULONG PagesNeeded, ULONG LastPage); // Returns the page number of the first available page range before the specified page -VOID MmUpdateLastFreePageHint(PVOID PageLookupTable, ULONG TotalPageCount); // Sets the LastFreePageHint to the last usable page of memory -BOOLEAN MmAreMemoryPagesAvailable(PVOID PageLookupTable, ULONG TotalPageCount, PVOID PageAddress, ULONG PageCount); // Returns TRUE if the specified pages of memory are available, otherwise FALSE -VOID MmSetMemoryType(PVOID MemoryAddress, ULONG MemorySize, TYPE_OF_MEMORY NewType); // Use with EXTREME caution! +PFN_NUMBER MmGetPageNumberFromAddress(PVOID Address); // Returns the page number that contains a linear address +PFN_NUMBER MmGetAddressablePageCountIncludingHoles(VOID); // Returns the count of addressable pages from address zero including any memory holes and reserved memory regions +PVOID MmFindLocationForPageLookupTable(PFN_NUMBER TotalPageCount); // Returns the address for a memory chunk big enough to hold the page lookup table (starts search from end of memory) +VOID MmInitPageLookupTable(PVOID PageLookupTable, PFN_NUMBER TotalPageCount); // Inits the page lookup table according to the memory types in the memory map +VOID MmMarkPagesInLookupTable(PVOID PageLookupTable, PFN_NUMBER StartPage, PFN_NUMBER PageCount, TYPE_OF_MEMORY PageAllocated); // Marks the specified pages as allocated or free in the lookup table +VOID MmAllocatePagesInLookupTable(PVOID PageLookupTable, PFN_NUMBER StartPage, PFN_NUMBER PageCount, TYPE_OF_MEMORY MemoryType); // Allocates the specified pages in the lookup table +PFN_NUMBER MmCountFreePagesInLookupTable(PVOID PageLookupTable, PFN_NUMBER TotalPageCount); // Returns the number of free pages in the lookup table +PFN_NUMBER MmFindAvailablePages(PVOID PageLookupTable, PFN_NUMBER TotalPageCount, PFN_NUMBER PagesNeeded, BOOLEAN FromEnd); // Returns the page number of the first available page range from the beginning or end of memory +PFN_NUMBER MmFindAvailablePagesBeforePage(PVOID PageLookupTable, PFN_NUMBER TotalPageCount, PFN_NUMBER PagesNeeded, PFN_NUMBER LastPage); // Returns the page number of the first available page range before the specified page +VOID MmUpdateLastFreePageHint(PVOID PageLookupTable, PFN_NUMBER TotalPageCount); // Sets the LastFreePageHint to the last usable page of memory +BOOLEAN MmAreMemoryPagesAvailable(PVOID PageLookupTable, PFN_NUMBER TotalPageCount, PVOID PageAddress, PFN_NUMBER PageCount); // Returns TRUE if the specified pages of memory are available, otherwise FALSE +VOID MmSetMemoryType(PVOID MemoryAddress, SIZE_T MemorySize, TYPE_OF_MEMORY NewType); // Use with EXTREME caution! -PPAGE_LOOKUP_TABLE_ITEM MmGetMemoryMap(ULONG *NoEntries); // Returns a pointer to the memory mapping table and a number of entries in it +PPAGE_LOOKUP_TABLE_ITEM MmGetMemoryMap(PFN_NUMBER *NoEntries); // Returns a pointer to the memory mapping table and a number of entries in it //BOOLEAN MmInitializeMemoryManager(ULONG LowMemoryStart, ULONG LowMemoryLength); BOOLEAN MmInitializeMemoryManager(VOID); VOID MmInitializeHeap(PVOID PageLookupTable); -PVOID MmAllocateMemory(ULONG MemorySize); -PVOID MmAllocateMemoryWithType(ULONG MemorySize, TYPE_OF_MEMORY MemoryType); +PVOID MmAllocateMemory(SIZE_T MemorySize); +PVOID MmAllocateMemoryWithType(SIZE_T MemorySize, TYPE_OF_MEMORY MemoryType); VOID MmFreeMemory(PVOID MemoryPointer); -PVOID MmAllocateMemoryAtAddress(ULONG MemorySize, PVOID DesiredAddress, TYPE_OF_MEMORY MemoryType); -PVOID MmAllocateHighestMemoryBelowAddress(ULONG MemorySize, PVOID DesiredAddress, TYPE_OF_MEMORY MemoryType); +PVOID MmAllocateMemoryAtAddress(SIZE_T MemorySize, PVOID DesiredAddress, TYPE_OF_MEMORY MemoryType); +PVOID MmAllocateHighestMemoryBelowAddress(SIZE_T MemorySize, PVOID DesiredAddress, TYPE_OF_MEMORY MemoryType); PVOID MmHeapAlloc(SIZE_T MemorySize); VOID MmHeapFree(PVOID MemoryPointer); @@ -114,7 +114,7 @@ PVOID HeapCreate( - ULONG MaximumSize, + SIZE_T MaximumSize, TYPE_OF_MEMORY MemoryType); VOID Modified: trunk/reactos/boot/freeldr/freeldr/include/winldr.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/inclu…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/include/winldr.h [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/include/winldr.h [iso-8859-1] Fri Feb 10 19:10:17 2012 @@ -162,12 +162,12 @@ MempAllocatePageTables(); BOOLEAN -MempSetupPaging(IN ULONG StartPage, - IN ULONG NumberOfPages, +MempSetupPaging(IN PFN_NUMBER StartPage, + IN PFN_NUMBER NumberOfPages, IN BOOLEAN KernelMapping); VOID -MempUnmapPage(ULONG Page); +MempUnmapPage(PFN_NUMBER Page); VOID MempDump(); Modified: trunk/reactos/boot/freeldr/freeldr/inifile/parse.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/inifi…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/inifile/parse.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/inifile/parse.c [iso-8859-1] Fri Feb 10 19:10:17 2012 @@ -73,7 +73,7 @@ // Get the line of data CurrentOffset = IniGetNextLine(IniFileData, IniFileSize, IniFileLine, IniFileLineSize, CurrentOffset); - LineLength = strlen(IniFileLine); + LineLength = (ULONG)strlen(IniFileLine); // If it is a blank line or a comment then skip it if (IniIsLineEmpty(IniFileLine, LineLength) || IniIsCommentLine(IniFileLine, LineLength)) Modified: trunk/reactos/boot/freeldr/freeldr/mm/heap.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/mm/he…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/mm/heap.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/mm/heap.c [iso-8859-1] Fri Feb 10 19:10:17 2012 @@ -30,8 +30,8 @@ typedef struct _BLOCK_DATA { - ULONG Flink; - ULONG Blink; + ULONG_PTR Flink; + ULONG_PTR Blink; } BLOCK_DATA, *PBLOCK_DATA; typedef struct _HEAP_BLOCK @@ -44,26 +44,26 @@ typedef struct _HEAP { - ULONG MaximumSize; - ULONG CurrentAllocBytes; - ULONG MaxAllocBytes; + SIZE_T MaximumSize; + SIZE_T CurrentAllocBytes; + SIZE_T MaxAllocBytes; ULONG NumAllocs; ULONG NumFrees; - ULONG LargestAllocation; + SIZE_T LargestAllocation; ULONGLONG AllocationTime; ULONGLONG FreeTime; - ULONG TerminatingBlock; + ULONG_PTR TerminatingBlock; HEAP_BLOCK Blocks; } HEAP, *PHEAP; PVOID HeapCreate( - ULONG MaximumSize, + SIZE_T MaximumSize, TYPE_OF_MEMORY MemoryType) { PHEAP Heap; PHEAP_BLOCK Block; - ULONG Remaining; + SIZE_T Remaining; USHORT PreviousSize; TRACE("HeapCreate(MemoryType=%ld)\n", MemoryType); @@ -136,7 +136,7 @@ /* Mark all pages as firmware temporary, so they are free for the kernel */ MmMarkPagesInLookupTable(PageLookupTableAddress, (ULONG_PTR)Heap / MM_PAGE_SIZE, - Heap->MaximumSize / MM_PAGE_SIZE, + (PFN_COUNT)(Heap->MaximumSize / MM_PAGE_SIZE), LoaderFirmwareTemporary); } @@ -147,7 +147,7 @@ PHEAP Heap = HeapHandle; PHEAP_BLOCK Block; PUCHAR StartAddress, EndAddress; - ULONG FreePages, AllFreePages = 0; + PFN_COUNT FreePages, AllFreePages = 0; TRACE("HeapRelease(%p)\n", HeapHandle); /* Loop all heap chunks */ @@ -176,7 +176,7 @@ EndAddress = ALIGN_DOWN_POINTER_BY(Block->Data, PAGE_SIZE); } - FreePages = (EndAddress - StartAddress) / MM_PAGE_SIZE; + FreePages = (PFN_COUNT)((EndAddress - StartAddress) / MM_PAGE_SIZE); AllFreePages += FreePages; /* Now mark the pages free */ @@ -449,7 +449,7 @@ } PVOID -MmHeapAlloc(ULONG MemorySize) +MmHeapAlloc(SIZE_T MemorySize) { return HeapAllocate(FrLdrDefaultHeap, MemorySize, 'pHmM'); } Modified: trunk/reactos/boot/freeldr/freeldr/mm/meminit.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/mm/me…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/mm/meminit.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/mm/meminit.c [iso-8859-1] Fri Feb 10 19:10:17 2012 @@ -53,11 +53,11 @@ #endif PVOID PageLookupTableAddress = NULL; -ULONG TotalPagesInLookupTable = 0; -ULONG FreePagesInLookupTable = 0; -ULONG LastFreePageHint = 0; -ULONG MmLowestPhysicalPage = 0xFFFFFFFF; -ULONG MmHighestPhysicalPage = 0; +PFN_NUMBER TotalPagesInLookupTable = 0; +PFN_NUMBER FreePagesInLookupTable = 0; +PFN_NUMBER LastFreePageHint = 0; +PFN_NUMBER MmLowestPhysicalPage = 0xFFFFFFFF; +PFN_NUMBER MmHighestPhysicalPage = 0; PFREELDR_MEMORY_DESCRIPTOR BiosMemoryMap; ULONG BiosMemoryMapEntryCount; @@ -232,15 +232,15 @@ } #endif -ULONG MmGetPageNumberFromAddress(PVOID Address) +PFN_NUMBER MmGetPageNumberFromAddress(PVOID Address) { return ((ULONG_PTR)Address) / MM_PAGE_SIZE; } -ULONG MmGetAddressablePageCountIncludingHoles(VOID) +PFN_NUMBER MmGetAddressablePageCountIncludingHoles(VOID) { const FREELDR_MEMORY_DESCRIPTOR* MemoryDescriptor = NULL; - ULONG PageCount; + PFN_NUMBER PageCount; // // Go through the whole memory map to get max address @@ -277,12 +277,12 @@ return PageCount; } -PVOID MmFindLocationForPageLookupTable(ULONG TotalPageCount) +PVOID MmFindLocationForPageLookupTable(PFN_NUMBER TotalPageCount) { const FREELDR_MEMORY_DESCRIPTOR* MemoryDescriptor = NULL; - ULONG PageLookupTableSize; - ULONG PageLookupTablePages; - ULONG PageLookupTableStartPage = 0; + SIZE_T PageLookupTableSize; + PFN_NUMBER PageLookupTablePages; + PFN_NUMBER PageLookupTableStartPage = 0; PVOID PageLookupTableMemAddress = NULL; // Calculate how much pages we need to keep the page lookup table @@ -316,11 +316,11 @@ return PageLookupTableMemAddress; } -VOID MmInitPageLookupTable(PVOID PageLookupTable, ULONG TotalPageCount) +VOID MmInitPageLookupTable(PVOID PageLookupTable, PFN_NUMBER TotalPageCount) { const FREELDR_MEMORY_DESCRIPTOR* MemoryDescriptor = NULL; - ULONG PageLookupTableStartPage; - ULONG PageLookupTablePageCount; + PFN_NUMBER PageLookupTableStartPage; + PFN_NUMBER PageLookupTablePageCount; TRACE("MmInitPageLookupTable()\n"); @@ -359,10 +359,10 @@ MmMarkPagesInLookupTable(PageLookupTable, PageLookupTableStartPage, PageLookupTablePageCount, LoaderFirmwareTemporary); } -VOID MmMarkPagesInLookupTable(PVOID PageLookupTable, ULONG StartPage, ULONG PageCount, TYPE_OF_MEMORY PageAllocated) -{ - PPAGE_LOOKUP_TABLE_ITEM RealPageLookupTable = (PPAGE_LOOKUP_TABLE_ITEM)PageLookupTable; - ULONG Index; +VOID MmMarkPagesInLookupTable(PVOID PageLookupTable, PFN_NUMBER StartPage, PFN_NUMBER PageCount, TYPE_OF_MEMORY PageAllocated) +{ + PPAGE_LOOKUP_TABLE_ITEM RealPageLookupTable = (PPAGE_LOOKUP_TABLE_ITEM)PageLookupTable; + PFN_NUMBER Index; TRACE("MmMarkPagesInLookupTable()\n"); /* Validate the range */ @@ -389,10 +389,10 @@ TRACE("MmMarkPagesInLookupTable() Done\n"); } -VOID MmAllocatePagesInLookupTable(PVOID PageLookupTable, ULONG StartPage, ULONG PageCount, TYPE_OF_MEMORY MemoryType) +VOID MmAllocatePagesInLookupTable(PVOID PageLookupTable, PFN_NUMBER StartPage, PFN_NUMBER PageCount, TYPE_OF_MEMORY MemoryType) { PPAGE_LOOKUP_TABLE_ITEM RealPageLookupTable = (PPAGE_LOOKUP_TABLE_ITEM)PageLookupTable; - ULONG Index; + PFN_NUMBER Index; StartPage -= MmLowestPhysicalPage; for (Index=StartPage; Index<(StartPage+PageCount); Index++) @@ -402,11 +402,11 @@ } } -ULONG MmCountFreePagesInLookupTable(PVOID PageLookupTable, ULONG TotalPageCount) +PFN_NUMBER MmCountFreePagesInLookupTable(PVOID PageLookupTable, PFN_NUMBER TotalPageCount) { PPAGE_LOOKUP_TABLE_ITEM RealPageLookupTable = (PPAGE_LOOKUP_TABLE_ITEM)PageLookupTable; - ULONG Index; - ULONG FreePageCount; + PFN_NUMBER Index; + PFN_NUMBER FreePageCount; FreePageCount = 0; for (Index=0; Index<TotalPageCount; Index++) @@ -420,11 +420,11 @@ return FreePageCount; } -ULONG MmFindAvailablePages(PVOID PageLookupTable, ULONG TotalPageCount, ULONG PagesNeeded, BOOLEAN FromEnd) +PFN_NUMBER MmFindAvailablePages(PVOID PageLookupTable, PFN_NUMBER TotalPageCount, PFN_NUMBER PagesNeeded, BOOLEAN FromEnd) { PPAGE_LOOKUP_TABLE_ITEM RealPageLookupTable = (PPAGE_LOOKUP_TABLE_ITEM)PageLookupTable; - ULONG AvailablePagesSoFar; - ULONG Index; + PFN_NUMBER AvailablePagesSoFar; + PFN_NUMBER Index; if (LastFreePageHint > TotalPageCount) { @@ -479,11 +479,11 @@ return 0; } -ULONG MmFindAvailablePagesBeforePage(PVOID PageLookupTable, ULONG TotalPageCount, ULONG PagesNeeded, ULONG LastPage) +PFN_NUMBER MmFindAvailablePagesBeforePage(PVOID PageLookupTable, PFN_NUMBER TotalPageCount, PFN_NUMBER PagesNeeded, PFN_NUMBER LastPage) { PPAGE_LOOKUP_TABLE_ITEM RealPageLookupTable = (PPAGE_LOOKUP_TABLE_ITEM)PageLookupTable; - ULONG AvailablePagesSoFar; - ULONG Index; + PFN_NUMBER AvailablePagesSoFar; + PFN_NUMBER Index; if (LastPage > TotalPageCount) { @@ -512,10 +512,10 @@ return 0; } -VOID MmUpdateLastFreePageHint(PVOID PageLookupTable, ULONG TotalPageCount) +VOID MmUpdateLastFreePageHint(PVOID PageLookupTable, PFN_NUMBER TotalPageCount) { PPAGE_LOOKUP_TABLE_ITEM RealPageLookupTable = (PPAGE_LOOKUP_TABLE_ITEM)PageLookupTable; - ULONG Index; + PFN_NUMBER Index; for (Index=TotalPageCount-1; Index>0; Index--) { @@ -527,11 +527,11 @@ } } -BOOLEAN MmAreMemoryPagesAvailable(PVOID PageLookupTable, ULONG TotalPageCount, PVOID PageAddress, ULONG PageCount) +BOOLEAN MmAreMemoryPagesAvailable(PVOID PageLookupTable, PFN_NUMBER TotalPageCount, PVOID PageAddress, PFN_NUMBER PageCount) { PPAGE_LOOKUP_TABLE_ITEM RealPageLookupTable = (PPAGE_LOOKUP_TABLE_ITEM)PageLookupTable; - ULONG StartPage; - ULONG Index; + PFN_NUMBER StartPage; + PFN_NUMBER Index; StartPage = MmGetPageNumberFromAddress(PageAddress); Modified: trunk/reactos/boot/freeldr/freeldr/mm/mm.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/mm/mm…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/mm/mm.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/mm/mm.c [iso-8859-1] Fri Feb 10 19:10:17 2012 @@ -27,12 +27,12 @@ DBG_DEFAULT_CHANNEL(MEMORY); -ULONG LoaderPagesSpanned = 0; - -PVOID MmAllocateMemoryWithType(ULONG MemorySize, TYPE_OF_MEMORY MemoryType) -{ - ULONG PagesNeeded; - ULONG FirstFreePageFromEnd; +PFN_NUMBER LoaderPagesSpanned = 0; + +PVOID MmAllocateMemoryWithType(SIZE_T MemorySize, TYPE_OF_MEMORY MemoryType) +{ + PFN_NUMBER PagesNeeded; + PFN_NUMBER FirstFreePageFromEnd; PVOID MemPointer; if (MemorySize == 0) @@ -83,10 +83,10 @@ return MemPointer; } -PVOID MmAllocateMemoryAtAddress(ULONG MemorySize, PVOID DesiredAddress, TYPE_OF_MEMORY MemoryType) -{ - ULONG PagesNeeded; - ULONG StartPageNumber; +PVOID MmAllocateMemoryAtAddress(SIZE_T MemorySize, PVOID DesiredAddress, TYPE_OF_MEMORY MemoryType) +{ + PFN_NUMBER PagesNeeded; + PFN_NUMBER StartPageNumber; PVOID MemPointer; if (MemorySize == 0) @@ -142,10 +142,10 @@ return MemPointer; } -VOID MmSetMemoryType(PVOID MemoryAddress, ULONG MemorySize, TYPE_OF_MEMORY NewType) -{ - ULONG PagesNeeded; - ULONG StartPageNumber; +VOID MmSetMemoryType(PVOID MemoryAddress, SIZE_T MemorySize, TYPE_OF_MEMORY NewType) +{ + PFN_NUMBER PagesNeeded; + PFN_NUMBER StartPageNumber; // Find out how many blocks it will take to // satisfy this allocation @@ -158,11 +158,11 @@ MmAllocatePagesInLookupTable(PageLookupTableAddress, StartPageNumber, PagesNeeded, NewType); } -PVOID MmAllocateHighestMemoryBelowAddress(ULONG MemorySize, PVOID DesiredAddress, TYPE_OF_MEMORY MemoryType) -{ - ULONG PagesNeeded; - ULONG FirstFreePageFromEnd; - ULONG DesiredAddressPageNumber; +PVOID MmAllocateHighestMemoryBelowAddress(SIZE_T MemorySize, PVOID DesiredAddress, TYPE_OF_MEMORY MemoryType) +{ + PFN_NUMBER PagesNeeded; + PFN_NUMBER FirstFreePageFromEnd; + PFN_NUMBER DesiredAddressPageNumber; PVOID MemPointer; if (MemorySize == 0) @@ -221,7 +221,7 @@ VOID DumpMemoryAllocMap(VOID) { - ULONG Idx; + PFN_NUMBER Idx; PPAGE_LOOKUP_TABLE_ITEM RealPageLookupTable = (PPAGE_LOOKUP_TABLE_ITEM)PageLookupTableAddress; DbgPrint("----------- Memory Allocation Bitmap -----------\n"); @@ -295,7 +295,7 @@ } #endif // DBG -PPAGE_LOOKUP_TABLE_ITEM MmGetMemoryMap(ULONG *NoEntries) +PPAGE_LOOKUP_TABLE_ITEM MmGetMemoryMap(PFN_NUMBER *NoEntries) { PPAGE_LOOKUP_TABLE_ITEM RealPageLookupTable = (PPAGE_LOOKUP_TABLE_ITEM)PageLookupTableAddress; Modified: trunk/reactos/boot/freeldr/freeldr/reactos/archwsup.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/react…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/reactos/archwsup.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/reactos/archwsup.c [iso-8859-1] Fri Feb 10 19:10:17 2012 @@ -15,7 +15,7 @@ /* GLOBALS ********************************************************************/ extern CHAR reactos_arc_hardware_data[]; -ULONG FldrpHwHeapLocation; +SIZE_T FldrpHwHeapLocation; PCONFIGURATION_COMPONENT_DATA FldrArcHwTreeRoot; BOOLEAN UseRealHeap = FALSE; @@ -30,7 +30,7 @@ PVOID NTAPI -FldrpHwHeapAlloc(IN ULONG Size) +FldrpHwHeapAlloc(IN SIZE_T Size) { PVOID Buffer; @@ -62,7 +62,7 @@ FldrSetIdentifier(IN PCONFIGURATION_COMPONENT_DATA ComponentData, IN PCHAR IdentifierString) { - ULONG IdentifierLength; + SIZE_T IdentifierLength; PCONFIGURATION_COMPONENT Component = &ComponentData->ComponentEntry; PCHAR Identifier; @@ -75,7 +75,7 @@ RtlCopyMemory(Identifier, IdentifierString, IdentifierLength); /* Set component information */ - Component->IdentifierLength = IdentifierLength; + Component->IdentifierLength = (ULONG)IdentifierLength; Component->Identifier = Identifier; } Modified: trunk/reactos/boot/freeldr/freeldr/reactos/registry.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/react…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/reactos/registry.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/reactos/registry.c [iso-8859-1] Fri Feb 10 19:10:17 2012 @@ -174,8 +174,8 @@ FRLDRHKEY NewKey; PWCHAR p; PCWSTR name; - int subkeyLength; - int stringLength; + SIZE_T subkeyLength; + SIZE_T stringLength; ULONG NameSize; int CmpResult; @@ -220,7 +220,7 @@ stringLength = subkeyLength; name = KeyName; } - NameSize = (subkeyLength + 1) * sizeof(WCHAR); + NameSize = (ULONG)((subkeyLength + 1) * sizeof(WCHAR)); Ptr = CurrentKey->SubKeyList.Flink; CmpResult = 1; @@ -345,8 +345,8 @@ FRLDRHKEY CurrentKey; PWCHAR p; PCWSTR name; - int subkeyLength; - int stringLength; + SIZE_T subkeyLength; + SIZE_T stringLength; ULONG NameSize; TRACE("KeyName '%S'\n", KeyName); @@ -391,7 +391,7 @@ stringLength = subkeyLength; name = KeyName; } - NameSize = (subkeyLength + 1) * sizeof(WCHAR); + NameSize = (ULONG)((subkeyLength + 1) * sizeof(WCHAR)); Ptr = CurrentKey->SubKeyList.Flink; while (Ptr != &CurrentKey->SubKeyList) @@ -495,7 +495,7 @@ InsertTailList(&Key->ValueList, &Value->ValueList); Key->ValueCount++; - Value->NameSize = (wcslen(ValueName)+1) * sizeof(WCHAR); + Value->NameSize = (ULONG)(wcslen(ValueName)+1) * sizeof(WCHAR); Value->Name = MmHeapAlloc(Value->NameSize); if (Value->Name == NULL) return ERROR_OUTOFMEMORY; wcscpy(Value->Name, ValueName); Modified: trunk/reactos/boot/freeldr/freeldr/ui/tui.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/ui/tu…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/ui/tui.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/ui/tui.c [iso-8859-1] Fri Feb 10 19:10:17 2012 @@ -128,7 +128,7 @@ // // Draw title text // - TuiDrawText( (UiScreenWidth / 2) - (strlen(UiTitleBoxTitleText) / 2), + TuiDrawText( (UiScreenWidth / 2) - ((ULONG)strlen(UiTitleBoxTitleText) / 2), 2, UiTitleBoxTitleText, ATTR(UiTitleBoxFgColor, UiTitleBoxBgColor)); @@ -332,12 +332,12 @@ VOID TuiDrawCenteredText(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, PCSTR TextString, UCHAR Attr) { - ULONG TextLength; + SIZE_T TextLength; ULONG BoxWidth; ULONG BoxHeight; ULONG LineBreakCount; - ULONG Index; - ULONG LastIndex; + SIZE_T Index; + SIZE_T LastIndex; ULONG RealLeft; ULONG RealTop; ULONG X; @@ -361,7 +361,7 @@ { if ((Index - LastIndex) > BoxWidth) { - BoxWidth = (Index - LastIndex); + BoxWidth = (ULONG)(Index - LastIndex); } } } @@ -381,7 +381,7 @@ } else { - X = RealLeft + LastIndex; + X = (ULONG)(RealLeft + LastIndex); Y = RealTop; LastIndex++; Temp[0] = TextString[Index]; @@ -393,14 +393,14 @@ VOID TuiDrawStatusText(PCSTR StatusText) { - ULONG i; + SIZE_T i; TuiDrawText(0, UiScreenHeight-1, " ", ATTR(UiStatusBarFgColor, UiStatusBarBgColor)); TuiDrawText(1, UiScreenHeight-1, StatusText, ATTR(UiStatusBarFgColor, UiStatusBarBgColor)); for (i=strlen(StatusText)+1; i<UiScreenWidth; i++) { - TuiDrawText(i, UiScreenHeight-1, " ", ATTR(UiStatusBarFgColor, UiStatusBarBgColor)); + TuiDrawText((ULONG)i, UiScreenHeight-1, " ", ATTR(UiStatusBarFgColor, UiStatusBarBgColor)); } VideoCopyOffScreenBufferToVRAM(); @@ -459,7 +459,7 @@ strcat(DateString, TempString); // Draw the date - TuiDrawText(UiScreenWidth-strlen(DateString)-2, 1, DateString, ATTR(UiTitleBoxFgColor, UiTitleBoxBgColor)); + TuiDrawText(UiScreenWidth-(ULONG)strlen(DateString)-2, 1, DateString, ATTR(UiTitleBoxFgColor, UiTitleBoxBgColor)); // Get the hour and change from 24-hour mode to 12-hour if (TimeInfo->Hour > 12) @@ -498,7 +498,7 @@ } // Draw the time - TuiDrawText(UiScreenWidth-strlen(TimeString)-2, 2, TimeString, ATTR(UiTitleBoxFgColor, UiTitleBoxBgColor)); + TuiDrawText(UiScreenWidth-(ULONG)strlen(TimeString)-2, 2, TimeString, ATTR(UiTitleBoxFgColor, UiTitleBoxBgColor)); } VOID TuiSaveScreen(PUCHAR Buffer) Modified: trunk/reactos/boot/freeldr/freeldr/ui/tuimenu.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/ui/tu…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/ui/tuimenu.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/ui/tuimenu.c [iso-8859-1] Fri Feb 10 19:10:17 2012 @@ -151,7 +151,7 @@ // // Get the string length and make it become the new width if necessary // - Length = strlen(MenuInfo->MenuItemList[i]); + Length = (ULONG)strlen(MenuInfo->MenuItemList[i]); if (Length > Width) Width = Length; } @@ -248,7 +248,7 @@ // Copy the integral time text string, and remove the last 2 chars // strcpy(TempString, UiTimeText); - i = strlen(TempString); + i = (ULONG)strlen(TempString); TempString[i - 2] = 0; // @@ -271,7 +271,7 @@ // // Display it in the center of the menu // - UiDrawText(MenuInfo->Right - strlen(MenuLineText) - 1, + UiDrawText(MenuInfo->Right - (ULONG)strlen(MenuLineText) - 1, MenuInfo->Bottom, MenuLineText, ATTR(UiMenuFgColor, UiMenuBgColor)); @@ -303,7 +303,7 @@ // if (UiCenterMenu) { - UiDrawText(MenuInfo->Right - strlen(MenuLineText) - 1, + UiDrawText(MenuInfo->Right - (ULONG)strlen(MenuLineText) - 1, MenuInfo->Bottom, MenuLineText, ATTR(UiMenuFgColor, UiMenuBgColor)); @@ -364,7 +364,7 @@ // how many spaces will be to the left and right // SpaceTotal = (MenuInfo->Right - MenuInfo->Left - 2) - - strlen(MenuInfo->MenuItemList[MenuItemNumber]); + (ULONG)strlen(MenuInfo->MenuItemList[MenuItemNumber]); SpaceLeft = (SpaceTotal / 2) + 1; SpaceRight = (SpaceTotal - SpaceLeft) + 1; Modified: trunk/reactos/boot/freeldr/freeldr/ui/ui.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/ui/ui…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/ui/ui.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/ui/ui.c [iso-8859-1] Fri Feb 10 19:10:17 2012 @@ -228,7 +228,8 @@ BOOLEAN SetupUiInitialize(VOID) { CHAR DisplayModeText[260]; - ULONG Depth, Length; + ULONG Depth; + SIZE_T Length; DisplayModeText[0] = '\0'; @@ -313,12 +314,12 @@ VOID UiInfoBox(PCSTR MessageText) { - ULONG TextLength; + SIZE_T TextLength; ULONG BoxWidth; ULONG BoxHeight; ULONG LineBreakCount; - ULONG Index; - ULONG LastIndex; + SIZE_T Index; + SIZE_T LastIndex; ULONG Left; ULONG Top; ULONG Right; @@ -341,7 +342,7 @@ { if ((Index - LastIndex) > BoxWidth) { - BoxWidth = (Index - LastIndex); + BoxWidth = (ULONG)(Index - LastIndex); } } } Modified: trunk/reactos/boot/freeldr/freeldr/windows/peloader.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/windo…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/windows/peloader.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/windows/peloader.c [iso-8859-1] Fri Feb 10 19:10:17 2012 @@ -453,7 +453,7 @@ { PWSTR Buffer; UNICODE_STRING UnicodeNamePA; - ULONG i, Length; + SIZE_T i, Length; /* First obvious check: for length of two names */ Length = strlen(DllName); Modified: trunk/reactos/boot/freeldr/freeldr/windows/wlmemory.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/windo…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/windows/wlmemory.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/windows/wlmemory.c [iso-8859-1] Fri Feb 10 19:10:17 2012 @@ -49,8 +49,8 @@ extern PFREELDR_MEMORY_DESCRIPTOR BiosMemoryMap; extern ULONG BiosMemoryMapEntryCount; -extern ULONG MmLowestPhysicalPage; -extern ULONG MmHighestPhysicalPage; +extern PFN_NUMBER MmLowestPhysicalPage; +extern PFN_NUMBER MmHighestPhysicalPage; /* GLOBALS ***************************************************************/ @@ -63,8 +63,8 @@ VOID MempAddMemoryBlock(IN OUT PLOADER_PARAMETER_BLOCK LoaderBlock, - ULONG BasePage, - ULONG PageCount, + PFN_NUMBER BasePage, + PFN_NUMBER PageCount, ULONG Type) { BOOLEAN Status = TRUE; @@ -195,10 +195,10 @@ BOOLEAN WinLdrSetupMemoryLayout(IN OUT PLOADER_PARAMETER_BLOCK LoaderBlock) { - ULONG i, PagesCount, MemoryMapSizeInPages; - ULONG LastPageIndex, LastPageType, MemoryMapStartPage; + PFN_NUMBER i, PagesCount, MemoryMapSizeInPages, NoEntries; + PFN_NUMBER LastPageIndex, MemoryMapStartPage; PPAGE_LOOKUP_TABLE_ITEM MemoryMap; - ULONG NoEntries; + ULONG LastPageType; //PKTSS Tss; //BOOLEAN Status; Modified: trunk/reactos/boot/freeldr/freeldr/windows/wlregistry.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/windo…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/windows/wlregistry.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/windows/wlregistry.c [iso-8859-1] Fri Feb 10 19:10:17 2012 @@ -720,7 +720,7 @@ if (ImagePath && (wcslen(ImagePath) > 0)) { // Just copy ImagePath to the corresponding field in the structure - PathLength = wcslen(ImagePath) * sizeof(WCHAR) + sizeof(UNICODE_NULL); + PathLength = (USHORT)wcslen(ImagePath) * sizeof(WCHAR) + sizeof(UNICODE_NULL); BootDriverEntry->FilePath.Length = 0; BootDriverEntry->FilePath.MaximumLength = PathLength; @@ -743,7 +743,7 @@ else { // we have to construct ImagePath ourselves - PathLength = wcslen(ServiceName)*sizeof(WCHAR) + sizeof(L"system32\\drivers\\.sys"); + PathLength = (USHORT)wcslen(ServiceName)*sizeof(WCHAR) + sizeof(L"system32\\drivers\\.sys"); BootDriverEntry->FilePath.Length = 0; BootDriverEntry->FilePath.MaximumLength = PathLength; BootDriverEntry->FilePath.Buffer = MmHeapAlloc(PathLength); @@ -780,7 +780,7 @@ } // Add registry path - PathLength = (wcslen(RegistryPath) + wcslen(ServiceName))*sizeof(WCHAR) + sizeof(UNICODE_NULL); + PathLength = (USHORT)(wcslen(RegistryPath) + wcslen(ServiceName))*sizeof(WCHAR) + sizeof(UNICODE_NULL); BootDriverEntry->RegistryPath.Length = 0; BootDriverEntry->RegistryPath.MaximumLength = PathLength; BootDriverEntry->RegistryPath.Buffer = MmHeapAlloc(PathLength);
12 years, 10 months
1
0
0
0
[pschweitzer] 55528: [NTOSKRNL] IoCreateSymbolicLink -> IoAssignArcName
by pschweitzer@svn.reactos.org
Author: pschweitzer Date: Fri Feb 10 18:57:55 2012 New Revision: 55528 URL:
http://svn.reactos.org/svn/reactos?rev=55528&view=rev
Log: [NTOSKRNL] IoCreateSymbolicLink -> IoAssignArcName Modified: trunk/reactos/ntoskrnl/io/iomgr/arcname.c Modified: trunk/reactos/ntoskrnl/io/iomgr/arcname.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/iomgr/arcname.…
============================================================================== --- trunk/reactos/ntoskrnl/io/iomgr/arcname.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/io/iomgr/arcname.c [iso-8859-1] Fri Feb 10 18:57:55 2012 @@ -108,7 +108,7 @@ if (NT_SUCCESS(Status)) { /* Map ARC to NT name */ - IoCreateSymbolicLink(&BootDeviceName, &SystemDevice); + IoAssignArcName(&BootDeviceName, &SystemDevice); RtlFreeUnicodeString(&BootDeviceName); /* Now, get loader path name */ @@ -381,7 +381,7 @@ if (NT_SUCCESS(Status)) { /* Create symbolic link */ - IoCreateSymbolicLink(&ArcNameStringW, &DeviceStringW); + IoAssignArcName(&ArcNameStringW, &DeviceStringW); RtlFreeUnicodeString(&ArcNameStringW); DPRINT1("Boot device found\n"); } @@ -724,7 +724,7 @@ } /* Link both */ - IoCreateSymbolicLink(&ArcNameStringW, &DeviceStringW); + IoAssignArcName(&ArcNameStringW, &DeviceStringW); /* And release resources */ RtlFreeUnicodeString(&ArcNameStringW); @@ -781,7 +781,7 @@ } /* Link device name & ARC name */ - IoCreateSymbolicLink(&ArcNameStringW, &DeviceStringW); + IoAssignArcName(&ArcNameStringW, &DeviceStringW); /* Release strings */ RtlFreeUnicodeString(&ArcNameStringW);
12 years, 10 months
1
0
0
0
[tkreuzer] 55527: [RTL] Fix64 bit warnings
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Fri Feb 10 17:36:11 2012 New Revision: 55527 URL:
http://svn.reactos.org/svn/reactos?rev=55527&view=rev
Log: [RTL] Fix64 bit warnings Modified: trunk/reactos/include/ndk/rtlfuncs.h trunk/reactos/lib/rtl/atom.c trunk/reactos/lib/rtl/path.c trunk/reactos/lib/rtl/res.c trunk/reactos/lib/rtl/slist.c trunk/reactos/lib/rtl/time.c trunk/reactos/lib/rtl/unicode.c Modified: trunk/reactos/include/ndk/rtlfuncs.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/rtlfuncs.h?rev…
============================================================================== --- trunk/reactos/include/ndk/rtlfuncs.h [iso-8859-1] (original) +++ trunk/reactos/include/ndk/rtlfuncs.h [iso-8859-1] Fri Feb 10 17:36:11 2012 @@ -2533,8 +2533,8 @@ IN PUNICODE_STRING CallerBuffer, IN OUT PUNICODE_STRING DynamicString OPTIONAL, OUT PUNICODE_STRING* FullNameOut OPTIONAL, - OUT PULONG FilePartSize OPTIONAL, - OUT PULONG LengthNeeded OPTIONAL + OUT PSIZE_T FilePartSize OPTIONAL, + OUT PSIZE_T LengthNeeded OPTIONAL ); NTSYSAPI @@ -2608,7 +2608,7 @@ IN PSIZE_T FilePartSize, OUT PBOOLEAN NameInvalid, OUT RTL_PATH_TYPE* PathType, - OUT PULONG LengthNeeded + OUT PSIZE_T LengthNeeded ); NTSYSAPI Modified: trunk/reactos/lib/rtl/atom.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/atom.c?rev=55527&r…
============================================================================== --- trunk/reactos/lib/rtl/atom.c [iso-8859-1] (original) +++ trunk/reactos/lib/rtl/atom.c [iso-8859-1] Fri Feb 10 17:36:11 2012 @@ -349,7 +349,7 @@ simply add it to the list */ if (HashLink != NULL) { - ULONG AtomNameLen = wcslen(AtomName); + ULONG AtomNameLen = (ULONG)wcslen(AtomName); if (AtomNameLen > RTL_MAXIMUM_ATOM_LENGTH) { Modified: trunk/reactos/lib/rtl/path.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/path.c?rev=55527&r…
============================================================================== --- trunk/reactos/lib/rtl/path.c [iso-8859-1] (original) +++ trunk/reactos/lib/rtl/path.c [iso-8859-1] Fri Feb 10 17:36:11 2012 @@ -138,7 +138,7 @@ ((c == 'l') || (c == 'c') || (c == 'p') || (c == 'a') || (c == 'n'))) { /* Calculate the offset */ - ReturnOffset = (PCHAR)End - (PCHAR)PathCopy.Buffer; + ReturnOffset = (USHORT)((PCHAR)End - (PCHAR)PathCopy.Buffer); /* Build the final string */ PathCopy.Length = OriginalLength - ReturnOffset - (ColonCount * sizeof(WCHAR)); @@ -179,7 +179,7 @@ while ((Start > PathCopy.Buffer) && (Start[-1] == ' ')) --Start; /* Finally see how many characters are left, and that's our size */ - PathChars = Start - PathCopy.Buffer; + PathChars = (USHORT)(Start - PathCopy.Buffer); PathCopy.Length = PathChars * sizeof(WCHAR); /* Check if this is a COM or LPT port, which has a digit after it */ @@ -641,13 +641,13 @@ RtlReleasePebLock(); return Status; } - + /* File is in current directory */ if (RtlEqualUnicodeString(&FullPath, &CurrentDirectory->DosPath, TRUE)) { /* Make relative name string */ RelativeName->RelativeName.Buffer = (PWSTR)((ULONG_PTR)NewBuffer + FullPath.Length - PrefixCut); - RelativeName->RelativeName.Length = PathLength - FullPath.Length; + RelativeName->RelativeName.Length = (USHORT)(PathLength - FullPath.Length); /* If relative name starts with \, skip it */ if (RelativeName->RelativeName.Buffer[0] == L'\\') { @@ -1116,7 +1116,7 @@ CurDirHandle = (HANDLE)((ULONG_PTR)CurDirHandle | RTL_CURDIR_IS_REMOVABLE); } - FullPath.Length = FullPathLength; + FullPath.Length = (USHORT)FullPathLength; /* If full path isn't \ terminated, do it */ if (FullPath.Buffer[CharLength - 1] != L'\\') @@ -1784,7 +1784,7 @@ IN PSIZE_T FilePartSize, OUT PBOOLEAN NameInvalid, OUT RTL_PATH_TYPE* PathType, - OUT PULONG LengthNeeded) + OUT PSIZE_T LengthNeeded) { NTSTATUS Status; PWCHAR StaticBuffer; @@ -1846,7 +1846,7 @@ if ((StaticString) && (Length < StaticLength)) { /* Set the final length */ - StaticString->Length = Length; + StaticString->Length = (USHORT)Length; /* Set the file part size */ if (FilePartSize) *FilePartSize = ShortName ? (ShortName - StaticString->Buffer) : 0; @@ -1878,7 +1878,7 @@ /* Set the settings for the dynamic string the caller sent */ DynamicString->MaximumLength = StaticLength; - DynamicString->Length = Length; + DynamicString->Length = (USHORT)Length; DynamicString->Buffer = StaticBuffer; /* Set the part size */ @@ -1914,7 +1914,7 @@ if ((StaticString) && (Length < StaticLength)) { /* Set the final length */ - StaticString->Length = Length; + StaticString->Length = (USHORT)Length; /* Set the file part size */ if (FilePartSize) *FilePartSize = ShortName ? (ShortName - StaticString->Buffer) : 0; @@ -1946,7 +1946,7 @@ } /* Add space for a NULL terminator, and now check the full path */ - TempDynamicString.MaximumLength = Length + sizeof(UNICODE_NULL); + TempDynamicString.MaximumLength = (USHORT)Length + sizeof(UNICODE_NULL); Length = RtlGetFullPathName_Ustr(FileName, Length, TempDynamicString.Buffer, @@ -1979,7 +1979,7 @@ /* Finalize the string and return it to the user */ DynamicString->Buffer = TempDynamicString.Buffer; - DynamicString->Length = Length; + DynamicString->Length = (USHORT)Length; DynamicString->MaximumLength = TempDynamicString.MaximumLength; if (StringUsed) *StringUsed = DynamicString; @@ -2027,16 +2027,16 @@ IN PUNICODE_STRING CallerBuffer, IN OUT PUNICODE_STRING DynamicString OPTIONAL, OUT PUNICODE_STRING* FullNameOut OPTIONAL, - OUT PULONG FilePartSize OPTIONAL, - OUT PULONG LengthNeeded OPTIONAL) + OUT PSIZE_T FilePartSize OPTIONAL, + OUT PSIZE_T LengthNeeded OPTIONAL) { WCHAR StaticCandidateBuffer[MAX_PATH]; UNICODE_STRING StaticCandidateString; NTSTATUS Status; RTL_PATH_TYPE PathType; PWCHAR p, End, CandidateEnd, SegmentEnd; - ULONG SegmentSize, NamePlusExtLength, PathSize, MaxPathSize = 0, WorstCaseLength, ByteCount; - USHORT ExtensionLength = 0; + SIZE_T SegmentSize, ByteCount, PathSize, MaxPathSize = 0; + USHORT NamePlusExtLength, WorstCaseLength, ExtensionLength = 0; PUNICODE_STRING FullIsolatedPath; DPRINT("DOS Path Search: %lx %wZ %wZ %wZ %wZ %wZ\n", Flags, PathString, FileNameString, ExtensionString, CallerBuffer, DynamicString); @@ -2177,7 +2177,7 @@ /* Use the extension, the file name, and the largest path as the size */ WorstCaseLength = ExtensionLength + FileNameString->Length + - MaxPathSize + + (USHORT)MaxPathSize + sizeof(UNICODE_NULL); if (WorstCaseLength > UNICODE_STRING_MAX_BYTES) { @@ -2292,7 +2292,7 @@ *CandidateEnd = UNICODE_NULL; /* Now set the final length of the string so it becomes valid */ - StaticCandidateString.Length = (CandidateEnd - + StaticCandidateString.Length = (USHORT)(CandidateEnd - StaticCandidateString.Buffer) * sizeof(WCHAR); Modified: trunk/reactos/lib/rtl/res.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/res.c?rev=55527&r1…
============================================================================== --- trunk/reactos/lib/rtl/res.c [iso-8859-1] (original) +++ trunk/reactos/lib/rtl/res.c [iso-8859-1] Fri Feb 10 17:36:11 2012 @@ -133,7 +133,8 @@ { const IMAGE_RESOURCE_DIRECTORY_ENTRY *entry; const IMAGE_RESOURCE_DIR_STRING_U *str; - int min, max, res, pos, namelen; + int min, max, res, pos; + size_t namelen; if (!((ULONG_PTR)name & 0xFFFF0000)) return find_entry_by_id( dir, (ULONG_PTR)name & 0xFFFF, root, want_dir ); entry = (const IMAGE_RESOURCE_DIRECTORY_ENTRY *)(dir + 1); Modified: trunk/reactos/lib/rtl/slist.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/slist.c?rev=55527&…
============================================================================== --- trunk/reactos/lib/rtl/slist.c [iso-8859-1] (original) +++ trunk/reactos/lib/rtl/slist.c [iso-8859-1] Fri Feb 10 17:36:11 2012 @@ -58,13 +58,13 @@ #endif } -WORD +WORD NTAPI RtlQueryDepthSList(IN PSLIST_HEADER ListHead) { #ifdef _WIN64 - return ListHead->Header8.HeaderType ? - ListHead->Header16.Sequence : ListHead->Header8.Sequence; + return ListHead->Header8.HeaderType ? + (WORD)ListHead->Header16.Sequence : (WORD)ListHead->Header8.Sequence; #else return ListHead->Depth; #endif Modified: trunk/reactos/lib/rtl/time.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/time.c?rev=55527&r…
============================================================================== --- trunk/reactos/lib/rtl/time.c [iso-8859-1] (original) +++ trunk/reactos/lib/rtl/time.c [iso-8859-1] Fri Feb 10 17:36:11 2012 @@ -37,7 +37,7 @@ #endif -static const int YearLengths[2] = +static const unsigned int YearLengths[2] = { DAYSPERNORMALYEAR, DAYSPERLEAPYEAR }; Modified: trunk/reactos/lib/rtl/unicode.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/unicode.c?rev=5552…
============================================================================== --- trunk/reactos/lib/rtl/unicode.c [iso-8859-1] (original) +++ trunk/reactos/lib/rtl/unicode.c [iso-8859-1] Fri Feb 10 17:36:11 2012 @@ -2525,8 +2525,7 @@ BOOLEAN Found; const BOOLEAN WantToFind = (Flags & RTL_FIND_CHAR_IN_UNICODE_STRING_COMPLEMENT_CHAR_SET) == 0; const BOOLEAN CaseInSensitive = (Flags & RTL_FIND_CHAR_IN_UNICODE_STRING_CASE_INSENSITIVE) != 0; - INT Length; - INT i; + USHORT i, Length; DPRINT("RtlFindCharInUnicodeString(%u, '%wZ', '%wZ', %p)\n", Flags, SearchString, MatchString, Position);
12 years, 10 months
1
0
0
0
← Newer
1
...
38
39
40
41
42
43
44
...
58
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
Results per page:
10
25
50
100
200