| 1 |
// Licensed under the Apache License, Version 2.0 |
| 2 |
// <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license |
| 3 |
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option. |
| 4 |
// All files in the project carrying such notice may not be copied, modified, or distributed |
| 5 |
// except according to those terms. |
| 6 |
use shared::basetsd::{UINT32, UINT64}; |
| 7 |
use shared::guiddef::REFIID; |
| 8 |
use um::objidl::IApartmentShutdown; |
| 9 |
use um::winnt::{HRESULT, VOID}; |
| 10 |
use winrt::activation::IActivationFactory; |
| 11 |
use winrt::hstring::HSTRING; |
| 12 |
use winrt::inspectable::IInspectable; |
| 13 |
ENUM!{enum RO_INIT_TYPE { |
| 14 |
RO_INIT_SINGLETHREADED = 0, |
| 15 |
RO_INIT_MULTITHREADED = 1, |
| 16 |
}} |
| 17 |
pub enum RO_REGISTRATION_COOKIE__ {} |
| 18 |
pub type RO_REGISTRATION_COOKIE = *mut RO_REGISTRATION_COOKIE__; |
| 19 |
FN!{stdcall PFNGETACTIVATIONFACTORY( |
| 20 |
HSTRING, |
| 21 |
*mut *mut IActivationFactory, |
| 22 |
) -> HRESULT} |
| 23 |
extern "system" { |
| 24 |
pub fn RoInitialize( |
| 25 |
initType: RO_INIT_TYPE, |
| 26 |
) -> HRESULT; |
| 27 |
pub fn RoUninitialize(); |
| 28 |
pub fn RoActivateInstance( |
| 29 |
activatableClassId: HSTRING, |
| 30 |
instance: *mut *mut IInspectable, |
| 31 |
) -> HRESULT; |
| 32 |
pub fn RoRegisterActivationFactories( |
| 33 |
activatableClassIds: *const HSTRING, |
| 34 |
activationFactoryCallbacks: *const PFNGETACTIVATIONFACTORY, |
| 35 |
count: UINT32, |
| 36 |
cookie: *mut RO_REGISTRATION_COOKIE, |
| 37 |
) -> HRESULT; |
| 38 |
pub fn RoRevokeActivationFactories( |
| 39 |
cookie: RO_REGISTRATION_COOKIE, |
| 40 |
); |
| 41 |
pub fn RoGetActivationFactory( |
| 42 |
activatableClassId: HSTRING, |
| 43 |
iid: REFIID, |
| 44 |
factory: *mut *mut VOID, |
| 45 |
) -> HRESULT; |
| 46 |
} |
| 47 |
DECLARE_HANDLE!{APARTMENT_SHUTDOWN_REGISTRATION_COOKIE, APARTMENT_SHUTDOWN_REGISTRATION_COOKIE__} |
| 48 |
extern "system" { |
| 49 |
pub fn RoRegisterForApartmentShutdown( |
| 50 |
callbackObject: *const IApartmentShutdown, |
| 51 |
apartmentIdentifier: *mut UINT64, |
| 52 |
regCookie: *mut APARTMENT_SHUTDOWN_REGISTRATION_COOKIE, |
| 53 |
) -> HRESULT; |
| 54 |
pub fn RoUnregisterForApartmentShutdown( |
| 55 |
regCookie: APARTMENT_SHUTDOWN_REGISTRATION_COOKIE, |
| 56 |
) -> HRESULT; |
| 57 |
pub fn RoGetApartmentIdentifier( |
| 58 |
apartmentIdentifier: *mut UINT64, |
| 59 |
) -> HRESULT; |
| 60 |
} |