Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

edithive.h File Reference

#include "ntos.h"
#include "cmp.h"

Go to the source code of this file.

Defines

#define TYPE_SIMPLE   0
#define TYPE_LOG   1
#define TYPE_ALT   2

Functions

HANDLE EhOpenHive (IN PUNICODE_STRING FileName, OUT PHANDLE RootCell, OUT PUNICODE_STRING RootName, IN ULONG HiveType)
VOID EhCloseHive (IN HANDLE Hive)
NTSTATUS EhEnumerateValueKey (IN HANDLE HiveHandle, IN HANDLE CellHandle, IN ULONG Index, IN KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass, IN PVOID KeyValueInformation, IN ULONG Length, IN PULONG ResultLength)
NTSTATUS EhEnumerateKey (IN HANDLE HiveHandle, IN HANDLE CellHandle, IN ULONG Index, IN KEY_INFORMATION_CLASS KeyInformationClass, IN PVOID KeyInformation, IN ULONG Length, IN PULONG ResultLength)
NTSTATUS EhOpenChildByName (HANDLE HiveHandle, HANDLE KeyHandle, PUNICODE_STRING Name, PHANDLE ChildCell)
NTSTATUS EhCreateChild (IN HANDLE HiveHandle, IN HANDLE CellHandle, IN PUNICODE_STRING Name, OUT PHANDLE ChildCell, OUT PULONG Disposition OPTIONAL)
NTSTATUS EhQueryKey (IN HANDLE HiveHandle, IN HANDLE KeyHandle, IN KEY_INFORMATION_CLASS KeyInformationClass, IN PVOID KeyInformation, IN ULONG Length, IN PULONG ResultLength)
NTSTATUS EhQueryValueKey (IN HANDLE HiveHandle, IN HANDLE KeyHandle, IN PUNICODE_STRING ValueName, IN KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass, IN PVOID KeyValueInformation, IN ULONG Length, IN PULONG ResultLength)
NTSTATUS EhSetValueKey (IN HANDLE HiveHandle, IN HANDLE CellHandle, IN PUNICODE_STRING ValueName, IN ULONG TitleIndex OPTIONAL, IN ULONG Type, IN PVOID Data, IN ULONG DataSize)
NTSTATUS EhDeleteValueKey (IN HANDLE Hive, IN HANDLE Cell, IN PUNICODE_STRING ValueName)
PSECURITY_DESCRIPTOR EhGetKeySecurity (IN HANDLE HiveHandle, IN HANDLE KeyHandle)


Define Documentation

#define TYPE_ALT   2
 

Definition at line 28 of file edithive.h.

Referenced by EhOpenHive().

#define TYPE_LOG   1
 

Definition at line 27 of file edithive.h.

Referenced by EhOpenHive().

#define TYPE_SIMPLE   0
 

Definition at line 26 of file edithive.h.

Referenced by EhOpenHive(), main(), and RiInitializeRegistryFromAsciiFile().


Function Documentation

VOID EhCloseHive IN HANDLE  Hive  ) 
 

Definition at line 124 of file edithive.c.

References CmpFree(), HFILE_TYPE_ALTERNATE, HFILE_TYPE_LOG, HFILE_TYPE_PRIMARY, HvSyncHive(), and NtClose().

Referenced by RiInitializeRegistryFromAsciiFile().

00130 : 00131 00132 Closes a hive, including writing all the data out to disk and freeing 00133 the relevant structures. 00134 00135 Arguments: 00136 00137 HiveHandle - Supplies a handle to the hive control structure 00138 00139 Return Value: 00140 00141 None. 00142 00143 --*/ 00144 00145 { 00146 HvSyncHive((PHHIVE)HiveHandle); 00147 NtClose(((PCMHIVE)HiveHandle)->FileHandles[HFILE_TYPE_PRIMARY]); 00148 NtClose(((PCMHIVE)HiveHandle)->FileHandles[HFILE_TYPE_ALTERNATE]); 00149 NtClose(((PCMHIVE)HiveHandle)->FileHandles[HFILE_TYPE_LOG]); 00150 CmpFree((PCMHIVE)HiveHandle, sizeof(CMHIVE)); 00151 00152 }

