Hello
I got a little problem while trying to pass args to my ThreadEntryPoint with PsCreateSystemThread ...
Here's my code:
But when calling with the PsCreateSystemThread it BSOD while attempting to display the DbgPrint...
Any idea?
I got a little problem while trying to pass args to my ThreadEntryPoint with PsCreateSystemThread ...
Here's my code:
Code: Select all
typedef struct _MESSAGE_TO_SEND {
WCHAR msg[MAX_MSG];
LPWSTR port;
ULONG command;
}MESSAGE_TO_SEND, *PMESSAGE_TO_SEND;
Code: Select all
MESSAGE_TO_SEND m2s = {0};
HANDLE hThread = NULL;
RtlStringCbPrintfW(m2s.msg, MAX_MSG, L"%d", id);
m2s.port = L"\\TestLpcPortName";
m2s.command = 0x5;
NtStatus = PsCreateSystemThread(&hThread, THREAD_ALL_ACCESS, NULL, NULL, NULL, (PKSTART_ROUTINE)SendMessageLPC, &m2s);
//SendMessageLPC(&m2s);
Code: Select all
When calling my function with SendMessageLPC(&m2s); all is working well.KSTART_ROUTINE SendMessageLPC;
VOID SendMessageLPC(PVOID pm2s)
{
DbgPrint("msg : %ws\n", ((PMESSAGE_TO_SEND)(pm2s))->msg);
}
But when calling with the PsCreateSystemThread it BSOD while attempting to display the DbgPrint...
Any idea?