Author: tkreuzer
Date: Sat Feb 14 15:44:44 2015
New Revision: 66266
URL: http://svn.reactos.org/svn/reactos?rev=66266&view=rev
Log:
[CMAKE]
- Disable warning C4800: forcing value to bool 'true' or 'false' (performance warning). This is emitted when assigning an integer value to a C++ bool, which is always true (1) or false (0), so assigning an integer to it, will result in an implicit comparison against 0. But "fixing" this warning by adding an explicit comparison ("bool f = (i != 0);") will actually result in LESS efficient code (for whatever reasons). So this warning can be considered entirely useless and counter productive.
- Remove C4018 (signed/unsigned mismatch) from the TODO in the disable list. A comparison between an unsigned and a signed value will very likely result in wrong behavior and can easily cause hard to spot security bugs (e.g. when doing overflow checks). It is also often easy to fix.
Modified:
trunk/reactos/cmake/msvc.cmake
Modified: trunk/reactos/cmake/msvc.cmake
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/cmake/msvc.cmake?rev=66266…
==============================================================================
--- trunk/reactos/cmake/msvc.cmake [iso-8859-1] (original)
+++ trunk/reactos/cmake/msvc.cmake [iso-8859-1] Sat Feb 14 15:44:44 2015
@@ -35,11 +35,11 @@
# Disable overly sensitive warnings as well as those that generally aren't
# useful to us.
-# - TODO: C4018: signed/unsigned mismatch
# - C4244: implicit integer truncation
# - C4290: C++ exception specification ignored
-#add_compile_flags("/wd4018 /wd4244 /wd4290")
-add_compile_flags("/wd4290 /wd4244")
+# - C4800: forcing value to bool 'true' or 'false' (performance warning)
+#add_compile_flags("/wd4244 /wd4290 /wd4800 ")
+add_compile_flags("/wd4244 /wd4290 /wd4800")
# The following warnings are treated as errors:
# - C4013: implicit function declaration
Author: pschweitzer
Date: Sat Feb 14 15:41:44 2015
New Revision: 66265
URL: http://svn.reactos.org/svn/reactos?rev=66265&view=rev
Log:
[NTFS]
NtfsMoonWalkID():
- Do not allow opening a file by ID if it's not in use any longer
- Do not attempt to create the full path, if an error occured during walk
Modified:
trunk/reactos/drivers/filesystems/ntfs/create.c
Modified: trunk/reactos/drivers/filesystems/ntfs/create.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/ntfs/c…
==============================================================================
--- trunk/reactos/drivers/filesystems/ntfs/create.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/ntfs/create.c [iso-8859-1] Sat Feb 14 15:41:44 2015
@@ -116,6 +116,11 @@
break;
ASSERT(MftRecord->Ntfs.Type == NRH_FILE_TYPE);
+ if (!(MftRecord->Flags & FRH_IN_USE))
+ {
+ Status = STATUS_OBJECT_PATH_NOT_FOUND;
+ break;
+ }
FileName = GetBestFileNameFromRecord(MftRecord);
WritePosition -= FileName->NameLength;
@@ -131,6 +136,9 @@
}
ExFreePoolWithTag(MftRecord, TAG_NTFS);
+
+ if (!NT_SUCCESS(Status))
+ return Status;
OutPath->Length = (MAX_PATH - WritePosition - 1) * sizeof(WCHAR);
OutPath->MaximumLength = (MAX_PATH - WritePosition) * sizeof(WCHAR);