Skip to content

Commit

Permalink
Apply minor fixes and bump version to 0.10.1
Browse files Browse the repository at this point in the history
* Bump minimal required version of `winapi` to `0.3.9`
* Reexport `REG_PROCESS_APPKEY` and use it in the `load_app_key` example
  • Loading branch information
gentoo90 committed Sep 12, 2021
1 parent 76f84e9 commit 0db718e
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "winreg"
version = "0.10.0"
version = "0.10.1"
authors = ["Igor Shaula <gentoo90@gmail.com>"]
license = "MIT"
description = "Rust bindings to MS Windows Registry API"
Expand All @@ -11,7 +11,7 @@ keywords = ["Windows", "WinSDK", "Registry"]
categories = ["api-bindings", "os::windows-apis"]

[dependencies]
winapi = { version = "0.3.7", features = ["impl-default", "impl-debug", "minwindef", "minwinbase", "timezoneapi", "winerror", "winnt", "winreg", "handleapi"] }
winapi = { version = "0.3.9", features = ["impl-default", "impl-debug", "minwindef", "minwinbase", "timezoneapi", "winerror", "winnt", "winreg", "handleapi"] }
chrono = { version = "0.4.6", optional = true }
serde = { version = "1", optional = true }

Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,11 @@ fn main() -> Result<(), Box<dyn Error>> {

## Changelog

### 0.10.1

* Bump minimal required version of `winapi` to `0.3.9` (required for `load_app_key`)
* Reexport `REG_PROCESS_APPKEY` and use it in the `load_app_key` example

### 0.10.0

* Add `RegKey::load_app_key()` and `RegKey::load_app_key_with_flags()` ([#30](https://github.com/gentoo90/winreg-rs/issues/30))
Expand Down
4 changes: 3 additions & 1 deletion examples/load_app_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
// except according to those terms.
extern crate winreg;
use std::io;
use winreg::enums::*;
use winreg::RegKey;

fn main() -> io::Result<()> {
Expand All @@ -16,7 +17,8 @@ fn main() -> io::Result<()> {
}
let answer: u32 = {
// NOTE: on Windows 7 this fails with ERROR_ALREADY_EXISTS
let app_key_2 = RegKey::load_app_key("myhive.dat", true)?;
let app_key_2 =
RegKey::load_app_key_with_flags("myhive.dat", KEY_READ, REG_PROCESS_APPKEY)?;
app_key_2.get_value("answer")?
};
println!("The Answer is {}", answer);
Expand Down
2 changes: 1 addition & 1 deletion src/enums.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pub use winapi::um::winnt::{
pub use winapi::um::winreg::{
HKEY_CLASSES_ROOT, HKEY_CURRENT_CONFIG, HKEY_CURRENT_USER, HKEY_CURRENT_USER_LOCAL_SETTINGS,
HKEY_DYN_DATA, HKEY_LOCAL_MACHINE, HKEY_PERFORMANCE_DATA, HKEY_PERFORMANCE_NLSTEXT,
HKEY_PERFORMANCE_TEXT, HKEY_USERS,
HKEY_PERFORMANCE_TEXT, HKEY_USERS, REG_PROCESS_APPKEY,
};

macro_rules! winapi_enum{
Expand Down

0 comments on commit 0db718e

Please sign in to comment.