1 // RegistryException.cpp: Implementierung der Klasse RegistryException.
2 //
3 //////////////////////////////////////////////////////////////////////
4 
5 #include "registryexception.hxx"
6 
7 #ifdef _MSC_VER
8 #pragma warning(push, 1) /* disable warnings within system headers */
9 #endif
10 #include <windows.h>
11 #ifdef _MSC_VER
12 #pragma warning(pop)
13 #endif
14 
15 //////////////////////////////////////////////////////////////////////
16 // Konstruktion/Destruktion
17 //////////////////////////////////////////////////////////////////////
18 
19 RegistryException::RegistryException(long ErrorCode) :
20 	m_ErrorCode(ErrorCode),
21 	m_ErrorMsg(0)
22 {
23 }
24 
25 /**
26 */
27 RegistryException::~RegistryException() throw()
28 {
29 	if (m_ErrorMsg)
30 		LocalFree(m_ErrorMsg);
31 }
32 
33 /**
34 */
35 const char* RegistryException::what() const throw()
36 {
37 	FormatMessage(
38 		FORMAT_MESSAGE_ALLOCATE_BUFFER |
39 		FORMAT_MESSAGE_FROM_SYSTEM |
40 		FORMAT_MESSAGE_IGNORE_INSERTS,
41 		NULL,
42 		m_ErrorCode,
43 		MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
44 		(LPTSTR) &m_ErrorMsg,
45 		0,
46 		NULL);
47 
48 	return reinterpret_cast<char*>(m_ErrorMsg);
49 }
50 
51 /**
52 */
53 long RegistryException::GetErrorCode() const
54 {
55 	return m_ErrorCode;
56 }
57 
58 //#######################################
59 // Thrown when a Registry key is accessed
60 // that is closed
61 //#######################################
62 
63 RegistryIOException::RegistryIOException(long ErrorCode) :
64 	RegistryException(ErrorCode)
65 {
66 };
67 
68 //#######################################
69 //
70 //#######################################
71 
72 RegistryNoWriteAccessException::RegistryNoWriteAccessException(long ErrorCode) :
73 	RegistryException(ErrorCode)
74 {
75 };
76 
77 //#######################################
78 //
79 //#######################################
80 
81 RegistryAccessDeniedException::RegistryAccessDeniedException(long ErrorCode) :
82 	RegistryException(ErrorCode)
83 {
84 };
85 
86 //#######################################
87 //
88 //#######################################
89 
90 RegistryValueNotFoundException::RegistryValueNotFoundException(long ErrorCode) :
91 	RegistryException(ErrorCode)
92 {
93 };
94 
95 //#######################################
96 //
97 //#######################################
98 
99 RegistryKeyNotFoundException::RegistryKeyNotFoundException(long ErrorCode) :
100 	RegistryException(ErrorCode)
101 {
102 };
103 
104 //#######################################
105 //
106 //#######################################
107 
108 RegistryInvalidOperationException::RegistryInvalidOperationException(long ErrorCode) :
109 	RegistryException(ErrorCode)
110 {
111 };
112