Wine-Devel
By thread
wine-devel@list.winehq.org
By month
Messages by month
- ----- 2026 -----
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2002 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2001 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
June 2019
- 73 participants
- 1462 messages
[PATCH v2 4/6] user32: Add helper for input drivers to submit native rawinput msgs.
by Derek Lesho
Signed-off-by: Derek Lesho <dereklesho52(a)Gmail.com>
---
dlls/user32/input.c | 29 +++++++++++++++++++++++++++++
dlls/user32/user32.spec | 1 +
include/winuser.h | 1 +
3 files changed, 31 insertions(+)
diff --git a/dlls/user32/input.c b/dlls/user32/input.c
index 8b2ae805aa..f7ef1c3be2 100644
--- a/dlls/user32/input.c
+++ b/dlls/user32/input.c
@@ -33,6 +33,7 @@
#include <assert.h>
#define NONAMELESSUNION
+#define NONAMELESSSTRUCT
#include "ntstatus.h"
#define WIN32_NO_STATUS
@@ -129,6 +130,34 @@ BOOL CDECL __wine_send_input( HWND hwnd, const INPUT *input )
return !status;
}
+BOOL CDECL __wine_send_raw_input( const RAWINPUT *raw_input )
+{
+ NTSTATUS status;
+
+ SERVER_START_REQ( send_rawinput_message )
+ {
+ req->input.type = raw_input->header.dwType;
+ switch (raw_input->header.dwType)
+ {
+ case RIM_TYPEMOUSE:
+ if (raw_input->data.mouse.usFlags || raw_input->data.mouse.ulRawButtons
+ || raw_input->data.mouse.ulExtraInformation)
+ WARN("Unhandled parameters");
+
+ req->input.mouse.x = raw_input->data.mouse.lLastX;
+ req->input.mouse.y = raw_input->data.mouse.lLastY;
+ req->input.mouse.button_flags = raw_input->data.mouse.u.s.usButtonFlags;
+ req->input.mouse.button_data = raw_input->data.mouse.u.s.usButtonData;
+ break;
+ }
+ status = wine_server_call( req );
+ }
+ SERVER_END_REQ;
+
+ if (status) SetLastError( RtlNtStatusToDosError(status) );
+ return !status;
+}
+
/***********************************************************************
* update_mouse_coords
diff --git a/dlls/user32/user32.spec b/dlls/user32/user32.spec
index d5b8597d8e..7103b86055 100644
--- a/dlls/user32/user32.spec
+++ b/dlls/user32/user32.spec
@@ -832,4 +832,5 @@
# or 'wine_' (for user-visible functions) to avoid namespace conflicts.
#
@ cdecl __wine_send_input(long ptr)
+@ cdecl __wine_send_raw_input(ptr)
@ cdecl __wine_set_pixel_format(long long)
diff --git a/include/winuser.h b/include/winuser.h
index 3cffaa19ac..5d8774b6e6 100644
--- a/include/winuser.h
+++ b/include/winuser.h
@@ -4354,6 +4354,7 @@ WORD WINAPI SYSTEM_KillSystemTimer( WORD );
#ifdef __WINESRC__
WINUSERAPI BOOL CDECL __wine_send_input( HWND hwnd, const INPUT *input );
+WINUSERAPI BOOL CDECL __wine_send_raw_input( const RAWINPUT *raw_input );
#endif
#ifdef __cplusplus
--
2.21.0
June 30, 2019
[PATCH v2 3/6] server: Add request for sending native raw-input messages.
by Derek Lesho
Signed-off-by: Derek Lesho <dereklesho52(a)Gmail.com>
---
server/protocol.def | 28 ++++++++++++++++++++++++++++
server/queue.c | 41 +++++++++++++++++++++++++++++++++++++++++
server/trace.c | 21 +++++++++++++++++++++
tools/make_requests | 1 +
4 files changed, 91 insertions(+)
diff --git a/server/protocol.def b/server/protocol.def
index 8b8a8a1512..3a6a202f49 100644
--- a/server/protocol.def
+++ b/server/protocol.def
@@ -358,6 +358,29 @@ typedef union
} hw;
} hw_input_t;
+typedef union
+{
+ int type;
+ struct
+ {
+ int type; /* RIM_TYPEMOUSE */
+ int x; /* relative x movement */
+ int y; /* relative y movement */
+ unsigned short button_flags; /* mouse button */
+ unsigned short button_data; /* event details */
+ } mouse;
+ struct
+ {
+ int type; /* RIM_TYPEKEYBOARD */
+ /* TODO: fill this in if/when necessary */
+ } kbd;
+ struct
+ {
+ int type; /* RIM_TYPEHID */
+ /* TODO: fill this in if/when necessary */
+ } hid;
+} hw_rawinput_t;
+
typedef union
{
unsigned char bytes[1]; /* raw data for sent messages */
@@ -2294,6 +2317,11 @@ enum message_type
#define SEND_HWMSG_INJECTED 0x01
+(a)REQ(send_rawinput_message)
+ hw_rawinput_t input;
+(a)END
+
+
/* Get a message from the current queue */
@REQ(get_message)
unsigned int flags; /* PM_* flags */
diff --git a/server/queue.c b/server/queue.c
index d12db927b9..35cfcecff5 100644
--- a/server/queue.c
+++ b/server/queue.c
@@ -2421,6 +2421,47 @@ DECL_HANDLER(send_hardware_message)
release_object( desktop );
}
+/* send a hardware rawinput message to the queue thread */
+DECL_HANDLER(send_rawinput_message)
+{
+ const struct rawinput_device *device;
+ struct hardware_msg_data *msg_data;
+ struct message *msg;
+ struct desktop *desktop;
+ struct hw_msg_source source = { IMDT_MOUSE, IMO_HARDWARE };
+
+ desktop = get_thread_desktop( current, 0 );
+
+ switch (req->input.type)
+ {
+ case RIM_TYPEMOUSE:
+ if ((device = current->process->rawinput_mouse))
+ {
+ if (!(msg = alloc_hardware_message( 0, source, 0 ))) return;
+ msg_data = msg->data;
+
+ msg->win = device->target;
+ msg->msg = WM_INPUT;
+ msg->wparam = RIM_INPUT;
+ msg->lparam = 0;
+
+ msg_data->flags = 0;
+ msg_data->rawinput.type = RIM_TYPEMOUSE;
+ msg_data->rawinput.mouse.x = req->input.mouse.x;
+ msg_data->rawinput.mouse.y = req->input.mouse.y;
+ msg_data->rawinput.mouse.button_flags = req->input.mouse.button_flags;
+ msg_data->rawinput.mouse.button_data = req->input.mouse.button_data;
+
+ queue_hardware_message( desktop, msg, 0 );
+ }
+ break;
+ default:
+ set_error( STATUS_INVALID_PARAMETER );
+ }
+
+ release_object(desktop);
+}
+
/* post a quit message to the current queue */
DECL_HANDLER(post_quit_message)
{
diff --git a/server/trace.c b/server/trace.c
index 3562823659..bccab449cf 100644
--- a/server/trace.c
+++ b/server/trace.c
@@ -390,6 +390,27 @@ static void dump_hw_input( const char *prefix, const hw_input_t *input )
}
}
+static void dump_hw_rawinput( const char *prefix, const hw_rawinput_t *rawinput )
+{
+ switch (rawinput->type)
+ {
+ case RIM_TYPEMOUSE:
+ fprintf( stderr, "%s{type=MOUSE,x=%d,y=%d,button_flags=%04hx,button_data=%04hx}",
+ prefix, rawinput->mouse.x, rawinput->mouse.y, rawinput->mouse.button_flags,
+ rawinput->mouse.button_data);
+ break;
+ case RIM_TYPEKEYBOARD:
+ fprintf( stderr, "%s{type=KEYBOARD}\n", prefix);
+ break;
+ case RIM_TYPEHID:
+ fprintf( stderr, "%s{type=HID}\n", prefix);
+ break;
+ default:
+ fprintf( stderr, "%s{type=%04x}", prefix, rawinput->type);
+ break;
+ }
+}
+
static void dump_luid( const char *prefix, const luid_t *luid )
{
fprintf( stderr, "%s%d.%u", prefix, luid->high_part, luid->low_part );
diff --git a/tools/make_requests b/tools/make_requests
index 367f245653..cf631923a7 100755
--- a/tools/make_requests
+++ b/tools/make_requests
@@ -53,6 +53,7 @@ my %formats =
"ioctl_code_t" => [ 4, 4, "&dump_ioctl_code" ],
"cpu_type_t" => [ 4, 4, "&dump_cpu_type" ],
"hw_input_t" => [ 32, 8, "&dump_hw_input" ],
+ "hw_rawinput_t" => [ 16, 8, "&dump_hw_rawinput" ]
);
my @requests = ();
--
2.21.0
June 30, 2019
[PATCH v2 2/6] server: Move mouse raw-input message faking from user32 to wineserver.
by Derek Lesho
Signed-off-by: Derek Lesho <dereklesho52(a)Gmail.com>
---
dlls/user32/message.c | 46 +++----------------------------------------
server/protocol.def | 9 +++++----
server/queue.c | 46 +++++++++++++++++++++++++++++++++++++++++--
3 files changed, 52 insertions(+), 49 deletions(-)
diff --git a/dlls/user32/message.c b/dlls/user32/message.c
index 43ce77c2dd..b6dd7d5932 100644
--- a/dlls/user32/message.c
+++ b/dlls/user32/message.c
@@ -2295,54 +2295,14 @@ static BOOL process_rawinput_message( MSG *msg, const struct hardware_msg_data *
rawinput->header.dwType = msg_data->rawinput.type;
if (msg_data->rawinput.type == RIM_TYPEMOUSE)
{
- static const unsigned int button_flags[] =
- {
- 0, /* MOUSEEVENTF_MOVE */
- RI_MOUSE_LEFT_BUTTON_DOWN, /* MOUSEEVENTF_LEFTDOWN */
- RI_MOUSE_LEFT_BUTTON_UP, /* MOUSEEVENTF_LEFTUP */
- RI_MOUSE_RIGHT_BUTTON_DOWN, /* MOUSEEVENTF_RIGHTDOWN */
- RI_MOUSE_RIGHT_BUTTON_UP, /* MOUSEEVENTF_RIGHTUP */
- RI_MOUSE_MIDDLE_BUTTON_DOWN, /* MOUSEEVENTF_MIDDLEDOWN */
- RI_MOUSE_MIDDLE_BUTTON_UP, /* MOUSEEVENTF_MIDDLEUP */
- };
- unsigned int i;
-
rawinput->header.dwSize = FIELD_OFFSET(RAWINPUT, data) + sizeof(RAWMOUSE);
rawinput->header.hDevice = WINE_MOUSE_HANDLE;
rawinput->header.wParam = 0;
rawinput->data.mouse.usFlags = MOUSE_MOVE_RELATIVE;
- rawinput->data.mouse.u.s.usButtonFlags = 0;
- rawinput->data.mouse.u.s.usButtonData = 0;
- for (i = 1; i < ARRAY_SIZE(button_flags); ++i)
- {
- if (msg_data->flags & (1 << i))
- rawinput->data.mouse.u.s.usButtonFlags |= button_flags[i];
- }
- if (msg_data->flags & MOUSEEVENTF_WHEEL)
- {
- rawinput->data.mouse.u.s.usButtonFlags |= RI_MOUSE_WHEEL;
- rawinput->data.mouse.u.s.usButtonData = msg_data->rawinput.mouse.data;
- }
- if (msg_data->flags & MOUSEEVENTF_HWHEEL)
- {
- rawinput->data.mouse.u.s.usButtonFlags |= RI_MOUSE_HORIZONTAL_WHEEL;
- rawinput->data.mouse.u.s.usButtonData = msg_data->rawinput.mouse.data;
- }
- if (msg_data->flags & MOUSEEVENTF_XDOWN)
- {
- if (msg_data->rawinput.mouse.data == XBUTTON1)
- rawinput->data.mouse.u.s.usButtonFlags |= RI_MOUSE_BUTTON_4_DOWN;
- else if (msg_data->rawinput.mouse.data == XBUTTON2)
- rawinput->data.mouse.u.s.usButtonFlags |= RI_MOUSE_BUTTON_5_DOWN;
- }
- if (msg_data->flags & MOUSEEVENTF_XUP)
- {
- if (msg_data->rawinput.mouse.data == XBUTTON1)
- rawinput->data.mouse.u.s.usButtonFlags |= RI_MOUSE_BUTTON_4_UP;
- else if (msg_data->rawinput.mouse.data == XBUTTON2)
- rawinput->data.mouse.u.s.usButtonFlags |= RI_MOUSE_BUTTON_5_UP;
- }
+
+ rawinput->data.mouse.u.s.usButtonFlags = msg_data->rawinput.mouse.button_flags;
+ rawinput->data.mouse.u.s.usButtonData = msg_data->rawinput.mouse.button_data;
rawinput->data.mouse.ulRawButtons = 0;
rawinput->data.mouse.lLastX = msg_data->rawinput.mouse.x;
diff --git a/server/protocol.def b/server/protocol.def
index 5adc83db8b..8b8a8a1512 100644
--- a/server/protocol.def
+++ b/server/protocol.def
@@ -304,10 +304,11 @@ struct hardware_msg_data
} kbd;
struct
{
- int type; /* RIM_TYPEMOUSE */
- int x; /* x coordinate */
- int y; /* y coordinate */
- unsigned int data; /* mouse data */
+ int type; /* RIM_TYPEMOUSE */
+ int x; /* x coordinate */
+ int y; /* y coordinate */
+ unsigned short button_flags; /* mouse button */
+ unsigned short button_data; /* event details */
} mouse;
} rawinput;
};
diff --git a/server/queue.c b/server/queue.c
index 0ab5adfead..d12db927b9 100644
--- a/server/queue.c
+++ b/server/queue.c
@@ -1627,6 +1627,16 @@ static int queue_mouse_message( struct desktop *desktop, user_handle_t win, cons
WM_MOUSEHWHEEL /* 0x1000 = MOUSEEVENTF_HWHEEL */
};
+ static const unsigned int raw_button_flags[] = {
+ 0, /* 0x0001 = MOUSEEVENTF_MOVE */
+ RI_MOUSE_LEFT_BUTTON_DOWN, /* 0x0002 = MOUSEEVENTF_LEFTDOWN */
+ RI_MOUSE_LEFT_BUTTON_UP, /* 0x0004 = MOUSEEVENTF_LEFTUP */
+ RI_MOUSE_RIGHT_BUTTON_DOWN, /* 0x0008 = MOUSEEVENTF_RIGHTDOWN */
+ RI_MOUSE_RIGHT_BUTTON_UP, /* 0x0010 = MOUSEEVENTF_RIGHTUP */
+ RI_MOUSE_MIDDLE_BUTTON_DOWN, /* 0x0020 = MOUSEEVENTF_MIDDLEDOWN */
+ RI_MOUSE_MIDDLE_BUTTON_UP, /* 0x0040 = MOUSEEVENTF_MIDDLEUP */
+ };
+
desktop->cursor.last_change = get_tick_count();
flags = input->mouse.flags;
time = input->mouse.time;
@@ -1664,11 +1674,43 @@ static int queue_mouse_message( struct desktop *desktop, user_handle_t win, cons
msg->wparam = RIM_INPUT;
msg->lparam = 0;
- msg_data->flags = flags;
+ msg_data->flags = 0;
msg_data->rawinput.type = RIM_TYPEMOUSE;
msg_data->rawinput.mouse.x = x - desktop->cursor.x;
msg_data->rawinput.mouse.y = y - desktop->cursor.y;
- msg_data->rawinput.mouse.data = input->mouse.data;
+ msg_data->rawinput.mouse.button_flags = 0;
+ msg_data->rawinput.mouse.button_data = 0;
+
+ for (i = 1; i < ARRAY_SIZE(raw_button_flags); ++i)
+ {
+ if (flags & (1 << i))
+ msg_data->rawinput.mouse.button_flags |= raw_button_flags[i];
+ }
+
+ if (flags & MOUSEEVENTF_WHEEL)
+ {
+ msg_data->rawinput.mouse.button_flags |= RI_MOUSE_WHEEL;
+ msg_data->rawinput.mouse.button_data = input->mouse.data;
+ }
+ if (flags & MOUSEEVENTF_HWHEEL)
+ {
+ msg_data->rawinput.mouse.button_flags |= RI_MOUSE_HORIZONTAL_WHEEL;
+ msg_data->rawinput.mouse.button_data = input->mouse.data;
+ }
+ if (flags & MOUSEEVENTF_XDOWN)
+ {
+ if (input->mouse.data == XBUTTON1)
+ msg_data->rawinput.mouse.button_flags |= RI_MOUSE_BUTTON_4_DOWN;
+ else if (input->mouse.data == XBUTTON2)
+ msg_data->rawinput.mouse.button_flags |= RI_MOUSE_BUTTON_5_DOWN;
+ }
+ if (flags & MOUSEEVENTF_XUP)
+ {
+ if (input->mouse.data == XBUTTON1)
+ msg_data->rawinput.mouse.button_flags |= RI_MOUSE_BUTTON_4_UP;
+ else if (input->mouse.data == XBUTTON2)
+ msg_data->rawinput.mouse.button_flags |= RI_MOUSE_BUTTON_5_UP;
+ }
queue_hardware_message( desktop, msg, 0 );
--
2.21.0
June 30, 2019
[PATCH v2 1/6] user32: Add support for RIDEV_NOLEGACY flag.
by Derek Lesho
Signed-off-by: Derek Lesho <dereklesho52(a)Gmail.com>
---
dlls/user32/rawinput.c | 2 +-
server/queue.c | 9 +++++++++
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/dlls/user32/rawinput.c b/dlls/user32/rawinput.c
index 2085fd3f9f..120de073c8 100644
--- a/dlls/user32/rawinput.c
+++ b/dlls/user32/rawinput.c
@@ -250,7 +250,7 @@ BOOL WINAPI DECLSPEC_HOTPATCH RegisterRawInputDevices(RAWINPUTDEVICE *devices, U
TRACE("device %u: page %#x, usage %#x, flags %#x, target %p.\n",
i, devices[i].usUsagePage, devices[i].usUsage,
devices[i].dwFlags, devices[i].hwndTarget);
- if (devices[i].dwFlags & ~RIDEV_REMOVE)
+ if (devices[i].dwFlags & ~(RIDEV_REMOVE|RIDEV_NOLEGACY))
FIXME("Unhandled flags %#x for device %u.\n", devices[i].dwFlags, i);
d[i].usage_page = devices[i].usUsagePage;
diff --git a/server/queue.c b/server/queue.c
index 24239916af..0ab5adfead 100644
--- a/server/queue.c
+++ b/server/queue.c
@@ -372,6 +372,9 @@ static void set_cursor_pos( struct desktop *desktop, int x, int y )
static const struct hw_msg_source source = { IMDT_UNAVAILABLE, IMO_SYSTEM };
struct message *msg;
+ if (current->process->rawinput_mouse &&
+ current->process->rawinput_mouse->flags & RIDEV_NOLEGACY) return;
+
if (!(msg = alloc_hardware_message( 0, source, get_tick_count() ))) return;
msg->msg = WM_MOUSEMOVE;
@@ -1668,6 +1671,9 @@ static int queue_mouse_message( struct desktop *desktop, user_handle_t win, cons
msg_data->rawinput.mouse.data = input->mouse.data;
queue_hardware_message( desktop, msg, 0 );
+
+ if (device->flags & RIDEV_NOLEGACY)
+ return FALSE;
}
for (i = 0; i < ARRAY_SIZE( messages ); i++)
@@ -1793,6 +1799,9 @@ static int queue_keyboard_message( struct desktop *desktop, user_handle_t win, c
msg_data->rawinput.kbd.scan = input->kbd.scan;
queue_hardware_message( desktop, msg, 0 );
+
+ if (device->flags & RIDEV_NOLEGACY)
+ return FALSE;
}
if (!(msg = alloc_hardware_message( input->kbd.info, source, time ))) return 0;
--
2.21.0
June 30, 2019
[PATCH 4/4] strmbase: Fix implementation of IEnumMediaTypes::Skip().
by Zebediah Figura
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47291
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com>
---
dlls/qcap/tests/avico.c | 4 ++--
dlls/qcap/tests/avimux.c | 6 +++---
dlls/qcap/tests/smartteefilter.c | 2 +-
dlls/qedit/tests/nullrenderer.c | 2 +-
dlls/quartz/tests/avidec.c | 6 +++---
dlls/quartz/tests/avisplit.c | 6 +++---
dlls/quartz/tests/dsoundrender.c | 2 +-
dlls/quartz/tests/filesource.c | 8 ++++----
dlls/quartz/tests/mpegsplit.c | 4 ++--
dlls/quartz/tests/videorenderer.c | 2 +-
dlls/quartz/tests/vmr7.c | 2 +-
dlls/quartz/tests/vmr9.c | 2 +-
dlls/quartz/tests/waveparser.c | 6 +++---
dlls/strmbase/mediatype.c | 17 +++++++----------
14 files changed, 33 insertions(+), 36 deletions(-)
diff --git a/dlls/qcap/tests/avico.c b/dlls/qcap/tests/avico.c
index 10402897575..dbc15e3f15d 100644
--- a/dlls/qcap/tests/avico.c
+++ b/dlls/qcap/tests/avico.c
@@ -611,7 +611,7 @@ static void test_enum_media_types(IBaseFilter *filter)
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Clone(enum1, &enum2);
- todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Skip(enum1, 1);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
@@ -642,7 +642,7 @@ static void test_enum_media_types(IBaseFilter *filter)
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Clone(enum1, &enum2);
- todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Skip(enum1, 1);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
diff --git a/dlls/qcap/tests/avimux.c b/dlls/qcap/tests/avimux.c
index 98a775433c6..85ebd5c82c7 100644
--- a/dlls/qcap/tests/avimux.c
+++ b/dlls/qcap/tests/avimux.c
@@ -613,13 +613,13 @@ static void test_enum_media_types(void)
ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Skip(enum1, 1);
- todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Skip(enum1, 1);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Next(enum1, 1, mts, NULL);
- todo_wine ok(hr == S_FALSE, "Got hr %#x.\n", hr);
+ ok(hr == S_FALSE, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Next(enum2, 1, mts, NULL);
ok(hr == S_OK, "Got hr %#x.\n", hr);
@@ -648,7 +648,7 @@ static void test_enum_media_types(void)
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Clone(enum1, &enum2);
- todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Skip(enum1, 1);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
diff --git a/dlls/qcap/tests/smartteefilter.c b/dlls/qcap/tests/smartteefilter.c
index 361b0603d85..487c8eca3c1 100644
--- a/dlls/qcap/tests/smartteefilter.c
+++ b/dlls/qcap/tests/smartteefilter.c
@@ -446,7 +446,7 @@ static void test_enum_media_types(void)
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Clone(enum1, &enum2);
- todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Skip(enum1, 1);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
diff --git a/dlls/qedit/tests/nullrenderer.c b/dlls/qedit/tests/nullrenderer.c
index 7841720cfe1..45a0af16184 100644
--- a/dlls/qedit/tests/nullrenderer.c
+++ b/dlls/qedit/tests/nullrenderer.c
@@ -407,7 +407,7 @@ static void test_enum_media_types(void)
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Clone(enum1, &enum2);
- todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Skip(enum1, 1);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
diff --git a/dlls/quartz/tests/avidec.c b/dlls/quartz/tests/avidec.c
index b53b64ec8ae..19997e3c172 100644
--- a/dlls/quartz/tests/avidec.c
+++ b/dlls/quartz/tests/avidec.c
@@ -571,7 +571,7 @@ static void test_enum_media_types(void)
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Clone(enum1, &enum2);
- todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Skip(enum1, 1);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
@@ -602,13 +602,13 @@ static void test_enum_media_types(void)
todo_wine ok(hr == S_FALSE, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Clone(enum1, &enum2);
- todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Skip(enum1, 1);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Next(enum2, 1, mts, NULL);
- todo_wine ok(hr == S_FALSE, "Got hr %#x.\n", hr);
+ ok(hr == S_FALSE, "Got hr %#x.\n", hr);
IEnumMediaTypes_Release(enum1);
IEnumMediaTypes_Release(enum2);
diff --git a/dlls/quartz/tests/avisplit.c b/dlls/quartz/tests/avisplit.c
index 7dc8b14c5e4..a1dadd481ad 100644
--- a/dlls/quartz/tests/avisplit.c
+++ b/dlls/quartz/tests/avisplit.c
@@ -685,7 +685,7 @@ static void test_enum_media_types(void)
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Clone(enum1, &enum2);
- todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Skip(enum1, 1);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
@@ -748,13 +748,13 @@ static void test_enum_media_types(void)
ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Skip(enum1, 1);
- todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Skip(enum1, 1);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Next(enum1, 1, mts, NULL);
- todo_wine ok(hr == S_FALSE, "Got hr %#x.\n", hr);
+ ok(hr == S_FALSE, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Next(enum2, 1, mts, NULL);
ok(hr == S_OK, "Got hr %#x.\n", hr);
diff --git a/dlls/quartz/tests/dsoundrender.c b/dlls/quartz/tests/dsoundrender.c
index 925a49c5da7..ecf4a46facd 100644
--- a/dlls/quartz/tests/dsoundrender.c
+++ b/dlls/quartz/tests/dsoundrender.c
@@ -542,7 +542,7 @@ static void test_enum_media_types(void)
ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Clone(enum1, &enum2);
- todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Skip(enum1, 2);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
diff --git a/dlls/quartz/tests/filesource.c b/dlls/quartz/tests/filesource.c
index 8d1d977b95e..18a9bf1499a 100644
--- a/dlls/quartz/tests/filesource.c
+++ b/dlls/quartz/tests/filesource.c
@@ -1159,19 +1159,19 @@ static void test_enum_media_types(void)
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Skip(enum1, 1);
- todo_wine ok(hr == S_FALSE, "Got hr %#x.\n", hr);
+ ok(hr == S_FALSE, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Reset(enum1);
ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Skip(enum1, 2);
- todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Skip(enum1, 1);
- todo_wine ok(hr == S_FALSE, "Got hr %#x.\n", hr);
+ ok(hr == S_FALSE, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Next(enum1, 1, mts, NULL);
- todo_wine ok(hr == S_FALSE, "Got hr %#x.\n", hr);
+ ok(hr == S_FALSE, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Next(enum2, 1, mts, NULL);
ok(hr == S_OK, "Got hr %#x.\n", hr);
diff --git a/dlls/quartz/tests/mpegsplit.c b/dlls/quartz/tests/mpegsplit.c
index 25c49438d06..5661c73e19a 100644
--- a/dlls/quartz/tests/mpegsplit.c
+++ b/dlls/quartz/tests/mpegsplit.c
@@ -876,7 +876,7 @@ static void test_enum_media_types(void)
ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Clone(enum1, &enum2);
- todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Skip(enum1, 5);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
@@ -979,7 +979,7 @@ static void test_enum_media_types(void)
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Next(enum1, 1, mts, NULL);
- todo_wine ok(hr == S_FALSE, "Got hr %#x.\n", hr);
+ ok(hr == S_FALSE, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Next(enum2, 1, mts, NULL);
ok(hr == S_OK, "Got hr %#x.\n", hr);
diff --git a/dlls/quartz/tests/videorenderer.c b/dlls/quartz/tests/videorenderer.c
index 5b03a04e4e6..9e5c8eb281f 100644
--- a/dlls/quartz/tests/videorenderer.c
+++ b/dlls/quartz/tests/videorenderer.c
@@ -456,7 +456,7 @@ static void test_enum_media_types(void)
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Clone(enum1, &enum2);
- todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Skip(enum1, 1);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
diff --git a/dlls/quartz/tests/vmr7.c b/dlls/quartz/tests/vmr7.c
index cb35590df2f..81b42243b88 100644
--- a/dlls/quartz/tests/vmr7.c
+++ b/dlls/quartz/tests/vmr7.c
@@ -759,7 +759,7 @@ static void test_enum_media_types(void)
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Clone(enum1, &enum2);
- todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Skip(enum1, 1);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
diff --git a/dlls/quartz/tests/vmr9.c b/dlls/quartz/tests/vmr9.c
index 0a55201f6ad..8d07522ab06 100644
--- a/dlls/quartz/tests/vmr9.c
+++ b/dlls/quartz/tests/vmr9.c
@@ -763,7 +763,7 @@ static void test_enum_media_types(void)
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Clone(enum1, &enum2);
- todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Skip(enum1, 1);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
diff --git a/dlls/quartz/tests/waveparser.c b/dlls/quartz/tests/waveparser.c
index a0df5ccc9b3..4bfa17a9e5f 100644
--- a/dlls/quartz/tests/waveparser.c
+++ b/dlls/quartz/tests/waveparser.c
@@ -673,7 +673,7 @@ static void test_enum_media_types(void)
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Clone(enum1, &enum2);
- todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Skip(enum1, 1);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
@@ -736,13 +736,13 @@ static void test_enum_media_types(void)
ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Skip(enum1, 1);
- todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Skip(enum1, 1);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Next(enum1, 1, mts, NULL);
- todo_wine ok(hr == S_FALSE, "Got hr %#x.\n", hr);
+ ok(hr == S_FALSE, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Next(enum2, 1, mts, NULL);
ok(hr == S_OK, "Got hr %#x.\n", hr);
diff --git a/dlls/strmbase/mediatype.c b/dlls/strmbase/mediatype.c
index 66b5fa1721b..393264c094c 100644
--- a/dlls/strmbase/mediatype.c
+++ b/dlls/strmbase/mediatype.c
@@ -203,21 +203,18 @@ static HRESULT WINAPI IEnumMediaTypesImpl_Next(IEnumMediaTypes *iface,
return i == count ? S_OK : S_FALSE;
}
-static HRESULT WINAPI IEnumMediaTypesImpl_Skip(IEnumMediaTypes * iface, ULONG cMediaTypes)
+static HRESULT WINAPI IEnumMediaTypesImpl_Skip(IEnumMediaTypes *iface, ULONG count)
{
- IEnumMediaTypesImpl *This = impl_from_IEnumMediaTypes(iface);
+ IEnumMediaTypesImpl *enummt = impl_from_IEnumMediaTypes(iface);
- TRACE("(%p)->(%u)\n", iface, cMediaTypes);
+ TRACE("iface %p, count %u.\n", iface, count);
- if (This->currentVersion != This->mediaVersionFunction(This->basePin))
+ if (enummt->currentVersion != enummt->mediaVersionFunction(enummt->basePin))
return VFW_E_ENUM_OUT_OF_SYNC;
- if (This->uIndex + cMediaTypes < This->count)
- {
- This->uIndex += cMediaTypes;
- return S_OK;
- }
- return S_FALSE;
+ enummt->uIndex += count;
+
+ return enummt->uIndex > enummt->count ? S_FALSE : S_OK;
}
static HRESULT WINAPI IEnumMediaTypesImpl_Reset(IEnumMediaTypes * iface)
--
2.22.0
June 29, 2019
[PATCH 3/4] strmbase: Simplify IEnumMediaTypesImpl_Next().
by Zebediah Figura
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com>
---
dlls/strmbase/mediatype.c | 43 ++++++++++++++++-----------------------
1 file changed, 17 insertions(+), 26 deletions(-)
diff --git a/dlls/strmbase/mediatype.c b/dlls/strmbase/mediatype.c
index 8ad2e22efc9..66b5fa1721b 100644
--- a/dlls/strmbase/mediatype.c
+++ b/dlls/strmbase/mediatype.c
@@ -172,44 +172,35 @@ static ULONG WINAPI IEnumMediaTypesImpl_Release(IEnumMediaTypes * iface)
return ref;
}
-static HRESULT WINAPI IEnumMediaTypesImpl_Next(IEnumMediaTypes * iface, ULONG cMediaTypes, AM_MEDIA_TYPE ** ppMediaTypes, ULONG * pcFetched)
+static HRESULT WINAPI IEnumMediaTypesImpl_Next(IEnumMediaTypes *iface,
+ ULONG count, AM_MEDIA_TYPE **mts, ULONG *ret_count)
{
- ULONG cFetched;
- IEnumMediaTypesImpl *This = impl_from_IEnumMediaTypes(iface);
-
- TRACE("(%p)->(%u, %p, %p)\n", iface, cMediaTypes, ppMediaTypes, pcFetched);
+ IEnumMediaTypesImpl *enummt = impl_from_IEnumMediaTypes(iface);
+ ULONG i;
- cFetched = min(This->count, This->uIndex + cMediaTypes) - This->uIndex;
+ TRACE("iface %p, count %u, mts %p, ret_count %p.\n", iface, count, mts, ret_count);
- if (This->currentVersion != This->mediaVersionFunction(This->basePin))
+ if (enummt->currentVersion != enummt->mediaVersionFunction(enummt->basePin))
return VFW_E_ENUM_OUT_OF_SYNC;
- TRACE("Next uIndex: %u, cFetched: %u\n", This->uIndex, cFetched);
-
- if (cFetched > 0)
+ for (i = 0; i < count && enummt->uIndex + i < enummt->count; i++)
{
- ULONG i;
- for (i = 0; i < cFetched; i++)
+ if (!(mts[i] = CoTaskMemAlloc(sizeof(AM_MEDIA_TYPE)))
+ || FAILED(enummt->enumMediaFunction(enummt->basePin, enummt->uIndex + i, mts[i])))
{
- if (!(ppMediaTypes[i] = CoTaskMemAlloc(sizeof(AM_MEDIA_TYPE)))
- || FAILED(This->enumMediaFunction(This->basePin, This->uIndex + i, ppMediaTypes[i])))
- {
- while (i--)
- DeleteMediaType(ppMediaTypes[i]);
- *pcFetched = 0;
- return E_OUTOFMEMORY;
- }
+ while (i--)
+ DeleteMediaType(mts[i]);
+ *ret_count = 0;
+ return E_OUTOFMEMORY;
}
}
- if ((cMediaTypes != 1) || pcFetched)
- *pcFetched = cFetched;
+ if ((count != 1) || ret_count)
+ *ret_count = i;
- This->uIndex += cFetched;
+ enummt->uIndex += i;
- if (cFetched != cMediaTypes)
- return S_FALSE;
- return S_OK;
+ return i == count ? S_OK : S_FALSE;
}
static HRESULT WINAPI IEnumMediaTypesImpl_Skip(IEnumMediaTypes * iface, ULONG cMediaTypes)
--
2.22.0
June 29, 2019
[PATCH 2/4] qedit/tests: Add some tests for IEnumMediaTypes().
by Zebediah Figura
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com>
---
dlls/qedit/tests/nullrenderer.c | 45 +++++++++++++++++++++++++++++++++
1 file changed, 45 insertions(+)
diff --git a/dlls/qedit/tests/nullrenderer.c b/dlls/qedit/tests/nullrenderer.c
index 3d5221b0a9e..7841720cfe1 100644
--- a/dlls/qedit/tests/nullrenderer.c
+++ b/dlls/qedit/tests/nullrenderer.c
@@ -379,6 +379,50 @@ static void test_media_types(void)
ok(!ref, "Got outstanding refcount %d.\n", ref);
}
+static void test_enum_media_types(void)
+{
+ IBaseFilter *filter = create_null_renderer();
+ IEnumMediaTypes *enum1, *enum2;
+ AM_MEDIA_TYPE *mts[2];
+ ULONG ref, count;
+ HRESULT hr;
+ IPin *pin;
+
+ IBaseFilter_FindPin(filter, sink_id, &pin);
+
+ hr = IPin_EnumMediaTypes(pin, &enum1);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+
+ hr = IEnumMediaTypes_Next(enum1, 1, mts, NULL);
+ ok(hr == S_FALSE, "Got hr %#x.\n", hr);
+
+ hr = IEnumMediaTypes_Next(enum1, 1, mts, &count);
+ ok(hr == S_FALSE, "Got hr %#x.\n", hr);
+ ok(!count, "Got count %u.\n", count);
+
+ hr = IEnumMediaTypes_Reset(enum1);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+
+ hr = IEnumMediaTypes_Next(enum1, 1, mts, NULL);
+ ok(hr == S_FALSE, "Got hr %#x.\n", hr);
+
+ hr = IEnumMediaTypes_Clone(enum1, &enum2);
+ todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr);
+
+ hr = IEnumMediaTypes_Skip(enum1, 1);
+ ok(hr == S_FALSE, "Got hr %#x.\n", hr);
+
+ hr = IEnumMediaTypes_Next(enum2, 1, mts, NULL);
+ ok(hr == S_FALSE, "Got hr %#x.\n", hr);
+
+ IEnumMediaTypes_Release(enum1);
+ IEnumMediaTypes_Release(enum2);
+ IPin_Release(pin);
+
+ ref = IBaseFilter_Release(filter);
+ ok(!ref, "Got outstanding refcount %d.\n", ref);
+}
+
START_TEST(nullrenderer)
{
IBaseFilter *filter;
@@ -401,6 +445,7 @@ START_TEST(nullrenderer)
test_pin_info();
test_aggregation();
test_media_types();
+ test_enum_media_types();
CoUninitialize();
}
--
2.22.0
June 29, 2019
[PATCH 1/4] qedit/tests: Add some tests for media types.
by Zebediah Figura
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com>
---
dlls/qedit/tests/nullrenderer.c | 28 ++++++++++++++++++++++++++
dlls/qedit/tests/samplegrabber.c | 34 ++++++++++++++++++++++++++++++++
2 files changed, 62 insertions(+)
diff --git a/dlls/qedit/tests/nullrenderer.c b/dlls/qedit/tests/nullrenderer.c
index d39b28d5779..3d5221b0a9e 100644
--- a/dlls/qedit/tests/nullrenderer.c
+++ b/dlls/qedit/tests/nullrenderer.c
@@ -352,6 +352,33 @@ static void test_aggregation(void)
ok(outer_ref == 1, "Got unexpected refcount %d.\n", outer_ref);
}
+static void test_media_types(void)
+{
+ IBaseFilter *filter = create_null_renderer();
+ AM_MEDIA_TYPE mt = {}, *pmt;
+ IEnumMediaTypes *enummt;
+ HRESULT hr;
+ ULONG ref;
+ IPin *pin;
+
+ IBaseFilter_FindPin(filter, sink_id, &pin);
+
+ hr = IPin_EnumMediaTypes(pin, &enummt);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+
+ hr = IEnumMediaTypes_Next(enummt, 1, &pmt, NULL);
+ ok(hr == S_FALSE, "Got hr %#x.\n", hr);
+
+ IEnumMediaTypes_Release(enummt);
+
+ hr = IPin_QueryAccept(pin, &mt);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+
+ IPin_Release(pin);
+ ref = IBaseFilter_Release(filter);
+ ok(!ref, "Got outstanding refcount %d.\n", ref);
+}
+
START_TEST(nullrenderer)
{
IBaseFilter *filter;
@@ -373,6 +400,7 @@ START_TEST(nullrenderer)
test_find_pin();
test_pin_info();
test_aggregation();
+ test_media_types();
CoUninitialize();
}
diff --git a/dlls/qedit/tests/samplegrabber.c b/dlls/qedit/tests/samplegrabber.c
index 8bc44b9c22f..9bb4eb4f01c 100644
--- a/dlls/qedit/tests/samplegrabber.c
+++ b/dlls/qedit/tests/samplegrabber.c
@@ -449,6 +449,39 @@ static void test_aggregation(void)
ok(outer_ref == 1, "Got unexpected refcount %d.\n", outer_ref);
}
+static void test_media_types(void)
+{
+ IBaseFilter *filter = create_sample_grabber();
+ IEnumMediaTypes *enummt;
+ AM_MEDIA_TYPE mt = {};
+ HRESULT hr;
+ ULONG ref;
+ IPin *pin;
+
+ IBaseFilter_FindPin(filter, sink_id, &pin);
+
+ hr = IPin_EnumMediaTypes(pin, &enummt);
+ todo_wine ok(hr == VFW_E_NOT_CONNECTED, "Got hr %#x.\n", hr);
+
+ hr = IPin_QueryAccept(pin, &mt);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+
+ IPin_Release(pin);
+
+ IBaseFilter_FindPin(filter, source_id, &pin);
+
+ hr = IPin_EnumMediaTypes(pin, &enummt);
+ todo_wine ok(hr == VFW_E_NOT_CONNECTED, "Got hr %#x.\n", hr);
+
+ hr = IPin_QueryAccept(pin, &mt);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+
+ IPin_Release(pin);
+
+ ref = IBaseFilter_Release(filter);
+ ok(!ref, "Got outstanding refcount %d.\n", ref);
+}
+
START_TEST(samplegrabber)
{
IBaseFilter *filter;
@@ -470,6 +503,7 @@ START_TEST(samplegrabber)
test_find_pin();
test_pin_info();
test_aggregation();
+ test_media_types();
CoUninitialize();
}
--
2.22.0
June 29, 2019
Re: Ubuntu 19.10 will be 64 bit only
by Sveinar Søpler
----- On Jun 22, 2019, at 1:12 PM, dimesio dimesio(a)earthlink.net wrote:
> On Sat, 22 Jun 2019 14:34:47 +0430
> Henri Verbeet <hverbeet(a)gmail.com> wrote:
>
>>
>> Provided the Ubuntu kernels will continue to support 32-bit
>> executables, and provided there's interest in the Ubuntu community to
>> continue running Wine, I imagine it should be possible for a bunch of
>> people in the Ubuntu community to get together and provide 32-bit
>> builds of the required packages as a PPA or something. Although hardly
>> ideal, I don't think there's a reason such an approach wouldn't work.
>
> I can't use PPAs to satisfy build dependencies on the OBS. Packages have to
> either be in the Ubuntu standard, update, or universe repositories, or on the
> OBS itself. The latter is what we're doing for FAudio. That works fine, other
> than the whining from Ubuntu users about the tremendous difficulty of copying
> and pasting the command to add another repository. So if Ubuntu users do decide
> to go the PPA route, they should also plan on building their own Wine packages.
>
Since most Launchpad PPA´s provide the needed orig.tar.xz files, along with .dsc
and -debian.tar.xz, it is not impossible to re-build those packages on the OBS
for use as a dependency. It is not there the work lies i guess.
Dunno if *buntu maintaners plan on creating any wine-release on Launchpad at all,
but if they do, it is not really impossible to maintain OBS as a kind of "backup"
of Launchpad to use for -devel and -staging.
Will be interesting to see how this is solved on Launchpad, cos dependencies is
a hornets nest on top of a anthill, and once main repo´s start dropping deps it´s
a huge undertaking to unwind.
Sveinar
>> The much easier option of course would be for the affected users to
>> switch to a distribution that cares about Wine, Debian perhaps being
>> the most obvious choice.
>>
> Other than the part about Debian being the obvious choice, that's basically what
> our forum sticky for CentOS/RHEL/Scientific Linux 7 users has been saying for 5
> years.
>
>
>
> --
> Rosanne DiMesio
> dimesio(a)earthlink.net
June 29, 2019
[PATCH] wined3d: Always try to create a hardware cursor.
by Zebediah Figura
From: Zebediah Figura <z.figura12(a)gmail.com>
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47386
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com>
---
dlls/wined3d/device.c | 65 +++++++++++++++++++++----------------------
1 file changed, 31 insertions(+), 34 deletions(-)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index d35a0648c9c..39dd93e11b7 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -5216,9 +5216,12 @@ HRESULT CDECL wined3d_device_set_cursor_properties(struct wined3d_device *device
UINT x_hotspot, UINT y_hotspot, struct wined3d_texture *texture, unsigned int sub_resource_idx)
{
unsigned int texture_level = sub_resource_idx % texture->level_count;
- unsigned int cursor_width, cursor_height;
+ unsigned int cursor_width, cursor_height, mask_size;
struct wined3d_display_mode mode;
struct wined3d_map_desc map_desc;
+ ICONINFO cursor_info;
+ DWORD *mask_bits;
+ HCURSOR cursor;
HRESULT hr;
TRACE("device %p, x_hotspot %u, y_hotspot %u, texture %p, sub_resource_idx %u.\n",
@@ -5268,43 +5271,37 @@ HRESULT CDECL wined3d_device_set_cursor_properties(struct wined3d_device *device
return WINED3DERR_INVALIDCALL;
}
- if (cursor_width == 32 && cursor_height == 32)
- {
- UINT mask_size = cursor_width * cursor_height / 8;
- ICONINFO cursor_info;
- DWORD *mask_bits;
- HCURSOR cursor;
+ mask_size = cursor_width * cursor_height / 8;
- /* 32-bit user32 cursors ignore the alpha channel if it's all
- * zeroes, and use the mask instead. Fill the mask with all ones
- * to ensure we still get a fully transparent cursor. */
- if (!(mask_bits = heap_alloc(mask_size)))
- return E_OUTOFMEMORY;
- memset(mask_bits, 0xff, mask_size);
+ /* 32-bit user32 cursors ignore the alpha channel if it's all
+ * zeroes, and use the mask instead. Fill the mask with all ones
+ * to ensure we still get a fully transparent cursor. */
+ if (!(mask_bits = heap_alloc(mask_size)))
+ return E_OUTOFMEMORY;
+ memset(mask_bits, 0xff, mask_size);
- wined3d_resource_map(&texture->resource, sub_resource_idx, &map_desc, NULL,
- WINED3D_MAP_NO_DIRTY_UPDATE | WINED3D_MAP_READ);
- cursor_info.fIcon = FALSE;
- cursor_info.xHotspot = x_hotspot;
- cursor_info.yHotspot = y_hotspot;
- cursor_info.hbmMask = CreateBitmap(cursor_width, cursor_height, 1, 1, mask_bits);
- cursor_info.hbmColor = CreateBitmap(cursor_width, cursor_height, 1, 32, map_desc.data);
- wined3d_resource_unmap(&texture->resource, sub_resource_idx);
+ wined3d_resource_map(&texture->resource, sub_resource_idx, &map_desc, NULL,
+ WINED3D_MAP_NO_DIRTY_UPDATE | WINED3D_MAP_READ);
+ cursor_info.fIcon = FALSE;
+ cursor_info.xHotspot = x_hotspot;
+ cursor_info.yHotspot = y_hotspot;
+ cursor_info.hbmMask = CreateBitmap(cursor_width, cursor_height, 1, 1, mask_bits);
+ cursor_info.hbmColor = CreateBitmap(cursor_width, cursor_height, 1, 32, map_desc.data);
+ wined3d_resource_unmap(&texture->resource, sub_resource_idx);
- /* Create our cursor and clean up. */
- cursor = CreateIconIndirect(&cursor_info);
- if (cursor_info.hbmMask)
- DeleteObject(cursor_info.hbmMask);
- if (cursor_info.hbmColor)
- DeleteObject(cursor_info.hbmColor);
- if (device->hardwareCursor)
- DestroyCursor(device->hardwareCursor);
- device->hardwareCursor = cursor;
- if (device->bCursorVisible)
- SetCursor(cursor);
+ /* Create our cursor and clean up. */
+ cursor = CreateIconIndirect(&cursor_info);
+ if (cursor_info.hbmMask)
+ DeleteObject(cursor_info.hbmMask);
+ if (cursor_info.hbmColor)
+ DeleteObject(cursor_info.hbmColor);
+ if (device->hardwareCursor)
+ DestroyCursor(device->hardwareCursor);
+ device->hardwareCursor = cursor;
+ if (device->bCursorVisible)
+ SetCursor(cursor);
- heap_free(mask_bits);
- }
+ heap_free(mask_bits);
TRACE("New cursor dimensions are %ux%u.\n", cursor_width, cursor_height);
device->cursorWidth = cursor_width;
--
2.20.1
June 28, 2019