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

Windows unicode (_W) api for all Win32 functions #89

Merged
merged 12 commits into from
Aug 1, 2024

Commits on Jul 31, 2024

  1. query windows registry for all COM ports

    individual unsafe blocks
    
    driveby resolve clippy lint
    
    add `Modem` as a device class to query for COM ports
    
    some refactoring of `get_ports_guids` to handle multiple class names
    
    clarifying comment
    
    filter to COM ports rather than removing LPT (unknown what else modems could show up as)
    
    raw ports only need to be iterated if additional ports have been found
    
    resolve typo in comment
    
    str -> w_string function
    
    critique the moethod later...
    
    `get_ports_guids` using `_W` win32 API
    
    `PortDevices::new()` using `_W` win32 API
    
    `PortDevices::instance_id()` using `_W` win32 API
    
    `PortDevices::name()` using `as_utf16`
    
    add utf16->utf8 function
    
    handles the conversion and null trimming
    
    use `from_utf16_lossy_trimmed`
    
    `PortDevice::property()` handling a larger than expected property by retrying
    
    `get_registry_com_ports` using utf16 API
    
    also removed all the unused optional parameters from `RegQueryInfoKey`
    
    minor cleanup
    Crzyrndm authored and sirhcel committed Jul 31, 2024
    Configuration menu
    Copy the full SHA
    69c0d24 View commit details
    Browse the repository at this point in the history
  2. remove one new use of the narrow API

    Crzyrndm authored and sirhcel committed Jul 31, 2024
    Configuration menu
    Copy the full SHA
    64e5566 View commit details
    Browse the repository at this point in the history
  3. PR comments on Port_Device::name

    Crzyrndm authored and sirhcel committed Jul 31, 2024
    Configuration menu
    Copy the full SHA
    d858e9e View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    03225bc View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    87352d0 View commit details
    Browse the repository at this point in the history
  6. Harmonize checks after querying registry values

    Let's use the same type names, variable names, and the same checks for
    easily comparing them.
    sirhcel committed Jul 31, 2024
    Configuration menu
    Copy the full SHA
    435959c View commit details
    Browse the repository at this point in the history
  7. Don't ignore insufficient buffer size for no obvious reason

    There is neither an explanation in the code nor does the history of this
    check reveal any insight in why it should be present. If the buffer is
    too small, what are we getting then, truncated data? I don't see the
    point in processing this data.
    sirhcel committed Jul 31, 2024
    Configuration menu
    Copy the full SHA
    e20f70a View commit details
    Browse the repository at this point in the history
  8. Check type of data from SetupDiGetDevicePropertyW too

    Let's check it the same way as for other registry data.
    sirhcel committed Jul 31, 2024
    Configuration menu
    Copy the full SHA
    28752f7 View commit details
    Browse the repository at this point in the history
  9. Be lavish with buffer space

    Harmonize the buffer sizes used here. If we are already in the mood for
    spending 100 characters, MAX_PATH won't hurt either.
    sirhcel committed Jul 31, 2024
    Configuration menu
    Copy the full SHA
    bb2a95a View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    f1bf351 View commit details
    Browse the repository at this point in the history

Commits on Aug 1, 2024

  1. Clean up nomenclature for character size

    Co-authored-by: Christopher Smyth <[email protected]>
    sirhcel and RossSmyth authored Aug 1, 2024
    Configuration menu
    Copy the full SHA
    c7a3d24 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    0b54550 View commit details
    Browse the repository at this point in the history