rv = node->GetName( &name );
rv = node->GetNameUTF8( &name );
void display( nsIRegistry *reg, nsRegistryKey root, const char *rootName ) {    // Print out key name.    printf( "%s\n", rootName );    // Make sure it isn't a "root" key.    if ( root != nsIRegistry::Common         &&         root != nsIRegistry::Users         &&         root != nsIRegistry::CurrentUser ) {        // Print values stored under this key.        displayValues( reg, root );    }    // Enumerate all subkeys (immediately) under the given node.    nsIEnumerator *keys;    nsresult rv = reg->EnumerateSubtrees( root, &keys );    // Check result.    if ( rv == NS_OK ) {        // Set enumerator to beginning.        rv = keys->First();        // Enumerate subkeys till done.        while( NS_SUCCEEDED( rv ) && (NS_OK != keys->IsDone()) ) {            nsISupports *base;            rv = keys->CurrentItem( &base );            // Test result.            if ( rv == NS_OK ) {                // Get specific interface.                nsIRegistryNode *node;                nsIID nodeIID = NS_IREGISTRYNODE_IID;                rv = base->QueryInterface( nodeIID, (void**)&node );                // Test that result.                if ( rv == NS_OK ) {                    // Get node name.                    char *name;                    rv = node->GetName( &name );                    // Test result.                    if ( rv == NS_OK ) {                        // Build complete name.                        char *fullName = new char[ PL_strlen(rootName) + PL_strlen(name) + 5 ];                        PL_strcpy( fullName, rootName );                        PL_strcat( fullName, " -  " );                        PL_strcat( fullName, name );                        // Display contents under this subkey.                        nsRegistryKey key;                        rv = reg->GetSubtreeRaw( root, name, &key );                        if ( rv == NS_OK ) {                            display( reg, key, fullName );                            printf( "\n" );                        } else {                            printf( "Error getting key, rv=0x%08X\n", (int)rv );                        }                        delete [] fullName;                    } else {                        printf( "Error getting subtree name, rv=0x%08X\n", (int)rv );                    }                    // Release node.                    node->Release();                } else {                    printf( "Error converting base node ptr to nsIRegistryNode, rv=0x%08X\n", (int)rv );                }                // Release item.                base->Release();                // Advance to next key.                rv = keys->Next();                // Check result.                if ( NS_SUCCEEDED( rv ) ) {                } else {                    printf( "Error advancing enumerator, rv=0x%08X\n", (int)rv );                }            } else {                printf( "Error getting current item, rv=0x%08X\n", (int)rv );            }        }        // Release key enumerator.        keys->Release();    } else {        printf( "Error creating enumerator for %s, root=0x%08X, rv=0x%08X\n",                rootName, (int)root, (int)rv );    }    return;}