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
August 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
19 participants
447 discussions
Start a n
N
ew thread
[ion] 23577: - Parameter changes to HvInitialize
by ion@svn.reactos.org
Author: ion Date: Mon Aug 14 16:50:09 2006 New Revision: 23577 URL:
http://svn.reactos.org/svn/reactos?rev=23577&view=rev
Log: - Parameter changes to HvInitialize 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 Mon Aug 14 16:50:09 2006 @@ -715,7 +715,7 @@ Status = HvInitialize (&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")); @@ -810,7 +810,7 @@ Status = HvInitialize (&Hive, HV_OPERATION_CREATE_HIVE, 0, 0, CmpAllocate, CmpFree, - NULL, NULL, NULL, NULL, NULL); + NULL, NULL, NULL, NULL, NULL, NULL); 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 16:50:09 2006 @@ -130,15 +130,16 @@ HvInitialize( PHHIVE *RegistryHive, ULONG Operation, - ULONG_PTR ChunkBase, - SIZE_T ChunkSize, + ULONG_PTR HiveData OPTIONAL, + SIZE_T Cluster, // HACK!! PALLOCATE_ROUTINE Allocate, PFREE_ROUTINE Free, PFILE_READ_ROUTINE FileRead, PFILE_WRITE_ROUTINE FileWrite, PFILE_SET_SIZE_ROUTINE FileSetSize, PFILE_FLUSH_ROUTINE FileFlush, - PVOID Opaque); + PVOID Opaque, // HACK!! + IN PUNICODE_STRING FileName); VOID CMAPI HvFree( 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 16:50:09 2006 @@ -309,7 +309,8 @@ PFILE_WRITE_ROUTINE FileWrite, PFILE_SET_SIZE_ROUTINE FileSetSize, PFILE_FLUSH_ROUTINE FileFlush, - PVOID Opaque) + PVOID Opaque, + IN PUNICODE_STRING FileName) { NTSTATUS Status; PHHIVE Hive; 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 16:50:09 2006 @@ -55,7 +55,7 @@ (ULONG_PTR)ChunkBase, ChunkSize, CmpAllocate, CmpFree, CmpFileRead, CmpFileWrite, CmpFileSetSize, - CmpFileFlush, Hive); + CmpFileFlush, Hive, NULL); if (!NT_SUCCESS(Status)) { DPRINT1 ("Opening hive failed (%x)\n", Status); 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 16:50:09 2006 @@ -143,7 +143,7 @@ Status = HvInitialize(&Hive, HV_OPERATION_CREATE_HIVE, 0, 0, CmpAllocate, CmpFree, CmpFileRead, CmpFileWrite, CmpFileSetSize, - CmpFileFlush, &CmHive); + CmpFileFlush, &CmHive, NULL); if (!NT_SUCCESS(Status)) { return FALSE; @@ -571,7 +571,7 @@ (ULONG_PTR)ViewBase, ViewSize, CmpAllocate, CmpFree, CmpFileRead, CmpFileWrite, CmpFileSetSize, - CmpFileFlush, RegistryHive); + CmpFileFlush, RegistryHive, NULL); if (!NT_SUCCESS(Status)) { DPRINT1("Failed to open hive\n"); @@ -622,7 +622,7 @@ Status = HvInitialize(&Hive->Hive, HV_OPERATION_CREATE_HIVE, 0, 0, CmpAllocate, CmpFree, CmpFileRead, CmpFileWrite, CmpFileSetSize, - CmpFileFlush, Hive); + CmpFileFlush, Hive, NULL); if (!NT_SUCCESS(Status)) { ExFreePool (Hive);
18 years, 4 months
1
0
0
0
[ion] 23576: - CELL_HEADER -> HCELL.
by ion@svn.reactos.org
Author: ion Date: Mon Aug 14 16:22:00 2006 New Revision: 23576 URL:
http://svn.reactos.org/svn/reactos?rev=23576&view=rev
Log: - CELL_HEADER -> HCELL. Modified: trunk/reactos/lib/cmlib/hivebin.c trunk/reactos/lib/cmlib/hivecell.c trunk/reactos/lib/cmlib/hivedata.h trunk/reactos/ntoskrnl/cm/regfile.c Modified: trunk/reactos/lib/cmlib/hivebin.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/cmlib/hivebin.c?rev=23…
============================================================================== --- trunk/reactos/lib/cmlib/hivebin.c (original) +++ trunk/reactos/lib/cmlib/hivebin.c Mon Aug 14 16:22:00 2006 @@ -21,7 +21,7 @@ ULONG BitmapSize; ULONG BlockCount; ULONG OldBlockListSize; - PCELL_HEADER Block; + PHCELL Block; BinSize = ROUND_UP(Size + sizeof(HBIN), HV_BLOCK_SIZE); BlockCount = BinSize / HV_BLOCK_SIZE; @@ -64,8 +64,8 @@ } /* Initialize a free block in this heap. */ - Block = (PCELL_HEADER)(Bin + 1); - Block->CellSize = BinSize - sizeof(HBIN); + Block = (PHCELL)(Bin + 1); + Block->Size = BinSize - sizeof(HBIN); if (Storage == HvStable) { Modified: trunk/reactos/lib/cmlib/hivecell.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/cmlib/hivecell.c?rev=2…
============================================================================== --- trunk/reactos/lib/cmlib/hivecell.c (original) +++ trunk/reactos/lib/cmlib/hivecell.c Mon Aug 14 16:22:00 2006 @@ -9,7 +9,7 @@ #define NDEBUG #include <debug.h> -static PCELL_HEADER __inline CMAPI +static PHCELL __inline CMAPI HvpGetCellHeader( PHHIVE RegistryHive, HCELL_INDEX CellIndex) @@ -52,7 +52,7 @@ PHHIVE RegistryHive, PVOID Cell) { - return ((PCELL_HEADER)Cell - 1)->CellSize; + return ((PHCELL)Cell - 1)->Size; } LONG CMAPI @@ -60,13 +60,13 @@ PHHIVE RegistryHive, PVOID Cell) { - PCELL_HEADER CellHeader; - - CellHeader = (PCELL_HEADER)Cell - 1; - if (CellHeader->CellSize < 0) - return CellHeader->CellSize + sizeof(CELL_HEADER); + PHCELL CellHeader; + + CellHeader = (PHCELL)Cell - 1; + if (CellHeader->Size < 0) + return CellHeader->Size + sizeof(HCELL); else - return CellHeader->CellSize - sizeof(CELL_HEADER); + return CellHeader->Size - sizeof(HCELL); } VOID CMAPI @@ -132,7 +132,7 @@ static NTSTATUS CMAPI HvpAddFree( PHHIVE RegistryHive, - PCELL_HEADER FreeBlock, + PHCELL FreeBlock, HCELL_INDEX FreeIndex) { PHCELL_INDEX FreeBlockData; @@ -143,7 +143,7 @@ ASSERT(FreeBlock != NULL); Storage = (FreeIndex & HCELL_TYPE_MASK) >> HCELL_TYPE_SHIFT; - Index = HvpComputeFreeListIndex(FreeBlock->CellSize); + Index = HvpComputeFreeListIndex(FreeBlock->Size); FreeBlockData = (PHCELL_INDEX)(FreeBlock + 1); *FreeBlockData = RegistryHive->Storage[Storage].FreeDisplay[Index]; @@ -157,7 +157,7 @@ static VOID CMAPI HvpRemoveFree( PHHIVE RegistryHive, - PCELL_HEADER CellBlock, + PHCELL CellBlock, HCELL_INDEX CellIndex) { PHCELL_INDEX FreeCellData; @@ -168,7 +168,7 @@ ASSERT(RegistryHive->ReadOnly == FALSE); Storage = (CellIndex & HCELL_TYPE_MASK) >> HCELL_TYPE_SHIFT; - Index = HvpComputeFreeListIndex(CellBlock->CellSize); + Index = HvpComputeFreeListIndex(CellBlock->Size); pFreeCellOffset = &RegistryHive->Storage[Storage].FreeDisplay[Index]; while (*pFreeCellOffset != HCELL_NULL) @@ -220,7 +220,7 @@ PHHIVE Hive) { HCELL_INDEX BlockOffset; - PCELL_HEADER FreeBlock; + PHCELL FreeBlock; ULONG BlockIndex; ULONG FreeOffset; PHBIN Bin; @@ -244,18 +244,18 @@ FreeOffset = sizeof(HBIN); while (FreeOffset < Bin->Size) { - FreeBlock = (PCELL_HEADER)((ULONG_PTR)Bin + FreeOffset); - if (FreeBlock->CellSize > 0) + FreeBlock = (PHCELL)((ULONG_PTR)Bin + FreeOffset); + if (FreeBlock->Size > 0) { Status = HvpAddFree(Hive, FreeBlock, Bin->FileOffset + FreeOffset); if (!NT_SUCCESS(Status)) return Status; - FreeOffset += FreeBlock->CellSize; + FreeOffset += FreeBlock->Size; } else { - FreeOffset -= FreeBlock->CellSize; + FreeOffset -= FreeBlock->Size; } } @@ -272,15 +272,15 @@ ULONG Size, HV_STORAGE_TYPE Storage) { - PCELL_HEADER FreeCell; + PHCELL FreeCell; HCELL_INDEX FreeCellOffset; - PCELL_HEADER NewCell; + PHCELL NewCell; PHBIN Bin; ASSERT(RegistryHive->ReadOnly == FALSE); /* Round to 16 bytes multiple. */ - Size = ROUND_UP(Size + sizeof(CELL_HEADER), 16); + Size = ROUND_UP(Size + sizeof(HCELL), 16); /* First search in free blocks. */ FreeCellOffset = HvpFindFree(RegistryHive, Size, Storage); @@ -299,11 +299,11 @@ /* Split the block in two parts */ /* FIXME: There is some minimal cell size that we must respect. */ - if (FreeCell->CellSize > Size + sizeof(HCELL_INDEX)) - { - NewCell = (PCELL_HEADER)((ULONG_PTR)FreeCell + Size); - NewCell->CellSize = FreeCell->CellSize - Size; - FreeCell->CellSize = Size; + if (FreeCell->Size > Size + sizeof(HCELL_INDEX)) + { + NewCell = (PHCELL)((ULONG_PTR)FreeCell + Size); + NewCell->Size = FreeCell->Size - Size; + FreeCell->Size = Size; HvpAddFree(RegistryHive, NewCell, FreeCellOffset + Size); if (Storage == HvStable) HvMarkCellDirty(RegistryHive, FreeCellOffset + Size); @@ -311,8 +311,8 @@ if (Storage == HvStable) HvMarkCellDirty(RegistryHive, FreeCellOffset); - FreeCell->CellSize = -FreeCell->CellSize; - RtlZeroMemory(FreeCell + 1, Size - sizeof(CELL_HEADER)); + FreeCell->Size = -FreeCell->Size; + RtlZeroMemory(FreeCell + 1, Size - sizeof(HCELL)); return FreeCellOffset; } @@ -366,8 +366,8 @@ PHHIVE RegistryHive, HCELL_INDEX CellIndex) { - PCELL_HEADER Free; - PCELL_HEADER Neighbor; + PHCELL Free; + PHCELL Neighbor; PHBIN Bin; ULONG CellType; ULONG CellBlock; @@ -376,9 +376,9 @@ Free = HvpGetCellHeader(RegistryHive, CellIndex); - ASSERT(Free->CellSize < 0); + ASSERT(Free->Size < 0); - Free->CellSize = -Free->CellSize; + Free->Size = -Free->Size; CellType = (CellIndex & HCELL_TYPE_MASK) >> HCELL_TYPE_SHIFT; CellBlock = (CellIndex & HCELL_BLOCK_MASK) >> HCELL_BLOCK_SHIFT; @@ -386,38 +386,38 @@ /* FIXME: Merge free blocks */ Bin = (PHBIN)RegistryHive->Storage[CellType].BlockList[CellBlock].Bin; - if ((CellIndex & ~HCELL_TYPE_MASK) + Free->CellSize < + if ((CellIndex & ~HCELL_TYPE_MASK) + Free->Size < Bin->FileOffset + Bin->Size) { - Neighbor = (PCELL_HEADER)((ULONG_PTR)Free + Free->CellSize); - if (Neighbor->CellSize > 0) + Neighbor = (PHCELL)((ULONG_PTR)Free + Free->Size); + if (Neighbor->Size > 0) { HvpRemoveFree(RegistryHive, Neighbor, ((HCELL_INDEX)Neighbor - (HCELL_INDEX)Bin + Bin->FileOffset) | (CellIndex & HCELL_TYPE_MASK)); - Free->CellSize += Neighbor->CellSize; - } - } - - Neighbor = (PCELL_HEADER)(Bin + 1); + Free->Size += Neighbor->Size; + } + } + + Neighbor = (PHCELL)(Bin + 1); while (Neighbor < Free) { - if (Neighbor->CellSize > 0) - { - if ((ULONG_PTR)Neighbor + Neighbor->CellSize == (ULONG_PTR)Free) + if (Neighbor->Size > 0) + { + if ((ULONG_PTR)Neighbor + Neighbor->Size == (ULONG_PTR)Free) { - Neighbor->CellSize += Free->CellSize; + Neighbor->Size += Free->Size; if (CellType == HvStable) HvMarkCellDirty(RegistryHive, (HCELL_INDEX)Neighbor - (HCELL_INDEX)Bin + Bin->FileOffset); return; } - Neighbor = (PCELL_HEADER)((ULONG_PTR)Neighbor + Neighbor->CellSize); + Neighbor = (PHCELL)((ULONG_PTR)Neighbor + Neighbor->Size); } else { - Neighbor = (PCELL_HEADER)((ULONG_PTR)Neighbor - Neighbor->CellSize); + Neighbor = (PHCELL)((ULONG_PTR)Neighbor - Neighbor->Size); } } Modified: trunk/reactos/lib/cmlib/hivedata.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/cmlib/hivedata.h?rev=2…
============================================================================== --- trunk/reactos/lib/cmlib/hivedata.h (original) +++ trunk/reactos/lib/cmlib/hivedata.h Mon Aug 14 16:22:00 2006 @@ -119,16 +119,36 @@ ULONG MemAlloc; } HBIN, *PHBIN; -typedef struct _CELL_HEADER +typedef struct _HCELL { /* <0 if used, >0 if free */ - LONG CellSize; -} CELL_HEADER, *PCELL_HEADER; + LONG Size; + union + { + struct + { + ULONG Last; + union + { + ULONG UserData; + HCELL_INDEX Next; + } u; + } OldCell; + struct + { + union + { + ULONG UserData; + HCELL_INDEX Next; + } u; + } NewCell; + } u; +} HCELL, *PHCELL; #include <poppack.h> -#define IsFreeCell(Cell)(Cell->CellSize >= 0) -#define IsUsedCell(Cell)(Cell->CellSize < 0) +#define IsFreeCell(Cell)(Cell->Size >= 0) +#define IsUsedCell(Cell)(Cell->Size < 0) typedef enum _HV_STORAGE_TYPE { 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 16:22:00 2006 @@ -1522,11 +1522,11 @@ } #if 0 - DPRINT("KeyCell->ValueList.Count %lu, ValueListCell->CellSize %lu (%lu %lx)\n", + DPRINT("KeyCell->ValueList.Count %lu, ValueListCell->Size %lu (%lu %lx)\n", KeyCell->ValueList.Count, - (ULONG)ABS_VALUE(ValueListCell->CellSize), - ((ULONG)ABS_VALUE(ValueListCell->CellSize) - sizeof(CELL_HEADER)) / sizeof(HCELL_INDEX), - ((ULONG)ABS_VALUE(ValueListCell->CellSize) - sizeof(CELL_HEADER)) / sizeof(HCELL_INDEX)); + (ULONG)ABS_VALUE(ValueListCell->Size), + ((ULONG)ABS_VALUE(ValueListCell->Size) - sizeof(HCELL)) / sizeof(HCELL_INDEX), + ((ULONG)ABS_VALUE(ValueListCell->Size) - sizeof(HCELL)) / sizeof(HCELL_INDEX)); #endif Status = CmiAllocateValueCell(RegistryHive,
18 years, 4 months
1
0
0
0
[ion] 23575: - Fix small build brekage. - Fix HBIN definition.
by ion@svn.reactos.org
Author: ion Date: Mon Aug 14 16:15:26 2006 New Revision: 23575 URL:
http://svn.reactos.org/svn/reactos?rev=23575&view=rev
Log: - Fix small build brekage. - Fix HBIN definition. Modified: trunk/reactos/boot/freeldr/freeldr/reactos/binhive.c trunk/reactos/lib/cmlib/cmdata.h trunk/reactos/lib/cmlib/hivebin.c trunk/reactos/lib/cmlib/hivecell.c trunk/reactos/lib/cmlib/hivedata.h trunk/reactos/lib/cmlib/hiveinit.c trunk/reactos/ntoskrnl/cm/cm.h trunk/reactos/ntoskrnl/cm/registry.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 16:15:26 2006 @@ -787,8 +787,8 @@ { Bin = (PHBIN)Hive->Storage[HvStable].BlockList[i].Bin; memcpy (ChunkBase + (i + 1) * HV_BLOCK_SIZE, - Bin, Bin->BinSize); - Size += Bin->BinSize; + Bin, Bin->Size); + Size += Bin->Size; } } Modified: trunk/reactos/lib/cmlib/cmdata.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/cmlib/cmdata.h?rev=235…
============================================================================== --- trunk/reactos/lib/cmlib/cmdata.h (original) +++ trunk/reactos/lib/cmlib/cmdata.h Mon Aug 14 16:15:26 2006 @@ -133,16 +133,17 @@ #define REG_DATA_SIZE_MASK 0x7FFFFFFF #define REG_DATA_IN_OFFSET 0x80000000 -typedef struct _SECURITY_CELL +typedef struct _CM_KEY_SECURITY { - USHORT Id; // "sk" - USHORT Reserved; - HCELL_INDEX PrevSecurityCell; - HCELL_INDEX NextSecurityCell; - ULONG RefCount; - ULONG SdSize; - UCHAR Data[0]; -} SECURITY_CELL, *PSECURITY_CELL; + USHORT Signature; // "sk" + USHORT Reserved; + HCELL_INDEX Flink; + HCELL_INDEX Blink; + ULONG ReferenceCount; + ULONG DescriptorLength; + //SECURITY_DESCRIPTOR_RELATIVE Descriptor; + UCHAR Data[0]; +} CM_KEY_SECURITY, *PCM_KEY_SECURITY; #include <poppack.h> Modified: trunk/reactos/lib/cmlib/hivebin.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/cmlib/hivebin.c?rev=23…
============================================================================== --- trunk/reactos/lib/cmlib/hivebin.c (original) +++ trunk/reactos/lib/cmlib/hivebin.c Mon Aug 14 16:15:26 2006 @@ -32,9 +32,9 @@ RtlZeroMemory(Bin, sizeof(HBIN)); Bin->Signature = HV_BIN_SIGNATURE; - Bin->BinOffset = RegistryHive->Storage[Storage].Length * + Bin->FileOffset = RegistryHive->Storage[Storage].Length * HV_BLOCK_SIZE; - Bin->BinSize = BinSize; + Bin->Size = BinSize; /* Allocate new block list */ OldBlockListSize = RegistryHive->Storage[Storage].Length; @@ -90,7 +90,7 @@ /* Mark new bin dirty. */ RtlSetBits(&RegistryHive->DirtyVector, - Bin->BinOffset / HV_BLOCK_SIZE, + Bin->FileOffset / HV_BLOCK_SIZE, BlockCount); } Modified: trunk/reactos/lib/cmlib/hivecell.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/cmlib/hivecell.c?rev=2…
============================================================================== --- trunk/reactos/lib/cmlib/hivecell.c (original) +++ trunk/reactos/lib/cmlib/hivecell.c Mon Aug 14 16:15:26 2006 @@ -242,12 +242,12 @@ /* Search free blocks and add to list */ FreeOffset = sizeof(HBIN); - while (FreeOffset < Bin->BinSize) + while (FreeOffset < Bin->Size) { FreeBlock = (PCELL_HEADER)((ULONG_PTR)Bin + FreeOffset); if (FreeBlock->CellSize > 0) { - Status = HvpAddFree(Hive, FreeBlock, Bin->BinOffset + FreeOffset); + Status = HvpAddFree(Hive, FreeBlock, Bin->FileOffset + FreeOffset); if (!NT_SUCCESS(Status)) return Status; @@ -259,8 +259,8 @@ } } - BlockIndex += Bin->BinSize / HV_BLOCK_SIZE; - BlockOffset += Bin->BinSize; + BlockIndex += Bin->Size / HV_BLOCK_SIZE; + BlockOffset += Bin->Size; } return STATUS_SUCCESS; @@ -291,7 +291,7 @@ Bin = HvpAddBin(RegistryHive, Size, Storage); if (Bin == NULL) return HCELL_NULL; - FreeCellOffset = Bin->BinOffset + sizeof(HBIN); + FreeCellOffset = Bin->FileOffset + sizeof(HBIN); FreeCellOffset |= Storage << HCELL_TYPE_SHIFT; } @@ -387,14 +387,14 @@ Bin = (PHBIN)RegistryHive->Storage[CellType].BlockList[CellBlock].Bin; if ((CellIndex & ~HCELL_TYPE_MASK) + Free->CellSize < - Bin->BinOffset + Bin->BinSize) + Bin->FileOffset + Bin->Size) { Neighbor = (PCELL_HEADER)((ULONG_PTR)Free + Free->CellSize); if (Neighbor->CellSize > 0) { HvpRemoveFree(RegistryHive, Neighbor, ((HCELL_INDEX)Neighbor - (HCELL_INDEX)Bin + - Bin->BinOffset) | (CellIndex & HCELL_TYPE_MASK)); + Bin->FileOffset) | (CellIndex & HCELL_TYPE_MASK)); Free->CellSize += Neighbor->CellSize; } } @@ -410,7 +410,7 @@ if (CellType == HvStable) HvMarkCellDirty(RegistryHive, (HCELL_INDEX)Neighbor - (HCELL_INDEX)Bin + - Bin->BinOffset); + Bin->FileOffset); return; } Neighbor = (PCELL_HEADER)((ULONG_PTR)Neighbor + Neighbor->CellSize); Modified: trunk/reactos/lib/cmlib/hivedata.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/cmlib/hivedata.h?rev=2…
============================================================================== --- trunk/reactos/lib/cmlib/hivedata.h (original) +++ trunk/reactos/lib/cmlib/hivedata.h Mon Aug 14 16:15:26 2006 @@ -99,21 +99,21 @@ ULONG BootRecover; } HBASE_BLOCK, *PHBASE_BLOCK; -typedef struct _BIN_HEADER +typedef struct _HBIN { /* Bin identifier "hbin" (0x6E696268) */ ULONG Signature; /* Block offset of this bin */ - HCELL_INDEX BinOffset; + HCELL_INDEX FileOffset; /* Size in bytes, multiple of the block size (4KB) */ - ULONG BinSize; + ULONG Size; - ULONG Reserved[2]; + ULONG Reserved1[2]; /* When this bin was last modified */ - LARGE_INTEGER DateModified; + LARGE_INTEGER TimeStamp; /* ? (In-memory only) */ ULONG MemAlloc; 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 16:15:26 2006 @@ -181,14 +181,14 @@ { Bin = (PHBIN)((ULONG_PTR)ChunkBase + (BlockIndex + 1) * HV_BLOCK_SIZE); if (Bin->Signature != HV_BIN_SIGNATURE || - (Bin->BinSize % HV_BLOCK_SIZE) != 0) + (Bin->Size % HV_BLOCK_SIZE) != 0) { Hive->Free(Hive->HiveHeader); Hive->Free(Hive->Storage[HvStable].BlockList); return STATUS_REGISTRY_CORRUPT; } - NewBin = Hive->Allocate(Bin->BinSize, TRUE); + NewBin = Hive->Allocate(Bin->Size, TRUE); if (NewBin == NULL) { Hive->Free(Hive->HiveHeader); @@ -199,11 +199,11 @@ Hive->Storage[HvStable].BlockList[BlockIndex].Bin = (ULONG_PTR)NewBin; Hive->Storage[HvStable].BlockList[BlockIndex].Block = (ULONG_PTR)NewBin; - RtlCopyMemory(NewBin, Bin, Bin->BinSize); - - if (Bin->BinSize > HV_BLOCK_SIZE) - { - for (i = 1; i < Bin->BinSize / HV_BLOCK_SIZE; i++) + RtlCopyMemory(NewBin, Bin, Bin->Size); + + if (Bin->Size > HV_BLOCK_SIZE) + { + for (i = 1; i < Bin->Size / HV_BLOCK_SIZE; i++) { Hive->Storage[HvStable].BlockList[BlockIndex + i].Bin = (ULONG_PTR)NewBin; Hive->Storage[HvStable].BlockList[BlockIndex + i].Block = @@ -211,7 +211,7 @@ } } - BlockIndex += Bin->BinSize / HV_BLOCK_SIZE; + BlockIndex += Bin->Size / HV_BLOCK_SIZE; } if (HvpCreateHiveFreeCellList(Hive)) Modified: trunk/reactos/ntoskrnl/cm/cm.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/cm/cm.h?rev=23575…
============================================================================== --- trunk/reactos/ntoskrnl/cm/cm.h (original) +++ trunk/reactos/ntoskrnl/cm/cm.h Mon Aug 14 16:15:26 2006 @@ -43,7 +43,7 @@ PHHIVE Hive; UNICODE_STRING HiveFileName; UNICODE_STRING LogFileName; - PSECURITY_CELL RootSecurityCell; + PCM_KEY_SECURITY RootSecurityCell; ULONG Flags; HANDLE HiveHandle; HANDLE LogHandle; 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 16:15:26 2006 @@ -164,7 +164,7 @@ UNICODE_STRING KeyName; PKEY_OBJECT RootKey; #if 0 - PSECURITY_CELL RootSecurityCell; + PCM_KEY_SECURITY RootSecurityCell; #endif HANDLE RootKeyHandle; HANDLE KeyHandle;
18 years, 4 months
1
0
0
0
[ion] 23574: - VALUE_CELL => CM_KEY_VALUE
by ion@svn.reactos.org
Author: ion Date: Mon Aug 14 16:01:20 2006 New Revision: 23574 URL:
http://svn.reactos.org/svn/reactos?rev=23574&view=rev
Log: - VALUE_CELL => CM_KEY_VALUE Modified: trunk/reactos/boot/freeldr/freeldr/reactos/binhive.c trunk/reactos/lib/cmlib/cmdata.h trunk/reactos/ntoskrnl/cm/cm.h trunk/reactos/ntoskrnl/cm/ntfunc.c trunk/reactos/ntoskrnl/cm/regfile.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 16:01:20 2006 @@ -117,11 +117,11 @@ static BOOLEAN CmiAllocateValueCell(PHHIVE Hive, - PVALUE_CELL *ValueCell, + PCM_KEY_VALUE *ValueCell, HCELL_INDEX *ValueCellOffset, PWCHAR ValueName) { - PVALUE_CELL NewValueCell; + PCM_KEY_VALUE NewValueCell; ULONG NameSize; BOOLEAN Packable = TRUE; ULONG i; @@ -136,14 +136,14 @@ break; } } - *ValueCellOffset = HvAllocateCell (Hive, sizeof(VALUE_CELL) + NameSize, HvStable); + *ValueCellOffset = HvAllocateCell (Hive, sizeof(CM_KEY_VALUE) + NameSize, HvStable); if (*ValueCellOffset == HCELL_NULL) { DbgPrint((DPRINT_REGISTRY, "CmiAllocateCell() failed\n")); return FALSE; } - NewValueCell = (PVALUE_CELL) HvGetCell (Hive, *ValueCellOffset); + NewValueCell = (PCM_KEY_VALUE) HvGetCell (Hive, *ValueCellOffset); NewValueCell->Id = REG_VALUE_CELL_ID; NewValueCell->NameSize = NameSize; NewValueCell->Flags = 0; @@ -210,7 +210,7 @@ { HCELL_INDEX ValueCellOffset; HCELL_INDEX DataCellOffset; - PVALUE_CELL ValueCell; + PCM_KEY_VALUE ValueCell; PVOID DataCell; ULONG DataSize; ULONG DataType; @@ -521,7 +521,7 @@ static BOOLEAN RegImportValue (PHHIVE Hive, - PVALUE_CELL ValueCell, + PCM_KEY_VALUE ValueCell, FRLDRHKEY Key) { PVOID DataCell; @@ -606,7 +606,7 @@ PHASH_TABLE_CELL HashCell; PCM_KEY_NODE SubKeyCell; PVALUE_LIST_CELL ValueListCell; - PVALUE_CELL ValueCell = NULL; + PCM_KEY_VALUE ValueCell = NULL; PWCHAR wName; FRLDRHKEY SubKey; LONG Error; @@ -664,7 +664,7 @@ { DbgPrint((DPRINT_REGISTRY, "ValueOffset[%d]: %x\n", i, ValueListCell->ValueOffset[i])); - ValueCell = (PVALUE_CELL) HvGetCell (Hive, ValueListCell->ValueOffset[i]); + ValueCell = (PCM_KEY_VALUE) HvGetCell (Hive, ValueListCell->ValueOffset[i]); DbgPrint((DPRINT_REGISTRY, "ValueCell[%d]: %x\n", i, ValueCell)); Modified: trunk/reactos/lib/cmlib/cmdata.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/cmlib/cmdata.h?rev=235…
============================================================================== --- trunk/reactos/lib/cmlib/cmdata.h (original) +++ trunk/reactos/lib/cmlib/cmdata.h Mon Aug 14 16:01:20 2006 @@ -114,7 +114,7 @@ HCELL_INDEX ValueOffset[0]; } VALUE_LIST_CELL, *PVALUE_LIST_CELL; -typedef struct _VALUE_CELL +typedef struct _CM_KEY_VALUE { USHORT Id; // "kv" USHORT NameSize; // length of Name @@ -124,12 +124,12 @@ USHORT Flags; USHORT Unused1; UCHAR Name[0]; /* warning : not zero terminated */ -} VALUE_CELL, *PVALUE_CELL; +} CM_KEY_VALUE, *PCM_KEY_VALUE; -/* VALUE_CELL.Flags constants */ +/* CM_KEY_VALUE.Flags constants */ #define REG_VALUE_NAME_PACKED 0x0001 -/* VALUE_CELL.DataSize mask constants */ +/* CM_KEY_VALUE.DataSize mask constants */ #define REG_DATA_SIZE_MASK 0x7FFFFFFF #define REG_DATA_IN_OFFSET 0x80000000 Modified: trunk/reactos/ntoskrnl/cm/cm.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/cm/cm.h?rev=23574…
============================================================================== --- trunk/reactos/ntoskrnl/cm/cm.h (original) +++ trunk/reactos/ntoskrnl/cm/cm.h Mon Aug 14 16:01:20 2006 @@ -269,21 +269,21 @@ CmiScanKeyForValue(IN PEREGISTRY_HIVE RegistryHive, IN PCM_KEY_NODE KeyCell, IN PUNICODE_STRING ValueName, - OUT PVALUE_CELL *ValueCell, + OUT PCM_KEY_VALUE *ValueCell, OUT HCELL_INDEX *VBOffset); NTSTATUS CmiGetValueFromKeyByIndex(IN PEREGISTRY_HIVE RegistryHive, IN PCM_KEY_NODE KeyCell, IN ULONG Index, - OUT PVALUE_CELL *ValueCell); + OUT PCM_KEY_VALUE *ValueCell); NTSTATUS CmiAddValueToKey(IN PEREGISTRY_HIVE RegistryHive, IN PCM_KEY_NODE KeyCell, IN HCELL_INDEX KeyCellOffset, IN PUNICODE_STRING ValueName, - OUT PVALUE_CELL *pValueCell, + OUT PCM_KEY_VALUE *pValueCell, OUT HCELL_INDEX *pValueCellOffset); NTSTATUS @@ -319,14 +319,14 @@ NTSTATUS CmiAllocateValueCell(IN PEREGISTRY_HIVE RegistryHive, - OUT PVALUE_CELL *ValueCell, + OUT PCM_KEY_VALUE *ValueCell, OUT HCELL_INDEX *VBOffset, IN PUNICODE_STRING ValueName, IN HV_STORAGE_TYPE Storage); NTSTATUS CmiDestroyValueCell(PEREGISTRY_HIVE RegistryHive, - PVALUE_CELL ValueCell, + PCM_KEY_VALUE ValueCell, HCELL_INDEX VBOffset); NTSTATUS 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 16:01:20 2006 @@ -987,7 +987,7 @@ PKEY_OBJECT KeyObject; PEREGISTRY_HIVE RegistryHive; PCM_KEY_NODE KeyCell; - PVALUE_CELL ValueCell; + PCM_KEY_VALUE ValueCell; PVOID DataCell; ULONG NameSize, DataSize; PKEY_VALUE_BASIC_INFORMATION ValueBasicInformation; @@ -1667,7 +1667,7 @@ PKEY_OBJECT KeyObject; PEREGISTRY_HIVE RegistryHive; PCM_KEY_NODE KeyCell; - PVALUE_CELL ValueCell; + PCM_KEY_VALUE ValueCell; PVOID DataCell; PKEY_VALUE_BASIC_INFORMATION ValueBasicInformation; PKEY_VALUE_PARTIAL_INFORMATION ValuePartialInformation; @@ -1927,7 +1927,7 @@ PKEY_OBJECT KeyObject; PEREGISTRY_HIVE RegistryHive; PCM_KEY_NODE KeyCell; - PVALUE_CELL ValueCell; + PCM_KEY_VALUE ValueCell; HCELL_INDEX ValueCellOffset; PVOID DataCell; ULONG DesiredAccess; @@ -2374,7 +2374,7 @@ OUT PULONG ReturnLength) { PEREGISTRY_HIVE RegistryHive; - PVALUE_CELL ValueCell; + PCM_KEY_VALUE ValueCell; PKEY_OBJECT KeyObject; PVOID DataCell; ULONG BufferLength = 0; 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 16:01:20 2006 @@ -937,7 +937,7 @@ PCM_KEY_NODE KeyCell) { PVALUE_LIST_CELL ValueListCell; - PVALUE_CELL CurValueCell; + PCM_KEY_VALUE CurValueCell; ULONG MaxValueName; ULONG Size; ULONG i; @@ -985,7 +985,7 @@ PCM_KEY_NODE KeyCell) { PVALUE_LIST_CELL ValueListCell; - PVALUE_CELL CurValueCell; + PCM_KEY_VALUE CurValueCell; LONG MaxValueData; ULONG i; @@ -1289,7 +1289,7 @@ { PHASH_TABLE_CELL HashBlock; PVALUE_LIST_CELL ValueList; - PVALUE_CELL ValueCell; + PCM_KEY_VALUE ValueCell; HV_STORAGE_TYPE Storage; ULONG i; @@ -1390,11 +1390,11 @@ CmiScanKeyForValue(IN PEREGISTRY_HIVE RegistryHive, IN PCM_KEY_NODE KeyCell, IN PUNICODE_STRING ValueName, - OUT PVALUE_CELL *ValueCell, + OUT PCM_KEY_VALUE *ValueCell, OUT HCELL_INDEX *ValueCellOffset) { PVALUE_LIST_CELL ValueListCell; - PVALUE_CELL CurValueCell; + PCM_KEY_VALUE CurValueCell; ULONG i; *ValueCell = NULL; @@ -1437,10 +1437,10 @@ CmiGetValueFromKeyByIndex(IN PEREGISTRY_HIVE RegistryHive, IN PCM_KEY_NODE KeyCell, IN ULONG Index, - OUT PVALUE_CELL *ValueCell) + OUT PCM_KEY_VALUE *ValueCell) { PVALUE_LIST_CELL ValueListCell; - PVALUE_CELL CurValueCell; + PCM_KEY_VALUE CurValueCell; *ValueCell = NULL; @@ -1472,11 +1472,11 @@ IN PCM_KEY_NODE KeyCell, IN HCELL_INDEX KeyCellOffset, IN PUNICODE_STRING ValueName, - OUT PVALUE_CELL *pValueCell, + OUT PCM_KEY_VALUE *pValueCell, OUT HCELL_INDEX *pValueCellOffset) { PVALUE_LIST_CELL ValueListCell; - PVALUE_CELL NewValueCell; + PCM_KEY_VALUE NewValueCell; HCELL_INDEX ValueListCellOffset; HCELL_INDEX NewValueCellOffset; ULONG CellSize; @@ -1560,7 +1560,7 @@ IN PUNICODE_STRING ValueName) { PVALUE_LIST_CELL ValueListCell; - PVALUE_CELL CurValueCell; + PCM_KEY_VALUE CurValueCell; ULONG i; NTSTATUS Status; @@ -1723,12 +1723,12 @@ NTSTATUS CmiAllocateValueCell(PEREGISTRY_HIVE RegistryHive, - PVALUE_CELL *ValueCell, + PCM_KEY_VALUE *ValueCell, HCELL_INDEX *VBOffset, IN PUNICODE_STRING ValueName, IN HV_STORAGE_TYPE Storage) { - PVALUE_CELL NewValueCell; + PCM_KEY_VALUE NewValueCell; NTSTATUS Status; BOOLEAN Packable; ULONG NameSize; @@ -1741,7 +1741,7 @@ DPRINT("ValueName->Length %lu NameSize %lu\n", ValueName->Length, NameSize); - *VBOffset = HvAllocateCell (RegistryHive->Hive, sizeof(VALUE_CELL) + NameSize, Storage); + *VBOffset = HvAllocateCell (RegistryHive->Hive, sizeof(CM_KEY_VALUE) + NameSize, Storage); if (*VBOffset == HCELL_NULL) { Status = STATUS_INSUFFICIENT_RESOURCES; @@ -1779,7 +1779,7 @@ NTSTATUS CmiDestroyValueCell(PEREGISTRY_HIVE RegistryHive, - PVALUE_CELL ValueCell, + PCM_KEY_VALUE ValueCell, HCELL_INDEX ValueCellOffset) { DPRINT("CmiDestroyValueCell(Cell %p Offset %lx)\n", @@ -2071,8 +2071,8 @@ { PVALUE_LIST_CELL NewValueListCell; PVALUE_LIST_CELL SrcValueListCell; - PVALUE_CELL NewValueCell; - PVALUE_CELL SrcValueCell; + PCM_KEY_VALUE NewValueCell; + PCM_KEY_VALUE SrcValueCell; PVOID SrcValueDataCell; PVOID NewValueDataCell; HCELL_INDEX ValueCellOffset; @@ -2104,7 +2104,7 @@ /* Copy value cell */ SrcValueCell = HvGetCell (SrcHive->Hive, SrcValueListCell->ValueOffset[i]); - NewValueCellSize = sizeof(VALUE_CELL) + SrcValueCell->NameSize; + NewValueCellSize = sizeof(CM_KEY_VALUE) + SrcValueCell->NameSize; ValueCellOffset = HvAllocateCell (DstHive->Hive, NewValueCellSize, HvStable); if (ValueCellOffset == HCELL_NULL) { 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 16:01:20 2006 @@ -888,7 +888,7 @@ PUNICODE_STRING TargetPath) { UNICODE_STRING LinkName = RTL_CONSTANT_STRING(L"SymbolicLinkValue"); - PVALUE_CELL ValueCell; + PCM_KEY_VALUE ValueCell; PVOID DataCell; NTSTATUS Status;
18 years, 4 months
1
0
0
0
[ion] 23573: - KEY_CELL => CM_KEY_NODE
by ion@svn.reactos.org
Author: ion Date: Mon Aug 14 15:57:47 2006 New Revision: 23573 URL:
http://svn.reactos.org/svn/reactos?rev=23573&view=rev
Log: - KEY_CELL => CM_KEY_NODE Modified: trunk/reactos/boot/freeldr/freeldr/reactos/binhive.c trunk/reactos/lib/cmlib/cmdata.h trunk/reactos/lib/cmlib/cminit.c trunk/reactos/lib/cmlib/hivedata.h trunk/reactos/ntoskrnl/cm/cm.h 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 15:57:47 2006 @@ -67,16 +67,16 @@ static BOOLEAN CmiAddKeyToParentHashTable (PHHIVE Hive, - HCELL_INDEX ParentKeyOffset, - PKEY_CELL NewKeyCell, + HCELL_INDEX Parent, + PCM_KEY_NODE NewKeyCell, HCELL_INDEX NKBOffset) { PHASH_TABLE_CELL HashBlock; - PKEY_CELL ParentKeyCell; + PCM_KEY_NODE ParentKeyCell; ULONG i; - ParentKeyCell = HvGetCell (Hive, ParentKeyOffset); - HashBlock = HvGetCell (Hive, ParentKeyCell->HashTableOffset[HvStable]); + ParentKeyCell = HvGetCell (Hive, Parent); + HashBlock = HvGetCell (Hive, ParentKeyCell->SubKeyLists[HvStable]); for (i = 0; i < HashBlock->HashTableSize; i++) { @@ -86,7 +86,7 @@ memcpy (&HashBlock->Table[i].HashValue, NewKeyCell->Name, min(NewKeyCell->NameSize, sizeof(ULONG))); - ParentKeyCell->NumberOfSubKeys[HvStable]++; + ParentKeyCell->SubKeyCounts[HvStable]++; return TRUE; } } @@ -180,7 +180,7 @@ HCELL_INDEX ValueCellOffset) { PVALUE_LIST_CELL ValueListCell; - PKEY_CELL KeyCell; + PCM_KEY_NODE KeyCell; KeyCell = HvGetCell (Hive, KeyCellOffset); if (KeyCell == NULL) @@ -189,15 +189,15 @@ return FALSE; } - ValueListCell = HvGetCell (Hive, KeyCell->ValueListOffset); + ValueListCell = HvGetCell (Hive, KeyCell->ValueList.List); if (ValueListCell == NULL) { DbgPrint((DPRINT_REGISTRY, "HvGetCell() failed\n")); return FALSE; } - ValueListCell->ValueOffset[KeyCell->NumberOfValues] = ValueCellOffset; - KeyCell->NumberOfValues++; + ValueListCell->ValueOffset[KeyCell->ValueList.Count] = ValueCellOffset; + KeyCell->ValueList.Count++; return TRUE; } @@ -278,12 +278,12 @@ static BOOLEAN CmiExportSubKey (PHHIVE Hive, - HCELL_INDEX ParentKeyOffset, + HCELL_INDEX Parent, FRLDRHKEY ParentKey, FRLDRHKEY Key) { HCELL_INDEX NKBOffset; - PKEY_CELL NewKeyCell; + PCM_KEY_NODE NewKeyCell; ULONG KeyCellSize; ULONG SubKeyCount; ULONG ValueCount; @@ -312,7 +312,7 @@ } /* Allocate key cell */ - KeyCellSize = sizeof(KEY_CELL) + NameSize; + KeyCellSize = sizeof(CM_KEY_NODE) + NameSize; NKBOffset = HvAllocateCell (Hive, KeyCellSize, HvStable); if (NKBOffset == HCELL_NULL) { @@ -321,15 +321,15 @@ } /* Initialize key cell */ - NewKeyCell = (PKEY_CELL) HvGetCell (Hive, NKBOffset); + NewKeyCell = (PCM_KEY_NODE) HvGetCell (Hive, NKBOffset); NewKeyCell->Id = REG_KEY_CELL_ID; NewKeyCell->Flags = 0; NewKeyCell->LastWriteTime.QuadPart = 0ULL; - NewKeyCell->ParentKeyOffset = ParentKeyOffset; - NewKeyCell->NumberOfSubKeys[HvStable] = 0; - NewKeyCell->HashTableOffset[HvStable] = -1; - NewKeyCell->NumberOfValues = 0; - NewKeyCell->ValueListOffset = -1; + NewKeyCell->Parent = Parent; + NewKeyCell->SubKeyCounts[HvStable] = 0; + NewKeyCell->SubKeyLists[HvStable] = -1; + NewKeyCell->ValueList.Count = 0; + NewKeyCell->ValueList.List = -1; NewKeyCell->SecurityKeyOffset = -1; NewKeyCell->ClassNameOffset = -1; NewKeyCell->NameSize = NameSize; @@ -352,7 +352,7 @@ /* Add key cell to the parent key's hash table */ if (!CmiAddKeyToParentHashTable (Hive, - ParentKeyOffset, + Parent, NewKeyCell, NKBOffset)) { @@ -366,7 +366,7 @@ { /* Allocate value list cell */ if (!CmiAllocateValueListCell (Hive, - &NewKeyCell->ValueListOffset, + &NewKeyCell->ValueList.List, ValueCount)) { DbgPrint((DPRINT_REGISTRY, "CmiAllocateValueListCell() failed\n")); @@ -400,7 +400,7 @@ { /* Allocate hash table cell */ if (!CmiAllocateHashTableCell (Hive, - &NewKeyCell->HashTableOffset[HvStable], + &NewKeyCell->SubKeyLists[HvStable], SubKeyCount)) { DbgPrint((DPRINT_REGISTRY, "CmiAllocateHashTableCell() failed\n")); @@ -430,7 +430,7 @@ CmiExportHive (PHHIVE Hive, PCWSTR KeyName) { - PKEY_CELL KeyCell; + PCM_KEY_NODE KeyCell; FRLDRHKEY Key; ULONG SubKeyCount; ULONG ValueCount; @@ -459,7 +459,7 @@ { /* Allocate value list cell */ if (!CmiAllocateValueListCell (Hive, - &KeyCell->ValueListOffset, + &KeyCell->ValueList.List, ValueCount)) { DbgPrint((DPRINT_REGISTRY, "CmiAllocateValueListCell() failed\n")); @@ -493,7 +493,7 @@ { /* Allocate hash table cell */ if (!CmiAllocateHashTableCell (Hive, - &KeyCell->HashTableOffset[HvStable], + &KeyCell->SubKeyLists[HvStable], SubKeyCount)) { DbgPrint((DPRINT_REGISTRY, "CmiAllocateHashTableCell() failed\n")); @@ -600,11 +600,11 @@ static BOOLEAN RegImportSubKey(PHHIVE Hive, - PKEY_CELL KeyCell, + PCM_KEY_NODE KeyCell, FRLDRHKEY ParentKey) { PHASH_TABLE_CELL HashCell; - PKEY_CELL SubKeyCell; + PCM_KEY_NODE SubKeyCell; PVALUE_LIST_CELL ValueListCell; PVALUE_CELL ValueCell = NULL; PWCHAR wName; @@ -651,16 +651,16 @@ DbgPrint((DPRINT_REGISTRY, "RegCreateKey() failed!\n")); return FALSE; } - DbgPrint((DPRINT_REGISTRY, "Subkeys: %u\n", KeyCell->NumberOfSubKeys)); - DbgPrint((DPRINT_REGISTRY, "Values: %u\n", KeyCell->NumberOfValues)); + DbgPrint((DPRINT_REGISTRY, "Subkeys: %u\n", KeyCell->SubKeyCounts)); + DbgPrint((DPRINT_REGISTRY, "Values: %u\n", KeyCell->ValueList.Count)); /* Enumerate and add values */ - if (KeyCell->NumberOfValues > 0) - { - ValueListCell = (PVALUE_LIST_CELL) HvGetCell (Hive, KeyCell->ValueListOffset); + if (KeyCell->ValueList.Count > 0) + { + ValueListCell = (PVALUE_LIST_CELL) HvGetCell (Hive, KeyCell->ValueList.List); DbgPrint((DPRINT_REGISTRY, "ValueListCell: %x\n", ValueListCell)); - for (i = 0; i < KeyCell->NumberOfValues; i++) + for (i = 0; i < KeyCell->ValueList.Count; i++) { DbgPrint((DPRINT_REGISTRY, "ValueOffset[%d]: %x\n", i, ValueListCell->ValueOffset[i])); @@ -674,17 +674,17 @@ } /* Enumerate and add subkeys */ - if (KeyCell->NumberOfSubKeys[HvStable] > 0) - { - HashCell = (PHASH_TABLE_CELL) HvGetCell (Hive, KeyCell->HashTableOffset[HvStable]); + if (KeyCell->SubKeyCounts[HvStable] > 0) + { + HashCell = (PHASH_TABLE_CELL) HvGetCell (Hive, KeyCell->SubKeyLists[HvStable]); DbgPrint((DPRINT_REGISTRY, "HashCell: %x\n", HashCell)); - DbgPrint((DPRINT_REGISTRY, "NumberOfSubKeys: %x\n", KeyCell->NumberOfSubKeys)); - - for (i = 0; i < KeyCell->NumberOfSubKeys[HvStable]; i++) + DbgPrint((DPRINT_REGISTRY, "SubKeyCounts: %x\n", KeyCell->SubKeyCounts)); + + for (i = 0; i < KeyCell->SubKeyCounts[HvStable]; i++) { DbgPrint((DPRINT_REGISTRY, "KeyOffset[%d]: %x\n", i, HashCell->Table[i].KeyOffset)); - SubKeyCell = (PKEY_CELL) HvGetCell (Hive, HashCell->Table[i].KeyOffset); + SubKeyCell = (PCM_KEY_NODE) HvGetCell (Hive, HashCell->Table[i].KeyOffset); DbgPrint((DPRINT_REGISTRY, "SubKeyCell[%d]: %x\n", i, SubKeyCell)); @@ -701,9 +701,9 @@ RegImportBinaryHive(PCHAR ChunkBase, ULONG ChunkSize) { - PKEY_CELL KeyCell; + PCM_KEY_NODE KeyCell; PHASH_TABLE_CELL HashCell; - PKEY_CELL SubKeyCell; + PCM_KEY_NODE SubKeyCell; FRLDRHKEY SystemKey; ULONG i; LONG Error; @@ -731,8 +731,8 @@ return FALSE; } - DbgPrint((DPRINT_REGISTRY, "Subkeys: %u\n", KeyCell->NumberOfSubKeys)); - DbgPrint((DPRINT_REGISTRY, "Values: %u\n", KeyCell->NumberOfValues)); + DbgPrint((DPRINT_REGISTRY, "Subkeys: %u\n", KeyCell->SubKeyCounts)); + DbgPrint((DPRINT_REGISTRY, "Values: %u\n", KeyCell->ValueList.Count)); /* Open 'System' key */ Error = RegOpenKey(NULL, @@ -745,13 +745,13 @@ } /* Enumerate and add subkeys */ - if (KeyCell->NumberOfSubKeys[HvStable] > 0) - { - HashCell = HvGetCell (Hive, KeyCell->HashTableOffset[HvStable]); + if (KeyCell->SubKeyCounts[HvStable] > 0) + { + HashCell = HvGetCell (Hive, KeyCell->SubKeyLists[HvStable]); DbgPrint((DPRINT_REGISTRY, "HashCell: %x\n", HashCell)); - DbgPrint((DPRINT_REGISTRY, "NumberOfSubKeys: %x\n", KeyCell->NumberOfSubKeys[HvStable])); - - for (i = 0; i < KeyCell->NumberOfSubKeys[HvStable]; i++) + DbgPrint((DPRINT_REGISTRY, "SubKeyCounts: %x\n", KeyCell->SubKeyCounts[HvStable])); + + for (i = 0; i < KeyCell->SubKeyCounts[HvStable]; i++) { DbgPrint((DPRINT_REGISTRY, "KeyOffset[%d]: %x\n", i, HashCell->Table[i].KeyOffset)); Modified: trunk/reactos/lib/cmlib/cmdata.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/cmlib/cmdata.h?rev=235…
============================================================================== --- trunk/reactos/lib/cmlib/cmdata.h (original) +++ trunk/reactos/lib/cmlib/cmdata.h Mon Aug 14 15:57:47 2006 @@ -31,7 +31,13 @@ ULONG UseCount; } CM_VIEW_OF_FILE, *PCM_VIEW_OF_FILE; -typedef struct _KEY_CELL +typedef struct _CHILD_LIST +{ + ULONG Count; + HCELL_INDEX List; +} CHILD_LIST, *PCHILD_LIST; + +typedef struct _CM_KEY_NODE { /* Key cell identifier "kn" (0x6b6e) */ USHORT Id; @@ -42,23 +48,18 @@ /* Time of last flush */ LARGE_INTEGER LastWriteTime; - /* ? */ - ULONG UnUsed1; + ULONG Spare; /* BlockAddress offset of parent key cell */ - HCELL_INDEX ParentKeyOffset; + HCELL_INDEX Parent; /* Count of sub keys for the key in this key cell (stable & volatile) */ - ULONG NumberOfSubKeys[HvMaxStorageType]; + ULONG SubKeyCounts[HvMaxStorageType]; /* BlockAddress offset of has table for FIXME: subkeys/values? (stable & volatile) */ - HCELL_INDEX HashTableOffset[HvMaxStorageType]; + HCELL_INDEX SubKeyLists[HvMaxStorageType]; - /* Count of values contained in this key cell */ - ULONG NumberOfValues; - - /* BlockAddress offset of VALUE_LIST_CELL */ - HCELL_INDEX ValueListOffset; + CHILD_LIST ValueList; /* BlockAddress offset of security cell */ HCELL_INDEX SecurityKeyOffset; @@ -66,8 +67,11 @@ /* BlockAddress offset of registry key class */ HCELL_INDEX ClassNameOffset; - /* ? */ - ULONG Unused4[5]; + ULONG MaxNameLen; + ULONG MaxClassLen; + ULONG MaxValueNameLen; + ULONG MaxValueDataLen; + ULONG WorkVar; /* Size in bytes of key name */ USHORT NameSize; @@ -77,9 +81,9 @@ /* Name of key (not zero terminated) */ UCHAR Name[0]; -} KEY_CELL, *PKEY_CELL; +} CM_KEY_NODE, *PCM_KEY_NODE; -/* KEY_CELL.Flags constants */ +/* CM_KEY_NODE.Flags constants */ #define REG_KEY_VOLATILE_CELL 0x01 #define REG_KEY_ROOT_CELL 0x0C #define REG_KEY_LINK_CELL 0x10 Modified: trunk/reactos/lib/cmlib/cminit.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/cmlib/cminit.c?rev=235…
============================================================================== --- trunk/reactos/lib/cmlib/cminit.c (original) +++ trunk/reactos/lib/cmlib/cminit.c Mon Aug 14 15:57:47 2006 @@ -12,29 +12,29 @@ PHHIVE Hive, PCWSTR Name) { - PKEY_CELL KeyCell; + PCM_KEY_NODE KeyCell; HCELL_INDEX RootCellIndex; ULONG NameSize; NameSize = wcslen(Name) * sizeof(WCHAR); - RootCellIndex = HvAllocateCell(Hive, sizeof(KEY_CELL) + NameSize, HvStable); + RootCellIndex = HvAllocateCell(Hive, sizeof(CM_KEY_NODE) + NameSize, HvStable); if (RootCellIndex == HCELL_NULL) return FALSE; Hive->HiveHeader->RootCell = RootCellIndex; Hive->HiveHeader->Checksum = HvpHiveHeaderChecksum(Hive->HiveHeader); - KeyCell = (PKEY_CELL)HvGetCell(Hive, RootCellIndex); + KeyCell = (PCM_KEY_NODE)HvGetCell(Hive, RootCellIndex); KeyCell->Id = REG_KEY_CELL_ID; KeyCell->Flags = REG_KEY_ROOT_CELL; KeyCell->LastWriteTime.QuadPart = 0; - KeyCell->ParentKeyOffset = HCELL_NULL; - KeyCell->NumberOfSubKeys[0] = 0; - KeyCell->NumberOfSubKeys[1] = 0; - KeyCell->HashTableOffset[0] = HCELL_NULL; - KeyCell->HashTableOffset[1] = HCELL_NULL; - KeyCell->NumberOfValues = 0; - KeyCell->ValueListOffset = HCELL_NULL; + KeyCell->Parent = HCELL_NULL; + KeyCell->SubKeyCounts[0] = 0; + KeyCell->SubKeyCounts[1] = 0; + KeyCell->SubKeyLists[0] = HCELL_NULL; + KeyCell->SubKeyLists[1] = HCELL_NULL; + KeyCell->ValueList.Count = 0; + KeyCell->ValueList.List = HCELL_NULL; KeyCell->SecurityKeyOffset = HCELL_NULL; KeyCell->ClassNameOffset = HCELL_NULL; KeyCell->NameSize = NameSize; @@ -47,23 +47,23 @@ static VOID CMAPI CmpPrepareKey( PHHIVE RegistryHive, - PKEY_CELL KeyCell) + PCM_KEY_NODE KeyCell) { - PKEY_CELL SubKeyCell; + PCM_KEY_NODE SubKeyCell; PHASH_TABLE_CELL HashCell; ULONG i; ASSERT(KeyCell->Id == REG_KEY_CELL_ID); - KeyCell->HashTableOffset[HvVolatile] = HCELL_NULL; - KeyCell->NumberOfSubKeys[HvVolatile] = 0; + KeyCell->SubKeyLists[HvVolatile] = HCELL_NULL; + KeyCell->SubKeyCounts[HvVolatile] = 0; /* Enumerate and add subkeys */ - if (KeyCell->NumberOfSubKeys[HvStable] > 0) + if (KeyCell->SubKeyCounts[HvStable] > 0) { - HashCell = HvGetCell(RegistryHive, KeyCell->HashTableOffset[HvStable]); + HashCell = HvGetCell(RegistryHive, KeyCell->SubKeyLists[HvStable]); - for (i = 0; i < KeyCell->NumberOfSubKeys[HvStable]; i++) + for (i = 0; i < KeyCell->SubKeyCounts[HvStable]; i++) { SubKeyCell = HvGetCell(RegistryHive, HashCell->Table[i].KeyOffset); CmpPrepareKey(RegistryHive, SubKeyCell); @@ -75,7 +75,7 @@ CmPrepareHive( PHHIVE RegistryHive) { - PKEY_CELL RootCell; + PCM_KEY_NODE RootCell; RootCell = HvGetCell(RegistryHive, RegistryHive->HiveHeader->RootCell); CmpPrepareKey(RegistryHive, RootCell); Modified: trunk/reactos/lib/cmlib/hivedata.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/cmlib/hivedata.h?rev=2…
============================================================================== --- trunk/reactos/lib/cmlib/hivedata.h (original) +++ trunk/reactos/lib/cmlib/hivedata.h Mon Aug 14 15:57:47 2006 @@ -77,7 +77,7 @@ ULONG Format; /* Offset into file from the byte after the end of the base block. - If the hive is volatile, this is the actual pointer to the KEY_CELL */ + If the hive is volatile, this is the actual pointer to the CM_KEY_NODE */ HCELL_INDEX RootCell; /* Size of each hive block ? */ Modified: trunk/reactos/ntoskrnl/cm/cm.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/cm/cm.h?rev=23573…
============================================================================== --- trunk/reactos/ntoskrnl/cm/cm.h (original) +++ trunk/reactos/ntoskrnl/cm/cm.h Mon Aug 14 15:57:47 2006 @@ -85,8 +85,8 @@ /* Block offset of the key cell this key belongs in */ HCELL_INDEX KeyCellOffset; - /* KEY_CELL this key belong in */ - PKEY_CELL KeyCell; + /* CM_KEY_NODE this key belong in */ + PCM_KEY_NODE KeyCell; /* Link to the parent KEY_OBJECT for this key */ struct _KEY_OBJECT *ParentKey; @@ -95,7 +95,7 @@ LIST_ENTRY ListEntry; /* Subkeys loaded in SubKeys */ - ULONG NumberOfSubKeys; + ULONG SubKeyCounts; /* Space allocated in SubKeys */ ULONG SizeOfSubKeys; @@ -236,16 +236,16 @@ ULONG CmiGetMaxValueNameLength(IN PEREGISTRY_HIVE RegistryHive, - IN PKEY_CELL KeyCell); + IN PCM_KEY_NODE KeyCell); ULONG CmiGetMaxValueDataLength(IN PEREGISTRY_HIVE RegistryHive, - IN PKEY_CELL KeyCell); + IN PCM_KEY_NODE KeyCell); NTSTATUS CmiScanForSubKey(IN PEREGISTRY_HIVE RegistryHive, - IN PKEY_CELL KeyCell, - OUT PKEY_CELL *SubKeyCell, + IN PCM_KEY_NODE KeyCell, + OUT PCM_KEY_NODE *SubKeyCell, OUT HCELL_INDEX *BlockOffset, IN PUNICODE_STRING KeyName, IN ACCESS_MASK DesiredAccess, @@ -267,20 +267,20 @@ NTSTATUS CmiScanKeyForValue(IN PEREGISTRY_HIVE RegistryHive, - IN PKEY_CELL KeyCell, + IN PCM_KEY_NODE KeyCell, IN PUNICODE_STRING ValueName, OUT PVALUE_CELL *ValueCell, OUT HCELL_INDEX *VBOffset); NTSTATUS CmiGetValueFromKeyByIndex(IN PEREGISTRY_HIVE RegistryHive, - IN PKEY_CELL KeyCell, + IN PCM_KEY_NODE KeyCell, IN ULONG Index, OUT PVALUE_CELL *ValueCell); NTSTATUS CmiAddValueToKey(IN PEREGISTRY_HIVE RegistryHive, - IN PKEY_CELL KeyCell, + IN PCM_KEY_NODE KeyCell, IN HCELL_INDEX KeyCellOffset, IN PUNICODE_STRING ValueName, OUT PVALUE_CELL *pValueCell, @@ -288,7 +288,7 @@ NTSTATUS CmiDeleteValueFromKey(IN PEREGISTRY_HIVE RegistryHive, - IN PKEY_CELL KeyCell, + IN PCM_KEY_NODE KeyCell, IN HCELL_INDEX KeyCellOffset, IN PUNICODE_STRING ValueName); @@ -299,7 +299,7 @@ IN ULONG HashTableSize, IN HV_STORAGE_TYPE Storage); -PKEY_CELL +PCM_KEY_NODE CmiGetKeyFromHashByIndex(PEREGISTRY_HIVE RegistryHive, PHASH_TABLE_CELL HashBlock, ULONG Index); @@ -307,9 +307,9 @@ NTSTATUS CmiAddKeyToHashTable(PEREGISTRY_HIVE RegistryHive, PHASH_TABLE_CELL HashCell, - PKEY_CELL KeyCell, + PCM_KEY_NODE KeyCell, HV_STORAGE_TYPE StorageType, - PKEY_CELL NewKeyCell, + PCM_KEY_NODE NewKeyCell, HCELL_INDEX NKBOffset); NTSTATUS @@ -365,11 +365,11 @@ BOOLEAN CmiCompareKeyNames(PUNICODE_STRING KeyName, - PKEY_CELL KeyCell); + PCM_KEY_NODE KeyCell); BOOLEAN CmiCompareKeyNamesI(PUNICODE_STRING KeyName, - PKEY_CELL KeyCell); + PCM_KEY_NODE KeyCell); VOID @@ -381,9 +381,9 @@ NTSTATUS CmiCopyKey (PEREGISTRY_HIVE DstHive, - PKEY_CELL DstKeyCell, + PCM_KEY_NODE DstKeyCell, PEREGISTRY_HIVE SrcHive, - PKEY_CELL SrcKeyCell); + PCM_KEY_NODE SrcKeyCell); NTSTATUS CmiSaveTempHive (PEREGISTRY_HIVE Hive, 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 15:57:47 2006 @@ -487,7 +487,7 @@ KeyObject->ParentKey = Object; KeyObject->RegistryHive = KeyObject->ParentKey->RegistryHive; KeyObject->Flags = 0; - KeyObject->NumberOfSubKeys = 0; + KeyObject->SubKeyCounts = 0; KeyObject->SizeOfSubKeys = 0; KeyObject->SubKeys = NULL; @@ -531,7 +531,7 @@ RtlpCreateUnicodeString(&KeyObject->Name, Start, NonPagedPool); } - KeyObject->KeyCell->ParentKeyOffset = KeyObject->ParentKey->KeyCellOffset; + KeyObject->KeyCell->Parent = KeyObject->ParentKey->KeyCellOffset; KeyObject->KeyCell->SecurityKeyOffset = KeyObject->ParentKey->KeyCell->SecurityKeyOffset; DPRINT("RemainingPath: %wZ\n", &RemainingPath); @@ -628,8 +628,8 @@ VERIFY_KEY_OBJECT(KeyObject); /* Check for subkeys */ - if (KeyObject->KeyCell->NumberOfSubKeys[HvStable] != 0 || - KeyObject->KeyCell->NumberOfSubKeys[HvVolatile] != 0) + if (KeyObject->KeyCell->SubKeyCounts[HvStable] != 0 || + KeyObject->KeyCell->SubKeyCounts[HvVolatile] != 0) { Status = STATUS_CANNOT_DELETE; } @@ -682,7 +682,7 @@ { PKEY_OBJECT KeyObject; PEREGISTRY_HIVE RegistryHive; - PKEY_CELL KeyCell, SubKeyCell; + PCM_KEY_NODE KeyCell, SubKeyCell; PHASH_TABLE_CELL HashTableBlock; PKEY_BASIC_INFORMATION BasicInformation; PKEY_NODE_INFORMATION NodeInformation; @@ -746,8 +746,8 @@ RegistryHive = KeyObject->RegistryHive; /* Check for hightest possible sub key index */ - if (Index >= KeyCell->NumberOfSubKeys[HvStable] + - KeyCell->NumberOfSubKeys[HvVolatile]) + if (Index >= KeyCell->SubKeyCounts[HvStable] + + KeyCell->SubKeyCounts[HvVolatile]) { ExReleaseResourceLite(&CmiRegistryLock); KeLeaveCriticalRegion(); @@ -759,10 +759,10 @@ } /* Get pointer to SubKey */ - if (Index >= KeyCell->NumberOfSubKeys[HvStable]) + if (Index >= KeyCell->SubKeyCounts[HvStable]) { Storage = HvVolatile; - BaseIndex = Index - KeyCell->NumberOfSubKeys[HvStable]; + BaseIndex = Index - KeyCell->SubKeyCounts[HvStable]; } else { @@ -770,7 +770,7 @@ BaseIndex = Index; } - if (KeyCell->HashTableOffset[Storage] == HCELL_NULL) + if (KeyCell->SubKeyLists[Storage] == HCELL_NULL) { ExReleaseResourceLite(&CmiRegistryLock); KeLeaveCriticalRegion(); @@ -780,8 +780,8 @@ return STATUS_NO_MORE_ENTRIES; } - ASSERT(KeyCell->HashTableOffset[Storage] != HCELL_NULL); - HashTableBlock = HvGetCell (RegistryHive->Hive, KeyCell->HashTableOffset[Storage]); + ASSERT(KeyCell->SubKeyLists[Storage] != HCELL_NULL); + HashTableBlock = HvGetCell (RegistryHive->Hive, KeyCell->SubKeyLists[Storage]); SubKeyCell = CmiGetKeyFromHashByIndex(RegistryHive, HashTableBlock, @@ -929,10 +929,10 @@ FullInformation->ClassOffset = sizeof(KEY_FULL_INFORMATION) - sizeof(WCHAR); FullInformation->ClassLength = SubKeyCell->ClassSize; - FullInformation->SubKeys = CmiGetNumberOfSubKeys(KeyObject); //SubKeyCell->NumberOfSubKeys; + FullInformation->SubKeys = CmiGetNumberOfSubKeys(KeyObject); //SubKeyCell->SubKeyCounts; FullInformation->MaxNameLen = CmiGetMaxNameLength(KeyObject); FullInformation->MaxClassLen = CmiGetMaxClassLength(KeyObject); - FullInformation->Values = SubKeyCell->NumberOfValues; + FullInformation->Values = SubKeyCell->ValueList.Count; FullInformation->MaxValueNameLen = CmiGetMaxValueNameLength(RegistryHive, SubKeyCell); FullInformation->MaxValueDataLen = @@ -986,7 +986,7 @@ NTSTATUS Status; PKEY_OBJECT KeyObject; PEREGISTRY_HIVE RegistryHive; - PKEY_CELL KeyCell; + PCM_KEY_NODE KeyCell; PVALUE_CELL ValueCell; PVOID DataCell; ULONG NameSize, DataSize; @@ -1441,7 +1441,7 @@ PEREGISTRY_HIVE RegistryHive; PVOID ClassCell; PKEY_OBJECT KeyObject; - PKEY_CELL KeyCell; + PCM_KEY_NODE KeyCell; ULONG NameSize, ClassSize; NTSTATUS Status; REG_QUERY_KEY_INFORMATION QueryKeyInfo; @@ -1603,10 +1603,10 @@ FullInformation->TitleIndex = 0; FullInformation->ClassOffset = sizeof(KEY_FULL_INFORMATION) - sizeof(WCHAR); FullInformation->ClassLength = KeyCell->ClassSize; - FullInformation->SubKeys = CmiGetNumberOfSubKeys(KeyObject); //KeyCell->NumberOfSubKeys; + FullInformation->SubKeys = CmiGetNumberOfSubKeys(KeyObject); //KeyCell->SubKeyCounts; FullInformation->MaxNameLen = CmiGetMaxNameLength(KeyObject); FullInformation->MaxClassLen = CmiGetMaxClassLength(KeyObject); - FullInformation->Values = KeyCell->NumberOfValues; + FullInformation->Values = KeyCell->ValueList.Count; FullInformation->MaxValueNameLen = CmiGetMaxValueNameLength(RegistryHive, KeyCell); FullInformation->MaxValueDataLen = @@ -1666,7 +1666,7 @@ ULONG NameSize, DataSize; PKEY_OBJECT KeyObject; PEREGISTRY_HIVE RegistryHive; - PKEY_CELL KeyCell; + PCM_KEY_NODE KeyCell; PVALUE_CELL ValueCell; PVOID DataCell; PKEY_VALUE_BASIC_INFORMATION ValueBasicInformation; @@ -1926,7 +1926,7 @@ NTSTATUS Status; PKEY_OBJECT KeyObject; PEREGISTRY_HIVE RegistryHive; - PKEY_CELL KeyCell; + PCM_KEY_NODE KeyCell; PVALUE_CELL ValueCell; HCELL_INDEX ValueCellOffset; PVOID DataCell; @@ -2378,7 +2378,7 @@ PKEY_OBJECT KeyObject; PVOID DataCell; ULONG BufferLength = 0; - PKEY_CELL KeyCell; + PCM_KEY_NODE KeyCell; NTSTATUS Status; PUCHAR DataPtr; ULONG i; 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 15:57:47 2006 @@ -832,7 +832,7 @@ ULONG CmiGetNumberOfSubKeys(PKEY_OBJECT KeyObject) { - PKEY_CELL KeyCell; + PCM_KEY_NODE KeyCell; ULONG SubKeyCount; VERIFY_KEY_OBJECT(KeyObject); @@ -841,8 +841,8 @@ VERIFY_KEY_CELL(KeyCell); SubKeyCount = (KeyCell == NULL) ? 0 : - KeyCell->NumberOfSubKeys[HvStable] + - KeyCell->NumberOfSubKeys[HvVolatile]; + KeyCell->SubKeyCounts[HvStable] + + KeyCell->SubKeyCounts[HvVolatile]; return SubKeyCount; } @@ -852,8 +852,8 @@ CmiGetMaxNameLength(PKEY_OBJECT KeyObject) { PHASH_TABLE_CELL HashBlock; - PKEY_CELL CurSubKeyCell; - PKEY_CELL KeyCell; + PCM_KEY_NODE CurSubKeyCell; + PCM_KEY_NODE KeyCell; ULONG MaxName; ULONG NameSize; ULONG i; @@ -867,12 +867,12 @@ MaxName = 0; for (Storage = HvStable; Storage < HvMaxStorageType; Storage++) { - if (KeyCell->HashTableOffset[Storage] != HCELL_NULL) + if (KeyCell->SubKeyLists[Storage] != HCELL_NULL) { - HashBlock = HvGetCell (KeyObject->RegistryHive->Hive, KeyCell->HashTableOffset[Storage]); + HashBlock = HvGetCell (KeyObject->RegistryHive->Hive, KeyCell->SubKeyLists[Storage]); ASSERT(HashBlock->Id == REG_HASH_TABLE_CELL_ID); - for (i = 0; i < KeyCell->NumberOfSubKeys[Storage]; i++) + for (i = 0; i < KeyCell->SubKeyCounts[Storage]; i++) { CurSubKeyCell = HvGetCell (KeyObject->RegistryHive->Hive, HashBlock->Table[i].KeyOffset); @@ -895,8 +895,8 @@ CmiGetMaxClassLength(PKEY_OBJECT KeyObject) { PHASH_TABLE_CELL HashBlock; - PKEY_CELL CurSubKeyCell; - PKEY_CELL KeyCell; + PCM_KEY_NODE CurSubKeyCell; + PCM_KEY_NODE KeyCell; ULONG MaxClass; ULONG i; ULONG Storage; @@ -909,13 +909,13 @@ MaxClass = 0; for (Storage = HvStable; Storage < HvMaxStorageType; Storage++) { - if (KeyCell->HashTableOffset[Storage] != HCELL_NULL) + if (KeyCell->SubKeyLists[Storage] != HCELL_NULL) { HashBlock = HvGetCell (KeyObject->RegistryHive->Hive, - KeyCell->HashTableOffset[Storage]); + KeyCell->SubKeyLists[Storage]); ASSERT(HashBlock->Id == REG_HASH_TABLE_CELL_ID); - for (i = 0; i < KeyCell->NumberOfSubKeys[Storage]; i++) + for (i = 0; i < KeyCell->SubKeyCounts[Storage]; i++) { CurSubKeyCell = HvGetCell (KeyObject->RegistryHive->Hive, HashBlock->Table[i].KeyOffset); @@ -934,7 +934,7 @@ ULONG CmiGetMaxValueNameLength(PEREGISTRY_HIVE RegistryHive, - PKEY_CELL KeyCell) + PCM_KEY_NODE KeyCell) { PVALUE_LIST_CELL ValueListCell; PVALUE_CELL CurValueCell; @@ -944,16 +944,16 @@ VERIFY_KEY_CELL(KeyCell); - if (KeyCell->ValueListOffset == HCELL_NULL) + if (KeyCell->ValueList.List == HCELL_NULL) { return 0; } MaxValueName = 0; ValueListCell = HvGetCell (RegistryHive->Hive, - KeyCell->ValueListOffset); - - for (i = 0; i < KeyCell->NumberOfValues; i++) + KeyCell->ValueList.List); + + for (i = 0; i < KeyCell->ValueList.Count; i++) { CurValueCell = HvGetCell (RegistryHive->Hive, ValueListCell->ValueOffset[i]); @@ -982,7 +982,7 @@ ULONG CmiGetMaxValueDataLength(PEREGISTRY_HIVE RegistryHive, - PKEY_CELL KeyCell) + PCM_KEY_NODE KeyCell) { PVALUE_LIST_CELL ValueListCell; PVALUE_CELL CurValueCell; @@ -991,15 +991,15 @@ VERIFY_KEY_CELL(KeyCell); - if (KeyCell->ValueListOffset == HCELL_NULL) + if (KeyCell->ValueList.List == HCELL_NULL) { return 0; } MaxValueData = 0; - ValueListCell = HvGetCell (RegistryHive->Hive, KeyCell->ValueListOffset); - - for (i = 0; i < KeyCell->NumberOfValues; i++) + ValueListCell = HvGetCell (RegistryHive->Hive, KeyCell->ValueList.List); + + for (i = 0; i < KeyCell->ValueList.Count; i++) { CurValueCell = HvGetCell (RegistryHive->Hive, ValueListCell->ValueOffset[i]); @@ -1015,15 +1015,15 @@ NTSTATUS CmiScanForSubKey(IN PEREGISTRY_HIVE RegistryHive, - IN PKEY_CELL KeyCell, - OUT PKEY_CELL *SubKeyCell, + IN PCM_KEY_NODE KeyCell, + OUT PCM_KEY_NODE *SubKeyCell, OUT HCELL_INDEX *BlockOffset, IN PUNICODE_STRING KeyName, IN ACCESS_MASK DesiredAccess, IN ULONG Attributes) { PHASH_TABLE_CELL HashBlock; - PKEY_CELL CurSubKeyCell; + PCM_KEY_NODE CurSubKeyCell; ULONG Storage; ULONG i; @@ -1038,16 +1038,16 @@ for (Storage = HvStable; Storage < HvMaxStorageType; Storage++) { /* The key does not have any subkeys */ - if (KeyCell->HashTableOffset[Storage] == HCELL_NULL) + if (KeyCell->SubKeyLists[Storage] == HCELL_NULL) { continue; } /* Get hash table */ - HashBlock = HvGetCell (RegistryHive->Hive, KeyCell->HashTableOffset[Storage]); + HashBlock = HvGetCell (RegistryHive->Hive, KeyCell->SubKeyLists[Storage]); ASSERT(HashBlock->Id == REG_HASH_TABLE_CELL_ID); - for (i = 0; i < KeyCell->NumberOfSubKeys[Storage]; i++) + for (i = 0; i < KeyCell->SubKeyCounts[Storage]; i++) { if (Attributes & OBJ_CASE_INSENSITIVE) { @@ -1099,9 +1099,9 @@ { PHASH_TABLE_CELL HashBlock; HCELL_INDEX NKBOffset; - PKEY_CELL NewKeyCell; + PCM_KEY_NODE NewKeyCell; ULONG NewBlockSize; - PKEY_CELL ParentKeyCell; + PCM_KEY_NODE ParentKeyCell; PVOID ClassCell; NTSTATUS Status; USHORT NameSize; @@ -1148,7 +1148,7 @@ Status = STATUS_SUCCESS; Storage = (CreateOptions & REG_OPTION_VOLATILE) ? HvVolatile : HvStable; - NewBlockSize = sizeof(KEY_CELL) + NameSize; + NewBlockSize = sizeof(CM_KEY_NODE) + NameSize; NKBOffset = HvAllocateCell (RegistryHive->Hive, NewBlockSize, Storage); if (NKBOffset == HCELL_NULL) { @@ -1167,13 +1167,13 @@ NewKeyCell->Flags = 0; } KeQuerySystemTime(&NewKeyCell->LastWriteTime); - NewKeyCell->ParentKeyOffset = HCELL_NULL; - NewKeyCell->NumberOfSubKeys[HvStable] = 0; - NewKeyCell->NumberOfSubKeys[HvVolatile] = 0; - NewKeyCell->HashTableOffset[HvStable] = HCELL_NULL; - NewKeyCell->HashTableOffset[HvVolatile] = HCELL_NULL; - NewKeyCell->NumberOfValues = 0; - NewKeyCell->ValueListOffset = HCELL_NULL; + NewKeyCell->Parent = HCELL_NULL; + NewKeyCell->SubKeyCounts[HvStable] = 0; + NewKeyCell->SubKeyCounts[HvVolatile] = 0; + NewKeyCell->SubKeyLists[HvStable] = HCELL_NULL; + NewKeyCell->SubKeyLists[HvVolatile] = HCELL_NULL; + NewKeyCell->ValueList.Count = 0; + NewKeyCell->ValueList.List = HCELL_NULL; NewKeyCell->SecurityKeyOffset = HCELL_NULL; NewKeyCell->ClassNameOffset = HCELL_NULL; @@ -1218,11 +1218,11 @@ SubKey->KeyCell = NewKeyCell; SubKey->KeyCellOffset = NKBOffset; - if (ParentKeyCell->HashTableOffset[Storage] == HCELL_NULL) + if (ParentKeyCell->SubKeyLists[Storage] == HCELL_NULL) { Status = CmiAllocateHashTableCell (RegistryHive, &HashBlock, - &ParentKeyCell->HashTableOffset[Storage], + &ParentKeyCell->SubKeyLists[Storage], REG_INIT_HASH_TABLE_SIZE, Storage); if (!NT_SUCCESS(Status)) @@ -1233,10 +1233,10 @@ else { HashBlock = HvGetCell (RegistryHive->Hive, - ParentKeyCell->HashTableOffset[Storage]); + ParentKeyCell->SubKeyLists[Storage]); ASSERT(HashBlock->Id == REG_HASH_TABLE_CELL_ID); - if (((ParentKeyCell->NumberOfSubKeys[Storage] + 1) >= HashBlock->HashTableSize)) + if (((ParentKeyCell->SubKeyCounts[Storage] + 1) >= HashBlock->HashTableSize)) { PHASH_TABLE_CELL NewHashBlock; HCELL_INDEX HTOffset; @@ -1258,8 +1258,8 @@ RtlCopyMemory(&NewHashBlock->Table[0], &HashBlock->Table[0], sizeof(NewHashBlock->Table[0]) * HashBlock->HashTableSize); - HvFreeCell (RegistryHive->Hive, ParentKeyCell->HashTableOffset[Storage]); - ParentKeyCell->HashTableOffset[Storage] = HTOffset; + HvFreeCell (RegistryHive->Hive, ParentKeyCell->SubKeyLists[Storage]); + ParentKeyCell->SubKeyLists[Storage] = HTOffset; HashBlock = NewHashBlock; } } @@ -1272,7 +1272,7 @@ NKBOffset); if (NT_SUCCESS(Status)) { - ParentKeyCell->NumberOfSubKeys[Storage]++; + ParentKeyCell->SubKeyCounts[Storage]++; } KeQuerySystemTime (&ParentKeyCell->LastWriteTime); @@ -1298,13 +1298,13 @@ Storage = (SubKey->KeyCell->Flags & REG_KEY_VOLATILE_CELL) ? HvVolatile : HvStable; /* Remove all values */ - if (SubKey->KeyCell->NumberOfValues != 0) + if (SubKey->KeyCell->ValueList.Count != 0) { /* Get pointer to the value list cell */ - ValueList = HvGetCell (RegistryHive->Hive, SubKey->KeyCell->ValueListOffset); + ValueList = HvGetCell (RegistryHive->Hive, SubKey->KeyCell->ValueList.List); /* Enumerate all values */ - for (i = 0; i < SubKey->KeyCell->NumberOfValues; i++) + for (i = 0; i < SubKey->KeyCell->ValueList.Count; i++) { /* Get pointer to value cell */ ValueCell = HvGetCell(RegistryHive->Hive, @@ -1323,51 +1323,51 @@ } /* Destroy value list cell */ - HvFreeCell (RegistryHive->Hive, SubKey->KeyCell->ValueListOffset); - - SubKey->KeyCell->NumberOfValues = 0; - SubKey->KeyCell->ValueListOffset = (HCELL_INDEX)-1; + HvFreeCell (RegistryHive->Hive, SubKey->KeyCell->ValueList.List); + + SubKey->KeyCell->ValueList.Count = 0; + SubKey->KeyCell->ValueList.List = (HCELL_INDEX)-1; HvMarkCellDirty(RegistryHive->Hive, SubKey->KeyCellOffset); } /* Remove the key from the parent key's hash block */ - if (ParentKey->KeyCell->HashTableOffset[Storage] != HCELL_NULL) - { - DPRINT("ParentKey HashTableOffset %lx\n", ParentKey->KeyCell->HashTableOffset[Storage]); + if (ParentKey->KeyCell->SubKeyLists[Storage] != HCELL_NULL) + { + DPRINT("ParentKey SubKeyLists %lx\n", ParentKey->KeyCell->SubKeyLists[Storage]); HashBlock = HvGetCell (ParentKey->RegistryHive->Hive, - ParentKey->KeyCell->HashTableOffset[Storage]); + 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, - ParentKey->KeyCell->HashTableOffset[Storage]); + ParentKey->KeyCell->SubKeyLists[Storage]); } /* Remove the key's hash block */ - if (SubKey->KeyCell->HashTableOffset[Storage] != HCELL_NULL) - { - DPRINT("SubKey HashTableOffset %lx\n", SubKey->KeyCell->HashTableOffset[Storage]); - HvFreeCell (RegistryHive->Hive, SubKey->KeyCell->HashTableOffset[Storage]); - SubKey->KeyCell->HashTableOffset[Storage] = HCELL_NULL; + if (SubKey->KeyCell->SubKeyLists[Storage] != HCELL_NULL) + { + DPRINT("SubKey SubKeyLists %lx\n", SubKey->KeyCell->SubKeyLists[Storage]); + HvFreeCell (RegistryHive->Hive, SubKey->KeyCell->SubKeyLists[Storage]); + SubKey->KeyCell->SubKeyLists[Storage] = HCELL_NULL; } /* Decrement the number of the parent key's sub keys */ if (ParentKey != NULL) { DPRINT("ParentKey %p\n", ParentKey); - ParentKey->KeyCell->NumberOfSubKeys[Storage]--; + ParentKey->KeyCell->SubKeyCounts[Storage]--; /* Remove the parent key's hash table */ - if (ParentKey->KeyCell->NumberOfSubKeys[Storage] == 0 && - ParentKey->KeyCell->HashTableOffset[Storage] != HCELL_NULL) - { - DPRINT("ParentKey HashTableOffset %lx\n", ParentKey->KeyCell->HashTableOffset); + if (ParentKey->KeyCell->SubKeyCounts[Storage] == 0 && + ParentKey->KeyCell->SubKeyLists[Storage] != HCELL_NULL) + { + DPRINT("ParentKey SubKeyLists %lx\n", ParentKey->KeyCell->SubKeyLists); HvFreeCell (ParentKey->RegistryHive->Hive, - ParentKey->KeyCell->HashTableOffset[Storage]); - ParentKey->KeyCell->HashTableOffset[Storage] = HCELL_NULL; + ParentKey->KeyCell->SubKeyLists[Storage]); + ParentKey->KeyCell->SubKeyLists[Storage] = HCELL_NULL; } KeQuerySystemTime(&ParentKey->KeyCell->LastWriteTime); @@ -1388,7 +1388,7 @@ NTSTATUS CmiScanKeyForValue(IN PEREGISTRY_HIVE RegistryHive, - IN PKEY_CELL KeyCell, + IN PCM_KEY_NODE KeyCell, IN PUNICODE_STRING ValueName, OUT PVALUE_CELL *ValueCell, OUT HCELL_INDEX *ValueCellOffset) @@ -1402,16 +1402,16 @@ *ValueCellOffset = (HCELL_INDEX)-1; /* The key does not have any values */ - if (KeyCell->ValueListOffset == (HCELL_INDEX)-1) + if (KeyCell->ValueList.List == (HCELL_INDEX)-1) { return STATUS_OBJECT_NAME_NOT_FOUND; } - ValueListCell = HvGetCell (RegistryHive->Hive, KeyCell->ValueListOffset); + ValueListCell = HvGetCell (RegistryHive->Hive, KeyCell->ValueList.List); VERIFY_VALUE_LIST_CELL(ValueListCell); - for (i = 0; i < KeyCell->NumberOfValues; i++) + for (i = 0; i < KeyCell->ValueList.Count; i++) { CurValueCell = HvGetCell (RegistryHive->Hive, ValueListCell->ValueOffset[i]); @@ -1435,7 +1435,7 @@ NTSTATUS CmiGetValueFromKeyByIndex(IN PEREGISTRY_HIVE RegistryHive, - IN PKEY_CELL KeyCell, + IN PCM_KEY_NODE KeyCell, IN ULONG Index, OUT PVALUE_CELL *ValueCell) { @@ -1444,18 +1444,18 @@ *ValueCell = NULL; - if (KeyCell->ValueListOffset == (HCELL_INDEX)-1) + if (KeyCell->ValueList.List == (HCELL_INDEX)-1) { return STATUS_NO_MORE_ENTRIES; } - if (Index >= KeyCell->NumberOfValues) + if (Index >= KeyCell->ValueList.Count) { return STATUS_NO_MORE_ENTRIES; } - ValueListCell = HvGetCell (RegistryHive->Hive, KeyCell->ValueListOffset); + ValueListCell = HvGetCell (RegistryHive->Hive, KeyCell->ValueList.List); VERIFY_VALUE_LIST_CELL(ValueListCell); @@ -1469,7 +1469,7 @@ NTSTATUS CmiAddValueToKey(IN PEREGISTRY_HIVE RegistryHive, - IN PKEY_CELL KeyCell, + IN PCM_KEY_NODE KeyCell, IN HCELL_INDEX KeyCellOffset, IN PUNICODE_STRING ValueName, OUT PVALUE_CELL *pValueCell, @@ -1483,10 +1483,10 @@ HV_STORAGE_TYPE Storage; NTSTATUS Status; - DPRINT("KeyCell->ValuesOffset %lu\n", (ULONG)KeyCell->ValueListOffset); + DPRINT("KeyCell->ValuesOffset %lu\n", (ULONG)KeyCell->ValueList.List); Storage = (KeyCell->Flags & REG_KEY_VOLATILE_CELL) ? HvVolatile : HvStable; - if (KeyCell->ValueListOffset == HCELL_NULL) + if (KeyCell->ValueList.List == HCELL_NULL) { CellSize = sizeof(VALUE_LIST_CELL) + (3 * sizeof(HCELL_INDEX)); @@ -1497,33 +1497,33 @@ } ValueListCell = HvGetCell (RegistryHive->Hive, ValueListCellOffset); - KeyCell->ValueListOffset = ValueListCellOffset; + KeyCell->ValueList.List = ValueListCellOffset; HvMarkCellDirty(RegistryHive->Hive, KeyCellOffset); } else { - ValueListCell = (PVALUE_LIST_CELL) HvGetCell (RegistryHive->Hive, KeyCell->ValueListOffset); + ValueListCell = (PVALUE_LIST_CELL) HvGetCell (RegistryHive->Hive, KeyCell->ValueList.List); CellSize = ABS_VALUE(HvGetCellSize(RegistryHive->Hive, ValueListCell)); - if (KeyCell->NumberOfValues >= + if (KeyCell->ValueList.Count >= (CellSize / sizeof(HCELL_INDEX))) { CellSize *= 2; - ValueListCellOffset = HvReallocateCell (RegistryHive->Hive, KeyCell->ValueListOffset, CellSize); + ValueListCellOffset = HvReallocateCell (RegistryHive->Hive, KeyCell->ValueList.List, CellSize); if (ValueListCellOffset == HCELL_NULL) { return STATUS_INSUFFICIENT_RESOURCES; } ValueListCell = HvGetCell (RegistryHive->Hive, ValueListCellOffset); - KeyCell->ValueListOffset = ValueListCellOffset; + KeyCell->ValueList.List = ValueListCellOffset; HvMarkCellDirty (RegistryHive->Hive, KeyCellOffset); } } #if 0 - DPRINT("KeyCell->NumberOfValues %lu, ValueListCell->CellSize %lu (%lu %lx)\n", - KeyCell->NumberOfValues, + DPRINT("KeyCell->ValueList.Count %lu, ValueListCell->CellSize %lu (%lu %lx)\n", + KeyCell->ValueList.Count, (ULONG)ABS_VALUE(ValueListCell->CellSize), ((ULONG)ABS_VALUE(ValueListCell->CellSize) - sizeof(CELL_HEADER)) / sizeof(HCELL_INDEX), ((ULONG)ABS_VALUE(ValueListCell->CellSize) - sizeof(CELL_HEADER)) / sizeof(HCELL_INDEX)); @@ -1539,11 +1539,11 @@ return Status; } - ValueListCell->ValueOffset[KeyCell->NumberOfValues] = NewValueCellOffset; - KeyCell->NumberOfValues++; + ValueListCell->ValueOffset[KeyCell->ValueList.Count] = NewValueCellOffset; + KeyCell->ValueList.Count++; HvMarkCellDirty(RegistryHive->Hive, KeyCellOffset); - HvMarkCellDirty(RegistryHive->Hive, KeyCell->ValueListOffset); + HvMarkCellDirty(RegistryHive->Hive, KeyCell->ValueList.List); HvMarkCellDirty(RegistryHive->Hive, NewValueCellOffset); *pValueCell = NewValueCell; @@ -1555,7 +1555,7 @@ NTSTATUS CmiDeleteValueFromKey(IN PEREGISTRY_HIVE RegistryHive, - IN PKEY_CELL KeyCell, + IN PCM_KEY_NODE KeyCell, IN HCELL_INDEX KeyCellOffset, IN PUNICODE_STRING ValueName) { @@ -1564,16 +1564,16 @@ ULONG i; NTSTATUS Status; - if (KeyCell->ValueListOffset == -1) + if (KeyCell->ValueList.List == -1) { return STATUS_OBJECT_NAME_NOT_FOUND; } - ValueListCell = HvGetCell (RegistryHive->Hive, KeyCell->ValueListOffset); + ValueListCell = HvGetCell (RegistryHive->Hive, KeyCell->ValueList.List); VERIFY_VALUE_LIST_CELL(ValueListCell); - for (i = 0; i < KeyCell->NumberOfValues; i++) + for (i = 0; i < KeyCell->ValueList.Count; i++) { CurValueCell = HvGetCell (RegistryHive->Hive, ValueListCell->ValueOffset[i]); @@ -1591,26 +1591,26 @@ return Status; } - if (i < (KeyCell->NumberOfValues - 1)) + if (i < (KeyCell->ValueList.Count - 1)) { RtlMoveMemory(&ValueListCell->ValueOffset[i], &ValueListCell->ValueOffset[i + 1], - sizeof(HCELL_INDEX) * (KeyCell->NumberOfValues - 1 - i)); + sizeof(HCELL_INDEX) * (KeyCell->ValueList.Count - 1 - i)); } - ValueListCell->ValueOffset[KeyCell->NumberOfValues - 1] = 0; - - - KeyCell->NumberOfValues--; - - if (KeyCell->NumberOfValues == 0) + ValueListCell->ValueOffset[KeyCell->ValueList.Count - 1] = 0; + + + KeyCell->ValueList.Count--; + + if (KeyCell->ValueList.Count == 0) { - HvFreeCell(RegistryHive->Hive, KeyCell->ValueListOffset); - KeyCell->ValueListOffset = -1; + HvFreeCell(RegistryHive->Hive, KeyCell->ValueList.List); + KeyCell->ValueList.List = -1; } else { HvMarkCellDirty(RegistryHive->Hive, - KeyCell->ValueListOffset); + KeyCell->ValueList.List); } HvMarkCellDirty(RegistryHive->Hive, @@ -1660,13 +1660,13 @@ } -PKEY_CELL +PCM_KEY_NODE CmiGetKeyFromHashByIndex(PEREGISTRY_HIVE RegistryHive, PHASH_TABLE_CELL HashBlock, ULONG Index) { HCELL_INDEX KeyOffset; - PKEY_CELL KeyCell; + PCM_KEY_NODE KeyCell; KeyOffset = HashBlock->Table[Index].KeyOffset; KeyCell = HvGetCell (RegistryHive->Hive, KeyOffset); @@ -1678,12 +1678,12 @@ NTSTATUS CmiAddKeyToHashTable(PEREGISTRY_HIVE RegistryHive, PHASH_TABLE_CELL HashCell, - PKEY_CELL KeyCell, + PCM_KEY_NODE KeyCell, HV_STORAGE_TYPE StorageType, - PKEY_CELL NewKeyCell, + PCM_KEY_NODE NewKeyCell, HCELL_INDEX NKBOffset) { - ULONG i = KeyCell->NumberOfSubKeys[StorageType]; + ULONG i = KeyCell->SubKeyCounts[StorageType]; HashCell->Table[i].KeyOffset = NKBOffset; HashCell->Table[i].HashValue = 0; @@ -1693,7 +1693,7 @@ NewKeyCell->Name, min(NewKeyCell->NameSize, sizeof(ULONG))); } - HvMarkCellDirty(RegistryHive->Hive, KeyCell->HashTableOffset[StorageType]); + HvMarkCellDirty(RegistryHive->Hive, KeyCell->SubKeyLists[StorageType]); return STATUS_SUCCESS; } @@ -1907,7 +1907,7 @@ BOOLEAN CmiCompareKeyNames(PUNICODE_STRING KeyName, - PKEY_CELL KeyCell) + PCM_KEY_NODE KeyCell) { PWCHAR UnicodeName; USHORT i; @@ -1944,7 +1944,7 @@ BOOLEAN CmiCompareKeyNamesI(PUNICODE_STRING KeyName, - PKEY_CELL KeyCell) + PCM_KEY_NODE KeyCell) { PWCHAR UnicodeName; USHORT i; @@ -1983,11 +1983,11 @@ NTSTATUS CmiCopyKey (PEREGISTRY_HIVE DstHive, - PKEY_CELL DstKeyCell, + PCM_KEY_NODE DstKeyCell, PEREGISTRY_HIVE SrcHive, - PKEY_CELL SrcKeyCell) -{ - PKEY_CELL NewKeyCell; + PCM_KEY_NODE SrcKeyCell) +{ + PCM_KEY_NODE NewKeyCell; ULONG NewKeyCellSize; HCELL_INDEX NewKeyCellOffset; PHASH_TABLE_CELL NewHashTableCell; @@ -2001,7 +2001,7 @@ if (DstKeyCell == NULL) { /* Allocate and copy key cell */ - NewKeyCellSize = sizeof(KEY_CELL) + SrcKeyCell->NameSize; + NewKeyCellSize = sizeof(CM_KEY_NODE) + SrcKeyCell->NameSize; NewKeyCellOffset = HvAllocateCell (DstHive->Hive, NewKeyCellSize, HvStable); if (NewKeyCellOffset == HCELL_NULL) { @@ -2046,9 +2046,9 @@ } /* Allocate hash table */ - if (SrcKeyCell->NumberOfSubKeys[HvStable] > 0) - { - NewHashTableSize = ROUND_UP(SrcKeyCell->NumberOfSubKeys[HvStable] + 1, 4) - 1; + if (SrcKeyCell->SubKeyCounts[HvStable] > 0) + { + NewHashTableSize = ROUND_UP(SrcKeyCell->SubKeyCounts[HvStable] + 1, 4) - 1; Status = CmiAllocateHashTableCell (DstHive, &NewHashTableCell, &NewHashTableOffset, @@ -2059,7 +2059,7 @@ DPRINT1 ("CmiAllocateHashTableBlock() failed (Status %lx)\n", Status); return Status; } - NewKeyCell->HashTableOffset[HvStable] = NewHashTableOffset; + NewKeyCell->SubKeyLists[HvStable] = NewHashTableOffset; } else { @@ -2067,7 +2067,7 @@ } /* Allocate and copy value list and values */ - if (SrcKeyCell->NumberOfValues != 0) + if (SrcKeyCell->ValueList.Count != 0) { PVALUE_LIST_CELL NewValueListCell; PVALUE_LIST_CELL SrcValueListCell; @@ -2082,24 +2082,24 @@ NewValueListCellSize = - ROUND_UP(SrcKeyCell->NumberOfValues, 4) * sizeof(HCELL_INDEX); - NewKeyCell->ValueListOffset = HvAllocateCell (DstHive->Hive, + ROUND_UP(SrcKeyCell->ValueList.Count, 4) * sizeof(HCELL_INDEX); + NewKeyCell->ValueList.List = HvAllocateCell (DstHive->Hive, NewValueListCellSize, HvStable); - if (NewKeyCell->ValueListOffset == HCELL_NULL) + if (NewKeyCell->ValueList.List == HCELL_NULL) { DPRINT1 ("HvAllocateCell() failed\n"); return STATUS_INSUFFICIENT_RESOURCES; } - DPRINT1("KeyCell->ValueListOffset: %x\n", NewKeyCell->ValueListOffset); - - NewValueListCell = HvGetCell (DstHive->Hive, NewKeyCell->ValueListOffset); + DPRINT1("KeyCell->ValueList.List: %x\n", NewKeyCell->ValueList.List); + + NewValueListCell = HvGetCell (DstHive->Hive, NewKeyCell->ValueList.List); RtlZeroMemory (NewValueListCell, NewValueListCellSize); /* Copy values */ - SrcValueListCell = HvGetCell (SrcHive->Hive, SrcKeyCell->ValueListOffset); - for (i = 0; i < SrcKeyCell->NumberOfValues; i++) + 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]); @@ -2139,24 +2139,24 @@ } /* Copy subkeys */ - if (SrcKeyCell->NumberOfSubKeys[HvStable] > 0) + if (SrcKeyCell->SubKeyCounts[HvStable] > 0) { PHASH_TABLE_CELL SrcHashTableCell; - PKEY_CELL SrcSubKeyCell; - PKEY_CELL NewSubKeyCell; + PCM_KEY_NODE SrcSubKeyCell; + PCM_KEY_NODE NewSubKeyCell; ULONG NewSubKeyCellSize; HCELL_INDEX NewSubKeyCellOffset; PHASH_RECORD SrcHashRecord; - SrcHashTableCell = HvGetCell (SrcHive->Hive, SrcKeyCell->HashTableOffset[HvStable]); - - for (i = 0; i < SrcKeyCell->NumberOfSubKeys[HvStable]; i++) + 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); /* Allocate and copy key cell */ - NewSubKeyCellSize = sizeof(KEY_CELL) + SrcSubKeyCell->NameSize; + NewSubKeyCellSize = sizeof(CM_KEY_NODE) + SrcSubKeyCell->NameSize; NewSubKeyCellOffset = HvAllocateCell (DstHive->Hive, NewSubKeyCellSize, HvStable); if (NewSubKeyCellOffset == HCELL_NULL) { 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 15:57:47 2006 @@ -255,7 +255,7 @@ RootKey->KeyCell = HvGetCell (CmiVolatileHive->Hive, RootKey->KeyCellOffset); RootKey->ParentKey = RootKey; RootKey->Flags = 0; - RootKey->NumberOfSubKeys = 0; + RootKey->SubKeyCounts = 0; RootKey->SubKeys = NULL; RootKey->SizeOfSubKeys = 0; InsertTailList(&CmiKeyObjectListHead, &RootKey->ListEntry); @@ -608,7 +608,7 @@ NULL); DPRINT("Status %x\n", Status); NewKey->Flags = 0; - NewKey->NumberOfSubKeys = 0; + NewKey->SubKeyCounts = 0; NewKey->SubKeys = NULL; NewKey->SizeOfSubKeys = 0; InsertTailList(&CmiKeyObjectListHead, &NewKey->ListEntry); 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 15:57:47 2006 @@ -23,7 +23,7 @@ static NTSTATUS CmiGetLinkTarget(PEREGISTRY_HIVE RegistryHive, - PKEY_CELL KeyCell, + PCM_KEY_NODE KeyCell, PUNICODE_STRING TargetPath); /* FUNCTONS *****************************************************************/ @@ -240,7 +240,7 @@ HCELL_INDEX BlockOffset; PKEY_OBJECT FoundObject; PKEY_OBJECT ParsedKey; - PKEY_CELL SubKeyCell; + PCM_KEY_NODE SubKeyCell; NTSTATUS Status; PWSTR StartPtr; PWSTR EndPtr; @@ -523,7 +523,7 @@ ObDereferenceObject (ParentKeyObject); - if (KeyObject->NumberOfSubKeys) + if (KeyObject->SubKeyCounts) { KEBUGCHECK(REGISTRY_ERROR); } @@ -766,28 +766,28 @@ DPRINT("ParentKey %.08x\n", ParentKey); - if (ParentKey->SizeOfSubKeys <= ParentKey->NumberOfSubKeys) + if (ParentKey->SizeOfSubKeys <= ParentKey->SubKeyCounts) { PKEY_OBJECT *tmpSubKeys = ExAllocatePool(NonPagedPool, - (ParentKey->NumberOfSubKeys + 1) * sizeof(ULONG)); - - if (ParentKey->NumberOfSubKeys > 0) + (ParentKey->SubKeyCounts + 1) * sizeof(ULONG)); + + if (ParentKey->SubKeyCounts > 0) { RtlCopyMemory (tmpSubKeys, ParentKey->SubKeys, - ParentKey->NumberOfSubKeys * sizeof(ULONG)); + ParentKey->SubKeyCounts * sizeof(ULONG)); } if (ParentKey->SubKeys) ExFreePool(ParentKey->SubKeys); ParentKey->SubKeys = tmpSubKeys; - ParentKey->SizeOfSubKeys = ParentKey->NumberOfSubKeys + 1; + ParentKey->SizeOfSubKeys = ParentKey->SubKeyCounts + 1; } /* FIXME: Please maintain the list in alphabetic order */ /* to allow a dichotomic search */ - ParentKey->SubKeys[ParentKey->NumberOfSubKeys++] = NewKey; + ParentKey->SubKeys[ParentKey->SubKeyCounts++] = NewKey; DPRINT("Reference parent key: 0x%p\n", ParentKey); @@ -807,15 +807,15 @@ ParentKey = KeyToRemove->ParentKey; /* FIXME: If list maintained in alphabetic order, use dichotomic search */ - for (Index = 0; Index < ParentKey->NumberOfSubKeys; Index++) + for (Index = 0; Index < ParentKey->SubKeyCounts; Index++) { if (ParentKey->SubKeys[Index] == KeyToRemove) { - if (Index < ParentKey->NumberOfSubKeys-1) + if (Index < ParentKey->SubKeyCounts-1) RtlMoveMemory(&ParentKey->SubKeys[Index], &ParentKey->SubKeys[Index + 1], - (ParentKey->NumberOfSubKeys - Index - 1) * sizeof(PKEY_OBJECT)); - ParentKey->NumberOfSubKeys--; + (ParentKey->SubKeyCounts - Index - 1) * sizeof(PKEY_OBJECT)); + ParentKey->SubKeyCounts--; DPRINT("Dereference parent key: 0x%x\n", ParentKey); @@ -841,7 +841,7 @@ KeyName, &Parent->Name); /* FIXME: if list maintained in alphabetic order, use dichotomic search */ - for (Index=0; Index < Parent->NumberOfSubKeys; Index++) + for (Index=0; Index < Parent->SubKeyCounts; Index++) { CurKey = Parent->SubKeys[Index]; if (Attributes & OBJ_CASE_INSENSITIVE) @@ -863,7 +863,7 @@ } } - if (Index < Parent->NumberOfSubKeys) + if (Index < Parent->SubKeyCounts) { if (CurKey->Flags & KO_MARKED_FOR_DELETE) { @@ -884,7 +884,7 @@ static NTSTATUS CmiGetLinkTarget(PEREGISTRY_HIVE RegistryHive, - PKEY_CELL KeyCell, + PCM_KEY_NODE KeyCell, PUNICODE_STRING TargetPath) { UNICODE_STRING LinkName = RTL_CONSTANT_STRING(L"SymbolicLinkValue");
18 years, 4 months
1
0
0
0
[ion] 23572: - Start using some NT structures (need to get rid of "Opaque").
by ion@svn.reactos.org
Author: ion Date: Mon Aug 14 15:35:48 2006 New Revision: 23572 URL:
http://svn.reactos.org/svn/reactos?rev=23572&view=rev
Log: - Start using some NT structures (need to get rid of "Opaque"). Modified: trunk/reactos/boot/bootdata/txtsetup.sif trunk/reactos/boot/freeldr/freeldr/reactos/binhive.c trunk/reactos/lib/cmlib/cmdata.h trunk/reactos/lib/cmlib/cminit.c trunk/reactos/lib/cmlib/cmlib.h trunk/reactos/lib/cmlib/hivebin.c trunk/reactos/lib/cmlib/hivecell.c trunk/reactos/lib/cmlib/hivedata.h trunk/reactos/lib/cmlib/hiveinit.c trunk/reactos/lib/cmlib/hivesum.c trunk/reactos/lib/cmlib/hivewrt.c trunk/reactos/ntoskrnl/cm/cm.h trunk/reactos/ntoskrnl/cm/regfile.c Modified: trunk/reactos/boot/bootdata/txtsetup.sif URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/bootdata/txtsetup.sif…
============================================================================== --- trunk/reactos/boot/bootdata/txtsetup.sif (original) +++ trunk/reactos/boot/bootdata/txtsetup.sif Mon Aug 14 15:35:48 2006 @@ -37,8 +37,8 @@ [SetupData] DefaultPath = \ReactOS -OsLoadOptions = "/NOGUIBOOT /NODEBUG" -;OsLoadOptions = "/NOGUIBOOT /DEBUGPORT=COM1 /BAUDRATE=19200 /IRQ=4" +;OsLoadOptions = "/NOGUIBOOT /NODEBUG" +OsLoadOptions = "/NOGUIBOOT /DEBUGPORT=COM1 /BAUDRATE=19200 /IRQ=4" ;OsLoadOptions = "/NOGUIBOOT /DEBUGPORT=SCREEN" ;OsLoadOptions = "/NOGUIBOOT /DEBUGPORT=BOCHS" 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 15:35:48 2006 @@ -42,7 +42,7 @@ static BOOLEAN -CmiAllocateHashTableCell (PREGISTRY_HIVE Hive, +CmiAllocateHashTableCell (PHHIVE Hive, PHCELL_INDEX HBOffset, ULONG SubKeyCount) { @@ -66,7 +66,7 @@ static BOOLEAN -CmiAddKeyToParentHashTable (PREGISTRY_HIVE Hive, +CmiAddKeyToParentHashTable (PHHIVE Hive, HCELL_INDEX ParentKeyOffset, PKEY_CELL NewKeyCell, HCELL_INDEX NKBOffset) @@ -96,7 +96,7 @@ static BOOLEAN -CmiAllocateValueListCell (PREGISTRY_HIVE Hive, +CmiAllocateValueListCell (PHHIVE Hive, PHCELL_INDEX ValueListOffset, ULONG ValueCount) { @@ -116,7 +116,7 @@ static BOOLEAN -CmiAllocateValueCell(PREGISTRY_HIVE Hive, +CmiAllocateValueCell(PHHIVE Hive, PVALUE_CELL *ValueCell, HCELL_INDEX *ValueCellOffset, PWCHAR ValueName) @@ -175,7 +175,7 @@ static BOOLEAN -CmiAddValueToKeyValueList(PREGISTRY_HIVE Hive, +CmiAddValueToKeyValueList(PHHIVE Hive, HCELL_INDEX KeyCellOffset, HCELL_INDEX ValueCellOffset) { @@ -203,7 +203,7 @@ } static BOOLEAN -CmiExportValue (PREGISTRY_HIVE Hive, +CmiExportValue (PHHIVE Hive, HCELL_INDEX KeyCellOffset, FRLDRHKEY Key, PVALUE Value) @@ -277,7 +277,7 @@ static BOOLEAN -CmiExportSubKey (PREGISTRY_HIVE Hive, +CmiExportSubKey (PHHIVE Hive, HCELL_INDEX ParentKeyOffset, FRLDRHKEY ParentKey, FRLDRHKEY Key) @@ -427,7 +427,7 @@ static BOOLEAN -CmiExportHive (PREGISTRY_HIVE Hive, +CmiExportHive (PHHIVE Hive, PCWSTR KeyName) { PKEY_CELL KeyCell; @@ -520,7 +520,7 @@ static BOOLEAN -RegImportValue (PREGISTRY_HIVE Hive, +RegImportValue (PHHIVE Hive, PVALUE_CELL ValueCell, FRLDRHKEY Key) { @@ -599,7 +599,7 @@ static BOOLEAN -RegImportSubKey(PREGISTRY_HIVE Hive, +RegImportSubKey(PHHIVE Hive, PKEY_CELL KeyCell, FRLDRHKEY ParentKey) { @@ -707,7 +707,7 @@ FRLDRHKEY SystemKey; ULONG i; LONG Error; - PREGISTRY_HIVE Hive; + PHHIVE Hive; NTSTATUS Status; DbgPrint((DPRINT_REGISTRY, "RegImportBinaryHive(%x, %u) called\n",ChunkBase,ChunkSize)); @@ -769,7 +769,7 @@ static VOID -CmiWriteHive(PREGISTRY_HIVE Hive, +CmiWriteHive(PHHIVE Hive, PCHAR ChunkBase, ULONG* ChunkSize) { @@ -781,11 +781,11 @@ Size = HV_BLOCK_SIZE; Bin = NULL; - for (i = 0; i < Hive->Storage[HvStable].BlockListSize; i++) - { - if (Hive->Storage[HvStable].BlockList[i].Bin != Bin) - { - Bin = Hive->Storage[HvStable].BlockList[i].Bin; + for (i = 0; i < Hive->Storage[HvStable].Length; i++) + { + if (Hive->Storage[HvStable].BlockList[i].Bin != (ULONG_PTR)Bin) + { + Bin = (PHBIN)Hive->Storage[HvStable].BlockList[i].Bin; memcpy (ChunkBase + (i + 1) * HV_BLOCK_SIZE, Bin, Bin->BinSize); Size += Bin->BinSize; @@ -803,7 +803,7 @@ PCHAR ChunkBase, ULONG* ChunkSize) { - PREGISTRY_HIVE Hive; + PHHIVE Hive; NTSTATUS Status; DbgPrint((DPRINT_REGISTRY, "Creating binary hardware hive\n")); Modified: trunk/reactos/lib/cmlib/cmdata.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/cmlib/cmdata.h?rev=235…
============================================================================== --- trunk/reactos/lib/cmlib/cmdata.h (original) +++ trunk/reactos/lib/cmlib/cmdata.h Mon Aug 14 15:35:48 2006 @@ -20,6 +20,17 @@ #include <pshpack1.h> +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; + typedef struct _KEY_CELL { /* Key cell identifier "kn" (0x6b6e) */ @@ -34,25 +45,25 @@ /* ? */ ULONG UnUsed1; - /* Block offset of parent key cell */ + /* BlockAddress offset of parent key cell */ HCELL_INDEX ParentKeyOffset; /* Count of sub keys for the key in this key cell (stable & volatile) */ ULONG NumberOfSubKeys[HvMaxStorageType]; - /* Block offset of has table for FIXME: subkeys/values? (stable & volatile) */ + /* BlockAddress offset of has table for FIXME: subkeys/values? (stable & volatile) */ HCELL_INDEX HashTableOffset[HvMaxStorageType]; /* Count of values contained in this key cell */ ULONG NumberOfValues; - /* Block offset of VALUE_LIST_CELL */ + /* BlockAddress offset of VALUE_LIST_CELL */ HCELL_INDEX ValueListOffset; - /* Block offset of security cell */ + /* BlockAddress offset of security cell */ HCELL_INDEX SecurityKeyOffset; - /* Block offset of registry key class */ + /* BlockAddress offset of registry key class */ HCELL_INDEX ClassNameOffset; /* ? */ Modified: trunk/reactos/lib/cmlib/cminit.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/cmlib/cminit.c?rev=235…
============================================================================== --- trunk/reactos/lib/cmlib/cminit.c (original) +++ trunk/reactos/lib/cmlib/cminit.c Mon Aug 14 15:35:48 2006 @@ -9,7 +9,7 @@ BOOLEAN CMAPI CmCreateRootNode( - PREGISTRY_HIVE Hive, + PHHIVE Hive, PCWSTR Name) { PKEY_CELL KeyCell; @@ -46,7 +46,7 @@ static VOID CMAPI CmpPrepareKey( - PREGISTRY_HIVE RegistryHive, + PHHIVE RegistryHive, PKEY_CELL KeyCell) { PKEY_CELL SubKeyCell; @@ -73,7 +73,7 @@ VOID CMAPI CmPrepareHive( - PREGISTRY_HIVE RegistryHive) + PHHIVE RegistryHive) { PKEY_CELL RootCell; 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 15:35:48 2006 @@ -19,65 +19,104 @@ #define CMAPI -typedef struct _BLOCK_LIST_ENTRY -{ - PHBIN Bin; - PVOID Block; -} BLOCK_LIST_ENTRY, *PBLOCK_LIST_ENTRY; - -struct _REGISTRY_HIVE; - -typedef PVOID (CMAPI *PHV_ALLOCATE)( +struct _HHIVE; + +typedef PVOID (CMAPI *PGET_CELL_ROUTINE)( + struct _HHIVE *Hive, + HCELL_INDEX Cell); + +typedef VOID (CMAPI *PRELEASE_CELL_ROUTINE)( + struct _HHIVE *Hive, + HCELL_INDEX Cell); + +typedef PVOID (CMAPI *PALLOCATE_ROUTINE)( ULONG Size, BOOLEAN Paged); -typedef VOID (CMAPI *PHV_FREE)( +typedef VOID (CMAPI *PFREE_ROUTINE)( PVOID Ptr); -typedef BOOLEAN (CMAPI *PHV_FILE_READ)( - struct _REGISTRY_HIVE *RegistryHive, +typedef BOOLEAN (CMAPI *PFILE_READ_ROUTINE)( + struct _HHIVE *RegistryHive, ULONG FileType, ULONG FileOffset, PVOID Buffer, ULONG BufferLength); -typedef BOOLEAN (CMAPI *PHV_FILE_WRITE)( - struct _REGISTRY_HIVE *RegistryHive, +typedef BOOLEAN (CMAPI *PFILE_WRITE_ROUTINE)( + struct _HHIVE *RegistryHive, ULONG FileType, ULONG FileOffset, PVOID Buffer, ULONG BufferLength); -typedef BOOLEAN (CMAPI *PHV_FILE_SET_SIZE)( - struct _REGISTRY_HIVE *RegistryHive, +typedef BOOLEAN (CMAPI *PFILE_SET_SIZE_ROUTINE)( + struct _HHIVE *RegistryHive, ULONG FileType, ULONG FileSize); -typedef BOOLEAN (CMAPI *PHV_FILE_FLUSH)( - struct _REGISTRY_HIVE *RegistryHive, +typedef BOOLEAN (CMAPI *PFILE_FLUSH_ROUTINE)( + struct _HHIVE *RegistryHive, ULONG FileType); -typedef struct _REGISTRY_HIVE -{ - PHIVE_HEADER HiveHeader; - BOOLEAN ReadOnly; - BOOLEAN Flat; - RTL_BITMAP DirtyBitmap; - struct - { - ULONG BlockListSize; - PBLOCK_LIST_ENTRY BlockList; - HCELL_INDEX FreeListOffset[24]; - } Storage[HvMaxStorageType]; - - PHV_ALLOCATE Allocate; - PHV_FREE Free; - PHV_FILE_READ FileRead; - PHV_FILE_WRITE FileWrite; - PHV_FILE_SET_SIZE FileSetSize; - PHV_FILE_FLUSH FileFlush; - PVOID Opaque; -} REGISTRY_HIVE, *PREGISTRY_HIVE; +typedef struct _HMAP_ENTRY +{ + ULONG_PTR Bin; + ULONG_PTR Block; + PCM_VIEW_OF_FILE CmHive; + ULONG MemAlloc; +} HMAP_ENTRY, *PHMAP_ENTRY; + +typedef struct _HMAP_TABLE +{ + HMAP_ENTRY Table[512]; +} HMAP_TABLE, *PHMAP_TABLE; + +typedef struct _HMAP_DIRECTORY +{ + PHMAP_TABLE Directory[2048]; +} HMAP_DIRECTORY, *PHMAP_DIRECTORY; + +typedef struct _DUAL +{ + ULONG Length; + PHMAP_DIRECTORY Map; + PHMAP_ENTRY BlockList; // PHMAP_TABLE SmallDir; + ULONG Guard; + HCELL_INDEX FreeDisplay[24]; //FREE_DISPLAY FreeDisplay[24]; + ULONG FreeSummary; + LIST_ENTRY FreeBins; +} DUAL, *PDUAL; + +typedef struct _HHIVE +{ + ULONG Signature; + PGET_CELL_ROUTINE GetCellRoutine; + PRELEASE_CELL_ROUTINE ReleaseCellRoutine; + PALLOCATE_ROUTINE Allocate; + PFREE_ROUTINE Free; + PFILE_READ_ROUTINE FileRead; + PFILE_WRITE_ROUTINE FileWrite; + PFILE_SET_SIZE_ROUTINE FileSetSize; + PFILE_FLUSH_ROUTINE FileFlush; + PHBASE_BLOCK HiveHeader; + RTL_BITMAP DirtyVector; + ULONG DirtyCount; + ULONG DirtyAlloc; + ULONG BaseBlockAlloc; + ULONG Cluster; + BOOLEAN Flat; + BOOLEAN ReadOnly; + BOOLEAN Log; + BOOLEAN DirtyFlag; + ULONG HiveFlags; + ULONG LogSize; + ULONG RefreshCount; + ULONG StorageTypeCount; + ULONG Version; + DUAL Storage[HvMaxStorageType]; + PVOID Opaque; // FIXME: KILL! +} HHIVE, *PHHIVE; /* * Public functions. @@ -89,70 +128,70 @@ NTSTATUS CMAPI HvInitialize( - PREGISTRY_HIVE *RegistryHive, + PHHIVE *RegistryHive, ULONG Operation, ULONG_PTR ChunkBase, SIZE_T ChunkSize, - PHV_ALLOCATE Allocate, - PHV_FREE Free, - PHV_FILE_READ FileRead, - PHV_FILE_WRITE FileWrite, - PHV_FILE_SET_SIZE FileSetSize, - PHV_FILE_FLUSH FileFlush, + PALLOCATE_ROUTINE Allocate, + PFREE_ROUTINE Free, + PFILE_READ_ROUTINE FileRead, + PFILE_WRITE_ROUTINE FileWrite, + PFILE_SET_SIZE_ROUTINE FileSetSize, + PFILE_FLUSH_ROUTINE FileFlush, PVOID Opaque); VOID CMAPI HvFree( - PREGISTRY_HIVE RegistryHive); + PHHIVE RegistryHive); PVOID CMAPI HvGetCell( - PREGISTRY_HIVE RegistryHive, + PHHIVE RegistryHive, HCELL_INDEX CellOffset); LONG CMAPI HvGetCellSize( - PREGISTRY_HIVE RegistryHive, + PHHIVE RegistryHive, PVOID Cell); HCELL_INDEX CMAPI HvAllocateCell( - PREGISTRY_HIVE RegistryHive, + PHHIVE RegistryHive, ULONG Size, HV_STORAGE_TYPE Storage); HCELL_INDEX CMAPI HvReallocateCell( - PREGISTRY_HIVE RegistryHive, + PHHIVE RegistryHive, HCELL_INDEX CellOffset, ULONG Size); VOID CMAPI HvFreeCell( - PREGISTRY_HIVE RegistryHive, + PHHIVE RegistryHive, HCELL_INDEX CellOffset); VOID CMAPI HvMarkCellDirty( - PREGISTRY_HIVE RegistryHive, + PHHIVE RegistryHive, HCELL_INDEX CellOffset); BOOLEAN CMAPI HvSyncHive( - PREGISTRY_HIVE RegistryHive); + PHHIVE RegistryHive); BOOLEAN CMAPI HvWriteHive( - PREGISTRY_HIVE RegistryHive); + PHHIVE RegistryHive); BOOLEAN CMAPI CmCreateRootNode( - PREGISTRY_HIVE Hive, + PHHIVE Hive, PCWSTR Name); VOID CMAPI CmPrepareHive( - PREGISTRY_HIVE RegistryHive); + PHHIVE RegistryHive); /* * Private functions. @@ -160,16 +199,16 @@ PHBIN CMAPI HvpAddBin( - PREGISTRY_HIVE RegistryHive, + PHHIVE RegistryHive, ULONG Size, HV_STORAGE_TYPE Storage); NTSTATUS CMAPI HvpCreateHiveFreeCellList( - PREGISTRY_HIVE Hive); + PHHIVE Hive); ULONG CMAPI HvpHiveHeaderChecksum( - PHIVE_HEADER HiveHeader); + PHBASE_BLOCK HiveHeader); #endif /* CMLIB_H */ Modified: trunk/reactos/lib/cmlib/hivebin.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/cmlib/hivebin.c?rev=23…
============================================================================== --- trunk/reactos/lib/cmlib/hivebin.c (original) +++ trunk/reactos/lib/cmlib/hivebin.c Mon Aug 14 15:35:48 2006 @@ -10,11 +10,11 @@ PHBIN CMAPI HvpAddBin( - PREGISTRY_HIVE RegistryHive, + PHHIVE RegistryHive, ULONG Size, HV_STORAGE_TYPE Storage) { - PBLOCK_LIST_ENTRY BlockList; + PHMAP_ENTRY BlockList; PHBIN Bin; ULONG BinSize; ULONG i; @@ -32,13 +32,13 @@ RtlZeroMemory(Bin, sizeof(HBIN)); Bin->Signature = HV_BIN_SIGNATURE; - Bin->BinOffset = RegistryHive->Storage[Storage].BlockListSize * + Bin->BinOffset = RegistryHive->Storage[Storage].Length * HV_BLOCK_SIZE; Bin->BinSize = BinSize; /* Allocate new block list */ - OldBlockListSize = RegistryHive->Storage[Storage].BlockListSize; - BlockList = RegistryHive->Allocate(sizeof(BLOCK_LIST_ENTRY) * + OldBlockListSize = RegistryHive->Storage[Storage].Length; + BlockList = RegistryHive->Allocate(sizeof(HMAP_ENTRY) * (OldBlockListSize + BlockCount), TRUE); if (BlockList == NULL) { @@ -49,18 +49,18 @@ if (OldBlockListSize > 0) { RtlCopyMemory(BlockList, RegistryHive->Storage[Storage].BlockList, - OldBlockListSize * sizeof(BLOCK_LIST_ENTRY)); + OldBlockListSize * sizeof(HMAP_ENTRY)); RegistryHive->Free(RegistryHive->Storage[Storage].BlockList); } RegistryHive->Storage[Storage].BlockList = BlockList; - RegistryHive->Storage[Storage].BlockListSize += BlockCount; + RegistryHive->Storage[Storage].Length += BlockCount; for (i = 0; i < BlockCount; i++) { RegistryHive->Storage[Storage].BlockList[OldBlockListSize + i].Block = - (PVOID)((ULONG_PTR)Bin + (i * HV_BLOCK_SIZE)); - RegistryHive->Storage[Storage].BlockList[OldBlockListSize + i].Bin = Bin; + ((ULONG_PTR)Bin + (i * HV_BLOCK_SIZE)); + RegistryHive->Storage[Storage].BlockList[OldBlockListSize + i].Bin = (ULONG_PTR)Bin; } /* Initialize a free block in this heap. */ @@ -70,26 +70,26 @@ if (Storage == HvStable) { /* Calculate bitmap size in bytes (always a multiple of 32 bits). */ - BitmapSize = ROUND_UP(RegistryHive->Storage[HvStable].BlockListSize, + BitmapSize = ROUND_UP(RegistryHive->Storage[HvStable].Length, sizeof(ULONG) * 8) / 8; /* Grow bitmap if necessary. */ - if (BitmapSize > RegistryHive->DirtyBitmap.SizeOfBitMap / 8) + if (BitmapSize > RegistryHive->DirtyVector.SizeOfBitMap / 8) { PULONG BitmapBuffer; BitmapBuffer = RegistryHive->Allocate(BitmapSize, TRUE); RtlZeroMemory(BitmapBuffer, BitmapSize); RtlCopyMemory(BitmapBuffer, - RegistryHive->DirtyBitmap.Buffer, - RegistryHive->DirtyBitmap.SizeOfBitMap / 8); - RegistryHive->Free(RegistryHive->DirtyBitmap.Buffer); - RtlInitializeBitMap(&RegistryHive->DirtyBitmap, BitmapBuffer, + RegistryHive->DirtyVector.Buffer, + RegistryHive->DirtyVector.SizeOfBitMap / 8); + RegistryHive->Free(RegistryHive->DirtyVector.Buffer); + RtlInitializeBitMap(&RegistryHive->DirtyVector, BitmapBuffer, BitmapSize * 8); } /* Mark new bin dirty. */ - RtlSetBits(&RegistryHive->DirtyBitmap, + RtlSetBits(&RegistryHive->DirtyVector, Bin->BinOffset / HV_BLOCK_SIZE, BlockCount); } Modified: trunk/reactos/lib/cmlib/hivecell.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/cmlib/hivecell.c?rev=2…
============================================================================== --- trunk/reactos/lib/cmlib/hivecell.c (original) +++ trunk/reactos/lib/cmlib/hivecell.c Mon Aug 14 15:35:48 2006 @@ -11,7 +11,7 @@ static PCELL_HEADER __inline CMAPI HvpGetCellHeader( - PREGISTRY_HIVE RegistryHive, + PHHIVE RegistryHive, HCELL_INDEX CellIndex) { PVOID Block; @@ -26,8 +26,8 @@ CellType = (CellIndex & HCELL_TYPE_MASK) >> HCELL_TYPE_SHIFT; CellBlock = (CellIndex & HCELL_BLOCK_MASK) >> HCELL_BLOCK_SHIFT; CellOffset = (CellIndex & HCELL_OFFSET_MASK) >> HCELL_OFFSET_SHIFT; - ASSERT(CellBlock < RegistryHive->Storage[CellType].BlockListSize); - Block = RegistryHive->Storage[CellType].BlockList[CellBlock].Block; + ASSERT(CellBlock < RegistryHive->Storage[CellType].Length); + Block = (PVOID)RegistryHive->Storage[CellType].BlockList[CellBlock].Block; ASSERT(Block != NULL); return (PVOID)((ULONG_PTR)Block + CellOffset); } @@ -41,7 +41,7 @@ PVOID CMAPI HvGetCell( - PREGISTRY_HIVE RegistryHive, + PHHIVE RegistryHive, HCELL_INDEX CellIndex) { return (PVOID)(HvpGetCellHeader(RegistryHive, CellIndex) + 1); @@ -49,7 +49,7 @@ static LONG __inline CMAPI HvpGetCellFullSize( - PREGISTRY_HIVE RegistryHive, + PHHIVE RegistryHive, PVOID Cell) { return ((PCELL_HEADER)Cell - 1)->CellSize; @@ -57,7 +57,7 @@ LONG CMAPI HvGetCellSize( - PREGISTRY_HIVE RegistryHive, + PHHIVE RegistryHive, PVOID Cell) { PCELL_HEADER CellHeader; @@ -71,7 +71,7 @@ VOID CMAPI HvMarkCellDirty( - PREGISTRY_HIVE RegistryHive, + PHHIVE RegistryHive, HCELL_INDEX CellIndex) { LONG CellSize; @@ -90,7 +90,7 @@ if (CellSize < 0) CellSize = -CellSize; - RtlSetBits(&RegistryHive->DirtyBitmap, + RtlSetBits(&RegistryHive->DirtyVector, CellBlock, CellLastBlock - CellBlock); } @@ -131,7 +131,7 @@ static NTSTATUS CMAPI HvpAddFree( - PREGISTRY_HIVE RegistryHive, + PHHIVE RegistryHive, PCELL_HEADER FreeBlock, HCELL_INDEX FreeIndex) { @@ -146,8 +146,8 @@ Index = HvpComputeFreeListIndex(FreeBlock->CellSize); FreeBlockData = (PHCELL_INDEX)(FreeBlock + 1); - *FreeBlockData = RegistryHive->Storage[Storage].FreeListOffset[Index]; - RegistryHive->Storage[Storage].FreeListOffset[Index] = FreeIndex; + *FreeBlockData = RegistryHive->Storage[Storage].FreeDisplay[Index]; + RegistryHive->Storage[Storage].FreeDisplay[Index] = FreeIndex; /* FIXME: Eventually get rid of free bins. */ @@ -156,7 +156,7 @@ static VOID CMAPI HvpRemoveFree( - PREGISTRY_HIVE RegistryHive, + PHHIVE RegistryHive, PCELL_HEADER CellBlock, HCELL_INDEX CellIndex) { @@ -170,7 +170,7 @@ Storage = (CellIndex & HCELL_TYPE_MASK) >> HCELL_TYPE_SHIFT; Index = HvpComputeFreeListIndex(CellBlock->CellSize); - pFreeCellOffset = &RegistryHive->Storage[Storage].FreeListOffset[Index]; + pFreeCellOffset = &RegistryHive->Storage[Storage].FreeDisplay[Index]; while (*pFreeCellOffset != HCELL_NULL) { FreeCellData = (PHCELL_INDEX)HvGetCell(RegistryHive, *pFreeCellOffset); @@ -187,7 +187,7 @@ static HCELL_INDEX CMAPI HvpFindFree( - PREGISTRY_HIVE RegistryHive, + PHHIVE RegistryHive, ULONG Size, HV_STORAGE_TYPE Storage) { @@ -198,7 +198,7 @@ for (Index = HvpComputeFreeListIndex(Size); Index < 24; Index++) { - pFreeCellOffset = &RegistryHive->Storage[Storage].FreeListOffset[Index]; + pFreeCellOffset = &RegistryHive->Storage[Storage].FreeDisplay[Index]; while (*pFreeCellOffset != HCELL_NULL) { FreeCellData = (PHCELL_INDEX)HvGetCell(RegistryHive, *pFreeCellOffset); @@ -217,7 +217,7 @@ NTSTATUS CMAPI HvpCreateHiveFreeCellList( - PREGISTRY_HIVE Hive) + PHHIVE Hive) { HCELL_INDEX BlockOffset; PCELL_HEADER FreeBlock; @@ -230,15 +230,15 @@ /* Initialize the free cell list */ for (Index = 0; Index < 24; Index++) { - Hive->Storage[HvStable].FreeListOffset[Index] = HCELL_NULL; - Hive->Storage[HvVolatile].FreeListOffset[Index] = HCELL_NULL; + Hive->Storage[HvStable].FreeDisplay[Index] = HCELL_NULL; + Hive->Storage[HvVolatile].FreeDisplay[Index] = HCELL_NULL; } BlockOffset = 0; BlockIndex = 0; - while (BlockIndex < Hive->Storage[HvStable].BlockListSize) - { - Bin = Hive->Storage[HvStable].BlockList[BlockIndex].Bin; + while (BlockIndex < Hive->Storage[HvStable].Length) + { + Bin = (PHBIN)Hive->Storage[HvStable].BlockList[BlockIndex].Bin; /* Search free blocks and add to list */ FreeOffset = sizeof(HBIN); @@ -268,7 +268,7 @@ HCELL_INDEX CMAPI HvAllocateCell( - PREGISTRY_HIVE RegistryHive, + PHHIVE RegistryHive, ULONG Size, HV_STORAGE_TYPE Storage) { @@ -319,7 +319,7 @@ HCELL_INDEX CMAPI HvReallocateCell( - PREGISTRY_HIVE RegistryHive, + PHHIVE RegistryHive, HCELL_INDEX CellIndex, ULONG Size) { @@ -363,7 +363,7 @@ VOID CMAPI HvFreeCell( - PREGISTRY_HIVE RegistryHive, + PHHIVE RegistryHive, HCELL_INDEX CellIndex) { PCELL_HEADER Free; @@ -384,7 +384,7 @@ CellBlock = (CellIndex & HCELL_BLOCK_MASK) >> HCELL_BLOCK_SHIFT; /* FIXME: Merge free blocks */ - Bin = RegistryHive->Storage[CellType].BlockList[CellBlock].Bin; + Bin = (PHBIN)RegistryHive->Storage[CellType].BlockList[CellBlock].Bin; if ((CellIndex & ~HCELL_TYPE_MASK) + Free->CellSize < Bin->BinOffset + Bin->BinSize) Modified: trunk/reactos/lib/cmlib/hivedata.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/cmlib/hivedata.h?rev=2…
============================================================================== --- trunk/reactos/lib/cmlib/hivedata.h (original) +++ trunk/reactos/lib/cmlib/hivedata.h Mon Aug 14 15:35:48 2006 @@ -9,7 +9,7 @@ #define CMLIB_HIVEDATA_H #define HV_BLOCK_SIZE 4096 -#define HV_LOG_HEADER_SIZE FIELD_OFFSET(HIVE_HEADER, Reserved2) +#define HV_LOG_HEADER_SIZE FIELD_OFFSET(HBASE_BLOCK, Reserved2) #define HV_SIGNATURE 0x66676572 #define HV_BIN_SIGNATURE 0x6e696268 @@ -44,12 +44,12 @@ #include <pshpack1.h> /** - * @name HIVE_HEADER + * @name HBASE_BLOCK * * On-disk header for registry hive file. */ -typedef struct _HIVE_HEADER +typedef struct _HBASE_BLOCK { /* Hive identifier "regf" (0x66676572) */ ULONG Signature; @@ -87,15 +87,17 @@ ULONG Cluster; /* Name of hive file */ - WCHAR FileName[32]; + CHAR FileName[64]; ULONG Reserved1[99]; /* Checksum of first 0x200 bytes */ ULONG Checksum; - ULONG Reserved2[0x380]; -} HIVE_HEADER, *PHIVE_HEADER; + ULONG Reserved2[0x37E]; + ULONG BootType; + ULONG BootRecover; +} HBASE_BLOCK, *PHBASE_BLOCK; typedef struct _BIN_HEADER { 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 15:35:48 2006 @@ -17,7 +17,7 @@ BOOLEAN CMAPI HvpVerifyHiveHeader( - PHIVE_HEADER HiveHeader) + PHBASE_BLOCK HiveHeader) { if (HiveHeader->Signature != HV_SIGNATURE || HiveHeader->Major != HV_MAJOR_VER || @@ -53,7 +53,7 @@ VOID CMAPI HvpFreeHiveBins( - PREGISTRY_HIVE Hive) + PHHIVE Hive) { ULONG i; PHBIN Bin; @@ -62,20 +62,20 @@ for (Storage = HvStable; Storage < HvMaxStorageType; Storage++) { Bin = NULL; - for (i = 0; i < Hive->Storage[Storage].BlockListSize; i++) - { - if (Hive->Storage[Storage].BlockList[i].Bin == NULL) + for (i = 0; i < Hive->Storage[Storage].Length; i++) + { + if (Hive->Storage[Storage].BlockList[i].Bin == (ULONG_PTR)NULL) continue; - if (Hive->Storage[Storage].BlockList[i].Bin != Bin) + if (Hive->Storage[Storage].BlockList[i].Bin != (ULONG_PTR)Bin) { - Bin = Hive->Storage[Storage].BlockList[i].Bin; - Hive->Free(Hive->Storage[Storage].BlockList[i].Bin); + Bin = (PHBIN)Hive->Storage[Storage].BlockList[i].Bin; + Hive->Free((PHBIN)Hive->Storage[Storage].BlockList[i].Bin); } - Hive->Storage[Storage].BlockList[i].Bin = NULL; - Hive->Storage[Storage].BlockList[i].Block = NULL; - } - - if (Hive->Storage[Storage].BlockListSize) + Hive->Storage[Storage].BlockList[i].Bin = (ULONG_PTR)NULL; + Hive->Storage[Storage].BlockList[i].Block = (ULONG_PTR)NULL; + } + + if (Hive->Storage[Storage].Length) Hive->Free(Hive->Storage[Storage].BlockList); } } @@ -91,15 +91,15 @@ NTSTATUS CMAPI HvpCreateHive( - PREGISTRY_HIVE RegistryHive) -{ - PHIVE_HEADER HiveHeader; + PHHIVE RegistryHive) +{ + PHBASE_BLOCK HiveHeader; ULONG Index; - HiveHeader = RegistryHive->Allocate(sizeof(HIVE_HEADER), FALSE); + HiveHeader = RegistryHive->Allocate(sizeof(HBASE_BLOCK), FALSE); if (HiveHeader == NULL) return STATUS_NO_MEMORY; - RtlZeroMemory(HiveHeader, sizeof(HIVE_HEADER)); + RtlZeroMemory(HiveHeader, sizeof(HBASE_BLOCK)); HiveHeader->Signature = HV_SIGNATURE; HiveHeader->Major = HV_MAJOR_VER; HiveHeader->Minor = HV_MINOR_VER; @@ -116,10 +116,10 @@ RegistryHive->HiveHeader = HiveHeader; for (Index = 0; Index < 24; Index++) { - RegistryHive->Storage[HvStable].FreeListOffset[Index] = HCELL_NULL; - RegistryHive->Storage[HvVolatile].FreeListOffset[Index] = HCELL_NULL; - } - RtlInitializeBitMap(&RegistryHive->DirtyBitmap, NULL, 0); + RegistryHive->Storage[HvStable].FreeDisplay[Index] = HCELL_NULL; + RegistryHive->Storage[HvVolatile].FreeDisplay[Index] = HCELL_NULL; + } + RtlInitializeBitMap(&RegistryHive->DirtyVector, NULL, 0); return STATUS_SUCCESS; } @@ -136,7 +136,7 @@ NTSTATUS CMAPI HvpInitializeMemoryHive( - PREGISTRY_HIVE Hive, + PHHIVE Hive, ULONG_PTR ChunkBase, SIZE_T ChunkSize) { @@ -146,30 +146,30 @@ ULONG BitmapSize; PULONG BitmapBuffer; - if (ChunkSize < sizeof(HIVE_HEADER) || - !HvpVerifyHiveHeader((PHIVE_HEADER)ChunkBase)) - { - DPRINT1("Registry is corrupt: ChunkSize %d < sizeof(HIVE_HEADER) %d, " - "or HvpVerifyHiveHeader() failed\n", ChunkSize, sizeof(HIVE_HEADER)); + if (ChunkSize < sizeof(HBASE_BLOCK) || + !HvpVerifyHiveHeader((PHBASE_BLOCK)ChunkBase)) + { + DPRINT1("Registry is corrupt: ChunkSize %d < sizeof(HBASE_BLOCK) %d, " + "or HvpVerifyHiveHeader() failed\n", ChunkSize, sizeof(HBASE_BLOCK)); return STATUS_REGISTRY_CORRUPT; } - Hive->HiveHeader = Hive->Allocate(sizeof(HIVE_HEADER), FALSE); + Hive->HiveHeader = Hive->Allocate(sizeof(HBASE_BLOCK), FALSE); if (Hive->HiveHeader == NULL) { return STATUS_NO_MEMORY; } - RtlCopyMemory(Hive->HiveHeader, (PVOID)ChunkBase, sizeof(HIVE_HEADER)); + RtlCopyMemory(Hive->HiveHeader, (PVOID)ChunkBase, sizeof(HBASE_BLOCK)); /* * Build a block list from the in-memory chunk and copy the data as * we go. */ - Hive->Storage[HvStable].BlockListSize = (ChunkSize / HV_BLOCK_SIZE) - 1; + Hive->Storage[HvStable].Length = (ChunkSize / HV_BLOCK_SIZE) - 1; Hive->Storage[HvStable].BlockList = - Hive->Allocate(Hive->Storage[HvStable].BlockListSize * - sizeof(BLOCK_LIST_ENTRY), FALSE); + Hive->Allocate(Hive->Storage[HvStable].Length * + sizeof(HMAP_ENTRY), FALSE); if (Hive->Storage[HvStable].BlockList == NULL) { DPRINT1("Allocating block list failed\n"); @@ -177,7 +177,7 @@ return STATUS_NO_MEMORY; } - for (BlockIndex = 0; BlockIndex < Hive->Storage[HvStable].BlockListSize; ) + for (BlockIndex = 0; BlockIndex < Hive->Storage[HvStable].Length; ) { Bin = (PHBIN)((ULONG_PTR)ChunkBase + (BlockIndex + 1) * HV_BLOCK_SIZE); if (Bin->Signature != HV_BIN_SIGNATURE || @@ -196,8 +196,8 @@ return STATUS_NO_MEMORY; } - Hive->Storage[HvStable].BlockList[BlockIndex].Bin = NewBin; - Hive->Storage[HvStable].BlockList[BlockIndex].Block = NewBin; + Hive->Storage[HvStable].BlockList[BlockIndex].Bin = (ULONG_PTR)NewBin; + Hive->Storage[HvStable].BlockList[BlockIndex].Block = (ULONG_PTR)NewBin; RtlCopyMemory(NewBin, Bin, Bin->BinSize); @@ -205,9 +205,9 @@ { for (i = 1; i < Bin->BinSize / HV_BLOCK_SIZE; i++) { - Hive->Storage[HvStable].BlockList[BlockIndex + i].Bin = NewBin; + Hive->Storage[HvStable].BlockList[BlockIndex + i].Bin = (ULONG_PTR)NewBin; Hive->Storage[HvStable].BlockList[BlockIndex + i].Block = - (PVOID)((ULONG_PTR)NewBin + (i * HV_BLOCK_SIZE)); + ((ULONG_PTR)NewBin + (i * HV_BLOCK_SIZE)); } } @@ -221,7 +221,7 @@ return STATUS_NO_MEMORY; } - BitmapSize = ROUND_UP(Hive->Storage[HvStable].BlockListSize, + BitmapSize = ROUND_UP(Hive->Storage[HvStable].Length, sizeof(ULONG) * 8) / 8; BitmapBuffer = (PULONG)Hive->Allocate(BitmapSize, TRUE); if (BitmapBuffer == NULL) @@ -231,8 +231,8 @@ return STATUS_NO_MEMORY; } - RtlInitializeBitMap(&Hive->DirtyBitmap, BitmapBuffer, BitmapSize * 8); - RtlClearAllBits(&Hive->DirtyBitmap); + RtlInitializeBitMap(&Hive->DirtyVector, BitmapBuffer, BitmapSize * 8); + RtlClearAllBits(&Hive->DirtyVector); return STATUS_SUCCESS; } @@ -249,17 +249,17 @@ NTSTATUS CMAPI HvpInitializeMemoryInplaceHive( - PREGISTRY_HIVE Hive, + PHHIVE Hive, ULONG_PTR ChunkBase, SIZE_T ChunkSize) { - if (ChunkSize < sizeof(HIVE_HEADER) || - !HvpVerifyHiveHeader((PHIVE_HEADER)ChunkBase)) + if (ChunkSize < sizeof(HBASE_BLOCK) || + !HvpVerifyHiveHeader((PHBASE_BLOCK)ChunkBase)) { return STATUS_REGISTRY_CORRUPT; } - Hive->HiveHeader = (PHIVE_HEADER)ChunkBase; + Hive->HiveHeader = (PHBASE_BLOCK)ChunkBase; Hive->ReadOnly = TRUE; Hive->Flat = TRUE; @@ -299,29 +299,29 @@ NTSTATUS CMAPI HvInitialize( - PREGISTRY_HIVE *RegistryHive, + PHHIVE *RegistryHive, ULONG Operation, ULONG_PTR ChunkBase, SIZE_T ChunkSize, - PHV_ALLOCATE Allocate, - PHV_FREE Free, - PHV_FILE_READ FileRead, - PHV_FILE_WRITE FileWrite, - PHV_FILE_SET_SIZE FileSetSize, - PHV_FILE_FLUSH FileFlush, + PALLOCATE_ROUTINE Allocate, + PFREE_ROUTINE Free, + PFILE_READ_ROUTINE FileRead, + PFILE_WRITE_ROUTINE FileWrite, + PFILE_SET_SIZE_ROUTINE FileSetSize, + PFILE_FLUSH_ROUTINE FileFlush, PVOID Opaque) { NTSTATUS Status; - PREGISTRY_HIVE Hive; + PHHIVE Hive; /* * Create a new hive structure that will hold all the maintenance data. */ - Hive = Allocate(sizeof(REGISTRY_HIVE), TRUE); + Hive = Allocate(sizeof(HHIVE), TRUE); if (Hive == NULL) return STATUS_NO_MEMORY; - RtlZeroMemory(Hive, sizeof(REGISTRY_HIVE)); + RtlZeroMemory(Hive, sizeof(HHIVE)); Hive->Allocate = Allocate; Hive->Free = Free; @@ -370,14 +370,14 @@ VOID CMAPI HvFree( - PREGISTRY_HIVE RegistryHive) + PHHIVE RegistryHive) { if (!RegistryHive->ReadOnly) { /* Release hive bitmap */ - if (RegistryHive->DirtyBitmap.Buffer) - { - RegistryHive->Free(RegistryHive->DirtyBitmap.Buffer); + if (RegistryHive->DirtyVector.Buffer) + { + RegistryHive->Free(RegistryHive->DirtyVector.Buffer); } HvpFreeHiveBins(RegistryHive); Modified: trunk/reactos/lib/cmlib/hivesum.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/cmlib/hivesum.c?rev=23…
============================================================================== --- trunk/reactos/lib/cmlib/hivesum.c (original) +++ trunk/reactos/lib/cmlib/hivesum.c Mon Aug 14 15:35:48 2006 @@ -15,7 +15,7 @@ ULONG CMAPI HvpHiveHeaderChecksum( - PHIVE_HEADER HiveHeader) + PHBASE_BLOCK HiveHeader) { PULONG Buffer = (PULONG)HiveHeader; ULONG Sum = 0; Modified: trunk/reactos/lib/cmlib/hivewrt.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/cmlib/hivewrt.c?rev=23…
============================================================================== --- trunk/reactos/lib/cmlib/hivewrt.c (original) +++ trunk/reactos/lib/cmlib/hivewrt.c Mon Aug 14 15:35:48 2006 @@ -11,7 +11,7 @@ static BOOLEAN CMAPI HvpWriteLog( - PREGISTRY_HIVE RegistryHive) + PHHIVE RegistryHive) { ULONG FileOffset; ULONG BufferSize; @@ -33,7 +33,7 @@ return FALSE; } - BitmapSize = RegistryHive->DirtyBitmap.SizeOfBitMap; + BitmapSize = RegistryHive->DirtyVector.SizeOfBitMap; BufferSize = HV_LOG_HEADER_SIZE + sizeof(ULONG) + BitmapSize; BufferSize = ROUND_UP(BufferSize, HV_BLOCK_SIZE); @@ -56,7 +56,7 @@ Ptr = Buffer + HV_LOG_HEADER_SIZE; RtlCopyMemory(Ptr, "DIRT", 4); Ptr += 4; - RtlCopyMemory(Ptr, RegistryHive->DirtyBitmap.Buffer, BitmapSize); + RtlCopyMemory(Ptr, RegistryHive->DirtyVector.Buffer, BitmapSize); /* Write hive block and block bitmap */ Success = RegistryHive->FileWrite(RegistryHive, HV_TYPE_LOG, @@ -71,16 +71,16 @@ /* Write dirty blocks */ FileOffset = BufferSize; BlockIndex = 0; - while (BlockIndex < RegistryHive->Storage[HvStable].BlockListSize) + while (BlockIndex < RegistryHive->Storage[HvStable].Length) { LastIndex = BlockIndex; - BlockIndex = RtlFindSetBits(&RegistryHive->DirtyBitmap, 1, BlockIndex); + BlockIndex = RtlFindSetBits(&RegistryHive->DirtyVector, 1, BlockIndex); if (BlockIndex == ~0 || BlockIndex < LastIndex) { break; } - BlockPtr = RegistryHive->Storage[HvStable].BlockList[BlockIndex].Block; + BlockPtr = (PVOID)RegistryHive->Storage[HvStable].BlockList[BlockIndex].Block; /* Write hive block */ Success = RegistryHive->FileWrite(RegistryHive, HV_TYPE_LOG, @@ -135,7 +135,7 @@ static BOOLEAN CMAPI HvpWriteHive( - PREGISTRY_HIVE RegistryHive, + PHHIVE RegistryHive, BOOLEAN OnlyDirty) { ULONG FileOffset; @@ -163,26 +163,26 @@ /* Write hive block */ Success = RegistryHive->FileWrite(RegistryHive, HV_TYPE_PRIMARY, 0, RegistryHive->HiveHeader, - sizeof(HIVE_HEADER)); + sizeof(HBASE_BLOCK)); if (!Success) { return FALSE; } BlockIndex = 0; - while (BlockIndex < RegistryHive->Storage[HvStable].BlockListSize) + while (BlockIndex < RegistryHive->Storage[HvStable].Length) { if (OnlyDirty) { LastIndex = BlockIndex; - BlockIndex = RtlFindSetBits(&RegistryHive->DirtyBitmap, 1, BlockIndex); + BlockIndex = RtlFindSetBits(&RegistryHive->DirtyVector, 1, BlockIndex); if (BlockIndex == ~0 || BlockIndex < LastIndex) { break; } } - BlockPtr = RegistryHive->Storage[HvStable].BlockList[BlockIndex].Block; + BlockPtr = (PVOID)RegistryHive->Storage[HvStable].BlockList[BlockIndex].Block; FileOffset = (ULONGLONG)(BlockIndex + 1) * (ULONGLONG)HV_BLOCK_SIZE; /* Write hive block */ @@ -211,7 +211,7 @@ /* Write hive block */ Success = RegistryHive->FileWrite(RegistryHive, HV_TYPE_PRIMARY, 0, RegistryHive->HiveHeader, - sizeof(HIVE_HEADER)); + sizeof(HBASE_BLOCK)); if (!Success) { return FALSE; @@ -228,11 +228,11 @@ BOOLEAN CMAPI HvSyncHive( - PREGISTRY_HIVE RegistryHive) -{ - ASSERT(RegistryHive->ReadOnly == FALSE); - - if (RtlFindSetBits(&RegistryHive->DirtyBitmap, 1, 0) == ~0) + PHHIVE RegistryHive) +{ + ASSERT(RegistryHive->ReadOnly == FALSE); + + if (RtlFindSetBits(&RegistryHive->DirtyVector, 1, 0) == ~0) { return TRUE; } @@ -253,14 +253,14 @@ } /* Clear dirty bitmap. */ - RtlClearAllBits(&RegistryHive->DirtyBitmap); + RtlClearAllBits(&RegistryHive->DirtyVector); return TRUE; } BOOLEAN CMAPI HvWriteHive( - PREGISTRY_HIVE RegistryHive) + PHHIVE RegistryHive) { ASSERT(RegistryHive->ReadOnly == FALSE); Modified: trunk/reactos/ntoskrnl/cm/cm.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/cm/cm.h?rev=23572…
============================================================================== --- trunk/reactos/ntoskrnl/cm/cm.h (original) +++ trunk/reactos/ntoskrnl/cm/cm.h Mon Aug 14 15:35:48 2006 @@ -40,7 +40,7 @@ typedef struct _EREGISTRY_HIVE { LIST_ENTRY HiveList; - PREGISTRY_HIVE Hive; + PHHIVE Hive; UNICODE_STRING HiveFileName; UNICODE_STRING LogFileName; PSECURITY_CELL RootSecurityCell; @@ -411,7 +411,7 @@ BOOLEAN CMAPI CmpFileRead( - PREGISTRY_HIVE RegistryHive, + PHHIVE RegistryHive, ULONG FileType, ULONG FileOffset, PVOID Buffer, @@ -419,7 +419,7 @@ BOOLEAN CMAPI CmpFileWrite( - PREGISTRY_HIVE RegistryHive, + PHHIVE RegistryHive, ULONG FileType, ULONG FileOffset, PVOID Buffer, @@ -427,29 +427,29 @@ BOOLEAN CMAPI CmpFileSetSize( - PREGISTRY_HIVE RegistryHive, + PHHIVE RegistryHive, ULONG FileType, ULONG FileSize); BOOLEAN CMAPI CmpFileFlush( - PREGISTRY_HIVE RegistryHive, + PHHIVE RegistryHive, ULONG FileType); #if 0 -static __inline PVOID xHvGetCell(char *file, int line, PREGISTRY_HIVE Hive, HCELL_INDEX Cell) +static __inline PVOID xHvGetCell(char *file, int line, PHHIVE Hive, HCELL_INDEX Cell) { DPRINT1("xHvGetCell @ %s:%d %x @ %x\n", file, line, Cell, Hive); return HvGetCell(Hive, Cell); } -static __inline VOID xHvFreeCell(char *file, int line, PREGISTRY_HIVE Hive, HCELL_INDEX Cell) +static __inline VOID xHvFreeCell(char *file, int line, PHHIVE Hive, HCELL_INDEX Cell) { DPRINT1("xHvFreeCell @ %s:%d %x @ %x\n", file, line, Cell, Hive); HvFreeCell(Hive, Cell); } -static __inline HCELL_INDEX xHvAllocateCell(char *file, int line, PREGISTRY_HIVE Hive, SIZE_T Size) +static __inline HCELL_INDEX xHvAllocateCell(char *file, int line, PHHIVE Hive, SIZE_T Size) { HCELL_INDEX Offset = HvAllocateCell(Hive, Size); DPRINT1("xHvAllocateCell @ %s:%d (%x) %x @ %x\n", file, line, Size, Offset, Hive); 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 15:35:48 2006 @@ -44,7 +44,7 @@ BOOLEAN CMAPI CmpFileRead( - PREGISTRY_HIVE RegistryHive, + PHHIVE RegistryHive, ULONG FileType, ULONG FileOffset, PVOID Buffer, @@ -65,7 +65,7 @@ BOOLEAN CMAPI CmpFileWrite( - PREGISTRY_HIVE RegistryHive, + PHHIVE RegistryHive, ULONG FileType, ULONG FileOffset, PVOID Buffer, @@ -86,7 +86,7 @@ BOOLEAN CMAPI CmpFileSetSize( - PREGISTRY_HIVE RegistryHive, + PHHIVE RegistryHive, ULONG FileType, ULONG FileSize) { @@ -119,7 +119,7 @@ BOOLEAN CMAPI CmpFileFlush( - PREGISTRY_HIVE RegistryHive, + PHHIVE RegistryHive, ULONG FileType) { PEREGISTRY_HIVE CmHive = RegistryHive->Opaque; @@ -136,7 +136,7 @@ CmiCreateNewRegFile(HANDLE FileHandle) { EREGISTRY_HIVE CmHive; - PREGISTRY_HIVE Hive; + PHHIVE Hive; NTSTATUS Status; CmHive.HiveHandle = FileHandle; @@ -190,8 +190,8 @@ IO_STATUS_BLOCK IoStatusBlock; HANDLE HiveHandle = INVALID_HANDLE_VALUE; HANDLE LogHandle = INVALID_HANDLE_VALUE; - PHIVE_HEADER HiveHeader = NULL; - PHIVE_HEADER LogHeader = NULL; + PHBASE_BLOCK HiveHeader = NULL; + PHBASE_BLOCK LogHeader = NULL; LARGE_INTEGER FileOffset; ULONG FileSize; ULONG BufferSize; @@ -260,7 +260,7 @@ /* Allocate hive header */ HiveHeader = ExAllocatePool(PagedPool, - sizeof(HIVE_HEADER)); + sizeof(HBASE_BLOCK)); if (HiveHeader == NULL) { DPRINT("ExAllocatePool() failed\n"); @@ -276,7 +276,7 @@ 0, &IoStatusBlock, HiveHeader, - sizeof(HIVE_HEADER), + sizeof(HBASE_BLOCK), &FileOffset, 0); if (!NT_SUCCESS(Status)) @@ -810,7 +810,7 @@ ASSERT(!IsNoFileHive(RegistryHive)); - if (RtlFindSetBits(&RegistryHive->Hive->DirtyBitmap, 1, 0) == ~0) + if (RtlFindSetBits(&RegistryHive->Hive->DirtyVector, 1, 0) == ~0) { return(STATUS_SUCCESS); }
18 years, 4 months
1
0
0
0
[fireball] 23571: - Change class.c to Wine-style debugging prints, add a bit of TRACEs, WARNs and ERRs (channel-based debugging output would really help a lot...) - Fix IntMapDesktopView() to actually store the created mapping in a global list of mappings. Previously, any operation to map an address from such heap resulted in a NULL. As a side-effect, "user32_winetest.exe class" went from 31 to 27 failures.
by fireball@svn.reactos.org
Author: fireball Date: Mon Aug 14 01:43:53 2006 New Revision: 23571 URL:
http://svn.reactos.org/svn/reactos?rev=23571&view=rev
Log: - Change class.c to Wine-style debugging prints, add a bit of TRACEs, WARNs and ERRs (channel-based debugging output would really help a lot...) - Fix IntMapDesktopView() to actually store the created mapping in a global list of mappings. Previously, any operation to map an address from such heap resulted in a NULL. As a side-effect, "user32_winetest.exe class" went from 31 to 27 failures. Modified: trunk/reactos/subsystems/win32/win32k/ntuser/class.c trunk/reactos/subsystems/win32/win32k/ntuser/desktop.c Modified: trunk/reactos/subsystems/win32/win32k/ntuser/class.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/class.c (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/class.c Mon Aug 14 01:43:53 2006 @@ -30,8 +30,8 @@ #include <w32k.h> -#define NDEBUG -#include <debug.h> +//#define YDEBUG +#include <wine/debug.h> /* WINDOWCLASS ***************************************************************/ @@ -826,6 +826,9 @@ PWINDOWCLASS Class = NULL; RTL_ATOM Atom; NTSTATUS Status = STATUS_SUCCESS; + + TRACE("lpwcx=%p ClassName=%wZ MenuName=%wZ wpExtra=%p dwFlags=%08x Desktop=%p pi=%p\n", + lpwcx, ClassName, MenuName, wpExtra, dwFlags, Desktop, pi); if (!IntRegisterClassAtom(ClassName, &Atom)) @@ -2100,12 +2103,19 @@ pi = GetW32ProcessInfo(); if (pi == NULL) { + ERR("GetW32ProcessInfo() returned NULL!\n"); goto Cleanup; } _SEH_TRY { /* probe the paramters */ CapturedClassName = ProbeForReadUnicodeString(ClassName); + + if (IS_ATOM(CapturedClassName.Buffer)) + TRACE("hInst %p atom %04X lpWndClassEx %p Ansi %d\n", hInstance, CapturedClassName.Buffer, lpWndClassEx, Ansi); + else + TRACE("hInst %p class %wZ lpWndClassEx %p Ansi %d\n", hInstance, &CapturedClassName, lpWndClassEx, Ansi); + if (CapturedClassName.Length & 1) { goto InvalidParameter; @@ -2121,6 +2131,7 @@ { if (!IS_ATOM(CapturedClassName.Buffer)) { + ERR("NtUserGetClassInfo() got ClassName instead of Atom!\n"); goto InvalidParameter; } } @@ -2151,7 +2162,6 @@ if (Ret) { lpWndClassEx->lpszClassName = CapturedClassName.Buffer; - /* FIXME - handle Class->Desktop == NULL!!!!! */ if (Class->MenuName != NULL && @@ -2168,6 +2178,7 @@ if (!(Class->Global || Class->System) && hInstance == NULL) { + WARN("Tried to get information of a non-existing class\n"); SetLastWin32Error(ERROR_CLASS_DOES_NOT_EXIST); Ret = FALSE; } @@ -2175,6 +2186,7 @@ } else { + WARN("Tried to get information of a non-existing class\n"); SetLastWin32Error(ERROR_CLASS_DOES_NOT_EXIST); } } Modified: trunk/reactos/subsystems/win32/win32k/ntuser/desktop.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/desktop.c (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/desktop.c Mon Aug 14 01:43:53 2006 @@ -31,8 +31,8 @@ #include <w32k.h> -#define NDEBUG -#include <debug.h> +//#define YDEBUG +#include <wine/debug.h> static VOID @@ -1694,6 +1694,8 @@ PW32HEAP_USER_MAPPING HeapMapping, *PrevLink = &PsGetCurrentProcessWin32Process()->HeapMappings.Next; NTSTATUS Status = STATUS_SUCCESS; + TRACE("DO %p\n"); + /* unmap if we're the last thread using the desktop */ HeapMapping = *PrevLink; while (HeapMapping != NULL) @@ -1756,6 +1758,7 @@ } /* we're the first, map the heap */ + DPRINT("Noone mapped the desktop heap %p yet, so - map it!\n", DesktopObject->hDesktopHeap); Offset.QuadPart = 0; Status = MmMapViewOfSection(DesktopObject->DesktopHeapSection, PsGetCurrentProcess(), @@ -1769,7 +1772,7 @@ PAGE_EXECUTE_READ); /* would prefer PAGE_READONLY, but thanks to RTL heaps... */ if (!NT_SUCCESS(Status)) { - DbgPrint("Failed to map desktop\n"); + DPRINT1("Failed to map desktop\n"); return Status; } @@ -1779,6 +1782,7 @@ { MmUnmapViewOfSection(PsGetCurrentProcess(), UserBase); + DPRINT1("UserHeapAlloc() failed!\n"); return STATUS_NO_MEMORY; } @@ -1786,6 +1790,7 @@ HeapMapping->KernelMapping = (PVOID)DesktopObject->hDesktopHeap; HeapMapping->UserMapping = UserBase; HeapMapping->Count = 1; + *PrevLink = HeapMapping; ObReferenceObject(DesktopObject); @@ -1812,6 +1817,7 @@ NTSTATUS Status; BOOL MapHeap; + DPRINT("IntSetThreadDesktop() DO=%p, FOF=%d\n", DesktopObject, FreeOnFailure); MapHeap = (PsGetCurrentProcess() != PsInitialSystemProcess); W32Thread = PsGetCurrentThreadWin32Thread();
18 years, 4 months
1
0
0
0
[fireball] 23570: Dmitry Philippov: In MoveFileWithProgressW() - Change alloca() to RtlAllocateHeap() and add missing freeing of the allocated space - Fix incorrect FileNameLength param in call to NtSetInformationFile() - Add support for MOVEFILE_REPLACE_EXISTING flag
by fireball@svn.reactos.org
Author: fireball Date: Sun Aug 13 23:49:34 2006 New Revision: 23570 URL:
http://svn.reactos.org/svn/reactos?rev=23570&view=rev
Log: Dmitry Philippov: In MoveFileWithProgressW() - Change alloca() to RtlAllocateHeap() and add missing freeing of the allocated space - Fix incorrect FileNameLength param in call to NtSetInformationFile() - Add support for MOVEFILE_REPLACE_EXISTING flag Modified: trunk/reactos/dll/win32/kernel32/file/move.c Modified: trunk/reactos/dll/win32/kernel32/file/move.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/file/mo…
============================================================================== --- trunk/reactos/dll/win32/kernel32/file/move.c (original) +++ trunk/reactos/dll/win32/kernel32/file/move.c Sun Aug 13 23:49:34 2006 @@ -274,7 +274,15 @@ return FALSE; } - FileRename = alloca(sizeof(FILE_RENAME_INFORMATION) + DstPathU.Length); + FileRename = RtlAllocateHeap( + RtlGetProcessHeap(), + HEAP_ZERO_MEMORY, + sizeof(FILE_RENAME_INFORMATION) + DstPathU.Length); + if( !FileRename ) { + CloseHandle(hFile); + SetLastError(ERROR_NOT_ENOUGH_MEMORY); + return FALSE; + } if( dwFlags & MOVEFILE_REPLACE_EXISTING ) { FileRename->ReplaceIfExists = TRUE; } @@ -287,17 +295,15 @@ RtlFreeHeap (RtlGetProcessHeap (), 0, DstPathU.Buffer); - /* - * FIXME: - * Is the length the count of characters or the length of the buffer? - */ - FileRename->FileNameLength = DstPathU.Length / sizeof(WCHAR); + + FileRename->FileNameLength = DstPathU.Length; errCode = NtSetInformationFile (hFile, &IoStatusBlock, FileRename, sizeof(FILE_RENAME_INFORMATION) + DstPathU.Length, FileRenameInformation); CloseHandle(hFile); + RtlFreeHeap(RtlGetProcessHeap(), 0, FileRename); if (GetFileAttributesW(lpExistingFileName) & FILE_ATTRIBUTE_DIRECTORY) { @@ -325,12 +331,12 @@ lpProgressRoutine, lpData, NULL, - FileRename->ReplaceIfExists ? 0 : COPY_FILE_FAIL_IF_EXISTS); + (dwFlags & MOVEFILE_REPLACE_EXISTING) ? 0 : COPY_FILE_FAIL_IF_EXISTS); if (Result) { /* Cleanup the source file */ Result = DeleteFileW (lpExistingFileName); - } + } } else {
18 years, 4 months
1
0
0
0
[fireball] 23569: Dmitry Philippov: Add more tests for delayed file operations
by fireball@svn.reactos.org
Author: fireball Date: Sun Aug 13 23:12:53 2006 New Revision: 23569 URL:
http://svn.reactos.org/svn/reactos?rev=23569&view=rev
Log: Dmitry Philippov: Add more tests for delayed file operations Modified: trunk/reactos/base/applications/testsets/smss/movefile/movefile.cpp Modified: trunk/reactos/base/applications/testsets/smss/movefile/movefile.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/testsets…
============================================================================== --- trunk/reactos/base/applications/testsets/smss/movefile/movefile.cpp (original) +++ trunk/reactos/base/applications/testsets/smss/movefile/movefile.cpp Sun Aug 13 23:12:53 2006 @@ -83,10 +83,12 @@ char sBuf[255]; DWORD dwSize; HANDLE hFile = NULL; - + BOOL fReturnValue; + + char *szxReplacedFile = "c:\\testFileIsReplaced"; + char *szxMovedFileWithRepl = "c:\\testFileShouldBeMovedW"; char *szxMovedFile = "c:\\testFileShouldBeMoved"; char *szxNewMovedFile = "c:\\testFileIsMoved"; - char *szxDeletedFile = "c:\\testFileShouldBeDeleted"; memset(sBuf, 0xaa, sizeof(sBuf)); @@ -123,15 +125,44 @@ WriteFile(hFile, sBuf, sizeof(sBuf), &dwSize, NULL); CloseHandle(hFile); - - BOOL fReturnValue; + hFile = CreateFile( + szxReplacedFile, + FILE_ALL_ACCESS, + 0, + NULL, + CREATE_ALWAYS, + FILE_ATTRIBUTE_NORMAL, + NULL); + if(NULL == hFile) { + printf("Can't create the %s file, err=%ld \n", szxReplacedFile, GetLastError()); + return 1; + } + WriteFile(hFile, sBuf, sizeof(sBuf), &dwSize, NULL); + CloseHandle(hFile); + + + hFile = CreateFile( + szxMovedFileWithRepl, + FILE_ALL_ACCESS, + 0, + NULL, + CREATE_ALWAYS, + FILE_ATTRIBUTE_NORMAL, + NULL); + if(NULL == hFile) { + printf("Can't create the %s file, err=%ld \n", szxMovedFileWithRepl, GetLastError()); + return 1; + } + WriteFile(hFile, sBuf, sizeof(sBuf), &dwSize, NULL); + CloseHandle(hFile); + fReturnValue = MoveFileEx( szxDeletedFile, NULL, MOVEFILE_DELAY_UNTIL_REBOOT); if( !fReturnValue ) { - printf("Can't move the %s file, err=%ld \n", szxMovedFile, GetLastError()); + printf("Can't move the %s file, err=%ld \n", szxDeletedFile, GetLastError()); return 1; } @@ -148,6 +179,17 @@ ShowRegValue(); + fReturnValue = MoveFileEx( + szxMovedFileWithRepl, + szxReplacedFile, + MOVEFILE_DELAY_UNTIL_REBOOT|MOVEFILE_REPLACE_EXISTING); + if( !fReturnValue ) { + printf("Can't move the %s file, err=%ld \n", szxMovedFileWithRepl, GetLastError()); + return 1; + } + + ShowRegValue(); + return 0; }
18 years, 4 months
1
0
0
0
[janderwald] 23568: * fix registry BSOD when no value exists * fixes bug 1750 * thnx to P43LOk for bug report
by janderwald@svn.reactos.org
Author: janderwald Date: Sun Aug 13 22:57:28 2006 New Revision: 23568 URL:
http://svn.reactos.org/svn/reactos?rev=23568&view=rev
Log: * fix registry BSOD when no value exists * fixes bug 1750 * thnx to P43LOk for bug report Modified: trunk/reactos/ntoskrnl/cm/regfile.c 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 Sun Aug 13 22:57:28 2006 @@ -1564,6 +1564,11 @@ ULONG i; NTSTATUS Status; + if (KeyCell->ValueListOffset == -1) + { + return STATUS_OBJECT_NAME_NOT_FOUND; + } + ValueListCell = HvGetCell (RegistryHive->Hive, KeyCell->ValueListOffset); VERIFY_VALUE_LIST_CELL(ValueListCell);
18 years, 4 months
1
0
0
0
← Newer
1
...
25
26
27
28
29
30
31
...
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