ReactOS  0.4.14-dev-77-gd9e7c48
autocomplete.c File Reference
#include <stdarg.h>
#include <initguid.h>
#include <windows.h>
#include <shlobj.h>
#include <shldisp.h>
#include <shlwapi.h>
#include <shlguid.h>
#include "wine/test.h"
Include dependency graph for autocomplete.c:

Go to the source code of this file.

Classes

struct  TestACL
 

Macros

#define COBJMACROS
 
#define ole_ok(exp)
 
#define expect_str(obj, str)
 
#define expect_end(obj)   ok(IEnumString_Next(obj, 1, &wstr, &i) == S_FALSE, "Unexpected return from Next\n");
 

Functions

static LPWSTR strdup_AtoW (LPCSTR str)
 
static TestACLimpl_from_IEnumString (IEnumString *iface)
 
static TestACLimpl_from_IACList (IACList *iface)
 
static TestACLTestACL_Constructor (int limit, const char **strings)
 
static ULONG STDMETHODCALLTYPE TestACL_AddRef (IEnumString *iface)
 
static ULONG STDMETHODCALLTYPE TestACL_Release (IEnumString *iface)
 
static HRESULT STDMETHODCALLTYPE TestACL_QueryInterface (IEnumString *iface, REFIID iid, LPVOID *ppvOut)
 
static HRESULT STDMETHODCALLTYPE TestACL_Next (IEnumString *iface, ULONG celt, LPOLESTR *rgelt, ULONG *pceltFetched)
 
static HRESULT STDMETHODCALLTYPE TestACL_Skip (IEnumString *iface, ULONG celt)
 
static HRESULT STDMETHODCALLTYPE TestACL_Clone (IEnumString *iface, IEnumString **out)
 
static HRESULT STDMETHODCALLTYPE TestACL_Reset (IEnumString *iface)
 
static HRESULT STDMETHODCALLTYPE TestACL_Expand (IACList *iface, LPCOLESTR str)
 
static ULONG STDMETHODCALLTYPE TestACL_ACList_AddRef (IACList *iface)
 
static ULONG STDMETHODCALLTYPE TestACL_ACList_Release (IACList *iface)
 
static HRESULT STDMETHODCALLTYPE TestACL_ACList_QueryInterface (IACList *iface, REFIID iid, LPVOID *ppvout)
 
static void test_ACLMulti (void)
 
static void test_ACListISF (void)
 
 START_TEST (autocomplete)
 

Variables

IEnumStringVtbl TestACLVtbl
 
IACListVtbl TestACL_ACListVtbl
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 20 of file autocomplete.c.

◆ expect_end

#define expect_end (   obj)    ok(IEnumString_Next(obj, 1, &wstr, &i) == S_FALSE, "Unexpected return from Next\n");

Definition at line 223 of file autocomplete.c.

◆ expect_str

#define expect_str (   obj,
  str 
)
Value:
{ \
ole_ok(IEnumString_Next(obj, 1, &wstr, &i)); \
ok(i == 1, "Expected i == 1, got %d\n", i); \
ok(str[0] == wstr[0], "String mismatch\n"); \
CoTaskMemFree(wstr); \
}
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
const WCHAR * str

Definition at line 215 of file autocomplete.c.

◆ ole_ok

#define ole_ok (   exp)
Value:
{ \
HRESULT res = (exp); \
if (res != S_OK) \
ok(FALSE, #exp " failed: %x\n", res); \
}
#define S_OK
Definition: intsafe.h:59
DWORD exp
Definition: msg.c:15681
GLuint res
Definition: glext.h:9613

Definition at line 33 of file autocomplete.c.

Function Documentation

◆ impl_from_IACList()

static TestACL* impl_from_IACList ( IACList *  iface)
static

Definition at line 68 of file autocomplete.c.

69 {
70  return CONTAINING_RECORD(iface, TestACL, IACList_iface);
71 }
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560

Referenced by TestACL_ACList_AddRef(), TestACL_ACList_QueryInterface(), TestACL_ACList_Release(), and TestACL_Expand().

◆ impl_from_IEnumString()

static TestACL* impl_from_IEnumString ( IEnumString iface)
inlinestatic

Definition at line 63 of file autocomplete.c.

64 {
65  return CONTAINING_RECORD(iface, TestACL, IEnumString_iface);
66 }
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560

Referenced by TestACL_AddRef(), TestACL_Next(), TestACL_QueryInterface(), TestACL_Release(), and TestACL_Reset().

◆ START_TEST()

START_TEST ( autocomplete  )

Definition at line 388 of file autocomplete.c.

389 {
391 
392  test_ACLMulti();
393  test_ACListISF();
394 
395  CoUninitialize();
396 }
static void test_ACListISF(void)
Definition: autocomplete.c:367
smooth NULL
Definition: ftsmooth.c:416
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
Definition: compobj.c:1991
static void test_ACLMulti(void)
Definition: autocomplete.c:226
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
Definition: compobj.c:1897

◆ strdup_AtoW()

static LPWSTR strdup_AtoW ( LPCSTR  str)
static

Definition at line 40 of file autocomplete.c.

41 {
42  int size = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0);
43  LPWSTR wstr = CoTaskMemAlloc((size + 1)*sizeof(WCHAR));
44  MultiByteToWideChar(CP_ACP, 0, str, -1, wstr, size+1);
45  return wstr;
46 }
#define CP_ACP
Definition: compat.h:99
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
GLsizeiptr size
Definition: glext.h:5919
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MultiByteToWideChar
Definition: compat.h:100
WCHAR * LPWSTR
Definition: xmlstorage.h:184
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: ifs.c:406

Referenced by TestACL_Next().

◆ test_ACListISF()

static void test_ACListISF ( void  )
static

Definition at line 367 of file autocomplete.c.

368 {
369  IEnumString *enumstring;
370  IACList *list, *list2;
371  HRESULT hr;
372 
373  hr = CoCreateInstance(&CLSID_ACListISF, NULL, CLSCTX_INPROC, &IID_IACList, (void**)&list);
374  ok(hr == S_OK, "failed to create ACListISF instance, 0x%08x\n", hr);
375 
376  hr = IACList_QueryInterface(list, &IID_IEnumString, (void**)&enumstring);
377  ok(hr == S_OK, "got 0x%08x\n", hr);
378 
379  hr = IEnumString_QueryInterface(enumstring, &IID_IACList, (void**)&list2);
380  ok(hr == S_OK, "got 0x%08x\n", hr);
381  ok(list == list2, "got %p, %p\n", list, list2);
382  IACList_Release(list2);
383 
384  IEnumString_Release(enumstring);
386 }
const GUID IID_IEnumString
HRESULT hr
Definition: shlfolder.c:183
smooth NULL
Definition: ftsmooth.c:416
#define IACList_Release(p)
Definition: shlobj.h:723
LONG HRESULT
Definition: typedefs.h:77
Definition: _list.h:228
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3234
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
#define list
Definition: rosglue.h:35
#define IACList_QueryInterface(p, a, b)
Definition: shlobj.h:721

Referenced by START_TEST().

◆ test_ACLMulti()

static void test_ACLMulti ( void  )
static

Definition at line 226 of file autocomplete.c.

227 {
228  const char *strings1[] = {"a", "c", "e"};
229  const char *strings2[] = {"a", "b", "d"};
230  WCHAR exp[] = {'A','B','C',0};
231  IEnumString *obj;
232  IEnumACString *unk;
233  HRESULT hr;
234  TestACL *acl1, *acl2;
235  IACList *acl;
236  IObjMgr *mgr;
237  LPWSTR wstr;
238  LPWSTR wstrtab[15];
239  LPVOID tmp;
240  ULONG ref;
241  UINT i;
242 
243  hr = CoCreateInstance(&CLSID_ACLMulti, NULL, CLSCTX_INPROC, &IID_IEnumString, (void**)&obj);
244  ok(hr == S_OK, "failed to create ACLMulti instance, 0x%08x\n", hr);
245  if (hr != S_OK) return;
246 
247  hr = IEnumString_QueryInterface(obj, &IID_IACList, (void**)&acl);
248  ok(hr == S_OK, "got 0x%08x\n", hr);
249  hr = IEnumString_QueryInterface(obj, &IID_IACList2, &tmp);
250  ok(hr == E_NOINTERFACE, "got 0x%08x\n", hr);
251  hr = IEnumString_QueryInterface(obj, &IID_IObjMgr, (void**)&mgr);
252  ok(hr == S_OK, "got 0x%08x\n", hr);
253 
254  hr = IEnumString_QueryInterface(obj, &IID_IEnumACString, (LPVOID*)&unk);
255  if (hr == E_NOINTERFACE)
256  todo_wine win_skip("IEnumACString is not supported, skipping tests\n");
257  else
258  {
259  ok(hr == S_OK, "QueryInterface(IID_IEnumACString) failed: %x\n", hr);
260  if (unk != NULL)
261  IEnumACString_Release(unk);
262  }
263 
264  i = -1;
265  hr = IEnumString_Next(obj, 1, (LPOLESTR *)&tmp, &i);
266  ok(hr == S_FALSE, "got 0x%08x\n", hr);
267  ok(i == 0, "Unexpected fetched value %d\n", i);
268  hr = IEnumString_Next(obj, 44, (LPOLESTR *)&tmp, &i);
269  ok(hr == S_FALSE, "got 0x%08x\n", hr);
270  hr = IEnumString_Skip(obj, 1);
271  ok(hr == E_NOTIMPL, "got 0x%08x\n", hr);
272  hr = IEnumString_Clone(obj, (IEnumString **)&tmp);
273  ok(hr == E_OUTOFMEMORY, "got 0x%08x\n", hr);
274  hr = IACList_Expand(acl, exp);
275  ok(hr == S_OK, "got 0x%08x\n", hr);
276 
277  acl1 = TestACL_Constructor(3, strings1);
278  acl2 = TestACL_Constructor(3, strings2);
279  hr = IObjMgr_Append(mgr, (IUnknown *)&acl1->IACList_iface);
280  ok(hr == S_OK, "got 0x%08x\n", hr);
281  hr = IObjMgr_Append(mgr, (IUnknown *)&acl2->IACList_iface);
282  ok(hr == S_OK, "got 0x%08x\n", hr);
283  hr = IObjMgr_Append(mgr, NULL);
284  ok(hr == E_FAIL, "got 0x%08x\n", hr);
285  expect_str(obj, "a");
286  expect_str(obj, "c");
287  expect_str(obj, "e");
288  expect_str(obj, "a");
289  expect_str(obj, "b");
290  expect_str(obj, "d");
291  expect_end(obj);
292 
293  hr = IEnumString_Reset(obj);
294  ok(hr == S_OK, "got 0x%08x\n", hr);
295  ok(acl1->pos == 0, "acl1 not reset\n");
296  ok(acl2->pos == 0, "acl2 not reset\n");
297 
298  hr = IACList_Expand(acl, exp);
299  ok(hr == S_OK, "got 0x%08x\n", hr);
300  ok(acl1->expcount == 1, "expcount - expected 1, got %d\n", acl1->expcount);
301  ok(acl2->expcount == 0 /* XP */ || acl2->expcount == 1 /* Vista */,
302  "expcount - expected 0 or 1, got %d\n", acl2->expcount);
303 
304  hr = IEnumString_Next(obj, 15, wstrtab, &i);
305  ok(hr == S_OK, "got 0x%08x\n", hr);
306  ok(i == 1, "Expected i == 1, got %d\n", i);
307  CoTaskMemFree(wstrtab[0]);
308 
309  hr = IEnumString_Next(obj, 15, wstrtab, &i);
310  ok(hr == S_OK, "got 0x%08x\n", hr);
311  CoTaskMemFree(wstrtab[0]);
312 
313  hr = IEnumString_Next(obj, 15, wstrtab, &i);
314  ok(hr == S_OK, "got 0x%08x\n", hr);
315  CoTaskMemFree(wstrtab[0]);
316 
317  hr = IEnumString_Next(obj, 15, wstrtab, &i);
318  ok(hr == S_OK, "got 0x%08x\n", hr);
319  CoTaskMemFree(wstrtab[0]);
320 
321  hr = IACList_Expand(acl, exp);
322  ok(hr == S_OK, "got 0x%08x\n", hr);
323  ok(acl1->expcount == 2, "expcount - expected 1, got %d\n", acl1->expcount);
324  ok(acl2->expcount == 0 /* XP */ || acl2->expcount == 2 /* Vista */,
325  "expcount - expected 0 or 2, got %d\n", acl2->expcount);
326  acl1->expret = S_FALSE;
327  hr = IACList_Expand(acl, exp);
328  ok(hr == S_OK, "got 0x%08x\n", hr);
329  ok(acl1->expcount == 3, "expcount - expected 1, got %d\n", acl1->expcount);
330  ok(acl2->expcount == 1 /* XP */ || acl2->expcount == 3 /* Vista */,
331  "expcount - expected 0 or 3, got %d\n", acl2->expcount);
332  acl1->expret = E_NOTIMPL;
333  hr = IACList_Expand(acl, exp);
334  ok(hr == S_OK, "got 0x%08x\n", hr);
335  ok(acl1->expcount == 4, "expcount - expected 1, got %d\n", acl1->expcount);
336  ok(acl2->expcount == 2 /* XP */ || acl2->expcount == 4 /* Vista */,
337  "expcount - expected 0 or 4, got %d\n", acl2->expcount);
338  acl2->expret = E_OUTOFMEMORY;
339  hr = IACList_Expand(acl, exp);
340  ok(hr == E_OUTOFMEMORY, "got 0x%08x\n", hr);
341  acl2->expret = E_FAIL;
342  hr = IACList_Expand(acl, exp);
343  ok(hr == E_FAIL, "got 0x%08x\n", hr);
344 
345  hr = IObjMgr_Remove(mgr, (IUnknown *)&acl1->IACList_iface);
346  ok(hr == S_OK, "got 0x%08x\n", hr);
347 
348  ok(acl1->ref == 1, "acl1 not released\n");
349  expect_end(obj);
350  IEnumString_Reset(obj);
351  expect_str(obj, "a");
352  expect_str(obj, "b");
353  expect_str(obj, "d");
354  expect_end(obj);
355 
356  IEnumString_Release(obj);
357  IACList_Release(acl);
358  ref = IObjMgr_Release(mgr);
359  ok(ref == 0, "Unexpected references\n");
360  ok(acl1->ref == 1, "acl1 not released\n");
361  ok(acl2->ref == 1, "acl2 not released\n");
362 
363  CoTaskMemFree(acl1);
364  CoTaskMemFree(acl2);
365 }
INT expcount
Definition: autocomplete.c:54
#define E_NOINTERFACE
Definition: winerror.h:2364
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:422
const GUID IID_IEnumString
HRESULT hr
Definition: shlfolder.c:183
#define expect_str(obj, str)
Definition: autocomplete.c:215
static LPOLESTR
Definition: stg_prop.c:27
#define E_FAIL
Definition: ddrawi.h:102
Definition: send.c:47
GLsizei GLsizei GLuint * obj
Definition: glext.h:6042
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
IACList IACList_iface
Definition: autocomplete.c:51
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
GLenum GLint ref
Definition: glext.h:6028
#define S_FALSE
Definition: winerror.h:2357
smooth NULL
Definition: ftsmooth.c:416
#define IACList_Release(p)
Definition: shlobj.h:723
static TestACL * TestACL_Constructor(int limit, const char **strings)
Definition: autocomplete.c:73
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
#define expect_end(obj)
Definition: autocomplete.c:223
#define todo_wine
Definition: test.h:154
LONG ref
Definition: autocomplete.c:52
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3234
#define IACList_Expand(p, a)
Definition: shlobj.h:725
#define S_OK
Definition: intsafe.h:59
#define IObjMgr_Append(p, a)
Definition: shlobj.h:678
#define ok(value,...)
Definition: atltest.h:57
HRESULT expret
Definition: autocomplete.c:53
#define E_NOTIMPL
Definition: ddrawi.h:99
#define IObjMgr_Remove(p, a)
Definition: shlobj.h:679
unsigned int UINT
Definition: ndis.h:50
DWORD exp
Definition: msg.c:15681
unsigned int ULONG
Definition: retypes.h:1
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define IObjMgr_Release(p)
Definition: shlobj.h:676
#define win_skip
Definition: test.h:141

