Conversation
Codecov Report
@@ Coverage Diff @@
## master #818 +/- ##
=================================================
+ Coverage 28.05285% 28.073% +0.02015%
=================================================
Files 1065 1065
Lines 292530 292402 -128
Branches 38519 38508 -11
=================================================
+ Hits 82063 82086 +23
+ Misses 206407 206253 -154
- Partials 4060 4063 +3
|
weltkante
left a comment
There was a problem hiding this comment.
Please check if ELEMDESC is defined correctly
src/Common/src/NativeMethods.cs
Outdated
There was a problem hiding this comment.
Is it correct making this a pointer? ELEMDESC embeds TYPEDESC by value, doing it by reference will lose the VARTYPE member and have the following PARAMDESC at the wrong alignment.
(That probably means the old struct was defined wrong too? If so this might need an additional code review of the callers to check if they need to be updated if they were previously coded/tested with wrong assumptions.)
There was a problem hiding this comment.
It's not clear to me why it's defined this way and also not clear why it's not using System.Runtime.InteropServices.ComTypes.ELEMDESC. I would rather have tests in place before making functional changes to the signatures.
There was a problem hiding this comment.
@sharwell you may be able to track down the blame for this in the old source control system and followup with the author about why these lines are the way that they are
There was a problem hiding this comment.
I've created follow up issue #896 to track the wrong definition
src/Common/src/NativeMethods.cs
Outdated
There was a problem hiding this comment.
Don't think these are necessary
There was a problem hiding this comment.
I agree, but I would prefer to have tests in place to verify before dropping them since I'm not 100%.
There was a problem hiding this comment.
They aren't necessary. I don't know if the marshaller ignores the redundancy here or if that makes it do extra work. @jkoritzinsky, are these just ignored or will they impact blittability logic?
There was a problem hiding this comment.
The marshalling system ignores the redundancy here. Having these doesn't impact blittability.
|
#791 is merged /cc @JeremyKuhne |
|
I rebased this and addressed the resulting merge conflicts, but have not addressed the other feedback items yet. |
|
cc @JeremyKuhne |
| public /*NativeMethods.tagELEMDESC*/ IntPtr lprgelemdescParam = IntPtr.Zero; | ||
| public /*NativeMethods.tagELEMDESC*/ IntPtr lprgelemdescParam; | ||
|
|
||
| // cpb, Microsoft, the EE chokes on Enums in structs |
There was a problem hiding this comment.
This isn't a true statement.
| public IntPtr lprgscode = IntPtr.Zero; | ||
| public IntPtr lprgscode; | ||
|
|
||
| // This is marked as NATIVE_TYPE_PTR, |
There was a problem hiding this comment.
All of these comments (before the next member) should be removed- they're not correct.
| public sealed class tagTYPEATTR { | ||
| public struct tagTYPEATTR { | ||
| public Guid guid; | ||
| [MarshalAs(UnmanagedType.U4)] |
There was a problem hiding this comment.
All of these can be removed. It doesn't matter if the field is int or uint when matching up DWORD. That said, prefer to the actual signed/unsigned type to match (e.g. uint for DWORD).
| @@ -5239,53 +5233,53 @@ public interface IProvideClassInfo | |||
| } | |||
|
|
|||
| [StructLayout(LayoutKind.Sequential)] | |||
There was a problem hiding this comment.
The attribute isn't needed- this is the default for structs.
JeremyKuhne
left a comment
There was a problem hiding this comment.
Awesome that we're getting rid of these classes!
We should look at yanking all of these and using the ones defined in System.Runtime.InteropServices.ComTypes. They're correctly defined as structs so there won't be allocation issues like they're trying to avoid here.
Don't hesitate to ping me if you're finding any difficulties using the .NET types here.
I think this is my preference, but they aren't the drop in replacements I was hoping for. I'll follow up with details next week and we can figure out the best plan for moving forward. |
I think this is the best idea moving forward. @sharwell I would love to see what you come up with next week 😄 For now, I am content to take this change if you are. |
|
@zsd4yr seems this can be merged? |
|
I'm going to merge this based on @zsd4yr approval above. |
ELEMDESC doesn't contain a pointer. This fixes a regression introduced in dotnet#818. Fixes dotnet#896
ELEMDESC doesn't contain a pointer. This fixes a regression introduced in dotnet#818. Fixes dotnet#896
Follow-up to #791.
I will rebase this change after the change from @hughbe is merged.