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/unicode.h"
43 WINE_DEFAULT_DEBUG_CHANNEL(browseui
);
45 typedef struct tagACLShellSource
{
46 IEnumString IEnumString_iface
;
47 IACList2 IACList2_iface
;
52 static inline ACLShellSource
*impl_from_IACList2(IACList2
*iface
)
54 return CONTAINING_RECORD(iface
, ACLShellSource
, IACList2_iface
);
57 static inline ACLShellSource
*impl_from_IEnumString(IEnumString
*iface
)
59 return CONTAINING_RECORD(iface
, ACLShellSource
, IEnumString_iface
);
62 static void ACLShellSource_Destructor(ACLShellSource
*This
)
64 TRACE("destroying %p\n", This
);
68 static HRESULT WINAPI
ACLShellSource_QueryInterface(IEnumString
*iface
, REFIID iid
, LPVOID
*ppvOut
)
70 ACLShellSource
*This
= impl_from_IEnumString(iface
);
72 TRACE("(%p)->(%s, %p)\n", This
, debugstr_guid(iid
), ppvOut
);
76 if (IsEqualIID(iid
, &IID_IUnknown
) || IsEqualIID(iid
, &IID_IEnumString
))
78 *ppvOut
= &This
->IEnumString_iface
;
80 else if (IsEqualIID(iid
, &IID_IACList2
) || IsEqualIID(iid
, &IID_IACList
))
82 *ppvOut
= &This
->IACList2_iface
;
87 IEnumString_AddRef(iface
);
91 WARN("unsupported interface: %s\n", debugstr_guid(iid
));
95 static ULONG WINAPI
ACLShellSource_AddRef(IEnumString
*iface
)
97 ACLShellSource
*This
= impl_from_IEnumString(iface
);
98 ULONG ref
= InterlockedIncrement(&This
->refCount
);
99 TRACE("(%p)->(%u)\n", This
, ref
);
103 static ULONG WINAPI
ACLShellSource_Release(IEnumString
*iface
)
105 ACLShellSource
*This
= impl_from_IEnumString(iface
);
106 ULONG ref
= InterlockedDecrement(&This
->refCount
);
108 TRACE("(%p)->(%u)\n", This
, ref
);
111 ACLShellSource_Destructor(This
);
115 static HRESULT WINAPI
ACLShellSource_Next(IEnumString
*iface
, ULONG celt
, LPOLESTR
*rgelt
,
118 ACLShellSource
*This
= impl_from_IEnumString(iface
);
119 FIXME("(%p)->(%u %p %p): stub\n", This
, celt
, rgelt
, fetched
);
123 static HRESULT WINAPI
ACLShellSource_Skip(IEnumString
*iface
, ULONG celt
)
125 ACLShellSource
*This
= impl_from_IEnumString(iface
);
126 FIXME("(%p)->(%u): stub\n", This
, celt
);
130 static HRESULT WINAPI
ACLShellSource_Reset(IEnumString
*iface
)
132 ACLShellSource
*This
= impl_from_IEnumString(iface
);
133 FIXME("(%p): stub\n", This
);
137 static HRESULT WINAPI
ACLShellSource_Clone(IEnumString
*iface
, IEnumString
**ppenum
)
139 ACLShellSource
*This
= impl_from_IEnumString(iface
);
140 FIXME("(%p)->(%p): stub\n", This
, ppenum
);
144 static const IEnumStringVtbl ACLShellSourceVtbl
= {
145 ACLShellSource_QueryInterface
,
146 ACLShellSource_AddRef
,
147 ACLShellSource_Release
,
150 ACLShellSource_Reset
,
154 static HRESULT WINAPI
ACList_QueryInterface(IACList2
*iface
, REFIID iid
, void **ppvOut
)
156 ACLShellSource
*This
= impl_from_IACList2(iface
);
157 return IEnumString_QueryInterface(&This
->IEnumString_iface
, iid
, ppvOut
);
160 static ULONG WINAPI
ACList_AddRef(IACList2
*iface
)
162 ACLShellSource
*This
= impl_from_IACList2(iface
);
163 return IEnumString_AddRef(&This
->IEnumString_iface
);
166 static ULONG WINAPI
ACList_Release(IACList2
*iface
)
168 ACLShellSource
*This
= impl_from_IACList2(iface
);
169 return IEnumString_Release(&This
->IEnumString_iface
);
172 static HRESULT WINAPI
ACList_Expand(IACList2
*iface
, LPCWSTR wstr
)
174 ACLShellSource
*This
= impl_from_IACList2(iface
);
175 FIXME("STUB:(%p) %s\n",This
,debugstr_w(wstr
));
179 static HRESULT WINAPI
ACList_GetOptions(IACList2
*iface
, DWORD
*pdwFlag
)
181 ACLShellSource
*This
= impl_from_IACList2(iface
);
182 *pdwFlag
= This
->dwOptions
;
186 static HRESULT WINAPI
ACList_SetOptions(IACList2
*iface
,
189 ACLShellSource
*This
= impl_from_IACList2(iface
);
190 This
->dwOptions
= dwFlag
;
194 static const IACList2Vtbl ACListVtbl
=
196 ACList_QueryInterface
,
204 HRESULT
ACLShellSource_Constructor(IUnknown
*pUnkOuter
, IUnknown
**ppOut
)
206 ACLShellSource
*This
;
208 return CLASS_E_NOAGGREGATION
;
210 This
= heap_alloc_zero(sizeof(ACLShellSource
));
212 return E_OUTOFMEMORY
;
214 This
->IEnumString_iface
.lpVtbl
= &ACLShellSourceVtbl
;
215 This
->IACList2_iface
.lpVtbl
= &ACListVtbl
;
218 TRACE("returning %p\n", This
);
219 *ppOut
= (IUnknown
*)&This
->IEnumString_iface
;