profile
viewpoint
Peter Atashian retep998 Massachusetts, USA Writes software in Rust and C++. Is fluffy.

notify-rs/notify 1022

🔭 Cross-platform filesystem notification library for Rust.

aatxe/irc 398

the irc crate – usable, async IRC for Rust

FTB-Gamepedia/mediawiki-rs 7

MediaWiki API in Rust

FTB-Gamepedia/ftb-rs 4

Stuff for FTB wiki

retep998/Chip8 4

A Chip8 emulator written in C++ and x86-64 MASM.

aatxe/tomato 3

Java MapleStory Server Emulator - v111

FTB-Gamepedia/bunnybutt-rs 2

An IRC bot for the FTB wiki

FTB-Gamepedia/FTB-Wiki-Issue-Tracker 1

Issue tracking (and hopefully squashing) for the FTB Wiki

pull request commentretep998/winapi-rs

WebAuthN bindings

Thus, it's very likely that I missed something!

For what it's worth, these are pretty spot on as far as I'm concerned! Good stuff! 👍

  • Organization of code
    • [x] All definitions go into the source file that directly maps to the header the definition is from.
    • [ ] Definitions are defined in the same order as they are in the original header. ❌ A couple of minor deviations (called out in source annotations above)
  • Imports
    • [x] Are sorted in asciibetical order.
  • Extern functions
    • [x] ABIS are correct (WINAPI = "system")
    • [ ] Names are correct (functions, parameters) ⚠️ A couple of minor parameter name typos (only important if we care about doc comments?)
    • [x] Parameter types are correct
    • [x] Return types are correct
  • Constants
    • [x] Names are correct
    • [x] Values are correct
    • [x] Types are correct
  • Structs
    • [x] Each field must be on its own line.
    • [x] Struct and field names match header.
    • [x] Field types match header.
    • [ ] Misc ⚠️ The previously mentioned #[non_exhaustive] concerns.
hecrj

comment created time in 2 hours

Pull request review commentretep998/winapi-rs

WebAuthN bindings

