ReactOS  0.4.14-dev-342-gdc047f9
CLayerStringList.hpp
Go to the documentation of this file.
1 /*
2  * PROJECT: ReactOS Compatibility Layer Shell Extension
3  * LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
4  * PURPOSE: CLayerStringList implementation
5  * COPYRIGHT: Copyright 2015-2018 Mark Jansen (mark.jansen@reactos.org)
6  */
7 
8 #pragma once
9 
10 /* TODO: Use HSDB instead of PDB */
12  public CComObjectRootEx<CComMultiThreadModelNoCS>,
13  public IEnumString
14 {
15 public:
18  {
21  StringCchCatW(buf, _countof(buf), L"\\sysmain.sdb");
23  Reset();
24  }
25 
27  {
29  }
30 
31  virtual HRESULT STDMETHODCALLTYPE Next(ULONG celt, LPOLESTR *rgelt, ULONG *pceltFetched)
32  {
33  if (pceltFetched)
34  *pceltFetched = 0;
35 
36  while (celt && m_layer)
37  {
39  if (nameid)
40  {
42  if (name && !IsBuiltinLayer(name))
43  {
44  ULONG Size = wcslen(name) + 1;
45 
46  *rgelt = (LPOLESTR)::CoTaskMemAlloc(Size * sizeof(WCHAR));
47  StringCchCopyW(*rgelt, Size, name);
48 
49  if (pceltFetched)
50  (*pceltFetched)++;
51 
52  celt--;
53  rgelt++;
54  }
55  }
57  }
58  return celt ? S_FALSE : S_OK;
59  }
60 
62  {
63  while (m_layer && celt)
64  {
66  --celt;
67  }
68  return celt ? S_FALSE : S_OK;
69  }
70 
72  {
74  if (m_db)
75  {
77  if (m_root != TAGID_NULL)
78  {
80  return S_OK;
81  }
82  }
83  return E_FAIL;
84  }
85 
87  {
88  return E_NOTIMPL;
89  }
90 
91 protected:
95 
96 public:
99  END_COM_MAP()
100 };
101 
#define TAG_NAME
Definition: vfat.h:547
const GUID IID_IEnumString
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define _countof(array)
Definition: fontsub.cpp:30
#define TAG_DATABASE
Definition: db.cpp:83
HRESULT WINAPI SdbGetAppPatchDir(HSDB db, LPWSTR path, DWORD size)
Definition: hsdb.c:579
LPWSTR WINAPI SdbGetStringTagPtr(PDB pdb, TAGID tagid)
Definition: sdbread.c:375
virtual HRESULT STDMETHODCALLTYPE Skip(ULONG celt)
static LPOLESTR
Definition: stg_prop.c:27
#define E_FAIL
Definition: ddrawi.h:102
virtual HRESULT STDMETHODCALLTYPE Reset()
STRSAFEAPI StringCchCatW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:325
STRSAFEAPI StringCchCopyW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:149
#define S_FALSE
Definition: winerror.h:2357
smooth NULL
Definition: ftsmooth.c:416
TAGID WINAPI SdbFindNextTag(PDB pdb, TAGID parent, TAGID prev_child)
Definition: sdbread.c:231
#define BEGIN_COM_MAP(x)
Definition: atlcom.h:541
virtual HRESULT STDMETHODCALLTYPE Clone(IEnumString **ppenum)
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
#define MAX_PATH
Definition: compat.h:26
#define STDMETHODCALLTYPE
Definition: bdasup.h:9
TAGID WINAPI SdbFindFirstTag(PDB pdb, TAGID parent, TAG tag)
Definition: sdbread.c:208
void WINAPI SdbCloseDatabase(PDB)
Definition: sdbapi.c:373
static const WCHAR L[]
Definition: oid.c:1250
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:359
#define TAGID_NULL
Definition: db.cpp:36
#define S_OK
Definition: intsafe.h:59
#define COM_INTERFACE_ENTRY_IID(iid, x)
Definition: atlcom.h:561
#define E_NOTIMPL
Definition: ddrawi.h:99
#define TAG_LAYER
Definition: db.cpp:88
#define TAGID_ROOT
Definition: db.cpp:37
Definition: name.c:36
unsigned int ULONG
Definition: retypes.h:1
#define END_COM_MAP()
Definition: atlcom.h:552
DWORD TAGID
WCHAR * LPWSTR
Definition: xmlstorage.h:184
virtual HRESULT STDMETHODCALLTYPE Next(ULONG celt, LPOLESTR *rgelt, ULONG *pceltFetched)
BOOL IsBuiltinLayer(PCWSTR Name)
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: ifs.c:404
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
PDB WINAPI SdbOpenDatabase(LPCWSTR path, PATH_TYPE type)
Definition: sdbapi.c:329