Hello Coders,

Does anyone know a trick to create VXD or SYS files using Delphi?
Delphi can create C/C++ objects, maybe I can use the MS Linker?
Does anyone have try that?

Thank you
Posted on 2004-03-24 13:25:07 by maCo
Hmmm... I wouldn't even try creating VxD files with delphi. It sorta might be possible (OMF object output, using MS linke which can handle both OMF and COFF objects) but - ugh.

I guess it's doable for KMD (SYS) writing, since those are normal PE files... as long as you make very sure to strip all the delphi runtimes et cetera. Of course you'd have to find some (or write your own...) delphi adaptation of the NT DDK.

Also, I don't really like the idea of Delphi for driver writing. While assembly and C were written for this kind of job, Pascal (and thus, and even moreso, Delphi) were written for application development. The language as such should have the necessary facilities, I just really wouldn't trust a Borland product for drivers ;) (yes, I'd rather see drivers written in C++ than Delphi).
Posted on 2004-03-24 14:01:38 by f0dder
You don't want to use any of the object-oriented features of any language when you're writing drivers, unless you can avoid dynamic memory allocation. In other words, no new or constructors.

Object creation relies on memory allocation, and the ring3 memory allocation functions don't work at the ring0 (driver) level.
Posted on 2004-03-24 15:45:42 by tenkey

unless you can avoid dynamic memory allocation. In other words, no new or constructors.

This isn't actually that much of a problem - C++ allows you to override operator new, both global and per-object. So, you can make global operator new use kernel-mode allocation generally, and special pools (like, locked memory) for particular objects.
Posted on 2004-03-24 15:48:02 by f0dder