mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 20:33:04 +00:00
[NTOSKRNL]
Integrate Timo's review: - Fix pointer arithmetic - Remove unless variable CORE-2582 svn path=/trunk/; revision=62455
This commit is contained in:
parent
ed057abe86
commit
b4a3df8d3f
1 changed files with 11 additions and 15 deletions
|
@ -503,12 +503,13 @@ FsRtlNotifyUpdateBuffer(OUT PFILE_NOTIFY_INFORMATION OutputBuffer,
|
||||||
OutputBuffer->FileName[ParentName->Length / sizeof(WCHAR)] = L'\\';
|
OutputBuffer->FileName[ParentName->Length / sizeof(WCHAR)] = L'\\';
|
||||||
AlreadyWritten = ParentName->Length + sizeof(WCHAR);
|
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)
|
if (StreamName)
|
||||||
{
|
{
|
||||||
AlreadyWritten += TargetName->Length;
|
AlreadyWritten += TargetName->Length;
|
||||||
OutputBuffer->FileName[AlreadyWritten / sizeof(WCHAR)] = L':';
|
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);
|
StreamName->Buffer, StreamName->Length);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -527,7 +528,7 @@ FsRtlNotifyUpdateBuffer(OUT PFILE_NOTIFY_INFORMATION OutputBuffer,
|
||||||
OutputBuffer->FileName[ResultSize / sizeof(WCHAR)] = L'\\';
|
OutputBuffer->FileName[ResultSize / sizeof(WCHAR)] = L'\\';
|
||||||
AlreadyWritten = ResultSize + sizeof(WCHAR);
|
AlreadyWritten = ResultSize + sizeof(WCHAR);
|
||||||
|
|
||||||
RtlOemToUnicodeN(OutputBuffer->FileName + AlreadyWritten,
|
RtlOemToUnicodeN((PVOID)((ULONG_PTR)OutputBuffer->FileName + AlreadyWritten),
|
||||||
OutputBuffer->FileNameLength, &ResultSize,
|
OutputBuffer->FileNameLength, &ResultSize,
|
||||||
TargetName->Buffer, TargetName->Length);
|
TargetName->Buffer, TargetName->Length);
|
||||||
|
|
||||||
|
@ -535,7 +536,7 @@ FsRtlNotifyUpdateBuffer(OUT PFILE_NOTIFY_INFORMATION OutputBuffer,
|
||||||
{
|
{
|
||||||
AlreadyWritten += ResultSize;
|
AlreadyWritten += ResultSize;
|
||||||
OutputBuffer->FileName[AlreadyWritten / sizeof(WCHAR)] = L':';
|
OutputBuffer->FileName[AlreadyWritten / sizeof(WCHAR)] = L':';
|
||||||
RtlOemToUnicodeN(OutputBuffer->FileName + AlreadyWritten + sizeof(WCHAR),
|
RtlOemToUnicodeN((PVOID)((ULONG_PTR)OutputBuffer->FileName + AlreadyWritten + sizeof(WCHAR)),
|
||||||
OutputBuffer->FileNameLength, &ResultSize,
|
OutputBuffer->FileNameLength, &ResultSize,
|
||||||
StreamName->Buffer, StreamName->Length);
|
StreamName->Buffer, StreamName->Length);
|
||||||
}
|
}
|
||||||
|
@ -991,7 +992,7 @@ FsRtlNotifyFilterReportChange(IN PNOTIFY_SYNC NotifySync,
|
||||||
BOOLEAN IsStream, IsParent, PoolQuotaCharged;
|
BOOLEAN IsStream, IsParent, PoolQuotaCharged;
|
||||||
STRING TargetDirectory, TargetName, ParentName, IntNormalizedParentName;
|
STRING TargetDirectory, TargetName, ParentName, IntNormalizedParentName;
|
||||||
ULONG NumberOfBytes, TargetNumberOfParts, FullNumberOfParts, LastPartOffset, ParentNameOffset, ParentNameLength;
|
ULONG NumberOfBytes, TargetNumberOfParts, FullNumberOfParts, LastPartOffset, ParentNameOffset, ParentNameLength;
|
||||||
ULONG DataLength, TargetNameLength, AlignedDataLength;
|
ULONG DataLength, AlignedDataLength;
|
||||||
|
|
||||||
TargetDirectory.Length = 0;
|
TargetDirectory.Length = 0;
|
||||||
TargetDirectory.MaximumLength = 0;
|
TargetDirectory.MaximumLength = 0;
|
||||||
|
@ -1251,16 +1252,11 @@ FsRtlNotifyFilterReportChange(IN PNOTIFY_SYNC NotifySync,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Look for target name & construct it, if required */
|
/* Look for target name & construct it, if required */
|
||||||
if (TargetName.Buffer)
|
if (TargetName.Buffer == NULL)
|
||||||
{
|
|
||||||
TargetNameLength = TargetName.Length;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
TargetName.Buffer = &FullTargetName->Buffer[TargetNameOffset];
|
TargetName.Buffer = &FullTargetName->Buffer[TargetNameOffset];
|
||||||
TargetNameLength = FullTargetName->Length - TargetNameOffset;
|
TargetName.Length =
|
||||||
TargetName.Length = TargetNameLength;
|
TargetName.MaximumLength = FullTargetName->Length - TargetNameOffset;
|
||||||
TargetName.MaximumLength = TargetNameLength;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Then, we will append it as well */
|
/* Then, we will append it as well */
|
||||||
|
@ -1296,8 +1292,8 @@ FsRtlNotifyFilterReportChange(IN PNOTIFY_SYNC NotifySync,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
OutputBuffer = 0;
|
OutputBuffer = NULL;
|
||||||
FileNotifyInfo = 0;
|
FileNotifyInfo = NULL;
|
||||||
/* If we already had a buffer, update last entry position */
|
/* If we already had a buffer, update last entry position */
|
||||||
if (NotifyChange->Buffer != NULL)
|
if (NotifyChange->Buffer != NULL)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue