监测是否是虚拟光驱,没有测试,:(
给你一个函数,(可以区分真实光驱和虚拟光驱):
Function IsCDROM(Drv : Char):BOOLEAN;
Var
CDR : string;
cnt : byte;
Count,First : word;
begin
Result := false;
CDR := '';
asm
mov ax, 1500h
xor bx, bx
int $2f
les di, COUNT
mov es:[di], bx
les di, FIRST
mov es:[di], cx
end;
if Count > 0 then
for cnt := 0 to (Count-1) do
CDR := CDR + char(First + Byte('A') + cnt);
Result := (Pos(upcase(Drv),CDR) > 0);
end;