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
July 2011
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
24 participants
517 discussions
Start a n
N
ew thread
[rharabien] 52593: [NTDLL/LDR] - Fix build (not sure if its right place for IMAGE_LOADER_FLAGS_*) - Remove unused label
by rharabien@svn.reactos.org
Author: rharabien Date: Sat Jul 9 22:26:23 2011 New Revision: 52593 URL:
http://svn.reactos.org/svn/reactos?rev=52593&view=rev
Log: [NTDLL/LDR] - Fix build (not sure if its right place for IMAGE_LOADER_FLAGS_*) - Remove unused label Modified: trunk/reactos/dll/ntdll/include/ntdllp.h trunk/reactos/dll/ntdll/ldr/ldrutils.c trunk/reactos/include/ddk/ntimage.h Modified: trunk/reactos/dll/ntdll/include/ntdllp.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/ntdll/include/ntdllp.h…
============================================================================== --- trunk/reactos/dll/ntdll/include/ntdllp.h [iso-8859-1] (original) +++ trunk/reactos/dll/ntdll/include/ntdllp.h [iso-8859-1] Sat Jul 9 22:26:23 2011 @@ -14,6 +14,10 @@ #define LDRP_UPDATE_REFCOUNT 0x01 #define LDRP_UPDATE_DEREFCOUNT 0x02 #define LDRP_UPDATE_PIN 0x03 + +/* Loader flags */ +#define IMAGE_LOADER_FLAGS_COMPLUS 0x00000001 +#define IMAGE_LOADER_FLAGS_SYSTEM_GLOBAL 0x01000000 typedef struct _LDRP_TLS_DATA { Modified: trunk/reactos/dll/ntdll/ldr/ldrutils.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/ntdll/ldr/ldrutils.c?r…
============================================================================== --- trunk/reactos/dll/ntdll/ldr/ldrutils.c [iso-8859-1] (original) +++ trunk/reactos/dll/ntdll/ldr/ldrutils.c [iso-8859-1] Sat Jul 9 22:26:23 2011 @@ -474,7 +474,6 @@ } } -Quickie: /* Close the file handle, we don't need it */ NtClose(FileHandle); Modified: trunk/reactos/include/ddk/ntimage.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/ntimage.h?rev=…
============================================================================== --- trunk/reactos/include/ddk/ntimage.h [iso-8859-1] (original) +++ trunk/reactos/include/ddk/ntimage.h [iso-8859-1] Sat Jul 9 22:26:23 2011 @@ -420,6 +420,12 @@ #define IMAGE_DLLCHARACTERISTICS_TERMINAL_SERVER_AWARE 0x8000 // +// Loader Flags +// +#define IMAGE_LOADER_FLAGS_COMPLUS 0x00000001 +#define IMAGE_LOADER_FLAGS_SYSTEM_GLOBAL 0x01000000 + +// // Directory Entry Specifiers // #define IMAGE_DIRECTORY_ENTRY_EXPORT 0
13 years, 5 months
1
0
0
0
[tfaber] 52592: [KMTESTS] - decrease log buffer size because ROS has a problem with unlocking it otherwise ; ) - add test for critical/guarded regions - add test for executive resources (part 1)
by tfaber@svn.reactos.org
Author: tfaber Date: Sat Jul 9 22:02:54 2011 New Revision: 52592 URL:
http://svn.reactos.org/svn/reactos?rev=52592&view=rev
Log: [KMTESTS] - decrease log buffer size because ROS has a problem with unlocking it otherwise ;) - add test for critical/guarded regions - add test for executive resources (part 1) Added: branches/GSoC_2011/KMTestSuite/kmtests/ntos_ex/ExResource.c (with props) branches/GSoC_2011/KMTestSuite/kmtests/ntos_ke/KeApc.c (with props) Modified: branches/GSoC_2011/KMTestSuite/kmtests/CMakeLists.txt branches/GSoC_2011/KMTestSuite/kmtests/kmtest/kmtest.c branches/GSoC_2011/KMTestSuite/kmtests/kmtest_drv.rbuild branches/GSoC_2011/KMTestSuite/kmtests/kmtest_drv/testlist.c branches/GSoC_2011/KMTestSuite/kmtests/ntos_ke/KeDpc.c Modified: branches/GSoC_2011/KMTestSuite/kmtests/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/KMTestSuite/kmtests/C…
============================================================================== --- branches/GSoC_2011/KMTestSuite/kmtests/CMakeLists.txt [iso-8859-1] (original) +++ branches/GSoC_2011/KMTestSuite/kmtests/CMakeLists.txt [iso-8859-1] Sat Jul 9 22:02:54 2011 @@ -15,11 +15,13 @@ example/Example.c ntos_ex/ExPools.c + ntos_ex/ExResource.c ntos_ex/ExTimer.c ntos_fsrtl/FsRtlExpression.c ntos_io/IoDeviceInterface.c ntos_io/IoIrp.c ntos_io/IoMdl.c + ntos_ke/KeApc.c ntos_ke/KeDpc.c ntos_ke/KeIrql.c ntos_ke/KeProcessor.c Modified: branches/GSoC_2011/KMTestSuite/kmtests/kmtest/kmtest.c URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/KMTestSuite/kmtests/k…
============================================================================== --- branches/GSoC_2011/KMTestSuite/kmtests/kmtest/kmtest.c [iso-8859-1] (original) +++ branches/GSoC_2011/KMTestSuite/kmtests/kmtest/kmtest.c [iso-8859-1] Sat Jul 9 22:02:54 2011 @@ -23,7 +23,7 @@ #define SERVICE_NAME L"Kmtest" #define SERVICE_PATH L"kmtest_drv.sys" -#define LOGBUFFER_SIZE 65000 +#define LOGBUFFER_SIZE 16364 #define RESULTBUFFER_SIZE FIELD_OFFSET(KMT_RESULTBUFFER, LogBuffer[LOGBUFFER_SIZE]) HANDLE KmtestHandle; Modified: branches/GSoC_2011/KMTestSuite/kmtests/kmtest_drv.rbuild URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/KMTestSuite/kmtests/k…
============================================================================== --- branches/GSoC_2011/KMTestSuite/kmtests/kmtest_drv.rbuild [iso-8859-1] (original) +++ branches/GSoC_2011/KMTestSuite/kmtests/kmtest_drv.rbuild [iso-8859-1] Sat Jul 9 22:02:54 2011 @@ -14,6 +14,7 @@ </directory> <directory name="ntos_ex"> <file>ExPools.c</file> + <file>ExResource.c</file> <file>ExTimer.c</file> </directory> <directory name="ntos_fsrtl"> @@ -25,6 +26,7 @@ <file>IoMdl.c</file> </directory> <directory name="ntos_ke"> + <file>KeApc.c</file> <file>KeDpc.c</file> <file>KeIrql.c</file> <file>KeProcessor.c</file> Modified: branches/GSoC_2011/KMTestSuite/kmtests/kmtest_drv/testlist.c URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/KMTestSuite/kmtests/k…
============================================================================== --- branches/GSoC_2011/KMTestSuite/kmtests/kmtest_drv/testlist.c [iso-8859-1] (original) +++ branches/GSoC_2011/KMTestSuite/kmtests/kmtest_drv/testlist.c [iso-8859-1] Sat Jul 9 22:02:54 2011 @@ -10,11 +10,13 @@ KMT_TESTFUNC Test_Example; KMT_TESTFUNC Test_ExPools; +KMT_TESTFUNC Test_ExResource; KMT_TESTFUNC Test_ExTimer; KMT_TESTFUNC Test_FsRtlExpression; KMT_TESTFUNC Test_IoDeviceInterface; KMT_TESTFUNC Test_IoIrp; KMT_TESTFUNC Test_IoMdl; +KMT_TESTFUNC Test_KeApc; KMT_TESTFUNC Test_KeDpc; KMT_TESTFUNC Test_KeIrql; KMT_TESTFUNC Test_KeProcessor; @@ -24,11 +26,13 @@ { { "Example", Test_Example }, { "ExPools", Test_ExPools }, + { "ExResource", Test_ExResource }, { "ExTimer", Test_ExTimer }, { "FsRtlExpression", Test_FsRtlExpression }, { "IoDeviceInterface", Test_IoDeviceInterface }, { "IoIrp", Test_IoIrp }, { "IoMdl", Test_IoMdl }, + { "KeApc", Test_KeApc }, { "KeDpc", Test_KeDpc }, { "KeIrql", Test_KeIrql }, { "KeProcessor", Test_KeProcessor }, Added: branches/GSoC_2011/KMTestSuite/kmtests/ntos_ex/ExResource.c URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/KMTestSuite/kmtests/n…
============================================================================== --- branches/GSoC_2011/KMTestSuite/kmtests/ntos_ex/ExResource.c (added) +++ branches/GSoC_2011/KMTestSuite/kmtests/ntos_ex/ExResource.c [iso-8859-1] Sat Jul 9 22:02:54 2011 @@ -1,0 +1,270 @@ +/* + * PROJECT: ReactOS kernel-mode tests + * LICENSE: GPLv2+ - See COPYING in the top level directory + * PURPOSE: Kernel-Mode Test Suite Executive Resource test + * PROGRAMMER: Thomas Faber <thfabba(a)gmx.de> + */ + +#undef NTDDI_VERSION +#define NTDDI_VERSION NTDDI_WS03SP1 +#include <ntddk.h> +#include <ntifs.h> +#include <ndk/extypes.h> +#include <kmt_test.h> +#include <pseh/pseh2.h> + +//#define NDEBUG +#include <debug.h> + +/* TODO: this is the Windows Server 2003 version! ROS should use this! + * This declaration can be removed once ROS headers are corrected */ +typedef struct _ERESOURCE_2K3 { + LIST_ENTRY SystemResourcesList; + POWNER_ENTRY OwnerTable; + SHORT ActiveCount; + USHORT Flag; + volatile PKSEMAPHORE SharedWaiters; + volatile PKEVENT ExclusiveWaiters; + OWNER_ENTRY OwnerThreads[2]; + ULONG ContentionCount; + USHORT NumberOfSharedWaiters; + USHORT NumberOfExclusiveWaiters; +#if defined(_WIN64) + PVOID Reserved2; /* TODO: not sure if this should be in here for 2k3 */ +#endif + _ANONYMOUS_UNION union { + PVOID Address; + ULONG_PTR CreatorBackTraceIndex; + } DUMMYUNIONNAME; + KSPIN_LOCK SpinLock; +} ERESOURCE_2K3, *PERESOURCE_2K3; + +#define CheckResourceFields(Res) do \ +{ \ + ok_eq_pointer((Res)->SystemResourcesList.Flink->Blink, &(Res)->SystemResourcesList); \ + ok_eq_pointer((Res)->SystemResourcesList.Blink->Flink, &(Res)->SystemResourcesList); \ + ok_eq_pointer((Res)->OwnerTable, NULL); \ + ok_eq_int((Res)->ActiveCount, 0); \ + ok_eq_uint((Res)->Flag, 0); \ + ok_eq_pointer((Res)->SharedWaiters, NULL); \ + ok_eq_pointer((Res)->ExclusiveWaiters, NULL); \ + ok_eq_pointer((PVOID)(Res)->OwnerThreads[0].OwnerThread, NULL); \ + ok_eq_ulong((Res)->OwnerThreads[0].TableSize, 0LU); \ + ok_eq_pointer((PVOID)(Res)->OwnerThreads[1].OwnerThread, NULL); \ + ok_eq_ulong((Res)->OwnerThreads[1].TableSize, 0LU); \ + ok_eq_ulong((Res)->ContentionCount, 0LU); \ + ok_eq_uint((Res)->NumberOfSharedWaiters, 0); \ + ok_eq_uint((Res)->NumberOfExclusiveWaiters, 0); \ + /* ok_eq_pointer((Res)->Reserved2, NULL); */ \ + ok_eq_pointer((Res)->Address, NULL); \ + ok_eq_pointer((PVOID)(Res)->SpinLock, NULL); \ +} while (0) + +#define CheckResourceStatus(Res, Exclusive, Shared, ExclusiveWaiters, SharedWaiters) do \ +{ \ + if (Exclusive) \ + ok_bool_true(ExIsResourceAcquiredExclusiveLite(Res), "ExIsResourceAcquiredExclusiveLite returned"); \ + else \ + ok_bool_false(ExIsResourceAcquiredExclusiveLite(Res), "ExIsResourceAcquiredExclusiveLite returned"); \ + ok_eq_ulong(ExIsResourceAcquiredSharedLite(Res), Shared); \ + ok_eq_ulong(ExGetExclusiveWaiterCount(Res), ExclusiveWaiters); \ + ok_eq_ulong(ExGetSharedWaiterCount(Res), SharedWaiters); \ +} while (0) + +static +VOID +TestResourceSharedAccess( + IN PERESOURCE Res) +{ + LONG Count = 0; + + KeEnterCriticalRegion(); + ok_bool_true(ExAcquireResourceSharedLite(Res, FALSE), "ExAcquireResourceSharedLite returned"); ++Count; + CheckResourceStatus(Res, FALSE, Count, 0LU, 0LU); + + ok_bool_true(ExAcquireResourceSharedLite(Res, FALSE), "ExAcquireResourceSharedLite returned"); ++Count; + ok_bool_true(ExAcquireResourceSharedLite(Res, TRUE), "ExAcquireResourceSharedLite returned"); ++Count; + ok_bool_true(ExAcquireSharedStarveExclusive(Res, FALSE), "ExAcquireSharedStarveExclusive returned"); ++Count; + ok_bool_true(ExAcquireSharedStarveExclusive(Res, TRUE), "ExAcquireSharedStarveExclusive returned"); ++Count; + ok_bool_true(ExAcquireSharedWaitForExclusive(Res, FALSE), "ExAcquireSharedWaitForExclusive returned"); ++Count; + ok_bool_true(ExAcquireSharedWaitForExclusive(Res, TRUE), "ExAcquireSharedWaitForExclusive returned"); ++Count; + CheckResourceStatus(Res, FALSE, Count, 0LU, 0LU); + + /* this one fails, TRUE would deadlock */ + ok_bool_false(ExAcquireResourceExclusiveLite(Res, FALSE), "ExAcquireResourceExclusiveLite returned"); + CheckResourceStatus(Res, FALSE, Count, 0LU, 0LU); + + /* this must not crash or deadlock (but can assert) */ + ExConvertExclusiveToSharedLite(Res); + CheckResourceStatus(Res, FALSE, Count, 0LU, 0LU); + + while (Count--) + ExReleaseResourceLite(Res); + KeLeaveCriticalRegion(); +} + +static +VOID +TestResourceExclusiveAccess( + IN PERESOURCE Res) +{ + LONG Count = 0; + + KeEnterCriticalRegion(); + ok_bool_true(ExAcquireResourceExclusiveLite(Res, FALSE), "ExAcquireResourceExclusiveLite returned"); ++Count; + + CheckResourceStatus(Res, TRUE, Count, 0LU, 0LU); + + ok_bool_true(ExAcquireResourceExclusiveLite(Res, TRUE), "ExAcquireResourceExclusiveLite returned"); ++Count; + CheckResourceStatus(Res, TRUE, Count, 0LU, 0LU); + + ok_bool_true(ExAcquireResourceSharedLite(Res, FALSE), "ExAcquireResourceSharedLite returned"); ++Count; + ok_bool_true(ExAcquireResourceSharedLite(Res, TRUE), "ExAcquireResourceSharedLite returned"); ++Count; + ok_bool_true(ExAcquireSharedStarveExclusive(Res, FALSE), "ExAcquireSharedStarveExclusive returned"); ++Count; + ok_bool_true(ExAcquireSharedStarveExclusive(Res, TRUE), "ExAcquireSharedStarveExclusive returned"); ++Count; + ok_bool_true(ExAcquireSharedWaitForExclusive(Res, FALSE), "ExAcquireSharedWaitForExclusive returned"); ++Count; + ok_bool_true(ExAcquireSharedWaitForExclusive(Res, TRUE), "ExAcquireSharedWaitForExclusive returned"); ++Count; + CheckResourceStatus(Res, TRUE, Count, 0LU, 0LU); + + ExConvertExclusiveToSharedLite(Res); + CheckResourceStatus(Res, FALSE, Count, 0LU, 0LU); + + while (Count--) + ExReleaseResourceLite(Res); + KeLeaveCriticalRegion(); +} + +static +VOID +TestResourceUndocumentedShortcuts( + IN PERESOURCE Res, + IN BOOLEAN AreApcsDisabled) +{ + PVOID Ret; + LONG Count = 0; + + ok_bool_false(KeAreApcsDisabled(), "KeAreApcsDisabled returned"); + ok_eq_uint(KeAreAllApcsDisabled(), AreApcsDisabled); + + /* ExEnterCriticalRegionAndAcquireResourceShared, ExEnterCriticalRegionAndAcquireSharedWaitForExclusive */ + Count = 0; + Ret = ExEnterCriticalRegionAndAcquireResourceShared(Res); ++Count; + ok_eq_pointer(Ret, KeGetCurrentThread()->Win32Thread); + ok_bool_true(KeAreApcsDisabled(), "KeAreApcsDisabled returned"); + ok_eq_bool(KeAreAllApcsDisabled(), AreApcsDisabled); + CheckResourceStatus(Res, FALSE, Count, 0LU, 0LU); + + Ret = ExEnterCriticalRegionAndAcquireResourceShared(Res); ++Count; + ok_eq_pointer(Ret, KeGetCurrentThread()->Win32Thread); + ok_bool_true(KeAreApcsDisabled(), "KeAreApcsDisabled returned"); + ok_eq_bool(KeAreAllApcsDisabled(), AreApcsDisabled); + CheckResourceStatus(Res, FALSE, Count, 0LU, 0LU); + + ExEnterCriticalRegionAndAcquireSharedWaitForExclusive(Res); ++Count; + ok_eq_pointer(Ret, KeGetCurrentThread()->Win32Thread); + ok_bool_true(KeAreApcsDisabled(), "KeAreApcsDisabled returned"); + ok_eq_bool(KeAreAllApcsDisabled(), AreApcsDisabled); + CheckResourceStatus(Res, FALSE, Count, 0LU, 0LU); + + while (Count-- > 1) + { + ExReleaseResourceAndLeaveCriticalRegion(Res); + ok_bool_true(KeAreApcsDisabled(), "KeAreApcsDisabled returned"); + ok_eq_bool(KeAreAllApcsDisabled(), AreApcsDisabled); + CheckResourceStatus(Res, FALSE, Count, 0LU, 0LU); + } + + ExReleaseResourceAndLeaveCriticalRegion(Res); + ok_bool_false(KeAreApcsDisabled(), "KeAreApcsDisabled returned"); + ok_eq_bool(KeAreAllApcsDisabled(), AreApcsDisabled); + CheckResourceStatus(Res, FALSE, Count, 0LU, 0LU); + + /* ExEnterCriticalRegionAndAcquireResourceExclusive */ + Count = 0; + ok_bool_false(KeAreApcsDisabled(), "KeAreApcsDisabled returned"); + ok_eq_bool(KeAreAllApcsDisabled(), AreApcsDisabled); + Ret = ExEnterCriticalRegionAndAcquireResourceExclusive(Res); ++Count; + ok_eq_pointer(Ret, KeGetCurrentThread()->Win32Thread); + ok_bool_true(KeAreApcsDisabled(), "KeAreApcsDisabled returned"); + ok_eq_bool(KeAreAllApcsDisabled(), AreApcsDisabled); + CheckResourceStatus(Res, TRUE, Count, 0LU, 0LU); + + Ret = ExEnterCriticalRegionAndAcquireResourceExclusive(Res); ++Count; + ok_eq_pointer(Ret, KeGetCurrentThread()->Win32Thread); + ok_bool_true(KeAreApcsDisabled(), "KeAreApcsDisabled returned"); + ok_eq_bool(KeAreAllApcsDisabled(), AreApcsDisabled); + CheckResourceStatus(Res, TRUE, Count, 0LU, 0LU); + + ExReleaseResourceAndLeaveCriticalRegion(Res); --Count; + ok_bool_true(KeAreApcsDisabled(), "KeAreApcsDisabled returned"); + ok_eq_bool(KeAreAllApcsDisabled(), AreApcsDisabled); + CheckResourceStatus(Res, TRUE, Count, 0LU, 0LU); + + ExReleaseResourceAndLeaveCriticalRegion(Res); --Count; + ok_bool_false(KeAreApcsDisabled(), "KeAreApcsDisabled returned"); + ok_eq_uint(KeAreAllApcsDisabled(), AreApcsDisabled); + CheckResourceStatus(Res, FALSE, Count, 0LU, 0LU); +} + +START_TEST(ExResource) +{ + NTSTATUS Status; + ERESOURCE Res; + KIRQL Irql; + + /* this must be true even with the different structure versions */ + ASSERT(sizeof(ERESOURCE) == sizeof(ERESOURCE_2K3)); + + /* functional tests & internals */ + Irql = KeRaiseIrqlToDpcLevel(); + Status = ExInitializeResourceLite(&Res); + ok_eq_hex(Status, STATUS_SUCCESS); + KeLowerIrql(APC_LEVEL); + + Status = ExDeleteResourceLite(&Res); + ok_eq_hex(Status, STATUS_SUCCESS); + KeLowerIrql(Irql); + + memset(&Res, 0x55, sizeof Res); + Status = ExInitializeResourceLite(&Res); + ok_eq_hex(Status, STATUS_SUCCESS); + CheckResourceFields((PERESOURCE_2K3)&Res); + + CheckResourceStatus(&Res, FALSE, 0LU, 0LU, 0LU); + + TestResourceSharedAccess(&Res); + CheckResourceStatus(&Res, FALSE, 0LU, 0LU, 0LU); + + TestResourceExclusiveAccess(&Res); + CheckResourceStatus(&Res, FALSE, 0LU, 0LU, 0LU); + + TestResourceUndocumentedShortcuts(&Res, FALSE); + CheckResourceStatus(&Res, FALSE, 0LU, 0LU, 0LU); + KeRaiseIrql(APC_LEVEL, &Irql); + TestResourceUndocumentedShortcuts(&Res, TRUE); + KeLowerIrql(Irql); + ok_bool_false(KeAreApcsDisabled(), "KeAreApcsDisabled returned"); + CheckResourceStatus(&Res, FALSE, 0LU, 0LU, 0LU); + + /* ExReinitializeResourceLite cleans up after us */ + Status = ExReinitializeResourceLite(&Res); + ok_eq_hex(Status, STATUS_SUCCESS); + CheckResourceFields((PERESOURCE_2K3)&Res); + CheckResourceStatus(&Res, FALSE, 0LU, 0LU, 0LU); + + Status = ExDeleteResourceLite(&Res); + ok_eq_hex(Status, STATUS_SUCCESS); + + /* parameter checks */ + Status = STATUS_SUCCESS; + _SEH2_TRY { + ExInitializeResourceLite(NULL); + } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { + Status = _SEH2_GetExceptionCode(); + } _SEH2_END; + ok_eq_hex(Status, STATUS_ACCESS_VIOLATION); + + /* these bugcheck + ExDeleteResourceLite(NULL); + Status = ExDeleteResourceLite(&Res);*/ +} Propchange: branches/GSoC_2011/KMTestSuite/kmtests/ntos_ex/ExResource.c ------------------------------------------------------------------------------ svn:eol-style = native Added: branches/GSoC_2011/KMTestSuite/kmtests/ntos_ke/KeApc.c URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/KMTestSuite/kmtests/n…
============================================================================== --- branches/GSoC_2011/KMTestSuite/kmtests/ntos_ke/KeApc.c (added) +++ branches/GSoC_2011/KMTestSuite/kmtests/ntos_ke/KeApc.c [iso-8859-1] Sat Jul 9 22:02:54 2011 @@ -1,0 +1,153 @@ +/* + * PROJECT: ReactOS kernel-mode tests + * LICENSE: GPLv2+ - See COPYING in the top level directory + * PURPOSE: Kernel-Mode Test Suite Asynchronous Procedure Call test + * PROGRAMMER: Thomas Faber <thfabba(a)gmx.de> + */ + +#undef NTDDI_VERSION +#define NTDDI_VERSION NTDDI_WS03SP1 +#include <ntddk.h> +#include <kmt_test.h> + +#define CheckApcs(KernelApcsDisabled, SpecialApcsDisabled, Irql) do \ +{ \ + ok_eq_bool(KeAreApcsDisabled(), KernelApcsDisabled); \ + ok_eq_bool(KeAreAllApcsDisabled(), SpecialApcsDisabled); \ + ok_irql(Irql); \ +} while (0) + +START_TEST(KeApc) +{ + KIRQL Irql; + + CheckApcs(FALSE, FALSE, PASSIVE_LEVEL); + + /* critical region */ + KeEnterCriticalRegion(); + CheckApcs(TRUE, FALSE, PASSIVE_LEVEL); + KeEnterCriticalRegion(); + CheckApcs(TRUE, FALSE, PASSIVE_LEVEL); + KeEnterCriticalRegion(); + CheckApcs(TRUE, FALSE, PASSIVE_LEVEL); + KeLeaveCriticalRegion(); + CheckApcs(TRUE, FALSE, PASSIVE_LEVEL); + KeLeaveCriticalRegion(); + CheckApcs(TRUE, FALSE, PASSIVE_LEVEL); + KeLeaveCriticalRegion(); + CheckApcs(FALSE, FALSE, PASSIVE_LEVEL); + + /* guarded region */ + KeEnterGuardedRegion(); + CheckApcs(TRUE, TRUE, PASSIVE_LEVEL); + KeEnterGuardedRegion(); + CheckApcs(TRUE, TRUE, PASSIVE_LEVEL); + KeEnterGuardedRegion(); + CheckApcs(TRUE, TRUE, PASSIVE_LEVEL); + KeLeaveGuardedRegion(); + CheckApcs(TRUE, TRUE, PASSIVE_LEVEL); + KeLeaveGuardedRegion(); + CheckApcs(TRUE, TRUE, PASSIVE_LEVEL); + KeLeaveGuardedRegion(); + CheckApcs(FALSE, FALSE, PASSIVE_LEVEL); + + /* mix them */ + KeEnterGuardedRegion(); + CheckApcs(TRUE, TRUE, PASSIVE_LEVEL); + KeEnterCriticalRegion(); + CheckApcs(TRUE, TRUE, PASSIVE_LEVEL); + KeLeaveCriticalRegion(); + CheckApcs(TRUE, TRUE, PASSIVE_LEVEL); + KeLeaveGuardedRegion(); + CheckApcs(FALSE, FALSE, PASSIVE_LEVEL); + + KeEnterCriticalRegion(); + CheckApcs(TRUE, FALSE, PASSIVE_LEVEL); + KeEnterGuardedRegion(); + CheckApcs(TRUE, TRUE, PASSIVE_LEVEL); + KeLeaveGuardedRegion(); + CheckApcs(TRUE, FALSE, PASSIVE_LEVEL); + KeLeaveCriticalRegion(); + CheckApcs(FALSE, FALSE, PASSIVE_LEVEL); + + /* raised irql - APC_LEVEL should disable APCs */ + KeRaiseIrql(APC_LEVEL, &Irql); + CheckApcs(FALSE, TRUE, APC_LEVEL); + KeLowerIrql(Irql); + CheckApcs(FALSE, FALSE, PASSIVE_LEVEL); + + /* KeAre*ApcsDisabled are documented to work up to DISPATCH_LEVEL... */ + KeRaiseIrql(DISPATCH_LEVEL, &Irql); + CheckApcs(FALSE, TRUE, DISPATCH_LEVEL); + KeLowerIrql(Irql); + CheckApcs(FALSE, FALSE, PASSIVE_LEVEL); + + /* ... but also work on higher levels! */ + KeRaiseIrql(HIGH_LEVEL, &Irql); + CheckApcs(FALSE, TRUE, HIGH_LEVEL); + KeLowerIrql(Irql); + CheckApcs(FALSE, FALSE, PASSIVE_LEVEL); + + /* now comes the crazy stuff */ + KeRaiseIrql(HIGH_LEVEL, &Irql); + CheckApcs(FALSE, TRUE, HIGH_LEVEL); + KeEnterCriticalRegion(); + CheckApcs(TRUE, TRUE, HIGH_LEVEL); + KeLeaveCriticalRegion(); + CheckApcs(FALSE, TRUE, HIGH_LEVEL); + + KeEnterGuardedRegion(); + CheckApcs(TRUE, TRUE, HIGH_LEVEL); + KeLeaveGuardedRegion(); + CheckApcs(FALSE, TRUE, HIGH_LEVEL); + KeLowerIrql(Irql); + CheckApcs(FALSE, FALSE, PASSIVE_LEVEL); + + KeRaiseIrql(HIGH_LEVEL, &Irql); + CheckApcs(FALSE, TRUE, HIGH_LEVEL); + KeEnterCriticalRegion(); + CheckApcs(TRUE, TRUE, HIGH_LEVEL); + KeEnterGuardedRegion(); + CheckApcs(TRUE, TRUE, HIGH_LEVEL); + KeLowerIrql(Irql); + CheckApcs(TRUE, TRUE, PASSIVE_LEVEL); + KeLeaveCriticalRegion(); + CheckApcs(TRUE, TRUE, PASSIVE_LEVEL); + KeLeaveGuardedRegion(); + CheckApcs(FALSE, FALSE, PASSIVE_LEVEL); + + KeEnterGuardedRegion(); + CheckApcs(TRUE, TRUE, PASSIVE_LEVEL); + KeRaiseIrql(HIGH_LEVEL, &Irql); + CheckApcs(TRUE, TRUE, HIGH_LEVEL); + KeEnterCriticalRegion(); + CheckApcs(TRUE, TRUE, HIGH_LEVEL); + KeLeaveGuardedRegion(); + CheckApcs(TRUE, TRUE, HIGH_LEVEL); + KeLowerIrql(Irql); + CheckApcs(TRUE, FALSE, PASSIVE_LEVEL); + KeLeaveCriticalRegion(); + CheckApcs(FALSE, FALSE, PASSIVE_LEVEL); + + KeEnterCriticalRegion(); + CheckApcs(TRUE, FALSE, PASSIVE_LEVEL); + KeRaiseIrql(HIGH_LEVEL, &Irql); + CheckApcs(TRUE, TRUE, HIGH_LEVEL); + KeEnterGuardedRegion(); + CheckApcs(TRUE, TRUE, HIGH_LEVEL); + KeLeaveCriticalRegion(); + CheckApcs(TRUE, TRUE, HIGH_LEVEL); + KeLowerIrql(Irql); + CheckApcs(TRUE, TRUE, PASSIVE_LEVEL); + KeLeaveGuardedRegion(); + CheckApcs(FALSE, FALSE, PASSIVE_LEVEL); + + KeEnterCriticalRegion(); + CheckApcs(TRUE, FALSE, PASSIVE_LEVEL); + KeRaiseIrql(HIGH_LEVEL, &Irql); + CheckApcs(TRUE, TRUE, HIGH_LEVEL); + KeLeaveCriticalRegion(); + CheckApcs(FALSE, TRUE, HIGH_LEVEL); + KeLowerIrql(Irql); + CheckApcs(FALSE, FALSE, PASSIVE_LEVEL); +} Propchange: branches/GSoC_2011/KMTestSuite/kmtests/ntos_ke/KeApc.c ------------------------------------------------------------------------------ svn:eol-style = native Modified: branches/GSoC_2011/KMTestSuite/kmtests/ntos_ke/KeDpc.c URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/KMTestSuite/kmtests/n…
============================================================================== --- branches/GSoC_2011/KMTestSuite/kmtests/ntos_ke/KeDpc.c [iso-8859-1] (original) +++ branches/GSoC_2011/KMTestSuite/kmtests/ntos_ke/KeDpc.c [iso-8859-1] Sat Jul 9 22:02:54 2011 @@ -82,12 +82,12 @@ ok_eq_uint(Dpc.Type, DpcObject); ok_eq_uint(Dpc.Importance, DpcImportance); ok_eq_uint(Dpc.Number, 0); - ok_eq_pointer(Dpc.DpcListEntry.Flink, (LIST_ENTRY *)0x5555555555555555); - ok_eq_pointer(Dpc.DpcListEntry.Blink, (LIST_ENTRY *)0x5555555555555555); + ok_eq_pointer(Dpc.DpcListEntry.Flink, (LIST_ENTRY *)0x5555555555555555LL); + ok_eq_pointer(Dpc.DpcListEntry.Blink, (LIST_ENTRY *)0x5555555555555555LL); ok_eq_pointer(Dpc.DeferredRoutine, DpcHandler); ok_eq_pointer(Dpc.DeferredContext, &Dpc); - ok_eq_pointer(Dpc.SystemArgument1, (PVOID)0x5555555555555555); - ok_eq_pointer(Dpc.SystemArgument2, (PVOID)0x5555555555555555); + ok_eq_pointer(Dpc.SystemArgument1, (PVOID)0x5555555555555555LL); + ok_eq_pointer(Dpc.SystemArgument2, (PVOID)0x5555555555555555LL); ok_eq_pointer(Dpc.DpcData, NULL); /* simply run the Dpc a few times */ @@ -117,8 +117,6 @@ KeRaiseIrql(HIGH_LEVEL, &Irql3); ok_dpccount(); KeLowerIrql(Irql3); - ok_dpccount(); - DPRINT1("This is a debug print\n"); ok_dpccount(); KeLowerIrql(Irql2); ++ExpectedDpcCount;
13 years, 5 months
1
0
0
0
[rharabien] 52591: [NTDLL/LDR] - Fix CMake build - Don't override failure status in LdrGetDllHandleEx - Minor improvements Fixes loading of mshtml.tlb in 2nd stage. Patch by Thomas Faber
by rharabien@svn.reactos.org
Author: rharabien Date: Sat Jul 9 21:48:59 2011 New Revision: 52591 URL:
http://svn.reactos.org/svn/reactos?rev=52591&view=rev
Log: [NTDLL/LDR] - Fix CMake build - Don't override failure status in LdrGetDllHandleEx - Minor improvements Fixes loading of mshtml.tlb in 2nd stage. Patch by Thomas Faber Modified: trunk/reactos/dll/ntdll/CMakeLists.txt trunk/reactos/dll/ntdll/ldr/ldrapi.c Modified: trunk/reactos/dll/ntdll/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/ntdll/CMakeLists.txt?r…
============================================================================== --- trunk/reactos/dll/ntdll/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/dll/ntdll/CMakeLists.txt [iso-8859-1] Sat Jul 9 21:48:59 2011 @@ -20,8 +20,6 @@ ldr/ldrinit.c ldr/ldrpe.c ldr/ldrutils.c - ldr/startup.c - ldr/utils.c rtl/libsupp.c rtl/version.c def/ntdll.rc Modified: trunk/reactos/dll/ntdll/ldr/ldrapi.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/ntdll/ldr/ldrapi.c?rev…
============================================================================== --- trunk/reactos/dll/ntdll/ldr/ldrapi.c [iso-8859-1] (original) +++ trunk/reactos/dll/ntdll/ldr/ldrapi.c [iso-8859-1] Sat Jul 9 21:48:59 2011 @@ -148,7 +148,7 @@ /* A normal failure */ return STATUS_INVALID_PARAMETER_3; } - + /* Do or Do Not. There is no Try */ ASSERT((Disposition != NULL) || !(Flags & LDR_LOCK_LOADER_LOCK_FLAG_TRY_ONLY)); @@ -388,7 +388,7 @@ /* Nothing to do */ if (!Ldr) return STATUS_NO_MORE_ENTRIES; - + /* Get the current entry */ LdrEntry = Ldr->EntryInProgress; if (LdrEntry) @@ -471,7 +471,7 @@ RtlInitEmptyUnicodeString(&RawDllName, NULL, 0); RedirectName = *DllName; pRedirectName = &RedirectName; - + /* Initialize state */ RedirectedDll = Locked = FALSE; LdrEntry = NULL; @@ -495,7 +495,7 @@ /* Acquire the lock */ Status = LdrLockLoaderLock(0, NULL, &Cookie); if (!NT_SUCCESS(Status)) goto Quickie; - + /* Remember we own it */ Locked = TRUE; } @@ -522,7 +522,11 @@ /* Unrecoverable SxS failure; */ goto Quickie; } - + else + { + ASSERT(pRedirectName == &RedirectName); + } + /* Set default failure code */ Status = STATUS_DLL_NOT_FOUND; @@ -533,28 +537,24 @@ if (RedirectedDll) { /* Check the flag */ + if (!(LdrpGetModuleHandleCache->Flags & LDRP_REDIRECTED)) + { + goto DontCompare; + } + + /* Use the right name */ + CompareName = &LdrpGetModuleHandleCache->FullDllName; + } + else + { + /* Check the flag */ if (LdrpGetModuleHandleCache->Flags & LDRP_REDIRECTED) { - /* Use the right name */ - CompareName = &LdrpGetModuleHandleCache->FullDllName; - } - else - { goto DontCompare; } - } - else - { - /* Check the flag */ - if (!(LdrpGetModuleHandleCache->Flags & LDRP_REDIRECTED)) - { - /* Use the right name */ - CompareName = &LdrpGetModuleHandleCache->BaseDllName; - } - else - { - goto DontCompare; - } + + /* Use the right name */ + CompareName = &LdrpGetModuleHandleCache->BaseDllName; } /* Check if the name matches */ @@ -604,7 +604,6 @@ /* Setup the string */ RawDllName.MaximumLength = Length; ASSERT(Length >= sizeof(UNICODE_NULL)); - RawDllName.Length = RawDllName.MaximumLength - sizeof(UNICODE_NULL); RawDllName.Buffer = RtlAllocateHeap(RtlGetProcessHeap(), 0, RawDllName.MaximumLength); @@ -614,18 +613,9 @@ goto Quickie; } - /* Copy the buffer */ - RtlMoveMemory(RawDllName.Buffer, - pRedirectName->Buffer, - pRedirectName->Length); - - /* Add extension */ - RtlMoveMemory((PVOID)((ULONG_PTR)RawDllName.Buffer + pRedirectName->Length), - LdrApiDefaultExtension.Buffer, - LdrApiDefaultExtension.Length); - - /* Null terminate */ - RawDllName.Buffer[RawDllName.Length / sizeof(WCHAR)] = UNICODE_NULL; + /* Copy the string and add extension */ + RtlCopyUnicodeString(&RawDllName, pRedirectName); + RtlAppendUnicodeStringToString(&RawDllName, &LdrApiDefaultExtension); } else { @@ -643,7 +633,6 @@ /* Setup the string */ RawDllName.MaximumLength = pRedirectName->Length + sizeof(WCHAR); - RawDllName.Length = pRedirectName->Length; RawDllName.Buffer = RtlAllocateHeap(RtlGetProcessHeap(), 0, RawDllName.MaximumLength); @@ -653,19 +642,14 @@ goto Quickie; } - /* Copy the buffer */ - RtlMoveMemory(RawDllName.Buffer, - pRedirectName->Buffer, - pRedirectName->Length); - - /* Null terminate */ - RawDllName.Buffer[RawDllName.Length / sizeof(WCHAR)] = UNICODE_NULL; + /* Copy the string */ + RtlCopyUnicodeString(&RawDllName, pRedirectName); } /* Display debug string */ if (ShowSnaps) { - DPRINT1("LDR: LdrGetDllHandle, searching for %wZ from %ws\n", + DPRINT1("LDR: LdrGetDllHandleEx, searching for %wZ from %ws\n", &RawDllName, DllPath ? ((ULONG_PTR)DllPath == 1 ? L"" : DllPath) : L""); } @@ -730,15 +714,15 @@ if (RawDllName.Buffer) { /* Free the heap-allocated buffer */ - Status = RtlFreeHeap(RtlGetProcessHeap(), 0, RawDllName.Buffer); + RtlFreeHeap(RtlGetProcessHeap(), 0, RawDllName.Buffer); RawDllName.Buffer = NULL; } /* Release lock */ if (Locked) { - Status = LdrUnlockLoaderLock(LDR_LOCK_LOADER_LOCK_FLAG_RAISE_ON_ERRORS, - Cookie); + LdrUnlockLoaderLock(LDR_LOCK_LOADER_LOCK_FLAG_RAISE_ON_ERRORS, + Cookie); } /* Return */ @@ -756,7 +740,7 @@ OUT PVOID *DllHandle) { /* Call the newer API */ - return LdrGetDllHandleEx(TRUE, + return LdrGetDllHandleEx(LDR_GET_DLL_HANDLE_EX_UNCHANGED_REFCOUNT, DllPath, DllCharacteristics, DllName, @@ -1134,10 +1118,10 @@ BOOLEAN LockHeld; ULONG_PTR Cookie; DPRINT("LdrDisableThreadCalloutsForDll (BaseAddress %p)\n", BaseAddress); - + /* Don't do it during shutdown */ if (LdrpShutdownInProgress) return STATUS_SUCCESS; - + /* Check if we should grab the lock */ LockHeld = FALSE; if (!LdrpInLdrInit) @@ -1147,7 +1131,7 @@ if (!NT_SUCCESS(Status)) return Status; LockHeld = TRUE; } - + /* Make sure the DLL is valid and get its entry */ Status = STATUS_DLL_NOT_FOUND; if (LdrpCheckForLoadedDllHandle(BaseAddress, &LdrEntry)) @@ -1167,7 +1151,7 @@ /* Release it */ LdrUnlockLoaderLock(LDR_UNLOCK_LOADER_LOCK_FLAG_RAISE_ON_ERRORS, Cookie); } - + /* Return the status */ return Status; }
13 years, 5 months
1
0
0
0
[rharabien] 52590: [BZIP2] - Fix MSVC build
by rharabien@svn.reactos.org
Author: rharabien Date: Sat Jul 9 21:07:30 2011 New Revision: 52590 URL:
http://svn.reactos.org/svn/reactos?rev=52590&view=rev
Log: [BZIP2] - Fix MSVC build Modified: trunk/reactos/lib/3rdparty/bzip2/CMakeLists.txt Modified: trunk/reactos/lib/3rdparty/bzip2/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/3rdparty/bzip2/CMakeLi…
============================================================================== --- trunk/reactos/lib/3rdparty/bzip2/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/lib/3rdparty/bzip2/CMakeLists.txt [iso-8859-1] Sat Jul 9 21:07:30 2011 @@ -16,5 +16,6 @@ set_module_type(bzip2 kernelmodedriver) add_importlibs(bzip2 ntoskrnl) +target_link_libraries(bzip2 libcntpr) set_target_properties(bzip2 PROPERTIES OUTPUT_NAME "unbzip2")
13 years, 5 months
1
0
0
0
[rharabien] 52589: [FRAMEBUF_NEW] - Fix MSVC build
by rharabien@svn.reactos.org
Author: rharabien Date: Sat Jul 9 20:33:47 2011 New Revision: 52589 URL:
http://svn.reactos.org/svn/reactos?rev=52589&view=rev
Log: [FRAMEBUF_NEW] - Fix MSVC build Modified: trunk/reactos/drivers/video/displays/framebuf_new/driver.h Modified: trunk/reactos/drivers/video/displays/framebuf_new/driver.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/video/displays/fra…
============================================================================== --- trunk/reactos/drivers/video/displays/framebuf_new/driver.h [iso-8859-1] (original) +++ trunk/reactos/drivers/video/displays/framebuf_new/driver.h [iso-8859-1] Sat Jul 9 20:33:47 2011 @@ -10,6 +10,7 @@ //#define DBG 1 #include "stddef.h" #include <stdarg.h> +#include <string.h> #include "windef.h" #include "wingdi.h" #include "winddi.h"
13 years, 5 months
1
0
0
0
[ion] 52588: [NTDLL]: Fix busted up LdrpCreateDllSection function, checking for the wrong things completely for Safer support, and also messing up the failure/success paths. Based on a find by arty.
by ion@svn.reactos.org
Author: ion Date: Sat Jul 9 20:33:29 2011 New Revision: 52588 URL:
http://svn.reactos.org/svn/reactos?rev=52588&view=rev
Log: [NTDLL]: Fix busted up LdrpCreateDllSection function, checking for the wrong things completely for Safer support, and also messing up the failure/success paths. Based on a find by arty. Modified: trunk/reactos/dll/ntdll/ldr/ldrutils.c Modified: trunk/reactos/dll/ntdll/ldr/ldrutils.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/ntdll/ldr/ldrutils.c?r…
============================================================================== --- trunk/reactos/dll/ntdll/ldr/ldrutils.c [iso-8859-1] (original) +++ trunk/reactos/dll/ntdll/ldr/ldrutils.c [iso-8859-1] Sat Jul 9 20:33:29 2011 @@ -436,7 +436,7 @@ /* Check for Safer restrictions */ if (DllCharacteristics && - !(*DllCharacteristics & IMAGE_DLLCHARACTERISTICS_WX86_DLL)) + !(*DllCharacteristics & IMAGE_FILE_SYSTEM)) { /* Make sure it's executable */ Status = ZwQuerySection(*SectionHandle, @@ -446,10 +446,10 @@ NULL); if (NT_SUCCESS(Status)) { - /* Check if it's executable */ - if (SectionImageInfo.ImageContainsCode) - { - /* It is, check safer */ + /* Bypass the check for .NET images */ + if (!(SectionImageInfo.LoaderFlags & IMAGE_LOADER_FLAGS_COMPLUS)) + { + /* Check with Safer */ Status = LdrpCodeAuthzCheckDllAllowed(FullName, DllHandle); if (!NT_SUCCESS(Status) && (Status != STATUS_NOT_FOUND)) { @@ -459,18 +459,19 @@ DPRINT1("LDR: Loading of (%wZ) blocked by Winsafer\n", &FullName); } + + /* Failure case, close section handle */ + NtClose(*SectionHandle); + *SectionHandle = NULL; } - else - { - /* We're fine, return normally */ - goto Quickie; - } - } - } - - /* Failure case, close section handle */ - NtClose(*SectionHandle); - *SectionHandle = NULL; + } + } + else + { + /* Failure case, close section handle */ + NtClose(*SectionHandle); + *SectionHandle = NULL; + } } Quickie:
13 years, 5 months
1
0
0
0
[rharabien] 52587: [NORMALIZ] - Don't build normaliz.dll - it's Win Vista library. It didn't even work because exports was redirected to commented out kernel32 exports. GCC ignored it but MSVC retu...
by rharabien@svn.reactos.org
Author: rharabien Date: Sat Jul 9 19:18:49 2011 New Revision: 52587 URL:
http://svn.reactos.org/svn/reactos?rev=52587&view=rev
Log: [NORMALIZ] - Don't build normaliz.dll - it's Win Vista library. It didn't even work because exports was redirected to commented out kernel32 exports. GCC ignored it but MSVC returns error in such case. Modified: trunk/reactos/dll/nls/CMakeLists.txt trunk/reactos/dll/nls/nls.rbuild Modified: trunk/reactos/dll/nls/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/nls/CMakeLists.txt?rev…
============================================================================== --- trunk/reactos/dll/nls/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/dll/nls/CMakeLists.txt [iso-8859-1] Sat Jul 9 19:18:49 2011 @@ -2,4 +2,4 @@ if(NOT MSVC) add_subdirectory(idndl) # FIXME: msvc build. endif() -add_subdirectory(normaliz) +#add_subdirectory(normaliz) # Win Vista Modified: trunk/reactos/dll/nls/nls.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/nls/nls.rbuild?rev=525…
============================================================================== --- trunk/reactos/dll/nls/nls.rbuild [iso-8859-1] (original) +++ trunk/reactos/dll/nls/nls.rbuild [iso-8859-1] Sat Jul 9 19:18:49 2011 @@ -7,9 +7,9 @@ <!--<directory name="idndl_redist"> <xi:include href="idndl_redist/idndl_redist.rbuild" /> </directory>--> - <directory name="normaliz"> + <!--<directory name="normaliz"> <xi:include href="normaliz/normaliz.rbuild" /> - </directory> + </directory>--> <!--<directory name="normaliz_redist"> <xi:include href="normaliz_redist/normaliz_redist.rbuild" /> </directory>-->
13 years, 5 months
1
0
0
0
[tkreuzer] 52586: [NTOSKRNL] Update TRAP_ENTRY macro to generate debugging information. Now WinDbg knows how to deal with the trap functions and also shows the user mode back traces.
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Sat Jul 9 19:15:34 2011 New Revision: 52586 URL:
http://svn.reactos.org/svn/reactos?rev=52586&view=rev
Log: [NTOSKRNL] Update TRAP_ENTRY macro to generate debugging information. Now WinDbg knows how to deal with the trap functions and also shows the user mode back traces. Modified: trunk/reactos/include/asm/asm.inc trunk/reactos/include/reactos/asm.inc trunk/reactos/ntoskrnl/include/internal/i386/asmmacro.S Modified: trunk/reactos/include/asm/asm.inc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/asm/asm.inc?rev=52…
============================================================================== --- trunk/reactos/include/asm/asm.inc [iso-8859-1] (original) +++ trunk/reactos/include/asm/asm.inc [iso-8859-1] Sat Jul 9 19:15:34 2011 @@ -32,16 +32,21 @@ /* To avoid reverse syntax we provide a new macro .PROC, replacing PROC... */ .PROC MACRO name - name PROC FRAME - _name: + _&name PROC ENDM #define FUNC .PROC /* ... and .ENDP, replacing ENDP */ .ENDP MACRO name - name ENDP + _&name ENDP ENDM #define ENDFUNC .ENDP + +/* check
http://msdn.microsoft.com/en-us/library/9c9k076y%28VS.80%29.aspx
+ and
http://msdn.microsoft.com/en-us/library/ms679352%28VS.85%29.aspx
*/ +FPO MACRO cdwLocals, cdwParams, cbProlog, cbRegs, fUseBP, cbFrame + .FPO (cdwLocals, cdwParams, cbProlog, cbRegs, fUseBP, cbFrame) +ENDM /* MASM doesn't have an ASCII macro */ .ASCII MACRO text:VARARG @@ -184,7 +189,7 @@ /* To avoid reverse syntax we provide a new macro .PROC, replacing PROC... */ .macro .PROC name .func \name - \name: + _\name: .cfi_startproc .equ cfa_current_offset, -8 .endm @@ -235,6 +240,12 @@ .macro .code .text +.endm + +/* check
http://msdn.microsoft.com/en-us/library/9c9k076y%28VS.80%29.aspx
+ and
http://msdn.microsoft.com/en-us/library/ms679352%28VS.85%29.aspx
*/ +.macro FPO cdwLocals, cdwParams, cbProlog, cbRegs, fUseBP, cbFrame + /* dummy */ .endm /* Macros for x64 stack unwind OPs */ Modified: trunk/reactos/include/reactos/asm.inc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/asm.inc?re…
============================================================================== --- trunk/reactos/include/reactos/asm.inc [iso-8859-1] (original) +++ trunk/reactos/include/reactos/asm.inc [iso-8859-1] Sat Jul 9 19:15:34 2011 @@ -41,6 +41,12 @@ name ENDP ENDM +/* check
http://msdn.microsoft.com/en-us/library/9c9k076y%28VS.80%29.aspx
+ and
http://msdn.microsoft.com/en-us/library/ms679352%28VS.85%29.aspx
*/ +FPO MACRO cdwLocals, cdwParams, cbProlog, cbRegs, fUseBP, cbFrame + .FPO (cdwLocals, cdwParams, cbProlog, cbRegs, fUseBP, cbFrame) +ENDM + /* MASM doesn't have an ASCII macro */ .ASCII MACRO text DB text @@ -143,7 +149,7 @@ /* To avoid reverse syntax we provide a new macro .PROC, replacing PROC... */ .macro .PROC name .func \name - \name: + _\name: .cfi_startproc .equ cfa_current_offset, -8 .endm @@ -190,6 +196,12 @@ .macro .code .text +.endm + +/* check
http://msdn.microsoft.com/en-us/library/9c9k076y%28VS.80%29.aspx
+ and
http://msdn.microsoft.com/en-us/library/ms679352%28VS.85%29.aspx
*/ +.macro FPO cdwLocals, cdwParams, cbProlog, cbRegs, fUseBP, cbFrame + /* dummy */ .endm /* Macros for x64 stack unwind OPs */ Modified: trunk/reactos/ntoskrnl/include/internal/i386/asmmacro.S URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
============================================================================== --- trunk/reactos/ntoskrnl/include/internal/i386/asmmacro.S [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/include/internal/i386/asmmacro.S [iso-8859-1] Sat Jul 9 19:15:34 2011 @@ -216,12 +216,21 @@ nop ENDM +#define FRAME_TRAP 1 + MACRO(TRAP_ENTRY, Trap, Flags) -EXTERN @&Trap&Handler@4 :PROC + EXTERN @&Trap&Handler@4 :PROC PUBLIC _&Trap - _&Trap: - KiEnterTrap Flags - KiCallHandler @&Trap&Handler@4 + .PROC &Trap + /* Generate proper debugging symbols */ + FPO 0, 0, 0, 0, 1, FRAME_TRAP + + /* Common code to create the trap frame */ + KiEnterTrap Flags + + /* Call the C handler */ + KiCallHandler @&Trap&Handler@4 + .ENDP &Trap ENDM #define KI_RESTORE_EAX HEX(001)
13 years, 5 months
1
0
0
0
[ion] 52585: [NTDLL]: Reimplemnt LdrDisableThreadCalloutsForDll using new loader APIS. [NTDLL]: Fix LdrpInitializeProcess to use new loader relocation API instead of LdrRelocateImage. Warn if an EX...
by ion@svn.reactos.org
Author: ion Date: Sat Jul 9 16:15:43 2011 New Revision: 52585 URL:
http://svn.reactos.org/svn/reactos?rev=52585&view=rev
Log: [NTDLL]: Reimplemnt LdrDisableThreadCalloutsForDll using new loader APIS. [NTDLL]: Fix LdrpInitializeProcess to use new loader relocation API instead of LdrRelocateImage. Warn if an EXE gets relocated since this was never supported in ReactOS. [NTDLL]: Move APIs into ldrapi.c and delete 3 leftover cruft files. This is the extent of my review for the moment. There are still many problems with the loader. It should've been tested/put in a branch. I found these 25 bugs in less than a day. Other problems remaining are missing SEH around loader lock, not too sure if the cookie generation is correct, cookies are ULONG_PTR not ULONGs, and haven't checked the PE loading code yet (only reviewed ldrapi.c). Removed: trunk/reactos/dll/ntdll/ldr/elf.c trunk/reactos/dll/ntdll/ldr/startup.c trunk/reactos/dll/ntdll/ldr/utils.c Modified: trunk/reactos/dll/ntdll/include/ntdllp.h trunk/reactos/dll/ntdll/ldr/ldrapi.c trunk/reactos/dll/ntdll/ldr/ldrinit.c trunk/reactos/dll/ntdll/ntdll.rbuild [This mail would be too long, it was shortened to contain the URLs only.] Modified: trunk/reactos/dll/ntdll/include/ntdllp.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/ntdll/include/ntdllp.h…
Removed: trunk/reactos/dll/ntdll/ldr/elf.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/ntdll/ldr/elf.c?rev=52…
Modified: trunk/reactos/dll/ntdll/ldr/ldrapi.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/ntdll/ldr/ldrapi.c?rev…
Modified: trunk/reactos/dll/ntdll/ldr/ldrinit.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/ntdll/ldr/ldrinit.c?re…
Removed: trunk/reactos/dll/ntdll/ldr/startup.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/ntdll/ldr/startup.c?re…
Removed: trunk/reactos/dll/ntdll/ldr/utils.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/ntdll/ldr/utils.c?rev=…
Modified: trunk/reactos/dll/ntdll/ntdll.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/ntdll/ntdll.rbuild?rev…
13 years, 5 months
1
0
0
0
[ion] 52584: [NTDLL]: Some more misc. cleanups and extra output.
by ion@svn.reactos.org
Author: ion Date: Sat Jul 9 15:32:36 2011 New Revision: 52584 URL:
http://svn.reactos.org/svn/reactos?rev=52584&view=rev
Log: [NTDLL]: Some more misc. cleanups and extra output. Modified: trunk/reactos/dll/ntdll/ldr/ldrapi.c Modified: trunk/reactos/dll/ntdll/ldr/ldrapi.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/ntdll/ldr/ldrapi.c?rev…
============================================================================== --- trunk/reactos/dll/ntdll/ldr/ldrapi.c [iso-8859-1] (original) +++ trunk/reactos/dll/ntdll/ldr/ldrapi.c [iso-8859-1] Sat Jul 9 15:32:36 2011 @@ -16,7 +16,7 @@ /* GLOBALS *******************************************************************/ LONG LdrpLoaderLockAcquisitonCount; -BOOLEAN LdrpShowRecursiveLoads; +BOOLEAN LdrpShowRecursiveLoads, LdrpBreakOnRecursiveDllLoads; UNICODE_STRING LdrApiDefaultExtension = RTL_CONSTANT_STRING(L".DLL"); /* FUNCTIONS *****************************************************************/ @@ -260,7 +260,7 @@ PTEB Teb = NtCurrentTeb(); /* Initialize the strings */ - RtlInitUnicodeString(&DllString2, NULL); + RtlInitEmptyUnicodeString(&DllString2, NULL, 0); DllString1.Buffer = StringBuffer; DllString1.Length = 0; DllString1.MaximumLength = sizeof(StringBuffer); @@ -285,11 +285,7 @@ else if (Status != STATUS_SXS_KEY_NOT_FOUND) { /* Unrecoverable SxS failure; did we get a string? */ - if (DllString2.Buffer) - { - /* Free the string */ - RtlFreeUnicodeString(&DllString2); - } + if (DllString2.Buffer) RtlFreeUnicodeString(&DllString2); return Status; } @@ -297,10 +293,11 @@ LdrLockLoaderLock(LDR_LOCK_LOADER_LOCK_FLAG_RAISE_ON_ERRORS, NULL, &Cookie); /* Check if there's a TLD DLL being loaded */ - if ((OldTldDll = LdrpTopLevelDllBeingLoaded)) + OldTldDll = LdrpTopLevelDllBeingLoaded; + if (OldTldDll) { /* This is a recursive load, do something about it? */ - if (ShowSnaps || LdrpShowRecursiveLoads) + if ((ShowSnaps) || (LdrpShowRecursiveLoads) || (LdrpBreakOnRecursiveDllLoads)) { /* Print out debug messages */ DPRINT1("[%lx, %lx] LDR: Recursive DLL Load\n", @@ -342,6 +339,23 @@ DllName, BaseAddress, TRUE); + if (NT_SUCCESS(Status)) + { + Status = STATUS_SUCCESS; + } + else if ((Status != STATUS_NO_SUCH_FILE) && + (Status != STATUS_DLL_NOT_FOUND) && + (Status != STATUS_OBJECT_NAME_NOT_FOUND) && + (Status != STATUS_DLL_INIT_FAILED)) + { + // 85 == DPFLTR_LDR_ID; + DbgPrintEx(85, + DPFLTR_WARNING_LEVEL, + "LDR: %s - failing because LdrpLoadDll(%wZ) returned status %x\n", + __FUNCTION__, + DllName, + Status); + } /* Restore the old TLD DLL */ LdrpTopLevelDllBeingLoaded = OldTldDll; @@ -1057,7 +1071,7 @@ BOOLEAN Stop = FALSE; /* Check parameters */ - if (ReservedFlag || !EnumProc) return STATUS_INVALID_PARAMETER; + if ((ReservedFlag) || !(EnumProc)) return STATUS_INVALID_PARAMETER; /* Acquire the loader lock */ Status = LdrLockLoaderLock(0, NULL, &Cookie);
13 years, 5 months
1
0
0
0
← Newer
1
...
40
41
42
43
44
45
46
...
52
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
Results per page:
10
25
50
100
200