forward
global type n_cst_diskid from nonvisualobject
end type
type tdriverstatus from structure within n_cst_diskid
end type
type tideregs from structure within n_cst_diskid
end type
type tsendcmdinparams from structure within n_cst_diskid
end type
type tsendcmdoutparams from structure within n_cst_diskid
end type
end forward
type tdriverstatus from structure
character bDriverError
character bIDEStatus
character bReserved[2]
ulong dwReserved[2]
end type
type tideregs from structure
character bFeaturesReg
character bSectorCountReg
character bSectorNumberReg
character bCylLowReg
character bCylHighReg
character bDriveHeadReg
character bCommandReg
character bReserved
end type
type tsendcmdinparams from structure
ulong cBufferSize
TIDERegs irDriveRegs
character bDriveNumber
character bReserved[3]
ulong dwReserved[4]
character bBuffer
end type
type tsendcmdoutparams from structure
ulong cBufferSize
TDriverStatus DriverStatus
character bBuffer
end type
global type n_cst_diskid from nonvisualobject autoinstantiate
end type
type prototypes
FUNCTION ulong CreateFile(string lpFileName,ulong dwDesiredAccess,ulong dwShareMode,ulong lpSecurityAttributes,ulong dwCreationDisposition,ulong dwFlagsAndAttributes,ulong hTemplateFile) LIBRARY "kernel32.dll" ALIAS FOR "CreateFileA"
FUNCTION ulong CloseHandle(ulong hObject) LIBRARY "kernel32.dll"
FUNCTION ulong DeviceIoControl(ulong hDevice,ulong dwIoControlCode,tsendcmdinparams lpInBuffer,ulong nInBufferSize,ref char lpOutBuffer[528],ulong nOutBufferSize,ref ulong lpBytesReturned,ulong lpOverlapped) LIBRARY "kernel32.dll"
end prototypes
forward prototypes
public function string of_getlocaldiskid ()
end prototypes
public function string of_getlocaldiskid ();//取不到号码的原因
//(1)少数硬盘没有号码
//(2)硬盘需要接为主盘