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

Bump windows-sys to 0.52 #26

Merged
merged 2 commits into from
Sep 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,42 +32,42 @@ jobs:
run: ./demo.bat

test-stable-linux:
name: Test on 1.48.0 Linux
name: Test on 1.63.0 Linux
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.48.0
toolchain: 1.63.0
- name: Restore MSRV Lock
run: cp Cargo.lock.msrv Cargo.lock
- name: Test
run: make test

test-stable-macos:
name: Test on 1.56.0 macOS
name: Test on 1.63.0 macOS
runs-on: macos-latest

steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.56.0
toolchain: 1.63.0
- name: Restore MSRV Lock
run: cp Cargo.lock.msrv Cargo.lock
- name: Test
run: make test

test-stable-windows:
name: Test on 1.48.0 Windows
name: Test on 1.63.0 Windows
runs-on: windows-latest

steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.48.0
toolchain: 1.63.0
- name: Restore MSRV Lock
run: cp Cargo.lock.msrv Cargo.lock
- name: Test
Expand Down
137 changes: 40 additions & 97 deletions Cargo.lock.msrv

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ rust-version = "1.48"
exclude = ["examples", "demo*"]

[dependencies]
tempfile = "3.6"
tempfile = "3.10.0"

[target."cfg(windows)".dependencies]
fastrand = "1.9.0"
windows-sys = { version = "0.48", features = [
fastrand = "2.1.0"
windows-sys = { version = "0.52", features = [
"Win32_Foundation",
"Win32_Storage_FileSystem",
"Win32_System_Environment",
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![Crates.io](https://img.shields.io/crates/d/self-replace.svg)](https://crates.io/crates/self-replace)
[![License](https://img.shields.io/github/license/mitsuhiko/self-replace)](https://github.com/mitsuhiko/self-replace/blob/main/LICENSE)
[![rustc 1.48.0](https://img.shields.io/badge/rust-1.48%2B-orange.svg)](https://img.shields.io/badge/rust-1.48%2B-orange.svg)
[![rustc 1.63.0](https://img.shields.io/badge/rust-1.63%2B-orange.svg)](https://img.shields.io/badge/rust-1.63%2B-orange.svg)
[![Documentation](https://docs.rs/self-replace/badge.svg)](https://docs.rs/self-replace)

`self-replace` is a crate that allows binaries to replace themselves with newer
Expand Down
5 changes: 2 additions & 3 deletions src/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use std::thread;
use std::time::Duration;

use windows_sys::Win32::Foundation::{
CloseHandle, DuplicateHandle, DUPLICATE_SAME_ACCESS, GENERIC_READ, HANDLE,
CloseHandle, DuplicateHandle, LocalFree, DUPLICATE_SAME_ACCESS, GENERIC_READ, HANDLE,
INVALID_HANDLE_VALUE, MAX_PATH, WAIT_OBJECT_0,
};
use windows_sys::Win32::Security::SECURITY_ATTRIBUTES;
Expand All @@ -20,7 +20,6 @@ use windows_sys::Win32::Storage::FileSystem::{
};
use windows_sys::Win32::System::Environment::GetCommandLineW;
use windows_sys::Win32::System::LibraryLoader::GetModuleFileNameW;
use windows_sys::Win32::System::Memory::LocalFree;
use windows_sys::Win32::System::Threading::{
CreateProcessA, ExitProcess, GetCurrentProcess, WaitForSingleObject, CREATE_NO_WINDOW,
INFINITE, PROCESS_INFORMATION, STARTUPINFOA,
Expand Down Expand Up @@ -235,7 +234,7 @@ fn schedule_self_deletion_on_shutdown(
// This creates a temporary executable with a random name in the given directory and
// the provided suffix.
fn get_temp_executable_name(base: &Path, suffix: &str) -> PathBuf {
let rng = fastrand::Rng::new();
let mut rng = fastrand::Rng::new();
let mut file_name = String::new();
file_name.push('.');

Expand Down
Loading