Laufwerke stoppen

Frank64

Cadet 1st Year
Registriert
Juli 2001
Beiträge
10
Hallo zusammen,

weiß jemand, wie ich die Festplatte stoppen kann oder wenigstens abfragen kann, ob die Festplatte noch läuft oder nicht?
Ein Beispiel in einer Programmiersprache (egal welche), wäre toll!

Danke und Gruß, Frank
 
Hallo,

ja also, ich möchte am Start meines Programmes eine Animation ablaufen lassen. Solange aber die Festplatte noch läuft, ruckelt es in der Animation, ok. Also will ich die Animation erst starten, wenn alle Laufwerksaktivitäten abgeschlossen sind.
Besser wäre es jedoch, die Festplatte manuell zu stoppen, irgendwie muß das gehen, der Taskmanager von Win98 macht das nämlich auch, also muß es irgendwie gehen.
Bevorzugte Sprachen für einen Sourcecode wären Profan², Assembler oder ein Basic-Dialekt, aber im Grunde ist mir die Sprache egal.

Gruß, Frank
 
Hi,

Vielleicht hilft dir das weiter:

mov ax, 440Dh ; generic IOCTL
mov bh, LockLevel ; see below
mov bl, DriveNum ; see below
mov ch, 08h ; device category (must be 08h)
mov cl, 4Bh ; Lock Physical Volume
mov dx, Permissions ; see below
int 21h

jc error


Locks the physical volume.

· Clears the carry flag if successful. Otherwise, the function sets the carry flag and sets the AX register to an error value.

LockLevel

Level of the lock. This parameter must be either 0, 1, 2, or 3.

DriveNum

Drive to lock. This parameter must be one of these values (same device unit numbers as for Interrupt 13h):

00 - 7Fh Floppy disk drive (00 for the first floppy drive, 01 for the second, and so on).
80 - FFh Hard disk drive (80 for the first hard disk drive, 81 for the second, and so on).
Permissions

Operations that the system permits while the volume is locked. This parameter is specified only when a level 1 lock is obtained or when a level 0 lock is obtained for the second time for formatting the volume. For other lock levels, this parameter is zero. When a level 1 lock is obtained, bits 0 and 1 of this parameter specify whether the system permits write operations, new file mappings, or both by other processes during a level 1 lock as well as during level 2 and 3 locks. If this parameter specifies that write operations, new file mappings, or both are failed, these operations are failed during level 1, 2, and 3 locks. This parameter has the following form:

Bit Meaning
0 0 = Write operations are failed (specified when a level 1 lock is obtained).
0 1 = Write operations are allowed (specified when a level 1 lock is obtained).
1 0 = New file mapping are allowed (specified when a level 1 lock is obtained).
1 1 = New file mapping are failed (specified when a level 1 lock is obtained).
2 1 = The volume is locked for formatting (specified when a level 0 lock is obtained for the second time).
The volume must be locked before the application performs direct disk write operations by using Interrupt 13h, Interrupt 26h, or the Interrupt 21h IOCTL functions. A single physical volume may be divided into more than one logical volume, which is also called a partition. The system automatically takes a logical volume lock on all logical volumes on the specified physical drive. If the application performs disk writes only to a logical drive, Lock Logical Volume (Interrupt 21h Function 440Dh Minor Code 4Ah) is used instead of this function. Unlock Physical Volume (Interrupt 21h Function 440Dh Minor Code 6Bh) should be called to release the lock.

___________________________________________

mov ax, 440Dh ; generic IOCTL
mov bl, DriveNum ; see below
mov ch, 08h ; device category (must be 08h)
mov cl, 6Ah ; Unlock Logical Volume
int 21h

jc error


Unlocks the logical volume or decrements the lock level.

· Clears the carry flag if successful. Otherwise, the function sets the carry flag and sets the AX register to an error value.

DriveNum

Drive to unlock. This parameter can be 0 for the default drive, 1 for A, 2 for B, and so on.

This function is used to release the lock obtained by using Lock Logical Volume (Interrupt 21h Function 440Dh Minor Code 4Ah). Only the lock owner can release the lock on a volume.
To release the lock on the volume, an application must call Unlock Logical Volume the same number of times that Lock Logical Volume was called.

Gruß

Toaster
 
HI,

vorher hatte ich mich vertan:

Interrupt 21h Function 440Dh Minor Code 4Ah Lock Logical Volume

mov ax, 440Dh ; generic IOCTL
mov bh, LockLevel ; see below
mov bl, DriveNum ; see below
mov ch, 08h ; device category (must be 08h)
mov cl, 4Ah ; Lock Logical Volume
mov dx, Permissions ; see below
int 21h

jc error


Locks the logical volume.

· Clears the carry flag if successful. Otherwise, the function sets the carry flag and sets the AX register to an error value.

LockLevel

Level of the lock. This parameter must be either 0, 1, 2, or 3.

DriveNum

Drive to lock. This parameter can be 0 for the default drive, 1 for A, 2 for B, and so on.

Permissions

Operations that the system permits while the volume is locked. This parameter is specified only when a level 1 lock is obtained or when a level 0 lock is obtained for the second time for formatting the volume. For other lock levels, this parameter is zero. When a level 1 lock is obtained, bits 0 and 1 of this parameter specify whether the system permits write operations, new file mappings, or both by other processes during a level 1 lock as well as during level 2 and 3 locks. If this parameter specifies that write operations, new file mappings, or both are failed, these operations are failed during level 1, 2, and 3 locks. This parameter has the following form:

