···6767 if (Hive->Frozen)
6868 {
6969 /* FIXME: TODO */
7070- DPRINT1("ERROR: Hive is frozen\n");
7171- while (TRUE);
7070+ UNIMPLEMENTED_DBGBREAK("ERROR: Hive is frozen\n");
7271 }
7372 }
7473···105104 CmpLockHiveFlusherExclusive(Hive);
106105107106 /* Check for illegal state */
108108- if ((ForceFlush) && (Hive->UseCount))
107107+ if (ForceFlush && Hive->UseCount)
109108 {
110109 /* Registry needs to be locked down */
111110 CMP_ASSERT_EXCLUSIVE_REGISTRY_LOCK();
112112- DPRINT1("FIXME: Hive is damaged and needs fixup\n");
113113- while (TRUE);
111111+ UNIMPLEMENTED_DBGBREAK("FIXME: Hive is damaged and needs fixup\n");
114112 }
115113116114 /* Only sync if we are forced to or if it won't cause a hive shrink */
117117- if ((ForceFlush) || (!HvHiveWillShrink(&Hive->Hive)))
115115+ if (ForceFlush || !HvHiveWillShrink(&Hive->Hive))
118116 {
119117 /* Do the sync */
120118 Status = HvSyncHive(&Hive->Hive);
121119122120 /* If something failed - set the flag and continue looping */
123123- if (!NT_SUCCESS(Status)) Result = FALSE;
121121+ if (!NT_SUCCESS(Status))
122122+ Result = FALSE;
124123 }
125124 else
126125 {
···708707 }
709708710709 /* We need the exclusive KCB lock now */
711711- if (!(CmpIsKcbLockedExclusive(Kcb)) &&
712712- !(CmpTryToConvertKcbSharedToExclusive(Kcb)))
710710+ if (!CmpIsKcbLockedExclusive(Kcb) &&
711711+ !CmpTryToConvertKcbSharedToExclusive(Kcb))
713712 {
714713 /* Acquire exclusive lock */
715714 CmpConvertKcbSharedToExclusive(Kcb);
···873872 Kcb->KcbLastWriteTime = Parent->LastWriteTime;
874873875874 /* Check if the cell is cached */
876876- if ((Found) && (CMP_IS_CELL_CACHED(Kcb->ValueCache.ValueList)))
875875+ if (Found && CMP_IS_CELL_CACHED(Kcb->ValueCache.ValueList))
877876 {
878877 /* Shouldn't happen */
879878 ASSERT(FALSE);
···884883 CmpCleanUpKcbValueCache(Kcb);
885884886885 /* Sanity checks */
887887- ASSERT(!(CMP_IS_CELL_CACHED(Kcb->ValueCache.ValueList)));
886886+ ASSERT(!CMP_IS_CELL_CACHED(Kcb->ValueCache.ValueList));
888887 ASSERT(!(Kcb->ExtFlags & CM_KCB_SYM_LINK_FOUND));
889888890889 /* Set the value cache */
···901900902901 /* Release the cells */
903902Quickie:
904904- if ((ParentCell != HCELL_NIL) && (Hive)) HvReleaseCell(Hive, ParentCell);
905905- if ((ChildCell != HCELL_NIL) && (Hive)) HvReleaseCell(Hive, ChildCell);
903903+ if ((ParentCell != HCELL_NIL) && Hive) HvReleaseCell(Hive, ParentCell);
904904+ if ((ChildCell != HCELL_NIL) && Hive) HvReleaseCell(Hive, ChildCell);
906905907906 /* Release the locks */
908907 if (FlusherLocked) CmpUnlockHiveFlusher((PCMHIVE)Hive);
···972971 if (ChildCell == HCELL_NIL) goto Quickie;
973972974973 /* We found the value, mark all relevant cells dirty */
975975- if (!((HvMarkCellDirty(Hive, Cell, FALSE)) &&
976976- (HvMarkCellDirty(Hive, Parent->ValueList.List, FALSE)) &&
977977- (HvMarkCellDirty(Hive, ChildCell, FALSE))))
974974+ if (!(HvMarkCellDirty(Hive, Cell, FALSE) &&
975975+ HvMarkCellDirty(Hive, Parent->ValueList.List, FALSE) &&
976976+ HvMarkCellDirty(Hive, ChildCell, FALSE)))
978977 {
979978 /* Not enough log space, fail */
980979 Status = STATUS_NO_LOG_SPACE;
···10371036 CmpCleanUpKcbValueCache(Kcb);
1038103710391038 /* Sanity checks */
10401040- ASSERT(!(CMP_IS_CELL_CACHED(Kcb->ValueCache.ValueList)));
10391039+ ASSERT(!CMP_IS_CELL_CACHED(Kcb->ValueCache.ValueList));
10411040 ASSERT(!(Kcb->ExtFlags & CM_KCB_SYM_LINK_FOUND));
1042104110431042 /* Set the value cache */
+1-2
ntoskrnl/config/cmcontrl.c
···208208 }
209209210210 /* Sanity check if this is a small key */
211211- ASSERT((IsSmallKey ?
212212- (Length <= CM_KEY_VALUE_SMALL) : TRUE));
211211+ ASSERT(IsSmallKey ? (Length <= CM_KEY_VALUE_SMALL) : TRUE);
213212214213 /* Copy the data in the buffer */
215214 RtlCopyMemory(ControlVector->Buffer, Buffer, Length);
+11-11
ntoskrnl/config/cminit.c
···4949 * - An alternate hive that is not linked to a correct file type.
5050 * - A lonely alternate hive not backed up with its corresponding primary hive.
5151 */
5252- if (((External) && ((Primary) || (Log))) ||
5353- ((Log) && !(Primary)) ||
5454- (!(CmpShareSystemHives) && (HiveFlags & HIVE_VOLATILE) &&
5555- ((Primary) || (External) || (Log))) ||
5656- ((OperationType == HINIT_MEMORY) && (!HiveData)) ||
5757- ((Log) && (FileType != HFILE_TYPE_LOG)) ||
5858- ((Alternate) && (FileType != HFILE_TYPE_ALTERNATE)) ||
5959- ((Alternate) && !(Primary)))
5252+ if ((External && (Primary || Log)) ||
5353+ (Log && !Primary) ||
5454+ (!CmpShareSystemHives && (HiveFlags & HIVE_VOLATILE) &&
5555+ (Primary || External || Log)) ||
5656+ ((OperationType == HINIT_MEMORY) && !HiveData) ||
5757+ (Log && (FileType != HFILE_TYPE_LOG)) ||
5858+ (Alternate && (FileType != HFILE_TYPE_ALTERNATE)) ||
5959+ (Alternate && !Primary))
6060 {
6161 /* Fail the request */
6262 return STATUS_INVALID_PARAMETER;
···338338 NULL);
339339340340 /* Check if we can create the hive */
341341- if ((CreateAllowed) && !(CmpShareSystemHives))
341341+ if (CreateAllowed && !CmpShareSystemHives)
342342 {
343343 /* Open only or create */
344344 CreateDisposition = FILE_OPEN_IF;
···357357 (NoBuffering ? FILE_NO_INTERMEDIATE_BUFFERING : 0);
358358359359 /* Set share and access modes */
360360- if ((CmpMiniNTBoot) && (CmpShareSystemHives))
360360+ if (CmpMiniNTBoot && CmpShareSystemHives)
361361 {
362362 /* We're on Live CD or otherwise sharing */
363363 DesiredAccess = FILE_READ_DATA;
···568568 FILE_SYNCHRONOUS_IO_NONALERT | IoFlags,
569569 NULL,
570570 0);
571571- if ((NT_SUCCESS(Status)) && (MarkAsSystemHive))
571571+ if (NT_SUCCESS(Status) && MarkAsSystemHive)
572572 {
573573 /* We opened it, mark it as a system hive */
574574 Status = ZwFsControlFile(*Log,
+9-9
ntoskrnl/config/cmkcbncb.c
···619619 CMP_ASSERT_KCB_LOCK(Kcb);
620620621621 /* Check if we should do a direct delete */
622622- if (((CmpHoldLazyFlush) &&
622622+ if ((CmpHoldLazyFlush &&
623623 !(Kcb->ExtFlags & CM_KCB_SYM_LINK_FOUND) &&
624624 !(Kcb->Flags & KEY_SYM_LINK)) ||
625625 (Kcb->ExtFlags & CM_KCB_NO_DELAY_CLOSE) ||
626626- (Kcb->Delete))
626626+ Kcb->Delete)
627627 {
628628 /* Clean up the KCB*/
629629 CmpCleanUpKcbCacheWithLock(Kcb, LockHeldExclusively);
···683683 NodeName = *KeyName;
684684685685 /* Remove leading slash */
686686- while ((NodeName.Length) && (*NodeName.Buffer == OBJ_NAME_PATH_SEPARATOR))
686686+ while (NodeName.Length && (*NodeName.Buffer == OBJ_NAME_PATH_SEPARATOR))
687687 {
688688 /* Move the buffer by one */
689689 NodeName.Buffer++;
···764764 else
765765 {
766766 /* Check if we're not creating a fake one, but it used to be fake */
767767- if ((Kcb->ExtFlags & CM_KCB_KEY_NON_EXIST) && !(IsFake))
767767+ if ((Kcb->ExtFlags & CM_KCB_KEY_NON_EXIST) && !IsFake)
768768 {
769769 /* Set the hive and cell */
770770 Kcb->KeyHive = Hive;
···801801 {
802802 /* Reference the parent */
803803 if (((Parent->TotalLevels + 1) < 512) &&
804804- (CmpReferenceKeyControlBlock(Parent)))
804804+ CmpReferenceKeyControlBlock(Parent))
805805 {
806806 /* Link it */
807807 Kcb->ParentKcb = Parent;
···863863 }
864864865865 /* Check if this is a KCB inside a frozen hive */
866866- if ((Kcb) && (((PCMHIVE)Hive)->Frozen) && (!(Kcb->Flags & KEY_SYM_LINK)))
866866+ if (Kcb && ((PCMHIVE)Hive)->Frozen && !(Kcb->Flags & KEY_SYM_LINK))
867867 {
868868 /* Don't add these to the delay close */
869869 Kcb->ExtFlags |= CM_KCB_NO_DELAY_CLOSE;
870870 }
871871872872 /* Sanity check */
873873- ASSERT((!Kcb) || (Kcb->Delete == FALSE));
873873+ ASSERT(!Kcb || !Kcb->Delete);
874874875875 /* Check if we had locked the hashes */
876876 if (!HashLock)
···950950 /* Sanity checks for deleted and fake keys */
951951 if ((!MyKcb->KeyCell && !MyKcb->Delete) ||
952952 !MyKcb->KeyHive ||
953953- MyKcb->ExtFlags & CM_KCB_KEY_NON_EXIST)
953953+ (MyKcb->ExtFlags & CM_KCB_KEY_NON_EXIST))
954954 {
955955 /* Failure */
956956 CmpFree(KeyName, 0);
···11091109 for (i = 0; i < 4; i++)
11101110 {
11111111 /* Add it into the list */
11121112- if (InterlockedCompareExchangePointer((VOID*)&KeyBody->KeyControlBlock->
11121112+ if (InterlockedCompareExchangePointer((PVOID*)&KeyBody->KeyControlBlock->
11131113 KeyBodyArray[i],
11141114 NULL,
11151115 KeyBody) == KeyBody)
+6-6
ntoskrnl/config/cmlazy.c
···9292 CmHive->FlushCount = CmpLazyFlushCount;
9393 }
9494 }
9595- else if ((CmHive->Hive.DirtyCount) &&
9696- (!(CmHive->Hive.HiveFlags & HIVE_VOLATILE)) &&
9797- (!(CmHive->Hive.HiveFlags & HIVE_NOLAZYFLUSH)))
9595+ else if (CmHive->Hive.DirtyCount &&
9696+ !(CmHive->Hive.HiveFlags & HIVE_VOLATILE) &&
9797+ !(CmHive->Hive.HiveFlags & HIVE_NOLAZYFLUSH))
9898 {
9999 /* Use another lazy flusher for this hive */
100100 ASSERT(CmHive->FlushCount == CmpLazyFlushCount);
···145145{
146146 /* Check if we should queue the lazy flush worker */
147147 DPRINT("Flush pending: %s, Holding lazy flush: %s.\n", CmpLazyFlushPending ? "yes" : "no", CmpHoldLazyFlush ? "yes" : "no");
148148- if ((!CmpLazyFlushPending) && (!CmpHoldLazyFlush))
148148+ if (!CmpLazyFlushPending && !CmpHoldLazyFlush)
149149 {
150150 CmpLazyFlushPending = TRUE;
151151 ExQueueWorkItem(&CmpLazyWorkItem, DelayedWorkQueue);
···160160 PAGED_CODE();
161161162162 /* Check if we should set the lazy flush timer */
163163- if ((!CmpNoWrite) && (!CmpHoldLazyFlush))
163163+ if (!CmpNoWrite && !CmpHoldLazyFlush)
164164 {
165165 /* Do it */
166166 DueTime.QuadPart = Int32x32To64(CmpLazyFlushIntervalInSeconds,
···400400 (Status == STATUS_ACCOUNT_EXPIRED) ||
401401 (Status == STATUS_ACCOUNT_DISABLED) ||
402402 (Status == STATUS_ACCOUNT_RESTRICTION)) &&
403403- (ImpersonationContext))
403403+ ImpersonationContext)
404404 {
405405 /* We failed due to an account/security error, impersonate SYSTEM */
406406 Status = SeImpersonateClientEx(ImpersonationContext, NULL);
+7-7
ntoskrnl/config/cmparse.c
···3939 }
40404141 /* Check if we have a path separator */
4242- while ((RemainingName->Length) &&
4242+ while (RemainingName->Length &&
4343 (*RemainingName->Buffer == OBJ_NAME_PATH_SEPARATOR))
4444 {
4545 /* Skip it */
···50505151 /* Start loop at where the current buffer is */
5252 NextName->Buffer = RemainingName->Buffer;
5353- while ((RemainingName->Length) &&
5353+ while (RemainingName->Length &&
5454 (*RemainingName->Buffer != OBJ_NAME_PATH_SEPARATOR))
5555 {
5656 /* Move to the next character */
···18731873 PAGED_CODE();
1874187418751875 /* Loop path separators at the end */
18761876- while ((RemainingName->Length) &&
18761876+ while (RemainingName->Length &&
18771877 (RemainingName->Buffer[(RemainingName->Length / sizeof(WCHAR)) - 1] ==
18781878 OBJ_NAME_PATH_SEPARATOR))
18791879 {
···18881888 Current = *RemainingName;
1889188918901890 /* Check if this is a create */
18911891- if (!(ParseContext) || !(ParseContext->CreateOperation))
18911891+ if (!ParseContext || !ParseContext->CreateOperation)
18921892 {
18931893 /* It isn't, so no context */
18941894 ParseContext = NULL;
···20432043 {
20442044 /* Get the next component */
20452045 Result = CmpGetNextName(&Current, &NextName, &Last);
20462046- if ((Result) && (NextName.Length))
20462046+ if (Result && NextName.Length)
20472047 {
20482048 /* See if this is a sym link */
20492049 if (!(Kcb->Flags & KEY_SYM_LINK))
···21502150 else
21512151 {
21522152 /* Check if this was the last key for a create */
21532153- if ((Last) && (ParseContext))
21532153+ if (Last && ParseContext)
21542154 {
21552155 /* Check if we're doing a link node */
21562156 if (ParseContext->CreateLink)
···22462246 break;
22472247 }
22482248 }
22492249- else if ((Result) && (Last))
22492249+ else if (Result && Last)
22502250 {
22512251 /* Opening the root. Is this an exit node? */
22522252 if (Node->Flags & KEY_HIVE_EXIT)
+1-1
ntoskrnl/config/cmse.c
···4040 Sid[3] = ExAllocatePoolWithTag(PagedPool, SidLength, TAG_CMSD);
41414242 /* Make sure all SIDs were allocated */
4343- if (!(Sid[0]) || !(Sid[1]) || !(Sid[2]) || !(Sid[3]))
4343+ if (!Sid[0] || !Sid[1] || !Sid[2] || !Sid[3])
4444 {
4545 /* Bugcheck */
4646 KeBugCheckEx(REGISTRY_ERROR, 11, 1, 0, 0);
+10-10
ntoskrnl/config/cmsysini.c
···228228229229 /* Check if the provided buffer is too small to fit even anything */
230230 if ((Length <= sizeof(OBJECT_NAME_INFORMATION)) ||
231231- ((Length < (*ReturnLength)) && (BytesToCopy < sizeof(WCHAR))))
231231+ ((Length < *ReturnLength) && (BytesToCopy < sizeof(WCHAR))))
232232 {
233233 /* Free the buffer allocated by CmpConstructName */
234234 ExFreePoolWithTag(KeyName, TAG_CM);
···238238 }
239239240240 /* Check if the provided buffer can be partially written */
241241- if (Length < (*ReturnLength))
241241+ if (Length < *ReturnLength)
242242 {
243243 /* Yes, indicate so in the return status */
244244 Status = STATUS_INFO_LENGTH_MISMATCH;
···687687 ValueInfo = (PKEY_VALUE_FULL_INFORMATION)ValueInfoBuffer;
688688689689 /* Check if we failed or got a non DWORD-value */
690690- if (!(NT_SUCCESS(Status)) || (ValueInfo->Type != REG_DWORD))
690690+ if (!NT_SUCCESS(Status) || (ValueInfo->Type != REG_DWORD))
691691 {
692692 Status = STATUS_SUCCESS;
693693 goto Cleanup;
···728728 Status = NtOpenKey(&ProfileHandle,
729729 KEY_READ | KEY_WRITE,
730730 &ObjectAttributes);
731731- if (!NT_SUCCESS (Status))
731731+ if (!NT_SUCCESS(Status))
732732 {
733733 /* Cleanup and exit */
734734 Status = STATUS_SUCCESS;
···13191319 &CmHive,
13201320 &CmpMachineHiveList[i].Allocate,
13211321 CM_CHECK_REGISTRY_PURGE_VOLATILES);
13221322- if (!(NT_SUCCESS(Status)) ||
13231323- (!(CmpShareSystemHives) && !(CmHive->FileHandles[HFILE_TYPE_LOG])))
13221322+ if (!NT_SUCCESS(Status) ||
13231323+ (!CmpShareSystemHives && !CmHive->FileHandles[HFILE_TYPE_LOG]))
13241324 {
13251325 /*
13261326 * We failed, or could not get a log file (unless
···13561356 TRUE,
13571357 FALSE,
13581358 &ClusterSize);
13591359- if (!(NT_SUCCESS(Status)) || !(AlternateHandle))
13591359+ if (!NT_SUCCESS(Status) || !AlternateHandle)
13601360 {
13611361 /* Couldn't open the hive or its alternate file, raise a hard error */
13621362 ErrorParameters = &FileName;
···21112111 Index1 = GET_HASH_INDEX(ConvKey1);
21122112 Index2 = GET_HASH_INDEX(ConvKey2);
21132113 ASSERT((GET_HASH_ENTRY(CmpCacheTable, ConvKey2)->Owner == KeGetCurrentThread()) ||
21142114- (CmpTestRegistryLockExclusive()));
21142114+ CmpTestRegistryLockExclusive());
2115211521162116 /* See which one is highest */
21172117 if (Index1 < Index2)
21182118 {
21192119 /* Grab them in the proper order */
21202120 ASSERT((GET_HASH_ENTRY(CmpCacheTable, ConvKey1)->Owner == KeGetCurrentThread()) ||
21212121- (CmpTestRegistryLockExclusive()));
21212121+ CmpTestRegistryLockExclusive());
21222122 CmpReleaseKcbLockByKey(ConvKey2);
21232123 CmpReleaseKcbLockByKey(ConvKey1);
21242124 }
···21282128 if (Index1 != Index2)
21292129 {
21302130 ASSERT((GET_HASH_ENTRY(CmpCacheTable, ConvKey1)->Owner == KeGetCurrentThread()) ||
21312131- (CmpTestRegistryLockExclusive()));
21312131+ CmpTestRegistryLockExclusive());
21322132 CmpReleaseKcbLockByKey(ConvKey1);
21332133 }
21342134 CmpReleaseKcbLockByKey(ConvKey2);
+10-10
ntoskrnl/config/cmvalche.c
···6969 else
7070 {
7171 /* Make sure the KCB is locked exclusive */
7272- if (!(CmpIsKcbLockedExclusive(Kcb)) &&
7373- !(CmpTryToConvertKcbSharedToExclusive(Kcb)))
7272+ if (!CmpIsKcbLockedExclusive(Kcb) &&
7373+ !CmpTryToConvertKcbSharedToExclusive(Kcb))
7474 {
7575 /* We need the exclusive lock */
7676 return SearchNeedExclusiveLock;
···7979 /* Select the value list as our cell, and get the actual list array */
8080 CellToRelease = ChildList->ValueList;
8181 *CellData = (PCELL_DATA)HvGetCell(Hive, CellToRelease);
8282- if (!(*CellData)) return SearchFail;
8282+ if (!*CellData) return SearchFail;
83838484 /* FIXME: Here we would cache the value */
8585···229229 if (SearchResult != SearchSuccess)
230230 {
231231 /* We either failed or need the exclusive lock */
232232- ASSERT((SearchResult == SearchFail) || !(CmpIsKcbLockedExclusive(Kcb)));
232232+ ASSERT((SearchResult == SearchFail) || !CmpIsKcbLockedExclusive(Kcb));
233233 ASSERT(Cell == HCELL_NIL);
234234 return SearchResult;
235235 }
···260260 if (SearchResult != SearchSuccess)
261261 {
262262 /* We either failed or need the exclusive lock */
263263- ASSERT((SearchResult == SearchFail) || !(CmpIsKcbLockedExclusive(Kcb)));
263263+ ASSERT((SearchResult == SearchFail) || !CmpIsKcbLockedExclusive(Kcb));
264264 ASSERT(Cell == HCELL_NIL);
265265 return SearchResult;
266266 }
···552552 }
553553554554 /* Sanity check */
555555- ASSERT((IsSmall ? (Size <= CM_KEY_VALUE_SMALL) : TRUE));
555555+ ASSERT(IsSmall ? (Size <= CM_KEY_VALUE_SMALL) : TRUE);
556556557557 /* Make sure we have a valid buffer */
558558 if (Buffer)
···658658 }
659659660660 /* Sanity check */
661661- ASSERT((IsSmall ? (Size <= CM_KEY_VALUE_SMALL) : TRUE));
661661+ ASSERT(IsSmall ? (Size <= CM_KEY_VALUE_SMALL) : TRUE);
662662663663 /* Make sure we have a valid buffer */
664664 if (Buffer)
···719719 if (Kcb->Flags & KEY_SYM_LINK)
720720 {
721721 /* We need the exclusive lock */
722722- if (!(CmpIsKcbLockedExclusive(Kcb)) &&
723723- !(CmpTryToConvertKcbSharedToExclusive(Kcb)))
722722+ if (!CmpIsKcbLockedExclusive(Kcb) &&
723723+ !CmpTryToConvertKcbSharedToExclusive(Kcb))
724724 {
725725 /* We need the exclusive lock */
726726 return SearchNeedExclusiveLock;
···734734 CmpCleanUpKcbValueCache(Kcb);
735735736736 /* Sanity checks */
737737- ASSERT(!(CMP_IS_CELL_CACHED(Kcb->ValueCache.ValueList)));
737737+ ASSERT(!CMP_IS_CELL_CACHED(Kcb->ValueCache.ValueList));
738738 ASSERT(!(Kcb->ExtFlags & CM_KCB_SYM_LINK_FOUND));
739739740740 /* Set the value cache */
+7-7
ntoskrnl/config/ntapi.c
···805805 goto Quit;
806806807807 /* Make sure the name is aligned properly */
808808- if ((ValueNameCopy.Length & (sizeof(WCHAR) - 1)))
808808+ if (ValueNameCopy.Length & (sizeof(WCHAR) - 1))
809809 {
810810 /* It isn't, so we'll fail */
811811 Status = STATUS_INVALID_PARAMETER;
···813813 }
814814815815 /* Ignore any null characters at the end */
816816- while ((ValueNameCopy.Length) &&
816816+ while (ValueNameCopy.Length &&
817817 !(ValueNameCopy.Buffer[ValueNameCopy.Length / sizeof(WCHAR) - 1]))
818818 {
819819 /* Skip it */
···947947 KeyHandle, &ValueNameCopy, TitleIndex, Type, DataSize);
948948949949 /* Make sure the name is aligned, not too long, and the data under 4GB */
950950- if ( (ValueNameCopy.Length > 32767) ||
951951- ((ValueNameCopy.Length & (sizeof(WCHAR) - 1))) ||
952952- (DataSize > 0x80000000))
950950+ if ((ValueNameCopy.Length > 32767) ||
951951+ (ValueNameCopy.Length & (sizeof(WCHAR) - 1)) ||
952952+ (DataSize > 0x80000000))
953953 {
954954 /* Fail */
955955 Status = STATUS_INVALID_PARAMETER;
···957957 }
958958959959 /* Ignore any null characters at the end */
960960- while ((ValueNameCopy.Length) &&
960960+ while (ValueNameCopy.Length &&
961961 !(ValueNameCopy.Buffer[ValueNameCopy.Length / sizeof(WCHAR) - 1]))
962962 {
963963 /* Skip it */
···10391039 goto Quit;
1040104010411041 /* Make sure the name is aligned properly */
10421042- if ((ValueNameCopy.Length & (sizeof(WCHAR) - 1)))
10421042+ if (ValueNameCopy.Length & (sizeof(WCHAR) - 1))
10431043 {
10441044 /* It isn't, so we'll fail */
10451045 Status = STATUS_INVALID_PARAMETER;
+25-27
sdk/lib/cmlib/hivewrt.c
···101101 * The hive log we are going to write data into
102102 * has to be writable and with a sane storage.
103103 */
104104- ASSERT(RegistryHive->ReadOnly == FALSE);
104104+ ASSERT(!RegistryHive->ReadOnly);
105105 ASSERT(RegistryHive->BaseBlock->Length ==
106106 RegistryHive->Storage[Stable].Length * HBLOCK_SIZE);
107107···109109 HvpValidateBaseHeader(RegistryHive);
110110111111 /*
112112- * The sequences can diverge in an occurrence of forced
113113- * shutdown of the system such as during a power failure,
114114- * the hardware crapping itself or during a system crash
115115- * when one of the sequences have been modified during
116116- * writing into the log or hive. In such cases the hive
117117- * needs a repair.
112112+ * The sequences can diverge during a forced system shutdown
113113+ * occurrence, such as during a power failure, a hardware
114114+ * failure or during a system crash, and when one of the
115115+ * sequences have been modified during writing into the log
116116+ * or hive. In such cases the hive needs a repair.
118117 */
119118 if (RegistryHive->BaseBlock->Sequence1 !=
120119 RegistryHive->BaseBlock->Sequence2)
···324323 ULONG LastIndex;
325324 PVOID Block;
326325327327- ASSERT(RegistryHive->ReadOnly == FALSE);
326326+ ASSERT(!RegistryHive->ReadOnly);
328327 ASSERT(RegistryHive->BaseBlock->Length ==
329328 RegistryHive->Storage[Stable].Length * HBLOCK_SIZE);
330329 ASSERT(RegistryHive->BaseBlock->RootCell != HCELL_NIL);
···333332 HvpValidateBaseHeader(RegistryHive);
334333335334 /*
336336- * The sequences can diverge in an occurrence of forced
337337- * shutdown of the system such as during a power failure,
338338- * the hardware crapping itself or during a system crash
339339- * when one of the sequences have been modified during
340340- * writing into the log or hive. In such cases the hive
341341- * needs a repair.
335335+ * The sequences can diverge during a forced system shutdown
336336+ * occurrence, such as during a power failure, a hardware
337337+ * failure or during a system crash, and when one of the
338338+ * sequences have been modified during writing into the log
339339+ * or hive. In such cases the hive needs a repair.
342340 */
343341 if (RegistryHive->BaseBlock->Sequence1 !=
344342 RegistryHive->BaseBlock->Sequence2)
···372370 while (BlockIndex < RegistryHive->Storage[Stable].Length)
373371 {
374372 /*
375375- * If we have to syncrhonize the registry hive we
373373+ * If we have to synchronize the registry hive we
376374 * want to look for dirty blocks to reflect the new
377375 * updates done to the hive. Otherwise just write
378376 * all the blocks as if we were doing a regular
379379- * writing of the hive.
377377+ * hive write.
380378 */
381379 if (OnlyDirty)
382380 {
···420418421419 /*
422420 * Increment the secondary sequence number and
423423- * update the checksum. A successful transaction
424424- * writing of hive is both of sequences are the
425425- * same indicating the writing operation didn't
421421+ * update the checksum. A successful hive write
422422+ * transaction is when both of sequences are the
423423+ * same, indicating the write operation didn't
426424 * fail.
427425 */
428426 RegistryHive->BaseBlock->Sequence2++;
···476474 BOOLEAN HardErrors;
477475#endif
478476479479- ASSERT(RegistryHive->ReadOnly == FALSE);
477477+ ASSERT(!RegistryHive->ReadOnly);
480478 ASSERT(RegistryHive->Signature == HV_HHIVE_SIGNATURE);
481479482480 /*
···522520 KeQuerySystemTime(&RegistryHive->BaseBlock->TimeStamp);
523521#endif
524522525525- /* Update the log file of hive if present */
526526- if (RegistryHive->Log == TRUE)
523523+ /* Update the hive log file if present */
524524+ if (RegistryHive->Log)
527525 {
528526 if (!HvpWriteLog(RegistryHive))
529527 {
···546544 }
547545548546 /* Update the alternate hive file if present */
549549- if (RegistryHive->Alternate == TRUE)
547547+ if (RegistryHive->Alternate)
550548 {
551549 if (!HvpWriteHive(RegistryHive, TRUE, HFILE_TYPE_ALTERNATE))
552550 {
···615613HvWriteHive(
616614 _In_ PHHIVE RegistryHive)
617615{
618618- ASSERT(RegistryHive->ReadOnly == FALSE);
616616+ ASSERT(!RegistryHive->ReadOnly);
619617 ASSERT(RegistryHive->Signature == HV_HHIVE_SIGNATURE);
620618621619#if !defined(_BLDR_)
···653651HvWriteAlternateHive(
654652 _In_ PHHIVE RegistryHive)
655653{
656656- ASSERT(RegistryHive->ReadOnly == FALSE);
654654+ ASSERT(!RegistryHive->ReadOnly);
657655 ASSERT(RegistryHive->Signature == HV_HHIVE_SIGNATURE);
658658- ASSERT(RegistryHive->Alternate == TRUE);
656656+ ASSERT(RegistryHive->Alternate);
659657660658#if !defined(_BLDR_)
661659 /* Update hive header modification time */
···691689HvSyncHiveFromRecover(
692690 _In_ PHHIVE RegistryHive)
693691{
694694- ASSERT(RegistryHive->ReadOnly == FALSE);
692692+ ASSERT(!RegistryHive->ReadOnly);
695693 ASSERT(RegistryHive->Signature == HV_HHIVE_SIGNATURE);
696694697695 /* Call the private API call to do the deed for us */