Referenced by START_TEST().

◆ TestACL_ACList_AddRef()

static ULONG STDMETHODCALLTYPE TestACL_ACList_AddRef ( IACList *  iface)
static

Definition at line 188 of file autocomplete.c.

189 {
190  TestACL *This = impl_from_IACList(iface);
191  return TestACL_AddRef(&This->IEnumString_iface);
192 }
static TestACL * impl_from_IACList(IACList *iface)
Definition: autocomplete.c:68
static ULONG STDMETHODCALLTYPE TestACL_AddRef(IEnumString *iface)
Definition: autocomplete.c:86

◆ TestACL_ACList_QueryInterface()

static HRESULT STDMETHODCALLTYPE TestACL_ACList_QueryInterface ( IACList *  iface,
REFIID  iid,
LPVOID ppvout 
)
static

Definition at line 200 of file autocomplete.c.

201 {
202  TestACL *This = impl_from_IACList(iface);
203  return TestACL_QueryInterface(&This->IEnumString_iface, iid, ppvout);
204 }
static TestACL * impl_from_IACList(IACList *iface)
Definition: autocomplete.c:68
static HRESULT STDMETHODCALLTYPE TestACL_QueryInterface(IEnumString *iface, REFIID iid, LPVOID *ppvOut)
Definition: autocomplete.c:103

