Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6328421
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T17:27:19+00:00 2026-05-24T17:27:19+00:00

Note: The particular case I’m having troubles with is when lpCompletionRoutine is null and

  • 0

Note: The particular case I’m having troubles with is when lpCompletionRoutine is null and lpOverlapped is not.

I’m trying to write a packet sniffer. I’m hooking WSARecv and replacing it with my own code. If lpOverlapped is not null, I create my own LPWSAOVERLAPPED variable and call the real WSARecv. I receive and log the packet just fine, but the problem is, the client that I’m sniffing seems to wait for it’s WSAOVERLAPPED thing to be triggered.

So the question is, how do I trigger the initial lpOverlapped? I’ve tried things like WSASetEvent. I’ve tried doing inline asm and doing something like this:

__asm{
  push InFlags
  push lpOverlapped
  push BytesTransferred
  push Error
  call lpOverlapped
}

Neither of those things worked. I’m thinking there should be a simple way to trigger the wsaoverlapped so the game knows that the i/o operation is complete, but I just don’t know how.

Any and all help is appreciated.

Thanks!

edit:

I’ve tried signaling the code by doing the following, but I get an ERROR_INVALID_HANDLE error.

WSAOVERLAPPED overlapped = *lpOverlapped;
HANDLE hEvent = overlapped.hEvent;
if(!SetEvent(hEvent)){
    int error = GetLastError();
    Write(error);
}

Is there something special I need to do to prepare the event?

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T17:27:19+00:00Added an answer on May 24, 2026 at 5:27 pm

    Agree with Eugene Homyakov, with one little addition. Actually there are 3 ways the OS may notify the process about overlapped I/O completion.

    • Setting the event specified by hEvent member of the OVERLAPPED structure
    • Invoking the completion routine (specified in the call to WSAxxxx).
    • Posting a completion to the completion port.

    About the completion routine – you should note that it’s scheduled to the caller thread’s APC queue when the I/O completes. It actually gets called only when the thread calls an alertable wait procedure, such as SleepEx or WaitForMultipleObjectsEx.

    The OS will post the completion to the completion port if the socket/file handle has been associated with it. See CreateIoCompletionPort and PostQueuedCompletionStatus for more info.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Note: Although my particular context is Objective-C, my question actually transcends programming language choice.
NOTE: XMLIgnore is NOT the answer! OK, so following on from my question on
NOTE: I am not set on using VI, it is just the first thing
Note that I am not asking which to choose (MVC or MVP), but rather
(Note: This is for MySQL's SQL, not SQL Server.) I have a database column
I am facing some trouble trying to configure a particular configuration for a NumericUpDown
Note: I'm not talking about preventing the rebinding of a variable. I'm talking about
NOTE: Sorry for the long question! I'm trying to understand some key areas behind
NOTE: Solved my own problem, it seems. See the edits. I am trying to
Note: This was posted when I was starting out C#. With 2014 knowledge, I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.