1 ///////////////////////////////////////////////////////////////////////////////
3 // Module: WriteRegistry.h
5 // Desc: Defines the interface for the WriteRegistry functions.
7 // Copyright (c) 2003 Grant McDorman
8 // This file is licensed using a BSD-type license:
9 // This software is provided 'as-is', without any express or implied
10 // warranty. In no event will the authors be held liable for any damages
11 // arising from the use of this software.
13 // Permission is granted to anyone to use this software for any purpose,
14 // including commercial applications, and to alter it and redistribute it
15 // freely, subject to the following restrictions:
17 // 1. The origin of this software must not be misrepresented; you must not
18 // claim that you wrote the original software. If you use this software
19 // in a product, an acknowledgment in the product documentation would be
20 // appreciated but is not required.
21 // 2. Altered source versions must be plainly marked as such, and must not be
22 // misrepresented as being the original software.
23 // 3. This notice may not be removed or altered from any source distribution.
25 ///////////////////////////////////////////////////////////////////////////////
27 #ifndef _WRITEREGISTRY_H_
28 #define _WRITEREGISTRY_H_
32 #endif // _MSC_VER >= 1000
35 //-----------------------------------------------------------------------------
36 // WriteRegistryTreeToFile
37 // Writes a registry tree to a file. Registry tree is fully specified by
41 // key registry key name; must start with on of:
42 // HKEY_CLASSES_ROOT or HKCR
43 // HKEY_CURRENT_USER or HKCU
44 // HKEY_LOCAL_MACHINE or HKLM
45 // HKEY_CURRENT_CONFIG or HKCC
47 // HKEY_PERFORMANCE_DATA or HKPD
48 // HKEY_DYN_DATA or HKDD
49 // filename file to write to
52 // Returns true if successful.
55 // Translates call into WriteRegistryTreeToFile(section, subkey, filename).
57 bool WriteRegistryTreeToFile(const char *key
, const char *filename
);
60 //-----------------------------------------------------------------------------
61 // WriteRegistryTreeToFile
62 // Writes a registry tree to a file. Registry tree is relative to given key,
63 // which must be one of the root keys.
66 // section registry section; must be one of
70 // HKEY_CURRENT_CONFIG
72 // HKEY_PERFORMANCE_DATA
74 // subkey subkey relative to section
75 // filename file to write to
78 // Returns true if successful.
83 bool WriteRegistryTreeToFile(HKEY section
, const char *subkey
, const char *filename
);