How to pass PVOID* to native code from managed code

B

BR

Hi,

I need to call a native windows method which has the following
signature

BOOL SomeMethod(PVOID* value);

value [out] - The original value.

I am calling this method using DllImport and am passing in an IntPtr.

Intptr val = IntPtr.Zero;
bool status = SomeMethod(val);

but this results in the method returning failure and GetLastError
gives me error code 1. (ERROR_INVALID_FUNCTION)

I suspect that this is because I am not passing in the correct data
type from the managed code.
What managed datatype should I use for a PVOID* ?

Thanks,
Roshan
 
M

Mattias Sjögren

I suspect that this is because I am not passing in the correct data
type from the managed code.
What managed datatype should I use for a PVOID* ?

out IntPtr


Mattias
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top