Skip to content

Commit

Permalink
Add "hello world" component sample (microsoft#2814)
Browse files Browse the repository at this point in the history
  • Loading branch information
kennykerr authored Jan 22, 2024
1 parent 1facf94 commit c7a10d6
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/clippy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ jobs:
cargo clippy -p riddle &&
cargo clippy -p sample_bits &&
cargo clippy -p sample_com_uri &&
cargo clippy -p sample_component_hello_world &&
cargo clippy -p sample_consent &&
cargo clippy -p sample_core_app &&
cargo clippy -p sample_counter &&
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ jobs:
cargo test -p riddle &&
cargo test -p sample_bits &&
cargo test -p sample_com_uri &&
cargo test -p sample_component_hello_world &&
cargo test -p sample_consent &&
cargo test -p sample_core_app &&
cargo test -p sample_counter &&
Expand Down
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ members = [
"crates/libs/*",
"crates/samples/windows-sys/*",
"crates/samples/windows/*",
"crates/samples/components/*",
"crates/targets/*",
"crates/tests/*",
"crates/tools/*",
Expand Down
8 changes: 8 additions & 0 deletions crates/samples/components/hello_world/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[package]
name = "sample_component_hello_world"
version = "0.0.0"
edition = "2021"
publish = false

[lib]
crate-type = ["cdylib"]
1 change: 1 addition & 0 deletions crates/samples/components/hello_world/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Sample for [Creating your first DLL in Rust](https://kennykerr.ca/rust-getting-started/creating-your-first-dll.html) in [Getting Started with Rust](https://kennykerr.ca/rust-getting-started).
4 changes: 4 additions & 0 deletions crates/samples/components/hello_world/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#[no_mangle]
extern "system" fn HelloWorld() -> i32 {
123
}

0 comments on commit c7a10d6

Please sign in to comment.