in crates/libs/core/src/runtime/stateful_bridge.rs [530:549]
fn BeginBuildReplica(
&self,
replica: *const FABRIC_REPLICA_INFORMATION,
callback: windows_core::Ref<super::IFabricAsyncOperationCallback>,
) -> crate::WinResult<super::IFabricAsyncOperationContext> {
let inner = self.inner.clone();
let r = ReplicaInformation::from(unsafe { replica.as_ref().unwrap() });
// check the parameter requirements from SF
debug_assert_eq!(r.role, ReplicaRole::IdleSecondary);
debug_assert_eq!(r.catch_up_capability, -1);
debug_assert_eq!(r.current_progress, -1);
let (ctx, token) = BridgeContext::make(callback);
ctx.spawn(&self.rt, async move {
inner
.build_replica(&r, token)
.await
.map_err(crate::WinError::from)
})
}