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
25 #include "wine/debug.h"
37 #include "wine/heap.h"
41 WINE_DEFAULT_DEBUG_CHANNEL(browseui
);
43 typedef struct tagACLShellSource
{
44 IEnumString IEnumString_iface
;
45 IACList2 IACList2_iface
;
50 static inline ACLShellSource
*impl_from_IACList2(IACList2
*iface
)
52 return CONTAINING_RECORD(iface
, ACLShellSource
, IACList2_iface
);
55 static inline ACLShellSource
*impl_from_IEnumString(IEnumString
*iface
)
57 return CONTAINING_RECORD(iface
, ACLShellSource
, IEnumString_iface
);
60 static void ACLShellSource_Destructor(ACLShellSource
*This
)
62 TRACE("destroying %p\n", This
);
66 static HRESULT WINAPI
ACLShellSource_QueryInterface(IEnumString
*iface
, REFIID iid
, LPVOID
*ppvOut
)
68 ACLShellSource
*This
= impl_from_IEnumString(iface
);
70 TRACE("(%p)->(%s, %p)\n", This
, debugstr_guid(iid
), ppvOut
);
74 if (IsEqualIID(iid
, &IID_IUnknown
) || IsEqualIID(iid
, &IID_IEnumString
))
76 *ppvOut
= &This
->IEnumString_iface
;
78 else if (IsEqualIID(iid
, &IID_IACList2
) || IsEqualIID(iid
, &IID_IACList
))
80 *ppvOut
= &This
->IACList2_iface
;
85 IEnumString_AddRef(iface
);
89 WARN("unsupported interface: %s\n", debugstr_guid(iid
));
93 static ULONG WINAPI
ACLShellSource_AddRef(IEnumString
*iface
)
95 ACLShellSource
*This
= impl_from_IEnumString(iface
);
96 ULONG ref
= InterlockedIncrement(&This
->refCount
);
97 TRACE("(%p)->(%u)\n", This
, ref
);
101 static ULONG WINAPI
ACLShellSource_Release(IEnumString
*iface
)
103 ACLShellSource
*This
= impl_from_IEnumString(iface
);
104 ULONG ref
= InterlockedDecrement(&This
->refCount
);
106 TRACE("(%p)->(%u)\n", This
, ref
);
109 ACLShellSource_Destructor(This
);
113 static HRESULT WINAPI
ACLShellSource_Next(IEnumString
*iface
, ULONG celt
, LPOLESTR
*rgelt
,
116 ACLShellSource
*This
= impl_from_IEnumString(iface
);
117 FIXME("(%p)->(%u %p %p): stub\n", This
, celt
, rgelt
, fetched
);
121 static HRESULT WINAPI
ACLShellSource_Skip(IEnumString
*iface
, ULONG celt
)
123 ACLShellSource
*This
= impl_from_IEnumString(iface
);
124 FIXME("(%p)->(%u): stub\n", This
, celt
);
128 static HRESULT WINAPI
ACLShellSource_Reset(IEnumString
*iface
)
130 ACLShellSource
*This
= impl_from_IEnumString(iface
);
131 FIXME("(%p): stub\n", This
);
135 static HRESULT WINAPI
ACLShellSource_Clone(IEnumString
*iface
, IEnumString
**ppenum
)
137 ACLShellSource
*This
= impl_from_IEnumString(iface
);
138 FIXME("(%p)->(%p): stub\n", This
, ppenum
);
142 static const IEnumStringVtbl ACLShellSourceVtbl
= {
143 ACLShellSource_QueryInterface
,
144 ACLShellSource_AddRef
,
145 ACLShellSource_Release
,
148 ACLShellSource_Reset
,
152 static HRESULT WINAPI
ACList_QueryInterface(IACList2
*iface
, REFIID iid
, void **ppvOut
)
154 ACLShellSource
*This
= impl_from_IACList2(iface
);
155 return IEnumString_QueryInterface(&This
->IEnumString_iface
, iid
, ppvOut
);
158 static ULONG WINAPI
ACList_AddRef(IACList2
*iface
)
160 ACLShellSource
*This
= impl_from_IACList2(iface
);
161 return IEnumString_AddRef(&This
->IEnumString_iface
);
164 static ULONG WINAPI
ACList_Release(IACList2
*iface
)
166 ACLShellSource
*This
= impl_from_IACList2(iface
);
167 return IEnumString_Release(&This
->IEnumString_iface
);
170 static HRESULT WINAPI
ACList_Expand(IACList2
*iface
, LPCWSTR wstr
)
172 ACLShellSource
*This
= impl_from_IACList2(iface
);
173 FIXME("STUB:(%p) %s\n",This
,debugstr_w(wstr
));
177 static HRESULT WINAPI
ACList_GetOptions(IACList2
*iface
, DWORD
*pdwFlag
)
179 ACLShellSource
*This
= impl_from_IACList2(iface
);
180 *pdwFlag
= This
->dwOptions
;
184 static HRESULT WINAPI
ACList_SetOptions(IACList2
*iface
,
187 ACLShellSource
*This
= impl_from_IACList2(iface
);
188 This
->dwOptions
= dwFlag
;
192 static const IACList2Vtbl ACListVtbl
=
194 ACList_QueryInterface
,
202 HRESULT
ACLShellSource_Constructor(IUnknown
*pUnkOuter
, IUnknown
**ppOut
)
204 ACLShellSource
*This
;
206 return CLASS_E_NOAGGREGATION
;
208 This
= heap_alloc_zero(sizeof(ACLShellSource
));
210 return E_OUTOFMEMORY
;
212 This
->IEnumString_iface
.lpVtbl
= &ACLShellSourceVtbl
;
213 This
->IACList2_iface
.lpVtbl
= &ACListVtbl
;
216 TRACE("returning %p\n", This
);
217 *ppOut
= (IUnknown
*)&This
->IEnumString_iface
;