29DEFINE_GUID(
GUID_NULL,0,0,0,0,0,0,0,0,0,0,0);
31#define EXPECT_HR(hr,hr_exp) \
32 ok(hr == hr_exp, "got 0x%08x, expected 0x%08x\n", hr, hr_exp)
34#define test_provideclassinfo(a, b) _test_provideclassinfo((IDispatch*)a, b, __LINE__)
43 ok_(__FILE__,
line) (
hr ==
S_OK,
"Failed to get IProvideClassInfo, %#x.\n",
hr);
45 hr = IProvideClassInfo_GetClassInfo(
classinfo, &ti);
48 hr = ITypeInfo_GetTypeAttr(ti, &
attr);
55 ITypeInfo_ReleaseTypeAttr(ti,
attr);
56 ITypeInfo_Release(ti);
59#define CHECK_BSTR_LENGTH(str) check_bstr_length(str, __LINE__)
68 static const WCHAR notepadW[] = {
'n',
'o',
't',
'e',
'p',
'a',
'd',
'.',
'e',
'x',
'e',0};
69 static const WCHAR desktopW[] = {
'D',
'e',
's',
'k',
't',
'o',
'p',0};
70 static const WCHAR lnk1W[] = {
'f',
'i',
'l',
'e',
'.',
'l',
'n',
'k',0};
71 static const WCHAR pathW[] = {
'%',
'P',
'A',
'T',
'H',
'%',0};
72 static const WCHAR sysW[] = {
'S',
'Y',
'S',
'T',
'E',
'M',0};
73 static const WCHAR path2W[] = {
'P',
'A',
'T',
'H',0};
74 static const WCHAR dummydirW[] = {
'd',
'e',
'a',
'd',
'p',
'a',
'r',
'r',
'o',
't',0};
75 static const WCHAR emptyW[] = {
'e',
'm',
'p',
't',
'y',0};
76 static const WCHAR cmdexeW[] = {
'\\',
'c',
'm',
'd',
'.',
'e',
'x',
'e',0};
77 static const WCHAR testdirW[] = {
'w',
's',
'h',
'o',
'm',
' ',
't',
'e',
's',
't',
' ',
'd',
'i',
'r',0};
78 static const WCHAR paramsW[] =
79 {
' ',
'/',
'c',
' ',
'r',
'd',
' ',
'/',
's',
' ',
'/',
'q',
' ',
'c',
':',
'\\',
'n',
'o',
's',
'u',
'c',
'h',
'd',
'i',
'r',0};
80 static const WCHAR cmdW[] =
81 {
'c',
'm',
'd',
'.',
'e',
'x',
'e',
' ',
'/',
'c',
' ',
'r',
'd',
' ',
'/',
's',
' ',
'/',
'q',
' ',
'c',
':',
'\\',
82 'n',
'o',
's',
'u',
'c',
'h',
'd',
'i',
'r',0};
83 static const WCHAR cmd2W[] =
84 {
'"',
'c',
'm',
'd',
'.',
'e',
'x',
'e',
' ',
'"',
' ',
'/',
'c',
' ',
'r',
'd',
' ',
'/',
's',
' ',
'/',
'q',
' ',
'c',
':',
'\\',
85 'n',
'o',
's',
'u',
'c',
'h',
'd',
'i',
'r',0};
94 IFolderCollection *folders;
110 hr = IDispatch_QueryInterface(disp, &IID_IWshShell3, (
void**)&
shell);
114 hr = IDispatch_QueryInterface(disp, &IID_IDispatchEx, (
void**)&dispex);
116 IDispatch_Release(disp);
118 hr = IUnknown_QueryInterface(
shell, &IID_IWshShell3, (
void**)&sh3);
124 hr = IWshShell3_QueryInterface(sh3, &IID_IWshShell, (
void**)&unk);
126 IUnknown_Release(unk);
128 hr = IWshShell3_QueryInterface(sh3, &IID_IWshShell2, (
void**)&unk);
130 IUnknown_Release(unk);
132 hr = IWshShell3_get_SpecialFolders(sh3, &coll);
136 hr = IWshCollection_QueryInterface(coll, &IID_IFolderCollection, (
void**)&folders);
139 hr = IWshCollection_QueryInterface(coll, &
IID_IDispatch, (
void**)&disp);
142 hr = IDispatch_GetTypeInfo(disp, 0, 0, &ti);
145 hr = ITypeInfo_GetTypeAttr(ti, &tattr);
147 ok(
IsEqualIID(&tattr->guid, &IID_IWshCollection),
"got wrong type guid\n");
148 ITypeInfo_ReleaseTypeAttr(ti, tattr);
155 dp.rgdispidNamedArgs =
NULL;
163 hr = IWshCollection_Item(coll, &
arg, &
res);
172 hr = IWshShell3_CreateShortcut(sh3,
str, &shortcut);
175 hr = IDispatch_QueryInterface(shortcut, &IID_IWshShortcut, (
void**)&shcut);
179 hr = IWshShortcut_get_Arguments(shcut,
NULL);
182 hr = IWshShortcut_get_IconLocation(shcut,
NULL);
185 IWshShortcut_Release(shcut);
186 IDispatch_Release(shortcut);
189 hr = IWshShell3_ExpandEnvironmentStrings(sh3,
NULL,
NULL);
193 hr = IWshShell3_ExpandEnvironmentStrings(sh3,
str,
NULL);
199 hr = IWshShell3_get_Environment(sh3, &
arg, &
env);
235 IWshEnvironment_Release(
env);
249 ok(retval == 10,
"got %u\n", retval);
254 ok(retval == 10,
"got %u\n", retval);
261 ok(retval == 10,
"got %u\n", retval);
311 hr = IWshShell3_get_CurrentDirectory(sh3,
NULL);
314 hr = IWshShell3_get_CurrentDirectory(sh3, &
str);
316 ok(
str &&
str[0] != 0,
"got empty string\n");
320 hr = IWshShell3_put_CurrentDirectory(sh3,
NULL);
325 hr = IWshShell3_put_CurrentDirectory(sh3,
str);
330 hr = IWshShell3_put_CurrentDirectory(sh3,
str);
338 hr = IWshShell3_Exec(sh3,
NULL, &shexec);
342 hr = IWshShell3_Exec(sh3,
str, &shexec);
346 IWshCollection_Release(coll);
347 IDispatch_Release(disp);
348 IWshShell3_Release(sh3);
349 IUnknown_Release(
shell);
373 static const WCHAR keypathW[] = {
'H',
'K',
'E',
'Y',
'_',
'C',
'U',
'R',
'R',
'E',
'N',
'T',
'_',
'U',
'S',
'E',
'R',
'\\',
374 'S',
'o',
'f',
't',
'w',
'a',
'r',
'e',
'\\',
'W',
'i',
'n',
'e',
'\\',
'T',
'e',
's',
't',
'\\',0};
375 static const WCHAR regsz2W[] = {
'r',
'e',
'g',
's',
'z',
'2',0};
376 static const WCHAR regszW[] = {
'r',
'e',
'g',
's',
'z',0};
377 static const WCHAR regdwordW[] = {
'r',
'e',
'g',
'd',
'w',
'o',
'r',
'd',0};
378 static const WCHAR regbinaryW[] = {
'r',
'e',
'g',
'b',
'i',
'n',
'a',
'r',
'y',0};
379 static const WCHAR regmultiszW[] = {
'r',
'e',
'g',
'm',
'u',
'l',
't',
'i',
's',
'z',0};
381 static const WCHAR regsz1W[] = {
'H',
'K',
'E',
'Y',
'_',
'C',
'U',
'R',
'R',
'E',
'N',
'T',
'_',
'U',
'S',
'E',
'R',
'\\',
382 'S',
'o',
'f',
't',
'w',
'a',
'r',
'e',
'\\',
'W',
'i',
'n',
'e',
'\\',
'T',
'e',
's',
't',
'\\',
'r',
'e',
'g',
's',
'z',
'1',0};
383 static const WCHAR foobarW[] = {
'f',
'o',
'o',
'b',
'a',
'r',0};
384 static const WCHAR fooW[] = {
'f',
'o',
'o',0};
385 static const WCHAR brokenW[] = {
'H',
'K',
'E',
'Y',
'_',
'b',
'r',
'o',
'k',
'e',
'n',
'_',
'k',
'e',
'y',0};
386 static const WCHAR broken2W[] = {
'H',
'K',
'E',
'Y',
'_',
'C',
'U',
'R',
'R',
'E',
'N',
'T',
'_',
'U',
'S',
'E',
'R',
'a',0};
400 &IID_IWshShell3, (
void**)&sh3);
491 ok(dim == 1,
"got %u\n", dim);
495 ok(bound == 0,
"got %u\n", bound);
499 ok(bound == 3,
"got %u\n", bound);
525 ok(dim == 1,
"got %u\n", dim);
529 ok(bound == 0,
"got %u\n", bound);
533 ok(bound == 1,
"got %u\n", bound);
635 IWshShell3_Release(sh3);
640 static const WCHAR textW[] = {
'T',
'e',
'x',
't',0};
648 &IID_IWshShell, (
void **)&
sh);
649 ok(
hr ==
S_OK,
"Failed to create WshShell object, hr %#x.\n",
hr);
675 ok(
hr ==
S_OK,
"Unexpected retval %#x.\n",
hr);
679 ok(
hr ==
S_OK,
"Unexpected retval %#x.\n",
hr);
683 IWshShell_Release(
sh);
696 win_skip(
"Could not create WshShell object: %08x\n",
hr);
699 IUnknown_Release(unk);
void shell(int argc, const char *argv[])
#define RegCloseKey(hKey)
static LPCWSTR LPCWSTR LPCWSTR env
LONG WINAPI RegCreateKeyA(HKEY hKey, LPCSTR lpSubKey, PHKEY phkResult)
LONG WINAPI RegSetValueExA(HKEY hKey, LPCSTR lpValueName, DWORD Reserved, DWORD dwType, CONST BYTE *lpData, DWORD cbData)
LONG WINAPI RegOpenKeyExA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey, _In_ DWORD ulOptions, _In_ REGSAM samDesired, _Out_ PHKEY phkResult)
LONG WINAPI RegDeleteValueA(HKEY hKey, LPCSTR lpValueName)
LONG WINAPI RegEnumKeyA(HKEY hKey, DWORD dwIndex, LPSTR lpName, DWORD cbName)
LONG WINAPI RegQueryValueExA(_In_ HKEY hkeyorg, _In_ LPCSTR name, _In_ LPDWORD reserved, _Out_opt_ LPDWORD type, _Out_opt_ LPBYTE data, _Inout_opt_ LPDWORD count)
LONG WINAPI RegDeleteKeyA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey)
#define ERROR_NO_MORE_ITEMS
BOOL WINAPI CopyFileW(IN LPCWSTR lpExistingFileName, IN LPCWSTR lpNewFileName, IN BOOL bFailIfExists)
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
BOOL WINAPI CreateDirectoryW(IN LPCWSTR lpPathName, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes)
BOOL WINAPI RemoveDirectoryW(IN LPCWSTR lpPathName)
DWORD WINAPI GetFileAttributesW(LPCWSTR lpFileName)
DWORD WINAPI GetTempPathW(IN DWORD count, OUT LPWSTR path)
UINT WINAPI GetSystemDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
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)
static const WCHAR desktopW[]
HRESULT WINAPI SafeArrayGetUBound(SAFEARRAY *psa, UINT nDim, LONG *plUbound)
HRESULT WINAPI SafeArrayGetElement(SAFEARRAY *psa, LONG *rgIndices, void *pvData)
UINT WINAPI SafeArrayGetDim(SAFEARRAY *psa)
HRESULT WINAPI SafeArrayGetLBound(SAFEARRAY *psa, UINT nDim, LONG *plLbound)
HRESULT WINAPI SafeArrayGetVartype(SAFEARRAY *psa, VARTYPE *pvt)
GLuint GLuint GLsizei GLenum type
GLuint GLuint GLuint GLuint GLuint GLuint GLuint arg2
GLenum GLuint GLenum GLsizei const GLchar * buf
static const WCHAR emptyW[]
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
int WINAPI lstrcmpW(LPCWSTR lpString1, LPCWSTR lpString2)
#define ERROR_FILE_NOT_FOUND
static const WCHAR textW[]
const IID IID_IObjectWithSite
static const WCHAR foobarW[]
static const WCHAR fooW[]
static const WCHAR sysW[]
static const WCHAR path2[]
#define KEY_ENUMERATE_SUB_KEYS
BSTR WINAPI SysAllocString(LPCOLESTR str)
UINT WINAPI SysStringLen(BSTR str)
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
#define DISPATCH_PROPERTYGET
const GUID IID_IProvideClassInfo
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8)
#define IsEqualGUID(rguid1, rguid2)
#define IsEqualIID(riid1, riid2)
#define delete_key(r, p, s)
static __inline const char * wine_dbgstr_guid(const GUID *id)
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
void WINAPI VariantInit(VARIANTARG *pVarg)
#define INVALID_FILE_ATTRIBUTES
#define DISP_E_PARAMNOTFOUND
#define ERROR_PATH_NOT_FOUND
#define DISP_E_MEMBERNOTFOUND
#define HRESULT_FROM_WIN32(x)
#define DISP_E_TYPEMISMATCH
#define HKEY_CURRENT_USER
#define test_provideclassinfo(a, b)
static void test_registry(void)
#define EXPECT_HR(hr, hr_exp)
static void test_popup(void)
static void check_bstr_length(BSTR str, int line)
#define CHECK_BSTR_LENGTH(str)
static void test_wshshell(void)
static void _test_provideclassinfo(IDispatch *disp, const GUID *guid, int line)