Signed-off-by: Connor McAdams cmcadams@codeweavers.com --- dlls/oleacc/client.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+)
diff --git a/dlls/oleacc/client.c b/dlls/oleacc/client.c index 22b8c225dd9..1cfbc7cd8cc 100644 --- a/dlls/oleacc/client.c +++ b/dlls/oleacc/client.c @@ -31,6 +31,7 @@ typedef struct { HRESULT (*get_state)(IAccessible *, VARIANT, VARIANT *); HRESULT (*get_name)(IAccessible *, VARIANT, BSTR *); HRESULT (*get_kbd_shortcut)(IAccessible *, VARIANT, BSTR *); + HRESULT (*get_value)(IAccessible *, VARIANT, BSTR *); } WinClassVtbl;
typedef struct { @@ -233,6 +234,9 @@ static HRESULT WINAPI Client_get_accValue(IAccessible *iface, VARIANT varID, BST
TRACE("(%p)->(%s %p)\n", This, debugstr_variant(&varID), pszValue);
+ if (This->vtbl.get_value) + return This->vtbl.get_value(iface, varID, pszValue); + *pszValue = NULL; if(convert_child_id(&varID) != CHILDID_SELF) return E_INVALIDARG; @@ -817,6 +821,33 @@ static HRESULT edit_get_kbd_shortcut(IAccessible *iface, VARIANT var_id, return acc_client_get_kbd_shortcut_str(name, len, out_kbd_shortcut); }
+static HRESULT edit_get_value(IAccessible *iface, VARIANT var_id, BSTR *out_value) +{ + Client *This = impl_from_Client(iface); + WCHAR *buf; + UINT len; + + TRACE("(%p)->(%s %p)\n", This, debugstr_variant(&var_id), out_value); + + *out_value = NULL; + if(convert_child_id(&var_id) != CHILDID_SELF || !IsWindow(This->hwnd)) + return E_INVALIDARG; + + if (GetWindowLongW(This->hwnd, GWL_STYLE) & ES_PASSWORD) + return E_ACCESSDENIED; + + len = SendMessageW(This->hwnd, WM_GETTEXTLENGTH, 0, 0); + buf = heap_alloc_zero((len + 1) * sizeof(*buf)); + if (!buf) + return E_OUTOFMEMORY; + + SendMessageW(This->hwnd, WM_GETTEXT, len + 1, (LPARAM)buf); + *out_value = SysAllocString(buf); + heap_free(buf); + + return S_OK; +} + HRESULT create_edit_client_object(HWND hwnd, const IID *iid, void **obj) { IAccessible *acc; @@ -831,6 +862,7 @@ HRESULT create_edit_client_object(HWND hwnd, const IID *iid, void **obj) client->vtbl.get_state = &edit_get_state; client->vtbl.get_name = &edit_get_name; client->vtbl.get_kbd_shortcut = &edit_get_kbd_shortcut; + client->vtbl.get_value = &edit_get_value;
hres = IAccessible_QueryInterface(acc, iid, obj); IAccessible_Release(acc);