amstream/tests: Define NONAMELESSUNION.

Old versions of gcc allow nameless unions, but can't parse them in designated initializers.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50378
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2020-12-21 11:04:58 -06:00 committed by Alexandre Julliard
parent baea948be1
commit 402532b3fd
1 changed files with 128 additions and 127 deletions

View File

@ -19,6 +19,7 @@
*/
#define COBJMACROS
#define NONAMELESSUNION
#include "wine/test.h"
#include "dshow.h"
@ -79,7 +80,7 @@ static const VIDEOINFO rgb565_video_info =
.bmiHeader.biPlanes = 1,
.bmiHeader.biBitCount = 16,
.bmiHeader.biCompression = BI_BITFIELDS,
.dwBitMasks = {0xf800, 0x07e0, 0x001f},
.u.dwBitMasks = {0xf800, 0x07e0, 0x001f},
};
static const VIDEOINFO rgb24_video_info =
@ -158,7 +159,7 @@ static const DDSURFACEDESC rgb8_format =
.dwFlags = DDSD_PIXELFORMAT,
.ddpfPixelFormat.dwSize = sizeof(DDPIXELFORMAT),
.ddpfPixelFormat.dwFlags = DDPF_RGB | DDPF_PALETTEINDEXED8,
.ddpfPixelFormat.dwRGBBitCount = 8,
.ddpfPixelFormat.u1.dwRGBBitCount = 8,
};
static const DDSURFACEDESC rgb555_format =
@ -167,10 +168,10 @@ static const DDSURFACEDESC rgb555_format =
.dwFlags = DDSD_PIXELFORMAT,
.ddpfPixelFormat.dwSize = sizeof(DDPIXELFORMAT),
.ddpfPixelFormat.dwFlags = DDPF_RGB,
.ddpfPixelFormat.dwRGBBitCount = 16,
.ddpfPixelFormat.dwRBitMask = 0x7c00,
.ddpfPixelFormat.dwGBitMask = 0x03e0,
.ddpfPixelFormat.dwBBitMask = 0x001f,
.ddpfPixelFormat.u1.dwRGBBitCount = 16,
.ddpfPixelFormat.u2.dwRBitMask = 0x7c00,
.ddpfPixelFormat.u3.dwGBitMask = 0x03e0,
.ddpfPixelFormat.u4.dwBBitMask = 0x001f,
};
static const DDSURFACEDESC rgb565_format =
@ -179,10 +180,10 @@ static const DDSURFACEDESC rgb565_format =
.dwFlags = DDSD_PIXELFORMAT,
.ddpfPixelFormat.dwSize = sizeof(DDPIXELFORMAT),
.ddpfPixelFormat.dwFlags = DDPF_RGB,
.ddpfPixelFormat.dwRGBBitCount = 16,
.ddpfPixelFormat.dwRBitMask = 0xf800,
.ddpfPixelFormat.dwGBitMask = 0x07e0,
.ddpfPixelFormat.dwBBitMask = 0x001f,
.ddpfPixelFormat.u1.dwRGBBitCount = 16,
.ddpfPixelFormat.u2.dwRBitMask = 0xf800,
.ddpfPixelFormat.u3.dwGBitMask = 0x07e0,
.ddpfPixelFormat.u4.dwBBitMask = 0x001f,
};
static const DDSURFACEDESC rgb24_format =
@ -191,10 +192,10 @@ static const DDSURFACEDESC rgb24_format =
.dwFlags = DDSD_PIXELFORMAT,
.ddpfPixelFormat.dwSize = sizeof(DDPIXELFORMAT),
.ddpfPixelFormat.dwFlags = DDPF_RGB,
.ddpfPixelFormat.dwRGBBitCount = 24,
.ddpfPixelFormat.dwRBitMask = 0xff0000,
.ddpfPixelFormat.dwGBitMask = 0x00ff00,
.ddpfPixelFormat.dwBBitMask = 0x0000ff,
.ddpfPixelFormat.u1.dwRGBBitCount = 24,
.ddpfPixelFormat.u2.dwRBitMask = 0xff0000,
.ddpfPixelFormat.u3.dwGBitMask = 0x00ff00,
.ddpfPixelFormat.u4.dwBBitMask = 0x0000ff,
};
static const DDSURFACEDESC rgb32_format =
@ -203,10 +204,10 @@ static const DDSURFACEDESC rgb32_format =
.dwFlags = DDSD_PIXELFORMAT,
.ddpfPixelFormat.dwSize = sizeof(DDPIXELFORMAT),
.ddpfPixelFormat.dwFlags = DDPF_RGB,
.ddpfPixelFormat.dwRGBBitCount = 32,
.ddpfPixelFormat.dwRBitMask = 0xff0000,
.ddpfPixelFormat.dwGBitMask = 0x00ff00,
.ddpfPixelFormat.dwBBitMask = 0x0000ff,
.ddpfPixelFormat.u1.dwRGBBitCount = 32,
.ddpfPixelFormat.u2.dwRBitMask = 0xff0000,
.ddpfPixelFormat.u3.dwGBitMask = 0x00ff00,
.ddpfPixelFormat.u4.dwBBitMask = 0x0000ff,
};
static const DDSURFACEDESC argb32_format =
@ -215,11 +216,11 @@ static const DDSURFACEDESC argb32_format =
.dwFlags = DDSD_PIXELFORMAT,
.ddpfPixelFormat.dwSize = sizeof(DDPIXELFORMAT),
.ddpfPixelFormat.dwFlags = DDPF_RGB | DDPF_ALPHAPIXELS,
.ddpfPixelFormat.dwRGBBitCount = 32,
.ddpfPixelFormat.dwRBitMask = 0xff0000,
.ddpfPixelFormat.dwGBitMask = 0x00ff00,
.ddpfPixelFormat.dwBBitMask = 0x0000ff,
.ddpfPixelFormat.dwRGBAlphaBitMask = 0xff000000,
.ddpfPixelFormat.u1.dwRGBBitCount = 32,
.ddpfPixelFormat.u2.dwRBitMask = 0xff0000,
.ddpfPixelFormat.u3.dwGBitMask = 0x00ff00,
.ddpfPixelFormat.u4.dwBBitMask = 0x0000ff,
.ddpfPixelFormat.u5.dwRGBAlphaBitMask = 0xff000000,
};
static const DDSURFACEDESC yuy2_format =
@ -229,7 +230,7 @@ static const DDSURFACEDESC yuy2_format =
.ddpfPixelFormat.dwSize = sizeof(DDPIXELFORMAT),
.ddpfPixelFormat.dwFlags = DDPF_FOURCC,
.ddpfPixelFormat.dwFourCC = MAKEFOURCC('Y', 'U', 'Y', '2'),
.ddpfPixelFormat.dwYUVBitCount = 16,
.ddpfPixelFormat.u1.dwYUVBitCount = 16,
};
static const DDSURFACEDESC yv12_format =
@ -239,7 +240,7 @@ static const DDSURFACEDESC yv12_format =
.ddpfPixelFormat.dwSize = sizeof(DDPIXELFORMAT),
.ddpfPixelFormat.dwFlags = DDPF_FOURCC,
.ddpfPixelFormat.dwFourCC = MAKEFOURCC('Y', 'V', '1', '2'),
.ddpfPixelFormat.dwYUVBitCount = 12,
.ddpfPixelFormat.u1.dwYUVBitCount = 12,
};
static const WCHAR primary_video_sink_id[] = L"I{A35FF56A-9FDA-11D0-8FDF-00C04FD9189D}";
@ -3799,9 +3800,9 @@ static void test_ddrawstream_receive_connection(void)
ok(hr == VFW_E_TYPE_NOT_ACCEPTED, "Got hr %#x.\n", hr);
format = yuy2_format;
format.ddpfPixelFormat.dwRBitMask = 0xf800;
format.ddpfPixelFormat.dwGBitMask = 0x07e0;
format.ddpfPixelFormat.dwBBitMask = 0x001f;
format.ddpfPixelFormat.u2.dwRBitMask = 0xf800;
format.ddpfPixelFormat.u3.dwGBitMask = 0x07e0;
format.ddpfPixelFormat.u4.dwBBitMask = 0x001f;
hr = IDirectDrawMediaStream_SetFormat(ddraw_stream, &format, NULL);
ok(hr == S_OK, "Got hr %#x.\n", hr);
@ -5116,7 +5117,7 @@ static void test_ddrawstream_set_format(void)
.dwFlags = DDSD_PIXELFORMAT,
.ddpfPixelFormat.dwSize = sizeof(DDPIXELFORMAT),
.ddpfPixelFormat.dwFlags = DDPF_RGB | DDPF_PALETTEINDEXED1,
.ddpfPixelFormat.dwRGBBitCount = 1,
.ddpfPixelFormat.u1.dwRGBBitCount = 1,
};
static const DDSURFACEDESC rgb2_format =
{
@ -5124,7 +5125,7 @@ static void test_ddrawstream_set_format(void)
.dwFlags = DDSD_PIXELFORMAT,
.ddpfPixelFormat.dwSize = sizeof(DDPIXELFORMAT),
.ddpfPixelFormat.dwFlags = DDPF_RGB | DDPF_PALETTEINDEXED2,
.ddpfPixelFormat.dwRGBBitCount = 2,
.ddpfPixelFormat.u1.dwRGBBitCount = 2,
};
static const DDSURFACEDESC rgb4_format =
{
@ -5132,7 +5133,7 @@ static void test_ddrawstream_set_format(void)
.dwFlags = DDSD_PIXELFORMAT,
.ddpfPixelFormat.dwSize = sizeof(DDPIXELFORMAT),
.ddpfPixelFormat.dwFlags = DDPF_RGB | DDPF_PALETTEINDEXED4,
.ddpfPixelFormat.dwRGBBitCount = 4,
.ddpfPixelFormat.u1.dwRGBBitCount = 4,
};
static const DDSURFACEDESC rgb4to8_format =
{
@ -5140,7 +5141,7 @@ static void test_ddrawstream_set_format(void)
.dwFlags = DDSD_PIXELFORMAT,
.ddpfPixelFormat.dwSize = sizeof(DDPIXELFORMAT),
.ddpfPixelFormat.dwFlags = DDPF_RGB | DDPF_PALETTEINDEXEDTO8,
.ddpfPixelFormat.dwRGBBitCount = 4,
.ddpfPixelFormat.u1.dwRGBBitCount = 4,
};
static const DDSURFACEDESC rgb332_format =
{
@ -5148,10 +5149,10 @@ static void test_ddrawstream_set_format(void)
.dwFlags = DDSD_PIXELFORMAT,
.ddpfPixelFormat.dwSize = sizeof(DDPIXELFORMAT),
.ddpfPixelFormat.dwFlags = DDPF_RGB,
.ddpfPixelFormat.dwRGBBitCount = 8,
.ddpfPixelFormat.dwRBitMask = 0xe0,
.ddpfPixelFormat.dwGBitMask = 0x1c,
.ddpfPixelFormat.dwBBitMask = 0x03,
.ddpfPixelFormat.u1.dwRGBBitCount = 8,
.ddpfPixelFormat.u2.dwRBitMask = 0xe0,
.ddpfPixelFormat.u3.dwGBitMask = 0x1c,
.ddpfPixelFormat.u4.dwBBitMask = 0x03,
};
IDirectDrawMediaStream *ddraw_stream;
@ -5231,19 +5232,19 @@ static void test_ddrawstream_set_format(void)
check_ddrawstream_set_format(ddraw_stream, &format, NULL, DDERR_INVALIDSURFACETYPE);
format = rgb565_format;
format.ddpfPixelFormat.dwRBitMask = 0x001f;
format.ddpfPixelFormat.dwGBitMask = 0x07e0;
format.ddpfPixelFormat.dwBBitMask = 0xf800;
format.ddpfPixelFormat.u2.dwRBitMask = 0x001f;
format.ddpfPixelFormat.u3.dwGBitMask = 0x07e0;
format.ddpfPixelFormat.u4.dwBBitMask = 0xf800;
check_ddrawstream_set_format(ddraw_stream, &format, NULL, DDERR_INVALIDSURFACETYPE);
format = rgb32_format;
format.ddpfPixelFormat.dwRBitMask = 0x00ff00;
format.ddpfPixelFormat.dwGBitMask = 0x0000ff;
format.ddpfPixelFormat.dwBBitMask = 0xff0000;
format.ddpfPixelFormat.u2.dwRBitMask = 0x00ff00;
format.ddpfPixelFormat.u3.dwGBitMask = 0x0000ff;
format.ddpfPixelFormat.u4.dwBBitMask = 0xff0000;
check_ddrawstream_set_format(ddraw_stream, &format, NULL, DDERR_INVALIDSURFACETYPE);
format = yuy2_format;
format.ddpfPixelFormat.dwYUVBitCount = 0;
format.ddpfPixelFormat.u1.dwYUVBitCount = 0;
check_ddrawstream_set_format(ddraw_stream, &format, NULL, E_INVALIDARG);
format = rgb32_format;
@ -5289,10 +5290,10 @@ static void test_ddrawstream_set_format(void)
"Got subtype %s.\n", wine_dbgstr_guid(&source.source.pin.mt.subtype));
hr = IDirectDrawMediaStream_GetFormat(ddraw_stream, &current_format, NULL, &desired_format, NULL);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(current_format.ddpfPixelFormat.dwRGBBitCount == 8,
"Got rgb bit count %u.\n", current_format.ddpfPixelFormat.dwRGBBitCount);
ok(desired_format.ddpfPixelFormat.dwRGBBitCount == 8,
"Got rgb bit count %u.\n", desired_format.ddpfPixelFormat.dwRGBBitCount);
ok(current_format.ddpfPixelFormat.u1.dwRGBBitCount == 8,
"Got rgb bit count %u.\n", current_format.ddpfPixelFormat.u1.dwRGBBitCount);
ok(desired_format.ddpfPixelFormat.u1.dwRGBBitCount == 8,
"Got rgb bit count %u.\n", desired_format.ddpfPixelFormat.u1.dwRGBBitCount);
format = rgb555_format;
format.dwFlags = 0;
@ -5312,10 +5313,10 @@ static void test_ddrawstream_set_format(void)
"Got subtype %s.\n", wine_dbgstr_guid(&source.source.pin.mt.subtype));
hr = IDirectDrawMediaStream_GetFormat(ddraw_stream, &current_format, NULL, &desired_format, NULL);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(current_format.ddpfPixelFormat.dwRGBBitCount == 16,
"Got rgb bit count %u.\n", current_format.ddpfPixelFormat.dwRGBBitCount);
ok(desired_format.ddpfPixelFormat.dwRGBBitCount == 16,
"Got rgb bit count %u.\n", desired_format.ddpfPixelFormat.dwRGBBitCount);
ok(current_format.ddpfPixelFormat.u1.dwRGBBitCount == 16,
"Got rgb bit count %u.\n", current_format.ddpfPixelFormat.u1.dwRGBBitCount);
ok(desired_format.ddpfPixelFormat.u1.dwRGBBitCount == 16,
"Got rgb bit count %u.\n", desired_format.ddpfPixelFormat.u1.dwRGBBitCount);
video_info = rgb555_video_info;
video_info.bmiHeader.biWidth = 222;
@ -7189,7 +7190,7 @@ static void test_ddrawstream_create_sample(void)
ok(desc.dwWidth == 100, "Expected width 100, got %d.\n", desc.dwWidth);
ok(desc.dwHeight == 100, "Expected height 100, got %d.\n", desc.dwHeight);
ok(desc.ddpfPixelFormat.dwFlags == DDPF_RGB, "Expected format flags DDPF_RGB, got %#x.\n", desc.ddpfPixelFormat.dwFlags);
ok(desc.ddpfPixelFormat.dwRGBBitCount, "Expected non-zero RGB bit count.\n");
ok(desc.ddpfPixelFormat.u1.dwRGBBitCount, "Expected non-zero RGB bit count.\n");
IDirectDrawSurface_Release(surface);
IDirectDrawStreamSample_Release(sample);
EXPECT_REF(stream, 3);
@ -7233,11 +7234,11 @@ static void test_ddrawstream_create_sample(void)
desc.dwHeight = 400;
desc.ddpfPixelFormat.dwSize = sizeof(DDPIXELFORMAT);
desc.ddpfPixelFormat.dwFlags = DDPF_RGB | DDPF_ALPHAPIXELS;
desc.ddpfPixelFormat.dwRGBBitCount = 32;
desc.ddpfPixelFormat.dwRBitMask = 0xff0000;
desc.ddpfPixelFormat.dwGBitMask = 0x00ff00;
desc.ddpfPixelFormat.dwBBitMask = 0x0000ff;
desc.ddpfPixelFormat.dwRGBAlphaBitMask = 0xff000000;
desc.ddpfPixelFormat.u1.dwRGBBitCount = 32;
desc.ddpfPixelFormat.u2.dwRBitMask = 0xff0000;
desc.ddpfPixelFormat.u3.dwGBitMask = 0x00ff00;
desc.ddpfPixelFormat.u4.dwBBitMask = 0x0000ff;
desc.ddpfPixelFormat.u5.dwRGBAlphaBitMask = 0xff000000;
desc.ddsCaps.dwCaps = DDSCAPS_SYSTEMMEMORY | DDSCAPS_OFFSCREENPLAIN;
hr = IDirectDraw_CreateSurface(ddraw, &desc, &surface, NULL);
ok(hr == S_OK, "Got hr %#x.\n", hr);
@ -7278,7 +7279,7 @@ static void test_ddrawstream_create_sample(void)
desc.dwHeight = 400;
desc.ddpfPixelFormat.dwSize = sizeof(DDPIXELFORMAT);
desc.ddpfPixelFormat.dwFlags = DDPF_RGB | DDPF_PALETTEINDEXED4;
desc.ddpfPixelFormat.dwRGBBitCount = 4;
desc.ddpfPixelFormat.u1.dwRGBBitCount = 4;
desc.ddsCaps.dwCaps = DDSCAPS_SYSTEMMEMORY | DDSCAPS_OFFSCREENPLAIN;
hr = IDirectDraw_CreateSurface(ddraw, &desc, &surface, NULL);
ok(hr == S_OK, "Got hr %#x.\n", hr);
@ -7304,10 +7305,10 @@ static void test_ddrawstream_create_sample(void)
ok(desc.dwWidth == 100, "Got width %u.\n", desc.dwWidth);
ok(desc.dwHeight == 100, "Got height %u.\n", desc.dwHeight);
ok(desc.ddpfPixelFormat.dwFlags == DDPF_RGB, "Got flags %#x.\n", desc.ddpfPixelFormat.dwFlags);
ok(desc.ddpfPixelFormat.dwRGBBitCount == 32, "Got rgb bit count %u.\n", desc.ddpfPixelFormat.dwRGBBitCount);
ok(desc.ddpfPixelFormat.dwRBitMask == 0xff0000, "Got r bit mask %#x.\n", desc.ddpfPixelFormat.dwRBitMask);
ok(desc.ddpfPixelFormat.dwGBitMask == 0x00ff00, "Got g bit mask %#x.\n", desc.ddpfPixelFormat.dwGBitMask);
ok(desc.ddpfPixelFormat.dwBBitMask == 0x0000ff, "Got b bit mask %#x.\n", desc.ddpfPixelFormat.dwBBitMask);
ok(desc.ddpfPixelFormat.u1.dwRGBBitCount == 32, "Got rgb bit count %u.\n", desc.ddpfPixelFormat.u1.dwRGBBitCount);
ok(desc.ddpfPixelFormat.u2.dwRBitMask == 0xff0000, "Got r bit mask %#x.\n", desc.ddpfPixelFormat.u2.dwRBitMask);
ok(desc.ddpfPixelFormat.u3.dwGBitMask == 0x00ff00, "Got g bit mask %#x.\n", desc.ddpfPixelFormat.u3.dwGBitMask);
ok(desc.ddpfPixelFormat.u4.dwBBitMask == 0x0000ff, "Got b bit mask %#x.\n", desc.ddpfPixelFormat.u4.dwBBitMask);
format1 = rgb8_format;
format1.dwFlags |= DDSD_WIDTH;
@ -7333,30 +7334,30 @@ static void test_ddrawstream_create_sample(void)
ok(desc.dwWidth == 333, "Got width %u.\n", desc.dwWidth);
ok(desc.dwHeight == 444, "Got height %u.\n", desc.dwHeight);
ok(desc.ddpfPixelFormat.dwFlags == DDPF_RGB, "Got flags %#x.\n", desc.ddpfPixelFormat.dwFlags);
ok(desc.ddpfPixelFormat.dwRGBBitCount == 32, "Got rgb bit count %u.\n", desc.ddpfPixelFormat.dwRGBBitCount);
ok(desc.ddpfPixelFormat.dwRBitMask == 0xff0000, "Got r bit mask %#x.\n", desc.ddpfPixelFormat.dwRBitMask);
ok(desc.ddpfPixelFormat.dwGBitMask == 0x00ff00, "Got g bit mask %#x.\n", desc.ddpfPixelFormat.dwGBitMask);
ok(desc.ddpfPixelFormat.dwBBitMask == 0x0000ff, "Got b bit mask %#x.\n", desc.ddpfPixelFormat.dwBBitMask);
ok(desc.ddpfPixelFormat.u1.dwRGBBitCount == 32, "Got rgb bit count %u.\n", desc.ddpfPixelFormat.u1.dwRGBBitCount);
ok(desc.ddpfPixelFormat.u2.dwRBitMask == 0xff0000, "Got r bit mask %#x.\n", desc.ddpfPixelFormat.u2.dwRBitMask);
ok(desc.ddpfPixelFormat.u3.dwGBitMask == 0x00ff00, "Got g bit mask %#x.\n", desc.ddpfPixelFormat.u3.dwGBitMask);
ok(desc.ddpfPixelFormat.u4.dwBBitMask == 0x0000ff, "Got b bit mask %#x.\n", desc.ddpfPixelFormat.u4.dwBBitMask);
get_ddrawstream_create_sample_desc(&rgb565_format, NULL, NULL, &desc);
ok(desc.dwWidth == 100, "Got width %u.\n", desc.dwWidth);
ok(desc.dwHeight == 100, "Got height %u.\n", desc.dwHeight);
ok(desc.ddpfPixelFormat.dwFlags == DDPF_RGB, "Got flags %#x.\n", desc.ddpfPixelFormat.dwFlags);
ok(desc.ddpfPixelFormat.dwRGBBitCount == 16, "Got rgb bit count %u.\n", desc.ddpfPixelFormat.dwRGBBitCount);
ok(desc.ddpfPixelFormat.dwRBitMask == 0xf800, "Got r bit mask %#x.\n", desc.ddpfPixelFormat.dwRBitMask);
ok(desc.ddpfPixelFormat.dwGBitMask == 0x07e0, "Got g bit mask %#x.\n", desc.ddpfPixelFormat.dwGBitMask);
ok(desc.ddpfPixelFormat.dwBBitMask == 0x001f, "Got b bit mask %#x.\n", desc.ddpfPixelFormat.dwBBitMask);
ok(desc.ddpfPixelFormat.u1.dwRGBBitCount == 16, "Got rgb bit count %u.\n", desc.ddpfPixelFormat.u1.dwRGBBitCount);
ok(desc.ddpfPixelFormat.u2.dwRBitMask == 0xf800, "Got r bit mask %#x.\n", desc.ddpfPixelFormat.u2.dwRBitMask);
ok(desc.ddpfPixelFormat.u3.dwGBitMask == 0x07e0, "Got g bit mask %#x.\n", desc.ddpfPixelFormat.u3.dwGBitMask);
ok(desc.ddpfPixelFormat.u4.dwBBitMask == 0x001f, "Got b bit mask %#x.\n", desc.ddpfPixelFormat.u4.dwBBitMask);
get_ddrawstream_create_sample_desc(&argb32_format, NULL, NULL, &desc);
ok(desc.dwWidth == 100, "Got width %u.\n", desc.dwWidth);
ok(desc.dwHeight == 100, "Got height %u.\n", desc.dwHeight);
ok(desc.ddpfPixelFormat.dwFlags == (DDPF_RGB | DDPF_ALPHAPIXELS), "Got flags %#x.\n", desc.ddpfPixelFormat.dwFlags);
ok(desc.ddpfPixelFormat.dwRGBBitCount == 32, "Got rgb bit count %u.\n", desc.ddpfPixelFormat.dwRGBBitCount);
ok(desc.ddpfPixelFormat.dwRBitMask == 0xff0000, "Got r bit mask %#x.\n", desc.ddpfPixelFormat.dwRBitMask);
ok(desc.ddpfPixelFormat.dwGBitMask == 0x00ff00, "Got g bit mask %#x.\n", desc.ddpfPixelFormat.dwGBitMask);
ok(desc.ddpfPixelFormat.dwBBitMask == 0x0000ff, "Got b bit mask %#x.\n", desc.ddpfPixelFormat.dwBBitMask);
ok(desc.ddpfPixelFormat.dwRGBAlphaBitMask == 0xff000000,
"Got alpha bit mask %#x.\n", desc.ddpfPixelFormat.dwBBitMask);
ok(desc.ddpfPixelFormat.u1.dwRGBBitCount == 32, "Got rgb bit count %u.\n", desc.ddpfPixelFormat.u1.dwRGBBitCount);
ok(desc.ddpfPixelFormat.u2.dwRBitMask == 0xff0000, "Got r bit mask %#x.\n", desc.ddpfPixelFormat.u2.dwRBitMask);
ok(desc.ddpfPixelFormat.u3.dwGBitMask == 0x00ff00, "Got g bit mask %#x.\n", desc.ddpfPixelFormat.u3.dwGBitMask);
ok(desc.ddpfPixelFormat.u4.dwBBitMask == 0x0000ff, "Got b bit mask %#x.\n", desc.ddpfPixelFormat.u4.dwBBitMask);
ok(desc.ddpfPixelFormat.u5.dwRGBAlphaBitMask == 0xff000000,
"Got alpha bit mask %#x.\n", desc.ddpfPixelFormat.u4.dwBBitMask);
format1 = rgb32_format;
format1.dwFlags |= DDSD_CAPS;
@ -7368,10 +7369,10 @@ static void test_ddrawstream_create_sample(void)
ok(desc.dwWidth == 100, "Got width %u.\n", desc.dwWidth);
ok(desc.dwHeight == 100, "Got height %u.\n", desc.dwHeight);
ok(desc.ddpfPixelFormat.dwFlags == DDPF_RGB, "Got flags %#x.\n", desc.ddpfPixelFormat.dwFlags);
ok(desc.ddpfPixelFormat.dwRGBBitCount == 32, "Got rgb bit count %u.\n", desc.ddpfPixelFormat.dwRGBBitCount);
ok(desc.ddpfPixelFormat.dwRBitMask == 0xff0000, "Got r bit mask %#x.\n", desc.ddpfPixelFormat.dwRBitMask);
ok(desc.ddpfPixelFormat.dwGBitMask == 0x00ff00, "Got g bit mask %#x.\n", desc.ddpfPixelFormat.dwGBitMask);
ok(desc.ddpfPixelFormat.dwBBitMask == 0x0000ff, "Got b bit mask %#x.\n", desc.ddpfPixelFormat.dwBBitMask);
ok(desc.ddpfPixelFormat.u1.dwRGBBitCount == 32, "Got rgb bit count %u.\n", desc.ddpfPixelFormat.u1.dwRGBBitCount);
ok(desc.ddpfPixelFormat.u2.dwRBitMask == 0xff0000, "Got r bit mask %#x.\n", desc.ddpfPixelFormat.u2.dwRBitMask);
ok(desc.ddpfPixelFormat.u3.dwGBitMask == 0x00ff00, "Got g bit mask %#x.\n", desc.ddpfPixelFormat.u3.dwGBitMask);
ok(desc.ddpfPixelFormat.u4.dwBBitMask == 0x0000ff, "Got b bit mask %#x.\n", desc.ddpfPixelFormat.u4.dwBBitMask);
format1 = rgb32_format;
format1.dwFlags |= DDSD_CKSRCBLT;
@ -7382,10 +7383,10 @@ static void test_ddrawstream_create_sample(void)
ok(desc.dwWidth == 100, "Got width %u.\n", desc.dwWidth);
ok(desc.dwHeight == 100, "Got height %u.\n", desc.dwHeight);
ok(desc.ddpfPixelFormat.dwFlags == DDPF_RGB, "Got flags %#x.\n", desc.ddpfPixelFormat.dwFlags);
ok(desc.ddpfPixelFormat.dwRGBBitCount == 32, "Got rgb bit count %u.\n", desc.ddpfPixelFormat.dwRGBBitCount);
ok(desc.ddpfPixelFormat.dwRBitMask == 0xff0000, "Got r bit mask %#x.\n", desc.ddpfPixelFormat.dwRBitMask);
ok(desc.ddpfPixelFormat.dwGBitMask == 0x00ff00, "Got g bit mask %#x.\n", desc.ddpfPixelFormat.dwGBitMask);
ok(desc.ddpfPixelFormat.dwBBitMask == 0x0000ff, "Got b bit mask %#x.\n", desc.ddpfPixelFormat.dwBBitMask);
ok(desc.ddpfPixelFormat.u1.dwRGBBitCount == 32, "Got rgb bit count %u.\n", desc.ddpfPixelFormat.u1.dwRGBBitCount);
ok(desc.ddpfPixelFormat.u2.dwRBitMask == 0xff0000, "Got r bit mask %#x.\n", desc.ddpfPixelFormat.u2.dwRBitMask);
ok(desc.ddpfPixelFormat.u3.dwGBitMask == 0x00ff00, "Got g bit mask %#x.\n", desc.ddpfPixelFormat.u3.dwGBitMask);
ok(desc.ddpfPixelFormat.u4.dwBBitMask == 0x0000ff, "Got b bit mask %#x.\n", desc.ddpfPixelFormat.u4.dwBBitMask);
ok(desc.ddckCKSrcBlt.dwColorSpaceLowValue == 0, "Got color key low value %#x.\n",
desc.ddckCKSrcBlt.dwColorSpaceLowValue);
ok(desc.ddckCKSrcBlt.dwColorSpaceHighValue == 0, "Got color key high value %#x.\n",
@ -7557,7 +7558,7 @@ static void test_ddrawstreamsample_update(void)
hr = IDirectDrawSurface_Lock(surface, NULL, &desc, 0, NULL);
ok(hr == S_OK, "Got hr %#x.\n", hr);
for (i = 0; i < 5; ++i)
memcpy((BYTE *)desc.lpSurface + i * desc.lPitch, initial_data, 12);
memcpy((BYTE *)desc.lpSurface + i * desc.u1.lPitch, initial_data, 12);
hr = IDirectDrawSurface_Unlock(surface, desc.lpSurface);
ok(hr == S_OK, "Got hr %#x.\n", hr);
@ -7574,11 +7575,11 @@ static void test_ddrawstreamsample_update(void)
ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IDirectDrawSurface_Lock(surface, NULL, &desc, 0, NULL);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(memcmp((BYTE *)desc.lpSurface + 0 * desc.lPitch, initial_data, 12) == 0, "Sample data didn't match.\n");
ok(memcmp((BYTE *)desc.lpSurface + 1 * desc.lPitch, &test_data[0], 12) == 0, "Sample data didn't match.\n");
ok(memcmp((BYTE *)desc.lpSurface + 2 * desc.lPitch, &test_data[12], 12) == 0, "Sample data didn't match.\n");
ok(memcmp((BYTE *)desc.lpSurface + 3 * desc.lPitch, initial_data, 12) == 0, "Sample data didn't match.\n");
ok(memcmp((BYTE *)desc.lpSurface + 4 * desc.lPitch, initial_data, 12) == 0, "Sample data didn't match.\n");
ok(memcmp((BYTE *)desc.lpSurface + 0 * desc.u1.lPitch, initial_data, 12) == 0, "Sample data didn't match.\n");
ok(memcmp((BYTE *)desc.lpSurface + 1 * desc.u1.lPitch, &test_data[0], 12) == 0, "Sample data didn't match.\n");
ok(memcmp((BYTE *)desc.lpSurface + 2 * desc.u1.lPitch, &test_data[12], 12) == 0, "Sample data didn't match.\n");
ok(memcmp((BYTE *)desc.lpSurface + 3 * desc.u1.lPitch, initial_data, 12) == 0, "Sample data didn't match.\n");
ok(memcmp((BYTE *)desc.lpSurface + 4 * desc.u1.lPitch, initial_data, 12) == 0, "Sample data didn't match.\n");
hr = IDirectDrawSurface_Unlock(surface, desc.lpSurface);
ok(hr == S_OK, "Got hr %#x.\n", hr);
@ -7605,7 +7606,7 @@ static void test_ddrawstreamsample_update(void)
hr = IDirectDrawSurface_Lock(surface, NULL, &desc, 0, NULL);
ok(hr == S_OK, "Got hr %#x.\n", hr);
for (i = 0; i < 5; ++i)
memcpy((BYTE *)desc.lpSurface + i * desc.lPitch, initial_data, 12);
memcpy((BYTE *)desc.lpSurface + i * desc.u1.lPitch, initial_data, 12);
hr = IDirectDrawSurface_Unlock(surface, desc.lpSurface);
ok(hr == S_OK, "Got hr %#x.\n", hr);
@ -7622,11 +7623,11 @@ static void test_ddrawstreamsample_update(void)
ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IDirectDrawSurface_Lock(surface, NULL, &desc, 0, NULL);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(memcmp((BYTE *)desc.lpSurface + 0 * desc.lPitch, initial_data, 12) == 0, "Sample data didn't match.\n");
ok(memcmp((BYTE *)desc.lpSurface + 1 * desc.lPitch, &test_data[12], 12) == 0, "Sample data didn't match.\n");
ok(memcmp((BYTE *)desc.lpSurface + 2 * desc.lPitch, &test_data[0], 12) == 0, "Sample data didn't match.\n");
ok(memcmp((BYTE *)desc.lpSurface + 3 * desc.lPitch, initial_data, 12) == 0, "Sample data didn't match.\n");
ok(memcmp((BYTE *)desc.lpSurface + 4 * desc.lPitch, initial_data, 12) == 0, "Sample data didn't match.\n");
ok(memcmp((BYTE *)desc.lpSurface + 0 * desc.u1.lPitch, initial_data, 12) == 0, "Sample data didn't match.\n");
ok(memcmp((BYTE *)desc.lpSurface + 1 * desc.u1.lPitch, &test_data[12], 12) == 0, "Sample data didn't match.\n");
ok(memcmp((BYTE *)desc.lpSurface + 2 * desc.u1.lPitch, &test_data[0], 12) == 0, "Sample data didn't match.\n");
ok(memcmp((BYTE *)desc.lpSurface + 3 * desc.u1.lPitch, initial_data, 12) == 0, "Sample data didn't match.\n");
ok(memcmp((BYTE *)desc.lpSurface + 4 * desc.u1.lPitch, initial_data, 12) == 0, "Sample data didn't match.\n");
hr = IDirectDrawSurface_Unlock(surface, desc.lpSurface);
ok(hr == S_OK, "Got hr %#x.\n", hr);
@ -7658,7 +7659,7 @@ static void test_ddrawstreamsample_update(void)
hr = IDirectDrawSurface_Lock(surface, NULL, &desc, 0, NULL);
ok(hr == S_OK, "Got hr %#x.\n", hr);
for (i = 0; i < 5; ++i)
memcpy((BYTE *)desc.lpSurface + i * desc.lPitch, initial_data, 12);
memcpy((BYTE *)desc.lpSurface + i * desc.u1.lPitch, initial_data, 12);
hr = IDirectDrawSurface_Unlock(surface, desc.lpSurface);
ok(hr == S_OK, "Got hr %#x.\n", hr);
@ -7674,11 +7675,11 @@ static void test_ddrawstreamsample_update(void)
ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IDirectDrawSurface_Lock(surface, NULL, &desc, 0, NULL);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(memcmp((BYTE *)desc.lpSurface + 0 * desc.lPitch, initial_data, 12) == 0, "Sample data didn't match.\n");
ok(memcmp((BYTE *)desc.lpSurface + 1 * desc.lPitch, &test_data[12], 12) == 0, "Sample data didn't match.\n");
ok(memcmp((BYTE *)desc.lpSurface + 2 * desc.lPitch, &test_data[0], 12) == 0, "Sample data didn't match.\n");
ok(memcmp((BYTE *)desc.lpSurface + 3 * desc.lPitch, initial_data, 12) == 0, "Sample data didn't match.\n");
ok(memcmp((BYTE *)desc.lpSurface + 4 * desc.lPitch, initial_data, 12) == 0, "Sample data didn't match.\n");
ok(memcmp((BYTE *)desc.lpSurface + 0 * desc.u1.lPitch, initial_data, 12) == 0, "Sample data didn't match.\n");
ok(memcmp((BYTE *)desc.lpSurface + 1 * desc.u1.lPitch, &test_data[12], 12) == 0, "Sample data didn't match.\n");
ok(memcmp((BYTE *)desc.lpSurface + 2 * desc.u1.lPitch, &test_data[0], 12) == 0, "Sample data didn't match.\n");
ok(memcmp((BYTE *)desc.lpSurface + 3 * desc.u1.lPitch, initial_data, 12) == 0, "Sample data didn't match.\n");
ok(memcmp((BYTE *)desc.lpSurface + 4 * desc.u1.lPitch, initial_data, 12) == 0, "Sample data didn't match.\n");
hr = IDirectDrawSurface_Unlock(surface, desc.lpSurface);
ok(hr == S_OK, "Got hr %#x.\n", hr);
@ -7707,7 +7708,7 @@ static void test_ddrawstreamsample_update(void)
hr = IDirectDrawSurface_Lock(surface, NULL, &desc, 0, NULL);
ok(hr == S_OK, "Got hr %#x.\n", hr);
for (i = 0; i < 5; ++i)
memcpy((BYTE *)desc.lpSurface + i * desc.lPitch, initial_data, 12);
memcpy((BYTE *)desc.lpSurface + i * desc.u1.lPitch, initial_data, 12);
hr = IDirectDrawSurface_Unlock(surface, desc.lpSurface);
ok(hr == S_OK, "Got hr %#x.\n", hr);
@ -7723,11 +7724,11 @@ static void test_ddrawstreamsample_update(void)
ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IDirectDrawSurface_Lock(surface, NULL, &desc, 0, NULL);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(memcmp((BYTE *)desc.lpSurface + 0 * desc.lPitch, initial_data, 12) == 0, "Sample data didn't match.\n");
ok(memcmp((BYTE *)desc.lpSurface + 1 * desc.lPitch, &test_data[12], 12) == 0, "Sample data didn't match.\n");
ok(memcmp((BYTE *)desc.lpSurface + 2 * desc.lPitch, &test_data[0], 12) == 0, "Sample data didn't match.\n");
ok(memcmp((BYTE *)desc.lpSurface + 3 * desc.lPitch, initial_data, 12) == 0, "Sample data didn't match.\n");
ok(memcmp((BYTE *)desc.lpSurface + 4 * desc.lPitch, initial_data, 12) == 0, "Sample data didn't match.\n");
ok(memcmp((BYTE *)desc.lpSurface + 0 * desc.u1.lPitch, initial_data, 12) == 0, "Sample data didn't match.\n");
ok(memcmp((BYTE *)desc.lpSurface + 1 * desc.u1.lPitch, &test_data[12], 12) == 0, "Sample data didn't match.\n");
ok(memcmp((BYTE *)desc.lpSurface + 2 * desc.u1.lPitch, &test_data[0], 12) == 0, "Sample data didn't match.\n");
ok(memcmp((BYTE *)desc.lpSurface + 3 * desc.u1.lPitch, initial_data, 12) == 0, "Sample data didn't match.\n");
ok(memcmp((BYTE *)desc.lpSurface + 4 * desc.u1.lPitch, initial_data, 12) == 0, "Sample data didn't match.\n");
hr = IDirectDrawSurface_Unlock(surface, desc.lpSurface);
ok(hr == S_OK, "Got hr %#x.\n", hr);
@ -7743,7 +7744,7 @@ static void test_ddrawstreamsample_update(void)
hr = IDirectDrawSurface_Lock(surface, NULL, &desc, 0, NULL);
ok(hr == S_OK, "Got hr %#x.\n", hr);
for (i = 0; i < 5; ++i)
memcpy((BYTE *)desc.lpSurface + i * desc.lPitch, initial_data, 12);
memcpy((BYTE *)desc.lpSurface + i * desc.u1.lPitch, initial_data, 12);
hr = IDirectDrawSurface_Unlock(surface, desc.lpSurface);
ok(hr == S_OK, "Got hr %#x.\n", hr);
@ -7755,18 +7756,18 @@ static void test_ddrawstreamsample_update(void)
hr = IDirectDrawSurface_Lock(surface, NULL, &desc, 0, NULL);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(memcmp((BYTE *)desc.lpSurface + 0 * desc.lPitch, initial_data, 12) == 0, "Sample data didn't match.\n");
ok(memcmp((BYTE *)desc.lpSurface + 1 * desc.lPitch, &test_data[12], 12) == 0, "Sample data didn't match.\n");
ok(memcmp((BYTE *)desc.lpSurface + 2 * desc.lPitch, &test_data[0], 12) == 0, "Sample data didn't match.\n");
ok(memcmp((BYTE *)desc.lpSurface + 3 * desc.lPitch, initial_data, 12) == 0, "Sample data didn't match.\n");
ok(memcmp((BYTE *)desc.lpSurface + 4 * desc.lPitch, initial_data, 12) == 0, "Sample data didn't match.\n");
ok(memcmp((BYTE *)desc.lpSurface + 0 * desc.u1.lPitch, initial_data, 12) == 0, "Sample data didn't match.\n");
ok(memcmp((BYTE *)desc.lpSurface + 1 * desc.u1.lPitch, &test_data[12], 12) == 0, "Sample data didn't match.\n");
ok(memcmp((BYTE *)desc.lpSurface + 2 * desc.u1.lPitch, &test_data[0], 12) == 0, "Sample data didn't match.\n");
ok(memcmp((BYTE *)desc.lpSurface + 3 * desc.u1.lPitch, initial_data, 12) == 0, "Sample data didn't match.\n");
ok(memcmp((BYTE *)desc.lpSurface + 4 * desc.u1.lPitch, initial_data, 12) == 0, "Sample data didn't match.\n");
hr = IDirectDrawSurface_Unlock(surface, desc.lpSurface);
ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IDirectDrawSurface_Lock(surface, NULL, &desc, 0, NULL);
ok(hr == S_OK, "Got hr %#x.\n", hr);
for (i = 0; i < 5; ++i)
memcpy((BYTE *)desc.lpSurface + i * desc.lPitch, initial_data, 12);
memcpy((BYTE *)desc.lpSurface + i * desc.u1.lPitch, initial_data, 12);
hr = IDirectDrawSurface_Unlock(surface, desc.lpSurface);
ok(hr == S_OK, "Got hr %#x.\n", hr);
@ -7778,11 +7779,11 @@ static void test_ddrawstreamsample_update(void)
hr = IDirectDrawSurface_Lock(surface, NULL, &desc, 0, NULL);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(memcmp((BYTE *)desc.lpSurface + 0 * desc.lPitch, initial_data, 12) == 0, "Sample data didn't match.\n");
ok(memcmp((BYTE *)desc.lpSurface + 1 * desc.lPitch, &test_data[12], 12) == 0, "Sample data didn't match.\n");
ok(memcmp((BYTE *)desc.lpSurface + 2 * desc.lPitch, &test_data[0], 12) == 0, "Sample data didn't match.\n");
ok(memcmp((BYTE *)desc.lpSurface + 3 * desc.lPitch, initial_data, 12) == 0, "Sample data didn't match.\n");
ok(memcmp((BYTE *)desc.lpSurface + 4 * desc.lPitch, initial_data, 12) == 0, "Sample data didn't match.\n");
ok(memcmp((BYTE *)desc.lpSurface + 0 * desc.u1.lPitch, initial_data, 12) == 0, "Sample data didn't match.\n");
ok(memcmp((BYTE *)desc.lpSurface + 1 * desc.u1.lPitch, &test_data[12], 12) == 0, "Sample data didn't match.\n");
ok(memcmp((BYTE *)desc.lpSurface + 2 * desc.u1.lPitch, &test_data[0], 12) == 0, "Sample data didn't match.\n");
ok(memcmp((BYTE *)desc.lpSurface + 3 * desc.u1.lPitch, initial_data, 12) == 0, "Sample data didn't match.\n");
ok(memcmp((BYTE *)desc.lpSurface + 4 * desc.u1.lPitch, initial_data, 12) == 0, "Sample data didn't match.\n");
hr = IDirectDrawSurface_Unlock(surface, desc.lpSurface);
ok(hr == S_OK, "Got hr %#x.\n", hr);
@ -7811,7 +7812,7 @@ static void test_ddrawstreamsample_update(void)
hr = IDirectDrawSurface_Lock(surface, NULL, &desc, 0, NULL);
ok(hr == S_OK, "Got hr %#x.\n", hr);
for (i = 0; i < 5; ++i)
memcpy((BYTE *)desc.lpSurface + i * desc.lPitch, initial_data, 12);
memcpy((BYTE *)desc.lpSurface + i * desc.u1.lPitch, initial_data, 12);
hr = IDirectDrawSurface_Unlock(surface, desc.lpSurface);
ok(hr == S_OK, "Got hr %#x.\n", hr);
@ -7837,7 +7838,7 @@ static void test_ddrawstreamsample_update(void)
hr = IDirectDrawSurface_Lock(surface, NULL, &desc, 0, NULL);
ok(hr == S_OK, "Got hr %#x.\n", hr);
for (i = 0; i < 5; ++i)
ok(memcmp((BYTE *)desc.lpSurface + i * desc.lPitch, initial_data, 12) == 0, "Sample data didn't match.\n");
ok(memcmp((BYTE *)desc.lpSurface + i * desc.u1.lPitch, initial_data, 12) == 0, "Sample data didn't match.\n");
hr = IDirectDrawSurface_Unlock(surface, desc.lpSurface);
ok(hr == S_OK, "Got hr %#x.\n", hr);
@ -7848,11 +7849,11 @@ static void test_ddrawstreamsample_update(void)
hr = IDirectDrawSurface_Lock(surface, NULL, &desc, 0, NULL);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(memcmp((BYTE *)desc.lpSurface + 0 * desc.lPitch, initial_data, 12) == 0, "Sample data didn't match.\n");
ok(memcmp((BYTE *)desc.lpSurface + 1 * desc.lPitch, &test_data[12], 12) == 0, "Sample data didn't match.\n");
ok(memcmp((BYTE *)desc.lpSurface + 2 * desc.lPitch, &test_data[0], 12) == 0, "Sample data didn't match.\n");
ok(memcmp((BYTE *)desc.lpSurface + 3 * desc.lPitch, initial_data, 12) == 0, "Sample data didn't match.\n");
ok(memcmp((BYTE *)desc.lpSurface + 4 * desc.lPitch, initial_data, 12) == 0, "Sample data didn't match.\n");
ok(memcmp((BYTE *)desc.lpSurface + 0 * desc.u1.lPitch, initial_data, 12) == 0, "Sample data didn't match.\n");
ok(memcmp((BYTE *)desc.lpSurface + 1 * desc.u1.lPitch, &test_data[12], 12) == 0, "Sample data didn't match.\n");
ok(memcmp((BYTE *)desc.lpSurface + 2 * desc.u1.lPitch, &test_data[0], 12) == 0, "Sample data didn't match.\n");
ok(memcmp((BYTE *)desc.lpSurface + 3 * desc.u1.lPitch, initial_data, 12) == 0, "Sample data didn't match.\n");
ok(memcmp((BYTE *)desc.lpSurface + 4 * desc.u1.lPitch, initial_data, 12) == 0, "Sample data didn't match.\n");
hr = IDirectDrawSurface_Unlock(surface, desc.lpSurface);
ok(hr == S_OK, "Got hr %#x.\n", hr);