On 64-bit Windows (with a 64-bit application), pointers are 64-bit.
You'll have to give some more details about what you're doing. Presumably there's something amiss somewhere.
Does Win32 API use 64 bit length pointers on 64 bit system ?
Hi!
I have Win32 API (cloud filter api). On Windows 10 x64 it does not work when I create x64 app and pass IntPtr to it's function . (I have access violation memory exception).
But when I build x86 app and use IntPtr with 32 length it works.
So my question is: win32 api is 32 bitness API and can work only with pointers with 32 bits length, is it true ?
4 answers
Sort by: Most helpful
-
David Lowndes 4,711 Reputation points
2020-12-21T12:22:41.527+00:00 -
RLWA32 40,286 Reputation points
2020-12-21T12:36:30.74+00:00 Make sure that your managed code is actually running as 64-bit code. An IntPtr is 32-bits in 32-bit code and 64-bits in 64-bit code.
Check to make sure that you are not building managed code for AnyCpu with prefer 32-bits selected.
-
RLWA32 40,286 Reputation points
2020-12-21T13:22:35.213+00:00 An access violation can result for any number of reasons. Chances are that there is a problem in the code that is exposed when building for x64.
-
Rita Han - MSFT 2,161 Reputation points
2020-12-22T05:38:52.813+00:00 Hello @Diakov Dmytro ,
CfExecute
API works well with 64 bit length pointers on 64 bit system in C++. You can test official sample: CloudMirror and get pointer size usingsizeof()
. The following snapshot shows an example and its result.Thank you!
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.