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

Add partial wininet bindings. #304

Merged
merged 1 commit into from
Nov 9, 2016
Merged

Add partial wininet bindings. #304

merged 1 commit into from
Nov 9, 2016

Conversation

DanielKeep
Copy link
Contributor

Includes what should be all the types and constants from wininet.h,
and some of the functions.

Note that, unlike other header bindings, the wininet module is not
re-exported in the root winapi module. This is because wininet.h
and winhttp.h define the same constants/enums with different values.

@DanielKeep
Copy link
Contributor Author

DanielKeep commented Jul 16, 2016

Do not merge yet: I haven't checked that structs respect packing.

Size and alignement of structs is now checked.

@retep998
Copy link
Owner

This PR will need to be updated to the winapi 0.3 new world order. #316

@DanielKeep
Copy link
Contributor Author

PR has been updated.

The one thing I'm not sure about is that I've had to add an Align field to GOPHER_ATTRIBUTE_TYPE to get the appropriate alignment on 64-bit. Specifically, it's a field that users won't expect to exist, and if better padding control comes along later, can't be removed. Should I rename it, add some docs for it, or just comment it out along with everything that depends on it?

I mean, it's for Gopher, so I'm not sure anyone'll miss it. Well, right away; you know how people are.

@retep998
Copy link
Owner

I'd prefer leaving the struct in with insufficient alignment for now, and commenting out the test, and having a fixme to fix it later.

pub const AUTODIAL_MODE_NEVER: DWORD = 1;
pub const AUTODIAL_MODE_ALWAYS: DWORD = 2;
pub const AUTODIAL_MODE_NO_NETWORK_PRESENT: DWORD = 4;
pub type INTERNET_STATUS_CALLBACK = Option<unsafe extern "system" fn(
Copy link
Owner

Choose a reason for hiding this comment

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

We now have FN! for this.

@DanielKeep
Copy link
Contributor Author

Updated fixes. From commit:

  • Changed !0 to -1i32 as u32.
  • Removed redundant #[allow(dead_code)]s.
  • Changed GOPHER_ATTRIBUTE_TYPE to be naturally aligned correctly.
  • Changed pointer type aliases to use FN!.

Note that the vtable struct still uses literal types, since there's no
name defined for them.

@retep998
Copy link
Owner

retep998 commented Nov 5, 2016

Merge conflicts and CI is failing.

@DanielKeep DanielKeep force-pushed the wininet branch 2 times, most recently from 526eff6 to ab7faaf Compare November 7, 2016 01:32
@DanielKeep
Copy link
Contributor Author

My bad; I think I forgot to enable features when testing the fixes I made. And then I forgot that dev was the upstream branch, rebased on to master, amended the commit, and then realised what I'd just done and had to fix it.

Looks good now. I hope.

"um-winioctl",
"um-winnt",
"um-winnt",
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 blame git gui for this.

This also includes a single definition from winineti.h, and a list of
symbols dumped from wininet.dll that *aren't* in wininet.h.

Includes the wininet.dll import libs for MinGW.
@retep998 retep998 merged commit 6247a8f into retep998:dev Nov 9, 2016
@retep998 retep998 mentioned this pull request May 30, 2017
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