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
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
August 2011
----- 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
18 participants
498 discussions
Start a n
N
ew thread
[ion] 53051: [CSRSRV]: CSRSS tries to connect with itself and already has the region mapped, so allow this as a hack.
by ion@svn.reactos.org
Author: ion Date: Wed Aug 3 15:45:16 2011 New Revision: 53051 URL:
http://svn.reactos.org/svn/reactos?rev=53051&view=rev
Log: [CSRSRV]: CSRSS tries to connect with itself and already has the region mapped, so allow this as a hack. Modified: trunk/reactos/subsystems/win32/csrss/csrsrv/api/wapi.c trunk/reactos/subsystems/win32/csrss/csrsrv/init.c Modified: trunk/reactos/subsystems/win32/csrss/csrsrv/api/wapi.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/csrss/csr…
============================================================================== --- trunk/reactos/subsystems/win32/csrss/csrsrv/api/wapi.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/csrss/csrsrv/api/wapi.c [iso-8859-1] Wed Aug 3 15:45:16 2011 @@ -293,6 +293,12 @@ ViewUnmap, SEC_NO_CHANGE, PAGE_EXECUTE_READ); + if (Status == STATUS_CONFLICTING_ADDRESSES) + { + /* I Think our csrss tries to connect to itself... */ + DPRINT1("Multiple mapping hack\n"); + Status = STATUS_SUCCESS; + } if (!NT_SUCCESS(Status)) return Status; } Modified: trunk/reactos/subsystems/win32/csrss/csrsrv/init.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/csrss/csr…
============================================================================== --- trunk/reactos/subsystems/win32/csrss/csrsrv/init.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/csrss/csrsrv/init.c [iso-8859-1] Wed Aug 3 15:45:16 2011 @@ -497,6 +497,7 @@ static NTSTATUS CsrpCreateHeap (int argc, char ** argv, char ** envp) { + CHAR Value[] = "1024,3072,512"; NTSTATUS Status; DPRINT("CSR: %s called\n", __FUNCTION__); @@ -512,7 +513,7 @@ } - Status = CsrSrvCreateSharedSection("1024,3072,512"); + Status = CsrSrvCreateSharedSection(Value); DPRINT1("Status: %lx\n", Status); ASSERT(Status == STATUS_SUCCESS);
13 years, 3 months
1
0
0
0
[jgardou] 53050: [PSDK] - mark operators == et != of REFPROPERTYKEY as C++ externs
by jgardou@svn.reactos.org
Author: jgardou Date: Wed Aug 3 15:20:36 2011 New Revision: 53050 URL:
http://svn.reactos.org/svn/reactos?rev=53050&view=rev
Log: [PSDK] - mark operators == et != of REFPROPERTYKEY as C++ externs Modified: trunk/reactos/include/psdk/propkeydef.h Modified: trunk/reactos/include/psdk/propkeydef.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/propkeydef.h?…
============================================================================== --- trunk/reactos/include/psdk/propkeydef.h [iso-8859-1] (original) +++ trunk/reactos/include/psdk/propkeydef.h [iso-8859-1] Wed Aug 3 15:20:36 2011 @@ -58,6 +58,8 @@ #ifndef _PROPERTYKEY_EQUALITY_OPERATORS_ #define _PROPERTYKEY_EQUALITY_OPERATORS_ #ifdef __cplusplus +extern "C++" +{ inline bool operator==(REFPROPERTYKEY guidOne, REFPROPERTYKEY guidOther) { return IsEqualPropertyKey(guidOne, guidOther); @@ -66,5 +68,6 @@ { return !(guidOne == guidOther); } +} //extern "C++" #endif #endif
13 years, 3 months
1
0
0
0
[ion] 53049: [CSRSRV]: Hey Arch, try creating a shared section before mapping it.
by ion@svn.reactos.org
Author: ion Date: Wed Aug 3 15:04:21 2011 New Revision: 53049 URL:
http://svn.reactos.org/svn/reactos?rev=53049&view=rev
Log: [CSRSRV]: Hey Arch, try creating a shared section before mapping it. Modified: trunk/reactos/subsystems/win32/csrss/csrsrv/api/wapi.c trunk/reactos/subsystems/win32/csrss/csrsrv/init.c Modified: trunk/reactos/subsystems/win32/csrss/csrsrv/api/wapi.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/csrss/csr…
============================================================================== --- trunk/reactos/subsystems/win32/csrss/csrsrv/api/wapi.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/csrss/csrsrv/api/wapi.c [iso-8859-1] Wed Aug 3 15:04:21 2011 @@ -153,7 +153,6 @@ PPEB Peb = NtCurrentPeb(); /* ReactOS Hackssss */ - ParameterValue = "1024,3072,512"; Status = NtQuerySystemInformation(SystemBasicInformation, &CsrNtSysInfo, sizeof(SYSTEM_BASIC_INFORMATION), @@ -175,7 +174,7 @@ } /* Make sure it's valid */ - if (!*SizeValue) return(STATUS_INVALID_PARAMETER); + if (!*SizeValue) return STATUS_INVALID_PARAMETER; /* Convert it to an integer */ Status = RtlCharToInteger(SizeValue, 0, &Size); @@ -184,6 +183,7 @@ /* Multiply by 1024 entries and round to page size */ #define ROUND_UP(n,size) (((ULONG)(n) + (size - 1)) & ~(size - 1)) // hax CsrSrvSharedSectionSize = ROUND_UP(Size * 1024, CsrNtSysInfo.PageSize); + DPRINT1("Size: %lx\n", CsrSrvSharedSectionSize); /* Create the Secion */ SectionSize.LowPart = CsrSrvSharedSectionSize; Modified: trunk/reactos/subsystems/win32/csrss/csrsrv/init.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/csrss/csr…
============================================================================== --- trunk/reactos/subsystems/win32/csrss/csrsrv/init.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/csrss/csrsrv/init.c [iso-8859-1] Wed Aug 3 15:04:21 2011 @@ -512,7 +512,8 @@ } - Status = CsrSrvCreateSharedSection(""); + Status = CsrSrvCreateSharedSection("1024,3072,512"); + DPRINT1("Status: %lx\n", Status); ASSERT(Status == STATUS_SUCCESS); BasepFakeStaticServerData();
13 years, 3 months
1
0
0
0
[jgardou] 53048: [CMAKE] - use functions instead of macros. This avoids adding flags multiple times. See the PARENT_SCOPE option of cmake's command "set" for details.
by jgardou@svn.reactos.org
Author: jgardou Date: Wed Aug 3 15:02:11 2011 New Revision: 53048 URL:
http://svn.reactos.org/svn/reactos?rev=53048&view=rev
Log: [CMAKE] - use functions instead of macros. This avoids adding flags multiple times. See the PARENT_SCOPE option of cmake's command "set" for details. Modified: trunk/reactos/cmake/compilerflags.cmake Modified: trunk/reactos/cmake/compilerflags.cmake URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/cmake/compilerflags.cmake?…
============================================================================== --- trunk/reactos/cmake/compilerflags.cmake [iso-8859-1] (original) +++ trunk/reactos/cmake/compilerflags.cmake [iso-8859-1] Wed Aug 3 15:02:11 2011 @@ -1,31 +1,22 @@ -macro(add_compiler_flags) +function(add_compiler_flags) # Adds the compiler flag to both CMAKE_C_FLAGS and CMAKE_CXX_FLAGS foreach(flag ${ARGN}) set(flags_list "${flags_list} ${flag}") endforeach() - if(CMAKE_C_FLAGS) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${flags_list}") - else() - set(CMAKE_C_FLAGS ${flags_list}) - endif() + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${flags_list}" PARENT_SCOPE) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flags_list}" PARENT_SCOPE) +endfunction() - if(CMAKE_CXX_FLAGS) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flags_list}") - else() - set(CMAKE_CXX_FLAGS ${flags_list}) - endif() -endmacro() - -macro(add_linkerflag MODULE _flag) +function(add_linkerflag MODULE _flag) set(NEW_LINKER_FLAGS ${_flag}) get_target_property(LINKER_FLAGS ${MODULE} LINK_FLAGS) if(LINKER_FLAGS) set(NEW_LINKER_FLAGS "${LINKER_FLAGS} ${NEW_LINKER_FLAGS}") endif() set_target_properties(${MODULE} PROPERTIES LINK_FLAGS ${NEW_LINKER_FLAGS}) -endmacro() +endfunction() macro(set_unicode) add_definitions(-DUNICODE -D_UNICODE)
13 years, 3 months
1
0
0
0
[tfaber] 53047: [KMTESTS] - add IoDriverObject test, partly ported from old kmtests. Should possibly be merged with another test - ExDoubleList: add another small testcase
by tfaber@svn.reactos.org
Author: tfaber Date: Wed Aug 3 12:48:22 2011 New Revision: 53047 URL:
http://svn.reactos.org/svn/reactos?rev=53047&view=rev
Log: [KMTESTS] - add IoDriverObject test, partly ported from old kmtests. Should possibly be merged with another test - ExDoubleList: add another small testcase Added: branches/GSoC_2011/KMTestSuite/kmtests/ntos_io/CMakeLists.txt - copied, changed from r52780, branches/GSoC_2011/KMTestSuite/kmtests/example/CMakeLists.txt branches/GSoC_2011/KMTestSuite/kmtests/ntos_io/IoDriverObject_drv.c - copied, changed from r52215, branches/GSoC_2011/KMTestSuite/drivers/kmtest/drvobj_test.c branches/GSoC_2011/KMTestSuite/kmtests/ntos_io/IoDriverObject_user.c (with props) branches/GSoC_2011/KMTestSuite/kmtests/ntos_io/iodriverobject_drv.rbuild - copied, changed from r52780, branches/GSoC_2011/KMTestSuite/kmtests/example/example_drv.rbuild Modified: branches/GSoC_2011/KMTestSuite/kmtests/CMakeLists.txt branches/GSoC_2011/KMTestSuite/kmtests/directory.rbuild branches/GSoC_2011/KMTestSuite/kmtests/kmtest.rbuild branches/GSoC_2011/KMTestSuite/kmtests/kmtest/testlist.c branches/GSoC_2011/KMTestSuite/kmtests/ntos_ex/ExDoubleList.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] Wed Aug 3 12:48:22 2011 @@ -5,6 +5,7 @@ # subdirectories containing special-purpose drivers # add_subdirectory(example) +add_subdirectory(ntos_io) # # kmtest_drv.sys driver @@ -65,6 +66,7 @@ kmtest/testlist.c example/Example_user.c + ntos_io/IoDriverObject_user.c rtl/RtlAvlTree.c rtl/RtlMemory.c rtl/RtlSplayTree.c @@ -82,7 +84,7 @@ # Group targets # add_custom_target(kmtest_drivers) -add_dependencies(kmtest_drivers kmtest_drv example_drv) +add_dependencies(kmtest_drivers kmtest_drv example_drv iodriverobject_drv) add_custom_target(kmtest_all) add_dependencies(kmtest_all kmtest_drivers kmtest) Modified: branches/GSoC_2011/KMTestSuite/kmtests/directory.rbuild URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/KMTestSuite/kmtests/d…
============================================================================== --- branches/GSoC_2011/KMTestSuite/kmtests/directory.rbuild [iso-8859-1] (original) +++ branches/GSoC_2011/KMTestSuite/kmtests/directory.rbuild [iso-8859-1] Wed Aug 3 12:48:22 2011 @@ -4,6 +4,9 @@ <directory name="example"> <xi:include href="example/example_drv.rbuild" /> </directory> + <directory name="ntos_io"> + <xi:include href="ntos_io/iodriverobject_drv.rbuild" /> + </directory> <xi:include href="kmtest.rbuild" /> <xi:include href="kmtest_drv.rbuild" /> </group> Modified: branches/GSoC_2011/KMTestSuite/kmtests/kmtest.rbuild URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/KMTestSuite/kmtests/k…
============================================================================== --- branches/GSoC_2011/KMTestSuite/kmtests/kmtest.rbuild [iso-8859-1] (original) +++ branches/GSoC_2011/KMTestSuite/kmtests/kmtest.rbuild [iso-8859-1] Wed Aug 3 12:48:22 2011 @@ -12,6 +12,9 @@ <directory name="example"> <file>Example_user.c</file> </directory> + <directory name="ntos_io"> + <file>IoDriverObject_user.c</file> + </directory> <directory name="rtl"> <file>RtlAvlTree.c</file> <file>RtlMemory.c</file> Modified: branches/GSoC_2011/KMTestSuite/kmtests/kmtest/testlist.c URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/KMTestSuite/kmtests/k…
============================================================================== --- branches/GSoC_2011/KMTestSuite/kmtests/kmtest/testlist.c [iso-8859-1] (original) +++ branches/GSoC_2011/KMTestSuite/kmtests/kmtest/testlist.c [iso-8859-1] Wed Aug 3 12:48:22 2011 @@ -8,6 +8,7 @@ #include <kmt_test.h> KMT_TESTFUNC Test_Example; +KMT_TESTFUNC Test_IoDriverObject; KMT_TESTFUNC Test_RtlAvlTree; KMT_TESTFUNC Test_RtlMemory; KMT_TESTFUNC Test_RtlSplayTree; @@ -16,6 +17,7 @@ const KMT_TEST TestList[] = { { "Example", Test_Example }, + { "IoDriverObject", Test_IoDriverObject }, { "RtlAvlTree", Test_RtlAvlTree }, { "RtlMemory", Test_RtlMemory }, { "RtlSplayTree", Test_RtlSplayTree }, Modified: branches/GSoC_2011/KMTestSuite/kmtests/ntos_ex/ExDoubleList.c URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/KMTestSuite/kmtests/n…
============================================================================== --- branches/GSoC_2011/KMTestSuite/kmtests/ntos_ex/ExDoubleList.c [iso-8859-1] (original) +++ branches/GSoC_2011/KMTestSuite/kmtests/ntos_ex/ExDoubleList.c [iso-8859-1] Wed Aug 3 12:48:22 2011 @@ -35,16 +35,16 @@ KSPIN_LOCK SpinLock; LIST_ENTRY ListHead; PLIST_ENTRY Ret; - + KeInitializeSpinLock(&SpinLock); - + memset(&ListHead, 0x55, sizeof ListHead); InitializeListHead(&ListHead); ok_eq_pointer(ListHead.Flink, &ListHead); ok_eq_pointer(ListHead.Blink, &ListHead); ok_bool_true(KmtAreInterruptsEnabled(), "Interrupts enabled:"); ok_irql(PASSIVE_LEVEL); - + Ret = ExInterlockedInsertHeadList(&ListHead, &Entries[0], &SpinLock); ok_eq_pointer(Ret, NULL); ok_eq_pointer(ListHead.Flink, &Entries[0]); @@ -53,61 +53,61 @@ ok_eq_pointer(Entries[0].Blink, &ListHead); ok_bool_true(KmtAreInterruptsEnabled(), "Interrupts enabled:"); ok_irql(PASSIVE_LEVEL); - - Ret = ExInterlockedRemoveHeadList(&ListHead, &SpinLock); - ok_eq_pointer(Ret, &Entries[0]); - ok_eq_pointer(ListHead.Flink, &ListHead); - ok_eq_pointer(ListHead.Blink, &ListHead); - ok_eq_free(Entries[0].Flink, &ListHead); - ok_eq_free(Entries[0].Blink, &ListHead); - ok_bool_true(KmtAreInterruptsEnabled(), "Interrupts enabled:"); - ok_irql(PASSIVE_LEVEL); - - Ret = ExInterlockedRemoveHeadList(&ListHead, &SpinLock); - ok_eq_pointer(Ret, NULL); - ok_eq_pointer(ListHead.Flink, &ListHead); - ok_eq_pointer(ListHead.Blink, &ListHead); - ok_eq_free(Entries[0].Flink, &ListHead); - ok_eq_free(Entries[0].Blink, &ListHead); - ok_bool_true(KmtAreInterruptsEnabled(), "Interrupts enabled:"); - ok_irql(PASSIVE_LEVEL); - - Ret = ExInterlockedInsertTailList(&ListHead, &Entries[0], &SpinLock); - ok_eq_pointer(Ret, NULL); - ok_eq_pointer(ListHead.Flink, &Entries[0]); - ok_eq_pointer(ListHead.Blink, &Entries[0]); - ok_eq_pointer(Entries[0].Flink, &ListHead); - ok_eq_pointer(Entries[0].Blink, &ListHead); - ok_bool_true(KmtAreInterruptsEnabled(), "Interrupts enabled:"); - ok_irql(PASSIVE_LEVEL); - - Ret = ExInterlockedRemoveHeadList(&ListHead, &SpinLock); - ok_eq_pointer(Ret, &Entries[0]); - ok_eq_pointer(ListHead.Flink, &ListHead); - ok_eq_pointer(ListHead.Blink, &ListHead); - ok_eq_free(Entries[0].Flink, &ListHead); - ok_eq_free(Entries[0].Blink, &ListHead); - ok_bool_true(KmtAreInterruptsEnabled(), "Interrupts enabled:"); - ok_irql(PASSIVE_LEVEL); - - Ret = ExInterlockedRemoveHeadList(&ListHead, &SpinLock); - ok_eq_pointer(Ret, NULL); - ok_eq_pointer(ListHead.Flink, &ListHead); - ok_eq_pointer(ListHead.Blink, &ListHead); - ok_eq_free(Entries[0].Flink, &ListHead); - ok_eq_free(Entries[0].Blink, &ListHead); - ok_bool_true(KmtAreInterruptsEnabled(), "Interrupts enabled:"); - ok_irql(PASSIVE_LEVEL); - - Ret = ExInterlockedInsertTailList(&ListHead, &Entries[0], &SpinLock); - ok_eq_pointer(Ret, NULL); - ok_eq_pointer(ListHead.Flink, &Entries[0]); - ok_eq_pointer(ListHead.Blink, &Entries[0]); - ok_eq_pointer(Entries[0].Flink, &ListHead); - ok_eq_pointer(Entries[0].Blink, &ListHead); - ok_bool_true(KmtAreInterruptsEnabled(), "Interrupts enabled:"); - ok_irql(PASSIVE_LEVEL); - + + Ret = ExInterlockedRemoveHeadList(&ListHead, &SpinLock); + ok_eq_pointer(Ret, &Entries[0]); + ok_eq_pointer(ListHead.Flink, &ListHead); + ok_eq_pointer(ListHead.Blink, &ListHead); + ok_eq_free(Entries[0].Flink, &ListHead); + ok_eq_free(Entries[0].Blink, &ListHead); + ok_bool_true(KmtAreInterruptsEnabled(), "Interrupts enabled:"); + ok_irql(PASSIVE_LEVEL); + + Ret = ExInterlockedRemoveHeadList(&ListHead, &SpinLock); + ok_eq_pointer(Ret, NULL); + ok_eq_pointer(ListHead.Flink, &ListHead); + ok_eq_pointer(ListHead.Blink, &ListHead); + ok_eq_free(Entries[0].Flink, &ListHead); + ok_eq_free(Entries[0].Blink, &ListHead); + ok_bool_true(KmtAreInterruptsEnabled(), "Interrupts enabled:"); + ok_irql(PASSIVE_LEVEL); + + Ret = ExInterlockedInsertTailList(&ListHead, &Entries[0], &SpinLock); + ok_eq_pointer(Ret, NULL); + ok_eq_pointer(ListHead.Flink, &Entries[0]); + ok_eq_pointer(ListHead.Blink, &Entries[0]); + ok_eq_pointer(Entries[0].Flink, &ListHead); + ok_eq_pointer(Entries[0].Blink, &ListHead); + ok_bool_true(KmtAreInterruptsEnabled(), "Interrupts enabled:"); + ok_irql(PASSIVE_LEVEL); + + Ret = ExInterlockedRemoveHeadList(&ListHead, &SpinLock); + ok_eq_pointer(Ret, &Entries[0]); + ok_eq_pointer(ListHead.Flink, &ListHead); + ok_eq_pointer(ListHead.Blink, &ListHead); + ok_eq_free(Entries[0].Flink, &ListHead); + ok_eq_free(Entries[0].Blink, &ListHead); + ok_bool_true(KmtAreInterruptsEnabled(), "Interrupts enabled:"); + ok_irql(PASSIVE_LEVEL); + + Ret = ExInterlockedRemoveHeadList(&ListHead, &SpinLock); + ok_eq_pointer(Ret, NULL); + ok_eq_pointer(ListHead.Flink, &ListHead); + ok_eq_pointer(ListHead.Blink, &ListHead); + ok_eq_free(Entries[0].Flink, &ListHead); + ok_eq_free(Entries[0].Blink, &ListHead); + ok_bool_true(KmtAreInterruptsEnabled(), "Interrupts enabled:"); + ok_irql(PASSIVE_LEVEL); + + Ret = ExInterlockedInsertTailList(&ListHead, &Entries[0], &SpinLock); + ok_eq_pointer(Ret, NULL); + ok_eq_pointer(ListHead.Flink, &Entries[0]); + ok_eq_pointer(ListHead.Blink, &Entries[0]); + ok_eq_pointer(Entries[0].Flink, &ListHead); + ok_eq_pointer(Entries[0].Blink, &ListHead); + ok_bool_true(KmtAreInterruptsEnabled(), "Interrupts enabled:"); + ok_irql(PASSIVE_LEVEL); + Ret = ExInterlockedInsertHeadList(&ListHead, &Entries[1], &SpinLock); ok_eq_pointer(Ret, &Entries[0]); ok_eq_pointer(ListHead.Flink, &Entries[1]); @@ -118,7 +118,20 @@ ok_eq_pointer(Entries[1].Blink, &ListHead); ok_bool_true(KmtAreInterruptsEnabled(), "Interrupts enabled:"); ok_irql(PASSIVE_LEVEL); - + + Ret = ExInterlockedInsertTailList(&ListHead, &Entries[2], &SpinLock); + ok_eq_pointer(Ret, &Entries[0]); + ok_eq_pointer(ListHead.Flink, &Entries[1]); + ok_eq_pointer(ListHead.Blink, &Entries[2]); + ok_eq_pointer(Entries[0].Flink, &Entries[2]); + ok_eq_pointer(Entries[0].Blink, &Entries[1]); + ok_eq_pointer(Entries[1].Flink, &Entries[0]); + ok_eq_pointer(Entries[1].Blink, &ListHead); + ok_eq_pointer(Entries[2].Flink, &ListHead); + ok_eq_pointer(Entries[2].Blink, &Entries[0]); + ok_bool_true(KmtAreInterruptsEnabled(), "Interrupts enabled:"); + ok_irql(PASSIVE_LEVEL); + memset(Entries, 0x55, sizeof Entries); #undef ExInterlockedInsertHeadList #undef ExInterlockedInsertTailList @@ -130,7 +143,7 @@ ok_eq_pointer(ListHead.Blink, &ListHead); ok_bool_true(KmtAreInterruptsEnabled(), "Interrupts enabled:"); ok_irql(PASSIVE_LEVEL); - + Ret = ExInterlockedInsertHeadList(&ListHead, &Entries[0], &SpinLock); ok_eq_pointer(Ret, NULL); ok_eq_pointer(ListHead.Flink, &Entries[0]); @@ -139,61 +152,61 @@ ok_eq_pointer(Entries[0].Blink, &ListHead); ok_bool_true(KmtAreInterruptsEnabled(), "Interrupts enabled:"); ok_irql(PASSIVE_LEVEL); - - Ret = ExInterlockedRemoveHeadList(&ListHead, &SpinLock); - ok_eq_pointer(Ret, &Entries[0]); - ok_eq_pointer(ListHead.Flink, &ListHead); - ok_eq_pointer(ListHead.Blink, &ListHead); - ok_eq_free2(Entries[0].Flink, &ListHead); - ok_eq_free2(Entries[0].Blink, &ListHead); - ok_bool_true(KmtAreInterruptsEnabled(), "Interrupts enabled:"); - ok_irql(PASSIVE_LEVEL); - - Ret = ExInterlockedRemoveHeadList(&ListHead, &SpinLock); - ok_eq_pointer(Ret, NULL); - ok_eq_pointer(ListHead.Flink, &ListHead); - ok_eq_pointer(ListHead.Blink, &ListHead); - ok_eq_free2(Entries[0].Flink, &ListHead); - ok_eq_free2(Entries[0].Blink, &ListHead); - ok_bool_true(KmtAreInterruptsEnabled(), "Interrupts enabled:"); - ok_irql(PASSIVE_LEVEL); - - Ret = ExInterlockedInsertTailList(&ListHead, &Entries[0], &SpinLock); - ok_eq_pointer(Ret, NULL); - ok_eq_pointer(ListHead.Flink, &Entries[0]); - ok_eq_pointer(ListHead.Blink, &Entries[0]); - ok_eq_pointer(Entries[0].Flink, &ListHead); - ok_eq_pointer(Entries[0].Blink, &ListHead); - ok_bool_true(KmtAreInterruptsEnabled(), "Interrupts enabled:"); - ok_irql(PASSIVE_LEVEL); - - Ret = ExInterlockedRemoveHeadList(&ListHead, &SpinLock); - ok_eq_pointer(Ret, &Entries[0]); - ok_eq_pointer(ListHead.Flink, &ListHead); - ok_eq_pointer(ListHead.Blink, &ListHead); - ok_eq_free2(Entries[0].Flink, &ListHead); - ok_eq_free2(Entries[0].Blink, &ListHead); - ok_bool_true(KmtAreInterruptsEnabled(), "Interrupts enabled:"); - ok_irql(PASSIVE_LEVEL); - - Ret = ExInterlockedRemoveHeadList(&ListHead, &SpinLock); - ok_eq_pointer(Ret, NULL); - ok_eq_pointer(ListHead.Flink, &ListHead); - ok_eq_pointer(ListHead.Blink, &ListHead); - ok_eq_free2(Entries[0].Flink, &ListHead); - ok_eq_free2(Entries[0].Blink, &ListHead); - ok_bool_true(KmtAreInterruptsEnabled(), "Interrupts enabled:"); - ok_irql(PASSIVE_LEVEL); - - Ret = ExInterlockedInsertTailList(&ListHead, &Entries[0], &SpinLock); - ok_eq_pointer(Ret, NULL); - ok_eq_pointer(ListHead.Flink, &Entries[0]); - ok_eq_pointer(ListHead.Blink, &Entries[0]); - ok_eq_pointer(Entries[0].Flink, &ListHead); - ok_eq_pointer(Entries[0].Blink, &ListHead); - ok_bool_true(KmtAreInterruptsEnabled(), "Interrupts enabled:"); - ok_irql(PASSIVE_LEVEL); - + + Ret = ExInterlockedRemoveHeadList(&ListHead, &SpinLock); + ok_eq_pointer(Ret, &Entries[0]); + ok_eq_pointer(ListHead.Flink, &ListHead); + ok_eq_pointer(ListHead.Blink, &ListHead); + ok_eq_free2(Entries[0].Flink, &ListHead); + ok_eq_free2(Entries[0].Blink, &ListHead); + ok_bool_true(KmtAreInterruptsEnabled(), "Interrupts enabled:"); + ok_irql(PASSIVE_LEVEL); + + Ret = ExInterlockedRemoveHeadList(&ListHead, &SpinLock); + ok_eq_pointer(Ret, NULL); + ok_eq_pointer(ListHead.Flink, &ListHead); + ok_eq_pointer(ListHead.Blink, &ListHead); + ok_eq_free2(Entries[0].Flink, &ListHead); + ok_eq_free2(Entries[0].Blink, &ListHead); + ok_bool_true(KmtAreInterruptsEnabled(), "Interrupts enabled:"); + ok_irql(PASSIVE_LEVEL); + + Ret = ExInterlockedInsertTailList(&ListHead, &Entries[0], &SpinLock); + ok_eq_pointer(Ret, NULL); + ok_eq_pointer(ListHead.Flink, &Entries[0]); + ok_eq_pointer(ListHead.Blink, &Entries[0]); + ok_eq_pointer(Entries[0].Flink, &ListHead); + ok_eq_pointer(Entries[0].Blink, &ListHead); + ok_bool_true(KmtAreInterruptsEnabled(), "Interrupts enabled:"); + ok_irql(PASSIVE_LEVEL); + + Ret = ExInterlockedRemoveHeadList(&ListHead, &SpinLock); + ok_eq_pointer(Ret, &Entries[0]); + ok_eq_pointer(ListHead.Flink, &ListHead); + ok_eq_pointer(ListHead.Blink, &ListHead); + ok_eq_free2(Entries[0].Flink, &ListHead); + ok_eq_free2(Entries[0].Blink, &ListHead); + ok_bool_true(KmtAreInterruptsEnabled(), "Interrupts enabled:"); + ok_irql(PASSIVE_LEVEL); + + Ret = ExInterlockedRemoveHeadList(&ListHead, &SpinLock); + ok_eq_pointer(Ret, NULL); + ok_eq_pointer(ListHead.Flink, &ListHead); + ok_eq_pointer(ListHead.Blink, &ListHead); + ok_eq_free2(Entries[0].Flink, &ListHead); + ok_eq_free2(Entries[0].Blink, &ListHead); + ok_bool_true(KmtAreInterruptsEnabled(), "Interrupts enabled:"); + ok_irql(PASSIVE_LEVEL); + + Ret = ExInterlockedInsertTailList(&ListHead, &Entries[0], &SpinLock); + ok_eq_pointer(Ret, NULL); + ok_eq_pointer(ListHead.Flink, &Entries[0]); + ok_eq_pointer(ListHead.Blink, &Entries[0]); + ok_eq_pointer(Entries[0].Flink, &ListHead); + ok_eq_pointer(Entries[0].Blink, &ListHead); + ok_bool_true(KmtAreInterruptsEnabled(), "Interrupts enabled:"); + ok_irql(PASSIVE_LEVEL); + Ret = ExInterlockedInsertHeadList(&ListHead, &Entries[1], &SpinLock); ok_eq_pointer(Ret, &Entries[0]); ok_eq_pointer(ListHead.Flink, &Entries[1]); @@ -204,6 +217,19 @@ ok_eq_pointer(Entries[1].Blink, &ListHead); ok_bool_true(KmtAreInterruptsEnabled(), "Interrupts enabled:"); ok_irql(PASSIVE_LEVEL); - + + Ret = ExInterlockedInsertTailList(&ListHead, &Entries[2], &SpinLock); + ok_eq_pointer(Ret, &Entries[0]); + ok_eq_pointer(ListHead.Flink, &Entries[1]); + ok_eq_pointer(ListHead.Blink, &Entries[2]); + ok_eq_pointer(Entries[0].Flink, &Entries[2]); + ok_eq_pointer(Entries[0].Blink, &Entries[1]); + ok_eq_pointer(Entries[1].Flink, &Entries[0]); + ok_eq_pointer(Entries[1].Blink, &ListHead); + ok_eq_pointer(Entries[2].Flink, &ListHead); + ok_eq_pointer(Entries[2].Blink, &Entries[0]); + ok_bool_true(KmtAreInterruptsEnabled(), "Interrupts enabled:"); + ok_irql(PASSIVE_LEVEL); + KmtSetIrql(PASSIVE_LEVEL); } Copied: branches/GSoC_2011/KMTestSuite/kmtests/ntos_io/CMakeLists.txt (from r52780, branches/GSoC_2011/KMTestSuite/kmtests/example/CMakeLists.txt) URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/KMTestSuite/kmtests/n…
============================================================================== --- branches/GSoC_2011/KMTestSuite/kmtests/example/CMakeLists.txt [iso-8859-1] (original) +++ branches/GSoC_2011/KMTestSuite/kmtests/ntos_io/CMakeLists.txt [iso-8859-1] Wed Aug 3 12:48:22 2011 @@ -3,13 +3,13 @@ list(APPEND EXAMPLE_DRV_SOURCE ../kmtest_drv/kmtest_standalone.c - Example_drv.c) + IoDriverObject_drv.c) -add_library(example_drv SHARED ${EXAMPLE_DRV_SOURCE}) +add_library(iodriverobject_drv SHARED ${EXAMPLE_DRV_SOURCE}) -set_module_type(example_drv kernelmodedriver) -target_link_libraries(example_drv kmtest_printf ${PSEH_LIB}) -add_importlibs(example_drv ntoskrnl hal) -set_property(TARGET example_drv PROPERTY COMPILE_DEFINITIONS KMT_STANDALONE_DRIVER) +set_module_type(iodriverobject_drv kernelmodedriver) +target_link_libraries(iodriverobject_drv kmtest_printf ${PSEH_LIB}) +add_importlibs(iodriverobject_drv ntoskrnl hal) +set_property(TARGET iodriverobject_drv PROPERTY COMPILE_DEFINITIONS KMT_STANDALONE_DRIVER) -add_cd_file(TARGET example_drv DESTINATION reactos/bin FOR all) +add_cd_file(TARGET iodriverobject_drv DESTINATION reactos/bin FOR all) Copied: branches/GSoC_2011/KMTestSuite/kmtests/ntos_io/IoDriverObject_drv.c (from r52215, branches/GSoC_2011/KMTestSuite/drivers/kmtest/drvobj_test.c) URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/KMTestSuite/kmtests/n…
============================================================================== --- branches/GSoC_2011/KMTestSuite/drivers/kmtest/drvobj_test.c [iso-8859-1] (original) +++ branches/GSoC_2011/KMTestSuite/kmtests/ntos_io/IoDriverObject_drv.c [iso-8859-1] Wed Aug 3 12:48:22 2011 @@ -1,31 +1,82 @@ /* - * Driver Regression Tests - * - * Copyright 2009 Michael Martin <martinmnet(a)hotmail.com> - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; see the file COPYING.LIB. - * If not, write to the Free Software Foundation, - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * PROJECT: ReactOS kernel-mode tests + * LICENSE: GPLv2+ - See COPYING in the top level directory + * PURPOSE: Kernel-Mode Test Suite Driver Object Test Driver + * PROGRAMMER: Michael Martin <martinmnet(a)hotmail.com> + * Thomas Faber <thfabba(a)gmx.de> */ -/* INCLUDES *******************************************************************/ +#include <kmt_test.h> -#include "kmtest.h" -#include <ddk/ntddk.h> -#include <ddk/ntifs.h> +//#define NDEBUG +#include <debug.h> -VOID DriverObjectTest(PDRIVER_OBJECT DriverObject, int DriverStatus) +typedef enum +{ + DriverEntry, + DriverIrp, + DriverUnload +} DRIVER_STATUS; + +static KMT_IRP_HANDLER TestIrpHandler; +static VOID TestDriverObject(IN PDRIVER_OBJECT DriverObject, IN DRIVER_STATUS DriverStatus); + +NTSTATUS +TestEntry( + IN PDRIVER_OBJECT DriverObject, + IN PCUNICODE_STRING RegistryPath, + OUT PCWSTR *DeviceName, + OUT INT *Flags) +{ + NTSTATUS Status = STATUS_SUCCESS; + + PAGED_CODE(); + + UNREFERENCED_PARAMETER(RegistryPath); + + *DeviceName = L"IoDriverObject"; + + KmtRegisterIrpHandler(IRP_MJ_CREATE, NULL, TestIrpHandler); + KmtRegisterIrpHandler(IRP_MJ_CLOSE, NULL, TestIrpHandler); + + TestDriverObject(DriverObject, DriverEntry); + + return Status; +} + +VOID +TestUnload( + IN PDRIVER_OBJECT DriverObject) +{ + PAGED_CODE(); + + TestDriverObject(DriverObject, DriverUnload); +} + +static +NTSTATUS +TestIrpHandler( + IN PDEVICE_OBJECT DeviceObject, + IN PIRP Irp, + IN PIO_STACK_LOCATION IoStackLocation) +{ + NTSTATUS Status = STATUS_SUCCESS; + + TestDriverObject(DeviceObject->DriverObject, DriverIrp); + + Irp->IoStatus.Status = Status; + Irp->IoStatus.Information = 0; + + IoCompleteRequest(Irp, IO_NO_INCREMENT); + + return Status; +} + +static +VOID +TestDriverObject( + IN PDRIVER_OBJECT DriverObject, + IN DRIVER_STATUS DriverStatus) { BOOLEAN CheckThisDispatchRoutine; PVOID FirstMajorFunc; @@ -34,7 +85,7 @@ ok(DriverObject->Size == sizeof(DRIVER_OBJECT), "Size does not match, got %x",DriverObject->Size); ok(DriverObject->Type == 4, "Type does not match 4. got %d",DriverObject->Type); - if (DriverStatus == 0) + if (DriverStatus == DriverEntry) { ok(DriverObject->DeviceObject == NULL, "Expected DeviceObject pointer to be 0, got %p", DriverObject->DeviceObject); @@ -42,26 +93,28 @@ "Expected Flags to be DRVO_LEGACY_DRIVER, got %lu", DriverObject->Flags); } - else if (DriverStatus == 1) + else if (DriverStatus == DriverIrp) { ok(DriverObject->DeviceObject != NULL, "Expected DeviceObject pointer to non null"); ok (DriverObject->Flags == (DRVO_LEGACY_DRIVER | DRVO_INITIALIZED), "Expected Flags to be DRVO_LEGACY_DRIVER | DRVO_INITIALIZED, got %lu", DriverObject->Flags); } - else + else if (DriverStatus == DriverUnload) { ok(DriverObject->DeviceObject != NULL, "Expected DeviceObject pointer to non null"); - ok (DriverObject->Flags == (DRVO_LEGACY_DRIVER | DRVO_INITIALIZED | DRVO_UNLOAD_INVOKED), + ok (DriverObject->Flags == (DRVO_LEGACY_DRIVER | DRVO_INITIALIZED | DRVO_UNLOAD_INVOKED), "Expected Flags to be DRVO_LEGACY_DRIVER | DRVO_INITIALIZED | DRVO_UNLOAD_INVOKED, got %lu", DriverObject->Flags); } + else + ASSERT(FALSE); /* Select a routine that was not changed */ FirstMajorFunc = DriverObject->MajorFunction[1]; ok(FirstMajorFunc != 0, "Expected MajorFunction[1] to be non NULL"); - if (FirstMajorFunc) + if (!skip(FirstMajorFunc != NULL, "First major function not set!\n")) { for (i = 0; i <= IRP_MJ_MAXIMUM_FUNCTION; i++) { @@ -75,67 +128,4 @@ } } } - else - { - ok(TRUE, "Skipped testing for all MajorFunction"); - } } - -BOOLEAN ZwLoadTest(PDRIVER_OBJECT DriverObject, PUNICODE_STRING DriverRegistryPath, PWCHAR NewDriverRegPath) -{ - UNICODE_STRING RegPath; - NTSTATUS Status; - - /* Try to load ourself */ - Status = ZwLoadDriver(DriverRegistryPath); - ok (Status == STATUS_IMAGE_ALREADY_LOADED, "Expected NTSTATUS STATUS_IMAGE_ALREADY_LOADED, got 0x%lX", Status); - - if (Status != STATUS_IMAGE_ALREADY_LOADED) - { - DbgPrint("WARNING: Loading this a second time will cause BUGCHECK!\n"); - } - - /* Try to load with a Registry Path that doesnt exist */ - RtlInitUnicodeString(&RegPath, L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\deadbeef"); - Status = ZwLoadDriver(&RegPath); - ok (Status == STATUS_OBJECT_NAME_NOT_FOUND, "Expected NTSTATUS STATUS_OBJECT_NAME_NOT_FOUND, got 0x%lX", Status); - - /* Load the driver */ - RtlInitUnicodeString(&RegPath, NewDriverRegPath); - Status = ZwLoadDriver(&RegPath); - ok(Status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got 0x%lX", Status); - - if (!NT_SUCCESS(Status)) - { - return FALSE; - } - - return TRUE; -} - -BOOLEAN ZwUnloadTest(PDRIVER_OBJECT DriverObject, PUNICODE_STRING DriverRegistryPath, PWCHAR NewDriverRegPath) -{ - UNICODE_STRING RegPath; - NTSTATUS Status; - - /* Try to unload ourself, which should fail as our Unload routine hasnt been set yet. */ - Status = ZwUnloadDriver(DriverRegistryPath); - ok (Status == STATUS_INVALID_DEVICE_REQUEST, "Expected NTSTATUS STATUS_INVALID_DEVICE_REQUEST, got 0x%lX", Status); - - /* Try to unload with a Registry Path that doesnt exist */ - RtlInitUnicodeString(&RegPath, L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\deadbeef"); - Status = ZwUnloadDriver(&RegPath); - ok (Status == STATUS_OBJECT_NAME_NOT_FOUND, "Expected NTSTATUS STATUS_OBJECT_NAME_NOT_FOUND, got 0x%lX", Status); - - /* Unload the driver */ - RtlInitUnicodeString(&RegPath, NewDriverRegPath); - Status = ZwUnloadDriver(&RegPath); - ok(Status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got 0x%lX", Status); - - if (!NT_SUCCESS(Status)) - { - return FALSE; - } - - return TRUE; -} Added: branches/GSoC_2011/KMTestSuite/kmtests/ntos_io/IoDriverObject_user.c URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/KMTestSuite/kmtests/n…
============================================================================== --- branches/GSoC_2011/KMTestSuite/kmtests/ntos_io/IoDriverObject_user.c (added) +++ branches/GSoC_2011/KMTestSuite/kmtests/ntos_io/IoDriverObject_user.c [iso-8859-1] Wed Aug 3 12:48:22 2011 @@ -1,0 +1,16 @@ +/* + * PROJECT: ReactOS kernel-mode tests + * LICENSE: GPLv2+ - See COPYING in the top level directory + * PURPOSE: Kernel-Mode Test Suite Driver Object test user-mode part + * PROGRAMMER: Thomas Faber <thfabba(a)gmx.de> + */ + +#include <kmt_test.h> + +START_TEST(IoDriverObject) +{ + KmtLoadDriver(L"IoDriverObject", FALSE); + KmtOpenDriver(); + KmtCloseDriver(); + KmtUnloadDriver(); +} Propchange: branches/GSoC_2011/KMTestSuite/kmtests/ntos_io/IoDriverObject_user.c ------------------------------------------------------------------------------ svn:eol-style = native Copied: branches/GSoC_2011/KMTestSuite/kmtests/ntos_io/iodriverobject_drv.rbuild (from r52780, branches/GSoC_2011/KMTestSuite/kmtests/example/example_drv.rbuild) URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/KMTestSuite/kmtests/n…
============================================================================== --- branches/GSoC_2011/KMTestSuite/kmtests/example/example_drv.rbuild [iso-8859-1] (original) +++ branches/GSoC_2011/KMTestSuite/kmtests/ntos_io/iodriverobject_drv.rbuild [iso-8859-1] Wed Aug 3 12:48:22 2011 @@ -1,11 +1,11 @@ -<module name="example_drv" type="kernelmodedriver" installbase="bin" installname="example_drv.sys"> +<module name="iodriverobject_drv" type="kernelmodedriver" installbase="bin" installname="iodriverobject_drv.sys"> <include base="kmtest_drv">include</include> <library>ntoskrnl</library> <library>hal</library> <library>pseh</library> <library>kmtest_printf</library> <define name="KMT_STANDALONE_DRIVER" /> - <file>Example_drv.c</file> + <file>IoDriverObject_drv.c</file> <directory name=".."> <directory name="kmtest_drv"> <file>kmtest_standalone.c</file>
13 years, 3 months
1
0
0
0
[tfaber] 53046: [KMTESTS] - add RtlSplayTree test. Patch by arty (hacks by me ; ]) - add RtlAvlTree test using the same code - add kmtest_drivers and kmtest_all build targets
by tfaber@svn.reactos.org
Author: tfaber Date: Wed Aug 3 11:21:35 2011 New Revision: 53046 URL:
http://svn.reactos.org/svn/reactos?rev=53046&view=rev
Log: [KMTESTS] - add RtlSplayTree test. Patch by arty (hacks by me ;]) - add RtlAvlTree test using the same code - add kmtest_drivers and kmtest_all build targets Added: branches/GSoC_2011/KMTestSuite/kmtests/rtl/RtlAvlTree.c (with props) branches/GSoC_2011/KMTestSuite/kmtests/rtl/RtlSplayTree.c (with props) Modified: branches/GSoC_2011/KMTestSuite/kmtests/CMakeLists.txt branches/GSoC_2011/KMTestSuite/kmtests/kmtest.rbuild branches/GSoC_2011/KMTestSuite/kmtests/kmtest/testlist.c branches/GSoC_2011/KMTestSuite/kmtests/kmtest_drv.rbuild branches/GSoC_2011/KMTestSuite/kmtests/kmtest_drv/testlist.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] Wed Aug 3 11:21:35 2011 @@ -32,7 +32,9 @@ ntos_ke/KeProcessor.c ntos_ke/KeSpinLock.c ntos_ob/ObCreate.c + rtl/RtlAvlTree.c rtl/RtlMemory.c + rtl/RtlSplayTree.c kmtest_drv/kmtest_drv.rc) @@ -63,13 +65,24 @@ kmtest/testlist.c example/Example_user.c + rtl/RtlAvlTree.c rtl/RtlMemory.c + rtl/RtlSplayTree.c kmtest/kmtest.rc) add_executable(kmtest ${KMTEST_SOURCE}) set_module_type(kmtest win32cui) -add_importlibs(kmtest advapi32 msvcrt kernel32) +add_importlibs(kmtest advapi32 msvcrt kernel32 ntdll) set_property(TARGET kmtest PROPERTY COMPILE_DEFINITIONS KMT_USER_MODE) add_cd_file(TARGET kmtest DESTINATION reactos/bin FOR all) + +# +# Group targets +# +add_custom_target(kmtest_drivers) +add_dependencies(kmtest_drivers kmtest_drv example_drv) + +add_custom_target(kmtest_all) +add_dependencies(kmtest_all kmtest_drivers kmtest) Modified: branches/GSoC_2011/KMTestSuite/kmtests/kmtest.rbuild URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/KMTestSuite/kmtests/k…
============================================================================== --- branches/GSoC_2011/KMTestSuite/kmtests/kmtest.rbuild [iso-8859-1] (original) +++ branches/GSoC_2011/KMTestSuite/kmtests/kmtest.rbuild [iso-8859-1] Wed Aug 3 11:21:35 2011 @@ -1,6 +1,7 @@ <module name="kmtest" type="win32cui" installbase="bin" installname="kmtest.exe"> <include base="kmtest">include</include> <library>advapi32</library> + <library>ntdll</library> <define name="KMT_USER_MODE" /> <directory name="kmtest"> <file>kmtest.c</file> @@ -12,6 +13,8 @@ <file>Example_user.c</file> </directory> <directory name="rtl"> + <file>RtlAvlTree.c</file> <file>RtlMemory.c</file> + <file>RtlSplayTree.c</file> </directory> </module> Modified: branches/GSoC_2011/KMTestSuite/kmtests/kmtest/testlist.c URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/KMTestSuite/kmtests/k…
============================================================================== --- branches/GSoC_2011/KMTestSuite/kmtests/kmtest/testlist.c [iso-8859-1] (original) +++ branches/GSoC_2011/KMTestSuite/kmtests/kmtest/testlist.c [iso-8859-1] Wed Aug 3 11:21:35 2011 @@ -8,12 +8,16 @@ #include <kmt_test.h> KMT_TESTFUNC Test_Example; +KMT_TESTFUNC Test_RtlAvlTree; KMT_TESTFUNC Test_RtlMemory; +KMT_TESTFUNC Test_RtlSplayTree; /* tests with a leading '-' will not be listed */ const KMT_TEST TestList[] = { { "Example", Test_Example }, + { "RtlAvlTree", Test_RtlAvlTree }, { "RtlMemory", Test_RtlMemory }, + { "RtlSplayTree", Test_RtlSplayTree }, { NULL, NULL }, }; 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] Wed Aug 3 11:21:35 2011 @@ -42,7 +42,9 @@ <file>ObCreate.c</file> </directory> <directory name="rtl"> + <file>RtlAvlTree.c</file> <file>RtlMemory.c</file> + <file>RtlSplayTree.c</file> </directory> </module> <module name="kmtest_printf" type="staticlibrary"> 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] Wed Aug 3 11:21:35 2011 @@ -5,7 +5,6 @@ * PROGRAMMER: Thomas Faber <thfabba(a)gmx.de> */ -#include <ntddk.h> #include <kmt_test.h> KMT_TESTFUNC Test_Example; @@ -27,7 +26,9 @@ KMT_TESTFUNC Test_KeProcessor; KMT_TESTFUNC Test_KernelType; KMT_TESTFUNC Test_ObCreate; +KMT_TESTFUNC Test_RtlAvlTree; KMT_TESTFUNC Test_RtlMemory; +KMT_TESTFUNC Test_RtlSplayTree; const KMT_TEST TestList[] = { @@ -50,6 +51,8 @@ { "KeProcessor", Test_KeProcessor }, { "-KernelType", Test_KernelType }, { "ObCreate", Test_ObCreate }, + { "RtlAvlTreeKM", Test_RtlAvlTree }, { "RtlMemoryKM", Test_RtlMemory }, + { "RtlSplayTreeKM", Test_RtlSplayTree }, { NULL, NULL } }; Added: branches/GSoC_2011/KMTestSuite/kmtests/rtl/RtlAvlTree.c URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/KMTestSuite/kmtests/r…
============================================================================== --- branches/GSoC_2011/KMTestSuite/kmtests/rtl/RtlAvlTree.c (added) +++ branches/GSoC_2011/KMTestSuite/kmtests/rtl/RtlAvlTree.c [iso-8859-1] Wed Aug 3 11:21:35 2011 @@ -1,0 +1,34 @@ +/* HACK: broken ntddk.h */ +#ifdef KMT_KERNEL_MODE +typedef struct _RTL_SPLAY_LINKS { + struct _RTL_SPLAY_LINKS *Parent; + struct _RTL_SPLAY_LINKS *LeftChild; + struct _RTL_SPLAY_LINKS *RightChild; +} RTL_SPLAY_LINKS, *PRTL_SPLAY_LINKS; +#endif + +#define RTL_USE_AVL_TABLES +#define KMT_EMULATE_KERNEL +#include <kmt_test.h> + +#if defined KMT_USER_MODE +/* HACK: missing in rtltypes.h */ +#undef RTL_GENERIC_TABLE +#undef PRTL_GENERIC_TABLE + +#define RTL_GENERIC_TABLE RTL_AVL_TABLE +#define PRTL_GENERIC_TABLE PRTL_AVL_TABLE + +/* HACK: missing in rtlfuncs.h */ +#define RtlInitializeGenericTable RtlInitializeGenericTableAvl +#define RtlInsertElementGenericTable RtlInsertElementGenericTableAvl +#define RtlDeleteElementGenericTable RtlDeleteElementGenericTableAvl +#define RtlLookupElementGenericTable RtlLookupElementGenericTableAvl +#define RtlEnumerateGenericTable RtlEnumerateGenericTableAvl +#define RtlGetElementGenericTable RtlGetElementGenericTableAvl +#define RtlNumberGenericTableElements RtlNumberGenericTableElementsAvl +#endif + +/* this is a little hacky, but better than duplicating the code (for now) */ +#define Test_RtlSplayTree Test_RtlAvlTree +#include "RtlSplayTree.c" Propchange: branches/GSoC_2011/KMTestSuite/kmtests/rtl/RtlAvlTree.c ------------------------------------------------------------------------------ svn:eol-style = native Added: branches/GSoC_2011/KMTestSuite/kmtests/rtl/RtlSplayTree.c URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/KMTestSuite/kmtests/r…
============================================================================== --- branches/GSoC_2011/KMTestSuite/kmtests/rtl/RtlSplayTree.c (added) +++ branches/GSoC_2011/KMTestSuite/kmtests/rtl/RtlSplayTree.c [iso-8859-1] Wed Aug 3 11:21:35 2011 @@ -1,0 +1,103 @@ +/* + * PROJECT: ReactOS kernel-mode tests + * LICENSE: LGPLv2+ - See COPYING.LIB in the top level directory + * PURPOSE: Kernel-Mode Test Suite RtlGenericTable + * PROGRAMMER: arty + */ + +#define KMT_EMULATE_KERNEL +#include <kmt_test.h> + +#define NDEBUG +#include <debug.h> + +/* HACK: missing in rtlfuncs.h */ +#if defined KMT_USER_MODE && !defined RTL_USE_AVL_TABLES +NTSYSAPI VOID NTAPI RtlInitializeGenericTable(OUT PRTL_GENERIC_TABLE Table, IN PRTL_GENERIC_COMPARE_ROUTINE CompareRoutine, IN PRTL_GENERIC_ALLOCATE_ROUTINE AllocateRoutine, IN PRTL_GENERIC_FREE_ROUTINE FreeRoutine, IN PVOID TableContext OPTIONAL); +NTSYSAPI PVOID NTAPI RtlInsertElementGenericTable(IN PRTL_GENERIC_TABLE Table, IN PVOID Buffer, IN CLONG BufferSize, OUT PBOOLEAN NewElement OPTIONAL); +NTSYSAPI BOOLEAN NTAPI RtlDeleteElementGenericTable(IN PRTL_GENERIC_TABLE Table, IN PVOID Buffer); +NTSYSAPI PVOID NTAPI RtlLookupElementGenericTable(IN PRTL_GENERIC_TABLE Table, IN PVOID Buffer); +NTSYSAPI PVOID NTAPI RtlEnumerateGenericTable(IN PRTL_GENERIC_TABLE Table, IN BOOLEAN Restart); +NTSYSAPI PVOID NTAPI RtlGetElementGenericTable(IN PRTL_GENERIC_TABLE Table, IN ULONG I); +NTSYSAPI ULONG NTAPI RtlNumberGenericTableElements(IN PRTL_GENERIC_TABLE Table); +#endif + +static LIST_ENTRY Allocations; + +static RTL_GENERIC_COMPARE_RESULTS NTAPI +CompareCharTable(PRTL_GENERIC_TABLE Table, PVOID A, PVOID B) +{ + RTL_GENERIC_COMPARE_RESULTS Result = (*((PCHAR)A) < *((PCHAR)B)) ? GenericLessThan : + (*((PCHAR)A) > *((PCHAR)B)) ? GenericGreaterThan : + GenericEqual; + return Result; +} + +static PVOID NTAPI +AllocRoutine(PRTL_GENERIC_TABLE Table, CLONG ByteSize) +{ + PLIST_ENTRY Entry = ExAllocatePool + (NonPagedPool, sizeof(LIST_ENTRY) + ByteSize); + InsertTailList(&Allocations, Entry); + return &Entry[1]; +} + +static VOID NTAPI +FreeRoutine(PRTL_GENERIC_TABLE Table, PVOID Buffer) +{ + PLIST_ENTRY Entry = (PLIST_ENTRY)(((PCHAR)Buffer) - sizeof(LIST_ENTRY)); + RemoveEntryList(Entry); + ExFreePool(Entry); +} + +static void RtlSplayTreeTest() +{ + ULONG i, del; + PCHAR Ch; + CHAR Text[] = "the quick_brown!fOx-jUmp3d/0vER+THe^lazy.D@g"; + CHAR NewE[] = "11111111111111111111111111111111110111111111"; + RTL_GENERIC_TABLE Table; + RtlInitializeGenericTable + (&Table, + CompareCharTable, + AllocRoutine, + FreeRoutine, + NULL); + for (i = 0; Text[i]; i++) { + BOOLEAN WasNew; + Ch = (PCHAR)RtlInsertElementGenericTable + (&Table, + &Text[i], + sizeof(Text[i]), + &WasNew); + ok(Ch && *Ch == Text[i], "Copy character into node\n"); + ok(WasNew == (NewE[i] == '1'), "Character newness didn't match\n"); + } + for (Ch = (PCHAR)RtlEnumerateGenericTable(&Table, TRUE), i = 0; + Ch; + Ch = (PCHAR)RtlEnumerateGenericTable(&Table, FALSE), i++) { + ok(strchr(Text, *Ch) != NULL, "Nonexistent character\n"); + } + ok(RtlNumberGenericTableElements(&Table) == strlen(Text) - 1, "Not the right number of elements\n"); + ok(RtlLookupElementGenericTable(&Table, "q") != NULL, "Could not lookup q\n"); + ok(!RtlLookupElementGenericTable(&Table, "#"), "Found a character that shouldn't appear\n"); + ok(strlen(Text) == i + 1, "Didn't enumerate enough characters\n"); + del = 0; + for (i = 0; Text[i]; i++) { + if (NewE[i] == '1') { + BOOLEAN WasDeleted; + WasDeleted = RtlDeleteElementGenericTable(&Table, &Text[i]); + del += WasDeleted; + } + } + ok(!RtlNumberGenericTableElements(&Table), "Not zero elements\n"); + ok(!RtlGetElementGenericTable(&Table, 0), "Elements left when we removed them all\n"); + ok(strlen(Text) == del + 1, "Deleted too many times\n"); + ok(IsListEmpty(&Allocations), "Didn't free all memory\n"); +} + +START_TEST(RtlSplayTree) +{ + InitializeListHead(&Allocations); + RtlSplayTreeTest(); +} Propchange: branches/GSoC_2011/KMTestSuite/kmtests/rtl/RtlSplayTree.c ------------------------------------------------------------------------------ svn:eol-style = native
13 years, 3 months
1
0
0
0
[cgutman] 53045: [NDIS] - Fix adapter binding for the WinPcap driver
by cgutman@svn.reactos.org
Author: cgutman Date: Wed Aug 3 07:52:51 2011 New Revision: 53045 URL:
http://svn.reactos.org/svn/reactos?rev=53045&view=rev
Log: [NDIS] - Fix adapter binding for the WinPcap driver Modified: trunk/reactos/drivers/network/ndis/ndis/protocol.c Modified: trunk/reactos/drivers/network/ndis/ndis/protocol.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/ndis/ndis/…
============================================================================== --- trunk/reactos/drivers/network/ndis/ndis/protocol.c [iso-8859-1] (original) +++ trunk/reactos/drivers/network/ndis/ndis/protocol.c [iso-8859-1] Wed Aug 3 07:52:51 2011 @@ -907,20 +907,22 @@ */ OBJECT_ATTRIBUTES ObjectAttributes; UNICODE_STRING RegistryPath; - WCHAR *RegistryPathStr; + WCHAR *RegistryPathStr, *DataPtr = NULL; NTSTATUS NtStatus; - WCHAR *DataPtr; HANDLE DriverKeyHandle = NULL; PKEY_VALUE_PARTIAL_INFORMATION KeyInformation = NULL; PNDIS_PROTOCOL_CHARACTERISTICS ProtocolCharacteristics = &Protocol->Chars; + UNICODE_STRING ValueName; + ULONG ResultLength; + PLIST_ENTRY CurrentEntry = NULL; RegistryPathStr = ExAllocatePoolWithTag(PagedPool, sizeof(SERVICES_KEY) + ProtocolCharacteristics->Name.Length + sizeof(LINKAGE_KEY), NDIS_TAG + __LINE__); if(!RegistryPathStr) - { + { NDIS_DbgPrint(MIN_TRACE, ("Insufficient resources.\n")); *Status = NDIS_STATUS_RESOURCES; return; - } + } wcscpy(RegistryPathStr, SERVICES_KEY); wcsncat(RegistryPathStr, ((WCHAR *)ProtocolCharacteristics->Name.Buffer), ProtocolCharacteristics->Name.Length / sizeof(WCHAR)); @@ -935,130 +937,165 @@ ExFreePool(RegistryPathStr); - if(!NT_SUCCESS(NtStatus)) - { - NDIS_DbgPrint(MIN_TRACE, ("Unable to open protocol configuration\n")); - *Status = NDIS_STATUS_FAILURE; - return; - } - - NDIS_DbgPrint(MAX_TRACE, ("Successfully opened the registry configuration\n")); - - { - UNICODE_STRING ValueName; - ULONG ResultLength; - - RtlInitUnicodeString(&ValueName, L"Bind"); - - NtStatus = ZwQueryValueKey(DriverKeyHandle, &ValueName, KeyValuePartialInformation, NULL, 0, &ResultLength); - if(NtStatus != STATUS_BUFFER_OVERFLOW && NtStatus != STATUS_BUFFER_TOO_SMALL && NtStatus != STATUS_SUCCESS) - { - NDIS_DbgPrint(MIN_TRACE, ("Unable to query the Bind value for size\n")); - ZwClose(DriverKeyHandle); - *Status = NDIS_STATUS_FAILURE; - return; - } - - KeyInformation = ExAllocatePoolWithTag(PagedPool, sizeof(KEY_VALUE_PARTIAL_INFORMATION) + ResultLength, NDIS_TAG + __LINE__); - if(!KeyInformation) - { - NDIS_DbgPrint(MIN_TRACE, ("Insufficient resources.\n")); - ZwClose(DriverKeyHandle); - *Status = NDIS_STATUS_FAILURE; - return; - } - - NtStatus = ZwQueryValueKey(DriverKeyHandle, &ValueName, KeyValuePartialInformation, KeyInformation, - sizeof(KEY_VALUE_PARTIAL_INFORMATION) + ResultLength, &ResultLength); - - ZwClose(DriverKeyHandle); - - if(!NT_SUCCESS(NtStatus)) - { - NDIS_DbgPrint(MIN_TRACE, ("Unable to query the Bind value\n")); + if(NT_SUCCESS(NtStatus)) + { + NDIS_DbgPrint(MAX_TRACE, ("Successfully opened the registry configuration\n")); + + RtlInitUnicodeString(&ValueName, L"Bind"); + + NtStatus = ZwQueryValueKey(DriverKeyHandle, &ValueName, KeyValuePartialInformation, NULL, 0, &ResultLength); + if(NtStatus != STATUS_BUFFER_OVERFLOW && NtStatus != STATUS_BUFFER_TOO_SMALL && NtStatus != STATUS_SUCCESS) + { + NDIS_DbgPrint(MIN_TRACE, ("Unable to query the Bind value for size\n")); + ZwClose(DriverKeyHandle); + } + else + { + KeyInformation = ExAllocatePoolWithTag(PagedPool, sizeof(KEY_VALUE_PARTIAL_INFORMATION) + ResultLength, NDIS_TAG + __LINE__); + if(!KeyInformation) + { + NDIS_DbgPrint(MIN_TRACE, ("Insufficient resources.\n")); + ZwClose(DriverKeyHandle); + NtStatus = STATUS_NO_MEMORY; + } + else + { + NtStatus = ZwQueryValueKey(DriverKeyHandle, &ValueName, KeyValuePartialInformation, KeyInformation, + sizeof(KEY_VALUE_PARTIAL_INFORMATION) + ResultLength, &ResultLength); + + ZwClose(DriverKeyHandle); + + if(!NT_SUCCESS(NtStatus)) + { + NDIS_DbgPrint(MIN_TRACE, ("Unable to query the Bind value\n")); + ExFreePool(KeyInformation); + KeyInformation = NULL; + } + } + } + } + + if (!NT_SUCCESS(NtStatus)) + { + NDIS_DbgPrint(MIN_TRACE, ("Performing global bind for protocol '%wZ'\n", &ProtocolCharacteristics->Name)); + KeyInformation = NULL; + + CurrentEntry = AdapterListHead.Flink; + } + else + { + NDIS_DbgPrint(MIN_TRACE, ("Performing standard bind for protocol '%wZ'\n", &ProtocolCharacteristics->Name)); + + DataPtr = (WCHAR*)KeyInformation->Data; + } + + /* Assume success for now */ + *Status = NDIS_STATUS_SUCCESS; + + while (TRUE) + { + /* BindContext is for tracking pending binding operations */ + VOID *BindContext = 0; + NDIS_STRING DeviceName; + NDIS_STRING RegistryPath; + WCHAR *RegistryPathStr = NULL; + ULONG PathLength = 0; + PLOGICAL_ADAPTER Adapter; + + if (KeyInformation) + { + /* Parse the REG_MULTI_SZ entry for device names */ + if (!(*DataPtr)) + break; + + RtlInitUnicodeString(&DeviceName, DataPtr); + } + else + { + /* Use the device name from the global adapter list */ + if (CurrentEntry == &AdapterListHead) + break; + + Adapter = CONTAINING_RECORD(CurrentEntry, LOGICAL_ADAPTER, ListEntry); + + DeviceName = Adapter->NdisMiniportBlock.MiniportName; + } + + /* Make sure the adapter has started */ + if (!MiniLocateDevice(&DeviceName)) + { + /* It wasn't in the global miniport list, so skip the bind entry */ + goto next; + } + + /* Make sure this device isn't already bound to this protocol */ + if (LocateAdapterBindingByName(Protocol, &DeviceName)) + { + /* It was already in this protocol's bound adapter list, so skip the bind entry */ + goto next; + } + + /* + * RegistryPath should be: + * \Registry\Machine\System\CurrentControlSet\Services\Nic1\Parameters\Tcpip + * + * This is constructed as follows: + * SERVICES_KEY + extracted device name + Protocol name from characteristics + */ + + PathLength = sizeof(SERVICES_KEY) + /* \Registry\Machine\System\CurrentControlSet\Services\ */ + wcslen( DeviceName.Buffer + 8 ) * sizeof(WCHAR) + /* Adapter1 (extracted from \Device\Adapter1) */ + sizeof(PARAMETERS_KEY) + /* \Parameters\ */ + ProtocolCharacteristics->Name.Length + sizeof(WCHAR); /* Tcpip */ + + RegistryPathStr = ExAllocatePool(PagedPool, PathLength); + if(!RegistryPathStr) + { + NDIS_DbgPrint(MIN_TRACE, ("insufficient resources.\n")); + *Status = NDIS_STATUS_RESOURCES; + break; + } + + wcscpy(RegistryPathStr, SERVICES_KEY); + wcscat(RegistryPathStr, DeviceName.Buffer + 8 ); + wcscat(RegistryPathStr, PARAMETERS_KEY); + wcsncat(RegistryPathStr, ProtocolCharacteristics->Name.Buffer, ProtocolCharacteristics->Name.Length / sizeof(WCHAR) ); + + RegistryPathStr[PathLength/sizeof(WCHAR) - 1] = 0; + + RtlInitUnicodeString(&RegistryPath, RegistryPathStr); + + NDIS_DbgPrint(MAX_TRACE, ("Calling protocol's BindAdapter handler with DeviceName %wZ and RegistryPath %wZ\n", + &DeviceName, &RegistryPath)); + + { + BIND_HANDLER BindHandler = ProtocolCharacteristics->BindAdapterHandler; + if(BindHandler) + { + BindHandler(Status, BindContext, &DeviceName, &RegistryPath, 0); + NDIS_DbgPrint(MIN_TRACE, ("%wZ's BindAdapter handler returned 0x%x for %wZ\n", &ProtocolCharacteristics->Name, *Status, &DeviceName)); + } + else + NDIS_DbgPrint(MIN_TRACE, ("No protocol bind handler specified\n")); + } + + next: + if (KeyInformation) + { + /* Advance to the next adapter in the REG_MULTI_SZ */ + DataPtr += (DeviceName.Length / sizeof(WCHAR)) + 1; + } + else + { + /* Advance to the next adapter in the global list */ + CurrentEntry = CurrentEntry->Flink; + } + } + + if (KeyInformation) + { ExFreePool(KeyInformation); - *Status = NDIS_STATUS_FAILURE; - return; - } - } - - /* Assume success for now */ - *Status = NDIS_STATUS_SUCCESS; - - for (DataPtr = (WCHAR *)KeyInformation->Data; - *DataPtr != 0; - DataPtr += wcslen(DataPtr) + 1) - { - /* BindContext is for tracking pending binding operations */ - VOID *BindContext = 0; - NDIS_STRING DeviceName; - NDIS_STRING RegistryPath; - WCHAR *RegistryPathStr = NULL; - ULONG PathLength = 0; - - RtlInitUnicodeString(&DeviceName, DataPtr); /* we know this is 0-term */ - - /* Make sure the adapter has started */ - if (!MiniLocateDevice(&DeviceName)) - { - /* It wasn't in the global miniport list, so skip the bind entry */ - continue; - } - - /* Make sure this device isn't already bound to this protocol */ - if (LocateAdapterBindingByName(Protocol, &DeviceName)) - { - /* It was already in this protocol's bound adapter list, so skip the bind entry */ - continue; - } - - /* - * RegistryPath should be: - * \Registry\Machine\System\CurrentControlSet\Services\Nic1\Parameters\Tcpip - * - * This is constructed as follows: - * SERVICES_KEY + extracted device name + Protocol name from characteristics - */ - - PathLength = sizeof(SERVICES_KEY) + /* \Registry\Machine\System\CurrentControlSet\Services\ */ - wcslen( DataPtr + 8 ) * sizeof(WCHAR) + /* Adapter1 (extracted from \Device\Adapter1) */ - sizeof(PARAMETERS_KEY) + /* \Parameters\ */ - ProtocolCharacteristics->Name.Length + sizeof(WCHAR); /* Tcpip */ - - RegistryPathStr = ExAllocatePool(PagedPool, PathLength); - if(!RegistryPathStr) - { - NDIS_DbgPrint(MIN_TRACE, ("insufficient resources.\n")); - ExFreePool(KeyInformation); - *Status = NDIS_STATUS_RESOURCES; - return; - } - - wcscpy(RegistryPathStr, SERVICES_KEY); - wcscat(RegistryPathStr, DataPtr + 8 ); - wcscat(RegistryPathStr, PARAMETERS_KEY); - wcsncat(RegistryPathStr, ProtocolCharacteristics->Name.Buffer, ProtocolCharacteristics->Name.Length / sizeof(WCHAR) ); - - RegistryPathStr[PathLength/sizeof(WCHAR) - 1] = 0; - - RtlInitUnicodeString(&RegistryPath, RegistryPathStr); - - NDIS_DbgPrint(MAX_TRACE, ("Calling protocol's BindAdapter handler with DeviceName %wZ and RegistryPath %wZ\n", - &DeviceName, &RegistryPath)); - - { - BIND_HANDLER BindHandler = ProtocolCharacteristics->BindAdapterHandler; - if(BindHandler) - { - BindHandler(Status, BindContext, &DeviceName, &RegistryPath, 0); - NDIS_DbgPrint(MIN_TRACE, ("%wZ's BindAdapter handler returned 0x%x for %wZ\n", &ProtocolCharacteristics->Name, *Status, &DeviceName)); - } - else - NDIS_DbgPrint(MIN_TRACE, ("No protocol bind handler specified\n")); - } - } - - ExFreePool(KeyInformation); + } } /*
13 years, 3 months
1
0
0
0
[ion] 53044: [CSRSRV]: Hey Arch, try creating a shared section before mapping it.
by ion@svn.reactos.org
Author: ion Date: Wed Aug 3 06:18:42 2011 New Revision: 53044 URL:
http://svn.reactos.org/svn/reactos?rev=53044&view=rev
Log: [CSRSRV]: Hey Arch, try creating a shared section before mapping it. Modified: trunk/reactos/subsystems/win32/csrss/csrsrv/init.c Modified: trunk/reactos/subsystems/win32/csrss/csrsrv/init.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/csrss/csr…
============================================================================== --- trunk/reactos/subsystems/win32/csrss/csrsrv/init.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/csrss/csrsrv/init.c [iso-8859-1] Wed Aug 3 06:18:42 2011 @@ -482,12 +482,22 @@ return Status; } + +VOID +WINAPI +BasepFakeStaticServerData(VOID); + +NTSTATUS +NTAPI +CsrSrvCreateSharedSection(IN PCHAR ParameterValue); + /********************************************************************** * CsrpCreateHeap/3 */ static NTSTATUS CsrpCreateHeap (int argc, char ** argv, char ** envp) { + NTSTATUS Status; DPRINT("CSR: %s called\n", __FUNCTION__); CsrssApiHeap = RtlCreateHeap(HEAP_GROWABLE, @@ -500,6 +510,12 @@ { return STATUS_UNSUCCESSFUL; } + + + Status = CsrSrvCreateSharedSection(""); + ASSERT(Status == STATUS_SUCCESS); + + BasepFakeStaticServerData(); return STATUS_SUCCESS; }
13 years, 3 months
1
0
0
0
[ion] 53043: [CSRSRV]: Try to see why it appears some processes don't have a handle in their CSR_PROCESS_DATA....
by ion@svn.reactos.org
Author: ion Date: Wed Aug 3 05:58:58 2011 New Revision: 53043 URL:
http://svn.reactos.org/svn/reactos?rev=53043&view=rev
Log: [CSRSRV]: Try to see why it appears some processes don't have a handle in their CSR_PROCESS_DATA.... Modified: trunk/reactos/subsystems/win32/csrss/csrsrv/api/process.c trunk/reactos/subsystems/win32/csrss/csrsrv/api/wapi.c Modified: trunk/reactos/subsystems/win32/csrss/csrsrv/api/process.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/csrss/csr…
============================================================================== --- trunk/reactos/subsystems/win32/csrss/csrsrv/api/process.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/csrss/csrsrv/api/process.c [iso-8859-1] Wed Aug 3 05:58:58 2011 @@ -105,6 +105,7 @@ PROCESS_ALL_ACCESS, &ObjectAttributes, &ClientId); + DPRINT1("CSR PRocess: %p Handle: %p\n", pProcessData, pProcessData->Process); if (!NT_SUCCESS(Status)) { ProcessData[hash] = pProcessData->next; Modified: trunk/reactos/subsystems/win32/csrss/csrsrv/api/wapi.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/csrss/csr…
============================================================================== --- trunk/reactos/subsystems/win32/csrss/csrsrv/api/wapi.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/csrss/csrsrv/api/wapi.c [iso-8859-1] Wed Aug 3 05:58:58 2011 @@ -282,6 +282,7 @@ if (CsrProcess) { /* Map the sectio into this process */ + DPRINT1("CSR Process Handle: %p. CSR Process: %p\n", CsrProcess->Process, CsrProcess); Status = NtMapViewOfSection(CsrSrvSharedSection, CsrProcess->Process, &CsrSrvSharedSectionBase, @@ -437,6 +438,24 @@ DPRINT1("Unable to allocate or find data for process 0x%x\n", Request->ClientId.UniqueProcess); } + } + + if (ProcessData->Process == NULL) + { + OBJECT_ATTRIBUTES ObjectAttributes; + + InitializeObjectAttributes(&ObjectAttributes, + NULL, + 0, + NULL, + NULL); + DPRINT1("WARNING: CSR PROCESS WITH NO CSR PROCESS HANDLE???\n"); + ClientId.UniqueThread = 0; + Status = NtOpenProcess(&ProcessData->Process, + PROCESS_ALL_ACCESS, + &ObjectAttributes, + &Request->ClientId); + DPRINT1("Status: %lx. Handle: %lx\n", Status, ProcessData->Process); } if (ProcessData)
13 years, 3 months
1
0
0
0
[ion] 53042: [CSRSS]: Fix broken logic.
by ion@svn.reactos.org
Author: ion Date: Wed Aug 3 03:57:30 2011 New Revision: 53042 URL:
http://svn.reactos.org/svn/reactos?rev=53042&view=rev
Log: [CSRSS]: Fix broken logic. Modified: trunk/reactos/ntoskrnl/lpc/complete.c trunk/reactos/subsystems/win32/csrss/csrsrv/api/wapi.c Modified: trunk/reactos/ntoskrnl/lpc/complete.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/lpc/complete.c?re…
============================================================================== --- trunk/reactos/ntoskrnl/lpc/complete.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/lpc/complete.c [iso-8859-1] Wed Aug 3 03:57:30 2011 @@ -148,7 +148,11 @@ RtlCopyMemory(ConnectMessage + 1, ReplyMessage + 1, ConnectionInfoLength); /* At this point, if the caller refused the connection, go to cleanup */ - if (!AcceptConnection) goto Cleanup; + if (!AcceptConnection) + { + DPRINT1("LPC connection was refused\n"); + goto Cleanup; + } /* Otherwise, create the actual port */ Status = ObCreateObject(PreviousMode, @@ -222,6 +226,11 @@ { /* Otherwise, quit */ ObDereferenceObject(ServerPort); + DPRINT1("Client section mapping failed: %lx\n", Status); + DPRINT1("View base, offset, size: %lx %lx %lx\n", + ServerPort->ClientSectionBase, + ConnectMessage->ClientView.ViewSize, + SectionOffset); goto Cleanup; } } Modified: trunk/reactos/subsystems/win32/csrss/csrsrv/api/wapi.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/csrss/csr…
============================================================================== --- trunk/reactos/subsystems/win32/csrss/csrsrv/api/wapi.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/csrss/csrsrv/api/wapi.c [iso-8859-1] Wed Aug 3 03:57:30 2011 @@ -437,11 +437,20 @@ DPRINT1("Unable to allocate or find data for process 0x%x\n", Request->ClientId.UniqueProcess); } + } + + if (ProcessData) + { + /* Attach the Shared Section */ + Status = CsrSrvAttachSharedSection(ProcessData, ConnectInfo); + if (NT_SUCCESS(Status)) + { + DPRINT1("Connection ok\n"); + AllowConnection = TRUE; + } else { - /* Attach the Shared Section */ - Status = CsrSrvAttachSharedSection(ProcessData, ConnectInfo); - if (NT_SUCCESS(Status)) AllowConnection = TRUE; + DPRINT1("Shared section map failed: %lx\n", Status); } }
13 years, 3 months
1
0
0
0
← Newer
1
...
44
45
46
47
48
49
50
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
Results per page:
10
25
50
100
200