GetExitCodeThread() public static method

Retrieves the termination status of the specified thread.
public static GetExitCodeThread ( SafeMemoryHandle threadHandle ) : IntPtr?
threadHandle Binarysharp.MemoryManagement.Native.SafeMemoryHandle A handle to the thread.
return IntPtr?
        /// <summary>
        ///     Gets the termination status of the thread.
        /// </summary>
        public T GetExitCode <T>()
        {
            // Get the exit code of the thread (can be nullable)
            var ret = ThreadCore.GetExitCodeThread(Handle);

            // Return the exit code or the default value of T if there's no exit code
            return(ret.HasValue ? MarshalType <T> .PtrToObject(MemorySharp, ret.Value) : default(T));
        }