Ejemplo n.º 1
0
        /// <summary>
        /// Get the status of EcDoAsyncWaitEx call.
        /// </summary>
        /// <param name="rpcAsyncHandle">RPC asynchronous handle</param>
        /// <returns>The status of asynchronous call</returns>
        public RPCAsyncStatus QueryAsyncWaitStatus(IntPtr rpcAsyncHandle)
        {
            RPCAsyncStatus status = (RPCAsyncStatus)NativeMethods.RpcAsyncGetCallStatus(rpcAsyncHandle);

            this.VerifyAsyncCallOnRPCTransport();
            return(status);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Complete the EcDoAsyncWaitEx call.
        /// </summary>
        /// <param name="rpcAsyncHandle">RPC asynchronous handle</param>
        /// <param name="flagsOut">The pulFlagsOut parameter returned by EcDoAsyncWaitEx</param>
        /// <returns>The EcDoAsyncWaitEx call return value</returns>
        public int EndAsyncWait(IntPtr rpcAsyncHandle, out int flagsOut)
        {
            IntPtr         reply  = Marshal.AllocHGlobal(sizeof(int));
            RPCAsyncStatus status = (RPCAsyncStatus)NativeMethods.RpcAsyncCompleteCall(rpcAsyncHandle, reply);

            Site.Assert.AreEqual <RPCAsyncStatus>(RPCAsyncStatus.RPC_S_OK, status, "Complete asynchronous wait.");
            int returnValue = Marshal.ReadInt32(reply);

            flagsOut = Marshal.ReadInt32(this.pulFlagsOut);
            this.VerifyAsyncCallOnRPCTransport();
            return(returnValue);
        }