CAutoReg Class ReferenceProvides registry read write capability.
More...
#include <AutoReg.h>
List of all members.
|
Public Member Functions |
|
| CAutoReg () |
| | Constructor.
|
|
virtual | ~CAutoReg () |
| | Destructor.
|
| LPREGENTRY | GetEntry (LPCTSTR pName) |
| | Returns a single registry entry by name.
|
| DWORD | TestAccess (LPCTSTR pName=NULL, LPREGENTRY pReg=NULL) |
| | Returns information about the allowed access to the specified key.
|
| virtual BOOL | Restore (LPCTSTR pName=NULL, DWORD *pdwNumRead=NULL) |
| | Restores a registry key from backup.
|
| virtual BOOL | Save (LPCTSTR pName=NULL) |
| | Saves registry information to a file.
|
|
void | DefaultAll () |
| | Sets default values.
|
| BOOL | Get (LPREGENTRY pRE, DWORD dwIndex) |
| | Returns information about a specified value.
|
|
DWORD | Size () |
| | Returns the total number of registry entry items.
|
|
void | RemoveAll () |
| | Deletes all registry entry items.
|
| BOOL | AddEntry (HKEY hKey, LPCTSTR pKey, DWORD dwType, LPCTSTR pName, void *pvoidData, DWORD dwLength, DWORD dwDef=0, void *pvoidDef=NULL, DWORD dwDefLength=0, DWORD dwUser=0, LPCTSTR pComputer=NULL) |
| | Adds an entry to the list of items.
|
| void | SetComputer (LPCTSTR pComputer) |
| | Sets the default computer to connect to.
|
|
LPCTSTR | GetComputer () |
| | Returns the name of the default computer used for registry transactions.
|
Static Public Member Functions |
| static BOOL | Default (LPREGENTRY pReg) |
| | Sets default values in a registry item.
|
| static BOOL | SetDefault (LPREGENTRY pReg, DWORD dwDef=0, void *pvoidDef=NULL, DWORD dwDefLength=0) |
| | Sets default values in a registry item.
|
| static BOOL | ReadReg (LPCTSTR pName, LPREGENTRY pReg, LPCTSTR pComputer) |
| | Reads the registry value.
|
| static BOOL | WriteReg (LPCTSTR pName, LPREGENTRY pReg, LPCTSTR pComputer) |
| | Reads the registry value.
|
| static DWORD | TestAccess (LPCTSTR pName, LPREGENTRY pReg, LPCTSTR pComputer) |
| | Returns information about the allowed access to the specified key.
|
| static char * | AccessString (DWORD access) |
| | Returns a human readable string describing access level.
|
| static BOOL | CreateEntry (LPREGENTRY pReg, HKEY hKey, LPCTSTR pKey, DWORD dwType, LPCTSTR pName, void *pvoidData, DWORD dwLength, DWORD dwDef=0, void *pvoidDef=NULL, DWORD dwDefLength=0, DWORD dwUser=0, LPCTSTR pComputer=NULL) |
| | Creates the specified registry key.
|
| static BOOL | DeleteEntry (LPCTSTR pName, LPREGENTRY pReg, LPCTSTR pComputer) |
| | Deletes the specified entry from the registry.
|
| static BOOL | DeleteSubKeys (HKEY hRoot, LPCTSTR pKey) |
| | Deletes specified keys sub keys.
|
| static BOOL | DeleteSubKeys (LPCTSTR pName, LPREGENTRY pReg, LPCTSTR pComputer) |
| | Deletes specified keys sub keys.
|
| static BOOL | GetSubKey (DWORD index, LPREGENTRY pDest, LPCTSTR pName, LPREGENTRY pReg, LPCTSTR pComputer) |
| | Returns information from the specified sub key.
|
Detailed Description
Provides registry read write capability.
The primary purpose of this class is to read values on remote computers using the Windows Registry API. If you only want registry values from the local machine, use CReg instead.
Member Function Documentation
| char * CAutoReg::AccessString |
( |
DWORD |
access |
) |
[static] |
|
|
|
Returns a human readable string describing access level.
- Parameters:
-
| [in] | access | - Access level. |
- Returns:
- Returns a pointer to a string describing the specified access level.
|
| BOOL CAutoReg::AddEntry |
( |
HKEY |
hKey, |
|
|
LPCTSTR |
pKey, |
|
|
DWORD |
dwType, |
|
|
LPCTSTR |
pName, |
|
|
void * |
pvoidData, |
|
|
DWORD |
dwLength, |
|
|
DWORD |
dwDef = 0, |
|
|
void * |
pvoidDef = NULL, |
|
|
DWORD |
dwDefLength = 0, |
|
|
DWORD |
dwUser = 0, |
|
|
LPCTSTR |
pComputer = NULL |
|
) |
|
|
|
|
Adds an entry to the list of items.
- Parameters:
-
| [in] | hKey | - Handle to the registry key. |
| [in] | pKey | - Name of the registry key. |
| [in] | dwType | - The type of value. |
| [in] | pName | - The name of the value. |
| [in] | pvoidData | - The data for the key. |
| [in] | dwLength | - Length of the buffer in pvoidData. |
| [in] | dwDef | - Default DWORD value for the key. |
| [in] | pvoidDef | - Default buffer value for the key. |
| [in] | dwDefLength | - Length of the buffer in pvoidDef. |
| [in] | dwUser | - User value. |
| [in] | pComputer | - The address of the remote computer. |
- Returns:
- Returns non-zero if success.
|
| BOOL CAutoReg::CreateEntry |
( |
LPREGENTRY |
pReg, |
|
|
HKEY |
hKey, |
|
|
LPCTSTR |
pKey, |
|
|
DWORD |
dwType, |
|
|
LPCTSTR |
pName, |
|
|
void * |
pvoidData, |
|
|
DWORD |
dwLength, |
|
|
DWORD |
dwDef = 0, |
|
|
void * |
pvoidDef = NULL, |
|
|
DWORD |
dwDefLength = 0, |
|
|
DWORD |
dwUser = 0, |
|
|
LPCTSTR |
pComputer = NULL |
|
) |
[static] |
|
|
|
Creates the specified registry key.
- Parameters:
-
| [in] | pReg | - Pointer to the registry entry structure. |
| [in] | hKey | - Handle to the registry key. |
| [in] | pKey | - Name of the registry key. |
| [in] | dwType | - The type of value. |
| [in] | pName | - The name of the value. |
| [in] | pvoidData | - The data for the key. |
| [in] | dwLength | - Length of the buffer in pvoidData. |
| [in] | dwDef | - Default DWORD value for the key. |
| [in] | pvoidDef | - Default buffer value for the key. |
| [in] | dwDefLength | - Length of the buffer in pvoidDef. |
| [in] | dwUser | - User value. |
| [in] | pComputer | - The address of the remote computer. |
- Returns:
- Returns non-zero if success.
|
| BOOL CAutoReg::Default |
( |
LPREGENTRY |
pReg |
) |
[static] |
|
|
|
Sets default values in a registry item.
- Parameters:
-
| [in] | pReg | - Pointer to REGENTRY structure. |
- Returns:
- Returns non-zero if success.
|
| BOOL CAutoReg::DeleteEntry |
( |
LPCTSTR |
pName, |
|
|
LPREGENTRY |
pReg, |
|
|
LPCTSTR |
pComputer |
|
) |
[static] |
|
|
|
Deletes the specified entry from the registry.
- Parameters:
-
| [in] | pName | - The name of the registry key to write. |
| [in] | pReg | - Pointer to the registry entry structure. |
| [in] | pComputer | - The computer name to write to or NULL for local machine. |
- Returns:
- Returns non-zero if success.
|
| BOOL CAutoReg::DeleteSubKeys |
( |
LPCTSTR |
pName, |
|
|
LPREGENTRY |
pReg, |
|
|
LPCTSTR |
pComputer |
|
) |
[static] |
|
|
|
Deletes specified keys sub keys.
- Parameters:
-
| [in] | pName | - The name of the registry key to write. |
| [in] | pReg | - Pointer to the registry entry structure. |
| [in] | pComputer | - The computer name to write to or NULL for local machine. |
- Returns:
- Returns non-zero if success.
|
| BOOL CAutoReg::DeleteSubKeys |
( |
HKEY |
hRoot, |
|
|
LPCTSTR |
pKey |
|
) |
[static] |
|
|
|
Deletes specified keys sub keys.
- Parameters:
-
| [in] | hRoot | - The root of the key to delete. |
| [in] | pKey | - The name of the key to delete. |
- Returns:
- Returns non-zero if success.
|
| BOOL CAutoReg::Get |
( |
LPREGENTRY |
pRE, |
|
|
DWORD |
dwIndex |
|
) |
|
|
|
|
Returns information about a specified value.
- Parameters:
-
| [out] | pRE | - Registry entry information. |
| [in] | dwIndex | - The index of the registry entry. |
- Returns:
- Returns non-zero if success.
|
|
|
Returns a single registry entry by name.
- Parameters:
-
| [in] | pName | - The registry value name. |
- Returns:
- Returns a pointer to the REGENTRY structure if found. Otherwise returns NULL.
|
| BOOL CAutoReg::GetSubKey |
( |
DWORD |
index, |
|
|
LPREGENTRY |
pDest, |
|
|
LPCTSTR |
pName, |
|
|
LPREGENTRY |
pReg, |
|
|
LPCTSTR |
pComputer |
|
) |
[static] |
|
|
|
Returns information from the specified sub key.
- Parameters:
-
| [in] | index | - Sub key index. |
| [in] | pDest | - Destination reg entry structure. |
| [in] | pName | - Name of the sub key |
| [in] | pReg | - Registry entry information. |
| [in] | pComputer | - The computer name to write to or NULL for local machine. |
- Returns:
- Returns non-zero if success.
|
| BOOL CAutoReg::ReadReg |
( |
LPCTSTR |
pName, |
|
|
LPREGENTRY |
pReg, |
|
|
LPCTSTR |
pComputer |
|
) |
[static] |
|
|
|
Reads the registry value.
- Parameters:
-
| [in] | pName | - The name of the registry key to read. |
| [out] | pReg | - Pointer to the registry entry structure. |
| [in] | pComputer | - The computer name to read from or NULL for local machine. |
- Returns:
- Returns non-zero if success.
|
| BOOL CAutoReg::Restore |
( |
LPCTSTR |
pName = NULL, |
|
|
DWORD * |
pdwNumRead = NULL |
|
) |
[virtual] |
|
|
|
Restores a registry key from backup.
- Parameters:
-
| [in] | pName | - Filename containing registry information. |
| [in] | pdwNumRead | - Number of registry entries restored. |
- Returns:
- Returns non-zero if success.
|
| BOOL CAutoReg::Save |
( |
LPCTSTR |
pName = NULL |
) |
[virtual] |
|
|
|
Saves registry information to a file.
- Parameters:
-
- Returns:
- Returns non-zero if success.
|
| void CAutoReg::SetComputer |
( |
LPCTSTR |
pComputer |
) |
[inline] |
|
|
|
Sets the default computer to connect to.
- Parameters:
-
| [in] | pComputer | - Network id of the default computer. |
|
| BOOL CAutoReg::SetDefault |
( |
LPREGENTRY |
pReg, |
|
|
DWORD |
dwDef = 0, |
|
|
void * |
pvoidDef = NULL, |
|
|
DWORD |
dwDefLength = 0 |
|
) |
[static] |
|
|
|
Sets default values in a registry item.
- Parameters:
-
| [in] | pReg | - Pointer to REGENTRY structure. |
| [in] | dwDef | - Default DWORD value. |
| [in] | pvoidDef | - Default value buffer. |
| [in] | dwDefLength | - Size of buffer in pvoidDef. |
- Returns:
- Returns non-zero if success.
|
| DWORD CAutoReg::TestAccess |
( |
LPCTSTR |
pName = NULL, |
|
|
LPREGENTRY |
pReg = NULL |
|
) |
|
|
|
|
Returns information about the allowed access to the specified key.
- Parameters:
-
| [in] | pName | - The name of the registry key to test. |
| [in] | pReg | - Pointer to the registry entry structure. |
- Returns:
- Retuns a value indicating the access rights available for the registry key.
|
| DWORD CAutoReg::TestAccess |
( |
LPCTSTR |
pName, |
|
|
LPREGENTRY |
pReg, |
|
|
LPCTSTR |
pComputer |
|
) |
[static] |
|
|
|
Returns information about the allowed access to the specified key.
- Parameters:
-
| [in] | pName | - The name of the registry key to test. |
| [in] | pReg | - Pointer to the registry entry structure. |
| [in] | pComputer | - The computer name to write to or NULL for local machine. |
- Returns:
- Retuns a value indicating the access rights available for the registry key.
|
| BOOL CAutoReg::WriteReg |
( |
LPCTSTR |
pName, |
|
|
LPREGENTRY |
pReg, |
|
|
LPCTSTR |
pComputer |
|
) |
[static] |
|
|
|
Reads the registry value.
- Parameters:
-
| [in] | pName | - The name of the registry key to write. |
| [in] | pReg | - Pointer to the registry entry structure. |
| [in] | pComputer | - The computer name to write to or NULL for local machine. |
- Returns:
- Returns non-zero if success.
|
The documentation for this class was generated from the following files:
|