📄 hw_32.hpp
字号:
// Borland C++ Builder
// Copyright (c) 1995, 1999 by Borland International
// All rights reserved
// (DO NOT EDIT: machine generated header) 'HW_32.pas' rev: 4.00
#ifndef HW_32HPP
#define HW_32HPP
#pragma delphiheader begin
#pragma option push -w-
#include <Windows.hpp> // Pascal unit
#include <Classes.hpp> // Pascal unit
#include <SysUtils.hpp> // Pascal unit
#include <SysInit.hpp> // Pascal unit
#include <System.hpp> // Pascal unit
//-- user supplied -----------------------------------------------------------
namespace Hw_32
{
//-- type declarations -------------------------------------------------------
typedef unsigned __stdcall (*TOpenVxdHandle)(unsigned Ev);
#pragma pack(push, 4)
struct HW_32__1
{
Word PortAddr;
Byte PortData;
bool fWrite;
} ;
#pragma pack(pop)
typedef HW_32__1 PortRec[65535];
typedef HW_32__1 *pPortRec;
#pragma pack(push, 4)
struct HW_32__2
{
Word PortAddr;
Word PortData;
bool fWrite;
} ;
#pragma pack(pop)
typedef HW_32__2 PortWRec[65535];
typedef HW_32__2 *pPortWRec;
#pragma pack(push, 4)
struct HW_32__3
{
Word PortAddr;
unsigned PortData;
bool fWrite;
} ;
#pragma pack(pop)
typedef HW_32__3 PortLRec[65535];
typedef HW_32__3 *pPortLRec;
#pragma pack(push, 4)
struct TLockedBuffer
{
unsigned Drv_IRQ_Counter;
Word ScanCode;
Word MAX_BUF_LPT;
Word LPT_BASE_PORT;
Word L_BUF_LPT;
Word N_ADD_LPT;
Word N_SEL_LPT;
Word BUF_LPT[512];
} ;
#pragma pack(pop)
typedef TLockedBuffer *PLockedBuffer;
typedef void __fastcall (__closure *TInterruptHandler)(System::TObject* Sender, int HwCounter, Byte
LPT_DataReg, Byte LPT_StatusReg, Byte Keyb_ScanCode);
typedef Word TLPTAddresses[3];
typedef Word *PLPTAddresses;
typedef unsigned SC_HANDLE;
class DELPHICLASS TVicHw32;
#pragma pack(push, 4)
class PASCALIMPLEMENTATION TVicHw32 : public Classes::TComponent
{
typedef Classes::TComponent inherited;
private:
char fDriverName[8];
System::SmallString<8> fSDriverName;
char fPathToDriver[129];
char fShortPathToDriver[13];
unsigned hDrv;
unsigned hDll;
bool fWin95;
bool fRegistry;
bool fStarted;
unsigned schSCManager;
bool fTerminated;
unsigned fInterface;
unsigned fBus;
unsigned fPhysLoPart;
unsigned fPhysHiPart;
unsigned fTypeMem;
unsigned fMemorySize;
void *fMappedPointers[16];
unsigned fMappedSizes[16];
unsigned fMappedAddresses[16];
Word fMappedAreas;
void *fpLockedMemory;
void *fMdl;
unsigned fLocEvent;
unsigned fDebugCode;
bool fHardAccess;
bool fOpenDrive;
TInterruptHandler fOnHwInterrupt;
bool fIsIRQSet;
Byte fIRQNumber;
bool fMasked;
unsigned fThreadId;
unsigned fThreadHandle;
unsigned hDrvEvent;
TOpenVxdHandle OpenVxdHandle;
Word *fLPTAddresses;
Word fLPTBasePort;
Byte fDataPorts[3];
Byte fLPTNumber;
Byte fLPTs;
bool __fastcall InstallDriver(void);
bool __fastcall StartDriver(void);
bool __fastcall StopDriver(void);
bool __fastcall RemoveDriver(void);
void __fastcall CloseStopUnloadDriver(void);
void __fastcall InstallStartLoadDriver(void);
unsigned __fastcall CtlCode(unsigned Code);
void __fastcall ClearFields(void);
void __fastcall SetHardAccess(bool parm);
void __fastcall SetLPTNumber(Byte nNewValue);
void __fastcall SetIRQMasked(bool bNewValue);
void __fastcall SetIRQNumber(Byte nNewValue);
bool __fastcall GetLPTAckwl(void);
bool __fastcall GetLPTBusy(void);
bool __fastcall GetLPTPaperEnd(void);
bool __fastcall GetLPTSlct(void);
bool __fastcall GetLPTError(void);
Byte __fastcall GetPortB(Word PortAddr);
void __fastcall SetPortB(Word PortAddr, Byte nNewValue);
Word __fastcall GetPortW(Word PortAddr);
void __fastcall SetPortW(Word PortAddr, Word nNewValue);
unsigned __fastcall GetPortL(Word PortAddr);
void __fastcall SetPortL(Word PortAddr, unsigned nNewValue);
bool __fastcall GetPin(Byte nPin);
void __fastcall SetPin(Byte nPin, bool bNewValue);
Byte __fastcall GetMemB(void * MappedAddr, unsigned Offset);
void __fastcall SetMemB(void * MappedAddr, unsigned Offset, Byte nNewValue);
Word __fastcall GetMemW(void * MappedAddr, unsigned Offset);
void __fastcall SetMemW(void * MappedAddr, unsigned Offset, Word nNewValue);
unsigned __fastcall GetMemL(void * MappedAddr, unsigned Offset);
void __fastcall SetMemL(void * MappedAddr, unsigned Offset, unsigned nNewValue);
public:
__fastcall virtual TVicHw32(Classes::TComponent* Owner);
__fastcall virtual ~TVicHw32(void);
void __fastcall CloseDriver(void);
bool __fastcall OpenDriver(void);
void * __fastcall MapPhysToLinear(unsigned PhAddr, unsigned PhSize);
void __fastcall UnmapMemory(unsigned PhAddr, unsigned PhSize);
bool __fastcall LPTPrintChar(char ch);
void __fastcall LPTStrobe(void);
void __fastcall LPTAutofd(bool Flag);
void __fastcall LPTInit(void);
void __fastcall LPTSlctIn(void);
void __fastcall PortControl(pPortRec Ports, Word NumPorts);
void __fastcall ReadPortFIFO(Word PortAddr, Word NumPorts, void *Buffer);
void __fastcall WritePortFIFO(Word PortAddr, Word NumPorts, void *Buffer);
void __fastcall ReadPortWFIFO(Word PortAddr, Word NumPorts, void *Buffer);
void __fastcall WritePortWFIFO(Word PortAddr, Word NumPorts, void *Buffer);
__property Byte Port[Word Index] = {read=GetPortB, write=SetPortB};
__property Word PortW[Word Index] = {read=GetPortW, write=SetPortW};
__property unsigned PortL[Word Index] = {read=GetPortL, write=SetPortL};
__property Byte Mem[void * Base][unsigned Offset] = {read=GetMemB, write=SetMemB};
__property Word MemW[void * Base][unsigned Offset] = {read=GetMemW, write=SetMemW};
__property unsigned MemL[void * Base][unsigned Offset] = {read=GetMemL, write=SetMemL};
__property bool IRQMasked = {read=fMasked, write=SetIRQMasked, nodefault};
__property bool LPTAckwl = {read=GetLPTAckwl, nodefault};
__property bool LPTBusy = {read=GetLPTBusy, nodefault};
__property bool LPTPaperEnd = {read=GetLPTPaperEnd, nodefault};
__property bool LPTSlct = {read=GetLPTSlct, nodefault};
__property bool LPTError = {read=GetLPTError, nodefault};
__property Byte LPTNumPorts = {read=fLPTs, nodefault};
__property Word LPTBasePort = {read=fLPTBasePort, nodefault};
__property unsigned DebugCode = {read=fDebugCode, nodefault};
__property bool Pin[Byte Index] = {read=GetPin, write=SetPin};
__published:
__property bool ActiveHW = {read=fOpenDrive, nodefault};
__property TInterruptHandler OnHwInterrupt = {read=fOnHwInterrupt, write=fOnHwInterrupt};
__property Byte LPTNumber = {read=fLPTNumber, write=SetLPTNumber, default=1};
__property Byte IRQNumber = {read=fIRQNumber, write=SetIRQNumber, nodefault};
__property bool HardAccess = {read=fHardAccess, write=SetHardAccess, default=1};
};
#pragma pack(pop)
//-- var, const, procedure ---------------------------------------------------
static const Shortint MaxPins = 0x11;
static const Word MAX_RING_BUFFER = 0x1ff;
static const Shortint MaxMappedAreas = 0x10;
static const Shortint _DRV_MAP_MEMORY = 0x2;
static const Shortint _DRV_UNMAP_MEMORY = 0x3;
static const Shortint _DRV_SET_POST_EVENT = 0x5;
static const Shortint _DRV_SET_INT_VEC = 0x6;
static const Shortint _DRV_MASK_INT_VEC = 0x7;
static const Shortint _DRV_UNMASK_INT_VEC = 0x8;
static const Shortint _DRV_STOP_INT_VEC = 0x9;
static const Shortint _DRV_PORT_CONTROL = 0xa;
static const Shortint _DRV_HARD_READ_PORT = 0xb;
static const Shortint _DRV_HARD_WRITE_PORT = 0xc;
static const Shortint _DRV_HARD_READ_PORTW = 0xd;
static const Shortint _DRV_HARD_WRITE_PORTW = 0xe;
static const Shortint _DRV_HARD_READ_PORTL = 0xf;
static const Shortint _DRV_HARD_WRITE_PORTL = 0x10;
static const Shortint _DRV_READ_FIFO = 0x12;
static const Shortint _DRV_WRITE_FIFO = 0x13;
static const Shortint _DRV_READ_FIFO_WORD = 0x14;
static const Shortint _DRV_WRITE_FIFO_WORD = 0x15;
static const Shortint _DRV_READ_FIFO_LONG = 0x16;
static const Shortint _DRV_WRITE_FIFO_LONG = 0x17;
static const Shortint _DRV_LOCK_MEMORY = 0x18;
static const Shortint _DRV_UNLOCK_MEMORY = 0x19;
static const Shortint _DRV_MAP_LPT_AREA = 0x1a;
static const Shortint _DRV_UNMAP_LPT_AREA = 0x1b;
static const Shortint _DRV_SOFT_ACCESS = 0x1f;
static const Shortint _DRV_HARD_ACCESS = 0x20;
extern PACKAGE unsigned schSCManager;
extern "C" unsigned __stdcall OpenScManager(unsigned N1, unsigned N2, unsigned A);
extern "C" BOOL __stdcall CloseServiceHandle(unsigned ScHandle);
extern "C" unsigned __stdcall CreateService(unsigned hSCManager, char * lpServiceName, char * lpDisplayName
, unsigned dwDesiredAccess, unsigned dwServiceType, unsigned dwStartType, unsigned dwErrorControl,
char * lpBinaryPathName, char * lpLoadOrderGroup, PDWORD lpdwTagId, char * lpDependencies, char * lpServiceStartName
, char * lpPassword);
extern "C" unsigned __stdcall OpenService(unsigned hSCManager, char * lpServiceName, unsigned dwDesiredAccess
);
extern "C" BOOL __stdcall StartService(unsigned hService, unsigned dwNumServiceArgs, char * lpServiceArgVectors
);
extern "C" BOOL __stdcall ControlService(unsigned hService, unsigned dwControl, void * lpServiceStatus
);
extern "C" BOOL __stdcall DeleteService(unsigned hService);
extern PACKAGE Byte PinsPort[17];
extern PACKAGE bool Negative[17];
extern PACKAGE Byte MaskPins[17];
static const Shortint DEB_INST_OK = 0x1;
static const Shortint DEB_INST_ERR = 0x2;
static const Shortint DEB_START_OK = 0x4;
static const Shortint DEB_START_ERR = 0x8;
static const Shortint DEB_ENTRY = 0x10;
static const Shortint DEB_ENTRY_NOT_DEMO = 0x20;
static const Shortint DEB_NOT_STARTED = 0x40;
static const Byte DEB_RESERVED = 0x80;
static const Word DEB_SC_OPEN = 0x100;
static const Word DEB_SC_NOT_OPEN = 0x200;
static const Word DEB_INSTALLED = 0x400;
static const Word DEB_NOT_INSTALLED = 0x800;
static const Word DEB_AFTER_INSTALL = 0x1000;
static const Word DEB_AFTER_START = 0x2000;
extern PACKAGE void __fastcall Register(void);
} /* namespace Hw_32 */
#if !defined(NO_IMPLICIT_NAMESPACE_USE)
using namespace Hw_32;
#endif
#pragma option pop // -w-
#pragma delphiheader end.
//-- end unit ----------------------------------------------------------------
#endif // HW_32
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -