Skip to content

Commit

Permalink
Implement RegKeyMetadata::last_write_time for RegKey::query_info
Browse files Browse the repository at this point in the history
This enables the Debug and Default traits for the winapi crate because
they are needed to use `FILETIME`.
  • Loading branch information
poiru committed Jul 14, 2019
1 parent f148572 commit c63318b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ keywords = ["Windows", "WinSDK", "Registry"]
categories = ["api-bindings", "os::windows-apis"]

[dependencies]
winapi = { version = "0.3", features = ["minwindef", "winerror", "winnt", "winreg", "handleapi"] }
winapi = { version = "0.3", features = ["impl-default", "impl-debug", "minwindef", "winerror", "winnt", "winreg", "handleapi"] }
serde = { version = "1", optional = true }
clippy = { version = "^0", optional = true }

Expand Down
6 changes: 3 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ use std::slice;
use transaction::Transaction;
use types::{FromRegValue, ToRegValue};
pub use winapi::shared::minwindef::HKEY;
use winapi::shared::minwindef::{BYTE, DWORD, LPBYTE};
use winapi::shared::minwindef::{BYTE, DWORD, FILETIME, LPBYTE};
use winapi::shared::winerror;
use winapi::um::winnt::{self, WCHAR};
use winapi::um::winreg as winapi_reg;
Expand Down Expand Up @@ -149,7 +149,7 @@ pub struct RegKeyMetadata {
pub max_value_name_len: DWORD,
pub max_value_len: DWORD,
// pub SecurityDescriptor: DWORD,
// pub LastWriteTime: winapi::PFILETIME,
pub last_write_time: FILETIME,
}

/// Raw registry value
Expand Down Expand Up @@ -461,7 +461,7 @@ impl RegKey {
&mut info.max_value_name_len,
&mut info.max_value_len,
ptr::null_mut(), // lpcbSecurityDescriptor: winapi::LPDWORD,
ptr::null_mut(), // lpftLastWriteTime: winapi::PFILETIME,
&mut info.last_write_time,
) as DWORD
} {
0 => Ok(info),
Expand Down

0 comments on commit c63318b

Please sign in to comment.