Skip to content

Conversation

@oldnewthing
Copy link
Member

XAML's ResourceDictionary has a custom implementation of IMap that returns E_FAIL and HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND) to indicate that the key is not present. Accommodate this nonstandard behavior.

Fixes #685

XAML's ResourceDictionary has a custom implementation
of `IMap` that returns `E_FAIL` and
`HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND)` to
indicate that the key is not present. Accommodate
this nonstandard behavior.
inline hresult check_hresult_allow_bounds(hresult const result)
{
if (result != impl::error_out_of_bounds)
if (result != impl::error_out_of_bounds && result != impl::error_fail && result != impl::error_file_not_found)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wish there was some way to incentivize the implementations to clean up their act as this isn't sustainable and they're not likely to fix this on their end.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a contract breaking change now if we "fix" the XAML implementation.

@kennykerr
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

No pipelines are associated with this pull request.

@kennykerr kennykerr merged commit 048c5c6 into microsoft:master Jul 10, 2020
@oldnewthing oldnewthing deleted the trylookup branch July 10, 2020 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Application.Current.Resources.TryLookup throws hresult_error despite it being a Try* method

3 participants