亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? tdlportio.h

?? I/O端口訪問,能在Win98下讀寫任意端口內容
?? H
字號:
//*** TDLPortIO: DriverLINX Port IO Driver wrapper component *****************
//**                                                                        **
//** File: TDLPortIO.h                                                      **
//**                                                                        **
//** Copyright (c) 1999 Chen Jiaqi. All rights reserved.                    **
//**     This software is CardWare; if you use it, you must send me a       **
//**     PostCard - see the documentation, or contact me for more           **
//**     information.                                                       **
//**                                                                        **
//**     Please notify me if you make any changes to this file.             **
//**     Email: cjq@bigfoot.com                                             **
//**                                                                        **
//*** http://cjq126.126.com/ *************************************************

#ifndef __TDLPortIO_H__
#define __TDLPortIO_H__

//---------------------------------------------------------------------------
// DLL Import Types
//    Pointer to functions, to dynamically link into the DLL
//---------------------------------------------------------------------------

typedef unsigned char UCHAR;    // BYTE
typedef unsigned short USHORT;  // WORD
typedef unsigned long ULONG;    // DWORD

typedef UCHAR (__stdcall *TDlPortReadPortUchar)(ULONG Port);
typedef USHORT (__stdcall *TDlPortReadPortUshort)(ULONG Port);
typedef ULONG (__stdcall *TDlPortReadPortUlong)(ULONG Port);

typedef void (__stdcall *TDlPortWritePortUchar)(ULONG Port, UCHAR Value);
typedef void (__stdcall *TDlPortWritePortUshort)(ULONG Port, USHORT Value);
typedef void (__stdcall *TDlPortWritePortUlong)(ULONG Port, ULONG Value);

typedef void (__stdcall *TDlPortReadPortBufferUchar)(ULONG Port, UCHAR *Buffer, ULONG Count);
typedef void (__stdcall *TDlPortReadPortBufferUshort)(ULONG Port, USHORT *Buffer, ULONG Count);
typedef void (__stdcall *TDlPortReadPortBufferUlong)(ULONG Port, ULONG *Buffer, ULONG Count);

typedef void (__stdcall *TDlPortWritePortBufferUchar)(ULONG Port, UCHAR *Buffer, ULONG Count);
typedef void (__stdcall *TDlPortWritePortBufferUshort)(ULONG Port, USHORT *Buffer, ULONG Count);
typedef void (__stdcall *TDlPortWritePortBufferUlong)(ULONG Port, ULONG *Buffer, ULONG Count);


//---------------------------------------------------------------------------
// Data Types
//---------------------------------------------------------------------------

// Specifies the type of read or write in a TPortCommand
typedef enum {tmReadByte,  tmReadWord,  tmReadDWord,
              tmWriteByte, tmWriteWord, tmWriteDWord} TMode;


// Specifies the data required to do a block
// read/write of an array of port records.
// Extends the model TVicHW32/TVicPort uses
typedef struct
{
   WORD PortAddr;    // The address of the port to read/write
   union             // The data to read/write
   {
      BYTE  Byte;
      WORD  Word;
      DWORD DWord;
   } PortData;
   TMode PortMode;   // The mode of reading/writing
} TPortCommand;


// Standard TVicHW32/TVicPort PortRec for compatibility
typedef struct
{
   WORD PortAddr;
   BYTE PortData;
   bool fWrite;
} TPortRec;


//---------------------------------------------------------------------------
// TDLPortIO class
//    This is supposed to be compatible with TVicPort
//---------------------------------------------------------------------------

class TDLPortIO : public TComponent
{
private:
   bool FActiveHW;     // Is the DLL loaded?
   bool FHardAccess;   // Not used: for compatibility only
   bool FRunningWinNT; // True when we're running Windows NT

   HINSTANCE FDLLInst; // For use with DLL
   SC_HANDLE hSCMan;   // For use with WinNT Service Control Manager

   AnsiString FDriverPath; // Full path of WinNT driver
   AnsiString FDLLPath;    // Full path of DriverLINX DLL
   AnsiString FLastError;  // Last error which occurred in Open/CloseDriver()

   // Used for the Windows NT version only
   bool FDrvPrevInst;   // DriverLINX driver already installed?
   bool FDrvPrevStart;  // DriverLINX driver already running?

   // Connects and disconnects to the WinNT Service Control Manager
   bool ConnectSCM();
   void DisconnectSCM();

