34 IQueryAssociations *qa;
35 IQueryAssociations *qa2;
39 hr =
CoCreateInstance(&CLSID_QueryAssociations,
NULL, CLSCTX_INPROC_SERVER, &IID_IQueryAssociations, (
void*)&qa);
43 ok(
hr ==
S_OK,
"QueryInterface (IQueryAssociations) returned 0x%x\n",
hr);
49 ok(
hr ==
S_OK,
"QueryInterface (IUnknown) returned 0x%x\n",
hr);
51 IUnknown_Release(unk);
67 hr = IApplicationAssociationRegistration_QueryInterface(appreg, &IID_IApplicationAssociationRegistration,
69 ok(
hr ==
S_OK,
"QueryInterface (IApplicationAssociationRegistration) returned 0x%x\n",
hr);
71 IApplicationAssociationRegistration_Release(appreg2);
74 hr = IApplicationAssociationRegistration_QueryInterface(appreg, &
IID_IUnknown, (
void**)&unk);
75 ok(
hr ==
S_OK,
"QueryInterface (IUnknown) returned 0x%x\n",
hr);
77 IUnknown_Release(unk);
95static const WCHAR badW[] = {
'b',
'a',
'd',
'b',
'a',
'd',0};
106 IQueryAssociations *assoc;
111 hr =
CoCreateInstance(&CLSID_QueryAssociations,
NULL, CLSCTX_INPROC_SERVER, &IID_IQueryAssociations, (
void*)&assoc);
112 ok_(__FILE__,
line)(
hr ==
S_OK,
"failed to create IQueryAssociations, 0x%x\n",
hr);
114 ok_(__FILE__,
line)(
hr ==
S_OK,
"IQueryAssociations::Init failed, 0x%x\n",
hr);
117 if (expected_string) {
118 ok_(__FILE__,
line)(
hr ==
S_FALSE,
"GetString returned 0x%x, expected S_FALSE\n",
hr);
128 ok_(__FILE__,
line)(
hr ==
S_OK,
"GetString returned 0x%x, expected S_OK\n",
hr);
133 ok_(__FILE__,
line)(
FAILED(
hr),
"GetString returned 0x%x, expected failure\n",
hr);
142 static WCHAR test_extensionW[] = {
'.',
't',
'e',
's',
't',0};
143 static WCHAR test_progidW[] = {
't',
'e',
's',
't',
'f',
'i',
'l',
'e',0};
144 static WCHAR DefaultIconW[] = {
'D',
'e',
'f',
'a',
'u',
'l',
't',
'I',
'c',
'o',
'n',0};
146 static WCHAR test_iconW[] = {
's',
'h',
'e',
'l',
'l',
'3',
'2',
'.',
'd',
'l',
'l',
',',
'1',0};
147 HKEY test_extension_key;
148 HKEY test_progid_key;
149 HKEY test_defaulticon_key;
153 IQueryAssociations *assoc;
161 win_skip(
"Not enough permissions to create a test key.\n");
167 ok(
r ==
ERROR_SUCCESS,
"RegSetValueExW(HKCR\\.test, NULL, \"testfile\") failed: 0x%lx\n",
r);
171 ok(
r ==
ERROR_SUCCESS,
"RegCreateKeyExW(HKCR, \"testfile\") failed: 0x%lx\n",
r);
178 ok(
r ==
ERROR_SUCCESS,
"RegCreateKeyExW(HKCR\\testfile\\DefaultIcon) failed: 0x%lx\n",
r);
180 ok(
r ==
ERROR_SUCCESS,
"RegSetValueExW(HKCR\\testfile\\DefaultIcon, NULL, \"folder.ico\") failed: 0x%lx\n",
r);
189 hr =
CoCreateInstance(&CLSID_QueryAssociations,
NULL, CLSCTX_INPROC_SERVER, &IID_IQueryAssociations, (
void*)&assoc);
190 ok(
hr ==
S_OK,
"failed to create object, 0x%x\n",
hr);
198 ok(
len > 0,
"got wrong needed length, %d\n",
len);
215 ok(
hr ==
ptr->hr,
"%d: GetString failed, 0x%08x\n",
i,
hr);
216 ok(
len >
ptr->len,
"%d: got needed length %d\n",
i,
len);
221 ok(buffW[0] == 0 ||
broken(buffW[0] == 0x1) ,
"%d: got %x\n",
i, buffW[0]);
224 ok(buffW[0] != 0,
"%d: got %x\n",
i, buffW[0]);
235 IQueryAssociations *assoc;
239 hr =
CoCreateInstance(&CLSID_QueryAssociations,
NULL, CLSCTX_INPROC_SERVER, &IID_IQueryAssociations, (
void*)&assoc);
240 ok(
hr ==
S_OK,
"failed to create object, 0x%x\n",
hr);
261 static const WCHAR txtW[] = {
'.',
't',
'x',
't',0};
262 static const WCHAR spacetxtW[] = {
' ',
'.',
't',
'x',
't',0};
299 IQueryAssociations *qa;
306 hr =
CoCreateInstance(&CLSID_QueryAssociations,
NULL, CLSCTX_INPROC_SERVER, &IID_IQueryAssociations, (
void*)&qa);
316 win_skip(
"IQueryAssociations not supported, 0x%x\n",
hr);
320 &IID_IApplicationAssociationRegistration, (
LPVOID*)&appreg);
326 IApplicationAssociationRegistration_Release(appreg);
329 win_skip(
"IApplicationAssociationRegistration not supported: 0x%x\n",
hr);
static void * heap_alloc(size_t len)
static BOOL heap_free(void *mem)
LONG WINAPI RegCreateKeyExW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey, _In_ DWORD Reserved, _In_opt_ LPWSTR lpClass, _In_ DWORD dwOptions, _In_ REGSAM samDesired, _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, _Out_ PHKEY phkResult, _Out_opt_ LPDWORD lpdwDisposition)
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
LONG WINAPI RegDeleteKeyW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey)
#define ERROR_ACCESS_DENIED
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
GLdouble GLdouble GLdouble r
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
static const WCHAR emptyW[]
VOID WINAPI CoTaskMemFree(LPVOID ptr)
static const WCHAR badW[]
static void test_IApplicationAssociationRegistration_QueryCurrentDefault(IApplicationAssociationRegistration *appreg)
static void getstring_test(LPCWSTR assocName, HKEY progIdKey, ASSOCSTR str, LPCWSTR expected_string, int line)
static void test_IQueryAssociations_GetString(void)
static const WCHAR httpW[]
static void test_IQueryAssociations_QueryInterface(void)
static void test_IApplicationAssociationRegistration_QueryInterface(IApplicationAssociationRegistration *appreg)
static void test_IQueryAssociations_Init(void)
static struct assoc_getstring_test getstring_tests[]
#define IQueryAssociations_Release(p)
#define IQueryAssociations_Init(p, a, b, c, d)
#define IQueryAssociations_QueryInterface(p, a, b)
#define IQueryAssociations_GetString(p, a, b, c, d, e)
#define ERROR_NO_ASSOCIATION
#define HRESULT_FROM_WIN32(x)
#define HKEY_CLASSES_ROOT