IPC Help

Hello!

I have hooked winsock send/recv in a process.

I'm trying to use named pipes to send the packets to my main program, but I'm still new to c++ which has way more complicated datatype system than any of the languages I've used before, and so I've run into some beginner issues.

In a nutshell, here's pseudocode of what I want to do:

OnWinsockSend(Packet p)
{
SendPacketToMainProgram(p);
ModifiedPacket p = GetResponseFromMainProgram();
return p;
}

Here's the real "OnWinsockSend" function of mine.

int WINAPI MySend(SOCKET s, const char* buf, int len, int flags)
{
return pSend(s, buf, len, flags);
}

And here's the "OnWinsockRecv":

int WINAPI MyRecv(SOCKET s, char* buf, int len, int flags)
{
return pRecv(s, buf, len, flags);
}

So I need to somehow run char* and const char* by my main program. It's for a winsock packet editing utility.

Here's some thoughts of mine..
- I'm quite sure that named pipes is the IPC method of choice
- I need to send datatypes char* and const char* and CreatePipe takes wide char so CreatePipeA or something like MultiByteToWideChar has to be used

I would greatly appreciate any help putting this all together, as my c++ knowledge is very limited.

T.I.A.!
Topic archived. No new replies allowed.