PATH 
ADC Home > Documentation > Hardware > Device Managers and Drivers > PCI Card Services > Designing PCI Cards and Drivers for Power Macintosh Computers


  

RegistryPropertyIterate

Repeated calls to RegistryPropertyIterate use the iterator returned by RegistryPropertyIterateCreate to iterate through a succession of properties.

OSStatus RegistryPropertyIterate (
                     RegPropertyIter *cookie,
                     RegPropertyName *foundProperty,
                     Boolean *done);
--> cookie
Pointer to the iterator used by property iterate routines.
<-- foundProperty
Pointer to the name of the property found.
<-- done
Pointer, returns true when all properties have been found.
DESCRIPTION

RegistryPropertyIterate moves from property to property among the properties of the name entry specified in a prior RegistryPropertyIterateCreate call (see previous section). It returns the name of the next property in foundProperty, or true in done if all properties have been iterated through.

RESULT CODES
noErr 0 No error
paramErr -50 Bad parameter
CODE SAMPLE

Listing 10-8 shows code that uses RegistryPropertyIterate to iterate through all the properties for a given name entry.

Listing 10-8 Iterating through properties

OSStatus IterateDeviceProperties(
    constRegEntryID    *deviceEntry
    )
{
    RegPropertyNameBuf  propertyName;
    RegPropertyIter     cookie;
    Boolean             done;
    OSStatus            err = noErr;

    err = RegistryPropertyIterateCreate(deviceEntry, &cookie);

    if (err!=noErr) {
        do{
            err = RegistryPropertyIterate(&cookie, &propertyName[0], &done);
            if (err != noErr)
                break;

            /*
            * Do something with the property, given the property name
            * you can use RegistryPropertyGetSize to determine the size
            * of the value and and RegistryPropertyGet to retrieve the value.
            */

        } while (!done && err == noErr);
    }
    RegistryPropertyIterateDispose(&cookie);
    returnerr;
}

© 1999 Apple Computer, Inc. – (Last Updated 26 March 99)