   // Installs, starts, stops and removes the WinNT kernel mode driver
   bool DriverInstall();
   bool DriverStart();
   bool DriverStop();
   bool DriverRemove();

   // Pointers to the functions within the DLL
   TDlPortReadPortUchar  DlReadByte;
   TDlPortReadPortUshort DlReadWord;
   TDlPortReadPortUlong  DlReadDWord;

   TDlPortWritePortUchar  DlWriteByte;
   TDlPortWritePortUshort DlWriteWord;
   TDlPortWritePortUlong  DlWriteDWord;

   TDlPortReadPortBufferUchar  DlReadBufferByte;
   TDlPortReadPortBufferUshort DlReadBufferWord;
   TDlPortReadPortBufferUlong  DlReadBufferDWord;

   TDlPortWritePortBufferUchar  DlWriteBufferByte;
   TDlPortWritePortBufferUshort DlWriteBufferWord;
   TDlPortWritePortBufferUlong  DlWriteBufferDWord;

protected:
   // returns true if the DLL/Driver is loaded
   bool __fastcall IsLoaded()
      { return FActiveHW; }

   // Wrappers for the properties below
   BYTE __fastcall GetPortByte(WORD Address)
     { return DlReadByte(Address); }
   void __fastcall SetPortByte(WORD Address, BYTE Data)
     { DlWriteByte(Address, Data); }
   WORD __fastcall GetPortWord(WORD Address)
     { return DlReadWord(Address); }
   void __fastcall SetPortWord(WORD Address, WORD Data)
     { DlWriteWord(Address, Data); }
   DWORD __fastcall GetPortDWord(WORD Address)
     { return DlReadDWord(Address); }
   void __fastcall SetPortDWord(WORD Address, DWORD Data)
     { DlWriteDWord(Address, Data); }

public:
   // Constructor
   __fastcall TDLPortIO(TComponent *Owner);
   // Destructor
   __fastcall ~TDLPortIO();

   // These open and close the DLL/Driver
   void __fastcall OpenDriver();
   void __fastcall CloseDriver();

   // Allows write/read array of ports.
   void __fastcall PortControl(TPortRec Ports[], WORD NumPorts);
   void __fastcall PortCommand(TPortCommand Ports[], WORD NumPorts);

   // Allows read/write array of bytes from single port.
   void __fastcall ReadPortFIFO(WORD PortAddr, WORD NumPorts, BYTE Buffer[])
     { DlReadBufferByte(PortAddr, Buffer, NumPorts); }
   void __fastcall WritePortFIFO(WORD PortAddr, WORD NumPorts, BYTE Buffer[])
     { DlWriteBufferByte(PortAddr, Buffer, NumPorts); }

   // Extended block read/write routines for WORD and DWORD
   void __fastcall ReadWPortFIFO(WORD PortAddr, WORD NumPorts, WORD Buffer[])
     { DlReadBufferWord(PortAddr, Buffer, NumPorts); }
   void __fastcall WriteWPortFIFO(WORD PortAddr, WORD NumPorts, WORD Buffer[])
     { DlWriteBufferWord(PortAddr, Buffer, NumPorts); }
   void __fastcall ReadLPortFIFO(WORD PortAddr, WORD NumPorts, DWORD Buffer[])
     { DlReadBufferDWord(PortAddr, Buffer, NumPorts); }
   void __fastcall WriteLPortFIFO(WORD PortAddr, WORD NumPorts, DWORD Buffer[])
     { DlWriteBufferDWord(PortAddr, Buffer, NumPorts); }

   // Access any port as you like, similar to the old pascal way of doing things
   __property BYTE Port[WORD Address]={read=GetPortByte,write=SetPortByte};
   __property WORD PortW[WORD Address]={read=GetPortWord,write=SetPortWord};
   __property DWORD PortL[WORD Address]={read=GetPortDWord,write=SetPortDWord};

__published:
   // Sets the path (no ending \, nor any filename) of the DLPortIO.SYS file
   // Assumed to be <windows system directory>\DRIVERS if not specified
   // Has no effect if the DriverLINX driver is already installed
   __property AnsiString DriverPath={read=FDriverPath,write=FDriverPath};

   // Sets the path (no ending \, nor any filename) of the DLPortIO.DLL file
   // Assumed to be "" if not specified, meaning it will search the program
   // path, windows directory and computer's path for the DLL
   __property AnsiString DLLPath={read=FDLLPath,write=FDLLPath};

