Okay, after even more extensive search:
com_class
is part of intercom
crate, not windows-rs
. The latter is much younger, and probably that is the reason Google and AI is recommending using com_class
. But it can be expand roughly to:
#[no_mangle]
pub extern "stdcall" fn DllGetClassObject(
clsid: *const GUID,
iid: *const GUID,
ppv: *mut *mut core::ffi::c_void,
) -> HRESULT {
if unsafe { *clsid } == GUID::from_values(0x80e3c337, 0x61c5, 0x4966, [0x90, 0xe6, 0xfc, 0x49, 0x8c, 0x3a, 0xaf, 0x9b]) {
let class = MyProvider::new();
unsafe { *ppv = Box::into_raw(Box::new(class)) as *mut _ };
HRESULT(0) // S_OK
} else {
CLASS_E_CLASSNOTAVAILABLE
}
}