Thema: Delphi Zugriff sperren

Einzelnen Beitrag anzeigen

Killer

Registriert seit: 11. Nov 2003
152 Beiträge
 
Delphi 6 Enterprise
 
#1

Zugriff sperren

  Alt 13. Nov 2003, 12:12
Hi wie kann ich den Zugriff auf einzelne Ordner, Laufwerke und Dateien sperren?

Das folgende hab ich in der WinHilfe gefunden:
Zitat:
The FSCTL_LOCK_VOLUME DeviceIoControl operation locks a volume. A locked volume can be accessed only through handles to the file object (*hDevice) that locks the volume.

dwIoControlCode = FSCTL_LOCK_VOLUME; // operation code
lpInBuffer = NULL; // pointer to input buffer; not used; must be NULL
nInBufferSize = 0; // size of input buffer; not used; must be zero
lpOutBuffer ; // pointer to output buffer; not used; must be NULL
nOutBufferSize ; // size of output buffer; not used; must be zero
lpBytesReturned ; // pointer to DWORD used by DeviceIoControl function


Parameters

lpInBuffer

Points to an input buffer. Not used with this operation. Set to NULL.

nInBufferSize

Specifies the size, in bytes, of the buffer pointed to by lpInBuffer. Not used with this operation. Set to zero.

lpOutBuffer

Points to an output buffer. Not used with this operation. Set to NULL.

nOutBufferSize

Specifies the size, in bytes, of the buffer pointed to by lpOutBuffer. Not used with this operation. Set to zero.

lpBytesReturned

Pointer to a DWORD. This value cannot be NULL. Although the FSCTL_LOCK_VOLUME operation produces no output data and lpOutBuffer should be NULL, the DeviceIoControl function uses the variable pointed to by lpBytesReturned. After the operation, the value of this variable is without meaning.
Naja leider ist kein Beispiel dabei, ich weiß auch nicht, obs überhaupt die richtige Funktion wäre. Kann mir jemand helfen?