ReactOS  0.4.12-dev-102-g4b7f1e0
registry.cpp File Reference
#include "precomp.h"
#include <winreg.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 16 of file registry.cpp.

Referenced by RegistrySettings::Load().

17 {
18  DWORD dwPrev = dwValue;
19 
20  if (key.QueryDWORDValue(lpName, dwValue) != ERROR_SUCCESS)
21  dwValue = dwPrev;
22 
23  if (bCheckForDef && dwValue == 0)
24  dwValue = dwPrev;
25 
26  return dwPrev;
27 }
#define ERROR_SUCCESS
Definition: deptool.c:10
_In_ LPCSTR lpName
Definition: winbase.h:2729
LONG QueryDWORDValue(LPCTSTR pszValueName, DWORD &dwValue)
Definition: atlbase.h:1134
unsigned long DWORD
Definition: ntddk_ex.h:95

◆ ReadFileHistory()

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

Definition at line 29 of file registry.cpp.

Referenced by RegistrySettings::Load().

30 {
31  ULONG nChars = MAX_PATH;
32  LPTSTR szFile = strFile.GetBuffer(nChars);
33  if (key.QueryStringValue(lpName, szFile, &nChars) != ERROR_SUCCESS)
34  szFile[0] = '\0';
35  strFile.ReleaseBuffer();
36 }
#define ERROR_SUCCESS
Definition: deptool.c:10
_In_ LPCSTR lpName
Definition: winbase.h:2729
CHAR * LPTSTR
Definition: xmlstorage.h:192
void ReleaseBuffer(_In_ int nNewLength=-1)
Definition: atlsimpstr.h:372
#define MAX_PATH
Definition: compat.h:26
LONG QueryStringValue(LPCTSTR pszValueName, LPTSTR pszValue, ULONG *pnChars)
Definition: atlbase.h:1157
unsigned int ULONG
Definition: retypes.h:1