|
|
发表于 2008-6-17 13:16:14
|
显示全部楼层
WINIO在VISTA下可以直接用的,不需要去重新编译! K- n2 s* J- Q* e0 V4 ~1 e1 B
[DllImport("winio.dll")]$ K2 X+ o) q+ E6 L( y: y
public static extern bool InitializeWinIo();
) L7 ^2 P2 y% g( f% t. } [DllImport("winio.dll")]2 s7 ~1 e" z [ r
public static extern bool GetPortVal(IntPtr wPortAddr, out int pdwPortVal, byte bSize);
/ a F2 z# D& k) G) A8 ^1 \) q& c ^ [DllImport("winio.dll")]; o3 K% d1 V+ q: R
public static extern bool SetPortVal(uint wPortAddr, IntPtr dwPortVal, byte bSize);
' _" `& c6 M5 M0 v [DllImport("winio.dll")]
& i, E4 i) {6 o* S; z% O8 y public static extern byte MapPhysToLin(byte pbPhysAddr, uint dwPhysSize, IntPtr PhysicalMemoryHandle);
Y+ K+ z# [9 N- a4 q2 x6 \, G [DllImport("winio.dll")]
1 X' u s8 \- m' }% j+ o* Z: P public static extern bool UnmapPhysicalMemory(IntPtr PhysicalMemoryHandle, byte pbLinAddr);+ ~3 s5 B4 P. F. l% O
[DllImport("winio.dll")]
" p3 c8 |' M7 X" ]/ B. G# { public static extern bool GetPhysLong(IntPtr pbPhysAddr, byte pdwPhysVal);
* M$ B) Y; \' R0 c [DllImport("winio.dll")]# S; L" t: z1 V" M- w2 Q
public static extern bool SetPhysLong(IntPtr pbPhysAddr, byte dwPhysVal);4 ]# l& e, ?9 O2 W) i( F. @& z$ X
[DllImport("winio.dll")]
0 ~ O# T/ n2 |- | public static extern void ShutdownWinIo(); |
|