ReactOS  0.4.15-dev-1377-ga59cecd
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 ReadFileHistory (CRegKey &key, LPCTSTR lpName, CString &strFile)
 

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)
23  dwValue = dwPrev;
24 
25  if (bCheckForDef && dwValue == 0)
26  dwValue = dwPrev;
27 
28  return dwPrev;
29 }
#define ERROR_SUCCESS
Definition: deptool.c:10
_In_ LPCSTR lpName
Definition: winbase.h:2752
unsigned long DWORD
Definition: ntddk_ex.h:95
Definition: path.c:41

Referenced by RegistrySettings::Load().

◆ ReadFileHistory()

static void ReadFileHistory ( CRegKey key,
LPCTSTR  lpName,
CString strFile 
)
static

Definition at line 31 of file registry.cpp.

32 {
33  ULONG nChars = MAX_PATH;
34  LPTSTR szFile = strFile.GetBuffer(nChars);
35  if (key.QueryStringValue(lpName, szFile, &nChars) != ERROR_SUCCESS)
36  szFile[0] = '\0';
37  strFile.ReleaseBuffer();
38 }
#define ERROR_SUCCESS
Definition: deptool.c:10
_In_ LPCSTR lpName
Definition: winbase.h:2752
CHAR * LPTSTR
Definition: xmlstorage.h:192
void ReleaseBuffer(_In_ int nNewLength=-1)
Definition: atlsimpstr.h:372
#define MAX_PATH
Definition: compat.h:34
unsigned int ULONG
Definition: retypes.h:1
Definition: path.c:41

Referenced by RegistrySettings::Load().