简体   繁体   English

如何在Windows内核编程中使用线程?

[英]How to use thread in windows kernel programming?

I need to create user timer and thread in windows kernel program. 我需要在Windows内核程序中创建用户计时器和线程。 Anyone please give a clue that if the regular threading headers are applicable in this mode? 任何人都可以提供一个线索,说明常规线程头是否适用于此模式?

You need to look into KMDF or WDM if you are using some old drivers. 如果使用的是旧驱动程序,则需要研究KMDF或WDM。

For timers see this: 对于计时器,请参见以下内容:

http://msdn.microsoft.com/en-us/library/windows/hardware/ff550050(v=vs.85).aspx http://msdn.microsoft.com/zh-CN/library/windows/hardware/ff550050(v=vs.85).aspx

And here are threads or work items: 这是线程或工作项:

http://msdn.microsoft.com/en-us/library/windows/hardware/ff551203(v=vs.85).aspx http://msdn.microsoft.com/zh-CN/library/windows/hardware/ff551203(v=vs.85).aspx

If you are developing in kernel mode, then you need to take a look at the DDK, as the functions are quite different and more restrictive to use, than the user space versions. 如果您正在内核模式下进行开发,那么您需要了解一下DDK,因为这些功能与用户空间版本相比完全不同并且使用限制更大。

So the short answer is, no, the regular libraries can not be used inside a driver. 因此,简短的答案是,不,不能在驱动程序内部使用常规库。

You might take alook at PsCreateSystemThread for threading, as this is something you will need. 您可能需要看看用于线程的PsCreateSystemThread ,因为这是您所需要的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM