同步异步

VOID MyThreadProc(PVOID context)
{ 
	PUNICODE_STRING str = (PUNICODE_STRING)context;
	KdPrint(("PrintInMyThread:%wZ\r\n",str));
	PsTerminateSystemThread(STATUS_SUCCESS);
}
VOID MyFunction()
{
	UNICODE_STRING str = RTK_CONSTANT_STRING(L"Hello!");
	HANDLE thread = NULL;
	NTSTATUS status;
	status = PsCreateSystemThread(&thread,0L,NULL,NULL,NULL,MyThreadProc,(PVOID)&str);
	if(!NT_SUCCESS(status))
	{
		
	}
	ZwClose(thread);
}

你可能感兴趣的:(同步异步)