Attribute VB_Name = "Module1" Public Declare Function InPortB Lib "ACCES32.dll" Alias "VBInPortB" (ByVal Port As Long) As Integer Public Declare Function OutPortB Lib "ACCES32.dll" Alias "VBOutPortB" (ByVal Port As Long, ByVal Value As Byte) As Integer Public Declare Sub Sleep Lib "kernel32.dll" (ByVal dwMilliseconds As Long) Public Declare Function RegOpenKeyEx Lib "advapi32.dll" Alias "RegOpenKeyExA" (ByVal hKey As Long, ByVal lpSubKey As String, ByVal ulOptions As Long, ByVal samDesired As Long, phkResult As Long) As Long Public Declare Function RegQueryValueEx Lib "advapi32.dll" Alias "RegQueryValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal lpReserved As Long, lpType As Long, lpData As Any, lpcbData As Long) As Long ' Note that if you declare the lpData parameter as String, you must pass it By Value. Public Declare Function RegCloseKey Lib "advapi32.dll" (ByVal hKey As Long) As Long Public Const HKEY_LOCAL_MACHINE = &H80000002 Public Const KEY_QUERY_VALUE = &H1 Public Type TPCI_COMMON_CONFIG VendorID As Integer DeviceID As Integer Command As Integer Status As Integer RevisionID As Byte ProgIf As Byte SubClass As Byte BaseClass As Byte CacheLineSize As Byte LatencyTimer As Byte HeaderType As Byte BIST As Byte BaseAddresses(5) As Long Reserved1(1) As Long RomBaseAddress As Long Reserved2(1) As Long InterruptLine As Byte InterruptPin As Byte MinimumGrant As Byte MaximumLatency As Byte End Type Public Function ShiftRight(ByVal InitNum As Long, ByVal BitsRight As Long) As Long 'Performs a bitwise right-shift. This is equivalent to C++'s >> operator. ShiftRight = CLng(InitNum / (2 ^ BitsRight)) End Function Public Function ShiftLeft(ByVal InitNum As Long, ByVal BitsLeft As Long) As Long 'Performs a bitwise left-shift. This is equivalent to C++'s << operator. 'C++: ' 1024 << 8 //Shift left 8 bits 'VB: ' ShiftLeft(1024, 8) 'Shift left 8 bits ShiftLeft = CLng(InitNum * (2 ^ BitsLeft)) End Function