+// Licensed under the Apache License, Version 2.0+// <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option.+// All files in the project carrying such notice may not be copied, modified, or distributed+// except according to those terms.+use shared::guiddef::GUID;+use shared::minwindef::{BOOL, DWORD, PBYTE};+use shared::windef::HWND;+use um::winnt::{HRESULT, LONG, LPCWSTR, PCWSTR, PVOID};+pub const WEBAUTHN_API_VERSION_1: DWORD = 1;+pub const WEBAUTHN_API_VERSION_2: DWORD = 2;+pub const WEBAUTHN_API_CURRENT_VERSION: DWORD = WEBAUTHN_API_VERSION_2;+pub const WEBAUTHN_HASH_ALGORITHM_SHA_256: &'static str = "SHA-256";+pub const WEBAUTHN_HASH_ALGORITHM_SHA_384: &'static str = "SHA-384";+pub const WEBAUTHN_HASH_ALGORITHM_SHA_512: &'static str = "SHA-512";+pub const WEBAUTHN_RP_ENTITY_INFORMATION_CURRENT_VERSION: DWORD = 1;+STRUCT!{struct WEBAUTHN_RP_ENTITY_INFORMATION {+    dwVersion: DWORD,+    pwszId: PCWSTR,+    pwszName: PCWSTR,+    pwszIcon: PCWSTR,+}}+pub type PWEBAUTHN_RP_ENTITY_INFORMATION = *mut WEBAUTHN_RP_ENTITY_INFORMATION;+pub type PCWEBAUTHN_RP_ENTITY_INFORMATION = *const WEBAUTHN_RP_ENTITY_INFORMATION;+pub const WEBAUTHN_MAX_USER_ID_LENGTH: DWORD = 64;+pub const WEBAUTHN_USER_ENTITY_INFORMATION_CURRENT_VERSION: DWORD = 1;+STRUCT!{struct WEBAUTHN_USER_ENTITY_INFORMATION {+    dwVersion: DWORD,+    cbId: DWORD,+    pbId: PBYTE,+    pwszName: PCWSTR,+    pwszIcon: PCWSTR,+    pwszDisplayName: PCWSTR,+}}+pub type PWEBAUTHN_USER_ENTITY_INFORMATION = *mut WEBAUTHN_USER_ENTITY_INFORMATION;+pub type PCWEBAUTHN_USER_ENTITY_INFORMATION = *const WEBAUTHN_USER_ENTITY_INFORMATION;+pub const WEBAUTHN_CLIENT_DATA_CURRENT_VERSION: DWORD = 1;+STRUCT!{struct WEBAUTHN_CLIENT_DATA {+    dwVersion: DWORD,+    cbClientDataJSON: DWORD,+    pbClientDataJSON: PBYTE,+    pwszHashAlgId: LPCWSTR,+}}+pub type PWEBAUTHN_CLIENT_DATA = *mut WEBAUTHN_CLIENT_DATA;+pub type PCWEBAUTHN_CLIENT_DATA = *const WEBAUTHN_CLIENT_DATA;+pub const WEBAUTHN_CREDENTIAL_TYPE_PUBLIC_KEY: &'static str = "public-key";+pub const WEBAUTHN_COSE_CREDENTIAL_PARAMETER_CURRENT_VERSION: DWORD = 1;+STRUCT!{struct WEBAUTHN_COSE_CREDENTIAL_PARAMETER {+    dwVersion: DWORD,+    pwszCredentialType: LPCWSTR,+    lAlg: LONG,+}}+pub type PWEBAUTHN_COSE_CREDENTIAL_PARAMETER = *mut WEBAUTHN_COSE_CREDENTIAL_PARAMETER;+pub type PCWEBAUTHN_COSE_CREDENTIAL_PARAMETER = *const WEBAUTHN_COSE_CREDENTIAL_PARAMETER;+STRUCT!{struct WEBAUTHN_COSE_CREDENTIAL_PARAMETERS {+    cCredentialParameters: DWORD,+    pCredentialParameters: PWEBAUTHN_COSE_CREDENTIAL_PARAMETER,+}}+pub type PWEBAUTHN_COSE_CREDENTIAL_PARAMETERS = *mut WEBAUTHN_COSE_CREDENTIAL_PARAMETERS;+pub type PCWEBAUTHN_COSE_CREDENTIAL_PARAMETERS = *const WEBAUTHN_COSE_CREDENTIAL_PARAMETERS;+pub const WEBAUTHN_CREDENTIAL_CURRENT_VERSION: DWORD = 1;+STRUCT!{struct WEBAUTHN_CREDENTIAL {+    dwVersion: DWORD,+    cbId: DWORD,+    pbId: PBYTE,+    pwszCredentialType: LPCWSTR,+}}+pub type PWEBAUTHN_CREDENTIAL = *mut WEBAUTHN_CREDENTIAL;+pub type PCWEBAUTHN_CREDENTIAL = *const WEBAUTHN_CREDENTIAL;+STRUCT!{struct WEBAUTHN_CREDENTIALS {+    cCredentials: DWORD,+    pCredentials: PWEBAUTHN_CREDENTIAL,+}}+pub type PWEBAUTHN_CREDENTIALS = *mut WEBAUTHN_CREDENTIALS;+pub type PCWEBAUTHN_CREDENTIALS = *const WEBAUTHN_CREDENTIALS;+pub const WEBAUTHN_CTAP_TRANSPORT_USB: DWORD = 0x01;+pub const WEBAUTHN_CTAP_TRANSPORT_NFC: DWORD = 0x02;+pub const WEBAUTHN_CTAP_TRANSPORT_BLE: DWORD = 0x04;+pub const WEBAUTHN_CTAP_TRANSPORT_TEST: DWORD = 0x08;+pub const WEBAUTHN_CTAP_TRANSPORT_INTERNAL: DWORD = 0x10;+pub const WEBAUTHN_CTAP_TRANSPORT_FLAGS_MASK: DWORD = 0x1F;+pub const WEBAUTHN_CREDENTIAL_EX_CURRENT_VERSION: DWORD = 1;+STRUCT!{struct WEBAUTHN_CREDENTIAL_EX {+    dwVersion: DWORD,+    cbId: DWORD,+    pbId: PBYTE,+    pwszCredentialType: LPCWSTR,+    dwTransports: DWORD,+}}+pub type PWEBAUTHN_CREDENTIAL_EX = *mut WEBAUTHN_CREDENTIAL_EX;+pub type PCWEBAUTHN_CREDENTIAL_EX = *const WEBAUTHN_CREDENTIAL_EX;+STRUCT!{struct WEBAUTHN_EXTENSION {+    pwszExtensionIdentifier: LPCWSTR,+    cbExtension: DWORD,+    pvExtension: PVOID,+}}+pub type PWEBAUTHN_EXTENSION = *mut WEBAUTHN_EXTENSION;+pub type PCWEBAUTHN_EXTENSION = *const WEBAUTHN_EXTENSION;+STRUCT!{struct WEBAUTHN_EXTENSIONS {+    cExtensions: DWORD,+    pExtensions: PWEBAUTHN_EXTENSION,+}}+pub type PWEBAUTHN_EXTENSIONS = *mut WEBAUTHN_EXTENSIONS;+pub type PCWEBAUTHN_EXTENSIONS = *const WEBAUTHN_EXTENSIONS;+STRUCT!{struct WEBAUTHN_CREDENTIAL_LIST {+    cCredentials: DWORD,+    ppCredentials: *mut PWEBAUTHN_CREDENTIAL_EX,+}}+pub type PWEBAUTHN_CREDENTIAL_LIST = *mut WEBAUTHN_CREDENTIAL_LIST;+pub type PCWEBAUTHN_CREDENTIAL_LIST = *const WEBAUTHN_CREDENTIAL_LIST;+pub const WEBAUTHN_AUTHENTICATOR_ATTACHMENT_ANY: DWORD = 0;+pub const WEBAUTHN_AUTHENTICATOR_ATTACHMENT_PLATFORM: DWORD = 1;+pub const WEBAUTHN_AUTHENTICATOR_ATTACHMENT_CROSS_PLATFORM: DWORD = 2;+pub const WEBAUTHN_AUTHENTICATOR_ATTACHMENT_CROSS_PLATFORM_U2F_V2: DWORD = 3;+pub const WEBAUTHN_USER_VERIFICATION_REQUIREMENT_ANY: DWORD = 0;+pub const WEBAUTHN_USER_VERIFICATION_REQUIREMENT_REQUIRED: DWORD = 1;+pub const WEBAUTHN_USER_VERIFICATION_REQUIREMENT_PREFERRED: DWORD = 2;+pub const WEBAUTHN_USER_VERIFICATION_REQUIREMENT_DISCOURAGED: DWORD = 3;+pub const WEBAUTHN_ATTESTATION_CONVEYANCE_PREFERENCE_ANY: DWORD = 0;+pub const WEBAUTHN_ATTESTATION_CONVEYANCE_PREFERENCE_NONE: DWORD = 1;+pub const WEBAUTHN_ATTESTATION_CONVEYANCE_PREFERENCE_INDIRECT: DWORD = 2;+pub const WEBAUTHN_ATTESTATION_CONVEYANCE_PREFERENCE_DIRECT: DWORD = 3;+pub const WEBAUTHN_AUTHENTICATOR_MAKE_CREDENTIAL_OPTIONS_VERSION_1: DWORD = 1;+pub const WEBAUTHN_AUTHENTICATOR_MAKE_CREDENTIAL_OPTIONS_VERSION_2: DWORD = 2;+pub const WEBAUTHN_AUTHENTICATOR_MAKE_CREDENTIAL_OPTIONS_VERSION_3: DWORD = 3;+pub const WEBAUTHN_AUTHENTICATOR_MAKE_CREDENTIAL_OPTIONS_CURRENT_VERSION: DWORD =+    WEBAUTHN_AUTHENTICATOR_MAKE_CREDENTIAL_OPTIONS_VERSION_3;+STRUCT!{struct WEBAUTHN_AUTHENTICATOR_MAKE_CREDENTIAL_OPTIONS {+    dwVersion: DWORD,+    dwTimeoutMilliseconds: DWORD,+    CredentialList: WEBAUTHN_CREDENTIALS,+    Extensions: WEBAUTHN_EXTENSIONS,+    dwAuthenticatorAttachment: DWORD,+    bRequireResidentKey: BOOL,+    dwUserVerificationRequirement: DWORD,+    dwAttestationConveyancePreference: DWORD,+    dwFlags: DWORD,+    pCancellationId: *mut GUID,+    pExcludeCredentialList: PWEBAUTHN_CREDENTIAL_LIST,+}}+pub type PWEBAUTHN_AUTHENTICATOR_MAKE_CREDENTIAL_OPTIONS = *mut+    WEBAUTHN_AUTHENTICATOR_MAKE_CREDENTIAL_OPTIONS;+pub type PCWEBAUTHN_AUTHENTICATOR_MAKE_CREDENTIAL_OPTIONS = *const+    WEBAUTHN_AUTHENTICATOR_MAKE_CREDENTIAL_OPTIONS;+pub const WEBAUTHN_AUTHENTICATOR_GET_ASSERTION_OPTIONS_VERSION_1: DWORD = 1;+pub const WEBAUTHN_AUTHENTICATOR_GET_ASSERTION_OPTIONS_VERSION_2: DWORD = 2;+pub const WEBAUTHN_AUTHENTICATOR_GET_ASSERTION_OPTIONS_VERSION_3: DWORD = 3;+pub const WEBAUTHN_AUTHENTICATOR_GET_ASSERTION_OPTIONS_VERSION_4: DWORD = 4;+pub const WEBAUTHN_AUTHENTICATOR_GET_ASSERTION_OPTIONS_CURRENT_VERSION: DWORD =+    WEBAUTHN_AUTHENTICATOR_GET_ASSERTION_OPTIONS_VERSION_4;+STRUCT!{struct WEBAUTHN_AUTHENTICATOR_GET_ASSERTION_OPTIONS {+    dwVersion: DWORD,+    dwTimeoutMilliseconds: DWORD,+    CredentialList: WEBAUTHN_CREDENTIALS,+    Extensions: WEBAUTHN_EXTENSIONS,+    dwAuthenticatorAttachment: DWORD,+    dwUserVerificationRequirement: DWORD,+    dwFlags: DWORD,+    pwszU2fAppId: PCWSTR,+    pbU2fAppId: *mut BOOL,+    pCancellationId: *mut GUID,+    pAllowCredentialList: PWEBAUTHN_CREDENTIAL_LIST,+}}+pub type PWEBAUTHN_AUTHENTICATOR_GET_ASSERTION_OPTIONS = *mut+    WEBAUTHN_AUTHENTICATOR_GET_ASSERTION_OPTIONS;+pub type PCWEBAUTHN_AUTHENTICATOR_GET_ASSERTION_OPTIONS = *const+    WEBAUTHN_AUTHENTICATOR_GET_ASSERTION_OPTIONS;+pub const WEBAUTHN_CREDENTIAL_ATTESTATION_VERSION_1: DWORD = 1;+pub const WEBAUTHN_CREDENTIAL_ATTESTATION_VERSION_2: DWORD = 2;+pub const WEBAUTHN_CREDENTIAL_ATTESTATION_VERSION_3: DWORD = 3;+pub const WEBAUTHN_CREDENTIAL_ATTESTATION_CURRENT_VERSION: DWORD =+    WEBAUTHN_CREDENTIAL_ATTESTATION_VERSION_3;+STRUCT!{struct WEBAUTHN_CREDENTIAL_ATTESTATION {+    dwVersion: DWORD,+    pwszFormatType: PCWSTR,+    cbAuthenticatorData: DWORD,+    pbAuthenticatorData: PBYTE,+    cbAttestation: DWORD,+    pbAttestation: PBYTE,+    dwAttestationDecodeType: DWORD,+    pvAttestationDecode: PVOID,+    cbAttestationObject: DWORD,+    pbAttestationObject: PBYTE,+    cbCredentialId: DWORD,+    pbCredentialId: PBYTE,+    Extensions: WEBAUTHN_EXTENSIONS,+    dwUsedTransport: DWORD,+}}+pub type PWEBAUTHN_CREDENTIAL_ATTESTATION = *mut WEBAUTHN_CREDENTIAL_ATTESTATION;+pub type PCWEBAUTHN_CREDENTIAL_ATTESTATION = *const WEBAUTHN_CREDENTIAL_ATTESTATION;+pub const WEBAUTHN_ASSERTION_CURRENT_VERSION: DWORD = 1;+STRUCT!{struct WEBAUTHN_ASSERTION {+    dwVersion: DWORD,+    cbAuthenticatorData: DWORD,+    pbAuthenticatorData: PBYTE,+    cbSignature: DWORD,+    pbSignature: PBYTE,+    Credential: WEBAUTHN_CREDENTIAL,+    cbUserId: DWORD,+    pbUserId: PBYTE,+}}+pub type PWEBAUTHN_ASSERTION = *mut WEBAUTHN_ASSERTION;+pub type PCWEBAUTHN_ASSERTION = *const WEBAUTHN_ASSERTION;+extern "system" {+    pub fn WebAuthNAuthenticatorMakeCredential(+        hWnd: HWND,+        pRpInformation: PCWEBAUTHN_RP_ENTITY_INFORMATION,+        pUserInformation: PCWEBAUTHN_USER_ENTITY_INFORMATION,+        pPubKeyCredParams: PCWEBAUTHN_COSE_CREDENTIAL_PARAMETERS,+        pWebAuthNClientData: PCWEBAUTHN_CLIENT_DATA,+        pWebAuthNMakeCredentialOPtions: PCWEBAUTHN_AUTHENTICATOR_MAKE_CREDENTIAL_OPTIONS,+        ppWebAuthNCredentialAttestattion: *mut PWEBAUTHN_CREDENTIAL_ATTESTATION,

