diff --git a/.gitignore b/.gitignore index 04af890f55..be7c0e6cfa 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ -.vscode -.vs -target -temp +/.vscode +/.vs +/target +/temp *.lock *.winmd diff --git a/crates/libs/metadata/src/attributes.rs b/crates/libs/metadata/src/attributes.rs index 2bfaa67446..af33397bd0 100644 --- a/crates/libs/metadata/src/attributes.rs +++ b/crates/libs/metadata/src/attributes.rs @@ -1,3 +1,5 @@ +#![allow(non_upper_case_globals)] + macro_rules! flags { ($name:ident, $size:ty) => { #[derive(Default, Copy, Clone, PartialEq, Eq, Debug)] diff --git a/crates/libs/metadata/src/codes.rs b/crates/libs/metadata/src/codes.rs index da1b65526b..5eca29fd2f 100644 --- a/crates/libs/metadata/src/codes.rs +++ b/crates/libs/metadata/src/codes.rs @@ -1,6 +1,6 @@ use super::*; -pub trait Decode { +pub(crate) trait Decode { fn decode(file: usize, code: usize) -> Self; } diff --git a/crates/libs/metadata/src/file.rs b/crates/libs/metadata/src/file.rs index e6614b21ad..368c6ff991 100644 --- a/crates/libs/metadata/src/file.rs +++ b/crates/libs/metadata/src/file.rs @@ -10,37 +10,37 @@ pub struct File { } #[derive(Default)] -pub struct Table { - pub offset: usize, +pub(crate) struct Table { + offset: usize, pub len: usize, - pub width: usize, - pub columns: [Column; 6], + width: usize, + columns: [Column; 6], } #[derive(Default)] -pub struct Column { +struct Column { pub offset: usize, pub width: usize, } -pub const TABLE_CONSTANT: usize = 0; -pub const TABLE_CUSTOMATTRIBUTE: usize = 1; -pub const TABLE_FIELD: usize = 2; -pub const TABLE_GENERICPARAM: usize = 3; -pub const TABLE_INTERFACEIMPL: usize = 4; -pub const TABLE_MEMBERREF: usize = 5; -pub const TABLE_METHODDEF: usize = 6; -pub const TABLE_PARAM: usize = 7; -pub const TABLE_TYPEDEF: usize = 8; -pub const TABLE_TYPEREF: usize = 9; -pub const TABLE_TYPESPEC: usize = 10; -pub const TABLE_IMPLMAP: usize = 11; -pub const TABLE_MODULEREF: usize = 12; -pub const TABLE_NESTEDCLASS: usize = 13; -pub const TABLE_MODULE: usize = 14; -pub const TABLE_ASSEMBLYREF: usize = 15; -pub const TABLE_CLASSLAYOUT: usize = 16; -pub const TABLE_LEN: usize = 17; +pub(crate) const TABLE_CONSTANT: usize = 0; +pub(crate) const TABLE_CUSTOMATTRIBUTE: usize = 1; +pub(crate) const TABLE_FIELD: usize = 2; +pub(crate) const TABLE_GENERICPARAM: usize = 3; +pub(crate) const TABLE_INTERFACEIMPL: usize = 4; +pub(crate) const TABLE_MEMBERREF: usize = 5; +pub(crate) const TABLE_METHODDEF: usize = 6; +pub(crate) const TABLE_PARAM: usize = 7; +pub(crate) const TABLE_TYPEDEF: usize = 8; +pub(crate) const TABLE_TYPEREF: usize = 9; +pub(crate) const TABLE_TYPESPEC: usize = 10; +pub(crate) const TABLE_IMPLMAP: usize = 11; +pub(crate) const TABLE_MODULEREF: usize = 12; +pub(crate) const TABLE_NESTEDCLASS: usize = 13; +pub(crate) const TABLE_MODULE: usize = 14; +pub(crate) const TABLE_ASSEMBLYREF: usize = 15; +pub(crate) const TABLE_CLASSLAYOUT: usize = 16; +pub(crate) const TABLE_LEN: usize = 17; type Result = std::result::Result; @@ -310,7 +310,7 @@ impl File { Ok(result) } - pub fn usize(&self, row: usize, table: usize, column: usize) -> usize { + pub(crate) fn usize(&self, row: usize, table: usize, column: usize) -> usize { let table = &self.tables[table]; let column = &table.columns[column]; let offset = table.offset + row * table.width + column.offset; @@ -331,7 +331,7 @@ impl File { /// * When the offset in the string table is out of bounds. /// * When no null terminator can be found in the string table. /// * When the null-terminated string is not valid utf-8. - pub fn str(&self, row: usize, table: usize, column: usize) -> &str { + pub(crate) fn str(&self, row: usize, table: usize, column: usize) -> &str { let offset = self.strings + self.usize(row, table, column); let bytes = &self.bytes[offset..]; @@ -339,7 +339,7 @@ impl File { std::str::from_utf8(&bytes[..nul_pos]).expect("expected valid utf-8 C-string") } - pub fn blob(&self, row: usize, table: usize, column: usize) -> &[u8] { + pub(crate) fn blob(&self, row: usize, table: usize, column: usize) -> &[u8] { let offset = self.blobs + self.usize(row, table, column); let initial_byte = self.bytes[offset]; let (blob_size, blob_size_bytes) = match initial_byte >> 5 { @@ -356,7 +356,7 @@ impl File { &self.bytes[offset..offset + blob_size] } - pub fn equal_range(&self, table: usize, column: usize, value: usize) -> (usize, usize) { + pub(crate) fn equal_range(&self, table: usize, column: usize, value: usize) -> (usize, usize) { let mut first = 0; let mut last = self.tables[table].len; let mut count = last; @@ -401,7 +401,7 @@ impl File { first } - pub fn upper_bound_of(&self, table: usize, mut first: usize, last: usize, column: usize, value: usize) -> usize { + fn upper_bound_of(&self, table: usize, mut first: usize, last: usize, column: usize, value: usize) -> usize { let mut count = last - first; while count > 0 { let count2 = count / 2; diff --git a/crates/libs/metadata/src/lib.rs b/crates/libs/metadata/src/lib.rs index 81eccc02db..20c13d131f 100644 --- a/crates/libs/metadata/src/lib.rs +++ b/crates/libs/metadata/src/lib.rs @@ -1,5 +1,3 @@ -#![allow(non_upper_case_globals)] - #[doc(hidden)] pub mod imp; @@ -14,22 +12,21 @@ mod r#type; mod type_name; pub use attributes::*; -pub use blob::*; +pub use blob::Blob; pub use codes::*; pub use file::*; -pub use filter::*; -pub use guid::*; -pub use r#type::*; -pub use row::*; -pub use type_name::*; - +pub use filter::Filter; +pub use guid::GUID; use imp::*; +pub use r#type::Type; +use row::Row; use std::collections::*; +pub use type_name::TypeName; macro_rules! tables { ($($name:ident,)*) => ($( #[derive(Copy, Clone, PartialEq, PartialOrd, Eq, Ord, Hash, Debug)] - pub struct $name(pub Row); + pub struct $name(Row); )*) } @@ -1906,6 +1903,14 @@ impl<'a> Reader<'a> { } } +fn trim_tick(name: &str) -> &str { + if name.as_bytes().iter().rev().nth(1) == Some(&b'`') { + &name[..name.len() - 2] + } else { + name + } +} + pub const REMAP_TYPES: [(TypeName, TypeName); 2] = [(TypeName::D2D_MATRIX_3X2_F, TypeName::Matrix3x2), (TypeName::D3DMATRIX, TypeName::Matrix4x4)]; pub const CORE_TYPES: [(TypeName, Type); 11] = [(TypeName::GUID, Type::GUID), (TypeName::IUnknown, Type::IUnknown), (TypeName::HResult, Type::HRESULT), (TypeName::HRESULT, Type::HRESULT), (TypeName::HSTRING, Type::String), (TypeName::BSTR, Type::BSTR), (TypeName::IInspectable, Type::IInspectable), (TypeName::PSTR, Type::PSTR), (TypeName::PWSTR, Type::PWSTR), (TypeName::Type, Type::TypeName), (TypeName::CHAR, Type::U8)]; diff --git a/crates/libs/metadata/src/type_name.rs b/crates/libs/metadata/src/type_name.rs index 9bc4b46245..750d58c3ec 100644 --- a/crates/libs/metadata/src/type_name.rs +++ b/crates/libs/metadata/src/type_name.rs @@ -1,3 +1,5 @@ +#![allow(non_upper_case_globals)] + #[derive(Copy, Clone, PartialEq, PartialOrd, Eq, Ord)] pub struct TypeName<'a> { pub namespace: &'a str, @@ -51,7 +53,7 @@ impl<'a> TypeName<'a> { } pub fn new(namespace: &'a str, name: &'a str) -> Self { - Self { namespace, name: trim_tick(name) } + Self { namespace, name: crate::trim_tick(name) } } pub fn parse(full_name: &'a str) -> Self { @@ -65,11 +67,3 @@ impl<'a> std::fmt::Display for TypeName<'a> { write!(fmt, "{}.{}", self.namespace, self.name) } } - -pub fn trim_tick(name: &str) -> &str { - if name.as_bytes().iter().rev().nth(1) == Some(&b'`') { - &name[..name.len() - 2] - } else { - name - } -} diff --git a/crates/samples/windows-sys/counter/Cargo.toml b/crates/samples/windows-sys/counter/Cargo.toml index 5bd192ea3b..b23cc7648b 100644 --- a/crates/samples/windows-sys/counter/Cargo.toml +++ b/crates/samples/windows-sys/counter/Cargo.toml @@ -2,6 +2,7 @@ name = "sample_counter_sys" version = "0.0.0" edition = "2018" +publish = false [dependencies.windows-sys] path = "../../../libs/sys" diff --git a/crates/samples/windows-sys/create_window/Cargo.toml b/crates/samples/windows-sys/create_window/Cargo.toml index 50cd5a6d3e..f83937c044 100644 --- a/crates/samples/windows-sys/create_window/Cargo.toml +++ b/crates/samples/windows-sys/create_window/Cargo.toml @@ -2,6 +2,7 @@ name = "sample_create_window_sys" version = "0.0.0" edition = "2018" +publish = false [dependencies.windows-sys] path = "../../../libs/sys" diff --git a/crates/samples/windows-sys/enum_windows/Cargo.toml b/crates/samples/windows-sys/enum_windows/Cargo.toml index 7252bcd862..90f735a1bb 100644 --- a/crates/samples/windows-sys/enum_windows/Cargo.toml +++ b/crates/samples/windows-sys/enum_windows/Cargo.toml @@ -2,6 +2,7 @@ name = "sample_enum_windows_sys" version = "0.0.0" edition = "2018" +publish = false [dependencies.windows-sys] path = "../../../libs/sys" diff --git a/crates/samples/windows-sys/message_box/Cargo.toml b/crates/samples/windows-sys/message_box/Cargo.toml index 9d8ff8937d..153a738bac 100644 --- a/crates/samples/windows-sys/message_box/Cargo.toml +++ b/crates/samples/windows-sys/message_box/Cargo.toml @@ -2,6 +2,7 @@ name = "sample_message_box_sys" version = "0.0.0" edition = "2018" +publish = false [dependencies.windows-sys] path = "../../../libs/sys" diff --git a/crates/samples/windows-sys/privileges/Cargo.toml b/crates/samples/windows-sys/privileges/Cargo.toml index a561258695..83b98d9794 100644 --- a/crates/samples/windows-sys/privileges/Cargo.toml +++ b/crates/samples/windows-sys/privileges/Cargo.toml @@ -2,6 +2,7 @@ name = "sample_privileges_sys" version = "0.0.0" edition = "2018" +publish = false [dependencies.windows-sys] path = "../../../libs/sys" diff --git a/crates/samples/windows-sys/thread_pool_work/Cargo.toml b/crates/samples/windows-sys/thread_pool_work/Cargo.toml index 049396b1dc..993daf8481 100644 --- a/crates/samples/windows-sys/thread_pool_work/Cargo.toml +++ b/crates/samples/windows-sys/thread_pool_work/Cargo.toml @@ -2,6 +2,7 @@ name = "sample_thread_pool_work_sys" version = "0.0.0" edition = "2018" +publish = false [dependencies.windows-sys] path = "../../../libs/sys" diff --git a/crates/samples/windows/bits/Cargo.toml b/crates/samples/windows/bits/Cargo.toml index 00089b4476..51e4e5a46d 100644 --- a/crates/samples/windows/bits/Cargo.toml +++ b/crates/samples/windows/bits/Cargo.toml @@ -2,6 +2,7 @@ name = "sample_bits" version = "0.0.0" edition = "2018" +publish = false [dependencies.windows] path = "../../../libs/windows" diff --git a/crates/samples/windows/com_uri/Cargo.toml b/crates/samples/windows/com_uri/Cargo.toml index 1599ee4a6d..241194d943 100644 --- a/crates/samples/windows/com_uri/Cargo.toml +++ b/crates/samples/windows/com_uri/Cargo.toml @@ -2,6 +2,7 @@ name = "sample_com_uri" version = "0.0.0" edition = "2018" +publish = false [dependencies.windows] path = "../../../libs/windows" diff --git a/crates/samples/windows/consent/Cargo.toml b/crates/samples/windows/consent/Cargo.toml index a5dacef8b9..5816fe987a 100644 --- a/crates/samples/windows/consent/Cargo.toml +++ b/crates/samples/windows/consent/Cargo.toml @@ -2,6 +2,7 @@ name = "sample_consent" version = "0.0.0" edition = "2018" +publish = false [dependencies.windows] path = "../../../libs/windows" diff --git a/crates/samples/windows/core_app/Cargo.toml b/crates/samples/windows/core_app/Cargo.toml index ef644189f4..b4849b2b52 100644 --- a/crates/samples/windows/core_app/Cargo.toml +++ b/crates/samples/windows/core_app/Cargo.toml @@ -2,6 +2,7 @@ name = "sample_core_app" version = "0.0.0" edition = "2018" +publish = false [dependencies.windows] path = "../../../libs/windows" diff --git a/crates/samples/windows/counter/Cargo.toml b/crates/samples/windows/counter/Cargo.toml index f594e98570..b85aeb27aa 100644 --- a/crates/samples/windows/counter/Cargo.toml +++ b/crates/samples/windows/counter/Cargo.toml @@ -2,6 +2,7 @@ name = "sample_counter" version = "0.0.0" edition = "2018" +publish = false [dependencies.windows] path = "../../../libs/windows" diff --git a/crates/samples/windows/create_window/Cargo.toml b/crates/samples/windows/create_window/Cargo.toml index fc2f88638a..3340af5392 100644 --- a/crates/samples/windows/create_window/Cargo.toml +++ b/crates/samples/windows/create_window/Cargo.toml @@ -2,6 +2,7 @@ name = "sample_create_window" version = "0.0.0" edition = "2018" +publish = false [dependencies.windows] path = "../../../libs/windows" diff --git a/crates/samples/windows/data_protection/Cargo.toml b/crates/samples/windows/data_protection/Cargo.toml index f41cfa88d8..a42d804dd2 100644 --- a/crates/samples/windows/data_protection/Cargo.toml +++ b/crates/samples/windows/data_protection/Cargo.toml @@ -2,6 +2,7 @@ name = "sample_data_protection" version = "0.0.0" edition = "2018" +publish = false [dependencies.windows] path = "../../../libs/windows" diff --git a/crates/samples/windows/dcomp/Cargo.toml b/crates/samples/windows/dcomp/Cargo.toml index d05a985d1a..9d473eba16 100644 --- a/crates/samples/windows/dcomp/Cargo.toml +++ b/crates/samples/windows/dcomp/Cargo.toml @@ -2,6 +2,7 @@ name = "sample_dcomp" version = "0.0.0" edition = "2018" +publish = false [dependencies] rand = "0.8.5" diff --git a/crates/samples/windows/device_watcher/Cargo.toml b/crates/samples/windows/device_watcher/Cargo.toml index f4b47aa75b..038c94d4e5 100644 --- a/crates/samples/windows/device_watcher/Cargo.toml +++ b/crates/samples/windows/device_watcher/Cargo.toml @@ -2,6 +2,7 @@ name = "sample_device_watcher" version = "0.0.0" edition = "2018" +publish = false [dependencies.windows] path = "../../../libs/windows" diff --git a/crates/samples/windows/direct2d/Cargo.toml b/crates/samples/windows/direct2d/Cargo.toml index 5876534528..49fc48f8bb 100644 --- a/crates/samples/windows/direct2d/Cargo.toml +++ b/crates/samples/windows/direct2d/Cargo.toml @@ -2,6 +2,7 @@ name = "sample_direct2d" version = "0.0.0" edition = "2018" +publish = false [dependencies.windows] path = "../../../libs/windows" diff --git a/crates/samples/windows/direct3d12/Cargo.toml b/crates/samples/windows/direct3d12/Cargo.toml index e14f988270..c3d97ee20b 100644 --- a/crates/samples/windows/direct3d12/Cargo.toml +++ b/crates/samples/windows/direct3d12/Cargo.toml @@ -2,6 +2,7 @@ name = "sample_direct3d12" version = "0.0.0" edition = "2018" +publish = false [dependencies] array-init = "2.0.0" diff --git a/crates/samples/windows/enum_windows/Cargo.toml b/crates/samples/windows/enum_windows/Cargo.toml index 21823e8781..a7d525d1f4 100644 --- a/crates/samples/windows/enum_windows/Cargo.toml +++ b/crates/samples/windows/enum_windows/Cargo.toml @@ -2,6 +2,7 @@ name = "sample_enum_windows" version = "0.0.0" edition = "2018" +publish = false [dependencies.windows] path = "../../../libs/windows" diff --git a/crates/samples/windows/kernel_event/Cargo.toml b/crates/samples/windows/kernel_event/Cargo.toml index 201517afe7..439adf1cc3 100644 --- a/crates/samples/windows/kernel_event/Cargo.toml +++ b/crates/samples/windows/kernel_event/Cargo.toml @@ -2,6 +2,7 @@ name = "sample_kernel_event" version = "0.0.0" edition = "2018" +publish = false [dependencies.windows] path = "../../../libs/windows" diff --git a/crates/samples/windows/memory_buffer/Cargo.toml b/crates/samples/windows/memory_buffer/Cargo.toml index 3d05195d23..3eb8ed777f 100644 --- a/crates/samples/windows/memory_buffer/Cargo.toml +++ b/crates/samples/windows/memory_buffer/Cargo.toml @@ -2,6 +2,7 @@ name = "sample_memory_buffer" version = "0.0.0" edition = "2018" +publish = false [dependencies.windows] path = "../../../libs/windows" diff --git a/crates/samples/windows/message_box/Cargo.toml b/crates/samples/windows/message_box/Cargo.toml index 90491900c2..4a3d2e23eb 100644 --- a/crates/samples/windows/message_box/Cargo.toml +++ b/crates/samples/windows/message_box/Cargo.toml @@ -2,6 +2,7 @@ name = "sample_message_box" version = "0.0.0" edition = "2018" +publish = false [dependencies.windows] path = "../../../libs/windows" diff --git a/crates/samples/windows/ocr/Cargo.toml b/crates/samples/windows/ocr/Cargo.toml index bbe330d593..1f238559ac 100644 --- a/crates/samples/windows/ocr/Cargo.toml +++ b/crates/samples/windows/ocr/Cargo.toml @@ -2,6 +2,7 @@ name = "sample_ocr" version = "0.0.0" edition = "2018" +publish = false [dependencies] futures = "0.3.5" diff --git a/crates/samples/windows/overlapped/Cargo.toml b/crates/samples/windows/overlapped/Cargo.toml index 25178c8ed6..723bc175b9 100644 --- a/crates/samples/windows/overlapped/Cargo.toml +++ b/crates/samples/windows/overlapped/Cargo.toml @@ -2,6 +2,7 @@ name = "sample_overlapped" version = "0.0.0" edition = "2018" +publish = false [dependencies.windows] path = "../../../libs/windows" diff --git a/crates/samples/windows/privileges/Cargo.toml b/crates/samples/windows/privileges/Cargo.toml index 369ead2b69..534999cf30 100644 --- a/crates/samples/windows/privileges/Cargo.toml +++ b/crates/samples/windows/privileges/Cargo.toml @@ -2,6 +2,7 @@ name = "sample_privileges" version = "0.0.0" edition = "2018" +publish = false [dependencies.windows] path = "../../../libs/windows" diff --git a/crates/samples/windows/rss/Cargo.toml b/crates/samples/windows/rss/Cargo.toml index 44b5b81d35..155633f813 100644 --- a/crates/samples/windows/rss/Cargo.toml +++ b/crates/samples/windows/rss/Cargo.toml @@ -2,6 +2,7 @@ name = "sample_rss" version = "0.0.0" edition = "2018" +publish = false [dependencies.windows] path = "../../../libs/windows" diff --git a/crates/samples/windows/simple/Cargo.toml b/crates/samples/windows/simple/Cargo.toml index 88de2ee724..34bfd501c9 100644 --- a/crates/samples/windows/simple/Cargo.toml +++ b/crates/samples/windows/simple/Cargo.toml @@ -2,6 +2,7 @@ name = "sample_simple" version = "0.0.0" edition = "2018" +publish = false [dependencies.windows] path = "../../../libs/windows" diff --git a/crates/samples/windows/spellchecker/Cargo.toml b/crates/samples/windows/spellchecker/Cargo.toml index 0953bd935f..f9d51188e0 100644 --- a/crates/samples/windows/spellchecker/Cargo.toml +++ b/crates/samples/windows/spellchecker/Cargo.toml @@ -2,6 +2,7 @@ name = "sample_spellchecker" version = "0.0.0" edition = "2018" +publish = false [dependencies.windows] path = "../../../libs/windows" diff --git a/crates/samples/windows/thread_pool_work/Cargo.toml b/crates/samples/windows/thread_pool_work/Cargo.toml index b586cbee8e..d5124173da 100644 --- a/crates/samples/windows/thread_pool_work/Cargo.toml +++ b/crates/samples/windows/thread_pool_work/Cargo.toml @@ -2,6 +2,7 @@ name = "sample_thread_pool_work" version = "0.0.0" edition = "2018" +publish = false [dependencies.windows] path = "../../../libs/windows" diff --git a/crates/samples/windows/uiautomation/Cargo.toml b/crates/samples/windows/uiautomation/Cargo.toml index 070d1ca49e..69849b1df2 100644 --- a/crates/samples/windows/uiautomation/Cargo.toml +++ b/crates/samples/windows/uiautomation/Cargo.toml @@ -2,6 +2,7 @@ name = "sample_uiautomation" version = "0.0.0" edition = "2018" +publish = false [dependencies.windows] path = "../../../libs/windows" diff --git a/crates/samples/windows/wmi/Cargo.toml b/crates/samples/windows/wmi/Cargo.toml index 3775a8c884..bbbe5c8ab7 100644 --- a/crates/samples/windows/wmi/Cargo.toml +++ b/crates/samples/windows/wmi/Cargo.toml @@ -2,6 +2,7 @@ name = "sample_wmi" version = "0.0.0" edition = "2018" +publish = false [dependencies.windows] path = "../../../libs/windows" diff --git a/crates/samples/windows/xml/Cargo.toml b/crates/samples/windows/xml/Cargo.toml index d16c785f16..18e0ec47c7 100644 --- a/crates/samples/windows/xml/Cargo.toml +++ b/crates/samples/windows/xml/Cargo.toml @@ -2,6 +2,7 @@ name = "sample_xml" version = "0.0.0" edition = "2018" +publish = false [dependencies.windows] path = "../../../libs/windows" diff --git a/crates/tests/agile/Cargo.toml b/crates/tests/agile/Cargo.toml index b4b20525fa..12857ee026 100644 --- a/crates/tests/agile/Cargo.toml +++ b/crates/tests/agile/Cargo.toml @@ -1,8 +1,8 @@ [package] name = "test_agile" version = "0.0.0" -authors = ["Microsoft"] edition = "2018" +publish = false [dependencies.windows] path = "../../libs/windows" diff --git a/crates/tests/agile_reference/Cargo.toml b/crates/tests/agile_reference/Cargo.toml index cbed3efda8..1c8e422223 100644 --- a/crates/tests/agile_reference/Cargo.toml +++ b/crates/tests/agile_reference/Cargo.toml @@ -1,8 +1,8 @@ [package] name = "test_agile_reference" version = "0.0.0" -authors = ["Microsoft"] edition = "2018" +publish = false [dependencies.windows] path = "../../libs/windows" diff --git a/crates/tests/alternate_success_code/Cargo.toml b/crates/tests/alternate_success_code/Cargo.toml index a97c34b283..392cddd677 100644 --- a/crates/tests/alternate_success_code/Cargo.toml +++ b/crates/tests/alternate_success_code/Cargo.toml @@ -1,8 +1,8 @@ [package] name = "test_alternate_success_code" version = "0.0.0" -authors = ["Microsoft"] edition = "2018" +publish = false [dependencies.windows] path = "../../libs/windows" diff --git a/crates/tests/arch/Cargo.toml b/crates/tests/arch/Cargo.toml index e3c7c7c6d5..5bd4e355e5 100644 --- a/crates/tests/arch/Cargo.toml +++ b/crates/tests/arch/Cargo.toml @@ -1,8 +1,8 @@ [package] name = "test_arch" version = "0.0.0" -authors = ["Microsoft"] edition = "2018" +publish = false [dependencies.windows] path = "../../libs/windows" diff --git a/crates/tests/arch_feature/Cargo.toml b/crates/tests/arch_feature/Cargo.toml index 74d2a96872..77605407c9 100644 --- a/crates/tests/arch_feature/Cargo.toml +++ b/crates/tests/arch_feature/Cargo.toml @@ -1,8 +1,8 @@ [package] name = "test_arch_feature" version = "0.0.0" -authors = ["Microsoft"] edition = "2018" +publish = false [dependencies.windows] path = "../../libs/windows" diff --git a/crates/tests/array/Cargo.toml b/crates/tests/array/Cargo.toml index 666fc0e630..93c13315d6 100644 --- a/crates/tests/array/Cargo.toml +++ b/crates/tests/array/Cargo.toml @@ -1,8 +1,8 @@ [package] name = "test_array" version = "0.0.0" -authors = ["Microsoft"] edition = "2018" +publish = false [dependencies.windows] path = "../../libs/windows" diff --git a/crates/tests/bcrypt/Cargo.toml b/crates/tests/bcrypt/Cargo.toml index c9345cfc65..cf822eed99 100644 --- a/crates/tests/bcrypt/Cargo.toml +++ b/crates/tests/bcrypt/Cargo.toml @@ -1,8 +1,8 @@ [package] name = "test_bcrypt" version = "0.0.0" -authors = ["Microsoft"] edition = "2018" +publish = false [dependencies.windows] path = "../../libs/windows" diff --git a/crates/tests/bstr/Cargo.toml b/crates/tests/bstr/Cargo.toml index 9d81b5dace..2b60553d01 100644 --- a/crates/tests/bstr/Cargo.toml +++ b/crates/tests/bstr/Cargo.toml @@ -1,8 +1,8 @@ [package] name = "test_bstr" version = "0.0.0" -authors = ["Microsoft"] edition = "2018" +publish = false [dependencies.windows] path = "../../libs/windows" diff --git a/crates/tests/calling_convention/Cargo.toml b/crates/tests/calling_convention/Cargo.toml index 290493dbc6..57d3fd0fed 100644 --- a/crates/tests/calling_convention/Cargo.toml +++ b/crates/tests/calling_convention/Cargo.toml @@ -1,8 +1,8 @@ [package] name = "test_calling_convention" version = "0.0.0" -authors = ["Microsoft"] edition = "2018" +publish = false [dependencies.windows] path = "../../libs/windows" diff --git a/crates/tests/cfg_generic/Cargo.toml b/crates/tests/cfg_generic/Cargo.toml index 19f6976c07..fbd9d4003f 100644 --- a/crates/tests/cfg_generic/Cargo.toml +++ b/crates/tests/cfg_generic/Cargo.toml @@ -1,8 +1,8 @@ [package] name = "test_cfg_generic" version = "0.0.0" -authors = ["Microsoft"] edition = "2018" +publish = false [dependencies.windows] path = "../../libs/windows" diff --git a/crates/tests/collections/Cargo.toml b/crates/tests/collections/Cargo.toml index 070be9701f..7e213db002 100644 --- a/crates/tests/collections/Cargo.toml +++ b/crates/tests/collections/Cargo.toml @@ -1,8 +1,8 @@ [package] name = "test_collections" version = "0.0.0" -authors = ["Microsoft"] edition = "2018" +publish = false [dependencies.windows] path = "../../libs/windows" diff --git a/crates/tests/component/Cargo.toml b/crates/tests/component/Cargo.toml index 85920f1c9b..ee1967b891 100644 --- a/crates/tests/component/Cargo.toml +++ b/crates/tests/component/Cargo.toml @@ -2,6 +2,7 @@ name = "test_component" version = "0.0.0" edition = "2018" +publish = false [lib] crate-type = ["cdylib"] diff --git a/crates/tests/component/build.rs b/crates/tests/component/build.rs index d7ef8d96f2..2735882fb5 100644 --- a/crates/tests/component/build.rs +++ b/crates/tests/component/build.rs @@ -29,7 +29,7 @@ fn main() { "-p", "riddle", "--target-dir", - "target", // TODO: workaround for https://github.com/rust-lang/cargo/issues/6412 + "../../../target/test_component", // TODO: workaround for https://github.com/rust-lang/cargo/issues/6412 "--", "-in", "component.winmd", diff --git a/crates/tests/component_client/Cargo.toml b/crates/tests/component_client/Cargo.toml index 4ff0bd57a5..438d5d2fb8 100644 --- a/crates/tests/component_client/Cargo.toml +++ b/crates/tests/component_client/Cargo.toml @@ -1,8 +1,8 @@ [package] name = "test_component_client" version = "0.0.0" -authors = ["Microsoft"] edition = "2018" +publish = false [dependencies.windows-core] path = "../../libs/core" diff --git a/crates/tests/component_client/build.rs b/crates/tests/component_client/build.rs index a30af087ab..736c325c05 100644 --- a/crates/tests/component_client/build.rs +++ b/crates/tests/component_client/build.rs @@ -6,7 +6,7 @@ fn main() { "-p", "riddle", "--target-dir", - "target", + "../../../target/test_component_client", // TODO: workaround for https://github.com/rust-lang/cargo/issues/6412 "--", "-in", "../component/component.winmd", diff --git a/crates/tests/const_fields/Cargo.toml b/crates/tests/const_fields/Cargo.toml index 024a3894d4..78b7de8965 100644 --- a/crates/tests/const_fields/Cargo.toml +++ b/crates/tests/const_fields/Cargo.toml @@ -1,8 +1,8 @@ [package] name = "test_const_fields" version = "0.0.0" -authors = ["Microsoft"] edition = "2018" +publish = false [dependencies.windows] path = "../../libs/windows" diff --git a/crates/tests/const_params/Cargo.toml b/crates/tests/const_params/Cargo.toml index 9cf37ff9af..13d6c5295b 100644 --- a/crates/tests/const_params/Cargo.toml +++ b/crates/tests/const_params/Cargo.toml @@ -1,8 +1,8 @@ [package] name = "test_const_params" version = "0.0.0" -authors = ["Microsoft"] edition = "2018" +publish = false [dependencies.windows] path = "../../libs/windows" diff --git a/crates/tests/const_ptrs/Cargo.toml b/crates/tests/const_ptrs/Cargo.toml index 3a290e7b77..f75d5e0299 100644 --- a/crates/tests/const_ptrs/Cargo.toml +++ b/crates/tests/const_ptrs/Cargo.toml @@ -1,8 +1,8 @@ [package] name = "test_const_ptrs" version = "0.0.0" -authors = ["Microsoft"] edition = "2018" +publish = false [dependencies.windows] path = "../../libs/windows" diff --git a/crates/tests/core/Cargo.toml b/crates/tests/core/Cargo.toml index 286297e1b3..51352ffd69 100644 --- a/crates/tests/core/Cargo.toml +++ b/crates/tests/core/Cargo.toml @@ -1,8 +1,8 @@ [package] name = "test_core" version = "0.0.0" -authors = ["Microsoft"] edition = "2018" +publish = false [dependencies.windows] path = "../../libs/windows" diff --git a/crates/tests/debug/Cargo.toml b/crates/tests/debug/Cargo.toml index 098da4efa4..4f0850fdcd 100644 --- a/crates/tests/debug/Cargo.toml +++ b/crates/tests/debug/Cargo.toml @@ -1,8 +1,8 @@ [package] name = "test_debug" version = "0.0.0" -authors = ["Microsoft"] edition = "2018" +publish = false [dependencies.windows] path = "../../libs/windows" diff --git a/crates/tests/debug_inspectable/Cargo.toml b/crates/tests/debug_inspectable/Cargo.toml index 95d536fcf1..0ef3566a6a 100644 --- a/crates/tests/debug_inspectable/Cargo.toml +++ b/crates/tests/debug_inspectable/Cargo.toml @@ -1,8 +1,8 @@ [package] name = "test_debug_inspectable" version = "0.0.0" -authors = ["Microsoft"] edition = "2018" +publish = false [dependencies.windows] path = "../../libs/windows" diff --git a/crates/tests/debugger_visualizer/Cargo.toml b/crates/tests/debugger_visualizer/Cargo.toml index 2054fb7cba..04e08d68dd 100644 --- a/crates/tests/debugger_visualizer/Cargo.toml +++ b/crates/tests/debugger_visualizer/Cargo.toml @@ -1,8 +1,8 @@ [package] name = "test_debugger_visualizer_x" version = "0.0.0" -authors = ["Microsoft"] edition = "2018" +publish = false [dependencies.windows] path = "../../libs/windows" diff --git a/crates/tests/deprecated/Cargo.toml b/crates/tests/deprecated/Cargo.toml index b0c7170417..5998fce35e 100644 --- a/crates/tests/deprecated/Cargo.toml +++ b/crates/tests/deprecated/Cargo.toml @@ -1,8 +1,8 @@ [package] name = "test_deprecated" version = "0.0.0" -authors = ["Microsoft"] edition = "2018" +publish = false [dependencies.windows] path = "../../libs/windows" diff --git a/crates/tests/dispatch/Cargo.toml b/crates/tests/dispatch/Cargo.toml index edf1aadd02..bdd9055a5b 100644 --- a/crates/tests/dispatch/Cargo.toml +++ b/crates/tests/dispatch/Cargo.toml @@ -1,8 +1,8 @@ [package] name = "test_dispatch" version = "0.0.0" -authors = ["Microsoft"] edition = "2018" +publish = false [dependencies.windows] path = "../../libs/windows" diff --git a/crates/tests/does_not_return/Cargo.toml b/crates/tests/does_not_return/Cargo.toml index 6b2dbeb2c0..e4ff7ca5e7 100644 --- a/crates/tests/does_not_return/Cargo.toml +++ b/crates/tests/does_not_return/Cargo.toml @@ -1,8 +1,8 @@ [package] name = "test_does_not_return" version = "0.0.0" -authors = ["Microsoft"] edition = "2018" +publish = false [dependencies.windows] path = "../../libs/windows" diff --git a/crates/tests/enums/Cargo.toml b/crates/tests/enums/Cargo.toml index 9d0f2bf6e3..bf4af00ef1 100644 --- a/crates/tests/enums/Cargo.toml +++ b/crates/tests/enums/Cargo.toml @@ -1,8 +1,8 @@ [package] name = "test_enums" version = "0.0.0" -authors = ["Microsoft"] edition = "2018" +publish = false [dependencies.windows] path = "../../libs/windows" diff --git a/crates/tests/error/Cargo.toml b/crates/tests/error/Cargo.toml index d746413407..268eaf55ae 100644 --- a/crates/tests/error/Cargo.toml +++ b/crates/tests/error/Cargo.toml @@ -1,8 +1,8 @@ [package] name = "test_error" version = "0.0.0" -authors = ["Microsoft"] edition = "2018" +publish = false [dependencies.windows] path = "../../libs/windows" diff --git a/crates/tests/event/Cargo.toml b/crates/tests/event/Cargo.toml index 03d5c493ef..e253c25981 100644 --- a/crates/tests/event/Cargo.toml +++ b/crates/tests/event/Cargo.toml @@ -1,8 +1,8 @@ [package] name = "test_event" version = "0.0.0" -authors = ["Microsoft"] edition = "2018" +publish = false [dependencies.windows] path = "../../libs/windows" diff --git a/crates/tests/extensions/Cargo.toml b/crates/tests/extensions/Cargo.toml index 022f5356ee..8c694bd3b1 100644 --- a/crates/tests/extensions/Cargo.toml +++ b/crates/tests/extensions/Cargo.toml @@ -1,8 +1,8 @@ [package] name = "test_extensions" version = "0.0.0" -authors = ["Microsoft"] edition = "2018" +publish = false [dependencies.windows] path = "../../libs/windows" diff --git a/crates/tests/handles/Cargo.toml b/crates/tests/handles/Cargo.toml index efbaf31157..7f70aebdb1 100644 --- a/crates/tests/handles/Cargo.toml +++ b/crates/tests/handles/Cargo.toml @@ -1,8 +1,8 @@ [package] name = "test_handles" version = "0.0.0" -authors = ["Microsoft"] edition = "2018" +publish = false [dependencies.windows] path = "../../libs/windows" diff --git a/crates/tests/implement/Cargo.toml b/crates/tests/implement/Cargo.toml index c2d424806b..c9eca87e7c 100644 --- a/crates/tests/implement/Cargo.toml +++ b/crates/tests/implement/Cargo.toml @@ -1,8 +1,8 @@ [package] name = "test_implement" version = "0.0.0" -authors = ["Microsoft"] edition = "2018" +publish = false [dependencies.windows] path = "../../libs/windows" diff --git a/crates/tests/interface/Cargo.toml b/crates/tests/interface/Cargo.toml index 1146780a54..65289c472e 100644 --- a/crates/tests/interface/Cargo.toml +++ b/crates/tests/interface/Cargo.toml @@ -1,8 +1,8 @@ [package] name = "test_interface" version = "0.0.0" -authors = ["Microsoft"] edition = "2018" +publish = false [dependencies.windows] path = "../../libs/windows" diff --git a/crates/tests/interop/Cargo.toml b/crates/tests/interop/Cargo.toml index efcdbc7cc7..ba3c25c102 100644 --- a/crates/tests/interop/Cargo.toml +++ b/crates/tests/interop/Cargo.toml @@ -1,8 +1,8 @@ [package] name = "test_interop" version = "0.0.0" -authors = ["Microsoft"] edition = "2018" +publish = false [dependencies.windows] path = "../../libs/windows" diff --git a/crates/tests/lib/Cargo.toml b/crates/tests/lib/Cargo.toml index b5f0fae75b..3a87b9a04d 100644 --- a/crates/tests/lib/Cargo.toml +++ b/crates/tests/lib/Cargo.toml @@ -1,8 +1,8 @@ [package] name = "test_lib" version = "0.0.0" -authors = ["Microsoft"] edition = "2018" +publish = false [dependencies.windows] path = "../../libs/windows" diff --git a/crates/tests/literals/Cargo.toml b/crates/tests/literals/Cargo.toml index f7420f76bf..c50ceb012b 100644 --- a/crates/tests/literals/Cargo.toml +++ b/crates/tests/literals/Cargo.toml @@ -1,8 +1,8 @@ [package] name = "test_literals" version = "0.0.0" -authors = ["Microsoft"] edition = "2018" +publish = false [dependencies.windows] path = "../../libs/windows" diff --git a/crates/tests/match/Cargo.toml b/crates/tests/match/Cargo.toml index 962610358b..63b84d2f2b 100644 --- a/crates/tests/match/Cargo.toml +++ b/crates/tests/match/Cargo.toml @@ -1,8 +1,8 @@ [package] name = "test_match" version = "0.0.0" -authors = ["Microsoft"] edition = "2018" +publish = false [dependencies.windows] path = "../../libs/windows" diff --git a/crates/tests/matrix3x2/Cargo.toml b/crates/tests/matrix3x2/Cargo.toml index 5107af84e6..07b0ef12fe 100644 --- a/crates/tests/matrix3x2/Cargo.toml +++ b/crates/tests/matrix3x2/Cargo.toml @@ -1,8 +1,8 @@ [package] name = "test_matrix3x2" version = "0.0.0" -authors = ["Microsoft"] edition = "2018" +publish = false [dependencies.windows] path = "../../libs/windows" diff --git a/crates/tests/metadata/Cargo.toml b/crates/tests/metadata/Cargo.toml index 00fd31a50d..8be7aa1f73 100644 --- a/crates/tests/metadata/Cargo.toml +++ b/crates/tests/metadata/Cargo.toml @@ -1,8 +1,8 @@ [package] name = "test_metadata" version = "0.0.0" -authors = ["Microsoft"] edition = "2018" +publish = false [dependencies] metadata = { package = "windows-metadata", path = "../../libs/metadata" } diff --git a/crates/tests/msrv/Cargo.toml b/crates/tests/msrv/Cargo.toml index 6335d34081..ecd2792b73 100644 --- a/crates/tests/msrv/Cargo.toml +++ b/crates/tests/msrv/Cargo.toml @@ -2,6 +2,7 @@ name = "test_msrv" version = "0.0.0" edition = "2018" +publish = false [dependencies.windows] path = "../../libs/windows" diff --git a/crates/tests/no_use/Cargo.toml b/crates/tests/no_use/Cargo.toml index 7de6ae9664..f9e14ea42f 100644 --- a/crates/tests/no_use/Cargo.toml +++ b/crates/tests/no_use/Cargo.toml @@ -1,8 +1,8 @@ [package] name = "test_no_use" version = "0.0.0" -authors = ["Microsoft"] edition = "2018" +publish = false [dependencies.windows] path = "../../libs/windows" diff --git a/crates/tests/not_dll/Cargo.toml b/crates/tests/not_dll/Cargo.toml index ff293550df..9b05273631 100644 --- a/crates/tests/not_dll/Cargo.toml +++ b/crates/tests/not_dll/Cargo.toml @@ -1,8 +1,8 @@ [package] name = "test_not_dll" version = "0.0.0" -authors = ["Microsoft"] edition = "2018" +publish = false [dependencies.windows] path = "../../libs/windows" diff --git a/crates/tests/query_signature/Cargo.toml b/crates/tests/query_signature/Cargo.toml index e8139ac667..9879f710c3 100644 --- a/crates/tests/query_signature/Cargo.toml +++ b/crates/tests/query_signature/Cargo.toml @@ -1,8 +1,8 @@ [package] name = "test_query_signature" version = "0.0.0" -authors = ["Microsoft"] edition = "2018" +publish = false [dependencies.windows] path = "../../libs/windows" diff --git a/crates/tests/readme/Cargo.toml b/crates/tests/readme/Cargo.toml index 69c1fa1a22..e2b8a9f062 100644 --- a/crates/tests/readme/Cargo.toml +++ b/crates/tests/readme/Cargo.toml @@ -1,8 +1,8 @@ [package] name = "test_readme" version = "0.0.0" -authors = ["Microsoft"] edition = "2018" +publish = false [dependencies.windows] version = "0.48" diff --git a/crates/tests/reserved/Cargo.toml b/crates/tests/reserved/Cargo.toml index 4f3edb0d9d..bfb400b425 100644 --- a/crates/tests/reserved/Cargo.toml +++ b/crates/tests/reserved/Cargo.toml @@ -1,8 +1,8 @@ [package] name = "test_reserved" version = "0.0.0" -authors = ["Microsoft"] edition = "2018" +publish = false [dependencies.windows] path = "../../libs/windows" diff --git a/crates/tests/resources/Cargo.toml b/crates/tests/resources/Cargo.toml index fb96bdefaf..6624346ec0 100644 --- a/crates/tests/resources/Cargo.toml +++ b/crates/tests/resources/Cargo.toml @@ -1,8 +1,8 @@ [package] name = "test_resources" version = "0.0.0" -authors = ["Microsoft"] edition = "2018" +publish = false [dependencies.windows] path = "../../libs/windows" diff --git a/crates/tests/return_struct/Cargo.toml b/crates/tests/return_struct/Cargo.toml index d4c28a1479..e8428d5f69 100644 --- a/crates/tests/return_struct/Cargo.toml +++ b/crates/tests/return_struct/Cargo.toml @@ -1,8 +1,8 @@ [package] name = "test_return_struct" version = "0.0.0" -authors = ["Microsoft"] edition = "2018" +publish = false [dependencies.windows] path = "../../libs/windows" diff --git a/crates/tests/riddle/Cargo.toml b/crates/tests/riddle/Cargo.toml index 1ed54384bf..c23e355151 100644 --- a/crates/tests/riddle/Cargo.toml +++ b/crates/tests/riddle/Cargo.toml @@ -1,8 +1,8 @@ [package] name = "test_riddle" version = "0.0.0" -authors = ["Microsoft"] edition = "2018" +publish = false [dependencies.windows-metadata] path = "../../libs/metadata" diff --git a/crates/tests/simple_component/Cargo.toml b/crates/tests/simple_component/Cargo.toml index ff6739aec5..52ef7fd428 100644 --- a/crates/tests/simple_component/Cargo.toml +++ b/crates/tests/simple_component/Cargo.toml @@ -2,6 +2,7 @@ name = "test_simple_component" version = "0.0.0" edition = "2018" +publish = false [lib] crate-type = ["cdylib"] diff --git a/crates/tests/standalone/Cargo.toml b/crates/tests/standalone/Cargo.toml index 96cdc05b7d..930d979dff 100644 --- a/crates/tests/standalone/Cargo.toml +++ b/crates/tests/standalone/Cargo.toml @@ -1,8 +1,8 @@ [package] name = "test_standalone" version = "0.0.0" -authors = ["Microsoft"] edition = "2018" +publish = false [dependencies.windows-core] path = "../../libs/core" diff --git a/crates/tests/standalone/build.rs b/crates/tests/standalone/build.rs index f1573de7d4..3acfc1b550 100644 --- a/crates/tests/standalone/build.rs +++ b/crates/tests/standalone/build.rs @@ -158,7 +158,7 @@ fn riddle(output: &str, filter: &[&str], config: &[&str]) { "-p", "riddle", "--target-dir", - "target", // TODO: workaround for https://github.com/rust-lang/cargo/issues/6412 + "../../../target/test_standalone", // TODO: workaround for https://github.com/rust-lang/cargo/issues/6412 "--", "-in", "../../libs/metadata/default", diff --git a/crates/tests/string_param/Cargo.toml b/crates/tests/string_param/Cargo.toml index ae6cc9617f..e47694040f 100644 --- a/crates/tests/string_param/Cargo.toml +++ b/crates/tests/string_param/Cargo.toml @@ -1,8 +1,8 @@ [package] name = "test_string_param" version = "0.0.0" -authors = ["Microsoft"] edition = "2018" +publish = false [dependencies.windows] path = "../../libs/windows" diff --git a/crates/tests/structs/Cargo.toml b/crates/tests/structs/Cargo.toml index d165c3874f..178e9a65a2 100644 --- a/crates/tests/structs/Cargo.toml +++ b/crates/tests/structs/Cargo.toml @@ -1,8 +1,8 @@ [package] name = "test_structs" version = "0.0.0" -authors = ["Microsoft"] edition = "2018" +publish = false [dependencies.windows] path = "../../libs/windows" diff --git a/crates/tests/sys/Cargo.toml b/crates/tests/sys/Cargo.toml index 992fce054d..3f4b7aaef2 100644 --- a/crates/tests/sys/Cargo.toml +++ b/crates/tests/sys/Cargo.toml @@ -1,8 +1,8 @@ [package] name = "test_sys" version = "0.0.0" -authors = ["Microsoft"] edition = "2018" +publish = false [dependencies.windows-sys] path = "../../libs/sys" diff --git a/crates/tests/targets/Cargo.toml b/crates/tests/targets/Cargo.toml index f9cabb0767..0cd24232d4 100644 --- a/crates/tests/targets/Cargo.toml +++ b/crates/tests/targets/Cargo.toml @@ -1,8 +1,8 @@ [package] name = "test_targets" version = "0.0.0" -authors = ["Microsoft"] edition = "2018" +publish = false [dependencies.windows-targets] path = "../../libs/targets" diff --git a/crates/tests/unions/Cargo.toml b/crates/tests/unions/Cargo.toml index 2ca8f25683..c1c61c2a1a 100644 --- a/crates/tests/unions/Cargo.toml +++ b/crates/tests/unions/Cargo.toml @@ -1,8 +1,8 @@ [package] name = "test_unions" version = "0.0.0" -authors = ["Microsoft"] edition = "2018" +publish = false [dependencies.windows] path = "../../libs/windows" diff --git a/crates/tests/wdk/Cargo.toml b/crates/tests/wdk/Cargo.toml index 12a1920a9c..c8f7c88e04 100644 --- a/crates/tests/wdk/Cargo.toml +++ b/crates/tests/wdk/Cargo.toml @@ -1,8 +1,8 @@ [package] name = "test_wdk" version = "0.0.0" -authors = ["Microsoft"] edition = "2018" +publish = false [dependencies.windows] path = "../../libs/windows" diff --git a/crates/tests/weak/Cargo.toml b/crates/tests/weak/Cargo.toml index 0ebbd4dcb5..0c6ab68b68 100644 --- a/crates/tests/weak/Cargo.toml +++ b/crates/tests/weak/Cargo.toml @@ -1,8 +1,8 @@ [package] name = "test_weak" version = "0.0.0" -authors = ["Microsoft"] edition = "2018" +publish = false [dependencies.windows] path = "../../libs/windows" diff --git a/crates/tests/weak_ref/Cargo.toml b/crates/tests/weak_ref/Cargo.toml index 87d0cf8f0b..9a0a6fdbbb 100644 --- a/crates/tests/weak_ref/Cargo.toml +++ b/crates/tests/weak_ref/Cargo.toml @@ -1,8 +1,8 @@ [package] name = "test_weak_ref" version = "0.0.0" -authors = ["Microsoft"] edition = "2018" +publish = false [dependencies.windows] path = "../../libs/windows" diff --git a/crates/tests/win32/Cargo.toml b/crates/tests/win32/Cargo.toml index 740648a68a..f831decf61 100644 --- a/crates/tests/win32/Cargo.toml +++ b/crates/tests/win32/Cargo.toml @@ -1,8 +1,8 @@ [package] name = "test_win32" version = "0.0.0" -authors = ["Microsoft"] edition = "2018" +publish = false [dependencies.windows] path = "../../libs/windows" diff --git a/crates/tests/win32_arrays/Cargo.toml b/crates/tests/win32_arrays/Cargo.toml index 1f1ffbcfeb..400b5ce140 100644 --- a/crates/tests/win32_arrays/Cargo.toml +++ b/crates/tests/win32_arrays/Cargo.toml @@ -1,8 +1,8 @@ [package] name = "test_win32_arrays" version = "0.0.0" -authors = ["Microsoft"] edition = "2018" +publish = false [dependencies.windows] path = "../../libs/windows" diff --git a/crates/tests/window_long/Cargo.toml b/crates/tests/window_long/Cargo.toml index c14faa18d2..b09ce17dbf 100644 --- a/crates/tests/window_long/Cargo.toml +++ b/crates/tests/window_long/Cargo.toml @@ -1,8 +1,8 @@ [package] name = "test_window_long" version = "0.0.0" -authors = ["Microsoft"] edition = "2018" +publish = false [dependencies.windows] path = "../../libs/windows" diff --git a/crates/tests/winrt/Cargo.toml b/crates/tests/winrt/Cargo.toml index 0c27c01a8d..266f2fe894 100644 --- a/crates/tests/winrt/Cargo.toml +++ b/crates/tests/winrt/Cargo.toml @@ -1,8 +1,8 @@ [package] name = "test_winrt" version = "0.0.0" -authors = ["Microsoft"] edition = "2018" +publish = false [dependencies.windows] path = "../../libs/windows" diff --git a/crates/tools/riddle/src/idl/mod.rs b/crates/tools/riddle/src/idl/mod.rs index a7d62e2a91..a8b7820dc0 100644 --- a/crates/tools/riddle/src/idl/mod.rs +++ b/crates/tools/riddle/src/idl/mod.rs @@ -26,8 +26,9 @@ impl File { writer::Writer::new(self).into_string() } - pub fn to_winmd(&self) -> Result> { - to_winmd::idl_to_winmd(self) + pub fn into_winmd(mut self) -> Result> { + self.canonicalize()?; + to_winmd::idl_to_winmd(&self) } } diff --git a/crates/tools/riddle/src/idl/to_winmd.rs b/crates/tools/riddle/src/idl/to_winmd.rs index d3278f4046..ffd2a351da 100644 --- a/crates/tools/riddle/src/idl/to_winmd.rs +++ b/crates/tools/riddle/src/idl/to_winmd.rs @@ -377,7 +377,7 @@ fn syn_path(namespace: &str, path: &syn::Path) -> winmd::Type { } } - // TODO: Here we assume that paths are absoluate since there's now way to disambiguate between nested and absoluate paths + // TODO: Here we assume that paths are absolute since there's no way to disambiguate between nested and absolute paths // The canonicalize function preprocesses the IDL to make this work let mut builder = vec![]; diff --git a/crates/tools/riddle/src/main.rs b/crates/tools/riddle/src/main.rs index f4be1d26a0..1b2aa48ce1 100644 --- a/crates/tools/riddle/src/main.rs +++ b/crates/tools/riddle/src/main.rs @@ -1,5 +1,3 @@ -#![allow(dead_code)] - mod args; mod error; mod idl; @@ -17,7 +15,6 @@ enum ArgKind { Output, Filter, Config, - Etc, } fn main() { @@ -64,7 +61,6 @@ Options: ArgKind::None => match arg.as_str() { "-in" => kind = ArgKind::Input, "-out" => kind = ArgKind::Output, - "-etc" => kind = ArgKind::Etc, "-filter" => kind = ArgKind::Filter, "-config" => kind = ArgKind::Config, "-format" => format = true, @@ -77,10 +73,6 @@ Options: return Err(Error::new("too many outputs")); } } - ArgKind::Etc => { - // TODO: Move arg reader to a separate type so we can recursively call it here - // with the contents of the file. - } ArgKind::Input => input.push(arg.as_str()), ArgKind::Filter => { if let Some(rest) = arg.strip_prefix('!') { @@ -246,10 +238,10 @@ fn read_file_lines(path: &str) -> Result> { fn read_idl_file(path: &str) -> Result { read_file_text(path) .and_then(|source| idl::File::parse_str(&source)) - .and_then(|file| file.to_winmd()) + .and_then(|file| file.into_winmd()) .map(|bytes| { - // Write bytes to file if you need to debug the intermediate .winmd file like so: - _ = write_to_file("temp.winmd", &bytes); + // TODO: Write bytes to file if you need to debug the intermediate .winmd file like so: + // _ = write_to_file("temp.winmd", &bytes); // Unwrapping here is fine since `idl_to_winmd` should have produced a valid winmd metadata::File::new(bytes).unwrap() @@ -301,8 +293,10 @@ fn directory(path: &str) -> &str { .map_or("", |(directory, _)| directory) } -fn explode(path: &str) -> (&str, &str, &str) { - let (directory, file_name) = path.rsplit_once(&['/', '\\']).unwrap_or(("", path)); - let (file_name, extension) = file_name.rsplit_once('.').unwrap_or((file_name, "")); - (directory, file_name, extension) +fn trim_tick(name: &str) -> &str { + if name.as_bytes().iter().rev().nth(1) == Some(&b'`') { + &name[..name.len() - 2] + } else { + name + } } diff --git a/crates/tools/riddle/src/rust/gen.rs b/crates/tools/riddle/src/rust/gen.rs index 4648969dba..66ac9b2997 100644 --- a/crates/tools/riddle/src/rust/gen.rs +++ b/crates/tools/riddle/src/rust/gen.rs @@ -573,7 +573,7 @@ impl<'a> Gen<'a> { _phantoms: &TokenStream, features: &TokenStream, ) -> TokenStream { - let name = trim_tick(self.reader.type_def_name(def)); + let name = crate::trim_tick(self.reader.type_def_name(def)); quote! { #features impl<#constraints> ::core::cmp::PartialEq for #ident { diff --git a/crates/tools/riddle/src/rust/mod.rs b/crates/tools/riddle/src/rust/mod.rs index 28f98ff46f..5e539938b2 100644 --- a/crates/tools/riddle/src/rust/mod.rs +++ b/crates/tools/riddle/src/rust/mod.rs @@ -64,11 +64,6 @@ fn gen_file(gen: &Gen) -> Result<()> { // there should be a simple way to generate the with or without namespaces. if gen.flatten { - // TODO: may need to harmonize right away since the filter doesn't map nicely to the standalone_imp... - // maybe just enumerate filter includes for now? - - // gen.namespace = "Windows."; - let tokens = standalone::standalone_imp(gen, gen.filter.includes()); crate::write_to_file(gen.output, tokens) } else { @@ -318,18 +313,6 @@ fn namespace_impl(gen: &Gen, tree: &Tree) -> String { try_format(tokens.into_string()) } -// /// Generates bindings for a specific component namespace. -// fn component(namespace_name: &str, files: &[File]) -> String { -// let reader = &Reader::new(files); -// let tree = reader.tree(namespace_name, &Default::default()); -// let mut gen = Gen::new(reader); -// gen.namespace = tree.namespace; -// gen.implement = true; -// let mut bindings = namespace(&gen, &tree); -// bindings.push_str(&namespace_impl(&gen, &tree)); -// try_format(bindings) -// } - fn allow() -> TokenStream { quote! { #![allow(non_snake_case, non_upper_case_globals, non_camel_case_types, dead_code, clippy::all)] diff --git a/crates/tools/riddle/src/tokens/mod.rs b/crates/tools/riddle/src/tokens/mod.rs index e9e9e1a9bd..ea10b7bbb7 100644 --- a/crates/tools/riddle/src/tokens/mod.rs +++ b/crates/tools/riddle/src/tokens/mod.rs @@ -1,4 +1,4 @@ -#![forbid(unsafe_code)] +#![allow(dead_code)] mod to_tokens; mod token_stream; @@ -441,14 +441,6 @@ pub fn to_ident(name: &str) -> TokenStream { | "try" | "async" | "await" | "dyn" => format!("r#{name}").into(), "Self" | "self" => format!("{name}_").into(), "_" => "unused".into(), - _ => trim_tick(name).into(), - } -} - -fn trim_tick(name: &str) -> &str { - if name.as_bytes().iter().rev().nth(1) == Some(&b'`') { - &name[..name.len() - 2] - } else { - name + _ => crate::trim_tick(name).into(), } } diff --git a/crates/tools/riddle/src/winmd/writer/codes.rs b/crates/tools/riddle/src/winmd/writer/codes.rs index cc75472e27..466b2549ca 100644 --- a/crates/tools/riddle/src/winmd/writer/codes.rs +++ b/crates/tools/riddle/src/winmd/writer/codes.rs @@ -1,4 +1,4 @@ -#![allow(clippy::enum_variant_names)] +#![allow(dead_code, clippy::enum_variant_names)] /// A `ResolutionScope` is an index into a certain table indicating the scope in which a TypeRef can be resolved. #[derive(Clone)] diff --git a/crates/tools/riddle/src/winmd/writer/file.rs b/crates/tools/riddle/src/winmd/writer/file.rs index e72cfcea8f..73141bcdb0 100644 --- a/crates/tools/riddle/src/winmd/writer/file.rs +++ b/crates/tools/riddle/src/winmd/writer/file.rs @@ -162,9 +162,3 @@ impl StreamHeader { self.offset + self.size } } - -fn guid_stream() -> Vec { - let mut buffer = Vec::new(); - buffer.resize(16, 0); // zero guid - buffer -} diff --git a/crates/tools/riddle/src/winmd/writer/type.rs b/crates/tools/riddle/src/winmd/writer/type.rs index d8d9521200..73f888a5df 100644 --- a/crates/tools/riddle/src/winmd/writer/type.rs +++ b/crates/tools/riddle/src/winmd/writer/type.rs @@ -1,4 +1,4 @@ -#![allow(clippy::upper_case_acronyms)] +#![allow(dead_code, clippy::upper_case_acronyms)] #[derive(Clone, Debug)] pub struct TypeName { @@ -34,7 +34,7 @@ pub enum Type { PCSTR, PCWSTR, BSTR, - TypeName, // TODO: maybe call this DeferredTypeName since its used to indicate that the type name follows in the blob's value stream. + TypeName, TypeRef(TypeName), GenericParam(String), MutPtr(Box, usize),