mirror of
https://github.com/reactos/reactos.git
synced 2024-12-29 02:25:17 +00:00
check for console handles in Get/SetFileAttributesByHandle()
svn path=/trunk/; revision=17531
This commit is contained in:
parent
5760f0496c
commit
55610a1a3d
1 changed files with 12 additions and 0 deletions
|
@ -979,6 +979,12 @@ GetFileAttributesByHandle(IN HANDLE hFile,
|
||||||
|
|
||||||
UNREFERENCED_PARAMETER(dwFlags);
|
UNREFERENCED_PARAMETER(dwFlags);
|
||||||
|
|
||||||
|
if (IsConsoleHandle(hFile))
|
||||||
|
{
|
||||||
|
SetLastError(ERROR_INVALID_HANDLE);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
Status = NtQueryInformationFile(hFile,
|
Status = NtQueryInformationFile(hFile,
|
||||||
&IoStatusBlock,
|
&IoStatusBlock,
|
||||||
&FileBasic,
|
&FileBasic,
|
||||||
|
@ -1008,6 +1014,12 @@ SetFileAttributesByHandle(IN HANDLE hFile,
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
|
|
||||||
UNREFERENCED_PARAMETER(dwFlags);
|
UNREFERENCED_PARAMETER(dwFlags);
|
||||||
|
|
||||||
|
if (IsConsoleHandle(hFile))
|
||||||
|
{
|
||||||
|
SetLastError(ERROR_INVALID_HANDLE);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
Status = NtQueryInformationFile(hFile,
|
Status = NtQueryInformationFile(hFile,
|
||||||
&IoStatusBlock,
|
&IoStatusBlock,
|
||||||
|
|
Loading…
Reference in a new issue