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


  

RegistryEntryGetMod

RegistryEntryGetMod fetches the modifiers for a name entry in the Registry.

OSStatus RegistryEntryGetMod (
                     const RegEntryID *entry,
                     RegEntryModifiers *modifiers);
--> entry
Pointer to the RegEntryID value that identifies a name entry.
<-- modifiers
Upon return contains the value of modifiers for the specified entry.
DESCRIPTION

RegistryEntryGetMod returns in modifiers the current modifiers for the name entry identified by entry.

RESULT CODES
noErr 0 No error
paramErr -50 Bad parameter
nrInvalidNodeErr -2538 RegEntryID value not valid
CODE SAMPLE

In Listing 10-10, RegistryEntryGetMod and RegistryEntrySetMod are used to save a property to disk.

Listing 10-10 Saving a property to disk

OSStatus SaveDeviceProperty(
    constRegEntryID        *deviceEntry,
    constRegPropertyName   *propertyName
    )
{
    RegPropertyModifiers    propertyModifiers;
    OSStatus                err = noErr;

    /*
    * Get the existing modifiers first.
    */
    err = RegistryPropertyGetMod(deviceEntry, propertyName, &propertyModifiers);

    if (err == noErr) {
        /*
        * Set the save-to-disk modifier preserving the
        * already existing ones.
        */
        propertyModifiers = propertyModifiers
                                &kRegPropertyValueIsSavedToDisk;
        err = RegistryPropertySetMod
                (deviceEntry, propertyName, propertyModifiers);
    }
    return err;
}

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