In a hook dll, I call SendIpcMessage() like this:
Code: Select all
OutputDebugString(L"IPC Start");
SendIpcMessage("MyIpcName", (void*)&requestMessage[0], requestMessage.size(), &responseBuffer[0], sizeof(responseBuffer), 5 * 1000, false);
OutputDebugString(L"IPC End");
I've omitted error handling for clarity, but SendIpcMessage() returns 'true' here.
And in a exe file, the callback function is like this:
Code: Select all
static void WINAPI IpcCallback(LPCSTR pIpc, LPCVOID pMessageBuf, DWORD dwMessageLen, LPVOID pAnswerBuf, DWORD dwAnswerLen) {
OutputDebugString(L"IpcCallback() Start");
Sleep(500);
OutputDebugString(L"IpcCallback() End");
}
Code: Select all
IPC Start
IpcCallback() Start
IpcCallback() End
IPC End
But on Windows 7, the debug messages print in a weird order like this:
Code: Select all
IPC Start
IPC End
IpcCallback() Start
/* and 500ms later... */
IpcCallback() End
I've omitted answer buffer manipulation here for clarity, but the answer buffer is intact when I write something in a callback function.
Is this a bug?