Click here to Skip to main content
13,352,408 members (53,124 online)
Click here to Skip to main content
Add your own
alternative version


29 bookmarked
Posted 6 Apr 2005

Kport Direct Access I/O Ports Under Win NT/2000/XP

, 6 Apr 2005
Rate this:
Please Sign up or sign in to vote.
Two simple functions for accessing I/O ports, skiping H.A.L.

Sample Image - kport.jpg


I wrote this DLL for implementing direct access I/O ports in Windows NT/2K/XP.


For compiling the project, you need VC7.1-2003. For compiling kioport.sys, you need to install the DDK. Kioport is based on PortTalk.sys from the article: "Beyond Logic Port Talk I/O Port Driver",, and "A DDK's project wizard for VC2003",

Using the code

  1. Copy kioport.sys to \windows\system32\drivers.
  2. Add kioport.reg to register windows.
  3. Reboot windows for activate service in the register of windows.
  4. Add kport.h in your project and kport.lib.
  5. Put Kport.dll in the same directory as the application.

Using the Kport DLL is so easy. Here is the function definition, and the explanation follows:

// Returns a value from specific ports.
BYTE Inportb(WORD PortNum);
// Write a value to specific ports.
void Outportb(WORD PortNum, BYTE byte);
  • PortNum: is the port number; for example: 0x378 (LPT1).
  • BYTE: data to send for a specific PortNum in Ouportb, and data received in Inportb.

How to use the sample dialog

  • Write a number bellow the text 'Write Value( )', and click in the Write button.
  • Click on the Read button.


  • First version: April 3, 2005.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Guerino Palacios
Web Developer
Argentina Argentina
I'm Javier Güerino Palacios.
I know MFC, PHP, C, C++, C#, Java, ASM-8086.
I study Ing. Electronics and Ing. Information systems.

You may also be interested in...

Comments and Discussions

QuestionProblem during read operation... Pin
darxoul16-Nov-06 4:51
memberdarxoul16-Nov-06 4:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.180111.1 | Last Updated 6 Apr 2005
Article Copyright 2005 by Guerino Palacios
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid