Closed drauch closed 11 months ago
Another question:
CreateFile
returns a SafeHandle
, the struct SIGNER_FILE_INFO
wants a HANDLE
. How to do that? Is (HANDLE) file.DangerousGetHandle()
the way to go?
One more:
CertOpenStore
has a parameter of HCRYPTPROV
which should be set to null. I can't pass null
nor IntPtr.Zero
though. How to pass NULL as this paramteter? Is new HCRYPTPROV_LEGACY(nuint.Zero)
the way to go?
All the best, D.R.
Also generating constants defined in https://learn.microsoft.com/en-us/windows/win32/seccrypto/alg-id does not work, how can they be found? Do I have to manually create those?
Best regards, D.R.
PS: Sorry for the spam :-)
Really like the concept of the library and started to use it today.
I've used it to generate
SignerSignEx2
, this generates lots of additional structs, and I've problems filling them:1) strings in those structs are PCWSTR and not System.String typed. How to properly convert a System.String into a PCWSTR? Wouldn't it be nice if those structs would contain System.String properties? :-)
2) How to properly fill the cbSize of those structs? Is this something that is done automatically in the ctor? It doesn't look like it, so I have to use
(uint) Marshal.SizeOf<STRUCT_TYPE>()
am I right?3) Unions are strangely called "Anonymous", is this correct or a generation error?
Best regards, D.R.