Delphi-PRAXiS
Seite 2 von 3     12 3      

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Win32/Win64 API (native code) (https://www.delphipraxis.net/17-win32-win64-api-native-code/)
-   -   Delphi Treiber Handling (https://www.delphipraxis.net/145107-treiber-handling.html)

JamesTKirk 24. Dez 2009 21:19

Re: Treiber Handling
 
Zitat:

Zitat von nanix
ntddk.cpp is like 400kb translating all of it would be craaazyyy.But would be perfect and mad at the same time.

That's why I decided to follow the "translate on demand" approach. At least until the port is mature enough to "stand on its own feet" and others start to contribute. ;)

Regards,
Sven

Muetze1 24. Dez 2009 21:22

Re: Treiber Handling
 
CPUID is not a privileged instruction and can be used in user mode (ring 3). So there is no need to use a driver for this instruction.

RDMSR is mostly usable from user mode, example is the TSC MSR register 10h, so RDTSC is also executable in user mode.

nanix 24. Dez 2009 21:29

Re: Treiber Handling
 
Yea correct Muetze but then you got PCI Config Read and Write which very usefull IMHO :-D

Muetze1 24. Dez 2009 22:02

Re: Treiber Handling
 
Zitat:

Zitat von nanix
Yea correct Muetze but then you got PCI Config Read and Write which very usefull IMHO :-D

Why write? PCI Configuration Registered are written (and configured) partly by the BIOS (PnP OS false) and at least by the OS. The OS is the system knowing all memory, port and address spaces and can configure the devices. When you write anything under an OS like Windows to these registers, you get in trouble as the OS does not get informed about these changes.

If you just want to get information for an system information tool, you can use the WMI and HAL interfaces to gather these informations.

All your posts just reminds me of razor...

nanix 24. Dez 2009 23:25

Re: Treiber Handling
 
Becouse i will make write.No i am not Razor.I find this forum very interesting.Lots of good people here.Sad to see you equal every english people :oops:

alzaimar 25. Dez 2009 13:06

Re: Treiber Handling
 
Zitat:

Zitat von nanix
No i am not Razor.

"Only the true Messiah denies His divinity."

Zitat:

Zitat von nanix
Sad to see you equal every english people :oops:

Sure you're english? :zwinker:

nanix 25. Dez 2009 13:14

Re: Treiber Handling
 
Yes i speak english.I mean english as english i am only one on this forum.

nanix 27. Dez 2009 13:27

Re: Treiber Handling
 
:) Ok i fully translated it.

But now how do i convert the units to lazarus.And how would the make file look.
Thanks!

JamesTKirk 27. Dez 2009 15:58

Re: Treiber Handling
 
Just try to compile the units with FPC.

E. g. in a shell run

Code:
fpc -Pi386 -FuPath/To/Other/Units yourunit.pas
When you try this on Windows you should use "\" of course. If you need to compile for Win64 then you need to use this instead of "-Pi386":

Code:
-Px86_64 -Twin64
If you get errors you might need to add the following between "unit bla;" and "interface":

Delphi-Quellcode:
{$ifdef fpc}
  {$mode delphi}{$H+}
{$endif}
Also you might need to correct some types. If you have types that are different from Delphi to Free Pascal then use the following construct:

Delphi-Quellcode:
{$ifdef fpc}TMyFPCType{$else}TMyDelphiType{$endif}
You can also use this inside the declaration of a function.

If you have errors you can't solve by yourself, then you might start a new topic in the FPC subforum.

Regards,
Sven

nanix 27. Dez 2009 16:00

Re: Treiber Handling
 
I tested the driver on a 32 bit Vista Home Premium and it works OK.Just like the original one coded with C.Now just the 64 bit one. :zwinker:


Alle Zeitangaben in WEZ +1. Es ist jetzt 11:53 Uhr.
Seite 2 von 3     12 3      

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz