|
发表于 2008-6-17 13:16:14
|
显示全部楼层
WINIO在VISTA下可以直接用的,不需要去重新编译
3 i+ v# }7 K6 u [DllImport("winio.dll")]
8 x. b" B% t5 W! A7 B* b- M" g p public static extern bool InitializeWinIo();1 l/ B, O* M" }1 f. `, I0 l
[DllImport("winio.dll")]: \5 [& s" A) U6 b) k; U1 V
public static extern bool GetPortVal(IntPtr wPortAddr, out int pdwPortVal, byte bSize);
* u1 f K: J/ j! }! v [DllImport("winio.dll")]( p4 A1 ?; I. v& c, T/ `* q; E7 Q
public static extern bool SetPortVal(uint wPortAddr, IntPtr dwPortVal, byte bSize);* D6 a- s5 c5 Q9 B* }
[DllImport("winio.dll")]9 c, } d3 E- \5 J
public static extern byte MapPhysToLin(byte pbPhysAddr, uint dwPhysSize, IntPtr PhysicalMemoryHandle);. Z6 N' H! n. S9 `: I" o- A
[DllImport("winio.dll")]
) C) I% f7 \; h. m& L public static extern bool UnmapPhysicalMemory(IntPtr PhysicalMemoryHandle, byte pbLinAddr);
1 Y, p* V2 S+ D5 \! c [DllImport("winio.dll")]
" e# R. a; Q$ q/ i; } public static extern bool GetPhysLong(IntPtr pbPhysAddr, byte pdwPhysVal);$ @6 x" ^- p! ~( c0 ]) o
[DllImport("winio.dll")]1 W! s. t/ K. d& a$ ~
public static extern bool SetPhysLong(IntPtr pbPhysAddr, byte dwPhysVal);
b% e" u' F, `6 U4 f) n- o [DllImport("winio.dll")]
' i9 \: Q( K& e# w. A public static extern void ShutdownWinIo(); |
|