Nit: ppWebAuthNCredentialAttestattion is one too many ts

hecrj

comment created time in 2 hours

Pull request review commentretep998/winapi-rs

WebAuthN bindings

+// Licensed under the Apache License, Version 2.0+// <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option.+// All files in the project carrying such notice may not be copied, modified, or distributed+// except according to those terms.+use shared::guiddef::GUID;+use shared::minwindef::{BOOL, DWORD, PBYTE};+use shared::windef::HWND;+use um::winnt::{HRESULT, LONG, LPCWSTR, PCWSTR, PVOID};+pub const WEBAUTHN_API_VERSION_1: DWORD = 1;+pub const WEBAUTHN_API_VERSION_2: DWORD = 2;+pub const WEBAUTHN_API_CURRENT_VERSION: DWORD = WEBAUTHN_API_VERSION_2;+pub const WEBAUTHN_HASH_ALGORITHM_SHA_256: &'static str = "SHA-256";+pub const WEBAUTHN_HASH_ALGORITHM_SHA_384: &'static str = "SHA-384";+pub const WEBAUTHN_HASH_ALGORITHM_SHA_512: &'static str = "SHA-512";+pub const WEBAUTHN_RP_ENTITY_INFORMATION_CURRENT_VERSION: DWORD = 1;+STRUCT!{struct WEBAUTHN_RP_ENTITY_INFORMATION {+    dwVersion: DWORD,+    pwszId: PCWSTR,+    pwszName: PCWSTR,+    pwszIcon: PCWSTR,+}}+pub type PWEBAUTHN_RP_ENTITY_INFORMATION = *mut WEBAUTHN_RP_ENTITY_INFORMATION;+pub type PCWEBAUTHN_RP_ENTITY_INFORMATION = *const WEBAUTHN_RP_ENTITY_INFORMATION;+pub const WEBAUTHN_MAX_USER_ID_LENGTH: DWORD = 64;+pub const WEBAUTHN_USER_ENTITY_INFORMATION_CURRENT_VERSION: DWORD = 1;+STRUCT!{struct WEBAUTHN_USER_ENTITY_INFORMATION {+    dwVersion: DWORD,+    cbId: DWORD,+    pbId: PBYTE,+    pwszName: PCWSTR,+    pwszIcon: PCWSTR,+    pwszDisplayName: PCWSTR,+}}+pub type PWEBAUTHN_USER_ENTITY_INFORMATION = *mut WEBAUTHN_USER_ENTITY_INFORMATION;+pub type PCWEBAUTHN_USER_ENTITY_INFORMATION = *const WEBAUTHN_USER_ENTITY_INFORMATION;+pub const WEBAUTHN_CLIENT_DATA_CURRENT_VERSION: DWORD = 1;+STRUCT!{struct WEBAUTHN_CLIENT_DATA {+    dwVersion: DWORD,+    cbClientDataJSON: DWORD,+    pbClientDataJSON: PBYTE,+    pwszHashAlgId: LPCWSTR,+}}+pub type PWEBAUTHN_CLIENT_DATA = *mut WEBAUTHN_CLIENT_DATA;+pub type PCWEBAUTHN_CLIENT_DATA = *const WEBAUTHN_CLIENT_DATA;+pub const WEBAUTHN_CREDENTIAL_TYPE_PUBLIC_KEY: &'static str = "public-key";+pub const WEBAUTHN_COSE_CREDENTIAL_PARAMETER_CURRENT_VERSION: DWORD = 1;+STRUCT!{struct WEBAUTHN_COSE_CREDENTIAL_PARAMETER {+    dwVersion: DWORD,+    pwszCredentialType: LPCWSTR,+    lAlg: LONG,+}}+pub type PWEBAUTHN_COSE_CREDENTIAL_PARAMETER = *mut WEBAUTHN_COSE_CREDENTIAL_PARAMETER;+pub type PCWEBAUTHN_COSE_CREDENTIAL_PARAMETER = *const WEBAUTHN_COSE_CREDENTIAL_PARAMETER;+STRUCT!{struct WEBAUTHN_COSE_CREDENTIAL_PARAMETERS {+    cCredentialParameters: DWORD,+    pCredentialParameters: PWEBAUTHN_COSE_CREDENTIAL_PARAMETER,+}}+pub type PWEBAUTHN_COSE_CREDENTIAL_PARAMETERS = *mut WEBAUTHN_COSE_CREDENTIAL_PARAMETERS;+pub type PCWEBAUTHN_COSE_CREDENTIAL_PARAMETERS = *const WEBAUTHN_COSE_CREDENTIAL_PARAMETERS;+pub const WEBAUTHN_CREDENTIAL_CURRENT_VERSION: DWORD = 1;+STRUCT!{struct WEBAUTHN_CREDENTIAL {+    dwVersion: DWORD,+    cbId: DWORD,+    pbId: PBYTE,+    pwszCredentialType: LPCWSTR,+}}+pub type PWEBAUTHN_CREDENTIAL = *mut WEBAUTHN_CREDENTIAL;+pub type PCWEBAUTHN_CREDENTIAL = *const WEBAUTHN_CREDENTIAL;+STRUCT!{struct WEBAUTHN_CREDENTIALS {+    cCredentials: DWORD,+    pCredentials: PWEBAUTHN_CREDENTIAL,+}}+pub type PWEBAUTHN_CREDENTIALS = *mut WEBAUTHN_CREDENTIALS;+pub type PCWEBAUTHN_CREDENTIALS = *const WEBAUTHN_CREDENTIALS;+pub const WEBAUTHN_CTAP_TRANSPORT_USB: DWORD = 0x01;+pub const WEBAUTHN_CTAP_TRANSPORT_NFC: DWORD = 0x02;+pub const WEBAUTHN_CTAP_TRANSPORT_BLE: DWORD = 0x04;+pub const WEBAUTHN_CTAP_TRANSPORT_TEST: DWORD = 0x08;+pub const WEBAUTHN_CTAP_TRANSPORT_INTERNAL: DWORD = 0x10;+pub const WEBAUTHN_CTAP_TRANSPORT_FLAGS_MASK: DWORD = 0x1F;+pub const WEBAUTHN_CREDENTIAL_EX_CURRENT_VERSION: DWORD = 1;+STRUCT!{struct WEBAUTHN_CREDENTIAL_EX {+    dwVersion: DWORD,+    cbId: DWORD,+    pbId: PBYTE,+    pwszCredentialType: LPCWSTR,+    dwTransports: DWORD,+}}+pub type PWEBAUTHN_CREDENTIAL_EX = *mut WEBAUTHN_CREDENTIAL_EX;+pub type PCWEBAUTHN_CREDENTIAL_EX = *const WEBAUTHN_CREDENTIAL_EX;+STRUCT!{struct WEBAUTHN_EXTENSION {+    pwszExtensionIdentifier: LPCWSTR,+    cbExtension: DWORD,+    pvExtension: PVOID,+}}+pub type PWEBAUTHN_EXTENSION = *mut WEBAUTHN_EXTENSION;+pub type PCWEBAUTHN_EXTENSION = *const WEBAUTHN_EXTENSION;+STRUCT!{struct WEBAUTHN_EXTENSIONS {+    cExtensions: DWORD,+    pExtensions: PWEBAUTHN_EXTENSION,+}}+pub type PWEBAUTHN_EXTENSIONS = *mut WEBAUTHN_EXTENSIONS;+pub type PCWEBAUTHN_EXTENSIONS = *const WEBAUTHN_EXTENSIONS;+STRUCT!{struct WEBAUTHN_CREDENTIAL_LIST {+    cCredentials: DWORD,+    ppCredentials: *mut PWEBAUTHN_CREDENTIAL_EX,+}}+pub type PWEBAUTHN_CREDENTIAL_LIST = *mut WEBAUTHN_CREDENTIAL_LIST;+pub type PCWEBAUTHN_CREDENTIAL_LIST = *const WEBAUTHN_CREDENTIAL_LIST;+pub const WEBAUTHN_AUTHENTICATOR_ATTACHMENT_ANY: DWORD = 0;+pub const WEBAUTHN_AUTHENTICATOR_ATTACHMENT_PLATFORM: DWORD = 1;+pub const WEBAUTHN_AUTHENTICATOR_ATTACHMENT_CROSS_PLATFORM: DWORD = 2;+pub const WEBAUTHN_AUTHENTICATOR_ATTACHMENT_CROSS_PLATFORM_U2F_V2: DWORD = 3;+pub const WEBAUTHN_USER_VERIFICATION_REQUIREMENT_ANY: DWORD = 0;+pub const WEBAUTHN_USER_VERIFICATION_REQUIREMENT_REQUIRED: DWORD = 1;+pub const WEBAUTHN_USER_VERIFICATION_REQUIREMENT_PREFERRED: DWORD = 2;+pub const WEBAUTHN_USER_VERIFICATION_REQUIREMENT_DISCOURAGED: DWORD = 3;+pub const WEBAUTHN_ATTESTATION_CONVEYANCE_PREFERENCE_ANY: DWORD = 0;+pub const WEBAUTHN_ATTESTATION_CONVEYANCE_PREFERENCE_NONE: DWORD = 1;+pub const WEBAUTHN_ATTESTATION_CONVEYANCE_PREFERENCE_INDIRECT: DWORD = 2;+pub const WEBAUTHN_ATTESTATION_CONVEYANCE_PREFERENCE_DIRECT: DWORD = 3;+pub const WEBAUTHN_AUTHENTICATOR_MAKE_CREDENTIAL_OPTIONS_VERSION_1: DWORD = 1;+pub const WEBAUTHN_AUTHENTICATOR_MAKE_CREDENTIAL_OPTIONS_VERSION_2: DWORD = 2;+pub const WEBAUTHN_AUTHENTICATOR_MAKE_CREDENTIAL_OPTIONS_VERSION_3: DWORD = 3;+pub const WEBAUTHN_AUTHENTICATOR_MAKE_CREDENTIAL_OPTIONS_CURRENT_VERSION: DWORD =+    WEBAUTHN_AUTHENTICATOR_MAKE_CREDENTIAL_OPTIONS_VERSION_3;+STRUCT!{struct WEBAUTHN_AUTHENTICATOR_MAKE_CREDENTIAL_OPTIONS {+    dwVersion: DWORD,+    dwTimeoutMilliseconds: DWORD,+    CredentialList: WEBAUTHN_CREDENTIALS,+    Extensions: WEBAUTHN_EXTENSIONS,+    dwAuthenticatorAttachment: DWORD,+    bRequireResidentKey: BOOL,+    dwUserVerificationRequirement: DWORD,+    dwAttestationConveyancePreference: DWORD,+    dwFlags: DWORD,+    pCancellationId: *mut GUID,+    pExcludeCredentialList: PWEBAUTHN_CREDENTIAL_LIST,+}}+pub type PWEBAUTHN_AUTHENTICATOR_MAKE_CREDENTIAL_OPTIONS = *mut+    WEBAUTHN_AUTHENTICATOR_MAKE_CREDENTIAL_OPTIONS;+pub type PCWEBAUTHN_AUTHENTICATOR_MAKE_CREDENTIAL_OPTIONS = *const+    WEBAUTHN_AUTHENTICATOR_MAKE_CREDENTIAL_OPTIONS;+pub const WEBAUTHN_AUTHENTICATOR_GET_ASSERTION_OPTIONS_VERSION_1: DWORD = 1;+pub const WEBAUTHN_AUTHENTICATOR_GET_ASSERTION_OPTIONS_VERSION_2: DWORD = 2;+pub const WEBAUTHN_AUTHENTICATOR_GET_ASSERTION_OPTIONS_VERSION_3: DWORD = 3;+pub const WEBAUTHN_AUTHENTICATOR_GET_ASSERTION_OPTIONS_VERSION_4: DWORD = 4;+pub const WEBAUTHN_AUTHENTICATOR_GET_ASSERTION_OPTIONS_CURRENT_VERSION: DWORD =+    WEBAUTHN_AUTHENTICATOR_GET_ASSERTION_OPTIONS_VERSION_4;+STRUCT!{struct WEBAUTHN_AUTHENTICATOR_GET_ASSERTION_OPTIONS {+    dwVersion: DWORD,+    dwTimeoutMilliseconds: DWORD,+    CredentialList: WEBAUTHN_CREDENTIALS,+    Extensions: WEBAUTHN_EXTENSIONS,+    dwAuthenticatorAttachment: DWORD,+    dwUserVerificationRequirement: DWORD,+    dwFlags: DWORD,+    pwszU2fAppId: PCWSTR,+    pbU2fAppId: *mut BOOL,+    pCancellationId: *mut GUID,+    pAllowCredentialList: PWEBAUTHN_CREDENTIAL_LIST,+}}+pub type PWEBAUTHN_AUTHENTICATOR_GET_ASSERTION_OPTIONS = *mut+    WEBAUTHN_AUTHENTICATOR_GET_ASSERTION_OPTIONS;+pub type PCWEBAUTHN_AUTHENTICATOR_GET_ASSERTION_OPTIONS = *const+    WEBAUTHN_AUTHENTICATOR_GET_ASSERTION_OPTIONS;+pub const WEBAUTHN_CREDENTIAL_ATTESTATION_VERSION_1: DWORD = 1;+pub const WEBAUTHN_CREDENTIAL_ATTESTATION_VERSION_2: DWORD = 2;+pub const WEBAUTHN_CREDENTIAL_ATTESTATION_VERSION_3: DWORD = 3;+pub const WEBAUTHN_CREDENTIAL_ATTESTATION_CURRENT_VERSION: DWORD =+    WEBAUTHN_CREDENTIAL_ATTESTATION_VERSION_3;+STRUCT!{struct WEBAUTHN_CREDENTIAL_ATTESTATION {+    dwVersion: DWORD,+    pwszFormatType: PCWSTR,+    cbAuthenticatorData: DWORD,+    pbAuthenticatorData: PBYTE,+    cbAttestation: DWORD,+    pbAttestation: PBYTE,+    dwAttestationDecodeType: DWORD,+    pvAttestationDecode: PVOID,+    cbAttestationObject: DWORD,+    pbAttestationObject: PBYTE,+    cbCredentialId: DWORD,+    pbCredentialId: PBYTE,+    Extensions: WEBAUTHN_EXTENSIONS,+    dwUsedTransport: DWORD,+}}+pub type PWEBAUTHN_CREDENTIAL_ATTESTATION = *mut WEBAUTHN_CREDENTIAL_ATTESTATION;+pub type PCWEBAUTHN_CREDENTIAL_ATTESTATION = *const WEBAUTHN_CREDENTIAL_ATTESTATION;+pub const WEBAUTHN_ASSERTION_CURRENT_VERSION: DWORD = 1;+STRUCT!{struct WEBAUTHN_ASSERTION {+    dwVersion: DWORD,+    cbAuthenticatorData: DWORD,+    pbAuthenticatorData: PBYTE,+    cbSignature: DWORD,+    pbSignature: PBYTE,+    Credential: WEBAUTHN_CREDENTIAL,+    cbUserId: DWORD,+    pbUserId: PBYTE,+}}+pub type PWEBAUTHN_ASSERTION = *mut WEBAUTHN_ASSERTION;+pub type PCWEBAUTHN_ASSERTION = *const WEBAUTHN_ASSERTION;+extern "system" {+    pub fn WebAuthNAuthenticatorMakeCredential(+        hWnd: HWND,+        pRpInformation: PCWEBAUTHN_RP_ENTITY_INFORMATION,+        pUserInformation: PCWEBAUTHN_USER_ENTITY_INFORMATION,+        pPubKeyCredParams: PCWEBAUTHN_COSE_CREDENTIAL_PARAMETERS,+        pWebAuthNClientData: PCWEBAUTHN_CLIENT_DATA,+        pWebAuthNMakeCredentialOPtions: PCWEBAUTHN_AUTHENTICATOR_MAKE_CREDENTIAL_OPTIONS,

Nit: pWebAuthNMakeCredentialOPtions miscapitalized

hecrj

comment created time in 2 hours

Pull request review commentretep998/winapi-rs

WebAuthN bindings

+// Licensed under the Apache License, Version 2.0+// <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option.+// All files in the project carrying such notice may not be copied, modified, or distributed+// except according to those terms.+use shared::guiddef::GUID;+use shared::minwindef::{BOOL, DWORD, PBYTE};+use shared::windef::HWND;+use um::winnt::{HRESULT, LONG, LPCWSTR, PCWSTR, PVOID};+pub const WEBAUTHN_API_VERSION_1: DWORD = 1;+pub const WEBAUTHN_API_VERSION_2: DWORD = 2;+pub const WEBAUTHN_API_CURRENT_VERSION: DWORD = WEBAUTHN_API_VERSION_2;+pub const WEBAUTHN_HASH_ALGORITHM_SHA_256: &'static str = "SHA-256";+pub const WEBAUTHN_HASH_ALGORITHM_SHA_384: &'static str = "SHA-384";+pub const WEBAUTHN_HASH_ALGORITHM_SHA_512: &'static str = "SHA-512";+pub const WEBAUTHN_RP_ENTITY_INFORMATION_CURRENT_VERSION: DWORD = 1;+STRUCT!{struct WEBAUTHN_RP_ENTITY_INFORMATION {+    dwVersion: DWORD,+    pwszId: PCWSTR,+    pwszName: PCWSTR,+    pwszIcon: PCWSTR,+}}+pub type PWEBAUTHN_RP_ENTITY_INFORMATION = *mut WEBAUTHN_RP_ENTITY_INFORMATION;+pub type PCWEBAUTHN_RP_ENTITY_INFORMATION = *const WEBAUTHN_RP_ENTITY_INFORMATION;+pub const WEBAUTHN_MAX_USER_ID_LENGTH: DWORD = 64;+pub const WEBAUTHN_USER_ENTITY_INFORMATION_CURRENT_VERSION: DWORD = 1;+STRUCT!{struct WEBAUTHN_USER_ENTITY_INFORMATION {+    dwVersion: DWORD,+    cbId: DWORD,+    pbId: PBYTE,+    pwszName: PCWSTR,+    pwszIcon: PCWSTR,+    pwszDisplayName: PCWSTR,+}}+pub type PWEBAUTHN_USER_ENTITY_INFORMATION = *mut WEBAUTHN_USER_ENTITY_INFORMATION;+pub type PCWEBAUTHN_USER_ENTITY_INFORMATION = *const WEBAUTHN_USER_ENTITY_INFORMATION;+pub const WEBAUTHN_CLIENT_DATA_CURRENT_VERSION: DWORD = 1;+STRUCT!{struct WEBAUTHN_CLIENT_DATA {+    dwVersion: DWORD,+    cbClientDataJSON: DWORD,+    pbClientDataJSON: PBYTE,+    pwszHashAlgId: LPCWSTR,+}}+pub type PWEBAUTHN_CLIENT_DATA = *mut WEBAUTHN_CLIENT_DATA;+pub type PCWEBAUTHN_CLIENT_DATA = *const WEBAUTHN_CLIENT_DATA;+pub const WEBAUTHN_CREDENTIAL_TYPE_PUBLIC_KEY: &'static str = "public-key";+pub const WEBAUTHN_COSE_CREDENTIAL_PARAMETER_CURRENT_VERSION: DWORD = 1;+STRUCT!{struct WEBAUTHN_COSE_CREDENTIAL_PARAMETER {+    dwVersion: DWORD,+    pwszCredentialType: LPCWSTR,+    lAlg: LONG,+}}+pub type PWEBAUTHN_COSE_CREDENTIAL_PARAMETER = *mut WEBAUTHN_COSE_CREDENTIAL_PARAMETER;+pub type PCWEBAUTHN_COSE_CREDENTIAL_PARAMETER = *const WEBAUTHN_COSE_CREDENTIAL_PARAMETER;+STRUCT!{struct WEBAUTHN_COSE_CREDENTIAL_PARAMETERS {+    cCredentialParameters: DWORD,+    pCredentialParameters: PWEBAUTHN_COSE_CREDENTIAL_PARAMETER,+}}+pub type PWEBAUTHN_COSE_CREDENTIAL_PARAMETERS = *mut WEBAUTHN_COSE_CREDENTIAL_PARAMETERS;+pub type PCWEBAUTHN_COSE_CREDENTIAL_PARAMETERS = *const WEBAUTHN_COSE_CREDENTIAL_PARAMETERS;+pub const WEBAUTHN_CREDENTIAL_CURRENT_VERSION: DWORD = 1;+STRUCT!{struct WEBAUTHN_CREDENTIAL {+    dwVersion: DWORD,+    cbId: DWORD,+    pbId: PBYTE,+    pwszCredentialType: LPCWSTR,+}}+pub type PWEBAUTHN_CREDENTIAL = *mut WEBAUTHN_CREDENTIAL;+pub type PCWEBAUTHN_CREDENTIAL = *const WEBAUTHN_CREDENTIAL;+STRUCT!{struct WEBAUTHN_CREDENTIALS {+    cCredentials: DWORD,+    pCredentials: PWEBAUTHN_CREDENTIAL,+}}+pub type PWEBAUTHN_CREDENTIALS = *mut WEBAUTHN_CREDENTIALS;+pub type PCWEBAUTHN_CREDENTIALS = *const WEBAUTHN_CREDENTIALS;+pub const WEBAUTHN_CTAP_TRANSPORT_USB: DWORD = 0x01;+pub const WEBAUTHN_CTAP_TRANSPORT_NFC: DWORD = 0x02;+pub const WEBAUTHN_CTAP_TRANSPORT_BLE: DWORD = 0x04;+pub const WEBAUTHN_CTAP_TRANSPORT_TEST: DWORD = 0x08;+pub const WEBAUTHN_CTAP_TRANSPORT_INTERNAL: DWORD = 0x10;+pub const WEBAUTHN_CTAP_TRANSPORT_FLAGS_MASK: DWORD = 0x1F;+pub const WEBAUTHN_CREDENTIAL_EX_CURRENT_VERSION: DWORD = 1;+STRUCT!{struct WEBAUTHN_CREDENTIAL_EX {+    dwVersion: DWORD,+    cbId: DWORD,+    pbId: PBYTE,+    pwszCredentialType: LPCWSTR,+    dwTransports: DWORD,+}}+pub type PWEBAUTHN_CREDENTIAL_EX = *mut WEBAUTHN_CREDENTIAL_EX;+pub type PCWEBAUTHN_CREDENTIAL_EX = *const WEBAUTHN_CREDENTIAL_EX;+STRUCT!{struct WEBAUTHN_EXTENSION {+    pwszExtensionIdentifier: LPCWSTR,+    cbExtension: DWORD,+    pvExtension: PVOID,+}}+pub type PWEBAUTHN_EXTENSION = *mut WEBAUTHN_EXTENSION;+pub type PCWEBAUTHN_EXTENSION = *const WEBAUTHN_EXTENSION;+STRUCT!{struct WEBAUTHN_EXTENSIONS {+    cExtensions: DWORD,+    pExtensions: PWEBAUTHN_EXTENSION,+}}+pub type PWEBAUTHN_EXTENSIONS = *mut WEBAUTHN_EXTENSIONS;+pub type PCWEBAUTHN_EXTENSIONS = *const WEBAUTHN_EXTENSIONS;

Nit: [P[C]]WEBAUTHN_EXTENSIONS placement doesn't match header order

hecrj

comment created time in 2 hours

Pull request review commentretep998/winapi-rs

WebAuthN bindings

+// Licensed under the Apache License, Version 2.0+// <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option.+// All files in the project carrying such notice may not be copied, modified, or distributed+// except according to those terms.+use shared::guiddef::GUID;+use shared::minwindef::{BOOL, DWORD, PBYTE};+use shared::windef::HWND;+use um::winnt::{HRESULT, LONG, LPCWSTR, PCWSTR, PVOID};+pub const WEBAUTHN_API_VERSION_1: DWORD = 1;+pub const WEBAUTHN_API_VERSION_2: DWORD = 2;+pub const WEBAUTHN_API_CURRENT_VERSION: DWORD = WEBAUTHN_API_VERSION_2;+pub const WEBAUTHN_HASH_ALGORITHM_SHA_256: &'static str = "SHA-256";+pub const WEBAUTHN_HASH_ALGORITHM_SHA_384: &'static str = "SHA-384";+pub const WEBAUTHN_HASH_ALGORITHM_SHA_512: &'static str = "SHA-512";+pub const WEBAUTHN_RP_ENTITY_INFORMATION_CURRENT_VERSION: DWORD = 1;+STRUCT!{struct WEBAUTHN_RP_ENTITY_INFORMATION {+    dwVersion: DWORD,+    pwszId: PCWSTR,+    pwszName: PCWSTR,+    pwszIcon: PCWSTR,+}}+pub type PWEBAUTHN_RP_ENTITY_INFORMATION = *mut WEBAUTHN_RP_ENTITY_INFORMATION;+pub type PCWEBAUTHN_RP_ENTITY_INFORMATION = *const WEBAUTHN_RP_ENTITY_INFORMATION;+pub const WEBAUTHN_MAX_USER_ID_LENGTH: DWORD = 64;+pub const WEBAUTHN_USER_ENTITY_INFORMATION_CURRENT_VERSION: DWORD = 1;+STRUCT!{struct WEBAUTHN_USER_ENTITY_INFORMATION {+    dwVersion: DWORD,+    cbId: DWORD,+    pbId: PBYTE,+    pwszName: PCWSTR,+    pwszIcon: PCWSTR,+    pwszDisplayName: PCWSTR,+}}+pub type PWEBAUTHN_USER_ENTITY_INFORMATION = *mut WEBAUTHN_USER_ENTITY_INFORMATION;+pub type PCWEBAUTHN_USER_ENTITY_INFORMATION = *const WEBAUTHN_USER_ENTITY_INFORMATION;+pub const WEBAUTHN_CLIENT_DATA_CURRENT_VERSION: DWORD = 1;+STRUCT!{struct WEBAUTHN_CLIENT_DATA {+    dwVersion: DWORD,+    cbClientDataJSON: DWORD,+    pbClientDataJSON: PBYTE,+    pwszHashAlgId: LPCWSTR,+}}+pub type PWEBAUTHN_CLIENT_DATA = *mut WEBAUTHN_CLIENT_DATA;+pub type PCWEBAUTHN_CLIENT_DATA = *const WEBAUTHN_CLIENT_DATA;+pub const WEBAUTHN_CREDENTIAL_TYPE_PUBLIC_KEY: &'static str = "public-key";+pub const WEBAUTHN_COSE_CREDENTIAL_PARAMETER_CURRENT_VERSION: DWORD = 1;+STRUCT!{struct WEBAUTHN_COSE_CREDENTIAL_PARAMETER {+    dwVersion: DWORD,+    pwszCredentialType: LPCWSTR,+    lAlg: LONG,+}}+pub type PWEBAUTHN_COSE_CREDENTIAL_PARAMETER = *mut WEBAUTHN_COSE_CREDENTIAL_PARAMETER;+pub type PCWEBAUTHN_COSE_CREDENTIAL_PARAMETER = *const WEBAUTHN_COSE_CREDENTIAL_PARAMETER;+STRUCT!{struct WEBAUTHN_COSE_CREDENTIAL_PARAMETERS {+    cCredentialParameters: DWORD,+    pCredentialParameters: PWEBAUTHN_COSE_CREDENTIAL_PARAMETER,+}}+pub type PWEBAUTHN_COSE_CREDENTIAL_PARAMETERS = *mut WEBAUTHN_COSE_CREDENTIAL_PARAMETERS;+pub type PCWEBAUTHN_COSE_CREDENTIAL_PARAMETERS = *const WEBAUTHN_COSE_CREDENTIAL_PARAMETERS;+pub const WEBAUTHN_CREDENTIAL_CURRENT_VERSION: DWORD = 1;+STRUCT!{struct WEBAUTHN_CREDENTIAL {+    dwVersion: DWORD,+    cbId: DWORD,+    pbId: PBYTE,+    pwszCredentialType: LPCWSTR,+}}+pub type PWEBAUTHN_CREDENTIAL = *mut WEBAUTHN_CREDENTIAL;+pub type PCWEBAUTHN_CREDENTIAL = *const WEBAUTHN_CREDENTIAL;+STRUCT!{struct WEBAUTHN_CREDENTIALS {+    cCredentials: DWORD,+    pCredentials: PWEBAUTHN_CREDENTIAL,+}}+pub type PWEBAUTHN_CREDENTIALS = *mut WEBAUTHN_CREDENTIALS;+pub type PCWEBAUTHN_CREDENTIALS = *const WEBAUTHN_CREDENTIALS;+pub const WEBAUTHN_CTAP_TRANSPORT_USB: DWORD = 0x01;+pub const WEBAUTHN_CTAP_TRANSPORT_NFC: DWORD = 0x02;+pub const WEBAUTHN_CTAP_TRANSPORT_BLE: DWORD = 0x04;+pub const WEBAUTHN_CTAP_TRANSPORT_TEST: DWORD = 0x08;+pub const WEBAUTHN_CTAP_TRANSPORT_INTERNAL: DWORD = 0x10;+pub const WEBAUTHN_CTAP_TRANSPORT_FLAGS_MASK: DWORD = 0x1F;

Should these be 0-padded like they are in the header ala GUIDs? (values are correct)

hecrj

comment created time in 2 hours

Pull request review commentretep998/winapi-rs

WebAuthN bindings

+// Licensed under the Apache License, Version 2.0+// <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option.+// All files in the project carrying such notice may not be copied, modified, or distributed+// except according to those terms.+use shared::guiddef::GUID;+use shared::minwindef::{BOOL, DWORD, PBYTE};+use shared::windef::HWND;+use um::winnt::{HRESULT, LONG, LPCWSTR, PCWSTR, PVOID};+pub const WEBAUTHN_API_VERSION_1: DWORD = 1;+pub const WEBAUTHN_API_VERSION_2: DWORD = 2;+pub const WEBAUTHN_API_CURRENT_VERSION: DWORD = WEBAUTHN_API_VERSION_2;+pub const WEBAUTHN_HASH_ALGORITHM_SHA_256: &'static str = "SHA-256";+pub const WEBAUTHN_HASH_ALGORITHM_SHA_384: &'static str = "SHA-384";+pub const WEBAUTHN_HASH_ALGORITHM_SHA_512: &'static str = "SHA-512";

Nit: WEBAUTHN_HASH_ALGORITHM_SHA_* doesn't match header order

hecrj

comment created time in 3 hours

