ReactOS  0.4.15-dev-4872-g8a3db97
registry.cpp File Reference
#include "precomp.h"
#include <winreg.h>
#include <wincon.h>
#include <shlobj.h>
Include dependency graph for registry.cpp:

Go to the source code of this file.

Functions

static DWORD ReadDWORD (CRegKey &key, LPCTSTR lpName, DWORD &dwValue, BOOL bCheckForDef)
 
static void ReadString (CRegKey &key, LPCTSTR lpName, CString &strValue, LPCTSTR lpDefault=TEXT(""))
 

Function Documentation

◆ ReadDWORD()

static DWORD ReadDWORD ( CRegKey key,
LPCTSTR  lpName,
DWORD dwValue,
BOOL  bCheckForDef 
)
static

Definition at line 18 of file registry.cpp.

19 {
20  DWORD dwPrev = dwValue;
21 
22  if (key.QueryDWORDValue(lpName, dwValue) != ERROR_SUCCESS || (bCheckForDef && dwValue == 0))
23  dwValue = dwPrev;
24 
25  return dwPrev;
26 }
#define ERROR_SUCCESS
Definition: deptool.c:10
_In_ LPCSTR lpName
Definition: winbase.h:2773
unsigned long DWORD
Definition: ntddk_ex.h:95
Definition: copy.c:22

Referenced by RegistrySettings::Load().

◆ ReadString()

static void ReadString ( CRegKey key,
LPCTSTR  lpName,
CString strValue,
LPCTSTR  lpDefault = TEXT("") 
)
static

Definition at line 28 of file registry.cpp.

29 {
30  CString strTemp;
31  ULONG nChars = MAX_PATH;
32  LPTSTR psz = strTemp.GetBuffer(nChars);
33  LONG error = key.QueryStringValue(lpName, psz, &nChars);
34  strTemp.ReleaseBuffer();
35 
36  if (error == ERROR_SUCCESS)
37  strValue = strTemp;
38  else
39  strValue = lpDefault;
40 }
#define ERROR_SUCCESS
Definition: deptool.c:10
#define error(str)
Definition: mkdosfs.c:1605
_In_ LPCSTR lpName
Definition: winbase.h:2773
CHAR * LPTSTR
Definition: xmlstorage.h:192
void ReleaseBuffer(_In_ int nNewLength=-1)
Definition: atlsimpstr.h:372
long LONG
Definition: pedump.c:60
#define MAX_PATH
Definition: compat.h:34
unsigned int ULONG
Definition: retypes.h:1
Definition: copy.c:22

Referenced by RegistrySettings::Load().