Abstractions.WindowsApi.pInvokes.GetFreeShareSpace C# (CSharp) Method

GetFreeShareSpace() public static method

Retrieves information about the amount of space that is available on a disk volume, which is the total amount of space, the total amount of free space, and the total amount of free space available to the user that is associated with the calling thread. based on http://msdn.microsoft.com/en-us/library/windows/desktop/aa364937(v=vs.85).aspx
public static GetFreeShareSpace ( string share ) : long[]
share string
return long[]
        public static long[] GetFreeShareSpace(string share)
        {
            long freeBytesForUser = -1, totalBytes = -1, freeBytes = -1;

            if (!SafeNativeMethods.GetDiskFreeSpaceEx(share, out freeBytesForUser, out totalBytes, out freeBytes))
            {
                LibraryLogging.Error("Unable to enumerate free space on {0} Error:{1}", share, LastError());
                return new long[] { -1, -1, -1 };
            }

            return new long[] { freeBytesForUser, totalBytes, freeBytes };
        }