pull request commentretep998/winapi-rs

WebAuthN bindings

webauthn.h implies several of these structs might gain additional fields in the future (and in fact has comments implying this happened a few times already before WEBAUTHN_API_VERSION_1 as found in 10.0.18362.0!). In modern Rust, #[non_exhaustive] might be appropriate? But that's not available until well after winapi's minimum supported rust version of 1.6. I'm not sure if extending the STRUCT! macro to support adding an old style hidden _non_exhaustive: () field might be appropriate...?

WEBAUTHN_API_VERSION_2 (10.0.19041.0, which this PR appears to be based on) doesn't add any new fields to any of the structs if the header comments are to be believed, so that's a plus at least.

hecrj

comment created time in 3 hours

pull request commentretep998/winapi-rs

Never return from ExitProcess

I'm not sure if this would technically be a breaking change in some strange edge cases involving Fn type inference? Would it be appropriate to target dev instead of 0.3?

That said, the windows headers do mark it DECLSPEC_NORETURN (__declspec(noreturn)) which means it really shouldn't ever return (would be undefined behavior in C++ codebases if it did), so I think the change itself is good :+1:

Plecra

comment created time in 3 hours

pull request commentretep998/winapi-rs

Instead of an empty crate, give a compile error when not on Windows

This would be a breaking change - I believe this should target the dev branch instead of the 0.3 branch?

