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

Upgrade windows-sys to version 0.59 and passed all the tests. #77

Closed
wants to merge 1 commit into from
Closed
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
6 changes: 3 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- channel: stable
target: x86_64-pc-windows-msvc
lint: true
- channel: '1.46'
- channel: '1.63'
target: x86_64-pc-windows-msvc
restrict_deps_versions: true
env:
Expand Down Expand Up @@ -112,13 +112,13 @@ jobs:
uses: actions-rs/cargo@v1
with:
command: update
args: --package windows-targets:0.48.5 --precise 0.48.5
args: --package windows-targets:0.52.6 --precise 0.52.6
- name: Restrict windows_x86_64_msvc version
if: matrix.restrict_deps_versions
uses: actions-rs/cargo@v1
with:
command: update
args: --package windows_x86_64_msvc:0.48.5 --precise 0.48.5
args: --package windows_x86_64_msvc:0.52.6 --precise 0.52.6
- name: Restrict libc version
if: matrix.restrict_deps_versions
uses: actions-rs/cargo@v1
Expand Down
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ categories = ["api-bindings", "os::windows-apis"]

[dependencies]
cfg-if = "1.0"
windows-sys = {version = "0.48", features = [
windows-sys = { version = "0.59", features = [
"Win32_Foundation",
"Win32_System_Time",
"Win32_System_Registry",
"Win32_Security",
"Win32_Storage_FileSystem",
"Win32_System_Diagnostics_Debug"
]}
"Win32_System_Diagnostics_Debug",
] }
chrono = { version = "0.4.6", optional = true }
serde = { version = "1", optional = true }

Expand Down
16 changes: 8 additions & 8 deletions src/reg_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ impl RegKey {
options: u32,
) -> io::Result<RegKey> {
let c_filename = to_utf16(filename);
let mut new_hkey: HKEY = 0;
let mut new_hkey: HKEY = std::ptr::null_mut();
match unsafe {
Registry::RegLoadAppKeyW(c_filename.as_ptr(), &mut new_hkey, perms, options, 0)
} {
Expand Down Expand Up @@ -191,7 +191,7 @@ impl RegKey {
perms: Registry::REG_SAM_FLAGS,
) -> io::Result<RegKey> {
let c_path = to_utf16(path);
let mut new_hkey: HKEY = 0;
let mut new_hkey: HKEY = std::ptr::null_mut();
match unsafe {
Registry::RegOpenKeyExW(self.hkey, c_path.as_ptr(), options, perms, &mut new_hkey)
} {
Expand Down Expand Up @@ -231,7 +231,7 @@ impl RegKey {
perms: Registry::REG_SAM_FLAGS,
) -> io::Result<RegKey> {
let c_path = to_utf16(path);
let mut new_hkey: HKEY = 0;
let mut new_hkey: HKEY = std::ptr::null_mut();
match unsafe {
Registry::RegOpenKeyTransactedW(
self.hkey,
Expand Down Expand Up @@ -292,7 +292,7 @@ impl RegKey {
perms: Registry::REG_SAM_FLAGS,
) -> io::Result<(RegKey, RegDisposition)> {
let c_path = to_utf16(path);
let mut new_hkey: HKEY = 0;
let mut new_hkey: HKEY = std::ptr::null_mut();
let mut disp_buf: u32 = 0;
match unsafe {
Registry::RegCreateKeyExW(
Expand Down Expand Up @@ -346,7 +346,7 @@ impl RegKey {
perms: Registry::REG_SAM_FLAGS,
) -> io::Result<(RegKey, RegDisposition)> {
let c_path = to_utf16(path);
let mut new_hkey: HKEY = 0;
let mut new_hkey: HKEY = std::ptr::null_mut();
let mut disp_buf: u32 = 0;
match unsafe {
Registry::RegCreateKeyTransactedW(
Expand Down Expand Up @@ -668,7 +668,7 @@ impl RegKey {
c_name.as_ptr(),
ptr::null_mut(),
&mut buf_type,
buf.as_mut_ptr() as *mut u8,
buf.as_mut_ptr(),
&mut buf_len,
)
} {
Expand Down Expand Up @@ -744,7 +744,7 @@ impl RegKey {
c_name.as_ptr(),
0,
t,
value.bytes.as_ptr() as *const u8,
value.bytes.as_ptr(),
value.bytes.len() as u32,
)
} {
Expand Down Expand Up @@ -971,7 +971,7 @@ impl RegKey {
&mut name_len,
ptr::null_mut(), // reserved
&mut buf_type,
buf.as_mut_ptr() as *mut u8,
buf.as_mut_ptr(),
&mut buf_len,
)
} {
Expand Down
2 changes: 1 addition & 1 deletion src/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
//!use winreg::enums::*;
//!use winreg::transaction::Transaction;
//!
//!fn main() {
//!{
//! let t = Transaction::new().unwrap();
//! let hkcu = RegKey::predef(HKEY_CURRENT_USER);
//! let (key, _disp) = hkcu.create_subkey_transacted("Software\\RustTransaction", &t).unwrap();
Expand Down