Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ features = [
"Win32_Graphics_Gdi",
"Win32_UI_Shell",
"Win32_UI_WindowsAndMessaging",
"Win32_UI_HiDpi",
"Win32_UI_Input_KeyboardAndMouse",
"System",
"Storage_Streams",
"Data_Json",
Expand Down
2 changes: 1 addition & 1 deletion runtime/src/collection_arg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const E_NOINTERFACE: HRESULT = HRESULT(0x80004002u32 as i32);
const E_POINTER: HRESULT = HRESULT(0x80004003u32 as i32);
const S_OK: HRESULT = HRESULT(0);
const IID_IINSPECTABLE: GUID = GUID::from_u128(0xAF86E2E0_B12D_4c6a_9C5A_D7AA65101E90);
const IID_IAGILE_OBJECT: GUID = GUID::from_u128(0x94ea2b94_e9cc_49e0_c0ff_ee64ca8f5b90);
use crate::value::IID_IAGILE_OBJECT;

const COLLECTIONS: &str = "Windows.Foundation.Collections.";

Expand Down
3 changes: 2 additions & 1 deletion runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7747,7 +7747,8 @@ unsafe extern "system" fn js_delegate_query_interface(
out: *mut *mut c_void,
) -> HRESULT {
let d = &*this;
if *iid == IUnknown::IID || *iid == d.guid {
// Agile: off-thread invokes run on the owner JS thread.
if *iid == IUnknown::IID || *iid == d.guid || *iid == crate::value::IID_IAGILE_OBJECT {
*out = this as *mut c_void;
js_delegate_add_ref(this);
HRESULT(0)
Expand Down
5 changes: 3 additions & 2 deletions runtime/src/napi_engine/delegate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,8 @@ unsafe extern "system" fn napi_delegate_query_interface(
out: *mut *mut c_void,
) -> HRESULT {
let d = &*this;
if *iid == IUnknown::IID || *iid == d.guid {
// Agile: off-thread invokes run on the owner JS thread.
if *iid == IUnknown::IID || *iid == d.guid || *iid == crate::value::IID_IAGILE_OBJECT {
*out = this as *mut c_void;
napi_delegate_add_ref(this);
HRESULT(0)
Expand Down Expand Up @@ -624,7 +625,7 @@ const AS_DELEGATE_HELPER_JS: &str = r#"
"#;

/// Stringify a napi value (used for exception capture); None on failure.
unsafe fn napi_value_to_rust_string(env: sys::napi_env, value: sys::napi_value) -> Option<String> {
pub(crate) unsafe fn napi_value_to_rust_string(env: sys::napi_env, value: sys::napi_value) -> Option<String> {
let mut coerced: sys::napi_value = std::ptr::null_mut();
if sys::napi_coerce_to_string(env, value, &mut coerced) != sys::Status::napi_ok {
return None;
Expand Down
1 change: 1 addition & 0 deletions runtime/src/napi_engine/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ pub mod timers;
pub mod url;
pub mod value;
pub mod websocket;
pub mod xaml_host;

// Engine-neutral marshaling types the napi backend and standalone hosts build against.
pub use crate::value::{NativeType, NativeValue};
Loading