aardio 文档

winring0 库模块帮助文档

winring0 成员列表

ver 1.0.0.5
支持win7,但需要管理员权限
可在启动a代码文件(例如main.aardio)首行加上以下代码启用管理权限
//RUNAS//

winring0.Cpuid

dll.api("Cpuid","bool(INT index,INT &eax,INT &ebx,INT &ecx,INT &edx)");

winring0.CpuidPx

dll.api("CpuidPx","bool(INT index,INT &eax,INT &ebx,INT &ecx,INT &edx,INT processAffinityMask)");

winring0.CpuidTx

dll.api("CpuidTx","bool(INT index,INT &eax,INT &ebx,INT &ecx,INT &edx,INT threadAffinityMask)");

winring0.DeinitializeOls()

卸载驱动,库卸载时会自动调用该函数。

winring0.FindPciDeviceByClass

dll.api("FindPciDeviceByClass","INT( BYTE baseClass, BYTE subClass, BYTE programIf, BYTE index )");

winring0.FindPciDeviceById

dll.api("FindPciDeviceById","INT( WORD vendorId, WORD deviceId, BYTE index )");

winring0.GetDllStatus()

返回DLL状态码,以_OLS_DLL_前缀的常量表示不同状态,
0/*_OLS_DLL_NO_ERROR*/表示加载驱动成功

winring0.GetDllVersion()

返回版本号,返回四个值:
version,major,minor,revision,release

winring0.GetDriverType()

返回驱动类型,
OLS_DRIVER_TYPE_前缀常量表示不同类型

winring0.GetDriverVersion()

返回驱动版本号,返回四个值:
version,major,minor,revision,release

winring0.Hlt

dll.api("Hlt","bool()");

winring0.HltPx

dll.api("HltPx","bool(INT processAffinityMask)");

winring0.HltTx

dll.api("HltTx","bool(INT threadAffinityMask)");

winring0.InitializeOls()

加载驱动,成功返回true
导入库时会自动调用该函数

winring0.IsCpuid

dll.api("IsCpuid","bool()");

winring0.IsMsr

dll.api("IsMsr","bool()");

winring0.IsTsc

dll.api("IsTsc","bool()");

winring0.PciBusDevFunc

function(Bus, Dev, Func){
    return (Bus&0xFF)<<8) | ((Dev&0x1F)<<3) | (Func&7); 
}

winring0.PciGetBus

function(address){
    return ((address>>8) & 0xFF)
}

winring0.PciGetDev

function(address){
    return ((address>>3) & 0x1F)
}

winring0.PciGetFunc

function(address){
    return (address&7)
}

winring0.Rdmsr

dll.api("Rdmsr","bool(INT index,INT &eax,INT &edx )");

winring0.RdmsrPx

dll.api("RdmsrPx","bool(INT index,INT & eax,INT & edx, INT processAffinityMask)");

winring0.RdmsrTx

dll.api("RdmsrTx","bool(INT index,INT & eax,INT & edx, INT threadAffinityMask)");

winring0.Rdpmc

dll.api("Rdpmc","bool(INT index,INT & eax,INT &edx )");

winring0.RdpmcPx

dll.api("RdpmcPx","bool(INT index,INT & eax,INT &edx,INT processAffinityMask)");

winring0.RdpmcTx

dll.api("RdpmcTx","bool(INT index,INT & eax,INT &edx,INT threadAffinityMask)");

winring0.Rdtsc

dll.api("Rdtsc","bool(INT &eax,INT &edx )");

winring0.RdtscPx

dll.api("RdtscPx","bool(INT &eax,INT & edx,INT processAffinityMask)");

winring0.RdtscTx

dll.api("RdtscTx","bool(INT &eax,INT &edx,INT threadAffinityMask)");

winring0.ReadIoPortByte

dll.api("ReadIoPortByte","BYTE( WORD port )");

winring0.ReadIoPortByteEx

dll.api("ReadIoPortByteEx","int( WORD port, BYTE& value )");

winring0.ReadIoPortDword

dll.api("ReadIoPortDword","INT( WORD port )");

winring0.ReadIoPortDwordEx

dll.api("ReadIoPortDwordEx","int( WORD port, INT value )");

winring0.ReadIoPortWord

