src/Common/Registry/Registry.h

Go to the documentation of this file.
00001 #pragma once
00002 
00003 namespace AppSecInc
00004 {
00006         namespace Registry
00007         {
00008         /*
00009             \fn KeyExists
00010             \brief Checks whether a registry key, and optionally registry value, exists
00011             \param root HKEY_LOCAL_MACHINE, etc.
00012             \param key path to the registry key
00013             \param name name of the value to check, if blank only checks the key
00014         */
00015         bool KeyExists(HKEY root, const std::wstring& key, const std::wstring& name = L"");
00016 
00017         /*
00018             \fn GetStringValue
00019             \brief Get a string value from registry
00020             \param root HKEY_LOCAL_MACHINE, etc.
00021             \param key path to the registry key
00022             \param name name of the value to fetch
00023         */
00024         std::wstring GetStringValue(HKEY root, const std::wstring& key, const std::wstring& name = L"");
00025 
00026         /*
00027             \fn CopyBranch
00028             \brief Copy an entire branch of the registry from one location to another
00029             \param sourceRoot HKEY_LOCAL_MACHINE, etc.
00030             \param keySrcRoot source path to the registry key that is being copied
00031                         \param targetRoot HKEY_LOCAL_MACHINE, etc.
00032             \param keyDestRoot destination path to the registry key that will be created
00033         */
00034                 void CopyBranch(HKEY sourceRoot, const std::wstring& keySrcRoot, HKEY destRoot, const std::wstring& keyDestRoot);
00035 
00036         /*
00037             \fn DeleteBranch
00038             \brief Delete an entire branch of the registry
00039             \param root HKEY_LOCAL_MACHINE, etc.
00040             \param key path to the registry key to be deleted
00041         */
00042                 void DeleteBranch(HKEY root, const std::wstring& key);
00043                 
00044                 /*
00045             \fn CreateKey
00046             \brief Create a registry key
00047             \param root HKEY_LOCAL_MACHINE, etc.
00048             \param key path to the registry key to be added
00049         */
00050                 void CreateKey(HKEY root, const std::wstring& key);
00051 
00052                 /*
00053             \fn SetStringValue
00054             \brief Creates a string name / value pair
00055             \param root HKEY_LOCAL_MACHINE, etc.
00056             \param key path to the registry key where the name / value is to be set
00057                         \param name 
00058                         \param value
00059         */
00060                 void SetStringValue(HKEY root, const std::wstring& key, const std::wstring &name, const std::wstring& value);
00061         }
00062 }


© Application Security Inc. - All Rights Reserved http://msiext.codeplex.com