   // True when the DLL/Driver has been loaded successfully after OpenDriver()
   __property bool ActiveHW={read=FActiveHW};
   // This doesn't really do anything; provided for compatibility only
   __property bool HardAccess={read=FHardAccess,write=FHardAccess,default=true};

   // Returns the last error which occurred in Open/CloseDriver()
   __property AnsiString LastError={read=FLastError};
};


//---------------------------------------------------------------------------
// TDLPrinterPortIO class
//    This is supposed to be compatible with TVicLPT
//---------------------------------------------------------------------------

class TDLPrinterPortIO : public TDLPortIO
{
private:
   // Masks
   static const BYTE BIT0 = 0x01;
   static const BYTE BIT1 = 0x02;
   static const BYTE BIT2 = 0x04;
   static const BYTE BIT3 = 0x08;
   static const BYTE BIT4 = 0x10;
   static const BYTE BIT5 = 0x20;
   static const BYTE BIT6 = 0x40;
   static const BYTE BIT7 = 0x80;

   // Printer Port pin numbers
   static const ACK_PIN       = 10;
   static const BUSY_PIN      = 11;
   static const PAPEREND_PIN  = 12;
   static const SELECTOUT_PIN = 13;
   static const ERROR_PIN     = 15;
   static const STROBE_PIN    = 1;
   static const AUTOFD_PIN    = 14;
   static const INIT_PIN      = 16;
   static const SELECTIN_PIN  = 17;

private:
   BYTE FLPTNumber;    // Current number of the printer port, default=1
   WORD FLPTBase;      // The address of the current printer port (faster)

protected:
    BYTE __fastcall GetLPTNumPorts();
    WORD __fastcall GetLPTBasePort();
    void __fastcall SetLPTNumber(BYTE Number);

    bool __fastcall GetPin(BYTE Index);
    void __fastcall SetPin(BYTE Index, bool State);

    bool __fastcall GetLPTAckwl()    { return GetPin(ACK_PIN); }
    bool __fastcall GetLPTBusy()     { return GetPin(BUSY_PIN); }
    bool __fastcall GetLPTPaperEnd() { return GetPin(PAPEREND_PIN); }
    bool __fastcall GetLPTSlct()     { return GetPin(SELECTOUT_PIN); }
    bool __fastcall GetLPTError()    { return GetPin(ERROR_PIN); }

public:
   // Constructor
   __fastcall TDLPrinterPortIO(TComponent *Owner);

   // Sends STROBE signal to the printer
   void __fastcall LPTStrobe();
   // Sends AUTOFD (auto line feed) signal to the printer
   void __fastcall LPTAutofd(bool Flag);
   // Resets printer by sending INIT signal
   void __fastcall LPTInit();
   // Sends SLCTIN signal to the printer
   void __fastcall LPTSlctIn();
   // Sends a character to the printer.
   // Returns true on success. Repeat as neccessary.
   bool __fastcall LPTPrintChar(char Ch);

   // Index valid is in the range 1-25 only (other values return false)
   // Reading the pin returns true when it is 5V, or false when it at 0V.
   // Writing true sets the pin to 5V, or 0V when false.
   __property bool Pin[BYTE Index]={read=GetPin,write=SetPin};

   // Returns ACKWL state from the printer
   __property bool LPTAckwl={read=GetLPTAckwl};
   // Returns BUSY state from the printer
   __property bool LPTBusy={read=GetLPTBusy};
   // Returns PAPER END state from the printer
   __property bool LPTPaperEnd={read=GetLPTPaperEnd};
   // Returns SLCT state from the printer
   __property bool LPTSlct={read=GetLPTSlct};
   // Returns ERROR state from the printer
   __property bool LPTError={read=GetLPTError};

__published:
   // Shows how many LPT ports are installed on your PC.
   // Always returns 3...
   __property BYTE LPTNumPorts={read=GetLPTNumPorts};
   // Selects the LPT port to use for all LPT operations
   __property BYTE LPTNumber={read=FLPTNumber,write=SetLPTNumber,default=1};
   // Returns a base address of the current LPT port.
   // Assumes LPT1=0x378, LPT2=0x278, LPT3=0x3BC
   __property WORD LPTBasePort={read=GetLPTBasePort};
};


//---------------------------------------------------------------------------
// Inline Functions
//---------------------------------------------------------------------------


