Laden...

API Funktion GetDiskFreeSpaceEx: Was bedeuten die Ausgabeparameter?

Erstellt von Meli vor 20 Jahren Letzter Beitrag vor 20 Jahren 3.898 Views
M
Meli Themenstarter:in
115 Beiträge seit 2003
vor 20 Jahren
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

H
704 Beiträge seit 2003
vor 20 Jahren

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/)
M
Meli Themenstarter:in
115 Beiträge seit 2003
vor 20 Jahren

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

Gernot Melichar

H
704 Beiträge seit 2003
vor 20 Jahren

jo
auserdem ist WMI besser und hat mehr funktionen

[last.fm](http://www.last.fm/user/hauptmanAlpha/)
C
980 Beiträge seit 2003
vor 20 Jahren

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

Gelöschter Account
vor 20 Jahren

Besten Dank, cdr!