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
2025
June
May
April
March
February
January
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
August 2006
----- 2025 -----
June 2025
May 2025
April 2025
March 2025
February 2025
January 2025
----- 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
19 participants
447 discussions
Start a n
N
ew thread
[jimtabor] 23587: Only lower word is used with dwTypeData as bitmap handle.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Tue Aug 15 22:05:18 2006 New Revision: 23587 URL:
http://svn.reactos.org/svn/reactos?rev=23587&view=rev
Log: Only lower word is used with dwTypeData as bitmap handle. Modified: trunk/reactos/subsystems/win32/win32k/ntuser/menu.c Modified: trunk/reactos/subsystems/win32/win32k/ntuser/menu.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/menu.c (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/menu.c Tue Aug 15 22:05:18 2006 @@ -788,12 +788,12 @@ } if(lpmii->fType & MFT_BITMAP) { -// if(lpmii->hbmpItem) + if(lpmii->hbmpItem) MenuItem->hbmpItem = lpmii->hbmpItem; -// else -// { /* Win 9x/Me stuff */ -// MenuItem->hbmpItem = (HBITMAP)lpmii->dwTypeData; -// } + else + { /* Win 9x/Me stuff */ + MenuItem->hbmpItem = (HBITMAP)((ULONG_PTR)(LOWORD(lpmii->dwTypeData))); + } } MenuItem->fType |= lpmii->fType; }
18 years, 10 months
1
0
0
0
[ion] 23586: - Add CM_VIEW_OF_FILE, CM_DELAYED_CLOSE_ENTRY. - Fix CM_KEY_CONTROL_BLOCK definition. - Fix minor parameter definition in CmpInitializeHive - Add cmkcbncb.c with the current work for NCB/KCB management, as well as cache indexes and delayed allocation/free. Some of these routines will go into cmutil.c soon. File is incomplete (have not coded all the routines yet, just the general framework) and full of bugs.
by ion@svn.reactos.org
Author: ion Date: Tue Aug 15 20:12:19 2006 New Revision: 23586 URL:
http://svn.reactos.org/svn/reactos?rev=23586&view=rev
Log: - Add CM_VIEW_OF_FILE, CM_DELAYED_CLOSE_ENTRY. - Fix CM_KEY_CONTROL_BLOCK definition. - Fix minor parameter definition in CmpInitializeHive - Add cmkcbncb.c with the current work for NCB/KCB management, as well as cache indexes and delayed allocation/free. Some of these routines will go into cmutil.c soon. File is incomplete (have not coded all the routines yet, just the general framework) and full of bugs. Added: branches/alex-cm-branch/reactos/ntoskrnl/cm/cmkcbncb.c Modified: branches/alex-cm-branch/reactos/ntoskrnl/cm/cm.h branches/alex-cm-branch/reactos/ntoskrnl/cm/cmhive.c Modified: branches/alex-cm-branch/reactos/ntoskrnl/cm/cm.h URL:
http://svn.reactos.org/svn/reactos/branches/alex-cm-branch/reactos/ntoskrnl…
============================================================================== --- branches/alex-cm-branch/reactos/ntoskrnl/cm/cm.h (original) +++ branches/alex-cm-branch/reactos/ntoskrnl/cm/cm.h Tue Aug 15 20:12:19 2006 @@ -114,19 +114,37 @@ #define CMP_HASH_PRIME 1000000007 // +// CmpCreateKcb Flags +// +#define CMP_CREATE_FAKE_KCB 0x1 +#define CMP_LOCK_HASHES_FOR_KCB 0x2 + +// +// Number of items that can fit inside an Allocation Page +// +#define CM_KCBS_PER_PAGE \ + PAGE_SIZE / sizeof(CM_KEY_CONTROL_BLOCK) +#define CM_DELAYS_PER_PAGE \ + PAGE_SIZE / sizeof(CM_DELAYED_CLOSE_ENTRY) + +// // A Cell Index is just a ULONG // typedef ULONG HCELL_INDEX; // -// TEMPORARY HACK HACK -// -typedef struct _HHIVE -{ - ULONG I; - ULONG Love; - ULONG Filip; -} HHIVE, *PHHIVE; +// Mapped View of a Hive +// +typedef struct _CM_VIEW_OF_FILE +{ + LIST_ENTRY LRUViewList; + LIST_ENTRY PinViewList; + ULONG FileOffset; + ULONG Size; + PULONG ViewAddress; + PVOID Bcb; + ULONG UseCount; +} CM_VIEW_OF_FILE, *PCM_VIEW_OF_FILE; // // Key Hash @@ -270,7 +288,7 @@ typedef struct _CM_KEY_CONTROL_BLOCK { USHORT RefCount; - ULONG Flags; + USHORT Flags; ULONG ExtFlags:8; ULONG PrivateAlloc:1; ULONG Delete:1; @@ -294,8 +312,11 @@ PCM_INDEX_HINT_BLOCK IndexHint; ULONG HashKey; ULONG SubKeyCount; - LIST_ENTRY KeyBodyListHead; - LIST_ENTRY FreeListEntry; + union + { + LIST_ENTRY KeyBodyListHead; + LIST_ENTRY FreeListEntry; + }; PCM_KEY_BODY KeyBodyArray[4]; PVOID DelayCloseEntry; LARGE_INTEGER KcbLastWriteTime; @@ -337,6 +358,15 @@ ULONG Reserved; PVOID AllocPage; } CM_ALLOC_PAGE, *PCM_ALLOC_PAGE; + +// +// Delayed Close Entry +// +typedef struct _CM_DELAYED_CLOSE_ENTRY +{ + LIST_ENTRY DelayedLRUList; + PCM_KEY_CONTROL_BLOCK KeyControlBlock; +} CM_DELAYED_CLOSE_ENTRY, *PCM_DELAYED_CLOSE_ENTRY; // // Use Count Log and Entry @@ -501,6 +531,15 @@ ); // +// Registry Lock +// +BOOLEAN +NTAPI +CmpTestRegistryLockExclusive( + VOID +); + +// // Global variables accessible from all of Cm // Modified: branches/alex-cm-branch/reactos/ntoskrnl/cm/cmhive.c URL:
http://svn.reactos.org/svn/reactos/branches/alex-cm-branch/reactos/ntoskrnl…
============================================================================== --- branches/alex-cm-branch/reactos/ntoskrnl/cm/cmhive.c (original) +++ branches/alex-cm-branch/reactos/ntoskrnl/cm/cmhive.c Tue Aug 15 20:12:19 2006 @@ -127,7 +127,7 @@ IN ULONG Operation, IN ULONG Flags, IN ULONG FileType, - IN PVOID Context, + IN PVOID HiveData, IN HANDLE Primary, IN HANDLE Alternate, IN HANDLE Log, @@ -146,7 +146,7 @@ * An external hive that is also internal. * An alternate hive or a log hive that's not a primary hive too. * A volatile hive that's linked to permanent storage. - * An in-memory initailization without context data. + * An in-memory initailization without hive data. * A log hive or alternative hive that's not linked to a correct file type. */ if ((Alternate && Log) || @@ -155,7 +155,7 @@ (Log && !Primary) || ((Flags & HIVE_VOLATILE) && (Alternate || Primary || External || Log)) || - ((Operation == HINIT_MEMORY) && (!Context)) || + ((Operation == HINIT_MEMORY) && (!HiveData)) || (Log && (FileType != HFILE_TYPE_LOG)) || (Alternate && (FileType != HFILE_TYPE_ALTERNATE))) { @@ -274,7 +274,7 @@ Operation, Flags, FileType, - Context, + (ULONG_PTR)HiveData, CmpAllocate, CmpFree, CmpFileRead, Added: branches/alex-cm-branch/reactos/ntoskrnl/cm/cmkcbncb.c URL:
http://svn.reactos.org/svn/reactos/branches/alex-cm-branch/reactos/ntoskrnl…
============================================================================== --- branches/alex-cm-branch/reactos/ntoskrnl/cm/cmkcbncb.c (added) +++ branches/alex-cm-branch/reactos/ntoskrnl/cm/cmkcbncb.c Tue Aug 15 20:12:19 2006 @@ -1,0 +1,844 @@ +/* + * PROJECT: ReactOS Kernel + * LICENSE: GPL - See COPYING in the top level directory + * FILE: ntoskrnl/cm/cmkcbncb.c + * PURPOSE: Routines for handling KCBs, NCBs, as well as key hashes. + * PROGRAMMERS: Alex Ionescu (alex.ionescu(a)reactos.org) + */ + +/* INCLUDES ******************************************************************/ + +#include <ntoskrnl.h> +#define NDEBUG +#include <debug.h> + +/* GLOBALS *******************************************************************/ + +ULONG CmpHashTableSize; +PCM_KEY_HASH_TABLE_ENTRY *CmpCacheTable; +PCM_NAME_HASH_TABLE_ENTRY *CmpNameCacheTable; +BOOLEAN CmpAllocInited; +KGUARDED_MUTEX CmpAllocBucketLock, CmpDelayAllocBucketLock; +LIST_ENTRY CmpFreeKCBListHead; +ULONG CmpDelayedCloseSize; +ULONG CmpDelayedCloseElements; +KGUARDED_MUTEX CmpDelayedCloseTableLock; +BOOLEAN CmpDelayCloseWorkItemActive; +LIST_ENTRY CmpDelayedLRUListHead; +LIST_ENTRY CmpFreeDelayItemsListHead; +ULONG CmpDelayCloseIntervalInSeconds = 5; +KDPC CmpDelayCloseDpc; +KTIMER CmpDelayCloseTimer; +BOOLEAN CmpHoldLazyFlush; + +/* FUNCTIONS *****************************************************************/ + +VOID +NTAPI +CmpRemoveKeyHash(IN PCM_KEY_HASH KeyHash) +{ + PCM_KEY_HASH *Prev; + PCM_KEY_HASH Current; + + /* Lookup all the keys in this index entry */ + Prev = &GET_HASH_ENTRY(CmpCacheTable, KeyHash->ConvKey).Entry; + while (TRUE) + { + /* Save the current one and make sure it's valid */ + Current = *Prev; + ASSERT(Current != NULL); + + /* Check if it matches */ + if (Current == KeyHash) + { + /* Then write the previous one */ + *Prev = Current->NextHash; + break; + } + + /* Otherwise, keep going */ + Prev = &Current->NextHash; + } +} + +PCM_KEY_CONTROL_BLOCK +NTAPI +CmpInsertKeyHash(IN PCM_KEY_HASH KeyHash, + IN BOOLEAN IsFake) +{ + ULONG i; + PCM_KEY_HASH Entry; + + /* Get the hash index */ + i = GET_HASH_INDEX(KeyHash->ConvKey); + + /* If this is a fake key, increase the key cell to use the parent data */ + if (IsFake) KeyHash->KeyCell++; + + /* Loop the hash table */ + Entry = CmpCacheTable[i]->Entry; + while (Entry) + { + /* Check if this matches */ + if ((KeyHash->ConvKey == Entry->ConvKey) && + (KeyHash->KeyCell == Entry->KeyCell) && + (KeyHash->KeyHive == Entry->KeyHive)) + { + /* Return it */ + return CONTAINING_RECORD(Entry, CM_KEY_CONTROL_BLOCK, KeyHash); + } + + /* Keep looping */ + Entry = Entry->NextHash; + } + + /* No entry found, add this one and return NULL since none existed */ + KeyHash->NextHash = CmpCacheTable[i]->Entry; + CmpCacheTable[i]->Entry = KeyHash; + return NULL; +} + +// FIXME: NEEDS COMPLETION +PCM_NAME_CONTROL_BLOCK +NTAPI +CmpGetNcb(IN PUNICODE_STRING NodeName) +{ + PCM_NAME_CONTROL_BLOCK Ncb; + ULONG ConvKey = 0; + PWCHAR p, pp; + ULONG i; + BOOLEAN IsCompressed = TRUE, Found; + PCM_NAME_HASH HashEntry; + ULONG Length; + + /* Loop the name */ + p = NodeName->Buffer; + for (i = 0; i < NodeName->Length; i += sizeof(WCHAR)) + { + /* Make sure it's not a slash */ + if (*p != OBJ_NAME_PATH_SEPARATOR) + { + /* Add it to the hash */ + ConvKey = 37 * ConvKey + RtlUpcaseUnicodeChar(*p); + } + + /* Next character */ + p++; + } + + /* Set assumed lengh and loop to check */ + Length = NodeName->Length / sizeof(WCHAR); + for (i = 0; i < (NodeName->Length / sizeof(WCHAR)); i++) + { + /* Check if this is a valid character */ + if (*NodeName->Buffer > (UCHAR)-1) + { + /* This is the actual size, and we know we're not compressed */ + Length = NodeName->Length; + IsCompressed = FALSE; + } + } + + /* Get the hash entry */ + HashEntry = GET_HASH_ENTRY(CmpNameCacheTable, ConvKey).Entry; + while (HashEntry) + { + /* Get the current NCB */ + Ncb = CONTAINING_RECORD(HashEntry, CM_NAME_CONTROL_BLOCK, NameHash); + + /* Check if the hash matches */ + if ((ConvKey = HashEntry->ConvKey) && (Length = Ncb->NameLength)) + { + /* Assume success */ + Found = TRUE; + + /* If the NCB is compressed, do a compressed name compare */ + if (Ncb->Compressed) + { + /* Compare names */ + if (CmpCompareCompressedName(NodeName, Ncb->Name, Length)) + { + /* We failed */ + Found = FALSE; + } + } + else + { + /* Do a manual compare */ + p = NodeName->Buffer; + pp = Ncb->Name; + for (i = 0; i < Ncb->NameLength; i += sizeof(WCHAR)) + { + /* Compare the character */ + if (RtlUpcaseUnicodeChar(*p) != RtlUpcaseUnicodeChar(*pp)) + { + /* Failed */ + Found = FALSE; + break; + } + + /* Next chars */ + *p++; + *pp++; + } + } + + /* Check if we found a name */ + if (Found) + { + + } + } + + /* Go to the next hash */ + HashEntry = HashEntry->NextHash; + } +} + +BOOLEAN +NTAPI +CmpTryToConvertKcbSharedToExclusive(IN PCM_KEY_CONTROL_BLOCK Kcb) +{ + /* Convert the lock */ + ASSERT(CmpIsKcbLockedExclusive(Kcb) == FALSE); + if (ExConvertPushLockSharedToExclusive(GET_HASH_ENTRY(CmpCacheTable, + Kcb->ConvKey).Lock)) + { + /* Set the lock owner */ + GET_HASH_ENTRY(CmpCacheTable, Kcb->ConvKey).Owner = KeGetCurrentThread(); + return TRUE; + } + + /* We failed */ + return FALSE; +} + +VOID +NTAPI +CmpRemoveKcb(IN PCM_KEY_CONTROL_BLOCK Kcb) +{ + /* Make sure that the registry and KCB are utterly locked */ + ASSERT((CmpIsKcbLockedExclusive(Kcb) == TRUE) || + (CmpTestRegistryLockExclusive() == TRUE)); + + /* Remove the key hash */ + CmpRemoveKeyHash(&Kcb->KeyHash); +} + +VOID +NTAPI +CmpFreeKcb(IN PCM_KEY_CONTROL_BLOCK Kcb) +{ + ULONG i; + PCM_ALLOC_PAGE AllocPage; + PAGED_CODE(); + + /* Sanity checks */ + ASSERT(IsListEmpty(&(Kcb->KeyBodyListHead)) == TRUE); + for (i = 0; i < 4; i++) ASSERT(Kcb->KeyBodyArray[i] == NULL); + + /* Check if it wasn't privately allocated */ + if (!Kcb->PrivateAlloc) + { + /* Free it from the pool */ + ExFreePool(Kcb); + } + else + { + /* Acquire the private allocation lock */ + KeAcquireGuardedMutex(&CmpAllocBucketLock); + + /* Sanity check on lock ownership */ + ASSERT((GET_HASH_ENTRY(CmpCacheTable, Kcb->ConvKey).Owner == + KeGetCurrentThread()) || + (CmpTestRegistryLockExclusive() == TRUE)); + + /* Remove us from the list */ + RemoveEntryList(&CmpFreeKCBListHead); + + /* Get the allocation page */ + AllocPage = (PCM_ALLOC_PAGE)((ULONG_PTR)Kcb & 0xFFFFF000); + + /* Sanity check */ + ASSERT(AllocPage->FreeCount != CM_KCBS_PER_PAGE); + + /* Increase free count */ + if (++AllocPage->FreeCount == CM_KCBS_PER_PAGE) + { + /* Loop all the entries */ + for (i = CM_KCBS_PER_PAGE; i; i--) + { + /* Remove the entry + RemoveEntryList(& */ + } + + /* Free the page */ + ExFreePool(AllocPage); + } + + /* Release the lock */ + KeReleaseGuardedMutex(&CmpAllocBucketLock); + } +} + +BOOLEAN +NTAPI +CmpReferenceKcb(IN PCM_KEY_CONTROL_BLOCK Kcb) +{ + /* Check if this is the KCB's first reference */ + if (Kcb->RefCount == 0) + { + /* Check if the KCB is locked in shared mode */ + if (!CmpIsKcbLockedExclusive(Kcb)) + { + /* Convert it to exclusive */ + if (!CmpTryToConvertKcbSharedToExclusive(Kcb)) + { + /* Set the delete flag */ + Kcb->Delete = TRUE; + + /* Increase the reference count while we release the lock */ + InterlockedIncrement((PLONG)&Kcb->RefCount); + + /* Sanity check, KCB should still be shared */ + ASSERT(CmpIsKcbLockedExclusive(Kcb) == FALSE); + + /* Release the current lock */ + CmpReleaseKcbLock(Kcb); + + /* Now acquire the lock in exclusive mode */ + CmpAcquireKcbLockExclusive(Kcb); + + /* Decrement the reference count; the lock is now held again */ + InterlockedDecrement((PLONG)&Kcb->RefCount); + + /* Sanity check */ + ASSERT((Kcb->DelayedCloseIndex == CmpDelayedCloseSize) || + (Kcb->DelayedCloseIndex == 0)); + + /* Remove the delete flag */ + Kcb->Delete = FALSE; + } + } + } + + /* Increase the reference count */ + if ((InterlockedIncrement((PLONG)&Kcb->RefCount) + 1) == 0) + { + /* We've overflown to 64K references, bail out */ + InterlockedDecrement((PLONG)&Kcb->RefCount); + return FALSE; + } + + /* Check if this was the last close index */ + if (!Kcb->DelayedCloseIndex) + { + /* Check if the KCB is locked in shared mode */ + if (!CmpIsKcbLockedExclusive(Kcb)) + { + /* Convert it to exclusive */ + if (!CmpTryToConvertKcbSharedToExclusive(Kcb)) + { + /* Sanity check, KCB should still be shared */ + ASSERT(CmpIsKcbLockedExclusive(Kcb) == FALSE); + + /* Release the current lock */ + CmpReleaseKcbLock(Kcb); + + /* Now acquire the lock in exclusive mode */ + CmpAcquireKcbLockExclusive(Kcb); + } + } + + /* If we're still the last entry, remove us */ + if (!Kcb->DelayedCloseIndex) CmpRemoveFromDelayedClose(Kcb); + } + + /* Return success */ + return TRUE; +} + +// FIXME: THIS FUNCTION IS PARTIALLY FUCKED +PCM_DELAYED_CLOSE_ENTRY +NTAPI +CmpAllocateDelayItem(VOID) +{ + PCM_DELAYED_CLOSE_ENTRY Entry; + PCM_ALLOC_PAGE AllocPage; + ULONG i; + PLIST_ENTRY NextEntry; + PAGED_CODE(); + + /* Lock the allocation buckets */ + KeAcquireGuardedMutex(&CmpDelayAllocBucketLock); + if (TRUE) + { + /* Allocate an allocation page */ + AllocPage = ExAllocatePoolWithTag(PagedPool, PAGE_SIZE, TAG_CM); + if (AllocPage) + { + /* Set default entries */ + AllocPage->FreeCount = CM_DELAYS_PER_PAGE; + + /* Loop each entry */ + for (i = 0; i < CM_DELAYS_PER_PAGE; i++) + { + /* Get this entry and link it */ + Entry = (PCM_DELAYED_CLOSE_ENTRY)(&AllocPage[i]); + InsertHeadList(&Entry->DelayedLRUList, + &CmpFreeDelayItemsListHead); + } + } + + /* Get the entry and the alloc page */ + Entry = CONTAINING_RECORD(NextEntry, + CM_DELAYED_CLOSE_ENTRY, + DelayedLRUList); + AllocPage = (PCM_ALLOC_PAGE)((ULONG_PTR)Entry & 0xFFFFF000); + + /* Decrease free entries */ + ASSERT(AllocPage->FreeCount != 0); + AllocPage->FreeCount--; + + /* Release the lock */ + KeReleaseGuardedMutex(&CmpDelayAllocBucketLock); + return Entry; + } + + /* Release the lock */ + KeReleaseGuardedMutex(&CmpDelayAllocBucketLock); + return Entry; +} + +VOID +NTAPI +CmpArmDelayedCloseTimer(VOID) +{ + LARGE_INTEGER Timeout; + PAGED_CODE(); + + /* Setup the interval */ + Timeout.QuadPart = CmpDelayCloseIntervalInSeconds * -10000000; + KeSetTimer(&CmpDelayCloseTimer, Timeout, &CmpDelayCloseDpc); +} + +VOID +NTAPI +CmpAddToDelayedClose(IN PCM_KEY_CONTROL_BLOCK Kcb, + IN BOOLEAN LockHeldExclusively) +{ + ULONG i; + ULONG OldRefCount, NewRefCount; + PCM_DELAYED_CLOSE_ENTRY Entry; + PAGED_CODE(); + + /* Sanity check */ + ASSERT((CmpIsKcbLockedExclusive(Kcb) == TRUE) || + (CmpTestRegistryLockExclusive() == TRUE)); + + /* Make sure it's valid */ + if (Kcb->DelayedCloseIndex != CmpDelayedCloseSize) ASSERT(FALSE); + + /* Sanity checks */ + ASSERT(Kcb->RefCount == 0); + ASSERT(IsListEmpty(&Kcb->KeyBodyListHead) == TRUE); + for (i = 0; i < 4; i++) ASSERT(Kcb->KeyBodyArray[i] == NULL); + + /* Allocate a delay item */ + Entry = CmpAllocateDelayItem(); + if (!Entry) + { + /* Cleanup immediately */ + CmpCleanUpKcbCacheWithLock(Kcb, LockHeldExclusively); + return; + } + + /* Sanity check */ + if (Kcb->InDelayClose) ASSERT(FALSE); + + /* Get the previous reference count */ + OldRefCount = Kcb->InDelayClose; + ASSERT(OldRefCount == 0); + + /* Write the new one */ + NewRefCount = InterlockedCompareExchange(&Kcb->InDelayClose, + 1, + OldRefCount); + if (NewRefCount != OldRefCount) ASSERT(FALSE); + + /* Remove the delete flag */ + Kcb->Delete = FALSE; + + /* Set up the close entry */ + Kcb->DelayCloseEntry = Entry; + Entry->KeyControlBlock = Kcb; + + /* Increase the number of elements */ + InterlockedIncrement(&CmpDelayedCloseElements); + + /* Acquire the delayed close table lock */ + KeAcquireGuardedMutex(&CmpDelayedCloseTableLock); + + /* Insert the entry into the list */ + InsertHeadList(&CmpDelayedLRUListHead, &Entry->DelayedLRUList); + + /* Check if we need to enable anything */ + if ((CmpDelayedCloseElements > CmpDelayedCloseSize) && + !(CmpDelayCloseWorkItemActive)) + { + /* Yes, we have too many elements to close, and no work item */ + CmpArmDelayedCloseTimer(); + } + + /* Release the table lock */ + KeReleaseGuardedMutex(&CmpDelayedCloseTableLock); +} + +PCM_KEY_CONTROL_BLOCK +NTAPI +CmpAllocateKcb(VOID) +{ + PLIST_ENTRY ListHead, NextEntry; + PCM_KEY_CONTROL_BLOCK CurrentKcb; + PCM_ALLOC_PAGE AllocPage; + ULONG i; + PAGED_CODE(); + + /* Check if private allocations are initialized */ + if (CmpAllocInited) + { + /* They are, acquire the bucket lock */ + KeAcquireGuardedMutex(&CmpAllocBucketLock); + + /* Loop the free KCB list */ + ListHead = &CmpFreeKCBListHead; + NextEntry = ListHead->Flink; + while (NextEntry != ListHead) + { + /* Remove the entry */ + RemoveEntryList(NextEntry); + + /* Get the KCB */ + CurrentKcb = CONTAINING_RECORD(NextEntry, + CM_KEY_CONTROL_BLOCK, + FreeListEntry); + + /* Get the allocation page */ + AllocPage = (PCM_ALLOC_PAGE)((ULONG_PTR)CurrentKcb & 0xFFFFF000); + + /* Decrease the free count */ + ASSERT(AllocPage->FreeCount != 0); + AllocPage->FreeCount--; + + /* Make sure this KCB is privately allocated */ + ASSERT(CurrentKcb->PrivateAlloc == 1); + + /* Release the allocation lock */ + KeReleaseGuardedMutex(&CmpAllocBucketLock); + + /* Return the KCB */ + return CurrentKcb; + } + + /* Allocate an allocation page */ + AllocPage = ExAllocatePoolWithTag(PagedPool, PAGE_SIZE, TAG_CM); + if (AllocPage) + { + /* Set default entries */ + AllocPage->FreeCount = CM_KCBS_PER_PAGE; + + /* Loop each entry */ + for (i = 0; i < CM_KCBS_PER_PAGE; i++) + { + /* Get this entry */ + CurrentKcb = (PCM_KEY_CONTROL_BLOCK)(AllocPage + 1); + + /* Set it up */ + CurrentKcb->PrivateAlloc = TRUE; + CurrentKcb->DelayCloseEntry = NULL; + InsertHeadList(&CurrentKcb->FreeListEntry, + &CmpFreeKCBListHead); + } + + /* Get the KCB */ + CurrentKcb = CONTAINING_RECORD(NextEntry, + CM_KEY_CONTROL_BLOCK, + FreeListEntry); + + /* Get the allocation page */ + AllocPage = (PCM_ALLOC_PAGE)((ULONG_PTR)CurrentKcb & 0xFFFFF000); + + /* Decrease the free count */ + ASSERT(AllocPage->FreeCount != 0); + AllocPage->FreeCount--; + + /* Make sure this KCB is privately allocated */ + ASSERT(CurrentKcb->PrivateAlloc == 1); + + /* Release the allocation lock */ + KeReleaseGuardedMutex(&CmpAllocBucketLock); + + /* Return the KCB */ + return CurrentKcb; + } + + /* Release the lock */ + KeReleaseGuardedMutex(&CmpAllocBucketLock); + } + + /* Allocate a KCB only */ + CurrentKcb = ExAllocatePoolWithTag(PagedPool, + sizeof(CM_KEY_CONTROL_BLOCK), + TAG_CM); + if (CurrentKcb) + { + /* Set it up */ + CurrentKcb->PrivateAlloc = 0; + CurrentKcb->DelayCloseEntry = NULL; + } + + /* Return it */ + return CurrentKcb; +} + +VOID +NTAPI +CmpDereferenceKcbWithLock(IN PCM_KEY_CONTROL_BLOCK Kcb, + IN BOOLEAN LockHeldExclusively) +{ + /* Sanity check */ + ASSERT((CmpIsKcbLockedExclusive(Kcb) == TRUE) || + (CmpTestRegistryLockExclusive() == TRUE)); + + /* Check if we should do a direct delete */ + if (((CmpHoldLazyFlush) && + !(Kcb->ExtFlags & CM_KCB_SYM_LINK_FOUND) && + !(Kcb->Flags & KEY_SYM_LINK)) || + (Kcb->ExtFlags & CM_KCB_NO_DELAY_CLOSE) || + (Kcb->PrivateAlloc)) + { + /* Clean up the KCB*/ + CmpCleanUpKcbCacheWithLock(Kcb, LockHeldExclusively); + } + else + { + /* Otherwise, use delayed close */ + CmpAddToDelayedClose(Kcb, LockHeldExclusively); + } +} + +VOID +NTAPI +CmpInitializeKcbKeyBodyList(IN PCM_KEY_CONTROL_BLOCK Kcb) +{ + /* Initialize the list */ + InitializeListHead(&Kcb->KeyBodyListHead); + + /* Clear the bodies */ + Kcb->KeyBodyArray[0] = + Kcb->KeyBodyArray[1] = + Kcb->KeyBodyArray[2] = + Kcb->KeyBodyArray[3] = NULL; +} + +PCM_KEY_CONTROL_BLOCK +NTAPI +CmpCreateKcb(IN PHHIVE Hive, + IN HCELL_INDEX Index, + IN PCM_KEY_NODE Node, + IN PCM_KEY_CONTROL_BLOCK Parent, + IN ULONG Flags, + IN PUNICODE_STRING KeyName) +{ + PCM_KEY_CONTROL_BLOCK Kcb, FoundKcb = NULL; + UNICODE_STRING NodeName; + ULONG ConvKey = 0, i; + BOOLEAN IsFake, HashLock; + PWCHAR p; + + /* Make sure we own this hive */ + if (((PCMHIVE)Hive)->CreatorOwner != KeGetCurrentThread()) return NULL; + + /* Check if this is a fake KCB */ + IsFake = (BOOLEAN)(Flags & CMP_CREATE_FAKE_KCB); + + /* If we have a parent, use its ConvKey */ + if (Parent) ConvKey = Parent->ConvKey; + + /* Make a copy of the name */ + NodeName = *KeyName; + + /* Remove leading slash */ + while ((NodeName.Length) && (*NodeName.Buffer == OBJ_NAME_PATH_SEPARATOR)) + { + /* Move the buffer by one */ + NodeName.Buffer++; + NodeName.Length -= sizeof(WCHAR); + } + + /* Make sure we didn't get just a slash or something */ + ASSERT(NodeName.Length > 0); + + /* Now setup the hash */ + p = NodeName.Buffer; + for (i = 0; i < NodeName.Length; i += sizeof(WCHAR)) + { + /* Make sure it's a valid character */ + if ((*p != OBJ_NAME_PATH_SEPARATOR) && (*p)) + { + /* Add this key to the hash */ + ConvKey = 37 * ConvKey + RtlUpcaseUnicodeChar(*p); + } + + /* Move on */ + p++; + } + + /* Allocate the KCB */ + Kcb = CmpAllocateKcb(); + if (!Kcb) return NULL; + + /* Initailize the key list */ + CmpInitializeKcbKeyBodyList(Kcb); + + /* Set it up */ + Kcb->Delete = FALSE; + Kcb->RefCount = 1; + Kcb->KeyHive = Hive; + Kcb->KeyCell = Index; + Kcb->ConvKey = ConvKey; + Kcb->DelayedCloseIndex = CmpDelayedCloseSize; + + /* Check if we have two hash entires */ + HashLock = (BOOLEAN)(Flags & CMP_LOCK_HASHES_FOR_KCB); + if (HashLock) + { + /* Not yet implemented */ + KeBugCheck(0); + } + + /* Check if we already have a KCB */ + FoundKcb = CmpInsertKeyHash(&Kcb->KeyHash, IsFake); + if (FoundKcb) + { + /* Sanity check */ + ASSERT(!FoundKcb->Delete); + + /* Free the one we allocated and reference this one */ + CmpFreeKcb(Kcb); + Kcb = FoundKcb; + if (!CmpReferenceKcb(Kcb)) + { + /* We got too many handles */ + ASSERT(Kcb->RefCount + 1 != 0); + Kcb = NULL; + } + else + { + /* Check if we're not creating a fake one, but it used to be fake */ + if ((Kcb->ExtFlags & CM_KCB_KEY_NON_EXIST) && !(IsFake)) + { + /* Set the hive and cell */ + Kcb->KeyHive = Hive; + Kcb->KeyCell = Index; + + /* This means that our current information is invalid */ + Kcb->ExtFlags = CM_KCB_INVALID_CACHED_INFO; + } + + /* Check if we didn't have any valid data */ + if (!(Kcb->ExtFlags & (CM_KCB_NO_SUBKEY | + CM_KCB_SUBKEY_ONE | + CM_KCB_SUBKEY_HINT))) + { + /* Calculate the index hint */ + Kcb->SubKeyCount = Node->SubKeyCounts[0] + + Node->SubKeyCounts[1]; + + /* Cached information is now valid */ + Kcb->ExtFlags &= ~CM_KCB_INVALID_CACHED_INFO; + } + + /* Setup the other data */ + Kcb->KcbLastWriteTime = Node->LastWriteTime; + Kcb->KcbMaxNameLen = (USHORT)Node->MaxNameLen; + Kcb->KcbMaxValueNameLen = (USHORT)Node->MaxValueNameLen; + Kcb->KcbMaxValueDataLen = Node->MaxValueDataLen; + } + } + else + { + /* No KCB, do we have a parent? */ + if (Parent) + { + /* Reference the parent */ + if (((Parent->TotalLevels + 1) < 512) && (CmpReferenceKcb(Parent))) + { + /* Link it */ + Kcb->ParentKcb = Parent; + Kcb->TotalLevels = Parent->TotalLevels + 1; + } + else + { + /* Remove the KCB and free it */ + CmpRemoveKcb(Kcb); + CmpFreeKcb(Kcb); + Kcb = NULL; + } + } + else + { + /* No parent, this is the root node */ + Kcb->ParentKcb = NULL; + Kcb->TotalLevels = 1; + } + + /* Check if we have a KCB */ + if (Kcb) + { + /* Get the NCB */ + Kcb->NameBlock = CmpGetNcb(&NodeName); + if (Kcb->NameBlock) + { + /* Fill it out */ + Kcb->ValueCache.Count = Node->ValueList.Count; + Kcb->ValueCache.ValueList = Node->ValueList.List; + Kcb->Flags = Node->Flags; + Kcb->ExtFlags = 0; + Kcb->DelayedCloseIndex = CmpDelayedCloseSize; + + /* Remember if this is a fake key */ + if (IsFake) Kcb->ExtFlags |= CM_KCB_KEY_NON_EXIST; + + /* Setup the other data */ + Kcb->SubKeyCount = Node->SubKeyCounts[0] + + Node->SubKeyCounts[1]; + Kcb->KcbLastWriteTime = Node->LastWriteTime; + Kcb->KcbMaxNameLen = (USHORT)Node->MaxNameLen; + Kcb->KcbMaxValueNameLen = (USHORT)Node->MaxValueNameLen; + Kcb->KcbMaxValueDataLen = (USHORT)Node->MaxValueDataLen; + } + else + { + /* Dereference the KCB */ + CmpDereferenceKcbWithLock(Parent, FALSE); + + /* Remove the KCB and free it */ + CmpRemoveKcb(Kcb); + CmpFreeKcb(Kcb); + Kcb = NULL; + } + } + } + + /* Check if we had locked the hashes */ + if (HashLock) + { + /* Not yet implemented: Unlock hashes */ + KeBugCheck(0); + } + + /* Return the KCB */ + return Kcb; +} +
18 years, 10 months
1
0
0
0
[gedmurphy] 23585: [AUDIT] iprtprio unimplemented
by gedmurphy@svn.reactos.org
Author: gedmurphy Date: Tue Aug 15 01:48:55 2006 New Revision: 23585 URL:
http://svn.reactos.org/svn/reactos?rev=23585&view=rev
Log: [AUDIT] iprtprio unimplemented Modified: trunk/reactos/dll/win32/iprtprio/iprtprio.c (props changed) trunk/reactos/dll/win32/iprtprio/iprtprio.def (props changed) trunk/reactos/dll/win32/iprtprio/iprtprio.rc (props changed) Propchange: trunk/reactos/dll/win32/iprtprio/iprtprio.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/dll/win32/iprtprio/iprtprio.def ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/dll/win32/iprtprio/iprtprio.rc ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -*
18 years, 10 months
1
0
0
0
[gedmurphy] 23584: Add debug print
by gedmurphy@svn.reactos.org
Author: gedmurphy Date: Tue Aug 15 01:35:51 2006 New Revision: 23584 URL:
http://svn.reactos.org/svn/reactos?rev=23584&view=rev
Log: Add debug print Modified: trunk/reactos/base/system/services/rpcserver.c Modified: trunk/reactos/base/system/services/rpcserver.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/services/rpcse…
============================================================================== --- trunk/reactos/base/system/services/rpcserver.c (original) +++ trunk/reactos/base/system/services/rpcserver.c Tue Aug 15 01:35:51 2006 @@ -1792,7 +1792,10 @@ /* Start the service */ Status = ScmStartService(lpService); if (!NT_SUCCESS(Status)) + { + DPRINT("ScmStartService failed!\n"); return RtlNtStatusToDosError(Status); + } return dwError; }
18 years, 10 months
1
0
0
0
[ion] 23583: - Get rid of "ChunkSize" through a sickening hack (however this should make the Hv* interface compatible enough for me to resume work on the cm branch).
by ion@svn.reactos.org
Author: ion Date: Tue Aug 15 01:09:41 2006 New Revision: 23583 URL:
http://svn.reactos.org/svn/reactos?rev=23583&view=rev
Log: - Get rid of "ChunkSize" through a sickening hack (however this should make the Hv* interface compatible enough for me to resume work on the cm branch). Modified: trunk/reactos/boot/freeldr/freeldr/reactos/binhive.c trunk/reactos/lib/cmlib/cmlib.h trunk/reactos/lib/cmlib/hiveinit.c trunk/reactos/ntoskrnl/cm/import.c trunk/reactos/ntoskrnl/cm/regfile.c Modified: trunk/reactos/boot/freeldr/freeldr/reactos/binhive.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/react…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/reactos/binhive.c (original) +++ trunk/reactos/boot/freeldr/freeldr/reactos/binhive.c Tue Aug 15 01:09:41 2006 @@ -715,7 +715,7 @@ CmHive = CmpAllocate(sizeof(EREGISTRY_HIVE), TRUE); Status = HvInitialize (&CmHive->Hive, HV_OPERATION_MEMORY_INPLACE, - (ULONG_PTR)ChunkBase, ChunkSize, + (ULONG_PTR)ChunkBase, 0, CmpAllocate, CmpFree, NULL, NULL, NULL, NULL, NULL); if (!NT_SUCCESS(Status)) Modified: trunk/reactos/lib/cmlib/cmlib.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/cmlib/cmlib.h?rev=2358…
============================================================================== --- trunk/reactos/lib/cmlib/cmlib.h (original) +++ trunk/reactos/lib/cmlib/cmlib.h Tue Aug 15 01:09:41 2006 @@ -142,7 +142,7 @@ PHHIVE RegistryHive, ULONG Operation, ULONG_PTR HiveData OPTIONAL, - SIZE_T Cluster, // HACK!! + ULONG Cluster OPTIONAL, PALLOCATE_ROUTINE Allocate, PFREE_ROUTINE Free, PFILE_READ_ROUTINE FileRead, Modified: trunk/reactos/lib/cmlib/hiveinit.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/cmlib/hiveinit.c?rev=2…
============================================================================== --- trunk/reactos/lib/cmlib/hiveinit.c (original) +++ trunk/reactos/lib/cmlib/hiveinit.c Tue Aug 15 01:09:41 2006 @@ -137,15 +137,22 @@ NTSTATUS CMAPI HvpInitializeMemoryHive( PHHIVE Hive, - ULONG_PTR ChunkBase, - SIZE_T ChunkSize) + ULONG_PTR ChunkBase) { SIZE_T BlockIndex; PHBIN Bin, NewBin; ULONG i; ULONG BitmapSize; PULONG BitmapBuffer; - + SIZE_T ChunkSize; + + // + // This hack is similar in magnitude to the US's National Debt + // + ChunkSize = ((PHBASE_BLOCK)ChunkBase)->Length; + ((PHBASE_BLOCK)ChunkBase)->Length = HV_BLOCK_SIZE; + DPRINT1("ChunkSize: %lx\n", ChunkSize); + if (ChunkSize < sizeof(HBASE_BLOCK) || !HvpVerifyHiveHeader((PHBASE_BLOCK)ChunkBase)) { @@ -250,11 +257,9 @@ NTSTATUS CMAPI HvpInitializeMemoryInplaceHive( PHHIVE Hive, - ULONG_PTR ChunkBase, - SIZE_T ChunkSize) -{ - if (ChunkSize < sizeof(HBASE_BLOCK) || - !HvpVerifyHiveHeader((PHBASE_BLOCK)ChunkBase)) + ULONG_PTR ChunkBase) +{ + if (!HvpVerifyHiveHeader((PHBASE_BLOCK)ChunkBase)) { return STATUS_REGISTRY_CORRUPT; } @@ -301,8 +306,8 @@ HvInitialize( PHHIVE RegistryHive, ULONG Operation, - ULONG_PTR ChunkBase, - SIZE_T ChunkSize, + ULONG_PTR HiveData OPTIONAL, + ULONG Cluster OPTIONAL, PALLOCATE_ROUTINE Allocate, PFREE_ROUTINE Free, PFILE_READ_ROUTINE FileRead, @@ -334,11 +339,11 @@ break; case HV_OPERATION_MEMORY: - Status = HvpInitializeMemoryHive(Hive, ChunkBase, ChunkSize); + Status = HvpInitializeMemoryHive(Hive, HiveData); break; case HV_OPERATION_MEMORY_INPLACE: - Status = HvpInitializeMemoryInplaceHive(Hive, ChunkBase, ChunkSize); + Status = HvpInitializeMemoryInplaceHive(Hive, HiveData); break; default: Modified: trunk/reactos/ntoskrnl/cm/import.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/cm/import.c?rev=2…
============================================================================== --- trunk/reactos/ntoskrnl/cm/import.c (original) +++ trunk/reactos/ntoskrnl/cm/import.c Tue Aug 15 01:09:41 2006 @@ -51,8 +51,9 @@ Hive->Flags = Flags; /* Allocate hive header */ + ((PHBASE_BLOCK)ChunkBase)->Length = ChunkSize; Status = HvInitialize(&Hive->Hive, HV_OPERATION_MEMORY, - (ULONG_PTR)ChunkBase, ChunkSize, + (ULONG_PTR)ChunkBase, 0, CmpAllocate, CmpFree, CmpFileRead, CmpFileWrite, CmpFileSetSize, CmpFileFlush, NULL); Modified: trunk/reactos/ntoskrnl/cm/regfile.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/cm/regfile.c?rev=…
============================================================================== --- trunk/reactos/ntoskrnl/cm/regfile.c (original) +++ trunk/reactos/ntoskrnl/cm/regfile.c Tue Aug 15 01:09:41 2006 @@ -569,8 +569,9 @@ } DPRINT("ViewBase %p ViewSize %lx\n", ViewBase, ViewSize); + ((PHBASE_BLOCK)ViewBase)->Length = ViewSize; Status = HvInitialize(&RegistryHive->Hive, HV_OPERATION_MEMORY, - (ULONG_PTR)ViewBase, ViewSize, + (ULONG_PTR)ViewBase, 0, CmpAllocate, CmpFree, CmpFileRead, CmpFileWrite, CmpFileSetSize, CmpFileFlush, NULL);
18 years, 10 months
1
0
0
0
[greatlrd] 23582: uppdate Dejavu font from 2.7 to 2.9
by greatlrd@svn.reactos.org
Author: greatlrd Date: Mon Aug 14 23:48:29 2006 New Revision: 23582 URL:
http://svn.reactos.org/svn/reactos?rev=23582&view=rev
Log: uppdate Dejavu font from 2.7 to 2.9 Added: trunk/reactos/media/fonts/doc/DejaVu_LICENSE.txt Modified: trunk/reactos/media/fonts/DejaVuSans-Bold.ttf trunk/reactos/media/fonts/DejaVuSans-BoldOblique.ttf trunk/reactos/media/fonts/DejaVuSans-ExtraLight.ttf trunk/reactos/media/fonts/DejaVuSans-Oblique.ttf trunk/reactos/media/fonts/DejaVuSans.ttf trunk/reactos/media/fonts/DejaVuSansCondensed-Bold.ttf trunk/reactos/media/fonts/DejaVuSansCondensed-BoldOblique.ttf trunk/reactos/media/fonts/DejaVuSansCondensed-Oblique.ttf trunk/reactos/media/fonts/DejaVuSansCondensed.ttf trunk/reactos/media/fonts/DejaVuSansMono-Bold.ttf trunk/reactos/media/fonts/DejaVuSansMono-BoldOblique.ttf trunk/reactos/media/fonts/DejaVuSansMono-Oblique.ttf trunk/reactos/media/fonts/DejaVuSansMono.ttf trunk/reactos/media/fonts/DejaVuSerif-Bold.ttf trunk/reactos/media/fonts/DejaVuSerif-BoldOblique.ttf trunk/reactos/media/fonts/DejaVuSerif-Oblique.ttf trunk/reactos/media/fonts/DejaVuSerif.ttf trunk/reactos/media/fonts/DejaVuSerifCondensed-Bold.ttf trunk/reactos/media/fonts/DejaVuSerifCondensed-BoldOblique.ttf trunk/reactos/media/fonts/DejaVuSerifCondensed-Oblique.ttf trunk/reactos/media/fonts/DejaVuSerifCondensed.ttf trunk/reactos/media/fonts/doc/DejaVu_NEWS.txt trunk/reactos/media/fonts/doc/DejaVu_README.txt trunk/reactos/media/fonts/doc/DejaVu_langcover.txt trunk/reactos/media/fonts/doc/DejaVu_status.txt trunk/reactos/media/fonts/doc/DejaVu_unicover.txt [This mail would be too long, it was shortened to contain the URLs only.] Modified: trunk/reactos/media/fonts/DejaVuSans-Bold.ttf URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/fonts/DejaVuSans-Bol…
Modified: trunk/reactos/media/fonts/DejaVuSans-BoldOblique.ttf URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/fonts/DejaVuSans-Bol…
Modified: trunk/reactos/media/fonts/DejaVuSans-ExtraLight.ttf URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/fonts/DejaVuSans-Ext…
Modified: trunk/reactos/media/fonts/DejaVuSans-Oblique.ttf URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/fonts/DejaVuSans-Obl…
Modified: trunk/reactos/media/fonts/DejaVuSans.ttf URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/fonts/DejaVuSans.ttf…
Modified: trunk/reactos/media/fonts/DejaVuSansCondensed-Bold.ttf URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/fonts/DejaVuSansCond…
Modified: trunk/reactos/media/fonts/DejaVuSansCondensed-BoldOblique.ttf URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/fonts/DejaVuSansCond…
Modified: trunk/reactos/media/fonts/DejaVuSansCondensed-Oblique.ttf URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/fonts/DejaVuSansCond…
Modified: trunk/reactos/media/fonts/DejaVuSansCondensed.ttf URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/fonts/DejaVuSansCond…
Modified: trunk/reactos/media/fonts/DejaVuSansMono-Bold.ttf URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/fonts/DejaVuSansMono…
Modified: trunk/reactos/media/fonts/DejaVuSansMono-BoldOblique.ttf URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/fonts/DejaVuSansMono…
Modified: trunk/reactos/media/fonts/DejaVuSansMono-Oblique.ttf URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/fonts/DejaVuSansMono…
Modified: trunk/reactos/media/fonts/DejaVuSansMono.ttf URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/fonts/DejaVuSansMono…
Modified: trunk/reactos/media/fonts/DejaVuSerif-Bold.ttf URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/fonts/DejaVuSerif-Bo…
Modified: trunk/reactos/media/fonts/DejaVuSerif-BoldOblique.ttf URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/fonts/DejaVuSerif-Bo…
Modified: trunk/reactos/media/fonts/DejaVuSerif-Oblique.ttf URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/fonts/DejaVuSerif-Ob…
Modified: trunk/reactos/media/fonts/DejaVuSerif.ttf URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/fonts/DejaVuSerif.tt…
Modified: trunk/reactos/media/fonts/DejaVuSerifCondensed-Bold.ttf URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/fonts/DejaVuSerifCon…
Modified: trunk/reactos/media/fonts/DejaVuSerifCondensed-BoldOblique.ttf URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/fonts/DejaVuSerifCon…
Modified: trunk/reactos/media/fonts/DejaVuSerifCondensed-Oblique.ttf URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/fonts/DejaVuSerifCon…
Modified: trunk/reactos/media/fonts/DejaVuSerifCondensed.ttf URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/fonts/DejaVuSerifCon…
Added: trunk/reactos/media/fonts/doc/DejaVu_LICENSE.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/fonts/doc/DejaVu_LIC…
Modified: trunk/reactos/media/fonts/doc/DejaVu_NEWS.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/fonts/doc/DejaVu_NEW…
Modified: trunk/reactos/media/fonts/doc/DejaVu_README.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/fonts/doc/DejaVu_REA…
Modified: trunk/reactos/media/fonts/doc/DejaVu_langcover.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/fonts/doc/DejaVu_lan…
Modified: trunk/reactos/media/fonts/doc/DejaVu_status.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/fonts/doc/DejaVu_sta…
Modified: trunk/reactos/media/fonts/doc/DejaVu_unicover.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/fonts/doc/DejaVu_uni…
18 years, 10 months
1
0
0
0
[janderwald] 23581: * create a directory "system" under %SystemRoot% to make dumb apps work * fixes bug 879
by janderwald@svn.reactos.org
Author: janderwald Date: Mon Aug 14 21:40:41 2006 New Revision: 23581 URL:
http://svn.reactos.org/svn/reactos?rev=23581&view=rev
Log: * create a directory "system" under %SystemRoot% to make dumb apps work * fixes bug 879 Modified: trunk/reactos/dll/win32/syssetup/install.c Modified: trunk/reactos/dll/win32/syssetup/install.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/syssetup/install…
============================================================================== --- trunk/reactos/dll/win32/syssetup/install.c (original) +++ trunk/reactos/dll/win32/syssetup/install.c Mon Aug 14 21:40:41 2006 @@ -488,7 +488,7 @@ { TCHAR sAccessories[256]; TCHAR sGames[256]; - + TCHAR szBuffer[MAX_PATH]; # if 0 OutputDebugStringA ("InstallReactOS() called\n"); @@ -627,6 +627,13 @@ CreateTempDir(L"TEMP"); CreateTempDir(L"TMP"); + if (GetWindowsDirectory(szBuffer, sizeof(szBuffer) / sizeof(TCHAR))) + { + PathAddBackslash(szBuffer); + _tcscat(szBuffer, _T("system")); + CreateDirectory(szBuffer, NULL); + } + hSysSetupInf = SetupOpenInfFileW(L"syssetup.inf", NULL, INF_STYLE_WIN4,
18 years, 10 months
1
0
0
0
[gedmurphy] 23580: [AUDIT] ws2_32 - All exported functions are fully documented on MSDN - All internal functions are clearly written with no signs of reversing - Reformat all code to ReactOS standard
by gedmurphy@svn.reactos.org
Author: gedmurphy Date: Mon Aug 14 21:26:36 2006 New Revision: 23580 URL:
http://svn.reactos.org/svn/reactos?rev=23580&view=rev
Log: [AUDIT] ws2_32 - All exported functions are fully documented on MSDN - All internal functions are clearly written with no signs of reversing - Reformat all code to ReactOS standard Modified: trunk/reactos/dll/win32/ws2_32/include/catalog.h (contents, props changed) trunk/reactos/dll/win32/ws2_32/include/debug.h (props changed) trunk/reactos/dll/win32/ws2_32/include/handle.h (contents, props changed) trunk/reactos/dll/win32/ws2_32/include/upcall.h (props changed) trunk/reactos/dll/win32/ws2_32/include/ws2_32.h (contents, props changed) trunk/reactos/dll/win32/ws2_32/misc/bsd.c (contents, props changed) trunk/reactos/dll/win32/ws2_32/misc/catalog.c (contents, props changed) trunk/reactos/dll/win32/ws2_32/misc/dllmain.c (contents, props changed) trunk/reactos/dll/win32/ws2_32/misc/event.c (contents, props changed) trunk/reactos/dll/win32/ws2_32/misc/handle.c (contents, props changed) trunk/reactos/dll/win32/ws2_32/misc/ns.c (contents, props changed) trunk/reactos/dll/win32/ws2_32/misc/sndrcv.c (contents, props changed) trunk/reactos/dll/win32/ws2_32/misc/stubs.c (contents, props changed) trunk/reactos/dll/win32/ws2_32/misc/upcall.c (contents, props changed) trunk/reactos/dll/win32/ws2_32/tests/setup.c (props changed) trunk/reactos/dll/win32/ws2_32/tests/stubs.tst (props changed) trunk/reactos/dll/win32/ws2_32/tests/tests/WinsockEvent.c (props changed) trunk/reactos/dll/win32/ws2_32/ws2_32.def (props changed) trunk/reactos/dll/win32/ws2_32/ws2_32.rc (props changed) trunk/reactos/dll/win32/ws2_32/ws2_32_specs (props changed) [This mail would be too long, it was shortened to contain the URLs only.] Modified: trunk/reactos/dll/win32/ws2_32/include/catalog.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ws2_32/include/c…
Modified: trunk/reactos/dll/win32/ws2_32/include/handle.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ws2_32/include/h…
Modified: trunk/reactos/dll/win32/ws2_32/include/ws2_32.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ws2_32/include/w…
Modified: trunk/reactos/dll/win32/ws2_32/misc/bsd.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ws2_32/misc/bsd.…
Modified: trunk/reactos/dll/win32/ws2_32/misc/catalog.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ws2_32/misc/cata…
Modified: trunk/reactos/dll/win32/ws2_32/misc/dllmain.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ws2_32/misc/dllm…
Modified: trunk/reactos/dll/win32/ws2_32/misc/event.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ws2_32/misc/even…
Modified: trunk/reactos/dll/win32/ws2_32/misc/handle.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ws2_32/misc/hand…
Modified: trunk/reactos/dll/win32/ws2_32/misc/ns.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ws2_32/misc/ns.c…
Modified: trunk/reactos/dll/win32/ws2_32/misc/sndrcv.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ws2_32/misc/sndr…
Modified: trunk/reactos/dll/win32/ws2_32/misc/stubs.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ws2_32/misc/stub…
Modified: trunk/reactos/dll/win32/ws2_32/misc/upcall.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ws2_32/misc/upca…
18 years, 10 months
1
0
0
0
[jimtabor] 23579: - User32: menu, patch by Michael Kaufmann. Fix the keyboard navigation and some graphical glitches for multi-column menus.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Mon Aug 14 18:44:40 2006 New Revision: 23579 URL:
http://svn.reactos.org/svn/reactos?rev=23579&view=rev
Log: - User32: menu, patch by Michael Kaufmann. Fix the keyboard navigation and some graphical glitches for multi-column menus. Modified: trunk/reactos/dll/win32/user32/windows/menu.c Modified: trunk/reactos/dll/win32/user32/windows/menu.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/windows/m…
============================================================================== --- trunk/reactos/dll/win32/user32/windows/menu.c (original) +++ trunk/reactos/dll/win32/user32/windows/menu.c Mon Aug 14 18:44:40 2006 @@ -668,6 +668,7 @@ { HPEN oldPen; RECT rc = Rect; + rc.left -= 3; rc.top = 3; rc.bottom = Height - 3; if (flat_menu) @@ -1408,11 +1409,11 @@ MenuSetRosMenuInfo(MenuInfo); return; } - - if (0 != (ItemInfo.fType & MF_MENUBARBREAK)) - { - OrgX++; - } +// Not sure here,, The patch from wine removes this. +// if (0 != (ItemInfo.fType & MF_MENUBARBREAK)) +// { +// OrgX++; +// } MaxX = max(MaxX, ItemInfo.Rect.right); OrgY = ItemInfo.Rect.bottom; if ((ItemInfo.Text) && 0 != ItemInfo.XTab) @@ -2664,7 +2665,7 @@ for (i++ ; i < MenuInfo->MenuItemCount; i++) { - if (0 != (MenuItems[i].fType & MF_MENUBARBREAK)) + if (0 != (MenuItems[i].fType & (MF_MENUBREAK | MF_MENUBARBREAK))) { return i; } @@ -2696,7 +2697,7 @@ /* Find the start of the column */ for (i = MenuInfo->FocusedItem; - 0 != i && 0 == (MenuItems[i].fType & MF_MENUBARBREAK); + 0 != i && 0 == (MenuItems[i].fType & (MF_MENUBREAK | MF_MENUBARBREAK)); --i) { ; /* empty */ @@ -2710,7 +2711,7 @@ for (--i; 0 != i; --i) { - if (MenuItems[i].fType & MF_MENUBARBREAK) + if (MenuItems[i].fType & (MF_MENUBREAK | MF_MENUBARBREAK)) { break; }
18 years, 10 months
1
0
0
0
[ion] 23578: - Make HHIVE part of EREGISTRY_HIVE, similarly to NT. - Get rid of Opaque member and paramter..
by ion@svn.reactos.org
Author: ion Date: Mon Aug 14 18:16:00 2006 New Revision: 23578 URL:
http://svn.reactos.org/svn/reactos?rev=23578&view=rev
Log: - Make HHIVE part of EREGISTRY_HIVE, similarly to NT. - Get rid of Opaque member and paramter.. Modified: trunk/reactos/boot/freeldr/freeldr/reactos/binhive.c trunk/reactos/lib/cmlib/cmlib.h trunk/reactos/lib/cmlib/hiveinit.c trunk/reactos/ntoskrnl/cm/cm.h trunk/reactos/ntoskrnl/cm/import.c trunk/reactos/ntoskrnl/cm/ntfunc.c trunk/reactos/ntoskrnl/cm/regfile.c trunk/reactos/ntoskrnl/cm/registry.c trunk/reactos/ntoskrnl/cm/regobj.c Modified: trunk/reactos/boot/freeldr/freeldr/reactos/binhive.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/react…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/reactos/binhive.c (original) +++ trunk/reactos/boot/freeldr/freeldr/reactos/binhive.c Mon Aug 14 18:16:00 2006 @@ -707,21 +707,24 @@ FRLDRHKEY SystemKey; ULONG i; LONG Error; + PEREGISTRY_HIVE CmHive; PHHIVE Hive; NTSTATUS Status; DbgPrint((DPRINT_REGISTRY, "RegImportBinaryHive(%x, %u) called\n",ChunkBase,ChunkSize)); - Status = HvInitialize (&Hive, HV_OPERATION_MEMORY_INPLACE, + CmHive = CmpAllocate(sizeof(EREGISTRY_HIVE), TRUE); + Status = HvInitialize (&CmHive->Hive, HV_OPERATION_MEMORY_INPLACE, (ULONG_PTR)ChunkBase, ChunkSize, CmpAllocate, CmpFree, - NULL, NULL, NULL, NULL, NULL, NULL); + NULL, NULL, NULL, NULL, NULL); if (!NT_SUCCESS(Status)) { DbgPrint((DPRINT_REGISTRY, "Invalid hive id!\n")); return FALSE; } + Hive = &CmHive->Hive; KeyCell = HvGetCell (Hive, Hive->HiveHeader->RootCell); DbgPrint((DPRINT_REGISTRY, "KeyCell: %x\n", KeyCell)); DbgPrint((DPRINT_REGISTRY, "KeyCell->Id: %x\n", KeyCell->Id)); @@ -803,14 +806,17 @@ PCHAR ChunkBase, ULONG* ChunkSize) { + PEREGISTRY_HIVE CmHive; PHHIVE Hive; NTSTATUS Status; DbgPrint((DPRINT_REGISTRY, "Creating binary hardware hive\n")); - Status = HvInitialize (&Hive, HV_OPERATION_CREATE_HIVE, 0, 0, + CmHive = CmpAllocate(sizeof(EREGISTRY_HIVE), TRUE); + Status = HvInitialize (&CmHive->Hive, HV_OPERATION_CREATE_HIVE, 0, 0, CmpAllocate, CmpFree, - NULL, NULL, NULL, NULL, NULL, NULL); + NULL, NULL, NULL, NULL, NULL); + Hive = &CmHive->Hive; if (!NT_SUCCESS(Status)) { return FALSE; Modified: trunk/reactos/lib/cmlib/cmlib.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/cmlib/cmlib.h?rev=2357…
============================================================================== --- trunk/reactos/lib/cmlib/cmlib.h (original) +++ trunk/reactos/lib/cmlib/cmlib.h Mon Aug 14 18:16:00 2006 @@ -115,8 +115,19 @@ ULONG StorageTypeCount; ULONG Version; DUAL Storage[HvMaxStorageType]; - PVOID Opaque; // FIXME: KILL! } HHIVE, *PHHIVE; + +typedef struct _EREGISTRY_HIVE +{ + HHIVE Hive; + LIST_ENTRY HiveList; + UNICODE_STRING HiveFileName; + UNICODE_STRING LogFileName; + PCM_KEY_SECURITY RootSecurityCell; + ULONG Flags; + HANDLE HiveHandle; + HANDLE LogHandle; +} EREGISTRY_HIVE, *PEREGISTRY_HIVE; /* * Public functions. @@ -128,7 +139,7 @@ NTSTATUS CMAPI HvInitialize( - PHHIVE *RegistryHive, + PHHIVE RegistryHive, ULONG Operation, ULONG_PTR HiveData OPTIONAL, SIZE_T Cluster, // HACK!! @@ -138,7 +149,6 @@ PFILE_WRITE_ROUTINE FileWrite, PFILE_SET_SIZE_ROUTINE FileSetSize, PFILE_FLUSH_ROUTINE FileFlush, - PVOID Opaque, // HACK!! IN PUNICODE_STRING FileName); VOID CMAPI Modified: trunk/reactos/lib/cmlib/hiveinit.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/cmlib/hiveinit.c?rev=2…
============================================================================== --- trunk/reactos/lib/cmlib/hiveinit.c (original) +++ trunk/reactos/lib/cmlib/hiveinit.c Mon Aug 14 18:16:00 2006 @@ -299,7 +299,7 @@ NTSTATUS CMAPI HvInitialize( - PHHIVE *RegistryHive, + PHHIVE RegistryHive, ULONG Operation, ULONG_PTR ChunkBase, SIZE_T ChunkSize, @@ -309,19 +309,15 @@ PFILE_WRITE_ROUTINE FileWrite, PFILE_SET_SIZE_ROUTINE FileSetSize, PFILE_FLUSH_ROUTINE FileFlush, - PVOID Opaque, IN PUNICODE_STRING FileName) { NTSTATUS Status; - PHHIVE Hive; + PHHIVE Hive = RegistryHive; /* * Create a new hive structure that will hold all the maintenance data. */ - Hive = Allocate(sizeof(HHIVE), TRUE); - if (Hive == NULL) - return STATUS_NO_MEMORY; RtlZeroMemory(Hive, sizeof(HHIVE)); Hive->Allocate = Allocate; @@ -330,7 +326,6 @@ Hive->FileWrite = FileWrite; Hive->FileSetSize = FileSetSize; Hive->FileFlush = FileFlush; - Hive->Opaque = Opaque; switch (Operation) { @@ -358,8 +353,6 @@ return Status; } - *RegistryHive = Hive; - return Status; } Modified: trunk/reactos/ntoskrnl/cm/cm.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/cm/cm.h?rev=23578…
============================================================================== --- trunk/reactos/ntoskrnl/cm/cm.h (original) +++ trunk/reactos/ntoskrnl/cm/cm.h Mon Aug 14 18:16:00 2006 @@ -37,18 +37,6 @@ #define REG_SAM_FILE_NAME L"\\sam" #define REG_SEC_FILE_NAME L"\\security" -typedef struct _EREGISTRY_HIVE -{ - LIST_ENTRY HiveList; - PHHIVE Hive; - UNICODE_STRING HiveFileName; - UNICODE_STRING LogFileName; - PCM_KEY_SECURITY RootSecurityCell; - ULONG Flags; - HANDLE HiveHandle; - HANDLE LogHandle; -} EREGISTRY_HIVE, *PEREGISTRY_HIVE; - /* When set, the hive is not backed by a file. Therefore, it can not be flushed to disk. */ #define HIVE_NO_FILE 0x00000002 Modified: trunk/reactos/ntoskrnl/cm/import.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/cm/import.c?rev=2…
============================================================================== --- trunk/reactos/ntoskrnl/cm/import.c (original) +++ trunk/reactos/ntoskrnl/cm/import.c Mon Aug 14 18:16:00 2006 @@ -55,7 +55,7 @@ (ULONG_PTR)ChunkBase, ChunkSize, CmpAllocate, CmpFree, CmpFileRead, CmpFileWrite, CmpFileSetSize, - CmpFileFlush, Hive, NULL); + CmpFileFlush, NULL); if (!NT_SUCCESS(Status)) { DPRINT1 ("Opening hive failed (%x)\n", Status); @@ -63,7 +63,7 @@ return FALSE; } - CmPrepareHive(Hive->Hive); + CmPrepareHive(&Hive->Hive); /* Acquire hive list lock exclusively */ KeEnterCriticalRegion(); Modified: trunk/reactos/ntoskrnl/cm/ntfunc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/cm/ntfunc.c?rev=2…
============================================================================== --- trunk/reactos/ntoskrnl/cm/ntfunc.c (original) +++ trunk/reactos/ntoskrnl/cm/ntfunc.c Mon Aug 14 18:16:00 2006 @@ -781,7 +781,7 @@ } ASSERT(KeyCell->SubKeyLists[Storage] != HCELL_NULL); - HashTableBlock = HvGetCell (RegistryHive->Hive, KeyCell->SubKeyLists[Storage]); + HashTableBlock = HvGetCell (&RegistryHive->Hive, KeyCell->SubKeyLists[Storage]); SubKeyCell = CmiGetKeyFromHashByIndex(RegistryHive, HashTableBlock, @@ -899,7 +899,7 @@ if (ClassSize != 0) { - ClassCell = HvGetCell (KeyObject->RegistryHive->Hive, + ClassCell = HvGetCell (&KeyObject->RegistryHive->Hive, SubKeyCell->ClassNameOffset); RtlCopyMemory (NodeInformation->Name + SubKeyCell->NameSize, ClassCell, @@ -947,7 +947,7 @@ if (ClassSize != 0) { - ClassCell = HvGetCell (KeyObject->RegistryHive->Hive, + ClassCell = HvGetCell (&KeyObject->RegistryHive->Hive, SubKeyCell->ClassNameOffset); RtlCopyMemory (FullInformation->Class, ClassCell, @@ -1117,7 +1117,7 @@ if (!(ValueCell->DataSize & REG_DATA_IN_OFFSET)) { - DataCell = HvGetCell (RegistryHive->Hive, ValueCell->DataOffset); + DataCell = HvGetCell (&RegistryHive->Hive, ValueCell->DataOffset); RtlCopyMemory(ValuePartialInformation->Data, DataCell, DataSize); @@ -1190,7 +1190,7 @@ if (!(ValueCell->DataSize & REG_DATA_IN_OFFSET)) { - DataCell = HvGetCell (RegistryHive->Hive, ValueCell->DataOffset); + DataCell = HvGetCell (&RegistryHive->Hive, ValueCell->DataOffset); RtlCopyMemory((PCHAR) ValueFullInformation + ValueFullInformation->DataOffset, DataCell, DataSize); @@ -1574,7 +1574,7 @@ if (ClassSize != 0) { - ClassCell = HvGetCell (KeyObject->RegistryHive->Hive, + ClassCell = HvGetCell (&KeyObject->RegistryHive->Hive, KeyCell->ClassNameOffset); RtlCopyMemory (NodeInformation->Name + KeyObject->Name.Length, ClassCell, @@ -1621,7 +1621,7 @@ if (ClassSize) { - ClassCell = HvGetCell (KeyObject->RegistryHive->Hive, + ClassCell = HvGetCell (&KeyObject->RegistryHive->Hive, KeyCell->ClassNameOffset); RtlCopyMemory (FullInformation->Class, ClassCell, ClassSize); @@ -1806,7 +1806,7 @@ if (!(ValueCell->DataSize & REG_DATA_IN_OFFSET)) { - DataCell = HvGetCell (RegistryHive->Hive, ValueCell->DataOffset); + DataCell = HvGetCell (&RegistryHive->Hive, ValueCell->DataOffset); RtlCopyMemory(ValuePartialInformation->Data, DataCell, DataSize); @@ -1881,7 +1881,7 @@ } if (!(ValueCell->DataSize & REG_DATA_IN_OFFSET)) { - DataCell = HvGetCell (RegistryHive->Hive, ValueCell->DataOffset); + DataCell = HvGetCell (&RegistryHive->Hive, ValueCell->DataOffset); RtlCopyMemory((PCHAR) ValueFullInformation + ValueFullInformation->DataOffset, DataCell, @@ -2010,8 +2010,8 @@ if (!(ValueCell->DataSize & REG_DATA_IN_OFFSET) && (ValueCell->DataSize & REG_DATA_SIZE_MASK) != 0) { - DataCell = HvGetCell (RegistryHive->Hive, ValueCell->DataOffset); - DataCellSize = -HvGetCellSize (RegistryHive->Hive, DataCell); + DataCell = HvGetCell (&RegistryHive->Hive, ValueCell->DataOffset); + DataCellSize = -HvGetCellSize (&RegistryHive->Hive, DataCell); } else { @@ -2026,13 +2026,13 @@ DPRINT("ValueCell->DataSize %lu\n", ValueCell->DataSize); if (DataCell) { - HvFreeCell(RegistryHive->Hive, ValueCell->DataOffset); + HvFreeCell(&RegistryHive->Hive, ValueCell->DataOffset); } RtlCopyMemory(&ValueCell->DataOffset, Data, DataSize); ValueCell->DataSize = DataSize | REG_DATA_IN_OFFSET; ValueCell->DataType = Type; - HvMarkCellDirty(RegistryHive->Hive, ValueCellOffset); + HvMarkCellDirty(&RegistryHive->Hive, ValueCellOffset); } else { @@ -2046,7 +2046,7 @@ DPRINT("ValueCell->DataSize %lu\n", ValueCell->DataSize); - NewOffset = HvAllocateCell (RegistryHive->Hive, DataSize, HvStable); + NewOffset = HvAllocateCell (&RegistryHive->Hive, DataSize, HvStable); if (NewOffset == HCELL_NULL) { DPRINT("CmiAllocateBlock() failed (Status %lx)\n", Status); @@ -2062,18 +2062,18 @@ if (DataCell) { - HvFreeCell(RegistryHive->Hive, ValueCell->DataOffset); + HvFreeCell(&RegistryHive->Hive, ValueCell->DataOffset); } ValueCell->DataOffset = NewOffset; - DataCell = HvGetCell(RegistryHive->Hive, NewOffset); + DataCell = HvGetCell(&RegistryHive->Hive, NewOffset); } RtlCopyMemory(DataCell, Data, DataSize); ValueCell->DataSize = DataSize & REG_DATA_SIZE_MASK; ValueCell->DataType = Type; - HvMarkCellDirty(RegistryHive->Hive, ValueCell->DataOffset); - HvMarkCellDirty(RegistryHive->Hive, ValueCellOffset); + HvMarkCellDirty(&RegistryHive->Hive, ValueCell->DataOffset); + HvMarkCellDirty(&RegistryHive->Hive, ValueCellOffset); } /* Mark link key */ @@ -2084,7 +2084,7 @@ } KeQuerySystemTime (&KeyCell->LastWriteTime); - HvMarkCellDirty (RegistryHive->Hive, KeyObject->KeyCellOffset); + HvMarkCellDirty (&RegistryHive->Hive, KeyObject->KeyCellOffset); ExReleaseResourceLite(&CmiRegistryLock); KeLeaveCriticalRegion(); @@ -2160,7 +2160,7 @@ ValueName); KeQuerySystemTime (&KeyObject->KeyCell->LastWriteTime); - HvMarkCellDirty (KeyObject->RegistryHive->Hive, KeyObject->KeyCellOffset); + HvMarkCellDirty (&KeyObject->RegistryHive->Hive, KeyObject->KeyCellOffset); /* Release hive lock */ ExReleaseResourceLite(&CmiRegistryLock); @@ -2461,7 +2461,7 @@ if (!(ValueCell->DataSize & REG_DATA_IN_OFFSET)) { - DataCell = HvGetCell (RegistryHive->Hive, + DataCell = HvGetCell (&RegistryHive->Hive, ValueCell->DataOffset); RtlCopyMemory(DataPtr, DataCell, ValueCell->DataSize & REG_DATA_SIZE_MASK); @@ -2685,7 +2685,7 @@ KeyObject->KeyCell->LastWriteTime.QuadPart = ((PKEY_WRITE_TIME_INFORMATION)KeyInformation)->LastWriteTime.QuadPart; - HvMarkCellDirty (KeyObject->RegistryHive->Hive, + HvMarkCellDirty (&KeyObject->RegistryHive->Hive, KeyObject->KeyCellOffset); /* Release hive lock */ Modified: trunk/reactos/ntoskrnl/cm/regfile.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/cm/regfile.c?rev=…
============================================================================== --- trunk/reactos/ntoskrnl/cm/regfile.c (original) +++ trunk/reactos/ntoskrnl/cm/regfile.c Mon Aug 14 18:16:00 2006 @@ -50,7 +50,7 @@ PVOID Buffer, ULONG BufferLength) { - PEREGISTRY_HIVE CmHive = RegistryHive->Opaque; + PEREGISTRY_HIVE CmHive = (PEREGISTRY_HIVE)RegistryHive; HANDLE HiveHandle = FileType == HV_TYPE_PRIMARY ? CmHive->HiveHandle : CmHive->LogHandle; LARGE_INTEGER _FileOffset; IO_STATUS_BLOCK IoStatusBlock; @@ -71,7 +71,7 @@ PVOID Buffer, ULONG BufferLength) { - PEREGISTRY_HIVE CmHive = RegistryHive->Opaque; + PEREGISTRY_HIVE CmHive = (PEREGISTRY_HIVE)RegistryHive; HANDLE HiveHandle = FileType == HV_TYPE_PRIMARY ? CmHive->HiveHandle : CmHive->LogHandle; LARGE_INTEGER _FileOffset; IO_STATUS_BLOCK IoStatusBlock; @@ -90,7 +90,7 @@ ULONG FileType, ULONG FileSize) { - PEREGISTRY_HIVE CmHive = RegistryHive->Opaque; + PEREGISTRY_HIVE CmHive = (PEREGISTRY_HIVE)RegistryHive; HANDLE HiveHandle = FileType == HV_TYPE_PRIMARY ? CmHive->HiveHandle : CmHive->LogHandle; FILE_END_OF_FILE_INFORMATION EndOfFileInfo; FILE_ALLOCATION_INFORMATION FileAllocationInfo; @@ -122,7 +122,7 @@ PHHIVE RegistryHive, ULONG FileType) { - PEREGISTRY_HIVE CmHive = RegistryHive->Opaque; + PEREGISTRY_HIVE CmHive = (PEREGISTRY_HIVE)RegistryHive; HANDLE HiveHandle = FileType == HV_TYPE_PRIMARY ? CmHive->HiveHandle : CmHive->LogHandle; IO_STATUS_BLOCK IoStatusBlock; NTSTATUS Status; @@ -135,21 +135,23 @@ static NTSTATUS CmiCreateNewRegFile(HANDLE FileHandle) { - EREGISTRY_HIVE CmHive; + PEREGISTRY_HIVE CmHive; PHHIVE Hive; NTSTATUS Status; - CmHive.HiveHandle = FileHandle; - Status = HvInitialize(&Hive, HV_OPERATION_CREATE_HIVE, 0, 0, + CmHive = CmpAllocate(sizeof(EREGISTRY_HIVE), TRUE); + CmHive->HiveHandle = FileHandle; + Status = HvInitialize(&CmHive->Hive, HV_OPERATION_CREATE_HIVE, 0, 0, CmpAllocate, CmpFree, CmpFileRead, CmpFileWrite, CmpFileSetSize, - CmpFileFlush, &CmHive, NULL); + CmpFileFlush, NULL); if (!NT_SUCCESS(Status)) { return FALSE; } /* Init root key cell */ + Hive = &CmHive->Hive; if (!CmCreateRootNode(Hive, L"")) { HvFree (Hive); @@ -571,7 +573,7 @@ (ULONG_PTR)ViewBase, ViewSize, CmpAllocate, CmpFree, CmpFileRead, CmpFileWrite, CmpFileSetSize, - CmpFileFlush, RegistryHive, NULL); + CmpFileFlush, NULL); if (!NT_SUCCESS(Status)) { DPRINT1("Failed to open hive\n"); @@ -584,7 +586,7 @@ return Status; } - CmPrepareHive(RegistryHive->Hive); + CmPrepareHive(&RegistryHive->Hive); /* Unmap and dereference the hive section */ MmUnmapViewOfSection(PsGetCurrentProcess(), @@ -622,16 +624,16 @@ Status = HvInitialize(&Hive->Hive, HV_OPERATION_CREATE_HIVE, 0, 0, CmpAllocate, CmpFree, CmpFileRead, CmpFileWrite, CmpFileSetSize, - CmpFileFlush, Hive, NULL); + CmpFileFlush, NULL); if (!NT_SUCCESS(Status)) { ExFreePool (Hive); return Status; } - if (!CmCreateRootNode (Hive->Hive, L"")) - { - HvFree (Hive->Hive); + if (!CmCreateRootNode (&Hive->Hive, L"")) + { + HvFree (&Hive->Hive); ExFreePool (Hive); return STATUS_INSUFFICIENT_RESOURCES; } @@ -732,7 +734,7 @@ RtlFreeUnicodeString (&RegistryHive->LogFileName); /* Release hive */ - HvFree (RegistryHive->Hive); + HvFree (&RegistryHive->Hive); return STATUS_SUCCESS; } @@ -810,7 +812,7 @@ ASSERT(!IsNoFileHive(RegistryHive)); - if (RtlFindSetBits(&RegistryHive->Hive->DirtyVector, 1, 0) == ~0) + if (RtlFindSetBits(&RegistryHive->Hive.DirtyVector, 1, 0) == ~0) { return(STATUS_SUCCESS); } @@ -821,7 +823,7 @@ return Status; } - Success = HvSyncHive(RegistryHive->Hive); + Success = HvSyncHive(&RegistryHive->Hive); CmCloseHiveFiles(RegistryHive); @@ -869,12 +871,12 @@ { if (KeyCell->SubKeyLists[Storage] != HCELL_NULL) { - HashBlock = HvGetCell (KeyObject->RegistryHive->Hive, KeyCell->SubKeyLists[Storage]); + HashBlock = HvGetCell (&KeyObject->RegistryHive->Hive, KeyCell->SubKeyLists[Storage]); ASSERT(HashBlock->Id == REG_HASH_TABLE_CELL_ID); for (i = 0; i < KeyCell->SubKeyCounts[Storage]; i++) { - CurSubKeyCell = HvGetCell (KeyObject->RegistryHive->Hive, + CurSubKeyCell = HvGetCell (&KeyObject->RegistryHive->Hive, HashBlock->Table[i].KeyOffset); NameSize = CurSubKeyCell->NameSize; if (CurSubKeyCell->Flags & REG_KEY_NAME_PACKED) @@ -911,13 +913,13 @@ { if (KeyCell->SubKeyLists[Storage] != HCELL_NULL) { - HashBlock = HvGetCell (KeyObject->RegistryHive->Hive, + HashBlock = HvGetCell (&KeyObject->RegistryHive->Hive, KeyCell->SubKeyLists[Storage]); ASSERT(HashBlock->Id == REG_HASH_TABLE_CELL_ID); for (i = 0; i < KeyCell->SubKeyCounts[Storage]; i++) { - CurSubKeyCell = HvGetCell (KeyObject->RegistryHive->Hive, + CurSubKeyCell = HvGetCell (&KeyObject->RegistryHive->Hive, HashBlock->Table[i].KeyOffset); if (MaxClass < CurSubKeyCell->ClassSize) @@ -950,12 +952,12 @@ } MaxValueName = 0; - ValueListCell = HvGetCell (RegistryHive->Hive, + ValueListCell = HvGetCell (&RegistryHive->Hive, KeyCell->ValueList.List); for (i = 0; i < KeyCell->ValueList.Count; i++) { - CurValueCell = HvGetCell (RegistryHive->Hive, + CurValueCell = HvGetCell (&RegistryHive->Hive, ValueListCell->ValueOffset[i]); if (CurValueCell == NULL) { @@ -997,11 +999,11 @@ } MaxValueData = 0; - ValueListCell = HvGetCell (RegistryHive->Hive, KeyCell->ValueList.List); + ValueListCell = HvGetCell (&RegistryHive->Hive, KeyCell->ValueList.List); for (i = 0; i < KeyCell->ValueList.Count; i++) { - CurValueCell = HvGetCell (RegistryHive->Hive, + CurValueCell = HvGetCell (&RegistryHive->Hive, ValueListCell->ValueOffset[i]); if ((MaxValueData < (LONG)(CurValueCell->DataSize & REG_DATA_SIZE_MASK))) { @@ -1044,7 +1046,7 @@ } /* Get hash table */ - HashBlock = HvGetCell (RegistryHive->Hive, KeyCell->SubKeyLists[Storage]); + HashBlock = HvGetCell (&RegistryHive->Hive, KeyCell->SubKeyLists[Storage]); ASSERT(HashBlock->Id == REG_HASH_TABLE_CELL_ID); for (i = 0; i < KeyCell->SubKeyCounts[Storage]; i++) @@ -1054,7 +1056,7 @@ if ((HashBlock->Table[i].HashValue == 0 || CmiCompareHashI(KeyName, (PCHAR)&HashBlock->Table[i].HashValue))) { - CurSubKeyCell = HvGetCell (RegistryHive->Hive, + CurSubKeyCell = HvGetCell (&RegistryHive->Hive, HashBlock->Table[i].KeyOffset); if (CmiCompareKeyNamesI(KeyName, CurSubKeyCell)) @@ -1070,7 +1072,7 @@ if ((HashBlock->Table[i].HashValue == 0 || CmiCompareHash(KeyName, (PCHAR)&HashBlock->Table[i].HashValue))) { - CurSubKeyCell = HvGetCell (RegistryHive->Hive, + CurSubKeyCell = HvGetCell (&RegistryHive->Hive, HashBlock->Table[i].KeyOffset); if (CmiCompareKeyNames(KeyName, CurSubKeyCell)) @@ -1149,14 +1151,14 @@ Storage = (CreateOptions & REG_OPTION_VOLATILE) ? HvVolatile : HvStable; NewBlockSize = sizeof(CM_KEY_NODE) + NameSize; - NKBOffset = HvAllocateCell (RegistryHive->Hive, NewBlockSize, Storage); + NKBOffset = HvAllocateCell (&RegistryHive->Hive, NewBlockSize, Storage); if (NKBOffset == HCELL_NULL) { Status = STATUS_INSUFFICIENT_RESOURCES; } else { - NewKeyCell = HvGetCell (RegistryHive->Hive, NKBOffset); + NewKeyCell = HvGetCell (&RegistryHive->Hive, NKBOffset); NewKeyCell->Id = REG_KEY_CELL_ID; if (CreateOptions & REG_OPTION_VOLATILE) { @@ -1200,10 +1202,10 @@ { NewKeyCell->ClassSize = Class->Length; NewKeyCell->ClassNameOffset = HvAllocateCell( - RegistryHive->Hive, NewKeyCell->ClassSize, HvStable); + &RegistryHive->Hive, NewKeyCell->ClassSize, HvStable); ASSERT(NewKeyCell->ClassNameOffset != HCELL_NULL); /* FIXME */ - ClassCell = HvGetCell(RegistryHive->Hive, NewKeyCell->ClassNameOffset); + ClassCell = HvGetCell(&RegistryHive->Hive, NewKeyCell->ClassNameOffset); RtlCopyMemory (ClassCell, Class->Buffer, Class->Length); @@ -1232,7 +1234,7 @@ } else { - HashBlock = HvGetCell (RegistryHive->Hive, + HashBlock = HvGetCell (&RegistryHive->Hive, ParentKeyCell->SubKeyLists[Storage]); ASSERT(HashBlock->Id == REG_HASH_TABLE_CELL_ID); @@ -1258,7 +1260,7 @@ RtlCopyMemory(&NewHashBlock->Table[0], &HashBlock->Table[0], sizeof(NewHashBlock->Table[0]) * HashBlock->HashTableSize); - HvFreeCell (RegistryHive->Hive, ParentKeyCell->SubKeyLists[Storage]); + HvFreeCell (&RegistryHive->Hive, ParentKeyCell->SubKeyLists[Storage]); ParentKeyCell->SubKeyLists[Storage] = HTOffset; HashBlock = NewHashBlock; } @@ -1276,7 +1278,7 @@ } KeQuerySystemTime (&ParentKeyCell->LastWriteTime); - HvMarkCellDirty (RegistryHive->Hive, ParentKey->KeyCellOffset); + HvMarkCellDirty (&RegistryHive->Hive, ParentKey->KeyCellOffset); return(Status); } @@ -1301,13 +1303,13 @@ if (SubKey->KeyCell->ValueList.Count != 0) { /* Get pointer to the value list cell */ - ValueList = HvGetCell (RegistryHive->Hive, SubKey->KeyCell->ValueList.List); + ValueList = HvGetCell (&RegistryHive->Hive, SubKey->KeyCell->ValueList.List); /* Enumerate all values */ for (i = 0; i < SubKey->KeyCell->ValueList.Count; i++) { /* Get pointer to value cell */ - ValueCell = HvGetCell(RegistryHive->Hive, + ValueCell = HvGetCell(&RegistryHive->Hive, ValueList->ValueOffset[i]); if (!(ValueCell->DataSize & REG_DATA_IN_OFFSET) @@ -1315,34 +1317,34 @@ && ValueCell->DataOffset != HCELL_NULL) { /* Destroy data cell */ - HvFreeCell (RegistryHive->Hive, ValueCell->DataOffset); + HvFreeCell (&RegistryHive->Hive, ValueCell->DataOffset); } /* Destroy value cell */ - HvFreeCell (RegistryHive->Hive, ValueList->ValueOffset[i]); + HvFreeCell (&RegistryHive->Hive, ValueList->ValueOffset[i]); } /* Destroy value list cell */ - HvFreeCell (RegistryHive->Hive, SubKey->KeyCell->ValueList.List); + HvFreeCell (&RegistryHive->Hive, SubKey->KeyCell->ValueList.List); SubKey->KeyCell->ValueList.Count = 0; SubKey->KeyCell->ValueList.List = (HCELL_INDEX)-1; - HvMarkCellDirty(RegistryHive->Hive, SubKey->KeyCellOffset); + HvMarkCellDirty(&RegistryHive->Hive, SubKey->KeyCellOffset); } /* Remove the key from the parent key's hash block */ if (ParentKey->KeyCell->SubKeyLists[Storage] != HCELL_NULL) { DPRINT("ParentKey SubKeyLists %lx\n", ParentKey->KeyCell->SubKeyLists[Storage]); - HashBlock = HvGetCell (ParentKey->RegistryHive->Hive, + HashBlock = HvGetCell (&ParentKey->RegistryHive->Hive, ParentKey->KeyCell->SubKeyLists[Storage]); ASSERT(HashBlock->Id == REG_HASH_TABLE_CELL_ID); DPRINT("ParentKey HashBlock %p\n", HashBlock); CmiRemoveKeyFromHashTable(ParentKey->RegistryHive, HashBlock, SubKey->KeyCellOffset); - HvMarkCellDirty(ParentKey->RegistryHive->Hive, + HvMarkCellDirty(&ParentKey->RegistryHive->Hive, ParentKey->KeyCell->SubKeyLists[Storage]); } @@ -1350,7 +1352,7 @@ if (SubKey->KeyCell->SubKeyLists[Storage] != HCELL_NULL) { DPRINT("SubKey SubKeyLists %lx\n", SubKey->KeyCell->SubKeyLists[Storage]); - HvFreeCell (RegistryHive->Hive, SubKey->KeyCell->SubKeyLists[Storage]); + HvFreeCell (&RegistryHive->Hive, SubKey->KeyCell->SubKeyLists[Storage]); SubKey->KeyCell->SubKeyLists[Storage] = HCELL_NULL; } @@ -1365,18 +1367,18 @@ ParentKey->KeyCell->SubKeyLists[Storage] != HCELL_NULL) { DPRINT("ParentKey SubKeyLists %lx\n", ParentKey->KeyCell->SubKeyLists); - HvFreeCell (ParentKey->RegistryHive->Hive, + HvFreeCell (&ParentKey->RegistryHive->Hive, ParentKey->KeyCell->SubKeyLists[Storage]); ParentKey->KeyCell->SubKeyLists[Storage] = HCELL_NULL; } KeQuerySystemTime(&ParentKey->KeyCell->LastWriteTime); - HvMarkCellDirty(ParentKey->RegistryHive->Hive, + HvMarkCellDirty(&ParentKey->RegistryHive->Hive, ParentKey->KeyCellOffset); } /* Destroy key cell */ - HvFreeCell (RegistryHive->Hive, SubKey->KeyCellOffset); + HvFreeCell (&RegistryHive->Hive, SubKey->KeyCellOffset); SubKey->KeyCell = NULL; SubKey->KeyCellOffset = (HCELL_INDEX)-1; @@ -1407,13 +1409,13 @@ return STATUS_OBJECT_NAME_NOT_FOUND; } - ValueListCell = HvGetCell (RegistryHive->Hive, KeyCell->ValueList.List); + ValueListCell = HvGetCell (&RegistryHive->Hive, KeyCell->ValueList.List); VERIFY_VALUE_LIST_CELL(ValueListCell); for (i = 0; i < KeyCell->ValueList.Count; i++) { - CurValueCell = HvGetCell (RegistryHive->Hive, + CurValueCell = HvGetCell (&RegistryHive->Hive, ValueListCell->ValueOffset[i]); if (CmiComparePackedNames(ValueName, @@ -1455,11 +1457,11 @@ } - ValueListCell = HvGetCell (RegistryHive->Hive, KeyCell->ValueList.List); + ValueListCell = HvGetCell (&RegistryHive->Hive, KeyCell->ValueList.List); VERIFY_VALUE_LIST_CELL(ValueListCell); - CurValueCell = HvGetCell (RegistryHive->Hive, ValueListCell->ValueOffset[Index]); + CurValueCell = HvGetCell (&RegistryHive->Hive, ValueListCell->ValueOffset[Index]); *ValueCell = CurValueCell; @@ -1490,34 +1492,34 @@ { CellSize = sizeof(VALUE_LIST_CELL) + (3 * sizeof(HCELL_INDEX)); - ValueListCellOffset = HvAllocateCell (RegistryHive->Hive, CellSize, Storage); + ValueListCellOffset = HvAllocateCell (&RegistryHive->Hive, CellSize, Storage); if (ValueListCellOffset == HCELL_NULL) { return STATUS_INSUFFICIENT_RESOURCES; } - ValueListCell = HvGetCell (RegistryHive->Hive, ValueListCellOffset); + ValueListCell = HvGetCell (&RegistryHive->Hive, ValueListCellOffset); KeyCell->ValueList.List = ValueListCellOffset; - HvMarkCellDirty(RegistryHive->Hive, KeyCellOffset); + HvMarkCellDirty(&RegistryHive->Hive, KeyCellOffset); } else { - ValueListCell = (PVALUE_LIST_CELL) HvGetCell (RegistryHive->Hive, KeyCell->ValueList.List); - CellSize = ABS_VALUE(HvGetCellSize(RegistryHive->Hive, ValueListCell)); + ValueListCell = (PVALUE_LIST_CELL) HvGetCell (&RegistryHive->Hive, KeyCell->ValueList.List); + CellSize = ABS_VALUE(HvGetCellSize(&RegistryHive->Hive, ValueListCell)); if (KeyCell->ValueList.Count >= (CellSize / sizeof(HCELL_INDEX))) { CellSize *= 2; - ValueListCellOffset = HvReallocateCell (RegistryHive->Hive, KeyCell->ValueList.List, CellSize); + ValueListCellOffset = HvReallocateCell (&RegistryHive->Hive, KeyCell->ValueList.List, CellSize); if (ValueListCellOffset == HCELL_NULL) { return STATUS_INSUFFICIENT_RESOURCES; } - ValueListCell = HvGetCell (RegistryHive->Hive, ValueListCellOffset); + ValueListCell = HvGetCell (&RegistryHive->Hive, ValueListCellOffset); KeyCell->ValueList.List = ValueListCellOffset; - HvMarkCellDirty (RegistryHive->Hive, KeyCellOffset); + HvMarkCellDirty (&RegistryHive->Hive, KeyCellOffset); } } @@ -1542,9 +1544,9 @@ ValueListCell->ValueOffset[KeyCell->ValueList.Count] = NewValueCellOffset; KeyCell->ValueList.Count++; - HvMarkCellDirty(RegistryHive->Hive, KeyCellOffset); - HvMarkCellDirty(RegistryHive->Hive, KeyCell->ValueList.List); - HvMarkCellDirty(RegistryHive->Hive, NewValueCellOffset); + HvMarkCellDirty(&RegistryHive->Hive, KeyCellOffset); + HvMarkCellDirty(&RegistryHive->Hive, KeyCell->ValueList.List); + HvMarkCellDirty(&RegistryHive->Hive, NewValueCellOffset); *pValueCell = NewValueCell; *pValueCellOffset = NewValueCellOffset; @@ -1569,13 +1571,13 @@ return STATUS_OBJECT_NAME_NOT_FOUND; } - ValueListCell = HvGetCell (RegistryHive->Hive, KeyCell->ValueList.List); + ValueListCell = HvGetCell (&RegistryHive->Hive, KeyCell->ValueList.List); VERIFY_VALUE_LIST_CELL(ValueListCell); for (i = 0; i < KeyCell->ValueList.Count; i++) { - CurValueCell = HvGetCell (RegistryHive->Hive, ValueListCell->ValueOffset[i]); + CurValueCell = HvGetCell (&RegistryHive->Hive, ValueListCell->ValueOffset[i]); if (CmiComparePackedNames(ValueName, CurValueCell->Name, @@ -1604,16 +1606,16 @@ if (KeyCell->ValueList.Count == 0) { - HvFreeCell(RegistryHive->Hive, KeyCell->ValueList.List); + HvFreeCell(&RegistryHive->Hive, KeyCell->ValueList.List); KeyCell->ValueList.List = -1; } else { - HvMarkCellDirty(RegistryHive->Hive, + HvMarkCellDirty(&RegistryHive->Hive, KeyCell->ValueList.List); } - HvMarkCellDirty(RegistryHive->Hive, + HvMarkCellDirty(&RegistryHive->Hive, KeyCellOffset); return STATUS_SUCCESS; @@ -1641,7 +1643,7 @@ *HashBlock = NULL; NewHashSize = sizeof(HASH_TABLE_CELL) + (SubKeyCount * sizeof(HASH_RECORD)); - *HBOffset = HvAllocateCell (RegistryHive->Hive, NewHashSize, Storage); + *HBOffset = HvAllocateCell (&RegistryHive->Hive, NewHashSize, Storage); if (*HBOffset == HCELL_NULL) { @@ -1650,7 +1652,7 @@ else { ASSERT(SubKeyCount <= 0xffff); /* should really be USHORT_MAX or similar */ - NewHashBlock = HvGetCell (RegistryHive->Hive, *HBOffset); + NewHashBlock = HvGetCell (&RegistryHive->Hive, *HBOffset); NewHashBlock->Id = REG_HASH_TABLE_CELL_ID; NewHashBlock->HashTableSize = (USHORT)SubKeyCount; *HashBlock = NewHashBlock; @@ -1669,7 +1671,7 @@ PCM_KEY_NODE KeyCell; KeyOffset = HashBlock->Table[Index].KeyOffset; - KeyCell = HvGetCell (RegistryHive->Hive, KeyOffset); + KeyCell = HvGetCell (&RegistryHive->Hive, KeyOffset); return KeyCell; } @@ -1693,7 +1695,7 @@ NewKeyCell->Name, min(NewKeyCell->NameSize, sizeof(ULONG))); } - HvMarkCellDirty(RegistryHive->Hive, KeyCell->SubKeyLists[StorageType]); + HvMarkCellDirty(&RegistryHive->Hive, KeyCell->SubKeyLists[StorageType]); return STATUS_SUCCESS; } @@ -1741,7 +1743,7 @@ DPRINT("ValueName->Length %lu NameSize %lu\n", ValueName->Length, NameSize); - *VBOffset = HvAllocateCell (RegistryHive->Hive, sizeof(CM_KEY_VALUE) + NameSize, Storage); + *VBOffset = HvAllocateCell (&RegistryHive->Hive, sizeof(CM_KEY_VALUE) + NameSize, Storage); if (*VBOffset == HCELL_NULL) { Status = STATUS_INSUFFICIENT_RESOURCES; @@ -1749,7 +1751,7 @@ else { ASSERT(NameSize <= 0xffff); /* should really be USHORT_MAX or similar */ - NewValueCell = HvGetCell (RegistryHive->Hive, *VBOffset); + NewValueCell = HvGetCell (&RegistryHive->Hive, *VBOffset); NewValueCell->Id = REG_VALUE_CELL_ID; NewValueCell->NameSize = (USHORT)NameSize; if (Packable) @@ -1792,11 +1794,11 @@ && ValueCell->DataSize > sizeof(HCELL_INDEX) && ValueCell->DataOffset != HCELL_NULL) { - HvFreeCell (RegistryHive->Hive, ValueCell->DataOffset); + HvFreeCell (&RegistryHive->Hive, ValueCell->DataOffset); } /* Destroy the value cell */ - HvFreeCell (RegistryHive->Hive, ValueCellOffset); + HvFreeCell (&RegistryHive->Hive, ValueCellOffset); return STATUS_SUCCESS; } @@ -2002,19 +2004,19 @@ { /* Allocate and copy key cell */ NewKeyCellSize = sizeof(CM_KEY_NODE) + SrcKeyCell->NameSize; - NewKeyCellOffset = HvAllocateCell (DstHive->Hive, NewKeyCellSize, HvStable); + NewKeyCellOffset = HvAllocateCell (&DstHive->Hive, NewKeyCellSize, HvStable); if (NewKeyCellOffset == HCELL_NULL) { DPRINT1 ("Failed to allocate a key cell\n"); return STATUS_INSUFFICIENT_RESOURCES; } - NewKeyCell = HvGetCell (DstHive->Hive, NewKeyCellOffset); + NewKeyCell = HvGetCell (&DstHive->Hive, NewKeyCellOffset); RtlCopyMemory (NewKeyCell, SrcKeyCell, NewKeyCellSize); - DstHive->Hive->HiveHeader->RootCell = NewKeyCellOffset; + DstHive->Hive.HiveHeader->RootCell = NewKeyCellOffset; /* Copy class name */ if (SrcKeyCell->ClassNameOffset != (HCELL_INDEX) -1) @@ -2023,17 +2025,17 @@ PVOID NewClassNameCell; HCELL_INDEX NewClassNameOffset; - SrcClassNameCell = HvGetCell (SrcHive->Hive, SrcKeyCell->ClassNameOffset); + SrcClassNameCell = HvGetCell (&SrcHive->Hive, SrcKeyCell->ClassNameOffset); NewKeyCell->ClassSize = SrcKeyCell->ClassSize; - NewClassNameOffset = HvAllocateCell (DstHive->Hive, NewKeyCell->ClassSize, HvStable); + NewClassNameOffset = HvAllocateCell (&DstHive->Hive, NewKeyCell->ClassSize, HvStable); if (NewClassNameOffset == HCELL_NULL) { DPRINT1 ("CmiAllocateBlock() failed\n"); return STATUS_INSUFFICIENT_RESOURCES; } - NewClassNameCell = HvGetCell (DstHive->Hive, NewClassNameOffset); + NewClassNameCell = HvGetCell (&DstHive->Hive, NewClassNameOffset); RtlCopyMemory (NewClassNameCell, SrcClassNameCell, NewKeyCell->ClassSize); @@ -2083,7 +2085,7 @@ NewValueListCellSize = ROUND_UP(SrcKeyCell->ValueList.Count, 4) * sizeof(HCELL_INDEX); - NewKeyCell->ValueList.List = HvAllocateCell (DstHive->Hive, + NewKeyCell->ValueList.List = HvAllocateCell (&DstHive->Hive, NewValueListCellSize, HvStable); if (NewKeyCell->ValueList.List == HCELL_NULL) @@ -2093,26 +2095,26 @@ } DPRINT1("KeyCell->ValueList.List: %x\n", NewKeyCell->ValueList.List); - NewValueListCell = HvGetCell (DstHive->Hive, NewKeyCell->ValueList.List); + NewValueListCell = HvGetCell (&DstHive->Hive, NewKeyCell->ValueList.List); RtlZeroMemory (NewValueListCell, NewValueListCellSize); /* Copy values */ - SrcValueListCell = HvGetCell (SrcHive->Hive, SrcKeyCell->ValueList.List); + SrcValueListCell = HvGetCell (&SrcHive->Hive, SrcKeyCell->ValueList.List); for (i = 0; i < SrcKeyCell->ValueList.Count; i++) { /* Copy value cell */ - SrcValueCell = HvGetCell (SrcHive->Hive, SrcValueListCell->ValueOffset[i]); + SrcValueCell = HvGetCell (&SrcHive->Hive, SrcValueListCell->ValueOffset[i]); NewValueCellSize = sizeof(CM_KEY_VALUE) + SrcValueCell->NameSize; - ValueCellOffset = HvAllocateCell (DstHive->Hive, NewValueCellSize, HvStable); + ValueCellOffset = HvAllocateCell (&DstHive->Hive, NewValueCellSize, HvStable); if (ValueCellOffset == HCELL_NULL) { DPRINT1 ("HvAllocateCell() failed (Status %lx)\n", Status); return STATUS_INSUFFICIENT_RESOURCES; } - NewValueCell = HvGetCell (DstHive->Hive, ValueCellOffset); + NewValueCell = HvGetCell (&DstHive->Hive, ValueCellOffset); NewValueListCell->ValueOffset[i] = ValueCellOffset; RtlCopyMemory (NewValueCell, SrcValueCell, @@ -2121,15 +2123,15 @@ /* Copy value data cell */ if (SrcValueCell->DataSize > (LONG) sizeof(PVOID)) { - SrcValueDataCell = HvGetCell (SrcHive->Hive, SrcValueCell->DataOffset); - - ValueDataCellOffset = HvAllocateCell (DstHive->Hive, SrcValueCell->DataSize, HvStable); + SrcValueDataCell = HvGetCell (&SrcHive->Hive, SrcValueCell->DataOffset); + + ValueDataCellOffset = HvAllocateCell (&DstHive->Hive, SrcValueCell->DataSize, HvStable); if (ValueDataCellOffset == HCELL_NULL) { DPRINT1 ("HvAllocateCell() failed\n"); return STATUS_INSUFFICIENT_RESOURCES; } - NewValueDataCell = HvGetCell (DstHive->Hive, ValueDataCellOffset); + NewValueDataCell = HvGetCell (&DstHive->Hive, ValueDataCellOffset); RtlCopyMemory (NewValueDataCell, SrcValueDataCell, SrcValueCell->DataSize); @@ -2148,23 +2150,23 @@ HCELL_INDEX NewSubKeyCellOffset; PHASH_RECORD SrcHashRecord; - SrcHashTableCell = HvGetCell (SrcHive->Hive, SrcKeyCell->SubKeyLists[HvStable]); + SrcHashTableCell = HvGetCell (&SrcHive->Hive, SrcKeyCell->SubKeyLists[HvStable]); for (i = 0; i < SrcKeyCell->SubKeyCounts[HvStable]; i++) { SrcHashRecord = &SrcHashTableCell->Table[i]; - SrcSubKeyCell = HvGetCell (SrcHive->Hive, SrcHashRecord->KeyOffset); + SrcSubKeyCell = HvGetCell (&SrcHive->Hive, SrcHashRecord->KeyOffset); /* Allocate and copy key cell */ NewSubKeyCellSize = sizeof(CM_KEY_NODE) + SrcSubKeyCell->NameSize; - NewSubKeyCellOffset = HvAllocateCell (DstHive->Hive, NewSubKeyCellSize, HvStable); + NewSubKeyCellOffset = HvAllocateCell (&DstHive->Hive, NewSubKeyCellSize, HvStable); if (NewSubKeyCellOffset == HCELL_NULL) { DPRINT1 ("Failed to allocate a sub key cell\n"); return STATUS_INSUFFICIENT_RESOURCES; } - NewSubKeyCell = HvGetCell (DstHive->Hive, NewSubKeyCellOffset); + NewSubKeyCell = HvGetCell (&DstHive->Hive, NewSubKeyCellOffset); NewHashTableCell->Table[i].KeyOffset = NewSubKeyCellOffset; NewHashTableCell->Table[i].HashValue = SrcHashRecord->HashValue; @@ -2179,11 +2181,11 @@ PVOID NewClassNameCell; HCELL_INDEX NewClassNameOffset; - SrcClassNameCell = HvGetCell (SrcHive->Hive, + SrcClassNameCell = HvGetCell (&SrcHive->Hive, SrcSubKeyCell->ClassNameOffset); NewSubKeyCell->ClassSize = SrcSubKeyCell->ClassSize; - NewClassNameOffset = HvAllocateCell (DstHive->Hive, + NewClassNameOffset = HvAllocateCell (&DstHive->Hive, NewSubKeyCell->ClassSize, HvStable); if (NewClassNameOffset == HCELL_NULL) @@ -2192,7 +2194,7 @@ return STATUS_INSUFFICIENT_RESOURCES; } - NewClassNameCell = HvGetCell (DstHive->Hive, NewClassNameOffset); + NewClassNameCell = HvGetCell (&DstHive->Hive, NewClassNameOffset); NewSubKeyCell->ClassNameOffset = NewClassNameOffset; RtlCopyMemory (NewClassNameCell, SrcClassNameCell, @@ -2221,7 +2223,7 @@ HANDLE FileHandle) { Hive->HiveHandle = FileHandle; - return HvWriteHive(Hive->Hive) ? STATUS_SUCCESS : STATUS_UNSUCCESSFUL; + return HvWriteHive(&Hive->Hive) ? STATUS_SUCCESS : STATUS_UNSUCCESSFUL; } /* EOF */ Modified: trunk/reactos/ntoskrnl/cm/registry.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/cm/registry.c?rev…
============================================================================== --- trunk/reactos/ntoskrnl/cm/registry.c (original) +++ trunk/reactos/ntoskrnl/cm/registry.c Mon Aug 14 18:16:00 2006 @@ -251,8 +251,8 @@ &RootKeyHandle); ASSERT(NT_SUCCESS(Status)); RootKey->RegistryHive = CmiVolatileHive; - RootKey->KeyCellOffset = CmiVolatileHive->Hive->HiveHeader->RootCell; - RootKey->KeyCell = HvGetCell (CmiVolatileHive->Hive, RootKey->KeyCellOffset); + RootKey->KeyCellOffset = CmiVolatileHive->Hive.HiveHeader->RootCell; + RootKey->KeyCell = HvGetCell (&CmiVolatileHive->Hive, RootKey->KeyCellOffset); RootKey->ParentKey = RootKey; RootKey->Flags = 0; RootKey->SubKeyCounts = 0; @@ -630,8 +630,8 @@ return STATUS_INSUFFICIENT_RESOURCES; } - NewKey->KeyCellOffset = RegistryHive->Hive->HiveHeader->RootCell; - NewKey->KeyCell = HvGetCell (RegistryHive->Hive, NewKey->KeyCellOffset); + NewKey->KeyCellOffset = RegistryHive->Hive.HiveHeader->RootCell; + NewKey->KeyCell = HvGetCell (&RegistryHive->Hive, NewKey->KeyCellOffset); NewKey->RegistryHive = RegistryHive; Status = RtlpCreateUnicodeString(&NewKey->Name, Modified: trunk/reactos/ntoskrnl/cm/regobj.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/cm/regobj.c?rev=2…
============================================================================== --- trunk/reactos/ntoskrnl/cm/regobj.c (original) +++ trunk/reactos/ntoskrnl/cm/regobj.c Mon Aug 14 18:16:00 2006 @@ -511,7 +511,7 @@ KeyObject); KeQuerySystemTime (&ParentKeyObject->KeyCell->LastWriteTime); - HvMarkCellDirty (ParentKeyObject->RegistryHive->Hive, + HvMarkCellDirty (&ParentKeyObject->RegistryHive->Hive, ParentKeyObject->KeyCellOffset); if (!IsNoFileHive (KeyObject->RegistryHive) || @@ -925,7 +925,7 @@ if (ValueCell->DataSize > 0) { - DataCell = HvGetCell (RegistryHive->Hive, ValueCell->DataOffset); + DataCell = HvGetCell (&RegistryHive->Hive, ValueCell->DataOffset); RtlCopyMemory(TargetPath->Buffer, DataCell, TargetPath->Length);
18 years, 10 months
1
0
0
0
← Newer
1
...
24
25
26
27
28
29
30
...
45
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
Results per page:
10
25
50
100
200