NTSTATUS EhCreateChild IN HANDLE  HiveHandle,
IN HANDLE  CellHandle,
IN PUNICODE_STRING  Name,
OUT PHANDLE  ChildCell,
OUT PULONG Disposition  OPTIONAL
 

Definition at line 625 of file edithive.c.

References _HHIVE::BaseBlock, _CM_KEY_NODE::Class, _CM_KEY_NODE::ClassLength, CM_KEY_NODE_SIGNATURE, CmpAddSubKey(), CmpFreeKeyByCell(), CmpHKeyNodeSize, _CHILD_LIST::Count, EhpAttachSecurity(), FALSE, _CM_KEY_NODE::Flags, Handle, HCELL_INDEX, HCELL_NIL, Hive, HvAllocateCell(), HvGetCell, Index, KeQuerySystemTime(), KeyBodyNode, _CM_KEY_NODE::LastWriteTime, _CHILD_LIST::List, _CM_KEY_NODE::MaxClassLen, _CM_KEY_NODE::MaxNameLen, _CM_KEY_NODE::MaxValueDataLen, _CM_KEY_NODE::MaxValueNameLen, _CM_KEY_NODE::Name, Name, _CM_KEY_NODE::NameLength, NTSTATUS(), _CM_KEY_NODE::Parent, PHCELL_INDEX, _CM_KEY_SECURITY::ReferenceCount, _HBASE_BLOCK::RootCell, _CM_KEY_NODE::Security, _CM_KEY_NODE::Signature, _CM_KEY_NODE::Spare, Stable, Status, _CM_KEY_NODE::SubKeyCounts, _CM_KEY_NODE::SubKeyLists, _CM_KEY_NODE::ValueList, and Volatile.

Referenced by RiInitializeRegistryFromAsciiFile().

