Commit f81694cc authored by Detlef Riekenberg's avatar Detlef Riekenberg Committed by Alexandre Julliard

Made test loadable on NT 3.51 again (GetDiskFreeSpaceExA not present).

parent 7453b63a
...@@ -25,6 +25,8 @@ ...@@ -25,6 +25,8 @@
#include "winbase.h" #include "winbase.h"
#include "winerror.h" #include "winerror.h"
static DWORD (WINAPI *pGetDiskFreeSpaceExA)(LPCSTR, PULARGE_INTEGER, PULARGE_INTEGER, PULARGE_INTEGER);
static void test_GetDriveTypeA(void) static void test_GetDriveTypeA(void)
{ {
char drive[] = "?:\\"; char drive[] = "?:\\";
...@@ -123,12 +125,13 @@ static void test_GetDiskFreeSpaceA(void) ...@@ -123,12 +125,13 @@ static void test_GetDiskFreeSpaceA(void)
/* win3.0 thru winME */ /* win3.0 thru winME */
ok( total_clusters <= 65535, ok( total_clusters <= 65535,
"total clusters is %ld > 65535\n", total_clusters); "total clusters is %ld > 65535\n", total_clusters);
else { else if (pGetDiskFreeSpaceExA) {
/* NT, 2k, XP : GetDiskFreeSpace shoud be accurate */ /* NT, 2k, XP : GetDiskFreeSpace shoud be accurate */
ULARGE_INTEGER totEx, tot, d; ULARGE_INTEGER totEx, tot, d;
tot.QuadPart = sectors_per_cluster; tot.QuadPart = sectors_per_cluster;
tot.QuadPart = (tot.QuadPart * bytes_per_sector) * total_clusters; tot.QuadPart = (tot.QuadPart * bytes_per_sector) * total_clusters;
ret = GetDiskFreeSpaceExA( drive, &d, &totEx, NULL); ret = pGetDiskFreeSpaceExA( drive, &d, &totEx, NULL);
ok( ret, "GetDiskFreeSpaceExA( %s ) failed. GetLastError=%ld\n", drive, GetLastError()); ok( ret, "GetDiskFreeSpaceExA( %s ) failed. GetLastError=%ld\n", drive, GetLastError());
ok( bytes_per_sector == 0 || /* empty cd rom drive */ ok( bytes_per_sector == 0 || /* empty cd rom drive */
totEx.QuadPart <= tot.QuadPart, totEx.QuadPart <= tot.QuadPart,
...@@ -194,6 +197,9 @@ static void test_GetDiskFreeSpaceW(void) ...@@ -194,6 +197,9 @@ static void test_GetDiskFreeSpaceW(void)
START_TEST(drive) START_TEST(drive)
{ {
HANDLE hkernel32 = GetModuleHandleA("kernel32");
pGetDiskFreeSpaceExA = (void *) GetProcAddress(hkernel32, "GetDiskFreeSpaceExA");
test_GetDriveTypeA(); test_GetDriveTypeA();
test_GetDriveTypeW(); test_GetDriveTypeW();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment