mullvad / windows-service-rs

Windows services in Rust
Apache License 2.0
513 stars 83 forks source link

Bug fixes, features and some public API changes #87

Closed citreae535 closed 1 year ago

citreae535 commented 1 year ago

Bug fixes and refactors

1. Breaking: change Service.delete to borrow rather than consume self

The underlying win32 API call merely marks the service for deletion. It can be called even if the service is not stopped and will not invalidate the caller's open handle to it. Making the function not consuming self allows the caller to decide when to close the handle. Docs and examples are updated to reflect this change.

2. Refactor double_nul_terminated implementation

New Features

4. Add public method Service.set_delayed_auto_start

This function configures if an auto-start service should be delayed.

5. Add public method Error.is_os_error

This function checks if an error from win32 API call matches a specific OS error code.

Public API changes

These three are more opinionated public API changes based on my own needs, If these do not feel right for you, I'll revert them.

6. Breaking: remove ServiceDependency


This change is Reviewable

pronebird commented 1 year ago

Hi,

Thanks for your efforts. However, your PR introduces a lot of changes, some of them are good, others are breaking or subject to discussion. It would be much simpler to review your changes if they were somehow isolated one from the other via separate PRs.

citreae535 commented 1 year ago

Close in favor of separate PRs