Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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
wine
wine-cw
Commits
cd6d01ac
Commit
cd6d01ac
authored
Nov 12, 2009
by
Henri Verbeet
Committed by
Alexandre Julliard
Nov 12, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Implement the FileNameInformation class for NtQueryInformationFile().
parent
27705d51
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
70 additions
and
0 deletions
+70
-0
file.c
dlls/ntdll/file.c
+70
-0
No files found.
dlls/ntdll/file.c
View file @
cd6d01ac
...
...
@@ -1486,6 +1486,40 @@ NTSTATUS WINAPI NtSetVolumeInformationFile(
return
0
;
}
static
NTSTATUS
server_get_unix_name
(
HANDLE
handle
,
ANSI_STRING
*
unix_name
)
{
data_size_t
size
=
1024
;
NTSTATUS
ret
;
char
*
name
;
for
(;;)
{
name
=
RtlAllocateHeap
(
GetProcessHeap
(),
0
,
size
+
1
);
if
(
!
name
)
return
STATUS_NO_MEMORY
;
unix_name
->
MaximumLength
=
size
+
1
;
SERVER_START_REQ
(
get_handle_unix_name
)
{
req
->
handle
=
wine_server_obj_handle
(
handle
);
wine_server_set_reply
(
req
,
name
,
size
);
ret
=
wine_server_call
(
req
);
size
=
reply
->
name_len
;
}
SERVER_END_REQ
;
if
(
!
ret
)
{
name
[
size
]
=
0
;
unix_name
->
Buffer
=
name
;
unix_name
->
Length
=
size
;
break
;
}
RtlFreeHeap
(
GetProcessHeap
(),
0
,
name
);
if
(
ret
!=
STATUS_BUFFER_OVERFLOW
)
break
;
}
return
ret
;
}
/******************************************************************************
* NtQueryInformationFile [NTDLL.@]
* ZwQueryInformationFile [NTDLL.@]
...
...
@@ -1774,6 +1808,42 @@ NTSTATUS WINAPI NtQueryInformationFile( HANDLE hFile, PIO_STATUS_BLOCK io,
SERVER_END_REQ
;
}
break
;
case
FileNameInformation
:
{
FILE_NAME_INFORMATION
*
info
=
ptr
;
ANSI_STRING
unix_name
;
if
(
!
(
io
->
u
.
Status
=
server_get_unix_name
(
hFile
,
&
unix_name
)))
{
LONG
name_len
=
len
-
FIELD_OFFSET
(
FILE_NAME_INFORMATION
,
FileName
);
UNICODE_STRING
nt_name
;
io
->
u
.
Status
=
wine_unix_to_nt_file_name
(
&
unix_name
,
&
nt_name
);
RtlFreeAnsiString
(
&
unix_name
);
if
(
!
io
->
u
.
Status
)
{
const
WCHAR
*
ptr
=
nt_name
.
Buffer
;
const
WCHAR
*
end
=
ptr
+
(
nt_name
.
Length
/
sizeof
(
WCHAR
));
/* Skip the volume mount point. */
while
(
ptr
!=
end
&&
*
ptr
==
'\\'
)
++
ptr
;
while
(
ptr
!=
end
&&
*
ptr
!=
'\\'
)
++
ptr
;
while
(
ptr
!=
end
&&
*
ptr
==
'\\'
)
++
ptr
;
while
(
ptr
!=
end
&&
*
ptr
!=
'\\'
)
++
ptr
;
info
->
FileNameLength
=
(
end
-
ptr
)
*
sizeof
(
WCHAR
);
if
(
name_len
<
info
->
FileNameLength
)
io
->
u
.
Status
=
STATUS_BUFFER_OVERFLOW
;
else
name_len
=
info
->
FileNameLength
;
memcpy
(
info
->
FileName
,
ptr
,
name_len
);
RtlFreeUnicodeString
(
&
nt_name
);
io
->
Information
=
FIELD_OFFSET
(
FILE_NAME_INFORMATION
,
FileName
)
+
name_len
;
}
}
}
break
;
default:
FIXME
(
"Unsupported class (%d)
\n
"
,
class
);
io
->
u
.
Status
=
STATUS_NOT_IMPLEMENTED
;
...
...
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