swagrid
✅ Roslyn analyzer: System.Guid only has _dummyPrimitive field?
I have an analyzer for more complex types that checks for
unmanaged
(in generics, for example). This specific analyzer is there to flag parameters that are expected to be passed as a pointer. Basically, everything that doesn't fit in a register should be passed as a pointer in some form (e.g. in Guid param1
). Since the unmanaged
constraint is valid on larger types, I cannot use it here. I'm also aware that doesn't fit in a register is very hard to determine because of the marshaler, so I'm overly pessimistic in the analyzer (which is fine in our scenario).19 replies
✅ Roslyn analyzer: System.Guid only has _dummyPrimitive field?
We do quite extensive native interop between C# and C++ and I'm writing an analyzer that ensures we follow some internal guidelines when marshaling data. The analyzer effectively looks at all
static extern
methods and analyzes their parameters and return types.19 replies