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
October 2006
----- 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
17 participants
357 discussions
Start a n
N
ew thread
[jimtabor] 24553: Implement Get & Set batch limit.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Tue Oct 17 09:30:54 2006 New Revision: 24553 URL:
http://svn.reactos.org/svn/reactos?rev=24553&view=rev
Log: Implement Get & Set batch limit. Modified: trunk/reactos/dll/win32/gdi32/include/gdi32p.h trunk/reactos/dll/win32/gdi32/misc/misc.c trunk/reactos/dll/win32/gdi32/misc/stubs.c Modified: trunk/reactos/dll/win32/gdi32/include/gdi32p.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/include/gd…
============================================================================== --- trunk/reactos/dll/win32/gdi32/include/gdi32p.h (original) +++ trunk/reactos/dll/win32/gdi32/include/gdi32p.h Tue Oct 17 09:30:54 2006 @@ -6,11 +6,14 @@ * PROGRAMMER: Alex Ionescu (alex(a)relsoft.net) */ +#define GDI_BATCH_LIMIT 20 + /* DATA **********************************************************************/ extern PGDI_TABLE_ENTRY GdiHandleTable; extern HANDLE hProcessHeap; extern HANDLE CurrentProcessId; +extern DWORD GDI_BatchLimit; typedef INT (CALLBACK* EMFPLAYPROC)( Modified: trunk/reactos/dll/win32/gdi32/misc/misc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/misc/misc.…
============================================================================== --- trunk/reactos/dll/win32/gdi32/misc/misc.c (original) +++ trunk/reactos/dll/win32/gdi32/misc/misc.c Tue Oct 17 09:30:54 2006 @@ -30,6 +30,7 @@ PGDI_TABLE_ENTRY GdiHandleTable = NULL; HANDLE CurrentProcessId = NULL; +DWORD GDI_BatchLimit = 1; /* * @implemented @@ -69,3 +70,29 @@ } return FALSE; } + + +/* + * @implemented + */ +DWORD +STDCALL +GdiSetBatchLimit(DWORD Limit) +{ + DWORD OldLimit = GDI_BatchLimit; + if ((!Limit) || (Limit > GDI_BATCH_LIMIT)) return Limit; + GdiFlush(); + GDI_BatchLimit = Limit; + return OldLimit; +} + + +/* + * @implemented + */ +DWORD +STDCALL +GdiGetBatchLimit() +{ + return GDI_BatchLimit; +} Modified: trunk/reactos/dll/win32/gdi32/misc/stubs.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/misc/stubs…
============================================================================== --- trunk/reactos/dll/win32/gdi32/misc/stubs.c (original) +++ trunk/reactos/dll/win32/gdi32/misc/stubs.c Tue Oct 17 09:30:54 2006 @@ -868,34 +868,6 @@ * implemented yet. */ return TRUE; -} - - -/* - * @unimplemented - */ -DWORD -STDCALL -GdiSetBatchLimit( - DWORD a0 - ) -{ - UNIMPLEMENTED; - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return 0; -} - - -/* - * @unimplemented - */ -DWORD -STDCALL -GdiGetBatchLimit() -{ - UNIMPLEMENTED; - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return 0; }
18 years, 2 months
1
0
0
0
[ion] 24552: - Merge some parts of IoInitSystem in the same main function instead of calling out to 10 external modules. - Re-factor some code into smaller functions. - Don't create some Object Directories twice, since now ExpCreateSystemRootLink does some of them. - Add some failure paths to I/O Init. - Implement a function to mark the boot partition DO_SYSTEM_BOOT_PARTITION in order to better catch some bugchecks.
by ion@svn.reactos.org
Author: ion Date: Tue Oct 17 09:14:57 2006 New Revision: 24552 URL:
http://svn.reactos.org/svn/reactos?rev=24552&view=rev
Log: - Merge some parts of IoInitSystem in the same main function instead of calling out to 10 external modules. - Re-factor some code into smaller functions. - Don't create some Object Directories twice, since now ExpCreateSystemRootLink does some of them. - Add some failure paths to I/O Init. - Implement a function to mark the boot partition DO_SYSTEM_BOOT_PARTITION in order to better catch some bugchecks. Modified: trunk/reactos/ntoskrnl/io/iomgr/driver.c trunk/reactos/ntoskrnl/io/iomgr/error.c trunk/reactos/ntoskrnl/io/iomgr/iomgr.c trunk/reactos/ntoskrnl/io/iomgr/timer.c trunk/reactos/ntoskrnl/io/iomgr/volume.c trunk/reactos/ntoskrnl/io/pnpmgr/pnpnotify.c trunk/reactos/ntoskrnl/ob/obinit.c Modified: trunk/reactos/ntoskrnl/io/iomgr/driver.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/iomgr/driver.c…
============================================================================== --- trunk/reactos/ntoskrnl/io/iomgr/driver.c (original) +++ trunk/reactos/ntoskrnl/io/iomgr/driver.c Tue Oct 17 09:14:57 2006 @@ -41,25 +41,7 @@ PLDR_DATA_TABLE_ENTRY *ModuleObject ); -#if defined (ALLOC_PRAGMA) -#pragma alloc_text(INIT, IopInitDriverImplementation) -#endif - - /* PRIVATE FUNCTIONS **********************************************************/ - -VOID -INIT_FUNCTION -IopInitDriverImplementation(VOID) -{ - InitializeListHead(&DriverReinitListHead); - KeInitializeSpinLock(&DriverReinitListLock); - DriverReinitTailEntry = NULL; - - InitializeListHead(&DriverBootReinitListHead); - KeInitializeSpinLock(&DriverBootReinitListLock); - DriverBootReinitTailEntry = NULL; -} NTSTATUS STDCALL IopInvalidDeviceRequest( Modified: trunk/reactos/ntoskrnl/io/iomgr/error.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/iomgr/error.c?…
============================================================================== --- trunk/reactos/ntoskrnl/io/iomgr/error.c (original) +++ trunk/reactos/ntoskrnl/io/iomgr/error.c Tue Oct 17 09:14:57 2006 @@ -31,16 +31,9 @@ HANDLE IopLogPort; WORK_QUEUE_ITEM IopErrorLogWorkItem; +PDEVICE_OBJECT IopErrorLogObject; + /* PRIVATE FUNCTIONS *********************************************************/ - -VOID -NTAPI -IopInitErrorLog(VOID) -{ - /* Initialize the locks and list head */ - KeInitializeSpinLock(&IopLogListLock); - InitializeListHead(&IopLogListHead); -} VOID NTAPI 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 (original) +++ trunk/reactos/ntoskrnl/io/iomgr/iomgr.c Tue Oct 17 09:14:57 2006 @@ -23,6 +23,14 @@ IN DEVICE_RELATION_TYPE Type ); +VOID +NTAPI +IopTimerDispatch( + IN PKDPC Dpc, + IN PVOID DeferredContext, + IN PVOID SystemArgument1, + IN PVOID SystemArgument2 +); /* DATA ********************************************************************/ @@ -49,16 +57,38 @@ extern KSPIN_LOCK ShutdownListLock; extern NPAGED_LOOKASIDE_LIST IoCompletionPacketLookaside; extern POBJECT_TYPE IoAdapterObjectType; +ERESOURCE IopDatabaseResource; +extern ERESOURCE FileSystemListLock; +ERESOURCE IopSecurityResource; +extern KGUARDED_MUTEX FsChangeNotifyListLock; +extern KGUARDED_MUTEX PnpNotifyListLock; +extern LIST_ENTRY IopDiskFsListHead; +extern LIST_ENTRY IopCdRomFsListHead; +extern LIST_ENTRY IopTapeFsListHead; +extern LIST_ENTRY IopNetworkFsListHead; +extern LIST_ENTRY DriverBootReinitListHead; +extern LIST_ENTRY DriverReinitListHead; +extern LIST_ENTRY PnpNotifyListHead; +extern LIST_ENTRY FsChangeNotifyListHead; +extern LIST_ENTRY IopLogListHead; +extern LIST_ENTRY IopTimerQueueHead; +extern KDPC IopTimerDpc; +extern KTIMER IopTimer; +extern KSPIN_LOCK CancelSpinLock; +extern KSPIN_LOCK IoVpbLock; +extern KSPIN_LOCK IoStatisticsLock; +extern KSPIN_LOCK DriverReinitListLock; +extern KSPIN_LOCK DriverBootReinitListLock; +extern KSPIN_LOCK IopLogListLock; +extern KSPIN_LOCK IopTimerLock; + +extern PDEVICE_OBJECT IopErrorLogObject; + NPAGED_LOOKASIDE_LIST IoLargeIrpLookaside; NPAGED_LOOKASIDE_LIST IoSmallIrpLookaside; NPAGED_LOOKASIDE_LIST IopMdlLookasideList; -VOID INIT_FUNCTION IopInitLookasideLists(VOID); - #if defined (ALLOC_PRAGMA) -#pragma alloc_text(INIT, IoInitCancelHandling) -#pragma alloc_text(INIT, IoInitShutdownNotification) -#pragma alloc_text(INIT, IopInitLookasideLists) #pragma alloc_text(INIT, IoInitSystem) #endif @@ -66,22 +96,7 @@ VOID INIT_FUNCTION -IoInitCancelHandling(VOID) -{ - extern KSPIN_LOCK CancelSpinLock; - KeInitializeSpinLock(&CancelSpinLock); -} - -VOID -INIT_FUNCTION -IoInitShutdownNotification (VOID) -{ - InitializeListHead(&ShutdownListHead); - KeInitializeSpinLock(&ShutdownListLock); -} - -VOID -INIT_FUNCTION +NTAPI IopInitLookasideLists(VOID) { ULONG LargeIrpSize, SmallIrpSize, MdlSize; @@ -225,28 +240,15 @@ } Prcb->PPLookasideList[LookasideMdlList].P = &CurrentList->L; } - - DPRINT("Done allocation\n"); } - BOOLEAN INIT_FUNCTION NTAPI -IoInitSystem(IN PLOADER_PARAMETER_BLOCK LoaderBlock) +IopCreateObjectTypes(VOID) { - PDEVICE_NODE DeviceNode; - PDRIVER_OBJECT DriverObject; - LDR_DATA_TABLE_ENTRY ModuleObject; - NTSTATUS Status; - CHAR Buffer[256]; - ANSI_STRING NtBootPath, RootString; OBJECT_TYPE_INITIALIZER ObjectTypeInitializer; UNICODE_STRING Name; - OBJECT_ATTRIBUTES ObjectAttributes; - UNICODE_STRING DirName; - UNICODE_STRING LinkName = RTL_CONSTANT_STRING(L"\\DosDevices"); - HANDLE Handle; /* Initialize default settings */ RtlZeroMemory(&ObjectTypeInitializer, sizeof(ObjectTypeInitializer)); @@ -259,19 +261,28 @@ /* Do the Adapter Type */ RtlInitUnicodeString(&Name, L"Adapter"); - ObCreateObjectType(&Name, &ObjectTypeInitializer, NULL, &IoAdapterObjectType); + if (!NT_SUCCESS(ObCreateObjectType(&Name, + &ObjectTypeInitializer, + NULL, + &IoAdapterObjectType))) return FALSE; /* Do the Controller Type */ RtlInitUnicodeString(&Name, L"Controller"); ObjectTypeInitializer.DefaultNonPagedPoolCharge = sizeof(CONTROLLER_OBJECT); - ObCreateObjectType(&Name, &ObjectTypeInitializer, NULL, &IoControllerObjectType); - - /* Do the Device Type */ + if (!NT_SUCCESS(ObCreateObjectType(&Name, + &ObjectTypeInitializer, + NULL, + &IoControllerObjectType))) return FALSE; + + /* Do the Device Type. FIXME: Needs Delete Routine! */ RtlInitUnicodeString(&Name, L"Device"); ObjectTypeInitializer.DefaultNonPagedPoolCharge = sizeof(DEVICE_OBJECT); ObjectTypeInitializer.ParseProcedure = IopParseDevice; ObjectTypeInitializer.SecurityProcedure = IopSecurityFile; - ObCreateObjectType(&Name, &ObjectTypeInitializer, NULL, &IoDeviceObjectType); + if (!NT_SUCCESS(ObCreateObjectType(&Name, + &ObjectTypeInitializer, + NULL, + &IoDeviceObjectType))) return FALSE; /* Initialize the Driver object type */ RtlInitUnicodeString(&Name, L"Driver"); @@ -279,7 +290,10 @@ ObjectTypeInitializer.DeleteProcedure = IopDeleteDriver; ObjectTypeInitializer.ParseProcedure = NULL; ObjectTypeInitializer.SecurityProcedure = NULL; - ObCreateObjectType(&Name, &ObjectTypeInitializer, NULL, &IoDriverObjectType); + if (!NT_SUCCESS(ObCreateObjectType(&Name, + &ObjectTypeInitializer, + NULL, + &IoDriverObjectType))) return FALSE; /* Initialize the I/O Completion object type */ RtlInitUnicodeString(&Name, L"IoCompletion"); @@ -288,7 +302,10 @@ ObjectTypeInitializer.InvalidAttributes |= OBJ_PERMANENT; ObjectTypeInitializer.GenericMapping = IopCompletionMapping; ObjectTypeInitializer.DeleteProcedure = IopDeleteIoCompletion; - ObCreateObjectType(&Name, &ObjectTypeInitializer, NULL, &IoCompletionType); + if (!NT_SUCCESS(ObCreateObjectType(&Name, + &ObjectTypeInitializer, + NULL, + &IoCompletionType))) return FALSE; /* Initialize the File object type */ RtlInitUnicodeString(&Name, L"File"); @@ -303,104 +320,187 @@ ObjectTypeInitializer.QueryNameProcedure = IopQueryNameFile; ObjectTypeInitializer.ParseProcedure = IopParseFile; ObjectTypeInitializer.UseDefaultObject = FALSE; - ObCreateObjectType(&Name, &ObjectTypeInitializer, NULL, &IoFileObjectType); - - /* - * Create the '\Driver' object directory - */ + if (!NT_SUCCESS(ObCreateObjectType(&Name, + &ObjectTypeInitializer, + NULL, + &IoFileObjectType))) return FALSE; + + /* Success */ + return TRUE; +} + +BOOLEAN +INIT_FUNCTION +NTAPI +IopCreateRootDirectories() +{ + OBJECT_ATTRIBUTES ObjectAttributes; + UNICODE_STRING DirName; + HANDLE Handle; + + /* Create the '\Driver' object directory */ RtlInitUnicodeString(&DirName, L"\\Driver"); InitializeObjectAttributes(&ObjectAttributes, - &DirName, - 0, - NULL, - NULL); - ZwCreateDirectoryObject(&Handle, - 0, - &ObjectAttributes); - - /* - * Create the '\FileSystem' object directory - */ - RtlInitUnicodeString(&DirName, - L"\\FileSystem"); + &DirName, + OBJ_PERMANENT, + NULL, + NULL); + if (!NT_SUCCESS(NtCreateDirectoryObject(&Handle, + DIRECTORY_ALL_ACCESS, + &ObjectAttributes))) return FALSE; + NtClose(Handle); + + /* Create the '\FileSystem' object directory */ + RtlInitUnicodeString(&DirName, L"\\FileSystem"); InitializeObjectAttributes(&ObjectAttributes, - &DirName, - 0, - NULL, - NULL); - ZwCreateDirectoryObject(&Handle, - 0, - &ObjectAttributes); - - /* - * Create the '\Device' directory - */ - RtlInitUnicodeString(&DirName, - L"\\Device"); + &DirName, + OBJ_PERMANENT, + NULL, + NULL); + if (!NT_SUCCESS(NtCreateDirectoryObject(&Handle, + DIRECTORY_ALL_ACCESS, + &ObjectAttributes))) return FALSE; + NtClose(Handle); + + /* Return success */ + return TRUE; +} + +BOOLEAN +INIT_FUNCTION +NTAPI +IopMarkBootPartition(IN PLOADER_PARAMETER_BLOCK LoaderBlock) +{ + OBJECT_ATTRIBUTES ObjectAttributes; + STRING DeviceString; + CHAR Buffer[256]; + UNICODE_STRING DeviceName; + NTSTATUS Status; + HANDLE FileHandle; + IO_STATUS_BLOCK IoStatusBlock; + PFILE_OBJECT FileObject; + + /* Build the ARC device name */ + sprintf(Buffer, "\\ArcName\\%s", LoaderBlock->ArcBootDeviceName); + RtlInitAnsiString(&DeviceString, Buffer); + Status = RtlAnsiStringToUnicodeString(&DeviceName, &DeviceString, TRUE); + if (!NT_SUCCESS(Status)) return FALSE; + + /* Open it */ InitializeObjectAttributes(&ObjectAttributes, - &DirName, - 0, - NULL, - NULL); - ZwCreateDirectoryObject(&Handle, - 0, - &ObjectAttributes); - - /* - * Create the '\??' directory - */ - RtlInitUnicodeString(&DirName, - L"\\??"); - InitializeObjectAttributes(&ObjectAttributes, - &DirName, - 0, - NULL, - NULL); - ZwCreateDirectoryObject(&Handle, - 0, - &ObjectAttributes); - - /* - * Create the '\ArcName' directory - */ - RtlInitUnicodeString(&DirName, - L"\\ArcName"); - InitializeObjectAttributes(&ObjectAttributes, - &DirName, - 0, - NULL, - NULL); - ZwCreateDirectoryObject(&Handle, - 0, - &ObjectAttributes); - - /* - * Initialize remaining subsubsystem - */ - IopInitDriverImplementation(); - IoInitCancelHandling(); - IoInitFileSystemImplementation(); - IoInitVpbImplementation(); - IoInitShutdownNotification(); - IopInitPnpNotificationImplementation(); - IopInitErrorLog(); - IopInitTimerImplementation(); + &DeviceName, + OBJ_CASE_INSENSITIVE, + NULL, + NULL); + Status = ZwOpenFile(&FileHandle, + FILE_READ_ATTRIBUTES, + &ObjectAttributes, + &IoStatusBlock, + 0, + FILE_NON_DIRECTORY_FILE); + if (!NT_SUCCESS(Status)) + { + /* Fail */ + KeBugCheckEx(INACCESSIBLE_BOOT_DEVICE, + (ULONG_PTR)&DeviceName, + Status, + 0, + 0); + } + + /* Get the DO */ + Status = ObReferenceObjectByHandle(FileHandle, + 0, + IoFileObjectType, + KernelMode, + (PVOID *)&FileObject, + NULL); + if (!NT_SUCCESS(Status)) + { + /* Fail */ + RtlFreeUnicodeString(&DeviceName); + return FALSE; + } + + /* Mark it as the boot partition */ + FileObject->DeviceObject->Flags |= DO_SYSTEM_BOOT_PARTITION; + + /* Save a copy of the DO for the I/O Error Logger */ + ObReferenceObject(FileObject->DeviceObject); + IopErrorLogObject = FileObject->DeviceObject; + + /* Cleanup and return success */ + RtlFreeUnicodeString(&DeviceName); + NtClose(FileHandle); + ObDereferenceObject(FileObject); + return TRUE; +} + +BOOLEAN +INIT_FUNCTION +NTAPI +IoInitSystem(IN PLOADER_PARAMETER_BLOCK LoaderBlock) +{ + LARGE_INTEGER ExpireTime; + PDEVICE_NODE DeviceNode; + PDRIVER_OBJECT DriverObject; + LDR_DATA_TABLE_ENTRY ModuleObject; + NTSTATUS Status; + CHAR Buffer[256]; + ANSI_STRING NtBootPath, RootString; + + /* Initialize empty NT Boot Path */ + RtlInitEmptyAnsiString(&NtBootPath, Buffer, sizeof(Buffer)); + + /* Initialize the lookaside lists */ IopInitLookasideLists(); - /* - * Create link from '\DosDevices' to '\??' directory - */ - RtlInitUnicodeString(&DirName, - L"\\??"); - IoCreateSymbolicLink(&LinkName, - &DirName); + /* Initialize all locks and lists */ + ExInitializeResource(&IopDatabaseResource); + ExInitializeResource(&FileSystemListLock); + ExInitializeResource(&IopSecurityResource); + KeInitializeGuardedMutex(&FsChangeNotifyListLock); + KeInitializeGuardedMutex(&PnpNotifyListLock); + InitializeListHead(&IopDiskFsListHead); + InitializeListHead(&IopCdRomFsListHead); + InitializeListHead(&IopTapeFsListHead); + InitializeListHead(&IopNetworkFsListHead); + InitializeListHead(&DriverBootReinitListHead); + InitializeListHead(&DriverReinitListHead); + InitializeListHead(&PnpNotifyListHead); + InitializeListHead(&ShutdownListHead); + InitializeListHead(&FsChangeNotifyListHead); + InitializeListHead(&IopLogListHead); + KeInitializeSpinLock(&CancelSpinLock); + KeInitializeSpinLock(&IoVpbLock); + KeInitializeSpinLock(&IoStatisticsLock); + KeInitializeSpinLock(&DriverReinitListLock); + KeInitializeSpinLock(&DriverBootReinitListLock); + KeInitializeSpinLock(&ShutdownListLock); + KeInitializeSpinLock(&IopLogListLock); + + /* Initialize Timer List Lock */ + KeInitializeSpinLock(&IopTimerLock); + + /* Initialize Timer List */ + InitializeListHead(&IopTimerQueueHead); + + /* Initialize the DPC/Timer which will call the other Timer Routines */ + ExpireTime.QuadPart = -10000000; + KeInitializeDpc(&IopTimerDpc, IopTimerDispatch, NULL); + KeInitializeTimerEx(&IopTimer, SynchronizationTimer); + KeSetTimerEx(&IopTimer, ExpireTime, 1000, &IopTimerDpc); + + /* Create Object Types */ + if (!IopCreateObjectTypes()) return FALSE; + + /* Create Object Directories */ + if (!IopCreateRootDirectories()) return FALSE; /* * Initialize PnP manager */ PnpInit(); - - RtlInitEmptyAnsiString(&NtBootPath, Buffer, sizeof(Buffer)); PnpInit2(); @@ -466,6 +566,9 @@ /* Create ARC names for boot devices */ IopCreateArcNames(LoaderBlock); + /* Mark the system boot partition */ + if (!IopMarkBootPartition(LoaderBlock)) return FALSE; + /* Read KDB Data */ KdbInit(); Modified: trunk/reactos/ntoskrnl/io/iomgr/timer.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/iomgr/timer.c?…
============================================================================== --- trunk/reactos/ntoskrnl/io/iomgr/timer.c (original) +++ trunk/reactos/ntoskrnl/io/iomgr/timer.c Tue Oct 17 09:14:57 2006 @@ -80,25 +80,6 @@ /* Unlock the Timers */ KeReleaseSpinLock(&IopTimerLock, OldIrql); -} - -VOID -FASTCALL -IopInitTimerImplementation(VOID) -{ - LARGE_INTEGER ExpireTime; - - /* Initialize Timer List Lock */ - KeInitializeSpinLock(&IopTimerLock); - - /* Initialize Timer List */ - InitializeListHead(&IopTimerQueueHead); - - /* Initialize the DPC/Timer which will call the other Timer Routines */ - ExpireTime.QuadPart = -10000000; - KeInitializeDpc(&IopTimerDpc, IopTimerDispatch, NULL); - KeInitializeTimerEx(&IopTimer, SynchronizationTimer); - KeSetTimerEx(&IopTimer, ExpireTime, 1000, &IopTimerDpc); } /* PUBLIC FUNCTIONS **********************************************************/ Modified: trunk/reactos/ntoskrnl/io/iomgr/volume.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/iomgr/volume.c…
============================================================================== --- trunk/reactos/ntoskrnl/io/iomgr/volume.c (original) +++ trunk/reactos/ntoskrnl/io/iomgr/volume.c Tue Oct 17 09:14:57 2006 @@ -29,30 +29,6 @@ KSPIN_LOCK IoVpbLock; /* PRIVATE FUNCTIONS *********************************************************/ - -VOID -INIT_FUNCTION -NTAPI -IoInitVpbImplementation(VOID) -{ - /* Just initialize the VPB Lock */ - KeInitializeSpinLock(&IoVpbLock); -} - -VOID -INIT_FUNCTION -NTAPI -IoInitFileSystemImplementation(VOID) -{ - /* Initialize the FS Lists and Locks */ - InitializeListHead(&IopDiskFsListHead); - InitializeListHead(&IopNetworkFsListHead); - InitializeListHead(&IopCdRomFsListHead); - InitializeListHead(&IopTapeFsListHead); - ExInitializeResourceLite(&FileSystemListLock); - InitializeListHead(&FsChangeNotifyListHead); - KeInitializeGuardedMutex(&FsChangeNotifyListLock); -} PVPB NTAPI Modified: trunk/reactos/ntoskrnl/io/pnpmgr/pnpnotify.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/pnpmgr/pnpnoti…
============================================================================== --- trunk/reactos/ntoskrnl/io/pnpmgr/pnpnotify.c (original) +++ trunk/reactos/ntoskrnl/io/pnpmgr/pnpnotify.c Tue Oct 17 09:14:57 2006 @@ -31,8 +31,8 @@ PDRIVER_NOTIFICATION_CALLBACK_ROUTINE PnpNotificationProc; } PNP_NOTIFY_ENTRY, *PPNP_NOTIFY_ENTRY; -static KGUARDED_MUTEX PnpNotifyListLock; -static LIST_ENTRY PnpNotifyListHead; +KGUARDED_MUTEX PnpNotifyListLock; +LIST_ENTRY PnpNotifyListHead; /* FUNCTIONS *****************************************************************/ @@ -323,11 +323,4 @@ ExFreePoolWithTag(NotificationStructure, TAG_PNP_NOTIFY); } -VOID INIT_FUNCTION -IopInitPnpNotificationImplementation(VOID) -{ - KeInitializeGuardedMutex(&PnpNotifyListLock); - InitializeListHead(&PnpNotifyListHead); -} - /* EOF */ Modified: trunk/reactos/ntoskrnl/ob/obinit.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ob/obinit.c?rev=2…
============================================================================== --- trunk/reactos/ntoskrnl/ob/obinit.c (original) +++ trunk/reactos/ntoskrnl/ob/obinit.c Tue Oct 17 09:14:57 2006 @@ -127,6 +127,8 @@ SECURITY_DESCRIPTOR SecurityDescriptor; OBJECT_TYPE_INITIALIZER ObjectTypeInitializer; OBP_LOOKUP_CONTEXT Context; + UNICODE_STRING LinkName = RTL_CONSTANT_STRING(L"\\DosDevices"); + HANDLE Handle; PKPRCB Prcb = KeGetCurrentPrcb(); /* Check if this is actually Phase 1 initialization */ @@ -287,6 +289,19 @@ /* Create 'symbolic link' object type */ ObInitSymbolicLinkImplementation(); + /* Create the '\??' directory */ + RtlInitUnicodeString(&Name, L"\\??"); + InitializeObjectAttributes(&ObjectAttributes, + &Name, + 0, + NULL, + NULL); + ZwCreateDirectoryObject(&Handle, 0, &ObjectAttributes); + + /* Create link from '\DosDevices' to '\??' directory */ + RtlInitUnicodeString(&Name, L"\\??"); + IoCreateSymbolicLink(&LinkName, &Name); + /* FIXME: Hack Hack! */ ObSystemDeviceMap = ExAllocatePoolWithTag(NonPagedPool, sizeof(*ObSystemDeviceMap), TAG('O', 'b', 'D', 'm')); RtlZeroMemory(ObSystemDeviceMap, sizeof(*ObSystemDeviceMap));
18 years, 2 months
1
0
0
0
[jimtabor] 24551: Win32k GDI Compatibility Project: - Add new Gdi user data structure - Fixed Meta constants - Add new GetDCWord constant
by jimtabor@svn.reactos.org
Author: jimtabor Date: Tue Oct 17 08:32:18 2006 New Revision: 24551 URL:
http://svn.reactos.org/svn/reactos?rev=24551&view=rev
Log: Win32k GDI Compatibility Project: - Add new Gdi user data structure - Fixed Meta constants - Add new GetDCWord constant Modified: trunk/reactos/include/reactos/win32k/ntgdibad.h trunk/reactos/include/reactos/win32k/ntgdihdl.h trunk/reactos/include/reactos/win32k/ntgdityp.h Modified: trunk/reactos/include/reactos/win32k/ntgdibad.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/win32k/ntg…
============================================================================== --- trunk/reactos/include/reactos/win32k/ntgdibad.h (original) +++ trunk/reactos/include/reactos/win32k/ntgdibad.h Tue Oct 17 08:32:18 2006 @@ -422,7 +422,7 @@ CONST LPBYTE Data ); -/* Should be done in user-mode. */ +/* Should be NtGdiFlush. */ BOOL STDCALL NtGdiGdiFlush (VOID); /* Should be done in user-mode. */ Modified: trunk/reactos/include/reactos/win32k/ntgdihdl.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/win32k/ntg…
============================================================================== --- trunk/reactos/include/reactos/win32k/ntgdihdl.h (original) +++ trunk/reactos/include/reactos/win32k/ntgdihdl.h Tue Oct 17 08:32:18 2006 @@ -43,10 +43,10 @@ #define GDI_OBJECT_TYPE_PEN 0x00300000 #define GDI_OBJECT_TYPE_EXTPEN 0x00500000 #define GDI_OBJECT_TYPE_COLORSPACE 0x00090000 +#define GDI_OBJECT_TYPE_METADC 0x00660000 +#define GDI_OBJECT_TYPE_METAFILE 0x00260000 +#define GDI_OBJECT_TYPE_ENHMETAFILE 0x00460000 /* Following object types made up for ROS */ -#define GDI_OBJECT_TYPE_METADC 0x00710000 -#define GDI_OBJECT_TYPE_METAFILE 0x00720000 -#define GDI_OBJECT_TYPE_ENHMETAFILE 0x00730000 #define GDI_OBJECT_TYPE_ENHMETADC 0x00740000 #define GDI_OBJECT_TYPE_MEMDC 0x00750000 #define GDI_OBJECT_TYPE_DCE 0x00770000 @@ -84,4 +84,25 @@ PVOID UserData; /* Points to the user mode structure, usually NULL though */ } GDI_TABLE_ENTRY, *PGDI_TABLE_ENTRY; + +typedef struct _GDI_USER_DATA +{ + COLORREF PenColor; + COLORREF BrushColor; + INT ROPmode; + INT PolyFillMode; + INT StretchBltMode; + INT BackgroundMode; + COLORREF BackgroundColor; + COLORREF TextColor; + HCOLORSPACE ColorSpace; + INT TextAlign; /* Text alignment from SetTextAlign() */ + INT CharExtra; /* Spacing from SetTextCharacterExtra() */ + INT GraphicsMode; /* Graphics mode */ + INT MapMode; + HFONT hFont; + DWORD Layout; +} GDI_USER_DATA, *PGDI_USER_DATA; + + #endif Modified: trunk/reactos/include/reactos/win32k/ntgdityp.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/win32k/ntg…
============================================================================== --- trunk/reactos/include/reactos/win32k/ntgdityp.h (original) +++ trunk/reactos/include/reactos/win32k/ntgdityp.h Tue Oct 17 08:32:18 2006 @@ -45,6 +45,7 @@ { GdiGetRelAbs = 1, GdiGetArcDirection = 4, + GdiGetFontLanguageInfo = 6, GdiGetIsMemDc = 7, } GETDCDWORD, *PGETDCDWORD;
18 years, 2 months
1
0
0
0
[ion] 24550: - One school day and two midterms later, I'm still the only one with enough time to fix a header. Can't wait to see who will be up for trying to fix booting...
by ion@svn.reactos.org
Author: ion Date: Tue Oct 17 08:20:48 2006 New Revision: 24550 URL:
http://svn.reactos.org/svn/reactos?rev=24550&view=rev
Log: - One school day and two midterms later, I'm still the only one with enough time to fix a header. Can't wait to see who will be up for trying to fix booting... Modified: trunk/reactos/include/ddk/ntifs.h trunk/reactos/include/ndk/rtlfuncs.h Modified: trunk/reactos/include/ddk/ntifs.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/ntifs.h?rev=24…
============================================================================== --- trunk/reactos/include/ddk/ntifs.h (original) +++ trunk/reactos/include/ddk/ntifs.h Tue Oct 17 08:20:48 2006 @@ -1363,6 +1363,66 @@ #endif +typedef enum _RTL_GENERIC_COMPARE_RESULTS +{ + GenericLessThan, + GenericGreaterThan, + GenericEqual +} RTL_GENERIC_COMPARE_RESULTS; + +typedef enum _TABLE_SEARCH_RESULT +{ + TableEmptyTree, + TableFoundNode, + TableInsertAsLeft, + TableInsertAsRight +} TABLE_SEARCH_RESULT; + +typedef NTSTATUS +(NTAPI *PRTL_AVL_MATCH_FUNCTION)( + struct _RTL_AVL_TABLE *Table, + PVOID UserData, + PVOID MatchData +); + +typedef RTL_GENERIC_COMPARE_RESULTS +(NTAPI *PRTL_AVL_COMPARE_ROUTINE) ( + struct _RTL_AVL_TABLE *Table, + PVOID FirstStruct, + PVOID SecondStruct +); + +typedef RTL_GENERIC_COMPARE_RESULTS +(NTAPI *PRTL_GENERIC_COMPARE_ROUTINE) ( + struct _RTL_GENERIC_TABLE *Table, + PVOID FirstStruct, + PVOID SecondStruct +); + +typedef PVOID +(NTAPI *PRTL_GENERIC_ALLOCATE_ROUTINE) ( + struct _RTL_GENERIC_TABLE *Table, + CLONG ByteSize +); + +typedef VOID +(NTAPI *PRTL_GENERIC_FREE_ROUTINE) ( + struct _RTL_GENERIC_TABLE *Table, + PVOID Buffer +); + +typedef PVOID +(NTAPI *PRTL_AVL_ALLOCATE_ROUTINE) ( + struct _RTL_AVL_TABLE *Table, + CLONG ByteSize +); + +typedef VOID +(NTAPI *PRTL_AVL_FREE_ROUTINE) ( + struct _RTL_AVL_TABLE *Table, + PVOID Buffer +); + typedef struct _PUBLIC_BCB { CSHORT NodeTypeCode; CSHORT NodeByteSize; @@ -1395,12 +1455,43 @@ struct _RTL_SPLAY_LINKS *RightChild; } RTL_SPLAY_LINKS, *PRTL_SPLAY_LINKS; -typedef enum _RTL_GENERIC_COMPARE_RESULTS +typedef struct _RTL_BALANCED_LINKS { - GenericLessThan, - GenericGreaterThan, - GenericEqual -} RTL_GENERIC_COMPARE_RESULTS; + struct _RTL_BALANCED_LINKS *Parent; + struct _RTL_BALANCED_LINKS *LeftChild; + struct _RTL_BALANCED_LINKS *RightChild; + CHAR Balance; + UCHAR Reserved[3]; +} RTL_BALANCED_LINKS, *PRTL_BALANCED_LINKS; + +typedef struct _RTL_GENERIC_TABLE +{ + PRTL_SPLAY_LINKS TableRoot; + LIST_ENTRY InsertOrderList; + PLIST_ENTRY OrderedPointer; + ULONG WhichOrderedElement; + ULONG NumberGenericTableElements; + PRTL_GENERIC_COMPARE_ROUTINE CompareRoutine; + PRTL_GENERIC_ALLOCATE_ROUTINE AllocateRoutine; + PRTL_GENERIC_FREE_ROUTINE FreeRoutine; + PVOID TableContext; +} RTL_GENERIC_TABLE, *PRTL_GENERIC_TABLE; + +typedef struct _RTL_AVL_TABLE +{ + RTL_BALANCED_LINKS BalancedRoot; + PVOID OrderedPointer; + ULONG WhichOrderedElement; + ULONG NumberGenericTableElements; + ULONG DepthOfTree; + PRTL_BALANCED_LINKS RestartKey; + ULONG DeleteCount; + PRTL_AVL_COMPARE_ROUTINE CompareRoutine; + PRTL_AVL_ALLOCATE_ROUTINE AllocateRoutine; + PRTL_AVL_FREE_ROUTINE FreeRoutine; + PVOID TableContext; +} RTL_AVL_TABLE, *PRTL_AVL_TABLE; + #if defined(USE_LPC6432) #define LPC_CLIENT_ID CLIENT_ID64 Modified: trunk/reactos/include/ndk/rtlfuncs.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/rtlfuncs.h?rev…
============================================================================== --- trunk/reactos/include/ndk/rtlfuncs.h (original) +++ trunk/reactos/include/ndk/rtlfuncs.h Tue Oct 17 08:20:48 2006 @@ -2507,6 +2507,7 @@ // // Generic Table Functions // +#if defined(NTOS_MODE_USER) || defined(_NTIFS_) PVOID NTAPI RtlInsertElementGenericTable( @@ -2541,6 +2542,7 @@ OUT PVOID *NodeOrParent, OUT TABLE_SEARCH_RESULT *SearchResult ); +#endif // // Handle Table Functions
18 years, 2 months
1
0
0
0
[weiden] 24549: Fixed usage of uninitialized variable warning
by weiden@svn.reactos.org
Author: weiden Date: Mon Oct 16 19:55:33 2006 New Revision: 24549 URL:
http://svn.reactos.org/svn/reactos?rev=24549&view=rev
Log: Fixed usage of uninitialized variable warning Modified: trunk/reactos/lib/rtl/generictable.c Modified: trunk/reactos/lib/rtl/generictable.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/generictable.c?rev…
============================================================================== --- trunk/reactos/lib/rtl/generictable.c (original) +++ trunk/reactos/lib/rtl/generictable.c Mon Oct 16 19:55:33 2006 @@ -34,7 +34,11 @@ RTL_GENERIC_COMPARE_RESULTS Result; /* Quick check to see if the table is empty */ - if (RtlIsGenericTableEmpty(Table)) return TableEmptyTree; + if (RtlIsGenericTableEmpty(Table)) + { + *NodeOrParent = NULL; + return TableEmptyTree; + } /* Set the current node */ CurrentNode = Table->TableRoot;
18 years, 2 months
1
0
0
0
[ion] 24548: - Fix user-mode compilation.
by ion@svn.reactos.org
Author: ion Date: Mon Oct 16 19:27:12 2006 New Revision: 24548 URL:
http://svn.reactos.org/svn/reactos?rev=24548&view=rev
Log: - Fix user-mode compilation. Modified: trunk/reactos/include/ndk/ifssupp.h Modified: trunk/reactos/include/ndk/ifssupp.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/ifssupp.h?rev=…
============================================================================== --- trunk/reactos/include/ndk/ifssupp.h (original) +++ trunk/reactos/include/ndk/ifssupp.h Mon Oct 16 19:27:12 2006 @@ -37,6 +37,9 @@ struct _RTL_SPLAY_LINKS *LeftChild; struct _RTL_SPLAY_LINKS *RightChild; } RTL_SPLAY_LINKS, *PRTL_SPLAY_LINKS; + +typedef struct _RTL_GENERIC_TABLE RTL_GENERIC_TABLE, *PRTL_GENERIC_TABLE; +typedef ULONG TABLE_SEARCH_RESULT; #if defined(USE_LPC6432) #define LPC_CLIENT_ID CLIENT_ID64
18 years, 2 months
1
0
0
0
[weiden] 24547: Fix a typo. Thanks to Dmitry Timoshkov
by weiden@svn.reactos.org
Author: weiden Date: Mon Oct 16 15:26:24 2006 New Revision: 24547 URL:
http://svn.reactos.org/svn/reactos?rev=24547&view=rev
Log: Fix a typo. Thanks to Dmitry Timoshkov Modified: trunk/reactos/dll/win32/setupapi/install.c Modified: trunk/reactos/dll/win32/setupapi/install.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/setupapi/install…
============================================================================== --- trunk/reactos/dll/win32/setupapi/install.c (original) +++ trunk/reactos/dll/win32/setupapi/install.c Mon Oct 16 15:26:24 2006 @@ -299,7 +299,7 @@ { BOOL exists = !RegQueryValueExW( hkey, value, NULL, NULL, NULL, NULL ); if (exists && (flags & FLG_ADDREG_NOCLOBBER)) return TRUE; - if (!exists & (flags & FLG_ADDREG_OVERWRITEONLY)) return TRUE; + if (!exists && (flags & FLG_ADDREG_OVERWRITEONLY)) return TRUE; } switch(flags & FLG_ADDREG_TYPE_MASK)
18 years, 2 months
1
0
0
0
[ion] 24546: - Implement RtlGetElementGenericTable using ordered node/element. - The splay tree generic table package is now complete. (The AVL package was done by Art earlier).
by ion@svn.reactos.org
Author: ion Date: Mon Oct 16 08:08:09 2006 New Revision: 24546 URL:
http://svn.reactos.org/svn/reactos?rev=24546&view=rev
Log: - Implement RtlGetElementGenericTable using ordered node/element. - The splay tree generic table package is now complete. (The AVL package was done by Art earlier). Modified: trunk/reactos/lib/rtl/generictable.c Modified: trunk/reactos/lib/rtl/generictable.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/generictable.c?rev…
============================================================================== --- trunk/reactos/lib/rtl/generictable.c (original) +++ trunk/reactos/lib/rtl/generictable.c Mon Oct 16 08:08:09 2006 @@ -412,15 +412,96 @@ } /* - * @unimplemented + * @implemented */ PVOID NTAPI RtlGetElementGenericTable(IN PRTL_GENERIC_TABLE Table, IN ULONG I) { - UNIMPLEMENTED; - return 0; + ULONG OrderedElement, ElementCount; + PLIST_ENTRY OrderedNode; + ULONG DeltaUp, DeltaDown; + ULONG NextI = I + 1; + + /* Setup current accounting data */ + OrderedNode = Table->OrderedPointer; + OrderedElement = Table->WhichOrderedElement; + ElementCount = Table->NumberGenericTableElements; + + /* Sanity checks */ + if ((I == MAXULONG) || (NextI > ElementCount)) return NULL; + + /* Check if we already found the entry */ + if (NextI == OrderedElement) + { + /* Return it */ + return &((PTABLE_ENTRY_HEADER)CONTAINING_RECORD(OrderedNode, + TABLE_ENTRY_HEADER, + ListEntry))->UserData; + } + + /* Now check if we're farther behind */ + if (OrderedElement > NextI) + { + /* Find out if the distance is more then the half-way point */ + if (NextI > (OrderedElement / 2)) + { + /* Do the search backwards, since this takes less iterations */ + DeltaDown = OrderedElement - NextI; + do + { + /* Get next node */ + OrderedNode = OrderedNode->Blink; + } while (--DeltaDown); + } + else + { + /* Follow the list directly instead */ + OrderedNode = &Table->InsertOrderList; + do + { + /* Get next node */ + OrderedNode = OrderedNode->Flink; + } while (--NextI); + } + } + else + { + /* We are farther ahead, calculate distances */ + DeltaUp = NextI - OrderedElement; + DeltaDown = (ElementCount - NextI) + 1; + + /* Check if the up distance is smaller then the down distance */ + if (DeltaUp <= DeltaDown) + { + /* Do the search forwards, since this takes less iterations */ + do + { + /* Get next node */ + OrderedNode = OrderedNode->Blink; + } while (--DeltaUp); + } + else + { + /* Do the search downwards, since this takes less iterations */ + OrderedNode = &Table->InsertOrderList; + do + { + /* Get next node */ + OrderedNode = OrderedNode->Blink; + } while (--DeltaDown); + } + } + + /* Got the element, save it */ + Table->OrderedPointer = OrderedNode; + Table->WhichOrderedElement = NextI; + + /* Return the element */ + return &((PTABLE_ENTRY_HEADER)CONTAINING_RECORD(OrderedNode, + TABLE_ENTRY_HEADER, + ListEntry))->UserData; } /* AVL FUNCTIONS *************************************************************/
18 years, 2 months
1
0
0
0
[ion] 24545: - Fix GCC compile bug.
by ion@svn.reactos.org
Author: ion Date: Mon Oct 16 07:53:48 2006 New Revision: 24545 URL:
http://svn.reactos.org/svn/reactos?rev=24545&view=rev
Log: - Fix GCC compile bug. Modified: trunk/reactos/lib/rtl/generictable.c Modified: trunk/reactos/lib/rtl/generictable.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/generictable.c?rev…
============================================================================== --- trunk/reactos/lib/rtl/generictable.c (original) +++ trunk/reactos/lib/rtl/generictable.c Mon Oct 16 07:53:48 2006 @@ -253,7 +253,7 @@ /* Call the full version */ return RtlLookupElementGenericTableFull(Table, Buffer, - &NodeOrParent, + (PVOID)&NodeOrParent, &Result); }
18 years, 2 months
1
0
0
0
[ion] 24544: - Create "AVL FUNCTIONS" section tag. - Implement RtlENumerateGEnericTableWithoutSplaying.
by ion@svn.reactos.org
Author: ion Date: Mon Oct 16 07:51:49 2006 New Revision: 24544 URL:
http://svn.reactos.org/svn/reactos?rev=24544&view=rev
Log: - Create "AVL FUNCTIONS" section tag. - Implement RtlENumerateGEnericTableWithoutSplaying. Modified: trunk/reactos/lib/rtl/generictable.c Modified: trunk/reactos/lib/rtl/generictable.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/generictable.c?rev…
============================================================================== --- trunk/reactos/lib/rtl/generictable.c (original) +++ trunk/reactos/lib/rtl/generictable.c Mon Oct 16 07:51:49 2006 @@ -357,6 +357,44 @@ } /* + * @implemented + */ +PVOID +NTAPI +RtlEnumerateGenericTableWithoutSplaying(IN PRTL_GENERIC_TABLE Table, + IN OUT PVOID *RestartKey) +{ + PRTL_SPLAY_LINKS FoundNode; + + /* Check if the table is empty */ + if (RtlIsGenericTableEmpty(Table)) return NULL; + + /* Check if we have to restart */ + if (!(*RestartKey)) + { + /* Then find the leftmost element */ + FoundNode = Table->TableRoot; + do + { + /* Get the left child */ + FoundNode = RtlLeftChild(FoundNode); + } while(RtlLeftChild(FoundNode)); + + /* Splay it */ + *RestartKey = FoundNode; + } + else + { + /* Otherwise, try using the real successor */ + FoundNode = RtlRealSuccessor(Table->TableRoot); + if (FoundNode) *RestartKey = FoundNode; + } + + /* Check if we found the node and return it */ + return FoundNode ? &((PTABLE_ENTRY_HEADER)FoundNode)->UserData : NULL; +} + +/* * @unimplemented */ PVOID @@ -378,24 +416,14 @@ */ PVOID NTAPI -RtlEnumerateGenericTableWithoutSplaying(IN PRTL_GENERIC_TABLE Table, - IN OUT PVOID *RestartKey) +RtlGetElementGenericTable(IN PRTL_GENERIC_TABLE Table, + IN ULONG I) { UNIMPLEMENTED; return 0; } -/* - * @unimplemented - */ -PVOID -NTAPI -RtlGetElementGenericTable(IN PRTL_GENERIC_TABLE Table, - IN ULONG I) -{ - UNIMPLEMENTED; - return 0; -} +/* AVL FUNCTIONS *************************************************************/ /* * @implemented
18 years, 2 months
1
0
0
0
← Newer
1
...
11
12
13
14
15
16
17
...
36
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
Results per page:
10
25
50
100
200