Commit dd162547 authored by Alexandre Julliard's avatar Alexandre Julliard

shell32/tests: Use nameless unions/structs.

parent 5cb72744
......@@ -19,9 +19,6 @@
*/
#define COBJMACROS
#define NONAMELESSUNION
#define NONAMELESSSTRUCT
#include "shldisp.h"
#include "shlobj.h"
#include "shlwapi.h"
......
......@@ -18,7 +18,6 @@
#define COBJMACROS
#define CONST_VTABLE
#define NONAMELESSUNION
#include <stdio.h>
#include <wine/test.h>
......@@ -117,7 +116,7 @@ static HRESULT WINAPI PropertyStorage_ReadMultiple(IPropertyStorage *This, ULONG
ok(rgpropvar != NULL, "rgpropvar = NULL\n");
ok(rgpspec[0].ulKind == PRSPEC_PROPID, "rgpspec[0].ulKind = %ld\n", rgpspec[0].ulKind);
ok(rgpspec[0].u.propid == PID_CODEPAGE, "rgpspec[0].propid = %ld\n", rgpspec[0].u.propid);
ok(rgpspec[0].propid == PID_CODEPAGE, "rgpspec[0].propid = %ld\n", rgpspec[0].propid);
rgpropvar[0].vt = VT_I2;
rgpropvar[0].iVal = 1234;
......
......@@ -23,9 +23,6 @@
#include <stdio.h>
#define COBJMACROS
#define NONAMELESSUNION
#define NONAMELESSSTRUCT
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include "shellapi.h"
......@@ -233,10 +230,10 @@ if (0)
hr = IShellFolder2_GetDefaultColumnState(folder, 6, &state);
ok(broken(hr == E_NOTIMPL) || hr == E_INVALIDARG /* Win7 */, "got 0x%08lx\n", hr);
details.str.u.pOleStr = NULL;
details.str.pOleStr = NULL;
hr = IShellFolder2_GetDetailsOf(folder, NULL, 0, &details);
ok(hr == S_OK || broken(hr == E_NOTIMPL) /* W2K */, "got 0x%08lx\n", hr);
if (SHELL_OsIsUnicode()) SHFree(details.str.u.pOleStr);
if (SHELL_OsIsUnicode()) SHFree(details.str.pOleStr);
/* test every column if method is implemented */
if (hr == S_OK)
......@@ -252,7 +249,7 @@ if (0)
ok(details.fmt == LVCFMT_LEFT, "got 0x%x\n", details.fmt);
/* can't be on w9x at this point, IShellFolder2 unsupported there,
check present for running Wine with w9x setup */
if (SHELL_OsIsUnicode()) SHFree(details.str.u.pOleStr);
if (SHELL_OsIsUnicode()) SHFree(details.str.pOleStr);
hr = IShellFolder2_GetDefaultColumnState(folder, i, &state);
ok(hr == S_OK, "got 0x%08lx\n", hr);
......
......@@ -611,7 +611,7 @@ static INT_PTR shell_execute_ex_(const char* file, int line,
sei.lpClass=class;
sei.hkeyClass=NULL;
sei.dwHotKey=0;
U(sei).hIcon=NULL;
sei.hIcon=NULL;
sei.hProcess=(HANDLE)0xdeadbeef; /* Out */
DeleteFileA(child_file);
......@@ -2400,7 +2400,7 @@ static void hook_WaitForInputIdle(DWORD (WINAPI *new_func)(HANDLE, DWORD))
/* Search for the correct imported module by walking the import descriptors */
import_descriptor = (PIMAGE_IMPORT_DESCRIPTOR)(base + import_directory_rva);
while (U(*import_descriptor).OriginalFirstThunk != 0)
while (import_descriptor->OriginalFirstThunk != 0)
{
char *import_module_name;
......@@ -2415,7 +2415,7 @@ static void hook_WaitForInputIdle(DWORD (WINAPI *new_func)(HANDLE, DWORD))
* arrays. We need the import name table to find the imported
* routine and the import address table to patch the address, so
* walk them side by side */
int_entry = (PIMAGE_THUNK_DATA)(base + U(*import_descriptor).OriginalFirstThunk);
int_entry = (PIMAGE_THUNK_DATA)(base + import_descriptor->OriginalFirstThunk);
iat_entry = (PIMAGE_THUNK_DATA)(base + import_descriptor->FirstThunk);
while (int_entry->u1.Ordinal != 0)
{
......
......@@ -4709,16 +4709,16 @@ static void r_verify_pidl(unsigned l, LPCITEMIDLIST pidl, const WCHAR *path)
ok_(__FILE__,l)(filename.uType == STRRET_WSTR || filename.uType == STRRET_CSTR,
"Got unexpected string type: %d\n", filename.uType);
if(filename.uType == STRRET_WSTR){
ok_(__FILE__,l)(lstrcmpW(path, U(filename).pOleStr) == 0,
ok_(__FILE__,l)(lstrcmpW(path, filename.pOleStr) == 0,
"didn't get expected path (%s), instead: %s\n",
wine_dbgstr_w(path), wine_dbgstr_w(U(filename).pOleStr));
SHFree(U(filename).pOleStr);
wine_dbgstr_w(path), wine_dbgstr_w(filename.pOleStr));
SHFree(filename.pOleStr);
}
else if(filename.uType == STRRET_CSTR)
{
WCHAR *strW = make_wstr(U(filename).cStr);
WCHAR *strW = make_wstr(filename.cStr);
ok_(__FILE__,l)(!lstrcmpW(path, strW), "didn't get expected path (%s), instead: %s\n",
wine_dbgstr_w(path), U(filename).cStr);
wine_dbgstr_w(path), filename.cStr);
free(strW);
}
......
......@@ -58,21 +58,21 @@ static void test_StrRetToStringNW(void)
trace("StrRetToStringNAW is Unicode\n");
strret.uType = STRRET_WSTR;
U(strret).pOleStr = CoDupStrW("Test");
strret.pOleStr = CoDupStrW("Test");
memset(buff, 0xff, sizeof(buff));
ret = pStrRetToStrNAW(buff, ARRAY_SIZE(buff), &strret, NULL);
ok(ret == TRUE && !wcscmp(buff, szTestW),
"STRRET_WSTR: dup failed, ret=%d\n", ret);
strret.uType = STRRET_CSTR;
lstrcpyA(U(strret).cStr, "Test");
lstrcpyA(strret.cStr, "Test");
memset(buff, 0xff, sizeof(buff));
ret = pStrRetToStrNAW(buff, ARRAY_SIZE(buff), &strret, NULL);
ok(ret == TRUE && !wcscmp(buff, szTestW),
"STRRET_CSTR: dup failed, ret=%d\n", ret);
strret.uType = STRRET_OFFSET;
U(strret).uOffset = 1;
strret.uOffset = 1;
strcpy((char*)&iidl, " Test");
memset(buff, 0xff, sizeof(buff));
ret = pStrRetToStrNAW(buff, ARRAY_SIZE(buff), &strret, iidl);
......@@ -84,7 +84,7 @@ if (0)
{
/* Invalid dest - should return FALSE, except NT4 does not, so we don't check. */
strret.uType = STRRET_WSTR;
U(strret).pOleStr = CoDupStrW("Test");
strret.pOleStr = CoDupStrW("Test");
pStrRetToStrNAW(NULL, ARRAY_SIZE(buff), &strret, NULL);
trace("NULL dest: ret=%d\n", ret);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment