ReactOS  0.4.14-dev-845-g8381e29
atl.c File Reference
#include <stdarg.h>
#include <stdio.h>
#include <windef.h>
#include <winbase.h>
#include <winuser.h>
#include <exdisp.h>
#include <wine/atlbase.h>
#include <mshtml.h>
#include <wine/test.h>
Include dependency graph for atl.c:

Go to the source code of this file.

Macros

#define COBJMACROS
 
#define CONST_VTABLE
 
#define CLSID_TEST_STR   "178fc163-0000-0000-0000-000000000046"
 
#define CATID_CATTEST1_STR   "178fc163-0000-0000-0000-000000000146"
 
#define CATID_CATTEST2_STR   "178fc163-0000-0000-0000-000000000246"
 
#define test_key_exists(a, b)   _test_key_exists(__LINE__,a,b)
 
#define test_key_not_exists(a, b)   _test_key_not_exists(__LINE__,a,b)
 

Functions

static BOOL is_token_admin (HANDLE token)
 
static BOOL is_process_limited (void)
 
static void test_winmodule (void)
 
static void _test_key_exists (unsigned line, HKEY root, const char *key_name)
 
static void _test_key_not_exists (unsigned line, HKEY root, const char *key_name)
 
static void test_regcat (void)
 
static void test_typelib (void)
 