//---------------------------------------------------------------------------
// GetLPTNumPort()
//---------------------------------------------------------------------------
inline
BYTE __fastcall TDLPrinterPortIO::GetLPTNumPorts()
{
   // Not sure yet... assume they've got three ports?
   return 3;
}


//---------------------------------------------------------------------------
// GetLPTBasePort()
//---------------------------------------------------------------------------
inline
WORD __fastcall TDLPrinterPortIO::GetLPTBasePort()
{
   return FLPTBase;
}


//---------------------------------------------------------------------------
// LPTStrobe()
//    Sends STROBE signal to the printer
//---------------------------------------------------------------------------
inline
void __fastcall TDLPrinterPortIO::LPTStrobe()
{
   // Set to strobe pin to 0V
   SetPin(STROBE_PIN, false);
   // Wait one millisecond
   Sleep(1);
   // Set strobe pin back to 5V
   SetPin(STROBE_PIN, true);
}


//---------------------------------------------------------------------------
// LPTAutofd()
//    Sends AUTOFD (auto line feed) signal to the printer
//---------------------------------------------------------------------------
inline
void __fastcall TDLPrinterPortIO::LPTAutofd(bool Flag)
{
   // Set the auto line feed pin
   SetPin(AUTOFD_PIN, Flag);
}


//---------------------------------------------------------------------------
// LPTInit()
//    Resets printer by sending INIT signal
//---------------------------------------------------------------------------
inline
void __fastcall TDLPrinterPortIO::LPTInit()
{
   // Set pin to a 0V
   SetPin(INIT_PIN, false);
   // Wait 1 ms
   Sleep(1);
   // Set pin back to 5V
   SetPin(INIT_PIN, true);
}


//---------------------------------------------------------------------------
// LPTSlctIn()
//    Sends SLCTIN signal to the printer
//---------------------------------------------------------------------------
inline
void __fastcall TDLPrinterPortIO::LPTSlctIn()
{
   // Send the signal (0V)
   SetPin(SELECTIN_PIN, false);
}