00634 : 00635 00636 Attempts to open the given child subkey specified by name. If the 00637 child does not exist, it is created. 00638 00639 Arguments: 00640 00641 HiveHandle - handle of hive control structure for hive of interest 00642 00643 CellHandle - handle for parent cell 00644 00645 00646 Name - name of child object to create 00647 00648 ChildCell - pointer to variable to receive cell index of child 00649 00650 Disposition - This optional parameter is a pointer to a variable 00651 that will receive a value indicating whether a new Registry 00652 key was created or an existing one opened: 00653 00654 REG_CREATED_NEW_KEY - A new Registry Key was created 00655 REG_OPENED_EXISTING_KEY - An existing Registry Key was opened 00656 00657 Return Value: 00658 00659 status 00660 00661 --*/ 00662 { 00663 PHCELL_INDEX Index; 00664 NTSTATUS Status; 00665 PHHIVE Hive; 00666 HCELL_INDEX NewCell; 00667 HCELL_INDEX NewListCell; 00668 HCELL_INDEX OldListCell; 00669 PHCELL_INDEX NewList; 00670 PHCELL_INDEX OldList; 00671 PCM_KEY_NODE Child; 00672 PCM_KEY_NODE Parent; 00673 PCM_KEY_SECURITY Security; 00674 HANDLE Handle; 00675 ULONG oldcount; 00676 00677 Hive = &((PCMHIVE)HiveHandle)->Hive; 00678 00679 if ((HCELL_INDEX)CellHandle == HCELL_NIL) { 00680 if (Hive->BaseBlock->RootCell != HCELL_NIL) { 00681 *ChildCell = (HANDLE)(Hive->BaseBlock->RootCell); 00682 if (ARGUMENT_PRESENT(Disposition)) { 00683 *Disposition = REG_OPENED_EXISTING_KEY; 00684 } 00685 return(STATUS_SUCCESS); 00686 } else { 00687 Status = STATUS_OBJECT_NAME_NOT_FOUND; 00688 } 00689 } else { 00690 Parent = (PCM_KEY_NODE)HvGetCell(Hive, (HCELL_INDEX)CellHandle); 00691 Status = CmpFindChildByName(Hive, 00692 (HCELL_INDEX)CellHandle, 00693 *Name, 00694 KeyBodyNode, 00695 (PHCELL_INDEX)ChildCell, 00696 &Index); 00697 } 00698 if (Status == STATUS_OBJECT_NAME_NOT_FOUND) { 00699 00700 NewCell = HvAllocateCell(Hive, 00701 CmpHKeyNodeSize(Hive,Name->Length), 00702 Stable); 00703 if (NewCell != HCELL_NIL) { 00704 00705 *ChildCell = (HANDLE)NewCell; 00706 Child = (PCM_KEY_NODE)HvGetCell(Hive, NewCell); 00707 00708 Child->Signature = CM_KEY_NODE_SIGNATURE; 00709 Child->Flags = 0; 00710 00711 KeQuerySystemTime(&(Child->LastWriteTime)); 00712 00713 Child->Spare = 0; 00714 Child->Parent = (HCELL_INDEX)CellHandle; 00715 00716 Child->ValueList.Count = 0; 00717 Child->ValueList.List = HCELL_NIL; 00718 Child->u1.s1.Security = HCELL_NIL; 00719 Child->u1.s1.Class = HCELL_NIL; 00720 Child->NameLength = Name->Length; 00721 Child->ClassLength = 0; 00722 00723 Child->SubKeyCounts[Stable] = 0; 00724 Child->SubKeyCounts[Volatile] = 0; 00725 Child->SubKeyLists[Stable] = HCELL_NIL; 00726 Child->SubKeyLists[Volatile] = HCELL_NIL; 00727 00728 Child->MaxValueDataLen = 0; 00729 Child->MaxNameLen = 0; 00730 Child->MaxValueNameLen = 0; 00731 Child->MaxClassLen = 0; 00732 00733 if((HCELL_INDEX)CellHandle == HCELL_NIL) { 00734 Hive->BaseBlock->RootCell = NewCell; 00735 Status = EhpAttachSecurity(Hive, NewCell); 00736 } else { 00737 Child->u1.s1.Security = Parent->u1.s1.Security; 00738 Security = (PCM_KEY_SECURITY)HvGetCell(Hive, Child->u1.s1.Security); 00739 ++Security->ReferenceCount; 00740 } 00741 00742 RtlMoveMemory( 00743 &(Child->Name[0]), 00744 Name->Buffer, 00745 Name->Length 00746 ); 00747 00748 Status = STATUS_SUCCESS; 00749 } else { 00750 Status == STATUS_INSUFFICIENT_RESOURCES; 00751 return(Status); 00752 } 00753 if (ARGUMENT_PRESENT(Disposition)) { 00754 *Disposition = REG_CREATED_NEW_KEY; 00755 } 00756 00757 if ((HCELL_INDEX)CellHandle != HCELL_NIL) { 00758 00759 // 00760 // put newly created child into parent's sub key list 00761 // 00762 if (! CmpAddSubKey(Hive, (HCELL_INDEX)CellHandle, NewCell)) { 00763 CmpFreeKeyByCell(Hive, NewCell, FALSE); 00764 return STATUS_INSUFFICIENT_RESOURCES; 00765 } 00766 00767 Parent = (PCM_KEY_NODE)HvGetCell(Hive, (HCELL_INDEX)CellHandle); 00768 00769 if (Parent->MaxNameLen < Name->Length) { 00770 Parent->MaxNameLen = Name->Length; 00771 } 00772 Parent->MaxClassLen = 0; 00773 } 00774 } else { 00775 Status = STATUS_SUCCESS; 00776 if (ARGUMENT_PRESENT(Disposition)) { 00777 *Disposition = REG_OPENED_EXISTING_KEY; 00778 } 00779 } 00780 return(Status); 00781 }

NTSTATUS EhDeleteValueKey IN HANDLE  Hive,
IN HANDLE  Cell,
IN PUNICODE_STRING  ValueName
 

Definition at line 943 of file edithive.c.

References CmDeleteValueKey(), FALSE, HCELL_INDEX, kcb(), NULL, and ValueName.

Referenced by RiInitializeRegistryFromAsciiFile().

00950 : 00951 00952 One of the value entries of a registry key may be removed with this call. 00953 00954 The value entry with ValueName matching ValueName is removed from the key. 00955 If no such entry exists, an error is returned. 00956 00957 Arguments: 00958 00959 Hive - Supplies a handle to the hive control structure 00960 00961 Cell - Supplies a handle to the registry key to be operated on 00962 00963 ValueName - The name of the value to be deleted. NULL is a legal name. 00964 00965 Return Value: 00966 00967 NTSTATUS - Result code from call, among the following: 00968 00969 <TBS> 00970 00971 --*/ 00972 { 00973 CM_KEY_CONTROL_BLOCK kcb; 00974 00975 kcb.Delete = FALSE; 00976 kcb.Signature = CM_KEY_CONTROL_BLOCK_SIGNATURE; 00977 kcb.KeyHive = &((PCMHIVE)HiveHandle)->Hive; 00978 kcb.KeyCell = (HCELL_INDEX)CellHandle; 00979 kcb.FullName.Length = 0; 00980 kcb.FullName.MaximumLength = 0; 00981 kcb.FullName.Buffer = NULL; 00982 00983 return(CmDeleteValueKey(&kcb, *ValueName)); 00984 }

NTSTATUS EhEnumerateKey IN HANDLE  HiveHandle,
IN HANDLE  CellHandle,
IN ULONG  Index,
IN KEY_INFORMATION_CLASS  KeyInformationClass,
IN PVOID  KeyInformation,
IN ULONG  Length,
IN PULONG  ResultLength
 

Definition at line 320 of file edithive.c.

References CmEnumerateKey(), FALSE, HCELL_INDEX, Index, and kcb().

Referenced by DumpKeys().

00331 : 00332 00333 Enumerate sub keys, return data on Index'th entry. 00334 00335 CmEnumerateKey returns the name of the Index'th sub key of the open 00336 key specified. The value STATUS_NO_MORE_ENTRIES will be 00337 returned if value of Index is larger than the number of sub keys. 00338 00339 Note that Index is simply a way to select among child keys. Two calls 00340 to CmEnumerateKey with the same Index are NOT guaranteed to return 00341 the same results. 00342 00343 If KeyInformation is not long enough to hold all requested data, 00344 STATUS_BUFFER_OVERFLOW will be returned, and ResultLength will be 00345 set to the number of bytes actually required. 00346 00347 Arguments: 00348 00349 Hive - supplies a pointer to the hive control structure for the hive 00350 00351 Cell - supplies index of node to whose sub keys are to be found 00352 00353 Index - Specifies the (0-based) number of the sub key to be returned. 00354 00355 KeyInformationClass - Specifies the type of information returned in 00356 Buffer. One of the following types: 00357 00358 KeyBasicInformation - return last write time, title index, and name. 00359 (see KEY_BASIC_INFORMATION structure) 00360 00361 KeyNodeInformation - return last write time, title index, name, class. 00362 (see KEY_NODE_INFORMATION structure) 00363 00364 KeyInformation -Supplies pointer to buffer to receive the data. 00365 00366 Length - Length of KeyInformation in bytes. 00367 00368 ResultLength - Number of bytes actually written into KeyInformation. 00369 00370 Return Value: 00371 00372 NTSTATUS - Result code from call, among the following: 00373 00374 <TBS> 00375 00376 --*/ 00377 { 00378 CM_KEY_CONTROL_BLOCK kcb; 00379 00380 kcb.Signature = CM_KEY_CONTROL_BLOCK_SIGNATURE; 00381 kcb.Delete = FALSE; 00382 kcb.KeyHive = &((PCMHIVE)HiveHandle)->Hive; 00383 kcb.KeyCell = (HCELL_INDEX)CellHandle; 00384 kcb.RefCount = 1; 00385 00386 return(CmEnumerateKey(&kcb, 00387 Index, 00388 KeyInformationClass, 00389 KeyInformation, 00390 Length, 00391 ResultLength)); 00392 }

NTSTATUS EhEnumerateValueKey IN HANDLE  HiveHandle,
IN HANDLE  CellHandle,
IN ULONG  Index,
IN KEY_VALUE_INFORMATION_CLASS  KeyValueInformationClass,
IN PVOID  KeyValueInformation,
IN ULONG  Length,
IN PULONG  ResultLength
 

Definition at line 396 of file edithive.c.

References CmEnumerateValueKey(), FALSE, HCELL_INDEX, Index, and kcb().

Referenced by DumpValues().

00407 : 00408 00409 The value entries of an open key may be enumerated. 00410 00411 CmEnumerateValueKey returns the name of the Index'th value 00412 entry of the open key specified by KeyHandle. The value 00413 STATUS_NO_MORE_ENTRIES will be returned if value of Index is 00414 larger than the number of sub keys. 00415 00416 Note that Index is simply a way to select among value 00417 entries. Two calls to NtEnumerateValueKey with the same Index 00418 are NOT guaranteed to return the same results. 00419 00420 If KeyValueInformation is not long enough to hold all requested data, 00421 STATUS_BUFFER_OVERFLOW will be returned, and ResultLength will be 00422 set to the number of bytes actually required. 00423 00424 Arguments: 00425 00426 Hive - supplies a handle to the hive 00427 00428 Cell - supplies handle to node whose sub keys are to be found 00429 00430 Index - Specifies the (0-based) number of the sub key to be returned. 00431 00432 KeyValueInformationClass - Specifies the type of information returned 00433 in Buffer. One of the following types: 00434 00435 KeyValueBasicInformation - return time of last write, 00436 title index, and name. (See KEY_VALUE_BASIC_INFORMATION) 00437 00438 KeyValueFullInformation - return time of last write, 00439 title index, name, class. (See KEY_VALUE_FULL_INFORMATION) 00440 00441 KeyValueInformation -Supplies pointer to buffer to receive the data. 00442 00443 Length - Length of KeyValueInformation in bytes. 00444 00445 ResultLength - Number of bytes actually written into KeyValueInformation. 00446 00447 Return Value: 00448 00449 NTSTATUS - Result code from call, among the following: 00450 00451 <TBS> 00452 00453 --*/ 00454 { 00455 CM_KEY_CONTROL_BLOCK kcb; 00456 00457 kcb.Signature = CM_KEY_CONTROL_BLOCK_SIGNATURE; 00458 kcb.Delete = FALSE; 00459 kcb.KeyHive = (PHHIVE)&(((PCMHIVE)HiveHandle)->Hive); 00460 kcb.KeyCell = (HCELL_INDEX)CellHandle; 00461 kcb.RefCount = 1; 00462 00463 return(CmEnumerateValueKey(&kcb, 00464 Index, 00465 KeyValueInformationClass, 00466 KeyValueInformation, 00467 Length, 00468 ResultLength)); 00469 }

PSECURITY_DESCRIPTOR EhGetKeySecurity IN HANDLE  HiveHandle,
IN HANDLE  KeyHandle
 

Definition at line 854 of file edithive.c.

References CmpGetObjectSecurity(), _CM_KEY_SECURITY::Descriptor, HCELL_INDEX, Hive, and NULL.

00858 { 00859 PCM_KEY_SECURITY Security; 00860 00861 CmpGetObjectSecurity((HCELL_INDEX)KeyHandle, 00862 &((PCMHIVE)HiveHandle)->Hive, 00863 &Security, 00864 NULL); 00865 00866 return(&Security->Descriptor); 00867 }

NTSTATUS EhOpenChildByName HANDLE  HiveHandle,
HANDLE  KeyHandle,
PUNICODE_STRING  Name,
PHANDLE  ChildCell
 

Definition at line 585 of file edithive.c.

References HCELL_INDEX, Hive, Index, KeyBodyNode, Name, and PHCELL_INDEX.

Referenced by DumpKeys().

00593 : 00594 00595 Find the child subkey cell specified by Name. 00596 00597 Arguments: 00598 00599 HiveHandle - handle of hive control structure for hive of interest 00600 00601 CellHandle - handle for parent cell 00602 00603 Name - name of child object to find 00604 00605 ChildCell - pointer to variable to receive cell index of child 00606 00607 Return Value: 00608 00609 status 00610 00611 --*/ 00612 { 00613 PHCELL_INDEX Index; 00614 00615 return(CmpFindChildByName(&((PCMHIVE)HiveHandle)->Hive, 00616 (HCELL_INDEX)CellHandle, 00617 *Name, 00618 KeyBodyNode, 00619 (PHCELL_INDEX)ChildCell, 00620 &Index)); 00621 }

HANDLE EhOpenHive IN PUNICODE_STRING  FileName,
OUT PHANDLE  RootCell,
OUT PUNICODE_STRING  RootName,
IN ULONG  HiveType
 

Referenced by main(), and RiInitializeRegistryFromAsciiFile().

NTSTATUS EhQueryKey IN HANDLE  HiveHandle,
IN HANDLE  KeyHandle,
IN KEY_INFORMATION_CLASS  KeyInformationClass,
IN PVOID  KeyInformation,
IN ULONG  Length,
IN PULONG  ResultLength
 

Definition at line 785 of file edithive.c.

References CmQueryKey(), _CM_KEY_CONTROL_BLOCK::Delete, FALSE, HCELL_INDEX, _CM_KEY_CONTROL_BLOCK::KeyCell, _CM_KEY_CONTROL_BLOCK::KeyHive, and NULL.

Referenced by RiInitializeRegistryFromAsciiFile().

00795 : 00796 00797 Data about the class of a key, and the numbers and sizes of its 00798 children and value entries may be queried with CmQueryKey. 00799 00800 NOTE: The returned lengths are guaranteed to be at least as 00801 long as the described values, but may be longer in 00802 some circumstances. 00803 00804 Arguments: 00805 00806 Hive - supplies a handle to the hive control structure for the hive 00807 00808 Cell - supplies handle of node to whose sub keys are to be found 00809 00810 KeyInformationClass - Specifies the type of information 00811 returned in Buffer. One of the following types: 00812 00813 KeyBasicInformation - return last write time, title index, and name. 00814 (See KEY_BASIC_INFORMATION) 00815 00816 KeyNodeInformation - return last write time, title index, name, class. 00817 (See KEY_NODE_INFORMATION) 00818 00819 KeyFullInformation - return all data except for name and security. 00820 (See KEY_FULL_INFORMATION) 00821 00822 KeyInformation -Supplies pointer to buffer to receive the data. 00823 00824 Length - Length of KeyInformation in bytes. 00825 00826 ResultLength - Number of bytes actually written into KeyInformation. 00827 00828 Return Value: 00829 00830 NTSTATUS - Result code from call, among the following: 00831 00832 <TBS> 00833 00834 --*/ 00835 { 00836 CM_KEY_CONTROL_BLOCK Kcb; 00837 00838 Kcb.Delete = FALSE; 00839 Kcb.Signature = CM_KEY_CONTROL_BLOCK_SIGNATURE; 00840 Kcb.KeyHive = &((PCMHIVE)HiveHandle)->Hive; 00841 Kcb.KeyCell = (HCELL_INDEX)KeyHandle; 00842 Kcb.FullName.Length = 0; 00843 Kcb.FullName.MaximumLength = 0; 00844 Kcb.FullName.Buffer = NULL; 00845 00846 return(CmQueryKey(&Kcb, 00847 KeyInformationClass, 00848 KeyInformation, 00849 Length, 00850 ResultLength)); 00851 }

NTSTATUS EhQueryValueKey IN HANDLE  HiveHandle,
IN HANDLE  KeyHandle,
IN PUNICODE_STRING  ValueName,
IN KEY_VALUE_INFORMATION_CLASS  KeyValueInformationClass,
IN PVOID  KeyValueInformation,
IN ULONG  Length,
IN PULONG  ResultLength
 

Definition at line 871 of file edithive.c.

References CmQueryValueKey(), FALSE, HCELL_INDEX, kcb(), NULL, and ValueName.

Referenced by RiInitializeRegistryFromAsciiFile().

00882 : 00883 00884 The ValueName, TitleIndex, Type, and Data for any one of a key's 00885 value entries may be queried with CmQueryValueKey. 00886 00887 If KeyValueInformation is not long enough to hold all requested data, 00888 STATUS_BUFFER_OVERFLOW will be returned, and ResultLength will be 00889 set to the number of bytes actually required. 00890 00891 Arguments: 00892 00893 Hive - supplies a pointer to the hive control structure for the hive 00894 00895 Cell - supplies index of node to whose sub keys are to be found 00896 00897 ValueName - The name of the value entry to return data for. 00898 00899 KeyValueInformationClass - Specifies the type of information 00900 returned in KeyValueInformation. One of the following types: 00901 00902 KeyValueBasicInformation - return time of last write, title 00903 index, and name. (See KEY_VALUE_BASIC_INFORMATION) 00904 00905 KeyValueFullInformation - return time of last write, title 00906 index, name, class. (See KEY_VALUE_FULL_INFORMATION) 00907 00908 KeyValueInformation -Supplies pointer to buffer to receive the data. 00909 00910 Length - Length of KeyValueInformation in bytes. 00911 00912 ResultLength - Number of bytes actually written into KeyValueInformation. 00913 00914 Return Value: 00915 00916 NTSTATUS - Result code from call, among the following: 00917 00918 <TBS> 00919 00920 --*/ 00921 { 00922 CM_KEY_CONTROL_BLOCK kcb; 00923 00924 kcb.Delete = FALSE; 00925 kcb.Signature = CM_KEY_CONTROL_BLOCK_SIGNATURE; 00926 kcb.KeyHive = &((PCMHIVE)HiveHandle)->Hive; 00927 kcb.KeyCell = (HCELL_INDEX)KeyHandle; 00928 kcb.FullName.Length = 0; 00929 kcb.FullName.MaximumLength = 0; 00930 kcb.FullName.Buffer = NULL; 00931 00932 return(CmQueryValueKey(&kcb, 00933 *ValueName, 00934 KeyValueInformationClass, 00935 KeyValueInformation, 00936 Length, 00937 ResultLength)); 00938 00939 }

NTSTATUS EhSetValueKey IN HANDLE  HiveHandle,
IN HANDLE  CellHandle,
IN PUNICODE_STRING  ValueName,
IN ULONG TitleIndex  OPTIONAL,
IN ULONG  Type,
IN PVOID  Data,
IN ULONG  DataSize
 

Definition at line 515 of file edithive.c.

References CmSetValueKey(), FALSE, HCELL_INDEX, kcb(), NULL, and ValueName.

Referenced by RiInitializeRegistryFromAsciiFile().

00526 : 00527 00528 A value entry may be created or replaced with EhSetValueKey. 00529 00530 If a value entry with a Value ID (i.e. name) matching the 00531 one specified by ValueName exists, it is deleted and replaced 00532 with the one specified. If no such value entry exists, a new 00533 one is created. NULL is a legal Value ID. While Value IDs must 00534 be unique within any given key, the same Value ID may appear 00535 in many different keys. 00536 00537 Arguments: 00538 00539 HiveHandle - handle of hive control structure for hive of interest 00540 00541 CellHandle - handle for parent cell 00542 00543 ValueName - The unique (relative to the containing key) name 00544 of the value entry. May be NULL. 00545 00546 TitleIndex - Supplies the title index for ValueName. The title 00547 index specifies the index of the localized alias for the ValueName. 00548 00549 Type - The integer type number of the value entry. 00550 00551 Data - Pointer to buffer with actual data for the value entry. 00552 00553 DataSize - Size of Data buffer. 00554 00555 00556 Return Value: 00557 00558 NTSTATUS - Result code from call, among the following: 00559 00560 <TBS> 00561 00562 --*/ 00563 { 00564 CM_KEY_CONTROL_BLOCK kcb; 00565 00566 kcb.Delete = FALSE; 00567 kcb.Signature = CM_KEY_CONTROL_BLOCK_SIGNATURE; 00568 kcb.KeyHive = (PHHIVE)&(((PCMHIVE)HiveHandle)->Hive); 00569 kcb.KeyCell = (HCELL_INDEX)CellHandle; 00570 kcb.FullName.Length = 0; 00571 kcb.FullName.MaximumLength = 0; 00572 kcb.FullName.Buffer = NULL; 00573 00574 return(CmSetValueKey(&kcb, 00575 *ValueName, 00576 TitleIndex, 00577 Type, 00578 Data, 00579 DataSize)); 00580 00581 }


Generated on Sat May 15 19:43:32 2004 for test by doxygen 1.3.7