Wine-devel
Threads by month
- ----- 2026 -----
- 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
July 2019
- 65 participants
- 284 discussions
Signed-off-by: Jacek Caban <jacek(a)codeweavers.com>
---
dlls/ntdll/misc.c | 8 --------
dlls/ntdll/ntdll.spec | 2 +-
dlls/ntdll/process.c | 29 +++++++++++++++++++++++++++++
dlls/ntdll/server.c | 5 +++++
include/winternl.h | 2 ++
server/protocol.def | 8 +++++++-
server/thread.c | 1 +
server/trace.c | 6 ++++++
8 files changed, 51 insertions(+), 10 deletions(-)
1
0
05 Jul '19
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
---
First time this was dropped because of test failure presumably, probably because of
tests relation to changed module wasn't obvious to testbot or something like that.
It works fine for me locally however, including starting with clean prefix.
dlls/mf/tests/mf.c | 25 +-
dlls/winegstreamer/Makefile.in | 7 +-
dlls/winegstreamer/gst_private.h | 3 +
dlls/winegstreamer/main.c | 14 +-
dlls/winegstreamer/mfplat.c | 444 +++++++++++++++++++++++++++++++
dlls/winegstreamer/mfplat.idl | 26 ++
6 files changed, 513 insertions(+), 6 deletions(-)
create mode 100644 dlls/winegstreamer/mfplat.c
create mode 100644 dlls/winegstreamer/mfplat.idl
diff --git a/dlls/mf/tests/mf.c b/dlls/mf/tests/mf.c
index 15aa58620a..8c1b0c294e 100644
--- a/dlls/mf/tests/mf.c
+++ b/dlls/mf/tests/mf.c
@@ -2079,7 +2079,6 @@ static void test_video_processor(void)
hr = CoCreateInstance(&CLSID_VideoProcessorMFT, NULL, CLSCTX_INPROC_SERVER, &IID_IMFTransform,
(void **)&transform);
-todo_wine
ok(hr == S_OK || broken(hr == REGDB_E_CLASSNOTREG), "Failed to create video processor transform, hr %#x.\n", hr);
if (FAILED(hr))
@@ -2120,12 +2119,14 @@ todo_wine
ok(hr == E_NOTIMPL, "Unexpected hr %#x.\n", hr);
hr = IMFTransform_GetInputStatus(transform, 0, &flags);
+todo_wine
ok(hr == MF_E_TRANSFORM_TYPE_NOT_SET, "Unexpected hr %#x.\n", hr);
hr = IMFTransform_GetInputStreamAttributes(transform, 0, &attributes);
ok(hr == E_NOTIMPL, "Unexpected hr %#x.\n", hr);
hr = IMFTransform_GetOutputStatus(transform, &flags);
+todo_wine
ok(hr == MF_E_TRANSFORM_TYPE_NOT_SET, "Unexpected hr %#x.\n", hr);
hr = IMFTransform_GetOutputStreamAttributes(transform, 0, &attributes);
@@ -2137,30 +2138,38 @@ todo_wine
IMFAttributes_Release(attributes2);
hr = IMFTransform_GetOutputAvailableType(transform, 0, 0, &media_type);
+todo_wine
ok(hr == MF_E_NO_MORE_TYPES, "Unexpected hr %#x.\n", hr);
hr = IMFTransform_GetInputCurrentType(transform, 0, &media_type);
+todo_wine
ok(hr == MF_E_TRANSFORM_TYPE_NOT_SET, "Unexpected hr %#x.\n", hr);
hr = IMFTransform_GetInputCurrentType(transform, 1, &media_type);
+todo_wine
ok(hr == MF_E_INVALIDSTREAMNUMBER, "Unexpected hr %#x.\n", hr);
hr = IMFTransform_GetOutputCurrentType(transform, 0, &media_type);
+todo_wine
ok(hr == MF_E_TRANSFORM_TYPE_NOT_SET, "Unexpected hr %#x.\n", hr);
hr = IMFTransform_GetOutputCurrentType(transform, 1, &media_type);
+todo_wine
ok(hr == MF_E_INVALIDSTREAMNUMBER, "Unexpected hr %#x.\n", hr);
hr = IMFTransform_GetInputStreamInfo(transform, 1, &input_info);
+todo_wine
ok(hr == MF_E_INVALIDSTREAMNUMBER, "Unexpected hr %#x.\n", hr);
+ memset(&input_info, 0xcc, sizeof(input_info));
hr = IMFTransform_GetInputStreamInfo(transform, 0, &input_info);
+todo_wine {
ok(hr == S_OK, "Failed to get stream info, hr %#x.\n", hr);
ok(input_info.dwFlags == 0, "Unexpected flag %#x.\n", input_info.dwFlags);
ok(input_info.cbSize == 0, "Unexpected size %u.\n", input_info.cbSize);
ok(input_info.cbMaxLookahead == 0, "Unexpected lookahead length %u.\n", input_info.cbMaxLookahead);
ok(input_info.cbAlignment == 0, "Unexpected alignment %u.\n", input_info.cbAlignment);
-
+}
hr = MFCreateMediaEvent(MEUnknown, &GUID_NULL, S_OK, NULL, &event);
ok(hr == S_OK, "Failed to create event object, hr %#x.\n", hr);
hr = IMFTransform_ProcessEvent(transform, 0, event);
@@ -2174,6 +2183,7 @@ todo_wine
{
if (FAILED(hr = IMFTransform_GetInputAvailableType(transform, 0, i, &media_type)))
{
+ todo_wine
ok(hr == MF_E_NO_MORE_TYPES, "Unexpected hr %#x.\n", hr);
break;
}
@@ -2254,17 +2264,22 @@ todo_wine
ok(hr == S_OK, "Failed to set attribute, hr %#x.\n", hr);
hr = IMFTransform_SetInputType(transform, 0, media_type, 0);
+todo_wine
ok(hr == S_OK, "Failed to set input type, hr %#x.\n", hr);
hr = IMFMediaType_SetGUID(media_type, &MF_MT_SUBTYPE, &MFVideoFormat_RGB32);
ok(hr == S_OK, "Failed to set attribute, hr %#x.\n", hr);
hr = IMFTransform_SetOutputType(transform, 0, media_type, 0);
+todo_wine
ok(hr == S_OK, "Failed to set output type, hr %#x.\n", hr);
+ memset(&output_info, 0, sizeof(output_info));
hr = IMFTransform_GetOutputStreamInfo(transform, 0, &output_info);
+todo_wine
ok(hr == S_OK, "Failed to get stream info, hr %#x.\n", hr);
ok(output_info.dwFlags == 0, "Unexpected flags %#x.\n", output_info.dwFlags);
+todo_wine
ok(output_info.cbSize > 0, "Unexpected size %u.\n", output_info.cbSize);
ok(output_info.cbAlignment == 0, "Unexpected alignment %u.\n", output_info.cbAlignment);
@@ -2278,20 +2293,24 @@ todo_wine
output_buffer.pSample = sample;
flags = 0;
hr = IMFTransform_ProcessOutput(transform, 0, 1, &output_buffer, &flags);
+todo_wine
ok(hr == MF_E_TRANSFORM_NEED_MORE_INPUT, "Unexpected hr %#x.\n", hr);
ok(output_buffer.dwStatus == 0, "Unexpected buffer status, %#x.\n", output_buffer.dwStatus);
ok(flags == 0, "Unexpected status %#x.\n", flags);
hr = IMFTransform_ProcessInput(transform, 0, sample2, 0);
+todo_wine
ok(hr == S_OK, "Failed to push a sample, hr %#x.\n", hr);
hr = IMFTransform_ProcessInput(transform, 0, sample2, 0);
+todo_wine
ok(hr == MF_E_NOTACCEPTING, "Unexpected hr %#x.\n", hr);
memset(&output_buffer, 0, sizeof(output_buffer));
output_buffer.pSample = sample;
flags = 0;
hr = IMFTransform_ProcessOutput(transform, 0, 1, &output_buffer, &flags);
+todo_wine
ok(hr == MF_E_NO_SAMPLE_TIMESTAMP, "Unexpected hr %#x.\n", hr);
ok(output_buffer.dwStatus == 0, "Unexpected buffer status, %#x.\n", output_buffer.dwStatus);
ok(flags == 0, "Unexpected status %#x.\n", flags);
@@ -2302,6 +2321,7 @@ todo_wine
output_buffer.pSample = sample;
flags = 0;
hr = IMFTransform_ProcessOutput(transform, 0, 1, &output_buffer, &flags);
+todo_wine
ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
ok(output_buffer.dwStatus == 0, "Unexpected buffer status, %#x.\n", output_buffer.dwStatus);
ok(flags == 0, "Unexpected status %#x.\n", flags);
@@ -2319,6 +2339,7 @@ todo_wine
output_buffer.pSample = sample;
flags = 0;
hr = IMFTransform_ProcessOutput(transform, 0, 1, &output_buffer, &flags);
+todo_wine
ok(hr == S_OK || broken(FAILED(hr)) /* Win8 */, "Failed to get output buffer, hr %#x.\n", hr);
ok(output_buffer.dwStatus == 0, "Unexpected buffer status, %#x.\n", output_buffer.dwStatus);
ok(flags == 0, "Unexpected status %#x.\n", flags);
diff --git a/dlls/winegstreamer/Makefile.in b/dlls/winegstreamer/Makefile.in
index fecabe8ba2..437915f6da 100644
--- a/dlls/winegstreamer/Makefile.in
+++ b/dlls/winegstreamer/Makefile.in
@@ -1,5 +1,5 @@
MODULE = winegstreamer.dll
-IMPORTS = strmbase strmiids uuid winmm msacm32 msvfw32 ole32 oleaut32 user32 gdi32 advapi32
+IMPORTS = strmbase strmiids uuid winmm msacm32 msvfw32 ole32 oleaut32 user32 gdi32 advapi32 mfplat mfuuid
EXTRAINCL = $(GSTREAMER_CFLAGS)
EXTRALIBS = $(GSTREAMER_LIBS) $(PTHREAD_LIBS)
@@ -7,7 +7,10 @@ C_SRCS = \
gst_cbs.c \
gstdemux.c \
gsttffilter.c \
- main.c
+ main.c \
+ mfplat.c
+
+IDL_SRCS = mfplat.idl
RC_SRCS = \
rsrc.rc
diff --git a/dlls/winegstreamer/gst_private.h b/dlls/winegstreamer/gst_private.h
index 85659c4bd9..06236e2636 100644
--- a/dlls/winegstreamer/gst_private.h
+++ b/dlls/winegstreamer/gst_private.h
@@ -53,4 +53,7 @@ void start_dispatch_thread(void) DECLSPEC_HIDDEN;
extern const char *media_quark_string DECLSPEC_HIDDEN;
+extern HRESULT mfplat_get_class_object(REFCLSID rclsid, REFIID riid, void **obj) DECLSPEC_HIDDEN;
+extern HRESULT mfplat_can_unload_now(void) DECLSPEC_HIDDEN;
+
#endif /* __GST_PRIVATE_INCLUDED__ */
diff --git a/dlls/winegstreamer/main.c b/dlls/winegstreamer/main.c
index f11e59a914..4419a6fde5 100644
--- a/dlls/winegstreamer/main.c
+++ b/dlls/winegstreamer/main.c
@@ -232,7 +232,12 @@ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv)
*/
HRESULT WINAPI DllCanUnloadNow(void)
{
- return STRMBASE_DllCanUnloadNow();
+ HRESULT hr = STRMBASE_DllCanUnloadNow();
+
+ if (hr == S_OK)
+ hr = mfplat_can_unload_now();
+
+ return hr;
}
/***********************************************************************
@@ -240,7 +245,12 @@ HRESULT WINAPI DllCanUnloadNow(void)
*/
HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
{
- return STRMBASE_DllGetClassObject( rclsid, riid, ppv );
+ HRESULT hr;
+
+ if (FAILED(hr = mfplat_get_class_object(rclsid, riid, ppv)))
+ hr = STRMBASE_DllGetClassObject( rclsid, riid, ppv );
+
+ return hr;
}
/* GStreamer common functions */
diff --git a/dlls/winegstreamer/mfplat.c b/dlls/winegstreamer/mfplat.c
new file mode 100644
index 0000000000..2233bbe159
--- /dev/null
+++ b/dlls/winegstreamer/mfplat.c
@@ -0,0 +1,444 @@
+/*
+ * Copyright 2019 Nikolay Sivov for CodeWeavers
+ *
+ * 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
+ */
+
+#include <stdarg.h>
+
+#define COBJMACROS
+#define NONAMELESSUNION
+
+#include "mfapi.h"
+#include "mfidl.h"
+
+#include "wine/debug.h"
+#include "wine/heap.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(mfplat);
+
+static LONG object_locks;
+
+struct video_processor
+{
+ IMFTransform IMFTransform_iface;
+ LONG refcount;
+ IMFAttributes *attributes;
+ IMFAttributes *output_attributes;
+};
+
+static struct video_processor *impl_video_processor_from_IMFTransform(IMFTransform *iface)
+{
+ return CONTAINING_RECORD(iface, struct video_processor, IMFTransform_iface);
+}
+
+static HRESULT WINAPI video_processor_QueryInterface(IMFTransform *iface, REFIID riid, void **obj)
+{
+ TRACE("%p, %s, %p.\n", iface, debugstr_guid(riid), obj);
+
+ if (IsEqualIID(riid, &IID_IMFTransform) ||
+ IsEqualIID(riid, &IID_IUnknown))
+ {
+ *obj = iface;
+ IMFTransform_AddRef(iface);
+ return S_OK;
+ }
+
+ WARN("Unsupported %s.\n", debugstr_guid(riid));
+ *obj = NULL;
+ return E_NOINTERFACE;
+}
+
+static ULONG WINAPI video_processor_AddRef(IMFTransform *iface)
+{
+ struct video_processor *transform = impl_video_processor_from_IMFTransform(iface);
+ ULONG refcount = InterlockedIncrement(&transform->refcount);
+
+ TRACE("%p, refcount %u.\n", iface, refcount);
+
+ return refcount;
+}
+
+static ULONG WINAPI video_processor_Release(IMFTransform *iface)
+{
+ struct video_processor *transform = impl_video_processor_from_IMFTransform(iface);
+ ULONG refcount = InterlockedDecrement(&transform->refcount);
+
+ TRACE("%p, refcount %u.\n", iface, refcount);
+
+ if (!refcount)
+ {
+ if (transform->attributes)
+ IMFAttributes_Release(transform->attributes);
+ if (transform->output_attributes)
+ IMFAttributes_Release(transform->output_attributes);
+ heap_free(transform);
+ }
+
+ return refcount;
+}
+
+static HRESULT WINAPI video_processor_GetStreamLimits(IMFTransform *iface, DWORD *input_minimum, DWORD *input_maximum,
+ DWORD *output_minimum, DWORD *output_maximum)
+{
+ TRACE("%p, %p, %p, %p, %p.\n", iface, input_minimum, input_maximum, output_minimum, output_maximum);
+
+ *input_minimum = *input_maximum = *output_minimum = *output_maximum = 1;
+
+ return S_OK;
+}
+
+static HRESULT WINAPI video_processor_GetStreamCount(IMFTransform *iface, DWORD *inputs, DWORD *outputs)
+{
+ TRACE("%p, %p, %p.\n", iface, inputs, outputs);
+
+ *inputs = *outputs = 1;
+
+ return S_OK;
+}
+
+static HRESULT WINAPI video_processor_GetStreamIDs(IMFTransform *iface, DWORD input_size, DWORD *inputs,
+ DWORD output_size, DWORD *outputs)
+{
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI video_processor_GetInputStreamInfo(IMFTransform *iface, DWORD id, MFT_INPUT_STREAM_INFO *info)
+{
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI video_processor_GetOutputStreamInfo(IMFTransform *iface, DWORD id, MFT_OUTPUT_STREAM_INFO *info)
+{
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI video_processor_GetAttributes(IMFTransform *iface, IMFAttributes **attributes)
+{
+ struct video_processor *transform = impl_video_processor_from_IMFTransform(iface);
+
+ TRACE("%p, %p.\n", iface, attributes);
+
+ *attributes = transform->attributes;
+ IMFAttributes_AddRef(*attributes);
+
+ return S_OK;
+}
+
+static HRESULT WINAPI video_processor_GetInputStreamAttributes(IMFTransform *iface, DWORD id,
+ IMFAttributes **attributes)
+{
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI video_processor_GetOutputStreamAttributes(IMFTransform *iface, DWORD id,
+ IMFAttributes **attributes)
+{
+ struct video_processor *transform = impl_video_processor_from_IMFTransform(iface);
+
+ TRACE("%p, %u, %p.\n", iface, id, attributes);
+
+ *attributes = transform->output_attributes;
+ IMFAttributes_AddRef(*attributes);
+
+ return S_OK;
+}
+
+static HRESULT WINAPI video_processor_DeleteInputStream(IMFTransform *iface, DWORD id)
+{
+ TRACE("%p, %u.\n", iface, id);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI video_processor_AddInputStreams(IMFTransform *iface, DWORD streams, DWORD *ids)
+{
+ TRACE("%p, %u, %p.\n", iface, streams, ids);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI video_processor_GetInputAvailableType(IMFTransform *iface, DWORD id, DWORD index,
+ IMFMediaType **type)
+{
+ FIXME("%p, %u, %u, %p.\n", iface, id, index, type);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI video_processor_GetOutputAvailableType(IMFTransform *iface, DWORD id, DWORD index,
+ IMFMediaType **type)
+{
+ FIXME("%p, %u, %u, %p.\n", iface, id, index, type);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI video_processor_SetInputType(IMFTransform *iface, DWORD id, IMFMediaType *type, DWORD flags)
+{
+ FIXME("%p, %u, %p, %#x.\n", iface, id, type, flags);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI video_processor_SetOutputType(IMFTransform *iface, DWORD id, IMFMediaType *type, DWORD flags)
+{
+ FIXME("%p, %u, %p, %#x.\n", iface, id, type, flags);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI video_processor_GetInputCurrentType(IMFTransform *iface, DWORD id, IMFMediaType **type)
+{
+ FIXME("%p, %u, %p.\n", iface, id, type);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI video_processor_GetOutputCurrentType(IMFTransform *iface, DWORD id, IMFMediaType **type)
+{
+ FIXME("%p, %u, %p.\n", iface, id, type);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI video_processor_GetInputStatus(IMFTransform *iface, DWORD id, DWORD *flags)
+{
+ FIXME("%p, %u, %p.\n", iface, id, flags);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI video_processor_GetOutputStatus(IMFTransform *iface, DWORD *flags)
+{
+ FIXME("%p, %p.\n", iface, flags);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI video_processor_SetOutputBounds(IMFTransform *iface, LONGLONG lower, LONGLONG upper)
+{
+ FIXME("%p, %s, %s.\n", iface, wine_dbgstr_longlong(lower), wine_dbgstr_longlong(upper));
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI video_processor_ProcessEvent(IMFTransform *iface, DWORD id, IMFMediaEvent *event)
+{
+ TRACE("%p, %u, %p.\n", iface, id, event);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI video_processor_ProcessMessage(IMFTransform *iface, MFT_MESSAGE_TYPE message, ULONG_PTR param)
+{
+ FIXME("%p, %u.\n", iface, message);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI video_processor_ProcessInput(IMFTransform *iface, DWORD id, IMFSample *sample, DWORD flags)
+{
+ FIXME("%p, %u, %p, %#x.\n", iface, id, sample, flags);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI video_processor_ProcessOutput(IMFTransform *iface, DWORD flags, DWORD count,
+ MFT_OUTPUT_DATA_BUFFER *samples, DWORD *status)
+{
+ FIXME("%p, %#x, %u, %p, %p.\n", iface, flags, count, samples, status);
+
+ return E_NOTIMPL;
+}
+
+static const IMFTransformVtbl video_processor_vtbl =
+{
+ video_processor_QueryInterface,
+ video_processor_AddRef,
+ video_processor_Release,
+ video_processor_GetStreamLimits,
+ video_processor_GetStreamCount,
+ video_processor_GetStreamIDs,
+ video_processor_GetInputStreamInfo,
+ video_processor_GetOutputStreamInfo,
+ video_processor_GetAttributes,
+ video_processor_GetInputStreamAttributes,
+ video_processor_GetOutputStreamAttributes,
+ video_processor_DeleteInputStream,
+ video_processor_AddInputStreams,
+ video_processor_GetInputAvailableType,
+ video_processor_GetOutputAvailableType,
+ video_processor_SetInputType,
+ video_processor_SetOutputType,
+ video_processor_GetInputCurrentType,
+ video_processor_GetOutputCurrentType,
+ video_processor_GetInputStatus,
+ video_processor_GetOutputStatus,
+ video_processor_SetOutputBounds,
+ video_processor_ProcessEvent,
+ video_processor_ProcessMessage,
+ video_processor_ProcessInput,
+ video_processor_ProcessOutput,
+};
+
+struct class_factory
+{
+ IClassFactory IClassFactory_iface;
+ LONG refcount;
+ HRESULT (*create_instance)(REFIID riid, void **obj);
+};
+
+static struct class_factory *impl_from_IClassFactory(IClassFactory *iface)
+{
+ return CONTAINING_RECORD(iface, struct class_factory, IClassFactory_iface);
+}
+
+static HRESULT WINAPI class_factory_QueryInterface(IClassFactory *iface, REFIID riid, void **obj)
+{
+ TRACE("%p, %s, %p.\n", iface, debugstr_guid(riid), obj);
+
+ if (IsEqualGUID(riid, &IID_IClassFactory) ||
+ IsEqualGUID(riid, &IID_IUnknown))
+ {
+ *obj = iface;
+ IClassFactory_AddRef(iface);
+ return S_OK;
+ }
+
+ WARN("%s is not supported.\n", debugstr_guid(riid));
+ *obj = NULL;
+ return E_NOINTERFACE;
+}
+
+static ULONG WINAPI class_factory_AddRef(IClassFactory *iface)
+{
+ struct class_factory *factory = impl_from_IClassFactory(iface);
+ return InterlockedIncrement(&factory->refcount);
+}
+
+static ULONG WINAPI class_factory_Release(IClassFactory *iface)
+{
+ struct class_factory *factory = impl_from_IClassFactory(iface);
+ ULONG refcount = InterlockedDecrement(&factory->refcount);
+
+ if (!refcount)
+ heap_free(factory);
+
+ return refcount;
+}
+
+static HRESULT WINAPI class_factory_CreateInstance(IClassFactory *iface, IUnknown *outer, REFIID riid, void **obj)
+{
+ struct class_factory *factory = impl_from_IClassFactory(iface);
+
+ TRACE("%p, %p, %s, %p.\n", iface, outer, debugstr_guid(riid), obj);
+
+ if (outer)
+ {
+ *obj = NULL;
+ return CLASS_E_NOAGGREGATION;
+ }
+
+ return factory->create_instance(riid, obj);
+}
+
+static HRESULT WINAPI class_factory_LockServer(IClassFactory *iface, BOOL dolock)
+{
+ TRACE("%p, %d.\n", iface, dolock);
+
+ if (dolock)
+ InterlockedIncrement(&object_locks);
+ else
+ InterlockedDecrement(&object_locks);
+
+ return S_OK;
+}
+
+static const IClassFactoryVtbl class_factory_vtbl =
+{
+ class_factory_QueryInterface,
+ class_factory_AddRef,
+ class_factory_Release,
+ class_factory_CreateInstance,
+ class_factory_LockServer,
+};
+
+static HRESULT video_processor_create(REFIID riid, void **ret)
+{
+ struct video_processor *object;
+ HRESULT hr;
+
+ if (!(object = heap_alloc_zero(sizeof(*object))))
+ return E_OUTOFMEMORY;
+
+ object->IMFTransform_iface.lpVtbl = &video_processor_vtbl;
+ object->refcount = 1;
+
+ if (FAILED(hr = MFCreateAttributes(&object->attributes, 0)))
+ goto failed;
+
+ if (FAILED(hr = MFCreateAttributes(&object->output_attributes, 0)))
+ goto failed;
+
+ *ret = &object->IMFTransform_iface;
+ return S_OK;
+
+failed:
+
+ IMFTransform_Release(&object->IMFTransform_iface);
+ return hr;
+}
+
+static const struct class_object
+{
+ const GUID *clsid;
+ HRESULT (*create_instance)(REFIID riid, void **obj);
+}
+class_objects[] =
+{
+ { &CLSID_VideoProcessorMFT, &video_processor_create },
+};
+
+HRESULT mfplat_get_class_object(REFCLSID rclsid, REFIID riid, void **obj)
+{
+ struct class_factory *factory;
+ unsigned int i;
+ HRESULT hr;
+
+ for (i = 0; i < ARRAY_SIZE(class_objects); ++i)
+ {
+ if (IsEqualGUID(class_objects[i].clsid, rclsid))
+ {
+ if (!(factory = heap_alloc(sizeof(*factory))))
+ return E_OUTOFMEMORY;
+
+ factory->IClassFactory_iface.lpVtbl = &class_factory_vtbl;
+ factory->refcount = 1;
+ factory->create_instance = class_objects[i].create_instance;
+
+ hr = IClassFactory_QueryInterface(&factory->IClassFactory_iface, riid, obj);
+ IClassFactory_Release(&factory->IClassFactory_iface);
+ return hr;
+ }
+ }
+
+ return CLASS_E_CLASSNOTAVAILABLE;
+}
+
+HRESULT mfplat_can_unload_now(void)
+{
+ return !object_locks ? S_OK : S_FALSE;
+}
diff --git a/dlls/winegstreamer/mfplat.idl b/dlls/winegstreamer/mfplat.idl
new file mode 100644
index 0000000000..05a75bdb8e
--- /dev/null
+++ b/dlls/winegstreamer/mfplat.idl
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2019 Nikolay Sivov for CodeWeavers
+ *
+ * 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
+ */
+
+#pragma makedep register
+
+[
+ threading(both),
+ uuid(88753b26-5b24-49bd-b2e7-0c445c78c982)
+
+]
+coclass VideoProcessorMFT { }
--
2.20.1
3
7
Signed-off-by: Hans Leidekker <hans(a)codeweavers.com>
---
dlls/wbemprox/class.c | 9 ++++++---
dlls/wbemprox/query.c | 2 ++
dlls/wbemprox/table.c | 6 +++++-
3 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/dlls/wbemprox/class.c b/dlls/wbemprox/class.c
index 6cb065b222..042ebebdcd 100644
--- a/dlls/wbemprox/class.c
+++ b/dlls/wbemprox/class.c
@@ -238,7 +238,7 @@ void destroy_array( struct array *array, CIMTYPE type )
UINT i, size;
if (!array) return;
- if (type == CIM_STRING || type == CIM_DATETIME)
+ if (type == CIM_STRING || type == CIM_DATETIME || type == CIM_REFERENCE)
{
size = get_type_size( type );
for (i = 0; i < array->count; i++) heap_free( *(WCHAR **)((char *)array->ptr + i * size) );
@@ -255,8 +255,9 @@ static void destroy_record( struct record *record )
release_table( record->table );
for (i = 0; i < record->count; i++)
{
- if (record->fields[i].type == CIM_STRING || record->fields[i].type == CIM_DATETIME)
- heap_free( record->fields[i].u.sval );
+ if (record->fields[i].type == CIM_STRING ||
+ record->fields[i].type == CIM_DATETIME ||
+ record->fields[i].type == CIM_REFERENCE) heap_free( record->fields[i].u.sval );
else if (record->fields[i].type & CIM_FLAG_ARRAY)
destroy_array( record->fields[i].u.aval, record->fields[i].type & CIM_TYPE_MASK );
}
@@ -357,6 +358,7 @@ static HRESULT record_get_value( const struct record *record, UINT index, VARIAN
{
case CIM_STRING:
case CIM_DATETIME:
+ case CIM_REFERENCE:
if (!vartype) vartype = VT_BSTR;
V_BSTR( var ) = SysAllocString( record->fields[index].u.sval );
break;
@@ -418,6 +420,7 @@ static HRESULT record_set_value( struct record *record, UINT index, VARIANT *var
{
case CIM_STRING:
case CIM_DATETIME:
+ case CIM_REFERENCE:
record->fields[index].u.sval = (WCHAR *)(INT_PTR)val;
return S_OK;
case CIM_SINT16:
diff --git a/dlls/wbemprox/query.c b/dlls/wbemprox/query.c
index f7b5163e0a..080329c14a 100644
--- a/dlls/wbemprox/query.c
+++ b/dlls/wbemprox/query.c
@@ -745,6 +745,7 @@ VARTYPE to_vartype( CIMTYPE type )
{
case CIM_BOOLEAN: return VT_BOOL;
case CIM_STRING:
+ case CIM_REFERENCE:
case CIM_DATETIME: return VT_BSTR;
case CIM_SINT8: return VT_I1;
case CIM_UINT8: return VT_UI1;
@@ -878,6 +879,7 @@ HRESULT get_propval( const struct view *view, UINT index, const WCHAR *name, VAR
if (!vartype) vartype = VT_BOOL;
break;
case CIM_STRING:
+ case CIM_REFERENCE:
case CIM_DATETIME:
if (val)
{
diff --git a/dlls/wbemprox/table.c b/dlls/wbemprox/table.c
index 261104b46e..79c7eb13a4 100644
--- a/dlls/wbemprox/table.c
+++ b/dlls/wbemprox/table.c
@@ -64,6 +64,7 @@ UINT get_type_size( CIMTYPE type )
case CIM_UINT64:
return sizeof(INT64);
case CIM_DATETIME:
+ case CIM_REFERENCE:
case CIM_STRING:
return sizeof(WCHAR *);
default:
@@ -110,6 +111,7 @@ HRESULT get_value( const struct table *table, UINT row, UINT column, LONGLONG *v
*val = *(const int *)ptr;
break;
case CIM_DATETIME:
+ case CIM_REFERENCE:
case CIM_STRING:
*val = (INT_PTR)*(const WCHAR **)ptr;
break;
@@ -173,6 +175,7 @@ BSTR get_value_bstr( const struct table *table, UINT row, UINT column )
else return SysAllocString( falseW );
case CIM_DATETIME:
+ case CIM_REFERENCE:
case CIM_STRING:
if (!val) return NULL;
len = lstrlenW( (const WCHAR *)(INT_PTR)val ) + 2;
@@ -220,6 +223,7 @@ HRESULT set_value( const struct table *table, UINT row, UINT column, LONGLONG va
switch (table->columns[column].type & COL_TYPE_MASK)
{
case CIM_DATETIME:
+ case CIM_REFERENCE:
case CIM_STRING:
*(WCHAR **)ptr = (WCHAR *)(INT_PTR)val;
break;
@@ -287,7 +291,7 @@ void free_row_values( const struct table *table, UINT row )
if (!(table->columns[i].type & COL_FLAG_DYNAMIC)) continue;
type = table->columns[i].type & COL_TYPE_MASK;
- if (type == CIM_STRING || type == CIM_DATETIME)
+ if (type == CIM_STRING || type == CIM_DATETIME || type == CIM_REFERENCE)
{
if (get_value( table, row, i, &val ) == S_OK) heap_free( (void *)(INT_PTR)val );
}
--
2.11.0
1
0
[PATCH] bcrypt: Ignore the size parameter in BCRYPT_CHAINING_MODE setters.
by Hans Leidekker 05 Jul '19
by Hans Leidekker 05 Jul '19
05 Jul '19
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47432
Signed-off-by: Hans Leidekker <hans(a)codeweavers.com>
---
dlls/bcrypt/bcrypt_main.c | 8 ++++----
dlls/bcrypt/gnutls.c | 8 ++++----
dlls/bcrypt/macos.c | 6 +++---
dlls/bcrypt/tests/bcrypt.c | 21 ++++++++++++++++++++-
4 files changed, 31 insertions(+), 12 deletions(-)
diff --git a/dlls/bcrypt/bcrypt_main.c b/dlls/bcrypt/bcrypt_main.c
index 3846341644..79660c1cf1 100644
--- a/dlls/bcrypt/bcrypt_main.c
+++ b/dlls/bcrypt/bcrypt_main.c
@@ -518,24 +518,24 @@ static NTSTATUS set_alg_property( struct algorithm *alg, const WCHAR *prop, UCHA
case ALG_ID_AES:
if (!strcmpW( prop, BCRYPT_CHAINING_MODE ))
{
- if (!strncmpW( (WCHAR *)value, BCRYPT_CHAIN_MODE_ECB, size ))
+ if (!strcmpW( (WCHAR *)value, BCRYPT_CHAIN_MODE_ECB ))
{
alg->mode = MODE_ID_ECB;
return STATUS_SUCCESS;
}
- else if (!strncmpW( (WCHAR *)value, BCRYPT_CHAIN_MODE_CBC, size ))
+ else if (!strcmpW( (WCHAR *)value, BCRYPT_CHAIN_MODE_CBC ))
{
alg->mode = MODE_ID_CBC;
return STATUS_SUCCESS;
}
- else if (!strncmpW( (WCHAR *)value, BCRYPT_CHAIN_MODE_GCM, size ))
+ else if (!strcmpW( (WCHAR *)value, BCRYPT_CHAIN_MODE_GCM ))
{
alg->mode = MODE_ID_GCM;
return STATUS_SUCCESS;
}
else
{
- FIXME( "unsupported mode %s\n", debugstr_wn( (WCHAR *)value, size ) );
+ FIXME( "unsupported mode %s\n", debugstr_w((WCHAR *)value) );
return STATUS_NOT_IMPLEMENTED;
}
}
diff --git a/dlls/bcrypt/gnutls.c b/dlls/bcrypt/gnutls.c
index 2a7e37ef8a..583a0e47e6 100644
--- a/dlls/bcrypt/gnutls.c
+++ b/dlls/bcrypt/gnutls.c
@@ -369,24 +369,24 @@ NTSTATUS key_set_property( struct key *key, const WCHAR *prop, UCHAR *value, ULO
{
if (!strcmpW( prop, BCRYPT_CHAINING_MODE ))
{
- if (!strncmpW( (WCHAR *)value, BCRYPT_CHAIN_MODE_ECB, size ))
+ if (!strcmpW( (WCHAR *)value, BCRYPT_CHAIN_MODE_ECB ))
{
key->u.s.mode = MODE_ID_ECB;
return STATUS_SUCCESS;
}
- else if (!strncmpW( (WCHAR *)value, BCRYPT_CHAIN_MODE_CBC, size ))
+ else if (!strcmpW( (WCHAR *)value, BCRYPT_CHAIN_MODE_CBC ))
{
key->u.s.mode = MODE_ID_CBC;
return STATUS_SUCCESS;
}
- else if (!strncmpW( (WCHAR *)value, BCRYPT_CHAIN_MODE_GCM, size ))
+ else if (!strcmpW( (WCHAR *)value, BCRYPT_CHAIN_MODE_GCM ))
{
key->u.s.mode = MODE_ID_GCM;
return STATUS_SUCCESS;
}
else
{
- FIXME( "unsupported mode %s\n", debugstr_wn( (WCHAR *)value, size ) );
+ FIXME( "unsupported mode %s\n", debugstr_w((WCHAR *)value) );
return STATUS_NOT_IMPLEMENTED;
}
}
diff --git a/dlls/bcrypt/macos.c b/dlls/bcrypt/macos.c
index cc99637c4b..df79f3e80d 100644
--- a/dlls/bcrypt/macos.c
+++ b/dlls/bcrypt/macos.c
@@ -48,19 +48,19 @@ NTSTATUS key_set_property( struct key *key, const WCHAR *prop, UCHAR *value, ULO
{
if (!strcmpW( prop, BCRYPT_CHAINING_MODE ))
{
- if (!strncmpW( (WCHAR *)value, BCRYPT_CHAIN_MODE_ECB, size ))
+ if (!strcmpW( (WCHAR *)value, BCRYPT_CHAIN_MODE_ECB ))
{
key->u.s.mode = MODE_ID_ECB;
return STATUS_SUCCESS;
}
- else if (!strncmpW( (WCHAR *)value, BCRYPT_CHAIN_MODE_CBC, size ))
+ else if (!strcmpW( (WCHAR *)value, BCRYPT_CHAIN_MODE_CBC ))
{
key->u.s.mode = MODE_ID_CBC;
return STATUS_SUCCESS;
}
else
{
- FIXME( "unsupported mode %s\n", debugstr_wn( (WCHAR *)value, size ) );
+ FIXME( "unsupported mode %s\n", debugstr_w((WCHAR *)value) );
return STATUS_NOT_IMPLEMENTED;
}
}
diff --git a/dlls/bcrypt/tests/bcrypt.c b/dlls/bcrypt/tests/bcrypt.c
index 11e274bc5f..b8678a520d 100644
--- a/dlls/bcrypt/tests/bcrypt.c
+++ b/dlls/bcrypt/tests/bcrypt.c
@@ -639,7 +639,7 @@ static void test_aes(void)
ok(key_lengths.dwIncrement == 64, "Expected 64, got %d\n", key_lengths.dwIncrement);
memcpy(mode, BCRYPT_CHAIN_MODE_GCM, sizeof(BCRYPT_CHAIN_MODE_GCM));
- ret = pBCryptSetProperty(alg, BCRYPT_CHAINING_MODE, mode, sizeof(mode), 0);
+ ret = pBCryptSetProperty(alg, BCRYPT_CHAINING_MODE, mode, 0, 0);
ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
size = 0;
@@ -694,6 +694,25 @@ static void test_BCryptGenerateSymmetricKey(void)
sizeof(BCRYPT_CHAIN_MODE_CBC), 0);
ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ size = 0;
+ memset(mode, 0, sizeof(mode));
+ ret = pBCryptGetProperty(key, BCRYPT_CHAINING_MODE, mode, sizeof(mode), &size, 0);
+ ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(!lstrcmpW((const WCHAR *)mode, BCRYPT_CHAIN_MODE_CBC), "got %s\n", wine_dbgstr_w((const WCHAR *)mode));
+ ok(size == 64, "got %u\n", size);
+
+ ret = pBCryptSetProperty(key, BCRYPT_CHAINING_MODE, (UCHAR *)BCRYPT_CHAIN_MODE_ECB, 0, 0);
+ ok(ret == STATUS_SUCCESS || broken(ret == STATUS_NOT_SUPPORTED) /* < Win 8 */, "got %08x\n", ret);
+ if (ret == STATUS_SUCCESS)
+ {
+ size = 0;
+ memset(mode, 0, sizeof(mode));
+ ret = pBCryptGetProperty(key, BCRYPT_CHAINING_MODE, mode, sizeof(mode), &size, 0);
+ ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(!lstrcmpW((const WCHAR *)mode, BCRYPT_CHAIN_MODE_ECB), "got %s\n", wine_dbgstr_w((const WCHAR *)mode));
+ ok(size == 64, "got %u\n", size);
+ }
+
ret = pBCryptSetProperty(key, BCRYPT_CHAINING_MODE, (UCHAR *)BCRYPT_CHAIN_MODE_CBC,
sizeof(BCRYPT_CHAIN_MODE_CBC), 0);
ok(ret == STATUS_SUCCESS || broken(ret == STATUS_NOT_SUPPORTED) /* < Win 8 */, "got %08x\n", ret);
--
2.20.1
1
0
Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru>
---
configure.ac | 1 +
dlls/cryptext/Makefile.in | 3 +-
dlls/cryptext/cryptext.spec | 4 +--
dlls/cryptext/cryptext_main.c | 64 +++++++++++++++++++++++++++++++++
dlls/cryptext/tests/Makefile.in | 4 +++
dlls/cryptext/tests/cryptext.c | 61 +++++++++++++++++++++++++++++++
6 files changed, 134 insertions(+), 3 deletions(-)
create mode 100644 dlls/cryptext/tests/Makefile.in
create mode 100644 dlls/cryptext/tests/cryptext.c
diff --git a/configure.ac b/configure.ac
index a7c45ace73..e801c35c46 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3049,6 +3049,7 @@ WINE_CONFIG_MAKEFILE(dlls/crypt32/tests)
WINE_CONFIG_MAKEFILE(dlls/cryptdlg)
WINE_CONFIG_MAKEFILE(dlls/cryptdll)
WINE_CONFIG_MAKEFILE(dlls/cryptext)
+WINE_CONFIG_MAKEFILE(dlls/cryptext/tests)
WINE_CONFIG_MAKEFILE(dlls/cryptnet)
WINE_CONFIG_MAKEFILE(dlls/cryptnet/tests)
WINE_CONFIG_MAKEFILE(dlls/cryptui)
diff --git a/dlls/cryptext/Makefile.in b/dlls/cryptext/Makefile.in
index 9c9f84cee8..0e817ffda6 100644
--- a/dlls/cryptext/Makefile.in
+++ b/dlls/cryptext/Makefile.in
@@ -1,4 +1,5 @@
-MODULE = cryptext.dll
+MODULE = cryptext.dll
+IMPORTS = crypt32 cryptui user32
EXTRADLLFLAGS = -mno-cygwin
diff --git a/dlls/cryptext/cryptext.spec b/dlls/cryptext/cryptext.spec
index 0dba38e393..911ab2f4ba 100644
--- a/dlls/cryptext/cryptext.spec
+++ b/dlls/cryptext/cryptext.spec
@@ -12,8 +12,8 @@
@ stub CryptExtAddSPCW
@ stub CryptExtOpenCAT
@ stub CryptExtOpenCATW
-@ stub CryptExtOpenCER
-@ stub CryptExtOpenCERW
+@ stdcall CryptExtOpenCER(long ptr str long)
+@ stdcall CryptExtOpenCERW(long ptr wstr long)
@ stub CryptExtOpenCRL
@ stub CryptExtOpenCRLW
@ stub CryptExtOpenCTL
diff --git a/dlls/cryptext/cryptext_main.c b/dlls/cryptext/cryptext_main.c
index f7c7bd1f55..2a381782d6 100644
--- a/dlls/cryptext/cryptext_main.c
+++ b/dlls/cryptext/cryptext_main.c
@@ -22,10 +22,29 @@
#include "windef.h"
#include "winbase.h"
+#include "winnls.h"
+#include "wincrypt.h"
+#include "winuser.h"
+#include "cryptuiapi.h"
+
+#include "wine/heap.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(cryptext);
+static WCHAR *heap_strdupAtoW(const char *str)
+{
+ WCHAR *ret;
+ INT len;
+
+ if (!str) return NULL;
+ len = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0);
+ ret = heap_alloc(len * sizeof(WCHAR));
+ if (ret)
+ MultiByteToWideChar(CP_ACP, 0, str, -1, ret, len);
+ return ret;
+}
+
BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, LPVOID reserved)
{
TRACE("(%p, %u, %p)\n", instance, reason, reserved);
@@ -59,3 +78,48 @@ HRESULT WINAPI CryptExtAddPFXW(LPCWSTR filename)
FIXME("stub: %s\n", debugstr_w(filename));
return E_NOTIMPL;
}
+
+/***********************************************************************
+ * CryptExtOpenCERW (CRYPTEXT.@)
+ */
+HRESULT WINAPI CryptExtOpenCERW(HWND hwnd, HINSTANCE hinst, LPCWSTR filename, DWORD showcmd)
+{
+ PCCERT_CONTEXT ctx;
+ CRYPTUI_VIEWCERTIFICATE_STRUCTW info;
+
+ TRACE("(%p, %p, %s, %u)\n", hwnd, hinst, debugstr_w(filename), showcmd);
+
+ if (!CryptQueryObject(CERT_QUERY_OBJECT_FILE, filename, CERT_QUERY_CONTENT_FLAG_CERT,
+ CERT_QUERY_FORMAT_FLAG_ALL, 0, NULL, NULL, NULL, NULL, NULL,
+ (const void **)&ctx))
+ {
+ /* FIXME: move to the resources */
+ static const WCHAR msg[] = {'T','h','i','s',' ','i','s',' ','n','o','t',' ','a',' ','v','a','l','i','d',' ','c','e','r','t','i','f','i','c','a','t','e',0};
+ MessageBoxW(NULL, msg, filename, MB_OK | MB_ICONERROR);
+ return S_OK; /* according to the tests */
+ }
+
+ memset(&info, 0, sizeof(info));
+ info.dwSize = sizeof(info);
+ info.pCertContext = ctx;
+ CryptUIDlgViewCertificateW(&info, NULL);
+ CertFreeCertificateContext(ctx);
+
+ return S_OK;
+}
+
+/***********************************************************************
+ * CryptExtOpenCER (CRYPTEXT.@)
+ */
+HRESULT WINAPI CryptExtOpenCER(HWND hwnd, HINSTANCE hinst, LPCSTR filename, DWORD showcmd)
+{
+ HRESULT hr;
+ LPWSTR filenameW;
+
+ TRACE("(%p, %p, %s, %u)\n", hwnd, hinst, debugstr_a(filename), showcmd);
+
+ filenameW = heap_strdupAtoW(filename);
+ hr = CryptExtOpenCERW(hwnd, hinst, filenameW, showcmd);
+ heap_free(filenameW);
+ return hr;
+}
diff --git a/dlls/cryptext/tests/Makefile.in b/dlls/cryptext/tests/Makefile.in
new file mode 100644
index 0000000000..522fc60a4a
--- /dev/null
+++ b/dlls/cryptext/tests/Makefile.in
@@ -0,0 +1,4 @@
+TESTDLL = cryptext.dll
+
+C_SRCS = \
+ cryptext.c
diff --git a/dlls/cryptext/tests/cryptext.c b/dlls/cryptext/tests/cryptext.c
new file mode 100644
index 0000000000..cc62a772b5
--- /dev/null
+++ b/dlls/cryptext/tests/cryptext.c
@@ -0,0 +1,61 @@
+/*
+ * Copyright 2019 Dmitry Timoshkov
+ *
+ * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include <stdarg.h>
+#include <assert.h>
+#include <windef.h>
+#include <winbase.h>
+#include <winuser.h>
+#include <winerror.h>
+
+#include "wine/test.h"
+
+static HRESULT (WINAPI *pCryptExtOpenCER)(HWND,HINSTANCE,LPCSTR,DWORD);
+
+static void test_CryptExtOpenCER(void)
+{
+ HRESULT hr;
+
+ if (!pCryptExtOpenCER)
+ {
+ win_skip("CryptExtOpenCER is not available on this platform\n");
+ return;
+ }
+
+ if (!winetest_interactive)
+ {
+ skip("CryptExtOpenCER test needs user interaction\n");
+ return;
+ }
+
+ SetLastError(0xdeadbeef);
+ hr = pCryptExtOpenCER(0, 0, "dead.beef", SW_HIDE);
+ ok(hr == S_OK, "got %#x\n", hr);
+
+ hr = pCryptExtOpenCER(0, 0, "VeriSign Class 3 Public Primary Certification Authority - G4.txt", SW_SHOW);
+ ok(hr == S_OK, "got %#x\n", hr);
+}
+
+START_TEST(cryptext)
+{
+ HMODULE hmod = LoadLibraryA("cryptext.dll");
+
+ pCryptExtOpenCER = (void *)GetProcAddress(hmod, "CryptExtOpenCER");
+
+ test_CryptExtOpenCER();
+}
--
2.20.1
1
0
[PATCH v2 5/5] winex11.drv: Implement X11DRV_D3DKMTCheckVidPnExclusiveOwnership.
by Zhiyi Zhang 04 Jul '19
by Zhiyi Zhang 04 Jul '19
04 Jul '19
Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com>
---
dlls/dxgi/tests/dxgi.c | 10 +++++++---
dlls/gdi32/tests/driver.c | 2 +-
dlls/winex11.drv/init.c | 2 +-
dlls/winex11.drv/x11drv.h | 1 +
dlls/winex11.drv/x11drv_main.c | 25 +++++++++++++++++++++++++
5 files changed, 35 insertions(+), 5 deletions(-)
diff --git a/dlls/dxgi/tests/dxgi.c b/dlls/dxgi/tests/dxgi.c
index d8176bb1c0..ab65725ccf 100644
--- a/dlls/dxgi/tests/dxgi.c
+++ b/dlls/dxgi/tests/dxgi.c
@@ -731,7 +731,6 @@ static IDXGIAdapter *get_adapter_(unsigned int line, IUnknown *device, BOOL is_d
hr = IDXGIFactory_QueryInterface(factory, &IID_IDXGIFactory4, (void **)&factory4);
ok_(__FILE__, line)(hr == S_OK, "Got unexpected hr %#x.\n", hr);
hr = IDXGIFactory4_EnumAdapterByLuid(factory4, luid, &IID_IDXGIAdapter, (void **)&adapter);
- ok_(__FILE__, line)(hr == S_OK, "Got unexpected hr %#x.\n", hr);
IDXGIFactory4_Release(factory4);
IDXGIFactory_Release(factory);
}
@@ -5497,13 +5496,18 @@ static void test_output_ownership(IUnknown *device, BOOL is_d3d12)
if (!pD3DKMTCheckVidPnExclusiveOwnership
|| pD3DKMTCheckVidPnExclusiveOwnership(NULL) == STATUS_PROCEDURE_NOT_FOUND)
{
- skip("D3DKMTCheckVidPnExclusiveOwnership() is unavailable.\n");
+ win_skip("D3DKMTCheckVidPnExclusiveOwnership() is unavailable.\n");
return;
}
get_factory(device, is_d3d12, &factory);
adapter = get_adapter(device, is_d3d12);
- ok(!!adapter, "Failed to get adapter.\n");
+ if (!adapter)
+ {
+ skip("Failed to get adapter on Direct3D %d.\n", is_d3d12 ? 12 : 10);
+ IDXGIFactory_Release(factory);
+ return;
+ }
hr = IDXGIAdapter_EnumOutputs(adapter, 0, &output);
IDXGIAdapter_Release(adapter);
diff --git a/dlls/gdi32/tests/driver.c b/dlls/gdi32/tests/driver.c
index 2ea43e3025..ed83a72813 100644
--- a/dlls/gdi32/tests/driver.c
+++ b/dlls/gdi32/tests/driver.c
@@ -376,7 +376,7 @@ static void test_D3DKMTCheckVidPnExclusiveOwnership(void)
if (!pD3DKMTCheckVidPnExclusiveOwnership || pD3DKMTCheckVidPnExclusiveOwnership(NULL) == STATUS_PROCEDURE_NOT_FOUND)
{
- skip("D3DKMTCheckVidPnExclusiveOwnership() is unavailable.\n");
+ win_skip("D3DKMTCheckVidPnExclusiveOwnership() is unavailable.\n");
return;
}
diff --git a/dlls/winex11.drv/init.c b/dlls/winex11.drv/init.c
index 66e6e7f09a..531bff0fdb 100644
--- a/dlls/winex11.drv/init.c
+++ b/dlls/winex11.drv/init.c
@@ -471,7 +471,7 @@ static const struct gdi_dc_funcs x11drv_funcs =
X11DRV_StrokePath, /* pStrokePath */
X11DRV_UnrealizePalette, /* pUnrealizePalette */
NULL, /* pWidenPath */
- NULL, /* pD3DKMTCheckVidPnExclusiveOwnership */
+ X11DRV_D3DKMTCheckVidPnExclusiveOwnership, /* pD3DKMTCheckVidPnExclusiveOwnership */
X11DRV_D3DKMTSetVidPnSourceOwner, /* pD3DKMTSetVidPnSourceOwner */
X11DRV_wine_get_wgl_driver, /* wine_get_wgl_driver */
X11DRV_wine_get_vulkan_driver, /* wine_get_vulkan_driver */
diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h
index d96a19f2e6..6ebf5db247 100644
--- a/dlls/winex11.drv/x11drv.h
+++ b/dlls/winex11.drv/x11drv.h
@@ -150,6 +150,7 @@ extern BOOL X11DRV_Arc( PHYSDEV dev, INT left, INT top, INT right,
extern BOOL X11DRV_Chord( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
INT xstart, INT ystart, INT xend, INT yend ) DECLSPEC_HIDDEN;
extern NTSTATUS X11DRV_D3DKMTSetVidPnSourceOwner( const D3DKMT_SETVIDPNSOURCEOWNER *desc ) DECLSPEC_HIDDEN;
+extern NTSTATUS X11DRV_D3DKMTCheckVidPnExclusiveOwnership( const D3DKMT_CHECKVIDPNEXCLUSIVEOWNERSHIP *desc ) DECLSPEC_HIDDEN;
extern BOOL X11DRV_Ellipse( PHYSDEV dev, INT left, INT top, INT right, INT bottom ) DECLSPEC_HIDDEN;
extern INT X11DRV_EnumICMProfiles( PHYSDEV dev, ICMENUMPROCW proc, LPARAM lparam ) DECLSPEC_HIDDEN;
extern BOOL X11DRV_ExtFloodFill( PHYSDEV dev, INT x, INT y, COLORREF color, UINT fillType ) DECLSPEC_HIDDEN;
diff --git a/dlls/winex11.drv/x11drv_main.c b/dlls/winex11.drv/x11drv_main.c
index ef973f3e48..c9b202ad0e 100644
--- a/dlls/winex11.drv/x11drv_main.c
+++ b/dlls/winex11.drv/x11drv_main.c
@@ -877,3 +877,28 @@ done:
LeaveCriticalSection( &x11drv_section );
return status;
}
+
+/**********************************************************************
+ * X11DRV_D3DKMTCheckVidPnExclusiveOwnership
+ */
+NTSTATUS X11DRV_D3DKMTCheckVidPnExclusiveOwnership( const D3DKMT_CHECKVIDPNEXCLUSIVEOWNERSHIP *desc )
+{
+ struct d3dkmt_vidpn_source *source;
+
+ TRACE("(%p)\n", desc);
+
+ if (!desc || !desc->hAdapter)
+ return STATUS_INVALID_PARAMETER;
+
+ EnterCriticalSection( &x11drv_section );
+ LIST_FOR_EACH_ENTRY( source, &d3dkmt_vidpn_sources, struct d3dkmt_vidpn_source, entry )
+ {
+ if (source->id == desc->VidPnSourceId && source->type == D3DKMT_VIDPNSOURCEOWNER_EXCLUSIVE)
+ {
+ LeaveCriticalSection( &x11drv_section );
+ return STATUS_GRAPHICS_PRESENT_OCCLUDED;
+ }
+ }
+ LeaveCriticalSection( &x11drv_section );
+ return STATUS_SUCCESS;
+}
--
2.20.1
2
1
04 Jul '19
Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com>
---
dlls/gdi32/tests/driver.c | 2 +-
dlls/winex11.drv/init.c | 2 +-
dlls/winex11.drv/x11drv.h | 1 +
dlls/winex11.drv/x11drv_main.c | 138 +++++++++++++++++++++++++++++++++
4 files changed, 141 insertions(+), 2 deletions(-)
diff --git a/dlls/gdi32/tests/driver.c b/dlls/gdi32/tests/driver.c
index b5f6f75a83..2ea43e3025 100644
--- a/dlls/gdi32/tests/driver.c
+++ b/dlls/gdi32/tests/driver.c
@@ -600,7 +600,7 @@ static void test_D3DKMTSetVidPnSourceOwner(void)
if (!pD3DKMTSetVidPnSourceOwner || pD3DKMTSetVidPnSourceOwner(&set_owner_desc) == STATUS_PROCEDURE_NOT_FOUND)
{
- skip("D3DKMTSetVidPnSourceOwner() is unavailable.\n");
+ win_skip("D3DKMTSetVidPnSourceOwner() is unavailable.\n");
return;
}
diff --git a/dlls/winex11.drv/init.c b/dlls/winex11.drv/init.c
index 49d334ef62..66e6e7f09a 100644
--- a/dlls/winex11.drv/init.c
+++ b/dlls/winex11.drv/init.c
@@ -472,7 +472,7 @@ static const struct gdi_dc_funcs x11drv_funcs =
X11DRV_UnrealizePalette, /* pUnrealizePalette */
NULL, /* pWidenPath */
NULL, /* pD3DKMTCheckVidPnExclusiveOwnership */
- NULL, /* pD3DKMTSetVidPnSourceOwner */
+ X11DRV_D3DKMTSetVidPnSourceOwner, /* pD3DKMTSetVidPnSourceOwner */
X11DRV_wine_get_wgl_driver, /* wine_get_wgl_driver */
X11DRV_wine_get_vulkan_driver, /* wine_get_vulkan_driver */
GDI_PRIORITY_GRAPHICS_DRV /* priority */
diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h
index 9ab948f724..d96a19f2e6 100644
--- a/dlls/winex11.drv/x11drv.h
+++ b/dlls/winex11.drv/x11drv.h
@@ -149,6 +149,7 @@ extern BOOL X11DRV_Arc( PHYSDEV dev, INT left, INT top, INT right,
INT bottom, INT xstart, INT ystart, INT xend, INT yend ) DECLSPEC_HIDDEN;
extern BOOL X11DRV_Chord( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
INT xstart, INT ystart, INT xend, INT yend ) DECLSPEC_HIDDEN;
+extern NTSTATUS X11DRV_D3DKMTSetVidPnSourceOwner( const D3DKMT_SETVIDPNSOURCEOWNER *desc ) DECLSPEC_HIDDEN;
extern BOOL X11DRV_Ellipse( PHYSDEV dev, INT left, INT top, INT right, INT bottom ) DECLSPEC_HIDDEN;
extern INT X11DRV_EnumICMProfiles( PHYSDEV dev, ICMENUMPROCW proc, LPARAM lparam ) DECLSPEC_HIDDEN;
extern BOOL X11DRV_ExtFloodFill( PHYSDEV dev, INT x, INT y, COLORREF color, UINT fillType ) DECLSPEC_HIDDEN;
diff --git a/dlls/winex11.drv/x11drv_main.c b/dlls/winex11.drv/x11drv_main.c
index 21807af3f1..ef973f3e48 100644
--- a/dlls/winex11.drv/x11drv_main.c
+++ b/dlls/winex11.drv/x11drv_main.c
@@ -42,6 +42,8 @@
#include <X11/extensions/Xrender.h>
#endif
+#include "ntstatus.h"
+#define WIN32_NO_STATUS
#include "windef.h"
#include "winbase.h"
#include "winreg.h"
@@ -52,6 +54,8 @@
#include "wine/unicode.h"
#include "wine/debug.h"
#include "wine/library.h"
+#include "wine/list.h"
+#include "wine/heap.h"
WINE_DEFAULT_DEBUG_CHANNEL(x11drv);
WINE_DECLARE_DEBUG_CHANNEL(synchronous);
@@ -96,6 +100,25 @@ static int (*old_error_handler)( Display *, XErrorEvent * );
static BOOL use_xim = TRUE;
static char input_style[20];
+static CRITICAL_SECTION x11drv_section;
+static CRITICAL_SECTION_DEBUG critsect_debug =
+{
+ 0, 0, &x11drv_section,
+ { &critsect_debug.ProcessLocksList, &critsect_debug.ProcessLocksList },
+ 0, 0, { (DWORD_PTR)(__FILE__ ": x11drv_section") }
+};
+static CRITICAL_SECTION x11drv_section = { &critsect_debug, -1, 0, 0, 0, 0 };
+
+struct d3dkmt_vidpn_source
+{
+ D3DKMT_VIDPNSOURCEOWNER_TYPE type; /* VidPN source owner type */
+ D3DDDI_VIDEO_PRESENT_SOURCE_ID id; /* VidPN present source id */
+ D3DKMT_HANDLE device; /* Kernel mode device context */
+ struct list entry; /* List entry */
+};
+
+static struct list d3dkmt_vidpn_sources = LIST_INIT( d3dkmt_vidpn_sources ); /* VidPN source information list */
+
#define IS_OPTION_TRUE(ch) \
((ch) == 'y' || (ch) == 'Y' || (ch) == 't' || (ch) == 'T' || (ch) == '1')
#define IS_OPTION_FALSE(ch) \
@@ -739,3 +762,118 @@ BOOL CDECL X11DRV_SystemParametersInfo( UINT action, UINT int_param, void *ptr_p
}
return FALSE; /* let user32 handle it */
}
+
+/**********************************************************************
+ * X11DRV_D3DKMTSetVidPnSourceOwner
+ */
+NTSTATUS X11DRV_D3DKMTSetVidPnSourceOwner( const D3DKMT_SETVIDPNSOURCEOWNER *desc )
+{
+ struct d3dkmt_vidpn_source *source, *source2;
+ NTSTATUS status = STATUS_SUCCESS;
+ BOOL found;
+ UINT i;
+
+ TRACE("(%p)\n", desc);
+
+ EnterCriticalSection( &x11drv_section );
+
+ /* Check parameters */
+ for (i = 0; i < desc->VidPnSourceCount; ++i)
+ {
+ LIST_FOR_EACH_ENTRY( source, &d3dkmt_vidpn_sources, struct d3dkmt_vidpn_source, entry )
+ {
+ if (source->id == desc->pVidPnSourceId[i])
+ {
+ /* Same device */
+ if (source->device == desc->hDevice)
+ {
+ if ((source->type == D3DKMT_VIDPNSOURCEOWNER_EXCLUSIVE
+ && (desc->pType[i] == D3DKMT_VIDPNSOURCEOWNER_SHARED
+ || desc->pType[i] == D3DKMT_VIDPNSOURCEOWNER_EMULATED))
+ || (source->type == D3DKMT_VIDPNSOURCEOWNER_EMULATED
+ && desc->pType[i] == D3DKMT_VIDPNSOURCEOWNER_EXCLUSIVE))
+ {
+ status = STATUS_INVALID_PARAMETER;
+ goto done;
+ }
+ }
+ /* Different devices */
+ else
+ {
+ if ((source->type == D3DKMT_VIDPNSOURCEOWNER_EXCLUSIVE
+ || source->type == D3DKMT_VIDPNSOURCEOWNER_EMULATED)
+ && (desc->pType[i] == D3DKMT_VIDPNSOURCEOWNER_EXCLUSIVE
+ || desc->pType[i] == D3DKMT_VIDPNSOURCEOWNER_EMULATED))
+ {
+ status = STATUS_GRAPHICS_VIDPN_SOURCE_IN_USE;
+ goto done;
+ }
+ }
+ }
+ }
+
+ /* On Windows, it seems that all video present sources are owned by DMM clients, so any attempt to set
+ * D3DKMT_VIDPNSOURCEOWNER_SHARED come back STATUS_GRAPHICS_VIDPN_SOURCE_IN_USE */
+ if (desc->pType[i] == D3DKMT_VIDPNSOURCEOWNER_SHARED)
+ {
+ status = STATUS_GRAPHICS_VIDPN_SOURCE_IN_USE;
+ goto done;
+ }
+
+ /* FIXME: D3DKMT_VIDPNSOURCEOWNER_EXCLUSIVEGDI unsupported */
+ if (desc->pType[i] == D3DKMT_VIDPNSOURCEOWNER_EXCLUSIVEGDI || desc->pType[i] > D3DKMT_VIDPNSOURCEOWNER_EMULATED)
+ {
+ status = STATUS_INVALID_PARAMETER;
+ goto done;
+ }
+ }
+
+ /* Remove owner */
+ if (!desc->VidPnSourceCount && !desc->pType && !desc->pVidPnSourceId)
+ {
+ LIST_FOR_EACH_ENTRY_SAFE( source, source2, &d3dkmt_vidpn_sources, struct d3dkmt_vidpn_source, entry )
+ {
+ if (source->device == desc->hDevice)
+ {
+ list_remove( &source->entry );
+ heap_free( source );
+ }
+ }
+ goto done;
+ }
+
+ /* Add owner */
+ for (i = 0; i < desc->VidPnSourceCount; ++i)
+ {
+ found = FALSE;
+ LIST_FOR_EACH_ENTRY( source, &d3dkmt_vidpn_sources, struct d3dkmt_vidpn_source, entry )
+ {
+ if (source->device == desc->hDevice && source->id == desc->pVidPnSourceId[i])
+ {
+ found = TRUE;
+ break;
+ }
+ }
+
+ if (found)
+ source->type = desc->pType[i];
+ else
+ {
+ source = heap_alloc( sizeof( *source ) );
+ if (!source)
+ {
+ status = STATUS_NO_MEMORY;
+ goto done;
+ }
+
+ source->id = desc->pVidPnSourceId[i];
+ source->type = desc->pType[i];
+ source->device = desc->hDevice;
+ list_add_tail( &d3dkmt_vidpn_sources, &source->entry );
+ }
+ }
+
+done:
+ LeaveCriticalSection( &x11drv_section );
+ return status;
+}
--
2.20.1
2
1
04 Jul '19
Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com>
---
.../api-ms-win-dx-d3dkmt-l1-1-0.spec | 2 +-
dlls/d3d11/d3d11.spec | 1 +
dlls/gdi32/dibdrv/dc.c | 2 ++
dlls/gdi32/driver.c | 22 +++++++++++++++++++
dlls/gdi32/enhmfdrv/dc.c | 1 +
dlls/gdi32/enhmfdrv/init.c | 1 +
dlls/gdi32/freetype.c | 1 +
dlls/gdi32/gdi32.spec | 1 +
dlls/gdi32/mfdrv/init.c | 1 +
dlls/gdi32/path.c | 1 +
dlls/wineandroid.drv/init.c | 1 +
dlls/winemac.drv/gdi.c | 1 +
dlls/wineps.drv/init.c | 1 +
dlls/winex11.drv/init.c | 1 +
dlls/winex11.drv/xrender.c | 1 +
include/ddk/d3dkmthk.h | 1 +
include/wine/gdi_driver.h | 3 ++-
17 files changed, 40 insertions(+), 2 deletions(-)
diff --git a/dlls/api-ms-win-dx-d3dkmt-l1-1-0/api-ms-win-dx-d3dkmt-l1-1-0.spec b/dlls/api-ms-win-dx-d3dkmt-l1-1-0/api-ms-win-dx-d3dkmt-l1-1-0.spec
index c14ebc68e9..0f68d777f0 100644
--- a/dlls/api-ms-win-dx-d3dkmt-l1-1-0/api-ms-win-dx-d3dkmt-l1-1-0.spec
+++ b/dlls/api-ms-win-dx-d3dkmt-l1-1-0/api-ms-win-dx-d3dkmt-l1-1-0.spec
@@ -5,7 +5,7 @@
@ stub D3DKMTCheckMonitorPowerState
@ stub D3DKMTCheckOcclusion
@ stub D3DKMTCheckSharedResourceAccess
-@ stub D3DKMTCheckVidPnExclusiveOwnership
+@ stdcall D3DKMTCheckVidPnExclusiveOwnership(ptr) gdi32.D3DKMTCheckVidPnExclusiveOwnership
@ stdcall D3DKMTCloseAdapter(ptr) gdi32.D3DKMTCloseAdapter
@ stub D3DKMTConfigureSharedResource
@ stub D3DKMTCreateAllocation
diff --git a/dlls/d3d11/d3d11.spec b/dlls/d3d11/d3d11.spec
index 606ddae3e3..383ed6aa9c 100644
--- a/dlls/d3d11/d3d11.spec
+++ b/dlls/d3d11/d3d11.spec
@@ -5,6 +5,7 @@
@ stdcall D3D11CreateDevice(ptr long ptr long ptr long long ptr ptr ptr)
@ stdcall D3D11CreateDeviceAndSwapChain(ptr long ptr long ptr long long ptr ptr ptr ptr ptr)
@ stdcall D3D11On12CreateDevice(ptr long ptr long ptr long long ptr ptr ptr)
+@ stdcall D3DKMTCheckVidPnExclusiveOwnership(ptr) gdi32.D3DKMTCheckVidPnExclusiveOwnership
@ stdcall D3DKMTCloseAdapter(ptr) gdi32.D3DKMTCloseAdapter
@ stub D3DKMTCreateAllocation
@ stub D3DKMTCreateContext
diff --git a/dlls/gdi32/dibdrv/dc.c b/dlls/gdi32/dibdrv/dc.c
index 10c3fc6f69..fe1ef1e0fc 100644
--- a/dlls/gdi32/dibdrv/dc.c
+++ b/dlls/gdi32/dibdrv/dc.c
@@ -520,6 +520,7 @@ const struct gdi_dc_funcs dib_driver =
dibdrv_StrokePath, /* pStrokePath */
NULL, /* pUnrealizePalette */
NULL, /* pWidenPath */
+ NULL, /* pD3DKMTCheckVidPnExclusiveOwnership */
NULL, /* pD3DKMTSetVidPnSourceOwner */
dibdrv_wine_get_wgl_driver, /* wine_get_wgl_driver */
NULL, /* wine_get_vulkan_driver */
@@ -1144,6 +1145,7 @@ static const struct gdi_dc_funcs window_driver =
NULL, /* pStrokePath */
NULL, /* pUnrealizePalette */
NULL, /* pWidenPath */
+ NULL, /* pD3DKMTCheckVidPnExclusiveOwnership */
NULL, /* pD3DKMTSetVidPnSourceOwner */
windrv_wine_get_wgl_driver, /* wine_get_wgl_driver */
NULL, /* wine_get_vulkan_driver */
diff --git a/dlls/gdi32/driver.c b/dlls/gdi32/driver.c
index 71a52ed9fc..9da7ba1734 100644
--- a/dlls/gdi32/driver.c
+++ b/dlls/gdi32/driver.c
@@ -753,6 +753,11 @@ static BOOL nulldrv_UnrealizePalette( HPALETTE palette )
return FALSE;
}
+static NTSTATUS WINAPI nulldrv_D3DKMTCheckVidPnExclusiveOwnership( const D3DKMT_CHECKVIDPNEXCLUSIVEOWNERSHIP *desc )
+{
+ return STATUS_PROCEDURE_NOT_FOUND;
+}
+
static NTSTATUS WINAPI nulldrv_D3DKMTSetVidPnSourceOwner( const D3DKMT_SETVIDPNSOURCEOWNER *desc )
{
return STATUS_PROCEDURE_NOT_FOUND;
@@ -897,6 +902,7 @@ const struct gdi_dc_funcs null_driver =
nulldrv_StrokePath, /* pStrokePath */
nulldrv_UnrealizePalette, /* pUnrealizePalette */
nulldrv_WidenPath, /* pWidenPath */
+ nulldrv_D3DKMTCheckVidPnExclusiveOwnership, /* pD3DKMTCheckVidPnExclusiveOwnership */
nulldrv_D3DKMTSetVidPnSourceOwner, /* pD3DKMTSetVidPnSourceOwner */
nulldrv_wine_get_wgl_driver, /* wine_get_wgl_driver */
nulldrv_wine_get_vulkan_driver, /* wine_get_vulkan_driver */
@@ -1473,3 +1479,19 @@ NTSTATUS WINAPI D3DKMTSetVidPnSourceOwner( const D3DKMT_SETVIDPNSOURCEOWNER *des
* released before showing the new window */
return get_display_driver()->pD3DKMTSetVidPnSourceOwner( desc );
}
+
+/******************************************************************************
+ * D3DKMTCheckVidPnExclusiveOwnership [GDI32.@]
+ */
+NTSTATUS WINAPI D3DKMTCheckVidPnExclusiveOwnership( const D3DKMT_CHECKVIDPNEXCLUSIVEOWNERSHIP *desc )
+{
+ TRACE("(%p)\n", desc);
+
+ if (!get_display_driver()->pD3DKMTCheckVidPnExclusiveOwnership)
+ return STATUS_PROCEDURE_NOT_FOUND;
+
+ if (!desc || !desc->hAdapter)
+ return STATUS_INVALID_PARAMETER;
+
+ return get_display_driver()->pD3DKMTCheckVidPnExclusiveOwnership( desc );
+}
diff --git a/dlls/gdi32/enhmfdrv/dc.c b/dlls/gdi32/enhmfdrv/dc.c
index 80e54685c7..450f80f6ba 100644
--- a/dlls/gdi32/enhmfdrv/dc.c
+++ b/dlls/gdi32/enhmfdrv/dc.c
@@ -950,6 +950,7 @@ static const struct gdi_dc_funcs emfpath_driver =
NULL, /* pStrokePath */
NULL, /* pUnrealizePalette */
NULL, /* pWidenPath */
+ NULL, /* pD3DKMTCheckVidPnExclusiveOwnership */
NULL, /* pD3DKMTSetVidPnSourceOwner */
NULL, /* wine_get_wgl_driver */
NULL, /* wine_get_vulkan_driver */
diff --git a/dlls/gdi32/enhmfdrv/init.c b/dlls/gdi32/enhmfdrv/init.c
index 6938e45cbd..d13f3b2b9d 100644
--- a/dlls/gdi32/enhmfdrv/init.c
+++ b/dlls/gdi32/enhmfdrv/init.c
@@ -163,6 +163,7 @@ static const struct gdi_dc_funcs emfdrv_driver =
EMFDRV_StrokePath, /* pStrokePath */
NULL, /* pUnrealizePalette */
EMFDRV_WidenPath, /* pWidenPath */
+ NULL, /* pD3DKMTCheckVidPnExclusiveOwnership */
NULL, /* pD3DKMTSetVidPnSourceOwner */
NULL, /* wine_get_wgl_driver */
NULL, /* wine_get_vulkan_driver */
diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c
index b571611c13..dceb1fae38 100644
--- a/dlls/gdi32/freetype.c
+++ b/dlls/gdi32/freetype.c
@@ -9236,6 +9236,7 @@ static const struct gdi_dc_funcs freetype_funcs =
NULL, /* pStrokePath */
NULL, /* pUnrealizePalette */
NULL, /* pWidenPath */
+ NULL, /* pD3DKMTCheckVidPnExclusiveOwnership */
NULL, /* pD3DKMTSetVidPnSourceOwner */
NULL, /* wine_get_wgl_driver */
NULL, /* wine_get_vulkan_driver */
diff --git a/dlls/gdi32/gdi32.spec b/dlls/gdi32/gdi32.spec
index 597002c9a8..4d71b75d19 100644
--- a/dlls/gdi32/gdi32.spec
+++ b/dlls/gdi32/gdi32.spec
@@ -80,6 +80,7 @@
@ stdcall CreateScalableFontResourceA(long str str str)
@ stdcall CreateScalableFontResourceW(long wstr wstr wstr)
@ stdcall CreateSolidBrush(long)
+@ stdcall D3DKMTCheckVidPnExclusiveOwnership(ptr)
@ stdcall D3DKMTCloseAdapter(ptr)
@ stdcall D3DKMTCreateDCFromMemory(ptr)
@ stdcall D3DKMTCreateDevice(ptr)
diff --git a/dlls/gdi32/mfdrv/init.c b/dlls/gdi32/mfdrv/init.c
index fb568f1838..52181cd60f 100644
--- a/dlls/gdi32/mfdrv/init.c
+++ b/dlls/gdi32/mfdrv/init.c
@@ -226,6 +226,7 @@ static const struct gdi_dc_funcs MFDRV_Funcs =
MFDRV_StrokePath, /* pStrokePath */
NULL, /* pUnrealizePalette */
MFDRV_WidenPath, /* pWidenPath */
+ NULL, /* pD3DKMTCheckVidPnExclusiveOwnership */
NULL, /* pD3DKMTSetVidPnSourceOwner */
NULL, /* wine_get_wgl_driver */
NULL, /* wine_get_vulkan_driver */
diff --git a/dlls/gdi32/path.c b/dlls/gdi32/path.c
index 23c0162f64..9a671db46c 100644
--- a/dlls/gdi32/path.c
+++ b/dlls/gdi32/path.c
@@ -2248,6 +2248,7 @@ const struct gdi_dc_funcs path_driver =
NULL, /* pStrokePath */
NULL, /* pUnrealizePalette */
NULL, /* pWidenPath */
+ NULL, /* pD3DKMTCheckVidPnExclusiveOwnership */
NULL, /* pD3DKMTSetVidPnSourceOwner */
NULL, /* wine_get_wgl_driver */
NULL, /* wine_get_vulkan_driver */
diff --git a/dlls/wineandroid.drv/init.c b/dlls/wineandroid.drv/init.c
index ec6c689b49..a73b025d4d 100644
--- a/dlls/wineandroid.drv/init.c
+++ b/dlls/wineandroid.drv/init.c
@@ -411,6 +411,7 @@ static const struct gdi_dc_funcs android_drv_funcs =
NULL, /* pStrokePath */
NULL, /* pUnrealizePalette */
NULL, /* pWidenPath */
+ NULL, /* pD3DKMTCheckVidPnExclusiveOwnership */
NULL, /* pD3DKMTSetVidPnSourceOwner */
ANDROID_wine_get_wgl_driver, /* wine_get_wgl_driver */
NULL, /* wine_get_vulkan_driver */
diff --git a/dlls/winemac.drv/gdi.c b/dlls/winemac.drv/gdi.c
index 32aeba04b4..5adf86c9de 100644
--- a/dlls/winemac.drv/gdi.c
+++ b/dlls/winemac.drv/gdi.c
@@ -390,6 +390,7 @@ static const struct gdi_dc_funcs macdrv_funcs =
NULL, /* pStrokePath */
NULL, /* pUnrealizePalette */
NULL, /* pWidenPath */
+ NULL, /* pD3DKMTCheckVidPnExclusiveOwnership */
NULL, /* pD3DKMTSetVidPnSourceOwner */
macdrv_wine_get_wgl_driver, /* wine_get_wgl_driver */
macdrv_wine_get_vulkan_driver, /* wine_get_vulkan_driver */
diff --git a/dlls/wineps.drv/init.c b/dlls/wineps.drv/init.c
index 2183029058..e82b0c8ee3 100644
--- a/dlls/wineps.drv/init.c
+++ b/dlls/wineps.drv/init.c
@@ -908,6 +908,7 @@ static const struct gdi_dc_funcs psdrv_funcs =
PSDRV_StrokePath, /* pStrokePath */
NULL, /* pUnrealizePalette */
NULL, /* pWidenPath */
+ NULL, /* pD3DKMTCheckVidPnExclusiveOwnership */
NULL, /* pD3DKMTSetVidPnSourceOwner */
NULL, /* wine_get_wgl_driver */
NULL, /* wine_get_vulkan_driver */
diff --git a/dlls/winex11.drv/init.c b/dlls/winex11.drv/init.c
index baed875ba5..49d334ef62 100644
--- a/dlls/winex11.drv/init.c
+++ b/dlls/winex11.drv/init.c
@@ -471,6 +471,7 @@ static const struct gdi_dc_funcs x11drv_funcs =
X11DRV_StrokePath, /* pStrokePath */
X11DRV_UnrealizePalette, /* pUnrealizePalette */
NULL, /* pWidenPath */
+ NULL, /* pD3DKMTCheckVidPnExclusiveOwnership */
NULL, /* pD3DKMTSetVidPnSourceOwner */
X11DRV_wine_get_wgl_driver, /* wine_get_wgl_driver */
X11DRV_wine_get_vulkan_driver, /* wine_get_vulkan_driver */
diff --git a/dlls/winex11.drv/xrender.c b/dlls/winex11.drv/xrender.c
index e8dbf27c0d..addd0ea1b1 100644
--- a/dlls/winex11.drv/xrender.c
+++ b/dlls/winex11.drv/xrender.c
@@ -2284,6 +2284,7 @@ static const struct gdi_dc_funcs xrender_funcs =
NULL, /* pStrokePath */
NULL, /* pUnrealizePalette */
NULL, /* pWidenPath */
+ NULL, /* pD3DKMTCheckVidPnExclusiveOwnership */
NULL, /* pD3DKMTSetVidPnSourceOwner */
NULL, /* wine_get_wgl_driver */
NULL, /* wine_get_vulkan_driver */
diff --git a/include/ddk/d3dkmthk.h b/include/ddk/d3dkmthk.h
index 05e2e65aea..717fdb3579 100644
--- a/include/ddk/d3dkmthk.h
+++ b/include/ddk/d3dkmthk.h
@@ -165,6 +165,7 @@ extern "C"
{
#endif /* __cplusplus */
+NTSTATUS WINAPI D3DKMTCheckVidPnExclusiveOwnership(const D3DKMT_CHECKVIDPNEXCLUSIVEOWNERSHIP *desc);
NTSTATUS WINAPI D3DKMTCloseAdapter(const D3DKMT_CLOSEADAPTER *desc);
NTSTATUS WINAPI D3DKMTCreateDevice(D3DKMT_CREATEDEVICE *desc);
NTSTATUS WINAPI D3DKMTCreateDCFromMemory(D3DKMT_CREATEDCFROMMEMORY *desc);
diff --git a/include/wine/gdi_driver.h b/include/wine/gdi_driver.h
index fac25349d1..8ae641b1ee 100644
--- a/include/wine/gdi_driver.h
+++ b/include/wine/gdi_driver.h
@@ -194,6 +194,7 @@ struct gdi_dc_funcs
BOOL (*pStrokePath)(PHYSDEV);
BOOL (*pUnrealizePalette)(HPALETTE);
BOOL (*pWidenPath)(PHYSDEV);
+ NTSTATUS (*pD3DKMTCheckVidPnExclusiveOwnership)(const D3DKMT_CHECKVIDPNEXCLUSIVEOWNERSHIP *);
NTSTATUS (*pD3DKMTSetVidPnSourceOwner)(const D3DKMT_SETVIDPNSOURCEOWNER *);
struct opengl_funcs * (*wine_get_wgl_driver)(PHYSDEV,UINT);
const struct vulkan_funcs * (*wine_get_vulkan_driver)(PHYSDEV,UINT);
@@ -203,7 +204,7 @@ struct gdi_dc_funcs
};
/* increment this when you change the DC function table */
-#define WINE_GDI_DRIVER_VERSION 50
+#define WINE_GDI_DRIVER_VERSION 51
#define GDI_PRIORITY_NULL_DRV 0 /* null driver */
#define GDI_PRIORITY_FONT_DRV 100 /* any font driver */
--
2.20.1
2
1
D3DKMTSetVidPnSourceOwner needs to be implemented in user drivers
because we need to maintain the VidPN source ownership information list
in user driver. For example, user drivers need to release the
exclusive owner when a new window is moved to a monitor which already
have an exclusive owner.
Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com>
---
.../api-ms-win-dx-d3dkmt-l1-1-0.spec | 2 +-
dlls/d3d11/d3d11.spec | 2 +-
dlls/gdi32/dibdrv/dc.c | 2 ++
dlls/gdi32/driver.c | 29 +++++++++++++++++++
dlls/gdi32/enhmfdrv/dc.c | 1 +
dlls/gdi32/enhmfdrv/init.c | 1 +
dlls/gdi32/freetype.c | 1 +
dlls/gdi32/gdi32.spec | 1 +
dlls/gdi32/mfdrv/init.c | 1 +
dlls/gdi32/path.c | 1 +
dlls/wineandroid.drv/init.c | 1 +
dlls/winemac.drv/gdi.c | 1 +
dlls/wineps.drv/init.c | 1 +
dlls/winex11.drv/init.c | 1 +
dlls/winex11.drv/xrender.c | 1 +
include/ddk/d3dkmthk.h | 1 +
include/wine/gdi_driver.h | 5 +++-
17 files changed, 49 insertions(+), 3 deletions(-)
diff --git a/dlls/api-ms-win-dx-d3dkmt-l1-1-0/api-ms-win-dx-d3dkmt-l1-1-0.spec b/dlls/api-ms-win-dx-d3dkmt-l1-1-0/api-ms-win-dx-d3dkmt-l1-1-0.spec
index 43452cda74..c14ebc68e9 100644
--- a/dlls/api-ms-win-dx-d3dkmt-l1-1-0/api-ms-win-dx-d3dkmt-l1-1-0.spec
+++ b/dlls/api-ms-win-dx-d3dkmt-l1-1-0/api-ms-win-dx-d3dkmt-l1-1-0.spec
@@ -82,7 +82,7 @@
@ stub D3DKMTSetProcessSchedulingPriorityClass
@ stub D3DKMTSetQueuedLimit
@ stub D3DKMTSetStereoEnabled
-@ stub D3DKMTSetVidPnSourceOwner
+@ stdcall D3DKMTSetVidPnSourceOwner(ptr) gdi32.D3DKMTSetVidPnSourceOwner
@ stub D3DKMTShareObjects
@ stub D3DKMTSharedPrimaryLockNotification
@ stub D3DKMTSharedPrimaryUnLockNotification
diff --git a/dlls/d3d11/d3d11.spec b/dlls/d3d11/d3d11.spec
index 01bc8bfebc..606ddae3e3 100644
--- a/dlls/d3d11/d3d11.spec
+++ b/dlls/d3d11/d3d11.spec
@@ -35,7 +35,7 @@
@ stub D3DKMTSetDisplayMode
@ stub D3DKMTSetDisplayPrivateDriverFormat
@ stub D3DKMTSetGammaRamp
-@ stub D3DKMTSetVidPnSourceOwner
+@ stdcall D3DKMTSetVidPnSourceOwner(ptr) gdi32.D3DKMTSetVidPnSourceOwner
@ stub D3DKMTSignalSynchronizationObject
@ stub D3DKMTUnlock
@ stub D3DKMTWaitForSynchronizationObject
diff --git a/dlls/gdi32/dibdrv/dc.c b/dlls/gdi32/dibdrv/dc.c
index a3f84bd688..10c3fc6f69 100644
--- a/dlls/gdi32/dibdrv/dc.c
+++ b/dlls/gdi32/dibdrv/dc.c
@@ -520,6 +520,7 @@ const struct gdi_dc_funcs dib_driver =
dibdrv_StrokePath, /* pStrokePath */
NULL, /* pUnrealizePalette */
NULL, /* pWidenPath */
+ NULL, /* pD3DKMTSetVidPnSourceOwner */
dibdrv_wine_get_wgl_driver, /* wine_get_wgl_driver */
NULL, /* wine_get_vulkan_driver */
GDI_PRIORITY_DIB_DRV /* priority */
@@ -1143,6 +1144,7 @@ static const struct gdi_dc_funcs window_driver =
NULL, /* pStrokePath */
NULL, /* pUnrealizePalette */
NULL, /* pWidenPath */
+ NULL, /* pD3DKMTSetVidPnSourceOwner */
windrv_wine_get_wgl_driver, /* wine_get_wgl_driver */
NULL, /* wine_get_vulkan_driver */
GDI_PRIORITY_DIB_DRV + 10 /* priority */
diff --git a/dlls/gdi32/driver.c b/dlls/gdi32/driver.c
index 49ed081df1..71a52ed9fc 100644
--- a/dlls/gdi32/driver.c
+++ b/dlls/gdi32/driver.c
@@ -753,6 +753,11 @@ static BOOL nulldrv_UnrealizePalette( HPALETTE palette )
return FALSE;
}
+static NTSTATUS WINAPI nulldrv_D3DKMTSetVidPnSourceOwner( const D3DKMT_SETVIDPNSOURCEOWNER *desc )
+{
+ return STATUS_PROCEDURE_NOT_FOUND;
+}
+
static struct opengl_funcs *nulldrv_wine_get_wgl_driver( PHYSDEV dev, UINT version )
{
return (void *)-1;
@@ -892,6 +897,7 @@ const struct gdi_dc_funcs null_driver =
nulldrv_StrokePath, /* pStrokePath */
nulldrv_UnrealizePalette, /* pUnrealizePalette */
nulldrv_WidenPath, /* pWidenPath */
+ nulldrv_D3DKMTSetVidPnSourceOwner, /* pD3DKMTSetVidPnSourceOwner */
nulldrv_wine_get_wgl_driver, /* wine_get_wgl_driver */
nulldrv_wine_get_vulkan_driver, /* wine_get_vulkan_driver */
@@ -1422,6 +1428,7 @@ NTSTATUS WINAPI D3DKMTCreateDevice( D3DKMT_CREATEDEVICE *desc )
NTSTATUS WINAPI D3DKMTDestroyDevice( const D3DKMT_DESTROYDEVICE *desc )
{
NTSTATUS status = STATUS_INVALID_PARAMETER;
+ D3DKMT_SETVIDPNSOURCEOWNER set_owner_desc;
struct d3dkmt_device *device;
TRACE("(%p)\n", desc);
@@ -1434,6 +1441,9 @@ NTSTATUS WINAPI D3DKMTDestroyDevice( const D3DKMT_DESTROYDEVICE *desc )
{
if (device->handle == desc->hDevice)
{
+ memset( &set_owner_desc, 0, sizeof(set_owner_desc) );
+ set_owner_desc.hDevice = desc->hDevice;
+ D3DKMTSetVidPnSourceOwner( &set_owner_desc );
list_remove( &device->entry );
heap_free( device );
status = STATUS_SUCCESS;
@@ -1444,3 +1454,22 @@ NTSTATUS WINAPI D3DKMTDestroyDevice( const D3DKMT_DESTROYDEVICE *desc )
return status;
}
+
+/******************************************************************************
+ * D3DKMTSetVidPnSourceOwner [GDI32.@]
+ */
+NTSTATUS WINAPI D3DKMTSetVidPnSourceOwner( const D3DKMT_SETVIDPNSOURCEOWNER *desc )
+{
+ TRACE("(%p)\n", desc);
+
+ if (!get_display_driver()->pD3DKMTSetVidPnSourceOwner)
+ return STATUS_PROCEDURE_NOT_FOUND;
+
+ if (!desc || !desc->hDevice)
+ return STATUS_INVALID_PARAMETER;
+
+ /* Store VidPN source ownership info in user driver because user driver needs to changes ownership sometimes.
+ * For example, when a new window is moved to a VidPN source with an exclusive owner, such exclusive owner will be
+ * released before showing the new window */
+ return get_display_driver()->pD3DKMTSetVidPnSourceOwner( desc );
+}
diff --git a/dlls/gdi32/enhmfdrv/dc.c b/dlls/gdi32/enhmfdrv/dc.c
index 960d1b295c..80e54685c7 100644
--- a/dlls/gdi32/enhmfdrv/dc.c
+++ b/dlls/gdi32/enhmfdrv/dc.c
@@ -950,6 +950,7 @@ static const struct gdi_dc_funcs emfpath_driver =
NULL, /* pStrokePath */
NULL, /* pUnrealizePalette */
NULL, /* pWidenPath */
+ NULL, /* pD3DKMTSetVidPnSourceOwner */
NULL, /* wine_get_wgl_driver */
NULL, /* wine_get_vulkan_driver */
GDI_PRIORITY_PATH_DRV + 1 /* priority */
diff --git a/dlls/gdi32/enhmfdrv/init.c b/dlls/gdi32/enhmfdrv/init.c
index 1cd838ab8e..6938e45cbd 100644
--- a/dlls/gdi32/enhmfdrv/init.c
+++ b/dlls/gdi32/enhmfdrv/init.c
@@ -163,6 +163,7 @@ static const struct gdi_dc_funcs emfdrv_driver =
EMFDRV_StrokePath, /* pStrokePath */
NULL, /* pUnrealizePalette */
EMFDRV_WidenPath, /* pWidenPath */
+ NULL, /* pD3DKMTSetVidPnSourceOwner */
NULL, /* wine_get_wgl_driver */
NULL, /* wine_get_vulkan_driver */
GDI_PRIORITY_GRAPHICS_DRV /* priority */
diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c
index 703dc3a997..b571611c13 100644
--- a/dlls/gdi32/freetype.c
+++ b/dlls/gdi32/freetype.c
@@ -9236,6 +9236,7 @@ static const struct gdi_dc_funcs freetype_funcs =
NULL, /* pStrokePath */
NULL, /* pUnrealizePalette */
NULL, /* pWidenPath */
+ NULL, /* pD3DKMTSetVidPnSourceOwner */
NULL, /* wine_get_wgl_driver */
NULL, /* wine_get_vulkan_driver */
GDI_PRIORITY_FONT_DRV /* priority */
diff --git a/dlls/gdi32/gdi32.spec b/dlls/gdi32/gdi32.spec
index 9abd82173c..597002c9a8 100644
--- a/dlls/gdi32/gdi32.spec
+++ b/dlls/gdi32/gdi32.spec
@@ -88,6 +88,7 @@
@ stdcall D3DKMTEscape(ptr)
@ stdcall D3DKMTOpenAdapterFromGdiDisplayName(ptr)
@ stdcall D3DKMTOpenAdapterFromHdc(ptr)
+@ stdcall D3DKMTSetVidPnSourceOwner(ptr)
@ stdcall DPtoLP(long ptr long)
@ stdcall DeleteColorSpace(long)
@ stdcall DeleteDC(long)
diff --git a/dlls/gdi32/mfdrv/init.c b/dlls/gdi32/mfdrv/init.c
index 4ef509a89f..fb568f1838 100644
--- a/dlls/gdi32/mfdrv/init.c
+++ b/dlls/gdi32/mfdrv/init.c
@@ -226,6 +226,7 @@ static const struct gdi_dc_funcs MFDRV_Funcs =
MFDRV_StrokePath, /* pStrokePath */
NULL, /* pUnrealizePalette */
MFDRV_WidenPath, /* pWidenPath */
+ NULL, /* pD3DKMTSetVidPnSourceOwner */
NULL, /* wine_get_wgl_driver */
NULL, /* wine_get_vulkan_driver */
GDI_PRIORITY_GRAPHICS_DRV /* priority */
diff --git a/dlls/gdi32/path.c b/dlls/gdi32/path.c
index 8cf86ccb2e..23c0162f64 100644
--- a/dlls/gdi32/path.c
+++ b/dlls/gdi32/path.c
@@ -2248,6 +2248,7 @@ const struct gdi_dc_funcs path_driver =
NULL, /* pStrokePath */
NULL, /* pUnrealizePalette */
NULL, /* pWidenPath */
+ NULL, /* pD3DKMTSetVidPnSourceOwner */
NULL, /* wine_get_wgl_driver */
NULL, /* wine_get_vulkan_driver */
GDI_PRIORITY_PATH_DRV /* priority */
diff --git a/dlls/wineandroid.drv/init.c b/dlls/wineandroid.drv/init.c
index 7a2945c80f..ec6c689b49 100644
--- a/dlls/wineandroid.drv/init.c
+++ b/dlls/wineandroid.drv/init.c
@@ -411,6 +411,7 @@ static const struct gdi_dc_funcs android_drv_funcs =
NULL, /* pStrokePath */
NULL, /* pUnrealizePalette */
NULL, /* pWidenPath */
+ NULL, /* pD3DKMTSetVidPnSourceOwner */
ANDROID_wine_get_wgl_driver, /* wine_get_wgl_driver */
NULL, /* wine_get_vulkan_driver */
GDI_PRIORITY_GRAPHICS_DRV /* priority */
diff --git a/dlls/winemac.drv/gdi.c b/dlls/winemac.drv/gdi.c
index 7156a3c3a8..32aeba04b4 100644
--- a/dlls/winemac.drv/gdi.c
+++ b/dlls/winemac.drv/gdi.c
@@ -390,6 +390,7 @@ static const struct gdi_dc_funcs macdrv_funcs =
NULL, /* pStrokePath */
NULL, /* pUnrealizePalette */
NULL, /* pWidenPath */
+ NULL, /* pD3DKMTSetVidPnSourceOwner */
macdrv_wine_get_wgl_driver, /* wine_get_wgl_driver */
macdrv_wine_get_vulkan_driver, /* wine_get_vulkan_driver */
GDI_PRIORITY_GRAPHICS_DRV /* priority */
diff --git a/dlls/wineps.drv/init.c b/dlls/wineps.drv/init.c
index 0dff6cc868..2183029058 100644
--- a/dlls/wineps.drv/init.c
+++ b/dlls/wineps.drv/init.c
@@ -908,6 +908,7 @@ static const struct gdi_dc_funcs psdrv_funcs =
PSDRV_StrokePath, /* pStrokePath */
NULL, /* pUnrealizePalette */
NULL, /* pWidenPath */
+ NULL, /* pD3DKMTSetVidPnSourceOwner */
NULL, /* wine_get_wgl_driver */
NULL, /* wine_get_vulkan_driver */
GDI_PRIORITY_GRAPHICS_DRV /* priority */
diff --git a/dlls/winex11.drv/init.c b/dlls/winex11.drv/init.c
index 20710cc0c9..baed875ba5 100644
--- a/dlls/winex11.drv/init.c
+++ b/dlls/winex11.drv/init.c
@@ -471,6 +471,7 @@ static const struct gdi_dc_funcs x11drv_funcs =
X11DRV_StrokePath, /* pStrokePath */
X11DRV_UnrealizePalette, /* pUnrealizePalette */
NULL, /* pWidenPath */
+ NULL, /* pD3DKMTSetVidPnSourceOwner */
X11DRV_wine_get_wgl_driver, /* wine_get_wgl_driver */
X11DRV_wine_get_vulkan_driver, /* wine_get_vulkan_driver */
GDI_PRIORITY_GRAPHICS_DRV /* priority */
diff --git a/dlls/winex11.drv/xrender.c b/dlls/winex11.drv/xrender.c
index 61729ecf29..e8dbf27c0d 100644
--- a/dlls/winex11.drv/xrender.c
+++ b/dlls/winex11.drv/xrender.c
@@ -2284,6 +2284,7 @@ static const struct gdi_dc_funcs xrender_funcs =
NULL, /* pStrokePath */
NULL, /* pUnrealizePalette */
NULL, /* pWidenPath */
+ NULL, /* pD3DKMTSetVidPnSourceOwner */
NULL, /* wine_get_wgl_driver */
NULL, /* wine_get_vulkan_driver */
GDI_PRIORITY_GRAPHICS_DRV + 10 /* priority */
diff --git a/include/ddk/d3dkmthk.h b/include/ddk/d3dkmthk.h
index 081758bf5d..05e2e65aea 100644
--- a/include/ddk/d3dkmthk.h
+++ b/include/ddk/d3dkmthk.h
@@ -171,6 +171,7 @@ NTSTATUS WINAPI D3DKMTCreateDCFromMemory(D3DKMT_CREATEDCFROMMEMORY *desc);
NTSTATUS WINAPI D3DKMTDestroyDCFromMemory(const D3DKMT_DESTROYDCFROMMEMORY *desc);
NTSTATUS WINAPI D3DKMTDestroyDevice(const D3DKMT_DESTROYDEVICE *desc);
NTSTATUS WINAPI D3DKMTOpenAdapterFromGdiDisplayName(D3DKMT_OPENADAPTERFROMGDIDISPLAYNAME *desc);
+NTSTATUS WINAPI D3DKMTSetVidPnSourceOwner(const D3DKMT_SETVIDPNSOURCEOWNER *desc);
#ifdef __cplusplus
}
diff --git a/include/wine/gdi_driver.h b/include/wine/gdi_driver.h
index d3e5bcefb4..fac25349d1 100644
--- a/include/wine/gdi_driver.h
+++ b/include/wine/gdi_driver.h
@@ -21,6 +21,8 @@
#ifndef __WINE_WINE_GDI_DRIVER_H
#define __WINE_WINE_GDI_DRIVER_H
+#include "winternl.h"
+#include "ddk/d3dkmthk.h"
#include "wine/list.h"
struct gdi_dc_funcs;
@@ -192,6 +194,7 @@ struct gdi_dc_funcs
BOOL (*pStrokePath)(PHYSDEV);
BOOL (*pUnrealizePalette)(HPALETTE);
BOOL (*pWidenPath)(PHYSDEV);
+ NTSTATUS (*pD3DKMTSetVidPnSourceOwner)(const D3DKMT_SETVIDPNSOURCEOWNER *);
struct opengl_funcs * (*wine_get_wgl_driver)(PHYSDEV,UINT);
const struct vulkan_funcs * (*wine_get_vulkan_driver)(PHYSDEV,UINT);
@@ -200,7 +203,7 @@ struct gdi_dc_funcs
};
/* increment this when you change the DC function table */
-#define WINE_GDI_DRIVER_VERSION 49
+#define WINE_GDI_DRIVER_VERSION 50
#define GDI_PRIORITY_NULL_DRV 0 /* null driver */
#define GDI_PRIORITY_FONT_DRV 100 /* any font driver */
--
2.20.1
2
1
[PATCH 1/2] user32/edit: In EM_POSFROMCHAR return correct position for empty lines
by Fabian Maurer 04 Jul '19
by Fabian Maurer 04 Jul '19
04 Jul '19
Fix with permission from ROS Jira
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47305
Signed-off-by: Fabian Maurer <dark.shadow4(a)web.de>
---
dlls/user32/edit.c | 2 +-
dlls/user32/tests/edit.c | 19 +++++++++++++++++++
2 files changed, 20 insertions(+), 1 deletion(-)
diff --git a/dlls/user32/edit.c b/dlls/user32/edit.c
index 3c5331f9dc..6c758c3911 100644
--- a/dlls/user32/edit.c
+++ b/dlls/user32/edit.c
@@ -1102,7 +1102,7 @@ static LRESULT EDIT_EM_PosFromChar(EDITSTATE *es, INT index, BOOL after_wrap)
x -= es->x_offset;
}
else
- x = es->x_offset;
+ x = (lw > 0 ? es->x_offset : -es->x_offset);
if (es->style & ES_RIGHT)
x = w - (lw - x);
diff --git a/dlls/user32/tests/edit.c b/dlls/user32/tests/edit.c
index d0374c02a3..31f20fbc12 100644
--- a/dlls/user32/tests/edit.c
+++ b/dlls/user32/tests/edit.c
@@ -1142,6 +1142,9 @@ static void test_edit_control_4(void)
int lo, hi, mid;
int ret;
int i;
+ HDC dc;
+ SIZE size;
+ RECT rect;
trace("EDIT: Test EM_CHARFROMPOS and EM_POSFROMCHAR\n");
hwEdit = create_editcontrol(ES_AUTOHSCROLL | ES_AUTOVSCROLL, 0);
@@ -1251,6 +1254,22 @@ static void test_edit_control_4(void)
ret = SendMessageA(hwEdit, EM_POSFROMCHAR, 2, 0);
ok(-1 == ret, "expected -1 got %d\n", ret);
DestroyWindow(hwEdit);
+
+ /* Test newline when the edit control is scrolled to the right */
+
+ hwEdit = create_editcontrol(ES_MULTILINE | ES_AUTOHSCROLL | ES_AUTOVSCROLL, 0);
+ SendMessageA(hwEdit, WM_SETTEXT, 0, (LPARAM)"wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww\r\n\r\n");
+ SendMessageA(hwEdit, EM_SETSEL, 40, 40);
+
+ dc = GetDC(hwEdit);
+ GetClientRect(hwEdit, &rect);
+ GetTextExtentPoint32A(dc, "w", 1, &size);
+ ReleaseDC(hwEdit, dc);
+ lo = (short)LOWORD(SendMessageA(hwEdit, EM_POSFROMCHAR, 42, 0));
+ ret = (short)LOWORD(SendMessageA(hwEdit, EM_POSFROMCHAR, 40, 0));
+ ret = size.cx * (-40) + ret;
+ ok(ret == lo, "expected %d got %d\n", ret, lo);
+ DestroyWindow(hwEdit);
}
/* Test if creating edit control without ES_AUTOHSCROLL and ES_AUTOVSCROLL
--
2.21.0
3
5