Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-fonts
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Aleksandr Isakov
wine-fonts
Commits
21283a3f
Commit
21283a3f
authored
Apr 17, 2015
by
Jianqiu Zhang
Committed by
Vitaly Lipatov
Jul 30, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Add support for FileFsFullSizeInformation class in NtQueryVolumeInformationFile(try 2)
parent
84d01737
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
9 deletions
+54
-9
file.c
dlls/ntdll/tests/file.c
+1
-7
file.c
dlls/ntdll/unix/file.c
+53
-2
No files found.
dlls/ntdll/tests/file.c
View file @
21283a3f
...
...
@@ -1289,7 +1289,7 @@ static void test_file_full_size_information(void)
/* Assume No Quota Settings configured on Wine Testbot */
res
=
pNtQueryVolumeInformationFile
(
h
,
&
io
,
&
ffsi
,
sizeof
ffsi
,
FileFsFullSizeInformation
);
todo_wine
ok
(
res
==
STATUS_SUCCESS
,
"cannot get attributes, res %lx
\n
"
,
res
);
ok
(
res
==
STATUS_SUCCESS
,
"cannot get attributes, res %lx
\n
"
,
res
);
res
=
pNtQueryVolumeInformationFile
(
h
,
&
io
,
&
fsi
,
sizeof
fsi
,
FileFsSizeInformation
);
ok
(
res
==
STATUS_SUCCESS
,
"cannot get attributes, res %lx
\n
"
,
res
);
...
...
@@ -1305,8 +1305,6 @@ static void test_file_full_size_information(void)
ok
(
fsi
.
BytesPerSector
==
512
,
"[fsi] BytesPerSector expected 512, got %ld
\n
"
,
fsi
.
BytesPerSector
);
ok
(
fsi
.
SectorsPerAllocationUnit
==
8
,
"[fsi] SectorsPerAllocationUnit expected 8, got %ld
\n
"
,
fsi
.
SectorsPerAllocationUnit
);
todo_wine
{
ok
(
ffsi
.
TotalAllocationUnits
.
QuadPart
>
0
,
"[ffsi] TotalAllocationUnits expected positive, got negative value 0x%s
\n
"
,
wine_dbgstr_longlong
(
ffsi
.
TotalAllocationUnits
.
QuadPart
));
...
...
@@ -1324,14 +1322,10 @@ static void test_file_full_size_information(void)
"[ffsi] CallerAvailableAllocationUnits error fsi:0x%s, ffsi: 0x%s
\n
"
,
wine_dbgstr_longlong
(
fsi
.
AvailableAllocationUnits
.
QuadPart
),
wine_dbgstr_longlong
(
ffsi
.
CallerAvailableAllocationUnits
.
QuadPart
));
}
/* Assume file system is NTFS */
todo_wine
{
ok
(
ffsi
.
BytesPerSector
==
512
,
"[ffsi] BytesPerSector expected 512, got %ld
\n
"
,
ffsi
.
BytesPerSector
);
ok
(
ffsi
.
SectorsPerAllocationUnit
==
8
,
"[ffsi] SectorsPerAllocationUnit expected 8, got %ld
\n
"
,
ffsi
.
SectorsPerAllocationUnit
);
}
CloseHandle
(
h
);
}
...
...
dlls/ntdll/unix/file.c
View file @
21283a3f
...
...
@@ -7539,8 +7539,59 @@ NTSTATUS WINAPI NtQueryVolumeInformationFile( HANDLE handle, IO_STATUS_BLOCK *io
break
;
case
FileFsFullSizeInformation
:
FIXME
(
"%p: full size info not supported
\n
"
,
handle
);
status
=
STATUS_NOT_IMPLEMENTED
;
if
(
length
<
sizeof
(
FILE_FS_FULL_SIZE_INFORMATION
))
io
->
u
.
Status
=
STATUS_BUFFER_TOO_SMALL
;
else
{
FILE_FS_FULL_SIZE_INFORMATION
*
info
=
buffer
;
if
(
fstat
(
fd
,
&
st
)
<
0
)
{
io
->
u
.
Status
=
errno_to_status
(
errno
);
break
;
}
if
(
!
S_ISREG
(
st
.
st_mode
)
&&
!
S_ISDIR
(
st
.
st_mode
))
{
io
->
u
.
Status
=
STATUS_INVALID_DEVICE_REQUEST
;
}
else
{
ULONGLONG
bsize
;
#if !defined(linux) || !defined(HAVE_FSTATFS)
struct
statvfs
stfs
;
if
(
fstatvfs
(
fd
,
&
stfs
)
<
0
)
{
io
->
u
.
Status
=
errno_to_status
(
errno
);
break
;
}
bsize
=
stfs
.
f_frsize
;
#else
struct
statfs
stfs
;
if
(
fstatfs
(
fd
,
&
stfs
)
<
0
)
{
io
->
u
.
Status
=
errno_to_status
(
errno
);
break
;
}
bsize
=
stfs
.
f_bsize
;
#endif
if
(
bsize
==
2048
)
/* assume CD-ROM */
{
info
->
BytesPerSector
=
2048
;
info
->
SectorsPerAllocationUnit
=
1
;
}
else
{
info
->
BytesPerSector
=
512
;
info
->
SectorsPerAllocationUnit
=
8
;
}
info
->
TotalAllocationUnits
.
QuadPart
=
bsize
*
stfs
.
f_blocks
/
(
info
->
BytesPerSector
*
info
->
SectorsPerAllocationUnit
);
info
->
CallerAvailableAllocationUnits
.
QuadPart
=
bsize
*
stfs
.
f_bavail
/
(
info
->
BytesPerSector
*
info
->
SectorsPerAllocationUnit
);
info
->
ActualAvailableAllocationUnits
.
QuadPart
=
bsize
*
stfs
.
f_bfree
/
(
info
->
BytesPerSector
*
info
->
SectorsPerAllocationUnit
);
io
->
Information
=
sizeof
(
*
info
);
io
->
u
.
Status
=
STATUS_SUCCESS
;
}
}
break
;
case
FileFsObjectIdInformation
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment