mirror of
https://github.com/reactos/reactos.git
synced 2025-07-27 21:02:19 +00:00
[NTDLL_APITEST] Query sector size for NtWriteFile tests
This commit is contained in:
parent
64b6327dd7
commit
bdaa8e5ad1
1 changed files with 22 additions and 1 deletions
|
@ -38,6 +38,24 @@ SizeOfMdl(VOID)
|
||||||
return Is64BitSystem() ? 48 : 28;
|
return Is64BitSystem() ? 48 : 28;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static
|
||||||
|
ULONG
|
||||||
|
SizeOfSector(VOID)
|
||||||
|
{
|
||||||
|
BOOL Ret;
|
||||||
|
ULONG SectorSize;
|
||||||
|
|
||||||
|
/* FIXME: Would be better to actually open systemroot */
|
||||||
|
Ret = GetDiskFreeSpaceW(NULL, NULL, &SectorSize, NULL, NULL);
|
||||||
|
ok(Ret != FALSE, "GetDiskFreeSpaceW failed: %lx\n", GetLastError());
|
||||||
|
if (!Ret)
|
||||||
|
{
|
||||||
|
SectorSize = 4096; /* On failure, assume max size */
|
||||||
|
}
|
||||||
|
|
||||||
|
return SectorSize;
|
||||||
|
}
|
||||||
|
|
||||||
START_TEST(NtWriteFile)
|
START_TEST(NtWriteFile)
|
||||||
{
|
{
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
|
@ -213,7 +231,10 @@ START_TEST(NtWriteFile)
|
||||||
ok_hex(Status, STATUS_SUCCESS);
|
ok_hex(Status, STATUS_SUCCESS);
|
||||||
|
|
||||||
/* Now, testing aligned/non aligned writes */
|
/* Now, testing aligned/non aligned writes */
|
||||||
BufferSize = 4096; /* We assume max sector size */
|
|
||||||
|
BufferSize = SizeOfSector();
|
||||||
|
trace("Sector is %ld bytes\n", BufferSize);
|
||||||
|
|
||||||
Status = NtAllocateVirtualMemory(NtCurrentProcess(),
|
Status = NtAllocateVirtualMemory(NtCurrentProcess(),
|
||||||
&Buffer,
|
&Buffer,
|
||||||
0,
|
0,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue