ReactOS 0.4.15-dev-6052-g2626c72
CSettings Class Reference

#include <Settings.h>

Public Member Functions

 CSettings ()
 
 ~CSettings ()
 
HRESULT Load (LPCTSTR pszLoadKey)
 
HRESULT Store (LPCTSTR pszStoreKey)
 
LPCTSTR GetPrompt ()
 
WORD GetNormalTextAttributes ()
 
WORD GetCommandTextAttributes ()
 

Private Member Functions

HRESULT Clean ()
 

Private Attributes

LPTSTR m_pszPrompt
 
WORD m_wNormalTextAttributes
 
WORD m_wCommandTextAttributes
 

Detailed Description

Definition at line 5 of file Settings.h.

Constructor & Destructor Documentation

◆ CSettings()

CSettings::CSettings ( )

Definition at line 32 of file Settings.cpp.

33{
35
38}
#define DEFAULT_COMMAND_TEXT_ATTRIBUTES
Definition: Settings.cpp:30
#define DEFAULT_NORMAL_TEXT_ATTRIBUTES
Definition: Settings.cpp:29
WORD m_wCommandTextAttributes
Definition: Settings.h:19
LPTSTR m_pszPrompt
Definition: Settings.h:17
WORD m_wNormalTextAttributes
Definition: Settings.h:18
#define NULL
Definition: types.h:112

◆ ~CSettings()

CSettings::~CSettings ( )

Definition at line 40 of file Settings.cpp.

41{
43}
HRESULT Clean()
Definition: Settings.cpp:45
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define VERIFY(e)
Definition: ph.h:34

Member Function Documentation

◆ Clean()

HRESULT CSettings::Clean ( )
private

Definition at line 45 of file Settings.cpp.

46{
47 if (m_pszPrompt)
48 {
49 delete[] m_pszPrompt;
51 }
52
53 return S_OK;
54}
#define S_OK
Definition: intsafe.h:52

Referenced by Load(), and ~CSettings().

◆ GetCommandTextAttributes()

WORD CSettings::GetCommandTextAttributes ( )

Definition at line 142 of file Settings.cpp.

143{
145}

Referenced by main().

◆ GetNormalTextAttributes()

WORD CSettings::GetNormalTextAttributes ( )

Definition at line 137 of file Settings.cpp.

138{
140}

Referenced by main().

◆ GetPrompt()

LPCTSTR CSettings::GetPrompt ( )

Definition at line 132 of file Settings.cpp.

133{
135}
static LPCTSTR GetDefaultPrompt()
Definition: Prompt.cpp:90

Referenced by main().

◆ Load()

HRESULT CSettings::Load ( LPCTSTR  pszLoadKey)

Definition at line 56 of file Settings.cpp.

57{
58 HKEY hKey = NULL;
59 HRESULT hr;
60 DWORD dwType;
62 DWORD w;
63
64 hr = Clean();
65 if (FAILED(hr))
66 return hr;
67
68 hr = S_OK;
69
71 if (nError != ERROR_SUCCESS)
72 return S_FALSE;
73
75 if (nError == ERROR_SUCCESS && dwType == REG_SZ)
76 {
77 m_pszPrompt = (TCHAR *) new (std::nothrow) BYTE[dwSize];
78 if (!m_pszPrompt)
79 {
81 goto Exit;
82 }
83
85 if (nError != ERROR_SUCCESS || dwType != REG_SZ)
86 {
87 delete m_pszPrompt;
89 hr = S_FALSE;
90 }
91 }
92 else
93 {
94 hr = S_FALSE;
95 }
96
97 dwSize = sizeof(DWORD);
99 if (nError != ERROR_SUCCESS || dwType != REG_DWORD)
100 {
101 hr = S_FALSE;
102 }
103 else
104 {
106 }
107
108 dwSize = sizeof(DWORD);
110 if (nError != ERROR_SUCCESS || dwType != REG_DWORD)
111 {
112 hr = S_FALSE;
113 }
114 else
115 {
117 }
118
119Exit:
120
121 if (hKey)
123
124 return hr;
125}
#define NORMAL_TEXT_ATTRIBUTES_VALUE_NAME
#define COMMAND_TEXT_ATTRIBUTES_VALUE_NAME
#define PROMPT_VALUE_NAME
#define RegCloseKey(hKey)
Definition: registry.h:47
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define ERROR_SUCCESS
Definition: deptool.c:10
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned short WORD
Definition: ntddk_ex.h:93
FxAutoRegKey hKey
GLubyte GLubyte GLubyte GLubyte w
Definition: glext.h:6102
#define FAILED(hr)
Definition: intsafe.h:51
#define REG_SZ
Definition: layer.c:22
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:56
#define KEY_QUERY_VALUE
Definition: nt_native.h:1016
#define DWORD
Definition: nt_native.h:44
long LONG
Definition: pedump.c:60
#define REG_DWORD
Definition: sdbapi.c:596
HRESULT hr
Definition: shlfolder.c:183
static void Exit(void)
Definition: sock.c:1330
#define S_FALSE
Definition: winerror.h:2357
#define HKEY_CURRENT_USER
Definition: winreg.h:11
#define RegOpenKeyEx
Definition: winreg.h:520
#define RegQueryValueEx
Definition: winreg.h:524
char TCHAR
Definition: xmlstorage.h:189
unsigned char BYTE
Definition: xxhash.c:193

Referenced by main().

◆ Store()

HRESULT CSettings::Store ( LPCTSTR  pszStoreKey)

Definition at line 127 of file Settings.cpp.

128{
129 return S_OK;
130}

Member Data Documentation

◆ m_pszPrompt

LPTSTR CSettings::m_pszPrompt
private

Definition at line 17 of file Settings.h.

Referenced by Clean(), CSettings(), GetPrompt(), and Load().

◆ m_wCommandTextAttributes

WORD CSettings::m_wCommandTextAttributes
private

Definition at line 19 of file Settings.h.

Referenced by CSettings(), GetCommandTextAttributes(), and Load().

◆ m_wNormalTextAttributes

WORD CSettings::m_wNormalTextAttributes
private

Definition at line 18 of file Settings.h.

Referenced by CSettings(), GetNormalTextAttributes(), and Load().


The documentation for this class was generated from the following files: