-
Notifications
You must be signed in to change notification settings - Fork 1.7k
PackageFamilyName is not None even if it should be None #40096
Copy link
Copy link
Open
Description
Windows Version
Microsoft Windows [version 10.0.26200.8117]
WSL Version
2.6.2.0
Are you using WSL 1 or WSL 2?
- WSL 2
- WSL 1
Kernel Version
6.6.87.2
Distro Version
No response
Other Software
Rust 1.94.1
wslplugins-rs 0.1.0-beta.2
Repro Steps
I am the developer of wslplugins-rs a framework to easely develop WSL plugins in rust and I facing an issue when I try to debug an example I just developped.
1 clone the repo
git clone https://github.com/mveril/wslplugins-rs- Go to branch unpackaged-distro-blacklist-policy
- sign the plugin and register it as you
cargo build --release -p unpackaged-distro-blacklist-policy
- found the dll in the target folder of the project sign it and register it as described in the readme of my project or in the Microsoft WSLPlugin sample
- Run WSL and check the logfile
C:\\wsl-unpackaged-distro-blacklist.logand you can see something like
2026-04-03T17:25:06.790520Z INFO unpackaged_distro_blacklist_policy: Distribution FedoraLinux-42 started with package family name Some("")
So the package family name is an empty string even if it should be None
This information is obtainied using this specific code
#[inline]
fn package_family_name(&self) -> Option<OsString> {
// SAFETY: check already inside
unsafe {
let ptr = self.0.PackageFamilyName;
if ptr.is_null() {
None
} else {
Some(OsString::from_wide(PCWSTR::from_raw(ptr).as_wide()))
}
}
}Expected Behavior
Package family name should be a null pointer when it's an unpackaged distro but it's an pointer to an empty string
Actual Behavior
Package family name should be a null pointer when it's an unpackaged distro but it's an pointer to an empty string
Diagnostic Logs
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels