diff --git a/mozilla/modules/libreg/xpcom/nsRegistry.cpp b/mozilla/modules/libreg/xpcom/nsRegistry.cpp index e45c2a37ed3..9cde3fd21a7 100644 --- a/mozilla/modules/libreg/xpcom/nsRegistry.cpp +++ b/mozilla/modules/libreg/xpcom/nsRegistry.cpp @@ -55,6 +55,7 @@ struct nsRegistry : public nsIRegistry { NS_IMETHOD OpenWellKnownRegistry( uint32 regid ); NS_IMETHOD OpenDefault(); NS_IMETHOD Close(); + NS_IMETHOD IsOpen( PRBool *result ); NS_IMETHOD GetString( Key baseKey, const char *path, char **result ); NS_IMETHOD SetString( Key baseKey, const char *path, const char *value ); @@ -492,6 +493,15 @@ NS_IMETHODIMP nsRegistry::Close() { return regerr2nsresult( err ); } +/*----------------------------- nsRegistry::IsOpen ----------------------------- +| Tests the mReg handle and returns whether the registry is open or not. | +------------------------------------------------------------------------------*/ +NS_IMETHODIMP nsRegistry::IsOpen( PRBool *result ) { + *result = ( mReg != 0 ); + return NS_OK; +} + + /*--------------------------- nsRegistry::GetString ---------------------------- | First, look for the entry using GetValueInfo. If found, and it's a string, | | allocate space for it and fetch the value. | diff --git a/mozilla/xpcom/components/nsIRegistry.h b/mozilla/xpcom/components/nsIRegistry.h index 44489588f10..4fadece1bc9 100644 --- a/mozilla/xpcom/components/nsIRegistry.h +++ b/mozilla/xpcom/components/nsIRegistry.h @@ -168,6 +168,7 @@ struct nsIRegistry : public nsISupports { NS_IMETHOD OpenWellKnownRegistry( uint32 regid ) = 0; NS_IMETHOD OpenDefault() = 0; NS_IMETHOD Close() = 0; + NS_IMETHOD IsOpen( PRBool *result ) = 0; /*----------------------- Reading/Writing Values --------------------------- | These functions read/write the registry values at a given node. | diff --git a/mozilla/xpcom/components/nsRegistry.cpp b/mozilla/xpcom/components/nsRegistry.cpp index e45c2a37ed3..9cde3fd21a7 100644 --- a/mozilla/xpcom/components/nsRegistry.cpp +++ b/mozilla/xpcom/components/nsRegistry.cpp @@ -55,6 +55,7 @@ struct nsRegistry : public nsIRegistry { NS_IMETHOD OpenWellKnownRegistry( uint32 regid ); NS_IMETHOD OpenDefault(); NS_IMETHOD Close(); + NS_IMETHOD IsOpen( PRBool *result ); NS_IMETHOD GetString( Key baseKey, const char *path, char **result ); NS_IMETHOD SetString( Key baseKey, const char *path, const char *value ); @@ -492,6 +493,15 @@ NS_IMETHODIMP nsRegistry::Close() { return regerr2nsresult( err ); } +/*----------------------------- nsRegistry::IsOpen ----------------------------- +| Tests the mReg handle and returns whether the registry is open or not. | +------------------------------------------------------------------------------*/ +NS_IMETHODIMP nsRegistry::IsOpen( PRBool *result ) { + *result = ( mReg != 0 ); + return NS_OK; +} + + /*--------------------------- nsRegistry::GetString ---------------------------- | First, look for the entry using GetValueInfo. If found, and it's a string, | | allocate space for it and fetch the value. |