[dllimport("kernel32", charset=charset.auto)]
private unsafe static extern boolean closehandle(uint32 hobject);
/// <summary> win32func: posts a context based event into an io completion port thread pool </summary>
[dllimport("kernel32", charset=charset.auto)]
private unsafe static extern boolean postqueuedcompletionstatus(uint32 hcompletionport, uint32 uisizeofargument, uint32* puiuserarg, overlapped* poverlapped);
/// <summary> win32func: waits on a context based event from an io completion port thread pool.
/// all threads in the pool wait in this win32 function </summary>
[dllimport("kernel32", charset=charset.auto)]
private unsafe static extern boolean getqueuedcompletionstatus(uint32 hcompletionport, uint32* psizeofargument, uint32* puiuserarg, overlapped** ppoverlapped, uint32 uimilliseconds);
the next section is the constants section. here we need to define the win32 constants required for the win32 api calls we are going to make later.
// constants
/// <summary> simtypeconst: this represents the win32 invalid handle value macro </summary>
private const uint32 invalid_handle_value = 0xffffffff;
/// <summary> simtypeconst: this represents the win32 infinite macro </summary>
private const uint32 inifinite = 0xffffffff;
/// <summary> simtypeconst: this tells the iocp function to shutdown </summary>
private const int32 shutdown_iocpthread = 0x7fffffff;