summaryrefslogtreecommitdiff
path: root/src/win32.rs
diff options
context:
space:
mode:
authorAve2024-04-12 00:44:51 +0000
committerAve2024-04-12 00:44:51 +0000
commit044af0e99d40a449c855d989feb7ad8ff042783f (patch)
tree7feb37ab1d5b6f5fb9bb18fbae15ccd913b08b15 /src/win32.rs
parent6d7c85fb2ce657e8e5a79c3223dd981958176ff8 (diff)
downloadohook-rs-044af0e99d40a449c855d989feb7ad8ff042783f.zip
Remove windows-sys dependency and code cleanupHEADmain
This affects the source code only, output binary hashes remain the same.
Diffstat (limited to 'src/win32.rs')
-rw-r--r--src/win32.rs29
1 files changed, 17 insertions, 12 deletions
diff --git a/src/win32.rs b/src/win32.rs
index 65995a3..8a5e2de 100644
--- a/src/win32.rs
+++ b/src/win32.rs
@@ -1,11 +1,20 @@
+// Mostly copied from windows-sys
+
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_camel_case_types)]
#[repr(C)]
pub struct SL_LICENSING_STATUS {
- pub SkuId: GUID,
+ pub SkuId: Guid,
pub eStatus: i32,
pub dwGraceTime: u32,
pub dwTotalGraceDays: u32,
@@ -21,9 +30,9 @@ pub struct SL_LICENSING_STATUS {
extern "system" {
pub fn SLGetLicensingStatusInformation(
hslc: *const c_void,
- pappid: *const GUID,
- pproductskuid: *const GUID,
- pwszrightname: PCWSTR,
+ pappid: *const Guid,
+ pproductskuid: *const Guid,
+ pwszrightname: *const u16,
pnstatuscount: *mut u32,
pplicensingstatus: *mut *mut SL_LICENSING_STATUS,
) -> i32;
@@ -37,8 +46,8 @@ extern "system" {
extern "system" {
pub fn SLGetProductSkuInformation(
hslc: *const c_void,
- pproductskuid: *const GUID,
- pwszvaluename: PCWSTR,
+ pproductskuid: *const Guid,
+ pwszvaluename: *const u16,
pedatatype: *mut u32,
pcbvalue: *mut u32,
ppbvalue: *mut *mut u8,
@@ -64,9 +73,5 @@ extern "system" {
)]
#[cfg_attr(not(target_arch = "x86"), link(name = "SHLWAPI", kind = "raw-dylib"))]
extern "system" {
- pub fn StrStrNIW(
- pszfirst: ::windows_sys::core::PCWSTR,
- pszsrch: ::windows_sys::core::PCWSTR,
- cchmax: u32,
- ) -> ::windows_sys::core::PWSTR;
+ pub fn StrStrNIW(pszfirst: *const u16, pszsrch: *const u16, cchmax: u32) -> *mut u16;
}