Skip to content

Commit

Permalink
Update windows dependency.
Browse files Browse the repository at this point in the history
  • Loading branch information
mstange committed May 4, 2024
1 parent 90e32cc commit a54ef19
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 27 deletions.
25 changes: 3 additions & 22 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion etw-reader/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ fxhash = "0.2.1"
memoffset = "0.9"

[dependencies.windows]
version = "0.51"
version = "0.56"
features = ["Win32_System_Diagnostics_Etw",
"Win32_System_Diagnostics_Debug",
"Win32_System_SystemInformation",
Expand Down
10 changes: 6 additions & 4 deletions etw-reader/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,9 @@ pub fn open_trace<F: FnMut(&EventRecord)>(

let session_handle = unsafe { Etw::OpenTraceW(&mut *log_file) };
let result = unsafe { Etw::ProcessTrace(&[session_handle], None, None) };
result.map_err(|e| std::io::Error::from_raw_os_error(e.code().0))
result
.ok()
.map_err(|e| std::io::Error::from_raw_os_error(e.code().0))
}

/// Complete Trace Properties struct
Expand Down Expand Up @@ -516,7 +518,7 @@ pub fn enumerate_trace_guids() {
}

let result = unsafe { EnumerateTraceGuids(ptrs.as_mut_slice(), &mut count) };
match result {
match result.ok() {
Ok(()) => {
for guid in guids[..count as usize].iter() {
println!("{:?}", guid.Guid);
Expand Down Expand Up @@ -552,7 +554,7 @@ pub fn enumerate_trace_guids_ex(print_instances: bool) {
&mut required_size as *mut _,
)
};
match result {
match result.ok() {
Ok(()) => {
for guid in guids.iter() {
println!("{:?}", guid);
Expand Down Expand Up @@ -608,7 +610,7 @@ pub fn get_provider_info(guid: &GUID) -> Vec<u8> {
&mut required_size as *mut _,
)
};
match result {
match result.ok() {
Ok(()) => {
return info;
}
Expand Down

0 comments on commit a54ef19

Please sign in to comment.