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

Go to the source code of this file.

Classes

struct  string_enumerator
 

Macros

#define COBJMACROS
 
#define check_dropdown(acdropdown, hwnd_edit, list, list_num)   check_dropdown_(__FILE__, __LINE__, acdropdown, hwnd_edit, list, list_num)
 

Functions

static void test_invalid_init (void)
 
static IAutoCompletetest_init (void)
 
static void test_killfocus (void)
 
static LRESULT CALLBACK MyWndProc (HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
 
static void createMainWnd (void)
 
static LRESULT CALLBACK HijackerWndProc (HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
 
static LRESULT CALLBACK HijackerWndProc2 (HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
 
static struct string_enumeratorimpl_from_IEnumString (IEnumString *iface)
 
static HRESULT WINAPI string_enumerator_QueryInterface (IEnumString *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI string_enumerator_AddRef (IEnumString *iface)
 
static ULONG WINAPI string_enumerator_Release (IEnumString *iface)
 
static HRESULT WINAPI string_enumerator_Next (IEnumString *iface, ULONG num, LPOLESTR *strings, ULONG *num_returned)
 
static HRESULT WINAPI string_enumerator_Reset (IEnumString *iface)
 
static HRESULT WINAPI string_enumerator_Skip (IEnumString *iface, ULONG num)
 
static HRESULT WINAPI string_enumerator_Clone (IEnumString *iface, IEnumString **out)
 
static struct string_enumeratorimpl_from_IACList (IACList *iface)
 
static HRESULT WINAPI aclist_QueryInterface (IACList *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI aclist_AddRef (IACList *iface)
 
static ULONG WINAPI aclist_Release (IACList *iface)
 
static HRESULT WINAPI aclist_Expand (IACList *iface, const WCHAR *expand)
 
static HRESULT string_enumerator_create (void **ppv, WCHAR **suggestions, int count)
 
static void dispatch_messages (void)
 
static void check_dropdown_ (const char *file, UINT line, IAutoCompleteDropDown *acdropdown, HWND hwnd_edit, WCHAR **list, UINT list_num)
 
static void test_aclist_expand (HWND hwnd_edit, void *enumerator)
 
static void test_prefix_filtering (HWND hwnd_edit)
 
static void test_custom_source (void)
 
 START_TEST (autocomplete)
 

Variables

static HWND hMainWnd
 
static HWND hEdit
 
static HINSTANCE hinst
 
static int killfocus_count
 
static WNDPROC HijackerWndProc_prev
 
static const WCHAR HijackerWndProc_txt [] = {'H','i','j','a','c','k','e','d',0}
 
static IEnumStringVtbl string_enumerator_vtbl
 
static IACListVtbl aclist_vtbl
 

Macro Definition Documentation

◆ check_dropdown

#define check_dropdown (   acdropdown,
  hwnd_edit,
  list,
  list_num 
)    check_dropdown_(__FILE__, __LINE__, acdropdown, hwnd_edit, list, list_num)

Definition at line 453 of file autocomplete.c.

◆ COBJMACROS

#define COBJMACROS

Definition at line 21 of file autocomplete.c.

Function Documentation

◆ aclist_AddRef()

static ULONG WINAPI aclist_AddRef ( IACList *  iface)
static

Definition at line 394 of file autocomplete.c.

395 {
396  return string_enumerator_AddRef(&impl_from_IACList(iface)->IEnumString_iface);
397 }
static struct string_enumerator * impl_from_IACList(IACList *iface)
Definition: autocomplete.c:384
static ULONG WINAPI string_enumerator_AddRef(IEnumString *iface)
Definition: autocomplete.c:304

◆ aclist_Expand()

static HRESULT WINAPI aclist_Expand ( IACList *  iface,
const WCHAR expand 
)
static

Definition at line 404 of file autocomplete.c.

405 {
406  struct string_enumerator *this = impl_from_IACList(iface);
407 
408  /* see what we get called with and how many times,
409  don't actually do any expansion of the strings */
410  memcpy(this->last_expand, expand, min((lstrlenW(expand) + 1)*sizeof(WCHAR), sizeof(this->last_expand)));
411  this->last_expand[ARRAY_SIZE(this->last_expand) - 1] = '\0';
412  this->num_expand++;
413 
414  return S_OK;
415 }
WCHAR last_expand[32]
Definition: autocomplete.c:279
static struct string_enumerator * impl_from_IACList(IACList *iface)
Definition: autocomplete.c:384
#define lstrlenW
Definition: compat.h:407
static BOOL expand(LPINT ac, LPTSTR **arg, LPCTSTR pattern)
Definition: misc.c:215
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define S_OK
Definition: intsafe.h:59
#define ARRAY_SIZE(a)
Definition: main.h:24
#define min(a, b)
Definition: monoChain.cc:55

◆ aclist_QueryInterface()

static HRESULT WINAPI aclist_QueryInterface ( IACList *  iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 389 of file autocomplete.c.

390 {
392 }
static struct string_enumerator * impl_from_IACList(IACList *iface)
Definition: autocomplete.c:384
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
static HRESULT WINAPI string_enumerator_QueryInterface(IEnumString *iface, REFIID riid, void **ppv)
Definition: autocomplete.c:287
IEnumString IEnumString_iface
Definition: autocomplete.c:271

◆ aclist_Release()

static ULONG WINAPI aclist_Release ( IACList *  iface)
static

Definition at line 399 of file autocomplete.c.

400 {
402 }
static struct string_enumerator * impl_from_IACList(IACList *iface)
Definition: autocomplete.c:384
static ULONG WINAPI string_enumerator_Release(IEnumString *iface)
Definition: autocomplete.c:313
IEnumString IEnumString_iface
Definition: autocomplete.c:271

◆ check_dropdown_()

static void check_dropdown_ ( const char file,
UINT  line,
IAutoCompleteDropDown acdropdown,
HWND  hwnd_edit,
WCHAR **  list,
UINT  list_num 
)
static

Definition at line 454 of file autocomplete.c.

455 {
456  UINT i;
457  DWORD flags = 0;
458  LPWSTR str;
459  HRESULT hr;
460 
461  hr = IAutoCompleteDropDown_GetDropDownStatus(acdropdown, &flags, &str);
462  ok_(file, line)(hr == S_OK, "IAutoCompleteDropDown_GetDropDownStatus failed: %x\n", hr);
463  if (hr != S_OK) return;
464  if (list_num) ok_(file, line)(flags & ACDD_VISIBLE, "AutoComplete DropDown not visible\n");
465  else
466  {
467  ok_(file, line)(!(flags & ACDD_VISIBLE), "AutoComplete DropDown visible\n");
468  return;
469  }
470  ok_(file, line)(str == NULL, "Expected (null), got %s\n", wine_dbgstr_w(str));
471  if (str)
472  {
474  return;
475  }
476 
477  for (i = 0; i <= list_num; i++)
478  {
479  flags = 0;
480  SendMessageW(hwnd_edit, WM_KEYDOWN, VK_DOWN, 0);
481  SendMessageW(hwnd_edit, WM_KEYUP, VK_DOWN, 0xc0000000);
482  hr = IAutoCompleteDropDown_GetDropDownStatus(acdropdown, &flags, &str);
483  ok_(file, line)(hr == S_OK, "IAutoCompleteDropDown_GetDropDownStatus failed: %x\n", hr);
484  ok_(file, line)(flags & ACDD_VISIBLE, "AutoComplete DropDown not visible\n");
485  if (hr == S_OK)
486  {
487  if (i < list_num)
488  ok_(file, line)(str && !lstrcmpW(list[i], str), "Expected %s, got %s\n",
490  else
491  ok_(file, line)(str == NULL, "Expected (null), got %s\n", wine_dbgstr_w(str));
492  }
494  }
495 }
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:422
HRESULT hr
Definition: shlfolder.c:183
char * wine_dbgstr_w(const wchar_t *wstr)
Definition: atltest.h:87
int WINAPI lstrcmpW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:170
#define VK_DOWN
Definition: winuser.h:2202
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
smooth NULL
Definition: ftsmooth.c:416
#define WM_KEYDOWN
Definition: winuser.h:1697
Definition: parser.c:48
LONG HRESULT
Definition: typedefs.h:77
#define WM_KEYUP
Definition: winuser.h:1698
unsigned long DWORD
Definition: ntddk_ex.h:95
GLbitfield flags
Definition: glext.h:7161
Definition: _list.h:228
#define S_OK
Definition: intsafe.h:59
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
unsigned int UINT
Definition: ndis.h:50
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define ok_(x1, x2)
Definition: atltest.h:61
Definition: fci.c:126

◆ createMainWnd()

static void createMainWnd ( void  )
static

Definition at line 220 of file autocomplete.c.

221 {
222  WNDCLASSA wc;
223  wc.style = CS_HREDRAW | CS_VREDRAW;
224  wc.cbClsExtra = 0;
225  wc.cbWndExtra = 0;
227  wc.hIcon = NULL;
230  wc.lpszMenuName = NULL;
231  wc.lpszClassName = "MyTestWnd";
232  wc.lpfnWndProc = MyWndProc;
233  RegisterClassA(&wc);
234 
235  hMainWnd = CreateWindowExA(0, "MyTestWnd", "Blah", WS_OVERLAPPEDWINDOW,
237 }
int cbClsExtra
Definition: winuser.h:3139
#define CS_HREDRAW
Definition: winuser.h:648
LPCSTR lpszMenuName
Definition: winuser.h:3145
HBRUSH hbrBackground
Definition: winuser.h:3144
char * LPSTR
Definition: xmlstorage.h:182
#define COLOR_WINDOW
Definition: winuser.h:908
#define IDC_IBEAM
Definition: winuser.h:683
int cbWndExtra
Definition: winuser.h:3140
HCURSOR hCursor
Definition: winuser.h:3143
#define CW_USEDEFAULT
Definition: winuser.h:225
smooth NULL
Definition: ftsmooth.c:416
#define CS_VREDRAW
Definition: winuser.h:653
static HWND hMainWnd
Definition: autocomplete.c:34
static LRESULT CALLBACK MyWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: autocomplete.c:203
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:821
LPCSTR lpszClassName
Definition: winuser.h:3146
HCURSOR WINAPI LoadCursorA(_In_opt_ HINSTANCE, _In_ LPCSTR)
Definition: cursoricon.c:2059
UINT style
Definition: winuser.h:3137
HINSTANCE hInstance
Definition: winuser.h:3141
WNDPROC lpfnWndProc
Definition: winuser.h:3138
HWND WINAPI CreateWindowExA(_In_ DWORD dwExStyle, _In_opt_ LPCSTR lpClassName, _In_opt_ LPCSTR lpWindowName, _In_ DWORD dwStyle, _In_ int X, _In_ int Y, _In_ int nWidth, _In_ int nHeight, _In_opt_ HWND hWndParent, _In_opt_ HMENU hMenu, _In_opt_ HINSTANCE hInstance, _In_opt_ LPVOID lpParam)
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
HBRUSH WINAPI GetSysColorBrush(_In_ int)
ATOM WINAPI RegisterClassA(_In_ CONST WNDCLASSA *)
HICON hIcon
Definition: winuser.h:3142

Referenced by START_TEST().

◆ dispatch_messages()

static void dispatch_messages ( void  )
static

Definition at line 442 of file autocomplete.c.

443 {
444  MSG msg;
445  Sleep(33);
446  while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE))
447  {
450  }
451 }
BOOL WINAPI TranslateMessage(_In_ const MSG *)
LRESULT WINAPI DispatchMessageA(_In_ const MSG *)
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
Definition: synch.c:790
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
BOOL WINAPI PeekMessageA(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT, _In_ UINT)
#define msg(x)
Definition: auth_time.c:54
#define PM_REMOVE
Definition: winuser.h:1182

Referenced by test_aclist_expand(), test_custom_source(), and test_prefix_filtering().

◆ HijackerWndProc()

static LRESULT CALLBACK HijackerWndProc ( HWND  hWnd,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 241 of file autocomplete.c.

242 {
243  switch(msg) {
244  case WM_GETTEXT:
245  {
247  memcpy((void*)lParam, HijackerWndProc_txt, len * sizeof(WCHAR));
248  return len;
249  }
250  case WM_GETTEXTLENGTH:
251  return ARRAY_SIZE(HijackerWndProc_txt) - 1;
252  }
254 }
#define WM_GETTEXTLENGTH
Definition: winuser.h:1601
#define WM_GETTEXT
Definition: winuser.h:1600
HWND hWnd
Definition: settings.c:17
WPARAM wParam
Definition: combotst.c:138
__wchar_t WCHAR
Definition: xmlstorage.h:180
static WNDPROC HijackerWndProc_prev
Definition: autocomplete.c:239
static const WCHAR HijackerWndProc_txt[]
Definition: autocomplete.c:240
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum GLsizei len
Definition: glext.h:6722
#define ARRAY_SIZE(a)
Definition: main.h:24
#define min(a, b)
Definition: monoChain.cc:55
#define msg(x)
Definition: auth_time.c:54
LRESULT WINAPI CallWindowProcW(_In_ WNDPROC, _In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
LPARAM lParam
Definition: combotst.c:139

Referenced by test_custom_source().

◆ HijackerWndProc2()

static LRESULT CALLBACK HijackerWndProc2 ( HWND  hWnd,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 256 of file autocomplete.c.

257 {
258  switch(msg) {
259  case EM_SETSEL:
260  lParam = wParam;
261  break;
262  case WM_SETTEXT:
264  break;
265  }
267 }
HWND hWnd
Definition: settings.c:17
WPARAM wParam
Definition: combotst.c:138
LONG_PTR LPARAM
Definition: windef.h:208
#define WM_SETTEXT
Definition: winuser.h:1599
#define EM_SETSEL
Definition: winuser.h:2000
static WNDPROC HijackerWndProc_prev
Definition: autocomplete.c:239
static const WCHAR HijackerWndProc_txt[]
Definition: autocomplete.c:240
#define msg(x)
Definition: auth_time.c:54
LRESULT WINAPI CallWindowProcW(_In_ WNDPROC, _In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
LPARAM lParam
Definition: combotst.c:139

Referenced by test_custom_source().

◆ impl_from_IACList()

static struct string_enumerator* impl_from_IACList ( IACList *  iface)
static

Definition at line 384 of file autocomplete.c.

385 {
386  return CONTAINING_RECORD(iface, struct string_enumerator, IACList_iface);
387 }
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 aclist_AddRef(), aclist_Expand(), aclist_QueryInterface(), and aclist_Release().

◆ impl_from_IEnumString()

static struct string_enumerator* impl_from_IEnumString ( IEnumString iface)
static

Definition at line 282 of file autocomplete.c.

283 {
285 }
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
IEnumString IEnumString_iface
Definition: autocomplete.c:271

Referenced by string_enumerator_AddRef(), string_enumerator_Next(), string_enumerator_QueryInterface(), string_enumerator_Release(), string_enumerator_Reset(), and string_enumerator_Skip().

◆ MyWndProc()

static LRESULT CALLBACK MyWndProc ( HWND  hWnd,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 203 of file autocomplete.c.

204 {
205  switch(msg) {
206  case WM_CREATE:
207  /* create edit control */
208  hEdit = CreateWindowExA(0, "EDIT", "Some text", 0, 10, 10, 300, 300,
209  hWnd, NULL, hinst, NULL);
210  ok(hEdit != NULL, "Can't create edit control\n");
211  break;
212  case WM_COMMAND:
213  if(HIWORD(wParam) == EN_KILLFOCUS)
214  killfocus_count++;
215  break;
216  }
217  return DefWindowProcA(hWnd, msg, wParam, lParam);
218 }
HWND hWnd
Definition: settings.c:17
static HINSTANCE hinst
Definition: autocomplete.c:35
WPARAM wParam
Definition: combotst.c:138
#define EN_KILLFOCUS
Definition: winuser.h:2007
smooth NULL
Definition: ftsmooth.c:416
static HWND hEdit
Definition: autocomplete.c:34
#define WM_COMMAND
Definition: winuser.h:1722
LRESULT WINAPI DefWindowProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define ok(value,...)
Definition: atltest.h:57
static int killfocus_count
Definition: autocomplete.c:36
#define msg(x)
Definition: auth_time.c:54
#define WM_CREATE
Definition: winuser.h:1590
HWND WINAPI CreateWindowExA(_In_ DWORD dwExStyle, _In_opt_ LPCSTR lpClassName, _In_opt_ LPCSTR lpWindowName, _In_ DWORD dwStyle, _In_ int X, _In_ int Y, _In_ int nWidth, _In_ int nHeight, _In_opt_ HWND hWndParent, _In_opt_ HMENU hMenu, _In_opt_ HINSTANCE hInstance, _In_opt_ LPVOID lpParam)
#define HIWORD(l)
Definition: typedefs.h:246
LPARAM lParam
Definition: combotst.c:139

Referenced by createMainWnd().

◆ START_TEST()

START_TEST ( autocomplete  )

Definition at line 800 of file autocomplete.c.

801 {
802  HRESULT r;
803  MSG msg;
804  IAutoComplete* ac;
805  RECT win_rect;
806  POINT orig_pos;
807 
808  r = CoInitialize(NULL);
809  ok(r == S_OK, "CoInitialize failed (0x%08x). Tests aborted.\n", r);
810  if (r != S_OK)
811  return;
812 
813  createMainWnd();
814  ok(hMainWnd != NULL, "Failed to create parent window. Tests aborted.\n");
815  if (!hMainWnd) return;
816 
817  /* Move the cursor away from the dropdown listbox */
818  GetWindowRect(hMainWnd, &win_rect);
819  GetCursorPos(&orig_pos);
820  SetCursorPos(win_rect.left, win_rect.top);
821 
823  ac = test_init();
824  if (!ac)
825  goto cleanup;
826  test_killfocus();
827 
829 
830  PostQuitMessage(0);
831  while(GetMessageA(&msg,0,0,0)) {
834  }
835 
836  IAutoComplete_Release(ac);
837 
838 cleanup:
839  SetCursorPos(orig_pos.x, orig_pos.y);
842 
843  CoUninitialize();
844 }
static void createMainWnd(void)
Definition: autocomplete.c:220
BOOL WINAPI TranslateMessage(_In_ const MSG *)
LRESULT WINAPI DispatchMessageA(_In_ const MSG *)
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
static IAutoComplete * test_init(void)
Definition: autocomplete.c:141
LONG top
Definition: windef.h:292
BOOL WINAPI GetMessageA(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT)
LONG left
Definition: windef.h:291
BOOL WINAPI GetCursorPos(_Out_ LPPOINT)
Definition: cursoricon.c:2635
BOOL WINAPI DestroyWindow(_In_ HWND)
static void test_custom_source(void)
Definition: autocomplete.c:677
smooth NULL
Definition: ftsmooth.c:416
static HWND hMainWnd
Definition: autocomplete.c:34
LONG HRESULT
Definition: typedefs.h:77
BOOL WINAPI SetCursorPos(_In_ int, _In_ int)
Definition: cursoricon.c:2627
static HWND hEdit
Definition: autocomplete.c:34
#define S_OK
Definition: intsafe.h:59
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
Definition: compobj.c:1991
#define ok(value,...)
Definition: atltest.h:57
static void test_invalid_init(void)
Definition: autocomplete.c:38
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
Definition: compobj.c:1897
#define msg(x)
Definition: auth_time.c:54
char * cleanup(char *str)
Definition: wpickclick.c:99
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
static void test_killfocus(void)
Definition: autocomplete.c:193

◆ string_enumerator_AddRef()

static ULONG WINAPI string_enumerator_AddRef ( IEnumString iface)
static

Definition at line 304 of file autocomplete.c.

305 {
306  struct string_enumerator *this = impl_from_IEnumString(iface);
307 
308  ULONG ref = InterlockedIncrement(&this->ref);
309 
310  return ref;
311 }
static struct string_enumerator * impl_from_IEnumString(IEnumString *iface)
Definition: autocomplete.c:282
Definition: send.c:47
GLenum GLint ref
Definition: glext.h:6028
#define InterlockedIncrement
Definition: armddk.h:53
unsigned int ULONG
Definition: retypes.h:1

Referenced by aclist_AddRef().

◆ string_enumerator_Clone()

static HRESULT WINAPI string_enumerator_Clone ( IEnumString iface,
IEnumString **  out 
)
static

Definition at line 367 of file autocomplete.c.

368 {
369  *out = NULL;
370  return E_NOTIMPL;
371 }
smooth NULL
Definition: ftsmooth.c:416
static FILE * out
Definition: regtests2xml.c:44
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ string_enumerator_create()

static HRESULT string_enumerator_create ( void **  ppv,
WCHAR **  suggestions,
int  count 
)
static

Definition at line 425 of file autocomplete.c.

426 {
427  struct string_enumerator *object;
428 
429  object = heap_alloc_zero(sizeof(*object));
430  object->IEnumString_iface.lpVtbl = &string_enumerator_vtbl;
431  object->IACList_iface.lpVtbl = &aclist_vtbl;
432  object->ref = 1;
433  object->data = suggestions;
434  object->data_len = count;
435  object->cur = 0;
436 
437  *ppv = &object->IEnumString_iface;
438 
439  return S_OK;
440 }
GLuint GLuint GLsizei count
Definition: gl.h:1545
REFIID LPVOID * ppv
Definition: atlbase.h:39
static IACListVtbl aclist_vtbl
Definition: autocomplete.c:417
static IEnumStringVtbl string_enumerator_vtbl
Definition: autocomplete.c:373
#define S_OK
Definition: intsafe.h:59
void * object
Definition: jmemsys.h:48

Referenced by test_custom_source(), and test_prefix_filtering().

◆ string_enumerator_Next()

static HRESULT WINAPI string_enumerator_Next ( IEnumString iface,
ULONG  num,
LPOLESTR strings,
ULONG num_returned 
)
static

Definition at line 325 of file autocomplete.c.

326 {
327  struct string_enumerator *this = impl_from_IEnumString(iface);
328  int i, len;
329 
330  *num_returned = 0;
331  for (i = 0; i < num; i++)
332  {
333  if (this->cur >= this->data_len)
334  return S_FALSE;
335 
336  len = lstrlenW(this->data[this->cur]) + 1;
337 
338  strings[i] = CoTaskMemAlloc(len * sizeof(WCHAR));
339  memcpy(strings[i], this->data[this->cur], len * sizeof(WCHAR));
340 
341  (*num_returned)++;
342  this->cur++;
343  }
344 
345  return S_OK;
346 }
static struct string_enumerator * impl_from_IEnumString(IEnumString *iface)
Definition: autocomplete.c:282
#define lstrlenW
Definition: compat.h:407
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
__wchar_t WCHAR
Definition: xmlstorage.h:180
GLuint GLuint num
Definition: glext.h:9618
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLsizei const GLchar *const * strings
Definition: glext.h:7622
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum GLsizei len
Definition: glext.h:6722
#define S_OK
Definition: intsafe.h:59
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: ifs.c:406

◆ string_enumerator_QueryInterface()

static HRESULT WINAPI string_enumerator_QueryInterface ( IEnumString iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 287 of file autocomplete.c.

288 {
289  struct string_enumerator *this = impl_from_IEnumString(iface);
291  *ppv = &this->IEnumString_iface;
292  else if (IsEqualGUID(riid, &IID_IACList))
293  *ppv = &this->IACList_iface;
294  else
295  {
296  *ppv = NULL;
297  return E_NOINTERFACE;
298  }
299 
300  IUnknown_AddRef(&this->IEnumString_iface);
301  return S_OK;
302 }
#define E_NOINTERFACE
Definition: winerror.h:2364
const GUID IID_IEnumString
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
static struct string_enumerator * impl_from_IEnumString(IEnumString *iface)
Definition: autocomplete.c:282
smooth NULL
Definition: ftsmooth.c:416
const GUID IID_IUnknown
#define S_OK
Definition: intsafe.h:59
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021
IEnumString IEnumString_iface
Definition: autocomplete.c:271

Referenced by aclist_QueryInterface().

◆ string_enumerator_Release()

static ULONG WINAPI string_enumerator_Release ( IEnumString iface)
static

Definition at line 313 of file autocomplete.c.

314 {
315  struct string_enumerator *this = impl_from_IEnumString(iface);
316 
317  ULONG ref = InterlockedDecrement(&this->ref);
318 
319  if (!ref)
320  heap_free(this);
321 
322  return ref;
323 }
static struct string_enumerator * impl_from_IEnumString(IEnumString *iface)
Definition: autocomplete.c:282
Definition: send.c:47
GLenum GLint ref
Definition: glext.h:6028
#define InterlockedDecrement
Definition: armddk.h:52
unsigned int ULONG
Definition: retypes.h:1
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by aclist_Release().

◆ string_enumerator_Reset()

static HRESULT WINAPI string_enumerator_Reset ( IEnumString iface)
static

Definition at line 348 of file autocomplete.c.

349 {
350  struct string_enumerator *this = impl_from_IEnumString(iface);
351 
352  this->cur = 0;
353  this->num_resets++;
354 
355  return S_OK;
356 }
static struct string_enumerator * impl_from_IEnumString(IEnumString *iface)
Definition: autocomplete.c:282
#define S_OK
Definition: intsafe.h:59

◆ string_enumerator_Skip()

static HRESULT WINAPI string_enumerator_Skip ( IEnumString iface,
ULONG  num 
)
static

Definition at line 358 of file autocomplete.c.

359 {
360  struct string_enumerator *this = impl_from_IEnumString(iface);
361 
362  this->cur += num;
363 
364  return S_OK;
365 }
static struct string_enumerator * impl_from_IEnumString(IEnumString *iface)
Definition: autocomplete.c:282
GLuint GLuint num
Definition: glext.h:9618
#define S_OK
Definition: intsafe.h:59

◆ test_aclist_expand()

static void test_aclist_expand ( HWND  hwnd_edit,
void enumerator 
)
static

Definition at line 497 of file autocomplete.c.

498 {
499  struct string_enumerator *obj = (struct string_enumerator*)enumerator;
500  static WCHAR str1[] = {'t','e','s','t',0};
501  static WCHAR str1a[] = {'t','e','s','t','\\',0};
502  static WCHAR str2[] = {'t','e','s','t','\\','f','o','o','\\','b','a','r','\\','b','a',0};
503  static WCHAR str2a[] = {'t','e','s','t','\\','f','o','o','\\','b','a','r','\\',0};
504  static WCHAR str2b[] = {'t','e','s','t','\\','f','o','o','\\','b','a','r','\\','b','a','z','_','b','b','q','\\',0};
505  obj->num_resets = 0;
506 
507  ok(obj->num_expand == 0, "Expected 0 expansions, got %u\n", obj->num_expand);
508  SendMessageW(hwnd_edit, WM_SETTEXT, 0, (LPARAM)str1);
509  SendMessageW(hwnd_edit, EM_SETSEL, ARRAY_SIZE(str1) - 1, ARRAY_SIZE(str1) - 1);
510  SendMessageW(hwnd_edit, WM_CHAR, '\\', 1);
512  ok(obj->num_expand == 1, "Expected 1 expansion, got %u\n", obj->num_expand);
513  ok(lstrcmpW(obj->last_expand, str1a) == 0, "Expected %s, got %s\n", wine_dbgstr_w(str1a), wine_dbgstr_w(obj->last_expand));
514  ok(obj->num_resets == 1, "Expected 1 reset, got %u\n", obj->num_resets);
515  SendMessageW(hwnd_edit, WM_SETTEXT, 0, (LPARAM)str2);
516  SendMessageW(hwnd_edit, EM_SETSEL, ARRAY_SIZE(str2) - 1, ARRAY_SIZE(str2) - 1);
517  SendMessageW(hwnd_edit, WM_CHAR, 'z', 1);
519  ok(obj->num_expand == 2, "Expected 2 expansions, got %u\n", obj->num_expand);
520  ok(lstrcmpW(obj->last_expand, str2a) == 0, "Expected %s, got %s\n", wine_dbgstr_w(str2a), wine_dbgstr_w(obj->last_expand));
521  ok(obj->num_resets == 2, "Expected 2 resets, got %u\n", obj->num_resets);
522  SetFocus(hwnd_edit);
523  SendMessageW(hwnd_edit, WM_CHAR, '_', 1);
524  SendMessageW(hwnd_edit, WM_CHAR, 'b', 1);
525  SetFocus(0);
526  SetFocus(hwnd_edit);
527  SendMessageW(hwnd_edit, WM_CHAR, 'b', 1);
528  SendMessageW(hwnd_edit, WM_CHAR, 'q', 1);
530  ok(obj->num_expand == 2, "Expected 2 expansions, got %u\n", obj->num_expand);
531  ok(obj->num_resets == 2, "Expected 2 resets, got %u\n", obj->num_resets);
532  SendMessageW(hwnd_edit, WM_CHAR, '\\', 1);
534  ok(obj->num_expand == 3, "Expected 3 expansions, got %u\n", obj->num_expand);
535  ok(lstrcmpW(obj->last_expand, str2b) == 0, "Expected %s, got %s\n", wine_dbgstr_w(str2b), wine_dbgstr_w(obj->last_expand));
536  ok(obj->num_resets == 3, "Expected 3 resets, got %u\n", obj->num_resets);
537  SendMessageW(hwnd_edit, EM_SETSEL, ARRAY_SIZE(str1a) - 1, -1);
538  SendMessageW(hwnd_edit, WM_CHAR, 'x', 1);
539  SendMessageW(hwnd_edit, WM_CHAR, 'y', 1);
541  ok(obj->num_expand == 4, "Expected 4 expansions, got %u\n", obj->num_expand);
542  ok(lstrcmpW(obj->last_expand, str1a) == 0, "Expected %s, got %s\n", wine_dbgstr_w(str1a), wine_dbgstr_w(obj->last_expand));
543  ok(obj->num_resets == 4, "Expected 4 resets, got %u\n", obj->num_resets);
544  SendMessageW(hwnd_edit, EM_SETSEL, ARRAY_SIZE(str1) - 1, -1);
545  SendMessageW(hwnd_edit, WM_CHAR, 'x', 1);
547  ok(obj->num_expand == 4, "Expected 4 expansions, got %u\n", obj->num_expand);
548  ok(obj->num_resets == 5, "Expected 5 resets, got %u\n", obj->num_resets);
549 }
#define WM_CHAR
Definition: winuser.h:1699
char * wine_dbgstr_w(const wchar_t *wstr)
Definition: atltest.h:87
int WINAPI lstrcmpW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:170
HWND WINAPI SetFocus(_In_opt_ HWND)
LONG_PTR LPARAM
Definition: windef.h:208
#define WM_SETTEXT
Definition: winuser.h:1599
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define EM_SETSEL
Definition: winuser.h:2000
#define ARRAY_SIZE(a)
Definition: main.h:24
static void dispatch_messages(void)
Definition: autocomplete.c:442
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define ok(value,...)
Definition: atltest.h:57

Referenced by test_custom_source().

◆ test_custom_source()

static void test_custom_source ( void  )
static

Definition at line 677 of file autocomplete.c.

678 {
679  static WCHAR str_alpha[] = {'t','e','s','t','1',0};
680  static WCHAR str_alpha2[] = {'t','e','s','t','2',0};
681  static WCHAR str_beta[] = {'a','u','t','o',' ','c','o','m','p','l','e','t','e',0};
682  static WCHAR str_au[] = {'a','u',0};
683  static WCHAR str_aut[] = {'a','u','t',0};
684  static WCHAR *suggestions[] = { str_alpha, str_alpha2, str_beta };
685  struct string_enumerator *obj;
686  IUnknown *enumerator;
687  IAutoComplete2 *autocomplete;
688  IAutoCompleteDropDown *acdropdown;
689  HWND hwnd_edit;
690  DWORD flags = 0;
691  WCHAR buffer[20];
692  HRESULT hr;
693 
695 
696  hwnd_edit = CreateWindowA("Edit", "", WS_OVERLAPPED | WS_VISIBLE | WS_CHILD | WS_BORDER, 50, 5, 200, 20, hMainWnd, 0, NULL, 0);
697 
698  hr = CoCreateInstance(&CLSID_AutoComplete, NULL, CLSCTX_INPROC_SERVER, &IID_IAutoComplete2, (void**)&autocomplete);
699  ok(hr == S_OK, "CoCreateInstance failed: %x\n", hr);
700 
701  hr = IAutoComplete2_QueryInterface(autocomplete, &IID_IAutoCompleteDropDown, (LPVOID*)&acdropdown);
702  ok(hr == S_OK, "No IAutoCompleteDropDown interface: %x\n", hr);
703 
704  string_enumerator_create((void**)&enumerator, suggestions, ARRAY_SIZE(suggestions));
705  obj = (struct string_enumerator*)enumerator;
706 
707  hr = IAutoComplete2_SetOptions(autocomplete, ACO_AUTOSUGGEST | ACO_AUTOAPPEND);
708  ok(hr == S_OK, "IAutoComplete2_SetOptions failed: %x\n", hr);
709  hr = IAutoCompleteDropDown_ResetEnumerator(acdropdown);
710  ok(hr == S_OK, "IAutoCompleteDropDown_ResetEnumerator failed: %x\n", hr);
711  hr = IAutoComplete2_Init(autocomplete, hwnd_edit, enumerator, NULL, NULL);
712  ok(hr == S_OK, "IAutoComplete_Init failed: %x\n", hr);
713 
714  SetFocus(hwnd_edit);
715  SendMessageW(hwnd_edit, WM_CHAR, 'a', 1);
716  SendMessageW(hwnd_edit, WM_CHAR, 'u', 1);
719  ok(lstrcmpW(str_beta, buffer) == 0, "Expected %s, got %s\n", wine_dbgstr_w(str_beta), wine_dbgstr_w(buffer));
720  ok(obj->num_resets == 1, "Expected 1 reset, got %u\n", obj->num_resets);
721  SendMessageW(hwnd_edit, EM_SETSEL, 0, -1);
722  SendMessageW(hwnd_edit, WM_CHAR, '\b', 1);
725  ok(buffer[0] == '\0', "Expected empty string, got %s\n", wine_dbgstr_w(buffer));
726  ok(obj->num_resets == 1, "Expected 1 reset, got %u\n", obj->num_resets);
727  hr = IAutoCompleteDropDown_ResetEnumerator(acdropdown);
728  ok(hr == S_OK, "IAutoCompleteDropDown_ResetEnumerator failed: %x\n", hr);
729  ok(obj->num_resets == 1, "Expected 1 reset, got %u\n", obj->num_resets);
730  obj->num_resets = 0;
731 
732  /* hijack the window procedure */
736 
737  SendMessageW(hwnd_edit, WM_CHAR, 'a', 1);
738  SendMessageW(hwnd_edit, WM_CHAR, 'u', 1);
742  ok(lstrcmpW(str_au, buffer) == 0, "Expected %s, got %s\n", wine_dbgstr_w(str_au), wine_dbgstr_w(buffer));
743  ok(obj->num_resets == 1, "Expected 1 reset, got %u\n", obj->num_resets);
744  SendMessageW(hwnd_edit, EM_SETSEL, 0, -1);
745  SendMessageW(hwnd_edit, WM_CHAR, '\b', 1);
748  ok(buffer[0] == '\0', "Expected empty string, got %s\n", wine_dbgstr_w(buffer));
749  hr = IAutoCompleteDropDown_ResetEnumerator(acdropdown);
750  ok(hr == S_OK, "IAutoCompleteDropDown_ResetEnumerator failed: %x\n", hr);
751 
753  SendMessageW(hwnd_edit, WM_CHAR, 'a', 1);
754  SendMessageW(hwnd_edit, WM_CHAR, 'u', 1);
758  ok(lstrcmpW(str_beta, buffer) == 0, "Expected %s, got %s\n", wine_dbgstr_w(str_beta), wine_dbgstr_w(buffer));
759  ok(obj->num_resets == 2, "Expected 2 resets, got %u\n", obj->num_resets);
760  /* end of hijacks */
761 
762  hr = IAutoCompleteDropDown_GetDropDownStatus(acdropdown, &flags, NULL);
763  ok(hr == S_OK, "IAutoCompleteDropDown_GetDropDownStatus failed: %x\n", hr);
764  ok(flags & ACDD_VISIBLE, "AutoComplete DropDown should be visible\n");
765  SendMessageW(hwnd_edit, WM_SETTEXT, 0, (LPARAM)str_au);
767  hr = IAutoCompleteDropDown_GetDropDownStatus(acdropdown, &flags, NULL);
768  ok(hr == S_OK, "IAutoCompleteDropDown_GetDropDownStatus failed: %x\n", hr);
769  ok(!(flags & ACDD_VISIBLE), "AutoComplete DropDown should have been hidden\n");
770  SendMessageW(hwnd_edit, WM_SETTEXT, 0, (LPARAM)str_aut);
772  hr = IAutoCompleteDropDown_GetDropDownStatus(acdropdown, &flags, NULL);
773  ok(hr == S_OK, "IAutoCompleteDropDown_GetDropDownStatus failed: %x\n", hr);
774  ok(!(flags & ACDD_VISIBLE), "AutoComplete DropDown should be hidden\n");
776  ok(lstrcmpW(str_aut, buffer) == 0, "Expected %s, got %s\n", wine_dbgstr_w(str_aut), wine_dbgstr_w(buffer));
777 
778  test_aclist_expand(hwnd_edit, enumerator);
779  obj->num_resets = 0;
780 
781  hr = IAutoCompleteDropDown_ResetEnumerator(acdropdown);
782  ok(hr == S_OK, "IAutoCompleteDropDown_ResetEnumerator failed: %x\n", hr);
783  SendMessageW(hwnd_edit, WM_CHAR, 'x', 1);
785  ok(obj->num_resets == 1, "Expected 1 reset, got %u\n", obj->num_resets);
786  SendMessageW(hwnd_edit, WM_CHAR, 'x', 1);
788  ok(obj->num_resets == 1, "Expected 1 reset, got %u\n", obj->num_resets);
789 
790  IAutoCompleteDropDown_Release(acdropdown);
791  IAutoComplete2_Release(autocomplete);
792  IUnknown_Release(enumerator);
793 
794  test_prefix_filtering(hwnd_edit);
795 
797  DestroyWindow(hwnd_edit);
798 }
#define WM_CHAR
Definition: winuser.h:1699
HRESULT hr
Definition: shlfolder.c:183
#define SW_HIDE
Definition: winuser.h:762
char * wine_dbgstr_w(const wchar_t *wstr)
Definition: atltest.h:87
int WINAPI lstrcmpW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:170
#define WM_GETTEXT
Definition: winuser.h:1600
GLuint buffer
Definition: glext.h:5915
HWND WINAPI SetFocus(_In_opt_ HWND)
#define WS_CHILD
Definition: pedump.c:617
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
BOOL WINAPI DestroyWindow(_In_ HWND)
GLsizei GLsizei GLuint * obj
Definition: glext.h:6042
static LRESULT CALLBACK HijackerWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: autocomplete.c:241
#define CreateWindowA(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4216
smooth NULL
Definition: ftsmooth.c:416
static LRESULT CALLBACK HijackerWndProc2(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: autocomplete.c:256
LONG_PTR LPARAM
Definition: windef.h:208
#define SW_SHOW
Definition: winuser.h:769
#define WM_SETTEXT
Definition: winuser.h:1599
static void test_aclist_expand(HWND hwnd_edit, void *enumerator)
Definition: autocomplete.c:497
static HWND hMainWnd
Definition: autocomplete.c:34
#define WS_OVERLAPPED
Definition: pedump.c:615
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
#define EM_SETSEL
Definition: winuser.h:2000
unsigned long DWORD
Definition: ntddk_ex.h:95
static WNDPROC HijackerWndProc_prev
Definition: autocomplete.c:239
static const WCHAR HijackerWndProc_txt[]
Definition: autocomplete.c:240
GLbitfield flags
Definition: glext.h:7161
#define GWLP_WNDPROC
Definition: treelist.c:66
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3234
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2880
#define S_OK
Definition: intsafe.h:59
#define WS_BORDER
Definition: pedump.c:625
#define ARRAY_SIZE(a)
Definition: main.h:24
static void dispatch_messages(void)
Definition: autocomplete.c:442
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define ok(value,...)
Definition: atltest.h:57
static HRESULT string_enumerator_create(void **ppv, WCHAR **suggestions, int count)
Definition: autocomplete.c:425
static void test_prefix_filtering(HWND hwnd_edit)
Definition: autocomplete.c:551
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define SetWindowLongPtrW
Definition: winuser.h:5247
#define WS_VISIBLE
Definition: pedump.c:620

Referenced by START_TEST().

◆ test_init()

static IAutoComplete* test_init ( void  )
static

Definition at line 141 of file autocomplete.c.

142 {
143  HRESULT r;
144  IAutoComplete *ac, *ac2;
145  IUnknown *acSource;
146  LONG_PTR user_data;
147 
148  /* AutoComplete instance */
149  r = CoCreateInstance(&CLSID_AutoComplete, NULL, CLSCTX_INPROC_SERVER,
150  &IID_IAutoComplete, (LPVOID*)&ac);
151  if (r == REGDB_E_CLASSNOTREG)
152  {
153  win_skip("CLSID_AutoComplete is not registered\n");
154  return NULL;
155  }
156  ok(r == S_OK, "no IID_IAutoComplete (0x%08x)\n", r);
157 
158  /* AutoComplete source */
159  r = CoCreateInstance(&CLSID_ACLMulti, NULL, CLSCTX_INPROC_SERVER,
160  &IID_IACList, (LPVOID*)&acSource);
161  if (r == REGDB_E_CLASSNOTREG)
162  {
163  win_skip("CLSID_ACLMulti is not registered\n");
164  IAutoComplete_Release(ac);
165  return NULL;
166  }
167  ok(r == S_OK, "no IID_IACList (0x%08x)\n", r);
168 
169  user_data = GetWindowLongPtrA(hEdit, GWLP_USERDATA);
170  ok(user_data == 0, "Expected the edit control user data to be zero\n");
171 
172  /* bind to edit control */
173  r = IAutoComplete_Init(ac, hEdit, acSource, NULL, NULL);
174  ok(r == S_OK, "Init returned 0x%08x\n", r);
175 
176  user_data = GetWindowLongPtrA(hEdit, GWLP_USERDATA);
177  ok(user_data == 0, "Expected the edit control user data to be zero\n");
178 
179  /* bind a different object to the same edit control */
180  r = CoCreateInstance(&CLSID_AutoComplete, NULL, CLSCTX_INPROC_SERVER,
181  &IID_IAutoComplete, (LPVOID*)&ac2);
182  ok(r == S_OK, "no IID_IAutoComplete (0x%08x)\n", r);
183 
184  r = IAutoComplete_Init(ac2, hEdit, acSource, NULL, NULL);
185  ok(r == S_OK, "Init returned 0x%08x\n", r);
186  IAutoComplete_Release(ac2);
187 
188  IUnknown_Release(acSource);
189 
190  return ac;
191 }
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define GWLP_USERDATA
Definition: treelist.c:63
smooth NULL
Definition: ftsmooth.c:416
#define GetWindowLongPtrA
Definition: winuser.h:4729
LONG HRESULT
Definition: typedefs.h:77
static HWND hEdit
Definition: autocomplete.c:34
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 REGDB_E_CLASSNOTREG
Definition: winerror.h:2696
#define ok(value,...)
Definition: atltest.h:57
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define win_skip
Definition: test.h:141

Referenced by START_TEST().

◆ test_invalid_init()

static void test_invalid_init ( void  )
static

Definition at line 38 of file autocomplete.c.

39 {
40  HRESULT hr;
41  IAutoComplete *ac;
42  IUnknown *acSource;
43  HWND edit_control;
44 
45  /* AutoComplete instance */
46  hr = CoCreateInstance(&CLSID_AutoComplete, NULL, CLSCTX_INPROC_SERVER,
47  &IID_IAutoComplete, (void **)&ac);
48  if (hr == REGDB_E_CLASSNOTREG)
49  {
50  win_skip("CLSID_AutoComplete is not registered\n");
51  return;
52  }
53  ok(hr == S_OK, "no IID_IAutoComplete (0x%08x)\n", hr);
54 
55  /* AutoComplete source */
56  hr = CoCreateInstance(&CLSID_ACLMulti, NULL, CLSCTX_INPROC_SERVER,
57  &IID_IACList, (void **)&acSource);
58  if (hr == REGDB_E_CLASSNOTREG)
59  {
60  win_skip("CLSID_ACLMulti is not registered\n");
61  IAutoComplete_Release(ac);
62  return;
63  }
64  ok(hr == S_OK, "no IID_IACList (0x%08x)\n", hr);
65 
66  edit_control = CreateWindowExA(0, "EDIT", "Some text", 0, 10, 10, 300, 300,
67  hMainWnd, NULL, hinst, NULL);
68  ok(edit_control != NULL, "Can't create edit control\n");
69 
70  /* The refcount of acSource would be incremented on older Windows. */
71  hr = IAutoComplete_Init(ac, NULL, acSource, NULL, NULL);
72  ok(hr == E_INVALIDARG ||
73  broken(hr == S_OK), /* Win2k/XP/Win2k3 */
74  "Init returned 0x%08x\n", hr);
75  if (hr == E_INVALIDARG)
76  {
77  LONG ref;
78 
79  IUnknown_AddRef(acSource);
80  ref = IUnknown_Release(acSource);
81  ok(ref == 1, "Expected AutoComplete source refcount to be 1, got %d\n", ref);
82  }
83 
84 if (0)
85 {
86  /* Older Windows versions never check the window handle, while newer
87  * versions only check for NULL. Subsequent attempts to initialize the
88  * object after this call succeeds would fail, because initialization
89  * state is determined by whether a non-NULL window handle is stored. */
90  hr = IAutoComplete_Init(ac, (HWND)0xdeadbeef, acSource, NULL, NULL);
91  ok(hr == S_OK, "Init returned 0x%08x\n", hr);
92 
93  /* Tests crash on older Windows. */
94  hr = IAutoComplete_Init(ac, NULL, NULL, NULL, NULL);
95  ok(hr == E_INVALIDARG, "Init returned 0x%08x\n", hr);
96 
97  hr = IAutoComplete_Init(ac, edit_control, NULL, NULL, NULL);
98  ok(hr == E_INVALIDARG, "Init returned 0x%08x\n", hr);
99 }
100 
101  /* bind to edit control */
102  hr = IAutoComplete_Init(ac, edit_control, acSource, NULL, NULL);
103  ok(hr == S_OK, "Init returned 0x%08x\n", hr);
104 
105  /* try invalid parameters after successful initialization .*/
106  hr = IAutoComplete_Init(ac, NULL, NULL, NULL, NULL);
107  ok(hr == E_INVALIDARG ||
108  hr == E_FAIL, /* Win2k/XP/Win2k3 */
109  "Init returned 0x%08x\n", hr);
110 
111  hr = IAutoComplete_Init(ac, NULL, acSource, NULL, NULL);
112  ok(hr == E_INVALIDARG ||
113  hr == E_FAIL, /* Win2k/XP/Win2k3 */
114  "Init returned 0x%08x\n", hr);
115 
116  hr = IAutoComplete_Init(ac, edit_control, NULL, NULL, NULL);
117  ok(hr == E_INVALIDARG ||
118  hr == E_FAIL, /* Win2k/XP/Win2k3 */
119  "Init returned 0x%08x\n", hr);
120 
121  /* try initializing twice on the same control */
122  hr = IAutoComplete_Init(ac, edit_control, acSource, NULL, NULL);
123  ok(hr == E_FAIL, "Init returned 0x%08x\n", hr);
124 
125  /* try initializing with a different control */
126  hr = IAutoComplete_Init(ac, hEdit, acSource, NULL, NULL);
127  ok(hr == E_FAIL, "Init returned 0x%08x\n", hr);
128 
129  DestroyWindow(edit_control);
130 
131  /* try initializing with a different control after
132  * destroying the original initialization control */
133  hr = IAutoComplete_Init(ac, hEdit, acSource, NULL, NULL);
134  ok(hr == E_UNEXPECTED ||
135  hr == E_FAIL, /* Win2k/XP/Win2k3 */
136  "Init returned 0x%08x\n", hr);
137 
138  IUnknown_Release(acSource);
139  IAutoComplete_Release(ac);
140 }
HRESULT hr
Definition: shlfolder.c:183
#define E_FAIL
Definition: ddrawi.h:102
BOOL WINAPI DestroyWindow(_In_ HWND)
static HINSTANCE hinst
Definition: autocomplete.c:35
Definition: send.c:47
long LONG
Definition: pedump.c:60
GLenum GLint ref
Definition: glext.h:6028
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
static HWND hMainWnd
Definition: autocomplete.c:34
LONG HRESULT
Definition: typedefs.h:77
static HWND hEdit
Definition: autocomplete.c:34
#define broken(x)
Definition: _sntprintf.h:21
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 REGDB_E_CLASSNOTREG
Definition: winerror.h:2696
#define ok(value,...)
Definition: atltest.h:57
#define E_UNEXPECTED
Definition: winerror.h:2456
HWND WINAPI CreateWindowExA(_In_ DWORD dwExStyle, _In_opt_ LPCSTR lpClassName, _In_opt_ LPCSTR lpWindowName, _In_ DWORD dwStyle, _In_ int X, _In_ int Y, _In_ int nWidth, _In_ int nHeight, _In_opt_ HWND hWndParent, _In_opt_ HMENU hMenu, _In_opt_ HINSTANCE hInstance, _In_opt_ LPVOID lpParam)
#define win_skip
Definition: test.h:141

Referenced by START_TEST().

◆ test_killfocus()

static void test_killfocus ( void  )
static

Definition at line 193 of file autocomplete.c.

194 {
195  /* Test if WM_KILLFOCUS messages are handled properly by checking if
196  * the parent receives an EN_KILLFOCUS message. */
197  SetFocus(hEdit);
198  killfocus_count = 0;
199  SetFocus(0);
200  ok(killfocus_count == 1, "Expected one EN_KILLFOCUS message, got: %d\n", killfocus_count);
201 }
HWND WINAPI SetFocus(_In_opt_ HWND)
static HWND hEdit
Definition: autocomplete.c:34
#define ok(value,...)
Definition: atltest.h:57
static int killfocus_count
Definition: autocomplete.c:36

Referenced by START_TEST().

◆ test_prefix_filtering()

static void test_prefix_filtering ( HWND  hwnd_edit)
static

Definition at line 551 of file autocomplete.c.

552 {
553  static WCHAR htt[] = {'h','t','t',0};
554  static WCHAR www[] = {'w','w','w','.',0};
555  static WCHAR str0[] = {'w','w','w','.','a','x',0};
556  static WCHAR str1[] = {'h','t','t','p','s',':','/','/','w','w','w','.','a','c',0};
557  static WCHAR str2[] = {'a','a',0};
558  static WCHAR str3[] = {'a','b',0};
559  static WCHAR str4[] = {'h','t','t','p',':','/','/','a','0',0};
560  static WCHAR str5[] = {'h','t','t','p','s',':','/','/','h','t','a',0};
561  static WCHAR str6[] = {'h','f','o','o',0};
562  static WCHAR str7[] = {'h','t','t','p',':','/','/','w','w','w','.','a','d','d',0};
563  static WCHAR str8[] = {'w','w','w','.','w','w','w','.','?',0};
564  static WCHAR str9[] = {'h','t','t','p',':','/','/','a','b','c','.','a','a','.','c','o','m',0};
565  static WCHAR str10[]= {'f','t','p',':','/','/','a','b','c',0};
566  static WCHAR str11[]= {'f','i','l','e',':','/','/','a','a',0};
567  static WCHAR str12[]= {'f','t','p',':','/','/','w','w','w','.','a','a',0};
568  static WCHAR *suggestions[] = { str0, str1, str2, str3, str4, str5, str6, str7, str8, str9, str10, str11, str12 };
569  static WCHAR *sorted1[] = { str4, str2, str3, str9, str1, str7, str0 };
570  static WCHAR *sorted2[] = { str3, str9 };
571  static WCHAR *sorted3[] = { str1, str7, str0 };
572  static WCHAR *sorted4[] = { str6, str5 };
573  static WCHAR *sorted5[] = { str5 };
574  static WCHAR *sorted6[] = { str4, str9 };
575  static WCHAR *sorted7[] = { str11, str10, str12 };
576  IUnknown *enumerator;
577  IAutoComplete2 *autocomplete;
578  IAutoCompleteDropDown *acdropdown;
579  WCHAR buffer[20];
580  HRESULT hr;
581 
582  hr = CoCreateInstance(&CLSID_AutoComplete, NULL, CLSCTX_INPROC_SERVER, &IID_IAutoComplete2, (void**)&autocomplete);
583  ok(hr == S_OK, "CoCreateInstance failed: %x\n", hr);
584 
585  hr = IAutoComplete2_QueryInterface(autocomplete, &IID_IAutoCompleteDropDown, (LPVOID*)&acdropdown);
586  ok(hr == S_OK, "No IAutoCompleteDropDown interface: %x\n", hr);
587 
588  string_enumerator_create((void**)&enumerator, suggestions, ARRAY_SIZE(suggestions));
589 
590  hr = IAutoComplete2_SetOptions(autocomplete, ACO_FILTERPREFIXES | ACO_AUTOSUGGEST | ACO_AUTOAPPEND);
591  ok(hr == S_OK, "IAutoComplete2_SetOptions failed: %x\n", hr);
592  hr = IAutoComplete2_Init(autocomplete, hwnd_edit, enumerator, NULL, NULL);
593  ok(hr == S_OK, "IAutoComplete_Init failed: %x\n", hr);
594 
595  SendMessageW(hwnd_edit, EM_SETSEL, 0, -1);
596  SendMessageW(hwnd_edit, WM_CHAR, 'a', 1);
599  ok(lstrcmpW(str4 + 7, buffer) == 0, "Expected %s, got %s\n", wine_dbgstr_w(str4 + 7), wine_dbgstr_w(buffer));
600  check_dropdown(acdropdown, hwnd_edit, sorted1, ARRAY_SIZE(sorted1));
601 
602  SendMessageW(hwnd_edit, EM_SETSEL, 0, -1);
603  SendMessageW(hwnd_edit, WM_CHAR, 'a', 1);
604  SendMessageW(hwnd_edit, WM_CHAR, 'b', 1);
607  ok(lstrcmpW(str3, buffer) == 0, "Expected %s, got %s\n", wine_dbgstr_w(str3), wine_dbgstr_w(buffer));
608  check_dropdown(acdropdown, hwnd_edit, sorted2, ARRAY_SIZE(sorted2));
609  SendMessageW(hwnd_edit, EM_SETSEL, 0, -1);
610  SendMessageW(hwnd_edit, WM_CHAR, 'a', 1);
611  SendMessageW(hwnd_edit, WM_CHAR, 'b', 1);
612  SendMessageW(hwnd_edit, WM_CHAR, 'c', 1);
615  ok(lstrcmpW(str9 + 7, buffer) == 0, "Expected %s, got %s\n", wine_dbgstr_w(str9 + 7), wine_dbgstr_w(buffer));
616 
617  SendMessageW(hwnd_edit, WM_SETTEXT, 0, (LPARAM)www);
618  SendMessageW(hwnd_edit, EM_SETSEL, ARRAY_SIZE(www) - 1, ARRAY_SIZE(www) - 1);
619  SendMessageW(hwnd_edit, WM_CHAR, 'a', 1);
622  ok(lstrcmpW(str1 + 8, buffer) == 0, "Expected %s, got %s\n", wine_dbgstr_w(str1 + 8), wine_dbgstr_w(buffer));
623  check_dropdown(acdropdown, hwnd_edit, sorted3, ARRAY_SIZE(sorted3));
624  SendMessageW(hwnd_edit, WM_SETTEXT, 0, (LPARAM)www);
625  SendMessageW(hwnd_edit, EM_SETSEL, ARRAY_SIZE(www) - 1, ARRAY_SIZE(www) - 1);
626  SendMessageW(hwnd_edit, WM_CHAR, 'w', 1);
629  ok(lstrcmpW(str8, buffer) == 0, "Expected %s, got %s\n", wine_dbgstr_w(str8), wine_dbgstr_w(buffer));
630 
631  SendMessageW(hwnd_edit, EM_SETSEL, 0, -1);
632  SendMessageW(hwnd_edit, WM_CHAR, 'h', 1);
635  ok(lstrcmpW(str6, buffer) == 0, "Expected %s, got %s\n", wine_dbgstr_w(str6), wine_dbgstr_w(buffer));
636  check_dropdown(acdropdown, hwnd_edit, sorted4, ARRAY_SIZE(sorted4));
637  SendMessageW(hwnd_edit, WM_CHAR, 't', 1);
639  ok(lstrcmpW(str5 + 8, buffer) == 0, "Expected %s, got %s\n", wine_dbgstr_w(str5 + 8), wine_dbgstr_w(buffer));
640  check_dropdown(acdropdown, hwnd_edit, sorted5, ARRAY_SIZE(sorted5));
641  SendMessageW(hwnd_edit, WM_CHAR, 't', 1);
643  ok(lstrcmpW(htt, buffer) == 0, "Expected %s, got %s\n", wine_dbgstr_w(htt), wine_dbgstr_w(buffer));
644  check_dropdown(acdropdown, hwnd_edit, NULL, 0);
645  SendMessageW(hwnd_edit, WM_CHAR, 'p', 1);
646  SendMessageW(hwnd_edit, WM_CHAR, ':', 1);
647  SendMessageW(hwnd_edit, WM_CHAR, '/', 1);
648  SendMessageW(hwnd_edit, WM_CHAR, '/', 1);
649  SendMessageW(hwnd_edit, WM_CHAR, 'a', 1);
652  ok(lstrcmpW(str4, buffer) == 0, "Expected %s, got %s\n", wine_dbgstr_w(str4), wine_dbgstr_w(buffer));
653  check_dropdown(acdropdown, hwnd_edit, sorted6, ARRAY_SIZE(sorted6));
654  SendMessageW(hwnd_edit, EM_SETSEL, 0, 2);
655  SendMessageW(hwnd_edit, WM_CHAR, 'H', 1);
657  check_dropdown(acdropdown, hwnd_edit, NULL, 0);
658  SendMessageW(hwnd_edit, WM_CHAR, 't', 1);
660  check_dropdown(acdropdown, hwnd_edit, sorted6, ARRAY_SIZE(sorted6));
661 
662  SendMessageW(hwnd_edit, EM_SETSEL, 0, -1);
663  SendMessageW(hwnd_edit, WM_CHAR, 'F', 1);
666  check_dropdown(acdropdown, hwnd_edit, sorted7, ARRAY_SIZE(sorted7));
667  SendMessageW(hwnd_edit, WM_CHAR, 'i', 1);
668  SendMessageW(hwnd_edit, WM_CHAR, 'L', 1);
670  check_dropdown(acdropdown, hwnd_edit, sorted7, 1);
671 
672  IAutoCompleteDropDown_Release(acdropdown);
673  IAutoComplete2_Release(autocomplete);
674  IUnknown_Release(enumerator);
675 }
#define WM_CHAR
Definition: winuser.h:1699
HRESULT hr
Definition: shlfolder.c:183
char * wine_dbgstr_w(const wchar_t *wstr)
Definition: atltest.h:87
int WINAPI lstrcmpW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:170
#define WM_GETTEXT
Definition: winuser.h:1600
#define check_dropdown(acdropdown, hwnd_edit, list, list_num)
Definition: autocomplete.c:453
GLuint buffer
Definition: glext.h:5915
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
#define WM_SETTEXT
Definition: winuser.h:1599
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
#define EM_SETSEL
Definition: winuser.h:2000
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 ARRAY_SIZE(a)
Definition: main.h:24
static void dispatch_messages(void)
Definition: autocomplete.c:442
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define ok(value,...)
Definition: atltest.h:57
static HRESULT string_enumerator_create(void **ppv, WCHAR **suggestions, int count)
Definition: autocomplete.c:425

Referenced by test_custom_source().

Variable Documentation

◆ aclist_vtbl

IACListVtbl aclist_vtbl
static
Initial value:
=
{
}
static HRESULT WINAPI aclist_QueryInterface(IACList *iface, REFIID riid, void **ppv)
Definition: autocomplete.c:389
static HRESULT WINAPI aclist_Expand(IACList *iface, const WCHAR *expand)
Definition: autocomplete.c:404
static ULONG WINAPI aclist_AddRef(IACList *iface)
Definition: autocomplete.c:394
static ULONG WINAPI aclist_Release(IACList *iface)
Definition: autocomplete.c:399

Definition at line 417 of file autocomplete.c.

Referenced by string_enumerator_create().

◆ hEdit

◆ HijackerWndProc_prev

WNDPROC HijackerWndProc_prev
static

Definition at line 239 of file autocomplete.c.

Referenced by HijackerWndProc(), HijackerWndProc2(), and test_custom_source().

◆ HijackerWndProc_txt

const WCHAR HijackerWndProc_txt[] = {'H','i','j','a','c','k','e','d',0}
static

Definition at line 240 of file autocomplete.c.

Referenced by HijackerWndProc(), HijackerWndProc2(), and test_custom_source().

◆ hinst

HINSTANCE hinst
static

Definition at line 35 of file autocomplete.c.

Referenced by MyWndProc(), and test_invalid_init().

◆ hMainWnd

HWND hMainWnd
static

Definition at line 34 of file autocomplete.c.

Referenced by createMainWnd(), START_TEST(), test_custom_source(), and test_invalid_init().

◆ killfocus_count

int killfocus_count
static

Definition at line 36 of file autocomplete.c.

Referenced by MyWndProc(), and test_killfocus().

◆ string_enumerator_vtbl

IEnumStringVtbl string_enumerator_vtbl
static
Initial value:
=
{
}
static HRESULT WINAPI string_enumerator_Next(IEnumString *iface, ULONG num, LPOLESTR *strings, ULONG *num_returned)
Definition: autocomplete.c:325
static ULONG WINAPI string_enumerator_Release(IEnumString *iface)
Definition: autocomplete.c:313
static ULONG WINAPI string_enumerator_AddRef(IEnumString *iface)
Definition: autocomplete.c:304
static HRESULT WINAPI string_enumerator_Reset(IEnumString *iface)
Definition: autocomplete.c:348
static HRESULT WINAPI string_enumerator_Clone(IEnumString *iface, IEnumString **out)
Definition: autocomplete.c:367
static HRESULT WINAPI string_enumerator_QueryInterface(IEnumString *iface, REFIID riid, void **ppv)
Definition: autocomplete.c:287
static HRESULT WINAPI string_enumerator_Skip(IEnumString *iface, ULONG num)
Definition: autocomplete.c:358

Definition at line 373 of file autocomplete.c.

Referenced by string_enumerator_create().