Recent

Author Topic: is it possible to create a Windows Device Driver with Lazarus  (Read 3088 times)

andyf97

  • New Member
  • *
  • Posts: 21
is it possible to create a Windows Device Driver with Lazarus so that it would show up in device manager.

Something really basic that acts as a midi key receiver and save to a file.

Common audio sequencer applications like Cubase can write to midi devices, I want my own to be able to expand it..

Seenkao

  • Hero Member
  • *****
  • Posts: 546
    • New ZenGL.
Re: is it possible to create a Windows Device Driver with Lazarus
« Reply #1 on: June 09, 2023, 11:17:33 am »
Да, с помощью FPC/Lazarus можно написать драйвер. Но для этого вам нужен опыт в создании драйверов. Или хотя бы сильное желание создать драйвер. Вам надо изучить как создаются драйвера и попробовать самому их создать с помощью FPC/Lazarus.

Google translate:
Yes, you can write a driver using FPC/Lazarus. But for this you need experience in creating drivers. Or at least a strong desire to create a driver. You should learn how drivers are created and try to create them yourself using FPC/Lazarus.
Rus: Стремлюсь к созданию минимальных и достаточно быстрых приложений.

Eng: I strive to create applications that are minimal and reasonably fast.
Working on ZenGL

Leledumbo

  • Hero Member
  • *****
  • Posts: 8746
  • Programming + Glam Metal + Tae Kwon Do = Me

PascalDragon

  • Hero Member
  • *****
  • Posts: 5446
  • Compiler Developer
Re: is it possible to create a Windows Device Driver with Lazarus
« Reply #3 on: June 09, 2023, 10:04:25 pm »
Please note that target nativent currently does only support i386, but not x86_64 or aarch64. Though at least in principle it shouldn't be that hard to port...

Thaddy

  • Hero Member
  • *****
  • Posts: 14205
  • Probably until I exterminate Putin.
Re: is it possible to create a Windows Device Driver with Lazarus
« Reply #4 on: June 10, 2023, 12:58:57 pm »
of course for the 64 bit drivers there is the little matter that they need to be codesigned.
That costs money to buy a signing certificate from a Microsoft approved certificate provider.
But once you buy it, you can use it for anything. Costs between $75-$125 a year.
Once signed, a particular driver is never affected if the certificate should expire, though, unless you want to update a particular driver. Then it needs to be signed again with a valid codesign certificate.
32 bit drivers are only partially affected because on a win64 system 32 bit stuff runs in a kind of virtual machine called windows on windows or SysWoW.
« Last Edit: June 10, 2023, 01:09:49 pm by Thaddy »
Specialize a type, not a var.

PascalDragon

  • Hero Member
  • *****
  • Posts: 5446
  • Compiler Developer
Re: is it possible to create a Windows Device Driver with Lazarus
« Reply #5 on: June 10, 2023, 01:23:34 pm »
32 bit drivers are only partially affected because on a win64 system 32 bit stuff runs in a kind of virtual machine called windows on windows or SysWoW.

You can not run 32-bit drivers on 64-bit systems. The 32-bit mode is not available in kernel mode.

Thaddy

  • Hero Member
  • *****
  • Posts: 14205
  • Probably until I exterminate Putin.
Re: is it possible to create a Windows Device Driver with Lazarus
« Reply #6 on: June 10, 2023, 01:30:03 pm »
You can not run 32-bit drivers on 64-bit systems. The 32-bit mode is not available in kernel mode.
I did not know that. - although my midi drivers and ASIO drivers are for sure 32 bit! In that case he can simply use a service/daemon in that case, same as i wrote for ASIO. But e.g. ASIOForAll is 32 bit, a driver and 32 bit.
Specialize a type, not a var.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11383
  • FPC developer.
Re: is it possible to create a Windows Device Driver with Lazarus
« Reply #7 on: June 10, 2023, 01:46:17 pm »
You can not run 32-bit drivers on 64-bit systems. The 32-bit mode is not available in kernel mode.
I did not know that. - although my midi drivers and ASIO drivers are for sure 32 bit! In that case he can simply use a service/daemon in that case, same as i wrote for ASIO. But e.g. ASIOForAll is 32 bit, a driver and 32 bit.

Usually those are services that hook generic filter drivers, and don't live in kernel space This also happens with e.g. industrial cameras.

TRon

  • Hero Member
  • *****
  • Posts: 2435
Re: is it possible to create a Windows Device Driver with Lazarus
« Reply #8 on: June 10, 2023, 01:49:28 pm »
Usually those are services that hook generic filter drivers, and don't live in kernel space This also happens with e.g. industrial cameras.
AS far as I know that is what thunking is used for ?

 

TinyPortal © 2005-2018