◆ TestACL_ACList_Release()

static ULONG STDMETHODCALLTYPE TestACL_ACList_Release ( IACList *  iface)
static

Definition at line 194 of file autocomplete.c.

195 {
196  TestACL *This = impl_from_IACList(iface);
197  return TestACL_Release(&This->IEnumString_iface);
198 }
static TestACL * impl_from_IACList(IACList *iface)
Definition: autocomplete.c:68
static ULONG STDMETHODCALLTYPE TestACL_Release(IEnumString *iface)
Definition: autocomplete.c:93

◆ TestACL_AddRef()

static ULONG STDMETHODCALLTYPE TestACL_AddRef ( IEnumString iface)
static

Definition at line 86 of file autocomplete.c.

87 {
89  trace("ACL(%p): addref (%d)\n", This, This->ref+1);
90  return InterlockedIncrement(&This->ref);
91 }
static TestACL * impl_from_IEnumString(IEnumString *iface)
Definition: autocomplete.c:63
#define trace
Definition: atltest.h:70
#define InterlockedIncrement
Definition: armddk.h:53

Referenced by TestACL_ACList_AddRef().

◆ TestACL_Clone()

static HRESULT STDMETHODCALLTYPE TestACL_Clone ( IEnumString iface,
IEnumString **  out 
)
static

Definition at line 154 of file autocomplete.c.

