From: Anna R Békefi <annareginabekefi@gmail.com> --- dlls/combase/errorinfo.c | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/dlls/combase/errorinfo.c b/dlls/combase/errorinfo.c index 3ddf3557a24..47934c199cb 100644 --- a/dlls/combase/errorinfo.c +++ b/dlls/combase/errorinfo.c @@ -619,3 +619,42 @@ static const IRestrictedErrorInfoVtbl restricted_errorinfo_vtbl = restricted_errorinfo_GetErrorDetails, restricted_errorinfo_GetReference }; + +HRESULT create_restricted_error_info(HRESULT hr, const WCHAR *description, + const WCHAR *restricted_description, const WCHAR *capability_sid, + const WCHAR *reference, IRestrictedErrorInfo **ret) +{ + struct restricted_error_info *info; + + TRACE("%#lx, %s, %s, %s, %s, %p.\n", hr, debugstr_w(description), + debugstr_w(restricted_description), debugstr_w(capability_sid), + debugstr_w(reference), ret); + + if (!ret) return E_INVALIDARG; + *ret = NULL; + + info = calloc(1, sizeof(*info)); + if (!info) return E_OUTOFMEMORY; + + info->IRestrictedErrorInfo_iface.lpVtbl = &restricted_errorinfo_vtbl; + info->IErrorInfo_iface.lpVtbl = &restricted_errorinfo_ierror_vtbl; + info->refcount = 1; + + info->guid = GUID_NULL; + info->source = NULL; + info->help_file = NULL; + info->help_context = 0; + + info->hr = hr; + info->description = description ? wcsdup(description) : NULL; + info->restricted_description = restricted_description ? wcsdup(restricted_description) : NULL; + info->capability_sid = capability_sid ? wcsdup(capability_sid) : NULL; + info->reference = reference ? wcsdup(reference) : NULL; + + info->context_captured = FALSE; + info->stack_frame_count = 0; + info->stack_hash = 0; + + *ret = &info->IRestrictedErrorInfo_iface; + return S_OK; +} -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10659