Skip to content

Commit

Permalink
Update samples
Browse files Browse the repository at this point in the history
  • Loading branch information
riverar committed Nov 14, 2024
1 parent 6b36a18 commit 11c10b1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions crates/samples/windows-sys/counter/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ use windows_sys::{core::*, Win32::System::Performance::*};

fn main() {
unsafe {
let mut query = 0;
let mut query = std::ptr::null_mut();
PdhOpenQueryW(std::ptr::null(), 0, &mut query);

let mut counter = 0;
let mut counter = std::ptr::null_mut();
PdhAddCounterW(
query,
w!("\\Processor(0)\\% Processor Time"),
Expand Down
4 changes: 2 additions & 2 deletions crates/samples/windows/counter/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ use windows::{core::*, Win32::System::Performance::*};

fn main() {
unsafe {
let mut query = 0;
let mut query = PDH_HQUERY::default();
PdhOpenQueryW(None, 0, &mut query);

let mut counter = 0;
let mut counter = PDH_HCOUNTER::default();
PdhAddCounterW(
query,
w!("\\Processor(0)\\% Processor Time"),
Expand Down
3 changes: 1 addition & 2 deletions crates/samples/windows/dcomp/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,7 @@ impl Window {
}

let desktop = self.desktop.as_ref().expect("IDCompositionDesktopDevice");
let mut stats = Default::default();
desktop.GetFrameStatistics(&mut stats)?;
let stats = desktop.GetFrameStatistics()?;

let next_frame: f64 =
stats.nextEstimatedFrameTime as f64 / stats.timeFrequency as f64;
Expand Down

0 comments on commit 11c10b1

Please sign in to comment.