title: Windows 7 kernel raw socket send Error
body: <p>Windows 7 SP1</p>
  
  <p>I am writing a File System Driver trying to send data using a socket.</p>
  
  <pre><code>NTSTATUS NTAPI Connect(IN PWSK_SOCKET WskSocket, IN PSOCKADDR RemoteAddress)
  {
      KEVENT CompletionEvent = { 0 };
      PIRP Irp = NULL;
      NTSTATUS status = STATUS_UNSUCCESSFUL;
      PWSK_PROVIDER_CONNECTION_DISPATCH SocketDispatcher;
  
      if (g_SocketState != INITIALIZED || !WskSocket || !RemoteAddress)
          return STATUS_INVALID_PARAMETER;
  
      status = InitWskData(&amp;Irp, &amp;CompletionEvent);
      if (!NT_SUCCESS(status))
      {
          DbgPrint("Connect(): InitWskData() Failed Status 0x%08X\n", status);
          return status;
      }
      SocketDispatcher = (PWSK_PROVIDER_CONNECTION_DISPATCH)WskSocket-&gt;Dispatch;
      status = SocketDispatcher-&gt;WskConnect(WskSocket, RemoteAddress, 0, Irp); // &lt;-- this line fails
      if (status == STATUS_PENDING)
      {
          KeWaitForSingleObject(&amp;CompletionEvent, Executive, KernelMode, FALSE, NULL);
          status = Irp-&gt;IoStatus.Status;
      }
      IoFreeIrp(Irp);
  
      return status;
  }
  </code></pre>
  
  <p>Creating a socket is successful, and <code>WSKStart()</code> is successful.</p>
  
  <p>But connecting the socket is reporting an error. </p>
  
  <pre><code>status = SocketDispatcher-&gt;WskConnect(WskSocket, RemoteAddress, 0, Irp);
  </code></pre>
  
  <p>The status code is <code>0xC0000184</code>.</p>
  
  <p>What is the problem?</p>