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
December 2022
----- 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
19 participants
98 discussions
Start a n
N
ew thread
[reactos] 02/08: [KMTEST] Add a NULL check
by Timo Kreuzer
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=52fe43e87b1f5f5423b34…
commit 52fe43e87b1f5f5423b34fd96d524a1d85142867 Author: Timo Kreuzer <timo.kreuzer(a)reactos.org> AuthorDate: Mon Nov 28 09:56:03 2022 +0200 Commit: Timo Kreuzer <timo.kreuzer(a)reactos.org> CommitDate: Tue Dec 13 07:18:24 2022 +0100 [KMTEST] Add a NULL check --- modules/rostests/kmtests/ntos_cc/CcSetFileSizes_drv.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/rostests/kmtests/ntos_cc/CcSetFileSizes_drv.c b/modules/rostests/kmtests/ntos_cc/CcSetFileSizes_drv.c index 89bc3973cfb..0270ff1d5e2 100644 --- a/modules/rostests/kmtests/ntos_cc/CcSetFileSizes_drv.c +++ b/modules/rostests/kmtests/ntos_cc/CcSetFileSizes_drv.c @@ -459,6 +459,11 @@ TestIrpHandler( ok(Irp->AssociatedIrp.SystemBuffer == NULL, "A SystemBuffer was allocated!\n"); OrigBuffer = Buffer = MapAndLockUserBuffer(Irp, Length); ok(Buffer != NULL, "Null pointer!\n"); + if (Buffer == NULL) + { + Status = STATUS_UNSUCCESSFUL; + goto Exit; + } if (Offset.QuadPart < Fcb->Header.FileSize.QuadPart) { @@ -545,6 +550,7 @@ TestIrpHandler( IoCompleteRequest(Irp, IO_NO_INCREMENT); } +Exit: FsRtlExitFileSystem(); return Status;
2 years
1
0
0
0
[reactos] 01/08: [KMTEST] Handle failure in KmtLoadDriver and KmtOpenDriver
by Timo Kreuzer
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=9e12af569f0ec8a419e98…
commit 9e12af569f0ec8a419e9815d84bfdb828e9b2c2e Author: Timo Kreuzer <timo.kreuzer(a)reactos.org> AuthorDate: Mon Aug 8 10:50:28 2022 +0300 Commit: Timo Kreuzer <timo.kreuzer(a)reactos.org> CommitDate: Tue Dec 13 07:18:24 2022 +0100 [KMTEST] Handle failure in KmtLoadDriver and KmtOpenDriver --- modules/rostests/kmtests/example/Example_user.c | 8 +++-- modules/rostests/kmtests/hidparse/HidP_user.c | 8 +++-- modules/rostests/kmtests/include/kmt_test.h | 5 +-- .../kmtests/kernel32/FileAttributes_user.c | 7 ++-- modules/rostests/kmtests/kernel32/FindFile_user.c | 7 ++-- modules/rostests/kmtests/kmtest/support.c | 42 +++++++++++++--------- modules/rostests/kmtests/ntos_cc/CcCopyRead_user.c | 7 ++-- .../rostests/kmtests/ntos_cc/CcCopyWrite_user.c | 7 ++-- modules/rostests/kmtests/ntos_cc/CcMapData_user.c | 6 ++-- .../kmtests/ntos_cc/CcPinMappedData_user.c | 6 ++-- modules/rostests/kmtests/ntos_cc/CcPinRead_user.c | 6 ++-- .../rostests/kmtests/ntos_cc/CcSetFileSizes_user.c | 6 ++-- .../rostests/kmtests/ntos_io/IoCreateFile_user.c | 6 ++-- .../rostests/kmtests/ntos_io/IoDeviceObject_user.c | 14 ++++++-- .../rostests/kmtests/ntos_io/IoReadWrite_user.c | 7 ++-- .../ntos_mm/MmMapLockedPagesSpecifyCache_user.c | 7 ++-- .../kmtests/ntos_mm/NtCreateSection_user.c | 7 ++-- modules/rostests/kmtests/ntos_po/PoIrp_user.c | 9 +++-- modules/rostests/kmtests/tcpip/TcpIp_user.c | 17 ++++++--- 19 files changed, 125 insertions(+), 57 deletions(-) diff --git a/modules/rostests/kmtests/example/Example_user.c b/modules/rostests/kmtests/example/Example_user.c index bd440e01264..720a2d02d1a 100644 --- a/modules/rostests/kmtests/example/Example_user.c +++ b/modules/rostests/kmtests/example/Example_user.c @@ -15,6 +15,7 @@ START_TEST(Example) SYSTEM_INFO SystemInfo; MY_STRUCT MyStruct[2] = { { 123, ":D" }, { 0 } }; DWORD Length = sizeof MyStruct; + DWORD Error; trace("Message from user-mode\n"); @@ -26,9 +27,10 @@ START_TEST(Example) KmtRunKernelTest("Example"); /* now start the special-purpose driver */ - KmtLoadDriver(L"Example", FALSE); - trace("After Entry\n"); - KmtOpenDriver(); + Error = KmtLoadAndOpenDriver(L"Example", FALSE); + ok_eq_int(Error, ERROR_SUCCESS); + if (Error) + return; trace("After Create\n"); ok(KmtSendToDriver(IOCTL_NOTIFY) == ERROR_SUCCESS, "\n"); diff --git a/modules/rostests/kmtests/hidparse/HidP_user.c b/modules/rostests/kmtests/hidparse/HidP_user.c index d1f5a4e00dd..153ef22db57 100644 --- a/modules/rostests/kmtests/hidparse/HidP_user.c +++ b/modules/rostests/kmtests/hidparse/HidP_user.c @@ -22,12 +22,14 @@ START_TEST(HidPDescription) KmtStartService(L"hidusb", &ServiceHandle); CloseServiceHandle(ServiceHandle); - KmtLoadDriver(L"HidP", FALSE); - KmtOpenDriver(); + Error = KmtLoadAndOpenDriver(L"HidP", FALSE); + ok_eq_int(Error, ERROR_SUCCESS); + if (Error) + return; Error = KmtSendToDriver(IOCTL_TEST_DESCRIPTION); ok(Error == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %lx\n", Error); KmtCloseDriver(); KmtUnloadDriver(); -} \ No newline at end of file +} diff --git a/modules/rostests/kmtests/include/kmt_test.h b/modules/rostests/kmtests/include/kmt_test.h index 509788a2e27..c046ab05874 100644 --- a/modules/rostests/kmtests/include/kmt_test.h +++ b/modules/rostests/kmtests/include/kmt_test.h @@ -169,10 +169,11 @@ VOID KmtFinishThread(IN PKTHREAD Thread OPTIONAL, IN PKEVENT Event OPTIONAL); #elif defined KMT_USER_MODE DWORD KmtRunKernelTest(IN PCSTR TestName); -VOID KmtLoadDriver(IN PCWSTR ServiceName, IN BOOLEAN RestartIfRunning); +DWORD KmtLoadDriver(IN PCWSTR ServiceName, IN BOOLEAN RestartIfRunning); VOID KmtUnloadDriver(VOID); -VOID KmtOpenDriver(VOID); +DWORD KmtOpenDriver(VOID); VOID KmtCloseDriver(VOID); +DWORD KmtLoadAndOpenDriver(IN PCWSTR ServiceName, IN BOOLEAN RestartIfRunning); DWORD KmtSendToDriver(IN DWORD ControlCode); DWORD KmtSendStringToDriver(IN DWORD ControlCode, IN PCSTR String); diff --git a/modules/rostests/kmtests/kernel32/FileAttributes_user.c b/modules/rostests/kmtests/kernel32/FileAttributes_user.c index 88d85a81da8..0815cdfbd2a 100644 --- a/modules/rostests/kmtests/kernel32/FileAttributes_user.c +++ b/modules/rostests/kmtests/kernel32/FileAttributes_user.c @@ -15,9 +15,12 @@ START_TEST(FileAttributes) PCWSTR FileName = L"\\\\.\\Global\\GLOBALROOT\\Device\\Kmtest-kernel32\\Somefile"; BOOL Ret; DWORD Attributes; + DWORD Error; - KmtLoadDriver(L"kernel32", FALSE); - KmtOpenDriver(); + Error = KmtLoadAndOpenDriver(L"kernel32", FALSE); + ok_eq_int(Error, ERROR_SUCCESS); + if (Error) + return; /* Set read-only attribute */ KmtSendUlongToDriver(IOCTL_EXPECT_SET_ATTRIBUTES, FILE_ATTRIBUTE_READONLY | FILE_ATTRIBUTE_NORMAL); diff --git a/modules/rostests/kmtests/kernel32/FindFile_user.c b/modules/rostests/kmtests/kernel32/FindFile_user.c index 34bd99a92f1..4d4425191f3 100644 --- a/modules/rostests/kmtests/kernel32/FindFile_user.c +++ b/modules/rostests/kmtests/kernel32/FindFile_user.c @@ -97,9 +97,12 @@ START_TEST(FindFile) const INT TestCount = sizeof(Tests) / sizeof(Tests[0]); INT i; WCHAR ExpressionBuffer[MAX_PATH]; + DWORD Error; - KmtLoadDriver(L"kernel32", FALSE); - KmtOpenDriver(); + Error = KmtLoadAndOpenDriver(L"kernel32", FALSE); + ok_eq_int(Error, ERROR_SUCCESS); + if (Error) + return; for (i = 0; i < TestCount; i++) { diff --git a/modules/rostests/kmtests/kmtest/support.c b/modules/rostests/kmtests/kmtest/support.c index 0f0ad64ce45..4cfa4bae9b8 100644 --- a/modules/rostests/kmtests/kmtest/support.c +++ b/modules/rostests/kmtests/kmtest/support.c @@ -124,12 +124,11 @@ static HANDLE TestDeviceHandle; * @param RestartIfRunning * TRUE to stop and restart the service if it is already running */ -VOID +DWORD KmtLoadDriver( IN PCWSTR ServiceName, IN BOOLEAN RestartIfRunning) { - DWORD Error = ERROR_SUCCESS; WCHAR ServicePath[MAX_PATH]; StringCbCopyW(ServicePath, sizeof(ServicePath), ServiceName); @@ -138,13 +137,7 @@ KmtLoadDriver( StringCbCopyW(TestServiceName, sizeof(TestServiceName), L"Kmtest-"); StringCbCatW(TestServiceName, sizeof(TestServiceName), ServiceName); - Error = KmtCreateAndStartService(TestServiceName, ServicePath, NULL, &TestServiceHandle, RestartIfRunning); - - if (Error) - { - // TODO - __debugbreak(); - } + return KmtCreateAndStartService(TestServiceName, ServicePath, NULL, &TestServiceHandle, RestartIfRunning); } /** @@ -177,7 +170,7 @@ KmtUnloadDriver(VOID) * * Open special-purpose driver (acquire a device handle) */ -VOID +DWORD KmtOpenDriver(VOID) { DWORD Error = ERROR_SUCCESS; @@ -190,12 +183,30 @@ KmtOpenDriver(VOID) if (TestDeviceHandle == INVALID_HANDLE_VALUE) error(Error); + return Error; +} + +/** + * @name KmtOpenDriver + * + * Load and open special-purpose driver (acquire a device handle) + */ +DWORD +KmtLoadAndOpenDriver( + IN PCWSTR ServiceName, + IN BOOLEAN RestartIfRunning) +{ + DWORD Error; + + Error = KmtLoadDriver(ServiceName, RestartIfRunning); if (Error) - { - // TODO - __debugbreak(); - } + return Error; + Error = KmtOpenDriver(); + if (Error) + return Error; + + return ERROR_SUCCESS; } /** @@ -213,8 +224,7 @@ KmtCloseDriver(VOID) if (Error) { - // TODO - __debugbreak(); + DPRINT1("CloseHandle failed: 0x%lx\n", Error); } } diff --git a/modules/rostests/kmtests/ntos_cc/CcCopyRead_user.c b/modules/rostests/kmtests/ntos_cc/CcCopyRead_user.c index cfaad14634c..4b8d6034199 100644 --- a/modules/rostests/kmtests/ntos_cc/CcCopyRead_user.c +++ b/modules/rostests/kmtests/ntos_cc/CcCopyRead_user.c @@ -20,9 +20,12 @@ START_TEST(CcCopyRead) UNICODE_STRING ReallySmallAlignmentTest = RTL_CONSTANT_STRING(L"\\Device\\Kmtest-CcCopyRead\\ReallySmallAlignmentTest"); UNICODE_STRING FileBig = RTL_CONSTANT_STRING(L"\\Device\\Kmtest-CcCopyRead\\FileBig"); UNICODE_STRING BehaviourTestFile = RTL_CONSTANT_STRING(L"\\Device\\Kmtest-CcCopyRead\\BehaviourTestFile"); + DWORD Error; - KmtLoadDriver(L"CcCopyRead", FALSE); - KmtOpenDriver(); + Error = KmtLoadAndOpenDriver(L"CcCopyRead", FALSE); + ok_eq_int(Error, ERROR_SUCCESS); + if (Error) + return; InitializeObjectAttributes(&ObjectAttributes, &SmallAlignmentTest, OBJ_CASE_INSENSITIVE, NULL, NULL); Status = NtOpenFile(&Handle, FILE_ALL_ACCESS, &ObjectAttributes, &IoStatusBlock, 0, FILE_NON_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT); diff --git a/modules/rostests/kmtests/ntos_cc/CcCopyWrite_user.c b/modules/rostests/kmtests/ntos_cc/CcCopyWrite_user.c index 3626cc16d0f..11c41fc1533 100644 --- a/modules/rostests/kmtests/ntos_cc/CcCopyWrite_user.c +++ b/modules/rostests/kmtests/ntos_cc/CcCopyWrite_user.c @@ -20,9 +20,12 @@ START_TEST(CcCopyWrite) UNICODE_STRING VerySmallFile = RTL_CONSTANT_STRING(L"\\Device\\Kmtest-CcCopyWrite\\VerySmallFile"); UNICODE_STRING NormalFile = RTL_CONSTANT_STRING(L"\\Device\\Kmtest-CcCopyWrite\\NormalFile"); UNICODE_STRING BehaviourTestFile = RTL_CONSTANT_STRING(L"\\Device\\Kmtest-CcCopyWrite\\BehaviourTestFile"); + DWORD Error; - KmtLoadDriver(L"CcCopyWrite", FALSE); - KmtOpenDriver(); + Error = KmtLoadAndOpenDriver(L"CcCopyWrite", FALSE); + ok_eq_int(Error, ERROR_SUCCESS); + if (Error) + return; InitializeObjectAttributes(&ObjectAttributes, &VerySmallFile, OBJ_CASE_INSENSITIVE, NULL, NULL); Status = NtOpenFile(&Handle, FILE_ALL_ACCESS, &ObjectAttributes, &IoStatusBlock, 0, FILE_NON_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT); diff --git a/modules/rostests/kmtests/ntos_cc/CcMapData_user.c b/modules/rostests/kmtests/ntos_cc/CcMapData_user.c index dee2a93d5ee..1964c4a9801 100644 --- a/modules/rostests/kmtests/ntos_cc/CcMapData_user.c +++ b/modules/rostests/kmtests/ntos_cc/CcMapData_user.c @@ -15,8 +15,10 @@ START_TEST(CcMapData) DWORD Ret; ULONG TestId; - KmtLoadDriver(L"CcMapData", FALSE); - KmtOpenDriver(); + Ret = KmtLoadAndOpenDriver(L"CcMapData", FALSE); + ok_eq_int(Ret, ERROR_SUCCESS); + if (Ret) + return; /* 3 tests for offset * 1 test for BCB diff --git a/modules/rostests/kmtests/ntos_cc/CcPinMappedData_user.c b/modules/rostests/kmtests/ntos_cc/CcPinMappedData_user.c index e0fdcfda150..7c7eaa9901e 100644 --- a/modules/rostests/kmtests/ntos_cc/CcPinMappedData_user.c +++ b/modules/rostests/kmtests/ntos_cc/CcPinMappedData_user.c @@ -15,8 +15,10 @@ START_TEST(CcPinMappedData) DWORD Ret; ULONG TestId; - KmtLoadDriver(L"CcPinMappedData", FALSE); - KmtOpenDriver(); + Ret = KmtLoadAndOpenDriver(L"CcPinMappedData", FALSE); + ok_eq_int(Ret, ERROR_SUCCESS); + if (Ret) + return; /* 1 basic test */ for (TestId = 0; TestId < 5; ++TestId) diff --git a/modules/rostests/kmtests/ntos_cc/CcPinRead_user.c b/modules/rostests/kmtests/ntos_cc/CcPinRead_user.c index c0878435fe7..9ba93796ca0 100644 --- a/modules/rostests/kmtests/ntos_cc/CcPinRead_user.c +++ b/modules/rostests/kmtests/ntos_cc/CcPinRead_user.c @@ -15,8 +15,10 @@ START_TEST(CcPinRead) DWORD Ret; ULONG TestId; - KmtLoadDriver(L"CcPinRead", FALSE); - KmtOpenDriver(); + Ret = KmtLoadAndOpenDriver(L"CcPinRead", FALSE); + ok_eq_int(Ret, ERROR_SUCCESS); + if (Ret) + return; /* 3 tests for offset * 1 test for BCB diff --git a/modules/rostests/kmtests/ntos_cc/CcSetFileSizes_user.c b/modules/rostests/kmtests/ntos_cc/CcSetFileSizes_user.c index 67bcc1df89e..51577c6f694 100644 --- a/modules/rostests/kmtests/ntos_cc/CcSetFileSizes_user.c +++ b/modules/rostests/kmtests/ntos_cc/CcSetFileSizes_user.c @@ -15,8 +15,10 @@ START_TEST(CcSetFileSizes) DWORD Ret; ULONG TestId; - KmtLoadDriver(L"CcSetFileSizes", FALSE); - KmtOpenDriver(); + Ret = KmtLoadAndOpenDriver(L"CcSetFileSizes", FALSE); + ok_eq_int(Ret, ERROR_SUCCESS); + if (Ret) + return; /* 0: mapped data - only FS * 1: copy read - only FS diff --git a/modules/rostests/kmtests/ntos_io/IoCreateFile_user.c b/modules/rostests/kmtests/ntos_io/IoCreateFile_user.c index 86ae2d8e497..02cfc7183cf 100644 --- a/modules/rostests/kmtests/ntos_io/IoCreateFile_user.c +++ b/modules/rostests/kmtests/ntos_io/IoCreateFile_user.c @@ -18,8 +18,10 @@ START_TEST(IoCreateFile) KmtRunKernelTest("IoCreateFile"); - KmtLoadDriver(L"IoCreateFile", FALSE); - KmtOpenDriver(); + Error = KmtLoadAndOpenDriver(L"IoCreateFile", FALSE); + ok_eq_int(Error, ERROR_SUCCESS); + if (Error) + return; Error = KmtSendStringToDriver(IOCTL_CALL_CREATE, NonSymlinkedFileName); ok(Error == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %lx\n", Error); diff --git a/modules/rostests/kmtests/ntos_io/IoDeviceObject_user.c b/modules/rostests/kmtests/ntos_io/IoDeviceObject_user.c index 44707c6db59..50d66c58926 100644 --- a/modules/rostests/kmtests/ntos_io/IoDeviceObject_user.c +++ b/modules/rostests/kmtests/ntos_io/IoDeviceObject_user.c @@ -9,12 +9,20 @@ START_TEST(IoDeviceObject) { + DWORD Error; + /* make sure IoHelper has an existing service key, but is not started */ - KmtLoadDriver(L"IoHelper", FALSE); + Error = KmtLoadDriver(L"IoHelper", FALSE); + ok_eq_int(Error, ERROR_SUCCESS); + if (Error) + return; KmtUnloadDriver(); - KmtLoadDriver(L"IoDeviceObject", TRUE); - KmtOpenDriver(); + Error = KmtLoadAndOpenDriver(L"IoDeviceObject", TRUE); + ok_eq_int(Error, ERROR_SUCCESS); + if (Error) + return; + KmtCloseDriver(); KmtUnloadDriver(); } diff --git a/modules/rostests/kmtests/ntos_io/IoReadWrite_user.c b/modules/rostests/kmtests/ntos_io/IoReadWrite_user.c index e04119bf775..b71a47b2399 100644 --- a/modules/rostests/kmtests/ntos_io/IoReadWrite_user.c +++ b/modules/rostests/kmtests/ntos_io/IoReadWrite_user.c @@ -304,9 +304,12 @@ START_TEST(IoReadWrite) OBJECT_ATTRIBUTES ObjectAttributes; IO_STATUS_BLOCK IoStatus; NTSTATUS Status; + DWORD Error; - KmtLoadDriver(L"IoReadWrite", FALSE); - KmtOpenDriver(); + Error = KmtLoadAndOpenDriver(L"IoReadWrite", FALSE); + ok_eq_int(Error, ERROR_SUCCESS); + if (Error) + return; RtlFillMemory(&IoStatus, sizeof(IoStatus), 0x55); InitializeObjectAttributes(&ObjectAttributes, diff --git a/modules/rostests/kmtests/ntos_mm/MmMapLockedPagesSpecifyCache_user.c b/modules/rostests/kmtests/ntos_mm/MmMapLockedPagesSpecifyCache_user.c index 0fe781f7d1a..31b0592e464 100644 --- a/modules/rostests/kmtests/ntos_mm/MmMapLockedPagesSpecifyCache_user.c +++ b/modules/rostests/kmtests/ntos_mm/MmMapLockedPagesSpecifyCache_user.c @@ -86,9 +86,12 @@ START_TEST(MmMapLockedPagesSpecifyCache) SYSTEM_BASIC_INFORMATION BasicInfo; NTSTATUS Status; ULONG_PTR HighestAddress; + DWORD Error; - KmtLoadDriver(L"MmMapLockedPagesSpecifyCache", FALSE); - KmtOpenDriver(); + Error = KmtLoadAndOpenDriver(L"MmMapLockedPagesSpecifyCache", FALSE); + ok_eq_int(Error, ERROR_SUCCESS); + if (Error) + return; // Less than a page SET_BUFFER_LENGTH(BufferLength, 2048); diff --git a/modules/rostests/kmtests/ntos_mm/NtCreateSection_user.c b/modules/rostests/kmtests/ntos_mm/NtCreateSection_user.c index 39cdcd61498..853d7d4860a 100644 --- a/modules/rostests/kmtests/ntos_mm/NtCreateSection_user.c +++ b/modules/rostests/kmtests/ntos_mm/NtCreateSection_user.c @@ -19,9 +19,12 @@ START_TEST(NtCreateSection) UNICODE_STRING InitOnCreate = RTL_CONSTANT_STRING(L"\\Device\\Kmtest-NtCreateSection\\InitOnCreate"); UNICODE_STRING InitOnRW = RTL_CONSTANT_STRING(L"\\Device\\Kmtest-NtCreateSection\\InitOnRW"); UNICODE_STRING InvalidInit = RTL_CONSTANT_STRING(L"\\Device\\Kmtest-NtCreateSection\\InvalidInit"); + DWORD Error; - KmtLoadDriver(L"NtCreateSection", FALSE); - KmtOpenDriver(); + Error = KmtLoadAndOpenDriver(L"NtCreateSection", FALSE); + ok_eq_int(Error, ERROR_SUCCESS); + if (Error) + return; /* Test 0 */ InitializeObjectAttributes(&ObjectAttributes, &InvalidInit, OBJ_CASE_INSENSITIVE, NULL, NULL); diff --git a/modules/rostests/kmtests/ntos_po/PoIrp_user.c b/modules/rostests/kmtests/ntos_po/PoIrp_user.c index ee6a1ad57bf..951605fb2ad 100644 --- a/modules/rostests/kmtests/ntos_po/PoIrp_user.c +++ b/modules/rostests/kmtests/ntos_po/PoIrp_user.c @@ -10,6 +10,8 @@ START_TEST(PoIrp) { + DWORD Error; + #if defined(_M_AMD64) if (TRUE) { @@ -18,8 +20,11 @@ START_TEST(PoIrp) } #endif - KmtLoadDriver(L"PoIrp", TRUE); - KmtOpenDriver(); + Error = KmtLoadAndOpenDriver(L"PoIrp", TRUE); + ok_eq_int(Error, ERROR_SUCCESS); + if (Error) + return; + KmtSendToDriver(IOCTL_RUN_TEST); KmtCloseDriver(); KmtUnloadDriver(); diff --git a/modules/rostests/kmtests/tcpip/TcpIp_user.c b/modules/rostests/kmtests/tcpip/TcpIp_user.c index 80f33b090f4..60286d2e48a 100644 --- a/modules/rostests/kmtests/tcpip/TcpIp_user.c +++ b/modules/rostests/kmtests/tcpip/TcpIp_user.c @@ -11,12 +11,18 @@ #include "tcpip.h" static -void +DWORD LoadTcpIpTestDriver(void) { + DWORD Error; + /* Start the special-purpose driver */ - KmtLoadDriver(L"TcpIp", FALSE); - KmtOpenDriver(); + Error = KmtLoadAndOpenDriver(L"TcpIp", FALSE); + ok_eq_int(Error, ERROR_SUCCESS); + if (Error) + return Error; + + return ERROR_SUCCESS; } static @@ -32,7 +38,10 @@ START_TEST(TcpIpTdi) { DWORD Error; - LoadTcpIpTestDriver(); + Error = LoadTcpIpTestDriver(); + ok_eq_int(Error, 0); + if (Error) + return; Error = KmtSendToDriver(IOCTL_TEST_TDI); ok_eq_ulong(Error, ERROR_SUCCESS);
2 years
1
0
0
0
[reactos] 01/01: [NTOS:IO] Bring back the NDEBUG definition
by Victor Perevertkin
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=53de4fd93ef29f7399112…
commit 53de4fd93ef29f739911283f6a676d94a16ca643 Author: Victor Perevertkin <victor.perevertkin(a)reactos.org> AuthorDate: Tue Dec 13 01:49:32 2022 +0300 Commit: Victor Perevertkin <victor.perevertkin(a)reactos.org> CommitDate: Tue Dec 13 01:49:32 2022 +0300 [NTOS:IO] Bring back the NDEBUG definition Addendum to 947f60b20716e1581b0785360d2d71363eff3657 --- ntoskrnl/io/iomgr/driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ntoskrnl/io/iomgr/driver.c b/ntoskrnl/io/iomgr/driver.c index adbb14ba445..61ac27ed25b 100644 --- a/ntoskrnl/io/iomgr/driver.c +++ b/ntoskrnl/io/iomgr/driver.c @@ -11,7 +11,7 @@ /* INCLUDES *******************************************************************/ #include <ntoskrnl.h> -// #define NDEBUG +#define NDEBUG #include <debug.h> /* GLOBALS ********************************************************************/
2 years
1
0
0
0
[reactos] 01/01: [NTOS:IO] Allow REG_SZ type for ImagePath of a driver
by Victor Perevertkin
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=947f60b20716e1581b078…
commit 947f60b20716e1581b0785360d2d71363eff3657 Author: Victor Perevertkin <victor.perevertkin(a)reactos.org> AuthorDate: Tue Dec 13 01:46:20 2022 +0300 Commit: Victor Perevertkin <victor.perevertkin(a)reactos.org> CommitDate: Tue Dec 13 01:46:20 2022 +0300 [NTOS:IO] Allow REG_SZ type for ImagePath of a driver Fixes the load of the Sysinternals FileMon driver. CORE-18725 --- ntoskrnl/io/iomgr/driver.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ntoskrnl/io/iomgr/driver.c b/ntoskrnl/io/iomgr/driver.c index c81e4714542..adbb14ba445 100644 --- a/ntoskrnl/io/iomgr/driver.c +++ b/ntoskrnl/io/iomgr/driver.c @@ -11,7 +11,7 @@ /* INCLUDES *******************************************************************/ #include <ntoskrnl.h> -#define NDEBUG +// #define NDEBUG #include <debug.h> /* GLOBALS ********************************************************************/ @@ -1926,7 +1926,7 @@ IopLoadDriver( Status = IopGetRegistryValue(ServiceHandle, L"ImagePath", &kvInfo); if (NT_SUCCESS(Status)) { - if (kvInfo->Type != REG_EXPAND_SZ || kvInfo->DataLength == 0) + if ((kvInfo->Type != REG_EXPAND_SZ && kvInfo->Type != REG_SZ) || kvInfo->DataLength == 0) { ExFreePool(kvInfo); return STATUS_ILL_FORMED_SERVICE_ENTRY;
2 years
1
0
0
0
[reactos] 01/01: [BTRFS] btrfs.inf: Comment out mkbtrfs.exe (#4937)
by Serge Gautherie
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=475c0d1b4de11553533ba…
commit 475c0d1b4de11553533ba12c5de85082752a3dce Author: Serge Gautherie <32623169+SergeGautherie(a)users.noreply.github.com> AuthorDate: Sun Dec 11 23:10:02 2022 +0100 Commit: GitHub <noreply(a)github.com> CommitDate: Sun Dec 11 23:10:02 2022 +0100 [BTRFS] btrfs.inf: Comment out mkbtrfs.exe (#4937) It is not imported into ReactOS. Addendum to 0.4.13-dev-788-g c8875c182ac638a9aed627ecaf39e30ab22daf40 and 0.4.14-dev-1535-g 194ea909fdff60294ce2d5434cbded63f5377754 --- drivers/filesystems/btrfs/btrfs.inf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/filesystems/btrfs/btrfs.inf b/drivers/filesystems/btrfs/btrfs.inf index fd3512b4f2f..746d247588a 100644 --- a/drivers/filesystems/btrfs/btrfs.inf +++ b/drivers/filesystems/btrfs/btrfs.inf @@ -95,13 +95,13 @@ LoadOrderGroup = "File System" [Btrfs.DllFiles] shellbtrfs.dll ubtrfs.dll -mkbtrfs.exe +; mkbtrfs.exe ; Not imported into ReactOS. [SourceDisksFiles] btrfs.sys = 1,, shellbtrfs.dll = 1,, ubtrfs.dll = 1,, -mkbtrfs.exe = 1,, +; mkbtrfs.exe = 1,, ; Not imported into ReactOS. [SourceDisksNames.x86] 1 = %DiskId1%,,,\x86
2 years
1
0
0
0
[reactos] 01/01: ['OLD'_WORDPAD] General resources in rsrc.rc are language-neutral.
by Hermès Bélusca-Maïto
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=e942eeaff8e0243469804…
commit e942eeaff8e0243469804d07359fc95d69b6c621 Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> AuthorDate: Sat Dec 10 00:40:53 2022 +0100 Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> CommitDate: Sat Dec 10 00:40:53 2022 +0100 ['OLD'_WORDPAD] General resources in rsrc.rc are language-neutral. --- modules/rosapps/templates/old_wordpad/rsrc.rc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/rosapps/templates/old_wordpad/rsrc.rc b/modules/rosapps/templates/old_wordpad/rsrc.rc index 918666a3f19..95dc2273738 100644 --- a/modules/rosapps/templates/old_wordpad/rsrc.rc +++ b/modules/rosapps/templates/old_wordpad/rsrc.rc @@ -2,14 +2,16 @@ #include <commctrl.h> #include "resource.h" -#define REACTOS_STR_FILE_DESCRIPTION "ReactOS Document Editor\0" -#define REACTOS_STR_INTERNAL_NAME "wordpad\0" -#define REACTOS_STR_ORIGINAL_FILENAME "wordpad.exe\0" +LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL + +#define REACTOS_STR_FILE_DESCRIPTION "ReactOS Document Editor" +#define REACTOS_STR_INTERNAL_NAME "editor" +#define REACTOS_STR_ORIGINAL_FILENAME "editor.exe" //#include <reactos/version.rc> STRINGTABLE DISCARDABLE BEGIN - IDS_APPNAME "WordPad" + IDS_APPNAME "Editor" IDS_VERSION "v0.1" END
2 years
1
0
0
0
[reactos] 02/02: [ROSAPPS] Exclude the templates from compilation by default.
by Hermès Bélusca-Maïto
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=11031042270e348fae94c…
commit 11031042270e348fae94cf5f782c09b6f4b2e815 Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> AuthorDate: Sat Dec 10 00:30:28 2022 +0100 Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> CommitDate: Sat Dec 10 00:36:13 2022 +0100 [ROSAPPS] Exclude the templates from compilation by default. --- modules/rosapps/CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/rosapps/CMakeLists.txt b/modules/rosapps/CMakeLists.txt index 58a32c1c186..8581d2ad68c 100644 --- a/modules/rosapps/CMakeLists.txt +++ b/modules/rosapps/CMakeLists.txt @@ -3,7 +3,10 @@ add_subdirectory(demos) add_subdirectory(drivers) add_subdirectory(include) add_subdirectory(lib) -add_subdirectory(templates) + +if(ENABLE_ROSAPPS_TEMPLATES) + add_subdirectory(templates) +endif() list(APPEND ROSAPPS_INF_FILES rosapps_shortcuts.inf)
2 years
1
0
0
0
[reactos] 01/02: [MDI] Template MDI app is Win32 GUI, not CUI.
by Hermès Bélusca-Maïto
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=49ceac2efc2a6ba65fc0b…
commit 49ceac2efc2a6ba65fc0b7dffbfe5dbb6af7601d Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> AuthorDate: Sat Dec 10 00:29:53 2022 +0100 Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> CommitDate: Sat Dec 10 00:36:12 2022 +0100 [MDI] Template MDI app is Win32 GUI, not CUI. --- modules/rosapps/templates/mdi/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/rosapps/templates/mdi/CMakeLists.txt b/modules/rosapps/templates/mdi/CMakeLists.txt index 9debc998841..9adcd757cef 100644 --- a/modules/rosapps/templates/mdi/CMakeLists.txt +++ b/modules/rosapps/templates/mdi/CMakeLists.txt @@ -6,6 +6,6 @@ list(APPEND SOURCE main.c) add_executable(template_mdi ${SOURCE} mdi.rc) -set_module_type(template_mdi win32cui) +set_module_type(template_mdi win32gui) add_importlibs(template_mdi advapi32 user32 gdi32 comctl32 msvcrt kernel32 ntdll) add_cd_file(TARGET template_mdi DESTINATION reactos/system32 FOR all)
2 years
1
0
0
0
[reactos] 01/01: [CONSOLE] Improve font preview and Update de-DE.rc (#4933)
by Joachim Henze
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=5123edd731094465b901c…
commit 5123edd731094465b901c0d69813628b7533da8c Author: Joachim Henze <joachim.henze(a)reactos.org> AuthorDate: Fri Dec 9 21:28:38 2022 +0100 Commit: GitHub <noreply(a)github.com> CommitDate: Fri Dec 9 21:28:38 2022 +0100 [CONSOLE] Improve font preview and Update de-DE.rc (#4933) An addendum to bc1e2dbb92340b89ed043545ff761f75ea013301 == SVN r74465 from CORE13182 (I intentionally did not want JIRA to auto-link) --- dll/cpl/console/lang/de-DE.rc | 16 ++++++++-------- dll/cpl/console/layout.c | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/dll/cpl/console/lang/de-DE.rc b/dll/cpl/console/lang/de-DE.rc index 43d482c0fc9..d144ea96947 100644 --- a/dll/cpl/console/lang/de-DE.rc +++ b/dll/cpl/console/lang/de-DE.rc @@ -33,7 +33,7 @@ END IDD_PROPPAGEFONT DIALOGEX 0, 0, 250, 220 STYLE DS_SHELLFONT | WS_CHILD | WS_CAPTION -CAPTION "Schrift" +CAPTION "Schriftart" FONT 8, "MS Shell Dlg" BEGIN LTEXT "Fenstervorschau:", IDC_STATIC, 7, 7, 115, 10 @@ -41,12 +41,12 @@ BEGIN LTEXT "Größe:", IDC_STATIC, 130, 7, 45, 10 LISTBOX IDC_LBOX_FONTSIZE, 130, 20, 50, 86, LBS_SORT | LBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP COMBOBOX IDC_CBOX_FONTSIZE, 130, 20, 30, 86, CBS_SIMPLE | CBS_SORT | WS_VSCROLL | WS_TABSTOP - AUTORADIOBUTTON "pi&xels", IDC_RADIO_PIXEL_UNIT, 165, 17, 60, 10, WS_CHILD | WS_VISIBLE | WS_TABSTOP - AUTORADIOBUTTON "&points", IDC_RADIO_POINT_UNIT, 165, 28, 60, 10, WS_CHILD | WS_VISIBLE | WS_TABSTOP - LTEXT "&Schrift", IDC_STATIC, 10, 105, 35, 10 - AUTOCHECKBOX "&Fette Schriften", IDC_CHECK_BOLD_FONTS, 45, 105, 60, 10 + AUTORADIOBUTTON "Pi&xel", IDC_RADIO_PIXEL_UNIT, 165, 17, 60, 10, WS_CHILD | WS_VISIBLE | WS_TABSTOP + AUTORADIOBUTTON "&Punkte", IDC_RADIO_POINT_UNIT, 165, 28, 60, 10, WS_CHILD | WS_VISIBLE | WS_TABSTOP + LTEXT "&Schriftart", IDC_STATIC, 10, 105, 35, 10 + AUTOCHECKBOX "&Fett", IDC_CHECK_BOLD_FONTS, 45, 105, 60, 10 LISTBOX IDC_LBOX_FONTTYPE, 10, 120, 110, 50, LBS_SORT | LBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP - GROUPBOX "Selected Font", IDC_GROUPBOX_FONT_NAME, 7, 156, 240, 50 + GROUPBOX "Gewählte Schriftart", IDC_GROUPBOX_FONT_NAME, 7, 156, 240, 50 CONTROL "", IDC_STATIC_SELECT_FONT_PREVIEW, "Static", SS_OWNERDRAW | SS_SUNKEN, 12, 166, 104, 35, WS_EX_CLIENTEDGE LTEXT "Jedes Zeichen ist:", IDC_STATIC, 125, 166, 85, 10 LTEXT "Bildschirmpixel breit\nBildschirmpixel hoch", IDC_STATIC, 138, 180, 100, 20 @@ -151,6 +151,6 @@ BEGIN IDS_CPLNAME "Konsole" IDS_CPLDESCRIPTION "Konfiguriert die Konsoleneigenschaften." IDS_APPLY_SHORTCUT_ALL "Modifiziere die &Verknüpfung, die das Fenster startete" - IDS_RASTERFONTS "Rasterschriften" - IDS_GROUPBOX_FONT_NAME "Selected Font: " + IDS_RASTERFONTS "Rasterschriftarten" + IDS_GROUPBOX_FONT_NAME "Gewählte Schriftart: " END diff --git a/dll/cpl/console/layout.c b/dll/cpl/console/layout.c index e275b518b9f..3764a927e21 100644 --- a/dll/cpl/console/layout.c +++ b/dll/cpl/console/layout.c @@ -458,7 +458,7 @@ WinPrevProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) /* CONSOLE TEXT PREVIEW *******************************************************/ const WCHAR szPreviewText[] = - L"C:\\ReactOS> dir \n" \ + L"C:\\ReactOS>dir\n" \ L"SYSTEM <DIR> 13-04-15 5:00a\n" \ L"SYSTEM32 <DIR> 13-04-15 5:00a\n" \ L"readme txt 1739 13-04-15 5:00a\n" \
2 years
1
0
0
0
[reactos] 01/01: [SHELL32] Improve "Empty Recycle Bin" sound code (#4927)
by Thamatip Chitpong
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=7ca2710d64179a4b48eb3…
commit 7ca2710d64179a4b48eb3b2fbd4d212949717cb0 Author: Thamatip Chitpong <tangaming123456(a)outlook.com> AuthorDate: Sat Dec 10 03:14:09 2022 +0700 Commit: GitHub <noreply(a)github.com> CommitDate: Fri Dec 9 23:14:09 2022 +0300 [SHELL32] Improve "Empty Recycle Bin" sound code (#4927) Split off from PR #4755. This change doesn't require WINMM fixes (#4635). - Remove `MAX_PATH` limit - Use ATL classes - Play the sound asynchronously --- dll/win32/shell32/folders/CRecycleBin.cpp | 72 +++++++++++++++++++++++-------- 1 file changed, 54 insertions(+), 18 deletions(-) diff --git a/dll/win32/shell32/folders/CRecycleBin.cpp b/dll/win32/shell32/folders/CRecycleBin.cpp index ee6c6d60754..bb44ca3cd6a 100644 --- a/dll/win32/shell32/folders/CRecycleBin.cpp +++ b/dll/win32/shell32/folders/CRecycleBin.cpp @@ -1018,6 +1018,57 @@ TRASH_TrashFile(LPCWSTR wszPath) return DeleteFileToRecycleBin(wszPath); } +static void TRASH_PlayEmptyRecycleBinSound() +{ + CRegKey regKey; + CHeapPtr<WCHAR> pszValue; + CHeapPtr<WCHAR> pszSndPath; + DWORD dwType, dwSize; + LONG lError; + + lError = regKey.Open(HKEY_CURRENT_USER, + L"AppEvents\\Schemes\\Apps\\Explorer\\EmptyRecycleBin\\.Current", + KEY_READ); + if (lError != ERROR_SUCCESS) + return; + + lError = regKey.QueryValue(NULL, &dwType, NULL, &dwSize); + if (lError != ERROR_SUCCESS) + return; + + if (!pszValue.AllocateBytes(dwSize)) + return; + + lError = regKey.QueryValue(NULL, &dwType, pszValue, &dwSize); + if (lError != ERROR_SUCCESS) + return; + + if (dwType == REG_EXPAND_SZ) + { + dwSize = ExpandEnvironmentStringsW(pszValue, NULL, 0); + if (dwSize == 0) + return; + + if (!pszSndPath.Allocate(dwSize)) + return; + + if (ExpandEnvironmentStringsW(pszValue, pszSndPath, dwSize) == 0) + return; + } + else if (dwType == REG_SZ) + { + /* The type is REG_SZ, no need to expand */ + pszSndPath.Attach(pszValue.Detach()); + } + else + { + /* Invalid type */ + return; + } + + PlaySoundW(pszSndPath, NULL, SND_FILENAME | SND_ASYNC | SND_NODEFAULT); +} + /************************************************************************* * SHUpdateCRecycleBinIcon [SHELL32.@] * @@ -1064,8 +1115,8 @@ HRESULT WINAPI SHEmptyRecycleBinA(HWND hwnd, LPCSTR pszRootPath, DWORD dwFlags) HRESULT WINAPI SHEmptyRecycleBinW(HWND hwnd, LPCWSTR pszRootPath, DWORD dwFlags) { - WCHAR szPath[MAX_PATH] = {0}, szBuffer[MAX_PATH]; - DWORD dwSize, dwType, count; + WCHAR szBuffer[MAX_PATH]; + DWORD count; LONG ret; IShellFolder *pDesktop, *pRecycleBin; PIDLIST_ABSOLUTE pidlRecycleBin; @@ -1157,22 +1208,7 @@ HRESULT WINAPI SHEmptyRecycleBinW(HWND hwnd, LPCWSTR pszRootPath, DWORD dwFlags) if (!(dwFlags & SHERB_NOSOUND)) { - dwSize = sizeof(szPath); - ret = RegGetValueW(HKEY_CURRENT_USER, - L"AppEvents\\Schemes\\Apps\\Explorer\\EmptyRecycleBin\\.Current", - NULL, - RRF_RT_REG_SZ, - &dwType, - (PVOID)szPath, - &dwSize); - if (ret != ERROR_SUCCESS) - return S_OK; - - if (dwType != REG_EXPAND_SZ) /* type dismatch */ - return S_OK; - - szPath[_countof(szPath)-1] = L'\0'; - PlaySoundW(szPath, NULL, SND_FILENAME); + TRASH_PlayEmptyRecycleBinSound(); } return S_OK; }
2 years
1
0
0
0
← Newer
1
2
3
4
5
6
7
8
9
10
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
Results per page:
10
25
50
100
200