Author: pschweitzer
Date: Sat Mar 8 09:03:59 2014
New Revision: 62455
URL:
http://svn.reactos.org/svn/reactos?rev=62455&view=rev
Log:
[NTOSKRNL]
Integrate Timo's review:
- Fix pointer arithmetic
- Remove unless variable
CORE-2582
Modified:
trunk/reactos/ntoskrnl/fsrtl/notify.c
Modified: trunk/reactos/ntoskrnl/fsrtl/notify.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/fsrtl/notify.c?re…
==============================================================================
--- trunk/reactos/ntoskrnl/fsrtl/notify.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/fsrtl/notify.c [iso-8859-1] Sat Mar 8 09:03:59 2014
@@ -503,12 +503,13 @@
OutputBuffer->FileName[ParentName->Length / sizeof(WCHAR)] =
L'\\';
AlreadyWritten = ParentName->Length + sizeof(WCHAR);
}
- RtlCopyMemory(OutputBuffer->FileName + AlreadyWritten,
TargetName->Buffer, TargetName->Length);
+ RtlCopyMemory((PVOID)((ULONG_PTR)OutputBuffer->FileName +
AlreadyWritten),
+ TargetName->Buffer, TargetName->Length);
if (StreamName)
{
AlreadyWritten += TargetName->Length;
OutputBuffer->FileName[AlreadyWritten / sizeof(WCHAR)] =
L':';
- RtlCopyMemory(OutputBuffer->FileName + AlreadyWritten +
sizeof(WCHAR),
+ RtlCopyMemory((PVOID)((ULONG_PTR)OutputBuffer->FileName +
AlreadyWritten + sizeof(WCHAR)),
StreamName->Buffer, StreamName->Length);
}
}
@@ -527,7 +528,7 @@
OutputBuffer->FileName[ResultSize / sizeof(WCHAR)] = L'\\';
AlreadyWritten = ResultSize + sizeof(WCHAR);
- RtlOemToUnicodeN(OutputBuffer->FileName + AlreadyWritten,
+ RtlOemToUnicodeN((PVOID)((ULONG_PTR)OutputBuffer->FileName +
AlreadyWritten),
OutputBuffer->FileNameLength, &ResultSize,
TargetName->Buffer, TargetName->Length);
@@ -535,7 +536,7 @@
{
AlreadyWritten += ResultSize;
OutputBuffer->FileName[AlreadyWritten / sizeof(WCHAR)] =
L':';
- RtlOemToUnicodeN(OutputBuffer->FileName + AlreadyWritten +
sizeof(WCHAR),
+ RtlOemToUnicodeN((PVOID)((ULONG_PTR)OutputBuffer->FileName +
AlreadyWritten + sizeof(WCHAR)),
OutputBuffer->FileNameLength, &ResultSize,
StreamName->Buffer, StreamName->Length);
}
@@ -991,7 +992,7 @@
BOOLEAN IsStream, IsParent, PoolQuotaCharged;
STRING TargetDirectory, TargetName, ParentName, IntNormalizedParentName;
ULONG NumberOfBytes, TargetNumberOfParts, FullNumberOfParts, LastPartOffset,
ParentNameOffset, ParentNameLength;
- ULONG DataLength, TargetNameLength, AlignedDataLength;
+ ULONG DataLength, AlignedDataLength;
TargetDirectory.Length = 0;
TargetDirectory.MaximumLength = 0;
@@ -1251,16 +1252,11 @@
}
/* Look for target name & construct it, if required */
- if (TargetName.Buffer)
- {
- TargetNameLength = TargetName.Length;
- }
- else
+ if (TargetName.Buffer == NULL)
{
TargetName.Buffer =
&FullTargetName->Buffer[TargetNameOffset];
- TargetNameLength = FullTargetName->Length -
TargetNameOffset;
- TargetName.Length = TargetNameLength;
- TargetName.MaximumLength = TargetNameLength;
+ TargetName.Length =
+ TargetName.MaximumLength = FullTargetName->Length -
TargetNameOffset;
}
/* Then, we will append it as well */
@@ -1296,8 +1292,8 @@
}
else
{
- OutputBuffer = 0;
- FileNotifyInfo = 0;
+ OutputBuffer = NULL;
+ FileNotifyInfo = NULL;
/* If we already had a buffer, update last entry position */
if (NotifyChange->Buffer != NULL)
{