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"
39 WINE_DEFAULT_DEBUG_CHANNEL(browseui
);
41 typedef struct tagACLShellSource
{
42 IEnumString IEnumString_iface
;
43 IACList2 IACList2_iface
;
48 static inline ACLShellSource
*impl_from_IACList2(IACList2
*iface
)
50 return CONTAINING_RECORD(iface
, ACLShellSource
, IACList2_iface
);
53 static inline ACLShellSource
*impl_from_IEnumString(IEnumString
*iface
)
55 return CONTAINING_RECORD(iface
, ACLShellSource
, IEnumString_iface
);
58 static HRESULT WINAPI
ACLShellSource_QueryInterface(IEnumString
*iface
, REFIID iid
, LPVOID
*ppvOut
)
60 ACLShellSource
*This
= impl_from_IEnumString(iface
);
62 TRACE("(%p)->(%s, %p)\n", This
, debugstr_guid(iid
), ppvOut
);
66 if (IsEqualIID(iid
, &IID_IUnknown
) || IsEqualIID(iid
, &IID_IEnumString
))
68 *ppvOut
= &This
->IEnumString_iface
;
70 else if (IsEqualIID(iid
, &IID_IACList2
) || IsEqualIID(iid
, &IID_IACList
))
72 *ppvOut
= &This
->IACList2_iface
;
77 IEnumString_AddRef(iface
);
81 WARN("unsupported interface: %s\n", debugstr_guid(iid
));
85 static ULONG WINAPI
ACLShellSource_AddRef(IEnumString
*iface
)
87 ACLShellSource
*This
= impl_from_IEnumString(iface
);
88 ULONG ref
= InterlockedIncrement(&This
->refCount
);
89 TRACE("(%p)->(%lu)\n", This
, ref
);
93 static ULONG WINAPI
ACLShellSource_Release(IEnumString
*iface
)
95 ACLShellSource
*This
= impl_from_IEnumString(iface
);
96 ULONG ref
= InterlockedDecrement(&This
->refCount
);
98 TRACE("(%p)->(%lu)\n", This
, ref
);
105 static HRESULT WINAPI
ACLShellSource_Next(IEnumString
*iface
, ULONG celt
, LPOLESTR
*rgelt
,
108 ACLShellSource
*This
= impl_from_IEnumString(iface
);
109 FIXME("(%p)->(%lu %p %p): stub\n", This
, celt
, rgelt
, fetched
);
113 static HRESULT WINAPI
ACLShellSource_Skip(IEnumString
*iface
, ULONG celt
)
115 ACLShellSource
*This
= impl_from_IEnumString(iface
);
116 FIXME("(%p)->(%lu): stub\n", This
, celt
);
120 static HRESULT WINAPI
ACLShellSource_Reset(IEnumString
*iface
)
122 ACLShellSource
*This
= impl_from_IEnumString(iface
);
123 FIXME("(%p): stub\n", This
);
127 static HRESULT WINAPI
ACLShellSource_Clone(IEnumString
*iface
, IEnumString
**ppenum
)
129 ACLShellSource
*This
= impl_from_IEnumString(iface
);
130 FIXME("(%p)->(%p): stub\n", This
, ppenum
);
134 static const IEnumStringVtbl ACLShellSourceVtbl
= {
135 ACLShellSource_QueryInterface
,
136 ACLShellSource_AddRef
,
137 ACLShellSource_Release
,
140 ACLShellSource_Reset
,
144 static HRESULT WINAPI
ACList_QueryInterface(IACList2
*iface
, REFIID iid
, void **ppvOut
)
146 ACLShellSource
*This
= impl_from_IACList2(iface
);
147 return IEnumString_QueryInterface(&This
->IEnumString_iface
, iid
, ppvOut
);
150 static ULONG WINAPI
ACList_AddRef(IACList2
*iface
)
152 ACLShellSource
*This
= impl_from_IACList2(iface
);
153 return IEnumString_AddRef(&This
->IEnumString_iface
);
156 static ULONG WINAPI
ACList_Release(IACList2
*iface
)
158 ACLShellSource
*This
= impl_from_IACList2(iface
);
159 return IEnumString_Release(&This
->IEnumString_iface
);
162 static HRESULT WINAPI
ACList_Expand(IACList2
*iface
, LPCWSTR wstr
)
164 ACLShellSource
*This
= impl_from_IACList2(iface
);
165 FIXME("STUB:(%p) %s\n",This
,debugstr_w(wstr
));
169 static HRESULT WINAPI
ACList_GetOptions(IACList2
*iface
, DWORD
*pdwFlag
)
171 ACLShellSource
*This
= impl_from_IACList2(iface
);
172 *pdwFlag
= This
->dwOptions
;
176 static HRESULT WINAPI
ACList_SetOptions(IACList2
*iface
,
179 ACLShellSource
*This
= impl_from_IACList2(iface
);
180 This
->dwOptions
= dwFlag
;
184 static const IACList2Vtbl ACListVtbl
=
186 ACList_QueryInterface
,
194 HRESULT
ACLShellSource_Constructor(IUnknown
*pUnkOuter
, IUnknown
**ppOut
)
196 ACLShellSource
*This
;
198 return CLASS_E_NOAGGREGATION
;
200 if (!(This
= calloc(1, sizeof(*This
))))
201 return E_OUTOFMEMORY
;
203 This
->IEnumString_iface
.lpVtbl
= &ACLShellSourceVtbl
;
204 This
->IACList2_iface
.lpVtbl
= &ACListVtbl
;
207 TRACE("returning %p\n", This
);
208 *ppOut
= (IUnknown
*)&This
->IEnumString_iface
;