ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
January 2014
----- 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
14 participants
426 discussions
Start a n
N
ew thread
[hbelusca] 61875: [NTVDM] - Enable experimental sound support (only PC speaker for the moment, aka. uses beep.sys). - Introduce a #define WORKING_TIMER which aim is to disable the currently problem...
by hbelusca@svn.reactos.org
Author: hbelusca Date: Wed Jan 29 00:25:43 2014 New Revision: 61875 URL:
http://svn.reactos.org/svn/reactos?rev=61875&view=rev
Log: [NTVDM] - Enable experimental sound support (only PC speaker for the moment, aka. uses beep.sys). - Introduce a #define WORKING_TIMER which aim is to disable the currently problematic approximate performance counter value calculation done in order not to call QueryPerformanceCounter each time. The problem is that we then compute a number of clock ticks for the PIT, which becomes negative, and therefore everything starts to hang. Disabling this code and calling each time QueryPerformanceCounter, fixes everything; we gain in precision but we loose in performance... A definitive fix must be found, [TheFlash] !! This fixes sound (and hangs) in Advanced NetWars, Dangerous Dave, ElitePlus and Rescue Rover (the games that I've tested so far). Modified: branches/ntvdm/subsystems/ntvdm/emulator.c branches/ntvdm/subsystems/ntvdm/hardware/speaker.c branches/ntvdm/subsystems/ntvdm/hardware/speaker.h branches/ntvdm/subsystems/ntvdm/ntvdm.c Modified: branches/ntvdm/subsystems/ntvdm/emulator.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/emulator…
============================================================================== --- branches/ntvdm/subsystems/ntvdm/emulator.c [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/emulator.c [iso-8859-1] Wed Jan 29 00:25:43 2014 @@ -134,6 +134,7 @@ static VOID WINAPI Port61hWrite(ULONG Port, BYTE Data) { + // BOOLEAN SpeakerChange = FALSE; BYTE OldPort61hState = Port61hState; /* Only the four lowest bytes can be written */ @@ -141,7 +142,8 @@ if ((OldPort61hState ^ Port61hState) & 0x01) { - DPRINT1("PIT 2 Gate %s\n", Port61hState & 0x01 ? "on" : "off"); + DPRINT("PIT 2 Gate %s\n", Port61hState & 0x01 ? "on" : "off"); + // SpeakerChange = TRUE; } PitSetGate(2, !!(Port61hState & 0x01)); @@ -149,8 +151,11 @@ if ((OldPort61hState ^ Port61hState) & 0x02) { /* There were some change for the speaker... */ - DPRINT1("Speaker %s\n", Port61hState & 0x02 ? "on" : "off"); - } + DPRINT("Speaker %s\n", Port61hState & 0x02 ? "on" : "off"); + // SpeakerChange = TRUE; + } + // if (SpeakerChange) SpeakerChange(); + SpeakerChange(); } static VOID WINAPI PitChan0Out(LPVOID Param, BOOLEAN State) @@ -183,6 +188,8 @@ static VOID WINAPI PitChan2Out(LPVOID Param, BOOLEAN State) { + // BYTE OldPort61hState = Port61hState; + #if 0 if (State) { @@ -197,6 +204,9 @@ #else Port61hState = (Port61hState & 0xDF) | (State << 5); #endif + DPRINT("Speaker PIT out\n"); + // if ((OldPort61hState ^ Port61hState) & 0x20) + // SpeakerChange(); } /* PUBLIC FUNCTIONS ***********************************************************/ Modified: branches/ntvdm/subsystems/ntvdm/hardware/speaker.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/hardware…
============================================================================== --- branches/ntvdm/subsystems/ntvdm/hardware/speaker.c [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/hardware/speaker.c [iso-8859-1] Wed Jan 29 00:25:43 2014 @@ -31,7 +31,7 @@ /* PUBLIC FUNCTIONS ***********************************************************/ -VOID SpeakerPool(VOID) +VOID SpeakerChange(VOID) { BYTE Port61hState = IOReadB(CONTROL_SYSTEM_PORT61H); BOOLEAN IsConnectedToPITChannel2 = !!(Port61hState & 0x01); Modified: branches/ntvdm/subsystems/ntvdm/hardware/speaker.h URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/hardware…
============================================================================== --- branches/ntvdm/subsystems/ntvdm/hardware/speaker.h [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/hardware/speaker.h [iso-8859-1] Wed Jan 29 00:25:43 2014 @@ -17,7 +17,7 @@ /* FUNCTIONS ******************************************************************/ -VOID SpeakerPool(VOID); +VOID SpeakerChange(VOID); VOID SpeakerInitialize(VOID); VOID SpeakerCleanup(VOID); Modified: branches/ntvdm/subsystems/ntvdm/ntvdm.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/ntvdm.c?…
============================================================================== --- branches/ntvdm/subsystems/ntvdm/ntvdm.c [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/ntvdm.c [iso-8859-1] Wed Jan 29 00:25:43 2014 @@ -26,7 +26,17 @@ */ #define TESTING -#define IPS_DISPLAY +/* + * Activate IPS_DISPLAY if you want to display the + * number of instructions per second, as well as + * the computed number of ticks for the PIT. + */ +// #define IPS_DISPLAY + +/* + * Activate WORKING_TIMER when the PIT timing problem is fixed. + */ +// #define WORKING_TIMER /* PUBLIC VARIABLES ***********************************************************/ @@ -257,12 +267,15 @@ /* Main loop */ while (VdmRunning) { +#ifdef WORKING_TIMER DWORD PitResolution = PitGetResolution(); +#endif DWORD RtcFrequency = RtcGetTicksPerSecond(); /* Get the current number of ticks */ CurrentTickCount = GetTickCount(); +#ifdef WORKING_TIMER if ((PitResolution <= 1000) && (RtcFrequency <= 1000)) { /* Calculate the approximate performance counter value instead */ @@ -271,6 +284,7 @@ * (Frequency.QuadPart / 1000); } else +#endif { /* Get the current performance counter value */ QueryPerformanceCounter(&Counter); @@ -331,7 +345,7 @@ #ifdef IPS_DISPLAY if ((CurrentTickCount - LastCyclePrintout) >= 1000) { - DPRINT1("NTVDM: %lu Instructions Per Second; TimerTicks = %lu\n", Cycles, TimerTicks); + DPRINT1("NTVDM: %lu Instructions Per Second; TimerTicks = %I64d\n", Cycles, TimerTicks); LastCyclePrintout = CurrentTickCount; Cycles = 0; }
10 years, 10 months
1
0
0
0
[tkreuzer] 61874: [NTOSKRNL] - Implement FsRtlRegisterFileSystemFilterCallbacks - Fix returned ResultLength value in NtQuerySystemInformation - Create \FileSystems\Filters folder in IopCreateRootDi...
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Tue Jan 28 23:40:27 2014 New Revision: 61874 URL:
http://svn.reactos.org/svn/reactos?rev=61874&view=rev
Log: [NTOSKRNL] - Implement FsRtlRegisterFileSystemFilterCallbacks - Fix returned ResultLength value in NtQuerySystemInformation - Create \FileSystems\Filters folder in IopCreateRootDirectories, used by Windows fltmgr Modified: trunk/reactos/ntoskrnl/ex/sysinfo.c trunk/reactos/ntoskrnl/fsrtl/fastio.c trunk/reactos/ntoskrnl/io/iomgr/iomgr.c Modified: trunk/reactos/ntoskrnl/ex/sysinfo.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ex/sysinfo.c?rev=…
============================================================================== --- trunk/reactos/ntoskrnl/ex/sysinfo.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ex/sysinfo.c [iso-8859-1] Tue Jan 28 23:40:27 2014 @@ -1654,7 +1654,7 @@ /* Check who is calling */ if (PreviousMode != KernelMode) { - static const UNICODE_STRING Win32kName = + static const UNICODE_STRING Win32kName = RTL_CONSTANT_STRING(L"\\SystemRoot\\System32\\win32k.sys"); /* Make sure we can load drivers */ @@ -1663,7 +1663,7 @@ /* FIXME: We can't, fail */ return STATUS_PRIVILEGE_NOT_HELD; } - + _SEH2_TRY { /* Probe and copy the unicode string */ @@ -1684,7 +1684,7 @@ _SEH2_YIELD(return _SEH2_GetExceptionCode()); } _SEH2_END; - + /* Recursively call the function, so that we are from kernel mode */ return ZwSetSystemInformation(SystemExtendServiceTableInformation, (PVOID)&Win32kName, @@ -1956,51 +1956,51 @@ SI_QX(SystemPerformanceInformation), SI_QX(SystemTimeOfDayInformation), SI_QX(SystemPathInformation), /* should be SI_XX */ - SI_QX(SystemProcessInformation), - SI_QX(SystemCallCountInformation), - SI_QX(SystemDeviceInformation), - SI_QX(SystemProcessorPerformanceInformation), - SI_QS(SystemFlagsInformation), + SI_QX(SystemProcessInformation), // aka SystemProcessesAndThreadsInformation + SI_QX(SystemCallCountInformation), // aka SystemCallCounts + SI_QX(SystemDeviceInformation), // aka SystemConfigurationInformation + SI_QX(SystemProcessorPerformanceInformation), // aka SystemProcessorTimes + SI_QS(SystemFlagsInformation), // aka SystemGlobalFlag SI_QX(SystemCallTimeInformation), /* should be SI_XX */ SI_QX(SystemModuleInformation), - SI_QX(SystemLocksInformation), + SI_QX(SystemLocksInformation), // aka SystemLockInformation SI_QX(SystemStackTraceInformation), /* should be SI_XX */ SI_QX(SystemPagedPoolInformation), /* should be SI_XX */ SI_QX(SystemNonPagedPoolInformation), /* should be SI_XX */ SI_QX(SystemHandleInformation), SI_QX(SystemObjectInformation), - SI_QX(SystemPageFileInformation), - SI_QX(SystemVdmInstemulInformation), + SI_QX(SystemPageFileInformation), // aka SystemPagefileInformation + SI_QX(SystemVdmInstemulInformation), // aka SystemInstructionEmulationCounts SI_QX(SystemVdmBopInformation), /* it should be SI_XX */ - SI_QS(SystemFileCacheInformation), + SI_QS(SystemFileCacheInformation), // aka SystemCacheInformation SI_QX(SystemPoolTagInformation), - SI_QX(SystemInterruptInformation), - SI_QS(SystemDpcBehaviourInformation), + SI_QX(SystemInterruptInformation), // aka SystemProcessorStatistics + SI_QS(SystemDpcBehaviourInformation), // aka SystemDpcInformation SI_QX(SystemFullMemoryInformation), /* it should be SI_XX */ - SI_XS(SystemLoadGdiDriverInformation), - SI_XS(SystemUnloadGdiDriverInformation), - SI_QS(SystemTimeAdjustmentInformation), + SI_XS(SystemLoadGdiDriverInformation), // correct: SystemLoadImage + SI_XS(SystemUnloadGdiDriverInformation), // correct: SystemUnloadImage + SI_QS(SystemTimeAdjustmentInformation), // aka SystemTimeAdjustment SI_QX(SystemSummaryMemoryInformation), /* it should be SI_XX */ SI_QX(SystemNextEventIdInformation), /* it should be SI_XX */ - SI_QX(SystemEventIdsInformation), /* it should be SI_XX */ + SI_QX(SystemEventIdsInformation), /* it should be SI_XX */ // SystemPerformanceTraceInformation SI_QX(SystemCrashDumpInformation), SI_QX(SystemExceptionInformation), SI_QX(SystemCrashDumpStateInformation), SI_QX(SystemKernelDebuggerInformation), SI_QX(SystemContextSwitchInformation), SI_QS(SystemRegistryQuotaInformation), - SI_XS(SystemExtendServiceTableInformation), + SI_XS(SystemExtendServiceTableInformation), // correct: SystemLoadAndCallImage SI_XS(SystemPrioritySeperation), SI_QX(SystemPlugPlayBusInformation), /* it should be SI_XX */ SI_QX(SystemDockInformation), /* it should be SI_XX */ - SI_QX(SystemPowerInformation), /* it should be SI_XX */ + SI_QX(SystemPowerInformation), /* it should be SI_XX */ // SystemPowerInformationNative? SystemInvalidInfoClass2 SI_QX(SystemProcessorSpeedInformation), /* it should be SI_XX */ - SI_QS(SystemCurrentTimeZoneInformation), /* it should be SI_QX */ + SI_QS(SystemCurrentTimeZoneInformation), /* it should be SI_QX */ // aka SystemTimeZoneInformation SI_QX(SystemLookasideInformation), SI_XS(SystemSetTimeSlipEvent), SI_XS(SystemCreateSession), SI_XS(SystemDeleteSession), - SI_QX(SystemInvalidInfoClass4), /* it should be SI_XX */ + SI_QX(SystemInvalidInfoClass4), /* it should be SI_XX */ // SystemSessionInformation? SI_QX(SystemRangeStartInformation), SI_QS(SystemVerifierInformation), SI_XS(SystemAddVerifier), @@ -2021,7 +2021,7 @@ OUT PULONG UnsafeResultLength) { KPROCESSOR_MODE PreviousMode; - ULONG ResultLength; + ULONG ResultLength = 0; NTSTATUS FStatus = STATUS_NOT_IMPLEMENTED; PAGED_CODE(); @@ -2038,8 +2038,11 @@ ProbeForWriteUlong(UnsafeResultLength); } + if (UnsafeResultLength) + *UnsafeResultLength = 0; + /* - * Check the request is valid. + * Check if the request is valid. */ if (SystemInformationClass >= MAX_SYSTEM_INFO_CLASS) { Modified: trunk/reactos/ntoskrnl/fsrtl/fastio.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/fsrtl/fastio.c?re…
============================================================================== --- trunk/reactos/ntoskrnl/fsrtl/fastio.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/fsrtl/fastio.c [iso-8859-1] Tue Jan 28 23:40:27 2014 @@ -1802,7 +1802,7 @@ Exclusive = TRUE; ResourceToAcquire = FcbHeader->Resource; } - else if (!FcbHeader->PagingIoResource || + else if (!FcbHeader->PagingIoResource || (FcbHeader->Flags & FSRTL_FLAG_ACQUIRE_MAIN_RSRC_SH)) { /* Acquire main resource shared if flag is specified or @@ -1942,9 +1942,35 @@ *--*/ NTSTATUS NTAPI -FsRtlRegisterFileSystemFilterCallbacks(IN PDRIVER_OBJECT FilterDriverObject, - IN PFS_FILTER_CALLBACKS Callbacks) -{ - UNIMPLEMENTED; - return STATUS_NOT_IMPLEMENTED; -} +FsRtlRegisterFileSystemFilterCallbacks( + PDRIVER_OBJECT FilterDriverObject, + PFS_FILTER_CALLBACKS Callbacks) +{ + PFS_FILTER_CALLBACKS NewCallbacks; + PEXTENDED_DRIVER_EXTENSION DriverExtension; + PAGED_CODE(); + + /* Verify parameters */ + if ((FilterDriverObject == NULL) || (Callbacks == NULL)) + { + return STATUS_INVALID_PARAMETER; + } + + /* Allocate a buffer for a copy of the callbacks */ + NewCallbacks = ExAllocatePoolWithTag(NonPagedPool, + Callbacks->SizeOfFsFilterCallbacks, + 'gmSF'); + if (NewCallbacks == NULL) + { + return STATUS_INSUFFICIENT_RESOURCES; + } + + /* Copy the callbacks */ + RtlCopyMemory(NewCallbacks, Callbacks, Callbacks->SizeOfFsFilterCallbacks); + + /* Set the callbacks in the driver extension */ + DriverExtension = (PEXTENDED_DRIVER_EXTENSION)FilterDriverObject->DriverExtension; + DriverExtension->FsFilterCallbacks = NewCallbacks; + + return STATUS_SUCCESS; +} Modified: trunk/reactos/ntoskrnl/io/iomgr/iomgr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/iomgr/iomgr.c?…
============================================================================== --- trunk/reactos/ntoskrnl/io/iomgr/iomgr.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/io/iomgr/iomgr.c [iso-8859-1] Tue Jan 28 23:40:27 2014 @@ -110,7 +110,7 @@ IOC_TAG1, 32, &ExSystemLookasideListHead); - + /* Initialize the Lookaside List for Large IRPs */ ExInitializeSystemLookasideList(&IoLargeIrpLookaside, NonPagedPool, @@ -137,11 +137,11 @@ &ExSystemLookasideListHead); /* Allocate the global lookaside list buffer */ - CurrentList = ExAllocatePoolWithTag(NonPagedPool, + CurrentList = ExAllocatePoolWithTag(NonPagedPool, 4 * KeNumberProcessors * sizeof(GENERAL_LOOKASIDE), TAG_IO); - + /* Loop all processors */ for (i = 0; i < KeNumberProcessors; i++) { @@ -165,13 +165,13 @@ &ExSystemLookasideListHead); Prcb->PPLookasideList[LookasideCompletionList].P = CurrentList; CurrentList++; - + } else { Prcb->PPLookasideList[LookasideCompletionList].P = &IoCompletionPacketLookaside; } - + /* Set the Large IRP List */ Prcb->PPLookasideList[LookasideLargeIrpList].L = &IoLargeIrpLookaside; if (CurrentList) @@ -185,7 +185,7 @@ &ExSystemLookasideListHead); Prcb->PPLookasideList[LookasideLargeIrpList].P = CurrentList; CurrentList++; - + } else { @@ -205,7 +205,7 @@ &ExSystemLookasideListHead); Prcb->PPLookasideList[LookasideSmallIrpList].P = CurrentList; CurrentList++; - + } else { @@ -223,10 +223,10 @@ TAG_MDL, 128, &ExSystemLookasideListHead); - + Prcb->PPLookasideList[LookasideMdlList].P = CurrentList; CurrentList++; - + } else { @@ -332,6 +332,7 @@ OBJECT_ATTRIBUTES ObjectAttributes; UNICODE_STRING DirName; HANDLE Handle; + NTSTATUS Status; /* Create the '\Driver' object directory */ RtlInitUnicodeString(&DirName, L"\\Driver"); @@ -340,9 +341,14 @@ OBJ_PERMANENT, NULL, NULL); - if (!NT_SUCCESS(NtCreateDirectoryObject(&Handle, - DIRECTORY_ALL_ACCESS, - &ObjectAttributes))) return FALSE; + Status = NtCreateDirectoryObject(&Handle, + DIRECTORY_ALL_ACCESS, + &ObjectAttributes); + if (!NT_SUCCESS(Status)) + { + DPRINT1("Failed to create \\Driver directory: 0x%lx\n", Status); + return FALSE; + } NtClose(Handle); /* Create the '\FileSystem' object directory */ @@ -352,9 +358,31 @@ OBJ_PERMANENT, NULL, NULL); - if (!NT_SUCCESS(NtCreateDirectoryObject(&Handle, - DIRECTORY_ALL_ACCESS, - &ObjectAttributes))) return FALSE; + Status = NtCreateDirectoryObject(&Handle, + DIRECTORY_ALL_ACCESS, + &ObjectAttributes); + if (!NT_SUCCESS(Status)) + { + DPRINT1("Failed to create \\FileSystem directory: 0x%lx\n", Status); + return FALSE; + } + NtClose(Handle); + + /* Create the '\FileSystem' object directory */ + RtlInitUnicodeString(&DirName, L"\\FileSystem\\Filters"); + InitializeObjectAttributes(&ObjectAttributes, + &DirName, + OBJ_PERMANENT, + NULL, + NULL); + Status = NtCreateDirectoryObject(&Handle, + DIRECTORY_ALL_ACCESS, + &ObjectAttributes); + if (!NT_SUCCESS(Status)) + { + DPRINT1("Failed to create \\FileSystem\\Filters directory: 0x%lx\n", Status); + return FALSE; + } NtClose(Handle); /* Return success */
10 years, 10 months
1
0
0
0
[jgardou] 61873: [WIN32K] - Fix allocation of DRIVEROBJ objects
by jgardou@svn.reactos.org
Author: jgardou Date: Tue Jan 28 22:36:57 2014 New Revision: 61873 URL:
http://svn.reactos.org/svn/reactos?rev=61873&view=rev
Log: [WIN32K] - Fix allocation of DRIVEROBJ objects Modified: trunk/reactos/win32ss/gdi/eng/driverobj.h Modified: trunk/reactos/win32ss/gdi/eng/driverobj.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/eng/driverobj.…
============================================================================== --- trunk/reactos/win32ss/gdi/eng/driverobj.h [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/eng/driverobj.h [iso-8859-1] Tue Jan 28 22:36:57 2014 @@ -14,7 +14,7 @@ BOOL NTAPI DRIVEROBJ_Cleanup(PVOID pObject); -#define DRIVEROBJ_AllocObjectWithHandle() ((PEDRIVEROBJ)GDIOBJ_AllocObjWithHandle(GDI_OBJECT_TYPE_DRIVEROBJ, sizeof(DRIVEROBJ))) +#define DRIVEROBJ_AllocObjectWithHandle() ((PEDRIVEROBJ)GDIOBJ_AllocObjWithHandle(GDI_OBJECT_TYPE_DRIVEROBJ, sizeof(EDRIVEROBJ))) #define DRIVEROBJ_FreeObjectByHandle(hdo) GDIOBJ_FreeObjByHandle((HGDIOBJ)hdo, GDI_OBJECT_TYPE_DRIVEROBJ) #define DRIVEROBJ_UnlockObject(pdo) GDIOBJ_vUnlockObject((POBJ)pdo)
10 years, 10 months
1
0
0
0
[tkreuzer] 61872: [RTL] Add implementation of RtlFindLastBackwardRunClear from amd64 branch, thanks to Alex for noticing that it has never been merged.
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Tue Jan 28 21:55:30 2014 New Revision: 61872 URL:
http://svn.reactos.org/svn/reactos?rev=61872&view=rev
Log: [RTL] Add implementation of RtlFindLastBackwardRunClear from amd64 branch, thanks to Alex for noticing that it has never been merged. Modified: trunk/reactos/lib/rtl/bitmap.c Modified: trunk/reactos/lib/rtl/bitmap.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/bitmap.c?rev=61872…
============================================================================== --- trunk/reactos/lib/rtl/bitmap.c [iso-8859-1] (original) +++ trunk/reactos/lib/rtl/bitmap.c [iso-8859-1] Tue Jan 28 21:55:30 2014 @@ -709,7 +709,7 @@ *StartingRunIndex = FromIndex + Length; /* Now return the length of the run */ - return RtlpGetLengthOfRunSet(BitMapHeader, FromIndex, MAXINDEX); + return RtlpGetLengthOfRunSet(BitMapHeader, FromIndex + Length, MAXINDEX); } BITMAP_INDEX @@ -728,8 +728,62 @@ _In_ BITMAP_INDEX FromIndex, _Out_ PBITMAP_INDEX StartingRunIndex) { - UNIMPLEMENTED; - return 0; + BITMAP_INDEX Value, InvValue, BitPos; + PBITMAP_BUFFER Buffer; + + /* Make sure we don't go past the end */ + FromIndex = min(FromIndex, BitMapHeader->SizeOfBitMap - 1); + + /* Calculate positions */ + Buffer = BitMapHeader->Buffer + FromIndex / _BITCOUNT; + BitPos = (_BITCOUNT - 1) - (FromIndex & (_BITCOUNT - 1)); + + /* Get the inversed value, clear bits that don't belong to the run */ + InvValue = ~(*Buffer--) << BitPos >> BitPos; + + /* Skip all set ULONGs */ + while (InvValue == 0) + { + /* Did we already reach past the first ULONG? */ + if (Buffer < BitMapHeader->Buffer) + { + /* Yes, nothing found */ + return 0; + } + + InvValue = ~(*Buffer--); + } + + /* We hit a clear bit, check how many set bits are left */ + BitScanReverse(&BitPos, InvValue); + + /* Calculate last bit position */ + FromIndex = (Buffer + 1 - BitMapHeader->Buffer) * _BITCOUNT + BitPos; + + Value = ~InvValue << ((_BITCOUNT - 1) - BitPos) >> ((_BITCOUNT - 1) - BitPos); + + /* Skip all clear ULONGs */ + while (Value == 0 && Buffer >= BitMapHeader->Buffer) + { + Value = *Buffer--; + } + + if (Value != 0) + { + /* We hit a set bit, check how many clear bits are left */ + BitScanReverse(&BitPos, Value); + + /* Calculate Starting Index */ + *StartingRunIndex = (Buffer + 1 - BitMapHeader->Buffer) * _BITCOUNT + BitPos + 1; + } + else + { + /* We reached the start of the bitmap */ + *StartingRunIndex = 0; + } + + /* Return length of the run */ + return FromIndex - *StartingRunIndex; }
10 years, 10 months
1
0
0
0
[tkreuzer] 61871: [KSECDD] Add public ksecioctl.h containing the supported IOCTLs
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Tue Jan 28 21:52:53 2014 New Revision: 61871 URL:
http://svn.reactos.org/svn/reactos?rev=61871&view=rev
Log: [KSECDD] Add public ksecioctl.h containing the supported IOCTLs Added: trunk/reactos/include/reactos/drivers/ksecdd/ trunk/reactos/include/reactos/drivers/ksecdd/ksecioctl.h (with props) Modified: trunk/reactos/drivers/crypto/ksecdd/CMakeLists.txt trunk/reactos/drivers/crypto/ksecdd/dispatch.c trunk/reactos/drivers/crypto/ksecdd/ksecdd.h Modified: trunk/reactos/drivers/crypto/ksecdd/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/crypto/ksecdd/CMak…
============================================================================== --- trunk/reactos/drivers/crypto/ksecdd/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/drivers/crypto/ksecdd/CMakeLists.txt [iso-8859-1] Tue Jan 28 21:52:53 2014 @@ -3,6 +3,7 @@ include_directories( + ${REACTOS_SOURCE_DIR}/include/reactos/drivers/ksecdd ${REACTOS_SOURCE_DIR}/lib/cryptlib) list(APPEND SOURCE Modified: trunk/reactos/drivers/crypto/ksecdd/dispatch.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/crypto/ksecdd/disp…
============================================================================== --- trunk/reactos/drivers/crypto/ksecdd/dispatch.c [iso-8859-1] (original) +++ trunk/reactos/drivers/crypto/ksecdd/dispatch.c [iso-8859-1] Tue Jan 28 21:52:53 2014 @@ -9,6 +9,7 @@ /* INCLUDES *******************************************************************/ #include "ksecdd.h" +#include <ksecioctl.h> #define NDEBUG #include <debug.h> @@ -96,7 +97,12 @@ /* Check ioctl code */ switch (IoControlCode) { - case IOCTL_KSEC_GEN_RANDOM: + case IOCTL_KSEC_REGISTER_LSA_PROCESS: + + Status = STATUS_SUCCESS; + break; + + case IOCTL_KSEC_RANDOM_FILL_BUFFER: Status = KsecGenRandom(Buffer, *OutputLength); break; Modified: trunk/reactos/drivers/crypto/ksecdd/ksecdd.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/crypto/ksecdd/ksec…
============================================================================== --- trunk/reactos/drivers/crypto/ksecdd/ksecdd.h [iso-8859-1] (original) +++ trunk/reactos/drivers/crypto/ksecdd/ksecdd.h [iso-8859-1] Tue Jan 28 21:52:53 2014 @@ -9,10 +9,6 @@ #define _NO_KSECDD_IMPORT_ #include <ntifs.h> #include <ndk/extypes.h> - -// 0x390004 -#define IOCTL_KSEC_GEN_RANDOM \ - CTL_CODE(FILE_DEVICE_KSEC, 0x01, METHOD_BUFFERED, FILE_ANY_ACCESS) #if defined(_M_IX86) || defined(_M_AMD64) typedef struct _KSEC_MACHINE_SPECIFIC_COUNTERS Added: trunk/reactos/include/reactos/drivers/ksecdd/ksecioctl.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/drivers/ks…
============================================================================== --- trunk/reactos/include/reactos/drivers/ksecdd/ksecioctl.h (added) +++ trunk/reactos/include/reactos/drivers/ksecdd/ksecioctl.h [iso-8859-1] Tue Jan 28 21:52:53 2014 @@ -0,0 +1,43 @@ + + +#pragma once + +// 0: 0x398000 - called from LSASRV!LsapInitLsa +#define IOCTL_KSEC_REGISTER_LSA_PROCESS \ + CTL_CODE(FILE_DEVICE_KSEC, 0x00, METHOD_BUFFERED, FILE_WRITE_ACCESS) + +// 1: 0x390004 - called from tcpip!InitIsnGenerator +#define IOCTL_KSEC_1 \ + CTL_CODE(FILE_DEVICE_KSEC, 0x01, METHOD_BUFFERED, FILE_ANY_ACCESS) + +// 2: 0x390008 - called from SystemFunction036 aka RtlGenRandom via RandomFillBuffer +#define IOCTL_KSEC_RANDOM_FILL_BUFFER \ + CTL_CODE(FILE_DEVICE_KSEC, 0x02, METHOD_BUFFERED, FILE_ANY_ACCESS) + +// 3: 0x39000E - called from SystemFunction040 aka RtlEncryptMemory with OptionFlags == 0 +#define IOCTL_KSEC_ENCRYPT_PROCESS \ + CTL_CODE(FILE_DEVICE_KSEC, 0x03, METHOD_OUT_DIRECT, FILE_ANY_ACCESS) + +// 4: 0x390012 - called from SystemFunction041 aka RtlDecryptMemory with OptionFlags == 0 +#define IOCTL_KSEC_DECRYPT_PROCESS \ + CTL_CODE(FILE_DEVICE_KSEC, 0x04, METHOD_OUT_DIRECT, FILE_ANY_ACCESS) + +// 5: 0x390016 - called from SystemFunction040 aka RtlEncryptMemory with OptionFlags == 1 +#define IOCTL_KSEC_ENCRYPT_CROSS_PROCESS \ + CTL_CODE(FILE_DEVICE_KSEC, 0x05, METHOD_OUT_DIRECT, FILE_ANY_ACCESS) + +// 6: 0x39001A - called from SystemFunction041 aka RtlDecryptMemory with OptionFlags == 1 +#define IOCTL_KSEC_DECRYPT_CROSS_PROCESS \ + CTL_CODE(FILE_DEVICE_KSEC, 0x06, METHOD_OUT_DIRECT, FILE_ANY_ACCESS) + +// 7: 0x39001E - called from SystemFunction040 aka RtlEncryptMemory with OptionFlags == 2 +#define IOCTL_KSEC_ENCRYPT_SAME_LOGON \ + CTL_CODE(FILE_DEVICE_KSEC, 0x07, METHOD_OUT_DIRECT, FILE_ANY_ACCESS) + +// 8: 0x390022 - called from SystemFunction041 aka RtlDecryptMemory with OptionFlags == 2 +#define IOCTL_KSEC_DECRYPT_SAME_LOGON \ + CTL_CODE(FILE_DEVICE_KSEC, 0x08, METHOD_OUT_DIRECT, FILE_ANY_ACCESS) + +// e: 0x390038 - see
http://wiki.mysmartlogon.com/Kernel_mode_SSP
+#define IOCTL_KSEC_REGISTER_EXTENSION \ + CTL_CODE(FILE_DEVICE_KSEC, 0x0e, METHOD_BUFFERED, FILE_ANY_ACCESS) Propchange: trunk/reactos/include/reactos/drivers/ksecdd/ksecioctl.h ------------------------------------------------------------------------------ svn:eol-style = native
10 years, 10 months
1
0
0
0
[akhaldi] 61870: [MOUNTMGR] * Remove one time inclusions from the main header and put them back where they belong. * Improve header inclusions. CORE-7716
by akhaldi@svn.reactos.org
Author: akhaldi Date: Tue Jan 28 21:45:44 2014 New Revision: 61870 URL:
http://svn.reactos.org/svn/reactos?rev=61870&view=rev
Log: [MOUNTMGR] * Remove one time inclusions from the main header and put them back where they belong. * Improve header inclusions. CORE-7716 Modified: trunk/reactos/drivers/filters/mountmgr/database.c trunk/reactos/drivers/filters/mountmgr/device.c trunk/reactos/drivers/filters/mountmgr/mntmgr.h trunk/reactos/drivers/filters/mountmgr/mountmgr.c trunk/reactos/drivers/filters/mountmgr/notify.c trunk/reactos/drivers/filters/mountmgr/point.c trunk/reactos/drivers/filters/mountmgr/symlink.c trunk/reactos/drivers/filters/mountmgr/uniqueid.c Modified: trunk/reactos/drivers/filters/mountmgr/database.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filters/mountmgr/d…
============================================================================== --- trunk/reactos/drivers/filters/mountmgr/database.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filters/mountmgr/database.c [iso-8859-1] Tue Jan 28 21:45:44 2014 @@ -22,8 +22,6 @@ * PURPOSE: Mount Manager - remote/local database handler * PROGRAMMER: Pierre Schweitzer (pierre.schweitzer(a)reactos.org) */ - -/* INCLUDES *****************************************************************/ #include "mntmgr.h" Modified: trunk/reactos/drivers/filters/mountmgr/device.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filters/mountmgr/d…
============================================================================== --- trunk/reactos/drivers/filters/mountmgr/device.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filters/mountmgr/device.c [iso-8859-1] Tue Jan 28 21:45:44 2014 @@ -23,8 +23,6 @@ * PROGRAMMER: Pierre Schweitzer (pierre.schweitzer(a)reactos.org) */ -/* INCLUDES *****************************************************************/ - #include "mntmgr.h" #define MAX_DEVICES 0x3E8 /* Matches 1000 devices */ Modified: trunk/reactos/drivers/filters/mountmgr/mntmgr.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filters/mountmgr/m…
============================================================================== --- trunk/reactos/drivers/filters/mountmgr/mntmgr.h [iso-8859-1] (original) +++ trunk/reactos/drivers/filters/mountmgr/mntmgr.h [iso-8859-1] Tue Jan 28 21:45:44 2014 @@ -2,14 +2,11 @@ #define _MNTMGR_H_ #include <ntifs.h> -#include <ntddk.h> #include <mountdev.h> #include <ntddvol.h> #include <wdmguid.h> -#include <ioevent.h> -#include <psfuncs.h> +#include <ndk/psfuncs.h> #include <ntdddisk.h> -#include <ntddvol.h> /* Enter FIXME */ #ifdef IsEqualGUID Modified: trunk/reactos/drivers/filters/mountmgr/mountmgr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filters/mountmgr/m…
============================================================================== --- trunk/reactos/drivers/filters/mountmgr/mountmgr.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filters/mountmgr/mountmgr.c [iso-8859-1] Tue Jan 28 21:45:44 2014 @@ -23,8 +23,6 @@ * PROGRAMMER: Pierre Schweitzer (pierre.schweitzer(a)reactos.org) * Alex Ionescu (alex.ionescu(a)reactos.org) */ - -/* INCLUDES *****************************************************************/ #include "mntmgr.h" Modified: trunk/reactos/drivers/filters/mountmgr/notify.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filters/mountmgr/n…
============================================================================== --- trunk/reactos/drivers/filters/mountmgr/notify.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filters/mountmgr/notify.c [iso-8859-1] Tue Jan 28 21:45:44 2014 @@ -24,9 +24,9 @@ * Alex Ionescu (alex.ionescu(a)reactos.org) */ -/* INCLUDES *****************************************************************/ - #include "mntmgr.h" + +#include <ioevent.h> #define NDEBUG #include <debug.h> Modified: trunk/reactos/drivers/filters/mountmgr/point.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filters/mountmgr/p…
============================================================================== --- trunk/reactos/drivers/filters/mountmgr/point.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filters/mountmgr/point.c [iso-8859-1] Tue Jan 28 21:45:44 2014 @@ -23,8 +23,6 @@ * PROGRAMMER: Pierre Schweitzer (pierre.schweitzer(a)reactos.org) */ -/* INCLUDES *****************************************************************/ - #include "mntmgr.h" #define NDEBUG Modified: trunk/reactos/drivers/filters/mountmgr/symlink.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filters/mountmgr/s…
============================================================================== --- trunk/reactos/drivers/filters/mountmgr/symlink.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filters/mountmgr/symlink.c [iso-8859-1] Tue Jan 28 21:45:44 2014 @@ -23,8 +23,6 @@ * PROGRAMMER: Pierre Schweitzer (pierre.schweitzer(a)reactos.org) */ -/* INCLUDES *****************************************************************/ - #include "mntmgr.h" #define NDEBUG Modified: trunk/reactos/drivers/filters/mountmgr/uniqueid.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filters/mountmgr/u…
============================================================================== --- trunk/reactos/drivers/filters/mountmgr/uniqueid.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filters/mountmgr/uniqueid.c [iso-8859-1] Tue Jan 28 21:45:44 2014 @@ -23,8 +23,6 @@ * PROGRAMMER: Pierre Schweitzer (pierre.schweitzer(a)reactos.org) */ -/* INCLUDES *****************************************************************/ - #include "mntmgr.h" #define NDEBUG
10 years, 10 months
1
0
0
0
[akhaldi] 61869: [NTFS] * Remove one time inclusions from the main header and put them back where they belong. CORE-7716
by akhaldi@svn.reactos.org
Author: akhaldi Date: Tue Jan 28 21:21:04 2014 New Revision: 61869 URL:
http://svn.reactos.org/svn/reactos?rev=61869&view=rev
Log: [NTFS] * Remove one time inclusions from the main header and put them back where they belong. CORE-7716 Modified: trunk/reactos/drivers/filesystems/ntfs/attrib.c trunk/reactos/drivers/filesystems/ntfs/blockdev.c trunk/reactos/drivers/filesystems/ntfs/close.c trunk/reactos/drivers/filesystems/ntfs/create.c trunk/reactos/drivers/filesystems/ntfs/dirctl.c trunk/reactos/drivers/filesystems/ntfs/dispatch.c trunk/reactos/drivers/filesystems/ntfs/fastio.c trunk/reactos/drivers/filesystems/ntfs/fcb.c trunk/reactos/drivers/filesystems/ntfs/finfo.c trunk/reactos/drivers/filesystems/ntfs/fsctl.c trunk/reactos/drivers/filesystems/ntfs/mft.c trunk/reactos/drivers/filesystems/ntfs/misc.c trunk/reactos/drivers/filesystems/ntfs/ntfs.c trunk/reactos/drivers/filesystems/ntfs/ntfs.h trunk/reactos/drivers/filesystems/ntfs/rw.c Modified: trunk/reactos/drivers/filesystems/ntfs/attrib.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/ntfs/a…
============================================================================== --- trunk/reactos/drivers/filesystems/ntfs/attrib.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/ntfs/attrib.c [iso-8859-1] Tue Jan 28 21:21:04 2014 @@ -31,9 +31,6 @@ #define NDEBUG #include <debug.h> -/* GLOBALS *****************************************************************/ - - /* FUNCTIONS ****************************************************************/ static Modified: trunk/reactos/drivers/filesystems/ntfs/blockdev.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/ntfs/b…
============================================================================== --- trunk/reactos/drivers/filesystems/ntfs/blockdev.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/ntfs/blockdev.c [iso-8859-1] Tue Jan 28 21:21:04 2014 @@ -29,9 +29,6 @@ #define NDEBUG #include <debug.h> - -/* GLOBALS *****************************************************************/ - /* FUNCTIONS ****************************************************************/ Modified: trunk/reactos/drivers/filesystems/ntfs/close.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/ntfs/c…
============================================================================== --- trunk/reactos/drivers/filesystems/ntfs/close.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/ntfs/close.c [iso-8859-1] Tue Jan 28 21:21:04 2014 @@ -30,9 +30,6 @@ #define NDEBUG #include <debug.h> - -/* GLOBALS *****************************************************************/ - /* FUNCTIONS ****************************************************************/ Modified: trunk/reactos/drivers/filesystems/ntfs/create.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/ntfs/c…
============================================================================== --- trunk/reactos/drivers/filesystems/ntfs/create.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/ntfs/create.c [iso-8859-1] Tue Jan 28 21:21:04 2014 @@ -29,9 +29,6 @@ #define NDEBUG #include <debug.h> - -/* GLOBALS *****************************************************************/ - /* FUNCTIONS ****************************************************************/ Modified: trunk/reactos/drivers/filesystems/ntfs/dirctl.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/ntfs/d…
============================================================================== --- trunk/reactos/drivers/filesystems/ntfs/dirctl.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/ntfs/dirctl.c [iso-8859-1] Tue Jan 28 21:21:04 2014 @@ -29,9 +29,6 @@ #define NDEBUG #include <debug.h> - -/* GLOBALS *****************************************************************/ - /* FUNCTIONS ****************************************************************/ Modified: trunk/reactos/drivers/filesystems/ntfs/dispatch.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/ntfs/d…
============================================================================== --- trunk/reactos/drivers/filesystems/ntfs/dispatch.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/ntfs/dispatch.c [iso-8859-1] Tue Jan 28 21:21:04 2014 @@ -30,9 +30,6 @@ #define NDEBUG #include <debug.h> - -/* GLOBALS *****************************************************************/ - /* FUNCTIONS ****************************************************************/ Modified: trunk/reactos/drivers/filesystems/ntfs/fastio.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/ntfs/f…
============================================================================== --- trunk/reactos/drivers/filesystems/ntfs/fastio.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/ntfs/fastio.c [iso-8859-1] Tue Jan 28 21:21:04 2014 @@ -31,7 +31,6 @@ #include <debug.h> #include "ntfs.h" - /* FUNCTIONS ****************************************************************/ Modified: trunk/reactos/drivers/filesystems/ntfs/fcb.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/ntfs/f…
============================================================================== --- trunk/reactos/drivers/filesystems/ntfs/fcb.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/ntfs/fcb.c [iso-8859-1] Tue Jan 28 21:21:04 2014 @@ -30,15 +30,9 @@ #define NDEBUG #include <debug.h> -/* GLOBALS *****************************************************************/ - - - /* MACROS *******************************************************************/ #define TAG_FCB 'BCFI' - - /* FUNCTIONS ****************************************************************/ Modified: trunk/reactos/drivers/filesystems/ntfs/finfo.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/ntfs/f…
============================================================================== --- trunk/reactos/drivers/filesystems/ntfs/finfo.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/ntfs/finfo.c [iso-8859-1] Tue Jan 28 21:21:04 2014 @@ -29,9 +29,6 @@ #define NDEBUG #include <debug.h> - -/* GLOBALS *****************************************************************/ - /* FUNCTIONS ****************************************************************/ Modified: trunk/reactos/drivers/filesystems/ntfs/fsctl.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/ntfs/f…
============================================================================== --- trunk/reactos/drivers/filesystems/ntfs/fsctl.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/ntfs/fsctl.c [iso-8859-1] Tue Jan 28 21:21:04 2014 @@ -29,10 +29,10 @@ #include "ntfs.h" +#include <ntdddisk.h> + #define NDEBUG #include <debug.h> - -/* GLOBALS *****************************************************************/ /* FUNCTIONS ****************************************************************/ Modified: trunk/reactos/drivers/filesystems/ntfs/mft.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/ntfs/m…
============================================================================== --- trunk/reactos/drivers/filesystems/ntfs/mft.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/ntfs/mft.c [iso-8859-1] Tue Jan 28 21:21:04 2014 @@ -31,11 +31,7 @@ #define NDEBUG #include <debug.h> -/* GLOBALS *****************************************************************/ - - /* FUNCTIONS ****************************************************************/ - NTSTATUS NtfsOpenMft(PDEVICE_EXTENSION Vcb) Modified: trunk/reactos/drivers/filesystems/ntfs/misc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/ntfs/m…
============================================================================== --- trunk/reactos/drivers/filesystems/ntfs/misc.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/ntfs/misc.c [iso-8859-1] Tue Jan 28 21:21:04 2014 @@ -30,9 +30,6 @@ #define NDEBUG #include <debug.h> - -/* GLOBALS *****************************************************************/ - /* FUNCTIONS ****************************************************************/ Modified: trunk/reactos/drivers/filesystems/ntfs/ntfs.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/ntfs/n…
============================================================================== --- trunk/reactos/drivers/filesystems/ntfs/ntfs.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/ntfs/ntfs.c [iso-8859-1] Tue Jan 28 21:21:04 2014 @@ -34,7 +34,6 @@ /* GLOBALS *****************************************************************/ PNTFS_GLOBAL_DATA NtfsGlobalData = NULL; - /* FUNCTIONS ****************************************************************/ Modified: trunk/reactos/drivers/filesystems/ntfs/ntfs.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/ntfs/n…
============================================================================== --- trunk/reactos/drivers/filesystems/ntfs/ntfs.h [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/ntfs/ntfs.h [iso-8859-1] Tue Jan 28 21:21:04 2014 @@ -2,8 +2,6 @@ #define NTFS_H #include <ntifs.h> -#include <ntddk.h> -#include <ntdddisk.h> #define CACHEPAGESIZE(pDeviceExt) \ ((pDeviceExt)->NtfsInfo.UCHARsPerCluster > PAGE_SIZE ? \ Modified: trunk/reactos/drivers/filesystems/ntfs/rw.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/ntfs/r…
============================================================================== --- trunk/reactos/drivers/filesystems/ntfs/rw.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/ntfs/rw.c [iso-8859-1] Tue Jan 28 21:21:04 2014 @@ -32,12 +32,10 @@ #define NDEBUG #include <debug.h> - /* GLOBALS *******************************************************************/ #define ROUND_UP(N, S) ((((N) + (S) - 1) / (S)) * (S)) #define ROUND_DOWN(N, S) ((N) - ((N) % (S))) - /* FUNCTIONS ****************************************************************/
10 years, 10 months
1
0
0
0
[akhaldi] 61868: [MSFS] * Remove one time inclusions from the main header and put them back where they belong. CORE-7716
by akhaldi@svn.reactos.org
Author: akhaldi Date: Tue Jan 28 20:57:32 2014 New Revision: 61868 URL:
http://svn.reactos.org/svn/reactos?rev=61868&view=rev
Log: [MSFS] * Remove one time inclusions from the main header and put them back where they belong. CORE-7716 Modified: trunk/reactos/drivers/filesystems/msfs/create.c trunk/reactos/drivers/filesystems/msfs/finfo.c trunk/reactos/drivers/filesystems/msfs/fsctrl.c trunk/reactos/drivers/filesystems/msfs/msfs.c trunk/reactos/drivers/filesystems/msfs/msfs.h trunk/reactos/drivers/filesystems/msfs/rw.c Modified: trunk/reactos/drivers/filesystems/msfs/create.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/msfs/c…
============================================================================== --- trunk/reactos/drivers/filesystems/msfs/create.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/msfs/create.c [iso-8859-1] Tue Jan 28 20:57:32 2014 @@ -10,9 +10,10 @@ #include "msfs.h" +#include <ndk/iotypes.h> + #define NDEBUG #include <debug.h> - /* FUNCTIONS *****************************************************************/ Modified: trunk/reactos/drivers/filesystems/msfs/finfo.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/msfs/f…
============================================================================== --- trunk/reactos/drivers/filesystems/msfs/finfo.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/msfs/finfo.c [iso-8859-1] Tue Jan 28 20:57:32 2014 @@ -17,7 +17,6 @@ #undef MAILSLOT_WAIT_FOREVER #define MAILSLOT_NO_MESSAGE MAXULONG #define MAILSLOT_WAIT_FOREVER MAXULONG - /* FUNCTIONS *****************************************************************/ Modified: trunk/reactos/drivers/filesystems/msfs/fsctrl.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/msfs/f…
============================================================================== --- trunk/reactos/drivers/filesystems/msfs/fsctrl.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/msfs/fsctrl.c [iso-8859-1] Tue Jan 28 20:57:32 2014 @@ -12,7 +12,6 @@ #define NDEBUG #include <debug.h> - /* FUNCTIONS *****************************************************************/ Modified: trunk/reactos/drivers/filesystems/msfs/msfs.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/msfs/m…
============================================================================== --- trunk/reactos/drivers/filesystems/msfs/msfs.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/msfs/msfs.c [iso-8859-1] Tue Jan 28 20:57:32 2014 @@ -12,7 +12,6 @@ #define NDEBUG #include <debug.h> - /* FUNCTIONS *****************************************************************/ Modified: trunk/reactos/drivers/filesystems/msfs/msfs.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/msfs/m…
============================================================================== --- trunk/reactos/drivers/filesystems/msfs/msfs.h [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/msfs/msfs.h [iso-8859-1] Tue Jan 28 20:57:32 2014 @@ -10,7 +10,6 @@ #define __DRIVERS_FS_MS_MSFS_H #include <ntifs.h> -#include <iotypes.h> #define DEFAULTAPI NTAPI Modified: trunk/reactos/drivers/filesystems/msfs/rw.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/msfs/r…
============================================================================== --- trunk/reactos/drivers/filesystems/msfs/rw.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/msfs/rw.c [iso-8859-1] Tue Jan 28 20:57:32 2014 @@ -12,7 +12,6 @@ #define NDEBUG #include <debug.h> - /* FUNCTIONS *****************************************************************/
10 years, 10 months
1
0
0
0
[hbelusca] 61867: [NTVDM]: Add debug print for timer ticks to try to find why the emulator sometimes hangs...
by hbelusca@svn.reactos.org
Author: hbelusca Date: Tue Jan 28 20:39:16 2014 New Revision: 61867 URL:
http://svn.reactos.org/svn/reactos?rev=61867&view=rev
Log: [NTVDM]: Add debug print for timer ticks to try to find why the emulator sometimes hangs... Modified: branches/ntvdm/subsystems/ntvdm/ntvdm.c Modified: branches/ntvdm/subsystems/ntvdm/ntvdm.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/ntvdm.c?…
============================================================================== --- branches/ntvdm/subsystems/ntvdm/ntvdm.c [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/ntvdm.c [iso-8859-1] Tue Jan 28 20:39:16 2014 @@ -331,7 +331,7 @@ #ifdef IPS_DISPLAY if ((CurrentTickCount - LastCyclePrintout) >= 1000) { - DPRINT1("NTVDM: %lu Instructions Per Second\n", Cycles); + DPRINT1("NTVDM: %lu Instructions Per Second; TimerTicks = %lu\n", Cycles, TimerTicks); LastCyclePrintout = CurrentTickCount; Cycles = 0; }
10 years, 10 months
1
0
0
0
[hbelusca] 61866: [NTVDM] Part 2 of PIT + sound fix. - Move port 61h management from speaker.c to the emulator.c module; - Add PIT OUT callbacks support; - Add (unimplemented) PitSetGate function (...
by hbelusca@svn.reactos.org
Author: hbelusca Date: Tue Jan 28 20:24:24 2014 New Revision: 61866 URL:
http://svn.reactos.org/svn/reactos?rev=61866&view=rev
Log: [NTVDM] Part 2 of PIT + sound fix. - Move port 61h management from speaker.c to the emulator.c module; - Add PIT OUT callbacks support; - Add (unimplemented) PitSetGate function (will be used later on). Still WIP. Modified: branches/ntvdm/subsystems/ntvdm/emulator.c branches/ntvdm/subsystems/ntvdm/emulator.h branches/ntvdm/subsystems/ntvdm/hardware/speaker.c branches/ntvdm/subsystems/ntvdm/hardware/speaker.h branches/ntvdm/subsystems/ntvdm/hardware/timer.c branches/ntvdm/subsystems/ntvdm/hardware/timer.h Modified: branches/ntvdm/subsystems/ntvdm/emulator.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/emulator…
============================================================================== --- branches/ntvdm/subsystems/ntvdm/emulator.c [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/emulator.c [iso-8859-1] Tue Jan 28 20:24:24 2014 @@ -31,6 +31,7 @@ BOOLEAN VdmRunning = TRUE; static BOOLEAN A20Line = FALSE; +static BYTE Port61hState = 0x00; LPCWSTR ExceptionName[] = { @@ -123,6 +124,79 @@ { DPRINT1("NTVDM: BOP_DEBUGGER\n"); DebugBreak(); +} + + +static BYTE WINAPI Port61hRead(ULONG Port) +{ + return Port61hState; +} + +static VOID WINAPI Port61hWrite(ULONG Port, BYTE Data) +{ + BYTE OldPort61hState = Port61hState; + + /* Only the four lowest bytes can be written */ + Port61hState = (Port61hState & 0xF0) | (Data & 0x0F); + + if ((OldPort61hState ^ Port61hState) & 0x01) + { + DPRINT1("PIT 2 Gate %s\n", Port61hState & 0x01 ? "on" : "off"); + } + + PitSetGate(2, !!(Port61hState & 0x01)); + + if ((OldPort61hState ^ Port61hState) & 0x02) + { + /* There were some change for the speaker... */ + DPRINT1("Speaker %s\n", Port61hState & 0x02 ? "on" : "off"); + } +} + +static VOID WINAPI PitChan0Out(LPVOID Param, BOOLEAN State) +{ + if (State) + { + DPRINT("PicInterruptRequest\n"); + PicInterruptRequest(0); // Raise IRQ 0 + } + // else < Lower IRQ 0 > +} + +static VOID WINAPI PitChan1Out(LPVOID Param, BOOLEAN State) +{ +#if 0 + if (State) + { + /* Set bit 4 of Port 61h */ + Port61hState |= 1 << 4; + } + else + { + /* Clear bit 4 of Port 61h */ + Port61hState &= ~(1 << 4); + } +#else + Port61hState = (Port61hState & 0xEF) | (State << 4); +#endif +} + +static VOID WINAPI PitChan2Out(LPVOID Param, BOOLEAN State) +{ +#if 0 + if (State) + { + /* Set bit 5 of Port 61h */ + Port61hState |= 1 << 5; + } + else + { + /* Clear bit 5 of Port 61h */ + Port61hState &= ~(1 << 5); + } +#else + Port61hState = (Port61hState & 0xDF) | (State << 5); +#endif } /* PUBLIC FUNCTIONS ***********************************************************/ @@ -159,6 +233,14 @@ PitInitialize(); CmosInitialize(); SpeakerInitialize(); + + /* Set output functions */ + PitSetOutFunction(0, NULL, PitChan0Out); + PitSetOutFunction(1, NULL, PitChan1Out); + PitSetOutFunction(2, NULL, PitChan2Out); + + /* Register the I/O Ports */ + RegisterIoPort(CONTROL_SYSTEM_PORT61H, Port61hRead, Port61hWrite); /* Initialize the PS2 port */ PS2Initialize(ConsoleInput); Modified: branches/ntvdm/subsystems/ntvdm/emulator.h URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/emulator…
============================================================================== --- branches/ntvdm/subsystems/ntvdm/emulator.h [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/emulator.h [iso-8859-1] Tue Jan 28 20:24:24 2014 @@ -61,6 +61,10 @@ #define BCD_TO_BINARY(x) (((x) >> 12) * 1000 + ((x) >> 8) * 100 + ((x) >> 4) * 10 + ((x) & 0x0F)) +/* System I/O ports */ +#define CONTROL_SYSTEM_PORT61H 0x61 + + enum { EMULATOR_EXCEPTION_DIVISION_BY_ZERO, Modified: branches/ntvdm/subsystems/ntvdm/hardware/speaker.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/hardware…
============================================================================== --- branches/ntvdm/subsystems/ntvdm/hardware/speaker.c [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/hardware/speaker.c [iso-8859-1] Tue Jan 28 20:24:24 2014 @@ -25,37 +25,19 @@ /* PRIVATE VARIABLES **********************************************************/ -static BYTE Port61hState = 0x00; -HANDLE hBeep = NULL; +static HANDLE hBeep = NULL; /* PRIVATE FUNCTIONS **********************************************************/ -static BYTE SpeakerReadStatus(VOID) +/* PUBLIC FUNCTIONS ***********************************************************/ + +VOID SpeakerPool(VOID) { - return Port61hState; -} + BYTE Port61hState = IOReadB(CONTROL_SYSTEM_PORT61H); + BOOLEAN IsConnectedToPITChannel2 = !!(Port61hState & 0x01); + BOOLEAN SpeakerDataOn = !!(Port61hState & 0x02); -static VOID SpeakerWriteCommand(BYTE Value) -{ - BOOLEAN IsConnectedToPITChannel2; - UCHAR SpeakerData; - - Port61hState = Value; - IsConnectedToPITChannel2 = ((Port61hState & 0x01) != 0); - SpeakerData = (Port61hState & 0x02); - - if (PitChannel2 && IsConnectedToPITChannel2) - { - /* Set bit 5 of Port 61h */ - Port61hState |= 1 << 5; - } - else - { - /* Clear bit 5 of Port 61h */ - Port61hState &= ~(1 << 5); - } - - if (PitChannel2 && IsConnectedToPITChannel2 && (SpeakerData != 0)) + if (PitChannel2 && IsConnectedToPITChannel2 && SpeakerDataOn) { /* Start beeping - Adapted from kernel32:Beep() */ NTSTATUS Status; @@ -121,18 +103,6 @@ } } -static BYTE WINAPI SpeakerReadPort(ULONG Port) -{ - return SpeakerReadStatus(); -} - -static VOID WINAPI SpeakerWritePort(ULONG Port, BYTE Data) -{ - SpeakerWriteCommand(Data); -} - -/* PUBLIC FUNCTIONS ***********************************************************/ - VOID SpeakerInitialize(VOID) { NTSTATUS Status; @@ -165,9 +135,6 @@ { DPRINT1("Failed to open Beep driver, Status 0x%08lx\n", Status); } - - /* Register the I/O Ports */ - RegisterIoPort(SPEAKER_CONTROL_PORT, SpeakerReadPort, SpeakerWritePort); } VOID SpeakerCleanup(VOID) Modified: branches/ntvdm/subsystems/ntvdm/hardware/speaker.h URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/hardware…
============================================================================== --- branches/ntvdm/subsystems/ntvdm/hardware/speaker.h [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/hardware/speaker.h [iso-8859-1] Tue Jan 28 20:24:24 2014 @@ -15,9 +15,9 @@ /* DEFINES ********************************************************************/ -#define SPEAKER_CONTROL_PORT 0x61 +/* FUNCTIONS ******************************************************************/ -/* FUNCTIONS ******************************************************************/ +VOID SpeakerPool(VOID); VOID SpeakerInitialize(VOID); VOID SpeakerCleanup(VOID); Modified: branches/ntvdm/subsystems/ntvdm/hardware/timer.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/hardware…
============================================================================== --- branches/ntvdm/subsystems/ntvdm/hardware/timer.c [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/hardware/timer.c [iso-8859-1] Tue Jan 28 20:24:24 2014 @@ -37,13 +37,14 @@ if (PitChannels[Channel].LatchStatusSet == FALSE) { BYTE StatusLatch = 0; - /* HACK!! */BYTE NullCount = 0;/* HACK!! */ - - StatusLatch = PitChannels[Channel].Out << 7 | NullCount << 6; + /** HACK!! **/BYTE NullCount = 0;/** HACK!! **/ + + StatusLatch = PitChannels[Channel].Out << 7 | NullCount << 6; StatusLatch |= (PitChannels[Channel].ReadWriteMode & 0x03) << 4; StatusLatch |= (PitChannels[Channel].Mode & 0x07) << 1; StatusLatch |= (PitChannels[Channel].Bcd & 0x01); + /* Latch the counter's status */ PitChannels[Channel].LatchStatusSet = TRUE; PitChannels[Channel].StatusLatch = StatusLatch; } @@ -61,23 +62,24 @@ */ if (PitChannels[Channel].ReadStatus == 0x00) { + /* Latch the counter's value */ PitChannels[Channel].ReadStatus = PitChannels[Channel].ReadWriteMode; /* Convert the current value to BCD if needed */ - PitChannels[Channel].OutputLatch = READ_PIT_VALUE(PitChannels[Channel], - PitChannels[Channel].CurrentValue); + PitChannels[Channel].OutputLatch = + READ_PIT_VALUE(PitChannels[Channel], PitChannels[Channel].CurrentValue); } } static VOID PitSetOut(PPIT_CHANNEL Channel, BOOLEAN State) { - if (State == Channel->Out) return; + /** HACK!! **\ if (State == Channel->Out) return; \** HACK!! **/ /* Set the new state of the OUT pin */ Channel->Out = State; - // /* Call the callback */ - // if (Channel->OutFunction) Channel->OutFunction(Channel->OutParam, State); + /* Call the callback */ + if (Channel->OutFunction) Channel->OutFunction(Channel->OutParam, State); } static VOID PitInitCounter(PPIT_CHANNEL Channel) @@ -138,20 +140,16 @@ /* ... otherwise, set the modes and reset flip-flops */ PitChannels[Channel].ReadWriteMode = ReadWriteMode; + PitChannels[Channel].ReadStatus = 0x00; + PitChannels[Channel].WriteStatus = 0x00; PitChannels[Channel].LatchStatusSet = FALSE; PitChannels[Channel].StatusLatch = 0x00; - PitChannels[Channel].ReadStatus = 0x00; - PitChannels[Channel].WriteStatus = 0x00; - PitChannels[Channel].CountRegister = 0x00; PitChannels[Channel].OutputLatch = 0x00; - PitChannels[Channel].Pulsed = FALSE; - - - // PitChannels[Channel].Out = FALSE; // <-- unneeded, see the PitInitCounter call below. + /** HACK!! **/PitChannels[Channel].FlipFlop = FALSE;/** HACK!! **/ /* Fix the current value if we switch to BCD counting */ PitChannels[Channel].Bcd = IsBcd; @@ -192,9 +190,8 @@ LPWORD CurrentValue = NULL; /* - * If the status was latched, the first read operation - * will return the latched status, whichever the count - * value or the status was latched first. + * If the status was latched, the first read operation will return the + * latched status, whichever value (count or status) was latched first. */ if (PitChannels[Channel].LatchStatusSet) { @@ -238,6 +235,8 @@ { PitChannels[Channel].WriteStatus = PitChannels[Channel].ReadWriteMode; } + + ASSERT(PitChannels[Channel].WriteStatus != 0); ReadWriteMode = &PitChannels[Channel].WriteStatus; @@ -261,6 +260,7 @@ { if (PitChannels[Channel].CountRegister == 0x0000) { + /* Wrap around to the highest count */ if (PitChannels[Channel].Bcd) PitChannels[Channel].CountRegister = 9999; else @@ -268,8 +268,8 @@ } /* Convert the current value from BCD if needed */ - PitChannels[Channel].CountRegister = WRITE_PIT_VALUE(PitChannels[Channel], - PitChannels[Channel].CountRegister); + PitChannels[Channel].CountRegister = + WRITE_PIT_VALUE(PitChannels[Channel], PitChannels[Channel].CountRegister); PitChannels[Channel].ReloadValue = PitChannels[Channel].CountRegister; } } @@ -311,6 +311,8 @@ static VOID PitDecrementCount(PPIT_CHANNEL Channel, DWORD Count) { + if (Count == 0) return; + switch (Channel->Mode) { case PIT_MODE_INT_ON_TERMINAL_COUNT: @@ -324,11 +326,10 @@ else Channel->CurrentValue -= Count; /* Did it fall to the terminal count? */ - if (Channel->CurrentValue == 0 && !Channel->Pulsed) + if (Channel->CurrentValue == 0 && !Channel->Out) { /* Yes, raise the output line */ - if (Channel == &PitChannels[0]) PicInterruptRequest(0); - Channel->Pulsed = TRUE; + PitSetOut(Channel, TRUE); } break; } @@ -342,7 +343,7 @@ if ((Count > Channel->CurrentValue) && (Channel->CurrentValue != 0)) { - /* Decrease the count */ + /* Decrement the count */ Count -= Channel->CurrentValue; /* Reload the value */ @@ -353,7 +354,7 @@ } else { - /* Decrease the value */ + /* Decrement the value */ Channel->CurrentValue -= Count; /* Clear the count */ @@ -368,8 +369,8 @@ } } - /* If there was a reload on channel 0, raise IRQ 0 */ - if ((Channel == &PitChannels[0]) && Reloaded) PicInterruptRequest(0); + /* If there was a reload, raise the output line */ + if (Reloaded) PitSetOut(Channel, TRUE); break; } @@ -387,7 +388,7 @@ if (((Count * 2) > Channel->CurrentValue) && (Channel->CurrentValue != 0)) { - /* Decrease the count */ + /* Decrement the count */ Count -= Channel->CurrentValue / 2; /* Reload the value */ @@ -398,7 +399,7 @@ } else { - /* Decrease the value */ + /* Decrement the value */ Channel->CurrentValue -= Count * 2; /* Clear the count */ @@ -421,16 +422,15 @@ /* Toggle the flip-flop if the number of reloads was odd */ if (ReloadCount & 1) { - Channel->Out = !Channel->Out; + Channel->FlipFlop = !Channel->FlipFlop; + // PitSetOut(Channel, !Channel->Out); } - /* Was there any rising edge on channel 0 ? */ - if (((Channel->Out && (ReloadCount == 1)) - || (ReloadCount > 1)) - && (Channel == &PitChannels[0])) + /* Was there any rising edge? */ + if ((Channel->FlipFlop && (ReloadCount == 1)) || (ReloadCount > 1)) { - /* Yes, IRQ 0 */ - PicInterruptRequest(0); + /* Yes, raise the output line */ + PitSetOut(Channel, TRUE); } break; @@ -453,6 +453,23 @@ /* PUBLIC FUNCTIONS ***********************************************************/ +VOID PitSetOutFunction(BYTE Channel, LPVOID Param, PIT_OUT_FUNCTION OutFunction) +{ + if (Channel >= PIT_CHANNELS) return; + + PitChannels[Channel].OutParam = Param; + PitChannels[Channel].OutFunction = OutFunction; +} + +VOID PitSetGate(BYTE Channel, BOOLEAN State) +{ + if (Channel >= PIT_CHANNELS) return; + if (State == PitChannels[Channel].Gate) return; + + /* UNIMPLEMENTED */ + PitChannels[Channel].Gate = State; +} + VOID PitClock(DWORD Count) { UINT i; @@ -461,7 +478,7 @@ for (i = 0; i < PIT_CHANNELS; i++) { - // if (!PitChannels[i].Couting) continue; + // if (!PitChannels[i].Counting) continue; PitDecrementCount(&PitChannels[i], Count); } } @@ -487,6 +504,14 @@ VOID PitInitialize(VOID) { + /* Set up the timers to their default value */ + PitSetOutFunction(0, NULL, NULL); + PitSetGate(0, TRUE); + PitSetOutFunction(1, NULL, NULL); + PitSetGate(1, TRUE); + PitSetOutFunction(2, NULL, NULL); + PitSetGate(2, FALSE); + /* Register the I/O Ports */ RegisterIoPort(PIT_COMMAND_PORT, NULL , PitWritePort); RegisterIoPort(PIT_DATA_PORT(0), PitReadPort, PitWritePort); Modified: branches/ntvdm/subsystems/ntvdm/hardware/timer.h URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/hardware…
============================================================================== --- branches/ntvdm/subsystems/ntvdm/hardware/timer.h [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/hardware/timer.h [iso-8859-1] Tue Jan 28 20:24:24 2014 @@ -38,23 +38,25 @@ PIT_MODE_HARDWARE_STROBE } PIT_MODE, *PPIT_MODE; +typedef VOID (WINAPI *PIT_OUT_FUNCTION)(LPVOID Param, BOOLEAN State); + typedef struct _PIT_CHANNEL { - BOOLEAN Pulsed; - - - /* PIT Status members */ + /* PIT Status fields */ PIT_MODE Mode; BOOLEAN Bcd; BYTE ReadWriteMode; // 0 --> Counter Latch ; 1 --> LSB R/W ; 2 --> MSB R/W ; 3 --> LSB then MSB R/W - /* Reading the PIT status byte */ + /* For interleaved reading and writing in 2-byte RW mode */ + BYTE ReadStatus; // Same convention as ReadWriteMode + BYTE WriteStatus; // Same convention as ReadWriteMode + + /* For reading the PIT status byte */ BOOLEAN LatchStatusSet; BYTE StatusLatch; - /* For interleaving reading and writing in 2-byte RW mode */ - BYTE ReadStatus; // Same convention as ReadWriteMode - BYTE WriteStatus; // Same convention as ReadWriteMode + /* Counting */ + BOOLEAN Gate; /**/WORD CountRegister;/**/ // Our ReloadValue ??? WORD OutputLatch; @@ -65,12 +67,18 @@ /* PIT Output */ BOOLEAN Out; // 0: Low ; 1: High + /** HACK!! **/BOOLEAN FlipFlop;/** HACK!! **/ + LPVOID OutParam; + PIT_OUT_FUNCTION OutFunction; } PIT_CHANNEL, *PPIT_CHANNEL; extern PPIT_CHANNEL PitChannel2; // Needed for PC Speaker /* FUNCTIONS ******************************************************************/ + +VOID PitSetOutFunction(BYTE Channel, LPVOID Param, PIT_OUT_FUNCTION OutFunction); +VOID PitSetGate(BYTE Channel, BOOLEAN State); VOID PitClock(DWORD Count); DWORD PitGetResolution(VOID);
10 years, 10 months
1
0
0
0
← Newer
1
2
3
4
5
6
...
43
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
Results per page:
10
25
50
100
200