Signed-off-by: Connor McAdams cmcadams@codeweavers.com --- dlls/oleacc/client.c | 21 ++++++++++++++++++++- dlls/oleacc/main.c | 2 +- dlls/oleacc/oleacc_private.h | 1 + 3 files changed, 22 insertions(+), 2 deletions(-)
diff --git a/dlls/oleacc/client.c b/dlls/oleacc/client.c index 93f6b590f78..5f702d0135b 100644 --- a/dlls/oleacc/client.c +++ b/dlls/oleacc/client.c @@ -34,6 +34,7 @@ typedef struct {
HWND hwnd; HWND enum_pos; + INT role; } Client;
static inline Client* impl_from_Client(IAccessible *iface) @@ -220,7 +221,7 @@ static HRESULT WINAPI Client_get_accRole(IAccessible *iface, VARIANT varID, VARI }
V_VT(pvarRole) = VT_I4; - V_I4(pvarRole) = ROLE_SYSTEM_CLIENT; + V_I4(pvarRole) = This->role; return S_OK; }
@@ -668,8 +669,26 @@ HRESULT create_client_object(HWND hwnd, const IID *iid, void **obj) client->ref = 1; client->hwnd = hwnd; client->enum_pos = 0; + client->role = ROLE_SYSTEM_CLIENT;
hres = IAccessible_QueryInterface(&client->IAccessible_iface, iid, obj); IAccessible_Release(&client->IAccessible_iface); return hres; } + +HRESULT create_edit_client_object(HWND hwnd, const IID *iid, void **obj) +{ + IAccessible *acc; + Client *client; + HRESULT hres; + + hres = create_client_object(hwnd, &IID_IAccessible, (void **)&acc); + if (FAILED(hres)) return hres; + + client = impl_from_Client(acc); + client->role = ROLE_SYSTEM_TEXT; + + hres = IAccessible_QueryInterface(acc, iid, obj); + IAccessible_Release(acc); + return hres; +} diff --git a/dlls/oleacc/main.c b/dlls/oleacc/main.c index db9f646988c..813ebc64a6e 100644 --- a/dlls/oleacc/main.c +++ b/dlls/oleacc/main.c @@ -54,7 +54,7 @@ static struct { {L"#32768", 0x10001, NULL, NULL}, /* menu */ {WC_BUTTONW, 0x10002, NULL, NULL}, {WC_STATICW, 0x10003, NULL, NULL}, - {WC_EDITW, 0x10004, NULL, NULL}, + {WC_EDITW, 0x10004, create_edit_client_object, NULL}, {WC_COMBOBOXW, 0x10005, NULL, NULL}, {L"#32770", 0x10006, NULL, NULL}, /* dialog */ {L"#32771", 0x10007, NULL, NULL}, /* winswitcher */ diff --git a/dlls/oleacc/oleacc_private.h b/dlls/oleacc/oleacc_private.h index 32561ef3d2f..144009b1f33 100644 --- a/dlls/oleacc/oleacc_private.h +++ b/dlls/oleacc/oleacc_private.h @@ -19,6 +19,7 @@ #include "oleacc_classes.h"
HRESULT create_client_object(HWND, const IID*, void**) DECLSPEC_HIDDEN; +HRESULT create_edit_client_object(HWND, const IID*, void**) DECLSPEC_HIDDEN; HRESULT create_window_object(HWND, const IID*, void**) DECLSPEC_HIDDEN; HRESULT get_accpropservices_factory(REFIID, void**) DECLSPEC_HIDDEN;