New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Access Violation on call to DsAddressToSiteNames #346
Comments
Another note, this seems to have been introduced in a recent version. Downgrading to |
Thank you for submitting such a thorough bug report! I'll have this resolved shortly. |
@ryannewington When you say "compile your app", how are you referencing the |
Hi David That should say "compile my app". So this is using the NuGet package. If the sample app provided above, referencing the latest NuGet is compiled as x86 it works, x64 it fails. I forked the library and modified the struct definition and could "fix" the issue by modifying the struct size. |
The problem lies in the |
Oh right. I did notice that looking at the code of the version I downgraded to, there was no fixed size parameter on the struct. Is there an issue I should be aware of that adding the size fixed? |
Yes. The 32-bit size and 64-bit size are different. I have a few structures in Vanara that are like this, so I need to find a solution. I'll close this with comments when I get it resolved. Unfortunately, the documentation on NuGet packaging is pretty weak. |
Can you confirm that using |
…e all structures work for both 32 and 64-bit (#346)
This is fixed with the latest commit. I'll publish soon. |
Describe the bug and how to reproduce
When passing an array of
SOCKET_ADDRESS
toDsAddressToSiteNames
either an access violation or win32 (1783) error (The stub received bad data) is throw.What code is involved
The header for SOCKET_ADDRESS is as follows
However, there appears to be no compiler definition for
x64
and therefore, the layout size is always set to 8. If you compile your app to run 32-bit it succeeds. If you compile as AnyCPU or x64, it fails.Vanara/PInvoke/Ws2_32/ws2def.cs
Line 1716 in d1d0ff5
Changing this struct value manually works.
Expected behavior
The call should succeed on both x86 an x64 builds.
Repo sample
Modify the dcname variable below with the name of a domain controller to reproduce the issue.
Running as x64 fails, running as x86 succeeds
The text was updated successfully, but these errors were encountered: