From: Alex Henrie alexhenrie24@gmail.com
--- dlls/shell32/tests/assoc.c | 51 +++--- dlls/shell32/tests/autocomplete.c | 53 +++--- dlls/shell32/tests/ebrowser.c | 14 +- dlls/shell32/tests/shelldispatch.c | 49 +++--- dlls/shell32/tests/shelllink.c | 54 +++---- dlls/shell32/tests/shellole.c | 6 +- dlls/shell32/tests/shellpath.c | 90 +++++------ dlls/shell32/tests/shfldr_special.c | 25 ++- dlls/shell32/tests/shlexec.c | 3 +- dlls/shell32/tests/shlfileop.c | 4 +- dlls/shell32/tests/shlfolder.c | 243 +++++++++++----------------- dlls/shell32/tests/string.c | 7 +- 12 files changed, 235 insertions(+), 364 deletions(-)
diff --git a/dlls/shell32/tests/assoc.c b/dlls/shell32/tests/assoc.c index 0e28d9f0355..9dd185fb033 100644 --- a/dlls/shell32/tests/assoc.c +++ b/dlls/shell32/tests/assoc.c @@ -90,13 +90,10 @@ struct assoc_getstring_test HRESULT brokenhr; };
-static const WCHAR httpW[] = {'h','t','t','p',0}; -static const WCHAR badW[] = {'b','a','d','b','a','d',0}; - static struct assoc_getstring_test getstring_tests[] = { - { httpW, 0, ASSOCSTR_EXECUTABLE, 2, 0x8007007a /* E_NOT_SUFFICIENT_BUFFER */, S_OK }, - { httpW, ASSOCF_NOTRUNCATE, ASSOCSTR_EXECUTABLE, 2, E_POINTER }, + { L"http", 0, ASSOCSTR_EXECUTABLE, 2, 0x8007007a /* E_NOT_SUFFICIENT_BUFFER */, S_OK }, + { L"http", ASSOCF_NOTRUNCATE, ASSOCSTR_EXECUTABLE, 2, E_POINTER }, { NULL } };
@@ -138,11 +135,8 @@ static void getstring_test(LPCWSTR assocName, HKEY progIdKey, ASSOCSTR str, LPCW
static void test_IQueryAssociations_GetString(void) { - static WCHAR test_extensionW[] = {'.','t','e','s','t',0}; - static WCHAR test_progidW[] = {'t','e','s','t','f','i','l','e',0}; - static WCHAR DefaultIconW[] = {'D','e','f','a','u','l','t','I','c','o','n',0}; - /* folder.ico, why not */ - static WCHAR test_iconW[] = {'s','h','e','l','l','3','2','.','d','l','l',',','1',0}; + static WCHAR test_progidW[] = L"testfile"; + static WCHAR test_iconW[] = L"shell32.dll,1"; /* folder.ico, why not */ HKEY test_extension_key; HKEY test_progid_key; HKEY test_defaulticon_key; @@ -154,7 +148,7 @@ static void test_IQueryAssociations_GetString(void) DWORD len; int i = 0;
- r = RegCreateKeyExW(HKEY_CLASSES_ROOT, test_extensionW, 0, NULL, 0, KEY_ALL_ACCESS, NULL, &test_extension_key, NULL); + r = RegCreateKeyExW(HKEY_CLASSES_ROOT, L".test", 0, NULL, 0, KEY_ALL_ACCESS, NULL, &test_extension_key, NULL); if (r == ERROR_ACCESS_DENIED) { win_skip("Not enough permissions to create a test key.\n"); @@ -168,27 +162,27 @@ static void test_IQueryAssociations_GetString(void) /* adding progid key with no information should fail to return information */ r = RegCreateKeyExW(HKEY_CLASSES_ROOT, test_progidW, 0, NULL, 0, KEY_ALL_ACCESS, NULL, &test_progid_key, NULL); ok(r == ERROR_SUCCESS, "RegCreateKeyExW(HKCR, "testfile") failed: 0x%Ix\n", r); - getstring_test(test_extensionW, NULL, ASSOCSTR_DEFAULTICON, NULL, __LINE__); + getstring_test(L".test", NULL, ASSOCSTR_DEFAULTICON, NULL, __LINE__); getstring_test(test_progidW, NULL, ASSOCSTR_DEFAULTICON, NULL, __LINE__); getstring_test(NULL, test_progid_key, ASSOCSTR_DEFAULTICON, NULL, __LINE__);
/* adding information to the progid should return that information */ - r = RegCreateKeyExW(test_progid_key, DefaultIconW, 0, NULL, 0, KEY_ALL_ACCESS, NULL, &test_defaulticon_key, NULL); + r = RegCreateKeyExW(test_progid_key, L"DefaultIcon", 0, NULL, 0, KEY_ALL_ACCESS, NULL, &test_defaulticon_key, NULL); ok(r == ERROR_SUCCESS, "RegCreateKeyExW(HKCR\testfile\DefaultIcon) failed: 0x%Ix\n", r); r = RegSetValueExW(test_defaulticon_key, NULL, 0, REG_SZ, (PBYTE)test_iconW, sizeof(test_iconW)); ok(r == ERROR_SUCCESS, "RegSetValueExW(HKCR\testfile\DefaultIcon, NULL, "folder.ico") failed: 0x%Ix\n", r); - getstring_test(test_extensionW, NULL, ASSOCSTR_DEFAULTICON, test_iconW, __LINE__); + getstring_test(L".test", NULL, ASSOCSTR_DEFAULTICON, test_iconW, __LINE__); getstring_test(test_progidW, NULL, ASSOCSTR_DEFAULTICON, test_iconW, __LINE__); getstring_test(NULL, test_progid_key, ASSOCSTR_DEFAULTICON, test_iconW, __LINE__);
- RegDeleteKeyW(test_progid_key, DefaultIconW); + RegDeleteKeyW(test_progid_key, L"DefaultIcon"); RegDeleteKeyW(HKEY_CLASSES_ROOT, test_progidW); - RegDeleteKeyW(HKEY_CLASSES_ROOT, test_extensionW); + RegDeleteKeyW(HKEY_CLASSES_ROOT, L".test");
hr = CoCreateInstance(&CLSID_QueryAssociations, NULL, CLSCTX_INPROC_SERVER, &IID_IQueryAssociations, (void*)&assoc); ok(hr == S_OK, "failed to create object, 0x%lx\n", hr);
- hr = IQueryAssociations_Init(assoc, ASSOCF_NONE, httpW, NULL, NULL); + hr = IQueryAssociations_Init(assoc, ASSOCF_NONE, L"http", NULL, NULL); ok(hr == S_OK, "Init failed, 0x%lx\n", hr);
len = 0; @@ -241,10 +235,10 @@ static void test_IQueryAssociations_Init(void) hr = IQueryAssociations_Init(assoc, ASSOCF_NONE, NULL, NULL, NULL); ok(hr == E_INVALIDARG, "Init failed, 0x%08lx\n", hr);
- hr = IQueryAssociations_Init(assoc, ASSOCF_NONE, httpW, NULL, NULL); + hr = IQueryAssociations_Init(assoc, ASSOCF_NONE, L"http", NULL, NULL); ok(hr == S_OK, "Init failed, 0x%08lx\n", hr);
- hr = IQueryAssociations_Init(assoc, ASSOCF_NONE, badW, NULL, NULL); + hr = IQueryAssociations_Init(assoc, ASSOCF_NONE, L"badbad", NULL, NULL); ok(hr == S_OK || broken(hr == S_FALSE) /* pre-vista */, "Init failed, 0x%08lx\n", hr);
len = 0; @@ -256,37 +250,34 @@ static void test_IQueryAssociations_Init(void)
static void test_IApplicationAssociationRegistration_QueryCurrentDefault(IApplicationAssociationRegistration *appreg) { - static const WCHAR emptyW[] = {0}; - static const WCHAR txtW[] = {'.','t','x','t',0}; - static const WCHAR spacetxtW[] = {' ','.','t','x','t',0}; HRESULT hr; LPWSTR assocprog = NULL;
- hr = IApplicationAssociationRegistration_QueryCurrentDefault(appreg, emptyW, AT_URLPROTOCOL, AL_EFFECTIVE, &assocprog); + hr = IApplicationAssociationRegistration_QueryCurrentDefault(appreg, L"", AT_URLPROTOCOL, AL_EFFECTIVE, &assocprog); ok(hr == E_INVALIDARG, "got 0x%lx\n", hr);
- hr = IApplicationAssociationRegistration_QueryCurrentDefault(appreg, emptyW, AT_FILEEXTENSION, AL_EFFECTIVE, &assocprog); + hr = IApplicationAssociationRegistration_QueryCurrentDefault(appreg, L"", AT_FILEEXTENSION, AL_EFFECTIVE, &assocprog); ok(hr == E_INVALIDARG, "got 0x%lx\n", hr);
- hr = IApplicationAssociationRegistration_QueryCurrentDefault(appreg, spacetxtW, AT_FILEEXTENSION, AL_EFFECTIVE, &assocprog); + hr = IApplicationAssociationRegistration_QueryCurrentDefault(appreg, L" .txt", AT_FILEEXTENSION, AL_EFFECTIVE, &assocprog); ok(hr == E_INVALIDARG || hr == HRESULT_FROM_WIN32(ERROR_NO_ASSOCIATION) /*Win8*/, "got 0x%lx\n", hr);
- hr = IApplicationAssociationRegistration_QueryCurrentDefault(appreg, httpW, AT_URLPROTOCOL, AL_EFFECTIVE, NULL); + hr = IApplicationAssociationRegistration_QueryCurrentDefault(appreg, L"http", AT_URLPROTOCOL, AL_EFFECTIVE, NULL); ok(hr == E_INVALIDARG, "got 0x%lx\n", hr);
/* AT_FILEEXTENSION must start with a period */ - hr = IApplicationAssociationRegistration_QueryCurrentDefault(appreg, txtW, AT_FILEEXTENSION, AL_EFFECTIVE, &assocprog); + hr = IApplicationAssociationRegistration_QueryCurrentDefault(appreg, L".txt", AT_FILEEXTENSION, AL_EFFECTIVE, &assocprog); ok(hr == S_OK, "got 0x%lx\n", hr); trace("%s\n", wine_dbgstr_w(assocprog)); CoTaskMemFree(assocprog);
- hr = IApplicationAssociationRegistration_QueryCurrentDefault(appreg, emptyW, AT_STARTMENUCLIENT, AL_EFFECTIVE, &assocprog); + hr = IApplicationAssociationRegistration_QueryCurrentDefault(appreg, L"", AT_STARTMENUCLIENT, AL_EFFECTIVE, &assocprog); ok(hr == HRESULT_FROM_WIN32(ERROR_NO_ASSOCIATION), "got 0x%lx\n", hr);
- hr = IApplicationAssociationRegistration_QueryCurrentDefault(appreg, emptyW, AT_MIMETYPE, AL_EFFECTIVE, &assocprog); + hr = IApplicationAssociationRegistration_QueryCurrentDefault(appreg, L"", AT_MIMETYPE, AL_EFFECTIVE, &assocprog); ok(hr == HRESULT_FROM_WIN32(ERROR_NO_ASSOCIATION), "got 0x%lx\n", hr);
- hr = IApplicationAssociationRegistration_QueryCurrentDefault(appreg, httpW, AT_URLPROTOCOL, AL_EFFECTIVE, &assocprog); + hr = IApplicationAssociationRegistration_QueryCurrentDefault(appreg, L"http", AT_URLPROTOCOL, AL_EFFECTIVE, &assocprog); ok(hr == S_OK, "got 0x%lx\n", hr); trace("%s\n", wine_dbgstr_w(assocprog));
diff --git a/dlls/shell32/tests/autocomplete.c b/dlls/shell32/tests/autocomplete.c index d0df5b225c1..aa5f023b858 100644 --- a/dlls/shell32/tests/autocomplete.c +++ b/dlls/shell32/tests/autocomplete.c @@ -236,7 +236,7 @@ static void createMainWnd(void) }
static WNDPROC HijackerWndProc_prev; -static const WCHAR HijackerWndProc_txt[] = {'H','i','j','a','c','k','e','d',0}; +static const WCHAR HijackerWndProc_txt[] = L"Hijacked"; static LRESULT CALLBACK HijackerWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { switch(msg) { @@ -496,11 +496,11 @@ static void check_dropdown_(const char *file, UINT line, IAutoCompleteDropDown * static void test_aclist_expand(HWND hwnd_edit, void *enumerator, IAutoCompleteDropDown *acdropdown) { struct string_enumerator *obj = (struct string_enumerator*)enumerator; - static WCHAR str1[] = {'t','e','s','t',0}; - static WCHAR str1a[] = {'t','e','s','t','\',0}; - static WCHAR str2[] = {'t','e','s','t','\','f','o','o','\','b','a','r','\','b','a',0}; - static WCHAR str2a[] = {'t','e','s','t','\','f','o','o','\','b','a','r','\',0}; - static WCHAR str2b[] = {'t','e','s','t','\','f','o','o','\','b','a','r','\','b','a','z','_','b','b','q','\',0}; + static WCHAR str1[] = L"test"; + static WCHAR str1a[] = L"test\"; + static WCHAR str2[] = L"test\foo\bar\ba"; + static WCHAR str2a[] = L"test\foo\bar\"; + static WCHAR str2b[] = L"test\foo\bar\baz_bbq\"; HRESULT hr; obj->num_resets = 0;
@@ -564,21 +564,20 @@ static void test_aclist_expand(HWND hwnd_edit, void *enumerator, IAutoCompleteDr
static void test_prefix_filtering(HWND hwnd_edit) { - static WCHAR htt[] = {'h','t','t',0}; - static WCHAR www[] = {'w','w','w','.',0}; - static WCHAR str0[] = {'w','w','w','.','a','x',0}; - static WCHAR str1[] = {'h','t','t','p','s',':','/','/','w','w','w','.','a','c',0}; - static WCHAR str2[] = {'a','a',0}; - static WCHAR str3[] = {'a','b',0}; - static WCHAR str4[] = {'h','t','t','p',':','/','/','a','0',0}; - static WCHAR str5[] = {'h','t','t','p','s',':','/','/','h','t','a',0}; - static WCHAR str6[] = {'h','f','o','o',0}; - static WCHAR str7[] = {'h','t','t','p',':','/','/','w','w','w','.','a','d','d',0}; - static WCHAR str8[] = {'w','w','w','.','w','w','w','.','?',0}; - static WCHAR str9[] = {'h','t','t','p',':','/','/','a','b','c','.','a','a','.','c','o','m',0}; - static WCHAR str10[]= {'f','t','p',':','/','/','a','b','c',0}; - static WCHAR str11[]= {'f','i','l','e',':','/','/','a','a',0}; - static WCHAR str12[]= {'f','t','p',':','/','/','w','w','w','.','a','a',0}; + static WCHAR www[] = L"www."; + static WCHAR str0[] = L"www.ax"; + static WCHAR str1[] = L"https://www.ac"; + static WCHAR str2[] = L"aa"; + static WCHAR str3[] = L"ab"; + static WCHAR str4[] = L"http://a0"; + static WCHAR str5[] = L"https://hta"; + static WCHAR str6[] = L"hfoo"; + static WCHAR str7[] = L"http://www.add"; + static WCHAR str8[] = L"www.www.?"; + static WCHAR str9[] = L"http://abc.aa.com"; + static WCHAR str10[]= L"ftp://abc"; + static WCHAR str11[]= L"file://aa"; + static WCHAR str12[]= L"ftp://www.aa"; static WCHAR *suggestions[] = { str0, str1, str2, str3, str4, str5, str6, str7, str8, str9, str10, str11, str12 }; static WCHAR *sorted1[] = { str4, str2, str3, str9, str1, str7, str0 }; static WCHAR *sorted2[] = { str3, str9 }; @@ -654,7 +653,7 @@ static void test_prefix_filtering(HWND hwnd_edit) check_dropdown(acdropdown, hwnd_edit, sorted5, ARRAY_SIZE(sorted5)); SendMessageW(hwnd_edit, WM_CHAR, 't', 1); SendMessageW(hwnd_edit, WM_GETTEXT, ARRAY_SIZE(buffer), (LPARAM)buffer); - ok(lstrcmpW(htt, buffer) == 0, "Expected %s, got %s\n", wine_dbgstr_w(htt), wine_dbgstr_w(buffer)); + ok(lstrcmpW(L"htt", buffer) == 0, "Expected L"htt", got %s\n", wine_dbgstr_w(buffer)); check_dropdown(acdropdown, hwnd_edit, NULL, 0); SendMessageW(hwnd_edit, WM_CHAR, 'p', 1); SendMessageW(hwnd_edit, WM_CHAR, ':', 1); @@ -690,11 +689,11 @@ static void test_prefix_filtering(HWND hwnd_edit)
static void test_custom_source(void) { - static WCHAR str_alpha[] = {'t','e','s','t','1',0}; - static WCHAR str_alpha2[] = {'t','e','s','t','2',0}; - static WCHAR str_beta[] = {'a','u','t','o',' ','c','o','m','p','l','e','t','e',0}; - static WCHAR str_au[] = {'a','u',0}; - static WCHAR str_aut[] = {'a','u','t',0}; + static WCHAR str_alpha[] = L"test1"; + static WCHAR str_alpha2[] = L"test2"; + static WCHAR str_beta[] = L"auto complete"; + static WCHAR str_au[] = L"au"; + static WCHAR str_aut[] = L"aut"; static WCHAR *suggestions[] = { str_alpha, str_alpha2, str_beta }; struct string_enumerator *obj; IUnknown *enumerator; diff --git a/dlls/shell32/tests/ebrowser.c b/dlls/shell32/tests/ebrowser.c index 19eb1bc4cf6..ed8557697fd 100644 --- a/dlls/shell32/tests/ebrowser.c +++ b/dlls/shell32/tests/ebrowser.c @@ -988,7 +988,6 @@ static void test_basics(void) HDWP hdwp; RECT rc; HRESULT hr; - static const WCHAR winetest[] = {'W','i','n','e','T','e','s','t',0};
ebrowser_instantiate(&peb); ebrowser_initialize(peb); @@ -1090,7 +1089,7 @@ static void test_basics(void) /* SetPropertyBag */ hr = IExplorerBrowser_SetPropertyBag(peb, NULL); ok(hr == E_INVALIDARG, "Got 0x%08lx\n", hr); - hr = IExplorerBrowser_SetPropertyBag(peb, winetest); + hr = IExplorerBrowser_SetPropertyBag(peb, L"WineTest"); ok(hr == S_OK, "Got 0x%08lx\n", hr);
/* TODO: Test after browsing somewhere. */ @@ -1281,8 +1280,7 @@ static void test_navigation(void) LONG lres; WCHAR current_path[MAX_PATH]; WCHAR child_path[MAX_PATH]; - static const WCHAR testfolderW[] = - {'w','i','n','e','t','e','s','t','f','o','l','d','e','r','\0'}; + static WCHAR testfolderW[] = L"winetestfolder";
ok(pSHCreateShellItem != NULL, "pSHCreateShellItem unexpectedly missing.\n");
@@ -1362,8 +1360,7 @@ static void test_navigation(void)
hr = IFolderView_GetFolder(pfv, &IID_IShellFolder, (void**)&psf); ok(hr == S_OK, "Got 0x%08lx\n", hr); - hr = IShellFolder_ParseDisplayName(psf, NULL, NULL, (LPWSTR)testfolderW, - NULL, &pidl_relative, NULL); + hr = IShellFolder_ParseDisplayName(psf, NULL, NULL, testfolderW, NULL, &pidl_relative, NULL); ok(hr == S_OK, "Got 0x%08lx\n", hr);
/* Browsing to another location here before using the @@ -1676,13 +1673,12 @@ static BOOL test_instantiate_control(void) static void setup_window(void) { WNDCLASSW wc; - static const WCHAR ebtestW[] = {'e','b','t','e','s','t',0};
ZeroMemory(&wc, sizeof(WNDCLASSW)); wc.lpfnWndProc = DefWindowProcW; - wc.lpszClassName = ebtestW; + wc.lpszClassName = L"ebtest"; RegisterClassW(&wc); - hwnd = CreateWindowExW(0, ebtestW, NULL, 0, + hwnd = CreateWindowExW(0, L"ebtest", NULL, 0, 0, 0, 500, 500, NULL, 0, 0, NULL); ok(hwnd != NULL, "Failed to create window for tests.\n"); diff --git a/dlls/shell32/tests/shelldispatch.c b/dlls/shell32/tests/shelldispatch.c index 1038603551e..d6a64f27cea 100644 --- a/dlls/shell32/tests/shelldispatch.c +++ b/dlls/shell32/tests/shelldispatch.c @@ -40,8 +40,6 @@ static void _expect_ref(IUnknown *obj, ULONG ref, int line) ok_(__FILE__,line)(rc == ref, "Unexpected refcount %ld, expected %ld\n", rc, ref); }
-static const WCHAR winetestW[] = {'w','i','n','e','t','e','s','t',0}; - static HRESULT (WINAPI *pSHGetNameFromIDList)(PCIDLIST_ABSOLUTE,SIGDN,PWSTR*);
/* Updated Windows 7 has a new IShellDispatch6 in its typelib */ @@ -105,11 +103,7 @@ static void test_namespace(void) ssfPROGRAMFILESx86, };
- static const WCHAR backslashW[] = {'\',0}; - static const WCHAR clsidW[] = { - ':',':','{','6','4','5','F','F','0','4','0','-','5','0','8','1','-', - '1','0','1','B','-','9','F','0','8','-', - '0','0','A','A','0','0','2','F','9','5','4','E','}',0}; + static const WCHAR clsidW[] = L"::{645FF040-5081-101B-9F08-00AA002F954E}";
static WCHAR tempW[MAX_PATH], curW[MAX_PATH]; WCHAR *long_pathW = NULL; @@ -252,14 +246,14 @@ static void test_namespace(void) GetTempPathW(MAX_PATH, tempW); GetCurrentDirectoryW(MAX_PATH, curW); SetCurrentDirectoryW(tempW); - CreateDirectoryW(winetestW, NULL); + CreateDirectoryW(L"winetest", NULL); V_VT(&var) = VT_BSTR; - V_BSTR(&var) = SysAllocString(winetestW); + V_BSTR(&var) = SysAllocString(L"winetest"); r = IShellDispatch_NameSpace(sd, var, &folder); ok(r == S_FALSE, "expected S_FALSE, got %08lx\n", r); SysFreeString(V_BSTR(&var));
- GetFullPathNameW(winetestW, MAX_PATH, tempW, NULL); + GetFullPathNameW(L"winetest", MAX_PATH, tempW, NULL);
len = GetLongPathNameW(tempW, NULL, 0); long_pathW = malloc(len * sizeof(WCHAR)); @@ -277,7 +271,7 @@ static void test_namespace(void)
r = Folder_get_Title(folder, &title); ok(r == S_OK, "Failed to get folder title: %#lx.\n", r); - ok(!lstrcmpW(title, winetestW), "Unexpected title: %s\n", wine_dbgstr_w(title)); + ok(!lstrcmpW(title, L"winetest"), "Unexpected title: %s\n", wine_dbgstr_w(title)); SysFreeString(title);
r = Folder_QueryInterface(folder, &IID_Folder2, (void **)&folder2); @@ -297,7 +291,7 @@ static void test_namespace(void) len = lstrlenW(tempW); if (len < MAX_PATH - 1) { - lstrcatW(tempW, backslashW); + lstrcatW(tempW, L"\"); V_VT(&var) = VT_BSTR; V_BSTR(&var) = SysAllocString(tempW); r = IShellDispatch_NameSpace(sd, var, &folder); @@ -308,7 +302,7 @@ static void test_namespace(void) ok(r == S_OK, "Folder::get_Title failed: %08lx\n", r); if (r == S_OK) { - ok(!lstrcmpW(title, winetestW), "bad title: %s\n", + ok(!lstrcmpW(title, L"winetest"), "bad title: %s\n", wine_dbgstr_w(title)); SysFreeString(title); } @@ -335,7 +329,7 @@ static void test_namespace(void) }
free(long_pathW); - RemoveDirectoryW(winetestW); + RemoveDirectoryW(L"winetest"); SetCurrentDirectoryW(curW); IShellDispatch_Release(sd); } @@ -384,9 +378,9 @@ static void test_items(void) GetTempPathW(MAX_PATH, path); GetCurrentDirectoryW(MAX_PATH, orig_dir); SetCurrentDirectoryW(path); - ret = CreateDirectoryW(winetestW, NULL); + ret = CreateDirectoryW(L"winetest", NULL); ok(ret, "CreateDirectory failed: %08lx\n", GetLastError()); - GetFullPathNameW(winetestW, MAX_PATH, path, NULL); + GetFullPathNameW(L"winetest", MAX_PATH, path, NULL); V_VT(&var) = VT_BSTR; V_BSTR(&var) = SysAllocString(path);
@@ -398,7 +392,7 @@ static void test_items(void) EXPECT_REF(sd, 1);
VariantClear(&var); - SetCurrentDirectoryW(winetestW); + SetCurrentDirectoryW(L"winetest"); GetCurrentDirectoryW(MAX_PATH, path); GetLongPathNameW(path, cur_dir, MAX_PATH);
@@ -792,7 +786,7 @@ static void test_items(void) /* remove the temporary directory and restore the original working directory */ GetTempPathW(MAX_PATH, path); SetCurrentDirectoryW(path); - ret = RemoveDirectoryW(winetestW); + ret = RemoveDirectoryW(L"winetest"); ok(ret, "RemoveDirectory failed: %08lx\n", GetLastError()); SetCurrentDirectoryW(orig_dir);
@@ -824,8 +818,6 @@ static void test_items(void)
static void test_service(void) { - static const WCHAR spooler[] = {'S','p','o','o','l','e','r',0}; - static const WCHAR dummyW[] = {'d','u','m','m','y',0}; SERVICE_STATUS_PROCESS status; SC_HANDLE scm, service; IShellDispatch2 *sd; @@ -850,13 +842,13 @@ static void test_service(void) EXPECT_HR(hr, S_OK);
scm = OpenSCManagerW(NULL, NULL, SC_MANAGER_CONNECT); - service = OpenServiceW(scm, spooler, SERVICE_QUERY_STATUS); + service = OpenServiceW(scm, L"Spooler", SERVICE_QUERY_STATUS); QueryServiceStatusEx(service, SC_STATUS_PROCESS_INFO, (BYTE *)&status, sizeof(SERVICE_STATUS_PROCESS), &dummy); CloseServiceHandle(service); CloseServiceHandle(scm);
/* service should exist */ - name = SysAllocString(spooler); + name = SysAllocString(L"Spooler"); V_VT(&v) = VT_I2; hr = IShellDispatch2_IsServiceRunning(sd, name, &v); EXPECT_HR(hr, S_OK); @@ -868,7 +860,7 @@ static void test_service(void) SysFreeString(name);
/* service doesn't exist */ - name = SysAllocString(dummyW); + name = SysAllocString(L"dummy"); V_VT(&v) = VT_I2; hr = IShellDispatch2_IsServiceRunning(sd, name, &v); EXPECT_HR(hr, S_OK); @@ -1216,7 +1208,6 @@ if (hr == S_OK) {
static void test_ParseName(void) { - static const WCHAR cadabraW[] = {'c','a','d','a','b','r','a',0}; WCHAR pathW[MAX_PATH]; IShellDispatch *sd; FolderItem *item; @@ -1250,7 +1241,7 @@ static void test_ParseName(void) SysFreeString(str);
/* path doesn't exist */ - str = SysAllocString(cadabraW); + str = SysAllocString(L"cadabra"); item = (void*)0xdeadbeef; hr = Folder_ParseName(folder, str, &item); ok(hr == S_FALSE || broken(hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND)) /* win2k */, @@ -1258,10 +1249,10 @@ static void test_ParseName(void) ok(item == NULL, "got %p\n", item); SysFreeString(str);
- lstrcatW(pathW, cadabraW); + lstrcatW(pathW, L"cadabra"); CreateDirectoryW(pathW, NULL);
- str = SysAllocString(cadabraW); + str = SysAllocString(L"cadabra"); item = NULL; hr = Folder_ParseName(folder, str, &item); ok(hr == S_OK, "got 0x%08lx\n", hr); @@ -1544,8 +1535,6 @@ static void test_ShellExecute(void) BSTR name; VARIANT args, dir, op, show;
- static const WCHAR regW[] = {'r','e','g',0}; - hr = CoCreateInstance(&CLSID_Shell, NULL, CLSCTX_INPROC_SERVER, &IID_IShellDispatch2, (void**)&sd); if (hr != S_OK) @@ -1562,7 +1551,7 @@ static void test_ShellExecute(void) V_VT(&show) = VT_I4; V_I4(&show) = 0;
- name = SysAllocString(regW); + name = SysAllocString(L"reg");
hr = IShellDispatch2_ShellExecute(sd, name, args, dir, op, show); ok(hr == S_OK, "ShellExecute failed: %08lx\n", hr); diff --git a/dlls/shell32/tests/shelllink.c b/dlls/shell32/tests/shelllink.c index f13155ade2f..35773fde551 100644 --- a/dlls/shell32/tests/shelllink.c +++ b/dlls/shell32/tests/shelllink.c @@ -863,17 +863,9 @@ static void test_load_save(void)
static void test_datalink(void) { - static const WCHAR lnk[] = { - ':',':','{','9','d','b','1','1','8','6','e','-','4','0','d','f','-','1', - '1','d','1','-','a','a','8','c','-','0','0','c','0','4','f','b','6','7', - '8','6','3','}',':','2','6',',','!','!','g','x','s','f','(','N','g',']', - 'q','F','`','H','{','L','s','A','C','C','E','S','S','F','i','l','e','s', - '>','p','l','T',']','j','I','{','j','f','(','=','1','&','L','[','-','8', - '1','-',']',':',':',0 }; - static const WCHAR comp[] = { - '2','6',',','!','!','g','x','s','f','(','N','g',']','q','F','`','H','{', - 'L','s','A','C','C','E','S','S','F','i','l','e','s','>','p','l','T',']', - 'j','I','{','j','f','(','=','1','&','L','[','-','8','1','-',']',0 }; + static const WCHAR lnk[] = + L"::{9db1186e-40df-11d1-aa8c-00c04fb67863}:26,!!gxsf(Ng]qF`H{LsACCESSFiles>plT]jI{jf(=1&L[-81-]::"; + static const WCHAR comp[] = L"26,!!gxsf(Ng]qF`H{LsACCESSFiles>plT]jI{jf(=1&L[-81-]"; IShellLinkDataList *dl = NULL; IShellLinkW *sl = NULL; HRESULT r; @@ -1123,9 +1115,6 @@ static void test_SHGetStockIconInfo(void)
static void test_SHExtractIcons(void) { - static const WCHAR notepadW[] = {'n','o','t','e','p','a','d','.','e','x','e',0}; - static const WCHAR shell32W[] = {'s','h','e','l','l','3','2','.','d','l','l',0}; - static const WCHAR emptyW[] = {0}; UINT ret, ret2; HICON icons[256]; UINT ids[256], i; @@ -1136,44 +1125,44 @@ static void test_SHExtractIcons(void) return; }
- ret = pSHExtractIconsW(emptyW, 0, 16, 16, icons, ids, 1, 0); + ret = pSHExtractIconsW(L"", 0, 16, 16, icons, ids, 1, 0); ok(ret == ~0u, "got %u\n", ret);
- ret = pSHExtractIconsW(notepadW, 0, 16, 16, NULL, NULL, 1, 0); + ret = pSHExtractIconsW(L"notepad.exe", 0, 16, 16, NULL, NULL, 1, 0); ok(ret == 1 || ret == 4 /* win11 */, "got %u\n", ret);
icons[0] = (HICON)0xdeadbeef; - ret = pSHExtractIconsW(notepadW, 0, 16, 16, icons, NULL, 1, 0); + ret = pSHExtractIconsW(L"notepad.exe", 0, 16, 16, icons, NULL, 1, 0); ok(ret == 1, "got %u\n", ret); ok(icons[0] != (HICON)0xdeadbeef, "icon not set\n"); DestroyIcon(icons[0]);
icons[0] = (HICON)0xdeadbeef; ids[0] = 0xdeadbeef; - ret = pSHExtractIconsW(notepadW, 0, 16, 16, icons, ids, 1, 0); + ret = pSHExtractIconsW(L"notepad.exe", 0, 16, 16, icons, ids, 1, 0); ok(ret == 1, "got %u\n", ret); ok(icons[0] != (HICON)0xdeadbeef, "icon not set\n"); ok(ids[0] != 0xdeadbeef, "id not set\n"); DestroyIcon(icons[0]);
- ret = pSHExtractIconsW(shell32W, 0, 16, 16, NULL, NULL, 0, 0); - ret2 = pSHExtractIconsW(shell32W, 4, MAKELONG(32,16), MAKELONG(32,16), NULL, NULL, 256, 0); + ret = pSHExtractIconsW(L"shell32.dll", 0, 16, 16, NULL, NULL, 0, 0); + ret2 = pSHExtractIconsW(L"shell32.dll", 4, MAKELONG(32,16), MAKELONG(32,16), NULL, NULL, 256, 0); ok(ret && ret == ret2, "icon count should be independent of requested icon sizes and base icon index\n");
- ret = pSHExtractIconsW(shell32W, 0, 16, 16, icons, ids, 0, 0); + ret = pSHExtractIconsW(L"shell32.dll", 0, 16, 16, icons, ids, 0, 0); ok(ret == ~0u || !ret /* < vista */, "got %u\n", ret);
- ret = pSHExtractIconsW(shell32W, 0, 16, 16, icons, ids, 3, 0); + ret = pSHExtractIconsW(L"shell32.dll", 0, 16, 16, icons, ids, 3, 0); ok(ret == 3, "got %u\n", ret); for (i = 0; i < ret; i++) DestroyIcon(icons[i]);
/* count must be a multiple of two when getting two sizes */ - ret = pSHExtractIconsW(shell32W, 0, MAKELONG(16,32), MAKELONG(16,32), icons, ids, 3, 0); + ret = pSHExtractIconsW(L"shell32.dll", 0, MAKELONG(16,32), MAKELONG(16,32), icons, ids, 3, 0); ok(!ret /* vista */ || ret == 4, "got %u\n", ret); for (i = 0; i < ret; i++) DestroyIcon(icons[i]);
- ret = pSHExtractIconsW(shell32W, 0, MAKELONG(16,32), MAKELONG(16,32), icons, ids, 4, 0); + ret = pSHExtractIconsW(L"shell32.dll", 0, MAKELONG(16,32), MAKELONG(16,32), icons, ids, 4, 0); ok(ret == 4, "got %u\n", ret); for (i = 0; i < ret; i++) DestroyIcon(icons[i]); } @@ -1215,9 +1204,6 @@ static void test_propertystore(void)
static void test_ExtractIcon(void) { - static const WCHAR nameW[] = {'\','e','x','t','r','a','c','t','i','c','o','n','_','t','e','s','t','.','t','x','t',0}; - static const WCHAR shell32W[] = {'s','h','e','l','l','3','2','.','d','l','l',0}; - static const WCHAR emptyW[] = {0}; WCHAR pathW[MAX_PATH]; HICON hicon, hicon2; char path[MAX_PATH]; @@ -1278,11 +1264,11 @@ if (0) hicon = ExtractIconW(GetModuleHandleA("shell32.dll"), NULL, 0); ok(hicon == NULL, "Got icon %p\n", hicon); } - hicon2 = ExtractIconW(GetModuleHandleA("shell32.dll"), shell32W, -1); + hicon2 = ExtractIconW(GetModuleHandleA("shell32.dll"), L"shell32.dll", -1); ok(hicon2 != NULL, "Got icon %p\n", hicon2);
/* existing index */ - hicon = ExtractIconW(NULL, shell32W, 0); + hicon = ExtractIconW(NULL, L"shell32.dll", 0); ok(hicon != NULL && HandleToLong(hicon) != -1, "Got icon %p\n", hicon); GetIconInfo(hicon, &info); GetObjectW(info.hbmColor, sizeof(bm), &bm); @@ -1291,16 +1277,16 @@ if (0) DestroyIcon(hicon);
/* returns number of resources */ - hicon = ExtractIconW(NULL, shell32W, -1); + hicon = ExtractIconW(NULL, L"shell32.dll", -1); ok(HandleToLong(hicon) > 1 && hicon == hicon2, "Got icon %p\n", hicon);
/* invalid index, valid dll name */ - hicon = ExtractIconW(NULL, shell32W, 3000); + hicon = ExtractIconW(NULL, L"shell32.dll", 3000); ok(hicon == NULL, "Got icon %p\n", hicon);
/* Create a temporary non-executable file */ GetTempPathW(ARRAY_SIZE(pathW), pathW); - lstrcatW(pathW, nameW); + lstrcatW(pathW, L"\extracticon_test.txt"); file = CreateFileW(pathW, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); ok(file != INVALID_HANDLE_VALUE, "Failed to create a test file\n"); CloseHandle(file); @@ -1318,10 +1304,10 @@ if (0) ok(r, "failed to delete file %s (%ld)\n", path, GetLastError());
/* Empty file path */ - hicon = ExtractIconW(NULL, emptyW, -1); + hicon = ExtractIconW(NULL, L"", -1); ok(hicon == NULL, "Got icon %p\n", hicon);
- hicon = ExtractIconW(NULL, emptyW, 0); + hicon = ExtractIconW(NULL, L"", 0); ok(hicon == NULL, "Got icon %p\n", hicon); }
diff --git a/dlls/shell32/tests/shellole.c b/dlls/shell32/tests/shellole.c index 5efdb035859..dbe704864a5 100644 --- a/dlls/shell32/tests/shellole.c +++ b/dlls/shell32/tests/shellole.c @@ -972,10 +972,8 @@ static void test_DragQueryFile(BOOL non_client_flag)
static void test_SHCreateSessionKey(void) { - static const WCHAR session_format[] = { - 'S','o','f','t','w','a','r','e','\','M','i','c','r','o','s','o','f','t','\', - 'W','i','n','d','o','w','s','\','C','u','r','r','e','n','t','V','e','r','s','i','o','n','\', - 'E','x','p','l','o','r','e','r','\','S','e','s','s','i','o','n','I','n','f','o','\','%','u',0}; + static const WCHAR session_format[] = + L"Software\Microsoft\Windows\CurrentVersion\Explorer\SessionInfo\%u"; HKEY hkey, hkey2; HRESULT hr; DWORD session; diff --git a/dlls/shell32/tests/shellpath.c b/dlls/shell32/tests/shellpath.c index 2d9450652a1..1f50640a25e 100644 --- a/dlls/shell32/tests/shellpath.c +++ b/dlls/shell32/tests/shellpath.c @@ -2165,13 +2165,6 @@ static void check_known_folder(IKnownFolderManager *mgr, KNOWNFOLDERID *folderId
static void test_knownFolders(void) { - static const WCHAR sWindows[] = {'W','i','n','d','o','w','s',0}; - static const WCHAR sWindows2[] = {'w','i','n','d','o','w','s',0}; - static const WCHAR sExample[] = {'E','x','a','m','p','l','e',0}; - static const WCHAR sExample2[] = {'E','x','a','m','p','l','e','2',0}; - static const WCHAR sSubFolder[] = {'S','u','b','F','o','l','d','e','r',0}; - static const WCHAR sNoSuch[] = {'N','o','S','u','c','h',0}; - static const WCHAR sBackslash[] = {'\',0}; static const KNOWNFOLDERID newFolderId = {0x01234567, 0x89AB, 0xCDEF, {0xFE, 0xDC, 0xBA, 0x98, 0x76, 0x54, 0x32, 0x01} }; static const KNOWNFOLDERID subFolderId = {0xFEDCBA98, 0x7654, 0x3210, {0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF} }; HRESULT hr; @@ -2191,18 +2184,16 @@ static void test_knownFolders(void) GetWindowsDirectoryW( sWinDir, MAX_PATH );
GetTempPathW(ARRAY_SIZE(sExamplePath), sExamplePath); - lstrcatW(sExamplePath, sExample); + lstrcatW(sExamplePath, L"Example");
GetTempPathW(ARRAY_SIZE(sExample2Path), sExample2Path); - lstrcatW(sExample2Path, sExample2); + lstrcatW(sExample2Path, L"Example2");
lstrcpyW(sSubFolderPath, sExamplePath); - lstrcatW(sSubFolderPath, sBackslash); - lstrcatW(sSubFolderPath, sSubFolder); + lstrcatW(sSubFolderPath, L"\SubFolder");
lstrcpyW(sSubFolder2Path, sExample2Path); - lstrcatW(sSubFolder2Path, sBackslash); - lstrcatW(sSubFolder2Path, sSubFolder); + lstrcatW(sSubFolder2Path, L"\SubFolder");
CoInitialize(NULL);
@@ -2261,7 +2252,7 @@ static void test_knownFolders(void) if(SUCCEEDED(hr)) { ok(kfDefinition.category==KF_CATEGORY_FIXED, "invalid folder category: 0x%08x\n", kfDefinition.category); - ok(lstrcmpW(kfDefinition.pszName, sWindows)==0, "invalid folder name: %s\n", wine_dbgstr_w(kfDefinition.pszName)); + ok(lstrcmpW(kfDefinition.pszName, L"Windows")==0, "invalid folder name: %s\n", wine_dbgstr_w(kfDefinition.pszName)); ok(kfDefinition.dwAttributes==0, "invalid folder attributes: %ld\n", kfDefinition.dwAttributes); FreeKnownFolderDefinitionFields(&kfDefinition); } @@ -2270,7 +2261,7 @@ static void test_knownFolders(void) ok(hr == S_OK, "failed to release KnownFolder instance: 0x%08lx\n", hr); }
- hr = IKnownFolderManager_GetFolderByName(mgr, sWindows, &folder); + hr = IKnownFolderManager_GetFolderByName(mgr, L"Windows", &folder); ok(hr == S_OK, "failed to get known folder: 0x%08lx\n", hr); if(SUCCEEDED(hr)) { @@ -2282,7 +2273,7 @@ static void test_knownFolders(void) ok(hr == S_OK, "failed to release KnownFolder instance: 0x%08lx\n", hr); }
- hr = IKnownFolderManager_GetFolderByName(mgr, sWindows2, &folder); + hr = IKnownFolderManager_GetFolderByName(mgr, L"windows", &folder); ok(hr == S_OK, "failed to get known folder: 0x%08lx\n", hr); if(SUCCEEDED(hr)) { @@ -2295,7 +2286,7 @@ static void test_knownFolders(void) }
folder = (IKnownFolder *)0xdeadbeef; - hr = IKnownFolderManager_GetFolderByName(mgr, sNoSuch, &folder); + hr = IKnownFolderManager_GetFolderByName(mgr, L"NoSuch", &folder); ok(hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), "got 0x%08lx\n", hr); ok(folder == NULL, "got %p\n", folder);
@@ -2323,10 +2314,10 @@ static void test_knownFolders(void)
ZeroMemory(&kfDefinition, sizeof(kfDefinition)); kfDefinition.category = KF_CATEGORY_PERUSER; - kfDefinition.pszName = CoTaskMemAlloc(sizeof(sExample)); - lstrcpyW(kfDefinition.pszName, sExample); - kfDefinition.pszDescription = CoTaskMemAlloc(sizeof(sExample)); - lstrcpyW(kfDefinition.pszDescription, sExample); + kfDefinition.pszName = CoTaskMemAlloc(sizeof(L"Example")); + lstrcpyW(kfDefinition.pszName, L"Example"); + kfDefinition.pszDescription = CoTaskMemAlloc(sizeof(L"Example")); + lstrcpyW(kfDefinition.pszDescription, L"Example"); kfDefinition.pszRelativePath = CoTaskMemAlloc(sizeof(sExamplePath)); lstrcpyW(kfDefinition.pszRelativePath, sExamplePath);
@@ -2359,12 +2350,12 @@ static void test_knownFolders(void) /* register sub-folder and mark it as child of Example folder */ ZeroMemory(&kfSubDefinition, sizeof(kfSubDefinition)); kfSubDefinition.category = KF_CATEGORY_PERUSER; - kfSubDefinition.pszName = CoTaskMemAlloc(sizeof(sSubFolder)); - lstrcpyW(kfSubDefinition.pszName, sSubFolder); - kfSubDefinition.pszDescription = CoTaskMemAlloc(sizeof(sSubFolder)); - lstrcpyW(kfSubDefinition.pszDescription, sSubFolder); - kfSubDefinition.pszRelativePath = CoTaskMemAlloc(sizeof(sSubFolder)); - lstrcpyW(kfSubDefinition.pszRelativePath, sSubFolder); + kfSubDefinition.pszName = CoTaskMemAlloc(sizeof(L"SubFolder")); + lstrcpyW(kfSubDefinition.pszName, L"SubFolder"); + kfSubDefinition.pszDescription = CoTaskMemAlloc(sizeof(L"SubFolder")); + lstrcpyW(kfSubDefinition.pszDescription, L"SubFolder"); + kfSubDefinition.pszRelativePath = CoTaskMemAlloc(sizeof(L"SubFolder")); + lstrcpyW(kfSubDefinition.pszRelativePath, L"SubFolder"); kfSubDefinition.fidParent = newFolderId;
hr = IKnownFolderManager_RegisterFolder(mgr, &subFolderId, &kfSubDefinition); @@ -2614,8 +2605,8 @@ static void test_knownFolders(void)
/* update the folder */ CoTaskMemFree(kfDefinition.pszName); - kfDefinition.pszName = CoTaskMemAlloc(sizeof(sExample2)); - lstrcpyW(kfDefinition.pszName, sExample2); + kfDefinition.pszName = CoTaskMemAlloc(sizeof(L"Example2")); + lstrcpyW(kfDefinition.pszName, L"Example2"); hr = IKnownFolderManager_RegisterFolder(mgr, &newFolderId, &kfDefinition); ok(hr == S_OK, "failed to re-register known folder: 0x%08lx\n", hr);
@@ -2624,7 +2615,7 @@ static void test_knownFolders(void)
hr = IKnownFolder_GetFolderDefinition(folder, &kfSubDefinition); ok(hr == S_OK, "failed to get folder definition: 0x%08lx\n", hr); - ok(!memcmp(kfDefinition.pszName, kfSubDefinition.pszName, sizeof(sExample2)), + ok(!memcmp(kfDefinition.pszName, kfSubDefinition.pszName, sizeof(L"Example2")), "Got wrong updated name: %s\n", wine_dbgstr_w(kfSubDefinition.pszName));
FreeKnownFolderDefinitionFields(&kfSubDefinition); @@ -2661,8 +2652,6 @@ static void test_DoEnvironmentSubst(void) DWORD res2; DWORD len; INT i; - static const WCHAR does_not_existW[] = {'%','D','O','E','S','_','N','O','T','_','E','X','I','S','T','%',0}; - static const CHAR does_not_existA[] = "%DOES_NOT_EXIST%"; static const CHAR *names[] = { /* interactive apps and services (works on all windows versions) */ "%ALLUSERSPROFILE%", "%APPDATA%", "%LOCALAPPDATA%", @@ -2779,21 +2768,21 @@ static void test_DoEnvironmentSubst(void) /* result: TRUE / string length including terminating 0 / the buffer is untouched */ memset(bufferA, '#', MAX_PATH - 1); bufferA[MAX_PATH - 1] = 0; - lstrcpyA(bufferA, does_not_existA); + lstrcpyA(bufferA, "%DOES_NOT_EXIST%"); MultiByteToWideChar(CP_ACP, 0, bufferA, MAX_PATH, bufferW, ARRAY_SIZE(bufferW));
- res2 = lstrlenA(does_not_existA) + 1; + res2 = sizeof("%DOES_NOT_EXIST%"); res = DoEnvironmentSubstA(bufferA, MAX_PATH); ok(HIWORD(res) && (LOWORD(res) == res2), "%d: got %d/%d (expected TRUE/%ld)\n", i, HIWORD(res), LOWORD(res), res2); - ok(!lstrcmpA(bufferA, does_not_existA), - "%d: got %s (expected %s)\n", i, bufferA, does_not_existA); + ok(!lstrcmpA(bufferA, "%DOES_NOT_EXIST%"), + "%d: got %s (expected %s)\n", i, bufferA, "%DOES_NOT_EXIST%");
res = DoEnvironmentSubstW(bufferW, MAX_PATH); ok(HIWORD(res) && (LOWORD(res) == res2), "%d: got %d/%d (expected TRUE/%ld)\n", i, HIWORD(res), LOWORD(res), res2); - ok(!lstrcmpW(bufferW, does_not_existW), - "%d: got %s (expected %s)\n", i, wine_dbgstr_w(bufferW), wine_dbgstr_w(does_not_existW)); + ok(!lstrcmpW(bufferW, L"%DOES_NOT_EXIST%"), + "%d: got %s (expected %s)\n", i, wine_dbgstr_w(bufferW), wine_dbgstr_w(L"%DOES_NOT_EXIST%"));
if (0) @@ -2806,11 +2795,6 @@ static void test_DoEnvironmentSubst(void)
static void test_PathYetAnotherMakeUniqueName(void) { - static const WCHAR shortW[] = {'f','i','l','e','.','t','s','t',0}; - static const WCHAR short2W[] = {'f','i','l','e',' ','(','2',')','.','t','s','t',0}; - static const WCHAR tmpW[] = {'t','m','p',0}; - static const WCHAR longW[] = {'n','a','m','e',0}; - static const WCHAR long2W[] = {'n','a','m','e',' ','(','2',')',0}; WCHAR nameW[MAX_PATH], buffW[MAX_PATH], pathW[MAX_PATH]; HANDLE file; BOOL ret; @@ -2835,10 +2819,10 @@ if (0)
/* Using short name only first */ nameW[0] = 0; - ret = pPathYetAnotherMakeUniqueName(nameW, pathW, shortW, NULL); + ret = pPathYetAnotherMakeUniqueName(nameW, pathW, L"file.tst", NULL); ok(ret, "got %d\n", ret); lstrcpyW(buffW, pathW); - lstrcatW(buffW, shortW); + lstrcatW(buffW, L"file.tst"); ok(!lstrcmpW(nameW, buffW), "got %s, expected %s\n", wine_dbgstr_w(nameW), wine_dbgstr_w(buffW));
/* now create a file with this name and get next name */ @@ -2846,40 +2830,40 @@ if (0) ok(file != NULL, "got %p\n", file);
nameW[0] = 0; - ret = pPathYetAnotherMakeUniqueName(nameW, pathW, shortW, NULL); + ret = pPathYetAnotherMakeUniqueName(nameW, pathW, L"file.tst", NULL); ok(ret, "got %d\n", ret); lstrcpyW(buffW, pathW); - lstrcatW(buffW, short2W); + lstrcatW(buffW, L"file (2).tst"); ok(!lstrcmpW(nameW, buffW), "got %s, expected %s\n", wine_dbgstr_w(nameW), wine_dbgstr_w(buffW));
CloseHandle(file);
/* Using short and long */ nameW[0] = 0; - ret = pPathYetAnotherMakeUniqueName(nameW, pathW, tmpW, longW); + ret = pPathYetAnotherMakeUniqueName(nameW, pathW, L"tmp", L"name"); ok(ret, "got %d\n", ret); lstrcpyW(buffW, pathW); - lstrcatW(buffW, longW); + lstrcatW(buffW, L"name"); ok(!lstrcmpW(nameW, buffW), "got %s, expected %s\n", wine_dbgstr_w(nameW), wine_dbgstr_w(buffW));
file = CreateFileW(nameW, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_FLAG_DELETE_ON_CLOSE, NULL); ok(file != NULL, "got %p\n", file);
nameW[0] = 0; - ret = pPathYetAnotherMakeUniqueName(nameW, pathW, tmpW, longW); + ret = pPathYetAnotherMakeUniqueName(nameW, pathW, L"tmp", L"name"); ok(ret, "got %d\n", ret); lstrcpyW(buffW, pathW); - lstrcatW(buffW, long2W); + lstrcatW(buffW, L"name (2)"); ok(!lstrcmpW(nameW, buffW), "got %s, expected %s\n", wine_dbgstr_w(nameW), wine_dbgstr_w(buffW));
CloseHandle(file);
/* Using long only */ nameW[0] = 0; - ret = pPathYetAnotherMakeUniqueName(nameW, pathW, NULL, longW); + ret = pPathYetAnotherMakeUniqueName(nameW, pathW, NULL, L"name"); ok(ret, "got %d\n", ret); lstrcpyW(buffW, pathW); - lstrcatW(buffW, longW); + lstrcatW(buffW, L"name"); ok(!lstrcmpW(nameW, buffW), "got %s, expected %s\n", wine_dbgstr_w(nameW), wine_dbgstr_w(buffW)); }
diff --git a/dlls/shell32/tests/shfldr_special.c b/dlls/shell32/tests/shfldr_special.c index 61b6a9309bc..3d21bfed6a9 100644 --- a/dlls/shell32/tests/shfldr_special.c +++ b/dlls/shell32/tests/shfldr_special.c @@ -39,7 +39,7 @@ static inline BOOL SHELL_OsIsUnicode(void) /* Tests for My Computer */ static void test_parse_for_my_computer(void) { - WCHAR path[] = { '\','\','?','\','C',':','\',0 }; + WCHAR path[] = L"\\?\C:\"; IShellFolder *mycomp, *sf; WCHAR *drive = path + 4; ITEMIDLIST *pidl; @@ -107,13 +107,8 @@ done: /* Tests for My Network Places */ static void test_parse_for_entire_network(void) { - static WCHAR my_network_places_path[] = { - ':',':','{','2','0','8','D','2','C','6','0','-','3','A','E','A','-', - '1','0','6','9','-','A','2','D','7','-','0','8','0','0','2','B','3','0','3','0','9','D','}', 0 }; - static WCHAR entire_network_path[] = { - ':',':','{','2','0','8','D','2','C','6','0','-','3','A','E','A','-', - '1','0','6','9','-','A','2','D','7','-','0','8','0','0','2','B','3','0','3','0','9','D', - '}','\','E','n','t','i','r','e','N','e','t','w','o','r','k',0 }; + static WCHAR my_network_places_path[] = L"::{208D2C60-3AEA-1069-A2D7-08002B30309D}"; + static WCHAR entire_network_path[] = L"::{208D2C60-3AEA-1069-A2D7-08002B30309D}\EntireNetwork"; IShellFolder *psfDesktop; HRESULT hr; DWORD eaten = 0xdeadbeef; @@ -168,9 +163,8 @@ static void test_parse_for_entire_network(void) static void test_parse_for_control_panel(void) { /* path of My Computer\Control Panel */ - static WCHAR control_panel_path[] = { - ':',':','{','2','0','D','0','4','F','E','0','-','3','A','E','A','-','1','0','6','9','-','A','2','D','8','-','0','8','0','0','2','B','3','0','3','0','9','D','}','\', - ':',':','{','2','1','E','C','2','0','2','0','-','3','A','E','A','-','1','0','6','9','-','A','2','D','D','-','0','8','0','0','2','B','3','0','3','0','9','D','}', 0 }; + static WCHAR control_panel_path[] = + L"::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\::{21EC2020-3AEA-1069-A2DD-08002B30309D}"; IShellFolder *psfDesktop; HRESULT hr; DWORD eaten = 0xdeadbeef; @@ -306,11 +300,10 @@ static void test_desktop_folder(void)
static void test_desktop_displaynameof(void) { - static WCHAR MyComputer[] = { ':',':','{','2','0','D','0','4','F','E','0','-','3','A','E','A','-','1','0','6','9','-','A','2','D','8','-','0','8','0','0','2','B','3','0','3','0','9','D','}', 0 }; - static WCHAR MyDocuments[] = { ':',':','{','4','5','0','D','8','F','B','A','-','A','D','2','5','-','1','1','D','0','-','9','8','A','8','-','0','8','0','0','3','6','1','B','1','1','0','3','}', 0 }; - static WCHAR RecycleBin[] = { ':',':','{','6','4','5','F','F','0','4','0','-','5','0','8','1','-','1','0','1','B','-','9','F','0','8','-','0','0','A','A','0','0','2','F','9','5','4','E','}', 0 }; - static WCHAR ControlPanel[]= { ':',':','{','2','0','D','0','4','F','E','0','-','3','A','E','A','-','1','0','6','9','-','A','2','D','8','-','0','8','0','0','2','B','3','0','3','0','9','D','}','\', - ':',':','{','2','1','E','C','2','0','2','0','-','3','A','E','A','-','1','0','6','9','-','A','2','D','D','-','0','8','0','0','2','B','3','0','3','0','9','D','}', 0 }; + static WCHAR MyComputer[] = L"::{20D04FE0-3AEA-1069-A2D8-08002B30309D}"; + static WCHAR MyDocuments[] = L"::{450D8FBA-AD25-11D0-98A8-0800361B1103}"; + static WCHAR RecycleBin[] = L"::{645FF040-5081-101B-9F08-00AA002F954E}"; + static WCHAR ControlPanel[]= L"::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\::{21EC2020-3AEA-1069-A2DD-08002B30309D}"; static WCHAR *folders[] = { MyComputer, MyDocuments, RecycleBin, ControlPanel }; IShellFolder *desktop; ITEMIDLIST *pidl; diff --git a/dlls/shell32/tests/shlexec.c b/dlls/shell32/tests/shlexec.c index 9579e18a531..336dfbef4fe 100644 --- a/dlls/shell32/tests/shlexec.c +++ b/dlls/shell32/tests/shlexec.c @@ -1388,7 +1388,6 @@ static BOOL test_one_cmdline(const cmdline_tests_t* test)
static void test_commandline2argv(void) { - static const WCHAR exeW[] = {'e','x','e',0}; const cmdline_tests_t* test; WCHAR strW[MAX_PATH]; LPWSTR *args; @@ -1404,7 +1403,7 @@ static void test_commandline2argv(void) }
SetLastError(0xdeadbeef); - args = CommandLineToArgvW(exeW, NULL); + args = CommandLineToArgvW(L"exe", NULL); le = GetLastError(); ok(args == NULL && le == ERROR_INVALID_PARAMETER, "expected NULL with ERROR_INVALID_PARAMETER got %p with %lu\n", args, le);
diff --git a/dlls/shell32/tests/shlfileop.c b/dlls/shell32/tests/shlfileop.c index 828637b39d1..af2bb3ac92c 100644 --- a/dlls/shell32/tests/shlfileop.c +++ b/dlls/shell32/tests/shlfileop.c @@ -49,7 +49,7 @@ static BOOL old_shell32 = FALSE;
static CHAR CURR_DIR[MAX_PATH]; -static const WCHAR UNICODE_PATH[] = {'c',':','\',0x00ae,'\0','\0'}; +static const WCHAR UNICODE_PATH[] = L"c:\\x00ae\0"; /* "c:\®" can be used in all codepages */ /* Double-null termination needed for pFrom field of SHFILEOPSTRUCT */
@@ -2323,7 +2323,7 @@ static void test_unicode(void) SHFILEOPSTRUCTW shfoW; int ret; HANDLE file; - static const WCHAR UNICODE_PATH_TO[] = {'c',':','\',0x00ae,0x00ae,'\0'}; + static const WCHAR UNICODE_PATH_TO[] = L"c:\\x00ae\x00ae"; HWND hwnd;
shfoW.hwnd = NULL; diff --git a/dlls/shell32/tests/shlfolder.c b/dlls/shell32/tests/shlfolder.c index f1cae84257a..ae9fbfa3a6b 100644 --- a/dlls/shell32/tests/shlfolder.c +++ b/dlls/shell32/tests/shlfolder.c @@ -198,31 +198,30 @@ static struct HRESULT hr; int todo; } parse_tests[] = { - {{'c',':','\',0}, S_OK}, - {{'c',':','\','\',0}, E_INVALIDARG, 1}, - {{'c',':','\','f','a','k','e',0}, 0x80070002}, /* ERROR_FILE_NOT_FOUND */ - {{'c',':','f','a','k','e',0}, E_INVALIDARG}, - {{'c',':','/',0}, E_INVALIDARG}, - {{'c',':','\','w','i','n','d','o','w','s',0}, S_OK}, - {{'c',':','\','w','i','n','d','o','w','s','\',0}, S_OK}, - {{'c',':','\','w','i','n','d','o','w','s','\','.',0}, E_INVALIDARG, 1}, - {{'c',':','\','w','i','n','d','o','w','s','\','.','.',0}, E_INVALIDARG, 1}, - {{'.',0}, E_INVALIDARG, 1}, - {{'.','.',0}, E_INVALIDARG, 1}, - {{'t','e','s','t',0}, 0x80070002}, - {{'t','e','s','t','\',0}, 0x80070002}, - {{'s','u','b','\','d','i','r',0}, 0x80070002}, - {{'s','u','b','/','d','i','r',0}, E_INVALIDARG, 1}, - {{'h','t','t','p',':',0}, S_OK, 1}, - {{'h','t','t','p',':','t','e','s','t',0}, S_OK, 1}, - {{'h','t','t','p',':','\','t','e','s','t',0}, S_OK, 1}, - {{'x','x',':',0}, S_OK, 1}, + {L"c:\", S_OK}, + {L"c:\\", E_INVALIDARG, 1}, + {L"c:\fake", 0x80070002}, /* ERROR_FILE_NOT_FOUND */ + {L"c:fake", E_INVALIDARG}, + {L"c:/", E_INVALIDARG}, + {L"c:\windows", S_OK}, + {L"c:\windows\", S_OK}, + {L"c:\windows\.", E_INVALIDARG, 1}, + {L"c:\windows\..", E_INVALIDARG, 1}, + {L".", E_INVALIDARG, 1}, + {L"..", E_INVALIDARG, 1}, + {L"test", 0x80070002}, + {L"test\", 0x80070002}, + {L"sub\dir", 0x80070002}, + {L"sub/dir", E_INVALIDARG, 1}, + {L"http:", S_OK, 1}, + {L"http:test", S_OK, 1}, + {L"http:\test", S_OK, 1}, + {L"xx:", S_OK, 1}, };
static void test_ParseDisplayName(void) { - static WCHAR testdirW[] = {'p','a','r','s','e','t','e','s','t',0}; - static WCHAR backslashW[] = {'\',0}; + static WCHAR testdirW[] = L"parsetest"; WCHAR buffer[MAX_PATH], buffer2[MAX_PATH]; IShellFolder *desktop; ITEMIDLIST *pidl; @@ -281,7 +280,7 @@ static void test_ParseDisplayName(void) ok(hr == S_OK, "got %#lx\n", hr);
ok(SHGetPathFromIDListW(pidl, buffer2), "SHGetPathFromIDList failed\n"); - lstrcatW(buffer, backslashW); + lstrcatW(buffer, L"\"); lstrcatW(buffer, testdirW); ok(!lstrcmpW(buffer, buffer2), "expected %s, got %s\n", wine_dbgstr_w(buffer), wine_dbgstr_w(buffer2));
@@ -439,9 +438,7 @@ static void test_BindToObject(void) WCHAR path[MAX_PATH]; CHAR pathA[MAX_PATH]; HANDLE hfile; - WCHAR wszMyComputer[] = { - ':',':','{','2','0','D','0','4','F','E','0','-','3','A','E','A','-','1','0','6','9','-', - 'A','2','D','8','-','0','8','0','0','2','B','3','0','3','0','9','D','}',0 }; + WCHAR wszMyComputer[] = L"::{20D04FE0-3AEA-1069-A2D8-08002B30309D}"; static const CHAR filename_html[] = "winetest.html"; static const CHAR filename_txt[] = "winetest.txt"; static const CHAR filename_foo[] = "winetest.foo"; @@ -663,12 +660,9 @@ static void test_GetDisplayName(void) SHITEMID emptyitem = { 0, { 0 } }; LPITEMIDLIST pidlTestFile, pidlEmpty = (LPITEMIDLIST)&emptyitem; LPCITEMIDLIST pidlLast; - static const CHAR szFileName[] = "winetest.foo"; - static const WCHAR wszFileName[] = { 'w','i','n','e','t','e','s','t','.','f','o','o',0 }; - static const WCHAR wszDirName[] = { 'w','i','n','e','t','e','s','t',0 };
/* It's ok to use this fixed path. Call will fail anyway. */ - WCHAR wszAbsoluteFilename[] = { 'C',':','\','w','i','n','e','t','e','s','t', 0 }; + WCHAR wszAbsoluteFilename[] = L"C:\winetest"; LPITEMIDLIST pidlNew;
/* I'm trying to figure if there is a functional difference between calling @@ -695,8 +689,7 @@ static void test_GetDisplayName(void) }
lstrcpyA(szTestFile, szTestDir); - lstrcatA(szTestFile, "\"); - lstrcatA(szTestFile, szFileName); + lstrcatA(szTestFile, "\winetest.foo"); hTestFile = CreateFileA(szTestFile, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL); ok((hTestFile != INVALID_HANDLE_VALUE), "CreateFileA failed! Last error: %lu\n", GetLastError()); if (hTestFile == INVALID_HANDLE_VALUE) return; @@ -719,15 +712,15 @@ static void test_GetDisplayName(void) pidlLast = ILFindLastID(pidlTestFile); ok(pidlLast->mkid.cb >= 76, "Expected pidl length of at least 76, got %d.\n", pidlLast->mkid.cb); if (pidlLast->mkid.cb >= 28) { - ok(!lstrcmpA((CHAR*)&pidlLast->mkid.abID[12], szFileName), + ok(!lstrcmpA((char*)&pidlLast->mkid.abID[12], "winetest.foo"), "Filename should be stored as ansi-string at this position!\n"); } /* WinXP and up store the filenames as both ANSI and UNICODE in the pidls */ if (pidlLast->mkid.cb >= 76) { - ok(!lstrcmpW((WCHAR*)&pidlLast->mkid.abID[46], wszFileName) || - (pidlLast->mkid.cb >= 94 && !lstrcmpW((WCHAR*)&pidlLast->mkid.abID[64], wszFileName)) || /* Vista */ - (pidlLast->mkid.cb >= 98 && !lstrcmpW((WCHAR*)&pidlLast->mkid.abID[68], wszFileName)) || /* Win7 */ - (pidlLast->mkid.cb >= 102 && !lstrcmpW((WCHAR*)&pidlLast->mkid.abID[72], wszFileName)), /* Win8 */ + ok(!lstrcmpW((WCHAR*)&pidlLast->mkid.abID[46], L"winetest.foo") || + (pidlLast->mkid.cb >= 94 && !lstrcmpW((WCHAR*)&pidlLast->mkid.abID[64], L"winetest.foo")) || /* Vista */ + (pidlLast->mkid.cb >= 98 && !lstrcmpW((WCHAR*)&pidlLast->mkid.abID[68], L"winetest.foo")) || /* Win7 */ + (pidlLast->mkid.cb >= 102 && !lstrcmpW((WCHAR*)&pidlLast->mkid.abID[72], L"winetest.foo")), /* Win8 */ "Filename should be stored as wchar-string at this position!\n"); }
@@ -746,7 +739,7 @@ static void test_GetDisplayName(void) ok(hr == S_OK, "SHBindToParent failed! hr = %08lx\n", hr);
/* The pidl returned through the last parameter of SetNameOf is a simple one. */ - hr = IShellFolder_SetNameOf(psfPersonal, NULL, pidlLast, wszDirName, SHGDN_NORMAL, &pidlNew); + hr = IShellFolder_SetNameOf(psfPersonal, NULL, pidlLast, L"winetest", SHGDN_NORMAL, &pidlNew); ok (hr == S_OK, "SetNameOf failed! hr = %08lx\n", hr);
ok (((ITEMIDLIST *)((BYTE *)pidlNew + pidlNew->mkid.cb))->mkid.cb == 0, @@ -759,7 +752,7 @@ static void test_GetDisplayName(void)
/* Rename the file back to its original name. SetNameOf ignores the fact, that the * SHGDN flags specify an absolute path. */ - hr = IShellFolder_SetNameOf(psfPersonal, NULL, pidlNew, wszFileName, SHGDN_FORPARSING, NULL); + hr = IShellFolder_SetNameOf(psfPersonal, NULL, pidlNew, L"winetest.foo", SHGDN_FORPARSING, NULL); ok (hr == S_OK, "SetNameOf failed! hr = %08lx\n", hr);
ILFree(pidlNew); @@ -827,17 +820,9 @@ static void test_CallForAttributes(void) LPSHELLFOLDER psfDesktop; LPITEMIDLIST pidlMyDocuments; DWORD dwAttributes, dwCallForAttributes, dwOrigAttributes, dwOrigCallForAttributes; - static const WCHAR wszAttributes[] = { 'A','t','t','r','i','b','u','t','e','s',0 }; - static const WCHAR wszCallForAttributes[] = { - 'C','a','l','l','F','o','r','A','t','t','r','i','b','u','t','e','s',0 }; - static const WCHAR wszMyDocumentsKey[] = { - 'C','L','S','I','D','\','{','4','5','0','D','8','F','B','A','-','A','D','2','5','-', - '1','1','D','0','-','9','8','A','8','-','0','8','0','0','3','6','1','B','1','1','0','3','}', - '\','S','h','e','l','l','F','o','l','d','e','r',0 }; - WCHAR wszMyDocuments[] = { - ':',':','{','4','5','0','D','8','F','B','A','-','A','D','2','5','-','1','1','D','0','-', - '9','8','A','8','-','0','8','0','0','3','6','1','B','1','1','0','3','}',0 }; - + static const WCHAR wszMyDocumentsKey[] = L"CLSID\{450D8FBA-AD25-11D0-98A8-0800361B1103}\ShellFolder"; + WCHAR wszMyDocuments[] = L"::{450D8FBA-AD25-11D0-98A8-0800361B1103}"; + /* For the root of a namespace extension, the attributes are not queried by binding * to the object and calling GetAttributesOf. Instead, the attributes are read from * the registry value HKCR/CLSID/{...}/ShellFolder/Attributes. This is documented on MSDN. @@ -887,7 +872,7 @@ static void test_CallForAttributes(void)
/* Query MyDocuments' Attributes value, to be able to restore it later. */ dwSize = sizeof(DWORD); - lResult = RegQueryValueExW(hKey, wszAttributes, NULL, NULL, (LPBYTE)&dwOrigAttributes, &dwSize); + lResult = RegQueryValueExW(hKey, L"Attributes", NULL, NULL, (BYTE*)&dwOrigAttributes, &dwSize); ok (lResult == ERROR_SUCCESS, "RegQueryValueEx failed! result: %08lx\n", lResult); if (lResult != ERROR_SUCCESS) { RegCloseKey(hKey); @@ -898,8 +883,8 @@ static void test_CallForAttributes(void)
/* Query MyDocuments' CallForAttributes value, to be able to restore it later. */ dwSize = sizeof(DWORD); - lResult = RegQueryValueExW(hKey, wszCallForAttributes, NULL, NULL, - (LPBYTE)&dwOrigCallForAttributes, &dwSize); + lResult = RegQueryValueExW(hKey, L"CallForAttributes", NULL, NULL, + (BYTE*)&dwOrigCallForAttributes, &dwSize); ok (lResult == ERROR_SUCCESS, "RegQueryValueEx failed! result: %08lx\n", lResult); if (lResult != ERROR_SUCCESS) { RegCloseKey(hKey); @@ -912,10 +897,10 @@ static void test_CallForAttributes(void) * SFGAO_GHOSTED and that MyDocuments should be called for the SFGAO_ISSLOW and * SFGAO_FILESYSTEM attributes. */ dwAttributes = SFGAO_ISSLOW|SFGAO_GHOSTED; - RegSetValueExW(hKey, wszAttributes, 0, REG_DWORD, (LPBYTE)&dwAttributes, sizeof(DWORD)); + RegSetValueExW(hKey, L"Attributes", 0, REG_DWORD, (BYTE*)&dwAttributes, sizeof(DWORD)); dwCallForAttributes = SFGAO_ISSLOW|SFGAO_FILESYSTEM; - RegSetValueExW(hKey, wszCallForAttributes, 0, REG_DWORD, - (LPBYTE)&dwCallForAttributes, sizeof(DWORD)); + RegSetValueExW(hKey, L"CallForAttributes", 0, REG_DWORD, + (BYTE*)&dwCallForAttributes, sizeof(DWORD));
/* Although it is not set in CallForAttributes, the SFGAO_GHOSTED flag is reset by * GetAttributesOf. It seems that once there is a single attribute queried, for which @@ -932,9 +917,9 @@ static void test_CallForAttributes(void) dwAttributes);
/* Restore MyDocuments' original Attributes and CallForAttributes registry values */ - RegSetValueExW(hKey, wszAttributes, 0, REG_DWORD, (LPBYTE)&dwOrigAttributes, sizeof(DWORD)); - RegSetValueExW(hKey, wszCallForAttributes, 0, REG_DWORD, - (LPBYTE)&dwOrigCallForAttributes, sizeof(DWORD)); + RegSetValueExW(hKey, L"Attributes", 0, REG_DWORD, (BYTE*)&dwOrigAttributes, sizeof(DWORD)); + RegSetValueExW(hKey, L"CallForAttributes", 0, REG_DWORD, + (BYTE*)&dwOrigCallForAttributes, sizeof(DWORD)); RegCloseKey(hKey); ILFree(pidlMyDocuments); IShellFolder_Release(psfDesktop); @@ -952,12 +937,10 @@ static void test_GetAttributesOf(void) SFGAO_FILESYSANCESTOR | SFGAO_FOLDER | SFGAO_FILESYSTEM | SFGAO_HASSUBFOLDER; static const DWORD myComputerFlags = SFGAO_CANRENAME | SFGAO_CANDELETE | SFGAO_HASPROPSHEET | SFGAO_DROPTARGET | SFGAO_FILESYSANCESTOR | SFGAO_FOLDER | SFGAO_HASSUBFOLDER; - WCHAR wszMyComputer[] = { - ':',':','{','2','0','D','0','4','F','E','0','-','3','A','E','A','-','1','0','6','9','-', - 'A','2','D','8','-','0','8','0','0','2','B','3','0','3','0','9','D','}',0 }; + WCHAR wszMyComputer[] = L"::{20D04FE0-3AEA-1069-A2D8-08002B30309D}"; char cCurrDirA [MAX_PATH] = {0}; WCHAR cCurrDirW [MAX_PATH]; - static WCHAR cTestDirW[] = {'t','e','s','t','d','i','r',0}; + static WCHAR cTestDirW[] = L"testdir"; IShellFolder *IDesktopFolder, *testIShellFolder; ITEMIDLIST *newPIDL; IEnumIDList *list; @@ -1139,15 +1122,12 @@ static void test_SHGetPathFromIDList(void) BOOL result; HRESULT hr; LPSHELLFOLDER psfDesktop; - WCHAR wszMyComputer[] = { - ':',':','{','2','0','D','0','4','F','E','0','-','3','A','E','A','-','1','0','6','9','-', - 'A','2','D','8','-','0','8','0','0','2','B','3','0','3','0','9','D','}',0 }; + WCHAR wszMyComputer[] = L"::{20D04FE0-3AEA-1069-A2D8-08002B30309D}"; WCHAR wszFileName[MAX_PATH]; LPITEMIDLIST pidlTestFile; HANDLE hTestFile; STRRET strret; - static WCHAR wszTestFile[] = { - 'w','i','n','e','t','e','s','t','.','f','o','o',0 }; + static WCHAR wszTestFile[] = L"winetest.foo"; LPITEMIDLIST pidlPrograms;
/* Calling SHGetPathFromIDListW with no pidl should return the empty string */ @@ -1352,31 +1332,18 @@ static ULONG WINAPI InitPropertyBag_IPropertyBag_Release(IPropertyBag *iface) { static HRESULT WINAPI InitPropertyBag_IPropertyBag_Read(IPropertyBag *iface, LPCOLESTR pszPropName, VARIANT *pVar, IErrorLog *pErrorLog) { - static const WCHAR wszTargetSpecialFolder[] = { - 'T','a','r','g','e','t','S','p','e','c','i','a','l','F','o','l','d','e','r',0 }; - static const WCHAR wszTarget[] = { - 'T','a','r','g','e','t',0 }; - static const WCHAR wszAttributes[] = { - 'A','t','t','r','i','b','u','t','e','s',0 }; - static const WCHAR wszResolveLinkFlags[] = { - 'R','e','s','o','l','v','e','L','i','n','k','F','l','a','g','s',0 }; - static const WCHAR wszTargetKnownFolder[] = { - 'T','a','r','g','e','t','K','n','o','w','n','F','o','l','d','e','r',0 }; - static const WCHAR wszCLSID[] = { - 'C','L','S','I','D',0 }; - - if (!lstrcmpW(pszPropName, wszTargetSpecialFolder)) { + if (!lstrcmpW(pszPropName, L"TargetSpecialFolder")) { ok(V_VT(pVar) == VT_I4, "Wrong variant type for 'TargetSpecialFolder' property!\n"); return E_INVALIDARG; } - - if (!lstrcmpW(pszPropName, wszResolveLinkFlags)) + + if (!lstrcmpW(pszPropName, L"ResolveLinkFlags")) { ok(V_VT(pVar) == VT_UI4, "Wrong variant type for 'ResolveLinkFlags' property!\n"); return E_INVALIDARG; }
- if (!lstrcmpW(pszPropName, wszTarget)) { + if (!lstrcmpW(pszPropName, L"Target")) { WCHAR wszPath[MAX_PATH]; BOOL result;
@@ -1391,7 +1358,7 @@ static HRESULT WINAPI InitPropertyBag_IPropertyBag_Read(IPropertyBag *iface, LPC return S_OK; }
- if (!lstrcmpW(pszPropName, wszAttributes)) { + if (!lstrcmpW(pszPropName, L"Attributes")) { ok(V_VT(pVar) == VT_UI4, "Wrong variant type for 'Attributes' property!\n"); if (V_VT(pVar) != VT_UI4) return E_INVALIDARG; V_UI4(pVar) = SFGAO_FOLDER|SFGAO_HASSUBFOLDER|SFGAO_FILESYSANCESTOR| @@ -1399,13 +1366,13 @@ static HRESULT WINAPI InitPropertyBag_IPropertyBag_Read(IPropertyBag *iface, LPC return S_OK; }
- if (!lstrcmpW(pszPropName, wszTargetKnownFolder)) { + if (!lstrcmpW(pszPropName, L"TargetKnownFolder")) { ok(V_VT(pVar) == VT_BSTR, "Wrong variant type for 'TargetKnownFolder' property!\n"); /* TODO */ return E_INVALIDARG; }
- if (!lstrcmpW(pszPropName, wszCLSID)) { + if (!lstrcmpW(pszPropName, L"CLSID")) { ok(V_VT(pVar) == VT_EMPTY, "Wrong variant type for 'CLSID' property!\n"); /* TODO */ return E_INVALIDARG; @@ -1445,19 +1412,13 @@ static void test_FolderShortcut(void) { CLSID clsid; LPITEMIDLIST pidlCurrentFolder, pidlWineTestFolder, pidlSubFolder; HKEY hShellExtKey; - WCHAR wszWineTestFolder[] = { - ':',':','{','9','B','3','5','2','E','B','F','-','2','7','6','5','-','4','5','C','1','-', - 'B','4','C','6','-','8','5','C','C','7','F','7','A','B','C','6','4','}',0 }; - WCHAR wszShellExtKey[] = { 'S','o','f','t','w','a','r','e','\', - 'M','i','c','r','o','s','o','f','t','\','W','i','n','d','o','w','s','\', - 'C','u','r','r','e','n','t','V','e','r','s','i','o','n','\', - 'E','x','p','l','o','r','e','r','\','D','e','s','k','t','o','p','\', - 'N','a','m','e','S','p','a','c','e','\', - '{','9','b','3','5','2','e','b','f','-','2','7','6','5','-','4','5','c','1','-', - 'b','4','c','6','-','8','5','c','c','7','f','7','a','b','c','6','4','}',0 }; - - WCHAR wszSomeSubFolder[] = { 'S','u','b','F','o','l','d','e','r', 0}; - static const GUID CLSID_UnixDosFolder = + WCHAR wszWineTestFolder[] = L"::{9B352EBF-2765-45C1-B4C6-85CC7F7ABC64}"; + WCHAR wszShellExtKey[] = + L"Software\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace\" + L"{9b352ebf-2765-45c1-b4c6-85cc7f7abc64}"; + + WCHAR wszSomeSubFolder[] = L"SubFolder"; + static const GUID CLSID_UnixDosFolder = {0x9d20aae8, 0x0625, 0x44b0, {0x9c, 0xa7, 0x71, 0x88, 0x9c, 0x22, 0x54, 0xd9}};
/* These tests basically show, that CLSID_FolderShortcuts are initialized @@ -1634,8 +1595,7 @@ static void test_ITEMIDLIST_format(void) { HANDLE hFile; HRESULT hr; BOOL bResult; - WCHAR wszFile[3][17] = { { 'e','v','e','n','_',0 }, { 'o','d','d','_',0 }, - { 'l','o','n','g','e','r','_','t','h','a','n','.','8','_','3',0 } }; + WCHAR wszFile[3][17] = { L"even_", L"odd_", L"longer_than.8_3" }; int i;
bResult = SHGetSpecialFolderPathW(NULL, wszPersonal, CSIDL_PERSONAL, FALSE); @@ -1980,8 +1940,7 @@ static void test_LocalizedNames(void) "LocalizedResourceName=@"; static const char desktopini_contents2[] = ",-1\r\n"; - static WCHAR foldernameW[] = {'t','e','s','t','f','o','l','d','e','r',0}; - static const WCHAR folderdisplayW[] = {'F','o','l','d','e','r',' ','N','a','m','e',' ','R','e','s','o','u','r','c','e',0}; + static WCHAR foldernameW[] = L"testfolder";
/* create folder with desktop.ini and localized name in GetModuleFileNameA(NULL) */ CreateDirectoryA(".\testfolder", NULL); @@ -2033,7 +1992,7 @@ static void test_LocalizedNames(void) hr = StrRetToBufW(&strret, newPIDL, tempbufW, ARRAY_SIZE(tempbufW)); ok (hr == S_OK, "StrRetToBufW failed! hr = %08lx\n", hr); todo_wine - ok (!lstrcmpiW(tempbufW, folderdisplayW), "GetDisplayNameOf returned %s\n", wine_dbgstr_w(tempbufW)); + ok (!lstrcmpiW(tempbufW, L"Folder Name Resource"), "GetDisplayNameOf returned %s\n", wine_dbgstr_w(tempbufW));
/* editing name is also read from the resource */ hr = IShellFolder_GetDisplayNameOf(testIShellFolder, newPIDL, SHGDN_INFOLDER|SHGDN_FOREDITING, &strret); @@ -2042,7 +2001,7 @@ static void test_LocalizedNames(void) hr = StrRetToBufW(&strret, newPIDL, tempbufW, ARRAY_SIZE(tempbufW)); ok (hr == S_OK, "StrRetToBufW failed! hr = %08lx\n", hr); todo_wine - ok (!lstrcmpiW(tempbufW, folderdisplayW), "GetDisplayNameOf returned %s\n", wine_dbgstr_w(tempbufW)); + ok (!lstrcmpiW(tempbufW, L"Folder Name Resource"), "GetDisplayNameOf returned %s\n", wine_dbgstr_w(tempbufW));
/* parsing name is unchanged */ hr = IShellFolder_GetDisplayNameOf(testIShellFolder, newPIDL, SHGDN_INFOLDER|SHGDN_FORPARSING, &strret); @@ -2073,7 +2032,7 @@ static void test_SHCreateShellItem(void) WCHAR curdirW[MAX_PATH]; WCHAR fnbufW[MAX_PATH]; IShellFolder *desktopfolder=NULL, *currentfolder=NULL; - static WCHAR testfileW[] = {'t','e','s','t','f','i','l','e',0}; + static WCHAR testfileW[] = L"testfile";
GetCurrentDirectoryA(MAX_PATH, curdirA);
@@ -2818,10 +2777,8 @@ static void test_ShellItemCompare(void) WCHAR curdirW[MAX_PATH]; BOOL failed; HRESULT hr; - static const WCHAR filesW[][9] = { - {'a','\','a',0}, {'a','\','b',0}, {'a','\','c',0}, - {'b','\','a',0}, {'b','\','b',0}, {'b','\','c',0}, - {'c','\','a',0}, {'c','\','b',0}, {'c','\','c',0} }; + static const WCHAR filesW[][9] = + { L"a\a", L"a\b", L"a\c", L"b\a", L"b\b", L"b\c", L"c\a", L"c\b", L"c\c" }; int order; UINT i;
@@ -3337,7 +3294,6 @@ static void test_SHCreateShellItemArray(void) HRESULT hr; WCHAR cTestDirW[MAX_PATH]; LPITEMIDLIST pidl_testdir, pidl; - static const WCHAR testdirW[] = {'t','e','s','t','d','i','r',0};
if(!pSHCreateShellItemArray) { skip("No pSHCreateShellItemArray!\n"); @@ -3370,7 +3326,7 @@ static void test_SHCreateShellItemArray(void)
GetCurrentDirectoryW(MAX_PATH, cTestDirW); myPathAddBackslashW(cTestDirW); - lstrcatW(cTestDirW, testdirW); + lstrcatW(cTestDirW, L"testdir");
CreateFilesFolders();
@@ -3595,7 +3551,6 @@ static void test_SHCreateShellItemArray(void)
if(pSHCreateShellItemArrayFromIDLists) { - WCHAR test1W[] = {'t','e','s','t','1','.','t','x','t',0}; WCHAR test1pathW[MAX_PATH]; LPITEMIDLIST pidltest1; LPCITEMIDLIST pidl_array[2]; @@ -3710,7 +3665,7 @@ static void test_SHCreateShellItemArray(void)
lstrcpyW(test1pathW, cTestDirW); myPathAddBackslashW(test1pathW); - lstrcatW(test1pathW, test1W); + lstrcatW(test1pathW, L"test1.txt");
SHGetDesktopFolder(&pdesktopsf);
@@ -3784,7 +3739,6 @@ static void test_ShellItemArrayEnumItems(void) WCHAR cTestDirW[MAX_PATH]; HRESULT hr; LPITEMIDLIST pidl_testdir; - static const WCHAR testdirW[] = {'t','e','s','t','d','i','r',0};
if(!pSHCreateShellItemArray) { @@ -3798,7 +3752,7 @@ static void test_ShellItemArrayEnumItems(void)
GetCurrentDirectoryW(MAX_PATH, cTestDirW); myPathAddBackslashW(cTestDirW); - lstrcatW(cTestDirW, testdirW); + lstrcatW(cTestDirW, L"testdir");
hr = IShellFolder_ParseDisplayName(pdesktopsf, NULL, NULL, cTestDirW, NULL, &pidl_testdir, 0); ok(hr == S_OK, "got 0x%08lx\n", hr); @@ -4107,8 +4061,6 @@ static void test_ShellItemGetAttributes(void) HRESULT hr; WCHAR curdirW[MAX_PATH]; WCHAR buf[MAX_PATH]; - static const WCHAR testdir1W[] = {'t','e','s','t','d','i','r',0}; - static const WCHAR testfile1W[] = {'t','e','s','t','d','i','r','\','t','e','s','t','1','.','t','x','t',0};
if(!pSHCreateShellItem) { @@ -4152,7 +4104,7 @@ static void test_ShellItemGetAttributes(void) myPathAddBackslashW(curdirW);
lstrcpyW(buf, curdirW); - lstrcatW(buf, testdir1W); + lstrcatW(buf, L"testdir"); hr = IShellFolder_ParseDisplayName(pdesktopsf, NULL, NULL, buf, NULL, &pidl, NULL); ok(hr == S_OK, "got 0x%08lx\n", hr); hr = pSHCreateShellItem(NULL, NULL, pidl, &psi_folder1); @@ -4160,7 +4112,7 @@ static void test_ShellItemGetAttributes(void) ILFree(pidl);
lstrcpyW(buf, curdirW); - lstrcatW(buf, testfile1W); + lstrcatW(buf, L"testdir\test1.txt"); hr = IShellFolder_ParseDisplayName(pdesktopsf, NULL, NULL, buf, NULL, &pidl, NULL); ok(hr == S_OK, "got 0x%08lx\n", hr); hr = pSHCreateShellItem(NULL, NULL, pidl, &psi_file1); @@ -4200,12 +4152,8 @@ static void test_ShellItemArrayGetAttributes(void) WCHAR curdirW[MAX_PATH]; WCHAR buf[MAX_PATH]; UINT i; - static const WCHAR testdir1W[] = {'t','e','s','t','d','i','r',0}; - static const WCHAR testdir2W[] = {'t','e','s','t','d','i','r','\','t','e','s','t','d','i','r','2',0}; - static const WCHAR testdir3W[] = {'t','e','s','t','d','i','r','\','t','e','s','t','d','i','r','3',0}; - static const WCHAR testfile1W[] = {'t','e','s','t','d','i','r','\','t','e','s','t','1','.','t','x','t',0}; - static const WCHAR testfile2W[] = {'t','e','s','t','d','i','r','\','t','e','s','t','2','.','t','x','t',0}; - static const WCHAR *testfilesW[5] = { testdir1W, testdir2W, testdir3W, testfile1W, testfile2W }; + static const WCHAR *testfilesW[] = + { L"testdir", L"testdir\testdir2", L"testdir\testdir3", L"testdir\test1.txt", L"testdir\test2.txt" };
if(!pSHCreateShellItemArrayFromShellItem) { @@ -4576,8 +4524,6 @@ static void test_GetUIObject(void) LPITEMIDLIST pidl; HRESULT hr; WCHAR path[MAX_PATH]; - const WCHAR filename[] = - {'\','t','e','s','t','d','i','r','\','t','e','s','t','1','.','t','x','t',0}; LPCITEMIDLIST pidl_child; IShellFolder *psf;
@@ -4587,7 +4533,7 @@ static void test_GetUIObject(void) skip("GetCurrentDirectoryW returned an empty string.\n"); return; } - lstrcatW(path, filename); + lstrcatW(path, L"\testdir\test1.txt"); SHGetDesktopFolder(&psf_desktop);
CreateFilesFolders(); @@ -4729,7 +4675,7 @@ static void r_verify_pidl(unsigned l, LPCITEMIDLIST pidl, const WCHAR *path)
static void test_SHSimpleIDListFromPath(void) { - const WCHAR adirW[] = {'C',':','\','s','i','d','l','f','p','d','i','r',0}; + const WCHAR adirW[] = L"C:\sidlfpdir"; const CHAR adirA[] = "C:\sidlfpdir"; BOOL br, is_unicode = !(GetVersion() & 0x80000000);
@@ -4811,8 +4757,7 @@ static HRESULT WINAPI fsbd_GetFindData_invalid(IFileSystemBindData *fsbd, static HRESULT WINAPI fsbd_GetFindData_valid(IFileSystemBindData *fsbd, WIN32_FIND_DATAW *pfd) { - static const WCHAR adirW[] = {'C',':','\','f','s','b','d','d','i','r',0}; - HANDLE handle = FindFirstFileW(adirW, pfd); + HANDLE handle = FindFirstFileW(L"C:\fsbddir", pfd); FindClose(handle); return S_OK; } @@ -4835,11 +4780,10 @@ static IFileSystemBindData fsbd = { &fsbdVtbl };
static void test_ParseDisplayNamePBC(void) { - WCHAR wFileSystemBindData[] = - {'F','i','l','e',' ','S','y','s','t','e','m',' ','B','i','n','d',' ','D','a','t','a',0}; - WCHAR adirW[] = {'C',':','\','f','s','b','d','d','i','r',0}; - WCHAR afileW[] = {'C',':','\','f','s','b','d','d','i','r','\','f','i','l','e','.','t','x','t',0}; - WCHAR afile2W[] = {'C',':','\','f','s','b','d','d','i','r','\','s','\','f','i','l','e','.','t','x','t',0}; + WCHAR wFileSystemBindData[] = L"File System Bind Data"; + WCHAR adirW[] = L"C:\fsbddir"; + WCHAR afileW[] = L"C:\fsbddir\file.txt"; + WCHAR afile2W[] = L"C:\fsbddir\s\file.txt"; const HRESULT exp_err = HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND);
IShellFolder *psf; @@ -5108,8 +5052,6 @@ static void test_SHChangeNotify(BOOL test_new_delivery) HRESULT hr; BOOL br, has_unicode; SHChangeNotifyEntry entries[1]; - const CHAR root_dirA[] = "C:\shell32_cn_test"; - const WCHAR root_dirW[] = {'C',':','\','s','h','e','l','l','3','2','_','c','n','_','t','e','s','t',0};
trace("SHChangeNotify tests (%x)\n", test_new_delivery);
@@ -5125,14 +5067,14 @@ static void test_SHChangeNotify(BOOL test_new_delivery) NULL, NULL, GetModuleHandleA(NULL), 0); ok(wnd != NULL, "Failed to make a window\n");
- br = CreateDirectoryA(root_dirA, NULL); + br = CreateDirectoryA("C:\shell32_cn_test", NULL); ok(br == TRUE, "CreateDirectory failed: %ld\n", GetLastError());
entries[0].pidl = NULL; if(has_unicode) - hr = SHILCreateFromPath(root_dirW, (LPITEMIDLIST*)&entries[0].pidl, 0); + hr = SHILCreateFromPath(L"C:\shell32_cn_test", (ITEMIDLIST**)&entries[0].pidl, 0); else - hr = SHILCreateFromPath((const void *)root_dirA, (LPITEMIDLIST*)&entries[0].pidl, 0); + hr = SHILCreateFromPath((const void*)"C:\shell32_cn_test", (ITEMIDLIST**)&entries[0].pidl, 0); ok(hr == S_OK, "SHILCreateFromPath failed: 0x%08lx\n", hr); entries[0].fRecursive = TRUE;
@@ -5171,7 +5113,7 @@ static void test_SHChangeNotify(BOOL test_new_delivery) DestroyWindow(wnd);
ILFree((LPITEMIDLIST)entries[0].pidl); - br = RemoveDirectoryA(root_dirA); + br = RemoveDirectoryA("C:\shell32_cn_test"); ok(br == TRUE, "RemoveDirectory failed: %ld\n", GetLastError()); }
@@ -5187,8 +5129,6 @@ static void test_SHCreateDefaultContextMenu(void) DEFCONTEXTMENU cminfo; HRESULT hr; UINT i; - const WCHAR filename[] = - {'\','t','e','s','t','d','i','r','\','t','e','s','t','1','.','t','x','t',0}; if(!pSHCreateDefaultContextMenu) { win_skip("SHCreateDefaultContextMenu missing.\n"); @@ -5201,7 +5141,7 @@ static void test_SHCreateDefaultContextMenu(void) skip("GetCurrentDirectoryW returned an empty string.\n"); return; } - lstrcatW(path, filename); + lstrcatW(path, L"\testdir\test1.txt"); SHGetDesktopFolder(&desktop);
CreateFilesFolders(); @@ -5656,9 +5596,6 @@ static void test_SHGetSetFolderCustomSettings(void) WCHAR pathW[MAX_PATH]; WCHAR bufferW[MAX_PATH]; WCHAR iconpathW[MAX_PATH]; - static const WCHAR somedirW[] = {'s','o','m','e','_','d','i','r',0}; - static const WCHAR iconW[] = {'\','s','o','m','e','_','i','c','o','n','.','i','c','o',0}; - static const WCHAR desktop_iniW[] = {'\','D','e','s','k','t','o','p','.','i','n','i',0};
if (!pSHGetSetFolderCustomSettings) { @@ -5667,11 +5604,11 @@ static void test_SHGetSetFolderCustomSettings(void) }
GetTempPathW(MAX_PATH, pathW); - lstrcatW(pathW, somedirW); + lstrcatW(pathW, L"some_dir"); CreateDirectoryW(pathW, NULL);
lstrcpyW(iconpathW, pathW); - lstrcatW(iconpathW, iconW); + lstrcatW(iconpathW, L"\some_icon.ico");
memset(&fcs, 0, sizeof(fcs)); fcs.dwSize = sizeof(fcs); @@ -5696,7 +5633,7 @@ static void test_SHGetSetFolderCustomSettings(void) ok(FAILED(hr), "Unexpected hr %#lx.\n", hr);
lstrcpyW(bufferW, pathW); - lstrcatW(bufferW, desktop_iniW); + lstrcatW(bufferW, L"\Desktop.ini"); DeleteFileW(bufferW); RemoveDirectoryW(pathW); } diff --git a/dlls/shell32/tests/string.c b/dlls/shell32/tests/string.c index f06df25e384..bedda41f5e7 100644 --- a/dlls/shell32/tests/string.c +++ b/dlls/shell32/tests/string.c @@ -49,7 +49,6 @@ static void test_StrRetToStringNA(void)
static void test_StrRetToStringNW(void) { - static const WCHAR szTestW[] = { 'T','e','s','t','\0' }; ITEMIDLIST iidl[10]; WCHAR buff[128]; STRRET strret; @@ -61,14 +60,14 @@ static void test_StrRetToStringNW(void) strret.pOleStr = CoDupStrW("Test"); memset(buff, 0xff, sizeof(buff)); ret = pStrRetToStrNAW(buff, ARRAY_SIZE(buff) - 1, &strret, NULL); - ok(ret == TRUE && !wcscmp(buff, szTestW), + ok(ret == TRUE && !wcscmp(buff, L"Test"), "STRRET_WSTR: dup failed, ret=%d\n", ret);
strret.uType = STRRET_CSTR; lstrcpyA(strret.cStr, "Test"); memset(buff, 0xff, sizeof(buff)); ret = pStrRetToStrNAW(buff, ARRAY_SIZE(buff), &strret, NULL); - ok(ret == TRUE && !wcscmp(buff, szTestW), + ok(ret == TRUE && !wcscmp(buff, L"Test"), "STRRET_CSTR: dup failed, ret=%d\n", ret);
strret.uType = STRRET_OFFSET; @@ -76,7 +75,7 @@ static void test_StrRetToStringNW(void) strcpy((char*)&iidl, " Test"); memset(buff, 0xff, sizeof(buff)); ret = pStrRetToStrNAW(buff, ARRAY_SIZE(buff), &strret, iidl); - ok(ret == TRUE && !wcscmp(buff, szTestW), + ok(ret == TRUE && !wcscmp(buff, L"Test"), "STRRET_OFFSET: dup failed, ret=%d\n", ret);
strret.uType = 3;