155 {
156  ok(FALSE, "Unexpected call to TestACL_Clone\n");
157  return E_OUTOFMEMORY;
158 }
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define ok(value,...)
Definition: atltest.h:57

◆ TestACL_Constructor()

static TestACL* TestACL_Constructor ( int  limit,
const char **  strings 
)
static

Definition at line 73 of file autocomplete.c.

74 {
75  TestACL *This = CoTaskMemAlloc(sizeof(TestACL));
76  ZeroMemory(This, sizeof(*This));
77  This->IEnumString_iface.lpVtbl = &TestACLVtbl;
78  This->IACList_iface.lpVtbl = &TestACL_ACListVtbl;
79  This->ref = 1;
80  This->expret = S_OK;
81  This->limit = limit;
82  This->data = strings;
83  return This;
84 }
#define ZeroMemory
Definition: winbase.h:1635
GLint limit
Definition: glext.h:10326
IEnumStringVtbl TestACLVtbl
Definition: autocomplete.c:176
GLsizei const GLchar *const * strings
Definition: glext.h:7622
#define S_OK
Definition: intsafe.h:59
IACListVtbl TestACL_ACListVtbl
Definition: autocomplete.c:206
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: ifs.c:406

Referenced by test_ACLMulti().

◆ TestACL_Expand()

static HRESULT STDMETHODCALLTYPE TestACL_Expand ( IACList *  iface,
LPCOLESTR  str 
)
static

Definition at line 168 of file autocomplete.c.

169 {
170  TestACL *This = impl_from_IACList(iface);
171  trace("ACL(%p): Expand\n", This);
172  This->expcount++;
173  return This->expret;
174 }
static TestACL * impl_from_IACList(IACList *iface)
Definition: autocomplete.c:68
#define trace
Definition: atltest.h:70

◆ TestACL_Next()

static HRESULT STDMETHODCALLTYPE TestACL_Next ( IEnumString iface,
ULONG  celt,
LPOLESTR rgelt,
ULONG pceltFetched 
)
static

Definition at line 127 of file autocomplete.c.

128 {
130  ULONG i;
131 
132  trace("ACL(%p): read %d item(s)\n", This, celt);
133  for (i = 0; i < celt; i++)
134  {
135  if (This->pos >= This->limit)
136  break;
137  rgelt[i] = strdup_AtoW(This->data[This->pos]);
138  This->pos++;
139  }
140 
141  if (pceltFetched)
142  *pceltFetched = i;
143  if (i == celt)
144  return S_OK;
145  return S_FALSE;
146 }
static TestACL * impl_from_IEnumString(IEnumString *iface)
Definition: autocomplete.c:63
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
#define S_FALSE
Definition: winerror.h:2357
static LPWSTR strdup_AtoW(LPCSTR str)
Definition: autocomplete.c:40
#define trace
Definition: atltest.h:70
#define S_OK
Definition: intsafe.h:59
unsigned int ULONG
Definition: retypes.h:1

◆ TestACL_QueryInterface()

static HRESULT STDMETHODCALLTYPE TestACL_QueryInterface ( IEnumString iface,
REFIID  iid,
LPVOID ppvOut 
)
static

Definition at line 103 of file autocomplete.c.

104 {
106  *ppvOut = NULL;
108  {
109  *ppvOut = iface;
110  }
111  else if (IsEqualGUID(iid, &IID_IACList))
112  {
113  *ppvOut = &This->IACList_iface;
114  }
115 
116  if (*ppvOut)
117  {
118  IEnumString_AddRef(iface);
119  return S_OK;
120  }
121 
122  if (!IsEqualGUID(iid, &IID_IEnumACString))
123  trace("unknown interface queried\n");
124  return E_NOINTERFACE;
125 }
#define E_NOINTERFACE
Definition: winerror.h:2364
const GUID IID_IEnumString
static TestACL * impl_from_IEnumString(IEnumString *iface)
Definition: autocomplete.c:63
smooth NULL
Definition: ftsmooth.c:416
#define trace
Definition: atltest.h:70
const GUID IID_IUnknown
#define S_OK
Definition: intsafe.h:59
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021

