_RegEnumKey


include vmm.h

LONG _RegEnumKey(HKEY hkey, DWORD iSubKey, LPTSTR lpszName, DWORD cchName)

Enumerates subkeys of the given open registry key; retrieves the name of one subkey each time the service is called. See the documentation for the Win32 function of the same name for additional information.

ERROR_NO_MORE_ITEMS

ERROR_KEY_DELETED

ERROR_MORE_DATA

ERROR_BADKEY

ERROR_REGISTRY_IO_FAILED

ERROR_REGISTRY_CORRUPT

ERROR_BADDB


hkey

Handle of an open key or one of the predefined keys:

HKEY_CLASSES_ROOT

HKEY_CURRENT_USER

HKEY_LOCAL_MACHINE

HKEY_USERS

HKEY_CURRENT_CONFIG

HKEY_DYN_DATA


iSubKey

Index of subkey to be retrieved; should be zero for the first call to this service and incremented for each subsequent call

Because subkeys are not ordered, any new subkey will have an arbitrary index.

lpszName

Address of buffer that receives the subkey name, including terminating null character.

cchName

Size in bytes of buffer; should include space for terminating null character.

To retrieve the index of the last subkey, use RegQueryInfoKey or increment iSubKey until ERROR_NO_MORE_ITEMS is returned.

Of the predefined key values, only HKEY_LOCAL_MACHINE and HKEY_DYN_DATA are available to VxDs during initialization time. The entire registry space can only be accessed after VxD initialization is complete.

The caller should reinitialize the variable containing the buffer size on each subsequent call to this service.