#endif

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品精品国产色婷婷| 国产在线乱码一区二区三区| 全国精品久久少妇| 成人免费av网站| 日韩欧美在线不卡| 亚洲欧洲美洲综合色网| 日本va欧美va精品| 91免费观看在线| 久久久777精品电影网影网| 亚洲福利国产精品| 成人av在线网站| ww亚洲ww在线观看国产| 婷婷国产v国产偷v亚洲高清| 色婷婷av一区二区三区大白胸| 久久久亚洲综合| 天天亚洲美女在线视频| 日本道色综合久久| 欧美激情中文字幕一区二区| 免费成人av在线| 91精品国产麻豆国产自产在线 | 亚洲激情自拍视频| 国产一区二区三区免费| 日韩精品一区二区三区四区| 日韩黄色在线观看| 欧美午夜精品久久久久久超碰| 国产精品国产三级国产aⅴ无密码 国产精品国产三级国产aⅴ原创 | 中文字幕第一页久久| 国产一区二区精品久久| 欧美电影免费观看完整版 | 亚洲日本va在线观看| 欧美日韩中文字幕精品| 中文字幕一区二区不卡| av电影天堂一区二区在线观看| 国产午夜精品久久久久久久| 国内精品国产三级国产a久久| 日韩女同互慰一区二区| 九色综合国产一区二区三区| 欧美变态口味重另类| 国产一区二区电影| 26uuu欧美日本| 国产不卡在线一区| 国产精品国产三级国产| 91视频在线看| 亚洲动漫第一页| 3d动漫精品啪啪| 久久国内精品自在自线400部| 精品国产91洋老外米糕| 国产成人av一区二区三区在线| 国产欧美日韩不卡| 色哟哟亚洲精品| 偷拍日韩校园综合在线| 日韩欧美一区二区免费| 成人一区二区三区视频| 一区视频在线播放| 欧美视频中文一区二区三区在线观看| 亚洲国产日韩精品| 日韩欧美国产一二三区| 国产v日产∨综合v精品视频| 日韩理论片中文av| 欧美丰满嫩嫩电影| 国产精一品亚洲二区在线视频| 国产日韩欧美制服另类| 日本久久电影网| 秋霞成人午夜伦在线观看| 欧美激情一区二区三区| 欧美色图12p| 国产精品一区二区无线| 亚洲一区二区视频在线观看| 欧美一区二区精品| 91原创在线视频| 另类小说一区二区三区| 亚洲女女做受ⅹxx高潮| 伊人性伊人情综合网| 日韩一区二区三区精品视频| 丰满少妇久久久久久久| 亚洲国产成人精品视频| 中文字幕的久久| 日韩欧美自拍偷拍| 在线观看一区不卡| 国产精品一区二区在线观看不卡| 亚洲一区二区三区爽爽爽爽爽| 国产丝袜美腿一区二区三区| 欧美日本一区二区在线观看| 国产成人av资源| 日本成人在线视频网站| 亚洲欧美另类在线| 久久久国产一区二区三区四区小说 | 精久久久久久久久久久| 亚洲国产婷婷综合在线精品| 国产精品美女久久久久aⅴ| 日韩欧美国产三级| 欧美日韩精品系列| 91麻豆精品在线观看| 国产酒店精品激情| 裸体歌舞表演一区二区| 亚洲电影第三页| 亚洲免费色视频| 国产精品女主播av| 国产女同性恋一区二区| 精品国精品国产| 亚洲精品国产无套在线观| 欧美经典一区二区| 国产日韩亚洲欧美综合| 久久影院电视剧免费观看| 日韩欧美一区电影| 日韩欧美成人激情| 欧美一级日韩免费不卡| 欧美精品欧美精品系列| 欧美亚洲禁片免费| 在线观看av一区二区| 色婷婷久久久综合中文字幕| 91色九色蝌蚪| 99re视频精品| 色婷婷精品大在线视频 | 亚洲欧美另类在线| 亚洲色图在线视频| 日韩毛片精品高清免费| 中文字幕一区在线| 自拍视频在线观看一区二区| 国产精品国产自产拍高清av王其| 欧美高清一级片在线观看| 国产欧美一区二区精品性色| 国产日本亚洲高清| 国产精品久久精品日日| 亚洲欧美视频一区| 亚洲一二三四区| 日韩成人av影视| 久久精品国产一区二区三 | 91亚洲精华国产精华精华液| av亚洲精华国产精华| 色综合久久综合中文综合网| 欧美午夜精品免费| 日韩一级完整毛片| 久久精品亚洲精品国产欧美| 欧美韩日一区二区三区四区| 亚洲另类春色国产| 日韩中文字幕不卡| 国产美女精品人人做人人爽| 99re热这里只有精品免费视频| 欧美主播一区二区三区| 日韩视频在线你懂得| 国产精品色哟哟网站| 亚洲国产成人va在线观看天堂| 久久国产欧美日韩精品| av一区二区不卡| 91精品国产综合久久久蜜臀粉嫩| 精品国产麻豆免费人成网站| 亚洲欧美在线另类| 日韩电影在线免费观看| 国产精品系列在线观看| 91色|porny| 26uuu欧美日本| 一区二区三区波多野结衣在线观看| 日韩电影在线一区二区三区| 成人午夜私人影院| 51精品秘密在线观看| 国产视频在线观看一区二区三区| 亚洲一区二区三区中文字幕在线| 麻豆freexxxx性91精品| 99久久免费视频.com| 日韩欧美资源站| 亚洲伦理在线精品| 国产呦精品一区二区三区网站| 色欧美乱欧美15图片| 欧美精品一区二区三区蜜桃| 亚洲一区免费在线观看| 成a人片国产精品| 日韩一级片网站| 一区二区三区日本| 成人午夜视频福利| 日韩久久精品一区| 亚洲高清在线视频| 91网站在线播放| 日本一区二区免费在线 | 精品国免费一区二区三区| 亚洲美女在线国产| 国产盗摄女厕一区二区三区| 日韩丝袜美女视频| 午夜视频在线观看一区二区| 91丝袜呻吟高潮美腿白嫩在线观看| xf在线a精品一区二区视频网站| 日日夜夜精品视频天天综合网| av在线免费不卡| 久久精品人人做人人爽人人| 麻豆精品久久久| 欧美日韩精品久久久| 樱花影视一区二区| 成人一区在线观看| 久久精品这里都是精品| 激情六月婷婷久久| 日韩免费看的电影| 日韩高清不卡在线| 制服丝袜中文字幕一区| 亚洲无人区一区| 在线视频一区二区三| 亚洲人成网站影音先锋播放| 99麻豆久久久国产精品免费 | 欧美一区二区福利视频| 亚洲一区二区三区四区在线免费观看 | 91精品视频网|