日期:2014-05-18  浏览次数:20685 次

SafeSocketHandle问题请教
大家好,请教问题哦,新接触C#IOCP,请多多指教。
在使用非托管API函数时,PostQueuedCompletionStatus定义中的“SafeFileHandle”是一种什么类型?
是自定义的类型吗?如果需要自定义,要怎么定义?

[DllImport("Kernel32", CharSet = CharSet.Auto)]
  private static extern bool PostQueuedCompletionStatus(SafeFileHandle CompletionPort, uint dwNumberOfBytesTransferred, IntPtr dwCompletionKey, IntPtr lpOverlapped);

以上,请不吝赐教,谢O(∩_∩)O谢谢。





------解决方案--------------------
http://technet.microsoft.com/zh-cn/magazine/microsoft.win32.safehandles.safefilehandle(VS.80).aspx