Windows System Software -- Consulting, Training, Development -- Unique Expertise, Guaranteed Results

Before Posting...
Please check out the Community Guidelines in the Announcements and Administration Category.

WSK - Reusing socket return error 0xc0000184

nb3mnb3m Member Posts: 12

Hello,

I am developing WDF driver using Winsock Kernel module connecting network. I have encounter problem when I try to reuse socket. I am successfully creating, binding and connecting socket. After that I am disconnecting socket with WskDisconnect function with success status. However when I try to reconnect using same socket I get error 0xc0000184. Any ideas why I can't reuse my socket? Binding fails as well.

Cheers.

Comments

  • Tim_RobertsTim_Roberts Member - All Emails Posts: 13,021
    via Email
    nb3m wrote:
    > I am developing WDF driver using Winsock Kernel module connecting network. I have encounter problem when I try to reuse socket. I am successfully creating, binding and connecting socket. After that I am disconnecting socket with WskDisconnect function with success status. However when I try to reconnect using same socket I get error 0xc0000184. Any ideas why I can't reuse my socket? Binding fails as well.

    I don't know the kernel equivalent, but in user-mode sockets, you have
    to set the socket option SO_REUSEADDR (and SO_REUSEPORT if it is
    defined) to reuse a TCP socket before the normal (lengthy) timeout.

    Tim Roberts, [email protected]
    Providenza & Boekelheide, Inc.

  • nb3mnb3m Member Posts: 12

    Hi Tim,

    As far as I know, Winsock kernel does not have such option. It is matter of two functions I am calling, at first WskConnect and then WskDisconnect. First time you call them is ok, but when you try to reconnect it fails. Connecting to different port does not work as well.

  • Jeffrey_Tippet_[MSFT]Jeffrey_Tippet_[MSFT] Member - All Emails Posts: 540
  • nb3mnb3m Member Posts: 12

    @Tim_Roberts It's not working. I receive same error. Any thoughts?

  • Tim_RobertsTim_Roberts Member - All Emails Posts: 13,021
    via Email
    nb3m wrote:
    > @Tim_Roberts It's not working. I receive same error. Any thoughts?

    Are you calling WskSocketConnect, or are you calling WskSocket, WdkBind,
    and WskConnect?  Maybe (and I'm just making this up now) you need to set
    the socket option before you bind and connect. That's true in user mode.

    Tim Roberts, [email protected]
    Providenza & Boekelheide, Inc.

  • nb3mnb3m Member Posts: 12

    @Tim_Roberts I am caling WskSocket, WskControlSocket, WskBind and WskConnect (All successful). I don't want to use WskSocketConnect because it will complicate my code.

  • nb3mnb3m Member Posts: 12

    Bump! Any idea what could possibly be root cause?

  • nb3mnb3m Member Posts: 12

    Still no solution. Anyone who could help with that?

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Upcoming OSR Seminars
Developing Minifilters 29 July 2019 OSR Seminar Space
Writing WDF Drivers 23 Sept 2019 OSR Seminar Space
Kernel Debugging 21 Oct 2019 OSR Seminar Space
Internals & Software Drivers 18 Nov 2019 Dulles, VA