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
January 2010
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
26 participants
522 discussions
Start a n
N
ew thread
[tkreuzer] 44894: [HAL] - Use spinlock.h from ntoskrnl, instead of duplicating the definitions - Use one spinlock.c, but compiled for 2 static libs (hal_generic_up and hal_generic_mp) - Move HalpAcquireSystemHardwareSpinLock and HalpReleaseCmosSpinLock to spinlock.c and use the inline functions for the kernel to make Arch happy.
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Sat Jan 2 21:03:49 2010 New Revision: 44894 URL:
http://svn.reactos.org/svn/reactos?rev=44894&view=rev
Log: [HAL] - Use spinlock.h from ntoskrnl, instead of duplicating the definitions - Use one spinlock.c, but compiled for 2 static libs (hal_generic_up and hal_generic_mp) - Move HalpAcquireSystemHardwareSpinLock and HalpReleaseCmosSpinLock to spinlock.c and use the inline functions for the kernel to make Arch happy. Added: branches/ros-amd64-bringup/reactos/hal/halx86/generic/spinlock.c - copied, changed from r44834, branches/ros-amd64-bringup/reactos/hal/halx86/up/spinlock.c branches/ros-amd64-bringup/reactos/hal/halx86/hal_generic_mp.rbuild (with props) Removed: branches/ros-amd64-bringup/reactos/hal/halx86/mp/i386/spinlock.c branches/ros-amd64-bringup/reactos/hal/halx86/up/spinlock.c Modified: branches/ros-amd64-bringup/reactos/hal/halx86/directory.rbuild branches/ros-amd64-bringup/reactos/hal/halx86/generic/cmos.c branches/ros-amd64-bringup/reactos/hal/halx86/hal_generic_up.rbuild branches/ros-amd64-bringup/reactos/hal/halx86/halmps.rbuild Modified: branches/ros-amd64-bringup/reactos/hal/halx86/directory.rbuild URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/hal/h…
============================================================================== --- branches/ros-amd64-bringup/reactos/hal/halx86/directory.rbuild [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/hal/halx86/directory.rbuild [iso-8859-1] Sat Jan 2 21:03:49 2010 @@ -4,6 +4,7 @@ <xi:include href="hal_generic.rbuild" /> <xi:include href="hal_generic_up.rbuild" /> + <xi:include href="hal_generic_mp.rbuild" /> <if property="ARCH" value="i386"> <xi:include href="hal.rbuild" /> Modified: branches/ros-amd64-bringup/reactos/hal/halx86/generic/cmos.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/hal/h…
============================================================================== --- branches/ros-amd64-bringup/reactos/hal/halx86/generic/cmos.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/hal/halx86/generic/cmos.c [iso-8859-1] Sat Jan 2 21:03:49 2010 @@ -16,53 +16,9 @@ /* GLOBALS *******************************************************************/ -KSPIN_LOCK HalpSystemHardwareLock; UCHAR HalpCmosCenturyOffset; -ULONG HalpSystemHardwareFlags; /* PRIVATE FUNCTIONS *********************************************************/ - -VOID -NTAPI -HalpAcquireSystemHardwareSpinLock(VOID) -{ - ULONG Flags; - - /* Get flags and disable interrupts */ - Flags = __readeflags(); - _disable(); - - /* Try to acquire the lock */ - while (InterlockedBitTestAndSet((PLONG)&HalpSystemHardwareLock, 0)) - { - /* Lock is held, spin until it's free */ - while (*(volatile ULONG*)HalpSystemHardwareLock & 1) - YieldProcessor(); - } - - /* We have the lock, save the flags now */ - HalpSystemHardwareFlags = Flags; -} - -VOID -NTAPI -HalpReleaseCmosSpinLock(VOID) -{ - ULONG Flags; - - /* Get the flags */ - Flags = HalpSystemHardwareFlags; - - /* Release lock and check if we owned it */ - if (!InterlockedBitTestAndReset((PLONG)&HalpSystemHardwareLock, 0)) - { - /* The spin lock was not owned! */ - KeBugCheckEx(SPIN_LOCK_NOT_OWNED, 0, 0, 0, 0); - } - - /* Restore the flags */ - __writeeflags(Flags); -} FORCEINLINE UCHAR Copied: branches/ros-amd64-bringup/reactos/hal/halx86/generic/spinlock.c (from r44834, branches/ros-amd64-bringup/reactos/hal/halx86/up/spinlock.c) URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/hal/h…
============================================================================== --- branches/ros-amd64-bringup/reactos/hal/halx86/up/spinlock.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/hal/halx86/generic/spinlock.c [iso-8859-1] Sat Jan 2 21:03:49 2010 @@ -4,6 +4,7 @@ * FILE: hal/halx86/up/spinlock.c * PURPOSE: Spinlock and Queued Spinlock Support * PROGRAMMERS: Alex Ionescu (alex.ionescu(a)reactos.org) + * Timo Kreuzer (timo.kreuzer(a)reactos.org) */ /* INCLUDES ******************************************************************/ @@ -15,105 +16,19 @@ #define NDEBUG #include <debug.h> +#include <internal/spinlock.h> + #undef KeAcquireSpinLock #undef KeReleaseSpinLock -// -// This is duplicated from ke_x.h -// -#ifdef CONFIG_SMP -// -// Spinlock Acquisition at IRQL >= DISPATCH_LEVEL -// -FORCEINLINE -VOID -KxAcquireSpinLock(IN PKSPIN_LOCK SpinLock) -{ - /* Make sure that we don't own the lock already */ - if (((KSPIN_LOCK)KeGetCurrentThread() | 1) == *SpinLock) - { - /* We do, bugcheck! */ - KeBugCheckEx(SPIN_LOCK_ALREADY_OWNED, (ULONG_PTR)SpinLock, 0, 0, 0); - } - - for (;;) - { - /* Try to acquire it */ - if (InterlockedBitTestAndSet((PLONG)SpinLock, 0)) - { - /* Value changed... wait until it's locked */ - while (*(volatile KSPIN_LOCK *)SpinLock == 1) - { -#ifdef DBG - /* On debug builds, we use a much slower but useful routine */ - //Kii386SpinOnSpinLock(SpinLock, 5); - - /* FIXME: Do normal yield for now */ - YieldProcessor(); -#else - /* Otherwise, just yield and keep looping */ - YieldProcessor(); -#endif - } - } - else - { -#ifdef DBG - /* On debug builds, we OR in the KTHREAD */ - *SpinLock = (KSPIN_LOCK)KeGetCurrentThread() | 1; -#endif - /* All is well, break out */ - break; - } - } -} - -// -// Spinlock Release at IRQL >= DISPATCH_LEVEL -// -FORCEINLINE -VOID -KxReleaseSpinLock(IN PKSPIN_LOCK SpinLock) -{ -#ifdef DBG - /* Make sure that the threads match */ - if (((KSPIN_LOCK)KeGetCurrentThread() | 1) != *SpinLock) - { - /* They don't, bugcheck */ - KeBugCheckEx(SPIN_LOCK_NOT_OWNED, (ULONG_PTR)SpinLock, 0, 0, 0); - } -#endif - /* Clear the lock */ - InterlockedAnd((PLONG)SpinLock, 0); -} - -#else - -// -// Spinlock Acquire at IRQL >= DISPATCH_LEVEL -// -FORCEINLINE -VOID -KxAcquireSpinLock(IN PKSPIN_LOCK SpinLock) -{ - /* On UP builds, spinlocks don't exist at IRQL >= DISPATCH */ - UNREFERENCED_PARAMETER(SpinLock); -} - -// -// Spinlock Release at IRQL >= DISPATCH_LEVEL -// -FORCEINLINE -VOID -KxReleaseSpinLock(IN PKSPIN_LOCK SpinLock) -{ - /* On UP builds, spinlocks don't exist at IRQL >= DISPATCH */ - UNREFERENCED_PARAMETER(SpinLock); -} - -#endif +/* GLOBALS *******************************************************************/ + +ULONG HalpSystemHardwareFlags; +KSPIN_LOCK HalpSystemHardwareLock; /* FUNCTIONS *****************************************************************/ + +#ifdef _M_IX86 /* * @implemented @@ -347,3 +262,39 @@ /* Call the fastcall function */ KfLowerIrql(NewIrql); } + +#endif + +VOID +NTAPI +HalpAcquireSystemHardwareSpinLock(VOID) +{ + ULONG Flags; + + /* Get flags and disable interrupts */ + Flags = __readeflags(); + _disable(); + + /* Acquire the lock */ + KxAcquireSpinLock(&HalpSystemHardwareLock); + + /* We have the lock, save the flags now */ + HalpSystemHardwareFlags = Flags; +} + +VOID +NTAPI +HalpReleaseCmosSpinLock(VOID) +{ + ULONG Flags; + + /* Get the flags */ + Flags = HalpSystemHardwareFlags; + + /* Release the lock */ + KxReleaseSpinLock(&HalpSystemHardwareLock); + + /* Restore the flags */ + __writeeflags(Flags); +} + Added: branches/ros-amd64-bringup/reactos/hal/halx86/hal_generic_mp.rbuild URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/hal/h…
============================================================================== --- branches/ros-amd64-bringup/reactos/hal/halx86/hal_generic_mp.rbuild (added) +++ branches/ros-amd64-bringup/reactos/hal/halx86/hal_generic_mp.rbuild [iso-8859-1] Sat Jan 2 21:03:49 2010 @@ -1,0 +1,18 @@ +<?xml version="1.0"?> +<!DOCTYPE group SYSTEM "../../../tools/rbuild/project.dtd"> +<group> + <module name="hal_generic_mp" type="objectlibrary"> + <include>include</include> + <include base="ntoskrnl">include</include> + <define name="_NTHAL_" /> + <define name="CONFIG_SMP" /> + <directory name="generic"> + <file>spinlock.c</file> + </directory> + <directory name="mp"> + <if property="ARCH" value="i386"> + <file>irq.S</file> + </if> + </directory> + </module> +</group> Propchange: branches/ros-amd64-bringup/reactos/hal/halx86/hal_generic_mp.rbuild ------------------------------------------------------------------------------ svn:eol-style = native Modified: branches/ros-amd64-bringup/reactos/hal/halx86/hal_generic_up.rbuild URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/hal/h…
============================================================================== --- branches/ros-amd64-bringup/reactos/hal/halx86/hal_generic_up.rbuild [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/hal/halx86/hal_generic_up.rbuild [iso-8859-1] Sat Jan 2 21:03:49 2010 @@ -5,11 +5,13 @@ <include>include</include> <include base="ntoskrnl">include</include> <define name="_NTHAL_" /> + <directory name="generic"> + <file>spinlock.c</file> + </directory> <directory name="up"> <file>processor.c</file> <if property="ARCH" value="i386"> <file>irq.S</file> - <file>spinlock.c</file> </if> </directory> </module> Modified: branches/ros-amd64-bringup/reactos/hal/halx86/halmps.rbuild URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/hal/h…
============================================================================== --- branches/ros-amd64-bringup/reactos/hal/halx86/halmps.rbuild [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/hal/halx86/halmps.rbuild [iso-8859-1] Sat Jan 2 21:03:49 2010 @@ -9,6 +9,7 @@ <define name="CONFIG_SMP" /> <define name="_NTHAL_" /> <library>hal_generic</library> + <library>hal_generic_mp</library> <library>ntoskrnl</library> <directory name="mp"> <file>apic.c</file> @@ -22,7 +23,6 @@ <directory name="i386"> <file>mps.S</file> <file>mpsboot.asm</file> - <file>spinlock.c</file> </directory> </directory> </module> Removed: branches/ros-amd64-bringup/reactos/hal/halx86/mp/i386/spinlock.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/hal/h…
============================================================================== --- branches/ros-amd64-bringup/reactos/hal/halx86/mp/i386/spinlock.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/hal/halx86/mp/i386/spinlock.c (removed) @@ -1,201 +1,0 @@ -/* - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel - * FILE: ntoskrnl/hal/x86/spinlock.c - * PURPOSE: Implements spinlocks - * PROGRAMMER: David Welch (welch(a)cwcom.net) - * Eric Kohl (ekohl(a)rz-online.de) - * UPDATE HISTORY: - * 09/06/2000 Created - */ - -/* - * NOTE: On a uniprocessor machine spinlocks are implemented by raising - * the irq level - */ - -/* INCLUDES ****************************************************************/ - -#include <hal.h> -#define NDEBUG -#include <debug.h> - -/* Hmm, needed for KDBG := 1. Why? */ -#undef KeGetCurrentIrql - -/* FUNCTIONS ***************************************************************/ - -#undef KeAcquireSpinLock -VOID NTAPI -KeAcquireSpinLock ( - PKSPIN_LOCK SpinLock, - PKIRQL OldIrql - ) -/* - * FUNCTION: Acquires a spinlock - * ARGUMENTS: - * SpinLock = Spinlock to acquire - * OldIrql (OUT) = Caller supplied storage for the previous irql - */ -{ - *OldIrql = KfAcquireSpinLock(SpinLock); -} - -KIRQL FASTCALL -KeAcquireSpinLockRaiseToSynch ( - PKSPIN_LOCK SpinLock - ) -{ - KIRQL OldIrql; - - OldIrql = KfRaiseIrql(CLOCK2_LEVEL); - KiAcquireSpinLock(SpinLock); - - return OldIrql; -} - -#undef KeReleaseSpinLock -VOID NTAPI -KeReleaseSpinLock ( - PKSPIN_LOCK SpinLock, - KIRQL NewIrql - ) -/* - * FUNCTION: Releases a spinlock - * ARGUMENTS: - * SpinLock = Spinlock to release - * NewIrql = Irql level before acquiring the spinlock - */ -{ - KfReleaseSpinLock(SpinLock, NewIrql); -} - -LOGICAL -FASTCALL -KeTryToAcquireQueuedSpinLock( - KSPIN_LOCK_QUEUE_NUMBER LockNumber, - PKIRQL OldIrql) -{ - UNIMPLEMENTED; - - return FALSE; -} - - -BOOLEAN -FASTCALL -KeTryToAcquireQueuedSpinLockRaiseToSynch( - KSPIN_LOCK_QUEUE_NUMBER LockNumber, - PKIRQL OldIrql) -{ - UNIMPLEMENTED; - - return FALSE; -} - -KIRQL FASTCALL -KfAcquireSpinLock ( - PKSPIN_LOCK SpinLock - ) -{ - KIRQL OldIrql; - - ASSERT(KeGetCurrentIrql() <= DISPATCH_LEVEL); - - OldIrql = KfRaiseIrql(DISPATCH_LEVEL); - KiAcquireSpinLock(SpinLock); - - return OldIrql; -} - -VOID FASTCALL -KfReleaseSpinLock ( - PKSPIN_LOCK SpinLock, - KIRQL NewIrql - ) -/* - * FUNCTION: Releases a spinlock - * ARGUMENTS: - * SpinLock = Spinlock to release - * NewIrql = Irql level before acquiring the spinlock - */ -{ - ASSERT(KeGetCurrentIrql() == DISPATCH_LEVEL || KeGetCurrentIrql() == SYNCH_LEVEL); - KiReleaseSpinLock(SpinLock); - KfLowerIrql(NewIrql); -} - - -/* - * @unimplemented - */ -VOID -FASTCALL -KeAcquireInStackQueuedSpinLock( - IN PKSPIN_LOCK SpinLock, - IN PKLOCK_QUEUE_HANDLE LockHandle - ) -{ - UNIMPLEMENTED; -} - -/* - * @unimplemented - */ -VOID -FASTCALL -KeAcquireInStackQueuedSpinLockRaiseToSynch( - IN PKSPIN_LOCK SpinLock, - IN PKLOCK_QUEUE_HANDLE LockHandle - ) -{ - UNIMPLEMENTED; -} - - -/* - * @unimplemented - */ -VOID -FASTCALL -KeReleaseInStackQueuedSpinLock( - IN PKLOCK_QUEUE_HANDLE LockHandle - ) -{ - UNIMPLEMENTED; -} - -/* - * @unimplemented - */ -KIRQL -FASTCALL -KeAcquireQueuedSpinLock(IN KSPIN_LOCK_QUEUE_NUMBER Number) -{ - UNIMPLEMENTED; - return 0; -} - -/* - * @unimplemented - */ -KIRQL -FASTCALL -KeAcquireQueuedSpinLockRaiseToSynch(IN KSPIN_LOCK_QUEUE_NUMBER LockNumber) -{ - UNIMPLEMENTED; - return 0; -} - -/* - * @unimplemented - */ -VOID -FASTCALL -KeReleaseQueuedSpinLock(IN KSPIN_LOCK_QUEUE_NUMBER Number, - IN KIRQL OldIrql) -{ - UNIMPLEMENTED; -} - -/* EOF */ Removed: branches/ros-amd64-bringup/reactos/hal/halx86/up/spinlock.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/hal/h…
============================================================================== --- branches/ros-amd64-bringup/reactos/hal/halx86/up/spinlock.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/hal/halx86/up/spinlock.c (removed) @@ -1,349 +1,0 @@ -/* - * PROJECT: ReactOS HAL - * LICENSE: GPL - See COPYING in the top level directory - * FILE: hal/halx86/up/spinlock.c - * PURPOSE: Spinlock and Queued Spinlock Support - * PROGRAMMERS: Alex Ionescu (alex.ionescu(a)reactos.org) - */ - -/* INCLUDES ******************************************************************/ - -/* Enable this (and the define in irq.S) to make UP HAL work for MP Kernel */ -/* #define CONFIG_SMP */ - -#include <hal.h> -#define NDEBUG -#include <debug.h> - -#undef KeAcquireSpinLock -#undef KeReleaseSpinLock - -// -// This is duplicated from ke_x.h -// -#ifdef CONFIG_SMP -// -// Spinlock Acquisition at IRQL >= DISPATCH_LEVEL -// -FORCEINLINE -VOID -KxAcquireSpinLock(IN PKSPIN_LOCK SpinLock) -{ - /* Make sure that we don't own the lock already */ - if (((KSPIN_LOCK)KeGetCurrentThread() | 1) == *SpinLock) - { - /* We do, bugcheck! */ - KeBugCheckEx(SPIN_LOCK_ALREADY_OWNED, (ULONG_PTR)SpinLock, 0, 0, 0); - } - - for (;;) - { - /* Try to acquire it */ - if (InterlockedBitTestAndSet((PLONG)SpinLock, 0)) - { - /* Value changed... wait until it's locked */ - while (*(volatile KSPIN_LOCK *)SpinLock == 1) - { -#ifdef DBG - /* On debug builds, we use a much slower but useful routine */ - //Kii386SpinOnSpinLock(SpinLock, 5); - - /* FIXME: Do normal yield for now */ - YieldProcessor(); -#else - /* Otherwise, just yield and keep looping */ - YieldProcessor(); -#endif - } - } - else - { -#ifdef DBG - /* On debug builds, we OR in the KTHREAD */ - *SpinLock = (KSPIN_LOCK)KeGetCurrentThread() | 1; -#endif - /* All is well, break out */ - break; - } - } -} - -// -// Spinlock Release at IRQL >= DISPATCH_LEVEL -// -FORCEINLINE -VOID -KxReleaseSpinLock(IN PKSPIN_LOCK SpinLock) -{ -#ifdef DBG - /* Make sure that the threads match */ - if (((KSPIN_LOCK)KeGetCurrentThread() | 1) != *SpinLock) - { - /* They don't, bugcheck */ - KeBugCheckEx(SPIN_LOCK_NOT_OWNED, (ULONG_PTR)SpinLock, 0, 0, 0); - } -#endif - /* Clear the lock */ - InterlockedAnd((PLONG)SpinLock, 0); -} - -#else - -// -// Spinlock Acquire at IRQL >= DISPATCH_LEVEL -// -FORCEINLINE -VOID -KxAcquireSpinLock(IN PKSPIN_LOCK SpinLock) -{ - /* On UP builds, spinlocks don't exist at IRQL >= DISPATCH */ - UNREFERENCED_PARAMETER(SpinLock); -} - -// -// Spinlock Release at IRQL >= DISPATCH_LEVEL -// -FORCEINLINE -VOID -KxReleaseSpinLock(IN PKSPIN_LOCK SpinLock) -{ - /* On UP builds, spinlocks don't exist at IRQL >= DISPATCH */ - UNREFERENCED_PARAMETER(SpinLock); -} - -#endif - -/* FUNCTIONS *****************************************************************/ - -/* - * @implemented - */ -VOID -NTAPI -KeAcquireSpinLock(PKSPIN_LOCK SpinLock, - PKIRQL OldIrql) -{ - /* Call the fastcall function */ - *OldIrql = KfAcquireSpinLock(SpinLock); -} - -/* - * @implemented - */ -KIRQL -FASTCALL -KeAcquireSpinLockRaiseToSynch(PKSPIN_LOCK SpinLock) -{ - KIRQL OldIrql; - - /* Raise to sync */ - KeRaiseIrql(SYNCH_LEVEL, &OldIrql); - - /* Acquire the lock and return */ - KxAcquireSpinLock(SpinLock); - return OldIrql; -} - -/* - * @implemented - */ -VOID -NTAPI -KeReleaseSpinLock(PKSPIN_LOCK SpinLock, - KIRQL NewIrql) -{ - /* Call the fastcall function */ - KfReleaseSpinLock(SpinLock, NewIrql); -} - -/* - * @implemented - */ -KIRQL -FASTCALL -KfAcquireSpinLock(PKSPIN_LOCK SpinLock) -{ - KIRQL OldIrql; - - /* Raise to dispatch and acquire the lock */ - KeRaiseIrql(DISPATCH_LEVEL, &OldIrql); - KxAcquireSpinLock(SpinLock); - return OldIrql; -} - -/* - * @implemented - */ -VOID -FASTCALL -KfReleaseSpinLock(PKSPIN_LOCK SpinLock, - KIRQL OldIrql) -{ - /* Release the lock and lower IRQL back */ - KxReleaseSpinLock(SpinLock); - KeLowerIrql(OldIrql); -} - -/* - * @implemented - */ -KIRQL -FASTCALL -KeAcquireQueuedSpinLock(IN KSPIN_LOCK_QUEUE_NUMBER LockNumber) -{ - KIRQL OldIrql; - - /* Raise to dispatch */ - KeRaiseIrql(DISPATCH_LEVEL, &OldIrql); - - /* Acquire the lock */ - KxAcquireSpinLock(KeGetCurrentPrcb()->LockQueue[LockNumber].Lock); // HACK - return OldIrql; -} - -/* - * @implemented - */ -KIRQL -FASTCALL -KeAcquireQueuedSpinLockRaiseToSynch(IN KSPIN_LOCK_QUEUE_NUMBER LockNumber) -{ - KIRQL OldIrql; - - /* Raise to synch */ - KeRaiseIrql(SYNCH_LEVEL, &OldIrql); - - /* Acquire the lock */ - KxAcquireSpinLock(KeGetCurrentPrcb()->LockQueue[LockNumber].Lock); // HACK - return OldIrql; -} - -/* - * @implemented - */ -VOID -FASTCALL -KeAcquireInStackQueuedSpinLock(IN PKSPIN_LOCK SpinLock, - IN PKLOCK_QUEUE_HANDLE LockHandle) -{ - /* Set up the lock */ - LockHandle->LockQueue.Next = NULL; - LockHandle->LockQueue.Lock = SpinLock; - - /* Raise to dispatch */ - KeRaiseIrql(DISPATCH_LEVEL, &LockHandle->OldIrql); - - /* Acquire the lock */ - KxAcquireSpinLock(LockHandle->LockQueue.Lock); // HACK -} - -/* - * @implemented - */ -VOID -FASTCALL -KeAcquireInStackQueuedSpinLockRaiseToSynch(IN PKSPIN_LOCK SpinLock, - IN PKLOCK_QUEUE_HANDLE LockHandle) -{ - /* Set up the lock */ - LockHandle->LockQueue.Next = NULL; - LockHandle->LockQueue.Lock = SpinLock; - - /* Raise to synch */ - KeRaiseIrql(SYNCH_LEVEL, &LockHandle->OldIrql); - - /* Acquire the lock */ - KxAcquireSpinLock(LockHandle->LockQueue.Lock); // HACK -} - -/* - * @implemented - */ -VOID -FASTCALL -KeReleaseQueuedSpinLock(IN KSPIN_LOCK_QUEUE_NUMBER LockNumber, - IN KIRQL OldIrql) -{ - /* Release the lock */ - KxReleaseSpinLock(KeGetCurrentPrcb()->LockQueue[LockNumber].Lock); // HACK - - /* Lower IRQL back */ - KeLowerIrql(OldIrql); -} - -/* - * @implemented - */ -VOID -FASTCALL -KeReleaseInStackQueuedSpinLock(IN PKLOCK_QUEUE_HANDLE LockHandle) -{ - /* Simply lower IRQL back */ - KxReleaseSpinLock(LockHandle->LockQueue.Lock); // HACK - KeLowerIrql(LockHandle->OldIrql); -} - -/* - * @implemented - */ -BOOLEAN -FASTCALL -KeTryToAcquireQueuedSpinLockRaiseToSynch(IN KSPIN_LOCK_QUEUE_NUMBER LockNumber, - IN PKIRQL OldIrql) -{ -#ifdef CONFIG_SMP - ASSERT(FALSE); // FIXME: Unused - while (TRUE); -#endif - - /* Simply raise to synch */ - KeRaiseIrql(SYNCH_LEVEL, OldIrql); - - /* Always return true on UP Machines */ - return TRUE; -} - -/* - * @implemented - */ -LOGICAL -FASTCALL -KeTryToAcquireQueuedSpinLock(IN KSPIN_LOCK_QUEUE_NUMBER LockNumber, - OUT PKIRQL OldIrql) -{ -#ifdef CONFIG_SMP - ASSERT(FALSE); // FIXME: Unused - while (TRUE); -#endif - - /* Simply raise to dispatch */ - KeRaiseIrql(DISPATCH_LEVEL, OldIrql); - - /* Always return true on UP Machines */ - return TRUE; -} - -#undef KeRaiseIrql -/* - * @implemented - */ -VOID -NTAPI -KeRaiseIrql(KIRQL NewIrql, - PKIRQL OldIrql) -{ - /* Call the fastcall function */ - *OldIrql = KfRaiseIrql(NewIrql); -} - -#undef KeLowerIrql -/* - * @implemented - */ -VOID -NTAPI -KeLowerIrql(KIRQL NewIrql) -{ - /* Call the fastcall function */ - KfLowerIrql(NewIrql); -}
14 years, 11 months
1
0
0
0
[tkreuzer] 44893: [NTOS] Move spinlock inline functions into their own header, so they can be shared with hal.
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Sat Jan 2 20:41:03 2010 New Revision: 44893 URL:
http://svn.reactos.org/svn/reactos?rev=44893&view=rev
Log: [NTOS] Move spinlock inline functions into their own header, so they can be shared with hal. Added: branches/ros-amd64-bringup/reactos/ntoskrnl/include/internal/spinlock.h (with props) Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/include/internal/ke_x.h branches/ros-amd64-bringup/reactos/ntoskrnl/include/internal/ntoskrnl.h Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/include/internal/ke_x.h URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
============================================================================== --- branches/ros-amd64-bringup/reactos/ntoskrnl/include/internal/ke_x.h [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/ntoskrnl/include/internal/ke_x.h [iso-8859-1] Sat Jan 2 20:41:03 2010 @@ -101,32 +101,7 @@ } \ } -VOID -NTAPI -Kii386SpinOnSpinLock(PKSPIN_LOCK SpinLock, ULONG Flags); - #ifndef CONFIG_SMP -// -// Spinlock Acquire at IRQL >= DISPATCH_LEVEL -// -FORCEINLINE -VOID -KxAcquireSpinLock(IN PKSPIN_LOCK SpinLock) -{ - /* On UP builds, spinlocks don't exist at IRQL >= DISPATCH */ - UNREFERENCED_PARAMETER(SpinLock); -} - -// -// Spinlock Release at IRQL >= DISPATCH_LEVEL -// -FORCEINLINE -VOID -KxReleaseSpinLock(IN PKSPIN_LOCK SpinLock) -{ - /* On UP builds, spinlocks don't exist at IRQL >= DISPATCH */ - UNREFERENCED_PARAMETER(SpinLock); -} // // This routine protects against multiple CPU acquires, it's meaningless on UP. @@ -306,62 +281,6 @@ } #else - -// -// Spinlock Acquisition at IRQL >= DISPATCH_LEVEL -// -FORCEINLINE -VOID -KxAcquireSpinLock(IN PKSPIN_LOCK SpinLock) -{ -#ifdef DBG - /* Make sure that we don't own the lock already */ - if (((KSPIN_LOCK)KeGetCurrentThread() | 1) == *SpinLock) - { - /* We do, bugcheck! */ - KeBugCheckEx(SPIN_LOCK_ALREADY_OWNED, (ULONG_PTR)SpinLock, 0, 0, 0); - } -#endif - - /* Try to acquire the lock */ - while (InterlockedBitTestAndSet((PLONG)SpinLock, 0)) - { -#if defined(_M_IX86) && defined(DBG) - /* On x86 debug builds, we use a much slower but useful routine */ - Kii386SpinOnSpinLock(SpinLock, 5); -#else - /* It's locked... spin until it's unlocked */ - while (*(volatile KSPIN_LOCK *)SpinLock & 1) - { - /* Yield and keep looping */ - YieldProcessor(); - } -#endif - } -#ifdef DBG - /* On debug builds, we OR in the KTHREAD */ - *SpinLock = (KSPIN_LOCK)KeGetCurrentThread() | 1; -#endif -} - -// -// Spinlock Release at IRQL >= DISPATCH_LEVEL -// -FORCEINLINE -VOID -KxReleaseSpinLock(IN PKSPIN_LOCK SpinLock) -{ -#if DBG - /* Make sure that the threads match */ - if (((KSPIN_LOCK)KeGetCurrentThread() | 1) != *SpinLock) - { - /* They don't, bugcheck */ - KeBugCheckEx(SPIN_LOCK_NOT_OWNED, (ULONG_PTR)SpinLock, 0, 0, 0); - } -#endif - /* Clear the lock */ - InterlockedAnd((PLONG)SpinLock, 0); -} FORCEINLINE VOID Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/include/internal/ntoskrnl.h URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
============================================================================== --- branches/ros-amd64-bringup/reactos/ntoskrnl/include/internal/ntoskrnl.h [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/ntoskrnl/include/internal/ntoskrnl.h [iso-8859-1] Sat Jan 2 20:41:03 2010 @@ -83,6 +83,7 @@ #include "../kdbg/kdb.h" #endif #include "dbgk.h" +#include "spinlock.h" #include "tag.h" #include "test.h" #include "inbv.h" Added: branches/ros-amd64-bringup/reactos/ntoskrnl/include/internal/spinlock.h URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
============================================================================== --- branches/ros-amd64-bringup/reactos/ntoskrnl/include/internal/spinlock.h (added) +++ branches/ros-amd64-bringup/reactos/ntoskrnl/include/internal/spinlock.h [iso-8859-1] Sat Jan 2 20:41:03 2010 @@ -1,0 +1,95 @@ +/* +* PROJECT: ReactOS Kernel +* LICENSE: GPL - See COPYING in the top level directory +* FILE: ntoskrnl/include/spinlock.h +* PURPOSE: Internal Inlined Functions for spinlocks, shared with HAL +* PROGRAMMERS: Alex Ionescu (alex.ionescu(a)reactos.org) +*/ + +VOID +NTAPI +Kii386SpinOnSpinLock(PKSPIN_LOCK SpinLock, ULONG Flags); + +#ifndef CONFIG_SMP + +// +// Spinlock Acquire at IRQL >= DISPATCH_LEVEL +// +FORCEINLINE +VOID +KxAcquireSpinLock(IN PKSPIN_LOCK SpinLock) +{ + /* On UP builds, spinlocks don't exist at IRQL >= DISPATCH */ + UNREFERENCED_PARAMETER(SpinLock); +} + +// +// Spinlock Release at IRQL >= DISPATCH_LEVEL +// +FORCEINLINE +VOID +KxReleaseSpinLock(IN PKSPIN_LOCK SpinLock) +{ + /* On UP builds, spinlocks don't exist at IRQL >= DISPATCH */ + UNREFERENCED_PARAMETER(SpinLock); +} + +#else + +// +// Spinlock Acquisition at IRQL >= DISPATCH_LEVEL +// +FORCEINLINE +VOID +KxAcquireSpinLock(IN PKSPIN_LOCK SpinLock) +{ +#ifdef DBG + /* Make sure that we don't own the lock already */ + if (((KSPIN_LOCK)KeGetCurrentThread() | 1) == *SpinLock) + { + /* We do, bugcheck! */ + KeBugCheckEx(SPIN_LOCK_ALREADY_OWNED, (ULONG_PTR)SpinLock, 0, 0, 0); + } +#endif + + /* Try to acquire the lock */ + while (InterlockedBitTestAndSet((PLONG)SpinLock, 0)) + { +#if defined(_M_IX86) && defined(DBG) + /* On x86 debug builds, we use a much slower but useful routine */ + Kii386SpinOnSpinLock(SpinLock, 5); +#else + /* It's locked... spin until it's unlocked */ + while (*(volatile KSPIN_LOCK *)SpinLock & 1) + { + /* Yield and keep looping */ + YieldProcessor(); + } +#endif + } +#ifdef DBG + /* On debug builds, we OR in the KTHREAD */ + *SpinLock = (KSPIN_LOCK)KeGetCurrentThread() | 1; +#endif +} + +// +// Spinlock Release at IRQL >= DISPATCH_LEVEL +// +FORCEINLINE +VOID +KxReleaseSpinLock(IN PKSPIN_LOCK SpinLock) +{ +#if DBG + /* Make sure that the threads match */ + if (((KSPIN_LOCK)KeGetCurrentThread() | 1) != *SpinLock) + { + /* They don't, bugcheck */ + KeBugCheckEx(SPIN_LOCK_NOT_OWNED, (ULONG_PTR)SpinLock, 0, 0, 0); + } +#endif + /* Clear the lock */ + InterlockedAnd((PLONG)SpinLock, 0); +} + +#endif Propchange: branches/ros-amd64-bringup/reactos/ntoskrnl/include/internal/spinlock.h ------------------------------------------------------------------------------ svn:eol-style = native
14 years, 11 months
1
0
0
0
[jimtabor] 44892: - Update region.c from wine head. This is needed for region testing of GetRegionData and related code.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Sat Jan 2 20:18:44 2010 New Revision: 44892 URL:
http://svn.reactos.org/svn/reactos?rev=44892&view=rev
Log: - Update region.c from wine head. This is needed for region testing of GetRegionData and related code. Modified: trunk/rostests/winetests/gdiplus/region.c Modified: trunk/rostests/winetests/gdiplus/region.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/gdiplus/region.…
============================================================================== --- trunk/rostests/winetests/gdiplus/region.c [iso-8859-1] (original) +++ trunk/rostests/winetests/gdiplus/region.c [iso-8859-1] Sat Jan 2 20:18:44 2010 @@ -364,7 +364,9 @@ expect_dword(buf + 5, 12); expect_magic((DWORD*)(buf + 6)); expect_dword(buf + 7, 0); - expect_dword(buf + 8, 0x00004000); + /* flags 0x4000 means its a path of shorts instead of FLOAT */ + ok((*(buf + 8) & (~ 0x00004000)) == 0x00000000, + "expected 00000000 got %08x\n", *(buf + 8) & (~ 0x00004000)); status = GdipDeleteRegion(region); expect(Ok, status); @@ -503,7 +505,8 @@ expect_float(buf + 25, 50); expect_float(buf + 26, 70.2); expect_dword(buf + 27, 0x01010100); - expect_dword(buf + 28, 0x00000101); + ok(*(buf + 28) == 0x00000101 || *(buf + 28) == 0x43050101 /* Win 7 */, + "expected 00000101 or 43050101 got %08x\n", *(buf + 28)); status = GdipDeletePath(path); expect(Ok, status); @@ -704,7 +707,7 @@ static void test_fromhrgn(void) { GpStatus status; - GpRegion *region; + GpRegion *region = (GpRegion*)0xabcdef01; HRGN hrgn; UINT needed; DWORD buf[220]; @@ -720,6 +723,7 @@ expect(InvalidParameter, status); status = GdipCreateRegionHrgn((HRGN)0xdeadbeef, ®ion); expect(InvalidParameter, status); + ok(region == (GpRegion*)0xabcdef01, "Expected region not to be created\n"); /* empty rectangle */ hrgn = CreateRectRgn(0, 0, 0, 0); @@ -788,21 +792,19 @@ /* ellipse */ hrgn = CreateEllipticRgn(0, 0, 100, 10); status = GdipCreateRegionHrgn(hrgn, ®ion); - todo_wine expect(Ok, status); + expect(Ok, status); status = GdipGetRegionDataSize(region, &needed); -todo_wine{ expect(Ok, status); ok(needed == 216 || needed == 196, /* win98 */ "Got %.8x\n", needed); -} + status = GdipGetRegionData(region, (BYTE*)buf, sizeof(buf), &needed); - todo_wine expect(Ok, status); + expect(Ok, status); if(status == Ok && needed == 216) /* Don't try to test win98 layout */ { -todo_wine{ expect(Ok, status); expect(216, needed); expect_dword(buf, 208); @@ -812,8 +814,7 @@ expect_dword(buf + 5, 0x000000C0); expect_magic((DWORD*)(buf + 6)); expect_dword(buf + 7, 0x00000024); - expect_dword(buf + 8, 0x00006000); /* ?? */ -} + todo_wine expect_dword(buf + 8, 0x00006000); /* ?? */ } GdipDeleteRegion(region); @@ -1176,10 +1177,440 @@ ok(rectf.Width == 100.0, "Expected width = 0.0, got %.2f\n", rectf.Width); ok(rectf.Height == 100.0, "Expected height = 0.0, got %.2f\n", rectf.Height); + /* the world and page transforms are ignored */ + GdipScaleWorldTransform(graphics, 2.0, 2.0, MatrixOrderPrepend); + GdipSetPageUnit(graphics, UnitInch); + GdipSetPageScale(graphics, 2.0); + status = GdipGetRegionBounds(region, graphics, &rectf); + ok(status == Ok, "status %08x\n", status); + ok(rectf.X == 10.0, "Expected X = 0.0, got %.2f\n", rectf.X); + ok(rectf.Y == 0.0, "Expected Y = 0.0, got %.2f\n", rectf.Y); + ok(rectf.Width == 100.0, "Expected width = 0.0, got %.2f\n", rectf.Width); + + rectf.X = 10.0; rectf.Y = 0.0; + rectf.Width = rectf.Height = 100.0; + status = GdipCombineRegionRect(region, &rectf, CombineModeReplace); + ok(status == Ok, "status %08x\n", status); + rectf.X = rectf.Y = 0.0; + rectf.Height = rectf.Width = 0.0; + status = GdipGetRegionBounds(region, graphics, &rectf); + ok(status == Ok, "status %08x\n", status); + ok(rectf.X == 10.0, "Expected X = 0.0, got %.2f\n", rectf.X); + ok(rectf.Y == 0.0, "Expected Y = 0.0, got %.2f\n", rectf.Y); + ok(rectf.Width == 100.0, "Expected width = 0.0, got %.2f\n", rectf.Width); + ok(rectf.Height == 100.0, "Expected height = 0.0, got %.2f\n", rectf.Height); + status = GdipDeleteRegion(region); ok(status == Ok, "status %08x\n", status); status = GdipDeleteGraphics(graphics); ok(status == Ok, "status %08x\n", status); + ReleaseDC(0, hdc); +} + +static void test_isvisiblepoint(void) +{ + HDC hdc = GetDC(0); + GpGraphics* graphics; + GpRegion* region; + GpPath* path; + GpRectF rectf; + GpStatus status; + BOOL res; + REAL x, y; + + status = GdipCreateFromHDC(hdc, &graphics); + expect(Ok, status); + + status = GdipCreateRegion(®ion); + expect(Ok, status); + + /* null parameters */ + status = GdipIsVisibleRegionPoint(NULL, 0, 0, graphics, &res); + expect(InvalidParameter, status); + status = GdipIsVisibleRegionPointI(NULL, 0, 0, graphics, &res); + expect(InvalidParameter, status); + + status = GdipIsVisibleRegionPoint(region, 0, 0, NULL, &res); + expect(Ok, status); + status = GdipIsVisibleRegionPointI(region, 0, 0, NULL, &res); + expect(Ok, status); + + status = GdipIsVisibleRegionPoint(region, 0, 0, graphics, NULL); + expect(InvalidParameter, status); + status = GdipIsVisibleRegionPointI(region, 0, 0, graphics, NULL); + expect(InvalidParameter, status); + + /* infinite region */ + status = GdipIsInfiniteRegion(region, graphics, &res); + expect(Ok, status); + ok(res == TRUE, "Region should be infinite\n"); + + x = 10; + y = 10; + status = GdipIsVisibleRegionPoint(region, x, y, graphics, &res); + expect(Ok, status); + ok(res == TRUE, "Expected (%.2f, %.2f) to be visible\n", x, y); + status = GdipIsVisibleRegionPointI(region, (INT)x, (INT)y, graphics, &res); + expect(Ok, status); + ok(res == TRUE, "Expected (%d, %d) to be visible\n", (INT)x, (INT)y); + + x = -10; + y = -10; + status = GdipIsVisibleRegionPoint(region, x, y, graphics, &res); + expect(Ok, status); + ok(res == TRUE, "Expected (%.2f, %.2f) to be visible\n", x, y); + status = GdipIsVisibleRegionPointI(region, (INT)x, (INT)y, graphics, &res); + expect(Ok, status); + ok(res == TRUE, "Expected (%d, %d) to be visible\n", (INT)x, (INT)y); + + /* rectangular region */ + rectf.X = 10; + rectf.Y = 20; + rectf.Width = 30; + rectf.Height = 40; + + status = GdipCombineRegionRect(region, &rectf, CombineModeReplace); + expect(Ok, status); + + x = 0; + y = 0; + status = GdipIsVisibleRegionPoint(region, x, y, graphics, &res); + expect(Ok, status); + ok(res == FALSE, "Expected (%.2f, %.2f) not to be visible\n", x, y); + status = GdipIsVisibleRegionPointI(region, (INT)x, (INT)y, graphics, &res); + expect(Ok, status); + ok(res == FALSE, "Expected (%d, %d) not to be visible\n", (INT)x, (INT)y); + + x = 9; + y = 19; + status = GdipIsVisibleRegionPoint(region, x, y, graphics, &res); + expect(Ok, status); + ok(res == FALSE, "Expected (%.2f, %.2f) to be visible\n", x, y); + + x = 9.25; + y = 19.25; + status = GdipIsVisibleRegionPoint(region, x, y, graphics, &res); + expect(Ok, status); + ok(res == FALSE, "Expected (%.2f, %.2f) to be visible\n", x, y); + + x = 9.5; + y = 19.5; + status = GdipIsVisibleRegionPoint(region, x, y, graphics, &res); + expect(Ok, status); + ok(res == TRUE, "Expected (%.2f, %.2f) to be visible\n", x, y); + + x = 9.75; + y = 19.75; + status = GdipIsVisibleRegionPoint(region, x, y, graphics, &res); + expect(Ok, status); + ok(res == TRUE, "Expected (%.2f, %.2f) to be visible\n", x, y); + + x = 10; + y = 20; + status = GdipIsVisibleRegionPoint(region, x, y, graphics, &res); + expect(Ok, status); + ok(res == TRUE, "Expected (%.2f, %.2f) to be visible\n", x, y); + + x = 25; + y = 40; + status = GdipIsVisibleRegionPoint(region, x, y, graphics, &res); + expect(Ok, status); + ok(res == TRUE, "Expected (%.2f, %.2f) to be visible\n", x, y); + status = GdipIsVisibleRegionPointI(region, (INT)x, (INT)y, graphics, &res); + expect(Ok, status); + ok(res == TRUE, "Expected (%d, %d) to be visible\n", (INT)x, (INT)y); + + x = 40; + y = 60; + status = GdipIsVisibleRegionPoint(region, x, y, graphics, &res); + expect(Ok, status); + ok(res == FALSE, "Expected (%.2f, %.2f) not to be visible\n", x, y); + status = GdipIsVisibleRegionPointI(region, (INT)x, (INT)y, graphics, &res); + expect(Ok, status); + ok(res == FALSE, "Expected (%d, %d) not to be visible\n", (INT)x, (INT)y); + + /* translate into the center of the rectangle */ + status = GdipTranslateWorldTransform(graphics, 25, 40, MatrixOrderAppend); + expect(Ok, status); + + /* native ignores the world transform, so treat these as if + * no transform exists */ + x = -20; + y = -30; + status = GdipIsVisibleRegionPoint(region, x, y, graphics, &res); + expect(Ok, status); + ok(res == FALSE, "Expected (%.2f, %.2f) not to be visible\n", x, y); + status = GdipIsVisibleRegionPointI(region, (INT)x, (INT)y, graphics, &res); + expect(Ok, status); + ok(res == FALSE, "Expected (%d, %d) not to be visible\n", (INT)x, (INT)y); + + x = 0; + y = 0; + status = GdipIsVisibleRegionPoint(region, x, y, graphics, &res); + expect(Ok, status); + ok(res == FALSE, "Expected (%.2f, %.2f) not to be visible\n", x, y); + status = GdipIsVisibleRegionPointI(region, (INT)x, (INT)y, graphics, &res); + expect(Ok, status); + ok(res == FALSE, "Expected (%d, %d) not to be visible\n", (INT)x, (INT)y); + + x = 25; + y = 40; + status = GdipIsVisibleRegionPoint(region, x, y, graphics, &res); + expect(Ok, status); + ok(res == TRUE, "Expected (%.2f, %.2f) to be visible\n", x, y); + status = GdipIsVisibleRegionPointI(region, (INT)x, (INT)y, graphics, &res); + expect(Ok, status); + ok(res == TRUE, "Expected (%d, %d) to be visible\n", (INT)x, (INT)y); + + /* translate back to origin */ + status = GdipTranslateWorldTransform(graphics, -25, -40, MatrixOrderAppend); + expect(Ok, status); + + /* region from path */ + status = GdipCreatePath(FillModeAlternate, &path); + expect(Ok, status); + + status = GdipAddPathEllipse(path, 10, 20, 30, 40); + expect(Ok, status); + + status = GdipCombineRegionPath(region, path, CombineModeReplace); + expect(Ok, status); + + x = 11; + y = 21; + status = GdipIsVisibleRegionPoint(region, x, y, graphics, &res); + expect(Ok, status); + ok(res == FALSE, "Expected (%.2f, %.2f) not to be visible\n", x, y); + status = GdipIsVisibleRegionPointI(region, (INT)x, (INT)y, graphics, &res); + expect(Ok, status); + ok(res == FALSE, "Expected (%d, %d) not to be visible\n", (INT)x, (INT)y); + + x = 25; + y = 40; + status = GdipIsVisibleRegionPoint(region, x, y, graphics, &res); + expect(Ok, status); + ok(res == TRUE, "Expected (%.2f, %.2f) to be visible\n", x, y); + status = GdipIsVisibleRegionPointI(region, (INT)x, (INT)y, graphics, &res); + expect(Ok, status); + ok(res == TRUE, "Expected (%d, %d) to be visible\n", (INT)x, (INT)y); + + x = 40; + y = 60; + status = GdipIsVisibleRegionPoint(region, x, y, graphics, &res); + expect(Ok, status); + ok(res == FALSE, "Expected (%.2f, %.2f) not to be visible\n", x, y); + status = GdipIsVisibleRegionPointI(region, (INT)x, (INT)y, graphics, &res); + expect(Ok, status); + ok(res == FALSE, "Expected (%d, %d) not to be visible\n", (INT)x, (INT)y); + + GdipDeletePath(path); + + GdipDeleteRegion(region); + GdipDeleteGraphics(graphics); + ReleaseDC(0, hdc); +} + +static void test_isvisiblerect(void) +{ + HDC hdc = GetDC(0); + GpGraphics* graphics; + GpRegion* region; + GpPath* path; + GpRectF rectf; + GpStatus status; + BOOL res; + REAL x, y, w, h; + + status = GdipCreateFromHDC(hdc, &graphics); + expect(Ok, status); + + status = GdipCreateRegion(®ion); + expect(Ok, status); + + /* null parameters */ + status = GdipIsVisibleRegionRect(NULL, 0, 0, 0, 0, graphics, &res); + expect(InvalidParameter, status); + status = GdipIsVisibleRegionRectI(NULL, 0, 0, 0, 0, graphics, &res); + expect(InvalidParameter, status); + + status = GdipIsVisibleRegionRect(region, 0, 0, 0, 0, NULL, &res); + expect(Ok, status); + status = GdipIsVisibleRegionRectI(region, 0, 0, 0, 0, NULL, &res); + expect(Ok, status); + + status = GdipIsVisibleRegionRect(region, 0, 0, 0, 0, graphics, NULL); + expect(InvalidParameter, status); + status = GdipIsVisibleRegionRectI(region, 0, 0, 0, 0, graphics, NULL); + expect(InvalidParameter, status); + + /* infinite region */ + status = GdipIsInfiniteRegion(region, graphics, &res); + expect(Ok, status); + ok(res == TRUE, "Region should be infinite\n"); + + x = 10; w = 10; + y = 10; h = 10; + status = GdipIsVisibleRegionRect(region, x, y, w, h, graphics, &res); + expect(Ok, status); + ok(res == TRUE, "Expected (%.2f, %.2f, %.2f, %.2f) to be visible\n", x, y, w, h); + + x = -10; w = 5; + y = -10; h = 5; + status = GdipIsVisibleRegionRect(region, x, y, w, h, graphics, &res); + expect(Ok, status); + ok(res == TRUE, "Expected (%.2f, %.2f, %.2f, %.2f) to be visible\n", x, y, w, h); + + /* rectangular region */ + rectf.X = 10; + rectf.Y = 20; + rectf.Width = 30; + rectf.Height = 40; + + status = GdipCombineRegionRect(region, &rectf, CombineModeIntersect); + expect(Ok, status); + + /* entirely within the region */ + x = 11; w = 10; + y = 12; h = 10; + status = GdipIsVisibleRegionRect(region, x, y, w, h, graphics, &res); + expect(Ok, status); + ok(res == TRUE, "Expected (%.2f, %.2f, %.2f, %.2f) to be visible\n", x, y, w, h); + status = GdipIsVisibleRegionRectI(region, (INT)x, (INT)y, (INT)w, (INT)h, graphics, &res); + expect(Ok, status); + ok(res == TRUE, "Expected (%d, %d, %d, %d) to be visible\n", (INT)x, (INT)y, (INT)w, (INT)h); + + /* entirely outside of the region */ + x = 0; w = 5; + y = 0; h = 5; + status = GdipIsVisibleRegionRect(region, x, y, w, h, graphics, &res); + expect(Ok, status); + ok(res == FALSE, "Expected (%.2f, %.2f, %.2f, %.2f) not to be visible\n", x, y, w, h); + status = GdipIsVisibleRegionRectI(region, (INT)x, (INT)y, (INT)w, (INT)h, graphics, &res); + expect(Ok, status); + ok(res == FALSE, "Expected (%d, %d, %d, %d) not to be visible\n", (INT)x, (INT)y, (INT)w, (INT)h); + + /* corner cases */ + x = 0; w = 10; + y = 0; h = 20; + status = GdipIsVisibleRegionRect(region, x, y, w, h, graphics, &res); + expect(Ok, status); + ok(res == FALSE, "Expected (%.2f, %.2f, %.2f, %.2f) not to be visible\n", x, y, w, h); + + x = 0; w = 10.25; + y = 0; h = 20.25; + status = GdipIsVisibleRegionRect(region, x, y, w, h, graphics, &res); + expect(Ok, status); + ok(res == TRUE, "Expected (%.2f, %.2f, %.2f, %.2f) to be visible\n", x, y, w, h); + + x = 39; w = 10; + y = 59; h = 10; + status = GdipIsVisibleRegionRect(region, x, y, w, h, graphics, &res); + expect(Ok, status); + ok(res == TRUE, "Expected (%.2f, %.2f, %.2f, %.2f) to be visible\n", x, y, w, h); + + x = 39.25; w = 10; + y = 59.25; h = 10; + status = GdipIsVisibleRegionRect(region, x, y, w, h, graphics, &res); + expect(Ok, status); + ok(res == FALSE, "Expected (%.2f, %.2f, %.2f, %.2f) not to be visible\n", x, y, w, h); + + /* corners outside, but some intersection */ + x = 0; w = 100; + y = 0; h = 100; + status = GdipIsVisibleRegionRect(region, x, y, w, h, graphics, &res); + expect(Ok, status); + ok(res == TRUE, "Expected (%.2f, %.2f, %.2f, %.2f) to be visible\n", x, y, w, h); + + x = 0; w = 100; + y = 0; h = 40; + status = GdipIsVisibleRegionRect(region, x, y, w, h, graphics, &res); + expect(Ok, status); + ok(res == TRUE, "Expected (%.2f, %.2f, %.2f, %.2f) to be visible\n", x, y, w, h); + + x = 0; w = 25; + y = 0; h = 100; + status = GdipIsVisibleRegionRect(region, x, y, w, h, graphics, &res); + expect(Ok, status); + ok(res == TRUE, "Expected (%.2f, %.2f, %.2f, %.2f) to be visible\n", x, y, w, h); + + /* translate into the center of the rectangle */ + status = GdipTranslateWorldTransform(graphics, 25, 40, MatrixOrderAppend); + expect(Ok, status); + + /* native ignores the world transform, so treat these as if + * no transform exists */ + x = 0; w = 5; + y = 0; h = 5; + status = GdipIsVisibleRegionRect(region, x, y, w, h, graphics, &res); + expect(Ok, status); + ok(res == FALSE, "Expected (%.2f, %.2f, %.2f, %.2f) not to be visible\n", x, y, w, h); + status = GdipIsVisibleRegionRectI(region, (INT)x, (INT)y, (INT)w, (INT)h, graphics, &res); + expect(Ok, status); + ok(res == FALSE, "Expected (%d, %d, %d, %d) not to be visible\n", (INT)x, (INT)y, (INT)w, (INT)h); + + x = 11; w = 10; + y = 12; h = 10; + status = GdipIsVisibleRegionRect(region, x, y, w, h, graphics, &res); + expect(Ok, status); + ok(res == TRUE, "Expected (%.2f, %.2f, %.2f, %.2f) to be visible\n", x, y, w, h); + status = GdipIsVisibleRegionRectI(region, (INT)x, (INT)y, (INT)w, (INT)h, graphics, &res); + expect(Ok, status); + ok(res == TRUE, "Expected (%d, %d, %d, %d) to be visible\n", (INT)x, (INT)y, (INT)w, (INT)h); + + /* translate back to origin */ + status = GdipTranslateWorldTransform(graphics, -25, -40, MatrixOrderAppend); + expect(Ok, status); + + /* region from path */ + status = GdipCreatePath(FillModeAlternate, &path); + expect(Ok, status); + + status = GdipAddPathEllipse(path, 10, 20, 30, 40); + expect(Ok, status); + + status = GdipCombineRegionPath(region, path, CombineModeReplace); + expect(Ok, status); + + x = 0; w = 12; + y = 0; h = 22; + status = GdipIsVisibleRegionRect(region, x, y, w, h, graphics, &res); + expect(Ok, status); + ok(res == FALSE, "Expected (%.2f, %.2f, %.2f, %.2f) not to be visible\n", x, y, w, h); + status = GdipIsVisibleRegionRectI(region, (INT)x, (INT)y, (INT)w, (INT)h, graphics, &res); + expect(Ok, status); + ok(res == FALSE, "Expected (%d, %d, %d, %d) not to be visible\n", (INT)x, (INT)y, (INT)w, (INT)h); + + x = 0; w = 25; + y = 0; h = 40; + status = GdipIsVisibleRegionRect(region, x, y, w, h, graphics, &res); + expect(Ok, status); + ok(res == TRUE, "Expected (%.2f, %.2f, %.2f, %.2f) to be visible\n", x, y, w, h); + status = GdipIsVisibleRegionRectI(region, (INT)x, (INT)y, (INT)w, (INT)h, graphics, &res); + expect(Ok, status); + ok(res == TRUE, "Expected (%d, %d, %d, %d) to be visible\n", (INT)x, (INT)y, (INT)w, (INT)h); + + x = 38; w = 10; + y = 55; h = 10; + status = GdipIsVisibleRegionRect(region, x, y, w, h, graphics, &res); + expect(Ok, status); + ok(res == FALSE, "Expected (%.2f, %.2f, %.2f, %.2f) not to be visible\n", x, y, w, h); + status = GdipIsVisibleRegionRectI(region, (INT)x, (INT)y, (INT)w, (INT)h, graphics, &res); + expect(Ok, status); + ok(res == FALSE, "Expected (%d, %d, %d, %d) not to be visible\n", (INT)x, (INT)y, (INT)w, (INT)h); + + x = 0; w = 100; + y = 0; h = 100; + status = GdipIsVisibleRegionRect(region, x, y, w, h, graphics, &res); + expect(Ok, status); + ok(res == TRUE, "Expected (%.2f, %.2f, %.2f, %.2f) to be visible\n", x, y, w, h); + status = GdipIsVisibleRegionRectI(region, (INT)x, (INT)y, (INT)w, (INT)h, graphics, &res); + expect(Ok, status); + ok(res == TRUE, "Expected (%d, %d, %d, %d) to be visible\n", (INT)x, (INT)y, (INT)w, (INT)h); + + GdipDeletePath(path); + + GdipDeleteRegion(region); + GdipDeleteGraphics(graphics); ReleaseDC(0, hdc); } @@ -1204,6 +1635,8 @@ test_isequal(); test_translate(); test_getbounds(); + test_isvisiblepoint(); + test_isvisiblerect(); GdiplusShutdown(gdiplusToken); }
14 years, 11 months
1
0
0
0
[tkreuzer] 44891: [NTDLL] - Add back missing exports See issue #5078 for more details.
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Sat Jan 2 18:55:17 2010 New Revision: 44891 URL:
http://svn.reactos.org/svn/reactos?rev=44891&view=rev
Log: [NTDLL] - Add back missing exports See issue #5078 for more details. Modified: trunk/reactos/dll/ntdll/def/ntdll.pspec Modified: trunk/reactos/dll/ntdll/def/ntdll.pspec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/ntdll/def/ntdll.pspec?…
============================================================================== --- trunk/reactos/dll/ntdll/def/ntdll.pspec [iso-8859-1] (original) +++ trunk/reactos/dll/ntdll/def/ntdll.pspec [iso-8859-1] Sat Jan 2 18:55:17 2010 @@ -412,6 +412,8 @@ @ stdcall RtlAcquirePebLock() @ stdcall RtlAcquireResourceExclusive(ptr long) @ stdcall RtlAcquireResourceShared(ptr long) +@ stdcall RtlAcquireSRWLockExclusive(ptr) +@ stdcall RtlAcquireSRWLockShared(ptr) @ stdcall RtlActivateActivationContext(long ptr ptr) //@ stdcall RtlActivateActivationContextEx @ stdcall RtlActivateActivationContextUnsafeFast(ptr ptr) @@ -713,6 +715,7 @@ @ stdcall RtlInitializeResource(ptr) @ stdcall RtlInitializeSListHead(ptr) @ stdcall RtlInitializeSid(ptr ptr long) +@ stdcall RtlInitializeSRWLock(ptr) //@ stdcall RtlInitializeStackTraceDataBase // 5.1 SP2 and SP3, and 5.2 only @ stdcall RtlInsertElementGenericTable(ptr ptr long ptr) @ stdcall RtlInsertElementGenericTableAvl(ptr ptr long ptr) @@ -842,6 +845,8 @@ //@ stdcall RtlReleaseMemoryStream @ stdcall RtlReleasePebLock() @ stdcall RtlReleaseResource(ptr) +@ stdcall RtlReleaseSRWLockExclusive(ptr) +@ stdcall RtlReleaseSRWLockShared(ptr) @ stdcall RtlRemoteCall(ptr ptr ptr long ptr long long) //@ stdcall RtlRemoveVectoredContinueHandler @ stdcall RtlRemoveVectoredExceptionHandler(ptr) @@ -892,6 +897,8 @@ @ stdcall RtlSetUserFlagsHeap(ptr long ptr long) @ stdcall RtlSetUserValueHeap(ptr long ptr ptr) @ stdcall RtlSizeHeap(long long ptr) +@ stdcall RtlSleepConditionVariableCS(ptr ptr ptr) +@ stdcall RtlSleepConditionVariableSRW(ptr ptr ptr long) @ stdcall RtlSplay(ptr) //@ stdcall RtlStartRXact //@ stdcall RtlStatMemoryStream
14 years, 11 months
1
0
0
0
[dgorbachev] 44890: Change base addresses of shlwapi.dll, syssetup.dll. Fix formatting.
by dgorbachev@svn.reactos.org
Author: dgorbachev Date: Sat Jan 2 18:07:46 2010 New Revision: 44890 URL:
http://svn.reactos.org/svn/reactos?rev=44890&view=rev
Log: Change base addresses of shlwapi.dll, syssetup.dll. Fix formatting. Modified: trunk/reactos/baseaddress.rbuild Modified: trunk/reactos/baseaddress.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/baseaddress.rbuild?rev=448…
============================================================================== --- trunk/reactos/baseaddress.rbuild [iso-8859-1] (original) +++ trunk/reactos/baseaddress.rbuild [iso-8859-1] Sat Jan 2 18:07:46 2010 @@ -1,257 +1,257 @@ <?xml version="1.0"?> <!DOCTYPE group SYSTEM "tools/rbuild/project.dtd"> <group xmlns:xi="
http://www.w3.org/2001/XInclude
"> - <property name="BASEADDRESS_REGTESTS" value="0x07000000" /> - <property name="BASEADDRESS_NOTIFYHOOK" value="0x08000000" /> - <property name="BASEADDRESS_QMGRPRXY" value="0x1F710000" /> - <property name="BASEADDRESS_CRYPTDLG" value="0x209C0000" /> - <property name="BASEADDRESS_COMCAT" value="0x20A50000" /> - <property name="BASEADDRESS_WINDOWSCODECS" value="0x26c40000" /> - <property name="BASEADDRESS_DEVENUM" value="0x35680000" /> - <property name="BASEADDRESS_RSABASE" value="0x35700000" /> - <property name="BASEADDRESS_RSAENH" value="0x35780000" /> - <property name="BASEADDRESS_URL" value="0x42ea0000" /> - <property name="BASEADDRESS_WLANAPI" value="0x470F0000" /> - <property name="BASEADDRESS_PIDGEN" value="0x473e0000" /> - <property name="BASEADDRESS_DWMAPI" value="0x4A3F0000" /> - <property name="BASEADDRESS_T2EMBED" value="0x4b310000" /> - <property name="BASEADDRESS_LOADPERF" value="0x4B920000" /> - <property name="BASEADDRESS_MPRAPI" value="0x4C400000" /> - <property name="BASEADDRESS_MSFTEDIT" value="0x4b460000" /> - <property name="BASEADDRESS_WUAPI" value="0x506a0000" /> - <property name="BASEADDRESS_SRCLIENT" value="0x512C0000" /> - <property name="BASEADDRESS_PSTOREC" value="0x513D0000" /> - <property name="BASEADDRESS_LPK" value="0x516C0000" /> - <property name="BASEADDRESS_MSGSM32ACM" value="0x56db0000" /> - <property name="BASEADDRESS_MSG711ACM" value="0x584f0000" /> - <property name="BASEADDRESS_IMAADP32ACM" value="0x585e0000" /> - <property name="BASEADDRESS_TELEPHON" value="0x58750000" /> - <property name="BASEADDRESS_PWRCFG" value="0x587e0000" /> - <property name="BASEADDRESS_MMSYS" value="0x588a0000" /> - <property name="BASEADDRESS_JOY" value="0x589b0000" /> - <property name="BASEADDRESS_QMGR" value="0x59620000" /> - <property name="BASEADDRESS_UXTHEME" value="0x5ad70000" /> - <property name="BASEADDRESS_VDMDBG" value="0x5b0d0000" /> - <property name="BASEADDRESS_UNTFS" value="0x5b340000" /> - <property name="BASEADDRESS_OBJSEL" value="0x5b400000" /> - <property name="BASEADDRESS_UFAT" value="0x5b570000" /> - <property name="BASEADDRESS_TAPIUI" value="0x5b770000" /> - <property name="BASEADDRESS_UEXT2" value="0x5b7a0000" /> - <property name="BASEADDRESS_SLAYER" value="0x5c7e0000" /> - <property name="BASEADDRESS_USRMGR" value="0x5c900000" /> - <property name="BASEADDRESS_SHIMGVW" value="0x5cb00000" /> - <property name="BASEADDRESS_COMMCTRL" value="0x5d090000" /> - <property name="BASEADDRESS_DPLAYX" value="0x5e080000" /> - <property name="BASEADDRESS_INPUT" value ="0x5e400000" /> - <property name="BASEADDRESS_NTLANMAN" value="0x5f380000" /> - <property name="BASEADDRESS_DINPUT" value="0x5f580000" /> - <property name="BASEADDRESS_NETID" value="0x5f660000" /> - <property name="BASEADDRESS_NTPRINT" value="0x5f6a0000" /> - <property name="BASEADDRESS_MSSIP32" value="0x60430000" /> - <property name="BASEADDRESS_MSISIP" value="0x60b10000" /> - <property name="BASEADDRESS_INSENG" value="0x61000000" /> - <property name="BASEADDRESS_QEDIT" value="0x611c0000" /> - <property name="BASEADDRESS_MODEMUI" value="0x61650000" /> - <property name="BASEADDRESS_MAPI32" value="0x62250000" /> - <property name="BASEADDRESS_MCIWAVE" value="0x622a0000" /> - <property name="BASEADDRESS_MCISEQ" value="0x622b0000" /> - <property name="BASEADDRESS_MCIQTZ32" value="0x622c0000" /> - <property name="BASEADDRESS_MCICDA" value="0x622e0000" /> - <property name="BASEADDRESS_LOCALUI" value="0x62f70000" /> - <property name="BASEADDRESS_HDWWIZ" value="0x64d40000" /> - <property name="BASEADDRESS_TIMEDATE" value="0x64da0000" /> - <property name="BASEADDRESS_SYSDM" value="0x64dd0000" /> - <property name="BASEADDRESS_NCPL" value="0x64ea0000" /> - <property name="BASEADDRESS_MAIN" value="0x64f40000" /> - <property name="BASEADDRESS_INTL" value="0x64fb0000" /> - <property name="BASEADDRESS_CONSOLE" value="0x6e4d0000" /> - <property name="BASEADDRESS_DESK" value="0x65080000" /> - <property name="BASEADDRESS_APPWIZ" value="0x65100000" /> - <property name="BASEADDRESS_MLANG" value="0x65140000" /> - <property name="BASEADDRESS_ACCESS" value="0x65180000" /> - <property name="BASEADDRESS_ITSS" value="0x66370000" /> - <property name="BASEADDRESS_ITIRCL" value="0x663a0000" /> - <property name="BASEADDRESS_INETMIB1" value="0x666f0000" /> - <property name="BASEADDRESS_INITPKI" value="0x66b00000" /> - <property name="BASEADDRESS_WSHTCPIP" value="0x677b0000" /> - <property name="BASEADDRESS_CRYPT32" value="0x67ab0000" /> - <property name="BASEADDRESS_HTTPAPI" value="0x67ae0000" /> - <property name="BASEADDRESS_HID" value="0x688f0000" /> - <property name="BASEADDRESS_PSXDLL" value="0x68eb0000" /> - <property name="BASEADDRESS_PSAPI" value="0x68f70000" /> - <property name="BASEADDRESS_KSPROXY" value="0x68f90000" /> - <property name="BASEADDRESS_GETUNAME" value="0x69110000" /> - <property name="BASEADDRESS_OLEACC" value="0x69640000" /> - <property name="BASEADDRESS_WINMM" value="0x697d0000" /> - <property name="BASEADDRESS_MSIMG32" value="0x69cc0000" /> - <property name="BASEADDRESS_BROWSEUI" value="0x69cd0000" /> - <property name="BASEADDRESS_NETPLWIZ" value="0x6a240000" /> - <property name="BASEADDRESS_SHELL32" value="0x6a360000" /> - <property name="BASEADDRESS_UNICODE" value="0x6b200000" /> - <property name="BASEADDRESS_ADVPACK" value="0x6b300000" /> - <property name="BASEADDRESS_CONTROL" value="0x6b310000" /> - <property name="BASEADDRESS_NCPA" value="0x6b320000" /> - <property name="BASEADDRESS_DBGHELP" value="0x6b330000" /> - <property name="BASEADDRESS_DINPUT8" value="0x6b340000" /> - <property name="BASEADDRESS_DXDIAGN" value="0x6b350000" /> - <property name="BASEADDRESS_DSOUND" value="0x6b360000" /> - <property name="BASEADDRESS_GLU32" value="0x6b370000" /> - <property name="BASEADDRESS_MESA32" value="0x6b380000" /> - <property name="BASEADDRESS_OPENGL32" value="0x6b390000" /> - <property name="BASEADDRESS_SECUR32" value="0x6b3a0000" /> - <property name="BASEADDRESS_SMDLL" value="0x6b3b0000" /> - <property name="BASEADDRESS_URLMON" value="0x6b3c0000" /> - <property name="BASEADDRESS_SERIALUI" value="0x6b3D0000" /> - <property name="BASEADDRESS_HLINK" value="0x6C6E0000" /> - <property name="BASEADDRESS_DESKMON" value="0x6d400000" /> - <property name="BASEADDRESS_DESKADP" value="0x6d410000" /> - <property name="BASEADDRESS_WLDAP32" value="0x6e130000" /> - <property name="BASEADDRESS_SXS" value="0x6e160000" /> - <property name="BASEADDRESS_SCHANNEL" value="0x6e360000" /> - <property name="BASEADDRESS_COMPSTUI" value="0x6ec10000" /> - <property name="BASEADDRESS_HNETCFG" value="0x6edb0000" /> - <property name="BASEADDRESS_CLB" value="0x6f2b0000" /> - <property name="BASEADDRESS_JSCRIPT" value="0x6fe80000" /> - <property name="BASEADDRESS_FONTEXT" value="0x6f7b0000" /> - <property name="BASEADDRESS_CARDS" value="0x701a0000" /> - <property name="BASEADDRESS_WININET" value="0x70200000" /> - <property name="BASEADDRESS_WINHTTP" value="0x70c60000" /> - <property name="BASEADDRESS_AMSTREAM" value="0x71030000" /> - <property name="BASEADDRESS_ACLUI" value="0x71550000" /> - <property name="BASEADDRESS_DHCPCSVC" value="0x71650000" /> - <property name="BASEADDRESS_SHDOCVW" value="0x71700000" /> - <property name="BASEADDRESS_ACTXPRXY" value="0x71800000" /> - <property name="BASEADDRESS_MSWSOCK" value="0x71a30000" /> - <property name="BASEADDRESS_WSOCK32" value="0x71ab0000" /> - <property name="BASEADDRESS_ACLEDIT" value="0x71b70000" /> - <property name="BASEADDRESS_NETAPI32" value="0x71c00000" /> - <property name="BASEADDRESS_OLESVR32" value="0x71dd0000" /> - <property name="BASEADDRESS_OLECLI32" value="0x71df0000" /> - <property name="BASEADDRESS_OLETHK32" value="0x71e10000" /> - <property name="BASEADDRESS_DPLAY" value="0x71e80000" /> - <property name="BASEADDRESS_SECURITY" value="0x71f10000" /> - <property name="BASEADDRESS_MSSIGN32" value="0x720c0000" /> - <property name="BASEADDRESS_CRYPTUI" value="0x720D0000" /> - <property name="BASEADDRESS_WINFAX" value="0x722C0000" /> - <property name="BASEADDRESS_WINSCARD" value="0x723d0000" /> - <property name="BASEADDRESS_DEVMGR" value="0x72a90000" /> - <property name="BASEADDRESS_MSADP32ACM" value="0x72cb0000" /> - <property name="BASEADDRESS_WDMAUD" value="0x72d20000" /> - <property name="BASEADDRESS_WINSPOOL" value="0x72f50000" /> - <property name="BASEADDRESS_SOFTPUB" value="0x73290000" /> - <property name="BASEADDRESS_MSCAT32" value="0x732b0000" /> - <property name="BASEADDRESS_MSTASK" value="0x73520000" /> - <property name="BASEADDRESS_TRAFFIC" value="0x73550000" /> - <property name="BASEADDRESS_MCIAVI32" value="0x73610000" /> - <property name="BASEADDRESS_MSVIDC32" value="0x73650000" /> - <property name="BASEADDRESS_MSRLE32" value="0x73660000" /> - <property name="BASEADDRESS_MSDMO" value="0x73670000" /> - <property name="BASEADDRESS_AVICAP32" value="0x739e0000" /> - <property name="BASEADDRESS_AVIFIL32" value="0x73ac0000" /> - <property name="BASEADDRESS_MSCMS" value="0x73af0000" /> - <property name="BASEADDRESS_DCIMAN32" value="0x73b10000" /> - <property name="BASEADDRESS_STI" value="0x73b60000" /> - <property name="BASEADDRESS_ICCVID" value="0x73bc0000" /> - <property name="BASEADDRESS_LZ32" value="0x73d80000" /> - <property name="BASEADDRESS_COREDLL" value="0x73d80000" /> - <property name="BASEADDRESS_KSUSER" value="0x73ea0000" /> - <property name="BASEADDRESS_ICMP" value="0x741f0000" /> - <property name="BASEADDRESS_SPOOLSS" value="0x742a0000" /> - <property name="BASEADDRESS_MSIMTF" value="0x746b0000" /> - <property name="BASEADDRESS_MSCTF" value="0x746e0000" /> - <property name="BASEADDRESS_QUARTZ" value="0x747d0000" /> - <property name="BASEADDRESS_USERENV" value="0x74850000" /> - <property name="BASEADDRESS_WS2_32" value="0x74aa0000" /> - <property name="BASEADDRESS_SYSSETUP" value="0x74a30000" /> - <property name="BASEADDRESS_POWRPROF" value="0x74ad0000" /> - <property name="BASEADDRESS_MSXML3" value="0x74ae0000" /> - <property name="BASEADDRESS_PRINTUI" value="0x74b40000" /> - <property name="BASEADDRESS_MMDRV" value="0x74c30000" /> - <property name="BASEADDRESS_PDH" value="0x74c70000" /> - <property name="BASEADDRESS_OLEDLG" value="0x74d00000" /> - <property name="BASEADDRESS_SAMSRV" value="0x74f30000" /> - <property name="BASEADDRESS_RESUTILS" value="0x75070000" /> - <property name="BASEADDRESS_SAMLIB" value="0x750C0000" /> - <property name="BASEADDRESS_CABINET" value="0x75120000" /> - <property name="BASEADDRESS_NETCFGX" value="0x755F0000" /> - <property name="BASEADDRESS_IPHLPAPI" value="0x75700000" /> - <property name="BASEADDRESS_NDDEAPI" value="0x75940000" /> - <property name="BASEADDRESS_MSGINA" value="0x75970000" /> - <property name="BASEADDRESS_LOCALSPL" value="0x75b80000" /> - <property name="BASEADDRESS_CRYPTNET" value="0x75e60000" /> - <property name="BASEADDRESS_RPCRT4" value="0x76000000" /> - <property name="BASEADDRESS_SHLWAPI" value="0x76120000" /> - <property name="BASEADDRESS_INETCOMM" value="0x76150000" /> - <property name="BASEADDRESS_COMCTL32" value="0x76160000" /> - <property name="BASEADDRESS_COMDLG32" value="0x76210000" /> - <property name="BASEADDRESS_WINSTA" value="0x762F0000" /> - <property name="BASEADDRESS_IMM32" value="0x76320000" /> - <property name="BASEADDRESS_RICHED32" value="0x76340000" /> - <property name="BASEADDRESS_D3D8THK" value="0x76340000" /> - <property name="BASEADDRESS_RICHED20" value="0x76360000" /> - <property name="BASEADDRESS_TWAIN_32" value="0x76380000" /> - <property name="BASEADDRESS_NETSHELL" value="0x76390000" /> - <property name="BASEADDRESS_LSASRV" value="0x76540000" /> - <property name="BASEADDRESS_MIDIMAP" value="0x76600000" /> - <property name="BASEADDRESS_ODBC32" value="0x76660000" /> - <property name="BASEADDRESS_MSHTML" value="0x76660000" /> - <property name="BASEADDRESS_ODBCCP32" value="0x76380000" /> - <property name="BASEADDRESS_WAVEMAP" value="0x76610000" /> - <property name="BASEADDRESS_MPR" value="0x76620000" /> - <property name="BASEADDRESS_SETUPAPI" value="0x76660000" /> - <property name="BASEADDRESS_CRYPTDLL" value="0x76740000" /> - <property name="BASEADDRESS_SHFOLDER" value="0x76760000" /> - <property name="BASEADDRESS_NTDSAPI" value="0x76780000" /> - <property name="BASEADDRESS_NTMARTA" value="0x768A0000" /> - <property name="BASEADDRESS_RASDLG" value="0x768d0000" /> - <property name="BASEADDRESS_GDIPLUS" value="0x76a00000" /> - <property name="BASEADDRESS_ATL" value="0x76a80000" /> - <property name="BASEADDRESS_SFC" value="0x76b50000" /> - <property name="BASEADDRESS_CREDUI" value="0x76bf0000" /> - <property name="BASEADDRESS_SFC_OS" value="0x76c10000" /> - <property name="BASEADDRESS_WINTRUST" value="0x76c30000" /> - <property name="BASEADDRESS_IMAGEHLP" value="0x76c90000" /> - <property name="BASEADDRESS_CLUSAPI" value="0x76d10000" /> - <property name="BASEADDRESS_WMI" value="0x76d20000" /> - <property name="BASEADDRESS_DHCPCSVC" value="0x76d80000" /> - <property name="BASEADDRESS_FMIFS" value="0x76df0000" /> - <property name="BASEADDRESS_OLEAUT32" value="0x76e00000" /> - <property name="BASEADDRESS_TAPI32" value="0x76e60000" /> - <property name="BASEADDRESS_RASMAN" value="0x76e90000" /> - <property name="BASEADDRESS_RASAPI32" value="0x76ee0000" /> - <property name="BASEADDRESS_WTSAPI32" value="0x76f50000" /> - <property name="BASEADDRESS_MSVFW32" value="0x76f60000" /> - <property name="BASEADDRESS_MSACM32" value="0x77400000" /> - <property name="BASEADDRESS_CRTDLL" value="0x77630000" /> - <property name="BASEADDRESS_AUTHZ" value="0x77690000" /> - <property name="BASEADDRESS_CFGMGR32" value="0x77700000" /> - <property name="BASEADDRESS_SENSAPI" value="0x77700000" /> - <property name="BASEADDRESS_PACKET" value="0x77780000" /> - <property name="BASEADDRESS_MSAFD" value="0x77780000" /> - <property name="BASEADDRESS_MSI" value="0x77790000" /> - <property name="BASEADDRESS_SNMPAPI" value="0x777a0000" /> - <property name="BASEADDRESS_USP10" value="0x777b0000" /> - <property name="BASEADDRESS_IPRTPRIO" value="0x777c0000" /> - <property name="BASEADDRESS_WS2HELP" value="0x777e0000" /> - <property name="BASEADDRESS_WSHIRDA" value="0x777f0000" /> - <property name="BASEADDRESS_VERSION" value="0x77a40000" /> - <property name="BASEADDRESS_OLE32" value="0x77a50000" /> - <property name="BASEADDRESS_OLEPRO32" value="0x77b10000" /> - <property name="BASEADDRESS_ACTIVEDS" value="0x77cb0000" /> - <property name="BASEADDRESS_ADVAPI32" value="0x77dc0000" /> - <property name="BASEADDRESS_USER32" value="0x77e50000" /> - <property name="BASEADDRESS_GDI32" value="0x77f70000" /> - <property name="BASEADDRESS_DNSAPI" value="0x77fb0000" /> - <property name="BASEADDRESS_MSVCRT" value="0x78000000" /> - <property name="BASEADDRESS_MSVCRT20" value="0x78500000" /> - <property name="BASEADDRESS_MSVCRT40" value="0x78700000" /> - <property name="BASEADDRESS_MSCOREE" value="0x79000000" /> - <property name="BASEADDRESS_FUSION" value="0x79040000" /> - <property name="BASEADDRESS_KERNEL32" value="0x7c700000" /> - <property name="BASEADDRESS_NTDLL" value="0x7c900000" /> - <property name="BASEADDRESS_QUERY" value="0x7d9a0000" /> - <property name="BASEADDRESS_HHCTRL" value="0x7e410000" /> - <property name="BASEADDRESS_SXS" value="0x7e690000" /> - <property name="BASEADDRESS_BEEPMIDI" value="0x7ef0000" /> - <property name="BASEADDRESS_FREETYPE" value="0x7f000000" /> + <property name="BASEADDRESS_REGTESTS" value="0x07000000" /> + <property name="BASEADDRESS_NOTIFYHOOK" value="0x08000000" /> + <property name="BASEADDRESS_QMGRPRXY" value="0x1f710000" /> + <property name="BASEADDRESS_CRYPTDLG" value="0x209c0000" /> + <property name="BASEADDRESS_COMCAT" value="0x20a50000" /> + <property name="BASEADDRESS_WINDOWSCODECS" value="0x26c40000" /> + <property name="BASEADDRESS_DEVENUM" value="0x35680000" /> + <property name="BASEADDRESS_RSABASE" value="0x35700000" /> + <property name="BASEADDRESS_RSAENH" value="0x35780000" /> + <property name="BASEADDRESS_URL" value="0x42ea0000" /> + <property name="BASEADDRESS_WLANAPI" value="0x470f0000" /> + <property name="BASEADDRESS_PIDGEN" value="0x473e0000" /> + <property name="BASEADDRESS_DWMAPI" value="0x4a3f0000" /> + <property name="BASEADDRESS_T2EMBED" value="0x4b310000" /> + <property name="BASEADDRESS_MSFTEDIT" value="0x4b460000" /> + <property name="BASEADDRESS_LOADPERF" value="0x4b920000" /> + <property name="BASEADDRESS_MPRAPI" value="0x4c400000" /> + <property name="BASEADDRESS_WUAPI" value="0x506a0000" /> + <property name="BASEADDRESS_SRCLIENT" value="0x512c0000" /> + <property name="BASEADDRESS_PSTOREC" value="0x513d0000" /> + <property name="BASEADDRESS_LPK" value="0x516c0000" /> + <property name="BASEADDRESS_MSGSM32ACM" value="0x56db0000" /> + <property name="BASEADDRESS_MSG711ACM" value="0x584f0000" /> + <property name="BASEADDRESS_IMAADP32ACM" value="0x585e0000" /> + <property name="BASEADDRESS_TELEPHON" value="0x58750000" /> + <property name="BASEADDRESS_PWRCFG" value="0x587e0000" /> + <property name="BASEADDRESS_MMSYS" value="0x588a0000" /> + <property name="BASEADDRESS_JOY" value="0x589b0000" /> + <property name="BASEADDRESS_QMGR" value="0x59620000" /> + <property name="BASEADDRESS_UXTHEME" value="0x5ad70000" /> + <property name="BASEADDRESS_VDMDBG" value="0x5b0d0000" /> + <property name="BASEADDRESS_UNTFS" value="0x5b340000" /> + <property name="BASEADDRESS_OBJSEL" value="0x5b400000" /> + <property name="BASEADDRESS_UFAT" value="0x5b570000" /> + <property name="BASEADDRESS_TAPIUI" value="0x5b770000" /> + <property name="BASEADDRESS_UEXT2" value="0x5b7a0000" /> + <property name="BASEADDRESS_SLAYER" value="0x5c7e0000" /> + <property name="BASEADDRESS_USRMGR" value="0x5c900000" /> + <property name="BASEADDRESS_SHIMGVW" value="0x5cb00000" /> + <property name="BASEADDRESS_COMMCTRL" value="0x5d090000" /> + <property name="BASEADDRESS_DPLAYX" value="0x5e080000" /> + <property name="BASEADDRESS_INPUT" value="0x5e400000" /> + <property name="BASEADDRESS_NTLANMAN" value="0x5f380000" /> + <property name="BASEADDRESS_DINPUT" value="0x5f580000" /> + <property name="BASEADDRESS_NETID" value="0x5f660000" /> + <property name="BASEADDRESS_NTPRINT" value="0x5f6a0000" /> + <property name="BASEADDRESS_MSSIP32" value="0x60430000" /> + <property name="BASEADDRESS_MSISIP" value="0x60b10000" /> + <property name="BASEADDRESS_INSENG" value="0x61000000" /> + <property name="BASEADDRESS_QEDIT" value="0x611c0000" /> + <property name="BASEADDRESS_MODEMUI" value="0x61650000" /> + <property name="BASEADDRESS_MAPI32" value="0x62250000" /> + <property name="BASEADDRESS_MCIWAVE" value="0x622a0000" /> + <property name="BASEADDRESS_MCISEQ" value="0x622b0000" /> + <property name="BASEADDRESS_MCIQTZ32" value="0x622c0000" /> + <property name="BASEADDRESS_MCICDA" value="0x622e0000" /> + <property name="BASEADDRESS_LOCALUI" value="0x62f70000" /> + <property name="BASEADDRESS_HDWWIZ" value="0x64d40000" /> + <property name="BASEADDRESS_TIMEDATE" value="0x64da0000" /> + <property name="BASEADDRESS_SYSDM" value="0x64dd0000" /> + <property name="BASEADDRESS_NCPL" value="0x64ea0000" /> + <property name="BASEADDRESS_MAIN" value="0x64f40000" /> + <property name="BASEADDRESS_INTL" value="0x64fb0000" /> + <property name="BASEADDRESS_DESK" value="0x65080000" /> + <property name="BASEADDRESS_APPWIZ" value="0x65100000" /> + <property name="BASEADDRESS_MLANG" value="0x65140000" /> + <property name="BASEADDRESS_ACCESS" value="0x65180000" /> + <property name="BASEADDRESS_ITSS" value="0x66370000" /> + <property name="BASEADDRESS_ITIRCL" value="0x663a0000" /> + <property name="BASEADDRESS_INETMIB1" value="0x666f0000" /> + <property name="BASEADDRESS_INITPKI" value="0x66b00000" /> + <property name="BASEADDRESS_WSHTCPIP" value="0x677b0000" /> + <property name="BASEADDRESS_CRYPT32" value="0x67ab0000" /> + <property name="BASEADDRESS_HTTPAPI" value="0x67ae0000" /> + <property name="BASEADDRESS_HID" value="0x688f0000" /> + <property name="BASEADDRESS_PSXDLL" value="0x68eb0000" /> + <property name="BASEADDRESS_PSAPI" value="0x68f70000" /> + <property name="BASEADDRESS_KSPROXY" value="0x68f90000" /> + <property name="BASEADDRESS_GETUNAME" value="0x69110000" /> + <property name="BASEADDRESS_OLEACC" value="0x69640000" /> + <property name="BASEADDRESS_WINMM" value="0x697d0000" /> + <property name="BASEADDRESS_MSIMG32" value="0x69cc0000" /> + <property name="BASEADDRESS_BROWSEUI" value="0x69cd0000" /> + <property name="BASEADDRESS_NETPLWIZ" value="0x6a240000" /> + <property name="BASEADDRESS_SHELL32" value="0x6a360000" /> + <property name="BASEADDRESS_UNICODE" value="0x6b200000" /> + <property name="BASEADDRESS_ADVPACK" value="0x6b300000" /> + <property name="BASEADDRESS_CONTROL" value="0x6b310000" /> + <property name="BASEADDRESS_NCPA" value="0x6b320000" /> + <property name="BASEADDRESS_DBGHELP" value="0x6b330000" /> + <property name="BASEADDRESS_DINPUT8" value="0x6b340000" /> + <property name="BASEADDRESS_DXDIAGN" value="0x6b350000" /> + <property name="BASEADDRESS_DSOUND" value="0x6b360000" /> + <property name="BASEADDRESS_GLU32" value="0x6b370000" /> + <property name="BASEADDRESS_MESA32" value="0x6b380000" /> + <property name="BASEADDRESS_OPENGL32" value="0x6b390000" /> + <property name="BASEADDRESS_SECUR32" value="0x6b3a0000" /> + <property name="BASEADDRESS_SMDLL" value="0x6b3b0000" /> + <property name="BASEADDRESS_URLMON" value="0x6b3c0000" /> + <property name="BASEADDRESS_SERIALUI" value="0x6b3d0000" /> + <property name="BASEADDRESS_HLINK" value="0x6c6e0000" /> + <property name="BASEADDRESS_DESKMON" value="0x6d400000" /> + <property name="BASEADDRESS_DESKADP" value="0x6d410000" /> + <property name="BASEADDRESS_WLDAP32" value="0x6e130000" /> + <property name="BASEADDRESS_SXS" value="0x6e160000" /> + <property name="BASEADDRESS_SCHANNEL" value="0x6e360000" /> + <property name="BASEADDRESS_CONSOLE" value="0x6e4d0000" /> + <property name="BASEADDRESS_COMPSTUI" value="0x6ec10000" /> + <property name="BASEADDRESS_HNETCFG" value="0x6edb0000" /> + <property name="BASEADDRESS_CLB" value="0x6f2b0000" /> + <property name="BASEADDRESS_FONTEXT" value="0x6f7b0000" /> + <property name="BASEADDRESS_JSCRIPT" value="0x6fe80000" /> + <property name="BASEADDRESS_CARDS" value="0x701a0000" /> + <property name="BASEADDRESS_WININET" value="0x70200000" /> + <property name="BASEADDRESS_WINHTTP" value="0x70c60000" /> + <property name="BASEADDRESS_AMSTREAM" value="0x71030000" /> + <property name="BASEADDRESS_ACLUI" value="0x71550000" /> + <property name="BASEADDRESS_DHCPCSVC" value="0x71650000" /> + <property name="BASEADDRESS_SHDOCVW" value="0x71700000" /> + <property name="BASEADDRESS_ACTXPRXY" value="0x71800000" /> + <property name="BASEADDRESS_MSWSOCK" value="0x71a30000" /> + <property name="BASEADDRESS_WSOCK32" value="0x71ab0000" /> + <property name="BASEADDRESS_ACLEDIT" value="0x71b70000" /> + <property name="BASEADDRESS_NETAPI32" value="0x71c00000" /> + <property name="BASEADDRESS_OLESVR32" value="0x71dd0000" /> + <property name="BASEADDRESS_OLECLI32" value="0x71df0000" /> + <property name="BASEADDRESS_OLETHK32" value="0x71e10000" /> + <property name="BASEADDRESS_DPLAY" value="0x71e80000" /> + <property name="BASEADDRESS_SECURITY" value="0x71f10000" /> + <property name="BASEADDRESS_MSSIGN32" value="0x720c0000" /> + <property name="BASEADDRESS_CRYPTUI" value="0x720d0000" /> + <property name="BASEADDRESS_WINFAX" value="0x722c0000" /> + <property name="BASEADDRESS_WINSCARD" value="0x723d0000" /> + <property name="BASEADDRESS_DEVMGR" value="0x72a90000" /> + <property name="BASEADDRESS_MSADP32ACM" value="0x72cb0000" /> + <property name="BASEADDRESS_WDMAUD" value="0x72d20000" /> + <property name="BASEADDRESS_WINSPOOL" value="0x72f50000" /> + <property name="BASEADDRESS_SOFTPUB" value="0x73290000" /> + <property name="BASEADDRESS_MSCAT32" value="0x732b0000" /> + <property name="BASEADDRESS_MSTASK" value="0x73520000" /> + <property name="BASEADDRESS_TRAFFIC" value="0x73550000" /> + <property name="BASEADDRESS_MCIAVI32" value="0x73610000" /> + <property name="BASEADDRESS_MSVIDC32" value="0x73650000" /> + <property name="BASEADDRESS_MSRLE32" value="0x73660000" /> + <property name="BASEADDRESS_MSDMO" value="0x73670000" /> + <property name="BASEADDRESS_AVICAP32" value="0x739e0000" /> + <property name="BASEADDRESS_AVIFIL32" value="0x73ac0000" /> + <property name="BASEADDRESS_MSCMS" value="0x73af0000" /> + <property name="BASEADDRESS_DCIMAN32" value="0x73b10000" /> + <property name="BASEADDRESS_STI" value="0x73b60000" /> + <property name="BASEADDRESS_ICCVID" value="0x73bc0000" /> + <property name="BASEADDRESS_COREDLL" value="0x73d80000" /> + <property name="BASEADDRESS_LZ32" value="0x73d80000" /> + <property name="BASEADDRESS_KSUSER" value="0x73ea0000" /> + <property name="BASEADDRESS_ICMP" value="0x741f0000" /> + <property name="BASEADDRESS_SPOOLSS" value="0x742a0000" /> + <property name="BASEADDRESS_MSIMTF" value="0x746b0000" /> + <property name="BASEADDRESS_MSCTF" value="0x746e0000" /> + <property name="BASEADDRESS_QUARTZ" value="0x747d0000" /> + <property name="BASEADDRESS_USERENV" value="0x74850000" /> + <property name="BASEADDRESS_SYSSETUP" value="0x74a10000" /> + <property name="BASEADDRESS_WS2_32" value="0x74aa0000" /> + <property name="BASEADDRESS_POWRPROF" value="0x74ad0000" /> + <property name="BASEADDRESS_MSXML3" value="0x74ae0000" /> + <property name="BASEADDRESS_PRINTUI" value="0x74b40000" /> + <property name="BASEADDRESS_MMDRV" value="0x74c30000" /> + <property name="BASEADDRESS_PDH" value="0x74c70000" /> + <property name="BASEADDRESS_OLEDLG" value="0x74d00000" /> + <property name="BASEADDRESS_SAMSRV" value="0x74f30000" /> + <property name="BASEADDRESS_RESUTILS" value="0x75070000" /> + <property name="BASEADDRESS_SAMLIB" value="0x750c0000" /> + <property name="BASEADDRESS_CABINET" value="0x75120000" /> + <property name="BASEADDRESS_NETCFGX" value="0x755f0000" /> + <property name="BASEADDRESS_IPHLPAPI" value="0x75700000" /> + <property name="BASEADDRESS_NDDEAPI" value="0x75940000" /> + <property name="BASEADDRESS_MSGINA" value="0x75970000" /> + <property name="BASEADDRESS_LOCALSPL" value="0x75b80000" /> + <property name="BASEADDRESS_CRYPTNET" value="0x75e60000" /> + <property name="BASEADDRESS_RPCRT4" value="0x76000000" /> + <property name="BASEADDRESS_SHLWAPI" value="0x76100000" /> + <property name="BASEADDRESS_INETCOMM" value="0x76150000" /> + <property name="BASEADDRESS_COMCTL32" value="0x76160000" /> + <property name="BASEADDRESS_COMDLG32" value="0x76210000" /> + <property name="BASEADDRESS_WINSTA" value="0x762f0000" /> + <property name="BASEADDRESS_IMM32" value="0x76320000" /> + <property name="BASEADDRESS_D3D8THK" value="0x76340000" /> + <property name="BASEADDRESS_RICHED32" value="0x76340000" /> + <property name="BASEADDRESS_RICHED20" value="0x76360000" /> + <property name="BASEADDRESS_ODBCCP32" value="0x76380000" /> + <property name="BASEADDRESS_TWAIN_32" value="0x76380000" /> + <property name="BASEADDRESS_NETSHELL" value="0x76390000" /> + <property name="BASEADDRESS_LSASRV" value="0x76540000" /> + <property name="BASEADDRESS_MIDIMAP" value="0x76600000" /> + <property name="BASEADDRESS_WAVEMAP" value="0x76610000" /> + <property name="BASEADDRESS_MPR" value="0x76620000" /> + <property name="BASEADDRESS_MSHTML" value="0x76660000" /> + <property name="BASEADDRESS_ODBC32" value="0x76660000" /> + <property name="BASEADDRESS_SETUPAPI" value="0x76660000" /> + <property name="BASEADDRESS_CRYPTDLL" value="0x76740000" /> + <property name="BASEADDRESS_SHFOLDER" value="0x76760000" /> + <property name="BASEADDRESS_NTDSAPI" value="0x76780000" /> + <property name="BASEADDRESS_NTMARTA" value="0x768a0000" /> + <property name="BASEADDRESS_RASDLG" value="0x768d0000" /> + <property name="BASEADDRESS_GDIPLUS" value="0x76a00000" /> + <property name="BASEADDRESS_ATL" value="0x76a80000" /> + <property name="BASEADDRESS_SFC" value="0x76b50000" /> + <property name="BASEADDRESS_CREDUI" value="0x76bf0000" /> + <property name="BASEADDRESS_SFC_OS" value="0x76c10000" /> + <property name="BASEADDRESS_WINTRUST" value="0x76c30000" /> + <property name="BASEADDRESS_IMAGEHLP" value="0x76c90000" /> + <property name="BASEADDRESS_CLUSAPI" value="0x76d10000" /> + <property name="BASEADDRESS_WMI" value="0x76d20000" /> + <property name="BASEADDRESS_DHCPCSVC" value="0x76d80000" /> + <property name="BASEADDRESS_FMIFS" value="0x76df0000" /> + <property name="BASEADDRESS_OLEAUT32" value="0x76e00000" /> + <property name="BASEADDRESS_TAPI32" value="0x76e60000" /> + <property name="BASEADDRESS_RASMAN" value="0x76e90000" /> + <property name="BASEADDRESS_RASAPI32" value="0x76ee0000" /> + <property name="BASEADDRESS_WTSAPI32" value="0x76f50000" /> + <property name="BASEADDRESS_MSVFW32" value="0x76f60000" /> + <property name="BASEADDRESS_MSACM32" value="0x77400000" /> + <property name="BASEADDRESS_CRTDLL" value="0x77630000" /> + <property name="BASEADDRESS_AUTHZ" value="0x77690000" /> + <property name="BASEADDRESS_CFGMGR32" value="0x77700000" /> + <property name="BASEADDRESS_SENSAPI" value="0x77700000" /> + <property name="BASEADDRESS_MSAFD" value="0x77780000" /> + <property name="BASEADDRESS_PACKET" value="0x77780000" /> + <property name="BASEADDRESS_MSI" value="0x77790000" /> + <property name="BASEADDRESS_SNMPAPI" value="0x777a0000" /> + <property name="BASEADDRESS_USP10" value="0x777b0000" /> + <property name="BASEADDRESS_IPRTPRIO" value="0x777c0000" /> + <property name="BASEADDRESS_WS2HELP" value="0x777e0000" /> + <property name="BASEADDRESS_WSHIRDA" value="0x777f0000" /> + <property name="BASEADDRESS_VERSION" value="0x77a40000" /> + <property name="BASEADDRESS_OLE32" value="0x77a50000" /> + <property name="BASEADDRESS_OLEPRO32" value="0x77b10000" /> + <property name="BASEADDRESS_ACTIVEDS" value="0x77cb0000" /> + <property name="BASEADDRESS_ADVAPI32" value="0x77dc0000" /> + <property name="BASEADDRESS_USER32" value="0x77e50000" /> + <property name="BASEADDRESS_GDI32" value="0x77f70000" /> + <property name="BASEADDRESS_DNSAPI" value="0x77fb0000" /> + <property name="BASEADDRESS_MSVCRT" value="0x78000000" /> + <property name="BASEADDRESS_MSVCRT20" value="0x78500000" /> + <property name="BASEADDRESS_MSVCRT40" value="0x78700000" /> + <property name="BASEADDRESS_MSCOREE" value="0x79000000" /> + <property name="BASEADDRESS_FUSION" value="0x79040000" /> + <property name="BASEADDRESS_KERNEL32" value="0x7c700000" /> + <property name="BASEADDRESS_NTDLL" value="0x7c900000" /> + <property name="BASEADDRESS_QUERY" value="0x7d9a0000" /> + <property name="BASEADDRESS_HHCTRL" value="0x7e410000" /> + <property name="BASEADDRESS_SXS" value="0x7e690000" /> + <property name="BASEADDRESS_BEEPMIDI" value="0x7ef00000" /> + <property name="BASEADDRESS_FREETYPE" value="0x7f000000" /> </group>
14 years, 11 months
1
0
0
0
[ekohl] 44889: [devmgr] Display 'Devnode Flags' property.
by ekohl@svn.reactos.org
Author: ekohl Date: Sat Jan 2 17:59:54 2010 New Revision: 44889 URL:
http://svn.reactos.org/svn/reactos?rev=44889&view=rev
Log: [devmgr] Display 'Devnode Flags' property. Modified: trunk/reactos/dll/win32/devmgr/advprop.c Modified: trunk/reactos/dll/win32/devmgr/advprop.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/devmgr/advprop.c…
============================================================================== --- trunk/reactos/dll/win32/devmgr/advprop.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/devmgr/advprop.c [iso-8859-1] Sat Jan 2 17:59:54 2010 @@ -554,9 +554,9 @@ static VOID -SetDevicePropertyText(IN PDEVADVPROP_INFO dap, - IN HWND hwndListView, - IN DWORD dwProperty) +DisplayDevicePropertyText(IN PDEVADVPROP_INFO dap, + IN HWND hwndListView, + IN DWORD dwProperty) { HDEVINFO DeviceInfoSet; PSP_DEVINFO_DATA DeviceInfoData; @@ -705,6 +705,92 @@ lpBuffer); } +static VOID +DisplayDevNodeFlags(IN PDEVADVPROP_INFO dap, + IN HWND hwndListView) +{ + DWORD dwStatus = 0; + DWORD dwProblem = 0; + INT index; + + CM_Get_DevNode_Status_Ex(&dwStatus, + &dwProblem, + dap->DeviceInfoData.DevInst, + 0, + dap->hMachine); + + index = 0; + if (dwStatus & DN_ROOT_ENUMERATED) + SetListViewText(hwndListView, index++, L"DN_ROOT_ENUMERATED"); + if (dwStatus & DN_DRIVER_LOADED) + SetListViewText(hwndListView, index++, L"DN_DRIVER_LOADED"); + if (dwStatus & DN_ENUM_LOADED) + SetListViewText(hwndListView, index++, L"DN_ENUM_LOADED"); + if (dwStatus & DN_STARTED) + SetListViewText(hwndListView, index++, L"DN_STARTED"); + if (dwStatus & DN_MANUAL) + SetListViewText(hwndListView, index++, L"DN_MANUAL"); + if (dwStatus & DN_NEED_TO_ENUM) + SetListViewText(hwndListView, index++, L"DN_NEED_TO_ENUM"); + if (dwStatus & DN_DRIVER_BLOCKED) + SetListViewText(hwndListView, index++, L"DN_DRIVER_BLOCKED"); + if (dwStatus & DN_HARDWARE_ENUM) + SetListViewText(hwndListView, index++, L"DN_HARDWARE_ENUM"); + if (dwStatus & DN_NEED_RESTART) + SetListViewText(hwndListView, index++, L"DN_NEED_RESTART"); + if (dwStatus & DN_CHILD_WITH_INVALID_ID) + SetListViewText(hwndListView, index++, L"DN_CHILD_WITH_INVALID_ID"); + if (dwStatus & DN_HAS_PROBLEM) + SetListViewText(hwndListView, index++, L"DN_HAS_PROBLEM"); + if (dwStatus & DN_FILTERED) + SetListViewText(hwndListView, index++, L"DN_FILTERED"); + if (dwStatus & DN_LEGACY_DRIVER) + SetListViewText(hwndListView, index++, L"DN_LEGACY_DRIVER"); + if (dwStatus & DN_DISABLEABLE) + SetListViewText(hwndListView, index++, L"DN_DISABLEABLE"); + if (dwStatus & DN_REMOVABLE) + SetListViewText(hwndListView, index++, L"DN_REMOVABLE"); + if (dwStatus & DN_PRIVATE_PROBLEM) + SetListViewText(hwndListView, index++, L"DN_PRIVATE_PROBLEM"); + if (dwStatus & DN_MF_PARENT) + SetListViewText(hwndListView, index++, L"DN_MF_PARENT"); + if (dwStatus & DN_MF_CHILD) + SetListViewText(hwndListView, index++, L"DN_MF_CHILD"); + if (dwStatus & DN_WILL_BE_REMOVED) + SetListViewText(hwndListView, index++, L"DN_WILL_BE_REMOVED"); + + if (dwStatus & DN_NOT_FIRST_TIMEE) + SetListViewText(hwndListView, index++, L"DN_NOT_FIRST_TIMEE"); + if (dwStatus & DN_STOP_FREE_RES) + SetListViewText(hwndListView, index++, L"DN_STOP_FREE_RES"); + if (dwStatus & DN_REBAL_CANDIDATE) + SetListViewText(hwndListView, index++, L"DN_REBAL_CANDIDATE"); + if (dwStatus & DN_BAD_PARTIAL) + SetListViewText(hwndListView, index++, L"DN_BAD_PARTIAL"); + if (dwStatus & DN_NT_ENUMERATOR) + SetListViewText(hwndListView, index++, L"DN_NT_ENUMERATOR"); + if (dwStatus & DN_NT_DRIVER) + SetListViewText(hwndListView, index++, L"DN_NT_DRIVER"); + + if (dwStatus & DN_NEEDS_LOCKING) + SetListViewText(hwndListView, index++, L"DN_NEEDS_LOCKING"); + if (dwStatus & DN_ARM_WAKEUP) + SetListViewText(hwndListView, index++, L"DN_ARM_WAKEUP"); + if (dwStatus & DN_APM_ENUMERATOR) + SetListViewText(hwndListView, index++, L"DN_APM_ENUMERATOR"); + if (dwStatus & DN_APM_DRIVER) + SetListViewText(hwndListView, index++, L"DN_APM_DRIVER"); + if (dwStatus & DN_SILENT_INSTALL) + SetListViewText(hwndListView, index++, L"DN_SILENT_INSTALL"); + if (dwStatus & DN_NO_SHOW_IN_DM) + SetListViewText(hwndListView, index++, L"DN_NO_SHOW_IN_DM"); + if (dwStatus & DN_BOOT_LOG_PROB) + SetListViewText(hwndListView, index++, L"DN_BOOT_LOG_PROB"); + +// swprintf(dap->szTemp, L"0x%08x", dwStatus); +// SetListViewText(hwndListView, 0, dap->szTemp); +} + static VOID @@ -731,15 +817,15 @@ case 1: /* Hardware ID */ - SetDevicePropertyText(dap, - hwndListView, - SPDRP_HARDWAREID); + DisplayDevicePropertyText(dap, + hwndListView, + SPDRP_HARDWAREID); break; case 2: /* Compatible IDs */ - SetDevicePropertyText(dap, - hwndListView, - SPDRP_COMPATIBLEIDS); + DisplayDevicePropertyText(dap, + hwndListView, + SPDRP_COMPATIBLEIDS); break; #if 0 @@ -748,32 +834,32 @@ #endif case 4: /* Service */ - SetDevicePropertyText(dap, - hwndListView, - SPDRP_SERVICE); + DisplayDevicePropertyText(dap, + hwndListView, + SPDRP_SERVICE); break; case 5: /* Enumerator */ - SetDevicePropertyText(dap, - hwndListView, - SPDRP_ENUMERATOR_NAME); + DisplayDevicePropertyText(dap, + hwndListView, + SPDRP_ENUMERATOR_NAME); break; case 6: /* Capabilities */ - SetDevicePropertyText(dap, - hwndListView, - SPDRP_CAPABILITIES); + DisplayDevicePropertyText(dap, + hwndListView, + SPDRP_CAPABILITIES); break; -#if 0 case 7: /* Devnode Flags */ + DisplayDevNodeFlags(dap, + hwndListView); break; -#endif case 8: /* Config Flags */ - SetDevicePropertyText(dap, - hwndListView, - SPDRP_CONFIGFLAGS); + DisplayDevicePropertyText(dap, + hwndListView, + SPDRP_CONFIGFLAGS); break; #if 0 @@ -782,15 +868,15 @@ #endif case 13: /* Upper Filters */ - SetDevicePropertyText(dap, - hwndListView, - SPDRP_UPPERFILTERS); + DisplayDevicePropertyText(dap, + hwndListView, + SPDRP_UPPERFILTERS); break; case 14: /* Lower Filters */ - SetDevicePropertyText(dap, - hwndListView, - SPDRP_LOWERFILTERS); + DisplayDevicePropertyText(dap, + hwndListView, + SPDRP_LOWERFILTERS); break; default:
14 years, 11 months
1
0
0
0
[tkreuzer] 44888: [KD64] - Remove unused variable
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Sat Jan 2 17:32:20 2010 New Revision: 44888 URL:
http://svn.reactos.org/svn/reactos?rev=44888&view=rev
Log: [KD64] - Remove unused variable Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/kd64/amd64/kdx64.c Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/kd64/amd64/kdx64.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
============================================================================== --- branches/ros-amd64-bringup/reactos/ntoskrnl/kd64/amd64/kdx64.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/ntoskrnl/kd64/amd64/kdx64.c [iso-8859-1] Sat Jan 2 17:32:20 2010 @@ -220,7 +220,6 @@ { PVOID ControlStart; PKPRCB Prcb = KiProcessorBlock[Processor]; - PKIPCR Pcr = CONTAINING_RECORD(Prcb, KIPCR, Prcb); switch (BaseAddress) {
14 years, 11 months
1
0
0
0
[tkreuzer] 44887: [KE] Move the .text and .code64 tag before all functions in trap.S
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Sat Jan 2 17:31:41 2010 New Revision: 44887 URL:
http://svn.reactos.org/svn/reactos?rev=44887&view=rev
Log: [KE] Move the .text and .code64 tag before all functions in trap.S Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/trap.S Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/trap.S URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
============================================================================== --- branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/trap.S [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/trap.S [iso-8859-1] Sat Jan 2 17:31:41 2010 @@ -234,6 +234,10 @@ .endm +/* FUNCTIONS *****************************************************************/ + +.text +.code64 // rbp = TrapFrame, eax = ExceptionCode, edx = NumParams, r9,r10,r11 = params _InternalDispatchException: @@ -278,8 +282,6 @@ ret /* SOFTWARE INTERRUPT SERVICES ***********************************************/ -.text -.code64 .proc KiDivideErrorFault .pushframe 0
14 years, 11 months
1
0
0
0
[tkreuzer] 44886: [KE] - KxAcquireSpinLock: check for already owned lock only on debug builds, fix check in inner loop, don't call Kii386SpinOnSpinLock inside the inner loop, but instead of it, simplify the code - stubplement Kii386SpinOnSpinLock in C
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Sat Jan 2 17:22:43 2010 New Revision: 44886 URL:
http://svn.reactos.org/svn/reactos?rev=44886&view=rev
Log: [KE] - KxAcquireSpinLock: check for already owned lock only on debug builds, fix check in inner loop, don't call Kii386SpinOnSpinLock inside the inner loop, but instead of it, simplify the code - stubplement Kii386SpinOnSpinLock in C Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/include/internal/ke_x.h branches/ros-amd64-bringup/reactos/ntoskrnl/ke/i386/trap.s branches/ros-amd64-bringup/reactos/ntoskrnl/ke/spinlock.c Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/include/internal/ke_x.h URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
============================================================================== --- branches/ros-amd64-bringup/reactos/ntoskrnl/include/internal/ke_x.h [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/ntoskrnl/include/internal/ke_x.h [iso-8859-1] Sat Jan 2 17:22:43 2010 @@ -101,6 +101,10 @@ } \ } +VOID +NTAPI +Kii386SpinOnSpinLock(PKSPIN_LOCK SpinLock, ULONG Flags); + #ifndef CONFIG_SMP // // Spinlock Acquire at IRQL >= DISPATCH_LEVEL @@ -310,44 +314,34 @@ VOID KxAcquireSpinLock(IN PKSPIN_LOCK SpinLock) { +#ifdef DBG /* Make sure that we don't own the lock already */ if (((KSPIN_LOCK)KeGetCurrentThread() | 1) == *SpinLock) { /* We do, bugcheck! */ KeBugCheckEx(SPIN_LOCK_ALREADY_OWNED, (ULONG_PTR)SpinLock, 0, 0, 0); } - - /* Start acquire loop */ - for (;;) - { - /* Try to acquire it */ - if (InterlockedBitTestAndSet((PLONG)SpinLock, 0)) - { - /* Value changed... wait until it's unlocked */ - while (*(volatile KSPIN_LOCK *)SpinLock == 1) - { -#if DBG - /* On debug builds, we use a much slower but useful routine */ - //Kii386SpinOnSpinLock(SpinLock, 5); - - /* FIXME: Do normal yield for now */ +#endif + + /* Try to acquire the lock */ + while (InterlockedBitTestAndSet((PLONG)SpinLock, 0)) + { +#if defined(_M_IX86) && defined(DBG) + /* On x86 debug builds, we use a much slower but useful routine */ + Kii386SpinOnSpinLock(SpinLock, 5); +#else + /* It's locked... spin until it's unlocked */ + while (*(volatile KSPIN_LOCK *)SpinLock & 1) + { + /* Yield and keep looping */ YieldProcessor(); -#else - /* Otherwise, just yield and keep looping */ - YieldProcessor(); + } #endif - } - } - else - { -#if DBG - /* On debug builds, we OR in the KTHREAD */ - *SpinLock = (KSPIN_LOCK)KeGetCurrentThread() | 1; + } +#ifdef DBG + /* On debug builds, we OR in the KTHREAD */ + *SpinLock = (KSPIN_LOCK)KeGetCurrentThread() | 1; #endif - /* All is well, break out */ - break; - } - } } // Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/ke/i386/trap.s URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
============================================================================== --- branches/ros-amd64-bringup/reactos/ntoskrnl/ke/i386/trap.s [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/ntoskrnl/ke/i386/trap.s [iso-8859-1] Sat Jan 2 17:22:43 2010 @@ -2828,31 +2828,3 @@ ret 12 .endfunc -/*++ - * Kii386SpinOnSpinLock - * - * FILLMEIN - * - * Params: - * SpinLock - FILLMEIN - * - * Flags - FILLMEIN - * - * Returns: - * None. - * - * Remarks: - * FILLMEIN - * - *--*/ -.globl _Kii386SpinOnSpinLock@8 -.func Kii386SpinOnSpinLock@8 -_Kii386SpinOnSpinLock@8: - -#ifdef CONFIG_SMP - /* FIXME: TODO */ - int 3 -#endif - - ret 8 -.endfunc Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/ke/spinlock.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
============================================================================== --- branches/ros-amd64-bringup/reactos/ntoskrnl/ke/spinlock.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/ntoskrnl/ke/spinlock.c [iso-8859-1] Sat Jan 2 17:22:43 2010 @@ -454,3 +454,22 @@ /* Spinlock appears to be free */ return TRUE; } + +#ifdef _M_IX86 +VOID +NTAPI +Kii386SpinOnSpinLock(PKSPIN_LOCK SpinLock, ULONG Flags) +{ + // FIXME: Handle flags + UNREFERENCED_PARAMETER(Flags); + + /* Spin until it's unlocked */ + while (*(volatile KSPIN_LOCK *)SpinLock & 1) + { + // FIXME: Check for timeout + + /* Yield and keep looping */ + YieldProcessor(); + } +} +#endif
14 years, 11 months
1
0
0
0
[ros-arm-bringup] 44885: - Switch to using ARM3 paged pool -- all pool allocations are now handled by ARM3, which should be much more efficient, and combines both NP and P code together.
by ros-arm-bringup@svn.reactos.org
Author: ros-arm-bringup Date: Sat Jan 2 17:17:48 2010 New Revision: 44885 URL:
http://svn.reactos.org/svn/reactos?rev=44885&view=rev
Log: - Switch to using ARM3 paged pool -- all pool allocations are now handled by ARM3, which should be much more efficient, and combines both NP and P code together. Removed: trunk/reactos/ntoskrnl/mm/dbgpool.c trunk/reactos/ntoskrnl/mm/pool.c trunk/reactos/ntoskrnl/mm/ppool.c trunk/reactos/ntoskrnl/mm/rpoolmgr.h Modified: trunk/reactos/ntoskrnl/ex/sysinfo.c trunk/reactos/ntoskrnl/mm/ARM3/expool.c trunk/reactos/ntoskrnl/mm/mminit.c trunk/reactos/ntoskrnl/ntoskrnl-generic.rbuild Modified: trunk/reactos/ntoskrnl/ex/sysinfo.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ex/sysinfo.c?rev=…
============================================================================== --- trunk/reactos/ntoskrnl/ex/sysinfo.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ex/sysinfo.c [iso-8859-1] Sat Jan 2 17:17:48 2010 @@ -594,7 +594,7 @@ Spi->Spare3Count = 0; /* FIXME */ Spi->ResidentSystemCachePage = MiMemoryConsumers[MC_CACHE].PagesUsed; - Spi->ResidentPagedPoolPage = MmPagedPoolSize; /* FIXME */ + Spi->ResidentPagedPoolPage = MiMemoryConsumers[MC_PPOOL].PagesUsed; /* FIXME */ Spi->ResidentSystemDriverPage = 0; /* FIXME */ Spi->CcFastReadNoWait = 0; /* FIXME */ Modified: trunk/reactos/ntoskrnl/mm/ARM3/expool.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/expool.c?…
============================================================================== --- trunk/reactos/ntoskrnl/mm/ARM3/expool.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/ARM3/expool.c [iso-8859-1] Sat Jan 2 17:17:48 2010 @@ -178,11 +178,14 @@ /* PUBLIC FUNCTIONS ***********************************************************/ +/* + * @implemented + */ PVOID NTAPI -ExAllocateArmPoolWithTag(IN POOL_TYPE PoolType, - IN SIZE_T NumberOfBytes, - IN ULONG Tag) +ExAllocatePoolWithTag(IN POOL_TYPE PoolType, + IN SIZE_T NumberOfBytes, + IN ULONG Tag) { PPOOL_DESCRIPTOR PoolDesc; PLIST_ENTRY ListHead; @@ -449,10 +452,13 @@ return ++Entry; } +/* + * @implemented + */ PVOID NTAPI -ExAllocateArmPool(POOL_TYPE PoolType, - SIZE_T NumberOfBytes) +ExAllocatePool(POOL_TYPE PoolType, + SIZE_T NumberOfBytes) { // // Use a default tag of "None" @@ -460,10 +466,13 @@ return ExAllocatePoolWithTag(PoolType, NumberOfBytes, 'enoN'); } +/* + * @implemented + */ VOID NTAPI -ExFreeArmPoolWithTag(IN PVOID P, - IN ULONG TagToFree) +ExFreePoolWithTag(IN PVOID P, + IN ULONG TagToFree) { PPOOL_HEADER Entry, NextEntry; ULONG BlockSize; @@ -633,14 +642,17 @@ ExUnlockPool(PoolDesc, OldIrql); } +/* + * @implemented + */ VOID NTAPI -ExFreeArmPool(PVOID P) +ExFreePool(PVOID P) { // // Just free without checking for the tag // - ExFreeArmPoolWithTag(P, 0); + ExFreePoolWithTag(P, 0); } /* Removed: trunk/reactos/ntoskrnl/mm/dbgpool.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/dbgpool.c?rev=…
============================================================================== --- trunk/reactos/ntoskrnl/mm/dbgpool.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/dbgpool.c (removed) @@ -1,134 +1,0 @@ -/* - * PROJECT: ReactOS Kernel - * LICENSE: GPL - See COPYING in the top level directory - * FILE: ntoskrnl/mm/dbgpool.c - * PURPOSE: Debug version of a pool allocator - * PROGRAMMERS: Aleksey Bragin (aleksey(a)reactos.org) - */ - -/* INCLUDES ***************************************************************/ - -#include <ntoskrnl.h> -#define NDEBUG -#include <debug.h> - -/* FUNCTIONS **************************************************************/ - -typedef struct _EI_WHOLE_PAGE_HEADER { - PVOID ActualAddress; - ULONG Size; - ULONG Tag; -} EI_WHOLE_PAGE_HEADER, *PEI_WHOLE_PAGE_HEADER; - -BOOLEAN -NTAPI -ExpIsPoolTagDebuggable(ULONG Tag) -{ -#if 0 - if (Tag == 'llaC') return FALSE; - if (Tag == 'virD') return FALSE; - if (Tag == 'iveD') return FALSE; - if (Tag == 'padA') return FALSE; - - if (Tag == 'dSeS') return FALSE; - if (Tag == 'iDbO') return FALSE; - if (Tag == 'mNbO') return FALSE; - if (Tag == 'DNbO') return FALSE; - if (Tag == 'btbO') return FALSE; - if (Tag == 'cSbO') return FALSE; - //if (Tag == 'iSeS') return FALSE; - //if (Tag == 'cAeS') return FALSE; -#endif - - return TRUE; -} - - -PVOID -NTAPI -ExpAllocateDebugPool(POOL_TYPE Type, ULONG Size, ULONG Tag, PVOID Caller, BOOLEAN EndOfPage) -{ - ULONG UserSize, TotalSize, AlignedSize; - ULONG_PTR UserData, GuardArea; - PEI_WHOLE_PAGE_HEADER Header; - ULONG_PTR Buffer; - - /* Calculate sizes */ - AlignedSize = ROUND_UP(Size, MM_POOL_ALIGNMENT); - UserSize = AlignedSize + sizeof(EI_WHOLE_PAGE_HEADER); - TotalSize = UserSize + 2*PAGE_SIZE; - - /* Right now we support only end-of-page allocations */ - ASSERT(EndOfPage); - - /* Allocate space using default routine */ - if (Type & PAGED_POOL_MASK) - { - Buffer = (ULONG_PTR) - ExAllocatePagedPoolWithTag(Type, TotalSize, Tag); - } - else - { - ASSERT(FALSE); - return NULL; - } - - - /* If allocation failed - fail too */ - if (!Buffer) - { - DPRINT1("A big problem! Pool allocation failed!\n"); - return NULL; - } - - /* Calculate guard area as placed on a page boundary - * at the end of allocated area */ - GuardArea = PAGE_ROUND_DOWN(Buffer + TotalSize - PAGE_SIZE + 1); - - /* Calculate user data and header pointers */ - UserData = GuardArea - AlignedSize; - Header = (PEI_WHOLE_PAGE_HEADER)(UserData - sizeof(EI_WHOLE_PAGE_HEADER)); - - /* Fill out the header */ - Header->ActualAddress = (PVOID)Buffer; - Header->Tag = Tag; - Header->Size = AlignedSize; - - /* Protect the guard page */ - MmSetPageProtect(NULL, (PVOID)GuardArea, PAGE_NOACCESS); - - DPRINT("Allocating whole page block Tag %c%c%c%c, Buffer %p, Header %p, UserData %p, GuardArea %p, Size %d\n", - Tag & 0xFF, (Tag >> 8) & 0xFF, - (Tag >> 16) & 0xFF, (Tag >> 24) & 0xFF, - Buffer, Header, UserData, GuardArea, Size); - - return (PVOID)UserData; -} - -VOID -NTAPI -ExpFreeDebugPool(PVOID Block, BOOLEAN PagedPool) -{ - PEI_WHOLE_PAGE_HEADER Header; - PVOID ProtectedPage; - - /* Get pointer to our special header */ - Header = (PEI_WHOLE_PAGE_HEADER) - (((PCHAR)Block) - sizeof(EI_WHOLE_PAGE_HEADER)); - - DPRINT("Freeing whole page block at %08x (Tag %c%c%c%c, %x Header %x)\n", Block, - Header->Tag & 0xFF, (Header->Tag >> 8) & 0xFF, - (Header->Tag >> 16) & 0xFF, (Header->Tag >> 24) & 0xFF, Header->Tag, Header); - - /* Calculate protected page adresss */ - ProtectedPage = ((PCHAR)Block) + Header->Size; - - /* Unprotect it */ - MmSetPageProtect(NULL, ProtectedPage, PAGE_READWRITE); - - /* Free storage */ - ASSERT(PagedPool); - ExFreePagedPool(Header->ActualAddress); -} - -/* EOF */ Modified: trunk/reactos/ntoskrnl/mm/mminit.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/mminit.c?rev=4…
============================================================================== --- trunk/reactos/ntoskrnl/mm/mminit.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/mminit.c [iso-8859-1] Sat Jan 2 17:17:48 2010 @@ -199,21 +199,6 @@ ASSERT(Status == STATUS_SUCCESS); // - // And now, ReactOS paged pool - // - BaseAddress = MmPagedPoolBase; - Status = MmCreateMemoryArea(MmGetKernelAddressSpace(), - MEMORY_AREA_PAGED_POOL | MEMORY_AREA_STATIC, - &BaseAddress, - MmPagedPoolSize, - PAGE_READWRITE, - &MArea, - TRUE, - 0, - BoundaryAddressMultiple); - ASSERT(Status == STATUS_SUCCESS); - - // // Next, the KPCR // BaseAddress = (PVOID)PCR; @@ -287,10 +272,6 @@ MmSystemRangeStart, (ULONG_PTR)MmSystemRangeStart + MmBootImageSize, "Boot Loaded Image"); - DPRINT1(" 0x%p - 0x%p\t%s\n", - MmPagedPoolBase, - (ULONG_PTR)MmPagedPoolBase + MmPagedPoolSize, - "Paged Pool"); DPRINT1(" 0x%p - 0x%p\t%s\n", MmPfnDatabase, (ULONG_PTR)MmPfnDatabase + (MxPfnAllocation << PAGE_SHIFT), @@ -389,80 +370,13 @@ // MiDbgReadyForPhysical = TRUE; #endif - - /* Put the paged pool after the loaded modules */ - MmPagedPoolBase = (PVOID)PAGE_ROUND_UP((ULONG_PTR)MmSystemRangeStart + - MmBootImageSize); - MmPagedPoolSize = MM_PAGED_POOL_SIZE; - + /* Intialize system memory areas */ MiInitSystemMemoryAreas(); - // - // STEP 1: Allocate and free a single page, repeatedly - // We should always get the same address back - // - if (1) - { - PULONG Test, OldTest; - ULONG i; - - OldTest = Test = MiAllocatePoolPages(PagedPool, PAGE_SIZE); - ASSERT(Test); - for (i = 0; i < 16; i++) - { - MiFreePoolPages(Test); - Test = MiAllocatePoolPages(PagedPool, PAGE_SIZE); - ASSERT(OldTest == Test); - } - MiFreePoolPages(Test); - } - - // - // STEP 2: Allocate 2048 pages without freeing them - // We should run out of space at 1024 pages, since we don't support - // expansion yet. - // - if (1) - { - PULONG Test[2048]; - ULONG i; - - for (i = 0; i < 2048; i++) - { - Test[i] = MiAllocatePoolPages(PagedPool, PAGE_SIZE); - if (!Test[i]) - { - ASSERT(i == 1024); - break; - } - } - - // - // Cleanup - // - while (--i) if (Test[i]) MiFreePoolPages(Test[i]); - } - - // - // STEP 3: Allocate a page and touch it. - // We should get an ARM3 page fault and it should handle the fault - // - if (1) - { - PULONG Test; - - Test = MiAllocatePoolPages(PagedPool, PAGE_SIZE); - ASSERT(*Test == 0); - MiFreePoolPages(Test); - } - /* Dump the address space */ MiDbgDumpAddressSpace(); - - /* Initialize paged pool */ - MmInitializePagedPool(); - + /* Initialize working sets */ MmInitializeMemoryConsumer(MC_USER, MmTrimUserMemory); Removed: trunk/reactos/ntoskrnl/mm/pool.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/pool.c?rev=448…
============================================================================== --- trunk/reactos/ntoskrnl/mm/pool.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/pool.c (removed) @@ -1,236 +1,0 @@ -/* - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel - * FILE: ntoskrnl/mm/pool.c - * PURPOSE: Implements the kernel memory pool - * - * PROGRAMMERS: David Welch (welch(a)mcmail.com) - */ - -/* INCLUDES ****************************************************************/ - -#include <ntoskrnl.h> - -#define NDEBUG -#include <debug.h> - -/* Uncomment to enable pool overruns debugging. Don't forget to increase - max pool sizes (MM_[NON]PAGED_POOL_SIZE) in include/internal/mm.h */ -//#define DEBUG_NPOOL -//#define DEBUG_PPOOL - -extern PVOID MiNonPagedPoolStart; -extern ULONG MiNonPagedPoolLength; -extern ULONG MmTotalPagedPoolQuota; -extern ULONG MmTotalNonPagedPoolQuota; - -/* FUNCTIONS ***************************************************************/ - -ULONG NTAPI -EiGetPagedPoolTag(IN PVOID Block); - -ULONG NTAPI -EiGetNonPagedPoolTag(IN PVOID Block); - -PVOID -NTAPI -ExAllocateArmPoolWithTag(POOL_TYPE PoolType, - SIZE_T NumberOfBytes, - ULONG Tag); - -static PVOID NTAPI -EiAllocatePool(POOL_TYPE PoolType, - ULONG NumberOfBytes, - ULONG Tag, - PVOID Caller) -{ - PVOID Block; - PCHAR TagChars = (PCHAR)&Tag; - - if (Tag == 0) - KeBugCheckEx(BAD_POOL_CALLER, 0x9b, PoolType, NumberOfBytes, (ULONG_PTR)Caller); - if (Tag == ' GIB') - KeBugCheckEx(BAD_POOL_CALLER, 0x9c, PoolType, NumberOfBytes, (ULONG_PTR)Caller); - -#define IS_LETTER_OR_DIGIT(c) (((c) >= 'a' && (c) <= 'z') || ((c) >= 'A' && (c) <= 'Z') || ((c) >= '0' && (c) <= '9')) - if (!IS_LETTER_OR_DIGIT(TagChars[0]) && - !IS_LETTER_OR_DIGIT(TagChars[1]) && - !IS_LETTER_OR_DIGIT(TagChars[2]) && - !IS_LETTER_OR_DIGIT(TagChars[3])) - KeBugCheckEx(BAD_POOL_CALLER, 0x9d, Tag, PoolType, (ULONG_PTR)Caller); - - /* FIXME: Handle SESSION_POOL_MASK, VERIFIER_POOL_MASK, QUOTA_POOL_MASK */ - if (PoolType & PAGED_POOL_MASK) - { - if (KeGetCurrentIrql() > APC_LEVEL) - KeBugCheckEx(BAD_POOL_CALLER, 0x08, KeGetCurrentIrql(), PoolType, Tag); -#ifdef DEBUG_PPOOL - if (ExpIsPoolTagDebuggable(Tag)) - Block = ExpAllocateDebugPool(PoolType, NumberOfBytes, Tag, Caller, TRUE); - else -#endif - Block = ExAllocatePagedPoolWithTag(PoolType, NumberOfBytes, Tag); - } - else - { - if (KeGetCurrentIrql() > DISPATCH_LEVEL) - KeBugCheckEx(BAD_POOL_CALLER, 0x08, KeGetCurrentIrql(), PoolType, Tag); -#ifdef DEBUG_NPOOL - if (ExpIsPoolTagDebuggable(Tag)) - Block = ExpAllocateDebugPool(PoolType, NumberOfBytes, Tag, Caller, TRUE); - else -#endif - Block = ExAllocateArmPoolWithTag(PoolType, NumberOfBytes, Tag); - } - - if ((PoolType & MUST_SUCCEED_POOL_MASK) && !Block) - KeBugCheckEx(BAD_POOL_CALLER, 0x9a, PoolType, NumberOfBytes, Tag); - return Block; -} - -/* - * @implemented - */ -PVOID NTAPI -ExAllocatePool (POOL_TYPE PoolType, SIZE_T NumberOfBytes) -/* - * FUNCTION: Allocates pool memory of a specified type and returns a pointer - * to the allocated block. This routine is used for general purpose allocation - * of memory - * ARGUMENTS: - * PoolType - * Specifies the type of memory to allocate which can be one - * of the following: - * - * NonPagedPool - * NonPagedPoolMustSucceed - * NonPagedPoolCacheAligned - * NonPagedPoolCacheAlignedMustS - * PagedPool - * PagedPoolCacheAligned - * - * NumberOfBytes - * Specifies the number of bytes to allocate - * RETURNS: The allocated block on success - * NULL on failure - */ -{ - PVOID Block; - -#if defined(__GNUC__) - - Block = EiAllocatePool(PoolType, - NumberOfBytes, - TAG_NONE, - (PVOID)__builtin_return_address(0)); -#elif defined(_MSC_VER) - - Block = EiAllocatePool(PoolType, - NumberOfBytes, - TAG_NONE, - &ExAllocatePool); -#else -#error Unknown compiler -#endif - - return(Block); -} - - -/* - * @implemented - */ -PVOID NTAPI -ExAllocatePoolWithTag (POOL_TYPE PoolType, SIZE_T NumberOfBytes, ULONG Tag) -{ - PVOID Block; - -#if defined(__GNUC__) - - Block = EiAllocatePool(PoolType, - NumberOfBytes, - Tag, - (PVOID)__builtin_return_address(0)); -#elif defined(_MSC_VER) - - Block = EiAllocatePool(PoolType, - NumberOfBytes, - Tag, - &ExAllocatePoolWithTag); -#else -#error Unknown compiler -#endif - - return(Block); -} - -/* - * @implemented - */ -#undef ExFreePool -VOID NTAPI -ExFreePool(IN PVOID Block) -{ - ExFreePoolWithTag(Block, 0); -} - -VOID -NTAPI -ExFreeArmPoolWithTag(PVOID P, - ULONG TagToFree); - -/* - * @implemented - */ -VOID -NTAPI -ExFreePoolWithTag( - IN PVOID Block, - IN ULONG Tag) -{ - /* Check for paged pool */ - if (Block >= MmPagedPoolBase && - (char*)Block < ((char*)MmPagedPoolBase + MmPagedPoolSize)) - { - /* Validate tag */ -#ifndef DEBUG_PPOOL - if (Tag != 0 && Tag != EiGetPagedPoolTag(Block)) - KeBugCheckEx(BAD_POOL_CALLER, - 0x0a, - (ULONG_PTR)Block, - EiGetPagedPoolTag(Block), - Tag); -#endif - /* Validate IRQL */ - if (KeGetCurrentIrql() > APC_LEVEL) - KeBugCheckEx(BAD_POOL_CALLER, - 0x09, - KeGetCurrentIrql(), - PagedPool, - (ULONG_PTR)Block); - - /* Free from paged pool */ -#ifdef DEBUG_PPOOL - if (ExpIsPoolTagDebuggable(Tag)) - ExpFreeDebugPool(Block, TRUE); - else -#endif - ExFreePagedPool(Block); - } - else if (Block) ExFreeArmPoolWithTag(Block, Tag); - else - { - /* Only warn and break for NULL pointers */ - if (Block == NULL) - { - DPRINT1("Warning: Trying to free a NULL pointer!\n"); - ASSERT(FALSE); - return; - } - - /* Block was not inside any pool! */ - KeBugCheckEx(BAD_POOL_CALLER, 0x42, (ULONG_PTR)Block, 0, 0); - } -} - -/* EOF */ Removed: trunk/reactos/ntoskrnl/mm/ppool.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ppool.c?rev=44…
============================================================================== --- trunk/reactos/ntoskrnl/mm/ppool.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/ppool.c (removed) @@ -1,243 +1,0 @@ -/* - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel - * FILE: ntoskrnl/mm/ppool.c - * PURPOSE: Implements the paged pool - * - * PROGRAMMERS: David Welch (welch(a)mcmail.com) - * Royce Mitchell III - */ - -/* INCLUDES *****************************************************************/ - -#include <ntoskrnl.h> -#define NDEBUG -#include <debug.h> - -#if defined (ALLOC_PRAGMA) -#pragma alloc_text(INIT, MmInitializePagedPool) -#endif - -#undef ASSERT -#define ASSERT(x) if (!(x)) {DbgPrint("Assertion "#x" failed at %s:%d\n", __FILE__,__LINE__); DbgBreakPoint(); } - -// enable "magic" -//#define R_MAGIC -#define R_MUTEX FAST_MUTEX -#define R_ACQUIRE_MUTEX(pool) /*DPRINT1("Acquiring PPool Mutex\n");*/ ExAcquireFastMutex(&pool->Mutex) -#define R_RELEASE_MUTEX(pool) /*DPRINT1("Releasing PPool Mutex\n");*/ ExReleaseFastMutex(&pool->Mutex) -#define R_PRINT_ADDRESS(addr) KeRosPrintAddress(addr) -#define R_PANIC() KeBugCheck(MEMORY_MANAGEMENT) -#define R_DEBUG DbgPrint - -#ifdef _ARM_ -#define R_GET_STACK_FRAMES(ptr,cnt) -#else -#define R_GET_STACK_FRAMES(ptr,cnt) RtlWalkFrameChain((PVOID*)ptr,cnt, 0) -#endif - -#include "rpoolmgr.h" - -/* GLOBALS *******************************************************************/ - -PVOID MmPagedPoolBase; -ULONG MmPagedPoolSize; -ULONG MmTotalPagedPoolQuota = 0; // TODO FIXME commented out until we use it -static PR_POOL MmPagedPool = NULL; - -/* FUNCTIONS *****************************************************************/ - -VOID -INIT_FUNCTION -NTAPI -MmInitializePagedPool(VOID) -{ - /* - * We are still at a high IRQL level at this point so explicitly commit - * the first page of the paged pool before writing the first block header. - */ - MmCommitPagedPoolAddress ( (PVOID)MmPagedPoolBase, FALSE ); - - MmPagedPool = RPoolInit ( MmPagedPoolBase, - MmPagedPoolSize, - MM_POOL_ALIGNMENT, - MM_CACHE_LINE_SIZE, - PAGE_SIZE ); - - ExInitializeFastMutex(&MmPagedPool->Mutex); -} - -/********************************************************************** - * NAME INTERNAL - * ExAllocatePagedPoolWithTag@12 - * - * DESCRIPTION - * - * ARGUMENTS - * - * RETURN VALUE - */ -PVOID NTAPI -ExAllocatePagedPoolWithTag (IN POOL_TYPE PoolType, - IN ULONG NumberOfBytes, - IN ULONG Tag) -{ - int align; - - if ( NumberOfBytes >= PAGE_SIZE ) - align = 2; - else if ( PoolType & CACHE_ALIGNED_POOL_MASK ) - align = 1; - else - align = 0; - - ASSERT_IRQL_LESS_OR_EQUAL(APC_LEVEL); - - return RPoolAlloc ( MmPagedPool, NumberOfBytes, Tag, align ); -} - -VOID NTAPI -ExFreePagedPool(IN PVOID Block) -{ - ASSERT_IRQL_LESS_OR_EQUAL(APC_LEVEL); - RPoolFree ( MmPagedPool, Block ); -} - -ULONG NTAPI -EiGetPagedPoolTag(IN PVOID Block) -{ - return RBodyToHdr(Block)->Tag; -} - - -#ifdef PPOOL_UMODE_TEST - -PVOID TestAlloc ( ULONG Bytes ) -{ - PVOID ret; - - //printf ( "Allocating block: " ); RPoolStats ( MmPagedPool ); - //RPoolRedZoneCheck ( MmPagedPool, __FILE__, __LINE__ ); - - ret = ExAllocatePagedPoolWithTag ( PagedPool, Bytes, 0 ); - - //printf ( "Block %x allocated: ", ret ); RPoolStats ( MmPagedPool ); - //RPoolRedZoneCheck ( MmPagedPool, __FILE__, __LINE__ ); - - return ret; -} - -void TestFree ( PVOID ptr ) -{ - //printf ( "Freeing block %x: ", ptr ); RPoolStats ( MmPagedPool ); - //RPoolRedZoneCheck ( MmPagedPool, __FILE__, __LINE__ ); - ExFreePagedPool(ptr); - //printf ( "Block %x freed: ", ptr ); RPoolStats ( MmPagedPool ); - //RPoolRedZoneCheck ( MmPagedPool, __FILE__, __LINE__ ); -} - -int main() -{ -#define COUNT 100 - int i, j; - char* keepers[COUNT]; - char* trash[COUNT]; - int AllocSize[] = { 15, 31, 63, 127, 255, 511, 1023, 2047 }; - const int ALLOCS = sizeof(AllocSize) / sizeof(0[AllocSize]); - ULONG dwStart; - - MmPagedPoolSize = 1*1024*1024; - MmPagedPoolBase = malloc ( MmPagedPoolSize ); - MmInitializePagedPool(); - - dwStart = GetTickCount(); - - printf ( "test #1 phase #1\n" ); - for ( i = 0; i < COUNT; i++ ) - { - //printf ( "keeper %i) ", i ); - keepers[i] = TestAlloc ( AllocSize[i%ALLOCS] ); - if ( !keepers[i] ) printf ( "allocation failed\n" ); - //printf ( "trash %i) ", i ); - trash[i] = TestAlloc ( AllocSize[i%ALLOCS] ); - if ( !trash[i] ) printf ( "allocation failed\n" ); - } - - printf ( "test #1 phase #2\n" ); - for ( i = 0; i < COUNT; i++ ) - { - if ( i == 6 ) - i = i; - //printf ( "%i) ", i ); - TestFree ( trash[i] ); - } - - printf ( "test #1 phase #3\n" ); - for ( i = 0; i < 4; i++ ) - { - //printf ( "%i) ", i ); - keepers[i] = TestAlloc ( 4096 ); - if ( !keepers[i] ) printf ( "allocation failed\n" ); - } - - printf ( "test #1 phase #4\n" ); - for ( i = 0; i < 4; i++ ) - { - //printf ( "%i) ", i ); - TestFree ( keepers[i] ); - } - - printf ( "test #1 phase #5\n" ); - srand(1); - for ( i = 0; i < COUNT; i++ ) - { - //printf ( "%i) ", i ); - trash[i] = TestAlloc ( rand()%1024+1 ); - if ( !trash[i] ) printf ( "allocation failed\n" ); - } - printf ( "test #1 phase #6\n" ); - for ( i = 0; i < 10000; i++ ) - { - TestFree ( trash[i%COUNT] ); - trash[i%COUNT] = TestAlloc ( rand()%1024+1 ); - if ( !trash[i%COUNT] ) printf ( "allocation failed\n" ); - } - printf ( "test #1 phase #7\n" ); - j = 0; - for ( i = 0; i < COUNT; i++ ) - { - if ( trash[i] ) - { - TestFree ( trash[i] ); - ++j; - } - } - printf ( "test #1 phase #8 ( freed %i of %i trash )\n", j, COUNT ); - if ( !TestAlloc ( 2048 ) ) - printf ( "Couldn't allocate 2048 bytes after freeing up a whole bunch of blocks\n" ); - - free ( MmPagedPoolBase ); - - printf ( "test time: %lu\n", GetTickCount() - dwStart ); - - printf ( "test #2\n" ); - - MmPagedPoolSize = 1024; - MmPagedPoolBase = malloc ( MmPagedPoolSize ); - MmInitializePagedPool(); - - TestAlloc ( 512 ); - i = RPoolLargestAllocPossible ( MmPagedPool, 0 ); - if ( !TestAlloc ( i ) ) - { - printf ( "allocating last available block failed\n" ); - } - - free ( MmPagedPoolBase ); - - printf ( "done!\n" ); - return 0; -} -#endif//PPOOL_UMODE_TEST - -/* EOF */ Removed: trunk/reactos/ntoskrnl/mm/rpoolmgr.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/rpoolmgr.h?rev…
============================================================================== --- trunk/reactos/ntoskrnl/mm/rpoolmgr.h [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/rpoolmgr.h (removed) @@ -1,1060 +1,0 @@ -/* - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel - * FILE: ntoskrnl/mm/RPoolMgr.h - * PURPOSE: A semi-generic reuseable Pool implementation - * PROGRAMMER: Royce Mitchell III - * UPDATE HISTORY: - */ - -#ifndef RPOOLMGR_H -#define RPOOLMGR_H - -typedef unsigned long rulong; - -#define R_IS_POOL_PTR(pool,ptr) (((void*)(ULONG_PTR)(ptr) >= pool->UserBase) && ((ULONG_PTR)(ptr) < ((ULONG_PTR)pool->UserBase + pool->UserSize))) -#define R_ASSERT_PTR(pool,ptr) ASSERT( R_IS_POOL_PTR(pool,ptr) ) -#define R_ASSERT_SIZE(pool,sz) ASSERT( sz > (sizeof(R_USED)+2*R_RZ) && sz >= sizeof(R_FREE) && sz < pool->UserSize ) - -#ifndef R_ROUND_UP -#define R_ROUND_UP(x,s) ((PVOID)(((ULONG_PTR)(x)+(s)-1) & ~((ULONG_PTR)(s)-1))) -#endif//R_ROUND_UP - -#ifndef R_ROUND_DOWN -#define R_ROUND_DOWN(x,s) ((PVOID)(((ULONG_PTR)(x)) & ~((ULONG_PTR)(s)-1))) -#endif//R_ROUND_DOWN - -#ifndef R_QUEMIN -// R_QUEMIN is the minimum number of entries to keep in a que -#define R_QUEMIN 0 -#endif//R_QUEMIN - -#ifndef R_QUECOUNT -// 16, 32, 64, 128, 256, 512 -#define R_QUECOUNT 6 -#endif//R_QUECOUNT - -#ifndef R_RZ -// R_RZ is the redzone size -#define R_RZ 4 -#endif//R_RZ - -#ifndef R_RZ_LOVALUE -#define R_RZ_LOVALUE 0x87 -#endif//R_RZ_LOVALUE - -#ifndef R_RZ_HIVALUE -#define R_RZ_HIVALUE 0xA5 -#endif//R_RZ_HIVALUE - -#ifndef R_STACK -// R_STACK is the number of stack entries to store in blocks for debug purposes -#define R_STACK 6 -#else // R_STACK -#if R_STACK > 0 && R_STACK < 6 -/* Increase the frame depth to get a reasonable back trace */ -#undef R_STACK -#define R_STACK 6 -#endif // R_STACK > 0 && R_STACK < 6 -#endif//R_STACK - -#ifndef R_TAG -// R_TAG do we keep track of tags on a per-memory block basis? -#define R_TAG 0 -#endif//R_TAG - -#ifdef R_MAGIC -# ifndef R_FREE_MAGIC -# define R_FREE_MAGIC (rulong)(('F'<<0) + ('r'<<8) + ('E'<<16) + ('e'<<24)) -# endif//R_FREE_MAGIC -# ifndef R_USED_MAGIC -# define R_USED_MAGIC (rulong)(('u'<<0) + ('S'<<8) + ('e'<<16) + ('D'<<24)) -# endif//R_USED_MAGIC -#endif//R_MAGIC - -// **IMPORTANT NOTE** Magic, PrevSize, Size and Status must be at same offset -// in both the R_FREE and R_USED structures - -typedef struct _R_FREE -{ -#ifdef R_MAGIC - rulong FreeMagic; -#endif//R_MAGIC - rulong PrevSize : 30; - rulong Status : 2; - rulong Size; -#if R_STACK - ULONG_PTR LastOwnerStack[R_STACK]; -#endif//R_STACK - struct _R_FREE* NextFree; - struct _R_FREE* PrevFree; -} -R_FREE, *PR_FREE; - -typedef struct _R_USED -{ -#ifdef R_MAGIC - rulong UsedMagic; -#endif//R_MAGIC - rulong PrevSize : 30; - rulong Status : 2; - rulong Size; -#if R_STACK - ULONG_PTR LastOwnerStack[R_STACK]; -#endif//R_STACK - struct _R_USED* NextUsed; -#if R_RZ - rulong UserSize; // how many bytes the user actually asked for... -#endif//R_RZ - rulong Tag; -} -R_USED, *PR_USED; - -typedef struct _R_QUE -{ - rulong Count; - PR_USED First, Last; -} -R_QUE, *PR_QUE; - -typedef struct _R_POOL -{ - void* PoolBase; - rulong PoolSize; - void* UserBase; - rulong UserSize; - rulong Alignments[3]; - PR_FREE FirstFree, LastFree; - R_QUE Que[R_QUECOUNT][3]; - R_MUTEX Mutex; -} -R_POOL, *PR_POOL; - -#if !R_STACK -#define RiPrintLastOwner(Block) -#else -static void -RiPrintLastOwner ( PR_USED Block ) -{ - int i; - for ( i = 0; i < R_STACK; i++ ) - { - if ( Block->LastOwnerStack[i] != 0xDEADBEEF ) - { - R_DEBUG(" "); - //if (!R_PRINT_ADDRESS ((PVOID)Block->LastOwnerStack[i]) ) - { - R_DEBUG("<%X>", Block->LastOwnerStack[i] ); - } - } - } -} -#endif//R_STACK - -static int -RQueWhich ( rulong size ) -{ - rulong que, quesize; - for ( que=0, quesize=16; que < R_QUECOUNT; que++, quesize<<=1 ) - { - if ( quesize >= size ) - { - return que; - } - } - return -1; -} - -static void -RQueInit ( PR_QUE que ) -{ - que->Count = 0; - que->First = NULL; - que->Last = NULL; -} - -static void -RQueAdd ( PR_QUE que, PR_USED Item ) -{ - ASSERT(Item); - Item->Status = 2; - Item->NextUsed = NULL; - ++que->Count; - if ( !que->Last ) - { - que->First = que->Last = Item; - return; - } - ASSERT(!que->Last->NextUsed); - que->Last->NextUsed = Item; - que->Last = Item; -} - -static PR_USED -RQueRemove ( PR_QUE que ) -{ - PR_USED Item; -#if R_QUEMIN - if ( que->count < R_QUEMIN ) - return NULL; -#endif - if ( !que->First ) - return NULL; - Item = que->First; - que->First = Item->NextUsed; - if ( !--que->Count ) - { - ASSERT ( !que->First ); - que->Last = NULL; - } - Item->Status = 0; - return Item; -} - -static void -RPoolAddFree ( PR_POOL pool, PR_FREE Item ) -{ - ASSERT(pool); - ASSERT(Item); - if ( !pool->FirstFree ) - { - pool->FirstFree = pool->LastFree = Item; - Item->NextFree = NULL; - } - else - { - pool->FirstFree->PrevFree = Item; - Item->NextFree = pool->FirstFree; - pool->FirstFree = Item; - } - Item->PrevFree = NULL; -} - -static void -RPoolRemoveFree ( PR_POOL pool, PR_FREE Item ) -{ - ASSERT(pool); - ASSERT(Item); - if ( Item->NextFree ) - Item->NextFree->PrevFree = Item->PrevFree; - else - { - ASSERT ( pool->LastFree == Item ); - pool->LastFree = Item->PrevFree; - } - if ( Item->PrevFree ) - Item->PrevFree->NextFree = Item->NextFree; - else - { - ASSERT ( pool->FirstFree == Item ); - pool->FirstFree = Item->NextFree; - } -#if DBG - Item->NextFree = Item->PrevFree = (PR_FREE)(ULONG_PTR)0xDEADBEEF; -#endif//DBG -} - -#if !R_STACK -#define RFreeFillStack(free) -#define RUsedFillStack(used) -#else -static void -RFreeFillStack ( PR_FREE free ) -{ - int i; - ULONG stack[R_STACK+3]; // need to skip 3 known levels of stack trace - memset ( stack, 0xCD, sizeof(stack) ); - R_GET_STACK_FRAMES ( stack, R_STACK+3 ); - for ( i = 0; i < R_STACK; i++ ) - free->LastOwnerStack[i] = stack[i+3]; -} - -static void -RUsedFillStack ( PR_USED used ) -{ - int i; - ULONG stack[R_STACK+2]; // need to skip 2 known levels of stack trace - memset ( stack, 0xCD, sizeof(stack) ); - R_GET_STACK_FRAMES ( stack, R_STACK+2 ); - for ( i = 0; i < R_STACK; i++ ) - used->LastOwnerStack[i] = stack[i+2]; -} -#endif - -static PR_FREE -RFreeInit ( void* memory ) -{ - PR_FREE block = (PR_FREE)memory; -#if R_FREEMAGIC - block->FreeMagic = R_FREE_MAGIC; -#endif//R_FREEMAGIC - block->Status = 0; - RFreeFillStack ( block ); -#if DBG - block->PrevFree = block->NextFree = (PR_FREE)(ULONG_PTR)0xDEADBEEF; -#endif//DBG - return block; -} - -PR_POOL -RPoolInit ( void* PoolBase, rulong PoolSize, int align1, int align2, int align3 ) -{ - int align, que; - PR_POOL pool = (PR_POOL)PoolBase; - - pool->PoolBase = PoolBase; - pool->PoolSize = PoolSize; - pool->UserBase = (char*)pool->PoolBase + sizeof(R_POOL); - pool->UserSize = PoolSize - sizeof(R_POOL); - pool->Alignments[0] = align1; - pool->Alignments[1] = align2; - pool->Alignments[2] = align3; - pool->FirstFree = pool->LastFree = NULL; - - RPoolAddFree ( pool, - RFreeInit ( pool->UserBase )); - - pool->FirstFree->PrevSize = 0; - pool->FirstFree->Size = pool->UserSize; - - for ( que = 0; que < R_QUECOUNT; que++ ) - { - for ( align = 0; align < 3; align++ ) - { - RQueInit ( &pool->Que[que][align] ); - } - } - return pool; -} - -#if R_RZ -static const char* -RFormatTag ( rulong Tag, char* buf ) -{ - int i; - *(rulong*)&buf[0] = Tag; - buf[4] = 0; - for ( i = 0; i < 4; i++ ) - { - if ( !buf[i] ) - buf[i] = ' '; - } - return buf; -} -#endif - -#if !R_RZ -#define RUsedRedZoneCheck(pUsed,Addr,file,line, printzone) -#else//R_RZ -static void -RiBadBlock ( PR_USED pUsed, char* Addr, const char* violation, const char* file, int line, int printzone ) -{ - char tag[5]; - unsigned int i; - - R_DEBUG("%s(%i): %s detected for paged pool address 0x%x\n", - file, line, violation, Addr ); - -#ifdef R_MAGIC - R_DEBUG ( "UsedMagic 0x%x, ", pUsed->UsedMagic ); -#endif//R_MAGIC - R_DEBUG ( "Tag %s(%X), Size %i, UserSize %i", - RFormatTag(pUsed->Tag,tag), - pUsed->Tag, - pUsed->Size, - pUsed->UserSize ); - - if ( printzone ) - { - unsigned char* HiZone = (unsigned char*)Addr + pUsed->UserSize; - unsigned char* LoZone = (unsigned char*)Addr - R_RZ; // this is to simplify indexing below... - R_DEBUG ( ", LoZone " ); - for ( i = 0; i < R_RZ; i++ ) - R_DEBUG ( "%02x", LoZone[i] ); - R_DEBUG ( ", HiZone " ); - for ( i = 0; i < R_RZ; i++ ) - R_DEBUG ( "%02x", HiZone[i] ); - } - R_DEBUG ( "\n" ); - - R_DEBUG ( "First few Stack Frames:" ); - RiPrintLastOwner ( pUsed ); - R_DEBUG ( "\n" ); - - R_DEBUG ( "Contents of Block:\n" ); - for ( i = 0; i < 8*16 && i < pUsed->UserSize; i += 16 ) - { - int j; - R_DEBUG ( "%04X ", i ); - for ( j = 0; j < 16; j++ ) - { - if ( i+j < pUsed->UserSize ) - { - R_DEBUG ( "%02X ", (unsigned)(unsigned char)Addr[i+j] ); - } - else - { - R_DEBUG ( " " ); - } - } - R_DEBUG(" "); - for ( j = 0; j < 16; j++ ) - { - if ( i+j < pUsed->UserSize ) - { - char c = Addr[i+j]; - if ( c < 0x20 || c > 0x7E ) - c = '.'; - R_DEBUG ( "%c", c ); - } - else - { - R_DEBUG ( " " ); - } - } - R_DEBUG("\n"); - } - R_PANIC(); -} -static void -RUsedRedZoneCheck ( PR_POOL pool, PR_USED pUsed, char* Addr, const char* file, int line ) -{ - int i; - unsigned char *LoZone, *HiZone; - int bLow = 1; - int bHigh = 1; - - ASSERT ( Addr >= (char*)pool->UserBase && Addr < ((char*)pool->UserBase + pool->UserSize - 16) ); -#ifdef R_MAGIC - if ( pUsed->UsedMagic == R_FREE_MAGIC ) - { - pUsed->UserSize = 0; // just to keep from confusion, MmpBadBlock() doesn't return... - RiBadBlock ( pUsed, Addr, "double-free", file, line, 0 ); - } - if ( pUsed->UsedMagic != R_USED_MAGIC ) - { - RiBadBlock ( pUsed, Addr, "bad magic", file, line, 0 ); - } -#endif//R_MAGIC - switch ( pUsed->Status ) - { - case 0: // freed into main pool - case 2: // in ques - RiBadBlock ( pUsed, Addr, "double-free", file, line, 0 ); - // no need for break here - RiBadBlock doesn't return - case 1: // allocated - this is okay - break; - default: - RiBadBlock ( pUsed, Addr, "corrupt status", file, line, 0 ); - } - if ( pUsed->Status != 1 ) - { - RiBadBlock ( pUsed, Addr, "double-free", file, line, 0 ); - } - if ( pUsed->Size > pool->PoolSize || pUsed->Size == 0 ) - { - RiBadBlock ( pUsed, Addr, "invalid size", file, line, 0 ); - } - if ( pUsed->UserSize > pool->PoolSize || pUsed->UserSize == 0 ) - { - RiBadBlock ( pUsed, Addr, "invalid user size", file, line, 0 ); - } - HiZone = (unsigned char*)Addr + pUsed->UserSize; - LoZone = (unsigned char*)Addr - R_RZ; // this is to simplify indexing below... - for ( i = 0; i < R_RZ && bLow && bHigh; i++ ) - { - bLow = bLow && ( LoZone[i] == R_RZ_LOVALUE ); - bHigh = bHigh && ( HiZone[i] == R_RZ_HIVALUE ); - } - if ( !bLow || !bHigh ) - { - const char* violation = "High and Low-side redzone overwrite"; - if ( bHigh ) // high is okay, so it was just low failed - violation = "Low-side redzone overwrite"; - else if ( bLow ) // low side is okay, so it was just high failed - violation = "High-side redzone overwrite"; - RiBadBlock ( pUsed, Addr, violation, file, line, 1 ); - } -} -#endif//R_RZ - -PR_FREE -RPreviousBlock ( PR_FREE Block ) -{ - if ( Block->PrevSize > 0 ) - return (PR_FREE)( (char*)Block - Block->PrevSize ); - return NULL; -} - -PR_FREE -RNextBlock ( PR_POOL pool, PR_FREE Block ) -{ - PR_FREE NextBlock = (PR_FREE)( (char*)Block + Block->Size ); - if ( (char*)NextBlock >= (char*)pool->UserBase + pool->UserSize ) - NextBlock = NULL; - return NextBlock; -} - -static __inline void* -RHdrToBody ( void* blk ) -/* - * FUNCTION: Translate a block header address to the corresponding block - * address (internal) - */ -{ - return ( (void *) ((char*)blk + sizeof(R_USED) + R_RZ) ); -} - -static __inline PR_USED -RBodyToHdr ( void* addr ) -{ - return (PR_USED) - ( ((char*)addr) - sizeof(R_USED) - R_RZ ); -} - -static int -RiInFreeChain ( PR_POOL pool, PR_FREE Block ) -{ - PR_FREE Free; - Free = pool->FirstFree; - if ( Free == Block ) - return 1; - while ( Free != Block ) - { - Free = Free->NextFree; - if ( !Free ) - return 0; - } - return 1; -} - -static void -RPoolRedZoneCheck ( PR_POOL pool, const char* file, int line ) -{ - { - PR_USED Block = (PR_USED)pool->UserBase; - PR_USED NextBlock; - - for ( ;; ) - { - switch ( Block->Status ) - { - case 0: // block is in chain - ASSERT ( RiInFreeChain ( pool, (PR_FREE)Block ) ); - break; - case 1: // block is allocated - RUsedRedZoneCheck ( pool, Block, RHdrToBody(Block), file, line ); - break; - case 2: // block is in que - // nothing to verify here yet - break; - default: - ASSERT ( !"invalid status in memory block found in pool!" ); - } - NextBlock = (PR_USED)RNextBlock(pool,(PR_FREE)Block); - if ( !NextBlock ) - break; - ASSERT ( NextBlock->PrevSize == Block->Size ); - Block = NextBlock; - } - } - { - // now let's step through the list of free pointers and verify - // each one can be found by size-jumping... - PR_FREE Free = (PR_FREE)pool->FirstFree; - while ( Free ) - { - PR_FREE NextFree = (PR_FREE)pool->UserBase; - if ( Free != NextFree ) - { - while ( NextFree != Free ) - { - NextFree = RNextBlock ( pool, NextFree ); - ASSERT(NextFree); - } - } - Free = Free->NextFree; - } - } -} - -static void -RSetSize ( PR_POOL pool, PR_FREE Block, rulong NewSize, PR_FREE NextBlock ) -{ - R_ASSERT_PTR(pool,Block); - ASSERT ( NewSize < pool->UserSize ); - ASSERT ( NewSize >= sizeof(R_FREE) ); - Block->Size = NewSize; - if ( !NextBlock ) - NextBlock = RNextBlock ( pool, Block ); - if ( NextBlock ) - NextBlock->PrevSize = NewSize; -} - -static PR_FREE -RFreeSplit ( PR_POOL pool, PR_FREE Block, rulong NewSize ) -{ - PR_FREE NewBlock = (PR_FREE)((char*)Block + NewSize); - RSetSize ( pool, NewBlock, Block->Size - NewSize, NULL ); - RSetSize ( pool, Block, NewSize, NewBlock ); - RFreeInit ( NewBlock ); - RPoolAddFree ( pool, NewBlock ); - return NewBlock; -} - -static void -RFreeMerge ( PR_POOL pool, PR_FREE First, PR_FREE Second ) -{ - ASSERT ( RPreviousBlock(Second) == First ); - ASSERT ( First->Size == Second->PrevSize ); - RPoolRemoveFree ( pool, Second ); - RSetSize ( pool, First, First->Size + Second->Size, NULL ); -} - -static void -RPoolReclaim ( PR_POOL pool, PR_FREE FreeBlock ) -{ - PR_FREE NextBlock, PreviousBlock; - - RFreeInit ( FreeBlock ); - RPoolAddFree ( pool, FreeBlock ); - - // TODO FIXME - don't merge and always insert freed blocks at the end for debugging purposes... - - /* - * If the next block is immediately adjacent to the newly freed one then - * merge them. - * PLEASE DO NOT WIPE OUT 'MAGIC' OR 'LASTOWNER' DATA FOR MERGED FREE BLOCKS - */ - NextBlock = RNextBlock ( pool, FreeBlock ); - if ( NextBlock != NULL && !NextBlock->Status ) - { - RFreeMerge ( pool, FreeBlock, NextBlock ); - } - - /* - * If the previous block is adjacent to the newly freed one then - * merge them. - * PLEASE DO NOT WIPE OUT 'MAGIC' OR 'LASTOWNER' DATA FOR MERGED FREE BLOCKS - */ - PreviousBlock = RPreviousBlock ( FreeBlock ); - if ( PreviousBlock != NULL && !PreviousBlock->Status ) - { - RFreeMerge ( pool, PreviousBlock, FreeBlock ); - } -} - -static void -RiUsedInit ( PR_USED Block, rulong Tag ) -{ - Block->Status = 1; - RUsedFillStack ( Block ); -#ifdef R_MAGIC - Block->UsedMagic = R_USED_MAGIC; -#endif//R_MAGIC - //ASSERT_SIZE ( Block->Size ); - - // now add the block to the used block list -#if DBG - Block->NextUsed = (PR_USED)(ULONG_PTR)0xDEADBEEF; -#endif//R_USED_LIST - - Block->Tag = Tag; -} - -#if !R_RZ -#define RiUsedInitRedZone(Block,UserSize) -#else//R_RZ -static void -RiUsedInitRedZone ( PR_USED Block, rulong UserSize ) -{ - // write out buffer-overrun detection bytes - char* Addr = (char*)RHdrToBody(Block); - Block->UserSize = UserSize; - memset ( Addr - R_RZ, R_RZ_LOVALUE, R_RZ ); - memset ( Addr + Block->UserSize, R_RZ_HIVALUE, R_RZ ); -#if DBG - memset ( Addr, 0xCD, UserSize ); -#endif//DBG -} -#endif//R_RZ - -static void* -RPoolAlloc ( PR_POOL pool, rulong NumberOfBytes, rulong Tag, rulong align ) -{ - PR_USED NewBlock; - PR_FREE BestBlock, - NextBlock, - PreviousBlock, - BestPreviousBlock, - CurrentBlock; - void* BestAlignedAddr; - int que, - queBytes = NumberOfBytes; - rulong BlockSize, - Alignment; - int que_reclaimed = 0; - - ASSERT ( pool ); - ASSERT ( align < 3 ); - - R_ACQUIRE_MUTEX(pool); - - if ( !NumberOfBytes ) - { - R_DEBUG("0 bytes requested - initiating pool verification\n"); - RPoolRedZoneCheck ( pool, __FILE__, __LINE__ ); - R_RELEASE_MUTEX(pool); - return NULL; - } - if ( NumberOfBytes > pool->PoolSize ) - { - if ( R_IS_POOL_PTR(pool,NumberOfBytes) ) - { - R_DEBUG("red zone verification requested for block 0x%X\n", NumberOfBytes ); - RUsedRedZoneCheck(pool,RBodyToHdr((void*)(ULONG_PTR)NumberOfBytes), (char*)(ULONG_PTR)NumberOfBytes, __FILE__, __LINE__ ); - R_RELEASE_MUTEX(pool); - return NULL; - } - R_DEBUG("Invalid allocation request: %i bytes\n", NumberOfBytes ); - R_RELEASE_MUTEX(pool); - return NULL; - } - - que = RQueWhich ( NumberOfBytes ); - if ( que >= 0 ) - { - if ( (NewBlock = RQueRemove ( &pool->Que[que][align] )) ) - { - RiUsedInit ( NewBlock, Tag ); - RiUsedInitRedZone ( NewBlock, NumberOfBytes ); - R_RELEASE_MUTEX(pool); - return RHdrToBody(NewBlock); - } - queBytes = 16 << que; - } - - /* - * Calculate the total number of bytes we will need. - */ - BlockSize = queBytes + sizeof(R_USED) + 2*R_RZ; - if (BlockSize < sizeof(R_FREE)) - { - /* At least we need the size of the free block header. */ - BlockSize = sizeof(R_FREE); - } - -try_again: - /* - * Find the best-fitting block. - */ - BestBlock = NULL; - Alignment = pool->Alignments[align]; - PreviousBlock = NULL; - BestPreviousBlock = NULL, - CurrentBlock = pool->FirstFree; - BestAlignedAddr = NULL; - - while ( CurrentBlock != NULL ) - { - PVOID Addr = RHdrToBody(CurrentBlock); - PVOID CurrentBlockEnd = (char*)CurrentBlock + CurrentBlock->Size; - /* calculate last size-aligned address available within this block */ - PVOID AlignedAddr = R_ROUND_DOWN((char*)CurrentBlockEnd-queBytes-R_RZ, Alignment); - ASSERT ( (char*)AlignedAddr+queBytes+R_RZ <= (char*)CurrentBlockEnd ); - - /* special case, this address is already size-aligned, and the right size */ - if ( Addr == AlignedAddr ) - { - BestAlignedAddr = AlignedAddr; - BestPreviousBlock = PreviousBlock; - BestBlock = CurrentBlock; - break; - } - // if we carve out a size-aligned block... is it still past the end of this - // block's free header? - else if ( (char*)RBodyToHdr(AlignedAddr) - >= (char*)CurrentBlock+sizeof(R_FREE) ) - { - /* - * there's enough room to allocate our size-aligned memory out - * of this block, see if it's a better choice than any previous - * finds - */ - if ( BestBlock == NULL - || BestBlock->Size > CurrentBlock->Size ) - { - BestAlignedAddr = AlignedAddr; - BestPreviousBlock = PreviousBlock; - BestBlock = CurrentBlock; - } - } - - PreviousBlock = CurrentBlock; - CurrentBlock = CurrentBlock->NextFree; - } - - /* - * We didn't find anything suitable at all. - */ - if (BestBlock == NULL) - { - if ( !que_reclaimed ) - { - // reclaim que - int i, j; - for ( i = 0; i < R_QUECOUNT; i++ ) - { - for ( j = 0; j < 3; j++ ) - { - while ( (BestBlock = (PR_FREE)RQueRemove ( &pool->Que[i][j] )) ) - { - RPoolReclaim ( pool, BestBlock ); - } - } - } - - que_reclaimed = 1; - goto try_again; - } - DPRINT1("Trying to allocate %lu bytes from paged pool - nothing suitable found, returning NULL\n", - queBytes ); - R_RELEASE_MUTEX(pool); - return NULL; - } - /* - * we found a best block. If Addr isn't already aligned, we've pre-qualified that - * there's room at the beginning of the block for a free block... - */ - { - void* Addr = RHdrToBody(BestBlock); - if ( BestAlignedAddr != Addr ) - { - PR_FREE NewFreeBlock = RFreeSplit ( - pool, - BestBlock, - (char*)RBodyToHdr(BestAlignedAddr) - (char*)BestBlock ); - ASSERT ( BestAlignedAddr > Addr ); - - //DPRINT ( "breaking off preceding bytes into their own block...\n" ); - /*DPRINT ( "NewFreeBlock 0x%x Size %lu (Old Block's new size %lu) NextFree 0x%x\n", - NewFreeBlock, NewFreeBlock->Size, BestBlock->Size, BestBlock->NextFree );*/ - - /* we want the following code to use our size-aligned block */ - BestPreviousBlock = BestBlock; - BestBlock = NewFreeBlock; - - //VerifyPagedPool(); - } - } - /* - * Is there enough space to create a second block from the unused portion. - */ - if ( (BestBlock->Size - BlockSize) > sizeof(R_FREE) ) - { - /*DPRINT("BestBlock 0x%x Size 0x%x BlockSize 0x%x NewSize 0x%x\n", - BestBlock, BestBlock->Size, BlockSize, NewSize );*/ - - /* - * Create the new free block. - */ - NextBlock = RFreeSplit ( pool, BestBlock, BlockSize ); - //ASSERT_SIZE ( NextBlock->Size ); - } - /* - * Remove the selected block from the list of free blocks. - */ - //DPRINT ( "Removing selected block from free block list\n" ); - RPoolRemoveFree ( pool, BestBlock ); - /* - * Create the new used block header. - */ - NewBlock = (PR_USED)BestBlock; - RiUsedInit ( NewBlock, Tag ); - - /* RtlZeroMemory(RHdrToBody(NewBlock), NumberOfBytes);*/ - - RiUsedInitRedZone ( NewBlock, NumberOfBytes ); - R_RELEASE_MUTEX(pool); - - return RHdrToBody(NewBlock); -} - -static void -RPoolFree ( PR_POOL pool, void* Addr ) -{ - PR_USED UsedBlock; - rulong UsedSize; - PR_FREE FreeBlock; - rulong UserSize; - int que; - - ASSERT(pool); - if ( !Addr ) - { - R_DEBUG("Attempt to free NULL ptr, initiating Red Zone Check\n" ); - R_ACQUIRE_MUTEX(pool); - RPoolRedZoneCheck ( pool, __FILE__, __LINE__ ); - R_RELEASE_MUTEX(pool); - return; - } - R_ASSERT_PTR(pool,Addr); - - UsedBlock = RBodyToHdr(Addr); - UsedSize = UsedBlock->Size; - FreeBlock = (PR_FREE)UsedBlock; -#if R_RZ - UserSize = UsedBlock->UserSize; -#else - UserSize = UsedSize - sizeof(R_USED) - 2*R_RZ; -#endif//R_RZ - - RUsedRedZoneCheck ( pool, UsedBlock, Addr, __FILE__, __LINE__ ); - -#if R_RZ - memset ( Addr, 0xCD, UsedBlock->UserSize ); -#endif - - que = RQueWhich ( UserSize ); - if ( que >= 0 ) - { - int queBytes = 16 << que; - ASSERT( (rulong)queBytes >= UserSize ); - if ( que >= 0 ) - { - int align = 0; - if ( R_ROUND_UP(Addr,pool->Alignments[2]) == Addr ) - align = 2; - else if ( R_ROUND_UP(Addr,pool->Alignments[1]) == Addr ) - align = 1; - R_ACQUIRE_MUTEX(pool); - RQueAdd ( &pool->Que[que][align], UsedBlock ); - R_RELEASE_MUTEX(pool); - return; - } - } - - R_ACQUIRE_MUTEX(pool); - RPoolReclaim ( pool, FreeBlock ); - R_RELEASE_MUTEX(pool); -} - -#if 0 -static void -RPoolDumpByTag ( PR_POOL pool, rulong Tag ) -{ - PR_USED Block = (PR_USED)pool->UserBase; - PR_USED NextBlock; - int count = 0; - char tag[5]; - - // TODO FIXME - should we validate params or ASSERT_IRQL? - R_DEBUG ( "PagedPool Dump by tag '%s'\n", RFormatTag(Tag,tag) ); - R_DEBUG ( " -BLOCK-- --SIZE--\n" ); - - R_ACQUIRE_MUTEX(pool); - for ( ;; ) - { - if ( Block->Status == 1 && Block->Tag == Tag ) - { - R_DEBUG ( " %08X %08X\n", Block, Block->Size ); - ++count; - } - NextBlock = (PR_USED)RNextBlock(pool,(PR_FREE)Block); - if ( !NextBlock ) - break; - ASSERT ( NextBlock->PrevSize == Block->Size ); - Block = NextBlock; - } - R_RELEASE_MUTEX(pool); - - R_DEBUG ( "Entries found for tag '%s': %i\n", tag, count ); -} -#endif - -rulong -RPoolQueryTag ( void* Addr ) -{ - PR_USED Block = RBodyToHdr(Addr); - // TODO FIXME - should we validate params? -#ifdef R_MAGIC - if ( Block->UsedMagic != R_USED_MAGIC ) - return 0xDEADBEEF; -#endif//R_MAGIC - if ( Block->Status != 1 ) - return 0xDEADBEEF; - return Block->Tag; -} - -void -RPoolStats ( PR_POOL pool ) -{ - int free=0, used=0, qued=0; - PR_USED Block = (PR_USED)pool->UserBase; - - R_ACQUIRE_MUTEX(pool); - while ( Block ) - { - switch ( Block->Status ) - { - case 0: - ++free; - break; - case 1: - ++used; - break; - case 2: - ++qued; - break; - default: - ASSERT ( !"Invalid Status for Block in pool!" ); - } - Block = (PR_USED)RNextBlock(pool,(PR_FREE)Block); - } - R_RELEASE_MUTEX(pool); - - R_DEBUG ( "Pool Stats: Free=%i, Used=%i, Qued=%i, Total=%i\n", free, used, qued, (free+used+qued) ); -} - -#ifdef R_LARGEST_ALLOC_POSSIBLE -static rulong -RPoolLargestAllocPossible ( PR_POOL pool, int align ) -{ - int Alignment = pool->Alignments[align]; - rulong LargestUserSize = 0; - PR_FREE Block = (PR_FREE)pool->UserBase; - while ( Block ) - { - if ( Block->Status != 1 ) - { - void* Addr, *AlignedAddr; - rulong BlockMaxUserSize; - int cue, cueBytes; - - Addr = (char*)Block + sizeof(R_USED) + R_RZ; - AlignedAddr = R_ROUND_UP(Addr,Alignment); - if ( Addr != AlignedAddr ) - Addr = R_ROUND_UP((char*)Block + sizeof(R_FREE) + sizeof(R_USED) + R_RZ, Alignment ); - BlockMaxUserSize = (char*)Block + Block->Size - (char*)Addr - R_RZ; - cue = RQueWhich ( BlockMaxUserSize ); - if ( cue >= 0 ) - { - cueBytes = 16 << cue; - if ( cueBytes > BlockMaxUserSize ); - { - if ( !cue ) - BlockMaxUserSize = 0; - else - BlockMaxUserSize = 16 << (cue-1); - } - } - if ( BlockMaxUserSize > LargestUserSize ) - LargestUserSize = BlockMaxUserSize; - } - Block = RNextBlock ( pool, Block ); - } - return LargestUserSize; -} -#endif//R_LARGEST_ALLOC_POSSIBLE - -#endif//RPOOLMGR_H Modified: trunk/reactos/ntoskrnl/ntoskrnl-generic.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ntoskrnl-generic.…
============================================================================== --- trunk/reactos/ntoskrnl/ntoskrnl-generic.rbuild [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ntoskrnl-generic.rbuild [iso-8859-1] Sat Jan 2 17:17:48 2010 @@ -403,7 +403,6 @@ </directory> <file>anonmem.c</file> <file>balance.c</file> - <file>dbgpool.c</file> <file>freelist.c</file> <file>marea.c</file> <if property="_WINKD_" value ="1"> @@ -415,8 +414,6 @@ <file>pagefile.c</file> <file>pageop.c</file> <file>pe.c</file> - <file>pool.c</file> - <file>ppool.c</file> <file>procsup.c</file> <file>region.c</file> <file>rmap.c</file>
14 years, 11 months
1
0
0
0
← Newer
1
...
45
46
47
48
49
50
51
52
53
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
Results per page:
10
25
50
100
200