Autor Beitrag
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Mo 24.10.05 11:40 
In der DP habe ich folgenden Thread gefunden: www.delphipraxis.net...aufwerk+sperren.html

Da IOCTL-Befehle aber AFAIK erst ab WinNT laufen, funktioniert die genannte Funktion unter Win9x nicht.

Im MSDN hab ich den folgenden Interrupt-Aufruf gefunden: msdn.microsoft.com/a...in9x/95func_9lm0.asp Aufheben mit msdn.microsoft.com/a...in9x/95func_9rxk.asp

Was muss ich beim Aufruf der Funktion beachten?

Soweit ich das MSDN verstehe sieht das folgendermaßen aus:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
asm
    mov ax, $440D        //generic IOCTL
    mov bh, LockLevel    //0,1,2,3 - Lock Level; Nur was macht davon welcher?
    mov bl, DriveNum     //Laufwerksbuchstabe: 0 = Default Drive, 1..26 => A..Z
    mov ch, $08          //device category (must be 08h)
    mov cl, $4A          //Lock Logical Volume
    mov dx, Permissions  //Permissions \ Device Sharing; kA wie die zu verstehen sind
    int $21

    setnc al             //Erfolg als Boolean in AL zurückgeben
    movzx eax, al
end;


TIA für Informationen bzw. Umsetzungen dieses Aufrufs.

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19315
Erhaltene Danke: 1747

W11 x64 (Chrome, Edge)
Delphi 11 Pro, Oxygene, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Mi 26.10.05 09:26 
Welche Laufwerke möchtest du denn eigentlich sperren? Nur CD-Laufwerke? Festplatten?