Пример #1
0
 internal static extern unsafe bool GetThreadWaitChain(
     SafeWaitChainSessionHandle handle,
     IntPtr context,
     UInt32 flags,
     UInt32 threadId,
     ref UInt32 nodeCount,
     WaitChanNodeInfo.Native *NodeInfoArray,
     [MarshalAs(UnmanagedType.Bool)] out bool IsCycle
     );
Пример #2
0
 public unsafe WaitChainSession()
 {
     handle = OpenThreadWaitChainSession(
         (uint)WCT_SESSION_OPEN_FLAGS.WCT_ASYNC_OPEN_FLAG,
         AsyncOperation.asyncCallback
         );
     if (handle.IsInvalid)
     {
         throw new Win32Exception();
     }
 }
Пример #3
0
        internal static unsafe void asyncCallback(SafeWaitChainSessionHandle WctHandle, IntPtr Context, uint CallbackStatus, ref uint NodeCount, WaitChanNodeInfo.Native *NodeInfoArray, ref bool IsCycle)
        {
            AsyncOperation self = (AsyncOperation)GCHandle.FromIntPtr(Context).Target;

            self.asyncCallback(CallbackStatus, ref NodeCount, NodeInfoArray, ref IsCycle);
        }