port access under 2000, XP

Windows specific forum
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by teachco.

From a german source:
http://www.bcb-box.de/Informationen/Port/port.html

For a port access under windows 2000 & XP you need a driver. There is a freeware driver : DriverLINX Port I/O Driver for Win95 and WinNT. It's an old one, but it's running without problems under windows 2000 and XP.

You can get the driver from : http://www.driverlinx.com/Software_Prod ... oducts.htm

Here is a code for the Borland C++ Builder 4.0 to work with the driver above.

***********************************************
* Who can translate this code into PureBasic? *
***********************************************

Code: Select all

1. First you have to declarate the function pointer:
typedef void( __stdcall *pOutPort)(DWORD m_addr, DWORD m_value );  

2. Then load the dll:
HINSTANCE dllport = LoadLibrary( "dlportio.dll" );
if ( dllport == NULL )     
{Application->MessageBox( "dlportio.dll not found.","DLL - error", MB_OK );
return;     } 

3. Now initialize  the pointer :
pOutPort OutPort;  

4. Calculate the funtion address:
OutPort = ( void(__stdcall *)(DWORD m_addr, DWORD m_value))
GetProcAddress( dllport, "DlPortWritePortUchar" );

5. Call function:
OutPort( 0x340, 0x55 );

6. Free DLL: 
FreeLibrary( dllport );
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by El_Choni.

Like this?

Code: Select all

If OpenLibrary(0, "dlportio.dll")=0
  MessageBox("DLL - error", "dlportio.dll not found.", #MB_OK)
Else
  CallFunction(0, "DlPortWritePortUchar", $340, $55)
  CloseLibrary(0)
EndIf
El_Choni
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Berikco.

It's not without problems on W2K and XP, i used it many years in my RAIDmonitor app on NT4 servers, and had to rewrite all to use another driver for W2K server.



Regards,

Berikco

http://www.benny.zeb.be/purebasic.htm
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by ebs.

You might want to look at http://www.beyondlogic.org/porttalk/porttalk.htm and try his device driver.

Eric
Originally posted by Berikco

It's not without problems on W2K and XP, i used it many years in my RAIDmonitor app on NT4 servers, and had to rewrite all to use another driver for W2K server.



Regards,

Berikco

http://www.benny.zeb.be/purebasic.htm
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Berikco.

I use TvicHW32, works great. I have commercial license for this.


Regards,

Berikco

http://www.benny.zeb.be/purebasic.htm
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by teachco.

Thank you all. I will test them.

Andi
Post Reply