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
2025
January
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
December 2020
----- 2025 -----
January 2025
----- 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
17 participants
131 discussions
Start a n
N
ew thread
[reactos] 01/01: [KMTESTS] Add more tests for CcMapData & CcPinRead
by Jérôme Gardou
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=115b8290cd77d5f091937…
commit 115b8290cd77d5f0919378e49df1e76f87b3bea5 Author: Jérôme Gardou <jerome.gardou(a)reactos.org> AuthorDate: Fri Dec 18 15:23:22 2020 +0100 Commit: Jérôme Gardou <jerome.gardou(a)reactos.org> CommitDate: Tue Dec 22 11:03:51 2020 +0100 [KMTESTS] Add more tests for CcMapData & CcPinRead Those show the shortcomings of the current implementation in ReactOS --- modules/rostests/kmtests/ntos_cc/CcMapData_drv.c | 48 +++++++-- modules/rostests/kmtests/ntos_cc/CcPinRead_drv.c | 130 +++++++++++++++++++---- 2 files changed, 146 insertions(+), 32 deletions(-) diff --git a/modules/rostests/kmtests/ntos_cc/CcMapData_drv.c b/modules/rostests/kmtests/ntos_cc/CcMapData_drv.c index 12e8286b936..5e43eb77408 100644 --- a/modules/rostests/kmtests/ntos_cc/CcMapData_drv.c +++ b/modules/rostests/kmtests/ntos_cc/CcMapData_drv.c @@ -371,28 +371,58 @@ PerformTest( } else if (TestId == 4) { + FileSizes.AllocationSize.QuadPart += VACB_MAPPING_GRANULARITY; + CcSetFileSizes(TestFileObject, &FileSizes); + /* Map after EOF */ Ret = FALSE; Offset.QuadPart = FileSizes.FileSize.QuadPart + 0x1000; KmtStartSeh(); - Ret = CcMapData(TestFileObject, &Offset, 0x1000, 0, &Bcb, (PVOID *)&Buffer); + Ret = CcMapData(TestFileObject, &Offset, 0x1000, MAP_WAIT, &Bcb, (PVOID *)&Buffer); KmtEndSeh(STATUS_SUCCESS); - ok(Ret == FALSE, "CcMapData succeed\n"); + ok(Ret == TRUE, "CcMapData failed\n"); if (Ret) { CcUnpinData(Bcb); } - /* Map a VACB after EOF */ + /* Map a VACB after EOF. */ Ret = FALSE; Offset.QuadPart = FileSizes.FileSize.QuadPart + 0x1000 + VACB_MAPPING_GRANULARITY; KmtStartSeh(); - Ret = CcMapData(TestFileObject, &Offset, 0x1000, 0, &Bcb, (PVOID *)&Buffer); - KmtEndSeh(STATUS_ACCESS_VIOLATION); - ok(Ret == FALSE, "CcMapData succeed\n"); + Ret = CcMapData(TestFileObject, &Offset, 0x1000, MAP_WAIT, &Bcb, (PVOID *)&Buffer); + KmtEndSeh(STATUS_SUCCESS); + ok(Ret == TRUE, "CcMapData failed\n"); + + if (Ret) + { + CcUnpinData(Bcb); + } + + /* Map after Allocation */ + Ret = FALSE; + Offset.QuadPart = FileSizes.AllocationSize.QuadPart + 0x1000; + + KmtStartSeh(); + Ret = CcMapData(TestFileObject, &Offset, 0x1000, MAP_WAIT, &Bcb, (PVOID *)&Buffer); + KmtEndSeh(STATUS_SUCCESS); + ok(Ret == TRUE, "CcMapData failed\n"); + + if (Ret) + { + CcUnpinData(Bcb); + } + + Ret = FALSE; + Offset.QuadPart = FileSizes.AllocationSize.QuadPart + 0x1000 + VACB_MAPPING_GRANULARITY; + + KmtStartSeh(); + Ret = CcMapData(TestFileObject, &Offset, 0x1000, MAP_WAIT, &Bcb, (PVOID *)&Buffer); + KmtEndSeh(STATUS_SUCCESS); + ok(Ret == TRUE, "CcMapData failed\n"); if (Ret) { @@ -404,9 +434,9 @@ PerformTest( Offset.QuadPart = 0x0; KmtStartSeh(); - Ret = CcMapData(TestFileObject, &Offset, 0x1000 + VACB_MAPPING_GRANULARITY, 0, &Bcb, (PVOID *)&Buffer); + Ret = CcMapData(TestFileObject, &Offset, 0x1000 + VACB_MAPPING_GRANULARITY, MAP_WAIT, &Bcb, (PVOID *)&Buffer); KmtEndSeh(STATUS_SUCCESS); - ok(Ret == FALSE, "CcMapData succeed\n"); + ok(Ret == TRUE, "CcMapData failed\n"); if (Ret) { @@ -475,7 +505,7 @@ TestMessageHandler( ok_eq_ulong((ULONG)InLength, sizeof(ULONG)); PerformTest(*(PULONG)Buffer, DeviceObject); break; - + case IOCTL_FINISH_TEST: ok_eq_ulong((ULONG)InLength, sizeof(ULONG)); CleanupTest(*(PULONG)Buffer, DeviceObject); diff --git a/modules/rostests/kmtests/ntos_cc/CcPinRead_drv.c b/modules/rostests/kmtests/ntos_cc/CcPinRead_drv.c index 40a802b566e..3f18625d893 100644 --- a/modules/rostests/kmtests/ntos_cc/CcPinRead_drv.c +++ b/modules/rostests/kmtests/ntos_cc/CcPinRead_drv.c @@ -36,6 +36,9 @@ static BOOLEAN TestWriteCalled = FALSE; static ULONGLONG Memory = 0; static BOOLEAN TS = FALSE; +LARGE_INTEGER WriteOffset; +ULONG WriteLength; + NTSTATUS TestEntry( _In_ PDRIVER_OBJECT DriverObject, @@ -558,15 +561,17 @@ PerformTest( } else if (TestId == 5) { + FileSizes.AllocationSize.QuadPart += VACB_MAPPING_GRANULARITY; + CcSetFileSizes(TestFileObject, &FileSizes); + /* Pin after EOF */ Ret = FALSE; Offset.QuadPart = FileSizes.FileSize.QuadPart + 0x1000; KmtStartSeh(); - Ret = CcPinRead(TestFileObject, &Offset, 0x1000, 0, &Bcb, (PVOID *)&Buffer); + Ret = CcPinRead(TestFileObject, &Offset, 0x1000, PIN_WAIT, &Bcb, (PVOID *)&Buffer); KmtEndSeh(STATUS_SUCCESS); - ok(Ret == FALSE, "CcPinRead succeed\n"); - + ok(Ret == TRUE, "CcPinRead failed\n"); if (Ret) { CcUnpinData(Bcb); @@ -577,13 +582,60 @@ PerformTest( Offset.QuadPart = FileSizes.FileSize.QuadPart + 0x1000 + VACB_MAPPING_GRANULARITY; KmtStartSeh(); - Ret = CcPinRead(TestFileObject, &Offset, 0x1000, 0, &Bcb, (PVOID *)&Buffer); - KmtEndSeh(STATUS_ACCESS_VIOLATION); - ok(Ret == FALSE, "CcPinRead succeed\n"); + Ret = CcPinRead(TestFileObject, &Offset, 0x1000, PIN_WAIT, &Bcb, (PVOID *)&Buffer); + KmtEndSeh(STATUS_SUCCESS); + ok(Ret == TRUE, "CcPinRead failed\n"); + if (Ret) + { + CcUnpinData(Bcb); + } + + /* Pin after Allocation */ + Ret = FALSE; + Offset.QuadPart = FileSizes.AllocationSize.QuadPart + 0x1000; + KmtStartSeh(); + Ret = CcPinRead(TestFileObject, &Offset, 0x1000, PIN_WAIT, &Bcb, (PVOID *)&Buffer); + KmtEndSeh(STATUS_SUCCESS); + ok(Ret == TRUE, "CcPinRead failed\n"); if (Ret) { + /* Set this one dirty */ + CcSetDirtyPinnedData(Bcb, NULL); + CcUnpinData(Bcb); + + WriteOffset.QuadPart = -1LL; + WriteLength = MAXULONG; + /* Flush to trigger the write */ + CcFlushCache(TestFileObject->SectionObjectPointer, &Offset, 0x1000, NULL); + + ok_eq_longlong(WriteOffset.QuadPart, Offset.QuadPart); + ok_eq_ulong(WriteLength, 0x1000); + } + + /* Pin a VACB after Allocation */ + Ret = FALSE; + Offset.QuadPart = FileSizes.AllocationSize.QuadPart + 0x1000 + VACB_MAPPING_GRANULARITY; + + KmtStartSeh(); + Ret = CcPinRead(TestFileObject, &Offset, 0x1000, PIN_WAIT, &Bcb, (PVOID *)&Buffer); + KmtEndSeh(STATUS_SUCCESS); + ok(Ret == TRUE, "CcPinRead failed\n"); + if (Ret) + { + /* Set this one dirty */ + CcSetDirtyPinnedData(Bcb, NULL); + + CcUnpinData(Bcb); + + WriteOffset.QuadPart = -1LL; + WriteLength = MAXULONG; + /* Flush to trigger the write */ + CcFlushCache(TestFileObject->SectionObjectPointer, &Offset, 0x1000, NULL); + + ok_eq_longlong(WriteOffset.QuadPart, Offset.QuadPart); + ok_eq_ulong(WriteLength, 0x1000); } /* Pin more than a VACB */ @@ -591,13 +643,23 @@ PerformTest( Offset.QuadPart = 0x0; KmtStartSeh(); - Ret = CcPinRead(TestFileObject, &Offset, 0x1000 + VACB_MAPPING_GRANULARITY, 0, &Bcb, (PVOID *)&Buffer); + Ret = CcPinRead(TestFileObject, &Offset, 0x1000 + VACB_MAPPING_GRANULARITY, PIN_WAIT, &Bcb, (PVOID *)&Buffer); KmtEndSeh(STATUS_SUCCESS); - ok(Ret == FALSE, "CcPinRead succeed\n"); - + ok(Ret == TRUE, "CcPinRead failed\n"); if (Ret) { + /* Set this one dirty */ + CcSetDirtyPinnedData(Bcb, NULL); + CcUnpinData(Bcb); + + /* The data is dirtified through the VACB */ + WriteOffset.QuadPart = -1LL; + WriteLength = MAXULONG; + CcFlushCache(TestFileObject->SectionObjectPointer, &Offset, VACB_MAPPING_GRANULARITY + 0x1000, NULL); + + ok_eq_longlong(WriteOffset.QuadPart, Offset.QuadPart); + ok_eq_ulong(WriteLength, VACB_MAPPING_GRANULARITY + 0x1000); } } else if (TestId == 6) @@ -690,7 +752,7 @@ TestMessageHandler( ok_eq_ulong((ULONG)InLength, sizeof(ULONG)); PerformTest(*(PULONG)Buffer, DeviceObject); break; - + case IOCTL_FINISH_TEST: ok_eq_ulong((ULONG)InLength, sizeof(ULONG)); CleanupTest(*(PULONG)Buffer, DeviceObject); @@ -775,28 +837,50 @@ TestIrpHandler( Offset = IoStack->Parameters.Write.ByteOffset; Length = IoStack->Parameters.Write.Length; - ok(TestTestId == 6, "Unexpected test id: %d\n", TestTestId); + ok((TestTestId == 5) || (TestTestId == 6), "Unexpected test id: %d\n", TestTestId); ok_eq_pointer(DeviceObject, TestDeviceObject); ok_eq_pointer(IoStack->FileObject, TestFileObject); ok(FlagOn(Irp->Flags, IRP_NOCACHE), "Not coming from Cc\n"); ok_irql(PASSIVE_LEVEL); - ok(Offset.QuadPart == 0, "Offset is not null: %I64i\n", Offset.QuadPart); - ok(Length % PAGE_SIZE == 0, "Length is not aligned: %I64i\n", Length); - ok(Length == PAGE_SIZE * 4, "Length is not MappedLength-sized: %I64i\n", Length); - Buffer = MapAndLockUserBuffer(Irp, Length); - ok(Buffer != NULL, "Null pointer!\n"); + if (TestTestId == 5) + { + /* This assumes continuous writes. */ + if (WriteOffset.QuadPart != -1) + { + LONGLONG WriteEnd = WriteOffset.QuadPart + WriteLength; - Mdl = Irp->MdlAddress; - ok(Mdl != NULL, "Null pointer for MDL!\n"); - ok((Mdl->MdlFlags & MDL_PAGES_LOCKED) != 0, "MDL not locked\n"); - ok((Mdl->MdlFlags & MDL_SOURCE_IS_NONPAGED_POOL) == 0, "MDL from non paged\n"); - ok((Irp->Flags & IRP_PAGING_IO) != 0, "Non paging IO\n"); + if (WriteOffset.QuadPart > Offset.QuadPart) + WriteOffset = Offset; + if (WriteEnd < (Offset.QuadPart + Length)) + WriteLength = (Offset.QuadPart + Length) - WriteOffset.QuadPart; + } + else + { + WriteOffset = Offset; + WriteLength = Length; + } + } + else + { + ok(Offset.QuadPart == 0, "Offset is not null: %I64i\n", Offset.QuadPart); + ok(Length % PAGE_SIZE == 0, "Length is not aligned: %I64i\n", Length); + ok(Length == PAGE_SIZE * 4, "Length is not MappedLength-sized: %I64i\n", Length); - ok_bool_false(TestWriteCalled, "Write has been unexpectedly called twice!\n"); - TestWriteCalled = TRUE; + Buffer = MapAndLockUserBuffer(Irp, Length); + ok(Buffer != NULL, "Null pointer!\n"); + + Mdl = Irp->MdlAddress; + ok(Mdl != NULL, "Null pointer for MDL!\n"); + ok((Mdl->MdlFlags & MDL_PAGES_LOCKED) != 0, "MDL not locked\n"); + ok((Mdl->MdlFlags & MDL_SOURCE_IS_NONPAGED_POOL) == 0, "MDL from non paged\n"); + ok((Irp->Flags & IRP_PAGING_IO) != 0, "Non paging IO\n"); + + ok_bool_false(TestWriteCalled, "Write has been unexpectedly called twice!\n"); + TestWriteCalled = TRUE; + } Status = STATUS_SUCCESS; Irp->IoStatus.Information = Length;
4 years
1
0
0
0
[reactos] 01/01: [NTOS:IO] Do not pass bogus file offset to the FS in NtReadFile & NtWriteFile
by Jérôme Gardou
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=a6c0af2e218cba4dc6f1a…
commit a6c0af2e218cba4dc6f1a9b2254f9a37a997ff6a Author: Jérôme Gardou <jerome.gardou(a)reactos.org> AuthorDate: Fri Dec 18 17:21:01 2020 +0100 Commit: Jérôme Gardou <jerome.gardou(a)reactos.org> CommitDate: Tue Dec 22 11:02:33 2020 +0100 [NTOS:IO] Do not pass bogus file offset to the FS in NtReadFile & NtWriteFile --- ntoskrnl/io/iomgr/iofunc.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/ntoskrnl/io/iomgr/iofunc.c b/ntoskrnl/io/iomgr/iofunc.c index 627ff9644b3..62c7799e47a 100644 --- a/ntoskrnl/io/iomgr/iofunc.c +++ b/ntoskrnl/io/iomgr/iofunc.c @@ -2776,6 +2776,14 @@ NtReadFile(IN HANDLE FileHandle, if (Key) CapturedKey = *Key; } + /* Check for invalid offset */ + if ((CapturedByteOffset.QuadPart < 0) && (CapturedByteOffset.QuadPart != -2)) + { + /* -2 is FILE_USE_FILE_POINTER_POSITION */ + ObDereferenceObject(FileObject); + return STATUS_INVALID_PARAMETER; + } + /* Check for event */ if (Event) { @@ -3827,6 +3835,15 @@ NtWriteFile(IN HANDLE FileHandle, if (Key) CapturedKey = *Key; } + /* Check for invalid offset */ + if (CapturedByteOffset.QuadPart < -2) + { + /* -1 is FILE_WRITE_TO_END_OF_FILE */ + /* -2 is FILE_USE_FILE_POINTER_POSITION */ + ObDereferenceObject(FileObject); + return STATUS_INVALID_PARAMETER; + } + /* Check if this is an append operation */ if ((ObjectHandleInfo.GrantedAccess & (FILE_APPEND_DATA | FILE_WRITE_DATA)) == FILE_APPEND_DATA)
4 years
1
0
0
0
[reactos] 01/01: [WINLOGON] Add hidden logon/logoff SFC notification
by Eric Kohl
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=94f01f5b6418204c78685…
commit 94f01f5b6418204c786859267cbe9b28b0ee2b13 Author: Eric Kohl <eric.kohl(a)reactos.org> AuthorDate: Mon Dec 21 20:42:40 2020 +0100 Commit: Eric Kohl <eric.kohl(a)reactos.org> CommitDate: Mon Dec 21 20:42:40 2020 +0100 [WINLOGON] Add hidden logon/logoff SFC notification --- base/system/winlogon/notify.c | 110 +++++++++++++++++++++++++++++++++++------- 1 file changed, 93 insertions(+), 17 deletions(-) diff --git a/base/system/winlogon/notify.c b/base/system/winlogon/notify.c index c0b78dc7b9b..d84e06af47f 100644 --- a/base/system/winlogon/notify.c +++ b/base/system/winlogon/notify.c @@ -43,6 +43,7 @@ typedef struct _NOTIFICATION_ITEM BOOL bImpersonate; BOOL bSmartCardLogon; DWORD dwMaxWait; + BOOL bSfcNotification; } NOTIFICATION_ITEM, *PNOTIFICATION_ITEM; @@ -51,6 +52,58 @@ static LIST_ENTRY NotificationDllListHead; /* FUNCTIONS *****************************************************************/ +static +VOID +AddSfcNotification(VOID) +{ + WCHAR szSfcFileName[MAX_PATH]; + PNOTIFICATION_ITEM NotificationDll; + DWORD dwError = ERROR_SUCCESS; + + ExpandEnvironmentStringsW(L"%windir%\\system32\\sfc.dll", + szSfcFileName, + ARRAYSIZE(szSfcFileName)); + + NotificationDll = RtlAllocateHeap(RtlGetProcessHeap(), + HEAP_ZERO_MEMORY, + sizeof(NOTIFICATION_ITEM)); + if (NotificationDll == NULL) + { + dwError = ERROR_OUTOFMEMORY; + goto done; + } + + NotificationDll->pszDllName = RtlAllocateHeap(RtlGetProcessHeap(), + HEAP_ZERO_MEMORY, + (wcslen(szSfcFileName) + 1) * sizeof(WCHAR)); + if (NotificationDll->pszDllName == NULL) + { + dwError = ERROR_OUTOFMEMORY; + goto done; + } + + wcscpy(NotificationDll->pszDllName, szSfcFileName); + + NotificationDll->bEnabled = TRUE; + NotificationDll->dwMaxWait = 30; /* FIXME: ??? */ + NotificationDll->bSfcNotification = TRUE; + + InsertHeadList(&NotificationDllListHead, + &NotificationDll->ListEntry); + +done: + if (dwError != ERROR_SUCCESS) + { + if (NotificationDll != NULL) + { + if (NotificationDll->pszDllName != NULL) + RtlFreeHeap(RtlGetProcessHeap(), 0, NotificationDll->pszDllName); + + RtlFreeHeap(RtlGetProcessHeap(), 0, NotificationDll); + } + } +} + static VOID AddNotificationDll( @@ -209,6 +262,8 @@ InitNotifications(VOID) InitializeListHead(&NotificationDllListHead); + AddSfcNotification(); + lError = RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"Software\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\\Notify", 0, @@ -262,27 +317,47 @@ CallNotificationDll( CHAR szFuncBuffer[128]; DWORD dwSize; DWORD dwType; - DWORD dwError; + DWORD dwError = ERROR_SUCCESS; PWLX_NOTIFY_HANDLER pNotifyHandler; - dwError = RegOpenKeyExW(hNotifyKey, - NotificationDll->pszKeyName, - 0, - KEY_READ, - &hDllKey); - if (dwError != ERROR_SUCCESS) + if (NotificationDll->bSfcNotification) { - TRACE("RegOpenKeyExW()\n"); - return; + switch (Type) + { + case LogonHandler: + strcpy(szFuncBuffer, "SfcWLEventLogon"); + break; + + case LogoffHandler: + strcpy(szFuncBuffer, "SfcWLEventLogoff"); + break; + + default: + return; + } + } + else + { + dwError = RegOpenKeyExW(hNotifyKey, + NotificationDll->pszKeyName, + 0, + KEY_READ, + &hDllKey); + if (dwError != ERROR_SUCCESS) + { + TRACE("RegOpenKeyExW()\n"); + return; + } + + dwSize = sizeof(szFuncBuffer); + dwError = RegQueryValueExA(hDllKey, + FuncNames[Type], + NULL, + &dwType, + (PBYTE)szFuncBuffer, + &dwSize); } - dwSize = sizeof(szFuncBuffer); - dwError = RegQueryValueExA(hDllKey, - FuncNames[Type], - NULL, - &dwType, - (PBYTE)szFuncBuffer, - &dwSize); if (dwError == ERROR_SUCCESS) { hModule = LoadLibraryW(NotificationDll->pszDllName); @@ -296,7 +371,8 @@ CallNotificationDll( } } - RegCloseKey(hDllKey); + if (hDllKey != NULL) + RegCloseKey(hDllKey); }
4 years
1
0
0
0
[reactos] 01/01: [REGEDIT] Display search finished messagebox when using Find Next (F3) menu item (#3371)
by Oleg Dubinskiy
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=9de87871877451e6fe30a…
commit 9de87871877451e6fe30a8c2e98015c9ead7b55a Author: Oleg Dubinskiy <oleg.dubinskij2013(a)yandex.ua> AuthorDate: Sat Nov 14 22:09:59 2020 +0200 Commit: Stanislav Motylkov <x86corez(a)gmail.com> CommitDate: Mon Dec 21 20:48:52 2020 +0300 [REGEDIT] Display search finished messagebox when using Find Next (F3) menu item (#3371) This repeats behaviour of Windows Regedit. CORE-17368 --- base/applications/regedit/find.c | 21 +++++++++++++-------- base/applications/regedit/framewnd.c | 2 +- base/applications/regedit/main.h | 1 + 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/base/applications/regedit/find.c b/base/applications/regedit/find.c index f095712bc6c..1fb5bbe45a0 100644 --- a/base/applications/regedit/find.c +++ b/base/applications/regedit/find.c @@ -810,18 +810,23 @@ static INT_PTR CALLBACK FindDialogProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPAR return iResult; } +void FindNextMessageBox(HWND hWnd) +{ + if (!FindNext(hWnd)) + { + WCHAR msg[128], caption[128]; + + LoadStringW(hInst, IDS_FINISHEDFIND, msg, COUNT_OF(msg)); + LoadStringW(hInst, IDS_APP_TITLE, caption, COUNT_OF(caption)); + MessageBoxW(hWnd, msg, caption, MB_ICONINFORMATION); + } +} + void FindDialog(HWND hWnd) { if (DialogBoxParamW(GetModuleHandle(NULL), MAKEINTRESOURCEW(IDD_FIND), hWnd, FindDialogProc, 0) != 0) { - if (!FindNext(hWnd)) - { - WCHAR msg[128], caption[128]; - - LoadStringW(hInst, IDS_FINISHEDFIND, msg, COUNT_OF(msg)); - LoadStringW(hInst, IDS_APP_TITLE, caption, COUNT_OF(caption)); - MessageBoxW(hWnd, msg, caption, MB_ICONINFORMATION); - } + FindNextMessageBox(hWnd); } } diff --git a/base/applications/regedit/framewnd.c b/base/applications/regedit/framewnd.c index 9fa92ec30e2..b9717cb4958 100644 --- a/base/applications/regedit/framewnd.c +++ b/base/applications/regedit/framewnd.c @@ -1230,7 +1230,7 @@ static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) FindDialog(hWnd); break; case ID_EDIT_FINDNEXT: - FindNext(hWnd); + FindNextMessageBox(hWnd); break; case ID_EDIT_COPYKEYNAME: CopyKeyName(hWnd, hKeyRoot, keyPath); diff --git a/base/applications/regedit/main.h b/base/applications/regedit/main.h index 01b7541434a..c9de998e3ee 100644 --- a/base/applications/regedit/main.h +++ b/base/applications/regedit/main.h @@ -103,6 +103,7 @@ extern int InfoMessageBox(HWND hWnd, UINT uType, LPCWSTR lpTitle, LPCWSTR lpMess /* find.c */ extern void FindDialog(HWND hWnd); extern BOOL FindNext(HWND hWnd); +extern void FindNextMessageBox(HWND hWnd); /* framewnd.c */ extern LRESULT CALLBACK FrameWndProc(HWND, UINT, WPARAM, LPARAM);
4 years
1
0
0
0
[reactos] 02/02: [WIN32K:NTUSER] Fix gradient caption bars with low color depth (#3338)
by Dmitry Borisov
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=bc90cbbb88f1b845a230c…
commit bc90cbbb88f1b845a230cf5e5b331a8b5f8f0871 Author: Dmitry Borisov <di.sean(a)protonmail.com> AuthorDate: Sat Oct 31 01:06:30 2020 +0600 Commit: Stanislav Motylkov <x86corez(a)gmail.com> CommitDate: Sun Dec 20 23:12:30 2020 +0300 [WIN32K:NTUSER] Fix gradient caption bars with low color depth (#3338) This fixes a problem when the window title bar is dithered down to the 16- or 256-color palette. See also commit 0705f30. --- win32ss/user/ntuser/sysparams.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/win32ss/user/ntuser/sysparams.c b/win32ss/user/ntuser/sysparams.c index 3907b17aff7..32b62cc026f 100644 --- a/win32ss/user/ntuser/sysparams.c +++ b/win32ss/user/ntuser/sysparams.c @@ -1583,7 +1583,17 @@ SpiGetSet(UINT uiAction, UINT uiParam, PVOID pvParam, FLONG fl) return SpiSetUserPref(UPM_LISTBOXSMOOTHSCROLLING, pvParam, fl); case SPI_GETGRADIENTCAPTIONS: - return SpiGetUserPref(UPM_GRADIENTCAPTIONS, pvParam, fl); + { + if (NtGdiGetDeviceCaps(ScreenDeviceContext, BITSPIXEL) <= 8) + { + INT iValue = 0; + return SpiGetInt(pvParam, &iValue, fl); + } + else + { + return SpiGetUserPref(UPM_GRADIENTCAPTIONS, pvParam, fl); + } + } case SPI_SETGRADIENTCAPTIONS: return SpiSetUserPref(UPM_GRADIENTCAPTIONS, pvParam, fl);
4 years
1
0
0
0
[reactos] 01/02: [USER32_APITEST] Add a test for SPI_GETGRADIENTCAPTIONS (#3338)
by Dmitry Borisov
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=2e6c9ee1caf0309ca7752…
commit 2e6c9ee1caf0309ca77526607fab5faec4351fdd Author: Dmitry Borisov <di.sean(a)protonmail.com> AuthorDate: Sat Oct 31 22:10:42 2020 +0600 Commit: Stanislav Motylkov <x86corez(a)gmail.com> CommitDate: Sun Dec 20 23:12:20 2020 +0300 [USER32_APITEST] Add a test for SPI_GETGRADIENTCAPTIONS (#3338) --- .../apitests/user32/SystemParametersInfo.c | 98 ++++++++++++++++++++++ 1 file changed, 98 insertions(+) diff --git a/modules/rostests/apitests/user32/SystemParametersInfo.c b/modules/rostests/apitests/user32/SystemParametersInfo.c index 98729094744..dfa7380eb35 100644 --- a/modules/rostests/apitests/user32/SystemParametersInfo.c +++ b/modules/rostests/apitests/user32/SystemParametersInfo.c @@ -9,6 +9,9 @@ HWND hWnd1, hWnd2; +static BOOL g_bReadyForDisplayChange = FALSE; +static HANDLE g_hSemDisplayChange; + /* FIXME: test for HWND_TOP, etc...*/ static int get_iwnd(HWND hWnd) { @@ -37,6 +40,13 @@ LRESULT CALLBACK SysParamsTestProc(HWND hWnd, UINT message, WPARAM wParam, LPARA RECORD_MESSAGE(iwnd, message, SENT, get_iwnd(pwp->hwndInsertAfter), pwp->flags); break; } + case WM_DISPLAYCHANGE: + if (g_bReadyForDisplayChange) + { + g_bReadyForDisplayChange = FALSE; + ReleaseSemaphore(g_hSemDisplayChange, 1, 0); + } + break; default: RECORD_MESSAGE(iwnd, message, SENT, 0,0); } @@ -171,6 +181,93 @@ static void Test_MouseSpeed() ok(ret, "SystemParametersInfo failed\n"); } +static void Test_GradientCaptions(void) +{ + BOOL ret; + LONG lResult; + DWORD dwResult; + BOOL bGradientCaptions, bModeFound; + DEVMODEW OldDevMode, NewDevMode; + INT iMode; + + ret = SystemParametersInfo(SPI_GETGRADIENTCAPTIONS, 0, &bGradientCaptions, 0); + ok(ret, "SystemParametersInfo failed\n"); + if (bGradientCaptions == FALSE) + { + skip("GRADIENTCAPTIONS value has changed from its original state\n"); + return; + } + + /* Try to find a graphics mode with 16 or 256 colors */ + iMode = 0; + bModeFound = FALSE; + while (EnumDisplaySettingsW(NULL, iMode, &NewDevMode)) + { + if ((NewDevMode.dmBitsPerPel == 4) || + (NewDevMode.dmBitsPerPel == 8)) + { + bModeFound = TRUE; + break; + } + + ++iMode; + } + if (!bModeFound) + { + skip("4bpp/8bpp graphics mode is not supported\n"); + return; + } + + /* Save the current graphics mode */ + ret = EnumDisplaySettingsW(NULL, ENUM_CURRENT_SETTINGS, &OldDevMode); + ok(ret, "EnumDisplaySettingsW failed\n"); + + g_hSemDisplayChange = CreateSemaphoreW(NULL, 0, 1, NULL); + + /* Switch to the new graphics mode */ + g_bReadyForDisplayChange = TRUE; + lResult = ChangeDisplaySettingsExW(NULL, &NewDevMode, NULL, 0, NULL); + if (lResult == DISP_CHANGE_SUCCESSFUL) + { + dwResult = WaitForSingleObject(g_hSemDisplayChange, 10000); + ok(dwResult == WAIT_OBJECT_0, "Waiting for the WM_DISPLAYCHANGE message timed out\n"); + } + g_bReadyForDisplayChange = FALSE; + ok(lResult == DISP_CHANGE_SUCCESSFUL, "ChangeDisplaySettingsExW returned %ld\n", lResult); + + /* SPI_GETGRADIENTCAPTIONS will now always return FALSE */ + ret = SystemParametersInfo(SPI_GETGRADIENTCAPTIONS, 0, &bGradientCaptions, 0); + ok(ret, "SystemParametersInfo failed\n"); + ok(bGradientCaptions == FALSE, "SPI_GETGRADIENTCAPTIONS got unexpected value (%d instead of 0)\n", bGradientCaptions); + + /* Enable gradient captions */ + bGradientCaptions = TRUE; + SystemParametersInfo(SPI_SETGRADIENTCAPTIONS, 0, UlongToPtr(bGradientCaptions), 0); + + /* Still FALSE */ + ret = SystemParametersInfo(SPI_GETGRADIENTCAPTIONS, 0, &bGradientCaptions, 0); + ok(ret, "SystemParametersInfo failed\n"); + ok(bGradientCaptions == FALSE, "SPI_GETGRADIENTCAPTIONS got unexpected value (%d instead of 0)\n", bGradientCaptions); + + /* Restore the previous graphics mode */ + g_bReadyForDisplayChange = TRUE; + lResult = ChangeDisplaySettingsExW(NULL, &OldDevMode, NULL, 0, NULL); + if (lResult == DISP_CHANGE_SUCCESSFUL) + { + dwResult = WaitForSingleObject(g_hSemDisplayChange, 10000); + ok(dwResult == WAIT_OBJECT_0, "Waiting for the WM_DISPLAYCHANGE message timed out\n"); + } + g_bReadyForDisplayChange = FALSE; + ok(lResult == DISP_CHANGE_SUCCESSFUL, "ChangeDisplaySettingsExW returned %ld\n", lResult); + + /* The original value should be restored */ + ret = SystemParametersInfo(SPI_GETGRADIENTCAPTIONS, 0, &bGradientCaptions, 0); + ok(ret, "SystemParametersInfo failed\n"); + ok(bGradientCaptions == TRUE, "SPI_GETGRADIENTCAPTIONS got unexpected value (%d instead of 1)\n", bGradientCaptions); + + CloseHandle(g_hSemDisplayChange); +} + START_TEST(SystemParametersInfo) { RegisterSimpleClass(SysParamsTestProc, L"sysparamstest"); @@ -182,6 +279,7 @@ START_TEST(SystemParametersInfo) Test_NonClientMetrics(); Test_MouseSpeed(); + Test_GradientCaptions(); DestroyWindow(hWnd1); DestroyWindow(hWnd2);
4 years
1
0
0
0
[reactos] 01/01: [BROWSEUI][PSDK] Stubplement ShellTaskScheduler (#3326)
by Oleg Dubinskiy
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=d5132f5ce3b0431718e93…
commit d5132f5ce3b0431718e93b7ea27cab3ed2ff98f3 Author: Oleg Dubinskiy <oleg.dubinskij2013(a)yandex.ua> AuthorDate: Tue Oct 27 19:25:36 2020 +0200 Commit: Stanislav Motylkov <x86corez(a)gmail.com> CommitDate: Sun Dec 20 22:06:16 2020 +0300 [BROWSEUI][PSDK] Stubplement ShellTaskScheduler (#3326) Required by MS Picture and Fax Viewer (shimgvw.dll). Now it starts properly without replacing any other system files. CORE-17337 --- dll/win32/browseui/CMakeLists.txt | 2 ++ dll/win32/browseui/CShellTaskScheduler.cpp | 41 +++++++++++++++++++++++++++ dll/win32/browseui/CShellTaskScheduler.h | 36 +++++++++++++++++++++++ dll/win32/browseui/browseui.cpp | 1 + dll/win32/browseui/browseui.rc | 1 + dll/win32/browseui/precomp.h | 1 + dll/win32/browseui/res/shelltaskscheduler.rgs | 13 +++++++++ dll/win32/browseui/resource.h | 1 + sdk/include/psdk/shlguid.h | 1 + 9 files changed, 97 insertions(+) diff --git a/dll/win32/browseui/CMakeLists.txt b/dll/win32/browseui/CMakeLists.txt index eb7070d05ae..9d199f6c996 100644 --- a/dll/win32/browseui/CMakeLists.txt +++ b/dll/win32/browseui/CMakeLists.txt @@ -18,6 +18,8 @@ list(APPEND SOURCE browseui.cpp browseuiord.cpp CAutoComplete.cpp + CShellTaskScheduler.cpp + CShellTaskScheduler.h CTaskbarList.cpp CTaskbarList.h commonbrowser.cpp diff --git a/dll/win32/browseui/CShellTaskScheduler.cpp b/dll/win32/browseui/CShellTaskScheduler.cpp new file mode 100644 index 00000000000..ff1709c3383 --- /dev/null +++ b/dll/win32/browseui/CShellTaskScheduler.cpp @@ -0,0 +1,41 @@ +/* + * PROJECT: ReactOS browseui + * LICENSE: LGPL-2.1-or-later (
https://spdx.org/licenses/LGPL-2.1-or-later
) + * PURPOSE: IShellTaskScheduler implementation + * COPYRIGHT: Copyright 2020 Oleg Dubinskiy (oleg.dubinskij2013(a)yandex.ua) + */ + +#include "precomp.h" + +CShellTaskScheduler::CShellTaskScheduler() +{ +} + +CShellTaskScheduler::~CShellTaskScheduler() +{ +} + +// *** IShellTaskScheduler methods *** +STDMETHODIMP CShellTaskScheduler::AddTask(IRunnableTask *pTask, REFGUID rtoid, DWORD_PTR lParam, DWORD dwPriority) +{ + TRACE("(%p, %u, %d, %d)\n", this, pTask, rtoid, lParam, dwPriority); + return E_NOTIMPL; +} + +STDMETHODIMP CShellTaskScheduler::RemoveTasks(REFGUID rtoid, DWORD_PTR lParam, BOOL fWaitIfRunning) +{ + TRACE("(%u, %d, %d)\n", this, rtoid, lParam, fWaitIfRunning); + return E_NOTIMPL; +} + +UINT STDMETHODCALLTYPE CShellTaskScheduler::CountTasks(REFGUID rtoid) +{ + TRACE("(%u)\n", this, rtoid); + return E_NOTIMPL; +} + +STDMETHODIMP CShellTaskScheduler::Status(DWORD dwReleaseStatus, DWORD dwThreadTimeout) +{ + TRACE("(%d, %d)\n", this, dwReleaseStatus, dwThreadTimeout); + return E_NOTIMPL; +} diff --git a/dll/win32/browseui/CShellTaskScheduler.h b/dll/win32/browseui/CShellTaskScheduler.h new file mode 100644 index 00000000000..42001c18439 --- /dev/null +++ b/dll/win32/browseui/CShellTaskScheduler.h @@ -0,0 +1,36 @@ +/* + * PROJECT: ReactOS browseui + * LICENSE: LGPL-2.1-or-later (
https://spdx.org/licenses/LGPL-2.1-or-later
) + * PURPOSE: IShellTaskScheduler implementation + * COPYRIGHT: Copyright 2020 Oleg Dubinskiy (oleg.dubinskij2013(a)yandex.ua) + */ + +#pragma once + +class CShellTaskScheduler : + public CComCoClass<CShellTaskScheduler, &CLSID_ShellTaskScheduler>, + public CComObjectRootEx<CComMultiThreadModelNoCS>, + public IShellTaskScheduler +{ +private: +public: + CShellTaskScheduler(); + ~CShellTaskScheduler(); + + // *** IShellTaskScheduler methods *** + STDMETHODIMP AddTask(IRunnableTask *pTask, REFGUID rtoid, DWORD_PTR lParam, DWORD dwPriority); + STDMETHODIMP RemoveTasks(REFGUID rtoid, DWORD_PTR lParam, BOOL fWaitIfRunning); + virtual UINT STDMETHODCALLTYPE CountTasks(REFGUID rtoid); + STDMETHODIMP Status(DWORD dwReleaseStatus, DWORD dwThreadTimeout); + +public: + + DECLARE_REGISTRY_RESOURCEID(IDR_SHELLTASKSCHEDULER) + DECLARE_NOT_AGGREGATABLE(CShellTaskScheduler) + + DECLARE_PROTECT_FINAL_CONSTRUCT() + + BEGIN_COM_MAP(CShellTaskScheduler) + COM_INTERFACE_ENTRY_IID(IID_IShellTaskScheduler, IShellTaskScheduler) + END_COM_MAP() +}; diff --git a/dll/win32/browseui/browseui.cpp b/dll/win32/browseui/browseui.cpp index 7051e248456..de1f8bb95ad 100644 --- a/dll/win32/browseui/browseui.cpp +++ b/dll/win32/browseui/browseui.cpp @@ -150,6 +150,7 @@ OBJECT_ENTRY(CLSID_CCommonBrowser, CCommonBrowser) OBJECT_ENTRY(CLSID_GlobalFolderSettings, CGlobalFolderSettings) OBJECT_ENTRY(CLSID_InternetToolbar, CInternetToolbar) OBJECT_ENTRY(CLSID_CRegTreeOptions, CRegTreeOptions) +OBJECT_ENTRY(CLSID_ShellTaskScheduler, CShellTaskScheduler) OBJECT_ENTRY(CLSID_TaskbarList, CTaskbarList) OBJECT_ENTRY(CLSID_ExplorerBand, CExplorerBand) OBJECT_ENTRY(CLSID_FileSearchBand, CSearchBar) diff --git a/dll/win32/browseui/browseui.rc b/dll/win32/browseui/browseui.rc index 4ff07550482..774e346c0de 100644 --- a/dll/win32/browseui/browseui.rc +++ b/dll/win32/browseui/browseui.rc @@ -41,6 +41,7 @@ IDR_COMMONBROWSER REGISTRY "res/commonbrowser.rgs" IDR_GLOBALFOLDERSETTINGS REGISTRY "res/globalfoldersettings.rgs" IDR_INTERNETTOOLBAR REGISTRY "res/internettoolbar.rgs" IDR_REGTREEOPTIONS REGISTRY "res/regtreeoptions.rgs" +IDR_SHELLTASKSCHEDULER REGISTRY "res/shelltaskscheduler.rgs" IDR_EXPLORERBAND REGISTRY "res/explorerband.rgs" IDR_PROGRESSDIALOG REGISTRY "res/progressdialog.rgs" IDR_AUTOCOMPLETE REGISTRY "res/autocomplete.rgs" diff --git a/dll/win32/browseui/precomp.h b/dll/win32/browseui/precomp.h index 27ce5443f45..02c27054544 100644 --- a/dll/win32/browseui/precomp.h +++ b/dll/win32/browseui/precomp.h @@ -54,6 +54,7 @@ #include "commonbrowser.h" #include "globalfoldersettings.h" #include "regtreeoptions.h" +#include "CShellTaskScheduler.h" #include "CTaskbarList.h" #include "explorerband.h" #include "CProgressDialog.h" diff --git a/dll/win32/browseui/res/shelltaskscheduler.rgs b/dll/win32/browseui/res/shelltaskscheduler.rgs new file mode 100644 index 00000000000..7d0ea18072c --- /dev/null +++ b/dll/win32/browseui/res/shelltaskscheduler.rgs @@ -0,0 +1,13 @@ +HKCR +{ + NoRemove CLSID + { + ForceRemove {603D3800-BD81-11d0-A3A5-00C04FD706EC} = s 'Background Task Scheduler' + { + InprocServer32 = s '%MODULE%' + { + val ThreadingModel = s 'Apartment' + } + } + } +} diff --git a/dll/win32/browseui/resource.h b/dll/win32/browseui/resource.h index ecb6b0a603b..1890dc0676a 100644 --- a/dll/win32/browseui/resource.h +++ b/dll/win32/browseui/resource.h @@ -108,6 +108,7 @@ #define IDR_FILESEARCHBAND 146 #define IDR_FINDFOLDER 147 #define IDR_USERASSIST 148 +#define IDR_SHELLTASKSCHEDULER 149 #define IDS_SMALLICONS 12301 #define IDS_LARGEICONS 12302 diff --git a/sdk/include/psdk/shlguid.h b/sdk/include/psdk/shlguid.h index 92720114bf3..132f2963fdc 100644 --- a/sdk/include/psdk/shlguid.h +++ b/sdk/include/psdk/shlguid.h @@ -105,6 +105,7 @@ DEFINE_GUID(CLSID_ACLMRU, 0x6756a641, 0xde71, 0x11d0, 0x83, 0x1b, 0x00, DEFINE_GUID(CLSID_ACLCustomMRU, 0x6935db93, 0x21e8, 0x4ccc, 0xbe, 0xb9, 0x9f, 0xe3, 0xc7, 0x7a, 0x29, 0x7a); DEFINE_GUID(CLSID_UserAssist, 0xdd313e04, 0xfeff, 0x11d1, 0x8e, 0xcd, 0x00, 0x00, 0xf8, 0x7a, 0x47, 0x0c); +DEFINE_GUID(CLSID_ShellTaskScheduler, 0x603d3800, 0xbd81, 0x11d0, 0xa3, 0xa5, 0x00, 0xc0, 0x4f, 0xd7, 0x06, 0xec); #define SID_SInternetExplorer IID_IWebBrowserApp #define SID_SWebBrowserApp IID_IWebBrowserApp
4 years
1
0
0
0
[reactos] 01/01: [BROWSEUI][PSDK] Stubplement UserAssist
by Oleg Dubinskiy
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=1f5e0f3fa7967d759ad88…
commit 1f5e0f3fa7967d759ad885487a59cb21a847704e Author: Oleg Dubinskiy <oleg.dubinskij2013(a)yandex.ua> AuthorDate: Wed Oct 21 17:46:09 2020 +0300 Commit: Stanislav Motylkov <x86corez(a)gmail.com> CommitDate: Sun Dec 20 17:32:11 2020 +0300 [BROWSEUI][PSDK] Stubplement UserAssist Initial implementation of `CUserAssist` class, which contains `IUserAssist` interface. See
https://www.geoffchappell.com/studies/windows/ie/browseui/classes/userassis…
. Required by MS shell32.dll. CORE-17345 CORE-17393 --- dll/win32/browseui/CMakeLists.txt | 4 +++- dll/win32/browseui/CUserAssist.cpp | 42 +++++++++++++++++++++++++++++++++++ dll/win32/browseui/CUserAssist.h | 38 +++++++++++++++++++++++++++++++ dll/win32/browseui/browseui.cpp | 1 + dll/win32/browseui/browseui.rc | 1 + dll/win32/browseui/precomp.h | 1 + dll/win32/browseui/res/userassist.rgs | 13 +++++++++++ dll/win32/browseui/resource.h | 1 + sdk/include/psdk/shlguid.h | 2 ++ sdk/include/psdk/shobjidl.idl | 36 ++++++++++++++++++++++++++++++ 10 files changed, 138 insertions(+), 1 deletion(-) diff --git a/dll/win32/browseui/CMakeLists.txt b/dll/win32/browseui/CMakeLists.txt index 8cb68cf9efa..eb7070d05ae 100644 --- a/dll/win32/browseui/CMakeLists.txt +++ b/dll/win32/browseui/CMakeLists.txt @@ -31,7 +31,9 @@ list(APPEND SOURCE toolsband.cpp travellog.cpp utility.cpp - CProgressDialog.cpp) + CProgressDialog.cpp + CUserAssist.cpp + CUserAssist.h) list(APPEND PCH_SKIP_SOURCE dllinstall.c) diff --git a/dll/win32/browseui/CUserAssist.cpp b/dll/win32/browseui/CUserAssist.cpp new file mode 100644 index 00000000000..54e6db7077d --- /dev/null +++ b/dll/win32/browseui/CUserAssist.cpp @@ -0,0 +1,42 @@ +/* + * PROJECT: ReactOS browseui + * LICENSE: LGPL-2.1-or-later (
https://spdx.org/licenses/LGPL-2.1-or-later
) + * PURPOSE: IUserAssist implementation + * COPYRIGHT: Copyright 2020 Oleg Dubinskiy (oleg.dubinskij2013(a)yandex.ua) + */ +// See
http://www.geoffchappell.com/studies/windows/ie/browseui/interfaces/iuseras…
+ +#include "precomp.h" + +CUserAssist::CUserAssist() +{ +} + +CUserAssist::~CUserAssist() +{ +} + +// *** IUserAssist methods *** +STDMETHODIMP CUserAssist::FireEvent(GUID const *guid, INT param1, ULONG param2, WPARAM wparam, LPARAM lparam) +{ + TRACE("(%u, %d, %d, %p, %p)\n", this, guid, param1, param2, wparam, lparam); + return E_NOTIMPL; +} + +STDMETHODIMP CUserAssist::QueryEvent(GUID const *guid, INT param, WPARAM wparam, LPARAM lparam, PVOID ptr) +{ + TRACE("(%u, %d, %p, %p, %p)\n", this, guid, param, wparam, lparam, ptr); + return E_NOTIMPL; +} + +STDMETHODIMP CUserAssist::SetEvent(GUID const *guid, INT param, WPARAM wparam, LPARAM lparam, PVOID ptr) +{ + TRACE("(%u, %d, %p, %p, %p)\n", this, guid, param, wparam, lparam, ptr); + return E_NOTIMPL; +} + +STDMETHODIMP CUserAssist::Enable(BOOL bEnable) +{ + TRACE("(%d)\n", this, bEnable); + return E_NOTIMPL; +} diff --git a/dll/win32/browseui/CUserAssist.h b/dll/win32/browseui/CUserAssist.h new file mode 100644 index 00000000000..88bdf6985ae --- /dev/null +++ b/dll/win32/browseui/CUserAssist.h @@ -0,0 +1,38 @@ +/* + * PROJECT: ReactOS browseui + * LICENSE: LGPL-2.1-or-later (
https://spdx.org/licenses/LGPL-2.1-or-later
) + * PURPOSE: IUserAssist implementation + * COPYRIGHT: Copyright 2020 Oleg Dubinskiy (oleg.dubinskij2013(a)yandex.ua) + */ +// See
https://www.geoffchappell.com/studies/windows/ie/browseui/classes/userassis…
+ +#pragma once + +class CUserAssist : + public CComCoClass<CUserAssist, &CLSID_UserAssist>, + public CComObjectRootEx<CComMultiThreadModelNoCS>, + public IUserAssist +{ +private: +public: + CUserAssist(); + ~CUserAssist(); + + // *** IUserAssist methods *** + STDMETHODIMP FireEvent(GUID const *guid, INT param1, ULONG param2, WPARAM wparam, LPARAM lparam); + // FIXME: PVOID should point to undocumented UEMINFO structure. + STDMETHODIMP QueryEvent(GUID const *guid, INT param, WPARAM wparam, LPARAM lparam, PVOID ptr); + STDMETHODIMP SetEvent(GUID const *guid, INT param, WPARAM wparam, LPARAM lparam, PVOID ptr); + STDMETHODIMP Enable(BOOL bEnable); + +public: + + DECLARE_REGISTRY_RESOURCEID(IDR_USERASSIST) + DECLARE_NOT_AGGREGATABLE(CUserAssist) + + DECLARE_PROTECT_FINAL_CONSTRUCT() + + BEGIN_COM_MAP(CUserAssist) + COM_INTERFACE_ENTRY_IID(IID_IUserAssist, IUserAssist) + END_COM_MAP() +}; diff --git a/dll/win32/browseui/browseui.cpp b/dll/win32/browseui/browseui.cpp index 8ae993dfa65..7051e248456 100644 --- a/dll/win32/browseui/browseui.cpp +++ b/dll/win32/browseui/browseui.cpp @@ -156,6 +156,7 @@ OBJECT_ENTRY(CLSID_FileSearchBand, CSearchBar) OBJECT_ENTRY(CLSID_ProgressDialog, CProgressDialog) OBJECT_ENTRY(CLSID_ISFBand, CISFBand) OBJECT_ENTRY(CLSID_FindFolder, CFindFolder) +OBJECT_ENTRY(CLSID_UserAssist, CUserAssist) END_OBJECT_MAP() CBrowseUIModule gModule; diff --git a/dll/win32/browseui/browseui.rc b/dll/win32/browseui/browseui.rc index 0d43f1c17af..4ff07550482 100644 --- a/dll/win32/browseui/browseui.rc +++ b/dll/win32/browseui/browseui.rc @@ -50,6 +50,7 @@ IDR_ACLCUSTOMMRU REGISTRY "res/custommru.rgs" IDR_TASKBARLIST REGISTRY "res/taskbarlist.rgs" IDR_FILESEARCHBAND REGISTRY "res/filesearchband.rgs" IDR_FINDFOLDER REGISTRY "res/findfolder.rgs" +IDR_USERASSIST REGISTRY "res/userassist.rgs" #include <reactos/manifest_dll.rc> diff --git a/dll/win32/browseui/precomp.h b/dll/win32/browseui/precomp.h index f119847b6fa..27ce5443f45 100644 --- a/dll/win32/browseui/precomp.h +++ b/dll/win32/browseui/precomp.h @@ -57,6 +57,7 @@ #include "CTaskbarList.h" #include "explorerband.h" #include "CProgressDialog.h" +#include "CUserAssist.h" #include "browseui.h" #include <stdio.h> diff --git a/dll/win32/browseui/res/userassist.rgs b/dll/win32/browseui/res/userassist.rgs new file mode 100644 index 00000000000..eaede088787 --- /dev/null +++ b/dll/win32/browseui/res/userassist.rgs @@ -0,0 +1,13 @@ +HKCR +{ + NoRemove CLSID + { + ForceRemove {DD313E04-FEFF-11D1-8ECD-0000F87A470C} = s 'User assistance' + { + InprocServer32 = s '%MODULE%' + { + val ThreadingModel = s 'Both' + } + } + } +} diff --git a/dll/win32/browseui/resource.h b/dll/win32/browseui/resource.h index 84269b677db..ecb6b0a603b 100644 --- a/dll/win32/browseui/resource.h +++ b/dll/win32/browseui/resource.h @@ -107,6 +107,7 @@ #define IDR_TASKBARLIST 145 #define IDR_FILESEARCHBAND 146 #define IDR_FINDFOLDER 147 +#define IDR_USERASSIST 148 #define IDS_SMALLICONS 12301 #define IDS_LARGEICONS 12302 diff --git a/sdk/include/psdk/shlguid.h b/sdk/include/psdk/shlguid.h index 25937b08019..92720114bf3 100644 --- a/sdk/include/psdk/shlguid.h +++ b/sdk/include/psdk/shlguid.h @@ -104,6 +104,8 @@ DEFINE_GUID(CLSID_ACListISF, 0x03c036f1, 0xa186, 0x11d0, 0x82, 0x4a, 0x00, DEFINE_GUID(CLSID_ACLMRU, 0x6756a641, 0xde71, 0x11d0, 0x83, 0x1b, 0x00, 0xaa, 0x00, 0x5b, 0x43, 0x83); DEFINE_GUID(CLSID_ACLCustomMRU, 0x6935db93, 0x21e8, 0x4ccc, 0xbe, 0xb9, 0x9f, 0xe3, 0xc7, 0x7a, 0x29, 0x7a); +DEFINE_GUID(CLSID_UserAssist, 0xdd313e04, 0xfeff, 0x11d1, 0x8e, 0xcd, 0x00, 0x00, 0xf8, 0x7a, 0x47, 0x0c); + #define SID_SInternetExplorer IID_IWebBrowserApp #define SID_SWebBrowserApp IID_IWebBrowserApp #define SID_SWebBrowserEventsService IID_IWebBrowserEventsService diff --git a/sdk/include/psdk/shobjidl.idl b/sdk/include/psdk/shobjidl.idl index 4d5d278dca0..cbb9892655c 100644 --- a/sdk/include/psdk/shobjidl.idl +++ b/sdk/include/psdk/shobjidl.idl @@ -4768,4 +4768,40 @@ interface IItemNameLimits : IUnknown [out] int *piMaxNameLen); }; +/***************************************************************************** + * IUserAssist interface + */ +[ + uuid(dd313e05-feff-11d1-8ecd-0000f87a470c), + object, + local, + pointer_default(unique) +] +interface IUserAssist : IUnknown +{ + HRESULT FireEvent( + GUID const *guid, + INT param1, + ULONG param2, + WPARAM wparam, + LPARAM lparam); + + HRESULT QueryEvent( + GUID const *guid, + INT param, + WPARAM wparam, + LPARAM lparam, + PVOID ptr); + + HRESULT SetEvent( + GUID const *guid, + INT param, + WPARAM wparam, + LPARAM lparam, + PVOID ptr); + + HRESULT Enable( + BOOL bEnable); +}; + #endif // __REACTOS__
4 years
1
0
0
0
[reactos] 01/01: [INTL] Broadcast a WM_SETTINGCHANGED message when settings have been changed.
by Eric Kohl
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=bb209e9010ecddfe89150…
commit bb209e9010ecddfe89150261b937ea8c73c1c823 Author: Eric Kohl <eric.kohl(a)reactos.org> AuthorDate: Sun Dec 20 11:21:10 2020 +0100 Commit: Eric Kohl <eric.kohl(a)reactos.org> CommitDate: Sun Dec 20 11:21:10 2020 +0100 [INTL] Broadcast a WM_SETTINGCHANGED message when settings have been changed. --- dll/cpl/intl/intl.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dll/cpl/intl/intl.c b/dll/cpl/intl/intl.c index 1942be8d714..0b775a734d6 100644 --- a/dll/cpl/intl/intl.c +++ b/dll/cpl/intl/intl.c @@ -219,6 +219,8 @@ Applet(HWND hwnd, UINT uMsg, LPARAM wParam, LPARAM lParam) psh.nStartPage = nPage; ret = (LONG)(PropertySheet(&psh) != -1); + if (ret > 0) + SendMessageW(HWND_BROADCAST, WM_SETTINGCHANGE, 0, (LPARAM)L"intl"); HeapFree(GetProcessHeap(), 0, pGlobalData);
4 years
1
0
0
0
[reactos] 01/01: [INTL] Implement the selection of a property page by command line
by Eric Kohl
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=497fe0a884925bbbc9852…
commit 497fe0a884925bbbc9852d5537524e90d9da26b6 Author: Eric Kohl <eric.kohl(a)reactos.org> AuthorDate: Sun Dec 20 10:47:08 2020 +0100 Commit: Eric Kohl <eric.kohl(a)reactos.org> CommitDate: Sun Dec 20 10:47:08 2020 +0100 [INTL] Implement the selection of a property page by command line --- dll/cpl/intl/intl.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/dll/cpl/intl/intl.c b/dll/cpl/intl/intl.c index 13ec00906a8..1942be8d714 100644 --- a/dll/cpl/intl/intl.c +++ b/dll/cpl/intl/intl.c @@ -36,7 +36,6 @@ Applet(HWND hwnd, UINT uMsg, LPARAM wParam, LPARAM lParam); HINSTANCE hApplet = 0; -HWND hCPLWindow; HINF hSetupInf = INVALID_HANDLE_VALUE; DWORD IsUnattendedSetupEnabled = 0; DWORD UnattendLCID = 0; @@ -173,6 +172,7 @@ Applet(HWND hwnd, UINT uMsg, LPARAM wParam, LPARAM lParam) PROPSHEETPAGE psp[3]; PROPSHEETHEADER psh; PGLOBALDATA pGlobalData; + INT nPage = 0; LONG ret; if (OpenSetupInf()) @@ -180,6 +180,9 @@ Applet(HWND hwnd, UINT uMsg, LPARAM wParam, LPARAM lParam) ParseSetupInf(); } + if (uMsg == CPL_STARTWPARMSW && lParam != 0) + nPage = _wtoi((PWSTR)lParam); + pGlobalData = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(GLOBALDATA)); if (pGlobalData == NULL) return FALSE; @@ -192,11 +195,11 @@ Applet(HWND hwnd, UINT uMsg, LPARAM wParam, LPARAM lParam) ZeroMemory(&psh, sizeof(PROPSHEETHEADER)); psh.dwSize = sizeof(PROPSHEETHEADER); psh.dwFlags = PSH_PROPSHEETPAGE | PSH_USEICONID | PSH_USECALLBACK; - psh.hwndParent = hCPLWindow; + psh.hwndParent = hwnd; psh.hInstance = hApplet; psh.pszIcon = MAKEINTRESOURCEW(IDC_CPLICON); psh.pszCaption = Caption; - psh.nPages = 0; //sizeof(psp) / sizeof(PROPSHEETPAGE); + psh.nPages = 0; psh.nStartPage = 0; psh.ppsp = psp; psh.pfnCallback = PropSheetProc; @@ -212,6 +215,9 @@ Applet(HWND hwnd, UINT uMsg, LPARAM wParam, LPARAM lParam) psh.nPages++; } + if (nPage != 0 && nPage <= psh.nPages) + psh.nStartPage = nPage; + ret = (LONG)(PropertySheet(&psh) != -1); HeapFree(GetProcessHeap(), 0, pGlobalData); @@ -227,7 +233,7 @@ CPlApplet(HWND hwndCpl, LPARAM lParam1, LPARAM lParam2) { - switch(uMsg) + switch (uMsg) { case CPL_INIT: return TRUE; @@ -248,12 +254,11 @@ CPlApplet(HWND hwndCpl, } case CPL_DBLCLK: - { - UINT uAppIndex = (UINT)lParam1; - hCPLWindow = hwndCpl; - Applets[uAppIndex].AppletProc(hwndCpl, uMsg, lParam1, lParam2); + Applets[(UINT)lParam1].AppletProc(hwndCpl, uMsg, lParam1, lParam2); break; - } + + case CPL_STARTWPARMSW: + return Applets[(UINT)lParam1].AppletProc(hwndCpl, uMsg, lParam1, lParam2); } return FALSE;
4 years
1
0
0
0
← Newer
1
2
3
4
5
6
7
8
9
...
14
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Results per page:
10
25
50
100
200