Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
afadda8f
Commit
afadda8f
authored
Feb 07, 2014
by
Piotr Caban
Committed by
Alexandre Julliard
Feb 07, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Handle STD_*_HANDLE in GetFileType.
parent
52bc06af
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
1 deletion
+10
-1
file.c
dlls/kernel32/file.c
+4
-0
file.c
dlls/kernel32/tests/file.c
+6
-1
No files found.
dlls/kernel32/file.c
View file @
afadda8f
...
...
@@ -817,6 +817,10 @@ DWORD WINAPI GetFileType( HANDLE hFile )
IO_STATUS_BLOCK
io
;
NTSTATUS
status
;
if
(
hFile
==
(
HANDLE
)
STD_INPUT_HANDLE
||
hFile
==
(
HANDLE
)
STD_OUTPUT_HANDLE
||
hFile
==
(
HANDLE
)
STD_ERROR_HANDLE
)
hFile
=
GetStdHandle
((
DWORD_PTR
)
hFile
);
if
(
is_console_handle
(
hFile
))
return
FILE_TYPE_CHAR
;
status
=
NtQueryVolumeInformationFile
(
hFile
,
&
io
,
&
info
,
sizeof
(
info
),
FileFsDeviceInformation
);
...
...
dlls/kernel32/tests/file.c
View file @
afadda8f
...
...
@@ -2686,7 +2686,7 @@ static void test_MapFile(void)
static
void
test_GetFileType
(
void
)
{
DWORD
type
;
DWORD
type
,
type2
;
HANDLE
h
=
CreateFileA
(
filename
,
GENERIC_READ
|
GENERIC_WRITE
,
0
,
NULL
,
CREATE_ALWAYS
,
0
,
0
);
ok
(
h
!=
INVALID_HANDLE_VALUE
,
"open %s failed
\n
"
,
filename
);
type
=
GetFileType
(
h
);
...
...
@@ -2698,6 +2698,11 @@ static void test_GetFileType(void)
ok
(
type
==
FILE_TYPE_CHAR
,
"expected type char for nul got %d
\n
"
,
type
);
CloseHandle
(
h
);
DeleteFileA
(
filename
);
h
=
GetStdHandle
(
STD_OUTPUT_HANDLE
);
ok
(
h
!=
INVALID_HANDLE_VALUE
,
"GetStdHandle failed
\n
"
);
type
=
GetFileType
(
(
HANDLE
)
STD_OUTPUT_HANDLE
);
type2
=
GetFileType
(
h
);
ok
(
type
==
type2
,
"expected type %d for STD_OUTPUT_HANDLE got %d
\n
"
,
type2
,
type
);
}
static
int
completion_count
;
...
...
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