Bit Meaning
0 0 = Write operations are failed (specified when a level 1 lock is obtained).
0 1 = Write operations are allowed (specified when a level 1 lock is obtained).
1 0 = New file mapping are allowed (specified when a level 1 lock is obtained).
1 1 = New file mapping are failed (specified when a level 1 lock is obtained).
2 1 = The volume is locked for formatting (specified when a level 0 lock is obtained for the second time).
The volume must be locked before the application performs direct disk write operations by using Interrupt 26h or the IOCTL control functions. Lock Physical Volume (Interrupt 21h Function 440Dh Minor Code 4Bh) is used instead of this function before a call to an Interrupt 13h function. Unlock Logical Volume (Interrupt 21h Function 440Dh Minor Code 6Ah) should be used to release the lock.


--------------------------------

Interrupt 21h Function 440Dh Minor Code 6Ah Unlock Logical Volume

mov ax, 440Dh ; generic IOCTL
mov bl, DriveNum ; see below
mov ch, 08h ; device category (must be 08h)
mov cl, 6Ah ; Unlock Logical Volume
int 21h

jc error


Unlocks the logical volume or decrements the lock level.

· Clears the carry flag if successful. Otherwise, the function sets the carry flag and sets the AX register to an error value.

DriveNum

Drive to unlock. This parameter can be 0 for the default drive, 1 for A, 2 for B, and so on.

This function is used to release the lock obtained by using Lock Logical Volume (Interrupt 21h Function 440Dh Minor Code 4Ah). Only the lock owner can release the lock on a volume.
To release the lock on the volume, an application must call Unlock Logical Volume the same number of times that Lock Logical Volume was called.


____________________________________________________

Interrupt 21h Function 440Dh Minor Code 4Bh Lock Physical Volume

mov ax, 440Dh ; generic IOCTL
mov bh, LockLevel ; see below
mov bl, DriveNum ; see below
mov ch, 08h ; device category (must be 08h)
mov cl, 4Bh ; Lock Physical Volume
mov dx, Permissions ; see below
int 21h

jc error


Locks the physical volume.

· Clears the carry flag if successful. Otherwise, the function sets the carry flag and sets the AX register to an error value.

LockLevel

Level of the lock. This parameter must be either 0, 1, 2, or 3.

DriveNum

Drive to lock. This parameter must be one of these values (same device unit numbers as for Interrupt 13h):

00 - 7Fh Floppy disk drive (00 for the first floppy drive, 01 for the second, and so on).
80 - FFh Hard disk drive (80 for the first hard disk drive, 81 for the second, and so on).
Permissions

Operations that the system permits while the volume is locked. This parameter is specified only when a level 1 lock is obtained or when a level 0 lock is obtained for the second time for formatting the volume. For other lock levels, this parameter is zero. When a level 1 lock is obtained, bits 0 and 1 of this parameter specify whether the system permits write operations, new file mappings, or both by other processes during a level 1 lock as well as during level 2 and 3 locks. If this parameter specifies that write operations, new file mappings, or both are failed, these operations are failed during level 1, 2, and 3 locks. This parameter has the following form:

Bit Meaning
0 0 = Write operations are failed (specified when a level 1 lock is obtained).
0 1 = Write operations are allowed (specified when a level 1 lock is obtained).
1 0 = New file mapping are allowed (specified when a level 1 lock is obtained).
1 1 = New file mapping are failed (specified when a level 1 lock is obtained).
2 1 = The volume is locked for formatting (specified when a level 0 lock is obtained for the second time).
The volume must be locked before the application performs direct disk write operations by using Interrupt 13h, Interrupt 26h, or the Interrupt 21h IOCTL functions. A single physical volume may be divided into more than one logical volume, which is also called a partition. The system automatically takes a logical volume lock on all logical volumes on the specified physical drive. If the application performs disk writes only to a logical drive, Lock Logical Volume (Interrupt 21h Function 440Dh Minor Code 4Ah) is used instead of this function. Unlock Physical Volume (Interrupt 21h Function 440Dh Minor Code 6Bh) should be called to release the lock.

--------------------------------------------

Interrupt 21h Function 440Dh Minor Code 6Bh Unlock Physical Volume


mov ax, 440Dh ; generic IOCTL
mov bl, DriveNum ; see below
mov ch, 08h ; device category (must be 08h)
mov cl, 6Bh ; Unlock Physical Volume
int 21h

jc enter


Unlocks the physical volume or decrements the lock level.

· Clears the carry flag if successful. Otherwise, the function sets the carry flag and sets the AX register to an error value.

DriveNum

Drive to unlock. This parameter must be one of these values (same device unit numbers as for Interrupt 13h):

00 - 7Fh Floppy disk drive (00 for the first floppy drive, 01 for the second, and so on).
80 - FFh Hard disk drive (80 for the first hard disk drive, 81 for the second, and so on).
This function is used to release the lock obtained by using Lock Physical Volume (Interrupt 21h Function 440Dh Minor Code 4Bh). Only the lock owner can release the lock on a volume.
To release the lock on the volume, an application must call Unlock Physical Volume the same number of times that Lock Physical Volume was called.

so sollte es stimmen.

Gruß

Toaster
 
Hallo,

wow, danke. Das war aber ausführlich. Eine einfache API hätte mir schon genügt.
Ich weiß aber nicht, ob ich das ganze DOS Zeugs zum laufen bringen kann. State of the Art ist die Interruptprogrammierung ja nicht mehr. Verwende nur Win32-Zeugs, vieles von dem DOS-Zeug funktioniert bei mir auch von vornherein gar nicht. Verwende MASM32...

Na ja, jedenfalls vielen Dank und Gruß, Frank
 
Zurück
Oben