static HRESULT WINAPI ConnectionPoint_QueryInterface (IConnectionPoint *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI ConnectionPoint_AddRef (IConnectionPoint *iface)
 
static ULONG WINAPI ConnectionPoint_Release (IConnectionPoint *iface)
 
static HRESULT WINAPI ConnectionPoint_GetConnectionInterface (IConnectionPoint *iface, IID *pIID)
 
static HRESULT WINAPI ConnectionPoint_GetConnectionPointContainer (IConnectionPoint *iface, IConnectionPointContainer **ppCPC)
 
static HRESULT WINAPI ConnectionPoint_Advise (IConnectionPoint *iface, IUnknown *pUnkSink, DWORD *pdwCookie)
 
static HRESULT WINAPI ConnectionPoint_Unadvise (IConnectionPoint *iface, DWORD dwCookie)
 
static HRESULT WINAPI ConnectionPoint_EnumConnections (IConnectionPoint *iface, IEnumConnections **ppEnum)
 
static HRESULT WINAPI ConnectionPointContainer_QueryInterface (IConnectionPointContainer *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI ConnectionPointContainer_AddRef (IConnectionPointContainer *iface)
 
static ULONG WINAPI ConnectionPointContainer_Release (IConnectionPointContainer *iface)
 
static HRESULT WINAPI ConnectionPointContainer_EnumConnectionPoints (IConnectionPointContainer *iface, IEnumConnectionPoints **ppEnum)
 
static HRESULT WINAPI ConnectionPointContainer_FindConnectionPoint (IConnectionPointContainer *iface, REFIID riid, IConnectionPoint **ppCP)
 
static void test_cp (void)
 
static HRESULT WINAPI Persist_QueryInterface (IPersist *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI Persist_AddRef (IPersist *iface)
 
static ULONG WINAPI Persist_Release (IPersist *iface)
 
static HRESULT WINAPI Persist_GetClassID (IPersist *iface, CLSID *pClassID)
 
static HRESULT WINAPI ProvideClassInfo2_QueryInterface (IProvideClassInfo2 *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI ProvideClassInfo2_AddRef (IProvideClassInfo2 *iface)
 
static ULONG WINAPI ProvideClassInfo2_Release (IProvideClassInfo2 *iface)
 
static HRESULT WINAPI ProvideClassInfo2_GetClassInfo (IProvideClassInfo2 *iface, ITypeInfo **ppTI)
 
static HRESULT WINAPI ProvideClassInfo2_GetGUID (IProvideClassInfo2 *iface, DWORD dwGuidKind, GUID *pGUID)
 
static HRESULT WINAPI Dispatch_QueryInterface (IDispatch *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI Dispatch_AddRef (IDispatch *iface)
 
static ULONG WINAPI Dispatch_Release (IDispatch *iface)
 
static HRESULT WINAPI Dispatch_GetTypeInfoCount (IDispatch *iface, UINT *pctinfo)
 
static HRESULT WINAPI Dispatch_GetTypeInfo (IDispatch *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
 
static HRESULT WINAPI Dispatch_GetIDsOfNames (IDispatch *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
 
static HRESULT WINAPI Dispatch_Invoke (IDispatch *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
 
static void test_source_iface (void)
 
static void test_ax_win (void)
 
static ATOM register_class (void)
 
static HWND create_container_window (void)
 
static void test_AtlAxAttachControl (void)
 
static void test_AtlAxCreateControl (void)
 
 START_TEST (atl)
 

Variables

static const GUID CLSID_Test
 
static const GUID CATID_CatTest1
 
static const GUID CATID_CatTest2
 
static const WCHAR emptyW [] = {'\0'}
 
static const WCHAR randomW [] = {'r','a','n','d','o','m','\0'}
 
static const WCHAR progid1W [] = {'S','h','e','l','l','.','E','x','p','l','o','r','e','r','.','2','\0'}
 
static const WCHAR clsid1W []
 
static const WCHAR url1W []
 
static const WCHAR mshtml1W []
 
static const WCHAR mshtml2W []
 
static const WCHAR mshtml3W []
 
static const WCHAR fileW [] = {'f','i','l','e',':','/','/','/','\0'}
 
static const WCHAR html_fileW [] = {'t','e','s','t','.','h','t','m','l','\0'}
 
static const char html_str [] = "<html><body>test</body><html>"
 
static int advise_cnt
 
static const IConnectionPointVtbl ConnectionPointVtbl
 
static IConnectionPoint ConnectionPoint = { &ConnectionPointVtbl }
 
static const IConnectionPointContainerVtbl ConnectionPointContainerVtbl
 
static IConnectionPointContainer ConnectionPointContainer = { &ConnectionPointContainerVtbl }
 
static CLSID persist_clsid
 
static const IPersistVtbl PersistVtbl
 
static IPersist Persist = { &PersistVtbl }
 
static const IProvideClassInfo2Vtbl ProvideClassInfo2Vtbl
 
static IProvideClassInfo2 ProvideClassInfo2 = { &ProvideClassInfo2Vtbl }
 
static BOOL support_classinfo2
 
static const IDispatchVtbl DispatchVtbl
 
static IDispatch Dispatch = { &DispatchVtbl }
 

Macro Definition Documentation

◆ CATID_CATTEST1_STR

#define CATID_CATTEST1_STR   "178fc163-0000-0000-0000-000000000146"

Definition at line 41 of file atl.c.

◆ CATID_CATTEST2_STR

#define CATID_CATTEST2_STR   "178fc163-0000-0000-0000-000000000246"

Definition at line 45 of file atl.c.

◆ CLSID_TEST_STR

#define CLSID_TEST_STR   "178fc163-0000-0000-0000-000000000046"

Definition at line 37 of file atl.c.

◆ COBJMACROS

#define COBJMACROS

Definition at line 22 of file atl.c.

◆ CONST_VTABLE

#define CONST_VTABLE

Definition at line 23 of file atl.c.

◆ test_key_exists

#define test_key_exists (   a,
  b 
)    _test_key_exists(__LINE__,a,b)

Definition at line 219 of file atl.c.

◆ test_key_not_exists

#define test_key_not_exists (   a,
  b 
)    _test_key_not_exists(__LINE__,a,b)

Definition at line 231 of file atl.c.

Function Documentation

◆ _test_key_exists()

static void _test_key_exists ( unsigned  line,
HKEY  root,
const char key_name 
)
static

Definition at line 220 of file atl.c.

221 {
222  HKEY key;
223  DWORD res;
224 
226  ok_(__FILE__,line)(res == ERROR_SUCCESS, "Could not open key %s\n", key_name);
227  if(res == ERROR_SUCCESS)
228  RegCloseKey(key);
229 }
LONG WINAPI RegOpenKeyA(HKEY hKey, LPCSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:3257
#define ERROR_SUCCESS
Definition: deptool.c:10
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
Definition: parser.c:48
unsigned long DWORD
Definition: ntddk_ex.h:95
HKEY key
Definition: reg.c:42
GLuint res
Definition: glext.h:9613
#define ok_(x1, x2)
Definition: atltest.h:61
Definition: path.c:41

◆ _test_key_not_exists()

static void _test_key_not_exists ( unsigned  line,
HKEY  root,
const char key_name 
)
static

Definition at line 232 of file atl.c.

233 {
234  HKEY key;
235  DWORD res;
236 
238  ok_(__FILE__,line)(res == ERROR_FILE_NOT_FOUND, "Attempting to open %s returned %u\n", key_name, res);
239  if(res == ERROR_SUCCESS)
240  RegCloseKey(key);
241 }
LONG WINAPI RegOpenKeyA(HKEY hKey, LPCSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:3257
#define ERROR_SUCCESS
Definition: deptool.c:10
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
Definition: parser.c:48
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
unsigned long DWORD
Definition: ntddk_ex.h:95
HKEY key
Definition: reg.c:42
GLuint res
Definition: glext.h:9613
#define ok_(x1, x2)
Definition: atltest.h:61
Definition: path.c:41

◆ ConnectionPoint_AddRef()

static ULONG WINAPI ConnectionPoint_AddRef ( IConnectionPoint iface)
static

Definition at line 342 of file atl.c.

343 {
344  return 2;
345 }

◆ ConnectionPoint_Advise()

static HRESULT WINAPI ConnectionPoint_Advise ( IConnectionPoint iface,
IUnknown pUnkSink,
DWORD pdwCookie 
)
static

Definition at line 367 of file atl.c.

369 {
370  ok(pUnkSink == (IUnknown*)0xdead0000, "pUnkSink = %p\n", pUnkSink);
371  *pdwCookie = 0xdeadbeef;
372  advise_cnt++;
373  return S_OK;
374 }
static int advise_cnt
Definition: atl.c:365
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57

◆ ConnectionPoint_EnumConnections()

static HRESULT WINAPI ConnectionPoint_EnumConnections ( IConnectionPoint iface,
IEnumConnections **  ppEnum 
)
static

Definition at line 383 of file atl.c.

385 {
386  ok(0, "unexpected call\n");
387  return E_NOTIMPL;
388 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ ConnectionPoint_GetConnectionInterface()

static HRESULT WINAPI ConnectionPoint_GetConnectionInterface ( IConnectionPoint iface,
IID pIID 
)
static

Definition at line 352 of file atl.c.

353 {
354  ok(0, "unexpected call\n");
355  return E_NOTIMPL;
356 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ ConnectionPoint_GetConnectionPointContainer()

static HRESULT WINAPI ConnectionPoint_GetConnectionPointContainer ( IConnectionPoint iface,
IConnectionPointContainer **  ppCPC 
)
static

Definition at line 358 of file atl.c.

360 {
361  ok(0, "unexpected call\n");
362  return E_NOTIMPL;
363 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ ConnectionPoint_QueryInterface()

static HRESULT WINAPI ConnectionPoint_QueryInterface ( IConnectionPoint iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 331 of file atl.c.

332 {
334  *ppv = iface;
335  return S_OK;
336  }
337 
338  ok(0, "unexpected call\n");
339  return E_NOINTERFACE;
340 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
const GUID IID_IConnectionPoint
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112

◆ ConnectionPoint_Release()

static ULONG WINAPI ConnectionPoint_Release ( IConnectionPoint iface)
static

Definition at line 347 of file atl.c.

348 {
349  return 1;
350 }

◆ ConnectionPoint_Unadvise()

static HRESULT WINAPI ConnectionPoint_Unadvise ( IConnectionPoint iface,
DWORD  dwCookie 
)
static

Definition at line 376 of file atl.c.

377 {
378  ok(dwCookie == 0xdeadbeef, "dwCookie = %x\n", dwCookie);
379  advise_cnt--;
380  return S_OK;
381 }
static int advise_cnt
Definition: atl.c:365
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57

◆ ConnectionPointContainer_AddRef()

static ULONG WINAPI ConnectionPointContainer_AddRef ( IConnectionPointContainer iface)
static

Definition at line 416 of file atl.c.

417 {
418  return 2;
419 }

◆ ConnectionPointContainer_EnumConnectionPoints()

static HRESULT WINAPI ConnectionPointContainer_EnumConnectionPoints ( IConnectionPointContainer iface,
IEnumConnectionPoints **  ppEnum 
)
static

Definition at line 426 of file atl.c.

428 {
429  ok(0, "unexpected call\n");
430  return E_NOTIMPL;
431 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ ConnectionPointContainer_FindConnectionPoint()

static HRESULT WINAPI ConnectionPointContainer_FindConnectionPoint ( IConnectionPointContainer iface,
REFIID  riid,
IConnectionPoint **  ppCP 
)
static

Definition at line 433 of file atl.c.

435 {
436  ok(IsEqualGUID(riid, &CLSID_Test), "unexpected riid\n");
437  *ppCP = &ConnectionPoint;
438  return S_OK;
439 }
REFIID riid
Definition: precomp.h:44
static const GUID CLSID_Test
Definition: atl.c:35
static IConnectionPoint ConnectionPoint
Definition: atl.c:402
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112

◆ ConnectionPointContainer_QueryInterface()

static HRESULT WINAPI ConnectionPointContainer_QueryInterface ( IConnectionPointContainer iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 404 of file atl.c.

406 {
408  *ppv = iface;
409  return S_OK;
410  }
411 
412  ok(0, "unexpected call\n");
413  return E_NOTIMPL;
414 }
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
const GUID IID_IConnectionPointContainer
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112

◆ ConnectionPointContainer_Release()

static ULONG WINAPI ConnectionPointContainer_Release ( IConnectionPointContainer iface)
static

Definition at line 421 of file atl.c.

422 {
423  return 1;
424 }

◆ create_container_window()

static HWND create_container_window ( void  )
static

Definition at line 837 of file atl.c.

838 {
839  return CreateWindowA("WineAtlTestClass", "Wine ATL Test Window", 0,
842 }
#define CreateWindowA(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4290
#define CW_USEDEFAULT
Definition: winuser.h:225
smooth NULL
Definition: ftsmooth.c:416

Referenced by test_AtlAxAttachControl(), and test_AtlAxCreateControl().

◆ Dispatch_AddRef()

static ULONG WINAPI Dispatch_AddRef ( IDispatch iface)
static

Definition at line 570 of file atl.c.

571 {
572  return 2;
573 }

◆ Dispatch_GetIDsOfNames()

static HRESULT WINAPI Dispatch_GetIDsOfNames ( IDispatch iface,
REFIID  riid,
LPOLESTR rgszNames,
UINT  cNames,
LCID  lcid,
DISPID rgDispId 
)
static

Definition at line 607 of file atl.c.

609 {
610  ok(0, "unexpected call\n");
611  return E_NOTIMPL;
612 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ Dispatch_GetTypeInfo()

static HRESULT WINAPI Dispatch_GetTypeInfo ( IDispatch iface,
UINT  iTInfo,
LCID  lcid,
ITypeInfo **  ppTInfo 
)
static

Definition at line 586 of file atl.c.

588 {
589  ITypeLib *typelib;
590  HRESULT hres;
591 
592  static const WCHAR mshtml_tlbW[] = {'m','s','h','t','m','l','.','t','l','b',0};
593 
594  ok(!iTInfo, "iTInfo = %d\n", iTInfo);
595  ok(!lcid, "lcid = %x\n", lcid);
596 
597  hres = LoadTypeLib(mshtml_tlbW, &typelib);
598  ok(hres == S_OK, "LoadTypeLib failed: %08x\n", hres);
599 
600  hres = ITypeLib_GetTypeInfoOfGuid(typelib, &IID_IHTMLElement, ppTInfo);
601  ok(hres == S_OK, "GetTypeInfoOfGuid failed: %08x\n", hres);
602 
603  ITypeLib_Release(typelib);
604  return S_OK;
605 }
static ITypeLib * typelib
Definition: apps.c:108
HRESULT WINAPI LoadTypeLib(const OLECHAR *szFile, ITypeLib **pptLib)
Definition: typelib.c:458
HRESULT hres
Definition: protocol.c:465
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57

◆ Dispatch_GetTypeInfoCount()

static HRESULT WINAPI Dispatch_GetTypeInfoCount ( IDispatch iface,
UINT pctinfo 
)
static

Definition at line 580 of file atl.c.

581 {
582  ok(0, "unexpected call\n");
583  return E_NOTIMPL;
584 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ Dispatch_Invoke()

static HRESULT WINAPI Dispatch_Invoke ( IDispatch iface,
DISPID  dispIdMember,
REFIID  riid,
LCID  lcid,
WORD  wFlags,
DISPPARAMS *  pDispParams,
VARIANT pVarResult,
EXCEPINFO *  pExcepInfo,
UINT puArgErr 
)
static

Definition at line 614 of file atl.c.

617 {
618  ok(0, "unexpected call\n");
619  return E_NOTIMPL;
620 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ Dispatch_QueryInterface()

static HRESULT WINAPI Dispatch_QueryInterface ( IDispatch iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 545 of file atl.c.

546 {
547  *ppv = NULL;
548 
550  *ppv = iface;
551  return S_OK;
552  }
553 
555  if(!support_classinfo2)
556  return E_NOINTERFACE;
558  return S_OK;
559  }
560 
561  if(IsEqualGUID(&IID_IPersist, riid)) {
562  *ppv = &Persist;
563  return S_OK;
564  }
565 
566  ok(0, "unexpected riid: %s\n", wine_dbgstr_guid(riid));
567  return E_NOINTERFACE;
568 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
const GUID IID_IPersist
Definition: proxy.cpp:14
REFIID LPVOID * ppv
Definition: atlbase.h:39
const char * wine_dbgstr_guid(const GUID *guid)
static IPersist Persist
Definition: atl.c:503
smooth NULL
Definition: ftsmooth.c:416
const GUID IID_IProvideClassInfo2
const GUID IID_IUnknown
static BOOL support_classinfo2
Definition: atl.c:543
const GUID IID_IDispatch
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
static IProvideClassInfo2 ProvideClassInfo2
Definition: atl.c:542

◆ Dispatch_Release()

static ULONG WINAPI Dispatch_Release ( IDispatch iface)
static

Definition at line 575 of file atl.c.

576 {
577  return 1;
578 }

◆ is_process_limited()

static BOOL is_process_limited ( void  )
static

Definition at line 113 of file atl.c.

114 {
115  static BOOL (WINAPI *pOpenProcessToken)(HANDLE, DWORD, PHANDLE) = NULL;
116  HANDLE token;
117  BOOL result=FALSE;
118 
119  if (!pOpenProcessToken)
120  {
121  HMODULE hadvapi32 = GetModuleHandleA("advapi32.dll");
122  pOpenProcessToken = (void*)GetProcAddress(hadvapi32, "OpenProcessToken");
123  if (!pOpenProcessToken)
124  return FALSE;
125  }
126 
127  if (pOpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token))
128  {
129  BOOL ret;
131  DWORD size;
132 
134  if (ret)
135  {
137  /* UAC is disabled, check for administrators group */
139  else if (type == TokenElevationTypeFull)
140  result = FALSE;
141  else if (type == TokenElevationTypeLimited)
142  result = TRUE;
143  }
145  }
146  return result;
147 }
enum _TOKEN_ELEVATION_TYPE TOKEN_ELEVATION_TYPE
#define TRUE
Definition: types.h:120
#define CloseHandle
Definition: compat.h:406
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define BOOL
Definition: nt_native.h:43
#define DWORD
Definition: nt_native.h:44
unsigned int BOOL
Definition: ntddk_ex.h:94
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 token
Definition: glfuncs.h:210
smooth NULL
Definition: ftsmooth.c:416
GLsizeiptr size
Definition: glext.h:5919
#define TOKEN_QUERY
Definition: setypes.h:874
HANDLE WINAPI GetCurrentProcess(VOID)
Definition: proc.c:1138
#define WINAPI
Definition: msvc.h:6
unsigned long DWORD
Definition: ntddk_ex.h:95
PVOID HANDLE
Definition: typedefs.h:71
int ret
PVOID *typedef PHANDLE
Definition: ntsecpkg.h:414
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:821
BOOL WINAPI GetTokenInformation(HANDLE TokenHandle, TOKEN_INFORMATION_CLASS TokenInformationClass, LPVOID TokenInformation, DWORD TokenInformationLength, PDWORD ReturnLength)
Definition: security.c:413
#define GetProcAddress(x, y)
Definition: compat.h:418
GLuint64EXT * result
Definition: glext.h:11304
static BOOL is_token_admin(HANDLE token)
Definition: atl.c:66

Referenced by test_regcat().

◆ is_token_admin()

static BOOL is_token_admin ( HANDLE  token)
static

Definition at line 66 of file atl.c.

67 {
68  PSID administrators = NULL;
70  DWORD groups_size;
72  DWORD group_index;
73 
74  /* Create a well-known SID for the Administrators group. */
76  DOMAIN_ALIAS_RID_ADMINS, 0, 0, 0, 0, 0, 0,
77  &administrators))
78  return FALSE;
79 
80  /* Get the group info from the token */
81  groups_size = 0;
82  GetTokenInformation(token, TokenGroups, NULL, 0, &groups_size);
83  groups = HeapAlloc(GetProcessHeap(), 0, groups_size);
84  if (groups == NULL)
85  {
86  FreeSid(administrators);
87  return FALSE;
88  }
89  if (! GetTokenInformation(token, TokenGroups, groups, groups_size, &groups_size))
90  {
92  FreeSid(administrators);
93  return FALSE;
94  }
95 
96  /* Now check if the token groups include the Administrators group */
97  for (group_index = 0; group_index < groups->GroupCount; group_index++)
98  {
99  if (EqualSid(groups->Groups[group_index].Sid, administrators))
100  {
102  FreeSid(administrators);
103  return TRUE;
104  }
105  }
106 
107  /* If we end up here we didn't find the Administrators group */
109  FreeSid(administrators);
110  return FALSE;
111 }
#define TRUE
Definition: types.h:120
BOOL WINAPI EqualSid(PSID pSid1, PSID pSid2)
Definition: security.c:708
GLsizei GLuint * groups
Definition: glext.h:11113
PVOID WINAPI FreeSid(PSID pSid)
Definition: security.c:577
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 token
Definition: glfuncs.h:210
smooth NULL
Definition: ftsmooth.c:416
#define SECURITY_NT_AUTHORITY
Definition: setypes.h:526
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define SECURITY_BUILTIN_DOMAIN_RID
Definition: setypes.h:553
unsigned long DWORD
Definition: ntddk_ex.h:95
BOOL WINAPI GetTokenInformation(HANDLE TokenHandle, TOKEN_INFORMATION_CLASS TokenInformationClass, LPVOID TokenInformation, DWORD TokenInformationLength, PDWORD ReturnLength)
Definition: security.c:413
#define DOMAIN_ALIAS_RID_ADMINS
Definition: setypes.h:624
#define HeapFree(x, y, z)
Definition: compat.h:402
BOOL WINAPI AllocateAndInitializeSid(PSID_IDENTIFIER_AUTHORITY pIdentifierAuthority, BYTE nSubAuthorityCount, DWORD nSubAuthority0, DWORD nSubAuthority1, DWORD nSubAuthority2, DWORD nSubAuthority3, DWORD nSubAuthority4, DWORD nSubAuthority5, DWORD nSubAuthority6, DWORD nSubAuthority7, PSID *pSid)
Definition: security.c:553

Referenced by is_process_limited().

◆ Persist_AddRef()

static ULONG WINAPI Persist_AddRef ( IPersist iface)
static

Definition at line 480 of file atl.c.

481 {
482  return 2;
483 }

◆ Persist_GetClassID()

static HRESULT WINAPI Persist_GetClassID ( IPersist iface,
CLSID pClassID 
)
static

Definition at line 490 of file atl.c.

491 {
492  *pClassID = persist_clsid;
493  return S_OK;
494 }
static CLSID persist_clsid
Definition: atl.c:472
#define S_OK
Definition: intsafe.h:59

◆ Persist_QueryInterface()

static HRESULT WINAPI Persist_QueryInterface ( IPersist iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 474 of file atl.c.

475 {
476  ok(0, "unexpected call\n");
477  return E_NOINTERFACE;
478 }
#define E_NOINTERFACE
Definition: winerror.h:2364
#define ok(value,...)
Definition: atltest.h:57

◆ Persist_Release()

static ULONG WINAPI Persist_Release ( IPersist iface)
static

Definition at line 485 of file atl.c.

486 {
487  return 1;
488 }

◆ ProvideClassInfo2_AddRef()

static ULONG WINAPI ProvideClassInfo2_AddRef ( IProvideClassInfo2 iface)
static

Definition at line 511 of file atl.c.

512 {
513  return 2;
514 }

◆ ProvideClassInfo2_GetClassInfo()

static HRESULT WINAPI ProvideClassInfo2_GetClassInfo ( IProvideClassInfo2 iface,
ITypeInfo **  ppTI 
)
static

Definition at line 521 of file atl.c.

522 {
523  ok(0, "unexpected call\n");
524  return E_NOTIMPL;
525 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ ProvideClassInfo2_GetGUID()

static HRESULT WINAPI ProvideClassInfo2_GetGUID ( IProvideClassInfo2 iface,
DWORD  dwGuidKind,
GUID pGUID 
)
static

Definition at line 527 of file atl.c.

528 {
529  ok(dwGuidKind == GUIDKIND_DEFAULT_SOURCE_DISP_IID, "unexpected dwGuidKind %x\n", dwGuidKind);
530  *pGUID = DIID_DispHTMLBody;
531  return S_OK;
532 }
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57

◆ ProvideClassInfo2_QueryInterface()

static HRESULT WINAPI ProvideClassInfo2_QueryInterface ( IProvideClassInfo2 iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 505 of file atl.c.

506 {
507  ok(0, "unexpected call\n");
508  return E_NOINTERFACE;
509 }
#define E_NOINTERFACE
Definition: winerror.h:2364
#define ok(value,...)
Definition: atltest.h:57

◆ ProvideClassInfo2_Release()

static ULONG WINAPI ProvideClassInfo2_Release ( IProvideClassInfo2 iface)
static

Definition at line 516 of file atl.c.

517 {
518  return 1;
519 }

◆ register_class()

static ATOM register_class ( void  )
static

Definition at line 819 of file atl.c.

820 {
821  WNDCLASSA wndclassA;
822 
823  wndclassA.style = 0;
824  wndclassA.lpfnWndProc = DefWindowProcA;
825  wndclassA.cbClsExtra = 0;
826  wndclassA.cbWndExtra = 0;
827  wndclassA.hInstance = GetModuleHandleA(NULL);
828  wndclassA.hIcon = NULL;
829  wndclassA.hCursor = LoadCursorA(NULL, (LPSTR)IDC_ARROW);
830  wndclassA.hbrBackground = (HBRUSH)(COLOR_BTNFACE+1);
831  wndclassA.lpszMenuName = NULL;
832  wndclassA.lpszClassName = "WineAtlTestClass";
833 
834  return RegisterClassA(&wndclassA);
835 }
int cbClsExtra
Definition: winuser.h:3140
LPCSTR lpszMenuName
Definition: winuser.h:3146
HBRUSH hbrBackground
Definition: winuser.h:3145
char * LPSTR
Definition: xmlstorage.h:182
int cbWndExtra
Definition: winuser.h:3141
HCURSOR hCursor
Definition: winuser.h:3144
smooth NULL
Definition: ftsmooth.c:416
#define COLOR_BTNFACE
Definition: winuser.h:918
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:821
LRESULT WINAPI DefWindowProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
LPCSTR lpszClassName
Definition: winuser.h:3147
HCURSOR WINAPI LoadCursorA(_In_opt_ HINSTANCE, _In_ LPCSTR)
Definition: cursoricon.c:2059
UINT style
Definition: winuser.h:3138
HINSTANCE hInstance
Definition: winuser.h:3142
WNDPROC lpfnWndProc
Definition: winuser.h:3139
#define IDC_ARROW
Definition: winuser.h:682
ATOM WINAPI RegisterClassA(_In_ CONST WNDCLASSA *)
HICON hIcon
Definition: winuser.h:3143

Referenced by START_TEST().

◆ START_TEST()

START_TEST ( atl  )

Definition at line 1082 of file atl.c.

1083 {
1084  if (!register_class())
1085  return;
1086 
1087  CoInitialize(NULL);
1088 
1089  test_winmodule();
1090  test_regcat();
1091  test_typelib();
1092  test_cp();
1094  test_ax_win();
1097 
1098  CoUninitialize();
1099 }
static void test_typelib(void)
Definition: atl.c:287
static void test_cp(void)
Definition: atl.c:451
static void test_regcat(void)
Definition: atl.c:243
static ATOM register_class(void)
Definition: atl.c:819
static void test_source_iface(void)
Definition: atl.c:634
static void test_ax_win(void)
Definition: atl.c:669
smooth NULL
Definition: ftsmooth.c:416
static void test_AtlAxCreateControl(void)
Definition: atl.c:913
static void test_AtlAxAttachControl(void)
Definition: atl.c:844
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
Definition: compobj.c:2067
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
Definition: compobj.c:1964
static void test_winmodule(void)
Definition: atl.c:149

◆ test_AtlAxAttachControl()

static void test_AtlAxAttachControl ( void  )
static

Definition at line 844 of file atl.c.

845 {
846  HWND hwnd;
847  HRESULT hr;
848  IUnknown *control, *container;
849  LONG val;
850 
852  ok(hr == E_INVALIDARG, "Expected AtlAxAttachControl to return E_INVALIDARG, got 0x%08x\n", hr);
853 
854  container = (IUnknown *)0xdeadbeef;
856  ok(hr == E_INVALIDARG, "Expected AtlAxAttachControl to return E_INVALIDARG, got 0x%08x\n", hr);
857  ok(container == (IUnknown *)0xdeadbeef,
858  "Expected the output container pointer to be untouched, got %p\n", container);
859 
862  ok(hr == E_INVALIDARG, "Expected AtlAxAttachControl to return E_INVALIDARG, got 0x%08x\n", hr);
864 
866  container = (IUnknown *)0xdeadbeef;
868  ok(hr == E_INVALIDARG, "Expected AtlAxAttachControl to return E_INVALIDARG, got 0x%08x\n", hr);
869  ok(container == (IUnknown *)0xdeadbeef, "returned %p\n", container);
871 
872  hr = CoCreateInstance(&CLSID_WebBrowser, NULL, CLSCTX_INPROC_SERVER | CLSCTX_INPROC_HANDLER,
873  &IID_IOleObject, (void **)&control);
874  ok(hr == S_OK, "Expected CoCreateInstance to return S_OK, got 0x%08x\n", hr);
875 
876  if (FAILED(hr))
877  {
878  skip("Couldn't obtain a test IOleObject instance\n");
879  return;
880  }
881 
882  hr = AtlAxAttachControl(control, NULL, NULL);
883  ok(hr == S_FALSE, "Expected AtlAxAttachControl to return S_FALSE, got 0x%08x\n", hr);
884 
885  container = NULL;
886  hr = AtlAxAttachControl(control, NULL, &container);
887  ok(hr == S_FALSE, "Expected AtlAxAttachControl to return S_FALSE, got 0x%08x\n", hr);
888  ok(container != NULL, "got %p\n", container);
889  IUnknown_Release(container);
890 
892  SetWindowLongW(hwnd, GWLP_USERDATA, 0xdeadbeef);
893  hr = AtlAxAttachControl(control, hwnd, NULL);
894  ok(hr == S_OK, "Expected AtlAxAttachControl to return S_OK, got 0x%08x\n", hr);
896  ok(val == 0xdeadbeef, "returned %08x\n", val);
898 
900  SetWindowLongW(hwnd, GWLP_USERDATA, 0xdeadbeef);
901  container = NULL;
902  hr = AtlAxAttachControl(control, hwnd, &container);
903  ok(hr == S_OK, "Expected AtlAxAttachControl to return S_OK, got 0x%08x\n", hr);
904  ok(container != NULL, "Expected not NULL!\n");
905  IUnknown_Release(container);
907  ok(val == 0xdeadbeef, "Expected unchanged, returned %08x\n", val);
909 
910  IUnknown_Release(control);
911 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
HRESULT hr
Definition: shlfolder.c:183
BOOL WINAPI DestroyWindow(_In_ HWND)
struct container container
long LONG
Definition: pedump.c:60
LONG WINAPI SetWindowLongW(_In_ HWND, _In_ int, _In_ LONG)
#define S_FALSE
Definition: winerror.h:2357
#define GWLP_USERDATA
Definition: treelist.c:63
#define E_INVALIDARG
Definition: ddrawi.h:101
LONG WINAPI GetWindowLongW(_In_ HWND, _In_ int)
smooth NULL
Definition: ftsmooth.c:416
const GUID IID_IOleObject
GLuint GLfloat * val
Definition: glext.h:7180
LONG HRESULT
Definition: typedefs.h:77
HRESULT WINAPI AtlAxAttachControl(IUnknown *control, HWND hWnd, IUnknown **container)
Definition: atl_ax.c:1147
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3325
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
#define skip(...)
Definition: atltest.h:64
static HWND create_container_window(void)
Definition: atl.c:837

Referenced by START_TEST().

◆ test_AtlAxCreateControl()

static void test_AtlAxCreateControl ( void  )
static

Definition at line 913 of file atl.c.

914 {
915  HWND hwnd;
916  IUnknown *control, *container;
917  HRESULT hr;
918  DWORD ret, ret_size;
919  HANDLE hfile;
920  WCHAR file_uri1W[MAX_PATH], pathW[MAX_PATH];
921 
922  container = NULL;
923  control = (IUnknown *)0xdeadbeef;
924  hr = AtlAxCreateControlEx(NULL, NULL, NULL, &container, &control, NULL, NULL);
925  todo_wine ok(hr == S_FALSE, "got 0x%08x\n", hr);
926  todo_wine ok(container != NULL, "returned %p\n", container);
927  ok(!control, "returned %p\n", control);
928 
929  container = NULL;
930  control = (IUnknown *)0xdeadbeef;
932  ok(hwnd != NULL, "create window failed!\n");
934  ok(hr == S_OK, "got 0x%08x\n", hr);
935  todo_wine ok(container != NULL, "returned %p!\n", container);
936  ok(!control, "returned %p\n", control);
938 
939  container = NULL;
940  control = (IUnknown *)0xdeadbeef;
942  ok(hwnd != NULL, "create window failed!\n");
944  ok(hr == S_OK, "got 0x%08x\n", hr);
945  todo_wine ok(container != NULL, "returned %p!\n", container);
946  ok(!control, "returned %p\n", control);
948 
949  container = (IUnknown *)0xdeadbeef;
950  control = (IUnknown *)0xdeadbeef;
952  ok(hwnd != NULL, "create window failed!\n");
954  ok(hr == CO_E_CLASSSTRING, "got 0x%08x\n", hr);
955  ok(!container, "returned %p!\n", container);
956  ok(!control, "returned %p\n", control);
958 
959  container = NULL;
960  control = NULL;
962  ok(hwnd != NULL, "create window failed!\n");
964  ok(hr == S_OK, "got 0x%08x\n", hr);
965  ok(container != NULL, "returned %p!\n", container);
966  ok(control != NULL, "returned %p\n", control);
967  IUnknown_Release(container);
968  IUnknown_Release(control);
970 
971  container = NULL;
972  control = NULL;
974  ok(hwnd != NULL, "create window failed!\n");
976  ok(hr == S_OK, "got 0x%08x\n", hr);
977  ok(container != NULL, "returned %p!\n", container);
978  ok(control != NULL, "returned %p\n", control);
979  IUnknown_Release(container);
980  IUnknown_Release(control);
982 
983  container = NULL;
984  control = NULL;
986  ok(hwnd != NULL, "create window failed!\n");
988  ok(hr == S_OK, "got 0x%08x\n", hr);
989  ok(container != NULL, "returned %p!\n", container);
990  ok(control != NULL, "returned %p\n", control);
991  IUnknown_Release(container);
992  IUnknown_Release(control);
994 
995  container = NULL;
996  control = NULL;
998  ok(hwnd != NULL, "create window failed!\n");
1000  ok(hr == S_OK, "got 0x%08x\n", hr);
1001  ok(container != NULL, "returned %p!\n", container);
1002  ok(control != NULL, "returned %p\n", control);
1003  IUnknown_Release(container);
1004  IUnknown_Release(control);
1006 
1007  container = NULL;
1008  control = NULL;
1010  ok(hwnd != NULL, "create window failed!\n");
1012  ok(hr == S_OK, "got 0x%08x\n", hr);
1013  ok(container != NULL, "returned %p!\n", container);
1014  ok(control != NULL, "returned %p\n", control);
1015  IUnknown_Release(container);
1016  IUnknown_Release(control);
1018 
1019  container = (IUnknown *)0xdeadbeef;
1020  control = (IUnknown *)0xdeadbeef;
1022  ok(hwnd != NULL, "create window failed!\n");
1024  ok(hr == CO_E_CLASSSTRING, "got 0x%08x\n", hr);
1025  ok(!container, "returned %p!\n", container);
1026  ok(!control, "returned %p\n", control);
1028 
1029  ret = GetTempPathW(MAX_PATH, pathW);
1030  ok(ret, "GetTempPath failed!\n");
1031  lstrcatW(pathW, html_fileW);
1032  hfile = CreateFileW(pathW, GENERIC_WRITE, 0, NULL, CREATE_NEW, 0, 0);
1033  ok(hfile != INVALID_HANDLE_VALUE, "failed to create file\n");
1034  ret = WriteFile(hfile, html_str, sizeof(html_str), &ret_size, NULL);
1035  ok(ret, "WriteFile failed\n");
1036  CloseHandle(hfile);
1037 
1038  /* test C:// scheme */
1039  container = NULL;
1040  control = NULL;
1042  ok(hwnd != NULL, "create window failed!\n");
1043  hr = AtlAxCreateControlEx(pathW, hwnd, NULL, &container, &control, &IID_NULL, NULL);
1044  ok(hr == S_OK, "got 0x%08x\n", hr);
1045  ok(container != NULL, "returned %p!\n", container);
1046  ok(control != NULL, "returned %p\n", control);
1047  IUnknown_Release(container);
1048  IUnknown_Release(control);
1050 
1051  /* test file:// scheme */
1052  lstrcpyW(file_uri1W, fileW);
1053  lstrcatW(file_uri1W, pathW);
1054  container = NULL;
1055  control = NULL;
1057  ok(hwnd != NULL, "create window failed!\n");
1058  hr = AtlAxCreateControlEx(file_uri1W, hwnd, NULL, &container, &control, &IID_NULL, NULL);
1059  ok(hr == S_OK, "got 0x%08x\n", hr);
1060  ok(container != NULL, "returned %p!\n", container);
1061  ok(control != NULL, "returned %p\n", control);
1062  IUnknown_Release(container);
1063  IUnknown_Release(control);
1065 
1066  /* test file:// scheme on non-existent file. */
1067  ret = DeleteFileW(pathW);
1068  ok(ret, "DeleteFile failed!\n");
1069  container = NULL;
1070  control = NULL;
1072  ok(hwnd != NULL, "create window failed!\n");
1073  hr = AtlAxCreateControlEx(file_uri1W, hwnd, NULL, &container, &control, &IID_NULL, NULL);
1074  ok(hr == S_OK, "got 0x%08x\n", hr);
1075  ok(container != NULL, "returned %p!\n", container);
1076  ok(control != NULL, "returned %p\n", control);
1077  IUnknown_Release(container);
1078  IUnknown_Release(control);
1080 }
static const WCHAR progid1W[]
Definition: atl.c:49
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
Definition: rw.c:24
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define CloseHandle
Definition: compat.h:406
HRESULT hr
Definition: shlfolder.c:183
#define INVALID_HANDLE_VALUE
Definition: compat.h:399
BOOL WINAPI DestroyWindow(_In_ HWND)
static const WCHAR emptyW[]
Definition: atl.c:47
static const WCHAR html_fileW[]
Definition: atl.c:63
struct container container
DWORD WINAPI GetTempPathW(IN DWORD count, OUT LPWSTR path)
Definition: path.c:2079
#define GENERIC_WRITE
Definition: nt_native.h:90
static const WCHAR mshtml2W[]
Definition: atl.c:58
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
Definition: delete.c:39
#define S_FALSE
Definition: winerror.h:2357
smooth NULL
Definition: ftsmooth.c:416
static const WCHAR fileW[]
Definition: atl.c:62
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
#define MAX_PATH
Definition: compat.h:26
unsigned long DWORD
Definition: ntddk_ex.h:95
static const WCHAR url1W[]
Definition: atl.c:53
int ret
#define IID_NULL
Definition: guiddef.h:98
#define todo_wine
Definition: test.h:162
static const char html_str[]
Definition: atl.c:64
#define S_OK
Definition: intsafe.h:59
#define lstrcpyW
Definition: compat.h:414
static const WCHAR randomW[]
Definition: atl.c:48
static const WCHAR clsid1W[]
Definition: atl.c:50
#define ok(value,...)
Definition: atltest.h:57
#define CreateFileW
Definition: compat.h:408
static const WCHAR mshtml1W[]
Definition: atl.c:56
#define CO_E_CLASSSTRING
Definition: winerror.h:2806
#define CREATE_NEW
Definition: disk.h:69
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:274
static const WCHAR mshtml3W[]
Definition: atl.c:60
static HWND create_container_window(void)
Definition: atl.c:837
HRESULT WINAPI AtlAxCreateControlEx(const WCHAR *lpTricsData, HWND hwnd, IStream *stream, IUnknown **container, IUnknown **control, REFIID iidSink, IUnknown *punkSink)
Definition: atl_ax.c:1483

Referenced by START_TEST().

◆ test_ax_win()

static void test_ax_win ( void  )
static

Definition at line 669 of file atl.c.

670 {
671  DWORD ret, ret_size, i;
672  HRESULT res;
673  HWND hwnd;
674  HANDLE hfile;
675  IUnknown *control;
676  WNDPROC wndproc[2] = {NULL, NULL};
677  WCHAR file_uri1W[MAX_PATH], pathW[MAX_PATH];
678  WNDCLASSEXW wcex;
679  static HMODULE hinstance = 0;
680  static const WCHAR cls_names[][16] =
681  {
682  {'A','t','l','A','x','W','i','n','1','0','0',0},
683  {'A','t','l','A','x','W','i','n','L','i','c','1','0','0',0}
684  };
685 
686  ret = AtlAxWinInit();
687  ok(ret, "AtlAxWinInit failed\n");
688 
689  hinstance = GetModuleHandleA(NULL);
690 
691  for (i = 0; i < 2; i++)
692  {
693  memset(&wcex, 0, sizeof(wcex));
694  wcex.cbSize = sizeof(wcex);
695  ret = GetClassInfoExW(hinstance, cls_names[i], &wcex);
696  ok(ret, "%s has not registered\n", wine_dbgstr_w(cls_names[i]));
697  ok(wcex.style == (CS_GLOBALCLASS | CS_DBLCLKS), "wcex.style %08x\n", wcex.style);
698  wndproc[i] = wcex.lpfnWndProc;
699 
700  hwnd = CreateWindowW(cls_names[i], NULL, 0, 100, 100, 100, 100, NULL, NULL, NULL, NULL);
701  ok(hwnd != NULL, "CreateWindow failed!\n");
702  control = (IUnknown *)0xdeadbeef;
703  res = AtlAxGetControl(hwnd, &control);
704  ok(res == E_FAIL, "Expected E_FAIL, returned %08x\n", res);
705  ok(!control, "returned %p\n", control);
706  if (control) IUnknown_Release(control);
708 
709  hwnd = CreateWindowW(cls_names[i], emptyW, 0, 100, 100, 100, 100, NULL, NULL, NULL, NULL);
710  ok(hwnd != NULL, "CreateWindow failed!\n");
711  control = (IUnknown *)0xdeadbeef;
712  res = AtlAxGetControl(hwnd, &control);
713  ok(res == E_FAIL, "Expected E_FAIL, returned %08x\n", res);
714  ok(!control, "returned %p\n", control);
715  if (control) IUnknown_Release(control);
717 
718  hwnd = CreateWindowW(cls_names[i], randomW, 0, 100, 100, 100, 100, NULL, NULL, NULL, NULL);
719  todo_wine ok(!hwnd, "returned %p\n", hwnd);
720  if(hwnd) DestroyWindow(hwnd);
721 
722  hwnd = CreateWindowW(cls_names[i], progid1W, 0, 100, 100, 100, 100, NULL, NULL, NULL, NULL);
723  ok(hwnd != NULL, "CreateWindow failed!\n");
724  control = NULL;
725  res = AtlAxGetControl(hwnd, &control);
726  ok(res == S_OK, "AtlAxGetControl failed with res %08x\n", res);
727  ok(control != NULL, "AtlAxGetControl failed!\n");
728  IUnknown_Release(control);
730 
731  hwnd = CreateWindowW(cls_names[i], clsid1W, 0, 100, 100, 100, 100, NULL, NULL, NULL, NULL);
732  ok(hwnd != NULL, "CreateWindow failed!\n");
733  control = NULL;
734  res = AtlAxGetControl(hwnd, &control);
735  ok(res == S_OK, "AtlAxGetControl failed with res %08x\n", res);
736  ok(control != NULL, "AtlAxGetControl failed!\n");
737  IUnknown_Release(control);
739 
740  hwnd = CreateWindowW(cls_names[i], url1W, 0, 100, 100, 100, 100, NULL, NULL, NULL, NULL);
741  ok(hwnd != NULL, "CreateWindow failed!\n");
742  control = NULL;
743  res = AtlAxGetControl(hwnd, &control);
744  ok(res == S_OK, "AtlAxGetControl failed with res %08x\n", res);
745  ok(control != NULL, "AtlAxGetControl failed!\n");
746  IUnknown_Release(control);
748 
749  /* test html stream with "MSHTML:" prefix */
750  hwnd = CreateWindowW(cls_names[i], mshtml1W, 0, 100, 100, 100, 100, NULL, NULL, NULL, NULL);
751  ok(hwnd != NULL, "CreateWindow failed!\n");
752  control = NULL;
753  res = AtlAxGetControl(hwnd, &control);
754  ok(res == S_OK, "AtlAxGetControl failed with res %08x\n", res);
755  ok(control != NULL, "AtlAxGetControl failed!\n");
756  IUnknown_Release(control);
758 
759  hwnd = CreateWindowW(cls_names[i], mshtml2W, 0, 100, 100, 100, 100, NULL, NULL, NULL, NULL);
760  ok(hwnd != NULL, "CreateWindow failed!\n");
761  control = NULL;
762  res = AtlAxGetControl(hwnd, &control);
763  ok(res == S_OK, "AtlAxGetControl failed with res %08x\n", res);
764  ok(control != NULL, "AtlAxGetControl failed!\n");
765  IUnknown_Release(control);
767 
768  /* test html stream without "MSHTML:" prefix */
769  hwnd = CreateWindowW(cls_names[i], mshtml3W, 0, 100, 100, 100, 100, NULL, NULL, NULL, NULL);
770  todo_wine ok(!hwnd, "returned %p\n", hwnd);
771  if(hwnd) DestroyWindow(hwnd);
772 
773  ret = GetTempPathW(MAX_PATH, pathW);
774  ok(ret, "GetTempPath failed!\n");
775  lstrcatW(pathW, html_fileW);
776  hfile = CreateFileW(pathW, GENERIC_WRITE, 0, NULL, CREATE_NEW, 0, 0);
777  ok(hfile != INVALID_HANDLE_VALUE, "failed to create file\n");
778  ret = WriteFile(hfile, html_str, sizeof(html_str), &ret_size, NULL);
779  ok(ret, "WriteFile failed\n");
780  CloseHandle(hfile);
781 
782  /* test C:// scheme */
783  hwnd = CreateWindowW(cls_names[i], pathW, 0, 100, 100, 100, 100, NULL, NULL, NULL, NULL);
784  ok(hwnd != NULL, "CreateWindow failed!\n");
785  control = NULL;
786  res = AtlAxGetControl(hwnd, &control);
787  ok(res == S_OK, "AtlAxGetControl failed with res %08x\n", res);
788  ok(control != NULL, "AtlAxGetControl failed!\n");
789  IUnknown_Release(control);
791 
792  /* test file:// scheme */
793  lstrcpyW(file_uri1W, fileW);
794  lstrcatW(file_uri1W, pathW);
795  hwnd = CreateWindowW(cls_names[i], file_uri1W, 0, 100, 100, 100, 100, NULL, NULL, NULL, NULL);
796  ok(hwnd != NULL, "CreateWindow failed!\n");
797  control = NULL;
798  res = AtlAxGetControl(hwnd, &control);
799  ok(res == S_OK, "AtlAxGetControl failed with res %08x\n", res);
800  ok(control != NULL, "AtlAxGetControl failed!\n");
801  IUnknown_Release(control);
803 
804  /* test file:// scheme on non-existent file */
805  ret = DeleteFileW(pathW);
806  ok(ret, "DeleteFile failed!\n");
807  hwnd = CreateWindowW(cls_names[i], file_uri1W, 0, 100, 100, 100, 100, NULL, NULL, NULL, NULL);
808  ok(hwnd != NULL, "CreateWindow failed!\n");
809  control = NULL;
810  res = AtlAxGetControl(hwnd, &control);
811  ok(res == S_OK, "AtlAxGetControl failed with res %08x\n", res);
812  ok(control != NULL, "AtlAxGetControl failed!\n");
813  IUnknown_Release(control);
815  }
816  todo_wine ok(wndproc[0] != wndproc[1], "expected different proc!\n");
817 }
static const WCHAR progid1W[]
Definition: atl.c:49
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
Definition: rw.c:24
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define CloseHandle
Definition: compat.h:406
BOOL WINAPI GetClassInfoExW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _Out_ LPWNDCLASSEXW)
BOOL WINAPI AtlAxWinInit(void)
Definition: atl_ax.c:89
char * wine_dbgstr_w(const wchar_t *wstr)
Definition: atltest.h:87
#define INVALID_HANDLE_VALUE
Definition: compat.h:399
#define E_FAIL
Definition: ddrawi.h:102
BOOL WINAPI DestroyWindow(_In_ HWND)
#define CreateWindowW(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4291
static const WCHAR emptyW[]
Definition: atl.c:47
static const WCHAR html_fileW[]
Definition: atl.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
DWORD WINAPI GetTempPathW(IN DWORD count, OUT LPWSTR path)
Definition: path.c:2079
#define GENERIC_WRITE
Definition: nt_native.h:90
static const WCHAR mshtml2W[]
Definition: atl.c:58
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
Definition: delete.c:39
smooth NULL
Definition: ftsmooth.c:416
static const WCHAR fileW[]
Definition: atl.c:62
HRESULT WINAPI AtlAxGetControl(HWND hWnd, IUnknown **pUnk)
Definition: atl_ax.c:1391
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
UINT cbSize
Definition: winuser.h:3191
#define CS_GLOBALCLASS
Definition: winuser.h:647
#define MAX_PATH
Definition: compat.h:26
unsigned long DWORD
Definition: ntddk_ex.h:95
static const WCHAR url1W[]
Definition: atl.c:53
int ret
#define todo_wine
Definition: test.h:162
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:821
#define CS_DBLCLKS
Definition: winuser.h:646
UINT style
Definition: winuser.h:3192
WNDPROC lpfnWndProc
Definition: winuser.h:3193
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2881
static const char html_str[]
Definition: atl.c:64
#define S_OK
Definition: intsafe.h:59
#define lstrcpyW
Definition: compat.h:414
static const WCHAR randomW[]
Definition: atl.c:48
static const WCHAR clsid1W[]
Definition: atl.c:50
#define ok(value,...)
Definition: atltest.h:57
#define CreateFileW
Definition: compat.h:408
GLuint res
Definition: glext.h:9613
static const WCHAR mshtml1W[]
Definition: atl.c:56
#define CREATE_NEW
Definition: disk.h:69
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:274
static const WCHAR mshtml3W[]
Definition: atl.c:60
#define memset(x, y, z)
Definition: compat.h:39

Referenced by START_TEST().

◆ test_cp()

static void test_cp ( void  )
static

Definition at line 451 of file atl.c.

452 {
453  DWORD cookie = 0;
454  HRESULT hres;
455 
456  hres = AtlAdvise(NULL, (IUnknown*)0xdeed0000, &CLSID_Test, &cookie);
457  ok(hres == E_INVALIDARG, "expect E_INVALIDARG, returned %08x\n", hres);
458 
459  hres = AtlUnadvise(NULL, &CLSID_Test, 0xdeadbeef);
460  ok(hres == E_INVALIDARG, "expect E_INVALIDARG, returned %08x\n", hres);
461 
463  ok(hres == S_OK, "AtlAdvise failed: %08x\n", hres);
464  ok(cookie == 0xdeadbeef, "cookie = %x\n", cookie);
465  ok(advise_cnt == 1, "advise_cnt = %d\n", advise_cnt);
466 
468  ok(hres == S_OK, "AtlUnadvise failed: %08x\n", hres);
469  ok(!advise_cnt, "advise_cnt = %d\n", advise_cnt);
470 }
HRESULT WINAPI AtlAdvise(IUnknown *pUnkCP, IUnknown *pUnk, const IID *iid, DWORD *pdw)
Definition: atl.c:45
static const GUID CLSID_Test
Definition: atl.c:35
static int advise_cnt
Definition: atl.c:365
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
HRESULT WINAPI AtlUnadvise(IUnknown *pUnkCP, const IID *iid, DWORD dw)
Definition: atl.c:73
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
unsigned long DWORD
Definition: ntddk_ex.h:95
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
Definition: cookie.c:33

Referenced by START_TEST().

◆ test_regcat()

static void test_regcat ( void  )
static

Definition at line 243 of file atl.c.

244 {
245  unsigned char b;
246  HRESULT hres;
247 
248  const struct _ATL_CATMAP_ENTRY catmap[] = {
252  };
253 
254  if (is_process_limited())
255  {
256  skip("process is limited\n");
257  return;
258  }
259 
261  ok(hres == S_OK, "AtlRegisterClassCategoriesHelper failed: %08x\n", hres);
262 
264  test_key_exists(HKEY_CLASSES_ROOT, "CLSID\\{" CLSID_TEST_STR "}\\Implemented Categories\\{" CATID_CATTEST1_STR "}");
265  test_key_exists(HKEY_CLASSES_ROOT, "CLSID\\{" CLSID_TEST_STR "}\\Required Categories\\{" CATID_CATTEST2_STR "}");
266 
268  ok(hres == S_OK, "AtlRegisterClassCategoriesHelper failed: %08x\n", hres);
269 
270  test_key_not_exists(HKEY_CLASSES_ROOT, "CLSID\\{" CLSID_TEST_STR "}\\Implemented Categories");
271  test_key_not_exists(HKEY_CLASSES_ROOT, "CLSID\\{" CLSID_TEST_STR "}\\Required Categories");
273 
274  ok(RegDeleteKeyA(HKEY_CLASSES_ROOT, "CLSID\\{" CLSID_TEST_STR "}") == ERROR_SUCCESS, "Could not delete key\n");
275 
277  ok(hres == S_OK, "AtlRegisterClassCategoriesHelper failed: %08x\n", hres);
278 
280 
281  b = 10;
283  ok(hres == S_OK, "AtlGetPerUserRegistration failed: %08x\n", hres);
284  ok(!b, "AtlGetPerUserRegistration returned %x\n", b);
285 }
#define test_key_not_exists(a, b)
Definition: atl.c:231
#define TRUE
Definition: types.h:120
#define test_key_exists(a, b)
Definition: atl.c:219
#define ERROR_SUCCESS
Definition: deptool.c:10
static const GUID CLSID_Test
Definition: atl.c:35
#define CATID_CATTEST2_STR
Definition: atl.c:45
smooth NULL
Definition: ftsmooth.c:416
#define CATID_CATTEST1_STR
Definition: atl.c:41
#define b
Definition: ke_i.h:79
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
#define CLSID_TEST_STR
Definition: atl.c:37
HRESULT WINAPI AtlGetPerUserRegistration(cpp_bool *pbEnabled)
Definition: atl.c:961
#define _ATL_CATMAP_ENTRY_REQUIRED
Definition: atlbase.h:255
LONG WINAPI RegDeleteKeyA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey)
Definition: reg.c:1222
static const GUID CATID_CatTest2
Definition: atl.c:43
#define S_OK
Definition: intsafe.h:59
static const GUID CATID_CatTest1
Definition: atl.c:39
#define ok(value,...)
Definition: atltest.h:57
#define _ATL_CATMAP_ENTRY_IMPLEMENTED
Definition: atlbase.h:254
#define skip(...)
Definition: atltest.h:64
HRESULT WINAPI AtlRegisterClassCategoriesHelper(REFCLSID clsid, const struct _ATL_CATMAP_ENTRY *catmap, BOOL reg)
Definition: atl.c:747
#define HKEY_CLASSES_ROOT
Definition: winreg.h:10
static BOOL is_process_limited(void)
Definition: atl.c:113
#define _ATL_CATMAP_ENTRY_END
Definition: atlbase.h:253
Definition: atlbase.h:247

Referenced by START_TEST().

◆ test_source_iface()

static void test_source_iface ( void  )
static

Definition at line 634 of file atl.c.

635 {
636  unsigned short maj_ver, min_ver;
637  IID libid, iid;
638  HRESULT hres;
639 
641 
642  maj_ver = min_ver = 0xdead;
643  hres = AtlGetObjectSourceInterface((IUnknown*)&Dispatch, &libid, &iid, &maj_ver, &min_ver);
644  ok(hres == S_OK, "AtlGetObjectSourceInterface failed: %08x\n", hres);
645  ok(IsEqualGUID(&libid, &LIBID_MSHTML), "libid = %s\n", wine_dbgstr_guid(&libid));
646  ok(IsEqualGUID(&iid, &DIID_DispHTMLBody), "iid = %s\n", wine_dbgstr_guid(&iid));
647  ok(maj_ver == 4 && min_ver == 0, "ver = %d.%d\n", maj_ver, min_ver);
648 
650  persist_clsid = CLSID_HTMLDocument;
651 
652  maj_ver = min_ver = 0xdead;
653  hres = AtlGetObjectSourceInterface((IUnknown*)&Dispatch, &libid, &iid, &maj_ver, &min_ver);
654  ok(hres == S_OK, "AtlGetObjectSourceInterface failed: %08x\n", hres);
655  ok(IsEqualGUID(&libid, &LIBID_MSHTML), "libid = %s\n", wine_dbgstr_guid(&libid));
656  ok(IsEqualGUID(&iid, &DIID_HTMLDocumentEvents), "iid = %s\n", wine_dbgstr_guid(&iid));
657  ok(maj_ver == 4 && min_ver == 0, "ver = %d.%d\n", maj_ver, min_ver);
658 
659  persist_clsid = CLSID_HTMLStyle;
660 
661  maj_ver = min_ver = 0xdead;
662  hres = AtlGetObjectSourceInterface((IUnknown*)&Dispatch, &libid, &iid, &maj_ver, &min_ver);
663  ok(hres == S_OK, "AtlGetObjectSourceInterface failed: %08x\n", hres);
664  ok(IsEqualGUID(&libid, &LIBID_MSHTML), "libid = %s\n", wine_dbgstr_guid(&libid));
665  ok(IsEqualGUID(&iid, &IID_NULL), "iid = %s\n", wine_dbgstr_guid(&iid));
666  ok(maj_ver == 4 && min_ver == 0, "ver = %d.%d\n", maj_ver, min_ver);
667 }
#define TRUE
Definition: types.h:120
const char * wine_dbgstr_guid(const GUID *guid)
DWORD min_ver
Definition: apphelp.c:212
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
static BOOL support_classinfo2
Definition: atl.c:543
#define IID_NULL
Definition: guiddef.h:98
_In_ USHORT _In_ ULONG _In_ PSOCKADDR _In_ PSOCKADDR _Reserved_ ULONG _In_opt_ PVOID _In_opt_ const WSK_CLIENT_CONNECTION_DISPATCH * Dispatch
Definition: wsk.h:182
static CLSID persist_clsid
Definition: atl.c:472
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
HRESULT WINAPI AtlGetObjectSourceInterface(IUnknown *unk, GUID *libid, IID *iid, unsigned short *major, unsigned short *minor)
Definition: atl.c:888

Referenced by START_TEST().

◆ test_typelib()

static void test_typelib ( void  )
static

Definition at line 287 of file atl.c.

288 {
289  ITypeLib *typelib;
290  HINSTANCE inst;
291  size_t len;
292  BSTR path;
293  HRESULT hres;
294 
295  static const WCHAR scrrun_dll_suffixW[] = {'\\','s','c','r','r','u','n','.','d','l','l',0};
296  static const WCHAR mshtml_tlb_suffixW[] = {'\\','m','s','h','t','m','l','.','t','l','b',0};
297 
298  inst = LoadLibraryA("scrrun.dll");
299  ok(inst != NULL, "Could not load scrrun.dll\n");
300 
301  typelib = NULL;
302  hres = AtlLoadTypeLib(inst, NULL, &path, &typelib);
303  ok(hres == S_OK, "AtlLoadTypeLib failed: %08x\n", hres);
304  FreeLibrary(inst);
305 
306  len = SysStringLen(path);
307  ok(len > ARRAY_SIZE(scrrun_dll_suffixW)
308  && lstrcmpiW(path+len-ARRAY_SIZE(scrrun_dll_suffixW), scrrun_dll_suffixW),
309  "unexpected path %s\n", wine_dbgstr_w(path));
311  ok(typelib != NULL, "typelib == NULL\n");
312  ITypeLib_Release(typelib);
313 
314  inst = LoadLibraryA("mshtml.dll");
315  ok(inst != NULL, "Could not load mshtml.dll\n");
316 
317  typelib = NULL;
318  hres = AtlLoadTypeLib(inst, NULL, &path, &typelib);
319  ok(hres == S_OK, "AtlLoadTypeLib failed: %08x\n", hres);
320  FreeLibrary(inst);
321 
322  len = SysStringLen(path);
323  ok(len > ARRAY_SIZE(mshtml_tlb_suffixW)
324  && lstrcmpiW(path+len-ARRAY_SIZE(mshtml_tlb_suffixW), mshtml_tlb_suffixW),
325  "unexpected path %s\n", wine_dbgstr_w(path));
327  ok(typelib != NULL, "typelib == NULL\n");
328  ITypeLib_Release(typelib);
329 }
GLsizei const GLchar ** path
Definition: glext.h:7234
char * wine_dbgstr_w(const wchar_t *wstr)
Definition: atltest.h:87
static ITypeLib * typelib
Definition: apps.c:108
OLECHAR * BSTR
Definition: compat.h:1942
int WINAPI lstrcmpiW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:194
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
Definition: loader.c:111
smooth NULL
Definition: ftsmooth.c:416
#define FreeLibrary(x)
Definition: compat.h:413
HRESULT hres
Definition: protocol.c:465
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
GLenum GLsizei len
Definition: glext.h:6722
HRESULT WINAPI AtlLoadTypeLib(HINSTANCE inst, LPCOLESTR lpszIndex, BSTR *pbstrPath, ITypeLib **ppTypeLib)
Definition: atl.c:341
UINT WINAPI SysStringLen(BSTR str)
Definition: oleaut.c:196
#define S_OK
Definition: intsafe.h:59
#define ARRAY_SIZE(a)
Definition: main.h:24
#define ok(value,...)
Definition: atltest.h:57
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:271

Referenced by START_TEST().

◆ test_winmodule()

static void test_winmodule ( void  )
static

Definition at line 149 of file atl.c.

150 {
151  _AtlCreateWndData create_data[3];
152  _ATL_WIN_MODULE winmod;
153  void *p;
154  HRESULT hres;
155 
156  winmod.cbSize = 0xdeadbeef;
157  hres = AtlWinModuleInit(&winmod);
158  ok(hres == E_INVALIDARG, "AtlWinModuleInit failed: %08x\n", hres);
159 
160  winmod.cbSize = sizeof(winmod);
161  winmod.m_pCreateWndList = (void*)0xdeadbeef;
162  winmod.m_csWindowCreate.LockCount = 0xdeadbeef;
163  winmod.m_rgWindowClassAtoms.m_aT = (void*)0xdeadbeef;
164  winmod.m_rgWindowClassAtoms.m_nSize = 0xdeadbeef;
165  winmod.m_rgWindowClassAtoms.m_nAllocSize = 0xdeadbeef;
166  hres = AtlWinModuleInit(&winmod);
167  ok(hres == S_OK, "AtlWinModuleInit failed: %08x\n", hres);
168  ok(!winmod.m_pCreateWndList, "winmod.m_pCreateWndList = %p\n", winmod.m_pCreateWndList);
169  ok(winmod.m_csWindowCreate.LockCount == -1, "winmod.m_csWindowCreate.LockCount = %d\n",
170  winmod.m_csWindowCreate.LockCount);
171  ok(winmod.m_rgWindowClassAtoms.m_aT == (void*)0xdeadbeef, "winmod.m_rgWindowClassAtoms.m_aT = %p\n",
172  winmod.m_rgWindowClassAtoms.m_aT);
173  ok(winmod.m_rgWindowClassAtoms.m_nSize == 0xdeadbeef, "winmod.m_rgWindowClassAtoms.m_nSize = %d\n",
175  ok(winmod.m_rgWindowClassAtoms.m_nAllocSize == 0xdeadbeef, "winmod.m_rgWindowClassAtoms.m_nAllocSize = %d\n",
177 
179 
180  AtlWinModuleAddCreateWndData(&winmod, create_data, (void*)0xdead0001);
181  ok(winmod.m_pCreateWndList == create_data, "winmod.m_pCreateWndList != create_data\n");
182  ok(create_data[0].m_pThis == (void*)0xdead0001, "unexpected create_data[0].m_pThis %p\n", create_data[0].m_pThis);
183  ok(create_data[0].m_dwThreadID == GetCurrentThreadId(), "unexpected create_data[0].m_dwThreadID %x\n",
184  create_data[0].m_dwThreadID);
185  ok(!create_data[0].m_pNext, "unexpected create_data[0].m_pNext %p\n", create_data[0].m_pNext);
186 
187  AtlWinModuleAddCreateWndData(&winmod, create_data+1, (void*)0xdead0002);
188  ok(winmod.m_pCreateWndList == create_data+1, "winmod.m_pCreateWndList != create_data\n");
189  ok(create_data[1].m_pThis == (void*)0xdead0002, "unexpected create_data[1].m_pThis %p\n", create_data[1].m_pThis);
190  ok(create_data[1].m_dwThreadID == GetCurrentThreadId(), "unexpected create_data[1].m_dwThreadID %x\n",
191  create_data[1].m_dwThreadID);
192  ok(create_data[1].m_pNext == create_data, "unexpected create_data[1].m_pNext %p\n", create_data[1].m_pNext);
193 
194  AtlWinModuleAddCreateWndData(&winmod, create_data+2, (void*)0xdead0003);
195  ok(winmod.m_pCreateWndList == create_data+2, "winmod.m_pCreateWndList != create_data\n");
196  ok(create_data[2].m_pThis == (void*)0xdead0003, "unexpected create_data[2].m_pThis %p\n", create_data[2].m_pThis);
197  ok(create_data[2].m_dwThreadID == GetCurrentThreadId(), "unexpected create_data[2].m_dwThreadID %x\n",
198  create_data[2].m_dwThreadID);
199  ok(create_data[2].m_pNext == create_data+1, "unexpected create_data[2].m_pNext %p\n", create_data[2].m_pNext);
200 
202  ok(p == (void*)0xdead0003, "unexpected AtlWinModuleExtractCreateWndData result %p\n", p);
203  ok(winmod.m_pCreateWndList == create_data+1, "winmod.m_pCreateWndList != create_data\n");
204  ok(create_data[2].m_pNext == create_data+1, "unexpected create_data[2].m_pNext %p\n", create_data[2].m_pNext);
205 
206  create_data[1].m_dwThreadID = 0xdeadbeef;
207 
209  ok(p == (void*)0xdead0001, "unexpected AtlWinModuleExtractCreateWndData result %p\n", p);
210  ok(winmod.m_pCreateWndList == create_data+1, "winmod.m_pCreateWndList != create_data\n");
211  ok(!create_data[0].m_pNext, "unexpected create_data[0].m_pNext %p\n", create_data[0].m_pNext);
212  ok(!create_data[1].m_pNext, "unexpected create_data[1].m_pNext %p\n", create_data[1].m_pNext);
213 
215  ok(!p, "unexpected AtlWinModuleExtractCreateWndData result %p\n", p);
216  ok(winmod.m_pCreateWndList == create_data+1, "winmod.m_pCreateWndList != create_data\n");
217 }
int m_nSize
Definition: atlbase.h:186
CComCriticalSection m_csWindowCreate
Definition: atlbase.h:201
void WINAPI AtlWinModuleAddCreateWndData(_ATL_WIN_MODULE *, _AtlCreateWndData *, void *)
CSimpleArray m_rgWindowClassAtoms
Definition: atlbase.h:203
#define E_INVALIDARG
Definition: ddrawi.h:101
VOID WINAPI InitializeCriticalSection(OUT LPCRITICAL_SECTION lpCriticalSection)
Definition: synch.c:751
DWORD WINAPI GetCurrentThreadId(VOID)
Definition: thread.c:458
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
void * m_aT
Definition: atlbase.h:185
HRESULT WINAPI AtlWinModuleInit(_ATL_WIN_MODULE *)
_AtlCreateWndData * m_pCreateWndList
Definition: atlbase.h:202
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
void *WINAPI AtlWinModuleExtractCreateWndData(_ATL_WIN_MODULE *)
GLfloat GLfloat p
Definition: glext.h:8902
int m_nAllocSize
Definition: atlbase.h:187

Referenced by START_TEST().

Variable Documentation

◆ advise_cnt

int advise_cnt
static

Definition at line 365 of file atl.c.

Referenced by ConnectionPoint_Advise(), ConnectionPoint_Unadvise(), and test_cp().

◆ CATID_CatTest1

const GUID CATID_CatTest1
static
Initial value:
=
{0x178fc163,0x0000,0x0000,{0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x46}}

Definition at line 39 of file atl.c.

Referenced by test_regcat().

◆ CATID_CatTest2

const GUID CATID_CatTest2
static
Initial value:
=
{0x178fc163,0x0000,0x0000,{0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x46}}

Definition at line 43 of file atl.c.

Referenced by test_regcat().

◆ clsid1W

const WCHAR clsid1W[]
static
Initial value:
= {'{','8','8','5','6','f','9','6','1','-','3','4','0','a','-',
'1','1','d','0','-','a','9','6','b','-',
'0','0','c','0','4','f','d','7','0','5','a','2','}','\0'}

Definition at line 50 of file atl.c.

Referenced by test_AtlAxCreateControl(), and test_ax_win().

◆ CLSID_Test

const GUID CLSID_Test
static
Initial value:
=
{0x178fc163,0x0000,0x0000,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x46}}

Definition at line 35 of file atl.c.

Referenced by ConnectionPointContainer_FindConnectionPoint(), run_test(), test_cp(), test_regcat(), and test_SxsLookupClrGuid().

◆ ConnectionPoint

◆ ConnectionPointContainer

◆ ConnectionPointContainerVtbl

const IConnectionPointContainerVtbl ConnectionPointContainerVtbl
static
Initial value:
= {
}
static HRESULT WINAPI ConnectionPointContainer_QueryInterface(IConnectionPointContainer *iface, REFIID riid, void **ppv)
Definition: atl.c:404
static ULONG WINAPI ConnectionPointContainer_AddRef(IConnectionPointContainer *iface)
Definition: atl.c:416
static HRESULT WINAPI ConnectionPointContainer_EnumConnectionPoints(IConnectionPointContainer *iface, IEnumConnectionPoints **ppEnum)
Definition: atl.c:426
static ULONG WINAPI ConnectionPointContainer_Release(IConnectionPointContainer *iface)
Definition: atl.c:421
static HRESULT WINAPI ConnectionPointContainer_FindConnectionPoint(IConnectionPointContainer *iface, REFIID riid, IConnectionPoint **ppCP)
Definition: atl.c:433

Definition at line 441 of file atl.c.

◆ ConnectionPointVtbl

const IConnectionPointVtbl ConnectionPointVtbl
static
Initial value:
=
{
}
static HRESULT WINAPI ConnectionPoint_EnumConnections(IConnectionPoint *iface, IEnumConnections **ppEnum)
Definition: atl.c:383
static HRESULT WINAPI ConnectionPoint_Unadvise(IConnectionPoint *iface, DWORD dwCookie)
Definition: atl.c:376
static HRESULT WINAPI ConnectionPoint_QueryInterface(IConnectionPoint *iface, REFIID riid, void **ppv)
Definition: atl.c:331
static HRESULT WINAPI ConnectionPoint_Advise(IConnectionPoint *iface, IUnknown *pUnkSink, DWORD *pdwCookie)
Definition: atl.c:367
static HRESULT WINAPI ConnectionPoint_GetConnectionPointContainer(IConnectionPoint *iface, IConnectionPointContainer **ppCPC)
Definition: atl.c:358
static HRESULT WINAPI ConnectionPoint_GetConnectionInterface(IConnectionPoint *iface, IID *pIID)
Definition: atl.c:352
static ULONG WINAPI ConnectionPoint_Release(IConnectionPoint *iface)
Definition: atl.c:347
static ULONG WINAPI ConnectionPoint_AddRef(IConnectionPoint *iface)
Definition: atl.c:342

Definition at line 390 of file atl.c.

◆ Dispatch

Definition at line 632 of file atl.c.

◆ DispatchVtbl

const IDispatchVtbl DispatchVtbl
static
Initial value:
= {
}
static HRESULT WINAPI Dispatch_GetTypeInfoCount(IDispatch *iface, UINT *pctinfo)
Definition: atl.c:580
static HRESULT WINAPI Dispatch_QueryInterface(IDispatch *iface, REFIID riid, void **ppv)
Definition: atl.c:545
static HRESULT WINAPI Dispatch_GetTypeInfo(IDispatch *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: atl.c:586
static HRESULT WINAPI Dispatch_GetIDsOfNames(IDispatch *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: atl.c:607
static ULONG WINAPI Dispatch_Release(IDispatch *iface)
Definition: atl.c:575
static HRESULT WINAPI Dispatch_Invoke(IDispatch *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
Definition: atl.c:614
static ULONG WINAPI Dispatch_AddRef(IDispatch *iface)
Definition: atl.c:570

Definition at line 622 of file atl.c.

◆ emptyW

const WCHAR emptyW[] = {'\0'}
static

Definition at line 47 of file atl.c.

Referenced by test_AtlAxCreateControl(), and test_ax_win().

◆ fileW

const WCHAR fileW[] = {'f','i','l','e',':','/','/','/','\0'}
static

Definition at line 62 of file atl.c.

Referenced by test_AtlAxCreateControl(), and test_ax_win().

◆ html_fileW

const WCHAR html_fileW[] = {'t','e','s','t','.','h','t','m','l','\0'}
static

Definition at line 63 of file atl.c.

Referenced by test_AtlAxCreateControl(), and test_ax_win().

◆ html_str

◆ mshtml1W

const WCHAR mshtml1W[]
static
Initial value:
= {'m','s','h','t','m','l',':','<','h','t','m','l','>','<','b','o','d','y','>',
't','e','s','t','<','/','b','o','d','y','>','<','/','h','t','m','l','>','\0'}

Definition at line 56 of file atl.c.

Referenced by test_AtlAxCreateControl(), and test_ax_win().

◆ mshtml2W

const WCHAR mshtml2W[]
static
Initial value:
= {'M','S','H','T','M','L',':','<','h','t','m','l','>','<','b','o','d','y','>',
't','e','s','t','<','/','b','o','d','y','>','<','/','h','t','m','l','>','\0'}

Definition at line 58 of file atl.c.

Referenced by test_AtlAxCreateControl(), and test_ax_win().

◆ mshtml3W

const WCHAR mshtml3W[]
static
Initial value:
= {'<','h','t','m','l','>','<','b','o','d','y','>', 't','e','s','t',
'<','/','b','o','d','y','>','<','/','h','t','m','l','>','\0'}

Definition at line 60 of file atl.c.

Referenced by test_AtlAxCreateControl(), and test_ax_win().

◆ Persist

IPersist Persist = { &PersistVtbl }
static

Definition at line 503 of file atl.c.

Referenced by cmdUse(), Dispatch_QueryInterface(), test_domain_password(), and test_generic().

◆ persist_clsid

CLSID persist_clsid
static

Definition at line 472 of file atl.c.

Referenced by Persist_GetClassID(), and test_source_iface().

◆ PersistVtbl

const IPersistVtbl PersistVtbl
static
Initial value:
= {
}
static ULONG WINAPI Persist_AddRef(IPersist *iface)
Definition: atl.c:480
static HRESULT WINAPI Persist_QueryInterface(IPersist *iface, REFIID riid, void **ppv)
Definition: atl.c:474
static ULONG WINAPI Persist_Release(IPersist *iface)
Definition: atl.c:485
static HRESULT WINAPI Persist_GetClassID(IPersist *iface, CLSID *pClassID)
Definition: atl.c:490

Definition at line 496 of file atl.c.

◆ progid1W

const WCHAR progid1W[] = {'S','h','e','l','l','.','E','x','p','l','o','r','e','r','.','2','\0'}
static

Definition at line 49 of file atl.c.

Referenced by test_AtlAxCreateControl(), and test_ax_win().

◆ ProvideClassInfo2

IProvideClassInfo2 ProvideClassInfo2 = { &ProvideClassInfo2Vtbl }
static

Definition at line 542 of file atl.c.

Referenced by Dispatch_QueryInterface().

◆ ProvideClassInfo2Vtbl

const IProvideClassInfo2Vtbl ProvideClassInfo2Vtbl
static
Initial value:
= {
}
static HRESULT WINAPI ProvideClassInfo2_GetClassInfo(IProvideClassInfo2 *iface, ITypeInfo **ppTI)
Definition: atl.c:521
static HRESULT WINAPI ProvideClassInfo2_GetGUID(IProvideClassInfo2 *iface, DWORD dwGuidKind, GUID *pGUID)
Definition: atl.c:527
static HRESULT WINAPI ProvideClassInfo2_QueryInterface(IProvideClassInfo2 *iface, REFIID riid, void **ppv)
Definition: atl.c:505
static ULONG WINAPI ProvideClassInfo2_AddRef(IProvideClassInfo2 *iface)
Definition: atl.c:511
static ULONG WINAPI ProvideClassInfo2_Release(IProvideClassInfo2 *iface)
Definition: atl.c:516

Definition at line 534 of file atl.c.

◆ randomW

const WCHAR randomW[] = {'r','a','n','d','o','m','\0'}
static

Definition at line 48 of file atl.c.

Referenced by test_AtlAxCreateControl(), and test_ax_win().

◆ support_classinfo2

BOOL support_classinfo2
static

Definition at line 543 of file atl.c.

Referenced by Dispatch_QueryInterface(), and test_source_iface().

◆ url1W

const WCHAR url1W[]
static
Initial value:
= {'h','t','t','p',':','/','/','t','e','s','t','.','w','i','n','e','h','q',
'.','o','r','g','/','t','e','s','t','s','/','w','i','n','e','h','q','_',
's','n','a','p','s','h','o','t','/','\0'}

Definition at line 53 of file atl.c.

Referenced by test_AtlAxCreateControl(), test_ax_win(), and test_IWinHttpRequest().