From a88df0a51a26dad2b15af19e69682f79beef23cc Mon Sep 17 00:00:00 2001 From: Youyuan Wu Date: Sun, 19 Nov 2023 10:56:52 -0800 Subject: [PATCH] save linux work --- .cargo/config.toml | 4 + .devcontainer/Dockerfile | 28 +++++++ .devcontainer/devcontainer.json | 33 ++++++++ .github/workflows/build.yaml | 52 +++++++++++- CMakeLists.txt | 23 ++++- Cargo.lock | 10 ++- Cargo.toml | 5 +- build.rs | 19 +++-- crates/fabric/ext/src/lib.rs | 20 ++--- crates/fabric/pal/Cargo.toml | 19 +++++ crates/fabric/pal/src/lib.rs | 2 + crates/fabric/pal/src/pal.rs | 83 +++++++++++++++++++ crates/samples/echomain/src/app.rs | 14 ++-- crates/samples/echomain/src/app/echo.rs | 8 +- crates/samples/echomain/src/main.rs | 11 +-- docs/development.md | 10 ++- .../FabricCommon/FabricClient/mod.rs | 16 ++-- .../FabricCommon/FabricRuntime/mod.rs | 40 ++++----- .../FabricCommon/FabricTransport/mod.rs | 4 +- 19 files changed, 321 insertions(+), 80 deletions(-) create mode 100644 .cargo/config.toml create mode 100644 .devcontainer/Dockerfile create mode 100644 .devcontainer/devcontainer.json create mode 100644 crates/fabric/pal/Cargo.toml create mode 100644 crates/fabric/pal/src/lib.rs create mode 100644 crates/fabric/pal/src/pal.rs diff --git a/.cargo/config.toml b/.cargo/config.toml new file mode 100644 index 00000000..9a552b15 --- /dev/null +++ b/.cargo/config.toml @@ -0,0 +1,4 @@ +[target.x86_64-unknown-linux-gnu] +rustflags = [ + "-C", "link-arg=-fuse-ld=lld", +] \ No newline at end of file diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 00000000..32bc0301 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,28 @@ +FROM ubuntu:20.04 + +RUN apt-get update && apt-get upgrade + +# install sf +RUN apt-get install apt-transport-https curl lsb-release wget gnupg2 software-properties-common debconf-utils -y + +RUN wget -q https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/packages-microsoft-prod.deb \ + && dpkg -i packages-microsoft-prod.deb \ + && curl -fsSL https://packages.microsoft.com/keys/msopentech.asc | apt-key add - \ + && curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - \ + && add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" \ + && apt-get update + +RUN echo "servicefabric servicefabric/accepted-eula-ga select true" | debconf-set-selections \ + && echo "servicefabricsdkcommon servicefabricsdkcommon/accepted-eula-ga select true" | debconf-set-selections \ + && apt-get install servicefabricsdkcommon -y + +# install rust +RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > ./rustup.sh +RUN chmod u+x ./rustup.sh && ./rustup.sh -y + +# more tools +RUN apt-get install cmake git -y +RUN apt-get install clang lld -y + +# expose sf shared libs +ENV LD_LIBRARY_PATH "$LD_LIBRARY_PATH:/opt/microsoft/servicefabric/bin/Fabric/Fabric.Code:/workspaces/service-fabric-rs/bintemp" \ No newline at end of file diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 00000000..e590ab77 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,33 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/cpp +{ + "name": "C++", + "build": { + "dockerfile": "Dockerfile" + }, + + // "image" : "fabric-metadata:v1", + + // Features to add to the dev container. More info: https://containers.dev/features. + // "features": {}, + + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], + + // Use 'postCreateCommand' to run commands after the container is created. + // "postCreateCommand": "gcc -v", + + // Configure tool-specific properties. + // "customizations": {}, + + "customizations": { + "vscode": { + "extensions": [ + "ms-vscode.cpptools-extension-pack", + "rust-lang.rust-analyzer"] + } + } + + // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. + // "remoteUser": "root" +} diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 3d5d3e04..b525e343 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -10,7 +10,7 @@ jobs: BUILD_TYPE: ["Debug"] os: [ windows-latest ] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Get MSVC uses: ilammy/msvc-dev-cmd@v1 @@ -46,4 +46,52 @@ jobs: run: Powershell.exe -File .\build\_deps\service_fabric_cpp-src\scripts\check_cluster_online.ps1 - name: run echo example app - run: Powershell.exe -File .\tests\echo_script_test.ps1 \ No newline at end of file + run: Powershell.exe -File .\tests\echo_script_test.ps1 + + build-linux: + runs-on: ${{ matrix.os }} + strategy: + matrix: + BUILD_TYPE: ["Debug"] + os: [ ubuntu-20.04 ] + steps: + - uses: actions/checkout@v4 + - name: apt-get + run: sudo apt-get update && sudo apt-get install apt-transport-https curl lsb-release wget gnupg2 software-properties-common debconf-utils clang lld -y + + - name: install sf + run: | + wget -q https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/packages-microsoft-prod.deb; + sudo dpkg -i packages-microsoft-prod.deb; + curl -fsSL https://packages.microsoft.com/keys/msopentech.asc | sudo apt-key add - ; + curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - ; + sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" ; + sudo apt-get update; + echo "servicefabric servicefabric/accepted-eula-ga select true" | sudo debconf-set-selections ; + echo "servicefabricsdkcommon servicefabricsdkcommon/accepted-eula-ga select true" | sudo debconf-set-selections ; + sudo apt-get install servicefabricsdkcommon -y + + - name: Get specific version CMake, v3.21.2 + uses: lukka/get-cmake@v3.21.2 + + - name: Install rust stable + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + + - name: run cmake + run: > + cmake . -DCMAKE_BUILD_TYPE=${{ matrix.BUILD_TYPE }} -B build + - name: run build + run: cmake --build build --config ${{ matrix.BUILD_TYPE }} + + + # - uses: actions/checkout@v2 + + # - name: apt-get + # run: sudo apt-get install apt-transport-https curl lsb-release wget gnupg2 software-properties-common debconf-utils -y + + # - name: Install rust stable + # uses: actions-rs/toolchain@v1 + # with: + # toolchain: stable \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index 1a732b64..3afb9c8a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,7 +30,7 @@ endif() # generate rust code find_program ( cargo_exe - NAMES cargo.exe + NAMES cargo.exe cargo REQUIRED ) @@ -48,7 +48,7 @@ add_custom_target(build_rust add_custom_target(build_rust_sample_client ALL COMMAND ${cargo_exe} build -p samples_client WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - DEPENDS generate_import_libs + #DEPENDS generate_import_libs ) add_custom_target(run_rust_sample_client @@ -65,12 +65,27 @@ add_custom_target(force_clean add_custom_target(build_rust_sample_echomain ALL COMMAND ${cargo_exe} build -p samples_echomain WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - DEPENDS generate_import_libs + DEPENDS build_fabric_rust_pal +) + +add_custom_target(build_fabric_rust_pal ALL + COMMAND ${cargo_exe} build -p pal + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} ) set(_pkg_root ${CMAKE_BINARY_DIR}/echoapp_root) set(_pkg_src ${CMAKE_CURRENT_SOURCE_DIR}/crates/samples/echomain) -set(_pkg_exe ${CMAKE_CURRENT_SOURCE_DIR}/target/debug/samples_echomain.exe) +if(WIN32) + set(_pkg_exe ${CMAKE_CURRENT_SOURCE_DIR}/target/debug/samples_echomain.exe) +else() + set(_pkg_exe ${CMAKE_CURRENT_SOURCE_DIR}/target/debug/samples_echomain) + set(_pal_so ${CMAKE_CURRENT_SOURCE_DIR}/target/debug/libfabric_rust_pal.so) + add_custom_command(TARGET build_rust_sample_echomain POST_BUILD + COMMAND ${CMAKE_COMMAND} -E make_directory ${_pkg_root} + COMMAND ${CMAKE_COMMAND} + -E copy_if_different ${_pal_so} ${_pkg_root}/EchoAppServicePackage/Code/libfabric_rust_pal.so + ) +endif(WIN32) add_custom_command(TARGET build_rust_sample_echomain POST_BUILD COMMAND ${CMAKE_COMMAND} -E make_directory ${_pkg_root} COMMAND ${CMAKE_COMMAND} diff --git a/Cargo.lock b/Cargo.lock index f9742d59..b0d4e1dd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -111,7 +111,7 @@ dependencies = [ [[package]] name = "fabric-metadata" version = "0.1.0" -source = "git+https://github.com/youyuanwu/fabric-metadata.git?rev=9d62ca15573a0716fb9828dce03a489ae4b8a4a7#9d62ca15573a0716fb9828dce03a489ae4b8a4a7" +source = "git+https://github.com/youyuanwu/fabric-metadata.git?rev=2e6a471c7752148c4dc8d0968c0f1161c2a6c76a#2e6a471c7752148c4dc8d0968c0f1161c2a6c76a" [[package]] name = "fabric_ext" @@ -215,6 +215,13 @@ dependencies = [ "libc", ] +[[package]] +name = "pal" +version = "0.1.0" +dependencies = [ + "windows", +] + [[package]] name = "parking_lot" version = "0.12.1" @@ -355,6 +362,7 @@ name = "service-fabric-rs" version = "0.0.2" dependencies = [ "fabric-metadata", + "pal", "windows", "windows-core", ] diff --git a/Cargo.toml b/Cargo.toml index 43f9adaf..f76177c0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,11 +18,12 @@ members = [ ] [package.metadata.docs.rs] -default-target = "x86_64-pc-windows-msvc" +# default-target = "x86_64-pc-windows-msvc" targets = [] [dependencies] -fabric-metadata = { git = "https://github.com/youyuanwu/fabric-metadata.git", rev = "9d62ca15573a0716fb9828dce03a489ae4b8a4a7"} +fabric-metadata = { git = "https://github.com/youyuanwu/fabric-metadata.git", rev = "2e6a471c7752148c4dc8d0968c0f1161c2a6c76a"} +pal = { path = "./crates/fabric/pal" } windows-core = "0.51" [dependencies.windows] diff --git a/build.rs b/build.rs index 167254b4..7eefd534 100644 --- a/build.rs +++ b/build.rs @@ -1,12 +1,13 @@ -//use std::{path::Path, env}; +use std::path::Path; fn main() { - // add link dir for fabric support libs. This is propagated to downstream targets - // let dir = String::from("build\\_deps\\fabric_metadata-build\\src"); - // let package_root = env::var("CARGO_MANIFEST_DIR").unwrap(); - // let abs_dir = package_root + &dir; - // println!( - // "cargo:rustc-link-search=native={}", - // Path::new(&abs_dir).display() - // ); + if cfg!(unix) { + // Add link dir for fabric libs on linux. + let dir = String::from("/opt/microsoft/servicefabric/bin/Fabric/Fabric.Code/"); + println!("cargo:rustc-link-search={}", Path::new(&dir).display()); + + // On linux, for windows-rs to work we need have a pal shared lib. + // No need to have search dir since it is in the target dir + println!("cargo:rustc-link-lib=dylib=fabric_rust_pal"); + } } diff --git a/crates/fabric/ext/src/lib.rs b/crates/fabric/ext/src/lib.rs index 6e4ba3ac..6700eb61 100644 --- a/crates/fabric/ext/src/lib.rs +++ b/crates/fabric/ext/src/lib.rs @@ -8,11 +8,8 @@ pub mod fasync; -use std::os::windows::prelude::OsStrExt; -use std::{ - ffi::OsString, - sync::{Arc, Condvar, Mutex}, -}; +//use std::os::windows::prelude::OsStrExt; +use std::sync::{Arc, Condvar, Mutex}; use log::info; use service_fabric_rs::FabricCommon::{ @@ -21,7 +18,7 @@ use service_fabric_rs::FabricCommon::{ IFabricAsyncOperationContext_Impl, IFabricStringResult, IFabricStringResult_Impl, }; use windows::core::implement; -use windows_core::PCWSTR; +use windows_core::{HSTRING, PCWSTR}; // Interface for waitable async callback. // This is a common use case to combine fabric Begin* and End* apis. @@ -144,13 +141,10 @@ pub struct StringResult { } impl StringResult { - pub fn new(data: OsString) -> StringResult { - let data_vec = data - .as_os_str() - .encode_wide() - .chain(Some(0)) - .collect::>(); - let ret = StringResult { vec_: data_vec }; + pub fn new(data: HSTRING) -> StringResult { + let ret = StringResult { + vec_: data.as_wide().to_vec(), + }; return ret; } } diff --git a/crates/fabric/pal/Cargo.toml b/crates/fabric/pal/Cargo.toml new file mode 100644 index 00000000..a8d37207 --- /dev/null +++ b/crates/fabric/pal/Cargo.toml @@ -0,0 +1,19 @@ +[package] +name = "pal" +version = "0.1.0" +edition = "2021" + + +[lib] +name = "fabric_rust_pal" +path = "src/lib.rs" +crate-type = ["cdylib"] + + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies.windows] +version = "0.51" +features = [ + "Win32_Foundation" +] diff --git a/crates/fabric/pal/src/lib.rs b/crates/fabric/pal/src/lib.rs new file mode 100644 index 00000000..aafae37c --- /dev/null +++ b/crates/fabric/pal/src/lib.rs @@ -0,0 +1,2 @@ +#[cfg(unix)] +pub mod pal; diff --git a/crates/fabric/pal/src/pal.rs b/crates/fabric/pal/src/pal.rs new file mode 100644 index 00000000..8b91dce5 --- /dev/null +++ b/crates/fabric/pal/src/pal.rs @@ -0,0 +1,83 @@ +#[allow(non_camel_case_types, non_snake_case, dead_code)] +use std::ffi::c_void; + +use windows::core::imp::LOAD_LIBRARY_FLAGS; +use windows::{ + core::{HRESULT, PCSTR, PWSTR}, + Win32::Foundation::{HANDLE, HMODULE}, +}; + +#[no_mangle] +pub unsafe extern "system" fn GetLastError() -> u32 { + 0 +} + +#[no_mangle] +pub unsafe extern "system" fn GetProcessHeap() -> isize { + 0 +} + +#[no_mangle] +pub unsafe extern "system" fn HeapAlloc(_heap: isize, _flags: u32, _len: usize) -> *mut c_void { + std::ptr::null_mut() +} + +#[no_mangle] +pub unsafe extern "system" fn HeapFree(_heap: isize, _flags: u32, _ptr: *const c_void) -> i32 { + 0 +} + +#[no_mangle] +pub unsafe extern "system" fn GetErrorInfo(_reserved: u32, _info: *mut *mut c_void) -> HRESULT { + HRESULT(0) +} + +#[no_mangle] +pub unsafe extern "system" fn SetErrorInfo(_reserved: u32, _info: *const c_void) -> HRESULT { + HRESULT(0) +} + +#[no_mangle] +pub unsafe extern "system" fn LoadLibraryA(_name: PCSTR) -> isize { + 0 +} + +#[no_mangle] +pub unsafe extern "system" fn LoadLibraryExA( + _lplibfilename: PCSTR, + _hfile: HANDLE, + _dwflags: LOAD_LIBRARY_FLAGS, +) -> HMODULE { + windows::Win32::Foundation::HMODULE(0) +} + +#[no_mangle] +pub unsafe extern "system" fn FreeLibrary(_library: isize) -> i32 { + 0 +} + +#[no_mangle] +pub unsafe extern "system" fn GetProcAddress(_library: isize, _name: PCSTR) -> *const c_void { + std::ptr::null() +} + +#[no_mangle] +pub unsafe extern "system" fn SysFreeString(_bstr: *const u16) {} + +#[no_mangle] +pub unsafe extern "system" fn SysStringLen(_bstr: *const u16) -> u32 { + 0 +} + +#[no_mangle] +pub unsafe extern "system" fn FormatMessageW( + _flags: u32, + _source: *const c_void, + _code: u32, + _lang: u32, + _buffer: PWSTR, + _len: u32, + _args: *const *const i8, +) -> u32 { + 0 +} diff --git a/crates/samples/echomain/src/app.rs b/crates/samples/echomain/src/app.rs index bcd7d93f..9253b221 100644 --- a/crates/samples/echomain/src/app.rs +++ b/crates/samples/echomain/src/app.rs @@ -1,5 +1,4 @@ use std::cell::Cell; -use std::ffi::OsString; use std::io::Error; use std::thread::JoinHandle; use std::{convert::TryInto, ptr::null}; @@ -19,10 +18,11 @@ use service_fabric_rs::FabricCommon::{IFabricAsyncOperationContext, IFabricStrin use tokio::sync::oneshot::{self, Sender}; use windows::core::implement; use windows::core::w; +use windows_core::HSTRING; mod echo; -pub fn run(runtime: &IFabricRuntime, port: u32, hostname: OsString) { +pub fn run(runtime: &IFabricRuntime, port: u32, hostname: HSTRING) { info!("port: {}, host: {:?}", port, hostname); let factory: IFabricStatelessServiceFactory = ServiceFactory::new(port, hostname).into(); @@ -35,11 +35,11 @@ pub fn run(runtime: &IFabricRuntime, port: u32, hostname: OsString) { #[implement(IFabricStatelessServiceFactory)] pub struct ServiceFactory { port_: u32, - hostname_: OsString, + hostname_: HSTRING, } impl ServiceFactory { - pub fn new(port: u32, hostname: OsString) -> ServiceFactory { + pub fn new(port: u32, hostname: HSTRING) -> ServiceFactory { ServiceFactory { port_: port, hostname_: hostname, @@ -86,13 +86,13 @@ impl IFabricStatelessServiceFactory_Impl for ServiceFactory { pub struct AppInstance { port_: u32, - hostname_: OsString, + hostname_: HSTRING, tx_: Cell>>, // hack to use this mutably th_: Cell>>>, } impl AppInstance { - pub fn new(port: u32, hostname: OsString) -> AppInstance { + pub fn new(port: u32, hostname: HSTRING) -> AppInstance { return AppInstance { port_: port, hostname_: hostname, @@ -155,7 +155,7 @@ impl IFabricStatelessServiceInstance_Impl for AppInstance { let addr = echo::get_addr(self.port_, self.hostname_.clone()); - let str_res: IFabricStringResult = StringResult::new(OsString::from(addr)).into(); + let str_res: IFabricStringResult = StringResult::new(HSTRING::from(addr)).into(); Ok(str_res) } diff --git a/crates/samples/echomain/src/app/echo.rs b/crates/samples/echomain/src/app/echo.rs index a73e1f6b..4d13d854 100644 --- a/crates/samples/echomain/src/app/echo.rs +++ b/crates/samples/echomain/src/app/echo.rs @@ -6,17 +6,17 @@ // echo server impl using tokio -use std::ffi::OsString; use std::io::Error; use log::info; use tokio::io::{AsyncReadExt, AsyncWriteExt}; use tokio::net::TcpListener; use tokio::sync::oneshot::Receiver; +use windows::core::HSTRING; -pub fn get_addr(port: u32, hostname: OsString) -> String { +pub fn get_addr(port: u32, hostname: HSTRING) -> String { let mut addr = String::new(); - addr.push_str(hostname.to_str().expect("cannot convert hostname")); + addr.push_str(&hostname.to_string()); addr.push(':'); addr.push_str(&port.to_string()); return addr; @@ -59,7 +59,7 @@ async fn echo_loop(listener: TcpListener) -> Result<(), Error> { } #[tokio::main()] -pub async fn start_echo(rx: Receiver<()>, port: u32, hostname: OsString) -> Result<(), Error> { +pub async fn start_echo(rx: Receiver<()>, port: u32, hostname: HSTRING) -> Result<(), Error> { let addr = get_addr(port, hostname); let listener = TcpListener::bind(&addr).await?; diff --git a/crates/samples/echomain/src/main.rs b/crates/samples/echomain/src/main.rs index 237c482d..3c07c933 100644 --- a/crates/samples/echomain/src/main.rs +++ b/crates/samples/echomain/src/main.rs @@ -4,9 +4,6 @@ // license information. // ------------------------------------------------------------ -use std::ffi::OsString; -use std::os::windows::prelude::OsStringExt; - use ctrlc; use fabric_ext::{IFabricWaitableCallback, WaitableCallback}; use log::info; @@ -18,7 +15,7 @@ use service_fabric_rs::FabricCommon::FabricRuntime::{ use service_fabric_rs::FabricCommon::IFabricAsyncOperationCallback; use std::sync::mpsc::channel; use windows::core::w; -use windows::core::{Interface, PCWSTR}; +use windows::core::{Interface, HSTRING}; use windows_core::ComInterface; pub mod app; @@ -71,7 +68,7 @@ fn get_port(activation_ctx: &IFabricCodePackageActivationContext) -> u32 { return unsafe { (*endpoint).Port }; } -fn get_hostname() -> OsString { +fn get_hostname() -> HSTRING { // let result = String::from_utf16_lossy(std::slice::from_raw_parts( let callback: IFabricWaitableCallback = WaitableCallback::new().into(); @@ -88,9 +85,9 @@ fn get_hostname() -> OsString { let node_ctx = unsafe { result.get_NodeContext() }; - let hostname_raw: PCWSTR = unsafe { (*node_ctx).IPAddressOrFQDN }; + let hostname_raw = unsafe { (*node_ctx).IPAddressOrFQDN }; - let ret = OsString::from_wide(unsafe { hostname_raw.as_wide() }); + let ret = HSTRING::from_wide(unsafe { hostname_raw.as_wide() }).expect("hstring"); info!("got hostname: {:?}", ret); return ret; } diff --git a/docs/development.md b/docs/development.md index e6e9a4c8..5eb183e8 100644 --- a/docs/development.md +++ b/docs/development.md @@ -1,4 +1,12 @@ * MISC ``` .\build\_deps\service_fabric_cpp-src\scripts\echomain_ctl.ps1 -Action Add -``` \ No newline at end of file +``` + +* Linux +Use vscode dev container. It has all deps installed. + +* Notes + * gcc ld linker has problems with SF .so so we use lld from clang which is configured in .cargo config. + * fabric_pal.so is needed to be able to provide windows C functions needed by windows-rs. Code is checked-in in /bintemp folder. + diff --git a/src/Microsoft/ServiceFabric/FabricCommon/FabricClient/mod.rs b/src/Microsoft/ServiceFabric/FabricCommon/FabricClient/mod.rs index 63245c19..0d6f42c6 100644 --- a/src/Microsoft/ServiceFabric/FabricCommon/FabricClient/mod.rs +++ b/src/Microsoft/ServiceFabric/FabricCommon/FabricClient/mod.rs @@ -4,7 +4,7 @@ pub unsafe fn FabricCreateClient( connectionstrings: &[::windows_core::PCWSTR], iid: *const ::windows_core::GUID, ) -> ::windows_core::Result<*mut ::core::ffi::c_void> { - #[link(name = "fabricclient")] + #[link(name = "FabricClient")] extern "system" { pub fn FabricCreateClient( connectionstringssize: u16, @@ -32,7 +32,7 @@ pub unsafe fn FabricCreateClient2( where P0: ::windows_core::IntoParam, { - #[link(name = "fabricclient")] + #[link(name = "FabricClient")] extern "system" { pub fn FabricCreateClient2( connectionstringssize: u16, @@ -64,7 +64,7 @@ where P0: ::windows_core::IntoParam, P1: ::windows_core::IntoParam, { - #[link(name = "fabricclient")] + #[link(name = "FabricClient")] extern "system" { pub fn FabricCreateClient3( connectionstringssize: u16, @@ -91,7 +91,7 @@ where pub unsafe fn FabricCreateLocalClient( iid: *const ::windows_core::GUID, ) -> ::windows_core::Result<*mut ::core::ffi::c_void> { - #[link(name = "fabricclient")] + #[link(name = "FabricClient")] extern "system" { pub fn FabricCreateLocalClient( iid: *const ::windows_core::GUID, @@ -110,7 +110,7 @@ pub unsafe fn FabricCreateLocalClient2( where P0: ::windows_core::IntoParam, { - #[link(name = "fabricclient")] + #[link(name = "FabricClient")] extern "system" { pub fn FabricCreateLocalClient2( __midl__fabricclientmodule0001: *mut ::core::ffi::c_void, @@ -137,7 +137,7 @@ where P0: ::windows_core::IntoParam, P1: ::windows_core::IntoParam, { - #[link(name = "fabricclient")] + #[link(name = "FabricClient")] extern "system" { pub fn FabricCreateLocalClient3( __midl__fabricclientmodule0004: *mut ::core::ffi::c_void, @@ -167,7 +167,7 @@ where P0: ::windows_core::IntoParam, P1: ::windows_core::IntoParam, { - #[link(name = "fabricclient")] + #[link(name = "FabricClient")] extern "system" { pub fn FabricCreateLocalClient4( __midl__fabricclientmodule0006: *mut ::core::ffi::c_void, @@ -191,7 +191,7 @@ where #[inline] pub unsafe fn FabricGetDefaultRollingUpgradeMonitoringPolicy( ) -> ::windows_core::Result { - #[link(name = "fabricclient")] + #[link(name = "FabricClient")] extern "system" { pub fn FabricGetDefaultRollingUpgradeMonitoringPolicy( result: *mut *mut ::core::ffi::c_void, diff --git a/src/Microsoft/ServiceFabric/FabricCommon/FabricRuntime/mod.rs b/src/Microsoft/ServiceFabric/FabricCommon/FabricRuntime/mod.rs index 0ef8f9b2..a0e88497 100644 --- a/src/Microsoft/ServiceFabric/FabricCommon/FabricRuntime/mod.rs +++ b/src/Microsoft/ServiceFabric/FabricCommon/FabricRuntime/mod.rs @@ -10,7 +10,7 @@ where P0: ::windows_core::IntoParam, P1: ::windows_core::IntoParam, { - #[link(name = "fabricruntime")] + #[link(name = "FabricRuntime")] extern "system" { pub fn FabricBeginCreateRuntime( riid: *const ::windows_core::GUID, @@ -40,7 +40,7 @@ pub unsafe fn FabricBeginGetActivationContext( where P0: ::windows_core::IntoParam, { - #[link(name = "fabricruntime")] + #[link(name = "FabricRuntime")] extern "system" { pub fn FabricBeginGetActivationContext( riid: *const ::windows_core::GUID, @@ -68,7 +68,7 @@ pub unsafe fn FabricBeginGetCodePackageActivator( where P0: ::windows_core::IntoParam, { - #[link(name = "fabricruntime")] + #[link(name = "FabricRuntime")] extern "system" { pub fn FabricBeginGetCodePackageActivator( riid: *const ::windows_core::GUID, @@ -95,7 +95,7 @@ pub unsafe fn FabricBeginGetNodeContext( where P0: ::windows_core::IntoParam, { - #[link(name = "fabricruntime")] + #[link(name = "FabricRuntime")] extern "system" { pub fn FabricBeginGetNodeContext( timeoutmilliseconds: u32, @@ -128,7 +128,7 @@ where P0: ::windows_core::IntoParam<::windows_core::PCWSTR>, P1: ::windows_core::IntoParam, { - #[link(name = "fabricruntime")] + #[link(name = "FabricRuntime")] extern "system" { pub fn FabricCreateKeyValueStoreReplica( riid: *const ::windows_core::GUID, @@ -176,7 +176,7 @@ where P1: ::windows_core::IntoParam, P2: ::windows_core::IntoParam, { - #[link(name = "fabricruntime")] + #[link(name = "FabricRuntime")] extern "system" { pub fn FabricCreateKeyValueStoreReplica2( riid: *const ::windows_core::GUID, @@ -228,7 +228,7 @@ where P1: ::windows_core::IntoParam, P2: ::windows_core::IntoParam, { - #[link(name = "fabricruntime")] + #[link(name = "FabricRuntime")] extern "system" { pub fn FabricCreateKeyValueStoreReplica3( riid: *const ::windows_core::GUID, @@ -281,7 +281,7 @@ where P1: ::windows_core::IntoParam, P2: ::windows_core::IntoParam, { - #[link(name = "fabricruntime")] + #[link(name = "FabricRuntime")] extern "system" { pub fn FabricCreateKeyValueStoreReplica4( riid: *const ::windows_core::GUID, @@ -336,7 +336,7 @@ where P1: ::windows_core::IntoParam, P2: ::windows_core::IntoParam, { - #[link(name = "fabricruntime")] + #[link(name = "FabricRuntime")] extern "system" { pub fn FabricCreateKeyValueStoreReplica5( riid: *const ::windows_core::GUID, @@ -375,7 +375,7 @@ where pub unsafe fn FabricCreateRuntime( riid: *const ::windows_core::GUID, ) -> ::windows_core::Result<*mut ::core::ffi::c_void> { - #[link(name = "fabricruntime")] + #[link(name = "FabricRuntime")] extern "system" { pub fn FabricCreateRuntime( riid: *const ::windows_core::GUID, @@ -393,7 +393,7 @@ pub unsafe fn FabricEndCreateRuntime( where P0: ::windows_core::IntoParam, { - #[link(name = "fabricruntime")] + #[link(name = "FabricRuntime")] extern "system" { pub fn FabricEndCreateRuntime( context: *mut ::core::ffi::c_void, @@ -411,7 +411,7 @@ pub unsafe fn FabricEndGetActivationContext( where P0: ::windows_core::IntoParam, { - #[link(name = "fabricruntime")] + #[link(name = "FabricRuntime")] extern "system" { pub fn FabricEndGetActivationContext( context: *mut ::core::ffi::c_void, @@ -429,7 +429,7 @@ pub unsafe fn FabricEndGetCodePackageActivator( where P0: ::windows_core::IntoParam, { - #[link(name = "fabricruntime")] + #[link(name = "FabricRuntime")] extern "system" { pub fn FabricEndGetCodePackageActivator( context: *mut ::core::ffi::c_void, @@ -447,7 +447,7 @@ pub unsafe fn FabricEndGetNodeContext( where P0: ::windows_core::IntoParam, { - #[link(name = "fabricruntime")] + #[link(name = "FabricRuntime")] extern "system" { pub fn FabricEndGetNodeContext( context: *mut ::core::ffi::c_void, @@ -462,7 +462,7 @@ where pub unsafe fn FabricGetActivationContext( riid: *const ::windows_core::GUID, ) -> ::windows_core::Result<*mut ::core::ffi::c_void> { - #[link(name = "fabricruntime")] + #[link(name = "FabricRuntime")] extern "system" { pub fn FabricGetActivationContext( riid: *const ::windows_core::GUID, @@ -477,7 +477,7 @@ pub unsafe fn FabricGetActivationContext( pub unsafe fn FabricGetCodePackageActivator( riid: *const ::windows_core::GUID, ) -> ::windows_core::Result<*mut ::core::ffi::c_void> { - #[link(name = "fabricruntime")] + #[link(name = "FabricRuntime")] extern "system" { pub fn FabricGetCodePackageActivator( riid: *const ::windows_core::GUID, @@ -490,7 +490,7 @@ pub unsafe fn FabricGetCodePackageActivator( #[doc = "*Required features: `\"ServiceFabric_FabricCommon_FabricRuntime\"`*"] #[inline] pub unsafe fn FabricGetNodeContext() -> ::windows_core::Result<*mut ::core::ffi::c_void> { - #[link(name = "fabricruntime")] + #[link(name = "FabricRuntime")] extern "system" { pub fn FabricGetNodeContext( nodecontext: *mut *mut ::core::ffi::c_void, @@ -511,7 +511,7 @@ where P1: ::windows_core::IntoParam<::windows_core::PCWSTR>, P2: ::windows_core::IntoParam<::windows_core::PCWSTR>, { - #[link(name = "fabricruntime")] + #[link(name = "FabricRuntime")] extern "system" { pub fn FabricLoadEseLocalStoreSettings( codepackageactivationcontext: *mut ::core::ffi::c_void, @@ -541,7 +541,7 @@ where P1: ::windows_core::IntoParam<::windows_core::PCWSTR>, P2: ::windows_core::IntoParam<::windows_core::PCWSTR>, { - #[link(name = "fabricruntime")] + #[link(name = "FabricRuntime")] extern "system" { pub fn FabricLoadReplicatorSettings( codepackageactivationcontext: *mut ::core::ffi::c_void, @@ -571,7 +571,7 @@ where P1: ::windows_core::IntoParam<::windows_core::PCWSTR>, P2: ::windows_core::IntoParam<::windows_core::PCWSTR>, { - #[link(name = "fabricruntime")] + #[link(name = "FabricRuntime")] extern "system" { pub fn FabricLoadSecurityCredentials( codepackageactivationcontext: *mut ::core::ffi::c_void, diff --git a/src/Microsoft/ServiceFabric/FabricCommon/FabricTransport/mod.rs b/src/Microsoft/ServiceFabric/FabricCommon/FabricTransport/mod.rs index 0c0e7c0a..19c640f3 100644 --- a/src/Microsoft/ServiceFabric/FabricCommon/FabricTransport/mod.rs +++ b/src/Microsoft/ServiceFabric/FabricCommon/FabricTransport/mod.rs @@ -14,7 +14,7 @@ where P2: ::windows_core::IntoParam, P3: ::windows_core::IntoParam, { - #[link(name = "fabrictransport")] + #[link(name = "FabricTransport")] extern "system" { pub fn CreateFabricTransportClient( interfaceid: *const ::windows_core::GUID, @@ -53,7 +53,7 @@ where P1: ::windows_core::IntoParam, P2: ::windows_core::IntoParam, { - #[link(name = "fabrictransport")] + #[link(name = "FabricTransport")] extern "system" { pub fn CreateFabricTransportListener( interfaceid: *const ::windows_core::GUID,