Registry::EnumRegKey


Executes a shallow (non-recursive) enumeration of a specified registry key (machine, location, subkey). Used by Microsoft® Provisioning Framework (MPF).

EnumRegKey is a wrapper for the Microsoft® Win32® function RegEnumKeyEx.

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
  <regKey>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>
  </regKey>
</executeData>

XML Output Schema

The following code fragment shows the format for data this procedure returns. For more information on individual elements and attributes, see the Elements and Attributes table.

<executeData>1..1
  <regKeyResp>1..1
	<subkeys>0..1
	<subkey>0..unbounded
		<name>1..1</name>
	</subkey>
	</subkeys>
  </regKeyResp>
</executeData>

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 and output data.

Children:
regKey (minOccurs="1" maxOccurs="1", input only)
regKeyResp (minOccurs="1" maxOccurs="1", output only)

machine Description:
Machine to enumerate keys for. The following sample code illustrates the use of machine.
<machine>
  <name>BOB1</name>
</machine> 

Parent:
regKey

Child:
name (minOccurs="1" maxOccurs="1")

name Description:
Name of the machine, root key, or subkey for the key to enumerate.

Parents:
machine, rootkey, subkey

regKey Description:
Encapsulates information about the key to enumerate. The following sample code illustrates the use of regKey.
<regKey>
  <machine>
	<name>BOB1</name>
  </machine>
  <rootkey>
	<name>HKEY_LOCAL_MACHINE</name>
  </rootkey>
  <subkey>
	<name>SOFTWARE\Microsoft\Active Setup</name>
  </subkey>
</regKey>

Parent:
executeData

Children:
machine (minOccurs="1" maxOccurs="1")
rootkey (minOccurs="1" maxOccurs="1")
subkey (minOccurs="1" maxOccurs="1")

regKeyResp Description:
Returns the enumerated keys.

Parent:
executeData

Child:
subkeys (minOccurs="0" maxOccurs="1")

rootkey Description:
Root key to enumerate from. The following sample code illustrates the use of rootkey.
<rootkey>
  <name>HKEY_LOCAL_MACHINE</name>
</rootkey>

Parent:
regKey

Child:
name (minOccurs="1" maxOccurs="1")

subkey Description:
Subkey to enumerate from. The following sample code illustrates the use of subkey.
<subkey>
  <name>SOFTWARE\Microsoft\Active Setup</name>
</subkey> 

Parents:
regKey (input)
subkeys (output)

Child:
name (minOccurs="1" maxOccurs="1")

subkeys Description:
Encapsulates output of enumerated subkeys.

Parent:
regKeyResp

Child:
subkey (minOccurs="0" maxOccurs="*")

Remarks

Only subkeys directly beneath the specified location are enumerated. Values are not enumerated. Recursive enumeration is not supported.

See Also

EnumRegValue, Registry Provider


Up Top of Page
© 1999-2002 Microsoft Corporation. All rights reserved.