jyn514

comment created time in 3 hours

startedretep998/winapi-rs

started time in 8 hours

created repositoryDarkX411/starter-book

created time in 10 hours

startedretep998/winapi-rs

started time in 21 hours

startedgoburrow/cache

started time in a day

startedretep998/winapi-rs

started time in a day

pull request commentretep998/winapi-rs

Add missing GetFileVersionInfo*Ex* funcs

Relevant header code:

winver.h

DWORD APIENTRY GetFileVersionInfoSizeExA(_In_ DWORD dwFlags, _In_ LPCSTR lpwstrFilename, _Out_ LPDWORD lpdwHandle);
DWORD APIENTRY GetFileVersionInfoSizeExW(_In_ DWORD dwFlags, _In_ LPCWSTR lpwstrFilename, _Out_ LPDWORD lpdwHandle);

BOOL APIENTRY GetFileVersionInfoExA(_In_ DWORD dwFlags,
                                    _In_ LPCSTR lpwstrFilename,
                                    _Reserved_ DWORD dwHandle,
                                    _In_ DWORD dwLen,
                                    _Out_writes_bytes_(dwLen) LPVOID lpData);
BOOL APIENTRY GetFileVersionInfoExW(_In_ DWORD dwFlags,
                                    _In_ LPCWSTR lpwstrFilename,
                                    _Reserved_ DWORD dwHandle,
                                    _In_ DWORD dwLen,
                                    _Out_writes_bytes_(dwLen) LPVOID lpData);

verrsrc.h


/* 
    FILE_VER_GET_... flags are for use by 
    GetFileVersionInfoSizeEx
    GetFileVersionInfoExW
*/
#define FILE_VER_GET_LOCALISED  0x01
#define FILE_VER_GET_NEUTRAL    0x02
#define FILE_VER_GET_PREFETCHED 0x04

/* ----- Types and structures ----- */

typedef struct tagVS_FIXEDFILEINFO
{
    DWORD   dwSignature;            /* e.g. 0xfeef04bd */
    DWORD   dwStrucVersion;         /* e.g. 0x00000042 = "0.42" */
    DWORD   dwFileVersionMS;        /* e.g. 0x00030075 = "3.75" */
    DWORD   dwFileVersionLS;        /* e.g. 0x00000031 = "0.31" */
    DWORD   dwProductVersionMS;     /* e.g. 0x00030010 = "3.10" */
    DWORD   dwProductVersionLS;     /* e.g. 0x00000031 = "0.31" */
    DWORD   dwFileFlagsMask;        /* = 0x3F for version "0.42" */
    DWORD   dwFileFlags;            /* e.g. VFF_DEBUG | VFF_PRERELEASE */
    DWORD   dwFileOS;               /* e.g. VOS_DOS_WINDOWS16 */
    DWORD   dwFileType;             /* e.g. VFT_DRIVER */
    DWORD   dwFileSubtype;          /* e.g. VFT2_DRV_KEYBOARD */
    DWORD   dwFileDateMS;           /* e.g. 0 */
    DWORD   dwFileDateLS;           /* e.g. 0 */
} VS_FIXEDFILEINFO;

According to the contribution guidelines shouldn't the struct and consts go in a new verrsrc.rs file?

All definitions go into the source file that directly maps to the header the definition is from. 

Also, the parameter name for GetFileVersionInfoExA and GetFileVersionInfoExW lptstrFilename seems to not match the header (lpwstrFilename) Same thing for GetFileVersionInfoSizeExA and GetFileVersionInfoSizeExW

Other than that, LGTM

roblabla

comment created time in a day

pull request commentretep998/winapi-rs

Add missing struct in winsvc.h

Relevant header code:

//
// Service delayed autostart info setting
//
typedef struct _SERVICE_DELAYED_AUTO_START_INFO {
    BOOL       fDelayedAutostart;      // Delayed autostart flag
} SERVICE_DELAYED_AUTO_START_INFO, *LPSERVICE_DELAYED_AUTO_START_INFO;

LGTM, the only thing is maybe we should also add the pointer type below

pub type LPSERVICE_DELAYED_AUTO_START_INFO = *mut SERVICE_DELAYED_AUTO_START_INFO;

I also ran ripgrep in the entire include folder looking for the struct name to check for duplicate definitions just in case, did not find any

NextTurn

comment created time in a day

startedopentk/opentk

started time in 4 days

startedretep998/winapi-rs

started time in 4 days

startedretep998/winapi-rs

started time in 5 days

startedfirdaus/temporal-python-sdk

started time in 5 days

startedalyssaxuu/screenity

started time in 6 days

startedretep998/winapi-rs

started time in 6 days

startedrclone/rclone

started time in 6 days

startedretep998/winapi-rs

started time in 7 days

startedretep998/winapi-rs

started time in 7 days

starteddirectus/directus

started time in 7 days

startedretep998/winapi-rs

started time in 7 days

startedgrafeas/kritis

started time in 7 days

more