ReactOS 0.4.16-dev-122-g325d74c
appdb.cpp File Reference
#include "rapps.h"
#include "appdb.h"
#include "configparser.h"
#include "settings.h"
Include dependency graph for appdb.cpp:

Go to the source code of this file.

Macros

#define UNINSTALL_SUBKEY   L"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall"
 

Functions

static VOID ClearList (CAtlList< CAppInfo * > &list)
 
static HKEY GetRootKeyInfo (UINT Index, REGSAM &RegSam)
 
static void DeleteWithWildcard (const CPathW &Dir, const CStringW &Filter)
 

Variables

static HKEY g_RootKeyEnum [3] = {HKEY_CURRENT_USER, HKEY_LOCAL_MACHINE, HKEY_LOCAL_MACHINE}
 
static REGSAM g_RegSamEnum [3] = {0, KEY_WOW64_32KEY, KEY_WOW64_64KEY}
 

Macro Definition Documentation

◆ UNINSTALL_SUBKEY

#define UNINSTALL_SUBKEY   L"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall"

Definition at line 18 of file appdb.cpp.

Function Documentation

◆ ClearList()

static VOID ClearList ( CAtlList< CAppInfo * > &  list)
static

Definition at line 21 of file appdb.cpp.

22{
23 POSITION InfoListPosition = list.GetHeadPosition();
24 while (InfoListPosition)
25 {
26 CAppInfo *Info = list.GetNext(InfoListPosition);
27 delete Info;
28 }
29 list.RemoveAll();
30}
Definition: list.h:37
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
Definition: wdfchildlist.h:690

Referenced by CAppDB::EnumerateFiles(), and CAppDB::UpdateInstalled().

◆ DeleteWithWildcard()

static void DeleteWithWildcard ( const CPathW Dir,
const CStringW Filter 
)
static

Definition at line 264 of file appdb.cpp.

265{
267 WIN32_FIND_DATAW FindFileData;
268
269 CPathW DirWithFilter = Dir;
270 DirWithFilter += Filter;
271
272 hFind = FindFirstFileW(DirWithFilter, &FindFileData);
273
274 if (hFind == INVALID_HANDLE_VALUE)
275 return;
276
277 do
278 {
279 CPathW szTmp = Dir;
280 szTmp += FindFileData.cFileName;
281
282 if (!(FindFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY))
283 {
285 }
286 } while (FindNextFileW(hFind, &FindFileData) != 0);
287 FindClose(hFind);
288}
char szTmp[518]
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
Definition: delete.c:39
HANDLE WINAPI FindFirstFileW(IN LPCWSTR lpFileName, OUT LPWIN32_FIND_DATAW lpFindFileData)
Definition: find.c:320
BOOL WINAPI FindClose(HANDLE hFindFile)
Definition: find.c:502
BOOL WINAPI FindNextFileW(IN HANDLE hFindFile, OUT LPWIN32_FIND_DATAW lpFindFileData)
Definition: find.c:382
_Must_inspect_result_ _In_opt_ PFLT_FILTER Filter
Definition: fltkernel.h:1801
#define FILE_ATTRIBUTE_DIRECTORY
Definition: nt_native.h:705

Referenced by CAppDB::RemoveCached().

◆ GetRootKeyInfo()

static HKEY GetRootKeyInfo ( UINT  Index,
REGSAM RegSam 
)
inlinestatic

Definition at line 145 of file appdb.cpp.

146{
149 {
150 RegSam = g_RegSamEnum[Index];
151 return g_RootKeyEnum[Index];
152 }
153 return NULL;
154}
static HKEY g_RootKeyEnum[3]
Definition: appdb.cpp:16
static REGSAM g_RegSamEnum[3]
Definition: appdb.cpp:17
#define NULL
Definition: types.h:112
#define C_ASSERT(e)
Definition: intsafe.h:73
#define _countof(array)
Definition: sndvol32.h:70
_In_ WDFCOLLECTION _In_ ULONG Index

Referenced by CAppDB::EnumInstalledRootKey(), and CAppDB::RemoveInstalledAppFromRegistry().

Variable Documentation

◆ g_RegSamEnum

REGSAM g_RegSamEnum[3] = {0, KEY_WOW64_32KEY, KEY_WOW64_64KEY}
static

Definition at line 17 of file appdb.cpp.

Referenced by GetRootKeyInfo().

◆ g_RootKeyEnum

Definition at line 16 of file appdb.cpp.

Referenced by GetRootKeyInfo().