CopyFileEx returns different results based on VisualStudio 2019 vs VisualStudio 2022 #100840
-
I am not sure at all where to ask this question, so please let me know if there is a better forum for this. I am one of the maintainers of the RoboSharp library, and am working on a PR to bring some custom implementations into existence for consumers. One of those will effectively be a wrapper for CopyFileEx, or its planned to be if all goes well (which its not). The problem i have run into is that 2 of my unit tests fail when running via VS2019 Professional, and succeeds when running via VS2022 Community. Test Environment:
Test Overview:
Relevant Code:
Other relevant code :
PR I discovered the issue in : tjscience/RoboSharp#193
Initial post for posterity : dotnet/csharplang#8046 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
VS2019 is 32bit and VS2022 is 64bit. This should be the main difference. The signature of 4th argument is |
Beta Was this translation helpful? Give feedback.
VS2019 is 32bit and VS2022 is 64bit. This should be the main difference.
The signature of 4th argument is
LPVOID lpData
. Usingobject
in P/Invoke signature means the OLEVARIANT
type. You should useIntPtr
instead.