11#define UNIQUEEXT L".RosTestExtShell32"
12#define UNIQUEPROGID L"88D6FB7F96C34598A94D7C1CBB37E70B"
13#define UNIQUEPROGID2 L"990B516360E4451EA6BE2156CB3819E4"
14#define UNIQUEGUID L"{FF9A10E8-E0E8-47B9-A2BC-36C5E435E5E1}"
16#define HKCR HKEY_CLASSES_ROOT
17#define HKCU HKEY_CURRENT_USER
18#define E_ANY ((0xFF << 24) | 42)
19#define S_ANY (~UINT(0) >> 24)
65 CComPtr<IQueryAssociations> pQA;
75 CComPtr<IQueryAssociations> pQA;
77 flags &= ~AF_INITMASK;
81 DWORD cbReg =
sizeof(
r.regdata);
96 *(
UINT64*)&
r.querydata = 0xBAAAAAAAAAAAAAADull;
105#define CheckRegValue(hrexpect, reg, type, flags, initstr, initprogid, extra, rhk, rpath, rname) do \
108 CheckHelper(r, (reg), (type), (flags), (initstr), (initprogid), (extra), (rhk), (rpath), (rname)); \
109 if ((hrexpect) == E_ANY) \
111 ok(FAILED(r.hr), "Expected failure, got %#x\n", r.hr); \
115 ok_hr(r.hr, (hrexpect)); \
116 if (SUCCEEDED(r.hr)) \
117 ok(r.match, "ASSOC %d did not match %ls |%ls|%ls|\n", (type), RegNameDisp(rname), r.querydata, r.regdata); \
121#define CheckRegStr(hrexpect, type, flags, initstr, initprogid, extra, rhk, rpath, rname) \
122 CheckRegValue((hrexpect), REG_SZ, (type), (flags), (initstr), (initprogid), (extra), (rhk), (rpath), (rname))
123#define CheckRegData(hrexpect, type, flags, initstr, initprogid, extra, rhk, rpath, rname) \
124 CheckRegValue((hrexpect), REG_BINARY, (type), (flags), (initstr), (initprogid), (extra), (rhk), (rpath), (rname))
134 CComPtr<IQueryAssociations> pQA;
138 skip(
"Could not create IQueryAssociations\n");
165 ok(!
r.hr && !
lstrcmpiW(
r.querydata,
r.regdata),
"VALUE mismatch\n");
170 ok(!
r.hr && !
lstrcmpiW(
r.querydata,
r.regdata),
"VALUE mismatch\n");
175 ok(
FAILED(
r.hr),
"Should not fall back to .ext\n");
181 ok(!
r.hr && !
lstrcmpiW(
r.querydata,
r.regdata),
"VALUE mismatch\n");
188 ok(!
r.hr && !
lstrcmpiW(
r.querydata,
r.regdata),
"VALUE mismatch\n");
191 pszValue =
L"%SystemRoot%\\System32\\rundll32.exe \"%SystemRoot%\\System32\\shell32.dll\", Func %1";
196 ok(!
hr &&
StrStrIW(
buf,
L"\\rundll32.exe"),
"REMAPRUNDLL is not implied for COMMAND, got %ls\n",
buf);
199 ok(!
hr &&
StrStrIW(
buf,
L"\\rundll32.exe"),
"REMAPRUNDLL has no effect on COMMAND, got %ls\n",
buf);
205 pszValue =
L"\"%SystemRoot%\\System32\\rundll32.exe\" \"%SystemRoot%\\System32\\shell32.dll\", Func %1";
210 pszValue =
L"rundll32.exe shell32.dll, Func %1";
215 pszValue =
L"%SystemRoot%\\System32\\rundll32.exe";
220 pszValue =
L"\"%SystemRoot%\\System32\\cmd.exe\" /C \"%SystemRoot%\\System32\\rundll32.exe\"";
#define ok_hr(status, expected)
static void CheckHelper(RESULT &r, UINT check, UINT type, UINT flags, LPCWSTR initstr, HKEY initprogid, LPCWSTR extra, HKEY rhk, LPCWSTR rpath, LPCWSTR rname)
#define CheckRegStr(hrexpect, type, flags, initstr, initprogid, extra, rhk, rpath, rname)
#define CheckRegData(hrexpect, type, flags, initstr, initprogid, extra, rhk, rpath, rname)
static HRESULT InitTest(IQueryAssociations **ppQA=NULL)
static HRESULT GetString(ASSOCSTR Str, UINT Flags, LPCWSTR pszAssoc, LPCWSTR pszExtra, PWSTR Out, HKEY hProgId=NULL)
COMPILER_DEPENDENT_UINT64 UINT64
LPWSTR WINAPI StrStrIW(LPCWSTR lpszStr, LPCWSTR lpszSearch)
#define ERROR_ACCESS_DENIED
int WINAPI lstrcmpiW(LPCWSTR str1, LPCWSTR str2)
DWORD WINAPI GetVersion(void)
_ACRTIMP int __cdecl memcmp(const void *, const void *, size_t)
DWORD WINAPI SHDeleteValueW(HKEY hkey, const WCHAR *subkey, const WCHAR *value)
DWORD WINAPI SHDeleteKeyW(HKEY hkey, const WCHAR *subkey)
static DWORD RegSetString(HKEY hKey, LPCWSTR Name, LPCWSTR Str, DWORD Type OPTIONAL_(REG_SZ))
HRESULT WINAPI AssocCreate(CLSID clsid, REFIID refiid, void **lpInterface)
#define check(expected, result)
GLuint GLuint GLsizei GLenum type
GLdouble GLdouble GLdouble r
GLenum GLuint GLenum GLsizei const GLchar * buf
#define ERROR_FILE_NOT_FOUND
@ ASSOCF_INIT_DEFAULTTOSTAR
@ ASSOCF_INIT_DEFAULTTOFOLDER
@ ASSOCF_INIT_NOREMAPCLSID
@ ASSOCF_INIT_IGNOREUNKNOWN
_In_opt_ LPCSTR _In_opt_ LPCSTR pszValue
static UINT RegSetStringEx(HKEY hKey, LPCWSTR Path, LPCWSTR Name, LPCWSTR Str, DWORD Type)
WCHAR querydata[_countof(regdata)]
WCHAR regdata[MAX_PATH *2]
WINSHLWAPI LSTATUS WINAPI SHRegGetValueW(HKEY, LPCWSTR, LPCWSTR, SRRF, LPDWORD, LPVOID, LPDWORD)
static HRESULT HRESULT_FROM_WIN32(unsigned int x)
#define ERROR_NO_ASSOCIATION
#define HKEY_CLASSES_ROOT
_Must_inspect_result_ _In_ ULONG Flags
#define IID_PPV_ARG(Itype, ppType)