Referenced by TestACL_ACList_QueryInterface().

◆ TestACL_Release()

static ULONG STDMETHODCALLTYPE TestACL_Release ( IEnumString iface)
static

Definition at line 93 of file autocomplete.c.

94 {
96  ULONG res;
97 
98  res = InterlockedDecrement(&This->ref);
99  trace("ACL(%p): release (%d)\n", This, res);
100  return res;
101 }
static TestACL * impl_from_IEnumString(IEnumString *iface)
Definition: autocomplete.c:63
#define trace
Definition: atltest.h:70
#define InterlockedDecrement
Definition: armddk.h:52
GLuint res
Definition: glext.h:9613
unsigned int ULONG
Definition: retypes.h:1

Referenced by TestACL_ACList_Release().

◆ TestACL_Reset()

static HRESULT STDMETHODCALLTYPE TestACL_Reset ( IEnumString iface)
static

Definition at line 160 of file autocomplete.c.

161 {
163  trace("ACL(%p): Reset\n", This);
164  This->pos = 0;
165  return S_OK;
166 }
static TestACL * impl_from_IEnumString(IEnumString *iface)
Definition: autocomplete.c:63
#define trace
Definition: atltest.h:70
#define S_OK
Definition: intsafe.h:59

◆ TestACL_Skip()

static HRESULT STDMETHODCALLTYPE TestACL_Skip ( IEnumString iface,
ULONG  celt 
)
static

Definition at line 148 of file autocomplete.c.

149 {
150  ok(FALSE, "Unexpected call to TestACL_Skip\n");
151  return E_NOTIMPL;
152 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

Variable Documentation

◆ TestACL_ACListVtbl

IACListVtbl TestACL_ACListVtbl
Initial value:
=
{
}
static HRESULT STDMETHODCALLTYPE TestACL_Expand(IACList *iface, LPCOLESTR str)
Definition: autocomplete.c:168
static ULONG STDMETHODCALLTYPE TestACL_ACList_Release(IACList *iface)
Definition: autocomplete.c:194
static ULONG STDMETHODCALLTYPE TestACL_ACList_AddRef(IACList *iface)
Definition: autocomplete.c:188
static HRESULT STDMETHODCALLTYPE TestACL_ACList_QueryInterface(IACList *iface, REFIID iid, LPVOID *ppvout)
Definition: autocomplete.c:200

Definition at line 206 of file autocomplete.c.

Referenced by TestACL_Constructor().

◆ TestACLVtbl

IEnumStringVtbl TestACLVtbl
Initial value:
=
{
}
static HRESULT STDMETHODCALLTYPE TestACL_Next(IEnumString *iface, ULONG celt, LPOLESTR *rgelt, ULONG *pceltFetched)
Definition: autocomplete.c:127
static HRESULT STDMETHODCALLTYPE TestACL_QueryInterface(IEnumString *iface, REFIID iid, LPVOID *ppvOut)
Definition: autocomplete.c:103
static HRESULT STDMETHODCALLTYPE TestACL_Skip(IEnumString *iface, ULONG celt)
Definition: autocomplete.c:148
static ULONG STDMETHODCALLTYPE TestACL_Release(IEnumString *iface)
Definition: autocomplete.c:93
static HRESULT STDMETHODCALLTYPE TestACL_Clone(IEnumString *iface, IEnumString **out)
Definition: autocomplete.c:154
static ULONG STDMETHODCALLTYPE TestACL_AddRef(IEnumString *iface)
Definition: autocomplete.c:86
static HRESULT STDMETHODCALLTYPE TestACL_Reset(IEnumString *iface)
Definition: autocomplete.c:160

Definition at line 176 of file autocomplete.c.

Referenced by TestACL_Constructor().