Laden...

API Funktion GetDiskFreeSpaceEx: Was bedeuten die Ausgabeparameter?

Letzter Beitrag vor 21 Jahren 6 Posts 4.051 Views
API Funktion GetDiskFreeSpaceEx: Was bedeuten die Ausgabeparameter?

Hallo,

das ist mein erstes Posting hier:Also Grias euch..

Folgendes:
Ich benutze in meinem Programm die API-Funktion "GetDiskFreeSpaceEx"
um Informationen über den freien Speicherplatz auf einem Datenträger
zu erhalten:Das klappt auch ganz vorzüglich.

Mein Problem ist: Ich kapier nicht den Unterschied zwischen den
Rückgabewerten. Die Plattform SDK Dokumentation sagt dazu:

BOOL GetDiskFreeSpaceEx(  
  LPCTSTR lpDirectoryName,  
  PULARGE_INTEGER lpFreeBytesAvailable,  
  PULARGE_INTEGER lpTotalNumberOfBytes,  
  PULARGE_INTEGER lpTotalNumberOfFreeBytes  
);  

Parameters
lpDirectoryName
[in] Pointer to a null-terminated string that specifies a directory on the disk of interest. If this parameter is NULL, the function uses the root of the current disk. If this parameter is a UNC name, it must include a trailing backslash (for example, \MyServer\MyShare).
Note that this parameter does not have to specify the root directory on a disk. The function accepts any directory on the disk.

lpFreeBytesAvailable
[out] Pointer to a variable that receives the total number of free bytes on the disk that are available to the user associated with the calling thread. This parameter can be NULL.
If per-user quotas are in use, this value may be less than the total number of free bytes on the disk.

lpTotalNumberOfBytes
[out] Pointer to a variable that receives the total number of bytes on the disk that are available to the user associated with the calling thread. This parameter can be NULL.
If per-user quotas are in use, this value may be less than the total number of bytes on the disk.

lpTotalNumberOfFreeBytes
[out] Pointer to a variable that receives the total number of free bytes on the disk. This parameter can be NULL.

Ähm, kann mir das bitte jemand ausdeutschen?

Besten Dank,

Gernot Melichar

nutze für solche dinge leiber WMI, anstatt der Win.API Funktionen
wir wollen ja schön plattformunabhängig bleiben 😉

[last.fm](http://www.last.fm/user/hauptmanAlpha/)

Ach ja die Plattformunabhängikeit von .NET...

Gernot Melichar

jo
auserdem ist WMI besser und hat mehr funktionen

[last.fm](http://www.last.fm/user/hauptmanAlpha/)

lpTotalNumberOfFreeBytes:
Anzahl Bytes, die auf der Partition noch frei sind.
Achtung: Evtl. Null Pointer!

lpFreeBytesAvailable:
Anzahl Bytes, die auf der Partition noch frei sind und auf die der aktuelle Benutzer auch wirklich zugreifen kann. (Mit Disk Quoten kann ja auf Bentzerbasis der Speicher begrenzt werden..)
Achtung: Evtl. Null Pointer!

lpTotalNumberOfBytes:
Anzahl Bytes auf der Partition, frei oder nicht frei, auf die der aktuelle Benutzer auch wirklich zugreifen kann. (Mit Disk Quoten kann ja auf Bentzerbasis der Speicher begrenzt werden..)
Achtung: Evtl. Null Pointer!

hth

Besten Dank, cdr!