Hi @VB_al First of all, as @Castorix31 said, I did not find any function named SignVerifier
on msdn. Did you want to call WinVerifyTrust?
WinVerifyTrust
requires three parameters, which should be defined as IntPtr in VB .net. According to document, the 1st parameter is the window handle of the caller. This can be passed as 0 during the actual call, but the type must not be mistaken in the declaration. The 2nd is a pointer to the GUID structure, and the 3rd is a pointer to the WINTRUST_DATA
structure.
Create a GUID instance through New Guid
, then allocate a specified size of unmanaged memory through Marshal.AllocHGlobal(Marshal.SizeOf(GetType(Guid)))
, and then send the GUID
instance to the previously allocated unmanaged memory through the Marshal.StructureToPtr
method in.
Create an instance of WINTRUST_DATA
through New WINTRUST_DATA
, pay attention to bring parameters to initialize when creating. The parameter is the file to be verified. This file name is used to initialize the WINTRUST_FILE_INFO
structure. Initialization can be done by defining a new procedure in the declaration of the WINTRUST_DATA
and WINTRUST_FILE_INFO
structures.
After the WINTRUST_DATA
instance is created, it is finally sent to the unmanaged memory space as the processing steps of the GUID
instance.
After all, you can call WinVerifyTrust(0, <GUID instance address>, <WINTRUST_DATA instance address>)
to verify the file.
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.