Skip to content

Commit e3c5189

Browse files
committed
Use IPropertyValue.GetGuid() instead of PropertyValue.CreateGuid()
1 parent 3ca0940 commit e3c5189

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

natvis/cppwinrt_visualizer.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,20 @@ coded_index<TypeDefOrRef> FindGuidType()
2424
{
2525
// There is no definitive TypeDef for System.Guid. But there are a variety of TypeRefs scattered about
2626
// This one should be relatively quick to find
27-
auto pv = db_cache->find("Windows.Foundation", "PropertyValue");
27+
auto pv = db_cache->find("Windows.Foundation", "IPropertyValue");
2828
for (auto&& method : pv.MethodList())
2929
{
30-
if (method.Name() == "CreateGuid")
30+
if (method.Name() == "GetGuid")
3131
{
3232
auto const& sig = method.Signature();
33-
auto const& params = sig.Params();
34-
if (params.first != params.second)
33+
auto const& type = sig.ReturnType().Type().Type();
34+
XLANG_ASSERT(std::holds_alternative<coded_index<TypeDefOrRef>>(type));
35+
if (std::holds_alternative<coded_index<TypeDefOrRef>>(type))
3536
{
36-
auto const& type = params.first->Type().Type();
37-
if (std::holds_alternative<coded_index<TypeDefOrRef>>(type))
38-
{
39-
guid_TypeRef = std::get<coded_index<TypeDefOrRef>>(type);
40-
}
37+
guid_TypeRef = std::get<coded_index<TypeDefOrRef>>(type);
38+
XLANG_ASSERT(guid_TypeRef.type() == TypeDefOrRef::TypeRef);
39+
XLANG_ASSERT(guid_TypeRef.TypeRef().TypeNamespace() == "System");
40+
XLANG_ASSERT(guid_TypeRef.TypeRef().TypeName() == "Guid");
4141
}
4242
}
4343
}

0 commit comments

Comments
 (0)