dll.api("ReadIoPortWord","WORD( WORD port )");

winring0.ReadIoPortWordEx

dll.api("ReadIoPortWordEx","int( WORD port, WORD& value )");

winring0.ReadPciConfigByte

dll.api("ReadPciConfigByte","BYTE(INT pciAddress, BYTE regAddress )");

winring0.ReadPciConfigByteEx

dll.api("ReadPciConfigByteEx","int(INT pciAddress, INT regAddress, BYTE& value )");

winring0.ReadPciConfigDword

dll.api("ReadPciConfigDword","INT(INT pciAddress, BYTE regAddress )");

winring0.ReadPciConfigDwordEx

dll.api("ReadPciConfigDwordEx","int(INT pciAddress, INT regAddress, INT value )");

winring0.ReadPciConfigWord

dll.api("ReadPciConfigWord","WORD(INT pciAddress, BYTE regAddress )");

winring0.ReadPciConfigWordEx

dll.api("ReadPciConfigWordEx","int(INT pciAddress, INT regAddress, WORD& value )");

winring0.SetPciMaxBusIndex

dll.api("SetPciMaxBusIndex","void( BYTE max )");

winring0.WriteIoPortByte

dll.api("WriteIoPortByte","void( WORD port, BYTE value )");

winring0.WriteIoPortByteEx

dll.api("WriteIoPortByteEx","int( WORD port, BYTE value )");

winring0.WriteIoPortDword

dll.api("WriteIoPortDword","void( WORD port, INT value )");

winring0.WriteIoPortDwordEx

dll.api("WriteIoPortDwordEx","int( WORD port, INT value )");

winring0.WriteIoPortWord

dll.api("WriteIoPortWord","void( WORD port, WORD value )");

winring0.WriteIoPortWordEx

dll.api("WriteIoPortWordEx","int( WORD port, WORD value )");

winring0.WritePciConfigByte

dll.api("WritePciConfigByte","void(INT pciAddress, BYTE regAddress, BYTE value )");

winring0.WritePciConfigByteEx

dll.api("WritePciConfigByteEx","int(INT pciAddress, INT regAddress, BYTE value )");

winring0.WritePciConfigDword

dll.api("WritePciConfigDword","void(INT pciAddress, BYTE regAddress, INT value )");

winring0.WritePciConfigDwordEx

dll.api("WritePciConfigDwordEx","int(INT pciAddress, INT regAddress, INT value )");

winring0.WritePciConfigWord

dll.api("WritePciConfigWord","void(INT pciAddress, BYTE regAddress, WORD value )");

winring0.WritePciConfigWordEx

dll.api("WritePciConfigWordEx","int(INT pciAddress, INT regAddress, WORD value )");

winring0.Wrmsr

dll.api("Wrmsr","bool(INT index, INT eax, INT edx )");

winring0.WrmsrPx

dll.api("WrmsrPx","bool(INT index, INT eax, INT edx,INT processAffinityMask)");

winring0.WrmsrTx

dll.api("WrmsrTx","bool(INT index, INT eax, INT edx,INT threadAffinityMask)");

自动完成常量

_OLS_DLL_DRIVER_NOT_FOUND=3
_OLS_DLL_DRIVER_NOT_LOADED=2
_OLS_DLL_DRIVER_NOT_LOADED_ON_NETWORK=5
_OLS_DLL_DRIVER_UNLOADED=4
_OLS_DLL_NO_ERROR=0
_OLS_DLL_UNKNOWN_ERROR=9
_OLS_DLL_UNSUPPORTED_PLATFORM=1
_OLS_DRIVER_TYPE_UNKNOWN=0
_OLS_DRIVER_TYPE_WIN_9X=1
_OLS_DRIVER_TYPE_WIN_NT=2
_OLS_DRIVER_TYPE_WIN_NT4=3
_OLS_DRIVER_TYPE_WIN_NT_IA64=5
_OLS_DRIVER_TYPE_WIN_NT_X64=4
_OLS_ERROR_PCI_BUS_NOT_EXIST=0xE0000001
_OLS_ERROR_PCI_NO_DEVICE=0xE0000002
_OLS_ERROR_PCI_READ_CONFIG=0xE0000004
_OLS_ERROR_PCI_WRITE_CONFIG=0xE0000003

Markdown 格式