ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
June 2015
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
13 participants
343 discussions
Start a n
N
ew thread
[tfaber] 68227: [NTOS:CC] - Raise an exception in case of failure in CcInitializeCacheMap CORE-9848
by tfaber@svn.reactos.org
Author: tfaber Date: Sun Jun 21 09:20:01 2015 New Revision: 68227 URL:
http://svn.reactos.org/svn/reactos?rev=68227&view=rev
Log: [NTOS:CC] - Raise an exception in case of failure in CcInitializeCacheMap CORE-9848 Modified: trunk/reactos/ntoskrnl/cc/fs.c trunk/reactos/ntoskrnl/cc/view.c Modified: trunk/reactos/ntoskrnl/cc/fs.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/cc/fs.c?rev=68227…
============================================================================== --- trunk/reactos/ntoskrnl/cc/fs.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/cc/fs.c [iso-8859-1] Sun Jun 21 09:20:01 2015 @@ -92,6 +92,8 @@ IN PCACHE_MANAGER_CALLBACKS CallBacks, IN PVOID LazyWriterContext) { + NTSTATUS Status; + ASSERT(FileObject); ASSERT(FileSizes); @@ -99,10 +101,12 @@ FileObject, FileSizes, PinAccess, CallBacks, LazyWriterContext); /* Call old ROS cache init function */ - CcRosInitializeFileCache(FileObject, - FileSizes, - CallBacks, - LazyWriterContext); + Status = CcRosInitializeFileCache(FileObject, + FileSizes, + CallBacks, + LazyWriterContext); + if (!NT_SUCCESS(Status)) + ExRaiseStatus(Status); } /* Modified: trunk/reactos/ntoskrnl/cc/view.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/cc/view.c?rev=682…
============================================================================== --- trunk/reactos/ntoskrnl/cc/view.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/cc/view.c [iso-8859-1] Sun Jun 21 09:20:01 2015 @@ -1176,7 +1176,7 @@ if (SharedCacheMap == NULL) { KeReleaseGuardedMutex(&ViewLock); - return STATUS_UNSUCCESSFUL; + return STATUS_INSUFFICIENT_RESOURCES; } RtlZeroMemory(SharedCacheMap, sizeof(*SharedCacheMap)); ObReferenceObjectByPointer(FileObject,
9 years, 6 months
1
0
0
0
[ekohl] 68226: [USETUP] UpdateDiskLayout: - Set the proper HiddenSectors value. - Fix counting the PartitonaNumber. UpdatePartitionNumbers() has become obsolete. Remove it.
by ekohl@svn.reactos.org
Author: ekohl Date: Sun Jun 21 08:55:43 2015 New Revision: 68226 URL:
http://svn.reactos.org/svn/reactos?rev=68226&view=rev
Log: [USETUP] UpdateDiskLayout: - Set the proper HiddenSectors value. - Fix counting the PartitonaNumber. UpdatePartitionNumbers() has become obsolete. Remove it. Modified: trunk/reactos/base/setup/usetup/partlist.c Modified: trunk/reactos/base/setup/usetup/partlist.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/partlist…
============================================================================== --- trunk/reactos/base/setup/usetup/partlist.c [iso-8859-1] (original) +++ trunk/reactos/base/setup/usetup/partlist.c [iso-8859-1] Sun Jun 21 08:55:43 2015 @@ -206,52 +206,6 @@ } -static -VOID -UpdatePartitionNumbers( - PDISKENTRY DiskEntry) -{ - PPARTENTRY PartEntry; - PLIST_ENTRY Entry; -// ULONG PartitionNumber = 1; - ULONG PartitionIndex = 0; - - Entry = DiskEntry->PrimaryPartListHead.Flink; - while (Entry != &DiskEntry->PrimaryPartListHead) - { - PartEntry = CONTAINING_RECORD(Entry, - PARTENTRY, - ListEntry); - - if (PartEntry->IsPartitioned == FALSE) - { -// PartEntry->PartitionNumber = 0; - PartEntry->PartitionIndex = (ULONG)-1; - } - else - { - if (IsContainerPartition(PartEntry->PartitionType)) - { -// PartEntry->PartitionNumber = 0; - } - else if (PartEntry->PartitionType == PARTITION_ENTRY_UNUSED && - PartEntry->SectorCount.QuadPart == 0ULL) - { -// PartEntry->PartitionNumber = 0; - } - else - { -// PartEntry->PartitionNumber = PartitionNumber++; - } - - PartEntry->PartitionIndex = PartitionIndex++; - } - - Entry = Entry->Flink; - } -} - - NTSTATUS NTAPI DiskIdentifierQueryRoutine( @@ -2297,7 +2251,7 @@ PartitionInfo->StartingOffset.QuadPart = PartEntry->StartSector.QuadPart * DiskEntry->BytesPerSector; PartitionInfo->PartitionLength.QuadPart = PartEntry->SectorCount.QuadPart * DiskEntry->BytesPerSector; - PartitionInfo->HiddenSectors = 0; + PartitionInfo->HiddenSectors = PartEntry->StartSector.LowPart; PartitionInfo->PartitionNumber = (!IsContainerPartition(PartEntry->PartitionType)) ? PartitionNumber : 0; PartitionInfo->PartitionType = PartEntry->PartitionType; PartitionInfo->BootIndicator = PartEntry->BootIndicator; @@ -2306,13 +2260,10 @@ PartEntry->PartitionNumber = PartitionNumber; PartEntry->PartitionIndex = Index; - + } + + if (!IsContainerPartition(PartEntry->PartitionType)) PartitionNumber++; - } - else if (!IsEmptyLayoutEntry(PartitionInfo)) - { - PartitionNumber++; - } Index++; } @@ -2480,8 +2431,6 @@ DiskEntry->Dirty = TRUE; - UpdatePartitionNumbers(DiskEntry); - AssignDriveLetters(List); } @@ -2624,8 +2573,6 @@ UpdateDiskLayout(DiskEntry); DiskEntry->Dirty = TRUE; - - UpdatePartitionNumbers(DiskEntry); AssignDriveLetters(List); } @@ -2712,8 +2659,6 @@ DiskEntry->Dirty = TRUE; - UpdatePartitionNumbers(DiskEntry); - AssignDriveLetters(List); } @@ -2822,8 +2767,6 @@ UpdateDiskLayout(DiskEntry); DiskEntry->Dirty = TRUE; - - UpdatePartitionNumbers(DiskEntry); AssignDriveLetters(List); }
9 years, 6 months
1
0
0
0
[tfaber] 68225: [NTDLL_APITEST] - Add a test for SystemFlagsInformation that demonstrates the parameter checks performed by NtQuerySystemInformation/NtSetSystemInformation CORE-9849
by tfaber@svn.reactos.org
Author: tfaber Date: Sun Jun 21 08:50:10 2015 New Revision: 68225 URL:
http://svn.reactos.org/svn/reactos?rev=68225&view=rev
Log: [NTDLL_APITEST] - Add a test for SystemFlagsInformation that demonstrates the parameter checks performed by NtQuerySystemInformation/NtSetSystemInformation CORE-9849 Modified: trunk/rostests/apitests/ntdll/SystemInfo.c Modified: trunk/rostests/apitests/ntdll/SystemInfo.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/ntdll/SystemInfo…
============================================================================== --- trunk/rostests/apitests/ntdll/SystemInfo.c [iso-8859-1] (original) +++ trunk/rostests/apitests/ntdll/SystemInfo.c [iso-8859-1] Sun Jun 21 08:50:10 2015 @@ -3,33 +3,182 @@ * LICENSE: GPL - See COPYING in the top level directory * PURPOSE: Test for NtQuery/SetSystemInformation * PROGRAMMERS: Timo Kreuzer + * Thomas Faber <thomas.faber(a)reactos.org> */ #include <apitest.h> #define WIN32_NO_STATUS #include <ndk/exfuncs.h> - +#include <ndk/rtlfuncs.h> +#include <ndk/setypes.h> + +#define ntv6(x) (LOBYTE(LOWORD(GetVersion())) >= 6 ? (x) : 0) + +static void -GetPrivilege() +Test_Flags(void) { - HANDLE hToken; - TOKEN_PRIVILEGES tkp; - - OpenProcessToken(GetCurrentProcess(), - TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, - &hToken); - - LookupPrivilegeValue(NULL, SE_SYSTEMTIME_NAME, &tkp.Privileges[0].Luid); - - tkp.PrivilegeCount = 1; - tkp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED; - - AdjustTokenPrivileges(hToken, FALSE, &tkp, 0, NULL, 0); - CloseHandle(hToken); + NTSTATUS Status; + ULONG ReturnLength; + ULONG Flags; + ULONG Buffer[2]; + ULONG Buffer2[2]; + PSYSTEM_FLAGS_INFORMATION FlagsInfo = (PVOID)Buffer; + BOOLEAN PrivilegeEnabled; + + /* Query */ + ReturnLength = 0x55555555; + Status = NtQuerySystemInformation(SystemFlagsInformation, NULL, 0, &ReturnLength); + ok(Status == STATUS_INFO_LENGTH_MISMATCH, "NtQuerySystemInformation returned %lx\n", Status); + ok(ReturnLength == 0 || + ntv6(ReturnLength == sizeof(SYSTEM_FLAGS_INFORMATION)), "ReturnLength = %lu\n", ReturnLength); + + ReturnLength = 0x55555555; + Status = NtQuerySystemInformation(SystemFlagsInformation, NULL, sizeof(SYSTEM_FLAGS_INFORMATION) - 1, &ReturnLength); + ok(Status == STATUS_ACCESS_VIOLATION, "NtQuerySystemInformation returned %lx\n", Status); + ok(ReturnLength == 0x55555555, "ReturnLength = %lu\n", ReturnLength); + + ReturnLength = 0x55555555; + Status = NtQuerySystemInformation(SystemFlagsInformation, (PVOID)2, 0, &ReturnLength); + ok(Status == STATUS_INFO_LENGTH_MISMATCH, "NtQuerySystemInformation returned %lx\n", Status); + ok(ReturnLength == 0 || + ntv6(ReturnLength == sizeof(SYSTEM_FLAGS_INFORMATION)), "ReturnLength = %lu\n", ReturnLength); + + ReturnLength = 0x55555555; + Status = NtQuerySystemInformation(SystemFlagsInformation, (PVOID)4, 0, &ReturnLength); + ok(Status == STATUS_INFO_LENGTH_MISMATCH, "NtQuerySystemInformation returned %lx\n", Status); + ok(ReturnLength == 0 || + ntv6(ReturnLength == sizeof(SYSTEM_FLAGS_INFORMATION)), "ReturnLength = %lu\n", ReturnLength); + + ReturnLength = 0x55555555; + RtlFillMemory(Buffer, sizeof(Buffer), 0x55); + Status = NtQuerySystemInformation(SystemFlagsInformation, (PUCHAR)FlagsInfo + 2, sizeof(SYSTEM_FLAGS_INFORMATION), &ReturnLength); + ok(Status == STATUS_DATATYPE_MISALIGNMENT, "NtQuerySystemInformation returned %lx\n", Status); + ok(ReturnLength == 0x55555555, "ReturnLength = %lu\n", ReturnLength); + ok(Buffer[0] == 0x55555555, "Buffer[0] = %lx\n", Buffer[0]); + ok(Buffer[1] == 0x55555555, "Buffer[1] = %lx\n", Buffer[1]); + + ReturnLength = 0x55555555; + RtlFillMemory(Buffer, sizeof(Buffer), 0x55); + Status = NtQuerySystemInformation(SystemFlagsInformation, (PUCHAR)FlagsInfo + 2, sizeof(SYSTEM_FLAGS_INFORMATION) - 1, &ReturnLength); + ok(Status == STATUS_DATATYPE_MISALIGNMENT, "NtQuerySystemInformation returned %lx\n", Status); + ok(ReturnLength == 0x55555555, "ReturnLength = %lu\n", ReturnLength); + ok(Buffer[0] == 0x55555555, "Buffer[0] = %lx\n", Buffer[0]); + ok(Buffer[1] == 0x55555555, "Buffer[1] = %lx\n", Buffer[1]); + + ReturnLength = 0x55555555; + RtlFillMemory(Buffer, sizeof(Buffer), 0x55); + Status = NtQuerySystemInformation(SystemFlagsInformation, FlagsInfo, sizeof(SYSTEM_FLAGS_INFORMATION) - 1, &ReturnLength); + ok(Status == STATUS_INFO_LENGTH_MISMATCH, "NtQuerySystemInformation returned %lx\n", Status); + ok(ReturnLength == 0 || + ntv6(ReturnLength == sizeof(SYSTEM_FLAGS_INFORMATION)), "ReturnLength = %lu\n", ReturnLength); + ok(Buffer[0] == 0x55555555, "Buffer[0] = %lx\n", Buffer[0]); + ok(Buffer[1] == 0x55555555, "Buffer[1] = %lx\n", Buffer[1]); + + ReturnLength = 0x55555555; + RtlFillMemory(Buffer, sizeof(Buffer), 0x55); + Status = NtQuerySystemInformation(SystemFlagsInformation, FlagsInfo, sizeof(SYSTEM_FLAGS_INFORMATION), &ReturnLength); + ok(Status == STATUS_SUCCESS, "NtQuerySystemInformation returned %lx\n", Status); + ok(ReturnLength == sizeof(SYSTEM_FLAGS_INFORMATION), "ReturnLength = %lu\n", ReturnLength); + ok(FlagsInfo->Flags != 0x55555555, "Flags = %lx\n", FlagsInfo->Flags); + ok(Buffer[1] == 0x55555555, "Buffer[1] = %lx\n", Buffer[1]); + Flags = FlagsInfo->Flags; + + ReturnLength = 0x55555555; + RtlFillMemory(Buffer, sizeof(Buffer), 0x55); + Status = NtQuerySystemInformation(SystemFlagsInformation, FlagsInfo, sizeof(SYSTEM_FLAGS_INFORMATION) + 1, &ReturnLength); + ok(Status == STATUS_INFO_LENGTH_MISMATCH, "NtQuerySystemInformation returned %lx\n", Status); + ok(ReturnLength == 0 || + ntv6(ReturnLength == sizeof(SYSTEM_FLAGS_INFORMATION)), "ReturnLength = %lu\n", ReturnLength); + ok(Buffer[0] == 0x55555555, "Buffer[0] = %lx\n", Buffer[0]); + ok(Buffer[1] == 0x55555555, "Buffer[1] = %lx\n", Buffer[1]); + + RtlFillMemory(Buffer, sizeof(Buffer), 0x55); + Status = NtQuerySystemInformation(SystemFlagsInformation, FlagsInfo, sizeof(SYSTEM_FLAGS_INFORMATION), NULL); + ok(Status == STATUS_SUCCESS, "NtQuerySystemInformation returned %lx\n", Status); + ok(FlagsInfo->Flags == Flags, "Flags = %lx, expected %lx\n", FlagsInfo->Flags, Flags); + ok(Buffer[1] == 0x55555555, "Buffer[1] = %lx\n", Buffer[1]); + + RtlFillMemory(Buffer, sizeof(Buffer), 0x55); + Status = NtQuerySystemInformation(SystemFlagsInformation, FlagsInfo, sizeof(SYSTEM_FLAGS_INFORMATION), (PVOID)4); + ok(Status == STATUS_ACCESS_VIOLATION, "NtQuerySystemInformation returned %lx\n", Status); + ok(Buffer[0] == 0x55555555, "Buffer[0] = %lx\n", Buffer[0]); + ok(Buffer[1] == 0x55555555, "Buffer[1] = %lx\n", Buffer[1]); + + RtlFillMemory(Buffer, sizeof(Buffer), 0x55); + Status = NtQuerySystemInformation(SystemFlagsInformation, FlagsInfo, sizeof(SYSTEM_FLAGS_INFORMATION), (PVOID)2); + ok(Status == STATUS_ACCESS_VIOLATION, "NtQuerySystemInformation returned %lx\n", Status); + ok(Buffer[0] == 0x55555555, "Buffer[0] = %lx\n", Buffer[0]); + ok(Buffer[1] == 0x55555555, "Buffer[1] = %lx\n", Buffer[1]); + + RtlFillMemory(Buffer, sizeof(Buffer), 0x55); + Status = NtQuerySystemInformation(SystemFlagsInformation, FlagsInfo, sizeof(SYSTEM_FLAGS_INFORMATION), (PVOID)1); + ok(Status == STATUS_ACCESS_VIOLATION, "NtQuerySystemInformation returned %lx\n", Status); + ok(Buffer[0] == 0x55555555, "Buffer[0] = %lx\n", Buffer[0]); + ok(Buffer[1] == 0x55555555, "Buffer[1] = %lx\n", Buffer[1]); + + RtlFillMemory(Buffer2, sizeof(Buffer2), 0x55); + RtlFillMemory(Buffer, sizeof(Buffer), 0x55); + Status = NtQuerySystemInformation(SystemFlagsInformation, FlagsInfo, sizeof(SYSTEM_FLAGS_INFORMATION), (PULONG)((PUCHAR)Buffer2 + 1)); + ok(Status == STATUS_SUCCESS, "NtQuerySystemInformation returned %lx\n", Status); + ok(FlagsInfo->Flags == Flags, "Flags = %lx, expected %lx\n", FlagsInfo->Flags, Flags); + ok(Buffer[1] == 0x55555555, "Buffer[1] = %lx\n", Buffer[1]); + ok(Buffer2[0] == 0x00000455, "Buffer2[0] = %lx\n", Buffer2[0]); + ok(Buffer2[1] == 0x55555500, "Buffer2[1] = %lx\n", Buffer2[1]); + + /* Set */ + Status = NtSetSystemInformation(SystemFlagsInformation, NULL, 0); + ok(Status == STATUS_INFO_LENGTH_MISMATCH, "NtSetSystemInformation returned %lx\n", Status); + + Status = NtSetSystemInformation(SystemFlagsInformation, NULL, sizeof(SYSTEM_FLAGS_INFORMATION) - 1); + ok(Status == STATUS_INFO_LENGTH_MISMATCH, "NtSetSystemInformation returned %lx\n", Status); + + Status = NtSetSystemInformation(SystemFlagsInformation, NULL, sizeof(SYSTEM_FLAGS_INFORMATION)); + ok(Status == STATUS_ACCESS_DENIED, "NtSetSystemInformation returned %lx\n", Status); + + Status = NtSetSystemInformation(SystemFlagsInformation, (PVOID)2, sizeof(SYSTEM_FLAGS_INFORMATION)); + ok(Status == STATUS_DATATYPE_MISALIGNMENT, "NtSetSystemInformation returned %lx\n", Status); + + Status = RtlAdjustPrivilege(SE_DEBUG_PRIVILEGE, TRUE, FALSE, &PrivilegeEnabled); + if (!NT_SUCCESS(Status)) + { + skip("Cannot acquire SeDebugPrivilege\n"); + return; + } + + Status = NtSetSystemInformation(SystemFlagsInformation, NULL, sizeof(SYSTEM_FLAGS_INFORMATION)); + ok(Status == STATUS_ACCESS_VIOLATION, "NtSetSystemInformation returned %lx\n", Status); + + Status = NtSetSystemInformation(SystemFlagsInformation, (PVOID)2, sizeof(SYSTEM_FLAGS_INFORMATION)); + ok(Status == STATUS_DATATYPE_MISALIGNMENT, "NtSetSystemInformation returned %lx\n", Status); + + Status = NtSetSystemInformation(SystemFlagsInformation, (PVOID)4, sizeof(SYSTEM_FLAGS_INFORMATION)); + ok(Status == STATUS_ACCESS_VIOLATION, "NtSetSystemInformation returned %lx\n", Status); + + FlagsInfo->Flags = Flags; + Status = NtSetSystemInformation(SystemFlagsInformation, (PUCHAR)FlagsInfo + 2, sizeof(SYSTEM_FLAGS_INFORMATION)); + ok(Status == STATUS_DATATYPE_MISALIGNMENT, "NtSetSystemInformation returned %lx\n", Status); + + Status = NtSetSystemInformation(SystemFlagsInformation, (PUCHAR)FlagsInfo + 2, sizeof(SYSTEM_FLAGS_INFORMATION) - 1); + ok(Status == STATUS_DATATYPE_MISALIGNMENT, "NtSetSystemInformation returned %lx\n", Status); + + Status = NtSetSystemInformation(SystemFlagsInformation, FlagsInfo, sizeof(SYSTEM_FLAGS_INFORMATION) - 1); + ok(Status == STATUS_INFO_LENGTH_MISMATCH, "NtSetSystemInformation returned %lx\n", Status); + + Status = NtSetSystemInformation(SystemFlagsInformation, FlagsInfo, sizeof(SYSTEM_FLAGS_INFORMATION) + 1); + ok(Status == STATUS_INFO_LENGTH_MISMATCH, "NtSetSystemInformation returned %lx\n", Status); + + Status = NtSetSystemInformation(SystemFlagsInformation, FlagsInfo, sizeof(SYSTEM_FLAGS_INFORMATION)); + ok(Status == STATUS_SUCCESS, "NtSetSystemInformation returned %lx\n", Status); + + ok(FlagsInfo->Flags == Flags, "Flags = %lx, expected %lu\n", FlagsInfo->Flags, Flags); + + Status = RtlAdjustPrivilege(SE_DEBUG_PRIVILEGE, PrivilegeEnabled, FALSE, &PrivilegeEnabled); + ok(Status == STATUS_SUCCESS, "RtlAdjustPrivilege returned %lx\n", Status); } - +static void Test_TimeAdjustment(void) { @@ -37,6 +186,7 @@ SYSTEM_SET_TIME_ADJUST_INFORMATION SetTimeInfo; NTSTATUS Status; ULONG ReturnLength; + BOOLEAN PrivilegeEnabled; SetTimeInfo.TimeAdjustment = 0; SetTimeInfo.Enable = 0; @@ -54,7 +204,12 @@ ok_ntstatus(Status, STATUS_PRIVILEGE_NOT_HELD); /* Get the required privilege */ - GetPrivilege(); + Status = RtlAdjustPrivilege(SE_SYSTEMTIME_PRIVILEGE, TRUE, FALSE, &PrivilegeEnabled); + if (!NT_SUCCESS(Status)) + { + skip("Cannot acquire SeSystemTimePrivilege\n"); + return; + } /* Test wrong length */ Status = NtSetSystemInformation(SystemTimeAdjustmentInformation, @@ -110,9 +265,12 @@ sizeof(SetTimeInfo)); ok_ntstatus(Status, STATUS_SUCCESS); + Status = RtlAdjustPrivilege(SE_SYSTEMTIME_PRIVILEGE, PrivilegeEnabled, FALSE, &PrivilegeEnabled); + ok(Status == STATUS_SUCCESS, "RtlAdjustPrivilege returned %lx\n", Status); } START_TEST(NtSystemInformation) { + Test_Flags(); Test_TimeAdjustment(); }
9 years, 6 months
1
0
0
0
[pschweitzer] 68224: [NTOSKNRL] As shown by the non commited yet tests from Thomas, we have to check for privilege in NtSetSystemInformation - SystemFlagsInformation
by pschweitzer@svn.reactos.org
Author: pschweitzer Date: Sun Jun 21 08:07:11 2015 New Revision: 68224 URL:
http://svn.reactos.org/svn/reactos?rev=68224&view=rev
Log: [NTOSKNRL] As shown by the non commited yet tests from Thomas, we have to check for privilege in NtSetSystemInformation - SystemFlagsInformation Modified: trunk/reactos/ntoskrnl/ex/sysinfo.c Modified: trunk/reactos/ntoskrnl/ex/sysinfo.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ex/sysinfo.c?rev=…
============================================================================== --- trunk/reactos/ntoskrnl/ex/sysinfo.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ex/sysinfo.c [iso-8859-1] Sun Jun 21 08:07:11 2015 @@ -1080,6 +1080,12 @@ { return STATUS_INFO_LENGTH_MISMATCH; } + + if (!SeSinglePrivilegeCheck(SeDebugPrivilege, ExGetPreviousMode())) + { + return STATUS_ACCESS_DENIED; + } + NtGlobalFlag = ((PSYSTEM_FLAGS_INFORMATION) Buffer)->Flags; return STATUS_SUCCESS; }
9 years, 6 months
1
0
0
0
[pschweitzer] 68223: [NTOSKRNL] - Probe input buffer for read in NtSetSystemInformation() and call the helpers function in a PSEH block - For the NtSetSytemInformation - SystemSessionCreate specifi...
by pschweitzer@svn.reactos.org
Author: pschweitzer Date: Sun Jun 21 08:06:25 2015 New Revision: 68223 URL:
http://svn.reactos.org/svn/reactos?rev=68223&view=rev
Log: [NTOSKRNL] - Probe input buffer for read in NtSetSystemInformation() and call the helpers function in a PSEH block - For the NtSetSytemInformation - SystemSessionCreate specific case, as we return session ID, probe for write directly there. Modified: trunk/reactos/ntoskrnl/ex/sysinfo.c Modified: trunk/reactos/ntoskrnl/ex/sysinfo.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ex/sysinfo.c?rev=…
============================================================================== --- trunk/reactos/ntoskrnl/ex/sysinfo.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ex/sysinfo.c [iso-8859-1] Sun Jun 21 08:06:25 2015 @@ -2068,6 +2068,8 @@ { return STATUS_PRIVILEGE_NOT_HELD; } + + ProbeForWriteUlong(Buffer); } Status = MmSessionCreate(&SessionId); @@ -2452,43 +2454,47 @@ IN PVOID SystemInformation, IN ULONG SystemInformationLength) { + NTSTATUS Status = STATUS_INVALID_INFO_CLASS; + KPROCESSOR_MODE PreviousMode; + PAGED_CODE(); - /* - * If called from user mode, check - * possible unsafe arguments. - */ -#if 0 - if (KernelMode != KeGetPreviousMode()) - { - // Check arguments - //ProbeForWrite( - // SystemInformation, - // Length - // ); - //ProbeForWrite( - // ResultLength, - // sizeof (ULONG) - // ); - } -#endif - /* - * Check the request is valid. - */ - if ((SystemInformationClass >= MIN_SYSTEM_INFO_CLASS) && - (SystemInformationClass < MAX_SYSTEM_INFO_CLASS)) - { - if (NULL != CallQS [SystemInformationClass].Set) - { - /* - * Hand the request to a subhandler. - */ - return CallQS [SystemInformationClass].Set(SystemInformation, - SystemInformationLength); - } - } - - return STATUS_INVALID_INFO_CLASS; + PreviousMode = ExGetPreviousMode(); + + _SEH2_TRY + { + /* + * If called from user mode, check + * possible unsafe arguments. + */ + if (PreviousMode != KernelMode) + { + ProbeForRead(SystemInformation, SystemInformationLength, sizeof(ULONG)); + } + + /* + * Check the request is valid. + */ + if ((SystemInformationClass >= MIN_SYSTEM_INFO_CLASS) && + (SystemInformationClass < MAX_SYSTEM_INFO_CLASS)) + { + if (NULL != CallQS [SystemInformationClass].Set) + { + /* + * Hand the request to a subhandler. + */ + Status = CallQS [SystemInformationClass].Set(SystemInformation, + SystemInformationLength); + } + } + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + Status = _SEH2_GetExceptionCode(); + } + _SEH2_END; + + return Status; } NTSTATUS
9 years, 6 months
1
0
0
0
[pschweitzer] 68222: [NTOSKRNL] Revert r68221: probing *should* be done in NtSetSystemInformation() Let's check there why it's not done instead...
by pschweitzer@svn.reactos.org
Author: pschweitzer Date: Sun Jun 21 05:46:38 2015 New Revision: 68222 URL:
http://svn.reactos.org/svn/reactos?rev=68222&view=rev
Log: [NTOSKRNL] Revert r68221: probing *should* be done in NtSetSystemInformation() Let's check there why it's not done instead... Modified: trunk/reactos/ntoskrnl/ex/sysinfo.c Modified: trunk/reactos/ntoskrnl/ex/sysinfo.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ex/sysinfo.c?rev=…
============================================================================== --- trunk/reactos/ntoskrnl/ex/sysinfo.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ex/sysinfo.c [iso-8859-1] Sun Jun 21 05:46:38 2015 @@ -2068,31 +2068,10 @@ { return STATUS_PRIVILEGE_NOT_HELD; } - - _SEH2_TRY - { - ProbeForWriteUlong(Buffer); - } - _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) - { - _SEH2_YIELD(return _SEH2_GetExceptionCode()); - } - _SEH2_END; } Status = MmSessionCreate(&SessionId); - if (NT_SUCCESS(Status)) - { - _SEH2_TRY - { - *(PULONG)Buffer = SessionId; - } - _SEH2_EXCEPT(ExSystemExceptionFilter()) - { - Status = _SEH2_GetExceptionCode(); - } - _SEH2_END; - } + if (NT_SUCCESS(Status)) *(PULONG)Buffer = SessionId; return Status; } @@ -2112,21 +2091,9 @@ { return STATUS_PRIVILEGE_NOT_HELD; } - - _SEH2_TRY - { - SessionId = ProbeForReadUlong(Buffer); - } - _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) - { - _SEH2_YIELD(return _SEH2_GetExceptionCode()); - } - _SEH2_END; - } - else - { - SessionId = *(PULONG)Buffer; - } + } + + SessionId = *(PULONG)Buffer; return MmSessionDelete(SessionId); }
9 years, 6 months
1
0
0
0
[pschweitzer] 68221: [NTOSKRNL] Don't trust the user! Probe buffers in NtSetSystemInformation - SystemSessionCreate and in NtSetSystemInformation - SystemSessionDetach
by pschweitzer@svn.reactos.org
Author: pschweitzer Date: Sun Jun 21 05:40:15 2015 New Revision: 68221 URL:
http://svn.reactos.org/svn/reactos?rev=68221&view=rev
Log: [NTOSKRNL] Don't trust the user! Probe buffers in NtSetSystemInformation - SystemSessionCreate and in NtSetSystemInformation - SystemSessionDetach Modified: trunk/reactos/ntoskrnl/ex/sysinfo.c Modified: trunk/reactos/ntoskrnl/ex/sysinfo.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ex/sysinfo.c?rev=…
============================================================================== --- trunk/reactos/ntoskrnl/ex/sysinfo.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ex/sysinfo.c [iso-8859-1] Sun Jun 21 05:40:15 2015 @@ -2068,10 +2068,31 @@ { return STATUS_PRIVILEGE_NOT_HELD; } + + _SEH2_TRY + { + ProbeForWriteUlong(Buffer); + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + _SEH2_YIELD(return _SEH2_GetExceptionCode()); + } + _SEH2_END; } Status = MmSessionCreate(&SessionId); - if (NT_SUCCESS(Status)) *(PULONG)Buffer = SessionId; + if (NT_SUCCESS(Status)) + { + _SEH2_TRY + { + *(PULONG)Buffer = SessionId; + } + _SEH2_EXCEPT(ExSystemExceptionFilter()) + { + Status = _SEH2_GetExceptionCode(); + } + _SEH2_END; + } return Status; } @@ -2091,9 +2112,21 @@ { return STATUS_PRIVILEGE_NOT_HELD; } - } - - SessionId = *(PULONG)Buffer; + + _SEH2_TRY + { + SessionId = ProbeForReadUlong(Buffer); + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + _SEH2_YIELD(return _SEH2_GetExceptionCode()); + } + _SEH2_END; + } + else + { + SessionId = *(PULONG)Buffer; + } return MmSessionDelete(SessionId); }
9 years, 6 months
1
0
0
0
[pschweitzer] 68220: [NTOSKRNL] Don't use SYSTEM_INFORMATION_CLASS definition from Wine but from NDK. Fix naming accordingly
by pschweitzer@svn.reactos.org
Author: pschweitzer Date: Sun Jun 21 05:33:53 2015 New Revision: 68220 URL:
http://svn.reactos.org/svn/reactos?rev=68220&view=rev
Log: [NTOSKRNL] Don't use SYSTEM_INFORMATION_CLASS definition from Wine but from NDK. Fix naming accordingly Modified: trunk/reactos/ntoskrnl/ex/sysinfo.c Modified: trunk/reactos/ntoskrnl/ex/sysinfo.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ex/sysinfo.c?rev=…
============================================================================== --- trunk/reactos/ntoskrnl/ex/sysinfo.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ex/sysinfo.c [iso-8859-1] Sun Jun 21 05:33:53 2015 @@ -1559,11 +1559,11 @@ return STATUS_NOT_IMPLEMENTED; } -/* Class 31 - Event Ids Information */ -QSI_DEF(SystemEventIdsInformation) -{ - /* FIXME */ - DPRINT1("NtQuerySystemInformation - SystemEventIdsInformation not implemented\n"); +/* Class 31 */ +QSI_DEF(SystemPerformanceTraceInformation) +{ + /* FIXME */ + DPRINT1("NtQuerySystemInformation - SystemPerformanceTraceInformation not implemented\n"); return STATUS_NOT_IMPLEMENTED; } @@ -1820,24 +1820,24 @@ return STATUS_SUCCESS; } -/* Class 40 - Plug Play Bus Information */ -QSI_DEF(SystemPlugPlayBusInformation) -{ - /* FIXME */ - DPRINT1("NtQuerySystemInformation - SystemPlugPlayBusInformation not implemented\n"); - return STATUS_NOT_IMPLEMENTED; -} - -/* Class 41 - Dock Information */ -QSI_DEF(SystemDockInformation) -{ - /* FIXME */ - DPRINT1("NtQuerySystemInformation - SystemDockInformation not implemented\n"); +/* Class 40 */ +QSI_DEF(SystemVerifierAddDriverInformation) +{ + /* FIXME */ + DPRINT1("NtQuerySystemInformation - SystemVerifierAddDriverInformation not implemented\n"); + return STATUS_NOT_IMPLEMENTED; +} + +/* Class 41 */ +QSI_DEF(SystemVerifierRemoveDriverInformation) +{ + /* FIXME */ + DPRINT1("NtQuerySystemInformation - SystemVerifierRemoveDriverInformation not implemented\n"); return STATUS_NOT_IMPLEMENTED; } /* Class 42 - Power Information */ -QSI_DEF(SystemPowerInformation) +QSI_DEF(SystemProcessorIdleInformation) { *ReqSize = sizeof(PROCESSOR_POWER_INFORMATION) * KeNumberProcessors; @@ -1851,11 +1851,11 @@ return STATUS_NOT_IMPLEMENTED; } -/* Class 43 - Processor Speed Information */ -QSI_DEF(SystemProcessorSpeedInformation) -{ - /* FIXME */ - DPRINT1("NtQuerySystemInformation - SystemProcessorSpeedInformation not implemented\n"); +/* Class 43 */ +QSI_DEF(SystemLegacyDriverInformation) +{ + /* FIXME */ + DPRINT1("NtQuerySystemInformation - SystemLegacyDriverInformation not implemented\n"); return STATUS_NOT_IMPLEMENTED; } @@ -2038,10 +2038,10 @@ /* Class 46 - Set time slip event */ -SSI_DEF(SystemSetTimeSlipEvent) -{ - /* FIXME */ - DPRINT1("NtSetSystemInformation - SystemSetTimSlipEvent not implemented\n"); +SSI_DEF(SystemTimeSlipNotification) +{ + /* FIXME */ + DPRINT1("NtSetSystemInformation - SystemTimeSlipNotification not implemented\n"); return STATUS_NOT_IMPLEMENTED; } @@ -2054,7 +2054,7 @@ MmSessionDelete(IN ULONG SessionId); /* Class 47 - Create a new session (TSE) */ -SSI_DEF(SystemCreateSession) +SSI_DEF(SystemSessionCreate) { ULONG SessionId; KPROCESSOR_MODE PreviousMode = KeGetPreviousMode(); @@ -2078,7 +2078,7 @@ /* Class 48 - Delete an existing session (TSE) */ -SSI_DEF(SystemDeleteSession) +SSI_DEF(SystemSessionDetach) { ULONG SessionId; KPROCESSOR_MODE PreviousMode = KeGetPreviousMode(); @@ -2100,10 +2100,10 @@ /* Class 49 - UNKNOWN */ -QSI_DEF(SystemInvalidInfoClass4) -{ - /* FIXME */ - DPRINT1("NtQuerySystemInformation - SystemInvalidInfoClass4 not implemented\n"); +QSI_DEF(SystemSessionInformation) +{ + /* FIXME */ + DPRINT1("NtQuerySystemInformation - SystemSessionInformation not implemented\n"); return STATUS_NOT_IMPLEMENTED; } @@ -2138,11 +2138,11 @@ } -/* Class 52 - Add a driver verifier */ -SSI_DEF(SystemAddVerifier) -{ - /* FIXME */ - DPRINT1("NtSetSystemInformation - SystemAddVerifier not implemented\n"); +/* Class 52 */ +SSI_DEF(SystemVerifierThunkExtend) +{ + /* FIXME */ + DPRINT1("NtSetSystemInformation - SystemVerifierThunkExtend not implemented\n"); return STATUS_NOT_IMPLEMENTED; } @@ -2322,54 +2322,54 @@ SI_QX(SystemPerformanceInformation), SI_QX(SystemTimeOfDayInformation), SI_QX(SystemPathInformation), /* should be SI_XX */ - SI_QX(SystemProcessInformation), // aka SystemProcessesAndThreadsInformation - SI_QX(SystemCallCountInformation), // aka SystemCallCounts - SI_QX(SystemDeviceInformation), // aka SystemConfigurationInformation - SI_QX(SystemProcessorPerformanceInformation), // aka SystemProcessorTimes - SI_QS(SystemFlagsInformation), // aka SystemGlobalFlag + SI_QX(SystemProcessInformation), + SI_QX(SystemCallCountInformation), + SI_QX(SystemDeviceInformation), + SI_QX(SystemProcessorPerformanceInformation), + SI_QS(SystemFlagsInformation), SI_QX(SystemCallTimeInformation), /* should be SI_XX */ SI_QX(SystemModuleInformation), - SI_QX(SystemLocksInformation), // aka SystemLockInformation + SI_QX(SystemLocksInformation), SI_QX(SystemStackTraceInformation), /* should be SI_XX */ SI_QX(SystemPagedPoolInformation), /* should be SI_XX */ SI_QX(SystemNonPagedPoolInformation), /* should be SI_XX */ SI_QX(SystemHandleInformation), SI_QX(SystemObjectInformation), - SI_QX(SystemPageFileInformation), // aka SystemPagefileInformation - SI_QX(SystemVdmInstemulInformation), // aka SystemInstructionEmulationCounts + SI_QX(SystemPageFileInformation), + SI_QX(SystemVdmInstemulInformation), SI_QX(SystemVdmBopInformation), /* it should be SI_XX */ - SI_QS(SystemFileCacheInformation), // aka SystemCacheInformation + SI_QS(SystemFileCacheInformation), SI_QX(SystemPoolTagInformation), - SI_QX(SystemInterruptInformation), // aka SystemProcessorStatistics - SI_QS(SystemDpcBehaviourInformation), // aka SystemDpcInformation + SI_QX(SystemInterruptInformation), + SI_QS(SystemDpcBehaviourInformation), SI_QX(SystemFullMemoryInformation), /* it should be SI_XX */ - SI_XS(SystemLoadGdiDriverInformation), // correct: SystemLoadImage - SI_XS(SystemUnloadGdiDriverInformation), // correct: SystemUnloadImage - SI_QS(SystemTimeAdjustmentInformation), // aka SystemTimeAdjustment + SI_XS(SystemLoadGdiDriverInformation), + SI_XS(SystemUnloadGdiDriverInformation), + SI_QS(SystemTimeAdjustmentInformation), SI_QX(SystemSummaryMemoryInformation), /* it should be SI_XX */ SI_QX(SystemNextEventIdInformation), /* it should be SI_XX */ - SI_QX(SystemEventIdsInformation), /* it should be SI_XX */ // SystemPerformanceTraceInformation + SI_QX(SystemPerformanceTraceInformation), /* it should be SI_XX */ SI_QX(SystemCrashDumpInformation), SI_QX(SystemExceptionInformation), SI_QX(SystemCrashDumpStateInformation), SI_QX(SystemKernelDebuggerInformation), SI_QX(SystemContextSwitchInformation), SI_QS(SystemRegistryQuotaInformation), - SI_XS(SystemExtendServiceTableInformation), // correct: SystemLoadAndCallImage + SI_XS(SystemExtendServiceTableInformation), SI_XS(SystemPrioritySeperation), - SI_QX(SystemPlugPlayBusInformation), /* it should be SI_XX */ - SI_QX(SystemDockInformation), /* it should be SI_XX */ - SI_QX(SystemPowerInformation), /* it should be SI_XX */ // SystemPowerInformationNative? SystemInvalidInfoClass2 - SI_QX(SystemProcessorSpeedInformation), /* it should be SI_XX */ - SI_QS(SystemCurrentTimeZoneInformation), /* it should be SI_QX */ // aka SystemTimeZoneInformation + SI_QX(SystemVerifierAddDriverInformation), /* it should be SI_XX */ + SI_QX(SystemVerifierRemoveDriverInformation), /* it should be SI_XX */ + SI_QX(SystemProcessorIdleInformation), /* it should be SI_XX */ + SI_QX(SystemLegacyDriverInformation), /* it should be SI_XX */ + SI_QS(SystemCurrentTimeZoneInformation), /* it should be SI_QX */ SI_QX(SystemLookasideInformation), - SI_XS(SystemSetTimeSlipEvent), - SI_XS(SystemCreateSession), - SI_XS(SystemDeleteSession), - SI_QX(SystemInvalidInfoClass4), /* it should be SI_XX */ // SystemSessionInformation? + SI_XS(SystemTimeSlipNotification), + SI_XS(SystemSessionCreate), + SI_XS(SystemSessionDetach), + SI_QX(SystemSessionInformation), /* it should be SI_XX */ SI_QX(SystemRangeStartInformation), SI_QS(SystemVerifierInformation), - SI_XS(SystemAddVerifier), + SI_XS(SystemVerifierThunkExtend), SI_QX(SystemSessionProcessesInformation), SI_XS(SystemLoadGdiDriverInSystemSpaceInformation), SI_QX(SystemNumaProcessorMap),
9 years, 6 months
1
0
0
0
[tfaber] 68219: [SHELL32] - Use CreateViewObject instead of QueryInterface to get a drop target from a shell folder. CORE-9846
by tfaber@svn.reactos.org
Author: tfaber Date: Sun Jun 21 05:30:20 2015 New Revision: 68219 URL:
http://svn.reactos.org/svn/reactos?rev=68219&view=rev
Log: [SHELL32] - Use CreateViewObject instead of QueryInterface to get a drop target from a shell folder. CORE-9846 Modified: trunk/reactos/dll/win32/shell32/CDefView.cpp trunk/reactos/dll/win32/shell32/CDefaultContextMenu.cpp Modified: trunk/reactos/dll/win32/shell32/CDefView.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/CDefView…
============================================================================== --- trunk/reactos/dll/win32/shell32/CDefView.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/CDefView.cpp [iso-8859-1] Sun Jun 21 05:30:20 2015 @@ -2906,7 +2906,7 @@ { /* We are not above one of the listview's subitems. Bind to the parent folder's * DropTarget interface. */ - hr = m_pSFParent->QueryInterface(IID_PPV_ARG(IDropTarget,&m_pCurDropTarget)); + hr = m_pSFParent->CreateViewObject(NULL, IID_PPV_ARG(IDropTarget,&m_pCurDropTarget)); } else { Modified: trunk/reactos/dll/win32/shell32/CDefaultContextMenu.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/CDefault…
============================================================================== --- trunk/reactos/dll/win32/shell32/CDefaultContextMenu.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/CDefaultContextMenu.cpp [iso-8859-1] Sun Jun 21 05:30:20 2015 @@ -1086,7 +1086,7 @@ } CComPtr<IDropTarget> pdrop; - hr = psfTarget->QueryInterface(IID_PPV_ARG(IDropTarget, &pdrop)); + hr = psfTarget->CreateViewObject(NULL, IID_PPV_ARG(IDropTarget, &pdrop)); if (FAILED(hr)) { ERR("Error getting IDropTarget interface\n"); @@ -1154,7 +1154,7 @@ return hr; } - hr = psfTarget->QueryInterface(IID_PPV_ARG(IDropTarget, &pDT)); + hr = psfTarget->CreateViewObject(NULL, IID_PPV_ARG(IDropTarget, &pDT)); if (FAILED(hr)) { ERR("no IDropTarget Interface\n");
9 years, 6 months
1
0
0
0
[tfaber] 68218: [SHELL32] - Finally give up on that assert. It's not easily fixable CORE-9839 or CORE-9844 or CORE-9845 or whatever
by tfaber@svn.reactos.org
Author: tfaber Date: Sun Jun 21 05:21:30 2015 New Revision: 68218 URL:
http://svn.reactos.org/svn/reactos?rev=68218&view=rev
Log: [SHELL32] - Finally give up on that assert. It's not easily fixable CORE-9839 or CORE-9844 or CORE-9845 or whatever Modified: trunk/reactos/dll/win32/shell32/folders/CDesktopFolder.cpp trunk/reactos/dll/win32/shell32/folders/CDrivesFolder.cpp trunk/reactos/include/reactos/shellutils.h Modified: trunk/reactos/dll/win32/shell32/folders/CDesktopFolder.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/folders/…
============================================================================== --- trunk/reactos/dll/win32/shell32/folders/CDesktopFolder.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/folders/CDesktopFolder.cpp [iso-8859-1] Sun Jun 21 05:21:30 2015 @@ -287,7 +287,6 @@ CDesktopFolder::~CDesktopFolder() { - ASSERT(_CreatorClass::IsTerminated()); } HRESULT WINAPI CDesktopFolder::FinalConstruct() Modified: trunk/reactos/dll/win32/shell32/folders/CDrivesFolder.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/folders/…
============================================================================== --- trunk/reactos/dll/win32/shell32/folders/CDrivesFolder.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/folders/CDrivesFolder.cpp [iso-8859-1] Sun Jun 21 05:21:30 2015 @@ -161,7 +161,6 @@ CDrivesFolder::~CDrivesFolder() { TRACE ("-- destroying IShellFolder(%p)\n", this); - ASSERT(_CreatorClass::IsTerminated()); SHFree(pidlRoot); } Modified: trunk/reactos/include/reactos/shellutils.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/shellutils…
============================================================================== --- trunk/reactos/include/reactos/shellutils.h [iso-8859-1] (original) +++ trunk/reactos/include/reactos/shellutils.h [iso-8859-1] Sun Jun 21 05:21:30 2015 @@ -47,7 +47,6 @@ { private: static IUnknown *s_pInstance; - static bool s_IsTerminated; public: static HRESULT WINAPI CreateInstance(void *pv, REFIID riid, LPVOID *ppv) @@ -59,26 +58,17 @@ { PVOID pObj; HRESULT hr; - s_IsTerminated = true; hr = ATL::CComCreator< T >::CreateInstance(NULL, IID_IUnknown, &pObj); if (FAILED(hr)) - { - s_IsTerminated = false; return hr; - } if (InterlockedCompareExchangePointer((PVOID *)&s_pInstance, pObj, NULL)) static_cast<IUnknown *>(pObj)->Release(); - s_IsTerminated = false; } return s_pInstance->QueryInterface(riid, ppv); } static void Term() { ULONG ref; -#ifdef ASSERT - ASSERT(!s_IsTerminated); -#endif - s_IsTerminated = true; if (s_pInstance) { ref = s_pInstance->Release(); @@ -88,16 +78,12 @@ s_pInstance = NULL; } } - static bool IsTerminated() { return s_IsTerminated; } }; template <typename T> IUnknown *CComCreatorCentralInstance<T>::s_pInstance = NULL; -template <typename T> -bool CComCreatorCentralInstance<T>::s_IsTerminated = false; - -#define DECLARE_CENTRAL_INSTANCE_NOT_AGGREGATABLE(x) \ +#define DECLARE_CENTRAL_INSTANCE_NOT_AGGREGATABLE(x) \ public: \ typedef CComCreatorCentralInstance< ATL::CComObject<x> > _CreatorClass; #endif
9 years, 6 months
1
0
0
0
← Newer
1
...
8
9
10
11
12
13
14
...
35
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
Results per page:
10
25
50
100
200