Simon Mourier's Avatar
Simon Mourier's blog (1807 answers on StackOverflow) about Microsoft technologies C#, C/C++, .NET, WinRT, WinUI3, AOT, P/Invoke, COM, Interop, DirectX, Direct2D, Windows, ...
  • 🔎︎ Search
  • Categories
  • Archives
  • About Me
  • bitness
  • interop

P/Inovke parameters offset by 32 bits when compiled in 64 bit

Sep 24, 2013 See the question and my original answer on StackOverflow

MethodName should not be a class instance method, as the first bytes (4 in x86 world, 8 in x64 world) will be used for the class instance pointer in the unmanaged world.

So, it should be a static method (or a C style method).

  • SmoBlog © 2010-2026 Simon Mourier. All rights reserved.
  • Privacy & Terms