Hans Leidekker (@hans) commented about dlls/ntdll/tests/file.c:
- size = GetFileSize( handle, NULL);
- ok ( size == bytesWritten, "wrong file size after write: should be 0x10000, got 0x%lx\n", size);
- memset( buffer, 0, length );
- SetFilePointerEx( handle, distanceToMove, NULL, FILE_BEGIN );
- res = ReadFile( handle, buffer, length, &bytesRead, NULL );
- ok ( res != 0 , "couldn't read file after allocation\n" );
- ok ( bytesRead == length, "couldn't read whole or part of file after allocation: allocated %lx, read %lx\n", length, bytesRead );
- ok ( *buffer == (char)0xa5, "data read from allocated file doesn't match written pattern: wrote 0xa5, got 0x%x\n", *buffer & 0xff );
- fas.AllocationSize.QuadPart = 2 * length;
- size = GetFileSize( handle, NULL );
- ok ( size == bytesWritten, "wrong file size after new lengthier allocation: should be 0x10000, got 0x%lx\n", size);
- fas.AllocationSize.QuadPart = length / 2;
- size = GetFileSize( handle, NULL );
You need to set the allocation size before these GetFileSize() calls.