Skip to content
Merged
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
40 changes: 40 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Rust

on:
push:
branches: [ "main" ]
paths:
- "etw/rust/**"
pull_request:
branches: [ "main" ]
paths:
- "etw/rust/**"

env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
RUST_BACKTRACE: short

defaults:
run:
working-directory: ./etw/rust

jobs:
windows-buildtest:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Setup Cache
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
2 changes: 2 additions & 0 deletions etw/rust/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
[workspace]
resolver = "2"

members = [
"tracelogging",
"tracelogging_dynamic",
Expand Down
4 changes: 2 additions & 2 deletions etw/rust/tracelogging/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "tracelogging"
version = "1.2.2"
version = "1.2.3"
edition = "2021"
authors = ["Microsoft"]
license = "MIT"
Expand Down Expand Up @@ -30,7 +30,7 @@ kernel_mode = []
macros = ["dep:tracelogging_macros"]

[dependencies]
tracelogging_macros = { optional = true, version = "= 1.2.0", path = "../tracelogging_macros" }
tracelogging_macros = { optional = true, version = "= 1.2.3", path = "../tracelogging_macros" }

[dev-dependencies]
windows = ">= 0.39"
Expand Down
5 changes: 5 additions & 0 deletions etw/rust/tracelogging/src/changelog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
#[allow(unused_imports)]
use crate::*; // For docs

/// # v1.2.3 (2025-03-02)
/// - Fix newer warnings about unsafe code
/// - Update `tracelongging-macros` dependency to 1.2.1
pub mod v1_2_3 {}

/// # v1.2.2 (2024-05-20)
/// - tracelogging crate supports use in kernel mode via feature
/// `kernel_mode`.
Expand Down
20 changes: 11 additions & 9 deletions etw/rust/tracelogging/src/native.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ impl ProviderContext {
}
#[cfg(all(windows, feature = "etw"))]
{
result = /* unsafe */ { &mut *self.cell.get() }.register(
result = unsafe { &mut *self.cell.get() }.register(
_provider_id,
_callback_fn,
_callback_context);
Expand Down Expand Up @@ -422,14 +422,16 @@ impl ProviderContextInner {
filter_data: usize,
outer_context: usize,
) {
(*(outer_context as *mut Self)).outer_callback_impl(
source_id,
event_control_code,
level,
match_any_keyword,
match_all_keyword,
filter_data,
);
unsafe {
(*(outer_context as *mut Self)).outer_callback_impl(
source_id,
event_control_code,
level,
match_any_keyword,
match_all_keyword,
filter_data,
);
}
}
}

Expand Down
4 changes: 2 additions & 2 deletions etw/rust/tracelogging_dynamic/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "tracelogging_dynamic"
version = "1.2.2"
version = "1.2.3"
edition = "2021"
authors = ["Microsoft"]
license = "MIT"
Expand Down Expand Up @@ -28,4 +28,4 @@ default = ["etw"]
etw = ["tracelogging/etw"] # Logging is enabled if windows && etw.

[dependencies]
tracelogging = { default-features = false, version = "= 1.2.2", path = "../tracelogging" }
tracelogging = { default-features = false, version = "= 1.2.3", path = "../tracelogging" }
5 changes: 5 additions & 0 deletions etw/rust/tracelogging_dynamic/src/changelog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
#[allow(unused_imports)]
use crate::*; // For docs

/// # v1.2.3 (2025-03-02)
/// - Fix newer warnings about unsafe code
/// - Update `tracelongging` dependency to 1.2.3
pub mod v1_2_3 {}

/// # v1.2.2 (2024-05-20)
/// - tracelogging crate supports use in kernel mode via feature
/// `kernel_mode`.
Expand Down
4 changes: 2 additions & 2 deletions etw/rust/tracelogging_dynamic/src/provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -329,9 +329,9 @@ impl Provider {
/// provider is dropped. (This is implied by the rules for `Pin` but repeated here
/// for clarity.)
pub unsafe fn register(self: Pin<&Self>) -> u32 {
let result = self
let result = unsafe { self
.context
.register(&self.id, self.callback_fn, self.callback_context);
.register(&self.id, self.callback_fn, self.callback_context) };
if result == 0 {
self.context.set_information(
2, // EventProviderSetTraits
Expand Down
2 changes: 1 addition & 1 deletion etw/rust/tracelogging_macros/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "tracelogging_macros"
version = "1.2.0"
version = "1.2.3"
edition = "2021"
authors = ["Microsoft"]
license = "MIT"
Expand Down
7 changes: 7 additions & 0 deletions etw/rust/tracelogging_macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@
#![allow(clippy::needless_return)]

//! Implements the macros that are exported by the tracelogging crate.
//!
//! # Changelog
//!
//! ## v1.2.3 (2025-03-02)
//! - Fix `repr_packed_without_abi` warning.
//!
//! ## v1.2.0 (2023-05-23)

extern crate proc_macro;
use proc_macro::{Span, TokenStream};
Expand Down