From f7f542063b1f8231286d2a275d465bd887305b50 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Wed, 17 Sep 2003 21:47:12 +0000 Subject: [PATCH] * syscalls.cc (gethostid): Add lpFreeBytesAvailable argument to GetDiskFreeSpaceEx call since NT4 requires it. --- winsup/cygwin/ChangeLog | 5 +++++ winsup/cygwin/syscalls.cc | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 2725400c3..62c776a38 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2003-09-16 Brian Ford + + * syscalls.cc (gethostid): Add lpFreeBytesAvailable argument to + GetDiskFreeSpaceEx call since NT4 requires it. + 2003-09-16 Christopher Faylor * fhandler_process.cc (fhandler_process::fill_filebuf): Open pinfo with diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc index c9d926462..11cacd5ed 100644 --- a/winsup/cygwin/syscalls.cc +++ b/winsup/cygwin/syscalls.cc @@ -2884,7 +2884,10 @@ long gethostid(void) key.get_string ("ProductId", (char *)&data[6], 24, "00000-000-0000000-00000"); debug_printf ("Windows Product ID: %s", (char *)&data[6]); - GetDiskFreeSpaceEx ("C:\\", NULL, (PULARGE_INTEGER) &data[11], NULL); + /* Contrary to MSDN, NT4 requires the second argument + or a STATUS_ACCESS_VIOLATION is generated */ + ULARGE_INTEGER availb; + GetDiskFreeSpaceEx ("C:\\", &availb, (PULARGE_INTEGER) &data[11], NULL); if (GetLastError () == ERROR_PROC_NOT_FOUND) GetDiskFreeSpace ("C:\\", NULL, NULL, NULL, (DWORD *)&data[11]);