Hans Leidekker (@hans) commented about dlls/ntdll/tests/file.c:
- BY_HANDLE_FILE_INFORMATION info;
- IO_STATUS_BLOCK io;
- HANDLE handle;
- int res;
- char* buffer;
- DWORD bytesWritten, bytesRead;
- DWORD length = 64*1024;
- LARGE_INTEGER distanceToMove;
- distanceToMove.QuadPart = 0;
- if( !(handle = create_temp_file(0)) ) return;
- memset( &fas, 0, sizeof(fas) );
- fas.AllocationSize.QuadPart = length;
- res = pNtSetInformationFile( handle, &io, &fas, sizeof fas, FileAllocationInformation );
Please test what happens to the file size (using GetFileSize()) with an allocation size larger than the current file size as well as an allocation size smaller than the current size.