Wine-Devel
Threads by month
- ----- 2026 -----
- 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
- 4 participants
- 84544 discussions
A user has shared the want to go with dosbox-staging instead of
classic DOSBox. To make that easier, and our current code easier
to maintain, abstract references to /dosbox.
On the way use strlen() instead of sizeof(). That is already used
earlier in that function, it is more robust, and still computed at
compile time if feasible.
Gerald
Signed-off-by: Gerald Pfeifer <gerald(a)pfeifer.com>
---
programs/winevdm/winevdm.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/programs/winevdm/winevdm.c b/programs/winevdm/winevdm.c
index bfc47b8853..43019fbd63 100644
--- a/programs/winevdm/winevdm.c
+++ b/programs/winevdm/winevdm.c
@@ -35,6 +35,7 @@
WINE_DEFAULT_DEBUG_CHANNEL(winevdm);
+const char DOSBOX[] = "/dosbox";
/*** PIF file structures ***/
#include "pshpack1.h"
@@ -118,7 +119,7 @@ static char *find_dosbox(void)
envpath_len = strlen( envpath );
path = HeapAlloc( GetProcessHeap(), 0, envpath_len + 1 );
- buffer = HeapAlloc( GetProcessHeap(), 0, envpath_len + sizeof("/dosbox") );
+ buffer = HeapAlloc( GetProcessHeap(), 0, envpath_len + strlen(DOSBOX) + 1 );
strcpy( path, envpath );
p = path;
@@ -130,7 +131,7 @@ static char *find_dosbox(void)
while (*p && *p != ':') p++;
if (*p == ':') *p++ = 0;
strcpy( buffer, dir );
- strcat( buffer, "/dosbox" );
+ strcat( buffer, DOSBOX );
if (!stat( buffer, &st ))
{
HeapFree( GetProcessHeap(), 0, path );
--
2.27.0
1
0
In c++11 char16_t is a distinct fundamental type,
but in c11 it is merely a typedef in <uchar.h>.
Explicitly mention char16_t only in c++11 (where it is built-in),
otherwise define WCHAR as unsigned short (without naming char16_t)
and just hope that on C11 this matches u"..."
Remove WINE_UNICODE_CHAR16; it is now the default when supported.
Signed-off-by: Kevin Puetz <PuetzKevinA(a)JohnDeere.com>
---
Per https://www.winehq.org/pipermail/wine-devel/2020-July/170502.html
Jacek wants to avoid including <uchar.h>; without that C11 has to make
some assumptions the standard doesn't guarantee. But that's far from
wine's first foray into implementation-defined behavior...
c11 defines char16_t as a typedef to uint_least16_t, which is likely
(though not guaranteed) the same as unsigned short (e.g. it could be
int if that is a 16-bit type). I do see that basetsd has a comment
saying only ILP32, LP64, or P64 typemodels are supported, though, so
probably wine would already not work on a platform with 16-bit int.
GCC and clang provide a macro __CHAR16_TYPE__, but basetsd.h needs I32
and CHAR8_BIT!=8 is far too exotic, so it's unecessary in practice.
It will be `#define __CHAR_TYPE__ unsigned short` anyway; the other
C11-compliant possibilities would already break wine. That makes both
the pro and con arguments moot, so it's now omitted.
---
Removing WINE_UNICODE_CHAR1 changes little for C or C++98/C++03,
or anything using -fshort-wchar/WINE_UNICODE_NATIVE, but it has
some ABI implications for wineg++ -std=c++11 -fno-short-wchar.
On the plus side:
* TEXT(), OLESTR() macros just work in UNICODE for c++11 and (usually) c11
* We revert an #ifdef with ABI implications, now there's just
-f(no-)short-wchar and -std=c++*, which already mattered
* in C++11, WCHAR overloads are no longer ambiguous vs integral types
and WCHAR is recognizable as text rather than promoted to int.
This is much more like the situation on MSVC where WCHAR == wchar_t;
char16_t is also distinct from uint16_t, unsigned short, etc.
* We avoid the situation where TEXT("...") -> u"..."
is accepted by the compiler and produces char16_t[],
but that isn't compatible with TCHAR[] or LPCTSTR.
Silently getting the wrong type is obnoxious in C++, since templates
can move the type-mismatch compile error far away from the offending
TEXT("...") macro, or even compile but use an unexpected overload.
Now u"..." either doesn't compile, or it's correct, so we can drop
https://www.winehq.org/pipermail/wine-devel/2020-July/170227.html
In C11 there's no templates or overloading; it's non-portable UB
(strict-aliasing) if an unsigned short * points to unsigned int[],
but not a practical issue on any platform basetsd.h supports.
On the minus side:
* any libraries built with wineg++ -std=c++11 -fno-short-wchar
change their mangled names for functions with WCHAR/LPCWSTR
parameters because char16_t is a distinct fundamental type.
This doesn't affect compatibility of wine itself (which always exports
things under their MSVC-ish mangling as-if using wchar_t), but wineg++
could fail to link to a .dll.so built with wine 5.0.x headers.
I don't know to what extent wineg++ tries to promise that this works,
but IMO we are headed into a major version 6, and binaries are already
not fully interchangeable due to winecrt0/__wine_spec_init changes.
So I think think it seems preferable to just have good defaults
that are MSVC-like, and fewer possible mistakes.
But it's certainly possible to keep the WINE_UNICODE_CHAR16 opt-in,
(or add a WINE_NO_UNICODE_CHAR16 opt-out), if we must.
Or we could follow gcc's lead on the upcoming c++20 -f(no-)char8_t
and winegcc could have -f(no-)char16_t, or -fchar16_t-wchar
(synthesizing the macro like it does with WINE_UNICODE_NATIVE).
But I like the simplicity of "just works if the compiler has support"
unless someone objects.
---
include/sqltypes.h | 2 +-
include/tchar.h | 2 +-
include/winnt.h | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/include/sqltypes.h b/include/sqltypes.h
index 0923f6b362..4c45de7e98 100644
--- a/include/sqltypes.h
+++ b/include/sqltypes.h
@@ -30,7 +30,7 @@ extern "C" {
typedef unsigned char SQLCHAR;
#if defined(WINE_UNICODE_NATIVE)
typedef wchar_t SQLWCHAR;
-#elif defined(WINE_UNICODE_CHAR16)
+#elif __cpp_unicode_literals >= 200710
typedef char16_t SQLWCHAR;
#else
typedef unsigned short SQLWCHAR;
diff --git a/include/tchar.h b/include/tchar.h
index 9fc4c72099..a8e64b4bf6 100644
--- a/include/tchar.h
+++ b/include/tchar.h
@@ -240,7 +240,7 @@ typedef unsigned short wctype_t;
#ifndef __TCHAR_DEFINED
#if defined(WINE_UNICODE_NATIVE)
typedef wchar_t _TCHAR;
-#elif defined(WINE_UNICODE_CHAR16)
+#elif __cpp_unicode_literals >= 200710
typedef char16_t _TCHAR;
#else
typedef unsigned short _TCHAR;
diff --git a/include/winnt.h b/include/winnt.h
index 1eb82876f1..b0736a036d 100644
--- a/include/winnt.h
+++ b/include/winnt.h
@@ -462,7 +462,7 @@ typedef int LONG, *PLONG;
/* Some systems might have wchar_t, but we really need 16 bit characters */
#if defined(WINE_UNICODE_NATIVE)
typedef wchar_t WCHAR;
-#elif defined(WINE_UNICODE_CHAR16)
+#elif __cpp_unicode_literals >= 200710
typedef char16_t WCHAR;
#else
typedef unsigned short WCHAR;
3
8
Oct. 2, 2020
Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com>
---
Makefile.am | 6 ++++--
tests/shader_runner_d3d12.c | 23 +++++++++++++++++++++++
tests/trigonometry.shader_test | 24 ++++++++++++++++++++++++
3 files changed, 51 insertions(+), 2 deletions(-)
create mode 100644 tests/trigonometry.shader_test
diff --git a/Makefile.am b/Makefile.am
index 27bc00b6..2e286bc8 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -61,7 +61,8 @@ vkd3d_shader_tests = \
tests/swizzle-4.shader_test \
tests/swizzle-5.shader_test \
tests/swizzle-6.shader_test \
- tests/swizzle-7.shader_test
+ tests/swizzle-7.shader_test \
+ tests/trigonometry.shader_test
vkd3d_test_headers = \
tests/d3d12_crosstest.h \
@@ -192,7 +193,8 @@ XFAIL_TESTS = \
tests/swizzle-4.shader_test \
tests/swizzle-5.shader_test \
tests/swizzle-6.shader_test \
- tests/swizzle-7.shader_test
+ tests/swizzle-7.shader_test \
+ tests/trigonometry.shader_test
endif
if BUILD_DEMOS
diff --git a/tests/shader_runner_d3d12.c b/tests/shader_runner_d3d12.c
index 709fc006..0e9694a4 100644
--- a/tests/shader_runner_d3d12.c
+++ b/tests/shader_runner_d3d12.c
@@ -190,6 +190,29 @@ static void parse_test_directive(struct shader_context *context, const char *lin
release_resource_readback(&rb);
reset_command_list(context->c.list, context->c.allocator);
}
+ else if (match_string(line, "probe rgba", &line))
+ {
+ struct resource_readback rb;
+ unsigned int x, y, ulps;
+ struct vec4 v;
+ RECT rect;
+ int ret;
+
+ ret = sscanf(line, "( %u , %u ) ( %f , %f , %f , %f ) %u", &x, &y, &v.x, &v.y, &v.z, &v.w, &ulps);
+ if (ret < 6)
+ goto err;
+ if (ret < 7)
+ ulps = 0;
+
+ get_texture_readback_with_command_list(context->c.render_target, 0, &rb, context->c.queue, context->c.list);
+ rect.left = x;
+ rect.right = x + 1;
+ rect.top = y;
+ rect.bottom = y + 1;
+ check_readback_data_vec4(&rb, &rect, &v, ulps);
+ release_resource_readback(&rb);
+ reset_command_list(context->c.list, context->c.allocator);
+ }
else if (match_string(line, "uniform", &line))
{
unsigned int offset;
diff --git a/tests/trigonometry.shader_test b/tests/trigonometry.shader_test
new file mode 100644
index 00000000..07a280a0
--- /dev/null
+++ b/tests/trigonometry.shader_test
@@ -0,0 +1,24 @@
+[pixel shader]
+float4 main(float4 pos : SV_POSITION) : SV_TARGET
+{
+ return float4(sin(pos.x - 0.5), cos(pos.x - 0.5), 0, 0);
+}
+
+[test]
+draw quad
+probe rgba ( 0, 0) ( 0.00000000, 1.00000000, 0.0, 0.0)
+probe rgba ( 1, 0) ( 0.84147098, 0.54030231, 0.0, 0.0) 1024
+probe rgba ( 2, 0) ( 0.90929743, -0.41614684, 0.0, 0.0) 1024
+probe rgba ( 3, 0) ( 0.14112001, -0.98999250, 0.0, 0.0) 1024
+probe rgba ( 4, 0) (-0.75680250, -0.65364362, 0.0, 0.0) 1024
+probe rgba ( 5, 0) (-0.95892427, 0.28366219, 0.0, 0.0) 1024
+probe rgba ( 6, 0) (-0.27941550, 0.96017029, 0.0, 0.0) 1024
+probe rgba ( 7, 0) ( 0.65698660, 0.75390225, 0.0, 0.0) 1024
+probe rgba ( 8, 0) ( 0.98935825, -0.14550003, 0.0, 0.0) 1024
+probe rgba ( 9, 0) ( 0.41211849, -0.91113026, 0.0, 0.0) 1024
+probe rgba (10, 0) (-0.54402111, -0.83907153, 0.0, 0.0) 1024
+probe rgba (11, 0) (-0.99999021, 0.00442570, 0.0, 0.0) 1024
+probe rgba (12, 0) (-0.53657292, 0.84385396, 0.0, 0.0) 1024
+probe rgba (13, 0) ( 0.42016704, 0.90744678, 0.0, 0.0) 1024
+probe rgba (14, 0) ( 0.99060736, 0.13673722, 0.0, 0.0) 1024
+probe rgba (15, 0) ( 0.65028784, -0.75968791, 0.0, 0.0) 1024
--
2.28.0
2
9
Oct. 2, 2020
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
---
dlls/evr/Makefile.in | 2 +-
dlls/evr/presenter.c | 47 +++++++++++++++++++++++++++++++++----
dlls/evr/tests/evr.c | 55 +++++++++++++++++++++++++++++++++++++++-----
3 files changed, 92 insertions(+), 12 deletions(-)
diff --git a/dlls/evr/Makefile.in b/dlls/evr/Makefile.in
index 6d936d65b79..02cdb9b820a 100644
--- a/dlls/evr/Makefile.in
+++ b/dlls/evr/Makefile.in
@@ -1,6 +1,6 @@
MODULE = evr.dll
IMPORTLIB = evr
-IMPORTS = mfuuid strmiids strmbase uuid dxguid ole32 oleaut32 dxva2
+IMPORTS = mfuuid strmiids strmbase uuid dxguid ole32 oleaut32 user32 d3d9 dxva2
DELAYIMPORTS = mfplat
EXTRADLLFLAGS = -mno-cygwin
diff --git a/dlls/evr/presenter.c b/dlls/evr/presenter.c
index b60de4b82a1..04653ff67ad 100644
--- a/dlls/evr/presenter.c
+++ b/dlls/evr/presenter.c
@@ -643,11 +643,47 @@ HRESULT WINAPI MFCreateVideoPresenter(IUnknown *owner, REFIID riid_device, REFII
return CoCreateInstance(&CLSID_MFVideoPresenter9, owner, CLSCTX_INPROC_SERVER, riid, obj);
}
+static HRESULT video_presenter_init_d3d(struct video_presenter *presenter)
+{
+ D3DPRESENT_PARAMETERS present_params = { 0 };
+ IDirect3DDevice9 *device;
+ IDirect3D9 *d3d;
+ HRESULT hr;
+
+ d3d = Direct3DCreate9(D3D_SDK_VERSION);
+
+ present_params.BackBufferCount = 1;
+ present_params.SwapEffect = D3DSWAPEFFECT_COPY;
+ present_params.hDeviceWindow = GetDesktopWindow();
+ present_params.Windowed = TRUE;
+ present_params.Flags = D3DPRESENTFLAG_VIDEO;
+ present_params.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE;
+ hr = IDirect3D9_CreateDevice(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, GetDesktopWindow(),
+ 0, &present_params, &device);
+
+ IDirect3D9_Release(d3d);
+
+ if (FAILED(hr))
+ {
+ WARN("Failed to create d3d device, hr %#x.\n", hr);
+ return hr;
+ }
+
+ hr = IDirect3DDeviceManager9_ResetDevice(presenter->device_manager, device, presenter->reset_token);
+ IDirect3DDevice9_Release(device);
+ if (FAILED(hr))
+ WARN("Failed to set new device for the manager, hr %#x.\n", hr);
+
+ return hr;
+}
+
HRESULT evr_presenter_create(IUnknown *outer, void **out)
{
struct video_presenter *object;
HRESULT hr;
+ *out = NULL;
+
if (!(object = heap_alloc_zero(sizeof(*object))))
return E_OUTOFMEMORY;
@@ -663,12 +699,13 @@ HRESULT evr_presenter_create(IUnknown *outer, void **out)
InitializeCriticalSection(&object->cs);
if (FAILED(hr = DXVA2CreateDirect3DDeviceManager9(&object->reset_token, &object->device_manager)))
- {
IUnknown_Release(&object->IUnknown_inner);
- return hr;
- }
- *out = &object->IUnknown_inner;
+ if (FAILED(hr = video_presenter_init_d3d(object)))
+ IUnknown_Release(&object->IUnknown_inner);
- return S_OK;
+ if (SUCCEEDED(hr))
+ *out = &object->IUnknown_inner;
+
+ return hr;
}
diff --git a/dlls/evr/tests/evr.c b/dlls/evr/tests/evr.c
index 0dff691b59f..c2e17595559 100644
--- a/dlls/evr/tests/evr.c
+++ b/dlls/evr/tests/evr.c
@@ -39,7 +39,7 @@ static HWND create_window(void)
AdjustWindowRect(&r, WS_OVERLAPPEDWINDOW | WS_VISIBLE, FALSE);
- return CreateWindowA("static", "d3d9_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE,
+ return CreateWindowA("static", "evr_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE,
0, 0, r.right - r.left, r.bottom - r.top, NULL, NULL, NULL, NULL);
}
@@ -967,12 +967,16 @@ done:
static void test_default_presenter(void)
{
D3DDEVICE_CREATION_PARAMETERS device_params = { 0 };
+ D3DPRESENT_PARAMETERS present_params = { 0 };
+ IMFVideoDisplayControl *display_control;
+ IDirect3DSwapChain9 *swapchain;
IMFVideoPresenter *presenter;
IMFRateSupport *rate_support;
IDirect3DDevice9 *d3d_device;
IDirect3DDeviceManager9 *dm;
IMFVideoDeviceID *deviceid;
IMFGetService *gs;
+ HWND hwnd, hwnd2;
HANDLE handle;
IUnknown *unk;
float rate;
@@ -1010,33 +1014,70 @@ static void test_default_presenter(void)
hr = IMFVideoPresenter_QueryInterface(presenter, &IID_IMFGetService, (void **)&gs);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ hr = IMFGetService_GetService(gs, &MR_VIDEO_RENDER_SERVICE, &IID_IMFVideoDisplayControl, (void **)&display_control);
+todo_wine
+ ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ if (SUCCEEDED(hr))
+ IMFVideoDisplayControl_Release(display_control);
+
hr = IMFGetService_GetService(gs, &MR_VIDEO_ACCELERATION_SERVICE, &IID_IDirect3DDeviceManager9, (void **)&dm);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ hr = IMFVideoPresenter_QueryInterface(presenter, &IID_IMFVideoDisplayControl, (void **)&display_control);
+ ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+
hr = IDirect3DDeviceManager9_OpenDeviceHandle(dm, &handle);
-todo_wine
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
hr = IDirect3DDeviceManager9_LockDevice(dm, handle, &d3d_device, FALSE);
-todo_wine
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
-if (SUCCEEDED(hr))
-{
hr = IDirect3DDevice9_GetCreationParameters(d3d_device, &device_params);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
ok(device_params.hFocusWindow == GetDesktopWindow(), "Unexpected window %p.\n", device_params.hFocusWindow);
+ hr = IDirect3DDevice9_GetSwapChain(d3d_device, 0, &swapchain);
+ ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+
+ hr = IDirect3DSwapChain9_GetPresentParameters(swapchain, &present_params);
+ ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+
+ ok(present_params.hDeviceWindow == GetDesktopWindow(), "Unexpected device window.\n");
+ ok(present_params.Windowed, "Unexpected windowed mode.\n");
+ ok(present_params.SwapEffect == D3DSWAPEFFECT_COPY, "Unexpected swap effect.\n");
+ ok(present_params.Flags == D3DPRESENTFLAG_VIDEO, "Unexpected flags.\n");
+ ok(present_params.PresentationInterval == D3DPRESENT_INTERVAL_IMMEDIATE, "Unexpected present interval.\n");
+
IDirect3DDevice9_Release(d3d_device);
hr = IDirect3DDeviceManager9_UnlockDevice(dm, handle, FALSE);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
- hr = IDirect3DDeviceManager9_CloseDeviceHandle(dm, handle);
+ hwnd = create_window();
+ ok(!!hwnd, "Failed to create a test window.\n");
+
+ hwnd2 = hwnd;
+ hr = IMFVideoDisplayControl_GetVideoWindow(display_control, &hwnd2);
+todo_wine {
+ ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hwnd2 == NULL, "Unexpected window %p.\n", hwnd2);
+}
+ hr = IMFVideoDisplayControl_SetVideoWindow(display_control, hwnd);
+todo_wine
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+
+ hwnd2 = NULL;
+ hr = IMFVideoDisplayControl_GetVideoWindow(display_control, &hwnd2);
+todo_wine {
+ ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hwnd2 == hwnd, "Unexpected window %p.\n", hwnd2);
}
+ hr = IDirect3DDeviceManager9_CloseDeviceHandle(dm, handle);
+ ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+
IDirect3DDeviceManager9_Release(dm);
+ IMFVideoDisplayControl_Release(display_control);
IMFGetService_Release(gs);
/* Rate support. */
@@ -1066,6 +1107,8 @@ if (SUCCEEDED(hr))
IMFRateSupport_Release(rate_support);
IMFVideoPresenter_Release(presenter);
+
+ DestroyWindow(hwnd);
}
static void test_MFCreateVideoMixerAndPresenter(void)
--
2.28.0
1
4
From: Arkadiusz Hiler <ahiler(a)codeweavers.com>
With this patch we start storing history of last 64 mouse positions on the
server side which can be retrieved by the newly introduced get_cursor_history
request.
The history is kept in reverse chronological order in an array that acts as
circular buffer - this makes it easy to iterate over it in
GetMouseMovePointsEx().
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=36873
Signed-off-by: Arkadiusz Hiler <ahiler(a)codeweavers.com>
Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com>
---
v4: Fix a few remaining white spaces issues, sign it off.
Supersedes: 192973
dlls/user32/input.c | 60 ++++++++++++++++++++++----
dlls/user32/tests/input.c | 88 +++++++++++++++++++++++++++++++++++++++
server/protocol.def | 22 ++++++++++
server/queue.c | 29 +++++++++++++
server/trace.c | 28 +++++++++++++
5 files changed, 219 insertions(+), 8 deletions(-)
diff --git a/dlls/user32/input.c b/dlls/user32/input.c
index 150b7de9704..75905beebce 100644
--- a/dlls/user32/input.c
+++ b/dlls/user32/input.c
@@ -1271,22 +1271,66 @@ TrackMouseEvent (TRACKMOUSEEVENT *ptme)
* Success: count of point set in the buffer
* Failure: -1
*/
-int WINAPI GetMouseMovePointsEx(UINT size, LPMOUSEMOVEPOINT ptin, LPMOUSEMOVEPOINT ptout, int count, DWORD res) {
+int WINAPI GetMouseMovePointsEx( UINT size, LPMOUSEMOVEPOINT ptin, LPMOUSEMOVEPOINT ptout, int count, DWORD resolution )
+{
+ cursor_history_t history;
+ cursor_pos_t *pos;
+ int copied;
+ unsigned int i;
- if((size != sizeof(MOUSEMOVEPOINT)) || (count < 0) || (count > 64)) {
- SetLastError(ERROR_INVALID_PARAMETER);
+ C_ASSERT( ARRAY_SIZE( history.positions ) == 64 );
+
+ TRACE( "%d, %p, %p, %d, %d\n", size, ptin, ptout, count, resolution );
+
+ if ((size != sizeof(MOUSEMOVEPOINT)) || (count < 0) || (count > ARRAY_SIZE( history.positions )))
+ {
+ SetLastError( ERROR_INVALID_PARAMETER );
return -1;
}
- if(!ptin || (!ptout && count)) {
- SetLastError(ERROR_NOACCESS);
+ if (!ptin || (!ptout && count))
+ {
+ SetLastError( ERROR_NOACCESS );
return -1;
}
- FIXME("(%d %p %p %d %d) stub\n", size, ptin, ptout, count, res);
+ if (resolution != GMMP_USE_DISPLAY_POINTS)
+ {
+ FIXME( "only GMMP_USE_DISPLAY_POINTS is supported for now\n" );
+ SetLastError( ERROR_POINT_NOT_FOUND );
+ return -1;
+ }
+
+ SERVER_START_REQ( get_cursor_history )
+ {
+ wine_server_set_reply( req, &history, sizeof(history) );
+ if (wine_server_call_err( req )) return -1;
+ }
+ SERVER_END_REQ;
+
+ for (i = 0; i < ARRAY_SIZE( history.positions ); i++)
+ {
+ pos = &history.positions[(i + history.newest) % ARRAY_SIZE( history.positions )];
+ if (ptin->x == pos->x && ptin->y == pos->y && (!ptin->time || ptin->time == pos->time))
+ break;
+ }
+
+ if (i == ARRAY_SIZE( history.positions ))
+ {
+ SetLastError( ERROR_POINT_NOT_FOUND );
+ return -1;
+ }
+
+ for (copied = 0; copied < count && i < ARRAY_SIZE( history.positions ); copied++, i++)
+ {
+ pos = &history.positions[(i + history.newest) % ARRAY_SIZE( history.positions )];
+ ptout[copied].x = pos->x;
+ ptout[copied].y = pos->y;
+ ptout[copied].time = pos->time;
+ ptout[copied].dwExtraInfo = pos->info;
+ }
- SetLastError(ERROR_POINT_NOT_FOUND);
- return -1;
+ return copied;
}
/***********************************************************************
diff --git a/dlls/user32/tests/input.c b/dlls/user32/tests/input.c
index ef6d6e1d430..c3363877b73 100644
--- a/dlls/user32/tests/input.c
+++ b/dlls/user32/tests/input.c
@@ -1481,6 +1481,7 @@ static void test_GetMouseMovePointsEx(void)
MOUSEMOVEPOINT in;
MOUSEMOVEPOINT out[200];
POINT point;
+ TEST_INPUT input;
/* Get a valid content for the input struct */
if(!GetCursorPos(&point)) {
@@ -1605,6 +1606,93 @@ static void test_GetMouseMovePointsEx(void)
ok(GetLastError() == ERROR_INVALID_PARAMETER || GetLastError() == MYERROR,
"expected error ERROR_INVALID_PARAMETER, got %u\n", GetLastError());
+ /* more than 64 to be sure we wrap around */
+ for (int i = 0; i < 67; i++)
+ {
+ in.x = i;
+ in.y = i*2;
+ SetCursorPos( in.x, in.y );
+ }
+
+ SetLastError( MYERROR );
+ retval = pGetMouseMovePointsEx( sizeof(MOUSEMOVEPOINT), &in, out, BUFLIM, GMMP_USE_DISPLAY_POINTS );
+ ok( retval == 64, "expected to get 64 mouse move points but got %d\n", retval );
+ ok( GetLastError() == MYERROR, "expected error to stay %x, got %x\n", MYERROR, GetLastError() );
+
+ for (int i = 0; i < retval; i++)
+ {
+ ok( out[i].x == in.x && out[i].y == in.y, "wrong position %d, expected %dx%d got %dx%d\n", i, in.x, in.y, out[i].x, out[i].y );
+ in.x--;
+ in.y -= 2;
+ }
+
+ in.x = 1500;
+ in.y = 1500;
+ SetLastError( MYERROR );
+ retval = pGetMouseMovePointsEx( sizeof(MOUSEMOVEPOINT), &in, out, BUFLIM, GMMP_USE_DISPLAY_POINTS );
+ ok( retval == -1, "expected to get -1 but got %d\n", retval );
+ ok( GetLastError() == ERROR_POINT_NOT_FOUND, "expected error to be set to %x, got %x\n", ERROR_POINT_NOT_FOUND, GetLastError() );
+
+ /* make sure there's no deduplication */
+ in.x = 6;
+ in.y = 6;
+ SetCursorPos( in.x, in.y );
+ SetCursorPos( in.x, in.y );
+ retval = pGetMouseMovePointsEx( sizeof(MOUSEMOVEPOINT), &in, out, BUFLIM, GMMP_USE_DISPLAY_POINTS );
+ ok( retval == 64, "expected to get 64 mouse move points but got %d\n", retval );
+ ok( out[0].x == 6 && out[0].y == 6, "expected cursor position to be 6x6 but got %d %d\n", out[0].x, out[0].y );
+ ok( out[1].x == 6 && out[1].y == 6, "expected cursor position to be 6x6 but got %d %d\n", out[1].x, out[1].y );
+
+ /* make sure 2 events are distinguishable by their timestamps */
+ in.x = 150;
+ in.y = 75;
+ SetCursorPos( 30, 30 );
+ SetCursorPos( in.x, in.y );
+ SetCursorPos( 150, 150 );
+ Sleep( 3 );
+ SetCursorPos( in.x, in.y );
+
+ retval = pGetMouseMovePointsEx( sizeof(MOUSEMOVEPOINT), &in, out, BUFLIM, GMMP_USE_DISPLAY_POINTS );
+ ok( retval == 64, "expected to get 64 mouse move points but got %d\n", retval );
+ ok( out[0].x == 150 && out[0].y == 75, "expected cursor position to be 150x75 but got %d %d\n", out[0].x, out[0].y );
+ ok( out[1].x == 150 && out[1].y == 150, "expected cursor position to be 150x150 but got %d %d\n", out[1].x, out[1].y );
+ ok( out[2].x == 150 && out[2].y == 75, "expected cursor position to be 150x75 but got %d %d\n", out[2].x, out[2].y );
+
+ in.time = out[2].time;
+ retval = pGetMouseMovePointsEx( sizeof(MOUSEMOVEPOINT), &in, out, BUFLIM, GMMP_USE_DISPLAY_POINTS );
+ ok( retval == 62, "expected to get 62 mouse move points but got %d\n", retval );
+ ok( out[0].x == 150 && out[0].y == 75, "expected cursor position to be 150x75 but got %d %d\n", out[0].x, out[0].y );
+ ok( out[1].x == 30 && out[1].y == 30, "expected cursor position to be 30x30 but got %d %d\n", out[1].x, out[1].y );
+
+ /* events created through other means should also be on the list with correct extra info */
+ mouse_event( MOUSEEVENTF_MOVE, -13, 17, 0, 0xcafecafe );
+ ok( GetCursorPos( &point ), "failed to get cursor position\n" );
+ ok( in.x != point.x && in.y != point.y, "cursor didn't change position after mouse_event()\n" );
+ in.time = 0;
+ in.x = point.x;
+ in.y = point.y;
+ retval = pGetMouseMovePointsEx( sizeof(MOUSEMOVEPOINT), &in, out, BUFLIM, GMMP_USE_DISPLAY_POINTS );
+ ok( retval == 64, "expected to get 64 mouse move points but got %d\n", retval );
+ ok( out[0].dwExtraInfo == 0xcafecafe, "wrong extra info, got 0x%lx expected 0xcafecafe\n", out[0].dwExtraInfo );
+
+ input.type = INPUT_MOUSE;
+ memset( &input, 0, sizeof(input) );
+ input.u.mi.dwFlags = MOUSEEVENTF_MOVE;
+ input.u.mi.dwExtraInfo = 0xdeadbeef;
+ input.u.mi.dx = -17;
+ input.u.mi.dy = 13;
+ SendInput( 1, (INPUT *)&input, sizeof(INPUT) );
+ ok( GetCursorPos( &point ), "failed to get cursor position\n" );
+ ok( in.x != point.x && in.y != point.y, "cursor didn't change position after mouse_event()\n" );
+ in.time = 0;
+ in.x = point.x;
+ in.y = point.y;
+ retval = pGetMouseMovePointsEx( sizeof(MOUSEMOVEPOINT), &in, out, BUFLIM, GMMP_USE_DISPLAY_POINTS );
+ ok( retval == 64, "expected to get 64 mouse move points but got %d\n", retval );
+ ok( out[0].dwExtraInfo == 0xdeadbeef, "wrong extra info, got 0x%lx expected 0xdeadbeef\n", out[0].dwExtraInfo );
+
+ retval = pGetMouseMovePointsEx( sizeof(MOUSEMOVEPOINT), &in, out, BUFLIM, GMMP_USE_HIGH_RESOLUTION_POINTS );
+ todo_wine ok( retval == 64, "expected to get 64 high resolution mouse move points but got %d\n", retval );
#undef BUFLIM
#undef MYERROR
}
diff --git a/server/protocol.def b/server/protocol.def
index 860632ee127..d7d3061c043 100644
--- a/server/protocol.def
+++ b/server/protocol.def
@@ -801,6 +801,22 @@ struct rawinput_device
user_handle_t target;
};
+typedef struct
+{
+ int x;
+ int y;
+ unsigned int time;
+ int __pad;
+ lparam_t info;
+} cursor_pos_t;
+
+typedef struct
+{
+ unsigned int newest;
+ int __pad;
+ cursor_pos_t positions[64];
+} cursor_history_t;
+
/****************************************************************/
/* Request declarations */
@@ -3640,6 +3656,12 @@ struct handle_info
#define SET_CURSOR_CLIP 0x08
#define SET_CURSOR_NOCLIP 0x10
+/* Get the history of the 64 last cursor positions */
+(a)REQ(get_cursor_history)
+(a)REPLY
+ VARARG(history,cursor_history);
+(a)END
+
/* Batch read rawinput message data */
@REQ(get_rawinput_buffer)
diff --git a/server/queue.c b/server/queue.c
index eba5de0972e..f29e8e45028 100644
--- a/server/queue.c
+++ b/server/queue.c
@@ -227,6 +227,8 @@ static const struct object_ops thread_input_ops =
/* pointer to input structure of foreground thread */
static unsigned int last_input_time;
+static cursor_history_t cursor_history;
+
static void queue_hardware_message( struct desktop *desktop, struct message *msg, int always_queue );
static void free_message( struct message *msg );
@@ -1528,14 +1530,32 @@ static void update_rawinput_device(const struct rawinput_device *device)
e->device.target = get_user_full_handle( e->device.target );
}
+static void prepend_cursor_history( int x, int y, unsigned int time, lparam_t info )
+{
+ const size_t positions_len = ARRAY_SIZE( cursor_history.positions );
+ cursor_pos_t *pos;
+ cursor_history.newest = (cursor_history.newest + positions_len - 1) % positions_len;
+ pos = &cursor_history.positions[cursor_history.newest];
+
+ pos->x = x;
+ pos->y = y;
+ pos->time = time;
+ pos->info = info;
+}
+
/* queue a hardware message into a given thread input */
static void queue_hardware_message( struct desktop *desktop, struct message *msg, int always_queue )
{
user_handle_t win;
struct thread *thread;
struct thread_input *input;
+ struct hardware_msg_data *msg_data;
unsigned int msg_code;
+ msg_data = msg->data;
+ if (msg->msg == WM_MOUSEMOVE)
+ prepend_cursor_history( msg->x, msg->y, msg->time, msg_data->info );
+
update_input_key_state( desktop, desktop->keystate, msg->msg, msg->wparam );
last_input_time = get_tick_count();
if (msg->msg != WM_MOUSEMOVE) always_queue = 1;
@@ -3313,6 +3333,15 @@ DECL_HANDLER(set_cursor)
reply->last_change = input->desktop->cursor.last_change;
}
+/* Get the history of the 64 last cursor positions */
+DECL_HANDLER(get_cursor_history)
+{
+ if (sizeof(cursor_history) <= get_reply_max_size())
+ set_reply_data( &cursor_history, min( sizeof(cursor_history), get_reply_max_size() ) );
+ else
+ set_error( STATUS_BUFFER_TOO_SMALL );
+}
+
DECL_HANDLER(get_rawinput_buffer)
{
struct thread_input *input = current->queue->input;
diff --git a/server/trace.c b/server/trace.c
index 32ccad16684..b7a242cd41a 100644
--- a/server/trace.c
+++ b/server/trace.c
@@ -889,6 +889,34 @@ static void dump_varargs_rectangles( const char *prefix, data_size_t size )
remove_data( size );
}
+static void dump_varargs_cursor_history( const char *prefix, data_size_t size )
+{
+ const cursor_history_t *history = cur_data;
+ const cursor_pos_t *pos;
+ data_size_t len;
+ if (size != sizeof(*history))
+ {
+ fprintf( stderr, "%s{}", prefix );
+ return;
+ }
+
+ fprintf( stderr, "%s{", prefix );
+ fprintf( stderr, "newest=%u,", history->newest );
+ fprintf( stderr, "positions={" );
+ len = ARRAY_SIZE( history->positions );
+ pos = history->positions;
+ while (len > 0)
+ {
+ fprintf( stderr, "{x=%d,y=%d,time=%u", pos->x, pos->y, pos->time );
+ dump_uint64( ",info=", &pos->info );
+ fputc( '}', stderr );
+ pos++;
+ if (--len) fputc( ',', stderr );
+ }
+ fputc( '}', stderr );
+ fputc( '}', stderr );
+}
+
static void dump_varargs_message_data( const char *prefix, data_size_t size )
{
/* FIXME: dump the structured data */
--
2.28.0
4
4
Oct. 2, 2020
Windows SDKs use #include here to import one into the other, so we do
the same.
Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com>
---
v2: So this is probably how it should be, at least to match recent
Windows SDKs, and to define IAgileObject in the right place.
Supersedes: 193527
include/Makefile.in | 1 +
include/objidl.idl | 1217 +---------------------------------------
include/objidlbase.idl | 1198 +++++++++++++++++++++++++++++++++++++++
3 files changed, 1227 insertions(+), 1189 deletions(-)
create mode 100644 include/objidlbase.idl
diff --git a/include/Makefile.in b/include/Makefile.in
index 91a02645c33..8621c5a8ff8 100644
--- a/include/Makefile.in
+++ b/include/Makefile.in
@@ -532,6 +532,7 @@ SOURCES = \
objbase.h \
objectarray.idl \
objidl.idl \
+ objidlbase.idl \
objsafe.idl \
objsel.h \
ocidl.idl \
diff --git a/include/objidl.idl b/include/objidl.idl
index a86ceb8b1d6..7576a686aeb 100644
--- a/include/objidl.idl
+++ b/include/objidl.idl
@@ -18,166 +18,18 @@
#ifndef DO_NO_IMPORTS
import "unknwn.idl";
+#define DO_NO_IMPORTS
+#define OBJIDL_UNDEF_DO_NO_IMPORTS
+#endif
+
+#include "objidlbase.idl"
+#ifdef OBJIDL_UNDEF_DO_NO_IMPORTS
+#undef DO_NO_IMPORTS
#endif
-interface IStream;
-interface IEnumString;
interface IRunningObjectTable;
interface IMoniker;
interface IAdviseSink;
-interface IAsyncManager;
-interface ISynchronize;
-
-typedef struct _COSERVERINFO {
- DWORD dwReserved1;
- LPWSTR pwszName;
- COAUTHINFO *pAuthInfo;
- DWORD dwReserved2;
-} COSERVERINFO;
-
-/******************** Fundamentals ********************/
-
-[
- local,
- object,
- uuid(00000003-0000-0000-C000-000000000046)
-]
-interface IMarshal : IUnknown
-{
- typedef [unique] IMarshal *LPMARSHAL;
-
- HRESULT GetUnmarshalClass(
- [in] REFIID riid,
- [in, unique] void *pv,
- [in] DWORD dwDestContext,
- [in, unique] void *pvDestContext,
- [in] DWORD mshlflags,
- [out] CLSID *pCid);
-
- HRESULT GetMarshalSizeMax(
- [in] REFIID riid,
- [in, unique] void *pv,
- [in] DWORD dwDestContext,
- [in, unique] void *pvDestContext,
- [in] DWORD mshlflags,
- [out] DWORD *pSize);
-
- HRESULT MarshalInterface(
- [in, unique] IStream *pStm,
- [in] REFIID riid,
- [in, unique] void *pv,
- [in] DWORD dwDestContext,
- [in, unique] void *pvDestContext,
- [in] DWORD mshlflags);
-
- HRESULT UnmarshalInterface(
- [in, unique] IStream *pStm,
- [in] REFIID riid,
- [out] void **ppv);
-
- HRESULT ReleaseMarshalData(
- [in, unique] IStream *pStm);
-
- HRESULT DisconnectObject(
- [in] DWORD dwReserved);
-}
-
-[
- local,
- object,
- uuid(000001cf-0000-0000-C000-000000000046)
-]
-interface IMarshal2 : IMarshal
-{
- typedef [unique] IMarshal2 *LPMARSHAL2;
-}
-
-[
- local,
- object,
- uuid(00000018-0000-0000-C000-000000000046)
-]
-interface IStdMarshalInfo : IUnknown
-{
- typedef [unique] IStdMarshalInfo *LPSTDMARSHALINFO;
-
- HRESULT GetClassForHandler(
- [in] DWORD dwDestContext,
- [in, unique] void *pvDestContext,
- [out] CLSID *pClsid);
-}
-
-[
- local,
- object,
- uuid(00000019-0000-0000-C000-000000000046)
-]
-interface IExternalConnection : IUnknown
-{
- typedef [unique] IExternalConnection *LPEXTERNALCONNECTION;
-
- typedef enum tagEXTCONN {
- EXTCONN_STRONG = 0x0001,
- EXTCONN_WEAK = 0x0002,
- EXTCONN_CALLABLE = 0x0004
- } EXTCONN;
-
- DWORD AddConnection(
- [in] DWORD extconn,
- [in] DWORD reserved);
-
- DWORD ReleaseConnection(
- [in] DWORD extconn,
- [in] DWORD reserved,
- [in] BOOL fLastReleaseCloses);
-}
-
-[
- local,
- object,
- uuid(00000020-0000-0000-C000-000000000046)
-]
-interface IMultiQI : IUnknown
-{
- typedef [unique] IMultiQI *LPMULTIQI;
-
- typedef struct tagMULTI_QI {
- const IID *pIID;
- IUnknown *pItf;
- HRESULT hr;
- } MULTI_QI;
-
- HRESULT QueryMultipleInterfaces(
- [in] ULONG cMQIs,
- [in, out] MULTI_QI *pMQIs);
-}
-
-[
- local,
- object,
- uuid(00000002-0000-0000-C000-000000000046)
-]
-interface IMalloc : IUnknown
-{
- typedef [unique] IMalloc *LPMALLOC;
-
- LPVOID Alloc(
- [in] SIZE_T cb);
-
- LPVOID Realloc(
- [in] LPVOID pv,
- [in] SIZE_T cb);
-
- void Free(
- [in] LPVOID pv);
-
- SIZE_T GetSize(
- [in] LPVOID pv);
-
- int DidAlloc(LPVOID pv);
-
- void HeapMinimize();
-}
[
local,
@@ -233,87 +85,6 @@ interface IMallocSpy : IUnknown
void PostHeapMinimize();
}
-[
- local,
- object,
- uuid(00000021-0000-0000-C000-000000000046)
-]
-interface IInternalUnknown : IUnknown
-{
- HRESULT QueryInternalInterface(
- [in] REFIID riid,
- [out] void **ppv);
-}
-
-[
- object,
- uuid(00000100-0000-0000-C000-000000000046),
- pointer_default(unique)
-]
-interface IEnumUnknown : IUnknown
-{
- typedef [unique] IEnumUnknown *LPENUMUNKNOWN;
-
- [local]
- HRESULT Next(
- [in] ULONG celt,
- [out] IUnknown **rgelt,
- [out] ULONG *pceltFetched);
-
- [call_as(Next)]
- HRESULT RemoteNext(
- [in] ULONG celt,
- [out, size_is(celt), length_is(*pceltFetched)]
- IUnknown **rgelt,
- [out] ULONG *pceltFetched);
-
- HRESULT Skip(
- [in] ULONG celt);
-
- HRESULT Reset();
-
- HRESULT Clone(
- [out] IEnumUnknown **ppenum);
-}
-
-[
- object,
- uuid(00000022-0000-0000-C000-000000000046),
- version(1.0),
- pointer_default(unique)
-]
-interface ISurrogate : IUnknown
-{
- typedef [unique] ISurrogate *LPSURROGATE;
-
- HRESULT LoadDllServer(
- [in] REFCLSID Clsid);
- HRESULT FreeSurrogate();
-}
-
-[
- local,
- object,
- uuid(00000146-0000-0000-C000-000000000046)
-]
-interface IGlobalInterfaceTable : IUnknown
-{
- typedef [unique] IGlobalInterfaceTable *LPGLOBALINTERFACETABLE;
-
- HRESULT RegisterInterfaceInGlobal(
- [in] IUnknown *pUnk,
- [in] REFIID riid,
- [out] DWORD *pdwCookie);
-
- HRESULT RevokeInterfaceFromGlobal(
- [in] DWORD dwCookie);
-
- HRESULT GetInterfaceFromGlobal(
- [in] DWORD dwCookie,
- [in] REFIID riid,
- [out, iid_is(riid)] void **ppv);
-}
-
/******************** Monikers ********************/
[
@@ -668,38 +439,6 @@ interface IROTData : IUnknown
[out] ULONG *pcbData);
}
-[
- object,
- uuid(00000101-0000-0000-C000-000000000046),
- pointer_default(unique)
-]
-interface IEnumString : IUnknown
-{
- typedef [unique] IEnumString *LPENUMSTRING;
-
- [local]
- HRESULT Next(
- [in] ULONG celt,
- [out, size_is(celt), length_is(*pceltFetched)]
- LPOLESTR *rgelt,
- [out] ULONG *pceltFetched);
-
- [call_as(Next)]
- HRESULT RemoteNext(
- [in] ULONG celt,
- [out, size_is(celt), length_is(*pceltFetched)]
- LPOLESTR *rgelt,
- [out] ULONG *pceltFetched);
-
- HRESULT Skip(
- [in] ULONG celt);
-
- HRESULT Reset();
-
- HRESULT Clone(
- [out] IEnumString **ppenum);
-}
-
[
object,
uuid(00000140-0000-0000-C000-000000000046)
@@ -714,143 +453,6 @@ interface IClassActivator : IUnknown
[out, iid_is(riid)] void **ppv);
}
-/******************** Storage ********************/
-
-[
- object,
- uuid(0c733a30-2a1c-11ce-ade5-00aa0044773d),
- pointer_default(unique)
-]
-interface ISequentialStream : IUnknown
-{
- [local]
- HRESULT Read(
- [out, size_is(cb), length_is(*pcbRead)]
- void *pv,
- [in] ULONG cb,
- [out] ULONG *pcbRead);
-
- [call_as(Read)]
- HRESULT RemoteRead(
- [out, size_is(cb), length_is(*pcbRead)]
- byte *pv,
- [in] ULONG cb,
- [out] ULONG *pcbRead);
-
- [local]
- HRESULT Write(
- [in, size_is(cb)] const void *pv,
- [in] ULONG cb,
- [out] ULONG *pcbWritten);
-
- [call_as(Write)]
- HRESULT RemoteWrite(
- [in, size_is(cb)] const byte *pv,
- [in] ULONG cb,
- [out] ULONG *pcbWritten);
-}
-
-[
- object,
- uuid(0000000c-0000-0000-C000-000000000046),
- pointer_default(unique)
-]
-interface IStream : ISequentialStream
-{
- typedef [unique] IStream *LPSTREAM;
-
- typedef struct tagSTATSTG {
- LPOLESTR pwcsName;
- DWORD type;
- ULARGE_INTEGER cbSize;
- FILETIME mtime;
- FILETIME ctime;
- FILETIME atime;
- DWORD grfMode;
- DWORD grfLocksSupported;
- CLSID clsid;
- DWORD grfStateBits;
- DWORD reserved;
- } STATSTG;
-
- typedef enum tagSTGTY {
- STGTY_STORAGE = 1,
- STGTY_STREAM = 2,
- STGTY_LOCKBYTES = 3,
- STGTY_PROPERTY = 4
- } STGTY;
-
- typedef enum tagSTREAM_SEEK {
- STREAM_SEEK_SET = 0,
- STREAM_SEEK_CUR = 1,
- STREAM_SEEK_END = 2
- } STREAM_SEEK;
-
- /* these are defined in Linux's fcntl.h,
- * undefine them to avoid conflicts */
- cpp_quote("#undef LOCK_MAND")
- cpp_quote("#undef LOCK_READ")
- cpp_quote("#undef LOCK_WRITE")
- cpp_quote("#undef LOCK_RW")
-
- typedef enum tagLOCKTYPE {
- LOCK_WRITE = 1,
- LOCK_EXCLUSIVE = 2,
- LOCK_ONLYONCE = 4
- } LOCKTYPE;
-
- [local]
- HRESULT Seek(
- [in] LARGE_INTEGER dlibMove,
- [in] DWORD dwOrigin,
- [out] ULARGE_INTEGER *plibNewPosition);
-
- [call_as(Seek)]
- HRESULT RemoteSeek(
- [in] LARGE_INTEGER dlibMove,
- [in] DWORD dwOrigin,
- [out] ULARGE_INTEGER *plibNewPosition);
-
- HRESULT SetSize(
- [in] ULARGE_INTEGER libNewSize);
-
- [local]
- HRESULT CopyTo(
- [in, unique] IStream *pstm,
- [in] ULARGE_INTEGER cb,
- [out] ULARGE_INTEGER *pcbRead,
- [out] ULARGE_INTEGER *pcbWritten);
-
- [call_as(CopyTo)]
- HRESULT RemoteCopyTo(
- [in, unique] IStream *pstm,
- [in] ULARGE_INTEGER cb,
- [out] ULARGE_INTEGER *pcbRead,
- [out] ULARGE_INTEGER *pcbWritten);
-
- HRESULT Commit(
- [in] DWORD grfCommitFlags);
-
- HRESULT Revert();
-
- HRESULT LockRegion(
- [in] ULARGE_INTEGER libOffset,
- [in] ULARGE_INTEGER cb,
- [in] DWORD dwLockType);
-
- HRESULT UnlockRegion(
- [in] ULARGE_INTEGER libOffset,
- [in] ULARGE_INTEGER cb,
- [in] DWORD dwLockType);
-
- HRESULT Stat(
- [out] STATSTG *pstatstg,
- [in] DWORD grfStatFlag);
-
- HRESULT Clone(
- [out] IStream **ppstm);
-}
-
[
object,
uuid(0000000d-0000-0000-C000-000000000046),
@@ -1689,604 +1291,36 @@ interface IMessageFilter : IUnknown
}
[
- local,
- object,
- uuid(D5F56B60-593B-101A-B569-08002B2DBF7A)
+ object,
+ uuid(0e6d4d92-6738-11cf-9608-00aa00680db4)
]
-interface IRpcChannelBuffer : IUnknown
+interface IDirectWriterLock : IUnknown
{
- typedef [unique] IRpcChannelBuffer *LPRPCCHANNELBUFFER;
-
- typedef unsigned long RPCOLEDATAREP;
-
- typedef struct tagRPCOLEMESSAGE {
- void *reserved1;
- RPCOLEDATAREP dataRepresentation;
- void *Buffer;
- ULONG cbBuffer;
- ULONG iMethod;
- void *reserved2[5];
- ULONG rpcFlags;
- } RPCOLEMESSAGE;
-
- typedef RPCOLEMESSAGE *PRPCOLEMESSAGE;
-
- HRESULT GetBuffer(
- [in] RPCOLEMESSAGE *pMessage,
- [in] REFIID riid);
-
- HRESULT SendReceive(
- [in,out] RPCOLEMESSAGE *pMessage,
- [out] ULONG *pStatus);
-
- HRESULT FreeBuffer(
- [in] RPCOLEMESSAGE *pMessage);
+ HRESULT WaitForWriteAccess(
+ [in] DWORD dwTimeout);
- HRESULT GetDestCtx(
- [out] DWORD *pdwDestContext,
- [out] void **ppvDestContext);
+ HRESULT ReleaseWriteAccess();
- HRESULT IsConnected();
+ HRESULT HaveWriteAccess();
}
[
- local,
- object,
- uuid(594f31d0-7f19-11d0-b194-00a0c90dc8bf)
+ object,
+ uuid(00000026-0000-0000-C000-000000000046)
]
-interface IRpcChannelBuffer2 : IRpcChannelBuffer
+interface IUrlMon : IUnknown
{
- typedef [unique] IRpcChannelBuffer2 *LPRPCCHANNELBUFFER2;
-
- HRESULT GetProtocolVersion(
- [in,out] DWORD *pdwVersion);
-}
-
-[
- local,
- object,
- uuid(25B15600-0115-11d0-BF0D-00AA00B8DFD2)
-]
-interface IRpcChannelBuffer3 : IRpcChannelBuffer2
-{
- typedef [unique] IRpcChannelBuffer3 *LPRPCCHANNELBUFFER3;
-
- HRESULT Send(
- [in,out] RPCOLEMESSAGE *pMsg,
- [out] ULONG *pulStatus);
-
- HRESULT Receive(
- [in,out] RPCOLEMESSAGE *pMsg,
- [in] ULONG ulSize,
- [out] ULONG *pulStatus);
-
- HRESULT Cancel(
- [in] RPCOLEMESSAGE *pMsg);
-
- HRESULT GetCallContext(
- [in] RPCOLEMESSAGE *pMsg,
- [in] REFIID riid,
- [out] void **pInterface);
-
- HRESULT GetDestCtxEx(
- [in] RPCOLEMESSAGE *pMsg,
- [out] DWORD *pdwDestContext,
- [out] void **ppvDestContext);
-
- HRESULT GetState(
- [in] RPCOLEMESSAGE *pMsg,
- [out] DWORD *pState);
-
- HRESULT RegisterAsync(
- [in] RPCOLEMESSAGE *pMsg,
- [in] IAsyncManager *pAsyncMgr);
-}
-
-[
- local,
- object,
- uuid(a5029fb6-3c34-11d1-9c99-00c04fb998aa),
- pointer_default(unique)
-]
-interface IAsyncRpcChannelBuffer : IRpcChannelBuffer2
-{
- HRESULT Send(
- [in, out] RPCOLEMESSAGE *pMsg,
- [in] ISynchronize *pSync,
- [out] ULONG *pulStatus);
-
- HRESULT Receive(
- [in, out] RPCOLEMESSAGE *pMsg,
- [out] ULONG *pulStatus);
-
- HRESULT GetDestCtxEx(
- [in] RPCOLEMESSAGE *pMsg,
- [out] DWORD *pdwDestContext,
- [out] void **ppvDestContext);
-}
-
-[
- local,
- object,
- uuid(58a08519-24c8-4935-b482-3fd823333a4f)
-]
-interface IRpcSyntaxNegotiate : IUnknown
-{
- HRESULT NegotiateSyntax(
- [in, out] RPCOLEMESSAGE *pMsg);
-}
-
-[
- local,
- object,
- uuid(D5F56A34-593B-101A-B569-08002B2DBF7A)
-]
-interface IRpcProxyBuffer : IUnknown
-{
- typedef [unique] IRpcProxyBuffer *LPRPCPROXYBUFFER;
-
- HRESULT Connect(
- [in, unique] IRpcChannelBuffer *pRpcChannelBuffer);
-
- void Disconnect();
-}
-
-[
- local,
- object,
- uuid(D5F56AFC-593B-101A-B569-08002B2DBF7A)
-]
-interface IRpcStubBuffer : IUnknown
-{
- typedef [unique] IRpcStubBuffer *LPRPCSTUBBUFFER;
-
- HRESULT Connect(
- [in] IUnknown *pUnkServer);
-
- void Disconnect();
-
- HRESULT Invoke(
- [in] RPCOLEMESSAGE *_prpcmsg,
- [in] IRpcChannelBuffer *_pRpcChannelBuffer);
-
- IRpcStubBuffer *IsIIDSupported(
- [in] REFIID riid);
-
- ULONG CountRefs();
-
- HRESULT DebugServerQueryInterface(
- void **ppv);
-
- void DebugServerRelease(
- void *pv);
-}
-
-[
- local,
- object,
- uuid(D5F569D0-593B-101A-B569-08002B2DBF7A)
-]
-interface IPSFactoryBuffer : IUnknown
-{
- typedef [unique] IPSFactoryBuffer *LPPSFACTORYBUFFER;
-
- HRESULT CreateProxy(
- [in] IUnknown *pUnkOuter,
- [in] REFIID riid,
- [out] IRpcProxyBuffer **ppProxy,
- [out] void **ppv);
-
- HRESULT CreateStub(
- [in] REFIID riid,
- [in, unique] IUnknown *pUnkServer,
- [out] IRpcStubBuffer **ppStub);
-}
-
-[
- local,
- object,
- uuid(1008c4a0-7613-11cf-9af1-0020af6e72f4)
-]
-interface IChannelHook : IUnknown
-{
- typedef [unique] IChannelHook *LPCHANNELHOOK;
-
- typedef struct SChannelHookCallInfo {
- IID iid;
- DWORD cbSize;
- GUID uCausality;
- DWORD dwServerPid;
- DWORD iMethod;
- void *pObject;
- } SChannelHookCallInfo;
-
- void ClientGetSize(
- [in] REFGUID uExtent,
- [in] REFIID riid,
- [out] ULONG *pDataSize);
-
- void ClientFillBuffer(
- [in] REFGUID uExtent,
- [in] REFIID riid,
- [in, out] ULONG *pDataSize,
- [in] void *pDataBuffer);
-
- void ClientNotify(
- [in] REFGUID uExtent,
- [in] REFIID riid,
- [in] ULONG cbDataSize,
- [in] void *pDataBuffer,
- [in] DWORD lDataRep,
- [in] HRESULT hrFault);
-
- void ServerNotify(
- [in] REFGUID uExtent,
- [in] REFIID riid,
- [in] ULONG cbDataSize,
- [in] void *pDataBuffer,
- [in] DWORD lDataRep);
-
- void ServerGetSize(
- [in] REFGUID uExtent,
- [in] REFIID riid,
- [in] HRESULT hrFault,
- [out] ULONG *pDataSize);
-
- void ServerFillBuffer(
- [in] REFGUID uExtent,
- [in] REFIID riid,
- [in, out] ULONG *pDataSize,
- [in] void *pDataBuffer,
- [in] HRESULT hrFault );
-}
-
-extern const FMTID FMTID_SummaryInformation;
-extern const FMTID FMTID_DocSummaryInformation;
-extern const FMTID FMTID_UserDefinedProperties;
-
-
-/******************** Connection Points ********************/
-/* FIXME */
-
-/******************** DCOM ********************/
-
-[
- local,
- object,
- uuid(0000013D-0000-0000-C000-000000000046)
-]
-interface IClientSecurity : IUnknown
-{
- typedef struct tagSOLE_AUTHENTICATION_SERVICE {
- DWORD dwAuthnSvc;
- DWORD dwAuthzSvc;
- OLECHAR *pPrincipalName;
- HRESULT hr;
- } SOLE_AUTHENTICATION_SERVICE;
-
- typedef SOLE_AUTHENTICATION_SERVICE *PSOLE_AUTHENTICATION_SERVICE;
-
- typedef struct tagSOLE_AUTHENTICATION_INFO {
- DWORD dwAuthnSvc;
- DWORD dwAuthzSvc;
- void *pAuthInfo;
- } SOLE_AUTHENTICATION_INFO;
-
- const OLECHAR *COLE_DEFAULT_PRINCIPAL = (OLECHAR*) -1;
- const void *COLE_DEFAULT_AUTHINFO = (void*) -1;
-
- typedef struct tagSOLE_AUTHENTICATION_LIST {
- DWORD cAuthInfo;
- SOLE_AUTHENTICATION_INFO *aAuthInfo;
- } SOLE_AUTHENTICATION_LIST;
-
- typedef enum tagEOLE_AUTHENTICATION_CAPABILITIES {
- EOAC_NONE = 0x0,
- EOAC_MUTUAL_AUTH = 0x1,
- EOAC_SECURE_REFS = 0x2, /* CoInitializeSecurity only */
- EOAC_ACCESS_CONTROL = 0x4, /* CoInitializeSecurity only */
- EOAC_APPID = 0x8, /* CoInitializeSecurity only */
- EOAC_DYNAMIC = 0x10, /* CoInitializeSecurity only */
- EOAC_STATIC_CLOAKING = 0x20,
- EOAC_DYNAMIC_CLOAKING = 0x40,
- EOAC_ANY_AUTHORITY = 0x80,
- EOAC_MAKE_FULLSIC = 0x100,
- EOAC_REQUIRE_FULLSIC = 0x200, /* CoInitializeSecurity only */
- EOAC_AUTO_IMPERSONATE = 0x400, /* CoInitializeSecurity only */
- EOAC_DEFAULT = 0x800,
- EOAC_DISABLE_AAA = 0x1000, /* CoInitializeSecurity only */
- EOAC_NO_CUSTOM_MARSHAL = 0x2000, /* CoInitializeSecurity only */
- } EOLE_AUTHENTICATION_CAPABILITIES;
-
- HRESULT QueryBlanket(
- [in] IUnknown *pProxy,
- [out] DWORD *pAuthnSvc,
- [out] DWORD *pAuthzSvc,
- [out] OLECHAR **pServerPrincName,
- [out] DWORD *pAuthnLevel,
- [out] DWORD *pImpLevel,
- [out] void **pAuthInfo,
- [out] DWORD *pCapabilities);
-
- HRESULT SetBlanket(
- [in] IUnknown *pProxy,
- [in] DWORD AuthnSvc,
- [in] DWORD AuthzSvc,
- [in] OLECHAR *pServerPrincName,
- [in] DWORD AuthnLevel,
- [in] DWORD ImpLevel,
- [in] void *pAuthInfo,
- [in] DWORD Capabilities);
-
- HRESULT CopyProxy(
- [in] IUnknown *pProxy,
- [out] IUnknown **ppCopy);
-}
-
-[
- local,
- object,
- uuid(0000013E-0000-0000-C000-000000000046)
-]
-interface IServerSecurity : IUnknown
-{
- HRESULT QueryBlanket(
- [out] DWORD *pAuthnSvc,
- [out] DWORD *pAuthzSvc,
- [out] OLECHAR **pServerPrincName,
- [out] DWORD *pAuthnLevel,
- [out] DWORD *pImpLevel,
- [out] void **pPrivs,
- [out] DWORD *pCapabilities);
-
- HRESULT ImpersonateClient();
-
- HRESULT RevertToSelf();
-
- BOOL IsImpersonating();
-}
-
-[
- local,
- object,
- uuid(00000024-0000-0000-C000-000000000046)
-]
-interface IAsyncSetup : IUnknown
-{
- HRESULT GetAsyncManager(
- [in] REFIID riid,
- [in] IUnknown *pOuter,
- [in] DWORD dwFlags,
- [out] IUnknown **ppInner,
- [out] IAsyncManager **ppAsyncMgr);
-}
-
-[
- object,
- uuid(0e6d4d92-6738-11cf-9608-00aa00680db4)
-]
-interface IDirectWriterLock : IUnknown
-{
- HRESULT WaitForWriteAccess(
- [in] DWORD dwTimeout);
-
- HRESULT ReleaseWriteAccess();
-
- HRESULT HaveWriteAccess();
-}
-
-[
- object,
- uuid(00000030-0000-0000-C000-000000000046)
-]
-
-interface ISynchronize : IUnknown
-{
- HRESULT Wait(
- [in] DWORD dwFlags,
- [in] DWORD dwMilliseconds);
-
- HRESULT Signal();
-
- HRESULT Reset();
-}
-
-
-[
- local,
- object,
- uuid(00000031-0000-0000-C000-000000000046)
-]
-interface ISynchronizeHandle : IUnknown
-{
- HRESULT GetHandle(
- [out] HANDLE *ph);
-}
-
-
-[
- local,
- object,
- uuid(00000032-0000-0000-C000-000000000046)
-]
-interface ISynchronizeEvent : ISynchronizeHandle
-{
- HRESULT SetEventHandle(
- [in] HANDLE *ph);
-}
-
-
-[
- local,
- object,
- uuid(00000033-0000-0000-C000-000000000046)
-]
-interface ISynchronizeContainer : IUnknown
-{
- HRESULT AddSynchronize(
- [in] ISynchronize *pSync);
-
- HRESULT WaitMultiple(
- [in] DWORD dwFlags,
- [in] DWORD dwTimeOut,
- [out] ISynchronize **ppSync);
-}
-
-[
- local,
- object,
- uuid(00000025-0000-0000-C000-000000000046)
-]
-interface ISynchronizeMutex : ISynchronize
-{
- HRESULT ReleaseMutex();
-}
-
-[
- local,
- object,
- uuid(00000029-0000-0000-C000-000000000046)
-]
-
-interface ICancelMethodCalls : IUnknown
-{
- typedef [unique] ICancelMethodCalls *LPCANCELMETHODCALLS;
-
- HRESULT Cancel(
- [in] ULONG ulSeconds);
-
- HRESULT TestCancel();
-}
-
-[
- local,
- object,
- uuid(0000002A-0000-0000-C000-000000000046)
-]
-interface IAsyncManager : IUnknown
-{
- typedef enum tagDCOM_CALL_STATE {
- DCOM_NONE = 0,
- DCOM_CALL_COMPLETE = 1,
- DCOM_CALL_CANCELED = 2
- } DCOM_CALL_STATE;
-
- HRESULT CompleteCall(
- [in] HRESULT Result);
-
- HRESULT GetCallContext(
- [in] REFIID riid,
- [out] void **pInterface);
-
- HRESULT GetState(
- [out] ULONG *pulStateFlags);
-}
-
-[
- local,
- object,
- uuid(1c733a30-2a1c-11ce-ade5-00aa0044773d),
- pointer_default(unique)
-]
-interface ICallFactory : IUnknown
-{
- HRESULT CreateCall(
- [in] REFIID riid,
- [in] IUnknown *pCtrlUnk,
- [in] REFIID riid2,
- [out, iid_is(riid2)] IUnknown **ppv);
-}
-
-[
- local,
- object,
- uuid(00000144-0000-0000-C000-000000000046)
-]
-interface IRpcOptions : IUnknown
-{
- HRESULT Set(
- [in] IUnknown *pPrx,
- [in] DWORD dwProperty,
- [in] ULONG_PTR dwValue);
-
- HRESULT Query(
- [in] IUnknown *pPrx,
- [in] DWORD dwProperty,
- [out] ULONG_PTR *pdwValue);
-}
-
-enum {
- COMBND_RPCTIMEOUT = 1,
- COMBND_SERVER_LOCALITY = 2
-};
-
-enum {
- SERVER_LOCALITY_PROCESS_LOCAL = 0,
- SERVER_LOCALITY_MACHINE_LOCAL = 1,
- SERVER_LOCALITY_REMOTE = 2
-};
-
-[
- local,
- object,
- uuid(00000149-0000-0000-C000-000000000046),
- pointer_default(unique)
-]
-interface IRpcHelper : IUnknown
-{
- HRESULT GetDCOMProtocolVersion(
- [out] DWORD *pComVersion);
-
- HRESULT GetIIDFromOBJREF(
- [in] void *pObjRef,
- [out] IID **piid);
-}
-
-[
- local,
- object,
- uuid(eb0cb9e8-7996-11d2-872e-0000f8080859)
-]
-interface IReleaseMarshalBuffers : IUnknown
-{
- HRESULT ReleaseMarshalBuffer(
- [in] RPCOLEMESSAGE *pMsg,
- [in] DWORD dwFlags,
- [in, unique] IUnknown *pChnl);
-}
-
-[
- local,
- object,
- uuid(0000002B-0000-0000-C000-000000000046)
-]
-interface IWaitMultiple : IUnknown
-{
- HRESULT WaitMultiple(
- [in] DWORD timeout,
- [out] ISynchronize **pSync);
- HRESULT AddSynchronize(
- [in] ISynchronize *pSync);
-}
-
-
-[
- object,
- uuid(00000026-0000-0000-C000-000000000046)
-]
-interface IUrlMon : IUnknown
-{
- HRESULT AsyncGetClassBits(
- [in] REFCLSID rclsid,
- [in, unique] LPCWSTR pszTYPE,
- [in, unique] LPCWSTR pszExt,
- [in] DWORD dwFileVersionMS,
- [in] DWORD dwFileVersionLS,
- [in, unique] LPCWSTR pszCodeBase,
- [in] IBindCtx *pbc,
- [in] DWORD dwClassContext,
- [in] REFIID riid,
- [in] DWORD flags);
+ HRESULT AsyncGetClassBits(
+ [in] REFCLSID rclsid,
+ [in, unique] LPCWSTR pszTYPE,
+ [in, unique] LPCWSTR pszExt,
+ [in] DWORD dwFileVersionMS,
+ [in] DWORD dwFileVersionLS,
+ [in, unique] LPCWSTR pszCodeBase,
+ [in] IBindCtx *pbc,
+ [in] DWORD dwClassContext,
+ [in] REFIID riid,
+ [in] DWORD flags);
}
[
@@ -2300,87 +1334,6 @@ interface IForegroundTransfer : IUnknown
[in] void *lpvReserved);
}
-[
- local,
- object,
- uuid(00000147-0000-0000-C000-000000000046)
-]
-interface IAddrTrackingControl : IUnknown
-{
- typedef [unique] IAddrTrackingControl *LPADDRTRACKINGCONTROL;
-
- HRESULT EnableCOMDynamicAddrTracking();
- HRESULT DisableCOMDynamicAddrTracking();
-}
-
-[
- local,
- object,
- uuid(00000148-0000-0000-C000-000000000046)
-]
-interface IAddrExclusionControl : IUnknown
-{
- typedef [unique] IAddrExclusionControl *LPADDREXCLUSIONCONTROL;
-
- HRESULT GetCurrentAddrExclusionList(
- [in] REFIID riid,
- [out, iid_is(riid)] void **ppEnumerator);
- HRESULT UpdateAddrExclusionList(
- [in] IUnknown *pEnumerator);
-}
-
-typedef enum _APTTYPE {
- APTTYPE_CURRENT = -1,
- APTTYPE_STA = 0,
- APTTYPE_MTA = 1,
- APTTYPE_NA = 2,
- APTTYPE_MAINSTA = 3
-} APTTYPE;
-
-typedef enum _APTTYPEQUALIFIER {
- APTTYPEQUALIFIER_NONE,
- APTTYPEQUALIFIER_IMPLICIT_MTA,
- APTTYPEQUALIFIER_NA_ON_MTA,
- APTTYPEQUALIFIER_NA_ON_STA,
- APTTYPEQUALIFIER_NA_ON_IMPLICIT_MTA,
- APTTYPEQUALIFIER_NA_ON_MAINSTA
-} APTTYPEQUALIFIER;
-
-typedef enum _THDTYPE {
- THDTYPE_BLOCKMESSAGES = 0,
- THDTYPE_PROCESSMESSAGES = 1
-} THDTYPE;
-
-[
- local,
- object,
- uuid(000001ce-0000-0000-C000-000000000046),
- pointer_default(unique)
-]
-interface IComThreadingInfo : IUnknown
-{
- HRESULT GetCurrentApartmentType(
- [out] APTTYPE *pAptType);
- HRESULT GetCurrentThreadType(
- [out] THDTYPE *pThreadType);
- HRESULT GetCurrentLogicalThreadId(
- [out] GUID *pguidLogicalThreadId);
- HRESULT SetCurrentLogicalThreadId(
- [in] REFGUID rguid);
-}
-
-
-[
- object,
- pointer_default(unique),
- uuid(72380d55-8d2b-43a3-8513-2b6ef31434e9)
-]
-interface IProcessInitControl : IUnknown
-{
- HRESULT ResetInitializerTimeout(
- [in] DWORD dwSecondsRemaining);
-}
-
[
local,
object,
@@ -2426,40 +1379,6 @@ interface IThumbnailExtractor : IUnknown
[in] IStorage *pStg);
}
-typedef enum tagGLOBALOPT_PROPERTIES
-{
- COMGLB_EXCEPTION_HANDLING = 1,
- COMGLB_APPID = 2,
- COMGLB_RPC_THREADPOOL_SETTING = 3
-} GLOBALOPT_PROPERTIES;
-
-typedef enum tagGLOBALOPT_EH_VALUES
-{
- COMGLB_EXCEPTION_HANDLE = 0,
- COMGLB_EXCEPTION_DONOT_HANDLE_FATAL = 1,
- COMGLB_EXCEPTION_DONOT_HANDLE = COMGLB_EXCEPTION_DONOT_HANDLE_FATAL,
- COMGLB_EXCEPTION_DONOT_HANDLE_ANY = 2
-} GLOBALOPT_EH_VALUES;
-
-typedef enum tagGLOBALOPT_RPCTP_VALUES
-{
- COMGLB_RPC_THREADPOOL_SETTING_DEFAULT_POOL = 0,
- COMGLB_RPC_THREADPOOL_SETTING_PRIVATE_POOL = 1
-} GLOBALOPT_RPCTP_VALUES;
-
-
-[
- object,
- local,
- pointer_default(unique),
- uuid(0000015B-0000-0000-C000-000000000046)
-]
-interface IGlobalOptions : IUnknown
-{
- HRESULT Set([in] GLOBALOPT_PROPERTIES property, [in] ULONG_PTR value);
- HRESULT Query([in] GLOBALOPT_PROPERTIES property, [out ] ULONG_PTR *value);
-}
-
[
object,
pointer_default(unique),
@@ -2480,83 +1399,3 @@ interface IApartmentShutdown : IUnknown
{
void OnUninitialize([in] UINT64 identifier);
}
-
-cpp_quote("#ifdef USE_COM_CONTEXT_DEF")
-
-typedef DWORD CPFLAGS;
-
-typedef struct tagContextProperty
-{
- GUID policyId;
- CPFLAGS flags;
- [unique] IUnknown *pUnk;
-} ContextProperty;
-
-[
- local,
- object,
- uuid(000001c1-0000-0000-C000-000000000046)
-]
-interface IEnumContextProps : IUnknown
-{
- typedef [unique] IEnumContextProps *LPENUMCONTEXTPROPS;
-
- HRESULT Next(
- [in] ULONG celt,
- [out, size_is(celt), length_is(*pceltFetched)] ContextProperty *pContextProperties,
- [out] ULONG *pceltFetched);
-
- HRESULT Skip(
- [in] ULONG celt);
-
- HRESULT Reset();
-
- HRESULT Clone(
- [out] IEnumContextProps **ppEnumContextProps);
-
- HRESULT Count(
- [out] ULONG *pcelt);
-}
-
-[
- local,
- object,
- uuid(000001c0-0000-0000-C000-000000000046)
-]
-interface IContext : IUnknown
-{
- HRESULT SetProperty(
- [in] REFGUID policyId,
- [in] CPFLAGS flags,
- [in] IUnknown *pUnk);
-
- HRESULT RemoveProperty(
- [in] REFGUID policyId);
-
- HRESULT GetProperty(
- [in] REFGUID guid,
- [out] CPFLAGS *pFlags,
- [out] IUnknown **ppUnk);
-
- HRESULT EnumContextProps(
- [out] IEnumContextProps **ppEnumContextProps);
-}
-
-[
- local,
- object,
- uuid(000001c6-0000-0000-c000-000000000046),
- pointer_default(unique)
-]
-interface IObjContext : IContext
-{
- void Reserved1();
- void Reserved2();
- void Reserved3();
- void Reserved4();
- void Reserved5();
- void Reserved6();
- void Reserved7();
-}
-
-cpp_quote("#endif /* defined USE_COM_CONTEXT_DEF */")
diff --git a/include/objidlbase.idl b/include/objidlbase.idl
new file mode 100644
index 00000000000..47602b98d35
--- /dev/null
+++ b/include/objidlbase.idl
@@ -0,0 +1,1198 @@
+/*
+ * Copyright 2002 Ove Kaaven
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#ifndef DO_NO_IMPORTS
+import "unknwn.idl";
+#endif
+
+cpp_quote("#ifndef _OBJIDLBASE_")
+cpp_quote("#define _OBJIDLBASE_")
+
+interface IStream;
+interface IEnumString;
+
+interface IAsyncManager;
+interface ISynchronize;
+
+typedef struct _COSERVERINFO {
+ DWORD dwReserved1;
+ LPWSTR pwszName;
+ COAUTHINFO *pAuthInfo;
+ DWORD dwReserved2;
+} COSERVERINFO;
+
+/******************** Fundamentals ********************/
+
+[
+ local,
+ object,
+ uuid(00000003-0000-0000-C000-000000000046)
+]
+interface IMarshal : IUnknown
+{
+ typedef [unique] IMarshal *LPMARSHAL;
+
+ HRESULT GetUnmarshalClass(
+ [in] REFIID riid,
+ [in, unique] void *pv,
+ [in] DWORD dwDestContext,
+ [in, unique] void *pvDestContext,
+ [in] DWORD mshlflags,
+ [out] CLSID *pCid);
+
+ HRESULT GetMarshalSizeMax(
+ [in] REFIID riid,
+ [in, unique] void *pv,
+ [in] DWORD dwDestContext,
+ [in, unique] void *pvDestContext,
+ [in] DWORD mshlflags,
+ [out] DWORD *pSize);
+
+ HRESULT MarshalInterface(
+ [in, unique] IStream *pStm,
+ [in] REFIID riid,
+ [in, unique] void *pv,
+ [in] DWORD dwDestContext,
+ [in, unique] void *pvDestContext,
+ [in] DWORD mshlflags);
+
+ HRESULT UnmarshalInterface(
+ [in, unique] IStream *pStm,
+ [in] REFIID riid,
+ [out] void **ppv);
+
+ HRESULT ReleaseMarshalData(
+ [in, unique] IStream *pStm);
+
+ HRESULT DisconnectObject(
+ [in] DWORD dwReserved);
+}
+
+[
+ local,
+ object,
+ uuid(000001cf-0000-0000-C000-000000000046)
+]
+interface IMarshal2 : IMarshal
+{
+ typedef [unique] IMarshal2 *LPMARSHAL2;
+}
+
+[
+ local,
+ object,
+ uuid(00000018-0000-0000-C000-000000000046)
+]
+interface IStdMarshalInfo : IUnknown
+{
+ typedef [unique] IStdMarshalInfo *LPSTDMARSHALINFO;
+
+ HRESULT GetClassForHandler(
+ [in] DWORD dwDestContext,
+ [in, unique] void *pvDestContext,
+ [out] CLSID *pClsid);
+}
+
+[
+ local,
+ object,
+ uuid(00000019-0000-0000-C000-000000000046)
+]
+interface IExternalConnection : IUnknown
+{
+ typedef [unique] IExternalConnection *LPEXTERNALCONNECTION;
+
+ typedef enum tagEXTCONN {
+ EXTCONN_STRONG = 0x0001,
+ EXTCONN_WEAK = 0x0002,
+ EXTCONN_CALLABLE = 0x0004
+ } EXTCONN;
+
+ DWORD AddConnection(
+ [in] DWORD extconn,
+ [in] DWORD reserved);
+
+ DWORD ReleaseConnection(
+ [in] DWORD extconn,
+ [in] DWORD reserved,
+ [in] BOOL fLastReleaseCloses);
+}
+
+[
+ local,
+ object,
+ uuid(00000020-0000-0000-C000-000000000046)
+]
+interface IMultiQI : IUnknown
+{
+ typedef [unique] IMultiQI *LPMULTIQI;
+
+ typedef struct tagMULTI_QI {
+ const IID *pIID;
+ IUnknown *pItf;
+ HRESULT hr;
+ } MULTI_QI;
+
+ HRESULT QueryMultipleInterfaces(
+ [in] ULONG cMQIs,
+ [in, out] MULTI_QI *pMQIs);
+}
+
+[
+ local,
+ object,
+ uuid(00000002-0000-0000-C000-000000000046)
+]
+interface IMalloc : IUnknown
+{
+ typedef [unique] IMalloc *LPMALLOC;
+
+ LPVOID Alloc(
+ [in] SIZE_T cb);
+
+ LPVOID Realloc(
+ [in] LPVOID pv,
+ [in] SIZE_T cb);
+
+ void Free(
+ [in] LPVOID pv);
+
+ SIZE_T GetSize(
+ [in] LPVOID pv);
+
+ int DidAlloc(LPVOID pv);
+
+ void HeapMinimize();
+}
+
+[
+ local,
+ object,
+ uuid(00000021-0000-0000-C000-000000000046)
+]
+interface IInternalUnknown : IUnknown
+{
+ HRESULT QueryInternalInterface(
+ [in] REFIID riid,
+ [out] void **ppv);
+}
+
+[
+ object,
+ uuid(00000100-0000-0000-C000-000000000046),
+ pointer_default(unique)
+]
+interface IEnumUnknown : IUnknown
+{
+ typedef [unique] IEnumUnknown *LPENUMUNKNOWN;
+
+ [local]
+ HRESULT Next(
+ [in] ULONG celt,
+ [out] IUnknown **rgelt,
+ [out] ULONG *pceltFetched);
+
+ [call_as(Next)]
+ HRESULT RemoteNext(
+ [in] ULONG celt,
+ [out, size_is(celt), length_is(*pceltFetched)]
+ IUnknown **rgelt,
+ [out] ULONG *pceltFetched);
+
+ HRESULT Skip(
+ [in] ULONG celt);
+
+ HRESULT Reset();
+
+ HRESULT Clone(
+ [out] IEnumUnknown **ppenum);
+}
+
+[
+ object,
+ uuid(00000022-0000-0000-C000-000000000046),
+ version(1.0),
+ pointer_default(unique)
+]
+interface ISurrogate : IUnknown
+{
+ typedef [unique] ISurrogate *LPSURROGATE;
+
+ HRESULT LoadDllServer(
+ [in] REFCLSID Clsid);
+ HRESULT FreeSurrogate();
+}
+
+[
+ local,
+ object,
+ uuid(00000146-0000-0000-C000-000000000046)
+]
+interface IGlobalInterfaceTable : IUnknown
+{
+ typedef [unique] IGlobalInterfaceTable *LPGLOBALINTERFACETABLE;
+
+ HRESULT RegisterInterfaceInGlobal(
+ [in] IUnknown *pUnk,
+ [in] REFIID riid,
+ [out] DWORD *pdwCookie);
+
+ HRESULT RevokeInterfaceFromGlobal(
+ [in] DWORD dwCookie);
+
+ HRESULT GetInterfaceFromGlobal(
+ [in] DWORD dwCookie,
+ [in] REFIID riid,
+ [out, iid_is(riid)] void **ppv);
+}
+
+[
+ object,
+ uuid(00000101-0000-0000-C000-000000000046),
+ pointer_default(unique)
+]
+interface IEnumString : IUnknown
+{
+ typedef [unique] IEnumString *LPENUMSTRING;
+
+ [local]
+ HRESULT Next(
+ [in] ULONG celt,
+ [out, size_is(celt), length_is(*pceltFetched)]
+ LPOLESTR *rgelt,
+ [out] ULONG *pceltFetched);
+
+ [call_as(Next)]
+ HRESULT RemoteNext(
+ [in] ULONG celt,
+ [out, size_is(celt), length_is(*pceltFetched)]
+ LPOLESTR *rgelt,
+ [out] ULONG *pceltFetched);
+
+ HRESULT Skip(
+ [in] ULONG celt);
+
+ HRESULT Reset();
+
+ HRESULT Clone(
+ [out] IEnumString **ppenum);
+}
+
+/******************** Storage ********************/
+
+[
+ object,
+ uuid(0c733a30-2a1c-11ce-ade5-00aa0044773d),
+ pointer_default(unique)
+]
+interface ISequentialStream : IUnknown
+{
+ [local]
+ HRESULT Read(
+ [out, size_is(cb), length_is(*pcbRead)]
+ void *pv,
+ [in] ULONG cb,
+ [out] ULONG *pcbRead);
+
+ [call_as(Read)]
+ HRESULT RemoteRead(
+ [out, size_is(cb), length_is(*pcbRead)]
+ byte *pv,
+ [in] ULONG cb,
+ [out] ULONG *pcbRead);
+
+ [local]
+ HRESULT Write(
+ [in, size_is(cb)] const void *pv,
+ [in] ULONG cb,
+ [out] ULONG *pcbWritten);
+
+ [call_as(Write)]
+ HRESULT RemoteWrite(
+ [in, size_is(cb)] const byte *pv,
+ [in] ULONG cb,
+ [out] ULONG *pcbWritten);
+}
+
+[
+ object,
+ uuid(0000000c-0000-0000-C000-000000000046),
+ pointer_default(unique)
+]
+interface IStream : ISequentialStream
+{
+ typedef [unique] IStream *LPSTREAM;
+
+ typedef struct tagSTATSTG {
+ LPOLESTR pwcsName;
+ DWORD type;
+ ULARGE_INTEGER cbSize;
+ FILETIME mtime;
+ FILETIME ctime;
+ FILETIME atime;
+ DWORD grfMode;
+ DWORD grfLocksSupported;
+ CLSID clsid;
+ DWORD grfStateBits;
+ DWORD reserved;
+ } STATSTG;
+
+ typedef enum tagSTGTY {
+ STGTY_STORAGE = 1,
+ STGTY_STREAM = 2,
+ STGTY_LOCKBYTES = 3,
+ STGTY_PROPERTY = 4
+ } STGTY;
+
+ typedef enum tagSTREAM_SEEK {
+ STREAM_SEEK_SET = 0,
+ STREAM_SEEK_CUR = 1,
+ STREAM_SEEK_END = 2
+ } STREAM_SEEK;
+
+ /* these are defined in Linux's fcntl.h,
+ * undefine them to avoid conflicts */
+ cpp_quote("#undef LOCK_MAND")
+ cpp_quote("#undef LOCK_READ")
+ cpp_quote("#undef LOCK_WRITE")
+ cpp_quote("#undef LOCK_RW")
+
+ typedef enum tagLOCKTYPE {
+ LOCK_WRITE = 1,
+ LOCK_EXCLUSIVE = 2,
+ LOCK_ONLYONCE = 4
+ } LOCKTYPE;
+
+ [local]
+ HRESULT Seek(
+ [in] LARGE_INTEGER dlibMove,
+ [in] DWORD dwOrigin,
+ [out] ULARGE_INTEGER *plibNewPosition);
+
+ [call_as(Seek)]
+ HRESULT RemoteSeek(
+ [in] LARGE_INTEGER dlibMove,
+ [in] DWORD dwOrigin,
+ [out] ULARGE_INTEGER *plibNewPosition);
+
+ HRESULT SetSize(
+ [in] ULARGE_INTEGER libNewSize);
+
+ [local]
+ HRESULT CopyTo(
+ [in, unique] IStream *pstm,
+ [in] ULARGE_INTEGER cb,
+ [out] ULARGE_INTEGER *pcbRead,
+ [out] ULARGE_INTEGER *pcbWritten);
+
+ [call_as(CopyTo)]
+ HRESULT RemoteCopyTo(
+ [in, unique] IStream *pstm,
+ [in] ULARGE_INTEGER cb,
+ [out] ULARGE_INTEGER *pcbRead,
+ [out] ULARGE_INTEGER *pcbWritten);
+
+ HRESULT Commit(
+ [in] DWORD grfCommitFlags);
+
+ HRESULT Revert();
+
+ HRESULT LockRegion(
+ [in] ULARGE_INTEGER libOffset,
+ [in] ULARGE_INTEGER cb,
+ [in] DWORD dwLockType);
+
+ HRESULT UnlockRegion(
+ [in] ULARGE_INTEGER libOffset,
+ [in] ULARGE_INTEGER cb,
+ [in] DWORD dwLockType);
+
+ HRESULT Stat(
+ [out] STATSTG *pstatstg,
+ [in] DWORD grfStatFlag);
+
+ HRESULT Clone(
+ [out] IStream **ppstm);
+}
+
+
+
+
+[
+ local,
+ object,
+ uuid(D5F56B60-593B-101A-B569-08002B2DBF7A)
+]
+interface IRpcChannelBuffer : IUnknown
+{
+ typedef [unique] IRpcChannelBuffer *LPRPCCHANNELBUFFER;
+
+ typedef unsigned long RPCOLEDATAREP;
+
+ typedef struct tagRPCOLEMESSAGE {
+ void *reserved1;
+ RPCOLEDATAREP dataRepresentation;
+ void *Buffer;
+ ULONG cbBuffer;
+ ULONG iMethod;
+ void *reserved2[5];
+ ULONG rpcFlags;
+ } RPCOLEMESSAGE;
+
+ typedef RPCOLEMESSAGE *PRPCOLEMESSAGE;
+
+ HRESULT GetBuffer(
+ [in] RPCOLEMESSAGE *pMessage,
+ [in] REFIID riid);
+
+ HRESULT SendReceive(
+ [in,out] RPCOLEMESSAGE *pMessage,
+ [out] ULONG *pStatus);
+
+ HRESULT FreeBuffer(
+ [in] RPCOLEMESSAGE *pMessage);
+
+ HRESULT GetDestCtx(
+ [out] DWORD *pdwDestContext,
+ [out] void **ppvDestContext);
+
+ HRESULT IsConnected();
+}
+
+[
+ local,
+ object,
+ uuid(594f31d0-7f19-11d0-b194-00a0c90dc8bf)
+]
+interface IRpcChannelBuffer2 : IRpcChannelBuffer
+{
+ typedef [unique] IRpcChannelBuffer2 *LPRPCCHANNELBUFFER2;
+
+ HRESULT GetProtocolVersion(
+ [in,out] DWORD *pdwVersion);
+}
+
+[
+ local,
+ object,
+ uuid(25B15600-0115-11d0-BF0D-00AA00B8DFD2)
+]
+interface IRpcChannelBuffer3 : IRpcChannelBuffer2
+{
+ typedef [unique] IRpcChannelBuffer3 *LPRPCCHANNELBUFFER3;
+
+ HRESULT Send(
+ [in,out] RPCOLEMESSAGE *pMsg,
+ [out] ULONG *pulStatus);
+
+ HRESULT Receive(
+ [in,out] RPCOLEMESSAGE *pMsg,
+ [in] ULONG ulSize,
+ [out] ULONG *pulStatus);
+
+ HRESULT Cancel(
+ [in] RPCOLEMESSAGE *pMsg);
+
+ HRESULT GetCallContext(
+ [in] RPCOLEMESSAGE *pMsg,
+ [in] REFIID riid,
+ [out] void **pInterface);
+
+ HRESULT GetDestCtxEx(
+ [in] RPCOLEMESSAGE *pMsg,
+ [out] DWORD *pdwDestContext,
+ [out] void **ppvDestContext);
+
+ HRESULT GetState(
+ [in] RPCOLEMESSAGE *pMsg,
+ [out] DWORD *pState);
+
+ HRESULT RegisterAsync(
+ [in] RPCOLEMESSAGE *pMsg,
+ [in] IAsyncManager *pAsyncMgr);
+}
+
+[
+ local,
+ object,
+ uuid(a5029fb6-3c34-11d1-9c99-00c04fb998aa),
+ pointer_default(unique)
+]
+interface IAsyncRpcChannelBuffer : IRpcChannelBuffer2
+{
+ HRESULT Send(
+ [in, out] RPCOLEMESSAGE *pMsg,
+ [in] ISynchronize *pSync,
+ [out] ULONG *pulStatus);
+
+ HRESULT Receive(
+ [in, out] RPCOLEMESSAGE *pMsg,
+ [out] ULONG *pulStatus);
+
+ HRESULT GetDestCtxEx(
+ [in] RPCOLEMESSAGE *pMsg,
+ [out] DWORD *pdwDestContext,
+ [out] void **ppvDestContext);
+}
+
+[
+ local,
+ object,
+ uuid(58a08519-24c8-4935-b482-3fd823333a4f)
+]
+interface IRpcSyntaxNegotiate : IUnknown
+{
+ HRESULT NegotiateSyntax(
+ [in, out] RPCOLEMESSAGE *pMsg);
+}
+
+[
+ local,
+ object,
+ uuid(D5F56A34-593B-101A-B569-08002B2DBF7A)
+]
+interface IRpcProxyBuffer : IUnknown
+{
+ typedef [unique] IRpcProxyBuffer *LPRPCPROXYBUFFER;
+
+ HRESULT Connect(
+ [in, unique] IRpcChannelBuffer *pRpcChannelBuffer);
+
+ void Disconnect();
+}
+
+[
+ local,
+ object,
+ uuid(D5F56AFC-593B-101A-B569-08002B2DBF7A)
+]
+interface IRpcStubBuffer : IUnknown
+{
+ typedef [unique] IRpcStubBuffer *LPRPCSTUBBUFFER;
+
+ HRESULT Connect(
+ [in] IUnknown *pUnkServer);
+
+ void Disconnect();
+
+ HRESULT Invoke(
+ [in] RPCOLEMESSAGE *_prpcmsg,
+ [in] IRpcChannelBuffer *_pRpcChannelBuffer);
+
+ IRpcStubBuffer *IsIIDSupported(
+ [in] REFIID riid);
+
+ ULONG CountRefs();
+
+ HRESULT DebugServerQueryInterface(
+ void **ppv);
+
+ void DebugServerRelease(
+ void *pv);
+}
+
+[
+ local,
+ object,
+ uuid(D5F569D0-593B-101A-B569-08002B2DBF7A)
+]
+interface IPSFactoryBuffer : IUnknown
+{
+ typedef [unique] IPSFactoryBuffer *LPPSFACTORYBUFFER;
+
+ HRESULT CreateProxy(
+ [in] IUnknown *pUnkOuter,
+ [in] REFIID riid,
+ [out] IRpcProxyBuffer **ppProxy,
+ [out] void **ppv);
+
+ HRESULT CreateStub(
+ [in] REFIID riid,
+ [in, unique] IUnknown *pUnkServer,
+ [out] IRpcStubBuffer **ppStub);
+}
+
+[
+ local,
+ object,
+ uuid(1008c4a0-7613-11cf-9af1-0020af6e72f4)
+]
+interface IChannelHook : IUnknown
+{
+ typedef [unique] IChannelHook *LPCHANNELHOOK;
+
+ typedef struct SChannelHookCallInfo {
+ IID iid;
+ DWORD cbSize;
+ GUID uCausality;
+ DWORD dwServerPid;
+ DWORD iMethod;
+ void *pObject;
+ } SChannelHookCallInfo;
+
+ void ClientGetSize(
+ [in] REFGUID uExtent,
+ [in] REFIID riid,
+ [out] ULONG *pDataSize);
+
+ void ClientFillBuffer(
+ [in] REFGUID uExtent,
+ [in] REFIID riid,
+ [in, out] ULONG *pDataSize,
+ [in] void *pDataBuffer);
+
+ void ClientNotify(
+ [in] REFGUID uExtent,
+ [in] REFIID riid,
+ [in] ULONG cbDataSize,
+ [in] void *pDataBuffer,
+ [in] DWORD lDataRep,
+ [in] HRESULT hrFault);
+
+ void ServerNotify(
+ [in] REFGUID uExtent,
+ [in] REFIID riid,
+ [in] ULONG cbDataSize,
+ [in] void *pDataBuffer,
+ [in] DWORD lDataRep);
+
+ void ServerGetSize(
+ [in] REFGUID uExtent,
+ [in] REFIID riid,
+ [in] HRESULT hrFault,
+ [out] ULONG *pDataSize);
+
+ void ServerFillBuffer(
+ [in] REFGUID uExtent,
+ [in] REFIID riid,
+ [in, out] ULONG *pDataSize,
+ [in] void *pDataBuffer,
+ [in] HRESULT hrFault );
+}
+
+extern const FMTID FMTID_SummaryInformation;
+extern const FMTID FMTID_DocSummaryInformation;
+extern const FMTID FMTID_UserDefinedProperties;
+
+
+/******************** Connection Points ********************/
+/* FIXME */
+
+/******************** DCOM ********************/
+
+[
+ local,
+ object,
+ uuid(0000013D-0000-0000-C000-000000000046)
+]
+interface IClientSecurity : IUnknown
+{
+ typedef struct tagSOLE_AUTHENTICATION_SERVICE {
+ DWORD dwAuthnSvc;
+ DWORD dwAuthzSvc;
+ OLECHAR *pPrincipalName;
+ HRESULT hr;
+ } SOLE_AUTHENTICATION_SERVICE;
+
+ typedef SOLE_AUTHENTICATION_SERVICE *PSOLE_AUTHENTICATION_SERVICE;
+
+ typedef struct tagSOLE_AUTHENTICATION_INFO {
+ DWORD dwAuthnSvc;
+ DWORD dwAuthzSvc;
+ void *pAuthInfo;
+ } SOLE_AUTHENTICATION_INFO;
+
+ const OLECHAR *COLE_DEFAULT_PRINCIPAL = (OLECHAR*) -1;
+ const void *COLE_DEFAULT_AUTHINFO = (void*) -1;
+
+ typedef struct tagSOLE_AUTHENTICATION_LIST {
+ DWORD cAuthInfo;
+ SOLE_AUTHENTICATION_INFO *aAuthInfo;
+ } SOLE_AUTHENTICATION_LIST;
+
+ typedef enum tagEOLE_AUTHENTICATION_CAPABILITIES {
+ EOAC_NONE = 0x0,
+ EOAC_MUTUAL_AUTH = 0x1,
+ EOAC_SECURE_REFS = 0x2, /* CoInitializeSecurity only */
+ EOAC_ACCESS_CONTROL = 0x4, /* CoInitializeSecurity only */
+ EOAC_APPID = 0x8, /* CoInitializeSecurity only */
+ EOAC_DYNAMIC = 0x10, /* CoInitializeSecurity only */
+ EOAC_STATIC_CLOAKING = 0x20,
+ EOAC_DYNAMIC_CLOAKING = 0x40,
+ EOAC_ANY_AUTHORITY = 0x80,
+ EOAC_MAKE_FULLSIC = 0x100,
+ EOAC_REQUIRE_FULLSIC = 0x200, /* CoInitializeSecurity only */
+ EOAC_AUTO_IMPERSONATE = 0x400, /* CoInitializeSecurity only */
+ EOAC_DEFAULT = 0x800,
+ EOAC_DISABLE_AAA = 0x1000, /* CoInitializeSecurity only */
+ EOAC_NO_CUSTOM_MARSHAL = 0x2000, /* CoInitializeSecurity only */
+ } EOLE_AUTHENTICATION_CAPABILITIES;
+
+ HRESULT QueryBlanket(
+ [in] IUnknown *pProxy,
+ [out] DWORD *pAuthnSvc,
+ [out] DWORD *pAuthzSvc,
+ [out] OLECHAR **pServerPrincName,
+ [out] DWORD *pAuthnLevel,
+ [out] DWORD *pImpLevel,
+ [out] void **pAuthInfo,
+ [out] DWORD *pCapabilities);
+
+ HRESULT SetBlanket(
+ [in] IUnknown *pProxy,
+ [in] DWORD AuthnSvc,
+ [in] DWORD AuthzSvc,
+ [in] OLECHAR *pServerPrincName,
+ [in] DWORD AuthnLevel,
+ [in] DWORD ImpLevel,
+ [in] void *pAuthInfo,
+ [in] DWORD Capabilities);
+
+ HRESULT CopyProxy(
+ [in] IUnknown *pProxy,
+ [out] IUnknown **ppCopy);
+}
+
+[
+ local,
+ object,
+ uuid(0000013E-0000-0000-C000-000000000046)
+]
+interface IServerSecurity : IUnknown
+{
+ HRESULT QueryBlanket(
+ [out] DWORD *pAuthnSvc,
+ [out] DWORD *pAuthzSvc,
+ [out] OLECHAR **pServerPrincName,
+ [out] DWORD *pAuthnLevel,
+ [out] DWORD *pImpLevel,
+ [out] void **pPrivs,
+ [out] DWORD *pCapabilities);
+
+ HRESULT ImpersonateClient();
+
+ HRESULT RevertToSelf();
+
+ BOOL IsImpersonating();
+}
+
+[
+ local,
+ object,
+ uuid(00000024-0000-0000-C000-000000000046)
+]
+interface IAsyncSetup : IUnknown
+{
+ HRESULT GetAsyncManager(
+ [in] REFIID riid,
+ [in] IUnknown *pOuter,
+ [in] DWORD dwFlags,
+ [out] IUnknown **ppInner,
+ [out] IAsyncManager **ppAsyncMgr);
+}
+
+[
+ object,
+ uuid(00000030-0000-0000-C000-000000000046)
+]
+
+interface ISynchronize : IUnknown
+{
+ HRESULT Wait(
+ [in] DWORD dwFlags,
+ [in] DWORD dwMilliseconds);
+
+ HRESULT Signal();
+
+ HRESULT Reset();
+}
+
+
+[
+ local,
+ object,
+ uuid(00000031-0000-0000-C000-000000000046)
+]
+interface ISynchronizeHandle : IUnknown
+{
+ HRESULT GetHandle(
+ [out] HANDLE *ph);
+}
+
+
+[
+ local,
+ object,
+ uuid(00000032-0000-0000-C000-000000000046)
+]
+interface ISynchronizeEvent : ISynchronizeHandle
+{
+ HRESULT SetEventHandle(
+ [in] HANDLE *ph);
+}
+
+
+[
+ local,
+ object,
+ uuid(00000033-0000-0000-C000-000000000046)
+]
+interface ISynchronizeContainer : IUnknown
+{
+ HRESULT AddSynchronize(
+ [in] ISynchronize *pSync);
+
+ HRESULT WaitMultiple(
+ [in] DWORD dwFlags,
+ [in] DWORD dwTimeOut,
+ [out] ISynchronize **ppSync);
+}
+
+[
+ local,
+ object,
+ uuid(00000025-0000-0000-C000-000000000046)
+]
+interface ISynchronizeMutex : ISynchronize
+{
+ HRESULT ReleaseMutex();
+}
+
+[
+ local,
+ object,
+ uuid(00000029-0000-0000-C000-000000000046)
+]
+
+interface ICancelMethodCalls : IUnknown
+{
+ typedef [unique] ICancelMethodCalls *LPCANCELMETHODCALLS;
+
+ HRESULT Cancel(
+ [in] ULONG ulSeconds);
+
+ HRESULT TestCancel();
+}
+
+[
+ local,
+ object,
+ uuid(0000002A-0000-0000-C000-000000000046)
+]
+interface IAsyncManager : IUnknown
+{
+ typedef enum tagDCOM_CALL_STATE {
+ DCOM_NONE = 0,
+ DCOM_CALL_COMPLETE = 1,
+ DCOM_CALL_CANCELED = 2
+ } DCOM_CALL_STATE;
+
+ HRESULT CompleteCall(
+ [in] HRESULT Result);
+
+ HRESULT GetCallContext(
+ [in] REFIID riid,
+ [out] void **pInterface);
+
+ HRESULT GetState(
+ [out] ULONG *pulStateFlags);
+}
+
+[
+ local,
+ object,
+ uuid(1c733a30-2a1c-11ce-ade5-00aa0044773d),
+ pointer_default(unique)
+]
+interface ICallFactory : IUnknown
+{
+ HRESULT CreateCall(
+ [in] REFIID riid,
+ [in] IUnknown *pCtrlUnk,
+ [in] REFIID riid2,
+ [out, iid_is(riid2)] IUnknown **ppv);
+}
+
+[
+ local,
+ object,
+ uuid(00000144-0000-0000-C000-000000000046)
+]
+interface IRpcOptions : IUnknown
+{
+ HRESULT Set(
+ [in] IUnknown *pPrx,
+ [in] DWORD dwProperty,
+ [in] ULONG_PTR dwValue);
+
+ HRESULT Query(
+ [in] IUnknown *pPrx,
+ [in] DWORD dwProperty,
+ [out] ULONG_PTR *pdwValue);
+}
+
+enum {
+ COMBND_RPCTIMEOUT = 1,
+ COMBND_SERVER_LOCALITY = 2
+};
+
+enum {
+ SERVER_LOCALITY_PROCESS_LOCAL = 0,
+ SERVER_LOCALITY_MACHINE_LOCAL = 1,
+ SERVER_LOCALITY_REMOTE = 2
+};
+
+[
+ local,
+ object,
+ uuid(00000149-0000-0000-C000-000000000046),
+ pointer_default(unique)
+]
+interface IRpcHelper : IUnknown
+{
+ HRESULT GetDCOMProtocolVersion(
+ [out] DWORD *pComVersion);
+
+ HRESULT GetIIDFromOBJREF(
+ [in] void *pObjRef,
+ [out] IID **piid);
+}
+
+[
+ local,
+ object,
+ uuid(eb0cb9e8-7996-11d2-872e-0000f8080859)
+]
+interface IReleaseMarshalBuffers : IUnknown
+{
+ HRESULT ReleaseMarshalBuffer(
+ [in] RPCOLEMESSAGE *pMsg,
+ [in] DWORD dwFlags,
+ [in, unique] IUnknown *pChnl);
+}
+
+[
+ local,
+ object,
+ uuid(0000002B-0000-0000-C000-000000000046)
+]
+interface IWaitMultiple : IUnknown
+{
+ HRESULT WaitMultiple(
+ [in] DWORD timeout,
+ [out] ISynchronize **pSync);
+ HRESULT AddSynchronize(
+ [in] ISynchronize *pSync);
+}
+
+
+[
+ local,
+ object,
+ uuid(00000147-0000-0000-C000-000000000046)
+]
+interface IAddrTrackingControl : IUnknown
+{
+ typedef [unique] IAddrTrackingControl *LPADDRTRACKINGCONTROL;
+
+ HRESULT EnableCOMDynamicAddrTracking();
+ HRESULT DisableCOMDynamicAddrTracking();
+}
+
+[
+ local,
+ object,
+ uuid(00000148-0000-0000-C000-000000000046)
+]
+interface IAddrExclusionControl : IUnknown
+{
+ typedef [unique] IAddrExclusionControl *LPADDREXCLUSIONCONTROL;
+
+ HRESULT GetCurrentAddrExclusionList(
+ [in] REFIID riid,
+ [out, iid_is(riid)] void **ppEnumerator);
+ HRESULT UpdateAddrExclusionList(
+ [in] IUnknown *pEnumerator);
+}
+
+typedef enum _APTTYPE {
+ APTTYPE_CURRENT = -1,
+ APTTYPE_STA = 0,
+ APTTYPE_MTA = 1,
+ APTTYPE_NA = 2,
+ APTTYPE_MAINSTA = 3
+} APTTYPE;
+
+typedef enum _APTTYPEQUALIFIER {
+ APTTYPEQUALIFIER_NONE,
+ APTTYPEQUALIFIER_IMPLICIT_MTA,
+ APTTYPEQUALIFIER_NA_ON_MTA,
+ APTTYPEQUALIFIER_NA_ON_STA,
+ APTTYPEQUALIFIER_NA_ON_IMPLICIT_MTA,
+ APTTYPEQUALIFIER_NA_ON_MAINSTA
+} APTTYPEQUALIFIER;
+
+typedef enum _THDTYPE {
+ THDTYPE_BLOCKMESSAGES = 0,
+ THDTYPE_PROCESSMESSAGES = 1
+} THDTYPE;
+
+[
+ local,
+ object,
+ uuid(000001ce-0000-0000-C000-000000000046),
+ pointer_default(unique)
+]
+interface IComThreadingInfo : IUnknown
+{
+ HRESULT GetCurrentApartmentType(
+ [out] APTTYPE *pAptType);
+ HRESULT GetCurrentThreadType(
+ [out] THDTYPE *pThreadType);
+ HRESULT GetCurrentLogicalThreadId(
+ [out] GUID *pguidLogicalThreadId);
+ HRESULT SetCurrentLogicalThreadId(
+ [in] REFGUID rguid);
+}
+
+
+[
+ object,
+ pointer_default(unique),
+ uuid(72380d55-8d2b-43a3-8513-2b6ef31434e9)
+]
+interface IProcessInitControl : IUnknown
+{
+ HRESULT ResetInitializerTimeout(
+ [in] DWORD dwSecondsRemaining);
+}
+
+typedef enum tagGLOBALOPT_PROPERTIES
+{
+ COMGLB_EXCEPTION_HANDLING = 1,
+ COMGLB_APPID = 2,
+ COMGLB_RPC_THREADPOOL_SETTING = 3
+} GLOBALOPT_PROPERTIES;
+
+typedef enum tagGLOBALOPT_EH_VALUES
+{
+ COMGLB_EXCEPTION_HANDLE = 0,
+ COMGLB_EXCEPTION_DONOT_HANDLE_FATAL = 1,
+ COMGLB_EXCEPTION_DONOT_HANDLE = COMGLB_EXCEPTION_DONOT_HANDLE_FATAL,
+ COMGLB_EXCEPTION_DONOT_HANDLE_ANY = 2
+} GLOBALOPT_EH_VALUES;
+
+typedef enum tagGLOBALOPT_RPCTP_VALUES
+{
+ COMGLB_RPC_THREADPOOL_SETTING_DEFAULT_POOL = 0,
+ COMGLB_RPC_THREADPOOL_SETTING_PRIVATE_POOL = 1
+} GLOBALOPT_RPCTP_VALUES;
+
+
+[
+ object,
+ local,
+ pointer_default(unique),
+ uuid(0000015B-0000-0000-C000-000000000046)
+]
+interface IGlobalOptions : IUnknown
+{
+ HRESULT Set([in] GLOBALOPT_PROPERTIES property, [in] ULONG_PTR value);
+ HRESULT Query([in] GLOBALOPT_PROPERTIES property, [out ] ULONG_PTR *value);
+}
+
+cpp_quote("#ifdef USE_COM_CONTEXT_DEF")
+
+typedef DWORD CPFLAGS;
+
+typedef struct tagContextProperty
+{
+ GUID policyId;
+ CPFLAGS flags;
+ [unique] IUnknown *pUnk;
+} ContextProperty;
+
+[
+ local,
+ object,
+ uuid(000001c1-0000-0000-C000-000000000046)
+]
+interface IEnumContextProps : IUnknown
+{
+ typedef [unique] IEnumContextProps *LPENUMCONTEXTPROPS;
+
+ HRESULT Next(
+ [in] ULONG celt,
+ [out, size_is(celt), length_is(*pceltFetched)] ContextProperty *pContextProperties,
+ [out] ULONG *pceltFetched);
+
+ HRESULT Skip(
+ [in] ULONG celt);
+
+ HRESULT Reset();
+
+ HRESULT Clone(
+ [out] IEnumContextProps **ppEnumContextProps);
+
+ HRESULT Count(
+ [out] ULONG *pcelt);
+}
+
+[
+ local,
+ object,
+ uuid(000001c0-0000-0000-C000-000000000046)
+]
+interface IContext : IUnknown
+{
+ HRESULT SetProperty(
+ [in] REFGUID policyId,
+ [in] CPFLAGS flags,
+ [in] IUnknown *pUnk);
+
+ HRESULT RemoveProperty(
+ [in] REFGUID policyId);
+
+ HRESULT GetProperty(
+ [in] REFGUID guid,
+ [out] CPFLAGS *pFlags,
+ [out] IUnknown **ppUnk);
+
+ HRESULT EnumContextProps(
+ [out] IEnumContextProps **ppEnumContextProps);
+}
+
+[
+ local,
+ object,
+ uuid(000001c6-0000-0000-c000-000000000046),
+ pointer_default(unique)
+]
+interface IObjContext : IContext
+{
+ void Reserved1();
+ void Reserved2();
+ void Reserved3();
+ void Reserved4();
+ void Reserved5();
+ void Reserved6();
+ void Reserved7();
+}
+
+cpp_quote("#endif /* defined USE_COM_CONTEXT_DEF */")
+cpp_quote("#endif /* defined _OBJIDLBASE_ */")
--
2.28.0
1
1
[PATCH v2] xactengine3_7: Explicity copy the XACT_RUNTIME_PARAMETERS members
by Alistair Leslie-Hughes Oct. 2, 2020
by Alistair Leslie-Hughes Oct. 2, 2020
Oct. 2, 2020
Wine-bug: https://bugs.winehq.org/show_bug.cgi?id=49911
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com>
---
dlls/xactengine3_7/xact_dll.c | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/dlls/xactengine3_7/xact_dll.c b/dlls/xactengine3_7/xact_dll.c
index e6e4dbb7b35..667ac58128b 100644
--- a/dlls/xactengine3_7/xact_dll.c
+++ b/dlls/xactengine3_7/xact_dll.c
@@ -780,7 +780,16 @@ static HRESULT WINAPI IXACT3EngineImpl_Initialize(IXACT3Engine *iface,
TRACE("(%p)->(%p)\n", This, pParams);
- memcpy(¶ms, pParams, sizeof(FACTRuntimeParameters));
+ memset(¶ms, 0, sizeof(FACTRuntimeParameters));
+ /* Explicitly copy to the FAudio structure as the packing is wrong under 64 bits */
+ params.lookAheadTime = pParams->lookAheadTime;
+ params.pGlobalSettingsBuffer = pParams->pGlobalSettingsBuffer;
+ params.globalSettingsBufferSize = pParams->globalSettingsBufferSize;
+ params.globalSettingsFlags = pParams->globalSettingsFlags;
+ params.globalSettingsAllocAttributes = pParams->globalSettingsAllocAttributes;
+ params.pRendererID = (int16_t*)pParams->pRendererID;
+ params.pXAudio2 = NULL;
+ params.pMasteringVoice = NULL;
/* FIXME: pXAudio2 and pMasteringVoice are pointers to
* IXAudio2/IXAudio2MasteringVoice objects. FACT wants pointers to
@@ -793,12 +802,10 @@ static HRESULT WINAPI IXACT3EngineImpl_Initialize(IXACT3Engine *iface,
* -flibit
*/
if (pParams->pXAudio2 != NULL){
- FIXME("pXAudio2 parameter not supported! Falling back to NULL\n");
- params.pXAudio2 = NULL;
+ FIXME("pXAudio2 parameter not supported!\n");
if (pParams->pMasteringVoice != NULL){
- FIXME("pXAudio2 parameter not supported! Falling back to NULL\n");
- params.pMasteringVoice = NULL;
+ FIXME("pMasteringVoice parameter not supported!\n");
}
}
--
2.28.0
1
0
Oct. 2, 2020
IP Address controls (SysIPAddress32) should set focus to the edit box
upon WM_SETFOCUS.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49924
Signed-off-by: Hirofumi Katayama <katayama.hirofumi.mz(a)gmail.com>
---
I forgot attachment.
https://github.com/reactos/reactos/commit/0733d96d9d90337c9c0537c0406650c9a…
https://jira.reactos.org/browse/CORE-3479
2
1
[PATCH v2 1/4] amstream: Implement IDirectDrawStreamSample::CompletionStatus.
by Anton Baskanov Oct. 2, 2020
by Anton Baskanov Oct. 2, 2020
Oct. 2, 2020
Signed-off-by: Anton Baskanov <baskanov(a)gmail.com>
---
dlls/amstream/ddrawstream.c | 53 ++++--
dlls/amstream/tests/amstream.c | 292 +++++++++++++++++++++++++++++++++
2 files changed, 335 insertions(+), 10 deletions(-)
diff --git a/dlls/amstream/ddrawstream.c b/dlls/amstream/ddrawstream.c
index 972c2b9f4d0..2526410cbff 100644
--- a/dlls/amstream/ddrawstream.c
+++ b/dlls/amstream/ddrawstream.c
@@ -70,7 +70,7 @@ struct ddraw_sample
struct ddraw_stream *parent;
IDirectDrawSurface *surface;
RECT rect;
- HANDLE update_event;
+ CONDITION_VARIABLE update_cv;
struct list entry;
HRESULT update_hr;
@@ -82,7 +82,7 @@ static HRESULT ddrawstreamsample_create(struct ddraw_stream *parent, IDirectDraw
static void remove_queued_update(struct ddraw_sample *sample)
{
list_remove(&sample->entry);
- SetEvent(sample->update_event);
+ WakeConditionVariable(&sample->update_cv);
}
static void flush_update_queue(struct ddraw_stream *stream, HRESULT update_hr)
@@ -1414,7 +1414,6 @@ static ULONG WINAPI ddraw_sample_Release(IDirectDrawStreamSample *iface)
if (sample->surface)
IDirectDrawSurface_Release(sample->surface);
- CloseHandle(sample->update_event);
HeapFree(GetProcessHeap(), 0, sample);
}
@@ -1491,6 +1490,7 @@ static HRESULT WINAPI ddraw_sample_Update(IDirectDrawStreamSample *iface,
}
if (!sample->parent->peer || sample->parent->eos)
{
+ sample->update_hr = MS_S_ENDOFSTREAM;
LeaveCriticalSection(&sample->parent->cs);
return MS_S_ENDOFSTREAM;
}
@@ -1501,25 +1501,58 @@ static HRESULT WINAPI ddraw_sample_Update(IDirectDrawStreamSample *iface,
}
sample->update_hr = MS_S_PENDING;
- ResetEvent(sample->update_event);
list_add_tail(&sample->parent->update_queue, &sample->entry);
WakeConditionVariable(&sample->parent->update_queued_cv);
- LeaveCriticalSection(&sample->parent->cs);
-
if (flags & SSUPDATE_ASYNC)
+ {
+ LeaveCriticalSection(&sample->parent->cs);
return MS_S_PENDING;
+ }
+
+ while (sample->update_hr == MS_S_PENDING)
+ SleepConditionVariableCS(&sample->update_cv, &sample->parent->cs, INFINITE);
- WaitForSingleObject(sample->update_event, INFINITE);
+ LeaveCriticalSection(&sample->parent->cs);
return sample->update_hr;
}
static HRESULT WINAPI ddraw_sample_CompletionStatus(IDirectDrawStreamSample *iface, DWORD flags, DWORD milliseconds)
{
- FIXME("(%p)->(%x,%u): stub\n", iface, flags, milliseconds);
+ struct ddraw_sample *sample = impl_from_IDirectDrawStreamSample(iface);
+ HRESULT hr;
- return E_NOTIMPL;
+ TRACE("sample %p, flags %#x, milliseconds %u.\n", sample, flags, milliseconds);
+
+ EnterCriticalSection(&sample->parent->cs);
+
+ if (sample->update_hr == MS_S_PENDING)
+ {
+ if (flags & (COMPSTAT_NOUPDATEOK | COMPSTAT_ABORT))
+ {
+ sample->update_hr = MS_S_NOUPDATE;
+ remove_queued_update(sample);
+ }
+ else if (flags & COMPSTAT_WAIT)
+ {
+ DWORD start_time = GetTickCount();
+ DWORD elapsed = 0;
+ while (sample->update_hr == MS_S_PENDING && elapsed < milliseconds)
+ {
+ DWORD sleep_time = milliseconds - elapsed;
+ if (!SleepConditionVariableCS(&sample->update_cv, &sample->parent->cs, sleep_time))
+ break;
+ elapsed = GetTickCount() - start_time;
+ }
+ }
+ }
+
+ hr = sample->update_hr;
+
+ LeaveCriticalSection(&sample->parent->cs);
+
+ return hr;
}
/*** IDirectDrawStreamSample methods ***/
@@ -1583,7 +1616,7 @@ static HRESULT ddrawstreamsample_create(struct ddraw_stream *parent, IDirectDraw
object->IDirectDrawStreamSample_iface.lpVtbl = &DirectDrawStreamSample_Vtbl;
object->ref = 1;
object->parent = parent;
- object->update_event = CreateEventW(NULL, FALSE, FALSE, NULL);
+ InitializeConditionVariable(&object->update_cv);
IAMMediaStream_AddRef(&parent->IAMMediaStream_iface);
++parent->sample_refs;
diff --git a/dlls/amstream/tests/amstream.c b/dlls/amstream/tests/amstream.c
index e5d1dd621f3..5467b519189 100644
--- a/dlls/amstream/tests/amstream.c
+++ b/dlls/amstream/tests/amstream.c
@@ -4028,6 +4028,21 @@ static DWORD CALLBACK ammediastream_receive(void *param)
return 0;
}
+static IStreamSample *streamsample_sample;
+static DWORD streamsample_flags;
+static DWORD streamsample_timeout;
+static HRESULT streamsample_expected_hr;
+
+static DWORD CALLBACK streamsample_completion_status(void *param)
+{
+ HRESULT hr;
+
+ hr = IStreamSample_CompletionStatus(streamsample_sample, streamsample_flags, streamsample_timeout);
+ ok(hr == streamsample_expected_hr, "Got hr %#x.\n", hr);
+
+ return 0;
+}
+
static void test_audiostreamsample_update(void)
{
static const BYTE test_data[] = { 0, 1, 2, 3, 4, 5, 6, 7 };
@@ -7221,6 +7236,282 @@ static void test_ddrawstreamsample_update(void)
ok(!ref, "Got outstanding refcount %d.\n", ref);
}
+static void test_ddrawstreamsample_completion_status(void)
+{
+ static const BYTE test_data[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 };
+ IAMMultiMediaStream *mmstream = create_ammultimediastream();
+ IDirectDrawStreamSample *stream_sample1;
+ IDirectDrawStreamSample *stream_sample2;
+ IDirectDrawMediaStream *ddraw_stream;
+ IMediaSample *media_sample;
+ IMediaFilter *media_filter;
+ struct testfilter source;
+ VIDEOINFO video_info;
+ IGraphBuilder *graph;
+ IMediaStream *stream;
+ AM_MEDIA_TYPE mt;
+ HANDLE thread;
+ HRESULT hr;
+ ULONG ref;
+ IPin *pin;
+
+ hr = IAMMultiMediaStream_Initialize(mmstream, STREAMTYPE_READ, 0, NULL);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+ hr = IAMMultiMediaStream_AddMediaStream(mmstream, NULL, &MSPID_PrimaryVideo, 0, &stream);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+ hr = IMediaStream_QueryInterface(stream, &IID_IDirectDrawMediaStream, (void **)&ddraw_stream);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+ hr = IMediaStream_QueryInterface(stream, &IID_IPin, (void **)&pin);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+ hr = IAMMultiMediaStream_GetFilterGraph(mmstream, &graph);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ok(graph != NULL, "Expected non-NULL graph.\n");
+ hr = IGraphBuilder_QueryInterface(graph, &IID_IMediaFilter, (void **)&media_filter);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+ testfilter_init(&source);
+ hr = IGraphBuilder_AddFilter(graph, &source.filter.IBaseFilter_iface, NULL);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+
+ hr = IMediaFilter_SetSyncSource(media_filter, NULL);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+
+ video_info = rgb32_video_info;
+ video_info.bmiHeader.biWidth = 3;
+ video_info.bmiHeader.biHeight = 1;
+ mt = rgb32_mt;
+ mt.pbFormat = (BYTE *)&video_info;
+ hr = IGraphBuilder_ConnectDirect(graph, &source.source.pin.IPin_iface, pin, &mt);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+ hr = IAMMultiMediaStream_SetState(mmstream, STREAMSTATE_RUN);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+
+ hr = IDirectDrawMediaStream_CreateSample(ddraw_stream, NULL, NULL, 0, &stream_sample1);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+ hr = IDirectDrawMediaStream_CreateSample(ddraw_stream, NULL, NULL, 0, &stream_sample2);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+
+ hr = IDirectDrawStreamSample_CompletionStatus(stream_sample1, 0, 0);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+
+ hr = IDirectDrawStreamSample_CompletionStatus(stream_sample1, COMPSTAT_WAIT, INFINITE);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+
+ hr = IDirectDrawStreamSample_Update(stream_sample1, SSUPDATE_ASYNC, NULL, NULL, 0);
+ ok(hr == MS_S_PENDING, "Got hr %#x.\n", hr);
+
+ hr = IDirectDrawStreamSample_CompletionStatus(stream_sample1, 0, 0);
+ ok(hr == MS_S_PENDING, "Got hr %#x.\n", hr);
+
+ hr = IDirectDrawStreamSample_CompletionStatus(stream_sample1, COMPSTAT_WAIT, 100);
+ ok(hr == MS_S_PENDING, "Got hr %#x.\n", hr);
+
+ hr = IDirectDrawStreamSample_Update(stream_sample2, SSUPDATE_ASYNC, NULL, NULL, 0);
+ ok(hr == MS_S_PENDING, "Got hr %#x.\n", hr);
+
+ hr = IDirectDrawStreamSample_CompletionStatus(stream_sample2, 0, 0);
+ ok(hr == MS_S_PENDING, "Got hr %#x.\n", hr);
+
+ media_sample = ammediastream_allocate_sample(&source, test_data, sizeof(test_data));
+ hr = IMemInputPin_Receive(source.source.pMemInputPin, media_sample);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ref = IMediaSample_Release(media_sample);
+ ok(!ref, "Got outstanding refcount %d.\n", ref);
+
+ hr = IDirectDrawStreamSample_CompletionStatus(stream_sample1, 0, 0);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+
+ hr = IDirectDrawStreamSample_CompletionStatus(stream_sample1, COMPSTAT_WAIT, INFINITE);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+
+ hr = IDirectDrawStreamSample_CompletionStatus(stream_sample2, 0, 0);
+ ok(hr == MS_S_PENDING, "Got hr %#x.\n", hr);
+
+ media_sample = ammediastream_allocate_sample(&source, test_data, sizeof(test_data));
+ hr = IMemInputPin_Receive(source.source.pMemInputPin, media_sample);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ref = IMediaSample_Release(media_sample);
+ ok(!ref, "Got outstanding refcount %d.\n", ref);
+
+ hr = IDirectDrawStreamSample_CompletionStatus(stream_sample2, 0, 0);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+
+ hr = IDirectDrawStreamSample_Update(stream_sample1, SSUPDATE_ASYNC, NULL, NULL, 0);
+ ok(hr == MS_S_PENDING, "Got hr %#x.\n", hr);
+
+ hr = IDirectDrawStreamSample_Update(stream_sample2, SSUPDATE_ASYNC, NULL, NULL, 0);
+ ok(hr == MS_S_PENDING, "Got hr %#x.\n", hr);
+
+ hr = IDirectDrawStreamSample_CompletionStatus(stream_sample1, COMPSTAT_NOUPDATEOK, 0);
+ ok(hr == MS_S_NOUPDATE, "Got hr %#x.\n", hr);
+
+ hr = IDirectDrawStreamSample_CompletionStatus(stream_sample1, COMPSTAT_WAIT, INFINITE);
+ ok(hr == MS_S_NOUPDATE, "Got hr %#x.\n", hr);
+
+ media_sample = ammediastream_allocate_sample(&source, test_data, sizeof(test_data));
+ hr = IMemInputPin_Receive(source.source.pMemInputPin, media_sample);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ref = IMediaSample_Release(media_sample);
+ ok(!ref, "Got outstanding refcount %d.\n", ref);
+
+ hr = IDirectDrawStreamSample_CompletionStatus(stream_sample1, 0, 0);
+ ok(hr == MS_S_NOUPDATE, "Got hr %#x.\n", hr);
+
+ hr = IDirectDrawStreamSample_CompletionStatus(stream_sample2, 0, 0);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+
+ hr = IDirectDrawStreamSample_Update(stream_sample1, SSUPDATE_ASYNC, NULL, NULL, 0);
+ ok(hr == MS_S_PENDING, "Got hr %#x.\n", hr);
+
+ hr = IDirectDrawStreamSample_Update(stream_sample2, SSUPDATE_ASYNC, NULL, NULL, 0);
+ ok(hr == MS_S_PENDING, "Got hr %#x.\n", hr);
+
+ hr = IDirectDrawStreamSample_CompletionStatus(stream_sample1, COMPSTAT_ABORT, 0);
+ ok(hr == MS_S_NOUPDATE, "Got hr %#x.\n", hr);
+
+ hr = IDirectDrawStreamSample_CompletionStatus(stream_sample1, COMPSTAT_WAIT, INFINITE);
+ ok(hr == MS_S_NOUPDATE, "Got hr %#x.\n", hr);
+
+ media_sample = ammediastream_allocate_sample(&source, test_data, sizeof(test_data));
+ hr = IMemInputPin_Receive(source.source.pMemInputPin, media_sample);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ref = IMediaSample_Release(media_sample);
+ ok(!ref, "Got outstanding refcount %d.\n", ref);
+
+ hr = IDirectDrawStreamSample_CompletionStatus(stream_sample1, 0, 0);
+ ok(hr == MS_S_NOUPDATE, "Got hr %#x.\n", hr);
+
+ hr = IDirectDrawStreamSample_CompletionStatus(stream_sample2, 0, 0);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+
+ hr = IDirectDrawStreamSample_Update(stream_sample1, SSUPDATE_ASYNC, NULL, NULL, 0);
+ ok(hr == MS_S_PENDING, "Got hr %#x.\n", hr);
+
+ hr = IDirectDrawStreamSample_CompletionStatus(stream_sample1, COMPSTAT_NOUPDATEOK | COMPSTAT_WAIT, INFINITE);
+ ok(hr == MS_S_NOUPDATE, "Got hr %#x.\n", hr);
+
+ hr = IDirectDrawStreamSample_Update(stream_sample1, SSUPDATE_ASYNC, NULL, NULL, 0);
+ ok(hr == MS_S_PENDING, "Got hr %#x.\n", hr);
+
+ hr = IDirectDrawStreamSample_CompletionStatus(stream_sample1, COMPSTAT_ABORT | COMPSTAT_WAIT, INFINITE);
+ ok(hr == MS_S_NOUPDATE, "Got hr %#x.\n", hr);
+
+ hr = IDirectDrawStreamSample_Update(stream_sample1, SSUPDATE_ASYNC, NULL, NULL, 0);
+ ok(hr == MS_S_PENDING, "Got hr %#x.\n", hr);
+
+ hr = IPin_EndOfStream(pin);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+
+ hr = IDirectDrawStreamSample_CompletionStatus(stream_sample1, 0, 0);
+ ok(hr == MS_S_ENDOFSTREAM, "Got hr %#x.\n", hr);
+
+ hr = IDirectDrawStreamSample_CompletionStatus(stream_sample1, COMPSTAT_WAIT, INFINITE);
+ ok(hr == MS_S_ENDOFSTREAM, "Got hr %#x.\n", hr);
+
+ hr = IDirectDrawStreamSample_Update(stream_sample1, SSUPDATE_ASYNC, NULL, NULL, 0);
+ ok(hr == MS_S_ENDOFSTREAM, "Got hr %#x.\n", hr);
+
+ hr = IDirectDrawStreamSample_CompletionStatus(stream_sample1, 0, 0);
+ ok(hr == MS_S_ENDOFSTREAM, "Got hr %#x.\n", hr);
+
+ hr = IDirectDrawStreamSample_CompletionStatus(stream_sample1, COMPSTAT_WAIT, INFINITE);
+ ok(hr == MS_S_ENDOFSTREAM, "Got hr %#x.\n", hr);
+
+ hr = IAMMultiMediaStream_SetState(mmstream, STREAMSTATE_STOP);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+ hr = IAMMultiMediaStream_SetState(mmstream, STREAMSTATE_RUN);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+
+ hr = IDirectDrawStreamSample_Update(stream_sample1, SSUPDATE_ASYNC, NULL, NULL, 0);
+ ok(hr == MS_S_PENDING, "Got hr %#x.\n", hr);
+
+ streamsample_sample = (IStreamSample *)stream_sample1;
+ streamsample_flags = COMPSTAT_WAIT;
+ streamsample_timeout = INFINITE;
+ streamsample_expected_hr = S_OK;
+ thread = CreateThread(NULL, 0, streamsample_completion_status, NULL, 0, NULL);
+ ok(WaitForSingleObject(thread, 100) == WAIT_TIMEOUT, "CompletionStatus returned prematurely.\n");
+
+ media_sample = ammediastream_allocate_sample(&source, test_data, sizeof(test_data));
+ hr = IMemInputPin_Receive(source.source.pMemInputPin, media_sample);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ref = IMediaSample_Release(media_sample);
+ ok(!ref, "Got outstanding refcount %d.\n", ref);
+
+ ok(!WaitForSingleObject(thread, 2000), "Wait timed out.\n");
+ CloseHandle(thread);
+
+ hr = IDirectDrawStreamSample_Update(stream_sample1, SSUPDATE_ASYNC, NULL, NULL, 0);
+ ok(hr == MS_S_PENDING, "Got hr %#x.\n", hr);
+
+ streamsample_sample = (IStreamSample *)stream_sample1;
+ streamsample_flags = COMPSTAT_WAIT;
+ streamsample_timeout = INFINITE;
+ streamsample_expected_hr = MS_S_ENDOFSTREAM;
+ thread = CreateThread(NULL, 0, streamsample_completion_status, NULL, 0, NULL);
+ ok(WaitForSingleObject(thread, 100) == WAIT_TIMEOUT, "CompletionStatus returned prematurely.\n");
+
+ hr = IPin_EndOfStream(pin);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+
+ ok(!WaitForSingleObject(thread, 2000), "Wait timed out.\n");
+ CloseHandle(thread);
+
+ hr = IAMMultiMediaStream_SetState(mmstream, STREAMSTATE_STOP);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+ hr = IAMMultiMediaStream_SetState(mmstream, STREAMSTATE_RUN);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+
+ hr = IDirectDrawStreamSample_Update(stream_sample1, SSUPDATE_ASYNC, NULL, NULL, 0);
+ ok(hr == MS_S_PENDING, "Got hr %#x.\n", hr);
+
+ hr = IAMMultiMediaStream_SetState(mmstream, STREAMSTATE_STOP);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+
+ hr = IDirectDrawStreamSample_CompletionStatus(stream_sample1, 0, 0);
+ ok(hr == MS_S_PENDING, "Got hr %#x.\n", hr);
+
+ hr = IAMMultiMediaStream_SetState(mmstream, STREAMSTATE_RUN);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+
+ media_sample = ammediastream_allocate_sample(&source, test_data, 6);
+ hr = IMemInputPin_Receive(source.source.pMemInputPin, media_sample);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ref = IMediaSample_Release(media_sample);
+ ok(!ref, "Got outstanding refcount %d.\n", ref);
+
+ hr = IDirectDrawStreamSample_CompletionStatus(stream_sample1, 0, 0);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+
+ hr = IAMMultiMediaStream_SetState(mmstream, STREAMSTATE_STOP);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+
+ hr = IDirectDrawStreamSample_Update(stream_sample1, SSUPDATE_ASYNC, NULL, NULL, 0);
+ ok(hr == MS_E_NOTRUNNING, "Got hr %#x.\n", hr);
+
+ hr = IDirectDrawStreamSample_CompletionStatus(stream_sample1, 0, 0);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+
+ hr = IDirectDrawStreamSample_CompletionStatus(stream_sample1, COMPSTAT_WAIT, INFINITE);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+
+ IGraphBuilder_Disconnect(graph, pin);
+ IGraphBuilder_Disconnect(graph, &source.source.pin.IPin_iface);
+
+ ref = IDirectDrawStreamSample_Release(stream_sample1);
+ ok(!ref, "Got outstanding refcount %d.\n", ref);
+ ref = IDirectDrawStreamSample_Release(stream_sample2);
+ ok(!ref, "Got outstanding refcount %d.\n", ref);
+ ref = IAMMultiMediaStream_Release(mmstream);
+ ok(!ref, "Got outstanding refcount %d.\n", ref);
+ IMediaFilter_Release(media_filter);
+ ref = IGraphBuilder_Release(graph);
+ ok(!ref, "Got outstanding refcount %d.\n", ref);
+ IPin_Release(pin);
+ IDirectDrawMediaStream_Release(ddraw_stream);
+ ref = IMediaStream_Release(stream);
+ ok(!ref, "Got outstanding refcount %d.\n", ref);
+}
+
START_TEST(amstream)
{
const WCHAR *test_avi_path;
@@ -7276,6 +7567,7 @@ START_TEST(amstream)
test_ddrawstreamsample_get_media_stream();
test_ddrawstreamsample_update();
+ test_ddrawstreamsample_completion_status();
test_ammediastream_join_am_multi_media_stream();
test_ammediastream_join_filter();
--
2.17.1
2
5
[PATCH 1/4] amstream: Implement IDirectDrawStreamSample::CompletionStatus.
by Anton Baskanov Oct. 2, 2020
by Anton Baskanov Oct. 2, 2020
Oct. 2, 2020
Signed-off-by: Anton Baskanov <baskanov(a)gmail.com>
---
dlls/amstream/ddrawstream.c | 31 +++-
dlls/amstream/tests/amstream.c | 280 +++++++++++++++++++++++++++++++++
2 files changed, 308 insertions(+), 3 deletions(-)
diff --git a/dlls/amstream/ddrawstream.c b/dlls/amstream/ddrawstream.c
index 972c2b9f4d0..9020828f578 100644
--- a/dlls/amstream/ddrawstream.c
+++ b/dlls/amstream/ddrawstream.c
@@ -1491,6 +1491,7 @@ static HRESULT WINAPI ddraw_sample_Update(IDirectDrawStreamSample *iface,
}
if (!sample->parent->peer || sample->parent->eos)
{
+ sample->update_hr = MS_S_ENDOFSTREAM;
LeaveCriticalSection(&sample->parent->cs);
return MS_S_ENDOFSTREAM;
}
@@ -1517,9 +1518,33 @@ static HRESULT WINAPI ddraw_sample_Update(IDirectDrawStreamSample *iface,
static HRESULT WINAPI ddraw_sample_CompletionStatus(IDirectDrawStreamSample *iface, DWORD flags, DWORD milliseconds)
{
- FIXME("(%p)->(%x,%u): stub\n", iface, flags, milliseconds);
+ struct ddraw_sample *sample = impl_from_IDirectDrawStreamSample(iface);
+ HRESULT hr;
- return E_NOTIMPL;
+ TRACE("sample %p, flags %#x, milliseconds %u.\n", sample, flags, milliseconds);
+
+ EnterCriticalSection(&sample->parent->cs);
+
+ if (sample->update_hr == MS_S_PENDING)
+ {
+ if (flags & (COMPSTAT_NOUPDATEOK | COMPSTAT_ABORT))
+ {
+ sample->update_hr = MS_S_NOUPDATE;
+ remove_queued_update(sample);
+ }
+ else if (flags & COMPSTAT_WAIT)
+ {
+ LeaveCriticalSection(&sample->parent->cs);
+ WaitForSingleObject(sample->update_event, milliseconds);
+ EnterCriticalSection(&sample->parent->cs);
+ }
+ }
+
+ hr = sample->update_hr;
+
+ LeaveCriticalSection(&sample->parent->cs);
+
+ return hr;
}
/*** IDirectDrawStreamSample methods ***/
@@ -1583,7 +1608,7 @@ static HRESULT ddrawstreamsample_create(struct ddraw_stream *parent, IDirectDraw
object->IDirectDrawStreamSample_iface.lpVtbl = &DirectDrawStreamSample_Vtbl;
object->ref = 1;
object->parent = parent;
- object->update_event = CreateEventW(NULL, FALSE, FALSE, NULL);
+ object->update_event = CreateEventW(NULL, TRUE, TRUE, NULL);
IAMMediaStream_AddRef(&parent->IAMMediaStream_iface);
++parent->sample_refs;
diff --git a/dlls/amstream/tests/amstream.c b/dlls/amstream/tests/amstream.c
index e5d1dd621f3..44debac2333 100644
--- a/dlls/amstream/tests/amstream.c
+++ b/dlls/amstream/tests/amstream.c
@@ -4028,6 +4028,21 @@ static DWORD CALLBACK ammediastream_receive(void *param)
return 0;
}
+static IStreamSample *streamsample_sample;
+static DWORD streamsample_flags;
+static DWORD streamsample_timeout;
+static HRESULT streamsample_expected_hr;
+
+static DWORD CALLBACK streamsample_completion_status(void *param)
+{
+ HRESULT hr;
+
+ hr = IStreamSample_CompletionStatus(streamsample_sample, streamsample_flags, streamsample_timeout);
+ ok(hr == streamsample_expected_hr, "Got hr %#x.\n", hr);
+
+ return 0;
+}
+
static void test_audiostreamsample_update(void)
{
static const BYTE test_data[] = { 0, 1, 2, 3, 4, 5, 6, 7 };
@@ -7221,6 +7236,270 @@ static void test_ddrawstreamsample_update(void)
ok(!ref, "Got outstanding refcount %d.\n", ref);
}
+static void test_ddrawstreamsample_completion_status(void)
+{
+ static const BYTE test_data[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 };
+ IAMMultiMediaStream *mmstream = create_ammultimediastream();
+ IDirectDrawStreamSample *stream_sample1;
+ IDirectDrawStreamSample *stream_sample2;
+ IDirectDrawMediaStream *ddraw_stream;
+ IMediaSample *media_sample;
+ IMediaFilter *media_filter;
+ struct testfilter source;
+ VIDEOINFO video_info;
+ IGraphBuilder *graph;
+ IMediaStream *stream;
+ AM_MEDIA_TYPE mt;
+ HANDLE thread;
+ HRESULT hr;
+ ULONG ref;
+ IPin *pin;
+
+ hr = IAMMultiMediaStream_Initialize(mmstream, STREAMTYPE_READ, 0, NULL);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+ hr = IAMMultiMediaStream_AddMediaStream(mmstream, NULL, &MSPID_PrimaryVideo, 0, &stream);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+ hr = IMediaStream_QueryInterface(stream, &IID_IDirectDrawMediaStream, (void **)&ddraw_stream);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+ hr = IMediaStream_QueryInterface(stream, &IID_IPin, (void **)&pin);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+ hr = IAMMultiMediaStream_GetFilterGraph(mmstream, &graph);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ok(graph != NULL, "Expected non-NULL graph.\n");
+ hr = IGraphBuilder_QueryInterface(graph, &IID_IMediaFilter, (void **)&media_filter);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+ testfilter_init(&source);
+ hr = IGraphBuilder_AddFilter(graph, &source.filter.IBaseFilter_iface, NULL);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+
+ hr = IMediaFilter_SetSyncSource(media_filter, NULL);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+
+ video_info = rgb32_video_info;
+ video_info.bmiHeader.biWidth = 3;
+ video_info.bmiHeader.biHeight = 1;
+ mt = rgb32_mt;
+ mt.pbFormat = (BYTE *)&video_info;
+ hr = IGraphBuilder_ConnectDirect(graph, &source.source.pin.IPin_iface, pin, &mt);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+ hr = IAMMultiMediaStream_SetState(mmstream, STREAMSTATE_RUN);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+
+ hr = IDirectDrawMediaStream_CreateSample(ddraw_stream, NULL, NULL, 0, &stream_sample1);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+ hr = IDirectDrawMediaStream_CreateSample(ddraw_stream, NULL, NULL, 0, &stream_sample2);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+
+ hr = IDirectDrawStreamSample_CompletionStatus(stream_sample1, 0, 0);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+
+ hr = IDirectDrawStreamSample_CompletionStatus(stream_sample1, COMPSTAT_WAIT, INFINITE);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+
+ hr = IDirectDrawStreamSample_Update(stream_sample1, SSUPDATE_ASYNC, NULL, NULL, 0);
+ ok(hr == MS_S_PENDING, "Got hr %#x.\n", hr);
+
+ hr = IDirectDrawStreamSample_CompletionStatus(stream_sample1, 0, 0);
+ ok(hr == MS_S_PENDING, "Got hr %#x.\n", hr);
+
+ hr = IDirectDrawStreamSample_CompletionStatus(stream_sample1, COMPSTAT_WAIT, 100);
+ ok(hr == MS_S_PENDING, "Got hr %#x.\n", hr);
+
+ hr = IDirectDrawStreamSample_Update(stream_sample2, SSUPDATE_ASYNC, NULL, NULL, 0);
+ ok(hr == MS_S_PENDING, "Got hr %#x.\n", hr);
+
+ hr = IDirectDrawStreamSample_CompletionStatus(stream_sample2, 0, 0);
+ ok(hr == MS_S_PENDING, "Got hr %#x.\n", hr);
+
+ media_sample = ammediastream_allocate_sample(&source, test_data, sizeof(test_data));
+ hr = IMemInputPin_Receive(source.source.pMemInputPin, media_sample);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ref = IMediaSample_Release(media_sample);
+ ok(!ref, "Got outstanding refcount %d.\n", ref);
+
+ hr = IDirectDrawStreamSample_CompletionStatus(stream_sample1, 0, 0);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+
+ hr = IDirectDrawStreamSample_CompletionStatus(stream_sample1, COMPSTAT_WAIT, INFINITE);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+
+ hr = IDirectDrawStreamSample_CompletionStatus(stream_sample2, 0, 0);
+ ok(hr == MS_S_PENDING, "Got hr %#x.\n", hr);
+
+ media_sample = ammediastream_allocate_sample(&source, test_data, sizeof(test_data));
+ hr = IMemInputPin_Receive(source.source.pMemInputPin, media_sample);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ref = IMediaSample_Release(media_sample);
+ ok(!ref, "Got outstanding refcount %d.\n", ref);
+
+ hr = IDirectDrawStreamSample_CompletionStatus(stream_sample2, 0, 0);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+
+ hr = IDirectDrawStreamSample_Update(stream_sample1, SSUPDATE_ASYNC, NULL, NULL, 0);
+ ok(hr == MS_S_PENDING, "Got hr %#x.\n", hr);
+
+ hr = IDirectDrawStreamSample_Update(stream_sample2, SSUPDATE_ASYNC, NULL, NULL, 0);
+ ok(hr == MS_S_PENDING, "Got hr %#x.\n", hr);
+
+ hr = IDirectDrawStreamSample_CompletionStatus(stream_sample1, COMPSTAT_NOUPDATEOK, 0);
+ ok(hr == MS_S_NOUPDATE, "Got hr %#x.\n", hr);
+
+ hr = IDirectDrawStreamSample_CompletionStatus(stream_sample1, COMPSTAT_WAIT, INFINITE);
+ ok(hr == MS_S_NOUPDATE, "Got hr %#x.\n", hr);
+
+ media_sample = ammediastream_allocate_sample(&source, test_data, sizeof(test_data));
+ hr = IMemInputPin_Receive(source.source.pMemInputPin, media_sample);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ref = IMediaSample_Release(media_sample);
+ ok(!ref, "Got outstanding refcount %d.\n", ref);
+
+ hr = IDirectDrawStreamSample_CompletionStatus(stream_sample1, 0, 0);
+ ok(hr == MS_S_NOUPDATE, "Got hr %#x.\n", hr);
+
+ hr = IDirectDrawStreamSample_CompletionStatus(stream_sample2, 0, 0);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+
+ hr = IDirectDrawStreamSample_Update(stream_sample1, SSUPDATE_ASYNC, NULL, NULL, 0);
+ ok(hr == MS_S_PENDING, "Got hr %#x.\n", hr);
+
+ hr = IDirectDrawStreamSample_Update(stream_sample2, SSUPDATE_ASYNC, NULL, NULL, 0);
+ ok(hr == MS_S_PENDING, "Got hr %#x.\n", hr);
+
+ hr = IDirectDrawStreamSample_CompletionStatus(stream_sample1, COMPSTAT_ABORT, 0);
+ ok(hr == MS_S_NOUPDATE, "Got hr %#x.\n", hr);
+
+ hr = IDirectDrawStreamSample_CompletionStatus(stream_sample1, COMPSTAT_WAIT, INFINITE);
+ ok(hr == MS_S_NOUPDATE, "Got hr %#x.\n", hr);
+
+ media_sample = ammediastream_allocate_sample(&source, test_data, sizeof(test_data));
+ hr = IMemInputPin_Receive(source.source.pMemInputPin, media_sample);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ref = IMediaSample_Release(media_sample);
+ ok(!ref, "Got outstanding refcount %d.\n", ref);
+
+ hr = IDirectDrawStreamSample_CompletionStatus(stream_sample1, 0, 0);
+ ok(hr == MS_S_NOUPDATE, "Got hr %#x.\n", hr);
+
+ hr = IDirectDrawStreamSample_CompletionStatus(stream_sample2, 0, 0);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+
+ hr = IDirectDrawStreamSample_Update(stream_sample1, SSUPDATE_ASYNC, NULL, NULL, 0);
+ ok(hr == MS_S_PENDING, "Got hr %#x.\n", hr);
+
+ hr = IPin_EndOfStream(pin);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+
+ hr = IDirectDrawStreamSample_CompletionStatus(stream_sample1, 0, 0);
+ ok(hr == MS_S_ENDOFSTREAM, "Got hr %#x.\n", hr);
+
+ hr = IDirectDrawStreamSample_CompletionStatus(stream_sample1, COMPSTAT_WAIT, INFINITE);
+ ok(hr == MS_S_ENDOFSTREAM, "Got hr %#x.\n", hr);
+
+ hr = IDirectDrawStreamSample_Update(stream_sample1, SSUPDATE_ASYNC, NULL, NULL, 0);
+ ok(hr == MS_S_ENDOFSTREAM, "Got hr %#x.\n", hr);
+
+ hr = IDirectDrawStreamSample_CompletionStatus(stream_sample1, 0, 0);
+ ok(hr == MS_S_ENDOFSTREAM, "Got hr %#x.\n", hr);
+
+ hr = IDirectDrawStreamSample_CompletionStatus(stream_sample1, COMPSTAT_WAIT, INFINITE);
+ ok(hr == MS_S_ENDOFSTREAM, "Got hr %#x.\n", hr);
+
+ hr = IAMMultiMediaStream_SetState(mmstream, STREAMSTATE_STOP);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+ hr = IAMMultiMediaStream_SetState(mmstream, STREAMSTATE_RUN);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+
+ hr = IDirectDrawStreamSample_Update(stream_sample1, SSUPDATE_ASYNC, NULL, NULL, 0);
+ ok(hr == MS_S_PENDING, "Got hr %#x.\n", hr);
+
+ streamsample_sample = (IStreamSample *)stream_sample1;
+ streamsample_flags = COMPSTAT_WAIT;
+ streamsample_timeout = INFINITE;
+ streamsample_expected_hr = S_OK;
+ thread = CreateThread(NULL, 0, streamsample_completion_status, NULL, 0, NULL);
+ ok(WaitForSingleObject(thread, 100) == WAIT_TIMEOUT, "CompletionStatus returned prematurely.\n");
+
+ media_sample = ammediastream_allocate_sample(&source, test_data, sizeof(test_data));
+ hr = IMemInputPin_Receive(source.source.pMemInputPin, media_sample);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ref = IMediaSample_Release(media_sample);
+ ok(!ref, "Got outstanding refcount %d.\n", ref);
+
+ ok(!WaitForSingleObject(thread, 2000), "Wait timed out.\n");
+ CloseHandle(thread);
+
+ hr = IDirectDrawStreamSample_Update(stream_sample1, SSUPDATE_ASYNC, NULL, NULL, 0);
+ ok(hr == MS_S_PENDING, "Got hr %#x.\n", hr);
+
+ streamsample_sample = (IStreamSample *)stream_sample1;
+ streamsample_flags = COMPSTAT_WAIT;
+ streamsample_timeout = INFINITE;
+ streamsample_expected_hr = MS_S_ENDOFSTREAM;
+ thread = CreateThread(NULL, 0, streamsample_completion_status, NULL, 0, NULL);
+ ok(WaitForSingleObject(thread, 100) == WAIT_TIMEOUT, "CompletionStatus returned prematurely.\n");
+
+ hr = IPin_EndOfStream(pin);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+
+ ok(!WaitForSingleObject(thread, 2000), "Wait timed out.\n");
+ CloseHandle(thread);
+
+ hr = IAMMultiMediaStream_SetState(mmstream, STREAMSTATE_STOP);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+ hr = IAMMultiMediaStream_SetState(mmstream, STREAMSTATE_RUN);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+
+ hr = IDirectDrawStreamSample_Update(stream_sample1, SSUPDATE_ASYNC, NULL, NULL, 0);
+ ok(hr == MS_S_PENDING, "Got hr %#x.\n", hr);
+
+ hr = IAMMultiMediaStream_SetState(mmstream, STREAMSTATE_STOP);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+
+ hr = IDirectDrawStreamSample_CompletionStatus(stream_sample1, 0, 0);
+ ok(hr == MS_S_PENDING, "Got hr %#x.\n", hr);
+
+ hr = IAMMultiMediaStream_SetState(mmstream, STREAMSTATE_RUN);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+
+ media_sample = ammediastream_allocate_sample(&source, test_data, 6);
+ hr = IMemInputPin_Receive(source.source.pMemInputPin, media_sample);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ref = IMediaSample_Release(media_sample);
+ ok(!ref, "Got outstanding refcount %d.\n", ref);
+
+ hr = IDirectDrawStreamSample_CompletionStatus(stream_sample1, 0, 0);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+
+ hr = IAMMultiMediaStream_SetState(mmstream, STREAMSTATE_STOP);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+
+ hr = IDirectDrawStreamSample_Update(stream_sample1, SSUPDATE_ASYNC, NULL, NULL, 0);
+ ok(hr == MS_E_NOTRUNNING, "Got hr %#x.\n", hr);
+
+ hr = IDirectDrawStreamSample_CompletionStatus(stream_sample1, 0, 0);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+
+ hr = IDirectDrawStreamSample_CompletionStatus(stream_sample1, COMPSTAT_WAIT, INFINITE);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+
+ IGraphBuilder_Disconnect(graph, pin);
+ IGraphBuilder_Disconnect(graph, &source.source.pin.IPin_iface);
+
+ ref = IDirectDrawStreamSample_Release(stream_sample1);
+ ok(!ref, "Got outstanding refcount %d.\n", ref);
+ ref = IDirectDrawStreamSample_Release(stream_sample2);
+ ok(!ref, "Got outstanding refcount %d.\n", ref);
+ ref = IAMMultiMediaStream_Release(mmstream);
+ ok(!ref, "Got outstanding refcount %d.\n", ref);
+ IMediaFilter_Release(media_filter);
+ ref = IGraphBuilder_Release(graph);
+ ok(!ref, "Got outstanding refcount %d.\n", ref);
+ IPin_Release(pin);
+ IDirectDrawMediaStream_Release(ddraw_stream);
+ ref = IMediaStream_Release(stream);
+ ok(!ref, "Got outstanding refcount %d.\n", ref);
+}
+
START_TEST(amstream)
{
const WCHAR *test_avi_path;
@@ -7276,6 +7555,7 @@ START_TEST(amstream)
test_ddrawstreamsample_get_media_stream();
test_ddrawstreamsample_update();
+ test_ddrawstreamsample_completion_status();
test_ammediastream_join_am_multi_media_stream();
test_ammediastream_join_filter();
--
2.17.1
2
7