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

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

More Info on Driver Writing and Debugging


The free OSR Learning Library has more than 50 articles on a wide variety of topics about writing and debugging device drivers and Minifilters. From introductory level to advanced. All the articles have been recently reviewed and updated, and are written using the clear and definitive style you've come to expect from OSR over the years.


Check out The OSR Learning Library at: https://www.osr.com/osr-learning-library/


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,401
    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: 573
  • nb3mnb3m Member Posts: 12

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

  • Tim_RobertsTim_Roberts Member - All Emails Posts: 13,401
    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
OSR has suspended in-person seminars due to the Covid-19 outbreak. But, don't miss your training! Attend via the internet instead!
Kernel Debugging 30 Mar 2020 OSR Seminar Space
Developing Minifilters 15 Jun 2020 LIVE ONLINE
Writing WDF Drivers 22 June 2020 LIVE ONLINE
Internals & Software Drivers 28 Sept 2020 Dulles, VA