2 * Shell AutoComplete list
4 * Copyright 2008 CodeWeavers, Aric Stewart
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
27 #include "wine/debug.h"
39 #include "wine/heap.h"
40 #include "wine/unicode.h"
44 WINE_DEFAULT_DEBUG_CHANNEL(browseui
);
46 typedef struct tagACLShellSource
{
47 IEnumString IEnumString_iface
;
48 IACList2 IACList2_iface
;
53 static inline ACLShellSource
*impl_from_IACList2(IACList2
*iface
)
55 return CONTAINING_RECORD(iface
, ACLShellSource
, IACList2_iface
);
58 static inline ACLShellSource
*impl_from_IEnumString(IEnumString
*iface
)
60 return CONTAINING_RECORD(iface
, ACLShellSource
, IEnumString_iface
);
63 static void ACLShellSource_Destructor(ACLShellSource
*This
)
65 TRACE("destroying %p\n", This
);
69 static HRESULT WINAPI
ACLShellSource_QueryInterface(IEnumString
*iface
, REFIID iid
, LPVOID
*ppvOut
)
71 ACLShellSource
*This
= impl_from_IEnumString(iface
);
73 TRACE("(%p)->(%s, %p)\n", This
, debugstr_guid(iid
), ppvOut
);
77 if (IsEqualIID(iid
, &IID_IUnknown
) || IsEqualIID(iid
, &IID_IEnumString
))
79 *ppvOut
= &This
->IEnumString_iface
;
81 else if (IsEqualIID(iid
, &IID_IACList2
) || IsEqualIID(iid
, &IID_IACList
))
83 *ppvOut
= &This
->IACList2_iface
;
88 IEnumString_AddRef(iface
);
92 WARN("unsupported interface: %s\n", debugstr_guid(iid
));
96 static ULONG WINAPI
ACLShellSource_AddRef(IEnumString
*iface
)
98 ACLShellSource
*This
= impl_from_IEnumString(iface
);
99 ULONG ref
= InterlockedIncrement(&This
->refCount
);
100 TRACE("(%p)->(%u)\n", This
, ref
);
104 static ULONG WINAPI
ACLShellSource_Release(IEnumString
*iface
)
106 ACLShellSource
*This
= impl_from_IEnumString(iface
);
107 ULONG ref
= InterlockedDecrement(&This
->refCount
);
109 TRACE("(%p)->(%u)\n", This
, ref
);
112 ACLShellSource_Destructor(This
);
116 static HRESULT WINAPI
ACLShellSource_Next(IEnumString
*iface
, ULONG celt
, LPOLESTR
*rgelt
,
119 ACLShellSource
*This
= impl_from_IEnumString(iface
);
120 FIXME("(%p)->(%u %p %p): stub\n", This
, celt
, rgelt
, fetched
);
124 static HRESULT WINAPI
ACLShellSource_Skip(IEnumString
*iface
, ULONG celt
)
126 ACLShellSource
*This
= impl_from_IEnumString(iface
);
127 FIXME("(%p)->(%u): stub\n", This
, celt
);
131 static HRESULT WINAPI
ACLShellSource_Reset(IEnumString
*iface
)
133 ACLShellSource
*This
= impl_from_IEnumString(iface
);
134 FIXME("(%p): stub\n", This
);
138 static HRESULT WINAPI
ACLShellSource_Clone(IEnumString
*iface
, IEnumString
**ppenum
)
140 ACLShellSource
*This
= impl_from_IEnumString(iface
);
141 FIXME("(%p)->(%p): stub\n", This
, ppenum
);
145 static const IEnumStringVtbl ACLShellSourceVtbl
= {
146 ACLShellSource_QueryInterface
,
147 ACLShellSource_AddRef
,
148 ACLShellSource_Release
,
151 ACLShellSource_Reset
,
155 static HRESULT WINAPI
ACList_QueryInterface(IACList2
*iface
, REFIID iid
, void **ppvOut
)
157 ACLShellSource
*This
= impl_from_IACList2(iface
);
158 return IEnumString_QueryInterface(&This
->IEnumString_iface
, iid
, ppvOut
);
161 static ULONG WINAPI
ACList_AddRef(IACList2
*iface
)
163 ACLShellSource
*This
= impl_from_IACList2(iface
);
164 return IEnumString_AddRef(&This
->IEnumString_iface
);
167 static ULONG WINAPI
ACList_Release(IACList2
*iface
)
169 ACLShellSource
*This
= impl_from_IACList2(iface
);
170 return IEnumString_Release(&This
->IEnumString_iface
);
173 static HRESULT WINAPI
ACList_Expand(IACList2
*iface
, LPCWSTR wstr
)
175 ACLShellSource
*This
= impl_from_IACList2(iface
);
176 FIXME("STUB:(%p) %s\n",This
,debugstr_w(wstr
));
180 static HRESULT WINAPI
ACList_GetOptions(IACList2
*iface
, DWORD
*pdwFlag
)
182 ACLShellSource
*This
= impl_from_IACList2(iface
);
183 *pdwFlag
= This
->dwOptions
;
187 static HRESULT WINAPI
ACList_SetOptions(IACList2
*iface
,
190 ACLShellSource
*This
= impl_from_IACList2(iface
);
191 This
->dwOptions
= dwFlag
;
195 static const IACList2Vtbl ACListVtbl
=
197 ACList_QueryInterface
,
205 HRESULT
ACLShellSource_Constructor(IUnknown
*pUnkOuter
, IUnknown
**ppOut
)
207 ACLShellSource
*This
;
209 return CLASS_E_NOAGGREGATION
;
211 This
= heap_alloc_zero(sizeof(ACLShellSource
));
213 return E_OUTOFMEMORY
;
215 This
->IEnumString_iface
.lpVtbl
= &ACLShellSourceVtbl
;
216 This
->IACList2_iface
.lpVtbl
= &ACListVtbl
;
219 TRACE("returning %p\n", This
);
220 *ppOut
= (IUnknown
*)&This
->IEnumString_iface
;