You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to use the CreateRemoteThread(Ex) function, I found that the generated signatures are not really usable as the lpStartAddress is of a delegate type:
The problem is that the remote function address is almost certainly invalid in the context of the calling process and creating a delegate to such an address (by using, for example, Marshal.GetDelegateForFunctionPointer) will fail. If there is a way to create this delegate, please let me know. Otherwise, could you please change the lpStartAddress type to either void * or nint?
The text was updated successfully, but these errors were encountered:
While metadata uses delegates to describe unmanaged function pointers, they are not intended to represent actual C# delegates. When these types are encountered, CsWin32 could potentially decompose them into IntPtr. (However, I recognize that this approach would result in a loss of type safety and other benefits.)
@AArnott Is there a way to instruct CsWin32 to emit raw bindings for APIs like this on an individual basis (e.g., via NativeMethods.json)?
When trying to use the CreateRemoteThread(Ex) function, I found that the generated signatures are not really usable as the lpStartAddress is of a delegate type:
The problem is that the remote function address is almost certainly invalid in the context of the calling process and creating a delegate to such an address (by using, for example,
Marshal.GetDelegateForFunctionPointer
) will fail. If there is a way to create this delegate, please let me know. Otherwise, could you please change the lpStartAddress type to eithervoid *
ornint
?The text was updated successfully, but these errors were encountered: