Registry Provider::SetRegValue
Sets a registry value to a specific item. Used by Microsoft® Provisioning Framework (MPF).
SetRegValue is a wrapper for the Microsoft® Win32® function RegSetValueEx.
XML Input Schema
The following code fragment shows the format for sending data to this procedure. For more information on individual elements and attributes, see the Elements and Attributes table.
<executeData>1..1 <regValue>1..1 <machine>1..1 <name>1..1</name> </machine> <rootkey>1..1 <name>1..1</name> </rootkey> <subkey>1..1 <name>1..1</name> </subkey> <item>1..1 <name>1..1</name> <regType>1..1</regType> <value>0..1</value> <values>0..1 <value>0..unbounded</value> </values> </item> </regValue> </executeData>XML Output Schema
SetRegValue does not return data.
Elements and Attributes
The following table describes the XML elements and attributes. Unless otherwise indicated, the data type is string.
Element Description, relationships, and attributes executeData Description:
Encapsulates the procedure's input data.Children:
regValue (minOccurs="1" maxOccurs="1", input only)
regValueResp (minOccurs="1" maxOccurs="1", output only)item Description:
Encapsulates item information.Parents:
executeData (input), regValueResp (output)Children:
name (minOccurs="1" maxOccurs="1", input and output)
regType (minOccurs="1" maxOccurs="1", output only)
values (minOccurs="0" maxOccurs="1", output only)machine Description:
Machine to retrieve values for. The following sample code illustrates the use of machine.<machine> <name>BOB1</name> </machine>Parent:
regValueChild:
name (minOccurs="1" maxOccurs="1")name Description:
Name of the item, machine, root key, or subkey for the value to retrieve.Parents:
machine, rootkey, subkeyregType Description:
Code that indicates the type of data to be stored. The following sample code illustrates the use of regType.<regType>REG_DWORD</regType>Valid regType values:
REG_BINARY Binary data in any form. REG_DWORD 32-bit number. REG_DWORD_LITTLE_ENDIAN 32-bit number in little-endian format; equivalent to REG_DWORD. In little-endian format, a multibyte value is stored in memory from the lowest byte (the "little end") to the highest byte. For example, the value 0x12345678 is stored as (0x78 0x56 0x34 0x12) in little-endian format. REG_DWORD_BIG_ENDIAN 32-bit number in big-endian format. In big-endian format, a multibyte value is stored in memory from the highest byte (the "big end") to the lowest byte. For example, the value 0x12345678 is stored as (0x12 0x34 0x56 0x78) in big-endian format. REG_EXPAND_SZ Null-terminated string that contains unexpanded references to environment variables (for example, "%PATH%"). It will be a UNICODE or ANSI string, depending on whether you use the UNICODE or ANSI functions. REG_LINK Unicode symbolic link. REG_MULTI_SZ Array of null-terminated strings that are terminated by two null characters. REG_NONE No defined value type. Setting a value to this type is equivalent to DeleteRegValue. REG_QWORD 64-bit number. REG_QWORD_LITTLE_ENDIAN A 64-bit number in little-endian format; equivalent to REG_QWORD. REG_RESOURCE_LIST Device-driver resource list. REG_SZ Null-terminated string. It will be a Unicode or ANSI string, depending on whether you use the Unicode or ANSI functions. Parent:
itemregValue Description:
Encapsulates information about the value to retrieve. The following sample code illustrates the use of regValue.<regValue> <machine> <name>BOB1</name> </machine> <rootkey> <name>HKEY_LOCAL_MACHINE</name> </rootkey> <subkey> <name>SOFTWARE\Microsoft\Active Setup</name> </subkey> <item> <name>CompletionChar</name> <item> </regValue>Parent:
executeDataChildren:
item (minOccurs="1" maxOccurs="1")
machine (minOccurs="1" maxOccurs="1")
rootkey (minOccurs="1" maxOccurs="1")
subkey (minOccurs="1" maxOccurs="1")rootkey Description:
Root key to retrieve. The following sample code illustrates the use of rootkey.<rootkey> <name>HKEY_LOCAL_MACHINE</name> </rootkey>Parent:
regValueChild:
name (minOccurs="1" maxOccurs="1")subkey Description:
Subkey to retrieve. The following sample code illustrates the use of subkey.<subkey> <name>SOFTWARE\Microsoft\Active Setup</name> </subkey>Parent:
regValueChild:
name (minOccurs="1" maxOccurs="1")value Description:
A value for the registry item.Parent:
valuesvalues Description:
Encapsulates a list of values for the registry item.Parent:
itemChild:
value (minOccurs="0" maxOccurs="*")See Also
Top of Page
© 1999-2002 Microsoft Corporation. All rights reserved.