Remove windows-sys dependency and code cleanup
This affects the source code only, output binary hashes remain the same.
This commit is contained in:
parent
6d7c85fb2c
commit
044af0e99d
71
Cargo.lock
generated
71
Cargo.lock
generated
@ -4,73 +4,4 @@ version = 3
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "shook"
|
name = "shook"
|
||||||
version = "0.1.0"
|
version = "0.1.1"
|
||||||
dependencies = [
|
|
||||||
"windows-sys",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "windows-sys"
|
|
||||||
version = "0.52.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d"
|
|
||||||
dependencies = [
|
|
||||||
"windows-targets",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "windows-targets"
|
|
||||||
version = "0.52.4"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b"
|
|
||||||
dependencies = [
|
|
||||||
"windows_aarch64_gnullvm",
|
|
||||||
"windows_aarch64_msvc",
|
|
||||||
"windows_i686_gnu",
|
|
||||||
"windows_i686_msvc",
|
|
||||||
"windows_x86_64_gnu",
|
|
||||||
"windows_x86_64_gnullvm",
|
|
||||||
"windows_x86_64_msvc",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "windows_aarch64_gnullvm"
|
|
||||||
version = "0.52.4"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9"
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "windows_aarch64_msvc"
|
|
||||||
version = "0.52.4"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675"
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "windows_i686_gnu"
|
|
||||||
version = "0.52.4"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3"
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "windows_i686_msvc"
|
|
||||||
version = "0.52.4"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02"
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "windows_x86_64_gnu"
|
|
||||||
version = "0.52.4"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03"
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "windows_x86_64_gnullvm"
|
|
||||||
version = "0.52.4"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177"
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "windows_x86_64_msvc"
|
|
||||||
version = "0.52.4"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8"
|
|
||||||
|
24
Cargo.toml
24
Cargo.toml
@ -1,21 +1,27 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "shook"
|
|
||||||
version = "0.1.0"
|
|
||||||
description = "A rust implementation of ohook"
|
|
||||||
repository = "https://github.com/massgravel/ohook-rs"
|
|
||||||
license = "MIT"
|
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
rust-version = "1.77.1"
|
rust-version = "1.77.1"
|
||||||
|
name = "shook"
|
||||||
|
version = "0.1.1"
|
||||||
|
description = "A rust implementation of ohook"
|
||||||
|
keywords = [
|
||||||
|
"activator",
|
||||||
|
"office",
|
||||||
|
"ohook",
|
||||||
|
]
|
||||||
|
categories = [
|
||||||
|
"no-std",
|
||||||
|
"no-std::no-alloc",
|
||||||
|
]
|
||||||
|
license = "MIT"
|
||||||
|
repository = "https://github.com/massgravel/ohook-rs"
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
crate-type = ["cdylib"]
|
crate-type = ["cdylib"]
|
||||||
|
|
||||||
[dependencies]
|
|
||||||
windows-sys = "0.52"
|
|
||||||
|
|
||||||
[profile.dev]
|
[profile.dev]
|
||||||
lto = true
|
|
||||||
opt-level = 1
|
opt-level = 1
|
||||||
|
lto = true
|
||||||
panic = "abort"
|
panic = "abort"
|
||||||
|
|
||||||
[profile.release]
|
[profile.release]
|
||||||
|
36
LICENSE
36
LICENSE
@ -1,18 +1,18 @@
|
|||||||
Copyright 2023-2024 asdcorp, Microsoft Corporation
|
Copyright 2023-2024 asdcorp, Microsoft Corporation
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
this software and associated documentation files (the “Software”), to deal in
|
this software and associated documentation files (the “Software”), to deal in
|
||||||
the Software without restriction, including without limitation the rights to
|
the Software without restriction, including without limitation the rights to
|
||||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||||
the Software, and to permit persons to whom the Software is furnished to do so,
|
the Software, and to permit persons to whom the Software is furnished to do so,
|
||||||
subject to the following conditions:
|
subject to the following conditions:
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
The above copyright notice and this permission notice shall be included in all
|
||||||
copies or substantial portions of the Software.
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
20
README.md
20
README.md
@ -1,10 +1,10 @@
|
|||||||
# ohook.rs
|
# ohook.rs
|
||||||
|
|
||||||
A rewrite of [ohook](https://github.com/asdcorp/ohook) in Rust for decreased size, easier building, and better reproducibility. For more information on ohook check the original repo.
|
A rewrite of [ohook](https://github.com/asdcorp/ohook) in Rust for decreased size, easier building, and better reproducibility. For more information on ohook check the original repo.
|
||||||
|
|
||||||
## Building
|
## Building
|
||||||
Rust 1.77.1 and [Visual Studio Build Tools 2022 LTSC 17.6](https://download.visualstudio.microsoft.com/download/pr/a851fc84-7739-4b67-a7da-2c8564e30b38/b4133f16d790c3ee7325fff80c47094d94dff44b426b86db9013b200bb669ce2/vs_BuildTools.exe) running on Windows is required if you want to build binaries bit-for-bit identical to the release. To build x64, run `cargo build --release`, and for x86 run `cargo build --release --target i686-pc-windows-msvc`.
|
Rust 1.77.1 and [Visual Studio Build Tools 2022 LTSC 17.6](https://download.visualstudio.microsoft.com/download/pr/a851fc84-7739-4b67-a7da-2c8564e30b38/b4133f16d790c3ee7325fff80c47094d94dff44b426b86db9013b200bb669ce2/vs_BuildTools.exe) running on Windows is required if you want to build binaries bit-for-bit identical to the release. To build x64, run `cargo build --release`, and for x86 run `cargo build --release --target i686-pc-windows-msvc`.
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
The project is licensed under the terms of the MIT License.
|
The project is licensed under the terms of the MIT License.
|
||||||
|
30
src/lib.rs
30
src/lib.rs
@ -4,46 +4,46 @@ mod sppcs;
|
|||||||
mod win32;
|
mod win32;
|
||||||
|
|
||||||
use core::{ffi::c_void, ptr::null_mut};
|
use core::{ffi::c_void, ptr::null_mut};
|
||||||
use win32::{LocalFree, StrStrNIW, SL_LICENSING_STATUS};
|
use win32::{
|
||||||
use win32::{SLGetLicensingStatusInformation, SLGetProductSkuInformation};
|
Guid, LocalFree, SLGetLicensingStatusInformation, SLGetProductSkuInformation, StrStrNIW,
|
||||||
|
SL_LICENSING_STATUS,
|
||||||
use windows_sys::{
|
|
||||||
core::{GUID, PCWSTR},
|
|
||||||
w,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
unsafe fn is_grace_period_product(hslc: *const c_void, pproductskuid: *const GUID) -> bool {
|
const GRACE: [u16; 6] = [0x47, 0x72, 0x61, 0x63, 0x65, 0x00];
|
||||||
|
const NAME: [u16; 5] = [0x4e, 0x61, 0x6d, 0x65, 0x00];
|
||||||
|
|
||||||
|
unsafe fn is_grace_period_product(hslc: *const c_void, pproductskuid: *const Guid) -> bool {
|
||||||
let mut p_buffer = null_mut();
|
let mut p_buffer = null_mut();
|
||||||
let mut cb_size = 0;
|
let mut cb_size = 0;
|
||||||
|
|
||||||
if SLGetProductSkuInformation(
|
if SLGetProductSkuInformation(
|
||||||
hslc,
|
hslc,
|
||||||
pproductskuid,
|
pproductskuid,
|
||||||
w!("Name"),
|
NAME.as_ptr(),
|
||||||
null_mut(),
|
null_mut(),
|
||||||
&mut cb_size,
|
&mut cb_size,
|
||||||
&mut p_buffer,
|
&mut p_buffer,
|
||||||
) != 0
|
) != 0
|
||||||
{
|
{
|
||||||
LocalFree(p_buffer as *mut c_void);
|
LocalFree(p_buffer.cast());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if !StrStrNIW(p_buffer as *const u16, w!("Grace"), cb_size).is_null() {
|
if !StrStrNIW(p_buffer.cast(), GRACE.as_ptr(), cb_size).is_null() {
|
||||||
LocalFree(p_buffer as *mut c_void);
|
LocalFree(p_buffer.cast());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
LocalFree(p_buffer as *mut c_void);
|
LocalFree(p_buffer.cast());
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
unsafe extern "system" fn SLGetLicensingStatusInformationHook(
|
unsafe extern "system" fn SLGetLicensingStatusInformationHook(
|
||||||
hslc: *const c_void,
|
hslc: *const c_void,
|
||||||
pappid: *const GUID,
|
pappid: *const Guid,
|
||||||
pproductskuid: *const GUID,
|
pproductskuid: *const Guid,
|
||||||
pwszrightname: PCWSTR,
|
pwszrightname: *const u16,
|
||||||
pnstatuscount: *mut u32,
|
pnstatuscount: *mut u32,
|
||||||
pplicensingstatus: *mut *mut SL_LICENSING_STATUS,
|
pplicensingstatus: *mut *mut SL_LICENSING_STATUS,
|
||||||
) -> i32 {
|
) -> i32 {
|
||||||
|
130
src/sppcs.rs
130
src/sppcs.rs
@ -1,132 +1,132 @@
|
|||||||
#![allow(non_snake_case)]
|
#![allow(non_snake_case)]
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
fn SLCallServer() {}
|
extern "system" fn SLCallServer() {}
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
fn SLpAuthenticateGenuineTicketResponse() {}
|
extern "system" fn SLpAuthenticateGenuineTicketResponse() {}
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
fn SLpBeginGenuineTicketTransaction() {}
|
extern "system" fn SLpBeginGenuineTicketTransaction() {}
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
fn SLpClearActivationInProgress() {}
|
extern "system" fn SLpClearActivationInProgress() {}
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
fn SLpDepositDownlevelGenuineTicket() {}
|
extern "system" fn SLpDepositDownlevelGenuineTicket() {}
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
fn SLpDepositTokenActivationResponse() {}
|
extern "system" fn SLpDepositTokenActivationResponse() {}
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
fn SLpGenerateTokenActivationChallenge() {}
|
extern "system" fn SLpGenerateTokenActivationChallenge() {}
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
fn SLpGetGenuineBlob() {}
|
extern "system" fn SLpGetGenuineBlob() {}
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
fn SLpGetGenuineLocal() {}
|
extern "system" fn SLpGetGenuineLocal() {}
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
fn SLpGetLicenseAcquisitionInfo() {}
|
extern "system" fn SLpGetLicenseAcquisitionInfo() {}
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
fn SLpGetMSPidInformation() {}
|
extern "system" fn SLpGetMSPidInformation() {}
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
fn SLpGetMachineUGUID() {}
|
extern "system" fn SLpGetMachineUGUID() {}
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
fn SLpGetTokenActivationGrantInfo() {}
|
extern "system" fn SLpGetTokenActivationGrantInfo() {}
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
fn SLpIAActivateProduct() {}
|
extern "system" fn SLpIAActivateProduct() {}
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
fn SLpIsCurrentInstalledProductKeyDefaultKey() {}
|
extern "system" fn SLpIsCurrentInstalledProductKeyDefaultKey() {}
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
fn SLpProcessVMPipeMessage() {}
|
extern "system" fn SLpProcessVMPipeMessage() {}
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
fn SLpSetActivationInProgress() {}
|
extern "system" fn SLpSetActivationInProgress() {}
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
fn SLpTriggerServiceWorker() {}
|
extern "system" fn SLpTriggerServiceWorker() {}
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
fn SLpVLActivateProduct() {}
|
extern "system" fn SLpVLActivateProduct() {}
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
fn SLClose() {}
|
extern "system" fn SLClose() {}
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
fn SLConsumeRight() {}
|
extern "system" fn SLConsumeRight() {}
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
fn SLDepositMigrationBlob() {}
|
extern "system" fn SLDepositMigrationBlob() {}
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
fn SLDepositOfflineConfirmationId() {}
|
extern "system" fn SLDepositOfflineConfirmationId() {}
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
fn SLDepositOfflineConfirmationIdEx() {}
|
extern "system" fn SLDepositOfflineConfirmationIdEx() {}
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
fn SLDepositStoreToken() {}
|
extern "system" fn SLDepositStoreToken() {}
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
fn SLFireEvent() {}
|
extern "system" fn SLFireEvent() {}
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
fn SLGatherMigrationBlob() {}
|
extern "system" fn SLGatherMigrationBlob() {}
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
fn SLGatherMigrationBlobEx() {}
|
extern "system" fn SLGatherMigrationBlobEx() {}
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
fn SLGenerateOfflineInstallationId() {}
|
extern "system" fn SLGenerateOfflineInstallationId() {}
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
fn SLGenerateOfflineInstallationIdEx() {}
|
extern "system" fn SLGenerateOfflineInstallationIdEx() {}
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
fn SLGetActiveLicenseInfo() {}
|
extern "system" fn SLGetActiveLicenseInfo() {}
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
fn SLGetApplicationInformation() {}
|
extern "system" fn SLGetApplicationInformation() {}
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
fn SLGetApplicationPolicy() {}
|
extern "system" fn SLGetApplicationPolicy() {}
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
fn SLGetAuthenticationResult() {}
|
extern "system" fn SLGetAuthenticationResult() {}
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
fn SLGetEncryptedPIDEx() {}
|
extern "system" fn SLGetEncryptedPIDEx() {}
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
fn SLGetGenuineInformation() {}
|
extern "system" fn SLGetGenuineInformation() {}
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
fn SLGetInstalledProductKeyIds() {}
|
extern "system" fn SLGetInstalledProductKeyIds() {}
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
fn SLGetLicense() {}
|
extern "system" fn SLGetLicense() {}
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
fn SLGetLicenseFileId() {}
|
extern "system" fn SLGetLicenseFileId() {}
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
fn SLGetLicenseInformation() {}
|
extern "system" fn SLGetLicenseInformation() {}
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
fn SLGetPKeyId() {}
|
extern "system" fn SLGetPKeyId() {}
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
fn SLGetPKeyInformation() {}
|
extern "system" fn SLGetPKeyInformation() {}
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
fn SLGetPolicyInformation() {}
|
extern "system" fn SLGetPolicyInformation() {}
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
fn SLGetPolicyInformationDWORD() {}
|
extern "system" fn SLGetPolicyInformationDWORD() {}
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
fn SLGetSLIDList() {}
|
extern "system" fn SLGetSLIDList() {}
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
fn SLGetServiceInformation() {}
|
extern "system" fn SLGetServiceInformation() {}
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
fn SLInstallLicense() {}
|
extern "system" fn SLInstallLicense() {}
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
fn SLInstallProofOfPurchase() {}
|
extern "system" fn SLInstallProofOfPurchase() {}
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
fn SLInstallProofOfPurchaseEx() {}
|
extern "system" fn SLInstallProofOfPurchaseEx() {}
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
fn SLIsGenuineLocalEx() {}
|
extern "system" fn SLIsGenuineLocalEx() {}
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
fn SLLoadApplicationPolicies() {}
|
extern "system" fn SLLoadApplicationPolicies() {}
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
fn SLOpen() {}
|
extern "system" fn SLOpen() {}
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
fn SLPersistApplicationPolicies() {}
|
extern "system" fn SLPersistApplicationPolicies() {}
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
fn SLPersistRTSPayloadOverride() {}
|
extern "system" fn SLPersistRTSPayloadOverride() {}
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
fn SLReArm() {}
|
extern "system" fn SLReArm() {}
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
fn SLRegisterEvent() {}
|
extern "system" fn SLRegisterEvent() {}
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
fn SLRegisterPlugin() {}
|
extern "system" fn SLRegisterPlugin() {}
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
fn SLSetAuthenticationData() {}
|
extern "system" fn SLSetAuthenticationData() {}
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
fn SLSetCurrentProductKey() {}
|
extern "system" fn SLSetCurrentProductKey() {}
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
fn SLSetGenuineInformation() {}
|
extern "system" fn SLSetGenuineInformation() {}
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
fn SLUninstallLicense() {}
|
extern "system" fn SLUninstallLicense() {}
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
fn SLUninstallProofOfPurchase() {}
|
extern "system" fn SLUninstallProofOfPurchase() {}
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
fn SLUnloadApplicationPolicies() {}
|
extern "system" fn SLUnloadApplicationPolicies() {}
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
fn SLUnregisterEvent() {}
|
extern "system" fn SLUnregisterEvent() {}
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
fn SLUnregisterPlugin() {}
|
extern "system" fn SLUnregisterPlugin() {}
|
||||||
|
29
src/win32.rs
29
src/win32.rs
@ -1,11 +1,20 @@
|
|||||||
|
// Mostly copied from windows-sys
|
||||||
|
|
||||||
use core::ffi::c_void;
|
use core::ffi::c_void;
|
||||||
use windows_sys::core::{GUID, PCWSTR};
|
|
||||||
|
#[repr(C)]
|
||||||
|
pub struct Guid {
|
||||||
|
pub data1: u32,
|
||||||
|
pub data2: u16,
|
||||||
|
pub data3: u16,
|
||||||
|
pub data4: [u8; 8],
|
||||||
|
}
|
||||||
|
|
||||||
#[allow(non_snake_case)]
|
#[allow(non_snake_case)]
|
||||||
#[allow(non_camel_case_types)]
|
#[allow(non_camel_case_types)]
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
pub struct SL_LICENSING_STATUS {
|
pub struct SL_LICENSING_STATUS {
|
||||||
pub SkuId: GUID,
|
pub SkuId: Guid,
|
||||||
pub eStatus: i32,
|
pub eStatus: i32,
|
||||||
pub dwGraceTime: u32,
|
pub dwGraceTime: u32,
|
||||||
pub dwTotalGraceDays: u32,
|
pub dwTotalGraceDays: u32,
|
||||||
@ -21,9 +30,9 @@ pub struct SL_LICENSING_STATUS {
|
|||||||
extern "system" {
|
extern "system" {
|
||||||
pub fn SLGetLicensingStatusInformation(
|
pub fn SLGetLicensingStatusInformation(
|
||||||
hslc: *const c_void,
|
hslc: *const c_void,
|
||||||
pappid: *const GUID,
|
pappid: *const Guid,
|
||||||
pproductskuid: *const GUID,
|
pproductskuid: *const Guid,
|
||||||
pwszrightname: PCWSTR,
|
pwszrightname: *const u16,
|
||||||
pnstatuscount: *mut u32,
|
pnstatuscount: *mut u32,
|
||||||
pplicensingstatus: *mut *mut SL_LICENSING_STATUS,
|
pplicensingstatus: *mut *mut SL_LICENSING_STATUS,
|
||||||
) -> i32;
|
) -> i32;
|
||||||
@ -37,8 +46,8 @@ extern "system" {
|
|||||||
extern "system" {
|
extern "system" {
|
||||||
pub fn SLGetProductSkuInformation(
|
pub fn SLGetProductSkuInformation(
|
||||||
hslc: *const c_void,
|
hslc: *const c_void,
|
||||||
pproductskuid: *const GUID,
|
pproductskuid: *const Guid,
|
||||||
pwszvaluename: PCWSTR,
|
pwszvaluename: *const u16,
|
||||||
pedatatype: *mut u32,
|
pedatatype: *mut u32,
|
||||||
pcbvalue: *mut u32,
|
pcbvalue: *mut u32,
|
||||||
ppbvalue: *mut *mut u8,
|
ppbvalue: *mut *mut u8,
|
||||||
@ -64,9 +73,5 @@ extern "system" {
|
|||||||
)]
|
)]
|
||||||
#[cfg_attr(not(target_arch = "x86"), link(name = "SHLWAPI", kind = "raw-dylib"))]
|
#[cfg_attr(not(target_arch = "x86"), link(name = "SHLWAPI", kind = "raw-dylib"))]
|
||||||
extern "system" {
|
extern "system" {
|
||||||
pub fn StrStrNIW(
|
pub fn StrStrNIW(pszfirst: *const u16, pszsrch: *const u16, cchmax: u32) -> *mut u16;
|
||||||
pszfirst: ::windows_sys::core::PCWSTR,
|
|
||||||
pszsrch: ::windows_sys::core::PCWSTR,
|
|
||||||
cchmax: u32,
|
|
||||||
) -> ::windows_sys::core::PWSTR;
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user