我可以用Delphi 2010编写Windows驱动程序吗? [英] Can I write Windows drivers with Delphi 2010?

查看:409
本文介绍了我可以用Delphi 2010编写Windows驱动程序吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直听说, Delphi 几乎可以做任何C ++可以做的...除了编写Windows驱动程序。这是正确的,如果是,为什么呢?

I've always heard that Delphi can do almost anything C++ can do...except write Windows drivers. Is this correct, and if so, why is that?

我最近在线阅读了一篇博文,可能表示可能的解决方案用Delphi编写驱动程序,但它是3岁,我不知道这个信息是多么准确。

I recently read a blog post online that may indicate a possible solution for writing drivers with Delphi, but it's 3 years old and I don't know how accurate this information is.

因此,使用最新版本的Delphi(2010),在技术上是否可以编写Windows驱动程序?

So, with the latest version of Delphi (2010), would it be technically possible to write a Windows driver?

推荐答案

在技术上可能用Delphi编写一些驱动程序,但是对于一般的答案,我会说:驱动程序与Delphi

It may be technically possible to write some drivers with Delp but as far as a general answer goes, I'd say: you can't easily write drivers with Delphi.

首先,用户模式驱动程序(UMDF)驱动程序和内核模式(KMDF) 驱动程序。 UMDF驱动程序应该可以用Delphi。 KMDF驱动程序是不容易的,因为

First, there's a difference between user-mode driver (UMDF) drivers and kernel-mode (KMDF) drivers. UMDF drivers should be possible with Delphi. KMDF drivers aren't easily possible though, because

1)Delphi的链接器不能产生它们和

1) Delphi's linker can't produce them and

2)Delphi的对象文件格式与Microsoft链接器默认使用的COFF格式不同。

2) Delphi's object file format is different from the COFF format the Microsoft linker uses by default.

3)Delphi的RTL假设它居住在用户模式,某些事情,一个不应该在kernel-land(我认为例如异常处理的方式;也不同的内存管理),所以你必须非常小心使用哪些RTL函数是安全的。 System和SysInit单元也有困难(见Ritsaert Hornstra对这里另一个答案的评论)。

3) Delphi's RTL makes the assumption it lives in user-mode and may do certain things that one shouldn't do in kernel-land (I think e.g. of the way exceptions are handled; also different memory management), so you'd have to be very careful on which RTL functions are safe to use. There are also difficulties with System and SysInit units (see the comment by Ritsaert Hornstra to another answer here).

我不是说这些不是问题,

I'm not saying these aren't problems that cannot be overcome (cf. the post you link to) if you're really dedicated, but it won't be straightforward.

其次,KMDF驱动程序(我不知道)关于UMDF,实际上 - 谁可以评论?)对于Win64必须在64位代码。因为目前没有64位的Delphi编译器,写它们是一个肯定的没有。

Secondly, KMDF drivers (I don't know about UMDF, actually - can anyone comment?) for Win64 have to be in 64-bit code. Since currently, there is no 64-bit Delphi compiler, writing them is a definite no-no.

这篇关于我可以用Delphi 2010编写Windows驱动程序吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