Wine-Devel
By thread
wine-devel@list.winehq.org
By month
Messages by month
- ----- 2026 -----
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2002 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2001 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
September 2018
- 70 participants
- 1549 messages
[PATCH 2/2] include: Add ID2D1DrawingStateBlock1 definition.
by Nikolay Sivov
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
---
include/d2d1_1.idl | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/include/d2d1_1.idl b/include/d2d1_1.idl
index 1118226310..ff283f8f1a 100644
--- a/include/d2d1_1.idl
+++ b/include/d2d1_1.idl
@@ -21,7 +21,6 @@ import "d2d1.idl";
interface ID2D1DeviceContext;
interface ID2D1StrokeStyle1;
interface ID2D1PathGeometry1;
-interface ID2D1DrawingStateBlock1;
interface ID2D1GdiMetafile;
interface ID2D1Properties;
interface IPrintDocumentPackageTarget;
@@ -251,6 +250,21 @@ typedef struct D2D1_EFFECT_INPUT_DESCRIPTION
typedef HRESULT (__stdcall *PD2D1_EFFECT_FACTORY)(IUnknown **effect);
+[
+ object,
+ uuid(689f1f85-c72e-4e33-8f19-85754efd5ace),
+ local,
+]
+interface ID2D1DrawingStateBlock1 : ID2D1DrawingStateBlock
+{
+ void GetDescription(
+ [out] D2D1_DRAWING_STATE_DESCRIPTION1 *desc
+ );
+ void SetDescription(
+ [in] const D2D1_DRAWING_STATE_DESCRIPTION1 *desc
+ );
+}
+
[
object,
uuid(a898a84c-3873-4588-b08b-ebbf978df041),
--
2.18.0
Sept. 13, 2018
[v2 PATCH 1/2] d2d1: Return bitmap options.
by Nikolay Sivov
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
---
dlls/d2d1/bitmap.c | 43 ++++++++++------
dlls/d2d1/d2d1_private.h | 7 +--
dlls/d2d1/device.c | 39 +++++++++++---
dlls/d2d1/tests/d2d1.c | 108 +++++++++++++++++++++------------------
4 files changed, 121 insertions(+), 76 deletions(-)
diff --git a/dlls/d2d1/bitmap.c b/dlls/d2d1/bitmap.c
index 8282dca043..79dbabbea9 100644
--- a/dlls/d2d1/bitmap.c
+++ b/dlls/d2d1/bitmap.c
@@ -179,9 +179,11 @@ static void STDMETHODCALLTYPE d2d_bitmap_GetColorContext(ID2D1Bitmap1 *iface, ID
static D2D1_BITMAP_OPTIONS STDMETHODCALLTYPE d2d_bitmap_GetOptions(ID2D1Bitmap1 *iface)
{
- FIXME("iface %p stub!\n", iface);
+ struct d2d_bitmap *bitmap = impl_from_ID2D1Bitmap1(iface);
+
+ TRACE("iface %p.\n", iface);
- return D2D1_BITMAP_OPTIONS_NONE;
+ return bitmap->options;
}
static HRESULT STDMETHODCALLTYPE d2d_bitmap_GetSurface(ID2D1Bitmap1 *iface, IDXGISurface **surface)
@@ -262,7 +264,7 @@ static BOOL format_supported(const D2D1_PIXEL_FORMAT *format)
}
static void d2d_bitmap_init(struct d2d_bitmap *bitmap, ID2D1Factory *factory,
- ID3D10ShaderResourceView *view, D2D1_SIZE_U size, const D2D1_BITMAP_PROPERTIES *desc)
+ ID3D10ShaderResourceView *view, D2D1_SIZE_U size, const D2D1_BITMAP_PROPERTIES1 *desc)
{
bitmap->ID2D1Bitmap1_iface.lpVtbl = &d2d_bitmap_vtbl;
bitmap->refcount = 1;
@@ -272,6 +274,7 @@ static void d2d_bitmap_init(struct d2d_bitmap *bitmap, ID2D1Factory *factory,
bitmap->format = desc->pixelFormat;
bitmap->dpi_x = desc->dpiX;
bitmap->dpi_y = desc->dpiY;
+ bitmap->options = desc->bitmapOptions;
if (bitmap->dpi_x == 0.0f && bitmap->dpi_y == 0.0f)
{
@@ -281,7 +284,7 @@ static void d2d_bitmap_init(struct d2d_bitmap *bitmap, ID2D1Factory *factory,
}
HRESULT d2d_bitmap_create(ID2D1Factory *factory, ID3D10Device *device, D2D1_SIZE_U size, const void *src_data,
- UINT32 pitch, const D2D1_BITMAP_PROPERTIES *desc, struct d2d_bitmap **bitmap)
+ UINT32 pitch, const D2D1_BITMAP_PROPERTIES1 *desc, struct d2d_bitmap **bitmap)
{
D3D10_SUBRESOURCE_DATA resource_data;
D3D10_TEXTURE2D_DESC texture_desc;
@@ -338,9 +341,9 @@ HRESULT d2d_bitmap_create(ID2D1Factory *factory, ID3D10Device *device, D2D1_SIZE
}
HRESULT d2d_bitmap_create_shared(ID2D1DeviceContext *context, ID3D10Device *target_device,
- REFIID iid, void *data, const D2D1_BITMAP_PROPERTIES *desc, struct d2d_bitmap **bitmap)
+ REFIID iid, void *data, const D2D1_BITMAP_PROPERTIES1 *desc, struct d2d_bitmap **bitmap)
{
- D2D1_BITMAP_PROPERTIES d;
+ D2D1_BITMAP_PROPERTIES1 d;
ID2D1Factory *factory;
if (IsEqualGUID(iid, &IID_ID2D1Bitmap))
@@ -432,7 +435,22 @@ HRESULT d2d_bitmap_create_shared(ID2D1DeviceContext *context, ID3D10Device *targ
return E_OUTOFMEMORY;
}
- d = *desc;
+
+ if (FAILED(hr = IDXGISurface_GetDesc(surface, &surface_desc)))
+ {
+ WARN("Failed to get surface desc, hr %#x.\n", hr);
+ ID3D10ShaderResourceView_Release(view);
+ return hr;
+ }
+
+ if (!desc)
+ {
+ memset(&d, 0, sizeof(d));
+ d.pixelFormat.format = surface_desc.Format;
+ }
+ else
+ d = *desc;
+
if (d.dpiX == 0.0f || d.dpiY == 0.0f)
{
float dpi_x, dpi_y;
@@ -444,13 +462,6 @@ HRESULT d2d_bitmap_create_shared(ID2D1DeviceContext *context, ID3D10Device *targ
d.dpiY = dpi_y;
}
- if (FAILED(hr = IDXGISurface_GetDesc(surface, &surface_desc)))
- {
- WARN("Failed to get surface desc, hr %#x.\n", hr);
- ID3D10ShaderResourceView_Release(view);
- return hr;
- }
-
pixel_size.width = surface_desc.Width;
pixel_size.height = surface_desc.Height;
@@ -469,10 +480,10 @@ HRESULT d2d_bitmap_create_shared(ID2D1DeviceContext *context, ID3D10Device *targ
}
HRESULT d2d_bitmap_create_from_wic_bitmap(ID2D1Factory *factory, ID3D10Device *device, IWICBitmapSource *bitmap_source,
- const D2D1_BITMAP_PROPERTIES *desc, struct d2d_bitmap **bitmap)
+ const D2D1_BITMAP_PROPERTIES1 *desc, struct d2d_bitmap **bitmap)
{
const D2D1_PIXEL_FORMAT *d2d_format;
- D2D1_BITMAP_PROPERTIES bitmap_desc;
+ D2D1_BITMAP_PROPERTIES1 bitmap_desc;
WICPixelFormatGUID wic_format;
unsigned int bpp, data_size;
D2D1_SIZE_U size;
diff --git a/dlls/d2d1/d2d1_private.h b/dlls/d2d1/d2d1_private.h
index 4148a685ba..5f83f8fde2 100644
--- a/dlls/d2d1/d2d1_private.h
+++ b/dlls/d2d1/d2d1_private.h
@@ -343,14 +343,15 @@ struct d2d_bitmap
D2D1_PIXEL_FORMAT format;
float dpi_x;
float dpi_y;
+ D2D1_BITMAP_OPTIONS options;
};
HRESULT d2d_bitmap_create(ID2D1Factory *factory, ID3D10Device *device, D2D1_SIZE_U size, const void *src_data,
- UINT32 pitch, const D2D1_BITMAP_PROPERTIES *desc, struct d2d_bitmap **bitmap) DECLSPEC_HIDDEN;
+ UINT32 pitch, const D2D1_BITMAP_PROPERTIES1 *desc, struct d2d_bitmap **bitmap) DECLSPEC_HIDDEN;
HRESULT d2d_bitmap_create_shared(ID2D1DeviceContext *context, ID3D10Device *device, REFIID iid, void *data,
- const D2D1_BITMAP_PROPERTIES *desc, struct d2d_bitmap **bitmap) DECLSPEC_HIDDEN;
+ const D2D1_BITMAP_PROPERTIES1 *desc, struct d2d_bitmap **bitmap) DECLSPEC_HIDDEN;
HRESULT d2d_bitmap_create_from_wic_bitmap(ID2D1Factory *factory, ID3D10Device *device, IWICBitmapSource *bitmap_source,
- const D2D1_BITMAP_PROPERTIES *desc, struct d2d_bitmap **bitmap) DECLSPEC_HIDDEN;
+ const D2D1_BITMAP_PROPERTIES1 *desc, struct d2d_bitmap **bitmap) DECLSPEC_HIDDEN;
struct d2d_bitmap *unsafe_impl_from_ID2D1Bitmap(ID2D1Bitmap *iface) DECLSPEC_HIDDEN;
struct d2d_state_block
diff --git a/dlls/d2d1/device.c b/dlls/d2d1/device.c
index 4478a19f9f..21092f65c2 100644
--- a/dlls/d2d1/device.c
+++ b/dlls/d2d1/device.c
@@ -328,14 +328,23 @@ static void STDMETHODCALLTYPE d2d_device_context_GetFactory(ID2D1DeviceContext *
static HRESULT STDMETHODCALLTYPE d2d_device_context_CreateBitmap(ID2D1DeviceContext *iface,
D2D1_SIZE_U size, const void *src_data, UINT32 pitch, const D2D1_BITMAP_PROPERTIES *desc, ID2D1Bitmap **bitmap)
{
- struct d2d_device_context *render_target = impl_from_ID2D1DeviceContext(iface);
+ struct d2d_device_context *context = impl_from_ID2D1DeviceContext(iface);
+ D2D1_BITMAP_PROPERTIES1 bitmap_desc;
struct d2d_bitmap *object;
HRESULT hr;
TRACE("iface %p, size {%u, %u}, src_data %p, pitch %u, desc %p, bitmap %p.\n",
iface, size.width, size.height, src_data, pitch, desc, bitmap);
- if (SUCCEEDED(hr = d2d_bitmap_create(render_target->factory, render_target->device, size, src_data, pitch, desc, &object)))
+ if (desc)
+ {
+ memcpy(&bitmap_desc, desc, sizeof(*desc));
+ bitmap_desc.bitmapOptions = 0;
+ bitmap_desc.colorContext = NULL;
+ }
+
+ if (SUCCEEDED(hr = d2d_bitmap_create(context->factory, context->device, size, src_data, pitch,
+ desc ? &bitmap_desc : NULL, &object)))
*bitmap = (ID2D1Bitmap *)&object->ID2D1Bitmap1_iface;
return hr;
@@ -344,15 +353,23 @@ static HRESULT STDMETHODCALLTYPE d2d_device_context_CreateBitmap(ID2D1DeviceCont
static HRESULT STDMETHODCALLTYPE d2d_device_context_CreateBitmapFromWicBitmap(ID2D1DeviceContext *iface,
IWICBitmapSource *bitmap_source, const D2D1_BITMAP_PROPERTIES *desc, ID2D1Bitmap **bitmap)
{
- struct d2d_device_context *render_target = impl_from_ID2D1DeviceContext(iface);
+ struct d2d_device_context *context = impl_from_ID2D1DeviceContext(iface);
+ D2D1_BITMAP_PROPERTIES1 bitmap_desc;
struct d2d_bitmap *object;
HRESULT hr;
TRACE("iface %p, bitmap_source %p, desc %p, bitmap %p.\n",
iface, bitmap_source, desc, bitmap);
- if (SUCCEEDED(hr = d2d_bitmap_create_from_wic_bitmap(render_target->factory, render_target->device, bitmap_source,
- desc, &object)))
+ if (desc)
+ {
+ memcpy(&bitmap_desc, desc, sizeof(*desc));
+ bitmap_desc.bitmapOptions = 0;
+ bitmap_desc.colorContext = NULL;
+ }
+
+ if (SUCCEEDED(hr = d2d_bitmap_create_from_wic_bitmap(context->factory, context->device, bitmap_source,
+ desc ? &bitmap_desc : NULL, &object)))
*bitmap = (ID2D1Bitmap *)&object->ID2D1Bitmap1_iface;
return hr;
@@ -361,14 +378,22 @@ static HRESULT STDMETHODCALLTYPE d2d_device_context_CreateBitmapFromWicBitmap(ID
static HRESULT STDMETHODCALLTYPE d2d_device_context_CreateSharedBitmap(ID2D1DeviceContext *iface,
REFIID iid, void *data, const D2D1_BITMAP_PROPERTIES *desc, ID2D1Bitmap **bitmap)
{
- struct d2d_device_context *render_target = impl_from_ID2D1DeviceContext(iface);
+ struct d2d_device_context *context = impl_from_ID2D1DeviceContext(iface);
+ D2D1_BITMAP_PROPERTIES1 bitmap_desc;
struct d2d_bitmap *object;
HRESULT hr;
TRACE("iface %p, iid %s, data %p, desc %p, bitmap %p.\n",
iface, debugstr_guid(iid), data, desc, bitmap);
- if (SUCCEEDED(hr = d2d_bitmap_create_shared(iface, render_target->device, iid, data, desc, &object)))
+ if (desc)
+ {
+ memcpy(&bitmap_desc, desc, sizeof(*desc));
+ bitmap_desc.bitmapOptions = D2D1_BITMAP_OPTIONS_TARGET | D2D1_BITMAP_OPTIONS_CANNOT_DRAW;
+ bitmap_desc.colorContext = NULL;
+ }
+
+ if (SUCCEEDED(hr = d2d_bitmap_create_shared(iface, context->device, iid, data, desc ? &bitmap_desc : NULL, &object)))
*bitmap = (ID2D1Bitmap *)&object->ID2D1Bitmap1_iface;
return hr;
diff --git a/dlls/d2d1/tests/d2d1.c b/dlls/d2d1/tests/d2d1.c
index eeae75f841..467d61314d 100644
--- a/dlls/d2d1/tests/d2d1.c
+++ b/dlls/d2d1/tests/d2d1.c
@@ -773,6 +773,56 @@ static ID2D1RenderTarget *create_render_target(IDXGISurface *surface)
return create_render_target_desc(surface, &desc);
}
+#define check_bitmap_surface(b, s, o) check_bitmap_surface_(__LINE__, b, s, o)
+static void check_bitmap_surface_(unsigned int line, ID2D1Bitmap1 *bitmap, BOOL has_surface, DWORD expected_options)
+{
+ D2D1_BITMAP_OPTIONS options;
+ IDXGISurface *surface;
+ HRESULT hr;
+
+ options = ID2D1Bitmap1_GetOptions(bitmap);
+ ok_(__FILE__, line)(options == expected_options, "Unexpected bitmap options %#x, expected %#x.\n",
+ options, expected_options);
+
+ surface = (void *)0xdeadbeef;
+ hr = ID2D1Bitmap1_GetSurface(bitmap, &surface);
+ if (has_surface)
+ {
+ D3D10_TEXTURE2D_DESC desc;
+ ID3D10Texture2D *texture;
+
+ todo_wine
+ ok_(__FILE__, line)(SUCCEEDED(hr), "Failed to get bitmap surface, hr %#x.\n", hr);
+ ok_(__FILE__, line)(!!surface, "Expected surface instance.\n");
+
+ if (SUCCEEDED(hr))
+ {
+ /* Correlate with resource configuration. */
+ hr = IDXGISurface_QueryInterface(surface, &IID_ID3D10Texture2D, (void **)&texture);
+ ok_(__FILE__, line)(SUCCEEDED(hr), "Failed to get texture pointer, hr %#x.\n", hr);
+
+ ID3D10Texture2D_GetDesc(texture, &desc);
+ ok_(__FILE__, line)(desc.Usage == 0, "Unexpected usage %#x.\n", desc.Usage);
+ ok_(__FILE__, line)(desc.BindFlags == (options & D2D1_BITMAP_OPTIONS_TARGET ?
+ D3D10_BIND_RENDER_TARGET : D3D10_BIND_SHADER_RESOURCE),
+ "Unexpected bind flags %#x, bitmap options %#x.\n", desc.BindFlags, options);
+ ok_(__FILE__, line)(desc.CPUAccessFlags == 0, "Unexpected cpu access flags %#x.\n", desc.CPUAccessFlags);
+ ok_(__FILE__, line)(desc.MiscFlags == 0, "Unexpected misc flags %#x.\n", desc.MiscFlags);
+
+ ID3D10Texture2D_Release(texture);
+
+ IDXGISurface_Release(surface);
+ }
+ }
+ else
+ {
+ todo_wine {
+ ok_(__FILE__, line)(hr == D2DERR_INVALID_CALL, "Unexpected hr %#x.\n", hr);
+ ok_(__FILE__, line)(!surface, "Unexpected surface instance.\n");
+ }
+ }
+}
+
static inline struct geometry_sink *impl_from_ID2D1SimplifiedGeometrySink(ID2D1SimplifiedGeometrySink *iface)
{
return CONTAINING_RECORD(iface, struct geometry_sink, ID2D1SimplifiedGeometrySink_iface);
@@ -4112,11 +4162,19 @@ static void test_shared_bitmap(void)
if (SUCCEEDED(hr))
{
+ ID2D1Bitmap1 *bitmap3;
+
size = ID2D1Bitmap_GetPixelSize(bitmap2);
hr = IDXGISurface_GetDesc(surface2, &surface_desc);
ok(SUCCEEDED(hr), "Failed to get surface description, hr %#x.\n", hr);
ok(size.width == surface_desc.Width && size.height == surface_desc.Height, "Got wrong bitmap size.\n");
+ hr = ID2D1Bitmap_QueryInterface(bitmap2, &IID_ID2D1Bitmap1, (void **)&bitmap3);
+ ok(SUCCEEDED(hr), "Failed to get ID2D1Bitmap1 pointer, hr %#x.\n", hr);
+
+ check_bitmap_surface(bitmap3, TRUE, D2D1_BITMAP_OPTIONS_TARGET | D2D1_BITMAP_OPTIONS_CANNOT_DRAW);
+ ID2D1Bitmap1_Release(bitmap3);
+
ID2D1Bitmap_Release(bitmap2);
/* IDXGISurface1 is supported too. */
@@ -6529,56 +6587,6 @@ static void test_create_device(void)
ok(!refcount, "Factory has %u references left.\n", refcount);
}
-#define check_bitmap_surface(b, s, o) check_bitmap_surface_(__LINE__, b, s, o)
-static void check_bitmap_surface_(unsigned int line, ID2D1Bitmap1 *bitmap, BOOL has_surface, DWORD expected_options)
-{
- D2D1_BITMAP_OPTIONS options;
- IDXGISurface *surface;
- HRESULT hr;
-
- options = ID2D1Bitmap1_GetOptions(bitmap);
- ok_(__FILE__, line)(options == expected_options, "Unexpected bitmap options %#x, expected %#x.\n",
- options, expected_options);
-
- surface = (void *)0xdeadbeef;
- hr = ID2D1Bitmap1_GetSurface(bitmap, &surface);
- if (has_surface)
- {
- D3D10_TEXTURE2D_DESC desc;
- ID3D10Texture2D *texture;
-
- todo_wine
- ok_(__FILE__, line)(SUCCEEDED(hr), "Failed to get bitmap surface, hr %#x.\n", hr);
- ok_(__FILE__, line)(!!surface, "Expected surface instance.\n");
-
- if (SUCCEEDED(hr))
- {
- /* Correlate with resource configuration. */
- hr = IDXGISurface_QueryInterface(surface, &IID_ID3D10Texture2D, (void **)&texture);
- ok_(__FILE__, line)(SUCCEEDED(hr), "Failed to get texture pointer, hr %#x.\n", hr);
-
- ID3D10Texture2D_GetDesc(texture, &desc);
- ok_(__FILE__, line)(desc.Usage == 0, "Unexpected usage %#x.\n", desc.Usage);
- ok_(__FILE__, line)(desc.BindFlags == (options & D2D1_BITMAP_OPTIONS_TARGET ?
- D3D10_BIND_RENDER_TARGET : D3D10_BIND_SHADER_RESOURCE),
- "Unexpected bind flags %#x, bitmap options %#x.\n", desc.BindFlags, options);
- ok_(__FILE__, line)(desc.CPUAccessFlags == 0, "Unexpected cpu access flags %#x.\n", desc.CPUAccessFlags);
- ok_(__FILE__, line)(desc.MiscFlags == 0, "Unexpected misc flags %#x.\n", desc.MiscFlags);
-
- ID3D10Texture2D_Release(texture);
-
- IDXGISurface_Release(surface);
- }
- }
- else
- {
- todo_wine {
- ok_(__FILE__, line)(hr == D2DERR_INVALID_CALL, "Unexpected hr %#x.\n", hr);
- ok_(__FILE__, line)(!surface, "Unexpected surface instance.\n");
- }
- }
-}
-
#define check_rt_bitmap_surface(r, s, o) check_rt_bitmap_surface_(__LINE__, r, s, o)
static void check_rt_bitmap_surface_(unsigned int line, ID2D1RenderTarget *rt, BOOL has_surface, DWORD options)
{
--
2.18.0
Sept. 13, 2018
Re: [PATCH v3 4/4] msftedit: Add tests for interfaces.
by Marvin
Hi,
While running your changed tests on Windows, I think I found new failures.
Being a bot and all I'm not very good at pattern recognition, so I might be
wrong, but could you please double-check?
Full results can be found at:
https://testbot.winehq.org/JobDetails.pl?Key=41960
Your paranoid android.
=== wxppro (32 bit Windows report) ===
msftedit:
0b40:richole: unhandled exception c0000005 at 4B42BB11
=== w2003std (32 bit Windows report) ===
msftedit:
06ac:richole: unhandled exception c0000005 at 6DEABB8E
06ac:richole: unhandled exception c0000005 at 6DEABB8E
06ac:richole: unhandled exception c0000005 at 6DEAA2B4
=== w7u (32 bit Windows report) ===
msftedit:
0a68:richole: unhandled exception c0000005 at 000004E4
0a68:richole: unhandled exception c0000005 at 000004E4
0a68:richole: unhandled exception c0000005 at 000004E4
0a68:richole: unhandled exception c0000005 at 000004E4
0a68:richole: unhandled exception c0000005 at 00000000
=== w8 (32 bit Windows report) ===
msftedit:
0d40:richole: unhandled exception c0000005 at 71811D5D
0d40:richole: unhandled exception c0000005 at 71811D5D
0d40:richole: unhandled exception c0000005 at 71811D5D
0d40:richole: unhandled exception c0000005 at 71811D5D
0d40:richole: unhandled exception c0000005 at 71811F39
=== w8adm (32 bit Windows report) ===
msftedit:
0684:richole: unhandled exception c0000005 at 71811D5D
0684:richole: unhandled exception c0000005 at 71811D5D
0684:richole: unhandled exception c0000005 at 71811D5D
0684:richole: unhandled exception c0000005 at 71811D5D
0684:richole: unhandled exception c0000005 at 71811F39
=== w864 (32 bit Windows report) ===
msftedit:
07f0:richole: unhandled exception c0000005 at 00000000
=== w1064 (32 bit Windows report) ===
msftedit:
0ee0:richole: unhandled exception c0000005 at 70549480
=== w7pro64 (64 bit Windows report) ===
msftedit:
0aec:richole: unhandled exception c0000005 at 000004E4000004E4
=== w864 (64 bit Windows report) ===
msftedit:
0aec:richole: unhandled exception c000001d at 00007FFB12016310
=== w1064 (64 bit Windows report) ===
msftedit:
0e04:richole: unhandled exception c0000005 at 0000000000000000
Sept. 13, 2018
[PATCH v3 4/4] msftedit: Add tests for interfaces.
by Jactry Zeng
Superseded patch 150978.
Signed-off-by: Jactry Zeng <jzeng(a)codeweavers.com>
---
configure | 1 +
configure.ac | 1 +
dlls/msftedit/tests/Makefile.in | 5 +
dlls/msftedit/tests/richole.c | 198 ++++++++++++++++++++++++++++++++
4 files changed, 205 insertions(+)
create mode 100644 dlls/msftedit/tests/Makefile.in
create mode 100644 dlls/msftedit/tests/richole.c
diff --git a/configure b/configure
index a3916ee233..818cb40fce 100755
--- a/configure
+++ b/configure
@@ -19595,6 +19595,7 @@ wine_fn_config_makefile dlls/msdmo enable_msdmo
wine_fn_config_makefile dlls/msdmo/tests enable_tests
wine_fn_config_makefile dlls/msdrm enable_msdrm
wine_fn_config_makefile dlls/msftedit enable_msftedit
+wine_fn_config_makefile dlls/msftedit/tests enable_tests
wine_fn_config_makefile dlls/msg711.acm enable_msg711_acm
wine_fn_config_makefile dlls/msgsm32.acm enable_msgsm32_acm
wine_fn_config_makefile dlls/mshtml.tlb enable_mshtml_tlb
diff --git a/configure.ac b/configure.ac
index 006f7d9fc2..605ad1690d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3451,6 +3451,7 @@ WINE_CONFIG_MAKEFILE(dlls/msdmo)
WINE_CONFIG_MAKEFILE(dlls/msdmo/tests)
WINE_CONFIG_MAKEFILE(dlls/msdrm)
WINE_CONFIG_MAKEFILE(dlls/msftedit)
+WINE_CONFIG_MAKEFILE(dlls/msftedit/tests)
WINE_CONFIG_MAKEFILE(dlls/msg711.acm)
WINE_CONFIG_MAKEFILE(dlls/msgsm32.acm)
WINE_CONFIG_MAKEFILE(dlls/mshtml.tlb)
diff --git a/dlls/msftedit/tests/Makefile.in b/dlls/msftedit/tests/Makefile.in
new file mode 100644
index 0000000000..99cc46a007
--- /dev/null
+++ b/dlls/msftedit/tests/Makefile.in
@@ -0,0 +1,5 @@
+TESTDLL = msftedit.dll
+IMPORTS = ole32 oleaut32 user32
+
+C_SRCS = \
+ richole.c
diff --git a/dlls/msftedit/tests/richole.c b/dlls/msftedit/tests/richole.c
new file mode 100644
index 0000000000..1f0db4b7e4
--- /dev/null
+++ b/dlls/msftedit/tests/richole.c
@@ -0,0 +1,198 @@
+/*
+ * Tests for IRichEditOle and friends.
+ *
+ * Copyright 2008 Google (Dan Hipschman)
+ * Copyright 2018 Jactry Zeng 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
+ */
+
+#define COBJMACROS
+
+#include <stdarg.h>
+
+#include <windef.h>
+#include <winbase.h>
+#include <initguid.h>
+#include <ole2.h>
+#include <richedit.h>
+#include <richole.h>
+#include <tom.h>
+#include <wine/test.h>
+
+static HMODULE msftedit_hmodule;
+
+#define EXPECT_REF(obj,ref) _expect_ref((IUnknown*)obj, ref, __LINE__)
+static void _expect_ref(IUnknown* obj, ULONG ref, int line)
+{
+ ULONG rc;
+ IUnknown_AddRef(obj);
+ rc = IUnknown_Release(obj);
+ ok_(__FILE__,line)(rc == ref, "expected refcount %d, got %d.\n", ref, rc);
+}
+
+static HWND new_window(LPCWSTR classname, DWORD dwstyle, HWND parent)
+{
+ HWND hwnd = CreateWindowW(classname, NULL,
+ dwstyle | WS_POPUP | WS_HSCROLL | WS_VSCROLL | WS_VISIBLE,
+ 0, 0, 200, 60, parent, NULL, msftedit_hmodule, NULL);
+ ok(hwnd != NULL, "class: %s, error: %d.\n", wine_dbgstr_w(classname), (int) GetLastError());
+ return hwnd;
+}
+
+static void test_Interfaces(void)
+{
+ IRichEditOle *reole = NULL, *reole1 = NULL;
+ ITextDocument *txtdoc = NULL;
+ ITextDocument2Old *txtdoc2old = NULL;
+ ITextDocument2 *txtdoc2 = NULL;
+ ITextSelection *txtsel = NULL, *txtsel2;
+ IUnknown *punk;
+ HRESULT hres;
+ LRESULT res;
+ HWND hwnd;
+ ULONG refcount;
+
+ hwnd = new_window(MSFTEDIT_CLASS, ES_MULTILINE, NULL);
+ if (!hwnd)
+ {
+ skip("Couldn't create window.\n");
+ return;
+ }
+
+ res = SendMessageA(hwnd, EM_GETOLEINTERFACE, 0, (LPARAM)&reole);
+ ok(res, "SendMessage\n");
+ ok(reole != NULL, "EM_GETOLEINTERFACE\n");
+ EXPECT_REF(reole, 2);
+
+ res = SendMessageA(hwnd, EM_GETOLEINTERFACE, 0, (LPARAM)&reole1);
+ ok(res == 1, "SendMessage\n");
+ ok(reole1 == reole, "Should not return a new IRichEditOle interface.\n");
+ EXPECT_REF(reole, 3);
+ IRichEditOle_Release(reole1);
+
+ hres = IRichEditOle_QueryInterface(reole, &IID_ITextDocument, (void **)&txtdoc);
+ ok(hres == S_OK, "IRichEditOle_QueryInterface failed: 0x%08x.\n", hres);
+ ok(txtdoc != NULL, "IRichEditOle_QueryInterface\n");
+
+ hres = ITextDocument_GetSelection(txtdoc, NULL);
+ ok(hres == E_INVALIDARG, "ITextDocument_GetSelection: 0x%08x.\n", hres);
+
+ EXPECT_REF(txtdoc, 3);
+
+ hres = ITextDocument_GetSelection(txtdoc, &txtsel);
+ ok(hres == S_OK, "ITextDocument_GetSelection failed 0x%08x.\n", hres);
+
+ EXPECT_REF(txtdoc, 3);
+ EXPECT_REF(txtsel, 2);
+
+ hres = ITextDocument_GetSelection(txtdoc, &txtsel2);
+ ok(hres == S_OK, "ITextDocument_GetSelection failed: 0x%08x.\n", hres);
+ ok(txtsel2 == txtsel, "got %p, %p\n", txtsel, txtsel2);
+
+ EXPECT_REF(txtdoc, 3);
+ EXPECT_REF(txtsel, 3);
+
+ ITextSelection_Release(txtsel2);
+
+ punk = NULL;
+ hres = ITextSelection_QueryInterface(txtsel, &IID_ITextSelection, (void **)&punk);
+ ok(hres == S_OK, "ITextSelection_QueryInterface failed: 0x%08x.\n", hres);
+ ok(punk != NULL, "ITextSelection_QueryInterface\n");
+ IUnknown_Release(punk);
+
+ punk = NULL;
+ hres = ITextSelection_QueryInterface(txtsel, &IID_ITextRange, (void **)&punk);
+ ok(hres == S_OK, "ITextSelection_QueryInterface failed: 0x%08x.\n", hres);
+ ok(punk != NULL, "ITextSelection_QueryInterface\n");
+ IUnknown_Release(punk);
+
+ punk = NULL;
+ hres = ITextSelection_QueryInterface(txtsel, &IID_IDispatch, (void **)&punk);
+ ok(hres == S_OK, "ITextSelection_QueryInterface failed: 0x%08x.\n", hres);
+ ok(punk != NULL, "ITextSelection_QueryInterface\n");
+ IUnknown_Release(punk);
+
+ punk = NULL;
+ hres = IRichEditOle_QueryInterface(reole, &IID_IOleClientSite, (void **)&punk);
+ ok(hres == E_NOINTERFACE, "IRichEditOle_QueryInterface: 0x%08x.\n", hres);
+
+ punk = NULL;
+ hres = IRichEditOle_QueryInterface(reole, &IID_IOleWindow, (void **)&punk);
+ ok(hres == E_NOINTERFACE, "IRichEditOle_QueryInterface: 0x%08x.\n", hres);
+
+ punk = NULL;
+ hres = IRichEditOle_QueryInterface(reole, &IID_IOleInPlaceSite, (void **)&punk);
+ ok(hres == E_NOINTERFACE, "IRichEditOle_QueryInterface: 0x%08x.\n", hres);
+
+ /* ITextDocument2 is implemented on msftedit after win8 for superseding ITextDocument2Old */
+ hres = IRichEditOle_QueryInterface(reole, &IID_ITextDocument2, (void **)&txtdoc2);
+ ok(hres == S_OK ||
+ hres == E_NOINTERFACE /* before win8 */, "IRichEditOle_QueryInterface: 0x%08x.\n", hres);
+ if (hres != E_NOINTERFACE)
+ {
+ ok(txtdoc2 != NULL, "IRichEditOle_QueryInterface\n");
+ ok((ITextDocument *)txtdoc2 == txtdoc, "Interface pointer isn't equal.\n");
+ EXPECT_REF(txtdoc2, 4);
+ EXPECT_REF(reole, 4);
+
+ hres = ITextDocument2_QueryInterface(txtdoc2, &IID_ITextDocument2Old, (void **)&txtdoc2old);
+ ok(hres == S_OK, "ITextDocument2_QueryInterface failed: 0x%08x.\n", hres);
+ EXPECT_REF(txtdoc2, 4);
+ EXPECT_REF(reole, 4);
+ EXPECT_REF(txtdoc2old, 1);
+ ITextDocument2Old_Release(txtdoc2old);
+ ITextDocument2_Release(txtdoc2);
+
+ hres = IRichEditOle_QueryInterface(reole, &IID_ITextDocument2Old, (void **)&txtdoc2old);
+ ok(hres == S_OK, "IRichEditOle_QueryInterface failed: 0x%08x.\n", hres);
+ ok(txtdoc2old != NULL, "IRichEditOle_QueryInterface\n");
+ ok((ITextDocument *)txtdoc2old != txtdoc, "Interface pointer is equal.\n");
+ EXPECT_REF(txtdoc2old, 1);
+ EXPECT_REF(reole, 3);
+ ITextDocument2Old_Release(txtdoc2old);
+ }
+ else
+ {
+ hres = IRichEditOle_QueryInterface(reole, &IID_ITextDocument2Old, (void **)&txtdoc2old);
+ ok(hres == S_OK, "IRichEditOle_QueryInterface failed: 0x%08x.\n", hres);
+ ok(txtdoc2old != NULL, "IRichEditOle_QueryInterface\n");
+ ok((ITextDocument *)txtdoc2old == txtdoc, "Interface pointer is equal.\n");
+ EXPECT_REF(txtdoc2old, 4);
+ EXPECT_REF(reole, 4);
+ ITextDocument2Old_Release(txtdoc2old);
+ }
+
+ ITextDocument_Release(txtdoc);
+ IRichEditOle_Release(reole);
+ refcount = IRichEditOle_Release(reole);
+ ok(refcount == 0, "Got wrong ref count: %d.\n", refcount);
+ DestroyWindow(hwnd);
+
+ /* Methods should return CO_E_RELEASED if the backing document has
+ been released. One test should suffice. */
+ hres = ITextSelection_CanEdit(txtsel, NULL);
+ ok(hres == CO_E_RELEASED, "ITextSelection after ITextDocument destroyed\n");
+
+ ITextSelection_Release(txtsel);
+}
+
+START_TEST(richole)
+{
+ msftedit_hmodule = LoadLibraryA("msftedit.dll");
+ ok(msftedit_hmodule != NULL, "error: %d\n", (int) GetLastError());
+
+ test_Interfaces();
+}
--
2.18.0
Sept. 13, 2018
[PATCH v3 3/4] riched20: Add IID_ITextDocument2Old support for ITextServices_QueryInterface().
by Jactry Zeng
Superseded patch 150977.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=20613
Signed-off-by: Jactry Zeng <jzeng(a)codeweavers.com>
---
dlls/riched20/tests/txtsrv.c | 34 ++++++++++++++++++++++++++++++++++
dlls/riched20/txtsrv.c | 5 +++--
2 files changed, 37 insertions(+), 2 deletions(-)
diff --git a/dlls/riched20/tests/txtsrv.c b/dlls/riched20/tests/txtsrv.c
index a8cf6ff1ad..1aa08f89a4 100644
--- a/dlls/riched20/tests/txtsrv.c
+++ b/dlls/riched20/tests/txtsrv.c
@@ -904,6 +904,7 @@ static void test_QueryInterface(void)
HRESULT hres;
IRichEditOle *reole, *txtsrv_reole;
ITextDocument *txtdoc, *txtsrv_txtdoc;
+ ITextDocument2Old *txtdoc2old, *txtsrv_txtdoc2old;
ULONG refcount;
if(!init_texthost(&txtserv, &host))
@@ -930,6 +931,17 @@ static void test_QueryInterface(void)
ITextDocument_Release(txtdoc);
refcount = get_refcount((IUnknown *)txtserv);
ok(refcount == 2, "got wrong ref count: %d\n", refcount);
+
+ hres = IRichEditOle_QueryInterface(txtsrv_reole, &IID_ITextDocument2Old, (void **)&txtdoc2old);
+ ok(hres == S_OK, "IRichEditOle_QueryInterface: 0x%08x\n", hres);
+ refcount = get_refcount((IUnknown *)txtserv);
+ ok(refcount == 3, "got wrong ref count: %d\n", refcount);
+ refcount = get_refcount((IUnknown *)txtsrv_reole);
+ ok(refcount == 3, "got wrong ref count: %d\n", refcount);
+
+ ITextDocument2Old_Release(txtdoc2old);
+ refcount = get_refcount((IUnknown *)txtserv);
+ ok(refcount == 2, "got wrong ref count: %d\n", refcount);
IRichEditOle_Release(txtsrv_reole);
refcount = get_refcount((IUnknown *)txtserv);
ok(refcount == 1, "got wrong ref count: %d\n", refcount);
@@ -956,6 +968,28 @@ static void test_QueryInterface(void)
refcount = get_refcount((IUnknown *)txtserv);
ok(refcount == 1, "got wrong ref count: %d\n", refcount);
+ /* ITextDocument2Old */
+ hres = ITextServices_QueryInterface(txtserv, &IID_ITextDocument2Old, (void **)&txtsrv_txtdoc2old);
+ ok(hres == S_OK, "ITextServices_QueryInterface: 0x%08x\n", hres);
+ refcount = get_refcount((IUnknown *)txtserv);
+ ok(refcount == 2, "got wrong ref count: %d\n", refcount);
+ refcount = get_refcount((IUnknown *)txtsrv_txtdoc2old);
+ ok(refcount == 2, "got wrong ref count: %d\n", refcount);
+
+ hres = ITextDocument2Old_QueryInterface(txtsrv_txtdoc2old, &IID_IRichEditOle, (void **)&reole);
+ ok(hres == S_OK, "ITextDocument2Old_QueryInterface: 0x%08x\n", hres);
+ refcount = get_refcount((IUnknown *)txtserv);
+ ok(refcount == 3, "got wrong ref count: %d\n", refcount);
+ refcount = get_refcount((IUnknown *)txtsrv_txtdoc2old);
+ ok(refcount == 3, "got wrong ref count: %d\n", refcount);
+
+ IRichEditOle_Release(reole);
+ refcount = get_refcount((IUnknown *)txtserv);
+ ok(refcount == 2, "got wrong ref count: %d\n", refcount);
+ ITextDocument2Old_Release(txtsrv_txtdoc2old);
+ refcount = get_refcount((IUnknown *)txtserv);
+ ok(refcount == 1, "got wrong ref count: %d\n", refcount);
+
ITextServices_Release(txtserv);
ITextHost_Release(host);
}
diff --git a/dlls/riched20/txtsrv.c b/dlls/riched20/txtsrv.c
index 5ab3322e6b..cf957cff89 100644
--- a/dlls/riched20/txtsrv.c
+++ b/dlls/riched20/txtsrv.c
@@ -78,11 +78,12 @@ static HRESULT WINAPI ITextServicesImpl_QueryInterface(IUnknown *iface, REFIID r
*ppv = &This->IUnknown_inner;
else if (IsEqualIID(riid, &IID_ITextServices))
*ppv = &This->ITextServices_iface;
- else if (IsEqualIID(riid, &IID_IRichEditOle) || IsEqualIID(riid, &IID_ITextDocument)) {
+ else if (IsEqualIID(riid, &IID_IRichEditOle) || IsEqualIID(riid, &IID_ITextDocument) ||
+ IsEqualIID(riid, &IID_ITextDocument2Old)) {
if (!This->editor->reOle)
if (!CreateIRichEditOle(This->outer_unk, This->editor, (void **)(&This->editor->reOle)))
return E_OUTOFMEMORY;
- if (IsEqualIID(riid, &IID_ITextDocument))
+ if (IsEqualIID(riid, &IID_ITextDocument) || IsEqualIID(riid, &IID_ITextDocument2Old))
ME_GetITextDocument2OldInterface(This->editor->reOle, ppv);
else
*ppv = This->editor->reOle;
--
2.18.0
Sept. 13, 2018
[PATCH v3 2/4] riched20: Add stub for ITextDocument2Old interface.
by Jactry Zeng
Superseded patch 150976.
Signed-off-by: Jactry Zeng <jzeng(a)codeweavers.com>
---
dlls/riched20/editor.h | 2 +-
dlls/riched20/richole.c | 445 ++++++++++++++++++++++++----------
dlls/riched20/tests/richole.c | 9 +
dlls/riched20/txtsrv.c | 2 +-
4 files changed, 325 insertions(+), 133 deletions(-)
diff --git a/dlls/riched20/editor.h b/dlls/riched20/editor.h
index 141c63aca9..eba6d35fc7 100644
--- a/dlls/riched20/editor.h
+++ b/dlls/riched20/editor.h
@@ -233,7 +233,7 @@ void ME_DrawOLE(ME_Context *c, int x, int y, ME_Run* run, BOOL selected) DECLSPE
void ME_GetOLEObjectSize(const ME_Context *c, ME_Run *run, SIZE *pSize) DECLSPEC_HIDDEN;
void ME_CopyReObject(REOBJECT *dst, const REOBJECT *src, DWORD flags) DECLSPEC_HIDDEN;
void ME_DeleteReObject(struct re_object *re_object) DECLSPEC_HIDDEN;
-void ME_GetITextDocumentInterface(IRichEditOle *iface, LPVOID *ppvObj) DECLSPEC_HIDDEN;
+void ME_GetITextDocument2OldInterface(IRichEditOle *iface, LPVOID *ppvObj) DECLSPEC_HIDDEN;
/* editor.c */
ME_TextEditor *ME_MakeEditor(ITextHost *texthost, BOOL bEmulateVersion10) DECLSPEC_HIDDEN;
diff --git a/dlls/riched20/richole.c b/dlls/riched20/richole.c
index 11b9920b57..8d43ce6ce1 100644
--- a/dlls/riched20/richole.c
+++ b/dlls/riched20/richole.c
@@ -46,6 +46,7 @@ DEFINE_GUID(IID_ITextServices, 0x8d33f740, 0xcf58, 0x11ce, 0xa8, 0x9d, 0x00, 0xa
DEFINE_GUID(IID_ITextHost, 0x13e670f4,0x1a5a,0x11cf,0xab,0xeb,0x00,0xaa,0x00,0xb6,0x5e,0xa1);
DEFINE_GUID(IID_ITextHost2, 0x13e670f5,0x1a5a,0x11cf,0xab,0xeb,0x00,0xaa,0x00,0xb6,0x5e,0xa1);
DEFINE_GUID(IID_ITextDocument, 0x8cc497c0, 0xa1df, 0x11ce, 0x80, 0x98, 0x00, 0xaa, 0x00, 0x47, 0xbe, 0x5d);
+DEFINE_GUID(IID_ITextDocument2Old, 0x01c25500, 0x4268, 0x11d1, 0x88, 0x3a, 0x3c, 0x8b, 0x00, 0xc1, 0x00, 0x00);
DEFINE_GUID(IID_ITextRange, 0x8cc497c2, 0xa1df, 0x11ce, 0x80, 0x98, 0x00, 0xaa, 0x00, 0x47, 0xbe, 0x5d);
DEFINE_GUID(IID_ITextSelection, 0x8cc497c1, 0xa1df, 0x11ce, 0x80, 0x98, 0x00, 0xaa, 0x00, 0x47, 0xbe, 0x5d);
DEFINE_GUID(IID_ITextFont, 0x8cc497c3, 0xa1df, 0x11ce, 0x80, 0x98, 0x00, 0xaa, 0x00, 0x47, 0xbe, 0x5d);
@@ -55,7 +56,7 @@ static ITypeLib *typelib;
enum tid_t {
NULL_tid,
- ITextDocument_tid,
+ ITextDocument2Old_tid,
ITextRange_tid,
ITextSelection_tid,
ITextFont_tid,
@@ -66,7 +67,7 @@ enum tid_t {
static const IID * const tid_ids[] =
{
&IID_NULL,
- &IID_ITextDocument,
+ &IID_ITextDocument2Old,
&IID_ITextRange,
&IID_ITextSelection,
&IID_ITextFont,
@@ -208,7 +209,7 @@ enum range_update_op {
typedef struct IRichEditOleImpl {
IUnknown IUnknown_inner;
IRichEditOle IRichEditOle_iface;
- ITextDocument ITextDocument_iface;
+ ITextDocument2Old ITextDocument2Old_iface;
IUnknown *outer_unk;
LONG ref;
@@ -267,9 +268,9 @@ static inline IRichEditOleImpl *impl_from_IRichEditOle(IRichEditOle *iface)
return CONTAINING_RECORD(iface, IRichEditOleImpl, IRichEditOle_iface);
}
-static inline IRichEditOleImpl *impl_from_ITextDocument(ITextDocument *iface)
+static inline IRichEditOleImpl *impl_from_ITextDocument2Old(ITextDocument2Old *iface)
{
- return CONTAINING_RECORD(iface, IRichEditOleImpl, ITextDocument_iface);
+ return CONTAINING_RECORD(iface, IRichEditOleImpl, ITextDocument2Old_iface);
}
static inline IRichEditOleImpl *impl_from_IUnknown(IUnknown *iface)
@@ -943,8 +944,8 @@ static HRESULT WINAPI IRichEditOleImpl_inner_fnQueryInterface(IUnknown *iface, R
*ppvObj = &This->IUnknown_inner;
else if (IsEqualGUID(riid, &IID_IRichEditOle))
*ppvObj = &This->IRichEditOle_iface;
- else if (IsEqualGUID(riid, &IID_ITextDocument))
- *ppvObj = &This->ITextDocument_iface;
+ else if (IsEqualGUID(riid, &IID_ITextDocument) || IsEqualGUID(riid, &IID_ITextDocument2Old))
+ *ppvObj = &This->ITextDocument2Old_iface;
if (*ppvObj)
{
IUnknown_AddRef((IUnknown *)*ppvObj);
@@ -3859,76 +3860,71 @@ static HRESULT create_textpara(ITextRange *range, ITextPara **ret)
}
/* ITextDocument */
-static HRESULT WINAPI
-ITextDocument_fnQueryInterface(ITextDocument* me, REFIID riid,
- void** ppvObject)
+static HRESULT WINAPI ITextDocument2Old_fnQueryInterface(ITextDocument2Old* iface, REFIID riid,
+ void **ppvObject)
{
- IRichEditOleImpl *This = impl_from_ITextDocument(me);
+ IRichEditOleImpl *This = impl_from_ITextDocument2Old(iface);
return IRichEditOle_QueryInterface(&This->IRichEditOle_iface, riid, ppvObject);
}
-static ULONG WINAPI
-ITextDocument_fnAddRef(ITextDocument* me)
+static ULONG WINAPI ITextDocument2Old_fnAddRef(ITextDocument2Old *iface)
{
- IRichEditOleImpl *This = impl_from_ITextDocument(me);
+ IRichEditOleImpl *This = impl_from_ITextDocument2Old(iface);
return IRichEditOle_AddRef(&This->IRichEditOle_iface);
}
-static ULONG WINAPI
-ITextDocument_fnRelease(ITextDocument* me)
+static ULONG WINAPI ITextDocument2Old_fnRelease(ITextDocument2Old *iface)
{
- IRichEditOleImpl *This = impl_from_ITextDocument(me);
+ IRichEditOleImpl *This = impl_from_ITextDocument2Old(iface);
return IRichEditOle_Release(&This->IRichEditOle_iface);
}
-static HRESULT WINAPI
-ITextDocument_fnGetTypeInfoCount(ITextDocument* me,
- UINT* pctinfo)
+static HRESULT WINAPI ITextDocument2Old_fnGetTypeInfoCount(ITextDocument2Old *iface,
+ UINT *pctinfo)
{
- IRichEditOleImpl *This = impl_from_ITextDocument(me);
+ IRichEditOleImpl *This = impl_from_ITextDocument2Old(iface);
TRACE("(%p)->(%p)\n", This, pctinfo);
*pctinfo = 1;
return S_OK;
}
-static HRESULT WINAPI
-ITextDocument_fnGetTypeInfo(ITextDocument* me, UINT iTInfo, LCID lcid,
- ITypeInfo** ppTInfo)
+static HRESULT WINAPI ITextDocument2Old_fnGetTypeInfo(ITextDocument2Old *iface, UINT iTInfo, LCID lcid,
+ ITypeInfo **ppTInfo)
{
- IRichEditOleImpl *This = impl_from_ITextDocument(me);
+ IRichEditOleImpl *This = impl_from_ITextDocument2Old(iface);
HRESULT hr;
TRACE("(%p)->(%u,%d,%p)\n", This, iTInfo, lcid, ppTInfo);
- hr = get_typeinfo(ITextDocument_tid, ppTInfo);
+ hr = get_typeinfo(ITextDocument2Old_tid, ppTInfo);
if (SUCCEEDED(hr))
ITypeInfo_AddRef(*ppTInfo);
return hr;
}
-static HRESULT WINAPI
-ITextDocument_fnGetIDsOfNames(ITextDocument* me, REFIID riid,
- LPOLESTR* rgszNames, UINT cNames, LCID lcid, DISPID* rgDispId)
+static HRESULT WINAPI ITextDocument2Old_fnGetIDsOfNames(ITextDocument2Old *iface, REFIID riid,
+ LPOLESTR *rgszNames, UINT cNames,
+ LCID lcid, DISPID *rgDispId)
{
- IRichEditOleImpl *This = impl_from_ITextDocument(me);
+ IRichEditOleImpl *This = impl_from_ITextDocument2Old(iface);
ITypeInfo *ti;
HRESULT hr;
TRACE("(%p)->(%s, %p, %u, %d, %p)\n", This, debugstr_guid(riid),
rgszNames, cNames, lcid, rgDispId);
- hr = get_typeinfo(ITextDocument_tid, &ti);
+ hr = get_typeinfo(ITextDocument2Old_tid, &ti);
if (SUCCEEDED(hr))
hr = ITypeInfo_GetIDsOfNames(ti, rgszNames, cNames, rgDispId);
return hr;
}
-static HRESULT WINAPI
-ITextDocument_fnInvoke(ITextDocument* me, DISPID dispIdMember,
- REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS* pDispParams,
- VARIANT* pVarResult, EXCEPINFO* pExcepInfo, UINT* puArgErr)
+static HRESULT WINAPI ITextDocument2Old_fnInvoke(ITextDocument2Old *iface, DISPID dispIdMember,
+ REFIID riid, LCID lcid, WORD wFlags,
+ DISPPARAMS *pDispParams, VARIANT *pVarResult,
+ EXCEPINFO *pExcepInfo, UINT *puArgErr)
{
- IRichEditOleImpl *This = impl_from_ITextDocument(me);
+ IRichEditOleImpl *This = impl_from_ITextDocument2Old(iface);
ITypeInfo *ti;
HRESULT hr;
@@ -3936,26 +3932,24 @@ ITextDocument_fnInvoke(ITextDocument* me, DISPID dispIdMember,
debugstr_guid(riid), lcid, wFlags, pDispParams, pVarResult,
pExcepInfo, puArgErr);
- hr = get_typeinfo(ITextDocument_tid, &ti);
+ hr = get_typeinfo(ITextDocument2Old_tid, &ti);
if (SUCCEEDED(hr))
- hr = ITypeInfo_Invoke(ti, me, dispIdMember, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
+ hr = ITypeInfo_Invoke(ti, iface, dispIdMember, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
return hr;
}
-static HRESULT WINAPI
-ITextDocument_fnGetName(ITextDocument* me, BSTR* pName)
+static HRESULT WINAPI ITextDocument2Old_fnGetName(ITextDocument2Old *iface, BSTR *pName)
{
- IRichEditOleImpl *This = impl_from_ITextDocument(me);
+ IRichEditOleImpl *This = impl_from_ITextDocument2Old(iface);
FIXME("stub %p\n",This);
return E_NOTIMPL;
}
-static HRESULT WINAPI
-ITextDocument_fnGetSelection(ITextDocument *me, ITextSelection **selection)
+static HRESULT WINAPI ITextDocument2Old_fnGetSelection(ITextDocument2Old *iface, ITextSelection **selection)
{
- IRichEditOleImpl *This = impl_from_ITextDocument(me);
+ IRichEditOleImpl *This = impl_from_ITextDocument2Old(iface);
- TRACE("(%p)->(%p)\n", me, selection);
+ TRACE("(%p)->(%p)\n", iface, selection);
if (!selection)
return E_INVALIDARG;
@@ -3973,125 +3967,110 @@ ITextDocument_fnGetSelection(ITextDocument *me, ITextSelection **selection)
return S_OK;
}
-static HRESULT WINAPI
-ITextDocument_fnGetStoryCount(ITextDocument* me, LONG* pCount)
+static HRESULT WINAPI ITextDocument2Old_fnGetStoryCount(ITextDocument2Old *iface, LONG *pCount)
{
- IRichEditOleImpl *This = impl_from_ITextDocument(me);
+ IRichEditOleImpl *This = impl_from_ITextDocument2Old(iface);
FIXME("stub %p\n",This);
return E_NOTIMPL;
}
-static HRESULT WINAPI
-ITextDocument_fnGetStoryRanges(ITextDocument* me,
- ITextStoryRanges** ppStories)
+static HRESULT WINAPI ITextDocument2Old_fnGetStoryRanges(ITextDocument2Old *iface,
+ ITextStoryRanges **ppStories)
{
- IRichEditOleImpl *This = impl_from_ITextDocument(me);
+ IRichEditOleImpl *This = impl_from_ITextDocument2Old(iface);
FIXME("stub %p\n",This);
return E_NOTIMPL;
}
-static HRESULT WINAPI
-ITextDocument_fnGetSaved(ITextDocument* me, LONG* pValue)
+static HRESULT WINAPI ITextDocument2Old_fnGetSaved(ITextDocument2Old *iface, LONG *pValue)
{
- IRichEditOleImpl *This = impl_from_ITextDocument(me);
+ IRichEditOleImpl *This = impl_from_ITextDocument2Old(iface);
FIXME("stub %p\n",This);
return E_NOTIMPL;
}
-static HRESULT WINAPI
-ITextDocument_fnSetSaved(ITextDocument* me, LONG Value)
+static HRESULT WINAPI ITextDocument2Old_fnSetSaved(ITextDocument2Old *iface, LONG Value)
{
- IRichEditOleImpl *This = impl_from_ITextDocument(me);
+ IRichEditOleImpl *This = impl_from_ITextDocument2Old(iface);
FIXME("stub %p\n",This);
return E_NOTIMPL;
}
-static HRESULT WINAPI
-ITextDocument_fnGetDefaultTabStop(ITextDocument* me, float* pValue)
+static HRESULT WINAPI ITextDocument2Old_fnGetDefaultTabStop(ITextDocument2Old *iface, float *pValue)
{
- IRichEditOleImpl *This = impl_from_ITextDocument(me);
+ IRichEditOleImpl *This = impl_from_ITextDocument2Old(iface);
FIXME("stub %p\n",This);
return E_NOTIMPL;
}
-static HRESULT WINAPI
-ITextDocument_fnSetDefaultTabStop(ITextDocument* me, float Value)
+static HRESULT WINAPI ITextDocument2Old_fnSetDefaultTabStop(ITextDocument2Old *iface, float Value)
{
- IRichEditOleImpl *This = impl_from_ITextDocument(me);
+ IRichEditOleImpl *This = impl_from_ITextDocument2Old(iface);
FIXME("stub %p\n",This);
return E_NOTIMPL;
}
-static HRESULT WINAPI
-ITextDocument_fnNew(ITextDocument* me)
+static HRESULT WINAPI ITextDocument2Old_fnNew(ITextDocument2Old *iface)
{
- IRichEditOleImpl *This = impl_from_ITextDocument(me);
+ IRichEditOleImpl *This = impl_from_ITextDocument2Old(iface);
FIXME("stub %p\n",This);
return E_NOTIMPL;
}
-static HRESULT WINAPI
-ITextDocument_fnOpen(ITextDocument* me, VARIANT* pVar, LONG Flags,
- LONG CodePage)
+static HRESULT WINAPI ITextDocument2Old_fnOpen(ITextDocument2Old *iface, VARIANT *pVar,
+ LONG Flags, LONG CodePage)
{
- IRichEditOleImpl *This = impl_from_ITextDocument(me);
+ IRichEditOleImpl *This = impl_from_ITextDocument2Old(iface);
FIXME("stub %p\n",This);
return E_NOTIMPL;
}
-static HRESULT WINAPI
-ITextDocument_fnSave(ITextDocument* me, VARIANT* pVar, LONG Flags,
- LONG CodePage)
+static HRESULT WINAPI ITextDocument2Old_fnSave(ITextDocument2Old *iface, VARIANT *pVar,
+ LONG Flags, LONG CodePage)
{
- IRichEditOleImpl *This = impl_from_ITextDocument(me);
+ IRichEditOleImpl *This = impl_from_ITextDocument2Old(iface);
FIXME("stub %p\n",This);
return E_NOTIMPL;
}
-static HRESULT WINAPI
-ITextDocument_fnFreeze(ITextDocument* me, LONG* pCount)
+static HRESULT WINAPI ITextDocument2Old_fnFreeze(ITextDocument2Old *iface, LONG *pCount)
{
- IRichEditOleImpl *This = impl_from_ITextDocument(me);
+ IRichEditOleImpl *This = impl_from_ITextDocument2Old(iface);
FIXME("stub %p\n",This);
return E_NOTIMPL;
}
-static HRESULT WINAPI
-ITextDocument_fnUnfreeze(ITextDocument* me, LONG* pCount)
+static HRESULT WINAPI ITextDocument2Old_fnUnfreeze(ITextDocument2Old *iface, LONG *pCount)
{
- IRichEditOleImpl *This = impl_from_ITextDocument(me);
+ IRichEditOleImpl *This = impl_from_ITextDocument2Old(iface);
FIXME("stub %p\n",This);
return E_NOTIMPL;
}
-static HRESULT WINAPI
-ITextDocument_fnBeginEditCollection(ITextDocument* me)
+static HRESULT WINAPI ITextDocument2Old_fnBeginEditCollection(ITextDocument2Old *iface)
{
- IRichEditOleImpl *This = impl_from_ITextDocument(me);
+ IRichEditOleImpl *This = impl_from_ITextDocument2Old(iface);
FIXME("stub %p\n",This);
return E_NOTIMPL;
}
-static HRESULT WINAPI
-ITextDocument_fnEndEditCollection(ITextDocument* me)
+static HRESULT WINAPI ITextDocument2Old_fnEndEditCollection(ITextDocument2Old *iface)
{
- IRichEditOleImpl *This = impl_from_ITextDocument(me);
+ IRichEditOleImpl *This = impl_from_ITextDocument2Old(iface);
FIXME("stub %p\n",This);
return E_NOTIMPL;
}
-static HRESULT WINAPI
-ITextDocument_fnUndo(ITextDocument* me, LONG Count, LONG* prop)
+static HRESULT WINAPI ITextDocument2Old_fnUndo(ITextDocument2Old *iface, LONG Count, LONG *prop)
{
- IRichEditOleImpl *This = impl_from_ITextDocument(me);
+ IRichEditOleImpl *This = impl_from_ITextDocument2Old(iface);
FIXME("stub %p\n",This);
return E_NOTIMPL;
}
-static HRESULT WINAPI
-ITextDocument_fnRedo(ITextDocument* me, LONG Count, LONG* prop)
+static HRESULT WINAPI ITextDocument2Old_fnRedo(ITextDocument2Old *iface, LONG Count, LONG *prop)
{
- IRichEditOleImpl *This = impl_from_ITextDocument(me);
+ IRichEditOleImpl *This = impl_from_ITextDocument2Old(iface);
FIXME("stub %p\n",This);
return E_NOTIMPL;
}
@@ -4112,11 +4091,10 @@ static HRESULT CreateITextRange(IRichEditOleImpl *reOle, LONG start, LONG end, I
return S_OK;
}
-static HRESULT WINAPI
-ITextDocument_fnRange(ITextDocument* me, LONG cp1, LONG cp2,
- ITextRange** ppRange)
+static HRESULT WINAPI ITextDocument2Old_fnRange(ITextDocument2Old *iface, LONG cp1, LONG cp2,
+ ITextRange **ppRange)
{
- IRichEditOleImpl *This = impl_from_ITextDocument(me);
+ IRichEditOleImpl *This = impl_from_ITextDocument2Old(iface);
const int len = ME_GetTextLength(This->editor) + 1;
TRACE("%p %p %d %d\n", This, ppRange, cp1, cp2);
@@ -4140,42 +4118,247 @@ ITextDocument_fnRange(ITextDocument* me, LONG cp1, LONG cp2,
return CreateITextRange(This, cp1, cp2, ppRange);
}
-static HRESULT WINAPI
-ITextDocument_fnRangeFromPoint(ITextDocument* me, LONG x, LONG y,
- ITextRange** ppRange)
+static HRESULT WINAPI ITextDocument2Old_fnRangeFromPoint(ITextDocument2Old *iface, LONG x, LONG y,
+ ITextRange **ppRange)
{
- IRichEditOleImpl *This = impl_from_ITextDocument(me);
+ IRichEditOleImpl *This = impl_from_ITextDocument2Old(iface);
FIXME("stub %p\n",This);
return E_NOTIMPL;
}
-static const ITextDocumentVtbl tdvt = {
- ITextDocument_fnQueryInterface,
- ITextDocument_fnAddRef,
- ITextDocument_fnRelease,
- ITextDocument_fnGetTypeInfoCount,
- ITextDocument_fnGetTypeInfo,
- ITextDocument_fnGetIDsOfNames,
- ITextDocument_fnInvoke,
- ITextDocument_fnGetName,
- ITextDocument_fnGetSelection,
- ITextDocument_fnGetStoryCount,
- ITextDocument_fnGetStoryRanges,
- ITextDocument_fnGetSaved,
- ITextDocument_fnSetSaved,
- ITextDocument_fnGetDefaultTabStop,
- ITextDocument_fnSetDefaultTabStop,
- ITextDocument_fnNew,
- ITextDocument_fnOpen,
- ITextDocument_fnSave,
- ITextDocument_fnFreeze,
- ITextDocument_fnUnfreeze,
- ITextDocument_fnBeginEditCollection,
- ITextDocument_fnEndEditCollection,
- ITextDocument_fnUndo,
- ITextDocument_fnRedo,
- ITextDocument_fnRange,
- ITextDocument_fnRangeFromPoint
+/* ITextDocument2Old methods */
+static HRESULT WINAPI ITextDocument2Old_fnAttachMsgFilter(ITextDocument2Old *iface, IUnknown *filter)
+{
+ IRichEditOleImpl *This = impl_from_ITextDocument2Old(iface);
+
+ FIXME("(%p)->(%p): stub\n", This, filter);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI ITextDocument2Old_fnSetEffectColor(ITextDocument2Old *iface, LONG index, COLORREF cr)
+{
+ IRichEditOleImpl *This = impl_from_ITextDocument2Old(iface);
+
+ FIXME("(%p)->(%d, 0x%x): stub\n", This, index, cr);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI ITextDocument2Old_fnGetEffectColor(ITextDocument2Old *iface, LONG index, COLORREF *cr)
+{
+ IRichEditOleImpl *This = impl_from_ITextDocument2Old(iface);
+
+ FIXME("(%p)->(%d, %p): stub\n", This, index, cr);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI ITextDocument2Old_fnGetCaretType(ITextDocument2Old *iface, LONG *type)
+{
+ IRichEditOleImpl *This = impl_from_ITextDocument2Old(iface);
+
+ FIXME("(%p)->(%p): stub\n", This, type);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI ITextDocument2Old_fnSetCaretType(ITextDocument2Old *iface, LONG type)
+{
+ IRichEditOleImpl *This = impl_from_ITextDocument2Old(iface);
+
+ FIXME("(%p)->(%d): stub\n", This, type);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI ITextDocument2Old_fnGetImmContext(ITextDocument2Old *iface, LONG *context)
+{
+ IRichEditOleImpl *This = impl_from_ITextDocument2Old(iface);
+
+ FIXME("(%p)->(%p): stub\n", This, context);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI ITextDocument2Old_fnReleaseImmContext(ITextDocument2Old *iface, LONG context)
+{
+ IRichEditOleImpl *This = impl_from_ITextDocument2Old(iface);
+
+ FIXME("(%p)->(%d): stub\n", This, context);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI ITextDocument2Old_fnGetPreferredFont(ITextDocument2Old *iface, LONG cp, LONG charrep,
+ LONG options, LONG current_charrep, LONG current_fontsize,
+ BSTR *bstr, LONG *pitch_family, LONG *new_fontsize)
+{
+ IRichEditOleImpl *This = impl_from_ITextDocument2Old(iface);
+
+ FIXME("(%p)->(%d, %d, %d, %d, %d, %p, %p, %p): stub\n", This, cp, charrep, options, current_charrep,
+ current_fontsize, bstr, pitch_family, new_fontsize);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI ITextDocument2Old_fnGetNotificationMode(ITextDocument2Old *iface, LONG *mode)
+{
+ IRichEditOleImpl *This = impl_from_ITextDocument2Old(iface);
+
+ FIXME("(%p)->(%p): stub\n", This, mode);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI ITextDocument2Old_fnSetNotificationMode(ITextDocument2Old *iface, LONG mode)
+{
+ IRichEditOleImpl *This = impl_from_ITextDocument2Old(iface);
+
+ FIXME("(%p)->(0x%x): stub\n", This, mode);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI ITextDocument2Old_fnGetClientRect(ITextDocument2Old *iface, LONG type, LONG *left, LONG *top,
+ LONG *right, LONG *bottom)
+{
+ IRichEditOleImpl *This = impl_from_ITextDocument2Old(iface);
+
+ FIXME("(%p)->(%d, %p, %p, %p, %p): stub\n", This, type, left, top, right, bottom);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI ITextDocument2Old_fnGetSelectionEx(ITextDocument2Old *iface, ITextSelection **selection)
+{
+ IRichEditOleImpl *This = impl_from_ITextDocument2Old(iface);
+
+ FIXME("(%p)->(%p): stub\n", This, selection);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI ITextDocument2Old_fnGetWindow(ITextDocument2Old *iface, LONG *hwnd)
+{
+ IRichEditOleImpl *This = impl_from_ITextDocument2Old(iface);
+
+ FIXME("(%p)->(%p): stub\n", This, hwnd);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI ITextDocument2Old_fnGetFEFlags(ITextDocument2Old *iface, LONG *flags)
+{
+ IRichEditOleImpl *This = impl_from_ITextDocument2Old(iface);
+
+ FIXME("(%p)->(%p): stub\n", This, flags);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI ITextDocument2Old_fnUpdateWindow(ITextDocument2Old *iface)
+{
+ IRichEditOleImpl *This = impl_from_ITextDocument2Old(iface);
+
+ FIXME("(%p): stub\n", This);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI ITextDocument2Old_fnCheckTextLimit(ITextDocument2Old *iface, LONG cch, LONG *exceed)
+{
+ IRichEditOleImpl *This = impl_from_ITextDocument2Old(iface);
+
+ FIXME("(%p)->(%d, %p): stub\n", This, cch, exceed);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI ITextDocument2Old_fnIMEInProgress(ITextDocument2Old *iface, LONG mode)
+{
+ IRichEditOleImpl *This = impl_from_ITextDocument2Old(iface);
+
+ FIXME("(%p)->(0x%x): stub\n", This, mode);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI ITextDocument2Old_fnSysBeep(ITextDocument2Old *iface)
+{
+ IRichEditOleImpl *This = impl_from_ITextDocument2Old(iface);
+
+ FIXME("(%p): stub\n", This);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI ITextDocument2Old_fnUpdate(ITextDocument2Old *iface, LONG mode)
+{
+ IRichEditOleImpl *This = impl_from_ITextDocument2Old(iface);
+
+ FIXME("(%p)->(0x%x): stub\n", This, mode);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI ITextDocument2Old_fnNotify(ITextDocument2Old *iface, LONG notify)
+{
+ IRichEditOleImpl *This = impl_from_ITextDocument2Old(iface);
+
+ FIXME("(%p)->(%d): stub\n", This, notify);
+
+ return E_NOTIMPL;
+}
+
+static const ITextDocument2OldVtbl tdvt = {
+ ITextDocument2Old_fnQueryInterface,
+ ITextDocument2Old_fnAddRef,
+ ITextDocument2Old_fnRelease,
+ ITextDocument2Old_fnGetTypeInfoCount,
+ ITextDocument2Old_fnGetTypeInfo,
+ ITextDocument2Old_fnGetIDsOfNames,
+ ITextDocument2Old_fnInvoke,
+ ITextDocument2Old_fnGetName,
+ ITextDocument2Old_fnGetSelection,
+ ITextDocument2Old_fnGetStoryCount,
+ ITextDocument2Old_fnGetStoryRanges,
+ ITextDocument2Old_fnGetSaved,
+ ITextDocument2Old_fnSetSaved,
+ ITextDocument2Old_fnGetDefaultTabStop,
+ ITextDocument2Old_fnSetDefaultTabStop,
+ ITextDocument2Old_fnNew,
+ ITextDocument2Old_fnOpen,
+ ITextDocument2Old_fnSave,
+ ITextDocument2Old_fnFreeze,
+ ITextDocument2Old_fnUnfreeze,
+ ITextDocument2Old_fnBeginEditCollection,
+ ITextDocument2Old_fnEndEditCollection,
+ ITextDocument2Old_fnUndo,
+ ITextDocument2Old_fnRedo,
+ ITextDocument2Old_fnRange,
+ ITextDocument2Old_fnRangeFromPoint,
+ /* ITextDocument2Old methods */
+ ITextDocument2Old_fnAttachMsgFilter,
+ ITextDocument2Old_fnSetEffectColor,
+ ITextDocument2Old_fnGetEffectColor,
+ ITextDocument2Old_fnGetCaretType,
+ ITextDocument2Old_fnSetCaretType,
+ ITextDocument2Old_fnGetImmContext,
+ ITextDocument2Old_fnReleaseImmContext,
+ ITextDocument2Old_fnGetPreferredFont,
+ ITextDocument2Old_fnGetNotificationMode,
+ ITextDocument2Old_fnSetNotificationMode,
+ ITextDocument2Old_fnGetClientRect,
+ ITextDocument2Old_fnGetSelectionEx,
+ ITextDocument2Old_fnGetWindow,
+ ITextDocument2Old_fnGetFEFlags,
+ ITextDocument2Old_fnUpdateWindow,
+ ITextDocument2Old_fnCheckTextLimit,
+ ITextDocument2Old_fnIMEInProgress,
+ ITextDocument2Old_fnSysBeep,
+ ITextDocument2Old_fnUpdate,
+ ITextDocument2Old_fnNotify
};
/* ITextSelection */
@@ -5276,7 +5459,7 @@ LRESULT CreateIRichEditOle(IUnknown *outer_unk, ME_TextEditor *editor, LPVOID *p
reo->IUnknown_inner.lpVtbl = &reo_unk_vtbl;
reo->IRichEditOle_iface.lpVtbl = &revt;
- reo->ITextDocument_iface.lpVtbl = &tdvt;
+ reo->ITextDocument2Old_iface.lpVtbl = &tdvt;
reo->ref = 1;
reo->editor = editor;
reo->txtSel = NULL;
@@ -5509,8 +5692,8 @@ void ME_CopyReObject(REOBJECT *dst, const REOBJECT *src, DWORD flags)
}
}
-void ME_GetITextDocumentInterface(IRichEditOle *iface, LPVOID *ppvObj)
+void ME_GetITextDocument2OldInterface(IRichEditOle *iface, LPVOID *ppvObj)
{
IRichEditOleImpl *This = impl_from_IRichEditOle(iface);
- *ppvObj = &This->ITextDocument_iface;
+ *ppvObj = &This->ITextDocument2Old_iface;
}
diff --git a/dlls/riched20/tests/richole.c b/dlls/riched20/tests/richole.c
index aaf52bcfdd..3e42047a57 100644
--- a/dlls/riched20/tests/richole.c
+++ b/dlls/riched20/tests/richole.c
@@ -117,6 +117,7 @@ static void test_Interfaces(void)
{
IRichEditOle *reOle = NULL, *reOle1 = NULL;
ITextDocument *txtDoc = NULL;
+ ITextDocument2Old *txtDoc2Old = NULL;
ITextSelection *txtSel = NULL, *txtSel2;
IUnknown *punk;
HRESULT hres;
@@ -195,6 +196,14 @@ static void test_Interfaces(void)
hres = IRichEditOle_QueryInterface(reOle, &IID_IOleInPlaceSite, (void **) &punk);
ok(hres == E_NOINTERFACE, "IRichEditOle_QueryInterface\n");
+ hres = IRichEditOle_QueryInterface(reOle, &IID_ITextDocument2Old, (void **)&txtDoc2Old);
+ ok(hres == S_OK, "IRichEditOle_QueryInterface\n");
+ ok(txtDoc2Old != NULL, "IRichEditOle_QueryInterface\n");
+ ok((ITextDocument *)txtDoc2Old == txtDoc, "interface pointer isn't equal.\n");
+ EXPECT_REF(txtDoc2Old, 5);
+ EXPECT_REF(reOle, 5);
+ ITextDocument2Old_Release(txtDoc2Old);
+
ITextDocument_Release(txtDoc);
IRichEditOle_Release(reOle);
refcount = IRichEditOle_Release(reOle);
diff --git a/dlls/riched20/txtsrv.c b/dlls/riched20/txtsrv.c
index ee65621b1d..5ab3322e6b 100644
--- a/dlls/riched20/txtsrv.c
+++ b/dlls/riched20/txtsrv.c
@@ -83,7 +83,7 @@ static HRESULT WINAPI ITextServicesImpl_QueryInterface(IUnknown *iface, REFIID r
if (!CreateIRichEditOle(This->outer_unk, This->editor, (void **)(&This->editor->reOle)))
return E_OUTOFMEMORY;
if (IsEqualIID(riid, &IID_ITextDocument))
- ME_GetITextDocumentInterface(This->editor->reOle, ppv);
+ ME_GetITextDocument2OldInterface(This->editor->reOle, ppv);
else
*ppv = This->editor->reOle;
} else {
--
2.18.0
Sept. 13, 2018
[PATCH v3 1/4] include: Add ITextDocument2Old and ITextDocument2 interface.
by Jactry Zeng
Superseded patch 150975.
Signed-off-by: Jactry Zeng <jzeng(a)codeweavers.com>
---
include/tom.idl | 91 +++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 91 insertions(+)
diff --git a/include/tom.idl b/include/tom.idl
index 357b0457a5..afc24ca5fb 100644
--- a/include/tom.idl
+++ b/include/tom.idl
@@ -237,6 +237,97 @@ interface ITextDocument : IDispatch
HRESULT RangeFromPoint([in]LONG x, [in]LONG y, [retval, out]ITextRange **ppRange);
}
+[
+ object,
+ uuid(01C25500-4268-11D1-883A-3C8B00C10000)
+]
+interface ITextDocument2Old : ITextDocument
+{
+ HRESULT AttachMsgFilter([in]IUnknown *filter);
+ HRESULT SetEffectColor([in]LONG index, [in]COLORREF cr);
+ HRESULT GetEffectColor([in]LONG index, [out]COLORREF *cr);
+ HRESULT GetCaretType([retval, out]LONG *type);
+ HRESULT SetCaretType([in]LONG type);
+ HRESULT GetImmContext([retval, out]LONG *context);
+ HRESULT ReleaseImmContext([in]LONG context);
+ HRESULT GetPreferredFont([in]LONG cp, [in]LONG codepage, [in]LONG option, [in]LONG current_codepage, [in]LONG current_fontsize,
+ [out]BSTR *bstr, [out]LONG *pitch_family, [out]LONG *new_fontsize);
+ HRESULT GetNotificationMode([retval, out]LONG *mode);
+ HRESULT SetNotificationMode([in]LONG mode);
+ HRESULT GetClientRect([in]LONG type, [out]LONG *left, [out]LONG *top, [out]LONG *right, [out]LONG *bottom);
+ HRESULT GetSelectionEx([retval, out]ITextSelection **selection);
+ HRESULT GetWindow([out]LONG *hwnd);
+ HRESULT GetFEFlags([out]LONG *flags);
+ HRESULT UpdateWindow();
+ HRESULT CheckTextLimit([in]LONG cch, [out]LONG *exceed);
+ HRESULT IMEInProgress([in]LONG mode);
+ HRESULT SysBeep();
+ HRESULT Update([in]LONG mode);
+ HRESULT Notify([in]LONG notify);
+}
+
+interface ITextDisplays;
+interface ITextFont2;
+interface ITextPara2;
+interface ITextRange2;
+interface ITextSelection2;
+interface ITextStory;
+interface ITextStoryRanges2;
+interface ITextStrings;
+
+[
+ object,
+ uuid(c241f5e0-7206-11d8-a2c7-00a0d1d6c6b3)
+]
+interface ITextDocument2 : ITextDocument
+{
+ HRESULT GetCaretType([retval, out]LONG *value);
+ HRESULT SetCaretType([in]LONG value);
+ HRESULT GetDisplays([retval, out]ITextDisplays **displays);
+ HRESULT GetDocumentFont([retval, out]ITextFont2 **font);
+ HRESULT SetDocumentFont([in]ITextFont2 *font);
+ HRESULT GetDocumentPara([retval, out]ITextPara2 **para);
+ HRESULT SetDocumentPara([in]ITextPara2 *para);
+ HRESULT GetEastAsianFlags([retval, out]LONG *flags);
+ HRESULT GetGenerator([retval, out]BSTR *bstr);
+ HRESULT SetIMEInProgress([in]LONG value);
+ HRESULT GetNotificationMode([retval, out]LONG *mode);
+ HRESULT SetNotificationMode([in]LONG mode);
+ HRESULT GetSelection2([retval, out]ITextSelection2 **selection);
+ HRESULT GetStoryRanges2([retval, out]ITextStoryRanges2 **stories);
+ HRESULT GetTypographyOptions([retval, out]LONG *options);
+ HRESULT GetVersion([retval, out]LONG *value);
+ HRESULT GetWindow([retval, out]LONG *hwnd);
+ HRESULT AttachMsgFilter([in]IUnknown *filter);
+ HRESULT CheckTextLimit([in]LONG cch, [out]LONG *exceed);
+ HRESULT GetCallManager([retval, out]IUnknown **manager);
+ HRESULT GetClientRect([in]LONG type, [out]LONG *left, [out]LONG *top, [out]LONG *right, [out]LONG *bottom);
+ HRESULT GetEffectColor([in]LONG index, [out]COLORREF *cr);
+ HRESULT GetImmContext([retval, out]LONG *context);
+ HRESULT GetPreferredFont([in]LONG cp, [in]LONG codepage, [in]LONG option, [in]LONG current_codepage, [in]LONG current_fontsize,
+ [out]BSTR *bstr, [out]LONG *pitch_family, [out]LONG *new_fontsize);
+ HRESULT GetProperty([in]LONG type, [out]LONG *value);
+ HRESULT GetStrings([out]ITextStrings **strings);
+ HRESULT Notify([in]LONG notify);
+ HRESULT Range2([in]LONG cp_active, [in]LONG cp_anchor, [retval, out]ITextRange2 **range);
+ HRESULT RangeFromPoint2([in]LONG x, [in]LONG y, [in]LONG type, [retval, out]ITextRange2 **range);
+ HRESULT ReleaseCallManager([in]IUnknown *manager);
+ HRESULT ReleaseImmContext([in]LONG context);
+ HRESULT SetEffectColor([in]LONG index, [in]LONG value);
+ HRESULT SetProperty([in]LONG type, [in]LONG value);
+ HRESULT SetTypographyOptions([in]LONG options, [in]LONG mask);
+ HRESULT SysBeep();
+ HRESULT Update([in]LONG value);
+ HRESULT UpdateWindow();
+ HRESULT GetMathProperties([out]LONG *options);
+ HRESULT SetMathProperties([in]LONG options, [in]LONG mask);
+ HRESULT GetActiveStory([retval, out]ITextStory **story);
+ HRESULT SetActiveStory([in]ITextStory *story);
+ HRESULT GetMainStory([retval, out]ITextStory **story);
+ HRESULT GetNewStory([retval, out]ITextStory **story);
+ HRESULT GetStory([in]LONG index, [retval, out]ITextStory **story);
+}
+
interface ITextFont;
interface ITextPara;
--
2.18.0
Sept. 13, 2018
Re: [PATCH v2] mpr: Implement WNetClearConnections().
by Dmitry Timoshkov
Pierre Schweitzer <pierre(a)reactos.org> wrote:
> > There is no need to initialize count, you are not verifying it anyway
> > after the API call.
>
> I do use it after the API call (see the for loop).
> And it's needed to initialize it as it is an IN/OUT parameter (specifies
> how many entries you want).
...
> > Since you are using an arbitrary size for NETRESOURCEW array it should be
> > possible to avoid dynamic heap allocation by using a fixed size array of
> > NETRESOURCEW structures (say 16), or even a single item. That would simplify
> > the code.
>
> It's not possible. NETRESOURCEW is a dynamic length structure. Its
> strings are append at the end of the structure.
I see, thanks for the clarification.
--
Dmitry.
Sept. 13, 2018
Re: [PATCH v2] mpr: Implement WNetClearConnections().
by Pierre Schweitzer
Le 13/09/2018 à 08:29, Dmitry Timoshkov a écrit :
> Pierre Schweitzer <pierre(a)reactos.org> wrote:
>
>> + size = 0x1000;
>> + resources = HeapAlloc(GetProcessHeap(), 0, size);
>> + if (!resources)
>> + {
>> + WNetCloseEnum(connected);
>> + return WN_OUT_OF_MEMORY;
>> + }
>> +
>> + do
>> + {
>> + size = 0x1000;
>> + count = -1;
>
> There is no need to initialize count, you are not verifying it anyway
> after the API call.
I do use it after the API call (see the for loop).
And it's needed to initialize it as it is an IN/OUT parameter (specifies
how many entries you want).
>> +
>> + memset(resources, 0, size);
>> + ret = WNetEnumResourceW(connected, &count, resources, &size);
>> + if (ret == WN_SUCCESS || ret == WN_MORE_DATA)
>> + {
>> + iter = resources;
>> + for (; count; count--)
>> + {
>> + WNetCancelConnection2W(iter->lpLocalName, 0, TRUE);
>> +
>> + iter++;
>> + }
>> + }
>> + else
>> + break;
>> + } while (ret != WN_NO_MORE_ENTRIES);
>
> Since you are using an arbitrary size for NETRESOURCEW array it should be
> possible to avoid dynamic heap allocation by using a fixed size array of
> NETRESOURCEW structures (say 16), or even a single item. That would simplify
> the code.
It's not possible. NETRESOURCEW is a dynamic length structure. Its
strings are append at the end of the structure.
Cheers,
--
Pierre Schweitzer <pierre at reactos.org>
System & Network Administrator
Senior Kernel Developer
ReactOS Deutschland e.V.
Sept. 13, 2018
Re: [PATCH v2] mpr: Implement WNetClearConnections().
by Dmitry Timoshkov
Pierre Schweitzer <pierre(a)reactos.org> wrote:
> + size = 0x1000;
> + resources = HeapAlloc(GetProcessHeap(), 0, size);
> + if (!resources)
> + {
> + WNetCloseEnum(connected);
> + return WN_OUT_OF_MEMORY;
> + }
> +
> + do
> + {
> + size = 0x1000;
> + count = -1;
There is no need to initialize count, you are not verifying it anyway
after the API call.
> +
> + memset(resources, 0, size);
> + ret = WNetEnumResourceW(connected, &count, resources, &size);
> + if (ret == WN_SUCCESS || ret == WN_MORE_DATA)
> + {
> + iter = resources;
> + for (; count; count--)
> + {
> + WNetCancelConnection2W(iter->lpLocalName, 0, TRUE);
> +
> + iter++;
> + }
> + }
> + else
> + break;
> + } while (ret != WN_NO_MORE_ENTRIES);
Since you are using an arbitrary size for NETRESOURCEW array it should be
possible to avoid dynamic heap allocation by using a fixed size array of
NETRESOURCEW structures (say 16), or even a single item. That would simplify
the code.
--
Dmitry.
Sept. 13, 2018