Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generating bindings for WinTrust #37

Merged
merged 7 commits into from
Apr 19, 2020
Merged

Generating bindings for WinTrust #37

merged 7 commits into from
Apr 19, 2020

Conversation

nathan-alden-sr
Copy link
Contributor

Generated bindings for WinTrust.h.

public IntPtr* pfnCertCheckPolicy;

[NativeTypeName("PFN_PROVIDER_TESTFINALPOLICY_CALL")]
public IntPtr* pfnTestFinalPolicy;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I borked this when I added the experimental function pointer support...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is supposed to be just IntPtr... I might just leave for now and fix when I regenerate the full bindings for 20H1

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what I can do to fix this.

Pull request feedback
Pull request feedback
#define mappings for WinTrust, Crypt32, and Advapi32

public const int CERT_SYSTEM_STORE_LOCAL_MACHINE_WCOS = CERT_SYSTEM_STORE_LOCAL_MACHINE_WCOS_ID << CERT_SYSTEM_STORE_LOCATION_SHIFT;

public const string CERT_GROUP_POLICY_SYSTEM_STORE_REGPATH =
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are (mostly) just macro functions that weren't ported, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit confused about how your question relates to the code you highlighted. There are many #defines in wincrypt.h that are basically simple math expressions (like the one you highlighted). However, I did not port any macro functions at all throughout this PR (i.e., anything with #define F(X).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code you highlighted is defined thusly:

#define CERT_SYSTEM_STORE_LOCAL_MACHINE_WCOS  \
    (CERT_SYSTEM_STORE_LOCAL_MACHINE_WCOS_ID << \
        CERT_SYSTEM_STORE_LOCATION_SHIFT)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For whatever reason, the "Conversation" tab puts this on the wrong line.

If you goto the "Files" tab, it is on L5919: https://github.com/terrafx/terrafx.interop.windows/pull/37/files/435c24606296062bd557b116d453c517e1e042cb#diff-d03360204625b1a7168b85116fe6c24bR5919

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, yes, those are all the remaining #defines. The PowerShell script creates comments for every #define that couldn't be mapped automatically. I then go through the list and convert any that I feel like I can manage. Most of the leftovers are "functions."

@tannergooding
Copy link
Member

Thanks for the contribution!

@tannergooding tannergooding merged commit 46bb6e1 into terrafx:master Apr 19, 2020
IngmarBitter pushed a commit to IngmarBitter/terrafx.interop.windows that referenced this pull request May 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants