Add PD and PD_RESULT enums in Interop Comdlg32#2594
Conversation
8a7e4df to
cf484bf
Compare
Codecov Report
@@ Coverage Diff @@
## master #2594 +/- ##
==================================================
+ Coverage 57.02795% 57.04975% +0.0218%
==================================================
Files 1440 1440
Lines 417476 417476
Branches 39004 39004
==================================================
+ Hits 238078 238169 +91
+ Misses 174011 173933 -78
+ Partials 5387 5374 -13
|
|
@gpetrou have you tested the functionality to confirm the print dialog was shown? |
|
@RussKie sorry about that. If I remember correctly, I had only tested the changes before modifying the flags to use Comdlg32.PD. I shouldn't have changed the order of class items. |
| IntPtr m_hDevNames; | ||
| IntPtr m_hDC; | ||
|
|
||
| int m_Flags; |
There was a problem hiding this comment.
fields cannot be moved around
| public IntPtr hDevNames { get { return m_hDevNames; } set { m_hDevNames = value; } } | ||
| public IntPtr hDC { get { return m_hDC; } set { m_hDC = value; } } | ||
|
|
||
| public int Flags { get { return m_Flags; } set { m_Flags = value; } } |
There was a problem hiding this comment.
automatic properties must be avoided in interop since you don't control the binary layout anymore
[edit] made the comment on the wrong side of the diff, this line got replaced by an automatic property public int Flags { get; set; } which is what I was talking about above.
| IntPtr m_hDevNames; | ||
| IntPtr m_hDC; | ||
|
|
||
| int m_Flags; |
There was a problem hiding this comment.
fields cannot be moved around
There was a problem hiding this comment.
Ah, should have picked that! 🤦♂
| public IntPtr hDevNames { get { return m_hDevNames; } set { m_hDevNames = value; } } | ||
| public IntPtr hDC { get { return m_hDC; } set { m_hDC = value; } } | ||
|
|
||
| public int Flags { get { return m_Flags; } set { m_Flags = value; } } |
There was a problem hiding this comment.
don't use automatic properties since you cannot control the binary layout
[edit] made the comment on the wrong side of the diff, this line got replaced by an automatic property public int Flags { get; set; } which is what I was talking about above.
Resolves dotnet#2814 The bug was caused by the conversion of a struct fields to auto-properties in dotnet#2594. This broke the interop binary layout. Rework the code to - correctly define x86 and x64 structs - make the structs blittable - add tests verifying the structs layouts
Resolves dotnet#2814 The bug was caused by the conversion of a struct fields to auto-properties in dotnet#2594. This broke the interop binary layout. Rework the code to - correctly define x86 and x64 structs - make the structs blittable - add tests verifying the structs layouts
Proposed changes
Microsoft Reviewers: Open in CodeFlow