Files
tubestation/third_party/rust/winreg/examples/enum.rs
Ray Kraesig db3d84fbf0 Bug 1807981 - Audit winreg 0.10.1 as safe-to-run, and upgrade to it r=supply-chain-reviewers,webdriver-reviewers,whimboo
Upgrade winreg (currently used only by mozrunner) to 0.10.1.

As winreg 0.5.1 is currently listed as an exemption in `supply-chain`,
audit the new version as a blank slate, rather than performing an audit
of the diffs; this is both simpler and allows removing the exemption.

(There are some uses of `unsafe` that would be concerning in deployment
(more for reasons of stability than security), but the crate does
qualify as `safe-to-run`.)

winreg 0.5.1 is currently only used by mozrunner, which requires no
source changes for this upgrade.

Differential Revision: https://phabricator.services.mozilla.com/D165723
2023-01-03 06:25:38 +00:00

28 lines
781 B
Rust

// Copyright 2015, Igor Shaula
// Licensed under the MIT License <LICENSE or
// http://opensource.org/licenses/MIT>. This file
// may not be copied, modified, or distributed
// except according to those terms.
extern crate winreg;
use std::io;
use winreg::enums::*;
use winreg::RegKey;
fn main() -> io::Result<()> {
println!("File extensions, registered in system:");
for i in RegKey::predef(HKEY_CLASSES_ROOT)
.enum_keys()
.map(|x| x.unwrap())
.filter(|x| x.starts_with('.'))
{
println!("{}", i);
}
let system = RegKey::predef(HKEY_LOCAL_MACHINE).open_subkey("HARDWARE\\DESCRIPTION\\System")?;
for (name, value) in system.enum_values().map(|x| x.unwrap()) {
println!("{} = {:?}", name, value);
}
Ok(())
}