CD Rom blockieren wie in diesem beispiel



  • sowas machste mit Assembler

    MOV AX wert
    MOV BX wert2
    INT <IntNR>

    .. juppi is gesperrt, aber ob dieser Interrupt AX und BX abfrag, oder vielleicht auch CX kann ich dir net sagen.. such bei google..



  • Das zeus.unex.es/~victor/software/Ctload/lock.exe-Beispiel arbeitet mit folgender dokumentierter Funktion:

    Int 21h Function 440Dh Minor Code 48h (FAT32) 
    [Windows 95 only.]
    
    Locks or unlocks the volume in the given drive (preventing or permitting its removal) or returns the locked status of the given drive. 
    
    mov ax, 440Dh           ; Generic IOCTL
    mov bx, DriveNum        ; See below 
    mov ch, DeviceCat       ; See below
    mov cl, 48h             ; Lock or unlock removable media
    mov dx, seg ParamBlock  ; See below
    mov ds, dx
    mov dx, offset ParamBlock
    int 21h
    
    jc  error_handler       ; Carry set means error
    
    Parameters
    DriveNum 
    Drive to lock or unlock (0 = default drive, 1 = A, 2 = B, and so on). 
    DeviceCat 
    Specifies a FAT16, FAT12 or FAT32 drive. Value Description  
    08h  FAT32, FAT16, or FAT12 drive.  
    48h  FAT32, FAT16, or FAT12 drive. This value is supported on Windows 95 OEM Service Release 2 and later.  
    
    Note: Because this call may be implemented in the device driver, the 48h form of this call may fail on FAT16 or FAT12 media. Therefore, applications making the 48h form of this call must fall back on the 08h form if the 48h call fails. 
    
    ParamBlock 
    Address of a PARAMBLOCK structure that specifies the operation to carry out and receives a count of the number of locks on the drive. 
    Return Values
    If the function is successful, clears the carry flag and copies the number of pending locks on the given drive to the NumLocks member of the PARAMBLOCK structure. Otherwise, sets the carry flag and sets the AX register to one of the following error values. 
    
    Value Description  
    01h  The function is not supported.  
    B0h  The volume is not locked in the drive.  
    B2h  The volume is not removable.  
    B4h  The lock count has been exceeded.
    

    Unter NT/2000/XP funktioniert das nicht!



  • JSFreak kennt sich aus 🙂

    rgs



  • Dies ist ein WINAPI-Forum!



  • danke.
    für die letzt bemerkung:
    wenn dies ein winapi forum ist wieso schreibst du dann nicht über winapi, schlaumeier!



  • Kann mir jemand bei der oben angegebenen Funktion helfen.

    welche #include dateien braucht man. und wie ruft man dies auf wenn man das laufwerk d:\ sperren will?



  • Original erstellt von Blindworm:
    wenn dies ein winapi forum ist wieso schreibst du dann nicht über winapi, schlaumeier!

    Wozu sollte ich, wenn's nicht geht?! Deine Frage ist hier ganz einfach falsch! Das gehört ins Assembler-Forum.



  • Nein die Frage gehört ins WinAPI Forum. Und die Antwort ist DeviceIoCtl().



  • Das genannte Beispielprogramm (http://zeus.unex.es/~victor/software/Ctload/lock.exe) verwendet aber kein DeviceIoCtl(), obwohl dies sicherlich die beste Lösung wäre, sondern die Int 21h Function 440Dh Minor Code 48h (FAT32)-Methode.

    Aber führen nicht viele Wege in die Kneipe? 🙄



  • schöne antworten.
    ich kann die win sdk hilfe auch selber lesen.

    ich wollte ein BEISPIEL!

    Der text sag nix aus.

    á propros: Das ist 100% eine Frage von WinApi. War im Assembler Forum gewesen und die sagen das dies eine Winapi frage ist.

    Nero Burning Rom kann das cdlaufwerk auch sperren


Anmelden zum Antworten