-
-
Notifications
You must be signed in to change notification settings - Fork 228
Conversation
According to the documentation for `SetWindowLongPtr`, > When compiling for 32-bit Windows, `SetWindowLongPtr` is defined as a call to the `SetWindowLong` function. What this really means is that calls to `PInvoke.User32.SetWindowLongPtr` on 32-bit processes will (and do) result in an `EntryPointNotFoundException` This fix exposes `SetWindowLongPtr` through `User32.Helpers.cs` by conditionally calling `SetWindowLongPtr` on 64-bit vs. `SetWindowLong` on 32-bit.
Upating xml-doc comments Add a test case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Thank you for taking the time to test this. Just one small change please.
src/User32/User32.cs
Outdated
/// When compiling for 32-bit Windows, SetWindowLongPtr is defined as a call to the SetWindowLong function. This | ||
/// function is exposed using a helper that conditionally calls SetWindowLong in 32-bit processes. | ||
/// </remarks> | ||
[DllImport(nameof(User32), SetLastError = true, EntryPoint = nameof(SetWindowLongPtr))] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should use nameof(SetWindowLongPtr)
for the EntryPoint
here. That's the name of the helper method, and if we ever renamed that method, it would not be correct to change the string here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Also, I added another definition as part of the latest commit (AdjustWindowRectEx). Just filling in the gaps as I find 'em.
/// through the number of bytes of extra window memory, minus the size of a LONG_PTR. To set any other value, | ||
/// specify one of the following values. | ||
/// | ||
/// <list type="table"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice translation to xml! 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, didn't know until now that "list" could mean "table" :)
…of(SetWindowLongPtr) to "SetWindowLongPtr" - Adding definition for AdjustWindowRectEx
According to the documentation for
SetWindowLongPtr
,What this really means is that calls to
PInvoke.User32.SetWindowLongPtr
on 32-bit processes will (and do) result in anEntryPointNotFoundException
This fix exposes
SetWindowLongPtr
throughUser32.Helpers.cs
by conditionally callingSetWindowLongPtr
on 64-bit vs.SetWindowLong
on 32-bit.Also, adding a test.
Fixes #385