ReactOS 0.4.15-dev-5667-ged97270
aclmulti.cpp
Go to the documentation of this file.
1/*
2 * Multisource AutoComplete list
3 *
4 * Copyright 2007 Mikolaj Zalewski
5 * Copyright 2009 Andrew Hill
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20 */
21
22#include "precomp.h"
23
25{
26 obj->punk->Release();
27 if (obj->pEnum)
28 obj->pEnum->Release();
29 if (obj->pACL)
30 obj->pACL->Release();
31}
32
34{
35 fObjectCount = 0;
37 fObjects = NULL;
38}
39
41{
42 int i;
43
44 TRACE("destroying %p\n", this);
45 for (i = 0; i < fObjectCount; i++)
48}
49
51{
52 TRACE("(%p, %p)\n", this, punk);
53 if (punk == NULL)
54 return E_FAIL;
55
56 fObjects = static_cast<ACLMultiSublist *>(
57 CoTaskMemRealloc(fObjects, sizeof(fObjects[0]) * (fObjectCount + 1)));
58 fObjects[fObjectCount].punk = punk;
59 punk->AddRef();
61 fObjects[fObjectCount].pEnum = NULL;
65 return S_OK;
66}
67
69{
70 int i;
71
72 TRACE("(%p, %p)\n", this, punk);
73 for (i = 0; i < fObjectCount; i++)
74 if (fObjects[i].punk == punk)
75 {
77 MoveMemory(&fObjects[i], &fObjects[i + 1], (fObjectCount - i - 1) * sizeof(ACLMultiSublist));
79 fObjects = static_cast<ACLMultiSublist *>(
81 return S_OK;
82 }
83
84 return E_FAIL;
85}
86
88{
89 TRACE("(%p, %d, %p, %p)\n", this, celt, rgelt, pceltFetched);
91 {
92 if (fObjects[fCurrentObject].pEnum)
93 {
94 /* native browseui 6.0 also returns only one element */
95 HRESULT ret = fObjects[fCurrentObject].pEnum->Next(1, rgelt, pceltFetched);
96 if (ret != S_FALSE)
97 return ret;
98 }
100 }
101
102 if (pceltFetched)
103 *pceltFetched = 0;
104 *rgelt = NULL;
105 return S_FALSE;
106}
107
109{
110 int i;
111
112 fCurrentObject = 0;
113 for (i = 0; i < fObjectCount; i++)
114 {
115 if (fObjects[i].pEnum)
116 fObjects[i].pEnum->Reset();
117 }
118 return S_OK;
119}
120
122{
123 /* native browseui 6.0 returns this: */
124 return E_NOTIMPL;
125}
126
128{
129 *ppOut = NULL;
130 /* native browseui 6.0 returns this: */
131 return E_OUTOFMEMORY;
132}
133
135{
136 HRESULT res = S_OK;
137 int i;
138
139 for (i = 0; i < fObjectCount; i++)
140 {
141 if (!fObjects[i].pACL)
142 continue;
143 res = fObjects[i].pACL->Expand(wstr);
144 if (res == S_OK)
145 break;
146 }
147 return res;
148}
#define STDMETHODCALLTYPE
Definition: bdasup.h:9
virtual HRESULT STDMETHODCALLTYPE Append(IUnknown *punk)
Definition: aclmulti.cpp:50
virtual HRESULT STDMETHODCALLTYPE Clone(IEnumString **ppenum)
Definition: aclmulti.cpp:127
INT fObjectCount
Definition: aclmulti.h:39
~CACLMulti()
Definition: aclmulti.cpp:40
struct ACLMultiSublist * fObjects
Definition: aclmulti.h:41
virtual HRESULT STDMETHODCALLTYPE Remove(IUnknown *punk)
Definition: aclmulti.cpp:68
virtual HRESULT STDMETHODCALLTYPE Reset()
Definition: aclmulti.cpp:108
void release_obj(struct ACLMultiSublist *obj)
Definition: aclmulti.cpp:24
INT fCurrentObject
Definition: aclmulti.h:40
virtual HRESULT STDMETHODCALLTYPE Skip(ULONG celt)
Definition: aclmulti.cpp:121
virtual HRESULT STDMETHODCALLTYPE Expand(LPCOLESTR pszExpand)
Definition: aclmulti.cpp:134
virtual HRESULT STDMETHODCALLTYPE Next(ULONG celt, LPOLESTR *rgelt, ULONG *pceltFetched)
Definition: aclmulti.cpp:87
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define E_NOTIMPL
Definition: ddrawi.h:99
#define E_FAIL
Definition: ddrawi.h:102
#define NULL
Definition: types.h:112
GLuint res
Definition: glext.h:9613
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
LPVOID WINAPI CoTaskMemRealloc(LPVOID pvOld, SIZE_T size)
Definition: ifs.c:460
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:442
ULONG AddRef()
HRESULT QueryInterface([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
HRESULT Next([in] ULONG celt, [out, size_is(celt), length_is(*pceltFetched)] STATPROPSETSTG *rgelt, [out] ULONG *pceltFetched)
HRESULT Reset()
#define S_OK
Definition: intsafe.h:52
static LPOLESTR
Definition: stg_prop.c:27
#define FAILED_UNEXPECTEDLY(hr)
Definition: shellutils.h:82
#define TRACE(s)
Definition: solgame.cpp:4
uint32_t ULONG
Definition: typedefs.h:59
int ret
#define MoveMemory
Definition: winbase.h:1667
#define S_FALSE
Definition: winerror.h:2357
#define IID_PPV_ARG(Itype, ppType)
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185