title: Crashes with hooked GetQueuedCompletionStatus
body: <p>i'm hooking <code>GetQueuedCompletionStatus</code> function with code below:</p>
  
  <pre><code>// hook code
  typedef BOOL (__stdcall * MyGetQueuedCompletionStatus)(
    _In_  HANDLE       CompletionPort,
    _Out_ LPDWORD      lpNumberOfBytes,
    _Out_ PULONG_PTR   lpCompletionKey,
    _Out_ LPOVERLAPPED *lpOverlapped,
    _In_  DWORD        dwMilliseconds
  );
  
  static BOOL __stdcall OwnGetQueuedCompletionStatus(
      __in  HANDLE CompletionPort,
      __out LPDWORD lpNumberOfBytesTransferred,
      __out PULONG_PTR lpCompletionKey,
      __out LPOVERLAPPED *lpOverlapped,
      __in  DWORD dwMilliseconds
      );    
  
  int hook()
  {
      LPVOID fnOrigGetQueuedCompletionStatus = ::GetProcAddress(LoadLibrary("kernel32.dll"),  "GetQueuedCompletionStatus");
      DWORD dwOsErr = cHookMgr.Hook(&amp;nHookId, (LPVOID*)&amp;(Information::Instance().pTrampolineGetQueuedCompletionStatus), fnOrigGetQueuedCompletionStatus, OwnGetQueuedCompletionStatus);
  }
  
  static BOOL __stdcall OwnGetQueuedCompletionStatus(
      __in  HANDLE CompletionPort,
      __out LPDWORD lpNumberOfBytesTransferred,
      __out PULONG_PTR lpCompletionKey,
      __out LPOVERLAPPED *lpOverlapped,
      __in  DWORD dwMilliseconds
      )
  {
      return Information::Instance().pTrampolineGetQueuedCompletionStatus(CompletionPort, lpNumberOfBytesTransferred, lpCompletionKey, lpOverlapped, dwMilliseconds);
  }
  </code></pre>
  
  <p>As you can see, fake function does nothing but i always have crashes when hooking app use it:</p>
  
  <blockquote>
    <p>Problem Event Name: BEX64<br>
      Application Name: MainServer.exe<br>
    Application Timestamp: 575f98b7<br>
      Fault Module Name: test64.dll_unloaded<br>
      Fault Module Version: 0.0.0.0<br>
      Fault Module Timestamp: 585af544<br>
      Exception Offset: 00000000000025a0<br>
    Exception Code: c0000005   Exception Data: 0000000000000008</p>
  </blockquote>
  
  <p>Other hooked functions work well.
  How can i fix that?</p>