Hi, @VB_al MarshalDirectiveException seems to be caused by the calling convention of the function. The calling convention of WinVerifyTrust is the __stdcall
:
You can try to explicitly declare as CallingConvention = CallingConvention.StdCall
. If this still does not solve the problem, please provide your sample which shows how you declare all the types and functions.
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.