mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-02 19:26:32 +00:00
check for console handles in Get/SetFileAttributesByHandle()
svn path=/trunk/; revision=17531
This commit is contained in:
@@ -979,6 +979,12 @@ GetFileAttributesByHandle(IN HANDLE hFile,
|
||||
|
||||
UNREFERENCED_PARAMETER(dwFlags);
|
||||
|
||||
if (IsConsoleHandle(hFile))
|
||||
{
|
||||
SetLastError(ERROR_INVALID_HANDLE);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
Status = NtQueryInformationFile(hFile,
|
||||
&IoStatusBlock,
|
||||
&FileBasic,
|
||||
@@ -1008,6 +1014,12 @@ SetFileAttributesByHandle(IN HANDLE hFile,
|
||||
NTSTATUS Status;
|
||||
|
||||
UNREFERENCED_PARAMETER(dwFlags);
|
||||
|
||||
if (IsConsoleHandle(hFile))
|
||||
{
|
||||
SetLastError(ERROR_INVALID_HANDLE);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
Status = NtQueryInformationFile(hFile,
|
||||
&IoStatusBlock,
|
||||
|
||||
Reference in New Issue
Block a user