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
June
May
April
March
February
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
November 2020
----- 2025 -----
June 2025
May 2025
April 2025
March 2025
February 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
18 participants
162 discussions
Start a n
N
ew thread
[reactos] 01/01: [NTOS:SE] Fix handling of relative security descriptors in SeQuerySecurityDescriptorInfo
by Timo Kreuzer
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=274bc4de1cbd2de19fbfa…
commit 274bc4de1cbd2de19fbfa94c88e91640753f409d Author: Timo Kreuzer <timo.kreuzer(a)reactos.org> AuthorDate: Fri Jan 3 20:44:05 2020 +0100 Commit: Timo Kreuzer <timo.kreuzer(a)reactos.org> CommitDate: Sat Nov 7 15:54:47 2020 +0100 [NTOS:SE] Fix handling of relative security descriptors in SeQuerySecurityDescriptorInfo --- ntoskrnl/se/sd.c | 32 ++++++++++++++++++-------------- 1 file changed,
…
[View More]
18 insertions(+), 14 deletions(-) diff --git a/ntoskrnl/se/sd.c b/ntoskrnl/se/sd.c index 012e9ef00ef..ccf17bb8388 100644 --- a/ntoskrnl/se/sd.c +++ b/ntoskrnl/se/sd.c @@ -658,28 +658,32 @@ SeQuerySecurityDescriptorInfo( /* Calculate the required security descriptor length */ Control = SE_SELF_RELATIVE; - if ((*SecurityInformation & OWNER_SECURITY_INFORMATION) && - (ObjectSd->Owner != NULL)) + if (*SecurityInformation & OWNER_SECURITY_INFORMATION) { - Owner = (PSID)((ULONG_PTR)ObjectSd->Owner + (ULONG_PTR)ObjectSd); - OwnerLength = ROUND_UP(RtlLengthSid(Owner), 4); - Control |= (ObjectSd->Control & SE_OWNER_DEFAULTED); + Owner = SepGetOwnerFromDescriptor(ObjectSd); + if (Owner != NULL) + { + OwnerLength = ROUND_UP(RtlLengthSid(Owner), 4); + Control |= (ObjectSd->Control & SE_OWNER_DEFAULTED); + } } - if ((*SecurityInformation & GROUP_SECURITY_INFORMATION) && - (ObjectSd->Group != NULL)) + if (*SecurityInformation & GROUP_SECURITY_INFORMATION) { - Group = (PSID)((ULONG_PTR)ObjectSd->Group + (ULONG_PTR)ObjectSd); - GroupLength = ROUND_UP(RtlLengthSid(Group), 4); - Control |= (ObjectSd->Control & SE_GROUP_DEFAULTED); + Group = SepGetGroupFromDescriptor(ObjectSd); + if (Group != NULL) + { + GroupLength = ROUND_UP(RtlLengthSid(Group), 4); + Control |= (ObjectSd->Control & SE_GROUP_DEFAULTED); + } } if ((*SecurityInformation & DACL_SECURITY_INFORMATION) && (ObjectSd->Control & SE_DACL_PRESENT)) { - if (ObjectSd->Dacl != NULL) + Dacl = SepGetDaclFromDescriptor(ObjectSd); + if (Dacl != NULL) { - Dacl = (PACL)((ULONG_PTR)ObjectSd->Dacl + (ULONG_PTR)ObjectSd); DaclLength = ROUND_UP((ULONG)Dacl->AclSize, 4); } @@ -689,9 +693,9 @@ SeQuerySecurityDescriptorInfo( if ((*SecurityInformation & SACL_SECURITY_INFORMATION) && (ObjectSd->Control & SE_SACL_PRESENT)) { - if (ObjectSd->Sacl != NULL) + Sacl = SepGetSaclFromDescriptor(ObjectSd); + if (Sacl != NULL) { - Sacl = (PACL)((ULONG_PTR)ObjectSd->Sacl + (ULONG_PTR)ObjectSd); SaclLength = ROUND_UP(Sacl->AclSize, 4); }
[View Less]
4 years, 7 months
1
0
0
0
[reactos] 01/01: [KMTESTS:HAL] Add a test for HalQueryAMLIIllegalIOPortAddresses. CORE-17359
by Thomas Faber
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=dab6b26a5790e27eb49cc…
commit dab6b26a5790e27eb49ccf5002ca1ede01d17534 Author: Thomas Faber <thomas.faber(a)reactos.org> AuthorDate: Sat Oct 31 12:26:27 2020 +0100 Commit: Thomas Faber <thomas.faber(a)reactos.org> CommitDate: Sat Nov 7 11:36:14 2020 +0100 [KMTESTS:HAL] Add a test for HalQueryAMLIIllegalIOPortAddresses. CORE-17359 --- modules/rostests/kmtests/CMakeLists.txt | 1 + modules/rostests/kmtests/
…
[View More]
hal/HalSystemInfo.c | 154 +++++++++++++++++++++++++ modules/rostests/kmtests/kmtest_drv/testlist.c | 2 + 3 files changed, 157 insertions(+) diff --git a/modules/rostests/kmtests/CMakeLists.txt b/modules/rostests/kmtests/CMakeLists.txt index 0d7eb194aaf..9e3528cdf96 100644 --- a/modules/rostests/kmtests/CMakeLists.txt +++ b/modules/rostests/kmtests/CMakeLists.txt @@ -37,6 +37,7 @@ list(APPEND KMTEST_DRV_SOURCE example/Example.c example/KernelType.c + hal/HalSystemInfo.c npfs/NpfsConnect.c npfs/NpfsCreate.c npfs/NpfsFileInfo.c diff --git a/modules/rostests/kmtests/hal/HalSystemInfo.c b/modules/rostests/kmtests/hal/HalSystemInfo.c new file mode 100644 index 00000000000..fa998c37846 --- /dev/null +++ b/modules/rostests/kmtests/hal/HalSystemInfo.c @@ -0,0 +1,154 @@ +/* + * PROJECT: ReactOS Kernel-Mode Tests + * LICENSE: LGPL-2.1-or-later (
https://spdx.org/licenses/LGPL-2.1-or-later
) + * PURPOSE: Test for HalQuerySystemInformation + * COPYRIGHT: Copyright 2020 Thomas Faber (thomas.faber(a)reactos.org) + */ + +#include <kmt_test.h> + +#define NDEBUG +#include <debug.h> + +static HAL_AMLI_BAD_IO_ADDRESS_LIST ExpectedList[] = +{ + { 0x0000, 0x10, 1, NULL }, + { 0x0020, 0x02, 0, NULL }, + { 0x0040, 0x04, 1, NULL }, + { 0x0048, 0x04, 1, NULL }, + { 0x0070, 0x02, 1, NULL }, + { 0x0074, 0x03, 1, NULL }, + { 0x0081, 0x03, 1, NULL }, + { 0x0087, 0x01, 1, NULL }, + { 0x0089, 0x01, 1, NULL }, + { 0x008A, 0x02, 1, NULL }, + { 0x008F, 0x01, 1, NULL }, + { 0x0090, 0x02, 1, NULL }, + { 0x0093, 0x02, 1, NULL }, + { 0x0096, 0x02, 1, NULL }, + { 0x00A0, 0x02, 0, NULL }, + { 0x00C0, 0x20, 1, NULL }, + { 0x04D0, 0x02, 0, NULL }, + /* We obviously don't have the expected pointer. Just use a non-null value */ + { 0x0CF8, 0x08, 1, (PVOID)1 }, + { 0x0000, 0x00, 0, NULL }, +}; + +static +void +TestAMLIllegalIOPortAddresses(void) +{ + NTSTATUS Status; + PHAL_AMLI_BAD_IO_ADDRESS_LIST AddressList; + ULONG AddressListLength; + ULONG ReturnedLength; + + /* Query required size and check that it's valid */ + ReturnedLength = 0x55555555; + Status = HalQuerySystemInformation(HalQueryAMLIIllegalIOPortAddresses, + 0, + NULL, + &ReturnedLength); + ok_eq_hex(Status, STATUS_INFO_LENGTH_MISMATCH); + ok(ReturnedLength % sizeof(*AddressList) == 0, "List size %lu is not a multiple of %Iu\n", ReturnedLength, sizeof(*AddressList)); + if (skip(ReturnedLength > 0 && ReturnedLength < 0x10000000, "Invalid length\n")) + { + return; + } + AddressListLength = ReturnedLength; + AddressList = ExAllocatePoolWithTag(NonPagedPool, + AddressListLength, + 'OImK'); + if (skip(AddressList != NULL, "Failed to alloc %lu bytes\n", AddressListLength)) + { + return; + } + + if (ReturnedLength != sizeof(*AddressList)) + { + /* Try with space for exactly one entry and make sure we get + * the same return code + */ + RtlFillMemory(AddressList, AddressListLength, 0x55); + ReturnedLength = 0x55555555; + Status = HalQuerySystemInformation(HalQueryAMLIIllegalIOPortAddresses, + sizeof(*AddressList), + AddressList, + &ReturnedLength); + ok_eq_hex(Status, STATUS_INFO_LENGTH_MISMATCH); + ok_eq_ulong(ReturnedLength, AddressListLength); + ok_eq_hex(AddressList[0].BadAddrBegin, 0x55555555UL); + } + + /* One byte less than required should still return no data */ + RtlFillMemory(AddressList, AddressListLength, 0x55); + ReturnedLength = 0x55555555; + Status = HalQuerySystemInformation(HalQueryAMLIIllegalIOPortAddresses, + AddressListLength - 1, + AddressList, + &ReturnedLength); + ok_eq_hex(Status, STATUS_INFO_LENGTH_MISMATCH); + ok_eq_ulong(ReturnedLength, AddressListLength); + ok_eq_hex(AddressList[0].BadAddrBegin, 0x55555555UL); + + /* Specify required size */ + RtlFillMemory(AddressList, AddressListLength, 0x55); + ReturnedLength = 0x55555555; + Status = HalQuerySystemInformation(HalQueryAMLIIllegalIOPortAddresses, + AddressListLength, + AddressList, + &ReturnedLength); + ok_eq_hex(Status, STATUS_SUCCESS); + ok_eq_ulong(ReturnedLength, AddressListLength); + + /* Validate the table against our expectations */ + ok_eq_ulong(ReturnedLength, sizeof(ExpectedList)); + for (ULONG i = 0; + i < min(ReturnedLength, sizeof(ExpectedList)) / sizeof(*AddressList); + i++) + { + ok(AddressList[i].BadAddrBegin == ExpectedList[i].BadAddrBegin, + "[%lu] BadAddrBegin 0x%lx, expected 0x%lx\n", + i, AddressList[i].BadAddrBegin, ExpectedList[i].BadAddrBegin); + ok(AddressList[i].BadAddrSize == ExpectedList[i].BadAddrSize, + "[%lu] BadAddrSize 0x%lx, expected 0x%lx\n", + i, AddressList[i].BadAddrSize, ExpectedList[i].BadAddrSize); + ok(AddressList[i].OSVersionTrigger == ExpectedList[i].OSVersionTrigger, + "[%lu] OSVersionTrigger 0x%lx, expected 0x%lx\n", + i, AddressList[i].OSVersionTrigger, ExpectedList[i].OSVersionTrigger); + if (ExpectedList[i].IOHandler != NULL) + { + ok(AddressList[i].IOHandler != NULL, + "[%lu] IOHandler = %p\n", i, AddressList[i].IOHandler); + } + else + { + ok(AddressList[i].IOHandler == NULL, + "[%lu] IOHandler = %p\n", i, AddressList[i].IOHandler); + } + + /* If we got an I/O handler, try to call it */ + if (AddressList[i].IOHandler != NULL) + { + ULONG Data = 0x55555555; + + /* We don't want to break devices, so call it with an address + * outside of its range, and it should return failure + */ + Status = AddressList[i].IOHandler(TRUE, + AddressList[i].BadAddrBegin - 1, + 1, + &Data); + ok(Status == STATUS_UNSUCCESSFUL, + "[%lu] IOHandler returned 0x%lx\n", i, Status); + ok(Data == 0x55555555, + "[%lu] IOHandler returned Data 0x%lx\n", i, Data); + } + } + ExFreePoolWithTag(AddressList, 'OImK'); +} + +START_TEST(HalSystemInfo) +{ + TestAMLIllegalIOPortAddresses(); +} diff --git a/modules/rostests/kmtests/kmtest_drv/testlist.c b/modules/rostests/kmtests/kmtest_drv/testlist.c index 859ec68ea6c..99743a26fe8 100644 --- a/modules/rostests/kmtests/kmtest_drv/testlist.c +++ b/modules/rostests/kmtests/kmtest_drv/testlist.c @@ -26,6 +26,7 @@ KMT_TESTFUNC Test_FsRtlLegal; KMT_TESTFUNC Test_FsRtlMcb; KMT_TESTFUNC Test_FsRtlRemoveDotsFromPath; KMT_TESTFUNC Test_FsRtlTunnel; +KMT_TESTFUNC Test_HalSystemInfo; KMT_TESTFUNC Test_IoCreateFile; KMT_TESTFUNC Test_IoDeviceInterface; KMT_TESTFUNC Test_IoEvent; @@ -102,6 +103,7 @@ const KMT_TEST TestList[] = { "FsRtlMcb", Test_FsRtlMcb }, { "FsRtlRemoveDotsFromPath", Test_FsRtlRemoveDotsFromPath }, { "FsRtlTunnel", Test_FsRtlTunnel }, + { "HalSystemInfo", Test_HalSystemInfo }, { "IoCreateFile", Test_IoCreateFile }, { "IoDeviceInterface", Test_IoDeviceInterface }, { "IoEvent", Test_IoEvent },
[View Less]
4 years, 7 months
1
0
0
0
[reactos] 05/05: [WINDOWSCODECS] It turns out that /wd4133 is not enough to demote the error; we need to use remove_target_compile_option() to completely remove the /we4133 flag.
by Hermès Bélusca-Maïto
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=d829bcc629b36ecf38c8a…
commit d829bcc629b36ecf38c8a99f2f4098296b071c8a Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> AuthorDate: Fri Nov 6 00:17:33 2020 +0100 Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> CommitDate: Fri Nov 6 01:06:13 2020 +0100 [WINDOWSCODECS] It turns out that /wd4133 is not enough to demote the error; we need to use remove_target_compile_option() to
…
[View More]
completely remove the /we4133 flag. Addendum to commits 7e116f0e and 00ed72d7. This removes the "error C4133: 'function': incompatible types - from 'WICPixelFormatNumericRepresentation *' to 'DWORD *'" message that still remains even when using /wd4133 . --- dll/win32/windowscodecs/CMakeLists.txt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dll/win32/windowscodecs/CMakeLists.txt b/dll/win32/windowscodecs/CMakeLists.txt index c9f0e9ecdbd..316fd1f329b 100644 --- a/dll/win32/windowscodecs/CMakeLists.txt +++ b/dll/win32/windowscodecs/CMakeLists.txt @@ -71,9 +71,10 @@ add_library(windowscodecs MODULE ${CMAKE_CURRENT_BINARY_DIR}/windowscodecs.def) if(MSVC) - target_compile_options(windowscodecs PRIVATE - /wd4133 # error C4133: 'function': incompatible types - from 'WICPixelFormatNumericRepresentation *' to 'DWORD *' - /FItypeof.h) + # error C4133: 'function': incompatible types - from 'WICPixelFormatNumericRepresentation *' to 'DWORD *' + remove_target_compile_option(windowscodecs "/we4133") + + target_compile_options(windowscodecs PRIVATE /FItypeof.h) endif() set_module_type(windowscodecs win32dll)
[View Less]
4 years, 7 months
1
0
0
0
[reactos] 04/05: [RAPPS.COM] Use HeapAlloc/Free instead of the deprecated LocalAlloc/Free.
by Hermès Bélusca-Maïto
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=ce2c1f6321f3e59da8697…
commit ce2c1f6321f3e59da86970f545ec497ebf0e54cf Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> AuthorDate: Thu Nov 5 19:55:33 2020 +0100 Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> CommitDate: Fri Nov 6 01:06:12 2020 +0100 [
RAPPS.COM
] Use HeapAlloc/Free instead of the deprecated LocalAlloc/Free. And fix my build. --- base/applications/
…
[View More]
rapps_com/main.c | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/base/applications/rapps_com/main.c b/base/applications/rapps_com/main.c index fdb583f053d..d5f7c01ff0f 100644 --- a/base/applications/rapps_com/main.c +++ b/base/applications/rapps_com/main.c @@ -9,11 +9,12 @@ #include <winbase.h> #include <strsafe.h> - int run_rapps(LPWSTR cmdline) { + DWORD dwExit; STARTUPINFOW si = { sizeof(si) }; PROCESS_INFORMATION pi = { 0 }; + SetLastError(0); if (!CreateProcessW(NULL, cmdline, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi)) { @@ -22,18 +23,21 @@ int run_rapps(LPWSTR cmdline) } CloseHandle(pi.hThread); WaitForSingleObject(pi.hProcess, INFINITE); - DWORD dwExit; GetExitCodeProcess(pi.hProcess, &dwExit); CloseHandle(pi.hProcess); - return dwExit; + return (int)dwExit; } int wmain(int argc, wchar_t* argv[]) { + int iRet; + int n; + size_t arglen; WCHAR RappsExe[MAX_PATH] = { 0 }; + wchar_t* cmdline; GetModuleFileNameW(NULL, RappsExe, ARRAYSIZE(RappsExe)); - size_t arglen = wcslen(RappsExe); + arglen = wcslen(RappsExe); if (arglen > 4 && !wcsicmp(RappsExe + arglen - 4, L".com")) { wcscpy(RappsExe + arglen - 4, L".exe"); @@ -41,18 +45,18 @@ int wmain(int argc, wchar_t* argv[]) else { fprintf(stderr, "Unable to build rapps.exe path...\n"); - return - 1; + return -1; } - arglen += (1 + 2); // nullterminator + 2 quotes + arglen += (1 + 2); // NULL terminator + 2 quotes - for (int n = 1; n < argc; ++n) + for (n = 1; n < argc; ++n) { arglen += wcslen(argv[n]); arglen += 3; // Surrounding quotes + space } - wchar_t* cmdline = LocalAlloc(LMEM_ZEROINIT, arglen * sizeof(WCHAR)); + cmdline = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, arglen * sizeof(WCHAR)); if (cmdline) { wchar_t* ptr = cmdline; @@ -60,14 +64,14 @@ int wmain(int argc, wchar_t* argv[]) StringCchPrintfExW(ptr, cchRemaining, &ptr, &cchRemaining, 0, L"\"%s\"", RappsExe); - for (int n = 1; n < argc; ++n) + for (n = 1; n < argc; ++n) { StringCchPrintfExW(ptr, cchRemaining, &ptr, &cchRemaining, 0, L" \"%s\"", argv[n]); } } - int iRet = run_rapps(cmdline); + iRet = run_rapps(cmdline); if (cmdline) - LocalFree(cmdline); + HeapFree(GetProcessHeap(), 0, cmdline); return iRet; }
[View Less]
4 years, 7 months
1
0
0
0
[reactos] 03/05: [NTOS:EX] Move the C_ASSERT UUID_CACHED_VALUES_STRUCT.GuidInit to a better place, where the structure is defined.
by Hermès Bélusca-Maïto
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=ce55fef1e5c98c146d187…
commit ce55fef1e5c98c146d187c5fa5011fd3a5cce425 Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> AuthorDate: Thu Nov 5 19:03:30 2020 +0100 Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> CommitDate: Fri Nov 6 01:06:12 2020 +0100 [NTOS:EX] Move the C_ASSERT UUID_CACHED_VALUES_STRUCT.GuidInit to a better place, where the structure is defined. --- ntoskrnl/ex/
…
[View More]
uuid.c | 1 - ntoskrnl/include/internal/ex.h | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ntoskrnl/ex/uuid.c b/ntoskrnl/ex/uuid.c index b196d6e9833..07530161d29 100644 --- a/ntoskrnl/ex/uuid.c +++ b/ntoskrnl/ex/uuid.c @@ -394,7 +394,6 @@ ExUuidCreate(OUT UUID *Uuid) { Time.QuadPart = ExpUuidCachedValues.Time; - C_ASSERT(sizeof(ExpUuidCachedValues.GuidInit) == sizeof(Uuid->Data4)); RtlCopyMemory(Uuid->Data4, ExpUuidCachedValues.GuidInit, sizeof(Uuid->Data4)); diff --git a/ntoskrnl/include/internal/ex.h b/ntoskrnl/include/internal/ex.h index 5ec4a8434f5..fae2026fc1c 100644 --- a/ntoskrnl/include/internal/ex.h +++ b/ntoskrnl/include/internal/ex.h @@ -183,6 +183,8 @@ typedef struct _UUID_CACHED_VALUES_STRUCT }; } UUID_CACHED_VALUES_STRUCT, *PUUID_CACHED_VALUES_STRUCT; +C_ASSERT(RTL_FIELD_SIZE(UUID_CACHED_VALUES_STRUCT, GuidInit) == RTL_FIELD_SIZE(UUID, Data4)); + /* INITIALIZATION FUNCTIONS *************************************************/ BOOLEAN
[View Less]
4 years, 7 months
1
0
0
0
[reactos] 02/05: [CMD][SERVMAN][SHELL32][WINSPOOL][ROSAPPS][NTOS:PNP] Fix my build.
by Hermès Bélusca-Maïto
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=3c722e35b1c89cb07bfa3…
commit 3c722e35b1c89cb07bfa3c281be2c2e013c008f6 Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> AuthorDate: Thu Aug 20 17:47:40 2020 +0200 Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> CommitDate: Fri Nov 6 01:06:11 2020 +0100 [CMD][SERVMAN][SHELL32][WINSPOOL][ROSAPPS][NTOS:PNP] Fix my build. --- base/applications/mscutils/servman/mainwnd.c |
…
[View More]
4 ++-- base/shell/cmd/batch.c | 4 +++- dll/win32/shell32/shellrecyclebin/recyclebin_v5.c | 3 ++- dll/win32/shell32/wine/shellord.c | 2 +- modules/rostests/apitests/shlwapi/SHLoadIndirectString.c | 3 ++- modules/rostests/apitests/utildll/CachedGetUserFromSid.c | 14 +++++++------- ntoskrnl/io/pnpmgr/devaction.c | 6 ++++-- win32ss/printing/base/winspool/jobs.c | 4 ++-- 8 files changed, 23 insertions(+), 17 deletions(-) diff --git a/base/applications/mscutils/servman/mainwnd.c b/base/applications/mscutils/servman/mainwnd.c index d96b4a32e79..1b016fb593b 100644 --- a/base/applications/mscutils/servman/mainwnd.c +++ b/base/applications/mscutils/servman/mainwnd.c @@ -380,12 +380,12 @@ MainWndCommand(PMAIN_WND_INFO Info, WORD CmdId, HWND hControl) { - UNREFERENCED_PARAMETER(hControl); - WCHAR szAppName[256]; WCHAR szAppAuthors[256]; HICON hIcon; + UNREFERENCED_PARAMETER(hControl); + switch (CmdId) { case ID_PROP: diff --git a/base/shell/cmd/batch.c b/base/shell/cmd/batch.c index 36600cd0720..8fc6bf8466e 100644 --- a/base/shell/cmd/batch.c +++ b/base/shell/cmd/batch.c @@ -409,11 +409,13 @@ INT Batch(LPTSTR fullname, LPTSTR firstword, LPTSTR param, PARSED_COMMAND *Cmd) /* Perform top-level batch initialization */ if (bTopLevel) { + TCHAR *dot; + /* Default the top-level batch context type to .BAT */ BatType = BAT_TYPE; /* If this is a .CMD file, adjust the type */ - TCHAR *dot = _tcsrchr(bc->BatchFilePath, _T('.')); + dot = _tcsrchr(bc->BatchFilePath, _T('.')); if (dot && (!_tcsicmp(dot, _T(".cmd")))) { BatType = CMD_TYPE; diff --git a/dll/win32/shell32/shellrecyclebin/recyclebin_v5.c b/dll/win32/shell32/shellrecyclebin/recyclebin_v5.c index 4e333da9f27..766bf4f4631 100644 --- a/dll/win32/shell32/shellrecyclebin/recyclebin_v5.c +++ b/dll/win32/shell32/shellrecyclebin/recyclebin_v5.c @@ -474,6 +474,7 @@ RecycleBin5_RecycleBin5_Restore( DELETED_FILE_RECORD *pRecord, *pLast; DWORD dwEntries, i; SHFILEOPSTRUCTW op; + int res; TRACE("(%p, %s, %p)\n", This, debugstr_w(pDeletedFileName), pDeletedFile); @@ -503,7 +504,7 @@ RecycleBin5_RecycleBin5_Restore( op.pFrom = pDeletedFileName; op.pTo = pDeletedFile->FileNameW; - int res = SHFileOperationW(&op); + res = SHFileOperationW(&op); if (res) { ERR("SHFileOperationW failed with 0x%x\n", res); diff --git a/dll/win32/shell32/wine/shellord.c b/dll/win32/shell32/wine/shellord.c index 37ff171d4b6..0b3965711c2 100644 --- a/dll/win32/shell32/wine/shellord.c +++ b/dll/win32/shell32/wine/shellord.c @@ -1486,8 +1486,8 @@ BOOL WINAPI SHRunControlPanel (_In_ LPCWSTR commandLine, _In_opt_ HWND parent) * However we need to keep it "alive" even when ReactOS is compliled as NT6+ * in order to keep control panel elements launch commands. */ - TRACE("(%s, %p)n", debugstr_w(commandLine), parent); WCHAR parameters[MAX_PATH] = L"shell32.dll,Control_RunDLL "; + TRACE("(%s, %p)n", debugstr_w(commandLine), parent); wcscat(parameters, commandLine); return ((INT_PTR)ShellExecuteW(parent, L"open", L"rundll32.exe", parameters, NULL, SW_SHOWNORMAL) > 32); diff --git a/modules/rostests/apitests/shlwapi/SHLoadIndirectString.c b/modules/rostests/apitests/shlwapi/SHLoadIndirectString.c index f086a7e2514..0eac5b04db6 100644 --- a/modules/rostests/apitests/shlwapi/SHLoadIndirectString.c +++ b/modules/rostests/apitests/shlwapi/SHLoadIndirectString.c @@ -16,6 +16,7 @@ static void execute_test(LPCWSTR DllFile) HRESULT hr; HANDLE hEvent; DWORD dwRet; + HMODULE mod; hEvent = CreateEventA(NULL, TRUE, FALSE, "Local\\shlwapi_apitest_evt"); @@ -24,7 +25,7 @@ static void execute_test(LPCWSTR DllFile) ok_hex(dwRet, WAIT_TIMEOUT); // Ensure the module is not loaded yet... - HMODULE mod = GetModuleHandleW(DllFile); + mod = GetModuleHandleW(DllFile); if (mod != NULL) { CloseHandle(hEvent); diff --git a/modules/rostests/apitests/utildll/CachedGetUserFromSid.c b/modules/rostests/apitests/utildll/CachedGetUserFromSid.c index 04a5ad75e14..0199fda2c06 100644 --- a/modules/rostests/apitests/utildll/CachedGetUserFromSid.c +++ b/modules/rostests/apitests/utildll/CachedGetUserFromSid.c @@ -61,26 +61,26 @@ static void test_Sid_Null(void) START_TEST(CachedGetUserFromSid) { const char szFunction[] = "CachedGetUserFromSid"; + void* pFunction; // TODO: Dynamically checking, until ReactOS implements this dll. - HMODULE hModule = LoadLibraryW(L"utildll.dll"); - DWORD dwLE = GetLastError(); + HMODULE hModule; + DWORD dwLE; + hModule = LoadLibraryW(L"utildll.dll"); if (!hModule) { + dwLE = GetLastError(); ok(FALSE, "LoadLibraryW(\"%S\") failed! (dwLE = %lu)\n", L"utildll.dll", dwLE); - skip("No DLL\n"); return; } - void *pFunction = (void *)GetProcAddress(hModule, szFunction); - dwLE = GetLastError(); - + pFunction = (void*)GetProcAddress(hModule, szFunction); if (!pFunction) { + dwLE = GetLastError(); ok(FALSE, "GetProcAddress(\"%s\") failed! (dwLE = %lu)\n", szFunction, dwLE); - skip("No function\n"); FreeLibrary(hModule); return; diff --git a/ntoskrnl/io/pnpmgr/devaction.c b/ntoskrnl/io/pnpmgr/devaction.c index 67221e83e20..e6479074f32 100644 --- a/ntoskrnl/io/pnpmgr/devaction.c +++ b/ntoskrnl/io/pnpmgr/devaction.c @@ -2404,6 +2404,8 @@ PipDeviceActionWorker( PLIST_ENTRY ListEntry; PDEVICE_ACTION_REQUEST Request; KIRQL OldIrql; + PDEVICE_NODE deviceNode; + NTSTATUS status; KeAcquireSpinLock(&IopDeviceActionLock, &OldIrql); while (!IsListEmpty(&IopDeviceActionRequestList)) @@ -2414,10 +2416,10 @@ PipDeviceActionWorker( ASSERT(Request->DeviceObject); - PDEVICE_NODE deviceNode = IopGetDeviceNode(Request->DeviceObject); + deviceNode = IopGetDeviceNode(Request->DeviceObject); ASSERT(deviceNode); - NTSTATUS status = STATUS_SUCCESS; + status = STATUS_SUCCESS; DPRINT("Processing PnP request %p: DeviceObject - %p, Action - %s\n", Request, Request->DeviceObject, ActionToStr(Request->Action)); diff --git a/win32ss/printing/base/winspool/jobs.c b/win32ss/printing/base/winspool/jobs.c index 69531438653..b0a248e1b37 100644 --- a/win32ss/printing/base/winspool/jobs.c +++ b/win32ss/printing/base/winspool/jobs.c @@ -435,9 +435,9 @@ SetJobA(HANDLE hPrinter, DWORD JobId, DWORD Level, PBYTE pJobInfo, DWORD Command break; case 1: { + JOB_INFO_1A *info1A = (JOB_INFO_1A*)pJobInfo; JOB_INFO_1W *info1W = HeapAlloc(GetProcessHeap(), 0, sizeof(*info1W)); ZeroMemory( info1W, sizeof(JOB_INFO_1W) ); - JOB_INFO_1A *info1A = (JOB_INFO_1A*)pJobInfo; JobW = (LPBYTE)info1W; info1W->pUserName = AsciiToUnicode(&usBuffer, info1A->pUserName); @@ -452,9 +452,9 @@ SetJobA(HANDLE hPrinter, DWORD JobId, DWORD Level, PBYTE pJobInfo, DWORD Command } case 2: { + JOB_INFO_2A *info2A = (JOB_INFO_2A*)pJobInfo; JOB_INFO_2W *info2W = HeapAlloc(GetProcessHeap(), 0, sizeof(*info2W)); ZeroMemory( info2W, sizeof(JOB_INFO_2W) ); - JOB_INFO_2A *info2A = (JOB_INFO_2A*)pJobInfo; JobW = (LPBYTE)info2W; info2W->pUserName = AsciiToUnicode(&usBuffer, info2A->pUserName);
[View Less]
4 years, 7 months
1
0
0
0
[reactos] 01/05: [SERVMAN] Fix trailing whitespace.
by Hermès Bélusca-Maïto
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=ec0853ba70e63c75605b2…
commit ec0853ba70e63c75605b2285be485c0e5ca84390 Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> AuthorDate: Thu Aug 20 17:50:42 2020 +0200 Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> CommitDate: Fri Nov 6 01:06:10 2020 +0100 [SERVMAN] Fix trailing whitespace. --- base/applications/mscutils/servman/mainwnd.c | 4 ++-- base/applications/mscutils/
…
[View More]
servman/propsheet_depends.c | 1 - base/applications/mscutils/servman/servman.c | 2 +- base/applications/mscutils/servman/stop.c | 4 ++-- base/applications/mscutils/servman/stop_dependencies.c | 6 +++--- 5 files changed, 8 insertions(+), 9 deletions(-) diff --git a/base/applications/mscutils/servman/mainwnd.c b/base/applications/mscutils/servman/mainwnd.c index 02d4ff55232..d96b4a32e79 100644 --- a/base/applications/mscutils/servman/mainwnd.c +++ b/base/applications/mscutils/servman/mainwnd.c @@ -383,7 +383,7 @@ MainWndCommand(PMAIN_WND_INFO Info, UNREFERENCED_PARAMETER(hControl); WCHAR szAppName[256]; - WCHAR szAppAuthors[256]; + WCHAR szAppAuthors[256]; HICON hIcon; switch (CmdId) @@ -596,7 +596,7 @@ MainWndCommand(PMAIN_WND_INFO Info, case ID_ABOUT: LoadStringW(hInstance, IDS_APPNAME, szAppName, _countof(szAppName)); LoadStringW(hInstance, IDS_APPAUTHORS, szAppAuthors, _countof(szAppAuthors)); - + hIcon = LoadIconW(hInstance, MAKEINTRESOURCEW(IDI_SM_ICON)); ShellAboutW(Info->hMainWnd, szAppName, szAppAuthors, hIcon); DestroyIcon(hIcon); diff --git a/base/applications/mscutils/servman/propsheet_depends.c b/base/applications/mscutils/servman/propsheet_depends.c index de1d6a55737..90e4e909f40 100644 --- a/base/applications/mscutils/servman/propsheet_depends.c +++ b/base/applications/mscutils/servman/propsheet_depends.c @@ -185,7 +185,6 @@ DependenciesPageProc(HWND hwndDlg, WPARAM wParam, LPARAM lParam) { - PDEPENDDATA pDependData; /* Get the window context */ diff --git a/base/applications/mscutils/servman/servman.c b/base/applications/mscutils/servman/servman.c index 1c893798b2d..ea6142fc765 100644 --- a/base/applications/mscutils/servman/servman.c +++ b/base/applications/mscutils/servman/servman.c @@ -27,7 +27,7 @@ wWinMain(HINSTANCE hThisInstance, MSG Msg; int Ret = 1; INITCOMMONCONTROLSEX icex; - + switch (GetUserDefaultUILanguage()) { case MAKELANGID(LANG_HEBREW, SUBLANG_DEFAULT): diff --git a/base/applications/mscutils/servman/stop.c b/base/applications/mscutils/servman/stop.c index c4a346dd003..b6844ad7a97 100644 --- a/base/applications/mscutils/servman/stop.c +++ b/base/applications/mscutils/servman/stop.c @@ -26,7 +26,7 @@ DoStopService(_In_z_ LPWSTR ServiceName, DWORD WaitTime; DWORD Timeout; DWORD dwResult = ERROR_SUCCESS; - + hSCManager = OpenSCManagerW(NULL, NULL, SC_MANAGER_CONNECT); @@ -113,7 +113,7 @@ DoStopService(_In_z_ LPWSTR ServiceName, } else { - dwResult = GetLastError(); + dwResult = GetLastError(); } CloseServiceHandle(hService); diff --git a/base/applications/mscutils/servman/stop_dependencies.c b/base/applications/mscutils/servman/stop_dependencies.c index 31588388dcd..da94ebbf414 100644 --- a/base/applications/mscutils/servman/stop_dependencies.c +++ b/base/applications/mscutils/servman/stop_dependencies.c @@ -14,7 +14,7 @@ typedef struct _STOP_DATA LPWSTR ServiceName; LPWSTR DisplayName; LPWSTR ServiceList; - + } STOP_DATA, *PSTOP_DATA; static LPWSTR @@ -250,7 +250,7 @@ InitDialog(HWND hDlg, AddServiceNamesToStop(hServiceListBox, (LPWSTR)StopData->ServiceList); } - + return bRet; } @@ -309,6 +309,6 @@ CreateStopDependsDialog(HWND hParent, (LPARAM)&StopData); if (Result == IDOK) return TRUE; - + return FALSE; } \ No newline at end of file
[View Less]
4 years, 7 months
1
0
0
0
[reactos] 02/02: [USETUP] Introduce two helpers for formatting displayed disk and partition sizes in order to reduce code duplication.
by Hermès Bélusca-Maïto
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=f1a4a6e70449f71f5e250…
commit f1a4a6e70449f71f5e250527a0e44c1f28022dd8 Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> AuthorDate: Sun Mar 3 17:03:59 2019 +0100 Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> CommitDate: Wed Nov 4 23:26:54 2020 +0100 [USETUP] Introduce two helpers for formatting displayed disk and partition sizes in order to reduce code duplication. --- base/
…
[View More]
setup/usetup/usetup.c | 165 ++++++++++++++++++--------------------------- 1 file changed, 67 insertions(+), 98 deletions(-) diff --git a/base/setup/usetup/usetup.c b/base/setup/usetup/usetup.c index 9b7cabb6324..01907778721 100644 --- a/base/setup/usetup/usetup.c +++ b/base/setup/usetup/usetup.c @@ -419,6 +419,66 @@ PopupError(PCCH Text, } +/** See also usetup:partlist.c!PrintDiskData() **/ +VOID +PrettifySize1( + IN OUT PULONGLONG Size, + OUT PCSTR* Unit) +{ + ULONGLONG DiskSize = *Size; + +#if 0 + if (DiskSize >= 10 * GB) /* 10 GB */ + { + DiskSize = DiskSize / GB; + *Unit = MUIGetString(STRING_GB); + } + else +#endif + { + DiskSize = DiskSize / MB; + if (DiskSize == 0) + DiskSize = 1; + + *Unit = MUIGetString(STRING_MB); + } + + *Size = DiskSize; +} + +/** See also usetup:partlist.c!PrintPartitionData() **/ +VOID +PrettifySize2( + IN OUT PULONGLONG Size, + OUT PCSTR* Unit) +{ + ULONGLONG PartSize = *Size; + +#if 0 + if (PartSize >= 10 * GB) /* 10 GB */ + { + PartSize = PartSize / GB; + *Unit = MUIGetString(STRING_GB); + } + else +#endif + if (PartSize >= 10 * MB) /* 10 MB */ + { + PartSize = PartSize / MB; + *Unit = MUIGetString(STRING_MB); + } + else + { + PartSize = PartSize / KB; + *Unit = MUIGetString(STRING_KB); + } + + // if (PartSize == 0) + // PartSize = 1; + *Size = PartSize; +} + + /* * Confirm quit setup * RETURNS @@ -2081,21 +2141,7 @@ CreatePrimaryPartitionPage(PINPUT_RECORD Ir) CONSOLE_SetTextXY(6, 8, MUIGetString(STRING_CHOOSENEWPARTITION)); DiskSize = DiskEntry->SectorCount.QuadPart * DiskEntry->BytesPerSector; -#if 0 - if (DiskSize >= 10 * GB) /* 10 GB */ - { - DiskSize = DiskSize / GB; - Unit = MUIGetString(STRING_GB); - } - else -#endif - { - DiskSize = DiskSize / MB; - if (DiskSize == 0) - DiskSize = 1; - - Unit = MUIGetString(STRING_MB); - } + PrettifySize1(&DiskSize, &Unit); if (DiskEntry->DriverName.Length > 0) { @@ -2243,21 +2289,7 @@ CreateExtendedPartitionPage(PINPUT_RECORD Ir) CONSOLE_SetTextXY(6, 8, MUIGetString(STRING_CHOOSE_NEW_EXTENDED_PARTITION)); DiskSize = DiskEntry->SectorCount.QuadPart * DiskEntry->BytesPerSector; -#if 0 - if (DiskSize >= 10 * GB) /* 10 GB */ - { - DiskSize = DiskSize / GB; - Unit = MUIGetString(STRING_GB); - } - else -#endif - { - DiskSize = DiskSize / MB; - if (DiskSize == 0) - DiskSize = 1; - - Unit = MUIGetString(STRING_MB); - } + PrettifySize1(&DiskSize, &Unit); if (DiskEntry->DriverName.Length > 0) { @@ -2404,21 +2436,7 @@ CreateLogicalPartitionPage(PINPUT_RECORD Ir) CONSOLE_SetTextXY(6, 8, MUIGetString(STRING_CHOOSE_NEW_LOGICAL_PARTITION)); DiskSize = DiskEntry->SectorCount.QuadPart * DiskEntry->BytesPerSector; -#if 0 - if (DiskSize >= 10 * GB) /* 10 GB */ - { - DiskSize = DiskSize / GB; - Unit = MUIGetString(STRING_GB); - } - else -#endif - { - DiskSize = DiskSize / MB; - if (DiskSize == 0) - DiskSize = 1; - - Unit = MUIGetString(STRING_MB); - } + PrettifySize1(&DiskSize, &Unit); if (DiskEntry->DriverName.Length > 0) { @@ -2606,24 +2624,7 @@ DeletePartitionPage(PINPUT_RECORD Ir) ARRAYSIZE(PartTypeString)); PartSize = PartEntry->SectorCount.QuadPart * DiskEntry->BytesPerSector; -#if 0 - if (PartSize >= 10 * GB) /* 10 GB */ - { - PartSize = PartSize / GB; - Unit = MUIGetString(STRING_GB); - } - else -#endif - if (PartSize >= 10 * MB) /* 10 MB */ - { - PartSize = PartSize / MB; - Unit = MUIGetString(STRING_MB); - } - else - { - PartSize = PartSize / KB; - Unit = MUIGetString(STRING_KB); - } + PrettifySize2(&PartSize, &Unit); if (*PartTypeString == '\0') // STRING_FORMATUNKNOWN ?? { @@ -2647,21 +2648,7 @@ DeletePartitionPage(PINPUT_RECORD Ir) } DiskSize = DiskEntry->SectorCount.QuadPart * DiskEntry->BytesPerSector; -#if 0 - if (DiskSize >= 10 * GB) /* 10 GB */ - { - DiskSize = DiskSize / GB; - Unit = MUIGetString(STRING_GB); - } - else -#endif - { - DiskSize = DiskSize / MB; - if (DiskSize == 0) - DiskSize = 1; - - Unit = MUIGetString(STRING_MB); - } + PrettifySize1(&DiskSize, &Unit); if (DiskEntry->DriverName.Length > 0) { @@ -3124,29 +3111,11 @@ SelectFileSystemPage(PINPUT_RECORD Ir) /* Adjust disk size */ DiskSize = DiskEntry->SectorCount.QuadPart * DiskEntry->BytesPerSector; - if (DiskSize >= 10 * GB) /* 10 GB */ - { - DiskSize = DiskSize / GB; - DiskUnit = MUIGetString(STRING_GB); - } - else - { - DiskSize = DiskSize / MB; - DiskUnit = MUIGetString(STRING_MB); - } + PrettifySize1(&DiskSize, &DiskUnit); /* Adjust partition size */ PartSize = PartEntry->SectorCount.QuadPart * DiskEntry->BytesPerSector; - if (PartSize >= 10 * GB) /* 10 GB */ - { - PartSize = PartSize / GB; - PartUnit = MUIGetString(STRING_GB); - } - else - { - PartSize = PartSize / MB; - PartUnit = MUIGetString(STRING_MB); - } + PrettifySize2(&PartSize, &PartUnit); /* Adjust partition type */ GetPartTypeStringFromPartitionType(PartEntry->PartitionType,
[View Less]
4 years, 7 months
1
0
0
0
[reactos] 01/02: [USETUP] Use pointers to const strings where meaningful.
by Hermès Bélusca-Maïto
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=13dd01b44cf30c9832254…
commit 13dd01b44cf30c983225469f4bc8724bfd884502 Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> AuthorDate: Wed Nov 4 23:20:03 2020 +0100 Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> CommitDate: Wed Nov 4 23:26:53 2020 +0100 [USETUP] Use pointers to const strings where meaningful. --- base/setup/usetup/mui.c | 2 +- base/setup/usetup/mui.h |
…
[View More]
10 +++++----- base/setup/usetup/partlist.c | 6 +++--- base/setup/usetup/usetup.c | 16 ++++++++-------- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/base/setup/usetup/mui.c b/base/setup/usetup/mui.c index e31b2c7e59d..d16caaa8800 100644 --- a/base/setup/usetup/mui.c +++ b/base/setup/usetup/mui.c @@ -226,7 +226,7 @@ MUIDisplayError( va_end(arg_ptr); } -LPSTR +PCSTR MUIGetString( ULONG Number) { diff --git a/base/setup/usetup/mui.h b/base/setup/usetup/mui.h index d7618ed56d3..13bedf61edd 100644 --- a/base/setup/usetup/mui.h +++ b/base/setup/usetup/mui.h @@ -4,15 +4,15 @@ typedef struct { SHORT X; SHORT Y; - LPCSTR Buffer; + PCSTR Buffer; DWORD Flags; INT TextID; } MUI_ENTRY, *PMUI_ENTRY; typedef struct { - LPCSTR ErrorText; - LPCSTR ErrorStatus; + PCSTR ErrorText; + PCSTR ErrorStatus; } MUI_ERROR; typedef struct @@ -24,7 +24,7 @@ typedef struct typedef struct { LONG Number; - LPSTR String; + PCSTR String; } MUI_STRING; typedef struct @@ -68,7 +68,7 @@ MUIDisplayError( VOID SetConsoleCodePage(VOID); -LPSTR +PCSTR MUIGetString( ULONG Number); diff --git a/base/setup/usetup/partlist.c b/base/setup/usetup/partlist.c index c35ffed1a42..f62b75b0595 100644 --- a/base/setup/usetup/partlist.c +++ b/base/setup/usetup/partlist.c @@ -172,10 +172,10 @@ PrintPartitionData( USHORT Width; USHORT Height; LARGE_INTEGER PartSize; - PCHAR Unit; + PCSTR Unit; UCHAR Attribute; CHAR PartTypeString[32]; - PCHAR PartType = PartTypeString; + PCSTR PartType = PartTypeString; Width = ListUi->Right - ListUi->Left - 1; Height = ListUi->Bottom - ListUi->Top - 2; @@ -308,7 +308,7 @@ PrintDiskData( USHORT Width; USHORT Height; ULARGE_INTEGER DiskSize; - PCHAR Unit; + PCSTR Unit; Width = ListUi->Right - ListUi->Left - 1; Height = ListUi->Bottom - ListUi->Top - 2; diff --git a/base/setup/usetup/usetup.c b/base/setup/usetup/usetup.c index b4956d1be46..9b7cabb6324 100644 --- a/base/setup/usetup/usetup.c +++ b/base/setup/usetup/usetup.c @@ -144,9 +144,9 @@ DoWatchDestFileName(LPCWSTR FileName) /* FUNCTIONS ****************************************************************/ static VOID -PrintString(char* fmt,...) +PrintString(IN PCSTR fmt,...) { - char buffer[512]; + CHAR buffer[512]; va_list ap; UNICODE_STRING UnicodeString; ANSI_STRING AnsiString; @@ -2065,7 +2065,7 @@ CreatePrimaryPartitionPage(PINPUT_RECORD Ir) ULONGLONG PartSize; ULONGLONG DiskSize; ULONGLONG SectorCount; - PCHAR Unit; + PCSTR Unit; if (PartitionList == NULL || CurrentPartition == NULL) { @@ -2227,7 +2227,7 @@ CreateExtendedPartitionPage(PINPUT_RECORD Ir) ULONGLONG PartSize; ULONGLONG DiskSize; ULONGLONG SectorCount; - PCHAR Unit; + PCSTR Unit; if (PartitionList == NULL || CurrentPartition == NULL) { @@ -2388,7 +2388,7 @@ CreateLogicalPartitionPage(PINPUT_RECORD Ir) ULONGLONG PartSize; ULONGLONG DiskSize; ULONGLONG SectorCount; - PCHAR Unit; + PCSTR Unit; if (PartitionList == NULL || CurrentPartition == NULL) { @@ -2586,7 +2586,7 @@ DeletePartitionPage(PINPUT_RECORD Ir) PDISKENTRY DiskEntry; ULONGLONG DiskSize; ULONGLONG PartSize; - PCHAR Unit; + PCSTR Unit; CHAR PartTypeString[32]; if (PartitionList == NULL || CurrentPartition == NULL) @@ -2757,8 +2757,8 @@ SelectFileSystemPage(PINPUT_RECORD Ir) PDISKENTRY DiskEntry; ULONGLONG DiskSize; ULONGLONG PartSize; - PCHAR DiskUnit; - PCHAR PartUnit; + PCSTR DiskUnit; + PCSTR PartUnit; CHAR PartTypeString[32]; FORMATMACHINESTATE PreviousFormatState; PCWSTR DefaultFs;
[View Less]
4 years, 7 months
1
0
0
0
[reactos] 01/01: [PC98VID] Fix build for PC-98 target (#3352)
by Dmitry Borisov
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=4dc3125450a253736acfc…
commit 4dc3125450a253736acfc6786ef4743fdbef2c5e Author: Dmitry Borisov <di.sean(a)protonmail.com> AuthorDate: Thu Nov 5 03:26:37 2020 +0600 Commit: GitHub <noreply(a)github.com> CommitDate: Thu Nov 5 00:26:37 2020 +0300 [PC98VID] Fix build for PC-98 target (#3352) - Some prototypes are not needed anymore. Addendum to 5c7ce4475e246560d1622b8cc60dc603e3955f66. --- win32ss/
…
[View More]
drivers/miniport/pc98vid/ioctl.c | 8 +++ win32ss/drivers/miniport/pc98vid/pc98vid.c | 3 ++ win32ss/drivers/miniport/pc98vid/pc98vid.h | 79 +----------------------------- 3 files changed, 12 insertions(+), 78 deletions(-) diff --git a/win32ss/drivers/miniport/pc98vid/ioctl.c b/win32ss/drivers/miniport/pc98vid/ioctl.c index 23bc2c6c6be..d89a17510cd 100644 --- a/win32ss/drivers/miniport/pc98vid/ioctl.c +++ b/win32ss/drivers/miniport/pc98vid/ioctl.c @@ -11,6 +11,7 @@ /* FUNCTIONS ******************************************************************/ +static CODE_SEG("PAGE") VOID FASTCALL @@ -43,6 +44,7 @@ Pc98VidQueryMode( VIDEO_MODE_PALETTE_DRIVEN | VIDEO_MODE_MANAGED_PALETTE; } +static CODE_SEG("PAGE") VP_STATUS FASTCALL @@ -70,6 +72,7 @@ Pc98VidQueryAvailModes( return NO_ERROR; } +static CODE_SEG("PAGE") VP_STATUS FASTCALL @@ -90,6 +93,7 @@ Pc98VidQueryNumAvailModes( return NO_ERROR; } +static CODE_SEG("PAGE") VP_STATUS FASTCALL @@ -110,6 +114,7 @@ Pc98VidQueryCurrentMode( return NO_ERROR; } +static CODE_SEG("PAGE") VP_STATUS FASTCALL @@ -150,6 +155,7 @@ Pc98VidMapVideoMemory( return Status; } +static CODE_SEG("PAGE") VP_STATUS FASTCALL @@ -166,6 +172,7 @@ Pc98VidUnmapVideoMemory( NULL); } +static CODE_SEG("PAGE") VP_STATUS FASTCALL @@ -178,6 +185,7 @@ Pc98VidResetDevice(VOID) return NO_ERROR; } +static CODE_SEG("PAGE") VP_STATUS FASTCALL diff --git a/win32ss/drivers/miniport/pc98vid/pc98vid.c b/win32ss/drivers/miniport/pc98vid/pc98vid.c index 716a760acb9..485cd1a0120 100644 --- a/win32ss/drivers/miniport/pc98vid/pc98vid.c +++ b/win32ss/drivers/miniport/pc98vid/pc98vid.c @@ -45,6 +45,7 @@ static VIDEO_ACCESS_RANGE LegacyRangeList[] = /* FUNCTIONS ******************************************************************/ +static CODE_SEG("PAGE") VP_STATUS NTAPI @@ -138,6 +139,7 @@ Pc98VidFindAdapter( return NO_ERROR; } +static CODE_SEG("PAGE") BOOLEAN NTAPI @@ -156,6 +158,7 @@ Pc98VidInitialize( return TRUE; } +static CODE_SEG("PAGE") VP_STATUS NTAPI diff --git a/win32ss/drivers/miniport/pc98vid/pc98vid.h b/win32ss/drivers/miniport/pc98vid/pc98vid.h index fd2d8e29b05..75cb4402c26 100644 --- a/win32ss/drivers/miniport/pc98vid/pc98vid.h +++ b/win32ss/drivers/miniport/pc98vid/pc98vid.h @@ -9,6 +9,7 @@ #define _PC98VID_PCH_ #include <ntdef.h> +#include <section_attribs.h> #include <dderror.h> #include <devioctl.h> #include <miniport.h> @@ -48,106 +49,28 @@ typedef struct _HW_DEVICE_EXTENSION ULONG FrameBufferLength; } HW_DEVICE_EXTENSION, *PHW_DEVICE_EXTENSION; -VP_STATUS -NTAPI -Pc98VidFindAdapter( - _In_ PVOID HwDeviceExtension, - _In_opt_ PVOID HwContext, - _In_opt_ PWSTR ArgumentString, - _Inout_ PVIDEO_PORT_CONFIG_INFO ConfigInfo, - _Out_ PUCHAR Again); - BOOLEAN NTAPI HasPegcController( _In_ PHW_DEVICE_EXTENSION DeviceExtension); -BOOLEAN -NTAPI -Pc98VidInitialize( - _In_ PVOID HwDeviceExtension); - -VP_STATUS -NTAPI -Pc98VidGetVideoChildDescriptor( - _In_ PVOID HwDeviceExtension, - _In_ PVIDEO_CHILD_ENUM_INFO ChildEnumInfo, - _Out_ PVIDEO_CHILD_TYPE VideoChildType, - _Out_ PUCHAR pChildDescriptor, - _Out_ PULONG UId, - _Out_ PULONG pUnused); - BOOLEAN NTAPI Pc98VidStartIO( _In_ PVOID HwDeviceExtension, _Inout_ PVIDEO_REQUEST_PACKET RequestPacket); -VOID -FASTCALL -Pc98VidQueryMode( - _In_ PHW_DEVICE_EXTENSION DeviceExtension, - _In_ ULONG ModeNumber, - _Out_ PVIDEO_MODE_INFORMATION VideoMode); - -VP_STATUS -FASTCALL -Pc98VidQueryAvailModes( - _In_ PHW_DEVICE_EXTENSION DeviceExtension, - _Out_ PVIDEO_MODE_INFORMATION ModeInformation, - _Out_ PSTATUS_BLOCK StatusBlock); - -VP_STATUS -FASTCALL -Pc98VidQueryNumAvailModes( - _In_ PHW_DEVICE_EXTENSION DeviceExtension, - _Out_ PVIDEO_NUM_MODES Modes, - _Out_ PSTATUS_BLOCK StatusBlock); - VP_STATUS FASTCALL Pc98VidSetCurrentMode( _In_ PHW_DEVICE_EXTENSION DeviceExtension, _In_ PVIDEO_MODE RequestedMode); -VP_STATUS -FASTCALL -Pc98VidQueryCurrentMode( - _In_ PHW_DEVICE_EXTENSION DeviceExtension, - _Out_ PVIDEO_MODE_INFORMATION VideoMode, - _Out_ PSTATUS_BLOCK StatusBlock); - -VP_STATUS -FASTCALL -Pc98VidMapVideoMemory( - _In_ PHW_DEVICE_EXTENSION DeviceExtension, - _In_ PVIDEO_MEMORY RequestedAddress, - _Out_ PVIDEO_MEMORY_INFORMATION MapInformation, - _Out_ PSTATUS_BLOCK StatusBlock); - -VP_STATUS -FASTCALL -Pc98VidUnmapVideoMemory( - _In_ PHW_DEVICE_EXTENSION DeviceExtension, - _In_ PVIDEO_MEMORY VideoMemory); - -VP_STATUS -FASTCALL -Pc98VidResetDevice(VOID); - VP_STATUS FASTCALL Pc98VidSetColorRegisters( _In_ PVIDEO_CLUT ColorLookUpTable); -VP_STATUS -FASTCALL -Pc98VidGetChildState( - _In_ PHW_DEVICE_EXTENSION DeviceExtension, - _In_ PULONG ChildIndex, - _Out_ PULONG ChildState, - _Out_ PSTATUS_BLOCK StatusBlock); - VP_STATUS NTAPI Pc98VidGetPowerState(
[View Less]
4 years, 7 months
1
0
0
0
← Newer
1
...
10
11
12
13
14
15
16
17
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Results per page:
10
25
50
100
200