ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
November 2007
----- 2025 -----
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
20 participants
888 discussions
Start a n
N
ew thread
[weiden] 30609: Optimize GetDesktopWindow() to read the information from the shared heap
by weiden@svn.reactos.org
Author: weiden Date: Wed Nov 21 02:15:49 2007 New Revision: 30609 URL:
http://svn.reactos.org/svn/reactos?rev=30609&view=rev
Log: Optimize GetDesktopWindow() to read the information from the shared heap 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 (original) +++ trunk/reactos/dll/win32/user32/windows/window.c Wed Nov 21 02:15:49 2007 @@ -529,7 +529,22 @@ HWND STDCALL GetDesktopWindow(VOID) { - return NtUserGetDesktopWindow(); + PWINDOW Wnd; + HWND Ret = NULL; + + _SEH_TRY + { + Wnd = GetThreadDesktopWnd(); + if (Wnd != NULL) + Ret = UserHMGetHandle(Wnd); + } + _SEH_HANDLE + { + /* Do nothing */ + } + _SEH_END; + + return Ret; } @@ -1096,7 +1111,7 @@ */ BOOL STDCALL GetWindowPlacement(HWND hWnd, - WINDOWPLACEMENT *lpwndpl) + WINDOWPLACEMENT *lpwndpl) { return (BOOL)NtUserGetWindowPlacement(hWnd, lpwndpl); }
17 years, 1 month
1
0
0
0
[fireball] 30608: - Implement a port reset function. - Fix a bug in get_dev_change function.
by fireball@svn.reactos.org
Author: fireball Date: Wed Nov 21 01:45:48 2007 New Revision: 30608 URL:
http://svn.reactos.org/svn/reactos?rev=30608&view=rev
Log: - Implement a port reset function. - Fix a bug in get_dev_change function. Modified: trunk/reactos/drivers/usb/nt4compat/usbdriver/ohci.c Modified: trunk/reactos/drivers/usb/nt4compat/usbdriver/ohci.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/nt4compat/usbd…
============================================================================== --- trunk/reactos/drivers/usb/nt4compat/usbdriver/ohci.c (original) +++ trunk/reactos/drivers/usb/nt4compat/usbdriver/ohci.c Wed Nov 21 01:45:48 2007 @@ -36,6 +36,7 @@ //BOOLEAN NTAPI ohci_isr(PKINTERRUPT interrupt, PVOID context); //BOOLEAN ohci_start(PHCD hcd); VOID ohci_init_hcd_interface(POHCI_DEV ohci); +BOOLEAN ohci_rh_reset_port(PHCD hcd, UCHAR port_idx); // shared with EHCI NTSTATUS ehci_dispatch_irp(IN PDEVICE_OBJECT DeviceObject, IN PIRP irp); @@ -50,6 +51,8 @@ extern USB_DEV_MANAGER g_dev_mgr; +/* wrap-aware logic morphed from <linux/jiffies.h> */ +#define tick_before(t1,t2) ((SHORT)(((SHORT)(t1))-((SHORT)(t2))) < 0) #define OHCI_READ_PORT_ULONG( pul ) ( *pul ) #define OHCI_WRITE_PORT_ULONG( pul, src ) \ @@ -92,6 +95,20 @@ #define OHCI_INTR_INIT \ (OHCI_INTR_MIE | OHCI_INTR_UE | OHCI_INTR_RD | OHCI_INTR_WDH) +/* See usb 7.1.7.5: root hubs must issue at least 50 msec reset signaling, + * not necessarily continuous ... to guard against resume signaling. + * The short timeout is safe for non-root hubs, and is backward-compatible + * with earlier Linux hosts. + */ +#ifdef CONFIG_USB_SUSPEND +#define PORT_RESET_MSEC 50 +#else +#define PORT_RESET_MSEC 10 +#endif + +/* this timer value might be vendor-specific ... */ +#define PORT_RESET_HW_MSEC 10 + VOID ohci_wait_ms(POHCI_DEV ohci, LONG ms) @@ -517,7 +534,7 @@ * (for OHCI integrated on mainboard, it normally is) */ hc_control = OHCI_READ_PORT_ULONG((PULONG)&ohci->regs->control); - DbgPrint("resetting from state %x, control = 0x%x\n", + DbgPrint("OHCI: resetting from state %x, control = 0x%x\n", (hc_control & OHCI_CTRL_HCFS), hc_control); @@ -632,6 +649,14 @@ //ohci_to_hcd(ohci)->state = HC_STATE_RUNNING; + // Debug code follows! + /*(VOID)ohci_rh_reset_port(hcd, 1); + (VOID)ohci_rh_reset_port(hcd, 2); + (VOID)ohci_rh_reset_port(hcd, 3); + (VOID)ohci_rh_reset_port(hcd, 4);*/ + // Debug code ends! + + return TRUE; } @@ -645,6 +670,7 @@ NTSTATUS ohci_submit_urb2(PHCD hcd, PUSB_DEV pdev, PUSB_ENDPOINT pendp, PURB purb) { + DbgPrint("ohci_submit_urb2 caled, but not implemented!\n"); return STATUS_UNSUCCESSFUL; } @@ -695,30 +721,67 @@ return STATUS_INVALID_PARAMETER; ohci = ohci_from_hcd(hcd); + DbgPrint("ohci_cancel_urb2 called, but not implemented!\n"); return STATUS_UNSUCCESSFUL;//ehci_cancel_urb(ehci, pdev, pendp, purb); } VOID ohci_generic_urb_completion(PURB purb, PVOID context) { + DbgPrint("ohci_generic_urb_completion called, but not implemented!\n"); } BOOLEAN ohci_rh_reset_port(PHCD hcd, UCHAR port_idx) { - //ULONG i; POHCI_DEV ohci; - //ULONG status; + ULONG status, temp; + PULONG PortStatus; + USHORT Now, ResetDone; if (hcd == NULL) return FALSE; ohci = ohci_from_hcd(hcd); - //if (port_idx < 1 || port_idx > ohci->num_ports) - // return FALSE; - - //usb_dbg_print(DBGLVL_MAXIMUM, ("ohci_rh_reset_port(): status after written=0x%x\n", status)); + if (port_idx < 1 || port_idx > ohci->num_ports) + return FALSE; + + port_idx--; + + PortStatus = &ohci->regs->roothub.portstatus[port_idx]; + + Now = OHCI_READ_PORT_ULONG((PULONG)&ohci->regs->fmnumber); + ResetDone = Now + PORT_RESET_MSEC; + + /* build a "continuous enough" reset signal, with up to + * 3msec gap between pulses. scheduler HZ==100 must work; + * this might need to be deadline-scheduled. + */ + do { + /* spin until any current reset finishes */ + for (;;) { + temp = OHCI_READ_PORT_ULONG(PortStatus); + if (!(temp & RH_PS_PRS)) + break; + usb_wait_us_dpc(500); + } + + if (!(temp & RH_PS_CCS)) + break; + if (temp & RH_PS_PRSC) + { + OHCI_WRITE_PORT_ULONG(PortStatus, RH_PS_PRSC); + } + + /* start the next reset, sleep till it's probably done */ + OHCI_WRITE_PORT_ULONG(PortStatus, RH_PS_PRS); + usb_wait_ms_dpc(PORT_RESET_HW_MSEC); + Now = OHCI_READ_PORT_ULONG((PULONG)&ohci->regs->fmnumber); + } while (tick_before(Now, ResetDone)); + + status = OHCI_READ_PORT_ULONG((PULONG)(&ohci->regs->roothub.portstatus[port_idx])); + usb_dbg_print(DBGLVL_MAXIMUM, ("ohci_rh_reset_port(): status after written=0x%x\n", status)); return TRUE; } @@ -736,7 +799,7 @@ for(i = 0; i < ohci->num_ports; i++) { - status = OHCI_READ_PORT_ULONG((PULONG)(ohci->regs->roothub.portstatus[i])); + status = OHCI_READ_PORT_ULONG((PULONG)(&ohci->regs->roothub.portstatus[i])); if (status != 0) {
17 years, 1 month
1
0
0
0
[fireball] 30607: - Implement init and start of OHCI controller (interrupts are still disabled, because corresponding code is not implemented). - Implement stubbed HCD interface functions for OHCI. - Add Endpoint Descriptor and Transfer Descriptor structs from Linux.
by fireball@svn.reactos.org
Author: fireball Date: Tue Nov 20 23:50:56 2007 New Revision: 30607 URL:
http://svn.reactos.org/svn/reactos?rev=30607&view=rev
Log: - Implement init and start of OHCI controller (interrupts are still disabled, because corresponding code is not implemented). - Implement stubbed HCD interface functions for OHCI. - Add Endpoint Descriptor and Transfer Descriptor structs from Linux. Modified: trunk/reactos/drivers/usb/nt4compat/usbdriver/ohci.c trunk/reactos/drivers/usb/nt4compat/usbdriver/ohci.h Modified: trunk/reactos/drivers/usb/nt4compat/usbdriver/ohci.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/nt4compat/usbd…
============================================================================== --- trunk/reactos/drivers/usb/nt4compat/usbdriver/ohci.c (original) +++ trunk/reactos/drivers/usb/nt4compat/usbdriver/ohci.c Tue Nov 20 23:50:56 2007 @@ -87,6 +87,12 @@ */ +/* For initializing controller (mask in an HCFS mode too) */ +#define OHCI_CONTROL_INIT OHCI_CTRL_CBSR +#define OHCI_INTR_INIT \ + (OHCI_INTR_MIE | OHCI_INTR_UE | OHCI_INTR_RD | OHCI_INTR_WDH) + + VOID ohci_wait_ms(POHCI_DEV ohci, LONG ms) { @@ -160,6 +166,28 @@ } return NULL; } + +BOOLEAN ohci_mem_init (POHCI_DEVICE_EXTENSION dev_ext) +{ + dev_ext->ohci->td_cache = HalAllocateCommonBuffer(dev_ext->padapter, + sizeof(OHCI_TD), &dev_ext->ohci->td_logic_addr, FALSE); + + if (!dev_ext->ohci->td_cache) + return FALSE; + + dev_ext->ohci->ed_cache = HalAllocateCommonBuffer(dev_ext->padapter, + sizeof(OHCI_ED), &dev_ext->ohci->ed_logic_addr, FALSE); + + if (!dev_ext->ohci->ed_cache) + { + HalFreeCommonBuffer(dev_ext->padapter, sizeof(OHCI_TD), dev_ext->ohci->td_logic_addr, + dev_ext->ohci->td_cache, FALSE); + return FALSE; + } + + return TRUE; +} + PDEVICE_OBJECT ohci_alloc(PDRIVER_OBJECT drvr_obj, PUNICODE_STRING reg_path, ULONG bus_addr, PUSB_DEV_MANAGER dev_mgr) @@ -201,7 +229,9 @@ dev_desc.Dma32BitAddresses = TRUE; dev_desc.BusNumber = bus; dev_desc.InterfaceType = PCIBus; - //dev_desc.MaximumLength = EHCI_MAX_SIZE_TRANSFER; + dev_desc.MaximumLength = EHCI_MAX_SIZE_TRANSFER; + pdev_ext->map_regs = 2; // we do not use it seriously + pdev_ext->padapter = HalGetAdapter(&dev_desc, &pdev_ext->map_regs); DbgPrint("ohci_alloc(): reg_path=0x%x, \n \ ohci_alloc(): bus=0x%x, bus_addr=0x%x \n \ @@ -333,13 +363,20 @@ DbgPrint("OHCI: %d ports\n", pdev_ext->ohci->num_ports); - //ohci->hcca = dma_alloc_coherent (ohci_to_hcd(ohci)->self.controller, - // sizeof *ohci->hcca, &ohci->hcca_dma, 0); - //if (!ohci->hcca) - // return -ENOMEM; - - //if ((ret = ohci_mem_init (ohci)) < 0) - // ohci_stop (ohci_to_hcd(ohci)); + pdev_ext->ohci->hcca = HalAllocateCommonBuffer(pdev_ext->padapter, + sizeof(*pdev_ext->ohci->hcca), &pdev_ext->ohci->hcca_logic_addr, FALSE); + + if (!pdev_ext->ohci->hcca) + { + DbgPrint("OHCI: HCCA allocation failed!\n"); + return NULL; + } + + if (!ohci_mem_init(pdev_ext)) + { + DbgPrint("OHCI: Mem init failed!\n"); + return NULL; + } #if 0 //init ehci_caps @@ -464,72 +501,137 @@ BOOLEAN ohci_start(PHCD hcd) { - //ULONG tmp; + ULONG temp, mask; //PBYTE base; //PEHCI_USBCMD_CONTENT usbcmd; - //POHCI_DEV ohci; + POHCI_DEV ohci; + ULONG hc_control; if (hcd == NULL) return FALSE; - return TRUE; + ohci = struct_ptr(hcd, OHCI_DEV, hcd_interf); + + /* Reset USB nearly "by the book". RemoteWakeupConnected + * saved if boot firmware (BIOS/SMM/...) told us it's connected + * (for OHCI integrated on mainboard, it normally is) + */ + hc_control = OHCI_READ_PORT_ULONG((PULONG)&ohci->regs->control); + DbgPrint("resetting from state %x, control = 0x%x\n", + (hc_control & OHCI_CTRL_HCFS), + hc_control); + + //if (hc_control & OHCI_CTRL_RWC + // && !(ohci->flags & OHCI_QUIRK_AMD756)) + // ohci_to_hcd(ohci)->can_wakeup = 1; + + switch (hc_control & OHCI_CTRL_HCFS) { + case OHCI_USB_OPER: + temp = 0; + break; + case OHCI_USB_SUSPEND: + case OHCI_USB_RESUME: + hc_control &= OHCI_CTRL_RWC; + hc_control |= OHCI_USB_RESUME; + temp = 10 /* msec wait */; + break; + // case OHCI_USB_RESET: + default: + hc_control &= OHCI_CTRL_RWC; + hc_control |= OHCI_USB_RESET; + temp = 50 /* msec wait */; + break; + } + OHCI_WRITE_PORT_ULONG((PULONG)&ohci->regs->control, hc_control); + + // flush the writes + (VOID)OHCI_READ_PORT_ULONG((PULONG)&ohci->regs->control); + + ohci_wait_ms(ohci, temp); + temp = roothub_a (ohci); + if (!(temp & RH_A_NPS)) { + /* power down each port */ + for (temp = 0; temp < ohci->num_ports; temp++) + { + OHCI_WRITE_PORT_ULONG((PULONG)&ohci->regs->roothub.portstatus [temp], RH_PS_LSDA); + } + } + // flush those writes + (VOID)OHCI_READ_PORT_ULONG((PULONG)&ohci->regs->control); + RtlZeroMemory(ohci->hcca, sizeof(OHCI_HCCA)); + + /* 2msec timelimit here means no irqs/preempt */ + //spin_lock_irq (&ohci->lock); + +//retry: + /* HC Reset requires max 10 us delay */ + OHCI_WRITE_PORT_ULONG((PULONG)&ohci->regs->cmdstatus, OHCI_HCR); + temp = 30; /* ... allow extra time */ + while ((OHCI_READ_PORT_ULONG ((PULONG)&ohci->regs->cmdstatus) & OHCI_HCR) != 0) { + if (--temp == 0) { + //spin_unlock_irq (&ohci->lock); + //ohci_err (ohci, "USB HC reset timed out!\n"); + DbgPrint("OHCI: USB HC reset timed out!\n"); + return FALSE; + } + KeStallExecutionProcessor(1); + } + + /* now we're in the SUSPEND state ... must go OPERATIONAL + * within 2msec else HC enters RESUME + * + * ... but some hardware won't init fmInterval "by the book" + * (SiS, OPTi ...), so reset again instead. SiS doesn't need + * this if we write fmInterval after we're OPERATIONAL. + * Unclear about ALi, ServerWorks, and others ... this could + * easily be a longstanding bug in chip init on Linux. + */ #if 0 - ehci = struct_ptr(hcd, EHCI_DEV, hcd_interf); - base = ehci->port_base; - - // stop the controller - tmp = EHCI_READ_PORT_ULONG((PULONG) (base + EHCI_USBCMD)); - usbcmd = (PEHCI_USBCMD_CONTENT) & tmp; - usbcmd->run_stop = 0; - EHCI_WRITE_PORT_ULONG((PULONG) (base + EHCI_USBCMD), tmp); - - // wait the controller stop( ehci spec, 16 microframe ) - usb_wait_ms_dpc(2); - - // reset the controller - usbcmd = (PEHCI_USBCMD_CONTENT) & tmp; - usbcmd->hcreset = TRUE; - EHCI_WRITE_PORT_ULONG((PULONG) (base + EHCI_USBCMD), tmp); - - for(;;) - { - // interval.QuadPart = -100 * 10000; // 10 ms - // KeDelayExecutionThread( KernelMode, FALSE, &interval ); - KeStallExecutionProcessor(10); - tmp = EHCI_READ_PORT_ULONG((PULONG) (base + EHCI_USBCMD)); - if (!usbcmd->hcreset) - break; - } - - // prepare the registers - EHCI_WRITE_PORT_ULONG((PULONG) (base + EHCI_CTRLDSSEGMENT), 0); - - // turn on all the int - EHCI_WRITE_PORT_ULONG((PULONG) (base + EHCI_USBINTR), - EHCI_USBINTR_INTE | EHCI_USBINTR_ERR | EHCI_USBINTR_ASYNC | EHCI_USBINTR_HSERR - // EHCI_USBINTR_FLROVR | \ // it is noisy - // EHCI_USBINTR_PC // we detect it by polling - ); - // write the list base reg - EHCI_WRITE_PORT_ULONG((PULONG) (base + EHCI_PERIODICLISTBASE), ehci->frame_list_phys_addr.LowPart); - - EHCI_WRITE_PORT_ULONG((PULONG) (base + EHCI_ASYNCLISTBASE), ehci->skel_async_qh->phys_addr & ~(0x1f)); - - usbcmd->int_threshold = 1; - EHCI_WRITE_PORT_ULONG((PULONG) (base + EHCI_USBCMD), tmp); - - // let's rock - usbcmd->run_stop = 1; - EHCI_WRITE_PORT_ULONG((PULONG) (base + EHCI_USBCMD), tmp); - - // set the configuration flag - EHCI_WRITE_PORT_ULONG((PULONG) (base + EHCI_CONFIGFLAG), 1); - - // enable the list traversaling - usbcmd->async_enable = 1; - usbcmd->periodic_enable = 1; - EHCI_WRITE_PORT_ULONG((PULONG) (base + EHCI_USBCMD), tmp); + if (ohci->flags & OHCI_QUIRK_INITRESET) { + ohci_writel (ohci, ohci->hc_control, &ohci->regs->control); + // flush those writes + (void) ohci_readl (ohci, &ohci->regs->control); + } #endif + /* Tell the controller where the control and bulk lists are + * The lists are empty now. */ + OHCI_WRITE_PORT_ULONG((PULONG)&ohci->regs->ed_controlhead, 0); + OHCI_WRITE_PORT_ULONG((PULONG)&ohci->regs->ed_bulkhead, 0); + + /* a reset clears this */ + OHCI_WRITE_PORT_ULONG((PULONG)&ohci->regs->hcca, (ULONG)ohci->hcca_logic_addr.LowPart); + + //periodic_reinit (ohci); + + /* start controller operations */ + hc_control &= OHCI_CTRL_RWC; + hc_control |= OHCI_CONTROL_INIT | OHCI_USB_OPER; + OHCI_WRITE_PORT_ULONG((PULONG)&ohci->regs->control, hc_control); + //ohci_to_hcd(ohci)->state = HC_STATE_RUNNING; + + /* wake on ConnectStatusChange, matching external hubs */ + OHCI_WRITE_PORT_ULONG((PULONG)&ohci->regs->roothub.status, RH_HS_DRWE); + + /* Choose the interrupts we care about now, others later on demand */ + mask = OHCI_INTR_INIT; + //OHCI_WRITE_PORT_ULONG((PULONG)&ohci->regs->intrstatus, mask); + //OHCI_WRITE_PORT_ULONG((PULONG)&ohci->regs->intrenable, mask); + + /* handle root hub init quirks ... */ + temp = roothub_a(ohci); + temp &= ~(RH_A_PSM | RH_A_OCPM); + OHCI_WRITE_PORT_ULONG((PULONG)&ohci->regs->roothub.status, RH_HS_LPSC); + OHCI_WRITE_PORT_ULONG((PULONG)&ohci->regs->roothub.b, (temp & RH_A_NPS) ? 0 : RH_B_PPCM); + // flush those writes + (VOID)OHCI_READ_PORT_ULONG((PULONG)&ohci->regs->control); + + //spin_unlock_irq (&ohci->lock); + + // POTPGT delay is bits 24-31, in 2 ms units. + ohci_wait_ms(ohci, (temp >> 23) & 0x1fe); + //ohci_to_hcd(ohci)->state = HC_STATE_RUNNING; + + return TRUE; } @@ -607,20 +709,48 @@ //ULONG i; POHCI_DEV ohci; //ULONG status; - //UCHAR port_count; if (hcd == NULL) return FALSE; ohci = ohci_from_hcd(hcd); - //port_count = (UCHAR) ((PEHCI_HCS_CONTENT) & ehci->ehci_caps.hcs_params)->port_count; - - //if (port_idx < 1 || port_idx > port_count) - // return FALSE; + + //if (port_idx < 1 || port_idx > ohci->num_ports) + // return FALSE; //usb_dbg_print(DBGLVL_MAXIMUM, ("ohci_rh_reset_port(): status after written=0x%x\n", status)); return TRUE; } + +BOOLEAN +ohci_rh_get_dev_change(PHCD hcd, PBYTE buf) //must have the rh dev_lock acquired +{ + POHCI_DEV ohci; + LONG i; + ULONG status; + + if (hcd == NULL) + return FALSE; + + ohci = ohci_from_hcd(hcd); + + for(i = 0; i < ohci->num_ports; i++) + { + status = OHCI_READ_PORT_ULONG((PULONG)(ohci->regs->roothub.portstatus[i])); + + if (status != 0) + { + ohci_dbg_print(DBGLVL_MAXIMUM, ("ohci_rh_get_dev_change(): erh port%d status=0x%x\n", i, status)); + } + + if (status & (RH_PS_PESC | RH_PS_CSC | RH_PS_OCIC)) + { + buf[(i + 1) >> 3] |= (1 << ((i + 1) & 7)); + } + } + return TRUE; +} + NTSTATUS ohci_hcd_dispatch(PHCD hcd, LONG disp_code, PVOID param) @@ -630,24 +760,24 @@ if (hcd == NULL) return STATUS_INVALID_PARAMETER; ohci = ohci_from_hcd(hcd); -#if 0 + switch (disp_code) { case HCD_DISP_READ_PORT_COUNT: { if (param == NULL) return STATUS_INVALID_PARAMETER; - *((PUCHAR) param) = (UCHAR) HCS_N_PORTS(ehci->ehci_caps.hcs_params); + *((PUCHAR) param) = ohci->num_ports; return STATUS_SUCCESS; } case HCD_DISP_READ_RH_DEV_CHANGE: { - if (ehci_rh_get_dev_change(hcd, param) == FALSE) + if (ohci_rh_get_dev_change(hcd, param) == FALSE) return STATUS_INVALID_PARAMETER; return STATUS_SUCCESS; } } -#endif + return STATUS_NOT_IMPLEMENTED; } Modified: trunk/reactos/drivers/usb/nt4compat/usbdriver/ohci.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/nt4compat/usbd…
============================================================================== --- trunk/reactos/drivers/usb/nt4compat/usbdriver/ohci.h (original) +++ trunk/reactos/drivers/usb/nt4compat/usbdriver/ohci.h Tue Nov 20 23:50:56 2007 @@ -115,6 +115,146 @@ #define RH_A_POTPGT (0xff << 24) /* power on to power good time */ /* + * OHCI Endpoint Descriptor (ED) ... holds TD queue + * See OHCI spec, section 4.2 + * + * This is a "Queue Head" for those transfers, which is why + * both EHCI and UHCI call similar structures a "QH". + */ +typedef struct _OHCI_ED { + /* first fields are hardware-specified */ + ULONG hwINFO; /* endpoint config bitmap */ + /* info bits defined by hcd */ +#define ED_DEQUEUE (1 << 27) + /* info bits defined by the hardware */ +#define ED_ISO (1 << 15) +#define ED_SKIP (1 << 14) +#define ED_LOWSPEED (1 << 13) +#define ED_OUT (0x01 << 11) +#define ED_IN (0x02 << 11) + ULONG hwTailP; /* tail of TD list */ + ULONG hwHeadP; /* head of TD list (hc r/w) */ +#define ED_C (0x02) /* toggle carry */ +#define ED_H (0x01) /* halted */ + ULONG hwNextED; /* next ED in list */ + + /* rest are purely for the driver's use */ +#if 0 + dma_addr_t dma; /* addr of ED */ + struct _OHCI_TD *dummy; /* next TD to activate */ + + /* host's view of schedule */ + struct _OHCI_ED *ed_next; /* on schedule or rm_list */ + struct _OHCI_ED *ed_prev; /* for non-interrupt EDs */ + struct list_head td_list; /* "shadow list" of our TDs */ + + /* create --> IDLE --> OPER --> ... --> IDLE --> destroy + * usually: OPER --> UNLINK --> (IDLE | OPER) --> ... + */ + UCHAR state; /* ED_{IDLE,UNLINK,OPER} */ +#define ED_IDLE 0x00 /* NOT linked to HC */ +#define ED_UNLINK 0x01 /* being unlinked from hc */ +#define ED_OPER 0x02 /* IS linked to hc */ + + UCHAR type; /* PIPE_{BULK,...} */ + + /* periodic scheduling params (for intr and iso) */ + UCHAR branch; + USHORT interval; + USHORT load; + USHORT last_iso; /* iso only */ + + /* HC may see EDs on rm_list until next frame (frame_no == tick) */ + USHORT tick; +#endif +} OHCI_ED, *POHCI_ED; + +#define ED_MASK ((u32)~0x0f) /* strip hw status in low addr bits */ + + +/* + * OHCI Transfer Descriptor (TD) ... one per transfer segment + * See OHCI spec, sections 4.3.1 (general = control/bulk/interrupt) + * and 4.3.2 (iso) + */ +typedef struct _OHCI_TD { + /* first fields are hardware-specified */ + ULONG hwINFO; /* transfer info bitmask */ + + /* hwINFO bits for both general and iso tds: */ +#define TD_CC 0xf0000000 /* condition code */ +#define TD_CC_GET(td_p) ((td_p >>28) & 0x0f) +//#define TD_CC_SET(td_p, cc) (td_p) = ((td_p) & 0x0fffffff) | (((cc) & 0x0f) << 28) +#define TD_DI 0x00E00000 /* frames before interrupt */ +#define TD_DI_SET(X) (((X) & 0x07)<< 21) + /* these two bits are available for definition/use by HCDs in both + * general and iso tds ... others are available for only one type + */ +#define TD_DONE 0x00020000 /* retired to donelist */ +#define TD_ISO 0x00010000 /* copy of ED_ISO */ + + /* hwINFO bits for general tds: */ +#define TD_EC 0x0C000000 /* error count */ +#define TD_T 0x03000000 /* data toggle state */ +#define TD_T_DATA0 0x02000000 /* DATA0 */ +#define TD_T_DATA1 0x03000000 /* DATA1 */ +#define TD_T_TOGGLE 0x00000000 /* uses ED_C */ +#define TD_DP 0x00180000 /* direction/pid */ +#define TD_DP_SETUP 0x00000000 /* SETUP pid */ +#define TD_DP_IN 0x00100000 /* IN pid */ +#define TD_DP_OUT 0x00080000 /* OUT pid */ + /* 0x00180000 rsvd */ +#define TD_R 0x00040000 /* round: short packets OK? */ + + /* (no hwINFO #defines yet for iso tds) */ + + ULONG hwCBP; /* Current Buffer Pointer (or 0) */ + ULONG hwNextTD; /* Next TD Pointer */ + ULONG hwBE; /* Memory Buffer End Pointer */ + + /* PSW is only for ISO. Only 1 PSW entry is used, but on + * big-endian PPC hardware that's the second entry. + */ +#define MAXPSW 2 + USHORT hwPSW [MAXPSW]; + + /* rest are purely for the driver's use */ +#if 0 + UCHAR index; + struct ed *ed; + struct td *td_hash; /* dma-->td hashtable */ + struct td *next_dl_td; + struct urb *urb; + + dma_addr_t td_dma; /* addr of this TD */ + dma_addr_t data_dma; /* addr of data it points to */ + + struct list_head td_list; /* "shadow list", TDs on same ED */ +#endif +} OHCI_TD, *POHCI_TD; + +/* + * The HCCA (Host Controller Communications Area) is a 256 byte + * structure defined section 4.4.1 of the OHCI spec. The HC is + * told the base address of it. It must be 256-byte aligned. + */ +typedef struct _OHCI_HCCA +{ +#define NUM_INTS 32 + ULONG int_table [NUM_INTS]; /* periodic schedule */ + + /* + * OHCI defines u16 frame_no, followed by u16 zero pad. + * Since some processors can't do 16 bit bus accesses, + * portable access must be a 32 bits wide. + */ + ULONG frame_no; /* current frame number */ + ULONG done_head; /* info returned for an interrupt */ + UCHAR reserved_for_hc [116]; + UCHAR what [4]; /* spec only identifies 252 bytes :) */ +} OHCI_HCCA, *POHCI_HCCA; + +/* * This is the structure of the OHCI controller's memory mapped I/O region. * You must use readl() and writel() (in <asm/io.h>) to access these fields!! * Layout is in section 7 (and appendix B) of the spec. @@ -165,6 +305,13 @@ BOOLEAN port_mapped; PBYTE port_base; // note: added by ehci_caps.length, operational regs base addr, not the actural base struct _OHCI_REGS *regs; + struct _OHCI_HCCA *hcca; + PVOID td_cache; + PVOID ed_cache; + + PHYSICAL_ADDRESS hcca_logic_addr; + PHYSICAL_ADDRESS td_logic_addr; + PHYSICAL_ADDRESS ed_logic_addr; USHORT num_ports;
17 years, 1 month
1
0
0
0
[cwittich] 30606: SetupDiGetDeviceInstanceId returns size in characters not in bytes
by cwittich@svn.reactos.org
Author: cwittich Date: Tue Nov 20 23:44:24 2007 New Revision: 30606 URL:
http://svn.reactos.org/svn/reactos?rev=30606&view=rev
Log: SetupDiGetDeviceInstanceId returns size in characters not in bytes Modified: trunk/reactos/dll/win32/newdev/newdev.c trunk/reactos/dll/win32/newdev/wizard.c Modified: trunk/reactos/dll/win32/newdev/newdev.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/newdev/newdev.c?…
============================================================================== --- trunk/reactos/dll/win32/newdev/newdev.c (original) +++ trunk/reactos/dll/win32/newdev/newdev.c Tue Nov 20 23:44:24 2007 @@ -150,7 +150,7 @@ TRACE("SetupDiGetDeviceInstanceIdW() failed with error 0x%x\n", GetLastError()); goto cleanup; } - else if ((Buffer = HeapAlloc(GetProcessHeap(), 0, BufferSize)) == NULL) + else if ((Buffer = HeapAlloc(GetProcessHeap(), 0, BufferSize * sizeof(WCHAR))) == NULL) { TRACE("HeapAlloc() failed\n", GetLastError()); SetLastError(ERROR_NOT_ENOUGH_MEMORY); Modified: trunk/reactos/dll/win32/newdev/wizard.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/newdev/wizard.c?…
============================================================================== --- trunk/reactos/dll/win32/newdev/wizard.c (original) +++ trunk/reactos/dll/win32/newdev/wizard.c Tue Nov 20 23:44:24 2007 @@ -236,7 +236,7 @@ { HKEY hKey = NULL; DWORD dwRegType; - DWORD dwPathLength; + DWORD dwPathLength = 0; LPWSTR Buffer = NULL; LPCWSTR Path; LONG rc;
17 years, 1 month
1
0
0
0
[cwittich] 30605: set TARGETTYPE=LIBRARY when fileext is dll
by cwittich@svn.reactos.org
Author: cwittich Date: Tue Nov 20 23:05:38 2007 New Revision: 30605 URL:
http://svn.reactos.org/svn/reactos?rev=30605&view=rev
Log: set TARGETTYPE=LIBRARY when fileext is dll Modified: trunk/reactos/tools/rbuild/backend/msbuild/msbuild.cpp Modified: trunk/reactos/tools/rbuild/backend/msbuild/msbuild.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/backend/msbui…
============================================================================== --- trunk/reactos/tools/rbuild/backend/msbuild/msbuild.cpp (original) +++ trunk/reactos/tools/rbuild/backend/msbuild/msbuild.cpp Tue Nov 20 23:05:38 2007 @@ -149,9 +149,10 @@ } } - if (module_type == ".sys") fprintf ( OUT, "TARGETTYPE=DRIVER\r\n" ); + if (module_type == ".dll") + fprintf ( OUT, "TARGETTYPE=LIBRARY\r\n" ); fprintf ( OUT, "\r\nMSC_WARNING_LEVEL=/W3 /WX\r\n\r\n" );
17 years, 1 month
1
0
0
0
[weiden] 30604: Optimize TranslateMessage() to only call win32k for messages that need to be translated
by weiden@svn.reactos.org
Author: weiden Date: Tue Nov 20 22:58:51 2007 New Revision: 30604 URL:
http://svn.reactos.org/svn/reactos?rev=30604&view=rev
Log: Optimize TranslateMessage() to only call win32k for messages that need to be translated Modified: trunk/reactos/dll/win32/user32/windows/message.c Modified: trunk/reactos/dll/win32/user32/windows/message.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/windows/m…
============================================================================== --- trunk/reactos/dll/win32/user32/windows/message.c (original) +++ trunk/reactos/dll/win32/user32/windows/message.c Tue Nov 20 22:58:51 2007 @@ -2067,7 +2067,17 @@ BOOL STDCALL TranslateMessageEx(CONST MSG *lpMsg, DWORD unk) { - return(NtUserTranslateMessage((LPMSG)lpMsg, (HKL)unk)); + switch (lpMsg->message) + { + case WM_KEYDOWN: + case WM_KEYUP: + case WM_SYSKEYDOWN: + case WM_SYSKEYUP: + return(NtUserTranslateMessage((LPMSG)lpMsg, (HKL)unk)); + + default: + return FALSE; + } }
17 years, 1 month
1
0
0
0
[jimtabor] 30603: Removing old syscalls and updated related files. Old syscalls will be renamed for internal use.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Tue Nov 20 22:56:57 2007 New Revision: 30603 URL:
http://svn.reactos.org/svn/reactos?rev=30603&view=rev
Log: Removing old syscalls and updated related files. Old syscalls will be renamed for internal use. Modified: trunk/reactos/dll/win32/gdi32/misc/hacks.c trunk/reactos/dll/win32/gdi32/misc/stubs.c trunk/reactos/dll/win32/gdi32/objects/brush.c trunk/reactos/dll/win32/gdi32/objects/dc.c trunk/reactos/dll/win32/gdi32/objects/text.c trunk/reactos/include/reactos/win32k/ntgdibad.h trunk/reactos/subsystems/win32/win32k/include/dc.h trunk/reactos/subsystems/win32/win32k/include/intgdi.h trunk/reactos/subsystems/win32/win32k/ntuser/misc.c trunk/reactos/subsystems/win32/win32k/objects/dc.c trunk/reactos/subsystems/win32/win32k/objects/dcutil.c trunk/reactos/subsystems/win32/win32k/objects/text.c trunk/reactos/subsystems/win32/win32k/w32ksvc.db Modified: trunk/reactos/dll/win32/gdi32/misc/hacks.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/misc/hacks…
============================================================================== --- trunk/reactos/dll/win32/gdi32/misc/hacks.c (original) +++ trunk/reactos/dll/win32/gdi32/misc/hacks.c Tue Nov 20 22:56:57 2007 @@ -43,21 +43,6 @@ * @implemented * */ -int -STDCALL -GetROP2(HDC hdc) -{ - /* FIXME do not use reactos own syscall for this, - * this hack need be remove - */ - return NtGdiGetROP2(hdc); -} - - -/* - * @implemented - * - */ INT STDCALL SetDIBitsToDevice( @@ -96,18 +81,6 @@ * @implemented * */ -int -STDCALL -SetBkMode(HDC hdc, - int iBkMode) -{ - return NtGdiSetBkMode(hdc,iBkMode); -} - -/* - * @implemented - * - */ HGDIOBJ STDCALL SelectObject(HDC hdc, @@ -137,29 +110,6 @@ GetStretchBltMode(HDC hdc) { return NtGdiGetStretchBltMode(hdc); -} - -/* - * @implemented - * - */ -UINT -STDCALL -GetTextAlign(HDC hdc) -{ - return NtGdiGetTextAlign(hdc); -} - - -/* - * @implemented - * - */ -COLORREF -STDCALL -GetTextColor(HDC hdc) -{ - return NtGdiGetTextColor(hdc); } /* Modified: trunk/reactos/dll/win32/gdi32/misc/stubs.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/misc/stubs…
============================================================================== --- trunk/reactos/dll/win32/gdi32/misc/stubs.c (original) +++ trunk/reactos/dll/win32/gdi32/misc/stubs.c Tue Nov 20 22:56:57 2007 @@ -111,18 +111,6 @@ { /* FIXME metadc stuff */ return NtGdiSetRectRgn(hrgn, nLeftRect, nTopRect, nRightRect, nBottomRect); -} - -/* - * @unimplemented - */ -UINT -STDCALL -SetTextAlign(HDC hdc, - UINT fMode) -{ - /* FIXME share memory */ - return NtGdiSetTextAlign(hdc, fMode); } /* @@ -2342,30 +2330,6 @@ * @implemented * */ -COLORREF -STDCALL -GetBkColor(HDC hdc) -{ - /* FIXME some part are done in user mode */ - return NtGdiGetBkColor(hdc); -} - -/* - * @implemented - * - */ -int -STDCALL -GetBkMode(HDC hdc) -{ - /* FIXME some part are done in user mode */ - return NtGdiGetBkMode(hdc); -} - -/* - * @implemented - * - */ int STDCALL GetDeviceCaps(HDC hdc, Modified: trunk/reactos/dll/win32/gdi32/objects/brush.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/objects/br…
============================================================================== --- trunk/reactos/dll/win32/gdi32/objects/brush.c (original) +++ trunk/reactos/dll/win32/gdi32/objects/brush.c Tue Nov 20 22:56:57 2007 @@ -204,6 +204,18 @@ return NtGdiPolyPatBlt(hdc, rop4, pPoly,Count,Mode); } +/* + * @implemented + * + */ +int +STDCALL +GetROP2(HDC hdc) +{ + PDC_ATTR Dc_Attr; + if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return 0; + return Dc_Attr->jROP2; +} /* * @implemented Modified: trunk/reactos/dll/win32/gdi32/objects/dc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/objects/dc…
============================================================================== --- trunk/reactos/dll/win32/gdi32/objects/dc.c (original) +++ trunk/reactos/dll/win32/gdi32/objects/dc.c Tue Nov 20 22:56:57 2007 @@ -823,53 +823,19 @@ } } return OldColor; -// return NtUserSetDCPenColor(hdc, crColor); -} - -/* - * @implemented +} + +/* + * @implemented + * */ COLORREF STDCALL -SetTextColor( - HDC hdc, - COLORREF crColor -) -{ - PDC_ATTR Dc_Attr; - COLORREF OldColor = CLR_INVALID; - - if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return OldColor; -#if 0 - if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC) - { - if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC) - return MFDRV_SetTextColor( hDC, crColor ); - else - { - PLDC pLDC = Dc_Attr->pvLDC; - if ( !pLDC ) - { - SetLastError(ERROR_INVALID_HANDLE); - return FALSE; - } - if (pLDC->iType == LDC_EMFLDC) - { - if return EMFDRV_SetTextColor( hDC, crColor ); - } - } - } -#endif - OldColor = (COLORREF) Dc_Attr->ulForegroundClr; - Dc_Attr->ulForegroundClr = (ULONG) crColor; - - if ( Dc_Attr->crForegroundClr != crColor ) - { - Dc_Attr->ulDirty_ |= DIRTY_TEXT; - Dc_Attr->crForegroundClr = crColor; - } - return OldColor; -// return NtGdiSetTextColor(hdc, crColor); +GetBkColor(HDC hdc) +{ + PDC_ATTR Dc_Attr; + if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return 0; + return Dc_Attr->ulBackgroundClr; } /* @@ -915,7 +881,58 @@ Dc_Attr->crBackgroundClr = crColor; } return OldColor; -// return NtGdiSetBkColor(hdc, crColor); +} + +/* + * @implemented + * + */ +int +STDCALL +GetBkMode(HDC hdc) +{ + PDC_ATTR Dc_Attr; + if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return 0; + return Dc_Attr->lBkMode; +} + +/* + * @implemented + * + */ +int +STDCALL +SetBkMode(HDC hdc, + int iBkMode) +{ + PDC_ATTR Dc_Attr; + INT OldMode = 0; + + if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return OldMode; +#if 0 + if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC) + { + if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC) + return MFDRV_SetBkMode( hdc, iBkMode ) + else + { + PLDC pLDC = Dc_Attr->pvLDC; + if ( !pLDC ) + { + SetLastError(ERROR_INVALID_HANDLE); + return FALSE; + } + if (pLDC->iType == LDC_EMFLDC) + { + if return EMFDRV_SetBkMode( hdc, iBkMode ) + } + } + } +#endif + OldMode = Dc_Attr->lBkMode; + Dc_Attr->jBkMode = iBkMode; // Processed + Dc_Attr->lBkMode = iBkMode; // Raw + return OldMode; } /* Modified: trunk/reactos/dll/win32/gdi32/objects/text.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/objects/te…
============================================================================== --- trunk/reactos/dll/win32/gdi32/objects/text.c (original) +++ trunk/reactos/dll/win32/gdi32/objects/text.c Tue Nov 20 22:56:57 2007 @@ -458,4 +458,117 @@ // return GetAndSetDCDWord( hDC, GdiGetSetTextCharExtra, CharExtra, 0, 0, 0 ); } - +/* + * @implemented + * + */ +UINT +STDCALL +GetTextAlign(HDC hdc) +{ + PDC_ATTR Dc_Attr; + if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return 0; + return Dc_Attr->lTextAlign; +} + + +/* + * @implemented + * + */ +COLORREF +STDCALL +GetTextColor(HDC hdc) +{ + PDC_ATTR Dc_Attr; + if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return 0; + return Dc_Attr->ulForegroundClr; +} + + + +/* + * @unimplemented + */ +UINT +STDCALL +SetTextAlign(HDC hdc, + UINT fMode) +{ + PDC_ATTR Dc_Attr; + INT OldMode = 0; + + if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return OldMode; +#if 0 + if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC) + { + if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC) + return MFDRV_SetTextAlign( hdc, fMode ) + else + { + PLDC pLDC = Dc_Attr->pvLDC; + if ( !pLDC ) + { + SetLastError(ERROR_INVALID_HANDLE); + return FALSE; + } + if (pLDC->iType == LDC_EMFLDC) + { + if return EMFDRV_SetTextAlign( hdc, fMode ) + } + } + } +#endif + OldMode = Dc_Attr->lTextAlign; + Dc_Attr->lTextAlign = fMode; // Raw + Dc_Attr->flTextAlign = fMode & 0x1f; + return OldMode; + +} + + +/* + * @implemented + */ +COLORREF +STDCALL +SetTextColor( + HDC hdc, + COLORREF crColor +) +{ + PDC_ATTR Dc_Attr; + COLORREF OldColor = CLR_INVALID; + + if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return OldColor; +#if 0 + if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC) + { + if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC) + return MFDRV_SetTextColor( hDC, crColor ); + else + { + PLDC pLDC = Dc_Attr->pvLDC; + if ( !pLDC ) + { + SetLastError(ERROR_INVALID_HANDLE); + return FALSE; + } + if (pLDC->iType == LDC_EMFLDC) + { + if return EMFDRV_SetTextColor( hDC, crColor ); + } + } + } +#endif + OldColor = (COLORREF) Dc_Attr->ulForegroundClr; + Dc_Attr->ulForegroundClr = (ULONG) crColor; + + if ( Dc_Attr->crForegroundClr != crColor ) + { + Dc_Attr->ulDirty_ |= DIRTY_TEXT; + Dc_Attr->crForegroundClr = crColor; + } + return OldColor; +} + Modified: trunk/reactos/include/reactos/win32k/ntgdibad.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/win32k/ntg…
============================================================================== --- trunk/reactos/include/reactos/win32k/ntgdibad.h (original) +++ trunk/reactos/include/reactos/win32k/ntgdibad.h Tue Nov 20 22:56:57 2007 @@ -196,20 +196,6 @@ NtGdiGetAspectRatioFilterEx(HDC hDC, LPSIZE AspectRatio); -/* Should be done in user-mode using shared GDI Objects. */ -COLORREF STDCALL NtGdiGetBkColor(HDC hDC); - -/* Should be done in user-mode using shared GDI Objects. */ -INT STDCALL NtGdiGetBkMode(HDC hDC); - -/* Use NtGdiGetCharABCWidthsW */ -BOOL -STDCALL -NtGdiGetCharABCWidths(HDC hDC, - UINT FirstChar, - UINT LastChar, - LPABC abc); - /* Use NtGdiGetColorSpaceforBitmap. */ HCOLORSPACE STDCALL @@ -307,21 +293,12 @@ INT STDCALL NtGdiGetPolyFillMode(HDC hDC); /* Should be done in user-mode using shared GDI Objects. */ -INT STDCALL NtGdiGetROP2(HDC hDC); +INT STDCALL NtGdiGetStretchBltMode(HDC hDC); /* Should be done in user-mode using shared GDI Objects. */ -INT STDCALL NtGdiGetStretchBltMode(HDC hDC); - -/* Should be done in user-mode using shared GDI Objects. */ -UINT STDCALL NtGdiGetTextAlign(HDC hDC); - -/* Should be done in user-mode using shared GDI Objects. */ UINT STDCALL NtGdiGetTextCharset(HDC hDC); - -/* Needs to be done in user-mode, using shared GDI Object Attributes. */ -COLORREF STDCALL NtGdiGetTextColor(HDC hDC); /* Use NtGdiGetDCPoint with GdiGetViewPortExt */ BOOL STDCALL NtGdiGetViewportExtEx(HDC hDC, LPSIZE viewportExt); @@ -403,12 +380,6 @@ /* Should be done in user-mode. */ HGDIOBJ STDCALL NtGdiSelectObject(HDC hDC, HGDIOBJ hGDIObj); - -/* Needs to be done in user-mode, using shared GDI Object Attributes. */ -COLORREF STDCALL NtGdiSetBkColor (HDC hDC, COLORREF Color); - -/* Needs to be done in user-mode, using shared GDI Object Attributes. */ -INT STDCALL NtGdiSetBkMode(HDC hDC, INT backgroundMode); /* Use SetDIBitsToDevice in gdi32. */ INT @@ -455,19 +426,7 @@ INT STDCALL NtGdiSetPolyFillMode(HDC hDC, INT polyFillMode); /* Needs to be done in user-mode, using shared GDI Object Attributes. */ -INT STDCALL NtGdiSetROP2(HDC hDC, INT ROPmode); - -/* Needs to be done in user-mode, using shared GDI Object Attributes. */ INT STDCALL NtGdiSetStretchBltMode(HDC hDC, INT stretchBltMode); - -/* Needs to be done in user-mode, using shared GDI Object Attributes. */ -UINT -STDCALL -NtGdiSetTextAlign(HDC hDC, - UINT Mode); - -/* Needs to be done in user-mode, using shared GDI Object Attributes. */ -COLORREF STDCALL NtGdiSetTextColor(HDC hDC, COLORREF color); /* Needs to be done in user-mode. */ BOOL @@ -536,29 +495,6 @@ LPWSTR Filename, UINT Command); -/* All this Should be in user-mode, not NtUser calls. Especially not in GDI! */ -DWORD -NTAPI -NtUserCallTwoParam( - DWORD Param1, - DWORD Param2, - DWORD Routine); - -#define TWOPARAM_ROUTINE_SETDCPENCOLOR 0x45 -#define TWOPARAM_ROUTINE_SETDCBRUSHCOLOR 0x46 -#define TWOPARAM_ROUTINE_GETDCCOLOR 0x47 - -#define NtUserGetDCBrushColor(hbr) \ - (COLORREF)NtUserCallTwoParam((DWORD)(hbr), OBJ_BRUSH, TWOPARAM_ROUTINE_GETDCCOLOR) - -#define NtUserGetDCPenColor(hbr) \ - (COLORREF)NtUserCallTwoParam((DWORD)(hbr), OBJ_PEN, TWOPARAM_ROUTINE_GETDCCOLOR) - -#define NtUserSetDCBrushColor(hbr, crColor) \ - (COLORREF)NtUserCallTwoParam((DWORD)(hbr), (DWORD)crColor, TWOPARAM_ROUTINE_SETDCBRUSHCOLOR) - -#define NtUserSetDCPenColor(hbr, crColor) \ - (COLORREF)NtUserCallTwoParam((DWORD)(hbr), (DWORD)crColor, TWOPARAM_ROUTINE_SETDCPENCOLOR) #endif /* WIN32K_NTGDI_BAD_INCLUDED */ Modified: trunk/reactos/subsystems/win32/win32k/include/dc.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/include/dc.h (original) +++ trunk/reactos/subsystems/win32/win32k/include/dc.h Tue Nov 20 22:56:57 2007 @@ -104,6 +104,15 @@ NTSTATUS STDCALL NtGdiFlushUserBatch(VOID); +COLORREF FASTCALL NtGdiSetBkColor (HDC hDC, COLORREF Color); +INT FASTCALL NtGdiSetBkMode(HDC hDC, INT backgroundMode); +COLORREF STDCALL NtGdiGetBkColor(HDC hDC); +INT STDCALL NtGdiGetBkMode(HDC hDC); +COLORREF FASTCALL NtGdiSetTextColor(HDC hDC, COLORREF color); +UINT FASTCALL NtGdiSetTextAlign(HDC hDC, UINT Mode); +UINT STDCALL NtGdiGetTextAlign(HDC hDC); +COLORREF STDCALL NtGdiGetTextColor(HDC hDC); + /* For Metafile and MetaEnhFile not in windows this struct taken from wine cvs 15/9-2006*/ typedef struct { Modified: trunk/reactos/subsystems/win32/win32k/include/intgdi.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/include/intgdi.h (original) +++ trunk/reactos/subsystems/win32/win32k/include/intgdi.h Tue Nov 20 22:56:57 2007 @@ -164,12 +164,6 @@ CONST PDEVMODEW InitData, BOOL CreateAsIC); -COLORREF FASTCALL -IntGetDCColor(HDC hDC, ULONG Object); - -COLORREF FASTCALL -IntSetDCColor(HDC hDC, ULONG Object, COLORREF Color); - /* Coord functions */ BOOL FASTCALL Modified: trunk/reactos/subsystems/win32/win32k/ntuser/misc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/misc.c (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/misc.c Tue Nov 20 22:56:57 2007 @@ -485,18 +485,6 @@ switch(Routine) { - case TWOPARAM_ROUTINE_SETDCPENCOLOR: - { - RETURN( (DWORD)IntSetDCColor((HDC)Param1, OBJ_PEN, (COLORREF)Param2)); - } - case TWOPARAM_ROUTINE_SETDCBRUSHCOLOR: - { - RETURN( (DWORD)IntSetDCColor((HDC)Param1, OBJ_BRUSH, (COLORREF)Param2)); - } - case TWOPARAM_ROUTINE_GETDCCOLOR: - { - RETURN( (DWORD)IntGetDCColor((HDC)Param1, (ULONG)Param2)); - } case TWOPARAM_ROUTINE_GETWINDOWRGNBOX: { DWORD Ret; Modified: trunk/reactos/subsystems/win32/win32k/objects/dc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/dc.c (original) +++ trunk/reactos/subsystems/win32/win32k/objects/dc.c Tue Nov 20 22:56:57 2007 @@ -150,8 +150,11 @@ NewDC->PalIndexed = OrigDC->PalIndexed; NewDC->w.hPalette = OrigDC->w.hPalette; + nDc_Attr->lTextAlign = oDc_Attr->lTextAlign; + nDc_Attr->ulForegroundClr = oDc_Attr->ulForegroundClr; + nDc_Attr->ulBackgroundClr = oDc_Attr->ulBackgroundClr; + nDc_Attr->lBkMode = oDc_Attr->lBkMode; nDc_Attr->crForegroundClr = oDc_Attr->crForegroundClr; - nDc_Attr->lTextAlign = oDc_Attr->lTextAlign; nDc_Attr->crBackgroundClr = oDc_Attr->crBackgroundClr; nDc_Attr->jBkMode = oDc_Attr->jBkMode; nDc_Attr->jROP2 = oDc_Attr->jROP2; @@ -1203,8 +1206,11 @@ nDc_Attr->jStretchBltMode = Dc_Attr->jStretchBltMode; nDc_Attr->lRelAbs = Dc_Attr->lRelAbs; nDc_Attr->jBkMode = Dc_Attr->jBkMode; + nDc_Attr->lBkMode = Dc_Attr->lBkMode; nDc_Attr->crBackgroundClr = Dc_Attr->crBackgroundClr; nDc_Attr->crForegroundClr = Dc_Attr->crForegroundClr; + nDc_Attr->ulBackgroundClr = Dc_Attr->ulBackgroundClr; + nDc_Attr->ulForegroundClr = Dc_Attr->ulForegroundClr; nDc_Attr->ptlBrushOrigin = Dc_Attr->ptlBrushOrigin; nDc_Attr->lTextAlign = Dc_Attr->lTextAlign; nDc_Attr->lTextExtra = Dc_Attr->lTextExtra; @@ -1273,6 +1279,9 @@ Dc_Attr->jBkMode = sDc_Attr->jBkMode; Dc_Attr->crBackgroundClr = sDc_Attr->crBackgroundClr; Dc_Attr->crForegroundClr = sDc_Attr->crForegroundClr; + Dc_Attr->lBkMode = sDc_Attr->lBkMode; + Dc_Attr->ulBackgroundClr = sDc_Attr->ulBackgroundClr; + Dc_Attr->ulForegroundClr = sDc_Attr->ulForegroundClr; Dc_Attr->ptlBrushOrigin = sDc_Attr->ptlBrushOrigin; Dc_Attr->lTextAlign = sDc_Attr->lTextAlign; @@ -2579,42 +2588,6 @@ return SurfObj->hsurf == PrimarySurface.Handle; } -/* - * Returns the color of the brush or pen that is currently selected into the DC. - * This function is called from GetDCBrushColor() and GetDCPenColor() - */ -COLORREF FASTCALL -IntGetDCColor(HDC hDC, ULONG Object) -{ - /* - * The previous implementation was completly incorrect. It modified the - * brush that was currently selected into the device context, but in fact - * the DC pen/brush color should be stored directly in the device context - * (at address 0x2C of the user mode DC object memory on Windows 2K/XP). - * The actual color is then used when DC_BRUSH/DC_PEN object is selected - * into the device context and BRUSHOBJ for drawing is composed (belongs - * to IntGdiInitBrushInstance in the current ReactOS implementation). Also - * the implementation should be moved to user mode GDI32.dll when UM - * mapped GDI objects will be implemented. - */ - - DPRINT("WIN32K:IntGetDCColor is unimplemented\n"); - return 0xFFFFFF; /* The default DC color. */ -} - -/* - * Changes the color of the brush or pen that is currently selected into the DC. - * This function is called from SetDCBrushColor() and SetDCPenColor() - */ -COLORREF FASTCALL -IntSetDCColor(HDC hDC, ULONG Object, COLORREF Color) -{ - /* See the comment in IntGetDCColor. */ - - DPRINT("WIN32K:IntSetDCColor is unimplemented\n"); - return CLR_INVALID; -} - #define SIZEOF_DEVMODEW_300 188 #define SIZEOF_DEVMODEW_400 212 #define SIZEOF_DEVMODEW_500 220 Modified: trunk/reactos/subsystems/win32/win32k/objects/dcutil.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/dcutil.c (original) +++ trunk/reactos/subsystems/win32/win32k/objects/dcutil.c Tue Nov 20 22:56:57 2007 @@ -157,14 +157,13 @@ DC_GET_VAL_EX( GetWindowOrgEx, ptlWindowOrg.x, ptlWindowOrg.y, POINT, x, y ) DC_GET_VAL_EX ( GetCurrentPositionEx, ptlCurrent.x, ptlCurrent.y, POINT, x, y ) -DC_SET_MODE( NtGdiSetBkMode, jBkMode, TRANSPARENT, OPAQUE ) DC_SET_MODE( NtGdiSetPolyFillMode, jFillMode, ALTERNATE, WINDING ) DC_SET_MODE( NtGdiSetROP2, jROP2, R2_BLACK, R2_WHITE ) DC_SET_MODE( NtGdiSetStretchBltMode, jStretchBltMode, BLACKONWHITE, HALFTONE ) -COLORREF STDCALL +COLORREF FASTCALL NtGdiSetBkColor(HDC hDC, COLORREF color) { COLORREF oldColor; @@ -181,9 +180,80 @@ if (!Dc_Attr) Dc_Attr = &dc->Dc_Attr; oldColor = Dc_Attr->crBackgroundClr; Dc_Attr->crBackgroundClr = color; + Dc_Attr->ulBackgroundClr = (ULONG)color; + Dc_Attr->ulDirty_ &= ~DIRTY_LINE; // Clear Flag if set. hBrush = Dc_Attr->hbrush; DC_UnlockDc(dc); NtGdiSelectObject(hDC, hBrush); return oldColor; } +INT FASTCALL +NtGdiSetBkMode(HDC hDC, INT Mode) +{ + COLORREF oldMode; + PDC dc; + PDC_ATTR Dc_Attr; + + if (!(dc = DC_LockDc(hDC))) + { + SetLastWin32Error(ERROR_INVALID_HANDLE); + return CLR_INVALID; + } + Dc_Attr = dc->pDc_Attr; + if (!Dc_Attr) Dc_Attr = &dc->Dc_Attr; + oldMode = Dc_Attr->lBkMode; + Dc_Attr->jBkMode = Mode; + Dc_Attr->lBkMode = Mode; + DC_UnlockDc(dc); + return oldMode; +} + +UINT +FASTCALL +NtGdiSetTextAlign(HDC hDC, + UINT Mode) +{ + UINT prevAlign; + DC *dc; + PDC_ATTR Dc_Attr; + + dc = DC_LockDc(hDC); + if (!dc) + { + SetLastWin32Error(ERROR_INVALID_HANDLE); + return GDI_ERROR; + } + Dc_Attr = dc->pDc_Attr; + if(!Dc_Attr) Dc_Attr = &dc->Dc_Attr; + prevAlign = Dc_Attr->lTextAlign; + Dc_Attr->lTextAlign = Mode; + DC_UnlockDc( dc ); + return prevAlign; +} + +COLORREF +FASTCALL +NtGdiSetTextColor(HDC hDC, + COLORREF color) +{ + COLORREF oldColor; + PDC dc = DC_LockDc(hDC); + PDC_ATTR Dc_Attr; + HBRUSH hBrush; + + if (!dc) + { + SetLastWin32Error(ERROR_INVALID_HANDLE); + return CLR_INVALID; + } + Dc_Attr = dc->pDc_Attr; + if(!Dc_Attr) Dc_Attr = &dc->Dc_Attr; + + oldColor = Dc_Attr->crForegroundClr; + Dc_Attr->crForegroundClr = color; + hBrush = Dc_Attr->hbrush; + DC_UnlockDc( dc ); + NtGdiSelectObject(hDC, hBrush); + return oldColor; +} Modified: trunk/reactos/subsystems/win32/win32k/objects/text.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/text.c (original) +++ trunk/reactos/subsystems/win32/win32k/objects/text.c Tue Nov 20 22:56:57 2007 @@ -4029,54 +4029,6 @@ return 0; } -UINT -STDCALL -NtGdiSetTextAlign(HDC hDC, - UINT Mode) -{ - UINT prevAlign; - DC *dc; - PDC_ATTR Dc_Attr; - - dc = DC_LockDc(hDC); - if (!dc) - { - SetLastWin32Error(ERROR_INVALID_HANDLE); - return GDI_ERROR; - } - Dc_Attr = dc->pDc_Attr; - if(!Dc_Attr) Dc_Attr = &dc->Dc_Attr; - prevAlign = Dc_Attr->lTextAlign; - Dc_Attr->lTextAlign = Mode; - DC_UnlockDc( dc ); - return prevAlign; -} - -COLORREF -STDCALL -NtGdiSetTextColor(HDC hDC, - COLORREF color) -{ - COLORREF oldColor; - PDC dc = DC_LockDc(hDC); - PDC_ATTR Dc_Attr; - HBRUSH hBrush; - - if (!dc) - { - SetLastWin32Error(ERROR_INVALID_HANDLE); - return CLR_INVALID; - } - Dc_Attr = dc->pDc_Attr; - if(!Dc_Attr) Dc_Attr = &dc->Dc_Attr; - - oldColor = Dc_Attr->crForegroundClr; - Dc_Attr->crForegroundClr = color; - hBrush = Dc_Attr->hbrush; - DC_UnlockDc( dc ); - NtGdiSelectObject(hDC, hBrush); - return oldColor; -} BOOL STDCALL Modified: trunk/reactos/subsystems/win32/win32k/w32ksvc.db URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/w3…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/w32ksvc.db (original) +++ trunk/reactos/subsystems/win32/win32k/w32ksvc.db Tue Nov 20 22:56:57 2007 @@ -679,18 +679,13 @@ # #ReactOS specify syscall NtGdiSelectObject 2 -NtGdiSetBkColor 2 -NtGdiSetBkMode 2 NtGdiSetDIBits 7 NtGdiSetEnhMetaFileBits 2 NtGdiSetGraphicsMode 2 NtGdiSetICMProfile 2 NtGdiSetMapperFlags 2 NtGdiSetPolyFillMode 2 -NtGdiSetROP2 2 NtGdiSetStretchBltMode 2 -NtGdiSetTextAlign 2 -NtGdiSetTextColor 2 NtGdiSetViewportExtEx 4 NtGdiSetViewportOrgEx 4 NtGdiSetWindowExtEx 4 @@ -744,8 +739,6 @@ NtGdiExtTextOut 8 NtGdiGdiComment 3 NtGdiGetAspectRatioFilterEx 2 -NtGdiGetBkColor 1 -NtGdiGetBkMode 1 NtGdiGetColorSpace 1 NtGdiGetCurrentPositionEx 2 NtGdiGetEnhMetaFile 1 @@ -762,10 +755,7 @@ NtGdiGetMapMode 1 NtGdiGetPixelFormat 1 NtGdiGetPolyFillMode 1 -NtGdiGetROP2 1 NtGdiGetStretchBltMode 1 -NtGdiGetTextAlign 1 -NtGdiGetTextColor 1 NtGdiGetTextExtentPoint32 4 NtGdiMoveToEx 4 NtGdiOffsetViewportOrgEx 4
17 years, 1 month
1
0
0
0
[cwittich] 30602: use sizeof(OBJECT_ATTRIBUTES) instead of sizeof(POBJECT_ATTRIBUTES) when probing ObjectAttributes for read
by cwittich@svn.reactos.org
Author: cwittich Date: Tue Nov 20 22:35:40 2007 New Revision: 30602 URL:
http://svn.reactos.org/svn/reactos?rev=30602&view=rev
Log: use sizeof(OBJECT_ATTRIBUTES) instead of sizeof(POBJECT_ATTRIBUTES) when probing ObjectAttributes for read Modified: trunk/reactos/ntoskrnl/se/sd.c Modified: trunk/reactos/ntoskrnl/se/sd.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/se/sd.c?rev=30602…
============================================================================== --- trunk/reactos/ntoskrnl/se/sd.c (original) +++ trunk/reactos/ntoskrnl/se/sd.c Tue Nov 20 22:35:40 2007 @@ -237,7 +237,7 @@ _SEH_TRY { ProbeForRead(ObjectAttributes, - sizeof(ObjectAttributes), + sizeof(OBJECT_ATTRIBUTES), sizeof(ULONG)); if(ObjectAttributes->Length == sizeof(OBJECT_ATTRIBUTES)) {
17 years, 1 month
1
0
0
0
[cwittich] 30601: add missing brackets in MmReserveSwapPages
by cwittich@svn.reactos.org
Author: cwittich Date: Tue Nov 20 22:15:02 2007 New Revision: 30601 URL:
http://svn.reactos.org/svn/reactos?rev=30601&view=rev
Log: add missing brackets in MmReserveSwapPages Modified: trunk/reactos/ntoskrnl/mm/pagefile.c Modified: trunk/reactos/ntoskrnl/mm/pagefile.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/pagefile.c?rev…
============================================================================== --- trunk/reactos/ntoskrnl/mm/pagefile.c (original) +++ trunk/reactos/ntoskrnl/mm/pagefile.c Tue Nov 20 22:15:02 2007 @@ -376,7 +376,7 @@ MiAvailSwapPages = (MiFreeSwapPages * MM_PAGEFILE_COMMIT_RATIO) + MM_PAGEFILE_COMMIT_GRACE; MiReservedSwapPages = MiReservedSwapPages + Nr; - if (MM_PAGEFILE_COMMIT_RATIO != 0 && MiAvailSwapPages < MiReservedSwapPages) + if ((MM_PAGEFILE_COMMIT_RATIO != 0) && (MiAvailSwapPages < MiReservedSwapPages)) { KeReleaseSpinLock(&PagingFileListLock, oldIrql); return(FALSE);
17 years, 1 month
1
0
0
0
[cwittich] 30600: fix some format strings
by cwittich@svn.reactos.org
Author: cwittich Date: Tue Nov 20 22:10:42 2007 New Revision: 30600 URL:
http://svn.reactos.org/svn/reactos?rev=30600&view=rev
Log: fix some format strings Modified: trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c trunk/reactos/ntoskrnl/mm/marea.c Modified: trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.…
============================================================================== --- trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c (original) +++ trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c Tue Nov 20 22:10:42 2007 @@ -171,12 +171,12 @@ } else { - DPRINT("IopTranslateDeviceResources() failed (Status 0x08lx)\n", Status); + DPRINT("IopTranslateDeviceResources() failed (Status 0x%08lx)\n", Status); } } else { - DPRINT("IopAssignDeviceResources() failed (Status 0x08lx)\n", Status); + DPRINT("IopAssignDeviceResources() failed (Status 0x%08lx)\n", Status); } IopDeviceNodeClearFlag(DeviceNode, DNF_ASSIGNING_RESOURCES); Modified: trunk/reactos/ntoskrnl/mm/marea.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/marea.c?rev=30…
============================================================================== --- trunk/reactos/ntoskrnl/mm/marea.c (original) +++ trunk/reactos/ntoskrnl/mm/marea.c Tue Nov 20 22:10:42 2007 @@ -713,7 +713,7 @@ NTAPI MmInitMemoryAreas(VOID) { - DPRINT("MmInitMemoryAreas()\n",0); + DPRINT("MmInitMemoryAreas()\n"); return(STATUS_SUCCESS); }
17 years, 1 month
1
0
0
0
← Newer
1
...
29
30
31
32
33
34
35
...
89
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
Results per page:
10
25
50
100
200