ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
February 2012
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
22 participants
577 discussions
Start a n
N
ew thread
[tkreuzer] 55415: [RTL] - Fix RtlLengthSecurityDescriptor - Implement amd64 version of Implement RtlInitializeContext - Add unwind info to amd64 debug asm functions - Fix 64 bit HEAP_COMMON_ENTRY s...
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Sat Feb 4 18:35:56 2012 New Revision: 55415 URL:
http://svn.reactos.org/svn/reactos?rev=55415&view=rev
Log: [RTL] - Fix RtlLengthSecurityDescriptor - Implement amd64 version of Implement RtlInitializeContext - Add unwind info to amd64 debug asm functions - Fix 64 bit HEAP_COMMON_ENTRY structure The resulting version doesn't exactly match the original windows one, but its compatible, as every field, except the dummy fields - which are omitted - is at its correct position. Modified: trunk/reactos/lib/rtl/amd64/debug_asm.S trunk/reactos/lib/rtl/amd64/stubs.c trunk/reactos/lib/rtl/heap.h Modified: trunk/reactos/lib/rtl/amd64/debug_asm.S URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/amd64/debug_asm.S?…
============================================================================== --- trunk/reactos/lib/rtl/amd64/debug_asm.S [iso-8859-1] (original) +++ trunk/reactos/lib/rtl/amd64/debug_asm.S [iso-8859-1] Sat Feb 4 18:35:56 2012 @@ -22,20 +22,31 @@ .code64 -DbgBreakPointNoBugCheck: +.PROC DbgBreakPointNoBugCheck + .endprolog int 3 ret +.ENDP -DbgBreakPoint: DbgUserBreakPoint: +.PROC DbgBreakPoint + .endprolog int 3 ret +.ENDP -DbgBreakPointWithStatus: +.PROC DbgBreakPointWithStatus + .endprolog mov eax, ecx -RtlpBreakWithStatusInstruction: int 3 ret +.ENDP + +.PROC RtlpBreakWithStatusInstruction + .endprolog + int 3 + ret +.ENDP DebugService2: ret Modified: trunk/reactos/lib/rtl/amd64/stubs.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/amd64/stubs.c?rev=…
============================================================================== --- trunk/reactos/lib/rtl/amd64/stubs.c [iso-8859-1] (original) +++ trunk/reactos/lib/rtl/amd64/stubs.c [iso-8859-1] Sat Feb 4 18:35:56 2012 @@ -11,6 +11,7 @@ #include <rtl.h> #define NDEBUG #include <debug.h> +#include "amd64/ketypes.h" /* PUBLIC FUNCTIONS **********************************************************/ @@ -23,9 +24,60 @@ OUT PCONTEXT ThreadContext, IN PVOID ThreadStartParam OPTIONAL, IN PTHREAD_START_ROUTINE ThreadStartAddress, - IN PINITIAL_TEB InitialTeb) + IN PINITIAL_TEB StackBase) { - UNIMPLEMENTED; + + ThreadContext->Rax = 0; + ThreadContext->Rbx = 0; + ThreadContext->Rcx = (ULONG64)ThreadStartParam; + ThreadContext->Rdx = 0; + ThreadContext->Rsi = 0; + ThreadContext->Rdi = 0; + ThreadContext->Rbp = 0; + ThreadContext->R8 = 0; + ThreadContext->R9 = 0; + ThreadContext->R10 = 0; + ThreadContext->R11 = 0; + ThreadContext->R12 = 0; + + /* Set the Selectors */ + if ((LONG64)ThreadStartAddress < 0) + { + /* Initialize kernel mode segments */ + ThreadContext->SegCs = KGDT64_R0_CODE; + ThreadContext->SegDs = KGDT64_R3_DATA; + ThreadContext->SegEs = KGDT64_R3_DATA; + ThreadContext->SegFs = KGDT64_R3_CMTEB; + ThreadContext->SegGs = KGDT64_R3_DATA; + ThreadContext->SegSs = KGDT64_R0_DATA; + } + else + { + /* Initialize user mode segments */ + ThreadContext->SegCs = KGDT64_R3_CODE | RPL_MASK; + ThreadContext->SegDs = KGDT64_R3_DATA | RPL_MASK; + ThreadContext->SegEs = KGDT64_R3_DATA | RPL_MASK; + ThreadContext->SegFs = KGDT64_R3_CMTEB | RPL_MASK; + ThreadContext->SegGs = KGDT64_R3_DATA | RPL_MASK; + ThreadContext->SegSs = KGDT64_R3_DATA | RPL_MASK; + } + + /* Enable Interrupts */ + ThreadContext->EFlags = EFLAGS_INTERRUPT_MASK; + + /* Settings passed */ + ThreadContext->Rip = (ULONG64)ThreadStartAddress; + ThreadContext->Rsp = (ULONG64)StackBase - 6 * sizeof(PVOID); + + /* Align stack by 16 and substract 8 (unaligned on function entry) */ + ThreadContext->Rsp &= ~15; + ThreadContext->Rsp -= 8; + + /* Only the basic Context is initialized */ + ThreadContext->ContextFlags = CONTEXT_CONTROL | + CONTEXT_INTEGER | + CONTEXT_SEGMENTS; + return; } Modified: trunk/reactos/lib/rtl/heap.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/heap.h?rev=55415&r…
============================================================================== --- trunk/reactos/lib/rtl/heap.h [iso-8859-1] (original) +++ trunk/reactos/lib/rtl/heap.h [iso-8859-1] Sat Feb 4 18:35:56 2012 @@ -78,6 +78,9 @@ /* Heap structures */ struct _HEAP_COMMON_ENTRY { +#ifdef _M_AMD64 + PVOID PreviousBlockPrivateData; +#endif union { struct @@ -88,7 +91,11 @@ }; struct { +#ifndef _M_AMD64 PVOID SubSegmentCode; +#else + ULONG SubSegmentCodeDummy; +#endif USHORT PreviousSize; union {
12 years, 10 months
1
0
0
0
[tkreuzer] 55414: [NTDLL] - Implement amd64 version of LdrInitializeThunk and KiUserApcDispatcher - Export ExpInterlockedPopEntrySList* on amd64, too - Fix some 64 bit issues
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Sat Feb 4 18:25:25 2012 New Revision: 55414 URL:
http://svn.reactos.org/svn/reactos?rev=55414&view=rev
Log: [NTDLL] - Implement amd64 version of LdrInitializeThunk and KiUserApcDispatcher - Export ExpInterlockedPopEntrySList* on amd64, too - Fix some 64 bit issues Added: trunk/reactos/dll/ntdll/dispatch/amd64/dispatch.S (with props) Modified: trunk/reactos/dll/ntdll/CMakeLists.txt trunk/reactos/dll/ntdll/def/ntdll.spec trunk/reactos/dll/ntdll/ldr/ldrinit.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 Feb 4 18:25:25 2012 @@ -27,7 +27,7 @@ if(ARCH MATCHES i386) list(APPEND SOURCE dispatch/i386/dispatch.S) elseif(ARCH MATCHES amd64) - list(APPEND SOURCE dispatch/amd64/stubs.c) + list(APPEND SOURCE dispatch/amd64/dispatch.S) elseif(ARCH MATCHES arm) list(APPEND SOURCE dispatch/arm/stubs_asm.s) else() Modified: trunk/reactos/dll/ntdll/def/ntdll.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/ntdll/def/ntdll.spec?r…
============================================================================== --- trunk/reactos/dll/ntdll/def/ntdll.spec [iso-8859-1] (original) +++ trunk/reactos/dll/ntdll/def/ntdll.spec [iso-8859-1] Sat Feb 4 18:25:25 2012 @@ -60,9 +60,9 @@ @ stdcall -arch=i386 KiFastSystemCall() @ stdcall -arch=i386 KiFastSystemCallRet() @ stdcall -arch=i386 KiIntSystemCall() -@ stdcall -arch=i386 ExpInterlockedPopEntrySListEnd() -@ stdcall -arch=i386 ExpInterlockedPopEntrySListFault() -@ stdcall -arch=i386 ExpInterlockedPopEntrySListResume() +@ stdcall -arch=i386,x86_64 ExpInterlockedPopEntrySListEnd() +@ stdcall -arch=i386,x86_64 ExpInterlockedPopEntrySListFault() +@ stdcall -arch=i386,x86_64 ExpInterlockedPopEntrySListResume() @ stdcall KiRaiseUserExceptionDispatcher() @ stdcall KiUserApcDispatcher(ptr ptr ptr ptr) @ stdcall KiUserCallbackDispatcher(ptr ptr long) ; CHECKME Added: trunk/reactos/dll/ntdll/dispatch/amd64/dispatch.S URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/ntdll/dispatch/amd64/d…
============================================================================== --- trunk/reactos/dll/ntdll/dispatch/amd64/dispatch.S (added) +++ trunk/reactos/dll/ntdll/dispatch/amd64/dispatch.S [iso-8859-1] Sat Feb 4 18:25:25 2012 @@ -1,0 +1,75 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS kernel + * FILE: ntdll/dispatch/amd64/dispatch.S + * PURPOSE: Usermode dispatcher stubs + * + * PROGRAMMER: Timo kreuzer (timo.kreuzer(a)reactos.org) + */ + +/* INCLUDES ******************************************************************/ + +#include <asm.inc> +#include <ksamd64.inc> + +EXTERN NtContinue:PROC +EXTERN LdrpInit:PROC + +.code + +PUBLIC LdrInitializeThunk +.PROC LdrInitializeThunk + mov rbp, 0 + .setframe rbp, 0 + .endprolog + + /* First parameter is the APC context */ + mov rcx, r9 + jmp LdrpInit + +.ENDP + +PUBLIC KiUserApcDispatcher +.PROC KiUserApcDispatcher + .endprolog + /* We enter with a 16 byte aligned stack */ + + mov rcx, [rsp + CONTEXT_P1Home] /* NormalContext */ + mov rdx, [rsp + CONTEXT_P2Home] /* SystemArgument1 */ + mov r8, [rsp + CONTEXT_P3Home] /* SystemArgument2 */ + lea r9, [rsp] /* Context */ + call qword ptr [rsp + CONTEXT_P4Home] /* NormalRoutine */ + + /* NtContinue(Context, TRUE); */ + lea rcx, [rsp] + mov dl, 1 + call NtContinue + + nop + int 3 +.ENDP + + +PUBLIC KiRaiseUserExceptionDispatcher +.PROC KiRaiseUserExceptionDispatcher + .endprolog + int 3 + +.ENDP + +PUBLIC KiUserCallbackDispatcher +.PROC KiUserCallbackDispatcher + .endprolog + int 3 + +.ENDP + +PUBLIC KiUserExceptionDispatcher +.PROC KiUserExceptionDispatcher + .endprolog + int 3 + +.ENDP + +END + Propchange: trunk/reactos/dll/ntdll/dispatch/amd64/dispatch.S ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/dll/ntdll/ldr/ldrinit.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/ntdll/ldr/ldrinit.c?re…
============================================================================== --- trunk/reactos/dll/ntdll/ldr/ldrinit.c [iso-8859-1] (original) +++ trunk/reactos/dll/ntdll/ldr/ldrinit.c [iso-8859-1] Sat Feb 4 18:25:25 2012 @@ -124,7 +124,7 @@ /* Setup the object attributes */ InitializeObjectAttributes(&ObjectAttributes, - Wow64 ? + Wow64 ? &Wow64OptionsString : &ImageExecOptionsString, OBJ_CASE_INSENSITIVE, NULL, @@ -441,7 +441,7 @@ { PULONG_PTR Cookie; LARGE_INTEGER Counter; - ULONG NewCookie; + ULONG_PTR NewCookie; /* Fetch address of the cookie */ Cookie = LdrpFetchAddressOfSecurityCookie(LdrEntry->DllBase, LdrEntry->SizeOfImage); @@ -536,7 +536,7 @@ EntryPoint = LdrEntry->EntryPoint; /* Check if we are ready to call it */ - if ((EntryPoint) && + if ((EntryPoint) && (LdrEntry->Flags & LDRP_PROCESS_ATTACH_CALLED) && (LdrEntry->Flags & LDRP_IMAGE_DLL)) { @@ -939,7 +939,7 @@ EntryPoint = LdrEntry->EntryPoint; /* Check if we are ready to call it */ - if (EntryPoint && + if (EntryPoint && (LdrEntry->Flags & LDRP_PROCESS_ATTACH_CALLED) && LdrEntry->Flags) { @@ -1212,7 +1212,7 @@ PTEB Teb = NtCurrentTeb(); PLIST_ENTRY NextEntry, ListHead; PLDRP_TLS_DATA TlsData; - ULONG TlsDataSize; + SIZE_T TlsDataSize; PVOID *TlsVector; /* Check if we have any entries */ @@ -1236,7 +1236,7 @@ NextEntry = NextEntry->Flink; /* Allocate this vector */ - TlsDataSize = TlsData->TlsDirectory.EndAddressOfRawData - + TlsDataSize = TlsData->TlsDirectory.EndAddressOfRawData - TlsData->TlsDirectory.StartAddressOfRawData; TlsVector[TlsData->TlsDirectory.Characteristics] = RtlAllocateHeap(RtlGetProcessHeap(), 0,
12 years, 10 months
1
0
0
0
[tkreuzer] 55413: [XDK] - fix ASSERTs in amd64 inline functions - fix definition of KWAIT_BLOCK These fixes are not critical, so I don't update wdm.h to avoid additional recompilation
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Sat Feb 4 17:29:34 2012 New Revision: 55413 URL:
http://svn.reactos.org/svn/reactos?rev=55413&view=rev
Log: [XDK] - fix ASSERTs in amd64 inline functions - fix definition of KWAIT_BLOCK These fixes are not critical, so I don't update wdm.h to avoid additional recompilation Modified: trunk/reactos/include/xdk/amd64/ke.h trunk/reactos/include/xdk/ketypes.h Modified: trunk/reactos/include/xdk/amd64/ke.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/xdk/amd64/ke.h?rev…
============================================================================== --- trunk/reactos/include/xdk/amd64/ke.h [iso-8859-1] (original) +++ trunk/reactos/include/xdk/amd64/ke.h [iso-8859-1] Sat Feb 4 17:29:34 2012 @@ -73,7 +73,7 @@ VOID KeLowerIrql(IN KIRQL NewIrql) { - //ASSERT(KeGetCurrentIrql() >= NewIrql); + ASSERT((KIRQL)__readcr8() >= NewIrql); __writecr8(NewIrql); } @@ -84,7 +84,7 @@ KIRQL OldIrql; OldIrql = (KIRQL)__readcr8(); - //ASSERT(OldIrql <= NewIrql); + ASSERT(OldIrql <= NewIrql); __writecr8(NewIrql); return OldIrql; } Modified: trunk/reactos/include/xdk/ketypes.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/xdk/ketypes.h?rev=…
============================================================================== --- trunk/reactos/include/xdk/ketypes.h [iso-8859-1] (original) +++ trunk/reactos/include/xdk/ketypes.h [iso-8859-1] Sat Feb 4 17:29:34 2012 @@ -463,7 +463,11 @@ struct _KWAIT_BLOCK *NextWaitBlock; USHORT WaitKey; UCHAR WaitType; +#if (NTDDI_VERSION >= NTDDI_LONGHORN) volatile UCHAR BlockState; +#else + UCHAR SpareByte; +#endif #if defined(_WIN64) LONG SpareLong; #endif
12 years, 10 months
1
0
0
0
[janderwald] 55412: [USBOHCI] - Revert 55411
by janderwald@svn.reactos.org
Author: janderwald Date: Sat Feb 4 15:04:27 2012 New Revision: 55412 URL:
http://svn.reactos.org/svn/reactos?rev=55412&view=rev
Log: [USBOHCI] - Revert 55411 Modified: branches/usb-bringup-trunk/drivers/usb/usbohci/hcd_controller.cpp Modified: branches/usb-bringup-trunk/drivers/usb/usbohci/hcd_controller.cpp URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup-trunk/drivers/usb/u…
============================================================================== --- branches/usb-bringup-trunk/drivers/usb/usbohci/hcd_controller.cpp [iso-8859-1] (original) +++ branches/usb-bringup-trunk/drivers/usb/usbohci/hcd_controller.cpp [iso-8859-1] Sat Feb 4 15:04:27 2012 @@ -531,19 +531,7 @@ // stop lower device // Status = SyncForwardIrp(m_NextDeviceObject, Irp); - if (NT_SUCCESS(Status)) - { - // - // detach device - // - IoDetachDevice(m_NextDeviceObject); - IoDeleteDevice(DeviceObject); - } - - } - - - + } break; } case IRP_MN_QUERY_REMOVE_DEVICE:
12 years, 10 months
1
0
0
0
[janderwald] 55411: [HIDCLASS] - Remove PDO from pdo list when it is destroyed - Handle IRP_MN_QUERY_REMOVE_DEVICE, IRP_MN_CANCEL_STOP_DEVICE, IRP_MN_QUERY_STOP_DEVICE, IRP_MN_CANCEL_REMOVE_DEVICE ...
by janderwald@svn.reactos.org
Author: janderwald Date: Sat Feb 4 14:10:18 2012 New Revision: 55411 URL:
http://svn.reactos.org/svn/reactos?rev=55411&view=rev
Log: [HIDCLASS] - Remove PDO from pdo list when it is destroyed - Handle IRP_MN_QUERY_REMOVE_DEVICE, IRP_MN_CANCEL_STOP_DEVICE, IRP_MN_QUERY_STOP_DEVICE, IRP_MN_CANCEL_REMOVE_DEVICE [HIDUSB] - Add driver unload routine [MOUHID] - Wait for completion of pending irp [USBHUB] - Remove pdo from PDO list - Handle IRP_MN_QUERY_DEVICE_RELATIONS - Add stub driver unload routine [USBOHCI] - handle IRP_MN_REMOVE for FDO - remove ASSERT Modified: branches/usb-bringup-trunk/drivers/hid/hidclass/pdo.c branches/usb-bringup-trunk/drivers/hid/hidclass/precomp.h branches/usb-bringup-trunk/drivers/hid/hidusb/hidusb.c branches/usb-bringup-trunk/drivers/hid/mouhid/mouhid.c branches/usb-bringup-trunk/drivers/usb/usbhub_new/pdo.c branches/usb-bringup-trunk/drivers/usb/usbhub_new/usbhub.c branches/usb-bringup-trunk/drivers/usb/usbohci/hcd_controller.cpp branches/usb-bringup-trunk/drivers/usb/usbohci/usb_request.cpp Modified: branches/usb-bringup-trunk/drivers/hid/hidclass/pdo.c URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup-trunk/drivers/hid/h…
============================================================================== --- branches/usb-bringup-trunk/drivers/hid/hidclass/pdo.c [iso-8859-1] (original) +++ branches/usb-bringup-trunk/drivers/hid/hidclass/pdo.c [iso-8859-1] Sat Feb 4 14:10:18 2012 @@ -344,7 +344,6 @@ return STATUS_SUCCESS; } - NTSTATUS HidClassPDO_PnP( IN PDEVICE_OBJECT DeviceObject, @@ -355,6 +354,7 @@ NTSTATUS Status; PPNP_BUS_INFORMATION BusInformation; PDEVICE_RELATIONS DeviceRelation; + ULONG Index; // // get device extension @@ -532,6 +532,21 @@ if (PDODeviceExtension->DeviceInterface.Length != 0) IoSetDeviceInterfaceState(&PDODeviceExtension->DeviceInterface, FALSE); + // + // remove us from the fdo's pdo list + // + for(Index = 0; Index < PDODeviceExtension->FDODeviceExtension->DeviceRelations->Count; Index++) + { + if (PDODeviceExtension->FDODeviceExtension->DeviceRelations->Objects[Index] == DeviceObject) + { + // + // remove us + // + PDODeviceExtension->FDODeviceExtension->DeviceRelations->Objects[Index] = NULL; + break; + } + } + /* Complete the IRP */ Irp->IoStatus.Status = STATUS_SUCCESS; IoCompleteRequest(Irp, IO_NO_INCREMENT); @@ -550,6 +565,17 @@ // do nothing // Status = Irp->IoStatus.Status; + break; + } + case IRP_MN_QUERY_REMOVE_DEVICE: + case IRP_MN_CANCEL_STOP_DEVICE: + case IRP_MN_QUERY_STOP_DEVICE: + case IRP_MN_CANCEL_REMOVE_DEVICE: + { + // + // no/op + // + Status = STATUS_SUCCESS; break; } default: @@ -657,6 +683,7 @@ PDODeviceExtension->Common.HidDeviceExtension.NextDeviceObject = FDODeviceExtension->Common.HidDeviceExtension.NextDeviceObject; PDODeviceExtension->Common.HidDeviceExtension.PhysicalDeviceObject = FDODeviceExtension->Common.HidDeviceExtension.PhysicalDeviceObject; PDODeviceExtension->Common.IsFDO = FALSE; + PDODeviceExtension->FDODeviceExtension = FDODeviceExtension; PDODeviceExtension->FDODeviceObject = DeviceObject; PDODeviceExtension->Common.DriverExtension = FDODeviceExtension->Common.DriverExtension; PDODeviceExtension->CollectionNumber = FDODeviceExtension->Common.DeviceDescription.CollectionDesc[Index].CollectionNumber; Modified: branches/usb-bringup-trunk/drivers/hid/hidclass/precomp.h URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup-trunk/drivers/hid/h…
============================================================================== --- branches/usb-bringup-trunk/drivers/hid/hidclass/precomp.h [iso-8859-1] (original) +++ branches/usb-bringup-trunk/drivers/hid/hidclass/precomp.h [iso-8859-1] Sat Feb 4 14:10:18 2012 @@ -107,6 +107,11 @@ // PDEVICE_OBJECT FDODeviceObject; + // + // fdo device extension + // + PHIDCLASS_FDO_EXTENSION FDODeviceExtension; + }HIDCLASS_PDO_DEVICE_EXTENSION, *PHIDCLASS_PDO_DEVICE_EXTENSION; typedef struct __HIDCLASS_FILEOP_CONTEXT__ Modified: branches/usb-bringup-trunk/drivers/hid/hidusb/hidusb.c URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup-trunk/drivers/hid/h…
============================================================================== --- branches/usb-bringup-trunk/drivers/hid/hidusb/hidusb.c [iso-8859-1] (original) +++ branches/usb-bringup-trunk/drivers/hid/hidusb/hidusb.c [iso-8859-1] Sat Feb 4 14:10:18 2012 @@ -1764,6 +1764,15 @@ return STATUS_SUCCESS; } +VOID +NTAPI +Hid_Unload( + IN PDRIVER_OBJECT DriverObject) +{ + UNIMPLEMENTED +} + + NTSTATUS NTAPI DriverEntry( @@ -1783,6 +1792,7 @@ DriverObject->MajorFunction[IRP_MJ_SYSTEM_CONTROL] = HidSystemControl; DriverObject->MajorFunction[IRP_MJ_PNP] = HidPnp; DriverObject->DriverExtension->AddDevice = HidAddDevice; + DriverObject->DriverUnload = Hid_Unload; // // prepare registration info Modified: branches/usb-bringup-trunk/drivers/hid/mouhid/mouhid.c URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup-trunk/drivers/hid/m…
============================================================================== --- branches/usb-bringup-trunk/drivers/hid/mouhid/mouhid.c [iso-8859-1] (original) +++ branches/usb-bringup-trunk/drivers/hid/mouhid/mouhid.c [iso-8859-1] Sat Feb 4 14:10:18 2012 @@ -807,6 +807,9 @@ { /* FIXME synchronization */ + /* request stop */ + DeviceExtension->StopReadReport = TRUE; + /* cancel irp */ IoCancelIrp(DeviceExtension->Irp); @@ -819,9 +822,19 @@ /* dispatch to lower device */ Status = IoCallDriver(DeviceExtension->NextDeviceObject, Irp); + /* wait for completion of stop event */ + KeWaitForSingleObject(&DeviceExtension->ReadCompletionEvent, Executive, KernelMode, FALSE, NULL); + + /* free irp */ IoFreeIrp(DeviceExtension->Irp); + + /* detach device */ IoDetachDevice(DeviceExtension->NextDeviceObject); + + /* delete device */ IoDeleteDevice(DeviceObject); + + /* done */ return Status; } else if (IoStack->MinorFunction == IRP_MN_START_DEVICE) Modified: branches/usb-bringup-trunk/drivers/usb/usbhub_new/pdo.c URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup-trunk/drivers/usb/u…
============================================================================== --- branches/usb-bringup-trunk/drivers/usb/usbhub_new/pdo.c [iso-8859-1] (original) +++ branches/usb-bringup-trunk/drivers/usb/usbhub_new/pdo.c [iso-8859-1] Sat Feb 4 14:10:18 2012 @@ -485,6 +485,8 @@ PIO_STACK_LOCATION Stack; ULONG_PTR Information = 0; PHUB_CHILDDEVICE_EXTENSION UsbChildExtension; + ULONG Index; + PDEVICE_RELATIONS DeviceRelation; UsbChildExtension = (PHUB_CHILDDEVICE_EXTENSION)DeviceObject->DeviceExtension; Stack = IoGetCurrentIrpStackLocation(Irp); @@ -576,7 +578,21 @@ DPRINT1("IRP_MJ_PNP / IRP_MN_REMOVE_DEVICE\n"); /* Remove the device */ - HubInterface->RemoveUsbDevice(HubDeviceExtension->UsbDInterface.BusContext, UsbChildExtension->UsbDeviceHandle, 0); + Status = HubInterface->RemoveUsbDevice(HubDeviceExtension->UsbDInterface.BusContext, UsbChildExtension->UsbDeviceHandle, 0); + + /* FIXME handle error */ + ASSERT(Status == STATUS_SUCCESS); + + /* remove us from pdo list */ + for(Index = 0; Index < USB_MAXCHILDREN; Index++) + { + if (HubDeviceExtension->ChildDeviceObject[Index] == DeviceObject) + { + /* remove us */ + HubDeviceExtension->ChildDeviceObject[Index] = NULL; + break; + } + } /* Complete the IRP */ Irp->IoStatus.Status = STATUS_SUCCESS; @@ -585,6 +601,35 @@ /* Delete the device object */ IoDeleteDevice(DeviceObject); return STATUS_SUCCESS; + } + case IRP_MN_QUERY_DEVICE_RELATIONS: + { + /* only target relations are supported */ + if (Stack->Parameters.QueryDeviceRelations.Type != TargetDeviceRelation) + { + /* not supported */ + Status = Irp->IoStatus.Status; + break; + } + + /* allocate device relations */ + DeviceRelation = (PDEVICE_RELATIONS)ExAllocatePool(NonPagedPool, sizeof(DEVICE_RELATIONS)); + if (!DeviceRelation) + { + /* no memory */ + Status = STATUS_INSUFFICIENT_RESOURCES; + break; + } + + /* init device relation */ + DeviceRelation->Count = 1; + DeviceRelation->Objects[0] = DeviceObject; + ObReferenceObject(DeviceRelation->Objects[0]); + + /* store result */ + Irp->IoStatus.Information = (ULONG_PTR)DeviceRelation; + Status = STATUS_SUCCESS; + break; } case IRP_MN_QUERY_STOP_DEVICE: case IRP_MN_QUERY_REMOVE_DEVICE: Modified: branches/usb-bringup-trunk/drivers/usb/usbhub_new/usbhub.c URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup-trunk/drivers/usb/u…
============================================================================== --- branches/usb-bringup-trunk/drivers/usb/usbhub_new/usbhub.c [iso-8859-1] (original) +++ branches/usb-bringup-trunk/drivers/usb/usbhub_new/usbhub.c [iso-8859-1] Sat Feb 4 14:10:18 2012 @@ -183,12 +183,23 @@ return STATUS_NOT_SUPPORTED; } +VOID +NTAPI +USBHUB_Unload( + IN PDRIVER_OBJECT DriverObject) +{ + UNIMPLEMENTED +} + + NTSTATUS NTAPI DriverEntry( IN PDRIVER_OBJECT DriverObject, IN PUNICODE_STRING RegistryPath) { DriverObject->DriverExtension->AddDevice = USBHUB_AddDevice; + DriverObject->DriverUnload = USBHUB_Unload; + DPRINT1("USBHUB: DriverEntry\n"); DriverObject->MajorFunction[IRP_MJ_CREATE] = USBHUB_Create; Modified: branches/usb-bringup-trunk/drivers/usb/usbohci/hcd_controller.cpp URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup-trunk/drivers/usb/u…
============================================================================== --- branches/usb-bringup-trunk/drivers/usb/usbohci/hcd_controller.cpp [iso-8859-1] (original) +++ branches/usb-bringup-trunk/drivers/usb/usbohci/hcd_controller.cpp [iso-8859-1] Sat Feb 4 14:10:18 2012 @@ -531,7 +531,19 @@ // stop lower device // Status = SyncForwardIrp(m_NextDeviceObject, Irp); - } + if (NT_SUCCESS(Status)) + { + // + // detach device + // + IoDetachDevice(m_NextDeviceObject); + IoDeleteDevice(DeviceObject); + } + + } + + + break; } case IRP_MN_QUERY_REMOVE_DEVICE: Modified: branches/usb-bringup-trunk/drivers/usb/usbohci/usb_request.cpp URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup-trunk/drivers/usb/u…
============================================================================== --- branches/usb-bringup-trunk/drivers/usb/usbohci/usb_request.cpp [iso-8859-1] (original) +++ branches/usb-bringup-trunk/drivers/usb/usbohci/usb_request.cpp [iso-8859-1] Sat Feb 4 14:10:18 2012 @@ -1672,11 +1672,6 @@ while(TransferDescriptor) { - // - // the descriptor must have been processed - // - ASSERT(OHCI_TD_GET_CONDITION_CODE(TransferDescriptor->Flags) != OHCI_TD_CONDITION_NOT_ACCESSED); - // // get condition code //
12 years, 10 months
1
0
0
0
[tfaber] 55410: [RTL] - Work around Wine's misuse of critical section debug flags. Hopefully fixes KVM
by tfaber@svn.reactos.org
Author: tfaber Date: Sat Feb 4 13:47:16 2012 New Revision: 55410 URL:
http://svn.reactos.org/svn/reactos?rev=55410&view=rev
Log: [RTL] - Work around Wine's misuse of critical section debug flags. Hopefully fixes KVM Modified: trunk/reactos/lib/rtl/critical.c Modified: trunk/reactos/lib/rtl/critical.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/critical.c?rev=554…
============================================================================== --- trunk/reactos/lib/rtl/critical.c [iso-8859-1] (original) +++ trunk/reactos/lib/rtl/critical.c [iso-8859-1] Sat Feb 4 13:47:16 2012 @@ -200,7 +200,7 @@ DPRINT1("Signaling Failed for: %p, %p, 0x%08lx\n", CriticalSection, CriticalSection->LockSemaphore, - Status); + Status); RtlRaiseStatus(Status); } } @@ -316,7 +316,7 @@ NtCurrentTeb()->ClientId.UniqueProcess); RtlpDebugInfoFreeList[EntryId] = FALSE; - } else { + } else if (!DebugInfo->Flags) { /* It's a dynamic one, so free from the heap */ DPRINT("Freeing from Heap: %p inside Process: %p\n", @@ -324,6 +324,13 @@ NtCurrentTeb()->ClientId.UniqueProcess); RtlFreeHeap(NtCurrentPeb()->ProcessHeap, 0, DebugInfo); + } else { + + /* Wine stores a section name pointer in the Flags member */ + DPRINT("Assuming static: %p inside Process: %p\n", + DebugInfo, + NtCurrentTeb()->ClientId.UniqueProcess); + } } @@ -365,7 +372,9 @@ { /* Remove it from the list */ RemoveEntryList(&CriticalSection->DebugInfo->ProcessLocksList); +#if 0 /* We need to preserve Flags for RtlpFreeDebugInfo */ RtlZeroMemory(CriticalSection->DebugInfo, sizeof(RTL_CRITICAL_SECTION_DEBUG)); +#endif } /* Unprotect */ @@ -546,6 +555,7 @@ CritcalSectionDebugData->ContentionCount = 0; CritcalSectionDebugData->EntryCount = 0; CritcalSectionDebugData->CriticalSection = CriticalSection; + CritcalSectionDebugData->Flags = 0; CriticalSection->DebugInfo = CritcalSectionDebugData; /*
12 years, 10 months
1
0
0
0
[tkreuzer] 55409: [ASM] Modify syscall stub macros to be compatible with the new amd64 stubs
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Sat Feb 4 12:29:24 2012 New Revision: 55409 URL:
http://svn.reactos.org/svn/reactos?rev=55409&view=rev
Log: [ASM] Modify syscall stub macros to be compatible with the new amd64 stubs Modified: trunk/reactos/include/asm/syscalls.inc Modified: trunk/reactos/include/asm/syscalls.inc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/asm/syscalls.inc?r…
============================================================================== --- trunk/reactos/include/asm/syscalls.inc [iso-8859-1] (original) +++ trunk/reactos/include/asm/syscalls.inc [iso-8859-1] Sat Feb 4 12:29:24 2012 @@ -2,14 +2,16 @@ #ifdef _M_IX86 #define KUSER_SHARED_SYSCALL HEX(7ffe0300) #define KGDT_R0_CODE 8 -MACRO(STUBCODE_U, SyscallId, StackBytes) +MACRO(STUBCODE_U, Name, SyscallId, ArgCount) + StackBytes = 4 * ArgCount FPO 0, 0, 0, 0, 0, FRAME_FPO mov eax, SyscallId mov ecx, KUSER_SHARED_SYSCALL call dword ptr [ecx] ret StackBytes ENDM -MACRO(STUBCODE_K, SyscallId, StackBytes) +MACRO(STUBCODE_K, Name, SyscallId, ArgCount) + StackBytes = 4 * &ArgCount FPO 0, 0, 0, 0, 0, FRAME_FPO mov eax, SyscallId lea edx, [esp + 4] @@ -19,31 +21,32 @@ ret StackBytes ENDM #elif defined(_M_AMD64) -MACRO(STUBCODE_U, SyscallId, StackBytes) +MACRO(STUBCODE_U, Name, SyscallId, ArgCount) .ENDPROLOG mov eax, SyscallId mov r10, rcx syscall - ret StackBytes + ret ENDM -MACRO(STUBCODE_K, SyscallId, StackBytes) +MACRO(STUBCODE_K, Name, SyscallId, ArgCount) .ENDPROLOG - mov eax, SyscallId - call KiSystemService - ret StackBytes + EXTERN Nt&Name:PROC + lea rax, Nt&Name[rip] + mov r10, ArgCount * 8 + jmp KiZwSystemService ENDM #elif defined(_M_ARM) -MACRO(STUBCODE_U, SyscallId, StackBytes) +MACRO(STUBCODE_U, Name, SyscallId, ArgCount) swi #SyscallId bx lr ENDM -MACRO(STUBCODE_K, SyscallId, StackBytes) +MACRO(STUBCODE_K, Name, SyscallId, ArgCount) mov ip, lr swi #SyscallId bx ip ENDM #elif defined(_M_PPC) -MACRO(STUBCODE_U, SyscallId, StackBytes) +MACRO(STUBCODE_U, Name, SyscallId, ArgCount) stwu 1,-16(1) mflr 0 stw 0,0(1) @@ -56,13 +59,13 @@ ENDM #define STUBCODE_K STUBCODE_U #elif defined(_M_MIPS) -MACRO(STUBCODE_U, SyscallId, StackBytes) +MACRO(STUBCODE_U, Name, SyscallId, ArgCount) li $8, KUSER_SHARED_SYSCALL lw $8,0($8) j $8 nop ENDM -MACRO(STUBCODE_K, SyscallId, StackBytes) +MACRO(STUBCODE_K, Name, SyscallId, ArgCount) j KiSystemService nop ENDM @@ -71,38 +74,36 @@ #endif #ifdef _M_IX86 -MACRO(MAKE_LABEL, Name, Stackbytes) - PUBLIC _&Name&@&Stackbytes - _&Name&@&Stackbytes: +MACRO(MAKE_LABEL, Name, StackBytes) + PUBLIC _&Name&@&StackBytes + _&Name&@&StackBytes: ENDM -MACRO(START_PROC, Name, Stackbytes) - PUBLIC _&Name&@&Stackbytes - .PROC _&Name&@&Stackbytes +MACRO(START_PROC, Name, StackBytes) + PUBLIC _&Name&@&StackBytes + .PROC _&Name&@&StackBytes ENDM #else -MACRO(MAKE_LABEL, Name, Stackbytes) +MACRO(MAKE_LABEL, Name, StackBytes) PUBLIC &Name &Name: ENDM -MACRO(START_PROC, Name, Stackbytes) +MACRO(START_PROC, Name, StackBytes) PUBLIC &Name .PROC &Name ENDM #endif MACRO(STUB_U, Name, ArgCount) - Stackbytes = 4 * &ArgCount - MAKE_LABEL Zw&Name, %Stackbytes - START_PROC Nt&Name, %Stackbytes - STUBCODE_U SyscallId, %Stackbytes + MAKE_LABEL Zw&Name, %ArgCount * 4 + START_PROC Nt&Name, %ArgCount * 4 + STUBCODE_U Name, SyscallId, %ArgCount .ENDP SyscallId = SyscallId + 1 ENDM MACRO(STUB_K, Name, ArgCount) - Stackbytes = 4 * &ArgCount - START_PROC Zw&Name, %Stackbytes - STUBCODE_K SyscallId, %Stackbytes + START_PROC Zw&Name, %ArgCount * 4 + STUBCODE_K Name, SyscallId, %ArgCount .ENDP SyscallId = SyscallId + 1 ENDM
12 years, 10 months
1
0
0
0
[tkreuzer] 55408: [CMLIB] Fix 64 bit / MSVC warnings
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Sat Feb 4 12:23:27 2012 New Revision: 55408 URL:
http://svn.reactos.org/svn/reactos?rev=55408&view=rev
Log: [CMLIB] Fix 64 bit / MSVC warnings Modified: trunk/reactos/lib/cmlib/cmdata.h trunk/reactos/lib/cmlib/cminit.c trunk/reactos/lib/cmlib/cmlib.h trunk/reactos/lib/cmlib/hivecell.c trunk/reactos/lib/cmlib/hivewrt.c Modified: trunk/reactos/lib/cmlib/cmdata.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/cmlib/cmdata.h?rev=554…
============================================================================== --- trunk/reactos/lib/cmlib/cmdata.h [iso-8859-1] (original) +++ trunk/reactos/lib/cmlib/cmdata.h [iso-8859-1] Sat Feb 4 12:23:27 2012 @@ -57,7 +57,7 @@ LIST_ENTRY PinViewList; ULONG FileOffset; ULONG Size; - PULONG ViewAddress; + PULONG_PTR ViewAddress; PVOID Bcb; ULONG UseCount; } CM_VIEW_OF_FILE, *PCM_VIEW_OF_FILE; Modified: trunk/reactos/lib/cmlib/cminit.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/cmlib/cminit.c?rev=554…
============================================================================== --- trunk/reactos/lib/cmlib/cminit.c [iso-8859-1] (original) +++ trunk/reactos/lib/cmlib/cminit.c [iso-8859-1] Sat Feb 4 12:23:27 2012 @@ -18,10 +18,10 @@ { PCM_KEY_NODE KeyCell; HCELL_INDEX RootCellIndex; - SIZE_T NameSize; + ULONG NameSize; /* Allocate the cell */ - NameSize = strlenW(Name) * sizeof(WCHAR); + NameSize = (ULONG)strlenW(Name) * sizeof(WCHAR); RootCellIndex = HvAllocateCell(Hive, FIELD_OFFSET(CM_KEY_NODE, Name) + NameSize, Stable, @@ -54,7 +54,7 @@ KeyCell->MaxClassLen = 0; KeyCell->MaxValueNameLen = 0; KeyCell->MaxValueDataLen = 0; - + /* Write the name */ KeyCell->NameLength = (USHORT)NameSize; memcpy(KeyCell->Name, Name, NameSize); Modified: trunk/reactos/lib/cmlib/cmlib.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/cmlib/cmlib.h?rev=5540…
============================================================================== --- trunk/reactos/lib/cmlib/cmlib.h [iso-8859-1] (original) +++ trunk/reactos/lib/cmlib/cmlib.h [iso-8859-1] Sat Feb 4 12:23:27 2012 @@ -253,7 +253,7 @@ HCELL_INDEX CMAPI HvAllocateCell( PHHIVE RegistryHive, - SIZE_T Size, + ULONG Size, HSTORAGE_TYPE Storage, IN HCELL_INDEX Vicinity); Modified: trunk/reactos/lib/cmlib/hivecell.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/cmlib/hivecell.c?rev=5…
============================================================================== --- trunk/reactos/lib/cmlib/hivecell.c [iso-8859-1] (original) +++ trunk/reactos/lib/cmlib/hivecell.c [iso-8859-1] Sat Feb 4 12:23:27 2012 @@ -337,7 +337,7 @@ HCELL_INDEX CMAPI HvAllocateCell( PHHIVE RegistryHive, - SIZE_T Size, + ULONG Size, HSTORAGE_TYPE Storage, HCELL_INDEX Vicinity) { @@ -546,7 +546,7 @@ CellRef->StaticCount++; return TRUE; } - + /* FIXME: TODO */ DPRINT1("ERROR: Too many references\n"); while (TRUE); @@ -562,10 +562,10 @@ /* Any references? */ if (CellRef->StaticCount > 0) - { + { /* Sanity check */ ASSERT(CellRef->StaticCount <= STATIC_CELL_PAIR_COUNT); - + /* Loop them */ for (i = 0; i < CellRef->StaticCount;i++) { @@ -577,4 +577,4 @@ /* Free again */ CellRef->StaticCount = 0; } -} +} Modified: trunk/reactos/lib/cmlib/hivewrt.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/cmlib/hivewrt.c?rev=55…
============================================================================== --- trunk/reactos/lib/cmlib/hivewrt.c [iso-8859-1] (original) +++ trunk/reactos/lib/cmlib/hivewrt.c [iso-8859-1] Sat Feb 4 12:23:27 2012 @@ -14,8 +14,8 @@ PHHIVE RegistryHive) { ULONG FileOffset; - SIZE_T BufferSize; - SIZE_T BitmapSize; + ULONG BufferSize; + ULONG BitmapSize; PUCHAR Buffer; PUCHAR Ptr; ULONG BlockIndex;
12 years, 10 months
1
0
0
0
[tkreuzer] 55407: [NTOSKRNL/MM/AMD64] - Implement more of MmCreateProcessAddressSpace - Acquire pfn lock and use MiRemoveZeroPage in MiGetPteForProcess
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Sat Feb 4 12:13:53 2012 New Revision: 55407 URL:
http://svn.reactos.org/svn/reactos?rev=55407&view=rev
Log: [NTOSKRNL/MM/AMD64] - Implement more of MmCreateProcessAddressSpace - Acquire pfn lock and use MiRemoveZeroPage in MiGetPteForProcess Modified: trunk/reactos/ntoskrnl/mm/amd64/page.c Modified: trunk/reactos/ntoskrnl/mm/amd64/page.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/amd64/page.c?r…
============================================================================== --- trunk/reactos/ntoskrnl/mm/amd64/page.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/amd64/page.c [iso-8859-1] Sat Feb 4 12:13:53 2012 @@ -28,7 +28,7 @@ /* GLOBALS *****************************************************************/ const -ULONG +ULONG64 MmProtectToPteMask[32] = { // @@ -151,37 +151,48 @@ Process && Process != PsGetCurrentProcess()) { UNIMPLEMENTED; + __debugbreak(); return NULL; } else if (Create) { + KIRQL OldIrql; TmplPte.u.Long = 0; TmplPte.u.Flush.Valid = 1; TmplPte.u.Flush.Write = 1; + + /* All page table levels of user pages are user owned */ + TmplPte.u.Flush.Owner = (Address < MmHighestUserAddress) ? 1 : 0; + + /* Lock the PFN database */ + OldIrql = KeAcquireQueuedSpinLock(LockQueuePfnLock); /* Get the PXE */ Pte = MiAddressToPxe(Address); if (!Pte->u.Hard.Valid) { -// TmplPte.u.Hard.PageFrameNumber = MiAllocPage(TRUE); - InterlockedExchangePte(Pte, TmplPte); + TmplPte.u.Hard.PageFrameNumber = MiRemoveZeroPage(0); + MI_WRITE_VALID_PTE(Pte, TmplPte); } /* Get the PPE */ Pte = MiAddressToPpe(Address); if (!Pte->u.Hard.Valid) { -// TmplPte.u.Hard.PageFrameNumber = MiAllocPage(TRUE); - InterlockedExchangePte(Pte, TmplPte); + TmplPte.u.Hard.PageFrameNumber = MiRemoveZeroPage(1); + MI_WRITE_VALID_PTE(Pte, TmplPte); } /* Get the PDE */ Pte = MiAddressToPde(Address); if (!Pte->u.Hard.Valid) { -// TmplPte.u.Hard.PageFrameNumber = MiAllocPage(TRUE); - InterlockedExchangePte(Pte, TmplPte); + TmplPte.u.Hard.PageFrameNumber = MiRemoveZeroPage(2); + MI_WRITE_VALID_PTE(Pte, TmplPte); } + + /* Unlock PFN database */ + KeReleaseQueuedSpinLock(LockQueuePfnLock, OldIrql); } else { @@ -529,6 +540,8 @@ TmplPte.u.Hard.Valid = 1; MiSetPteProtection(&TmplPte, PageProtection); + TmplPte.u.Flush.Owner = (Address < MmHighestUserAddress) ? 1 : 0; + //__debugbreak(); for (i = 0; i < PageCount; i++) @@ -537,7 +550,7 @@ Pte = MiGetPteForProcess(Process, Address, TRUE); -DPRINT1("MmCreateVirtualMappingUnsafe, Address=%p, TmplPte=%p, Pte=%p\n", +DPRINT("MmCreateVirtualMappingUnsafe, Address=%p, TmplPte=%p, Pte=%p\n", Address, TmplPte.u.Long, Pte); if (InterlockedExchangePte(Pte, TmplPte)) @@ -577,6 +590,44 @@ return MmCreateVirtualMappingUnsafe(Process, Address, Protect, Pages, PageCount); } +static PMMPTE +MmGetPageTableForProcess(PEPROCESS Process, PVOID Address, BOOLEAN Create) +{ + __debugbreak(); + return 0; +} + +BOOLEAN MmUnmapPageTable(PMMPTE Pt) +{ + ASSERT(FALSE); + return 0; +} + +static ULONG64 MmGetPageEntryForProcess(PEPROCESS Process, PVOID Address) +{ + MMPTE Pte, *PointerPte; + + PointerPte = MmGetPageTableForProcess(Process, Address, FALSE); + if (PointerPte) + { + Pte = *PointerPte; + MmUnmapPageTable(PointerPte); + return Pte.u.Long; + } + return 0; +} + +VOID +NTAPI +MmGetPageFileMapping( + PEPROCESS Process, + PVOID Address, + SWAPENTRY* SwapEntry) +{ + ULONG64 Entry = MmGetPageEntryForProcess(Process, Address); + *SwapEntry = Entry >> 1; +} + BOOLEAN NTAPI MmCreateProcessAddressSpace(IN ULONG MinWs, @@ -584,14 +635,19 @@ OUT PULONG_PTR DirectoryTableBase) { KIRQL OldIrql; - PFN_NUMBER TableBasePfn, HyperPfn; - PMMPTE PointerPte; + PFN_NUMBER TableBasePfn, HyperPfn, HyperPdPfn, HyperPtPfn, WorkingSetPfn; + PMMPTE SystemPte; MMPTE TempPte, PdePte; ULONG TableIndex; - PMMPTE SystemTable; - - /* No page colors yet */ - Process->NextPageColor = 0; + PMMPTE PageTablePointer; + + /* Make sure we don't already have a page directory setup */ + ASSERT(Process->Pcb.DirectoryTableBase[0] == 0); + ASSERT(Process->Pcb.DirectoryTableBase[1] == 0); + ASSERT(Process->WorkingSetPage == 0); + + /* Choose a process color */ + Process->NextPageColor = (USHORT)RtlRandom(&MmProcessColorSeed); /* Setup the hyperspace lock */ KeInitializeSpinLock(&Process->HyperSpaceLock); @@ -599,67 +655,97 @@ /* Lock PFN database */ OldIrql = KeAcquireQueuedSpinLock(LockQueuePfnLock); - /* Get a page for the table base and for hyperspace */ - TableBasePfn = MiRemoveAnyPage(0); - HyperPfn = MiRemoveAnyPage(0); + /* Get a page for the table base and one for hyper space. The PFNs for + these pages will be initialized in MmInitializeProcessAddressSpace, + when we are already attached to the process. */ + TableBasePfn = MiRemoveAnyPage(MI_GET_NEXT_PROCESS_COLOR(Process)); + HyperPfn = MiRemoveAnyPage(MI_GET_NEXT_PROCESS_COLOR(Process)); + HyperPdPfn = MiRemoveAnyPage(MI_GET_NEXT_PROCESS_COLOR(Process)); + HyperPtPfn = MiRemoveAnyPage(MI_GET_NEXT_PROCESS_COLOR(Process)); + WorkingSetPfn = MiRemoveAnyPage(MI_GET_NEXT_PROCESS_COLOR(Process)); /* Release PFN lock */ KeReleaseQueuedSpinLock(LockQueuePfnLock, OldIrql); - /* Zero both pages */ - MiZeroPhysicalPage(TableBasePfn); + /* Zero pages */ /// FIXME: MiZeroPhysicalPage(HyperPfn); + MiZeroPhysicalPage(WorkingSetPfn); /* Set the base directory pointers */ + Process->WorkingSetPage = WorkingSetPfn; DirectoryTableBase[0] = TableBasePfn << PAGE_SHIFT; DirectoryTableBase[1] = HyperPfn << PAGE_SHIFT; - /* Make sure we don't already have a page directory setup */ - ASSERT(Process->Pcb.DirectoryTableBase[0] == 0); - - /* Insert us into the Mm process list */ - InsertTailList(&MmProcessList, &Process->MmProcessLinks); - /* Get a PTE to map the page directory */ - PointerPte = MiReserveSystemPtes(1, SystemPteSpace); - ASSERT(PointerPte != NULL); - - /* Build it */ - MI_MAKE_HARDWARE_PTE_KERNEL(&PdePte, - PointerPte, - MM_READWRITE, - TableBasePfn); - - /* Set it dirty and map it */ - PdePte.u.Hard.Dirty = TRUE; - MI_WRITE_VALID_PTE(PointerPte, PdePte); - - /* Now get the page directory (which we'll double map, so call it a page table */ - SystemTable = MiPteToAddress(PointerPte); - - /* Copy all the kernel mappings */ - TableIndex = MiAddressToPxi(MmSystemRangeStart); - - RtlCopyMemory(&SystemTable[TableIndex], - MiAddressToPxe(MmSystemRangeStart), + SystemPte = MiReserveSystemPtes(1, SystemPteSpace); + ASSERT(SystemPte != NULL); + + /* Get its address */ + PageTablePointer = MiPteToAddress(SystemPte); + + /* Build the PTE for the page directory and map it */ + PdePte = ValidKernelPte; + PdePte.u.Hard.PageFrameNumber = TableBasePfn; + *SystemPte = PdePte; + +/// architecture specific + //MiInitializePageDirectoryForProcess( + + /* Copy the kernel mappings and zero out the rest */ + TableIndex = PXE_PER_PAGE / 2; + RtlZeroMemory(PageTablePointer, TableIndex * sizeof(MMPTE)); + RtlCopyMemory(PageTablePointer + TableIndex, + MiAddressToPxe(0) + TableIndex, PAGE_SIZE - TableIndex * sizeof(MMPTE)); - /* Now write the PTE/PDE entry for hyperspace itself */ + /* Sanity check */ + ASSERT(MiAddressToPxi(MmHyperSpaceEnd) >= TableIndex); + + /* Setup a PTE for the page directory mappings */ TempPte = ValidKernelPte; + + /* Update the self mapping of the PML4 */ + TableIndex = MiAddressToPxi((PVOID)PXE_SELFMAP); + TempPte.u.Hard.PageFrameNumber = TableBasePfn; + PageTablePointer[TableIndex] = TempPte; + + /* Write the PML4 entry for hyperspace */ + TableIndex = MiAddressToPxi((PVOID)HYPER_SPACE); TempPte.u.Hard.PageFrameNumber = HyperPfn; - TableIndex = MiAddressToPxi((PVOID)HYPER_SPACE); - SystemTable[TableIndex] = TempPte; - - /* Sanity check */ - ASSERT(MiAddressToPxi(MmHyperSpaceEnd) > TableIndex); - - /* Now do the x86 trick of making the PDE a page table itself */ - TableIndex = MiAddressToPxi((PVOID)PTE_BASE); - TempPte.u.Hard.PageFrameNumber = TableBasePfn; - SystemTable[TableIndex] = TempPte; - - /* Let go of the system PTE */ - MiReleaseSystemPtes(PointerPte, 1, SystemPteSpace); + PageTablePointer[TableIndex] = TempPte; + + /* Map the hyperspace PDPT to the system PTE */ + PdePte.u.Hard.PageFrameNumber = HyperPfn; + *SystemPte = PdePte; + __invlpg(PageTablePointer); + + /* Write the hyperspace entry for the first PD */ + TempPte.u.Hard.PageFrameNumber = HyperPdPfn; + PageTablePointer[0] = TempPte; + + /* Map the hyperspace PD to the system PTE */ + PdePte.u.Hard.PageFrameNumber = HyperPdPfn; + *SystemPte = PdePte; + __invlpg(PageTablePointer); + + /* Write the hyperspace entry for the first PT */ + TempPte.u.Hard.PageFrameNumber = HyperPtPfn; + PageTablePointer[0] = TempPte; + + /* Map the hyperspace PT to the system PTE */ + PdePte.u.Hard.PageFrameNumber = HyperPtPfn; + *SystemPte = PdePte; + __invlpg(PageTablePointer); + + /* Write the hyperspace PTE for the working set list index */ + TempPte.u.Hard.PageFrameNumber = WorkingSetPfn; + TableIndex = MiAddressToPti(MmWorkingSetList); + PageTablePointer[TableIndex] = TempPte; + +/// end architecture specific + + /* Release the system PTE */ + MiReleaseSystemPtes(SystemPte, 1, SystemPteSpace); /* Switch to phase 1 initialization */ ASSERT(Process->AddressSpaceInitialized == 0);
12 years, 10 months
1
0
0
0
[ekohl] 55406: [EVENTLOG] - Change LogfInitializeNew and LogfInitializeExisting to return an NTSTATUS code instead of a BOOL value. - LogfInitializeExisting no longer calls LogfInitializeNew when r...
by ekohl@svn.reactos.org
Author: ekohl Date: Sat Feb 4 11:34:13 2012 New Revision: 55406 URL:
http://svn.reactos.org/svn/reactos?rev=55406&view=rev
Log: [EVENTLOG] - Change LogfInitializeNew and LogfInitializeExisting to return an NTSTATUS code instead of a BOOL value. - LogfInitializeExisting no longer calls LogfInitializeNew when reading a log file fails but returns a proper status code instead. Modified: trunk/reactos/base/services/eventlog/eventlog.h trunk/reactos/base/services/eventlog/file.c Modified: trunk/reactos/base/services/eventlog/eventlog.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/eventlog/eve…
============================================================================== --- trunk/reactos/base/services/eventlog/eventlog.h [iso-8859-1] (original) +++ trunk/reactos/base/services/eventlog/eventlog.h [iso-8859-1] Sat Feb 4 11:34:13 2012 @@ -168,10 +168,6 @@ VOID LogfCloseAll(VOID); -BOOL LogfInitializeNew(PLOGFILE LogFile); - -BOOL LogfInitializeExisting(PLOGFILE LogFile); - DWORD LogfGetOldestRecord(PLOGFILE LogFile); DWORD LogfGetCurrentRecord(PLOGFILE LogFile); Modified: trunk/reactos/base/services/eventlog/file.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/eventlog/fil…
============================================================================== --- trunk/reactos/base/services/eventlog/file.c [iso-8859-1] (original) +++ trunk/reactos/base/services/eventlog/file.c [iso-8859-1] Sat Feb 4 11:34:13 2012 @@ -18,7 +18,8 @@ /* FUNCTIONS ****************************************************************/ -BOOL LogfInitializeNew(PLOGFILE LogFile) +static NTSTATUS +LogfInitializeNew(PLOGFILE LogFile) { DWORD dwWritten; EVENTLOGEOF EofRec; @@ -46,7 +47,7 @@ NULL)) { DPRINT1("WriteFile failed:%d!\n", GetLastError()); - return FALSE; + return STATUS_UNSUCCESSFUL; } EofRec.Ones = 0x11111111; @@ -67,19 +68,21 @@ NULL)) { DPRINT1("WriteFile failed:%d!\n", GetLastError()); - return FALSE; + return STATUS_UNSUCCESSFUL; } if (!FlushFileBuffers(LogFile->hFile)) { DPRINT1("FlushFileBuffers failed:%d!\n", GetLastError()); - return FALSE; - } - - return TRUE; -} - -BOOL LogfInitializeExisting(PLOGFILE LogFile) + return STATUS_UNSUCCESSFUL; + } + + return STATUS_SUCCESS; +} + + +static NTSTATUS +LogfInitializeExisting(PLOGFILE LogFile) { DWORD dwRead; DWORD dwRecordsNumber = 0; @@ -94,7 +97,7 @@ INVALID_SET_FILE_POINTER) { DPRINT1("SetFilePointer failed! %d\n", GetLastError()); - return FALSE; + return STATUS_EVENTLOG_FILE_CORRUPT; } if (!ReadFile(LogFile->hFile, @@ -104,34 +107,34 @@ NULL)) { DPRINT1("ReadFile failed! %d\n", GetLastError()); - return FALSE; + return STATUS_EVENTLOG_FILE_CORRUPT; } if (dwRead != sizeof(EVENTLOGHEADER)) { DPRINT("EventLog: Invalid file %S.\n", LogFile->FileName); - return LogfInitializeNew(LogFile); + return STATUS_EVENTLOG_FILE_CORRUPT; } if (LogFile->Header.HeaderSize != sizeof(EVENTLOGHEADER) || LogFile->Header.EndHeaderSize != sizeof(EVENTLOGHEADER)) { DPRINT("EventLog: Invalid header size in %S.\n", LogFile->FileName); - return LogfInitializeNew(LogFile); + return STATUS_EVENTLOG_FILE_CORRUPT; } if (LogFile->Header.Signature != LOGFILE_SIGNATURE) { DPRINT("EventLog: Invalid signature %x in %S.\n", LogFile->Header.Signature, LogFile->FileName); - return LogfInitializeNew(LogFile); + return STATUS_EVENTLOG_FILE_CORRUPT; } if (LogFile->Header.EndOffset > GetFileSize(LogFile->hFile, NULL) + 1) { DPRINT("EventLog: Invalid eof offset %x in %S.\n", LogFile->Header.EndOffset, LogFile->FileName); - return LogfInitializeNew(LogFile); + return STATUS_EVENTLOG_FILE_CORRUPT; } /* Set the read location to the oldest record */ @@ -139,7 +142,7 @@ if (dwFilePointer == INVALID_SET_FILE_POINTER) { DPRINT1("SetFilePointer failed! %d\n", GetLastError()); - return FALSE; + return STATUS_EVENTLOG_FILE_CORRUPT; } for (;;) @@ -149,7 +152,7 @@ if (dwFilePointer == INVALID_SET_FILE_POINTER) { DPRINT1("SetFilePointer failed! %d\n", GetLastError()); - return FALSE; + return STATUS_EVENTLOG_FILE_CORRUPT; } /* If the EVENTLOGEOF info has been reached and the oldest record was not immediately after the Header */ @@ -167,7 +170,7 @@ NULL)) { DPRINT1("ReadFile failed! %d\n", GetLastError()); - return FALSE; + return STATUS_EVENTLOG_FILE_CORRUPT; } if (dwRead != sizeof(dwRecSize)) @@ -180,7 +183,7 @@ NULL)) { DPRINT1("ReadFile() failed! %d\n", GetLastError()); - return FALSE; + return STATUS_EVENTLOG_FILE_CORRUPT; } if (dwRead != sizeof(dwRecSize)) @@ -199,22 +202,21 @@ FILE_CURRENT) == INVALID_SET_FILE_POINTER) { DPRINT1("SetFilePointer() failed! %d", GetLastError()); - return FALSE; + return STATUS_EVENTLOG_FILE_CORRUPT; } RecBuf = (PEVENTLOGRECORD) HeapAlloc(MyHeap, 0, dwRecSize); - - if (!RecBuf) + if (RecBuf == NULL) { DPRINT1("Can't allocate heap!\n"); - return FALSE; + return STATUS_NO_MEMORY; } if (!ReadFile(LogFile->hFile, RecBuf, dwRecSize, &dwRead, NULL)) { DPRINT1("ReadFile() failed! %d\n", GetLastError()); HeapFree(MyHeap, 0, RecBuf); - return FALSE; + return STATUS_EVENTLOG_FILE_CORRUPT; } if (dwRead != dwRecSize) @@ -248,7 +250,7 @@ { DPRINT1("LogfAddOffsetInformation() failed!\n"); HeapFree(MyHeap, 0, RecBuf); - return FALSE; + return STATUS_EVENTLOG_FILE_CORRUPT; } HeapFree(MyHeap, 0, RecBuf); @@ -266,7 +268,7 @@ INVALID_SET_FILE_POINTER) { DPRINT1("SetFilePointer() failed! %d\n", GetLastError()); - return FALSE; + return STATUS_EVENTLOG_FILE_CORRUPT; } if (!WriteFile(LogFile->hFile, @@ -276,16 +278,16 @@ NULL)) { DPRINT1("WriteFile failed! %d\n", GetLastError()); - return FALSE; + return STATUS_EVENTLOG_FILE_CORRUPT; } if (!FlushFileBuffers(LogFile->hFile)) { DPRINT1("FlushFileBuffers failed! %d\n", GetLastError()); - return FALSE; - } - - return TRUE; + return STATUS_EVENTLOG_FILE_CORRUPT; + } + + return STATUS_SUCCESS; } @@ -299,7 +301,7 @@ OBJECT_ATTRIBUTES ObjectAttributes; IO_STATUS_BLOCK IoStatusBlock; PLOGFILE pLogFile; - BOOL bResult, bCreateNew = FALSE; + BOOL bCreateNew = FALSE; NTSTATUS Status = STATUS_SUCCESS; pLogFile = (LOGFILE *) HeapAlloc(MyHeap, HEAP_ZERO_MEMORY, sizeof(LOGFILE)); @@ -376,15 +378,12 @@ pLogFile->Permanent = Permanent; if (bCreateNew) - bResult = LogfInitializeNew(pLogFile); + Status = LogfInitializeNew(pLogFile); else - bResult = LogfInitializeExisting(pLogFile); - - if (!bResult) - { - Status = STATUS_UNSUCCESSFUL; + Status = LogfInitializeExisting(pLogFile); + + if (!NT_SUCCESS(Status)) goto fail; - } RtlInitializeResource(&pLogFile->Lock); @@ -414,6 +413,7 @@ return Status; } + VOID LogfClose(PLOGFILE LogFile,
12 years, 10 months
1
0
0
0
← Newer
1
...
50
51
52
53
54
55
56
57
58
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
Results per page:
10
25
50
100
200