<div dir="ltr"><pre style="margin-top:0px;margin-bottom:0px">Hola,</pre><pre style="margin-top:0px;margin-bottom:0px"><br></pre><pre style="margin-top:0px;margin-bottom:0px">Estoy tratando de obtener el espacio libre de una unidad de disco. Ejecuto lo siguiente:</pre><pre style="margin-top:0px;margin-bottom:0px"><br></pre><pre style="margin-top:0px;margin-bottom:0px">    LPCWSTR drive=L"C:\\";

    ULARGE_INTEGER freeBytesToCaller;
    freeBytesToCaller.QuadPart = 0L;

    if( !GetDiskFreeSpaceEx( drive, &freeBytesToCaller, NULL, NULL ) )
    {
    cout << "ERROR: Call to GetDiskFreeSpaceEx() failed." << endl;
    }

    int freeSpace_gb = freeBytesToCaller.QuadPart;
    cout << "Free drive space: " << freeSpace_gb << "Bytes" << endl;<br></pre><pre style="margin-top:0px;margin-bottom:0px"><br></pre><pre style="margin-top:0px;margin-bottom:0px">Pero <span style="font-family:arial,sans-serif">freeSpace_gb </span><span style="font-family:arial,sans-serif">me da un valor de 1634967552 cuando solo tengo 9 GB libres.</span></pre><pre style="margin-top:0px;margin-bottom:0px"><br></pre><pre style="margin-top:0px;margin-bottom:0px">¿Qué problema hay?</pre><pre style="margin-top:0px;margin-bottom:0px"><br></pre><pre style="margin-top:0px;margin-bottom:0px">Gracias.</pre></div>