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
November 2023
----- 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
20 participants
274 discussions
Start a n
N
ew thread
[reactos] 01/02: [CRT][MSVCRT] Implement _CrtDbgReport(W)V and redefine _CrtDbgReport(W) around those (#5678)
by Hermès Bélusca-Maïto
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=f49e213943a510044bd4b…
commit f49e213943a510044bd4b8ff9c0a21a868a6195a Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> AuthorDate: Sun Sep 10 19:08:07 2023 +0200 Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> CommitDate: Tue Nov 14 12:23:51 2023 +0100 [CRT][MSVCRT] Implement _CrtDbgReport(W)V and redefine _CrtDbgReport(W) around those (#5678) Also add the internal _VCrtDbgReportA and _VCrtDbgReportW functions listed in
https://learn.microsoft.com/en-us/cpp/c-runtime-library/internal-crt-global…
CORE-11835, CORE-15517 --- dll/win32/msvcrt/msvcrt.spec | 4 +- sdk/include/crt/crtdbg.h | 4 ++ sdk/lib/atl/atltrace.h | 15 ++------ sdk/lib/crt/misc/dbgrpt.cpp | 89 +++++++++++++++++++++++++++++++++++++++----- 4 files changed, 89 insertions(+), 23 deletions(-) diff --git a/dll/win32/msvcrt/msvcrt.spec b/dll/win32/msvcrt/msvcrt.spec index 6a7b5372c51..0cd58fe0fd0 100644 --- a/dll/win32/msvcrt/msvcrt.spec +++ b/dll/win32/msvcrt/msvcrt.spec @@ -200,9 +200,9 @@ @ stub -version=0x600+ _CrtCheckMemory @ stub -version=0x600+ _CrtDbgBreak @ cdecl -version=0x600+ _CrtDbgReport(long str long str str) -@ stub -version=0x600+ _CrtDbgReportV +@ cdecl -version=0x600+ _CrtDbgReportV(long str long str str ptr) @ cdecl -version=0x600+ _CrtDbgReportW(long wstr long wstr wstr) -@ stub -version=0x600+ _CrtDbgReportWV +@ cdecl -version=0x600+ _CrtDbgReportWV(long wstr long wstr wstr ptr) @ stub -version=0x600+ _CrtDoForAllClientObjects @ stub -version=0x600+ _CrtDumpMemoryLeaks @ stub -version=0x600+ _CrtIsMemoryBlock diff --git a/sdk/include/crt/crtdbg.h b/sdk/include/crt/crtdbg.h index f9545698e89..13c16f66f50 100644 --- a/sdk/include/crt/crtdbg.h +++ b/sdk/include/crt/crtdbg.h @@ -81,6 +81,7 @@ extern "C" { size_t lTotalCount; } _CrtMemState; + // Debug reporting functions #ifdef _DEBUG @@ -88,6 +89,9 @@ extern "C" { int __cdecl _CrtDbgReport(int reportType, const char *filename, int linenumber, const char *moduleName, const char *format, ...); int __cdecl _CrtDbgReportW(int reportType, const wchar_t *filename, int linenumber, const wchar_t *moduleName, const wchar_t *format, ...); + int __cdecl _CrtDbgReportV(int reportType, const char *filename, int linenumber, const char *moduleName, const char *format, va_list arglist); + int __cdecl _CrtDbgReportWV(int reportType, const wchar_t *filename, int linenumber, const wchar_t *moduleName, const wchar_t *format, va_list arglist); + #endif diff --git a/sdk/lib/atl/atltrace.h b/sdk/lib/atl/atltrace.h index 6230af9f1fc..fcd81faad6e 100644 --- a/sdk/lib/atl/atltrace.h +++ b/sdk/lib/atl/atltrace.h @@ -9,18 +9,11 @@ #include "atldef.h" -#if DBG // FIXME: We should use _DEBUG instead of DBG. CORE-17505 +#ifdef _DEBUG #include <stdio.h> #include <crtdbg.h> -extern "C" -{ -// FIXME: Enabling _DEBUG at top level causes assertion failures... CORE-17505 -int __cdecl _CrtDbgReport(int reportType, const char *filename, int linenumber, const char *moduleName, const char *format, ...); -int __cdecl _CrtDbgReportW(int reportType, const wchar_t *filename, int linenumber, const wchar_t *moduleName, const wchar_t *format, ...); -} - namespace ATL { @@ -267,10 +260,10 @@ AtlTrace(_In_z_ _Printf_format_string_ const X_CHAR *format, ...) } // namespace ATL -#endif // DBG +#endif // _DEBUG #ifndef ATLTRACE - #if DBG // FIXME: We should use _DEBUG instead of DBG. CORE-17505 + #ifdef _DEBUG #define ATLTRACE(format, ...) ATL::AtlTraceEx(__FILE__, __LINE__, format, ##__VA_ARGS__) #else #define ATLTRACE(format, ...) ((void)0) @@ -279,7 +272,7 @@ AtlTrace(_In_z_ _Printf_format_string_ const X_CHAR *format, ...) #define ATLTRACE2 ATLTRACE -#if DBG // FIXME: We should use _DEBUG instead of DBG. CORE-17505 +#ifdef _DEBUG #define ATLTRACENOTIMPL(funcname) do { \ ATLTRACE(atlTraceNotImpl, 0, #funcname " is not implemented.\n"); \ return E_NOTIMPL; \ diff --git a/sdk/lib/crt/misc/dbgrpt.cpp b/sdk/lib/crt/misc/dbgrpt.cpp index 131a918a2e2..51c55af9b4c 100644 --- a/sdk/lib/crt/misc/dbgrpt.cpp +++ b/sdk/lib/crt/misc/dbgrpt.cpp @@ -309,7 +309,14 @@ static int _CrtHandleDbgReport(int reportType, const char_t* szCompleteMessage, EXTERN_C -int __cdecl _CrtDbgReport(int reportType, const char *filename, int linenumber, const char *moduleName, const char *format, ...) +int __cdecl +_VCrtDbgReportA( + int reportType, + const char *filename, + int linenumber, + const char *moduleName, + const char *format, + va_list arglist) { char szFormatted[DBGRPT_MAX_BUFFER_SIZE+1] = {0}; // The user provided message char szCompleteMessage[(DBGRPT_MAX_BUFFER_SIZE+1)*2] = {0}; // The output for debug / file @@ -325,11 +332,7 @@ int __cdecl _CrtDbgReport(int reportType, const char *filename, int linenumber, if (format) { - va_list arglist; - va_start(arglist, format); int len = _vsnprintf(szFormatted, DBGRPT_MAX_BUFFER_SIZE - 2 - sizeof(DBGRPT_ASSERT_PREFIX_MESSAGE), format, arglist); - va_end(arglist); - if (len < 0) { strcpy(szFormatted, DBGRPT_STRING_TOO_LONG); @@ -361,7 +364,14 @@ int __cdecl _CrtDbgReport(int reportType, const char *filename, int linenumber, } EXTERN_C -int __cdecl _CrtDbgReportW(int reportType, const wchar_t *filename, int linenumber, const wchar_t *moduleName, const wchar_t *format, ...) +int __cdecl +_VCrtDbgReportW( + int reportType, + const wchar_t *filename, + int linenumber, + const wchar_t *moduleName, + const wchar_t *format, + va_list arglist) { wchar_t szFormatted[DBGRPT_MAX_BUFFER_SIZE+1] = {0}; // The user provided message wchar_t szCompleteMessage[(DBGRPT_MAX_BUFFER_SIZE+1)*2] = {0}; // The output for debug / file @@ -377,11 +387,7 @@ int __cdecl _CrtDbgReportW(int reportType, const wchar_t *filename, int linenumb if (format) { - va_list arglist; - va_start(arglist, format); int len = _vsnwprintf(szFormatted, DBGRPT_MAX_BUFFER_SIZE - 2 - sizeof(DBGRPT_ASSERT_PREFIX_MESSAGE), format, arglist); - va_end(arglist); - if (len < 0) { wcscpy(szFormatted, _CRT_WIDE(DBGRPT_STRING_TOO_LONG)); @@ -412,5 +418,68 @@ int __cdecl _CrtDbgReportW(int reportType, const wchar_t *filename, int linenumb return nResult; } +EXTERN_C +int __cdecl +_CrtDbgReportV( + int reportType, + const char *filename, + int linenumber, + const char *moduleName, + const char *format, + va_list arglist) +{ + return _VCrtDbgReportA(reportType, filename, linenumber, moduleName, format, arglist); +} + +EXTERN_C +int __cdecl +_CrtDbgReportWV( + int reportType, + const wchar_t *filename, + int linenumber, + const wchar_t *moduleName, + const wchar_t *format, + va_list arglist) +{ + return _VCrtDbgReportW(reportType, filename, linenumber, moduleName, format, arglist); +} + +EXTERN_C +int __cdecl +_CrtDbgReport( + int reportType, + const char *filename, + int linenumber, + const char *moduleName, + const char *format, + ...) +{ + va_list arglist; + int result; + + va_start(arglist, format); + result = _VCrtDbgReportA(reportType, filename, linenumber, moduleName, format, arglist); + va_end(arglist); + return result; +} + +EXTERN_C +int __cdecl +_CrtDbgReportW( + int reportType, + const wchar_t *filename, + int linenumber, + const wchar_t *moduleName, + const wchar_t *format, + ...) +{ + va_list arglist; + int result; + + va_start(arglist, format); + result = _VCrtDbgReportW(reportType, filename, linenumber, moduleName, format, arglist); + va_end(arglist); + return result; +} //#endif // _DEBUG
1 year, 1 month
1
0
0
0
[reactos] 01/01: [WIN32KNT_APITEST] w32knapi.c: Update dll name (#5977)
by Serge Gautherie
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=7901a4c8fef4db23e4466…
commit 7901a4c8fef4db23e4466a466ebf6ae1debc37ce Author: Serge Gautherie <32623169+SergeGautherie(a)users.noreply.github.com> AuthorDate: Tue Nov 14 12:14:39 2023 +0100 Commit: GitHub <noreply(a)github.com> CommitDate: Tue Nov 14 12:14:39 2023 +0100 [WIN32KNT_APITEST] w32knapi.c: Update dll name (#5977) Addendum to commits 7ad21a4 (r70458) and bed6d00 (r76026). --- modules/rostests/apitests/win32nt/w32knapi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/rostests/apitests/win32nt/w32knapi.c b/modules/rostests/apitests/win32nt/w32knapi.c index 037d88ee2f7..a4a854fe6f6 100644 --- a/modules/rostests/apitests/win32nt/w32knapi.c +++ b/modules/rostests/apitests/win32nt/w32knapi.c @@ -127,10 +127,10 @@ WinMain(HINSTANCE hInstance, InitOsVersion(); printf("g_OsIdx = %d\n", g_OsIdx); - g_hModule = LoadLibraryW(L"w32kdll.dll"); + g_hModule = LoadLibraryW(L"win32u.dll"); if (!g_hModule) { - printf("w32kdll.dll not found!\n"); + printf("win32u.dll not found!\n"); return -1; }
1 year, 1 month
1
0
0
0
[reactos] 01/01: [NTOS:EX][CSRSRV][WIN32K] Make a few #define more explicit/strict (#5907)
by Serge Gautherie
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=3fb5957de14da885a1632…
commit 3fb5957de14da885a16324fca028d9f0ea7fdf37 Author: Serge Gautherie <32623169+SergeGautherie(a)users.noreply.github.com> AuthorDate: Mon Nov 13 20:55:48 2023 +0100 Commit: GitHub <noreply(a)github.com> CommitDate: Mon Nov 13 20:55:48 2023 +0100 [NTOS:EX][CSRSRV][WIN32K] Make a few #define more explicit/strict (#5907) - Add parentheses around macro parameters. - Add casts on return value for the Interlocked*UL ("Unsigned Long") macros. --- ntoskrnl/include/internal/ex.h | 16 ++++++++-------- subsystems/csr/csrsrv/srv.h | 8 ++++---- win32ss/pch.h | 9 +++++---- 3 files changed, 17 insertions(+), 16 deletions(-) diff --git a/ntoskrnl/include/internal/ex.h b/ntoskrnl/include/internal/ex.h index f80cc7f8efd..50dde0cbfc8 100644 --- a/ntoskrnl/include/internal/ex.h +++ b/ntoskrnl/include/internal/ex.h @@ -79,9 +79,9 @@ VOID NTAPI ExpDebuggerWorker(IN PVOID Context); #define HANDLE_LOW_BITS (PAGE_SHIFT - 3) #define HANDLE_HIGH_BITS (PAGE_SHIFT - 2) #endif -#define HANDLE_TAG_BITS (2) -#define HANDLE_INDEX_BITS (HANDLE_LOW_BITS + 2*HANDLE_HIGH_BITS) -#define KERNEL_FLAG_BITS (sizeof(PVOID)*8 - HANDLE_INDEX_BITS - HANDLE_TAG_BITS) +#define HANDLE_TAG_BITS 2 +#define HANDLE_INDEX_BITS (HANDLE_LOW_BITS + 2 * HANDLE_HIGH_BITS) +#define KERNEL_FLAG_BITS (sizeof(ULONG_PTR) * 8 - HANDLE_INDEX_BITS - HANDLE_TAG_BITS) typedef union _EXHANDLE { @@ -160,9 +160,9 @@ typedef struct _HARDERROR_USER_PARAMETERS #define MAX_MID_INDEX (MID_LEVEL_ENTRIES * LOW_LEVEL_ENTRIES) #define MAX_HIGH_INDEX (MID_LEVEL_ENTRIES * MID_LEVEL_ENTRIES * LOW_LEVEL_ENTRIES) -#define ExpChangeRundown(x, y, z) (ULONG_PTR)InterlockedCompareExchangePointer(&x->Ptr, (PVOID)y, (PVOID)z) -#define ExpChangePushlock(x, y, z) InterlockedCompareExchangePointer((PVOID*)x, (PVOID)y, (PVOID)z) -#define ExpSetRundown(x, y) InterlockedExchangePointer(&x->Ptr, (PVOID)y) +#define ExpChangeRundown(x, y, z) (ULONG_PTR)InterlockedCompareExchangePointer(&(x)->Ptr, (PVOID)(y), (PVOID)(z)) +#define ExpChangePushlock(x, y, z) InterlockedCompareExchangePointer((PVOID*)(x), (PVOID)(y), (PVOID)(z)) +#define ExpSetRundown(x, y) InterlockedExchangePointer(&(x)->Ptr, (PVOID)(y)) NTSTATUS NTAPI @@ -1541,10 +1541,10 @@ XIPInit( #ifdef _WIN64 #define InterlockedExchangeSizeT(Target, Value) \ - (SIZE_T)InterlockedExchange64((PLONG64)Target, (LONG64)Value) + (SIZE_T)InterlockedExchange64((PLONG64)(Target), (LONG64)(Value)) #else #define InterlockedExchangeSizeT(Target, Value) \ - (SIZE_T)InterlockedExchange((PLONG)Target, (LONG)Value) + (SIZE_T)InterlockedExchange((PLONG)(Target), (LONG)(Value)) #endif #define ExfInterlockedCompareExchange64UL(Destination, Exchange, Comperand) \ diff --git a/subsystems/csr/csrsrv/srv.h b/subsystems/csr/csrsrv/srv.h index d99c9633479..69ff83adbab 100644 --- a/subsystems/csr/csrsrv/srv.h +++ b/subsystems/csr/csrsrv/srv.h @@ -48,9 +48,9 @@ #define CSR_PORT_NAME L"ApiPort" #define UNICODE_PATH_SEP L"\\" -#define ROUND_UP(n, align) ROUND_DOWN(((ULONG)n) + (align) - 1, (align)) -#define ROUND_DOWN(n, align) (((ULONG)n) & ~((align) - 1l)) -#define InterlockedIncrementUL(Value) _InterlockedIncrement((PLONG)Value) -#define InterlockedDecrementUL(Value) _InterlockedDecrement((PLONG)Value) +#define ROUND_UP(n, align) ROUND_DOWN(((ULONG)(n)) + (align) - 1, (align)) +#define ROUND_DOWN(n, align) (((ULONG)(n)) & ~((align) - 1l)) +#define InterlockedIncrementUL(Value) (ULONG)_InterlockedIncrement((PLONG)(Value)) +#define InterlockedDecrementUL(Value) (ULONG)_InterlockedDecrement((PLONG)(Value)) #endif /* _SRV_H */ diff --git a/win32ss/pch.h b/win32ss/pch.h index 31bf7246d8b..d72708658f0 100644 --- a/win32ss/pch.h +++ b/win32ss/pch.h @@ -1,5 +1,3 @@ -#ifndef __W32K_H -#define __W32K_H /* * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS Win32k subsystem @@ -8,6 +6,9 @@ * PROGRAMMER: Alex Ionescu (alex(a)relsoft.net) */ +#ifndef __W32K_H +#define __W32K_H + /* INCLUDES ******************************************************************/ #define _NO_COM @@ -103,8 +104,8 @@ extern "C" { #include <ft2build.h> #include FT_FREETYPE_H -#define InterlockedIncrementUL(Value) InterlockedIncrement((PLONG)Value) -#define InterlockedDecrementUL(Value) InterlockedDecrement((PLONG)Value) +#define InterlockedIncrementUL(Value) (ULONG)InterlockedIncrement((PLONG)(Value)) +#define InterlockedDecrementUL(Value) (ULONG)InterlockedDecrement((PLONG)(Value)) /* Internal Win32K header */ #include "win32kp.h"
1 year, 1 month
1
0
0
0
[reactos] 01/01: [NETSHELL] Display component icons in list (#5904)
by Whindmar Saksit
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=e07dbf782c65fdedfeada…
commit e07dbf782c65fdedfeada94f55814fcfbb6e34ce Author: Whindmar Saksit <whindsaks(a)proton.me> AuthorDate: Mon Nov 13 20:51:52 2023 +0100 Commit: GitHub <noreply(a)github.com> CommitDate: Mon Nov 13 20:51:52 2023 +0100 [NETSHELL] Display component icons in list (#5904) Display the class icons for the installed network components. Also fixes a bug where the selection change whacked the checkbox of the first item. Use 0x7fffffff to append the item at the end of the list, as optimization. --- dll/shellext/netshell/lanconnectui.cpp | 44 ++++++++++++++++++++++------------ dll/shellext/netshell/lanconnectui.h | 2 +- 2 files changed, 30 insertions(+), 16 deletions(-) diff --git a/dll/shellext/netshell/lanconnectui.cpp b/dll/shellext/netshell/lanconnectui.cpp index d0c5b0b2e28..70b72549171 100644 --- a/dll/shellext/netshell/lanconnectui.cpp +++ b/dll/shellext/netshell/lanconnectui.cpp @@ -26,15 +26,16 @@ CNetConnectionPropertyUi::~CNetConnectionPropertyUi() } VOID -AddItemToListView(HWND hDlgCtrl, PNET_ITEM pItem, LPWSTR szName, BOOL bChecked) +AddItemToListView(HWND hDlgCtrl, PNET_ITEM pItem, LPWSTR szName, BOOL bChecked, UINT Image) { LVITEMW lvItem; - ZeroMemory(&lvItem, sizeof(lvItem)); - lvItem.mask = LVIF_TEXT | LVIF_PARAM; + lvItem.mask = LVIF_TEXT | LVIF_PARAM | LVIF_IMAGE; lvItem.pszText = szName; lvItem.lParam = (LPARAM)pItem; - lvItem.iItem = ListView_GetItemCount(hDlgCtrl); + lvItem.iImage = Image; + lvItem.iItem = 0x7fffffff; // Append at the end of the list. + lvItem.iSubItem = 0; lvItem.iItem = SendMessageW(hDlgCtrl, LVM_INSERTITEMW, 0, (LPARAM)&lvItem); ListView_SetCheckState(hDlgCtrl, lvItem.iItem, bChecked); } @@ -73,7 +74,7 @@ CNetConnectionPropertyUi::GetINetCfgComponent(INetCfg *pNCfg, INetCfgComponent * } VOID -CNetConnectionPropertyUi::EnumComponents(HWND hDlgCtrl, INetCfg *pNCfg, const GUID *CompGuid, UINT Type) +CNetConnectionPropertyUi::EnumComponents(HWND hDlgCtrl, INetCfg *pNCfg, const GUID *CompGuid, UINT Type, PSP_CLASSIMAGELIST_DATA pCILD) { HRESULT hr; CComPtr<IEnumNetCfgComponent> pENetCfg; @@ -127,7 +128,10 @@ CNetConnectionPropertyUi::EnumComponents(HWND hDlgCtrl, INetCfg *pNCfg, const GU pItem->pNCfgComp = pNCfgComp.Detach(); pItem->NumPropDialogOpen = 0; - AddItemToListView(hDlgCtrl, pItem, pDisplayName, bChecked); + INT image; + if (!pCILD->ImageList || !SetupDiGetClassImageIndex(pCILD, CompGuid, &image)) + image = I_IMAGENONE; + AddItemToListView(hDlgCtrl, pItem, pDisplayName, bChecked, image); CoTaskMemFree(pDisplayName); } } @@ -143,7 +147,6 @@ CNetConnectionPropertyUi::InitializeLANPropertiesUIDlg(HWND hwndDlg) RECT rc; DWORD dwStyle; LPWSTR pDisplayName; - LVITEMW li; SendDlgItemMessageW(hwndDlg, IDC_NETCARDNAME, WM_SETTEXT, 0, (LPARAM)m_pProperties->pszwDeviceName); if (m_pProperties->dwCharacter & NCCF_SHOW_ICON) @@ -193,15 +196,26 @@ CNetConnectionPropertyUi::InitializeLANPropertiesUIDlg(HWND hwndDlg) m_pNCfg = pNCfg; m_NCfgLock = pNCfgLock; - EnumComponents(hDlgCtrl, pNCfg, &GUID_DEVCLASS_NETCLIENT, NET_TYPE_CLIENT); - EnumComponents(hDlgCtrl, pNCfg, &GUID_DEVCLASS_NETSERVICE, NET_TYPE_SERVICE); - EnumComponents(hDlgCtrl, pNCfg, &GUID_DEVCLASS_NETTRANS, NET_TYPE_PROTOCOL); + SP_CLASSIMAGELIST_DATA spcid; + spcid.cbSize = sizeof(spcid); + if (SetupDiGetClassImageList(&spcid)) + { + HIMAGELIST hIL = ImageList_Duplicate(spcid.ImageList); + ListView_SetImageList(hDlgCtrl, hIL, LVSIL_SMALL); + } + else + { + spcid.ImageList = NULL; + } + + EnumComponents(hDlgCtrl, pNCfg, &GUID_DEVCLASS_NETCLIENT, NET_TYPE_CLIENT, &spcid); + EnumComponents(hDlgCtrl, pNCfg, &GUID_DEVCLASS_NETSERVICE, NET_TYPE_SERVICE, &spcid); + EnumComponents(hDlgCtrl, pNCfg, &GUID_DEVCLASS_NETTRANS, NET_TYPE_PROTOCOL, &spcid); + + if (spcid.ImageList) + SetupDiDestroyClassImageList(&spcid); - ZeroMemory(&li, sizeof(li)); - li.mask = LVIF_STATE; - li.stateMask = (UINT)-1; - li.state = LVIS_FOCUSED|LVIS_SELECTED; - (void)SendMessageW(hDlgCtrl, LVM_SETITEMW, 0, (LPARAM)&li); + ListView_SetItemState(hDlgCtrl, 0, -1, LVIS_FOCUSED | LVIS_SELECTED); } VOID diff --git a/dll/shellext/netshell/lanconnectui.h b/dll/shellext/netshell/lanconnectui.h index 0dd7fdc0384..964435b05fe 100644 --- a/dll/shellext/netshell/lanconnectui.h +++ b/dll/shellext/netshell/lanconnectui.h @@ -44,7 +44,7 @@ class CNetConnectionPropertyUi: private: BOOL GetINetCfgComponent(INetCfg *pNCfg, INetCfgComponent ** pOut); - VOID EnumComponents(HWND hDlgCtrl, INetCfg *pNCfg, const GUID *CompGuid, UINT Type); + VOID EnumComponents(HWND hDlgCtrl, INetCfg *pNCfg, const GUID *CompGuid, UINT Type, PSP_CLASSIMAGELIST_DATA pCILD); VOID InitializeLANPropertiesUIDlg(HWND hwndDlg); VOID ShowNetworkComponentProperties(HWND hwndDlg); BOOL GetDeviceInstanceID(OUT LPOLESTR *DeviceInstanceID);
1 year, 1 month
1
0
0
0
[reactos] 01/01: [FREELDR] Implement NOSERIALMICE and FASTDETECT options (#5886)
by Dmitry Borisov
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=8d7153c8ba5babb42e336…
commit 8d7153c8ba5babb42e336302c4995e81a311ae46 Author: Dmitry Borisov <di.sean(a)protonmail.com> AuthorDate: Sun Nov 5 14:23:43 2023 +0600 Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> CommitDate: Mon Nov 13 19:49:41 2023 +0100 [FREELDR] Implement NOSERIALMICE and FASTDETECT options (#5886) Enable FASTDETECT by default, as done in NT 5+. This is because the serial mouse is recognized by the serial stack since NT 5.x. --- base/setup/lib/bootsup.c | 2 +- boot/bootdata/livecd.ini | 14 ++--- boot/bootdata/txtsetup.sif | 2 +- boot/freeldr/freeldr/arch/i386/pc/machpc.c | 71 ++++++++++++++++++++++++-- boot/freeldr/freeldr/arch/i386/xbox/machxbox.c | 15 ++++-- 5 files changed, 86 insertions(+), 18 deletions(-) diff --git a/base/setup/lib/bootsup.c b/base/setup/lib/bootsup.c index c34950cc3e3..8c89220174e 100644 --- a/base/setup/lib/bootsup.c +++ b/base/setup/lib/bootsup.c @@ -73,7 +73,7 @@ CreateFreeLoaderReactOSEntries( /* ReactOS */ // BootEntry->BootEntryKey = MAKESTRKEY(L"ReactOS"); BootEntry->FriendlyName = L"\"ReactOS\""; - Options->OsLoadOptions = NULL; // L""; + Options->OsLoadOptions = L"/FASTDETECT"; AddBootStoreEntry(BootStoreHandle, BootEntry, MAKESTRKEY(L"ReactOS")); /* ReactOS_Debug */ diff --git a/boot/bootdata/livecd.ini b/boot/bootdata/livecd.ini index 5e12037ff44..f36197c2e1d 100644 --- a/boot/bootdata/livecd.ini +++ b/boot/bootdata/livecd.ini @@ -18,34 +18,34 @@ LiveCD_LogFile="LiveCD (Log file)" [LiveCD] BootType=Windows2003 SystemPath=\reactos -Options=/MININT +Options=/FASTDETECT /MININT [LiveCD_Debug] BootType=Windows2003 SystemPath=\reactos -Options=/DEBUG /DEBUGPORT=COM1 /BAUDRATE=115200 /SOS /MININT +Options=/DEBUG /DEBUGPORT=COM1 /BAUDRATE=115200 /SOS /FASTDETECT /MININT [LiveCD_Macpi] BootType=Windows2003 SystemPath=\reactos -Options=/HAL=halmacpi.dll /KERNEL=ntkrnlmp.exe /DEBUG /DEBUGPORT=COM1 /BAUDRATE=115200 /SOS /MININT +Options=/HAL=halmacpi.dll /KERNEL=ntkrnlmp.exe /DEBUG /DEBUGPORT=COM1 /BAUDRATE=115200 /SOS /FASTDETECT /MININT [LiveCD_Aacpi] BootType=Windows2003 SystemPath=\reactos -Options=/HAL=halaacpi.dll /DEBUG /DEBUGPORT=COM1 /BAUDRATE=115200 /SOS /MININT +Options=/HAL=halaacpi.dll /DEBUG /DEBUGPORT=COM1 /BAUDRATE=115200 /SOS /FASTDETECT /MININT [LiveCD_VBoxDebug] BootType=Windows2003 SystemPath=\reactos -Options=/DEBUG /DEBUGPORT=VBOX /SOS /MININT +Options=/DEBUG /DEBUGPORT=VBOX /SOS /FASTDETECT /MININT [LiveCD_Screen] BootType=Windows2003 SystemPath=\reactos -Options=/DEBUG /DEBUGPORT=SCREEN /SOS /MININT +Options=/DEBUG /DEBUGPORT=SCREEN /SOS /FASTDETECT /MININT [LiveCD_LogFile] BootType=Windows2003 SystemPath=\reactos -Options=/DEBUG /DEBUGPORT=FILE:\Device\HarddiskX\PartitionY\debug.log /SOS /MININT +Options=/DEBUG /DEBUGPORT=FILE:\Device\HarddiskX\PartitionY\debug.log /SOS /FASTDETECT /MININT diff --git a/boot/bootdata/txtsetup.sif b/boot/bootdata/txtsetup.sif index bb2e9d9d892..16ad79b9a8b 100644 --- a/boot/bootdata/txtsetup.sif +++ b/boot/bootdata/txtsetup.sif @@ -216,7 +216,7 @@ Cabinet=reactos.cab DefaultPath = \ReactOS SetupDebugOptions = "/DEBUG /KDSERIAL /DEBUGPORT=COM1 /FIRSTCHANCE" ;SetupDebugOptions = "/DEBUG /SOS /DEBUGPORT=SCREEN" -OsLoadOptions = "/NOGUIBOOT /NODEBUG" +OsLoadOptions = "/FASTDETECT /NOGUIBOOT /NODEBUG" [NLS] AnsiCodepage = c_1252.nls diff --git a/boot/freeldr/freeldr/arch/i386/pc/machpc.c b/boot/freeldr/freeldr/arch/i386/pc/machpc.c index c93bb23d945..639895ec25b 100644 --- a/boot/freeldr/freeldr/arch/i386/pc/machpc.c +++ b/boot/freeldr/freeldr/arch/i386/pc/machpc.c @@ -19,6 +19,8 @@ #include <freeldr.h> #include <cportlib/cportlib.h> +#include "../ntldr/ntldropts.h" + #include <debug.h> DBG_DEFAULT_CHANNEL(HWDETECT); @@ -710,6 +712,7 @@ DetectSerialPointerPeripheral(PCONFIGURATION_COMPONENT_DATA ControllerKey, } } +static ULONG PcGetSerialPort(ULONG Index, PULONG Irq) { @@ -727,8 +730,60 @@ PcGetSerialPort(ULONG Index, PULONG Irq) return (ULONG) *(BasePtr + Index); } +/* + * Parse the serial mouse detection options. + * Format: /FASTDETECT + * or: /NOSERIALMICE=COM[0-9],[0-9],[0-9]... + * or: /NOSERIALMICE:COM[0-9]... + * If we have /FASTDETECT, then nothing can be detected. + */ +static +ULONG +GetSerialMouseDetectionBitmap( + _In_opt_ PCSTR Options) +{ + PCSTR Option, c; + ULONG OptionLength, PortBitmap, i; + + if (NtLdrGetOption(Options, "FASTDETECT")) + return (1 << MAX_COM_PORTS) - 1; + + Option = NtLdrGetOptionEx(Options, "NOSERIALMICE=", &OptionLength); + if (!Option) + Option = NtLdrGetOptionEx(Options, "NOSERIALMICE:", &OptionLength); + + if (!Option) + return 0; + + /* Invalid port list */ + if (OptionLength < (sizeof("NOSERIALMICE=COM9") - 1)) + return (1 << MAX_COM_PORTS) - 1; + + /* Move to the port list */ + Option += sizeof("NOSERIALMICE=COM") - 1; + OptionLength -= sizeof("NOSERIALMICE=COM") - 1; + + PortBitmap = 0; + c = Option; + for (i = 0; i < OptionLength; i += 2) + { + UCHAR PortNumber = *c - '0'; + + if (PortNumber > 0 && PortNumber <= 9) + PortBitmap |= 1 << (PortNumber - 1); + + c += 2; + } + + return PortBitmap; +} + VOID -DetectSerialPorts(PCONFIGURATION_COMPONENT_DATA BusKey, GET_SERIAL_PORT MachGetSerialPort, ULONG Count) +DetectSerialPorts( + _In_opt_ PCSTR Options, + _Inout_ PCONFIGURATION_COMPONENT_DATA BusKey, + _In_ GET_SERIAL_PORT MachGetSerialPort, + _In_ ULONG Count) { PCM_PARTIAL_RESOURCE_LIST PartialResourceList; PCM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptor; @@ -740,9 +795,12 @@ DetectSerialPorts(PCONFIGURATION_COMPONENT_DATA BusKey, GET_SERIAL_PORT MachGetS PCONFIGURATION_COMPONENT_DATA ControllerKey; ULONG i; ULONG Size; + ULONG PortBitmap; TRACE("DetectSerialPorts()\n"); + PortBitmap = GetSerialMouseDetectionBitmap(Options); + for (i = 0; i < Count; i++) { Base = MachGetSerialPort(i, &Irq); @@ -813,7 +871,7 @@ DetectSerialPorts(PCONFIGURATION_COMPONENT_DATA BusKey, GET_SERIAL_PORT MachGetS Size, &ControllerKey); - if (!Rs232PortInUse(UlongToPtr(Base))) + if (!(PortBitmap & (1 << i)) && !Rs232PortInUse(UlongToPtr(Base))) { /* Detect serial mouse */ DetectSerialPointerPeripheral(ControllerKey, UlongToPtr(Base)); @@ -1561,7 +1619,10 @@ DetectDisplayController(PCONFIGURATION_COMPONENT_DATA BusKey) static VOID -DetectIsaBios(PCONFIGURATION_COMPONENT_DATA SystemKey, ULONG *BusNumber) +DetectIsaBios( + _In_opt_ PCSTR Options, + _Inout_ PCONFIGURATION_COMPONENT_DATA SystemKey, + _Out_ ULONG *BusNumber) { PCM_PARTIAL_RESOURCE_LIST PartialResourceList; PCONFIGURATION_COMPONENT_DATA BusKey; @@ -1600,7 +1661,7 @@ DetectIsaBios(PCONFIGURATION_COMPONENT_DATA SystemKey, ULONG *BusNumber) /* Detect ISA/BIOS devices */ DetectBiosDisks(SystemKey, BusKey); - DetectSerialPorts(BusKey, PcGetSerialPort, MAX_COM_PORTS); + DetectSerialPorts(Options, BusKey, PcGetSerialPort, MAX_COM_PORTS); DetectParallelPorts(BusKey); DetectKeyboardController(BusKey); DetectPS2Mouse(BusKey); @@ -1647,7 +1708,7 @@ PcHwDetect( DetectPciBios(SystemKey, &BusNumber); DetectApmBios(SystemKey, &BusNumber); DetectPnpBios(SystemKey, &BusNumber); - DetectIsaBios(SystemKey, &BusNumber); // TODO: Detect first EISA or MCA, before ISA + DetectIsaBios(Options, SystemKey, &BusNumber); // TODO: Detect first EISA or MCA, before ISA DetectAcpiBios(SystemKey, &BusNumber); // TODO: Collect the ROM blocks from 0xC0000 to 0xF0000 and append their diff --git a/boot/freeldr/freeldr/arch/i386/xbox/machxbox.c b/boot/freeldr/freeldr/arch/i386/xbox/machxbox.c index 4315e228598..97b38062d84 100644 --- a/boot/freeldr/freeldr/arch/i386/xbox/machxbox.c +++ b/boot/freeldr/freeldr/arch/i386/xbox/machxbox.c @@ -73,7 +73,11 @@ XboxGetSerialPort(ULONG Index, PULONG Irq) extern VOID -DetectSerialPorts(PCONFIGURATION_COMPONENT_DATA BusKey, GET_SERIAL_PORT MachGetSerialPort, ULONG Count); +DetectSerialPorts( + _In_opt_ PCSTR Options, + _Inout_ PCONFIGURATION_COMPONENT_DATA BusKey, + _In_ GET_SERIAL_PORT MachGetSerialPort, + _In_ ULONG Count); VOID XboxGetExtendedBIOSData(PULONG ExtendedBIOSDataArea, PULONG ExtendedBIOSDataSize) @@ -201,7 +205,10 @@ DetectDisplayController(PCONFIGURATION_COMPONENT_DATA BusKey) static VOID -DetectIsaBios(PCONFIGURATION_COMPONENT_DATA SystemKey, ULONG *BusNumber) +DetectIsaBios( + _In_opt_ PCSTR Options, + _Inout_ PCONFIGURATION_COMPONENT_DATA SystemKey, + _Out_ ULONG *BusNumber) { PCM_PARTIAL_RESOURCE_LIST PartialResourceList; PCONFIGURATION_COMPONENT_DATA BusKey; @@ -240,7 +247,7 @@ DetectIsaBios(PCONFIGURATION_COMPONENT_DATA SystemKey, ULONG *BusNumber) /* Detect ISA/BIOS devices */ DetectBiosDisks(SystemKey, BusKey); - DetectSerialPorts(BusKey, XboxGetSerialPort, MAX_XBOX_COM_PORTS); + DetectSerialPorts(Options, BusKey, XboxGetSerialPort, MAX_XBOX_COM_PORTS); DetectDisplayController(BusKey); /* FIXME: Detect more ISA devices */ @@ -279,7 +286,7 @@ XboxHwDetect( /* TODO: Build actual xbox's hardware configuration tree */ DetectPciBios(SystemKey, &BusNumber); - DetectIsaBios(SystemKey, &BusNumber); + DetectIsaBios(Options, SystemKey, &BusNumber); TRACE("DetectHardware() Done\n"); return SystemKey;
1 year, 1 month
1
0
0
0
[reactos] 01/01: [FREELDR:NTLDR] Pass boot-time detection options to HwDetect routines.
by Hermès Bélusca-Maïto
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=10e7643c808e99acc387b…
commit 10e7643c808e99acc387b380df567784e567d243 Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> AuthorDate: Thu Jun 15 17:04:53 2023 +0200 Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> CommitDate: Mon Nov 13 19:19:40 2023 +0100 [FREELDR:NTLDR] Pass boot-time detection options to HwDetect routines. Will be used for supporting /NOSERIALMICE, /FASTDETECT (NT 5+) switches (see PR #5886), as well as the undocumented /PCIENUM option. --- boot/freeldr/freeldr/arch/arm/macharm.c | 5 +++-- boot/freeldr/freeldr/arch/i386/pc/machpc.c | 3 ++- boot/freeldr/freeldr/arch/i386/pc98/pc98hw.c | 3 ++- boot/freeldr/freeldr/arch/i386/xbox/machxbox.c | 3 ++- boot/freeldr/freeldr/arch/uefi/uefihw.c | 3 ++- boot/freeldr/freeldr/include/arch/i386/machpc98.h | 6 +++++- boot/freeldr/freeldr/include/arch/i386/machxbox.h | 5 ++++- boot/freeldr/freeldr/include/arch/pc/machpc.h | 6 +++++- boot/freeldr/freeldr/include/arch/uefi/machuefi.h | 3 ++- boot/freeldr/freeldr/include/machine.h | 9 ++++++--- boot/freeldr/freeldr/ntldr/winldr.c | 2 +- 11 files changed, 34 insertions(+), 14 deletions(-) diff --git a/boot/freeldr/freeldr/arch/arm/macharm.c b/boot/freeldr/freeldr/arch/arm/macharm.c index 2179a59bd3a..e059ee07948 100644 --- a/boot/freeldr/freeldr/arch/arm/macharm.c +++ b/boot/freeldr/freeldr/arch/arm/macharm.c @@ -94,7 +94,8 @@ ArmPrepareForReactOS(VOID) } PCONFIGURATION_COMPONENT_DATA -ArmHwDetect(VOID) +ArmHwDetect( + _In_opt_ PCSTR Options) { ARM_CACHE_REGISTER CacheReg; @@ -137,7 +138,7 @@ BOOLEAN ArmInitializeBootDevices(VOID) { /* Emulate old behavior */ - if (ArmHwDetect() == NULL) + if (ArmHwDetect(NULL) == NULL) return FALSE; /* On ARM platforms, the loader is always in RAM */ diff --git a/boot/freeldr/freeldr/arch/i386/pc/machpc.c b/boot/freeldr/freeldr/arch/i386/pc/machpc.c index 4bef802f667..c93bb23d945 100644 --- a/boot/freeldr/freeldr/arch/i386/pc/machpc.c +++ b/boot/freeldr/freeldr/arch/i386/pc/machpc.c @@ -1628,7 +1628,8 @@ PcGetFloppyCount(VOID) #endif PCONFIGURATION_COMPONENT_DATA -PcHwDetect(VOID) +PcHwDetect( + _In_opt_ PCSTR Options) { PCONFIGURATION_COMPONENT_DATA SystemKey; ULONG BusNumber = 0; diff --git a/boot/freeldr/freeldr/arch/i386/pc98/pc98hw.c b/boot/freeldr/freeldr/arch/i386/pc98/pc98hw.c index a404237a6c0..98264eec03c 100644 --- a/boot/freeldr/freeldr/arch/i386/pc98/pc98hw.c +++ b/boot/freeldr/freeldr/arch/i386/pc98/pc98hw.c @@ -1180,7 +1180,8 @@ DetectPnpBios(PCONFIGURATION_COMPONENT_DATA SystemKey, ULONG *BusNumber) } PCONFIGURATION_COMPONENT_DATA -Pc98HwDetect(VOID) +Pc98HwDetect( + _In_opt_ PCSTR Options) { PCONFIGURATION_COMPONENT_DATA SystemKey; ULONG BusNumber = 0; diff --git a/boot/freeldr/freeldr/arch/i386/xbox/machxbox.c b/boot/freeldr/freeldr/arch/i386/xbox/machxbox.c index 0574cd307a5..4315e228598 100644 --- a/boot/freeldr/freeldr/arch/i386/xbox/machxbox.c +++ b/boot/freeldr/freeldr/arch/i386/xbox/machxbox.c @@ -263,7 +263,8 @@ XboxGetFloppyCount(VOID) } PCONFIGURATION_COMPONENT_DATA -XboxHwDetect(VOID) +XboxHwDetect( + _In_opt_ PCSTR Options) { PCONFIGURATION_COMPONENT_DATA SystemKey; ULONG BusNumber = 0; diff --git a/boot/freeldr/freeldr/arch/uefi/uefihw.c b/boot/freeldr/freeldr/arch/uefi/uefihw.c index 8dcf9602274..f671446b474 100644 --- a/boot/freeldr/freeldr/arch/uefi/uefihw.c +++ b/boot/freeldr/freeldr/arch/uefi/uefihw.c @@ -123,7 +123,8 @@ DetectAcpiBios(PCONFIGURATION_COMPONENT_DATA SystemKey, ULONG *BusNumber) } PCONFIGURATION_COMPONENT_DATA -UefiHwDetect(VOID) +UefiHwDetect( + _In_opt_ PCSTR Options) { PCONFIGURATION_COMPONENT_DATA SystemKey; ULONG BusNumber = 0; diff --git a/boot/freeldr/freeldr/include/arch/i386/machpc98.h b/boot/freeldr/freeldr/include/arch/i386/machpc98.h index 07881b83319..23e268e9d98 100644 --- a/boot/freeldr/freeldr/include/arch/i386/machpc98.h +++ b/boot/freeldr/freeldr/include/arch/i386/machpc98.h @@ -80,7 +80,11 @@ VOID Pc98VideoPrepareForReactOS(VOID); VOID Pc98PrepareForReactOS(VOID); TIMEINFO* Pc98GetTime(VOID); BOOLEAN Pc98InitializeBootDevices(VOID); -PCONFIGURATION_COMPONENT_DATA Pc98HwDetect(VOID); + +PCONFIGURATION_COMPONENT_DATA +Pc98HwDetect( + _In_opt_ PCSTR Options); + VOID Pc98HwIdle(VOID); /* pcmem.c */ diff --git a/boot/freeldr/freeldr/include/arch/i386/machxbox.h b/boot/freeldr/freeldr/include/arch/i386/machxbox.h index 5b21d8515e9..4d3a4510263 100644 --- a/boot/freeldr/freeldr/include/arch/i386/machxbox.h +++ b/boot/freeldr/freeldr/include/arch/i386/machxbox.h @@ -58,7 +58,10 @@ ULONG XboxDiskGetCacheableBlockCount(UCHAR DriveNumber); TIMEINFO* XboxGetTime(VOID); -PCONFIGURATION_COMPONENT_DATA XboxHwDetect(VOID); +PCONFIGURATION_COMPONENT_DATA +XboxHwDetect( + _In_opt_ PCSTR Options); + VOID XboxHwIdle(VOID); VOID XboxSetLED(PCSTR Pattern); diff --git a/boot/freeldr/freeldr/include/arch/pc/machpc.h b/boot/freeldr/freeldr/include/arch/pc/machpc.h index 35bf0e904c8..2263d75778c 100644 --- a/boot/freeldr/freeldr/include/arch/pc/machpc.h +++ b/boot/freeldr/freeldr/include/arch/pc/machpc.h @@ -67,7 +67,11 @@ ULONG PcDiskGetCacheableBlockCount(UCHAR DriveNumber); TIMEINFO* PcGetTime(VOID); BOOLEAN PcInitializeBootDevices(VOID); -PCONFIGURATION_COMPONENT_DATA PcHwDetect(VOID); + +PCONFIGURATION_COMPONENT_DATA +PcHwDetect( + _In_opt_ PCSTR Options); + VOID PcHwIdle(VOID); extern BIOS_MEMORY_MAP PcBiosMemoryMap[]; diff --git a/boot/freeldr/freeldr/include/arch/uefi/machuefi.h b/boot/freeldr/freeldr/include/arch/uefi/machuefi.h index ba878e30972..6df376b1494 100644 --- a/boot/freeldr/freeldr/include/arch/uefi/machuefi.h +++ b/boot/freeldr/freeldr/include/arch/uefi/machuefi.h @@ -106,7 +106,8 @@ BOOLEAN UefiInitializeBootDevices(VOID); PCONFIGURATION_COMPONENT_DATA -UefiHwDetect(VOID); +UefiHwDetect( + _In_opt_ PCSTR Options); VOID UefiPrepareForReactOS(VOID); diff --git a/boot/freeldr/freeldr/include/machine.h b/boot/freeldr/freeldr/include/machine.h index cfe40a2a0bc..7e6e5c249be 100644 --- a/boot/freeldr/freeldr/include/machine.h +++ b/boot/freeldr/freeldr/include/machine.h @@ -74,7 +74,7 @@ typedef struct tagMACHVTBL // NOTE: Not in the machine.c ... BOOLEAN (*InitializeBootDevices)(VOID); - PCONFIGURATION_COMPONENT_DATA (*HwDetect)(VOID); + PCONFIGURATION_COMPONENT_DATA (*HwDetect)(_In_opt_ PCSTR Options); VOID (*HwIdle)(VOID); } MACHVTBL, *PMACHVTBL; @@ -133,8 +133,11 @@ VOID MachInit(const char *CmdLine); #define MachInitializeBootDevices() \ MachVtbl.InitializeBootDevices() -#define MachHwDetect() MachVtbl.HwDetect() -#define MachHwIdle() MachVtbl.HwIdle() +#define MachHwDetect(Options) \ + MachVtbl.HwDetect(Options) + +#define MachHwIdle() \ + MachVtbl.HwIdle() /* ARC FUNCTIONS **************************************************************/ diff --git a/boot/freeldr/freeldr/ntldr/winldr.c b/boot/freeldr/freeldr/ntldr/winldr.c index 9f51a541721..9724b174c61 100644 --- a/boot/freeldr/freeldr/ntldr/winldr.c +++ b/boot/freeldr/freeldr/ntldr/winldr.c @@ -1173,7 +1173,7 @@ LoadAndBootWindowsCommon( /* Detect hardware */ UiUpdateProgressBar(20, "Detecting hardware..."); - LoaderBlock->ConfigurationRoot = MachHwDetect(); + LoaderBlock->ConfigurationRoot = MachHwDetect(BootOptions); /* Initialize the PE loader import-DLL callback, so that we can obtain * feedback (for example during SOS) on the PE images that get loaded. */
1 year, 1 month
1
0
0
0
[reactos] 01/01: [ADVAPI32] Handle HKEY_CLASSES_ROOT in RegQueryInfoKeyW (#5870)
by Whindmar Saksit
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=413b5a0827af51e102f99…
commit 413b5a0827af51e102f99f3b2cb59867cdbacb6b Author: Whindmar Saksit <whindsaks(a)proton.me> AuthorDate: Mon Nov 13 18:02:41 2023 +0100 Commit: GitHub <noreply(a)github.com> CommitDate: Mon Nov 13 18:02:41 2023 +0100 [ADVAPI32] Handle HKEY_CLASSES_ROOT in RegQueryInfoKeyW (#5870) CORE-8582 , CORE-14676 This fixes the bug where Regedit is unable to show all the keys in HKCR when a key exists in both HKCU and HKLM. --- dll/win32/advapi32/reg/hkcr.c | 65 +++++++++++++++++++++++++++++++++++++++++++ dll/win32/advapi32/reg/reg.c | 10 +++++++ dll/win32/advapi32/reg/reg.h | 15 ++++++++++ 3 files changed, 90 insertions(+) diff --git a/dll/win32/advapi32/reg/hkcr.c b/dll/win32/advapi32/reg/hkcr.c index f55a783eb5d..21921ebb42b 100644 --- a/dll/win32/advapi32/reg/hkcr.c +++ b/dll/win32/advapi32/reg/hkcr.c @@ -1014,3 +1014,68 @@ Exit: return ErrorCode; } + +/* HKCR version of RegQueryInfoKeyW */ +LONG +WINAPI +QueryInfoHKCRKey( + _In_ HKEY hKey, + _Out_writes_to_opt_(*lpcchClass, *lpcchClass + 1) LPWSTR lpClass, + _Inout_opt_ LPDWORD lpcchClass, + _Reserved_ LPDWORD lpReserved, + _Out_opt_ LPDWORD lpcSubKeys, + _Out_opt_ LPDWORD lpcbMaxSubKeyLen, + _Out_opt_ LPDWORD lpcbMaxClassLen, + _Out_opt_ LPDWORD lpcValues, + _Out_opt_ LPDWORD lpcbMaxValueNameLen, + _Out_opt_ LPDWORD lpcbMaxValueLen, + _Out_opt_ LPDWORD lpcbSecurityDescriptor, + _Out_opt_ PFILETIME lpftLastWriteTime) +{ + HKEY PreferredKey, FallbackKey; + LONG retval, err; + DWORD OtherSubKeys = 0, OtherMaxSub = 0, OtherMaxClass = 0; + DWORD OtherValues = 0, OtherMaxName = 0, OtherMaxVal = 0; + + ASSERT(IsHKCRKey(hKey)); + + /* Remove the HKCR flag while we're working */ + hKey = (HKEY)(((ULONG_PTR)hKey) & ~0x2); + + retval = GetFallbackHKCRKey(hKey, &FallbackKey, FALSE); + if (retval == ERROR_SUCCESS) + { + retval = RegQueryInfoKeyW(FallbackKey, lpClass, lpcchClass, lpReserved, + &OtherSubKeys, &OtherMaxSub, &OtherMaxClass, + &OtherValues, &OtherMaxName, &OtherMaxVal, + lpcbSecurityDescriptor, lpftLastWriteTime); + if (FallbackKey != hKey) + RegCloseKey(FallbackKey); + } + + err = GetPreferredHKCRKey(hKey, &PreferredKey); + if (err == ERROR_SUCCESS) + { + err = RegQueryInfoKeyW(PreferredKey, lpClass, lpcchClass, lpReserved, + lpcSubKeys, lpcbMaxSubKeyLen, lpcbMaxClassLen, + lpcValues, lpcbMaxValueNameLen, lpcbMaxValueLen, + lpcbSecurityDescriptor, lpftLastWriteTime); + if (PreferredKey != hKey) + RegCloseKey(PreferredKey); + } + + if (lpcSubKeys) + *lpcSubKeys = (err ? 0 : *lpcSubKeys) + OtherSubKeys; + if (lpcValues) + *lpcValues = (err ? 0 : *lpcValues) + OtherValues; + if (lpcbMaxSubKeyLen) + *lpcbMaxSubKeyLen = max((err ? 0 : *lpcbMaxSubKeyLen), OtherMaxSub); + if (lpcbMaxClassLen) + *lpcbMaxClassLen = max((err ? 0 : *lpcbMaxClassLen), OtherMaxClass); + if (lpcbMaxValueNameLen) + *lpcbMaxValueNameLen = max((err ? 0 : *lpcbMaxValueNameLen), OtherMaxName); + if (lpcbMaxValueLen) + *lpcbMaxValueLen = max((err ? 0 : *lpcbMaxValueLen), OtherMaxVal); + + return (err == ERROR_SUCCESS) ? ERROR_SUCCESS : retval; +} diff --git a/dll/win32/advapi32/reg/reg.c b/dll/win32/advapi32/reg/reg.c index 58515793c4e..1ded4b54222 100644 --- a/dll/win32/advapi32/reg/reg.c +++ b/dll/win32/advapi32/reg/reg.c @@ -3718,6 +3718,16 @@ RegQueryInfoKeyW(HKEY hKey, return RtlNtStatusToDosError(Status); } + if (IsHKCRKey(KeyHandle)) + { + ErrorCode = QueryInfoHKCRKey(KeyHandle, lpClass, lpcClass, lpReserved, + lpcSubKeys, lpcMaxSubKeyLen, lpcMaxClassLen, + lpcValues, lpcMaxValueNameLen, lpcMaxValueLen, + lpcbSecurityDescriptor, lpftLastWriteTime); + ClosePredefKey(KeyHandle); + return ErrorCode; + } + if (lpClass != NULL) { if (*lpcClass > 0) diff --git a/dll/win32/advapi32/reg/reg.h b/dll/win32/advapi32/reg/reg.h index 2c5c128d38c..469f2b6fbcd 100644 --- a/dll/win32/advapi32/reg/reg.h +++ b/dll/win32/advapi32/reg/reg.h @@ -96,3 +96,18 @@ EnumHKCRValue( _Out_opt_ LPBYTE data, _Inout_opt_ PDWORD count); +LONG +WINAPI +QueryInfoHKCRKey( + _In_ HKEY hKey, + _Out_writes_to_opt_(*lpcchClass, *lpcchClass + 1) LPWSTR lpClass, + _Inout_opt_ LPDWORD lpcchClass, + _Reserved_ LPDWORD lpReserved, + _Out_opt_ LPDWORD lpcSubKeys, + _Out_opt_ LPDWORD lpcbMaxSubKeyLen, + _Out_opt_ LPDWORD lpcbMaxClassLen, + _Out_opt_ LPDWORD lpcValues, + _Out_opt_ LPDWORD lpcbMaxValueNameLen, + _Out_opt_ LPDWORD lpcbMaxValueLen, + _Out_opt_ LPDWORD lpcbSecurityDescriptor, + _Out_opt_ PFILETIME lpftLastWriteTime);
1 year, 1 month
1
0
0
0
[reactos] 01/01: [ADVPACK] Handle ADN_DEL_IF_EMPTY in DelNodeW and DelNodeRunDLL32 (#5821)
by Whindmar Saksit
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=6eb8a1d0c70fcda787b9f…
commit 6eb8a1d0c70fcda787b9f16147564372bc630faf Author: Whindmar Saksit <whindsaks(a)proton.me> AuthorDate: Mon Nov 13 16:42:26 2023 +0100 Commit: GitHub <noreply(a)github.com> CommitDate: Mon Nov 13 16:42:26 2023 +0100 [ADVPACK] Handle ADN_DEL_IF_EMPTY in DelNodeW and DelNodeRunDLL32 (#5821) - Handling ADN_DEL_IF_EMPTY is critical to avoid data loss. - SetFileAttributesW failing is not fatal, the delete might still succeed. NOTE: Not in Wine yet. --- dll/win32/advpack/files.c | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/dll/win32/advpack/files.c b/dll/win32/advpack/files.c index 3e4cb366007..6f06bf0e9ab 100644 --- a/dll/win32/advpack/files.c +++ b/dll/win32/advpack/files.c @@ -341,9 +341,17 @@ static HRESULT DELNODE_recurse_dirtree(LPWSTR fname, DWORD flags) HANDLE hFindFile; WIN32_FIND_DATAW w32fd; BOOL done = TRUE; - int fname_len = lstrlenW(fname); + int fname_len; + +#ifdef __REACTOS__ + if (flags & ADN_DEL_IF_EMPTY) + { + goto deleteinitialdirectory; + } +#endif /* Generate a path with wildcard suitable for iterating */ + fname_len = lstrlenW(fname); if (fname_len && fname[fname_len-1] != '\\') fname[fname_len++] = '\\'; lstrcpyW(fname + fname_len, asterisk); @@ -371,8 +379,14 @@ static HRESULT DELNODE_recurse_dirtree(LPWSTR fname, DWORD flags) if (done) { +#ifdef __REACTOS__ +deleteinitialdirectory: TRACE("%s: directory\n", debugstr_w(fname)); + SetFileAttributesW(fname, FILE_ATTRIBUTE_NORMAL); + if (RemoveDirectoryW(fname)) +#else if (SetFileAttributesW(fname, FILE_ATTRIBUTE_NORMAL) && RemoveDirectoryW(fname)) +#endif { ret = S_OK; } @@ -381,7 +395,12 @@ static HRESULT DELNODE_recurse_dirtree(LPWSTR fname, DWORD flags) else { TRACE("%s: file\n", debugstr_w(fname)); +#ifdef __REACTOS__ + SetFileAttributesW(fname, FILE_ATTRIBUTE_NORMAL); + if (DeleteFileW(fname)) +#else if (SetFileAttributesW(fname, FILE_ATTRIBUTE_NORMAL) && DeleteFileW(fname)) +#endif { ret = S_OK; } @@ -435,9 +454,14 @@ HRESULT WINAPI DelNodeW(LPCWSTR pszFileOrDirName, DWORD dwFlags) HRESULT ret = E_FAIL; TRACE("(%s, %d)\n", debugstr_w(pszFileOrDirName), dwFlags); - + +#ifdef __REACTOS__ + if (dwFlags & ~ADN_DEL_IF_EMPTY) + FIXME("Flags %#x ignored!\n", dwFlags & ~ADN_DEL_IF_EMPTY); +#else if (dwFlags) FIXME("Flags ignored!\n"); +#endif if (pszFileOrDirName && *pszFileOrDirName) {
1 year, 1 month
1
0
0
0
[reactos] 01/01: [SHELL32][SHELLEXT] IEnumIDList::Next must handle pceltFetched and memory errors correctly (#5820)
by Whindmar Saksit
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=f283a3f9ae16eb047d602…
commit f283a3f9ae16eb047d60272186fcb911c79dc266 Author: Whindmar Saksit <whindsaks(a)proton.me> AuthorDate: Mon Nov 13 16:31:37 2023 +0100 Commit: GitHub <noreply(a)github.com> CommitDate: Mon Nov 13 16:31:37 2023 +0100 [SHELL32][SHELLEXT] IEnumIDList::Next must handle pceltFetched and memory errors correctly (#5820) - pceltFetched can be NULL if the caller is not requesting multiple items. - All entries returned in rgelt must be valid, they cannot be NULL. --- dll/shellext/fontext/CEnumFonts.cpp | 21 ++++++++++++++++----- dll/shellext/netshell/enumlist.cpp | 8 ++++++++ dll/shellext/zipfldr/CEnumZipContents.cpp | 24 ++++++++++++------------ dll/win32/shell32/CEnumIDListBase.cpp | 6 ++++++ 4 files changed, 42 insertions(+), 17 deletions(-) diff --git a/dll/shellext/fontext/CEnumFonts.cpp b/dll/shellext/fontext/CEnumFonts.cpp index 3897a73debd..957e816d322 100644 --- a/dll/shellext/fontext/CEnumFonts.cpp +++ b/dll/shellext/fontext/CEnumFonts.cpp @@ -36,9 +36,10 @@ public: // *** IEnumIDList methods *** STDMETHODIMP Next(ULONG celt, LPITEMIDLIST *rgelt, ULONG *pceltFetched) { - if (!pceltFetched || !rgelt) + if (!rgelt || (!pceltFetched && celt != 1)) return E_POINTER; + HRESULT hr = S_OK; ULONG Fetched = 0; while (celt) @@ -48,15 +49,25 @@ public: if (m_Index < g_FontCache->Size()) { CStringW Name = g_FontCache->Name(m_Index); - rgelt[Fetched] = _ILCreate(Name, m_Index); - + LPITEMIDLIST item = _ILCreate(Name, m_Index); + if (!item) + { + hr = Fetched ? S_FALSE : E_OUTOFMEMORY; + break; + } + rgelt[Fetched] = item; m_Index++; Fetched++; } + else + { + hr = S_FALSE; + } } - *pceltFetched = Fetched; - return Fetched ? S_OK : S_FALSE; + if (pceltFetched) + *pceltFetched = Fetched; + return hr; } STDMETHODIMP Skip(ULONG celt) { diff --git a/dll/shellext/netshell/enumlist.cpp b/dll/shellext/netshell/enumlist.cpp index a95eab776d8..9369663f708 100644 --- a/dll/shellext/netshell/enumlist.cpp +++ b/dll/shellext/netshell/enumlist.cpp @@ -277,9 +277,17 @@ CEnumIDList::Next( for (i = 0; i < celt; i++) { if (!m_pCurrent) + { + hr = S_FALSE; break; + } temp = ILClone(m_pCurrent->pidl); + if (!temp) + { + hr = i ? S_FALSE : E_OUTOFMEMORY; + break; + } rgelt[i] = temp; m_pCurrent = m_pCurrent->pNext; } diff --git a/dll/shellext/zipfldr/CEnumZipContents.cpp b/dll/shellext/zipfldr/CEnumZipContents.cpp index 372e21ba772..a3f5bcbf79c 100644 --- a/dll/shellext/zipfldr/CEnumZipContents.cpp +++ b/dll/shellext/zipfldr/CEnumZipContents.cpp @@ -34,25 +34,25 @@ public: // *** IEnumIDList methods *** STDMETHODIMP Next(ULONG celt, LPITEMIDLIST *rgelt, ULONG *pceltFetched) { - if (!pceltFetched || !rgelt) + if (!rgelt || (!pceltFetched && celt != 1)) return E_POINTER; - *pceltFetched = 0; - - if (celt != 1) - return E_FAIL; - + LPITEMIDLIST item; CStringW name; bool dir; unz_file_info64 info; - if (mEnumerator.next_unique(m_Prefix, name, dir, info)) + for (ULONG i = 0; i < celt; ++i) { - *pceltFetched = 1; - *rgelt = _ILCreate(dir ? ZIP_PIDL_DIRECTORY : ZIP_PIDL_FILE, name, info); - return S_OK; + if (pceltFetched) + *pceltFetched = i; + if (!mEnumerator.next_unique(m_Prefix, name, dir, info)) + return S_FALSE; + item = _ILCreate(dir ? ZIP_PIDL_DIRECTORY : ZIP_PIDL_FILE, name, info); + if (!item) + return i ? S_FALSE : E_OUTOFMEMORY; + rgelt[i] = item; } - - return S_FALSE; + return S_OK; } STDMETHODIMP Skip(ULONG celt) { diff --git a/dll/win32/shell32/CEnumIDListBase.cpp b/dll/win32/shell32/CEnumIDListBase.cpp index 59633418c3d..47adf6e2ea8 100644 --- a/dll/win32/shell32/CEnumIDListBase.cpp +++ b/dll/win32/shell32/CEnumIDListBase.cpp @@ -172,9 +172,15 @@ HRESULT WINAPI CEnumIDListBase::Next( for(i = 0; i < celt; i++) { if(!mpCurrent) + { hr = S_FALSE; break; + } temp = ILClone(mpCurrent->pidl); + if (!temp) + { hr = i ? S_FALSE : E_OUTOFMEMORY; + break; + } rgelt[i] = temp; mpCurrent = mpCurrent->pNext; }
1 year, 1 month
1
0
0
0
[reactos] 01/01: [DEVMGR] Fix some bugs spotted by Thomas Faber in PR #5775 (#5790)
by Hermès Bélusca-Maïto
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=b4b1c5b9aac030f96a0bb…
commit b4b1c5b9aac030f96a0bb58f14e7de9bee17d3c5 Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> AuthorDate: Thu Oct 12 15:34:06 2023 +0200 Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> CommitDate: Mon Nov 13 16:26:00 2023 +0100 [DEVMGR] Fix some bugs spotted by Thomas Faber in PR #5775 (#5790) - Fix TCHAR/WCHAR mis-usage, - Fix as a result, a buffer overflow (GlobalAlloc takes the size in bytes, but a number of characters was passed to it instead). - Remove usage of unsafe string function. Now the item text is directly retrieved within the allocated buffer. --- dll/win32/devmgr/properties/advprop.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/dll/win32/devmgr/properties/advprop.cpp b/dll/win32/devmgr/properties/advprop.cpp index c53fe65a46c..1c776069465 100644 --- a/dll/win32/devmgr/properties/advprop.cpp +++ b/dll/win32/devmgr/properties/advprop.cpp @@ -413,7 +413,7 @@ DriverDetailsDlgProc(IN HWND hwndDlg, pnmv->iItem, pnmv->iSubItem, szDriverPath, - MAX_PATH); + _countof(szDriverPath)); UpdateDriverVersionInfoDetails(hwndDlg, szDriverPath); @@ -1944,16 +1944,11 @@ AdvProcDetailsDlgProc(IN HWND hwndDlg, if (nSelectedId < 0 || nSelectedItems <= 0) break; - TCHAR szItemName[MAX_PATH]; HGLOBAL hGlobal; LPWSTR pszBuffer; + SIZE_T cchSize = MAX_PATH + 1; - ListView_GetItemText(hwndListView, - nSelectedId, 0, - szItemName, - _countof(szItemName)); - - hGlobal = GlobalAlloc(GHND, MAX_PATH); + hGlobal = GlobalAlloc(GHND, cchSize * sizeof(WCHAR)); if (!hGlobal) break; pszBuffer = (LPWSTR)GlobalLock(hGlobal); @@ -1963,7 +1958,12 @@ AdvProcDetailsDlgProc(IN HWND hwndDlg, break; } - wsprintf(pszBuffer, L"%s", szItemName); + ListView_GetItemText(hwndListView, + nSelectedId, 0, + pszBuffer, + cchSize); + /* Ensure NULL-termination */ + pszBuffer[cchSize - 1] = UNICODE_NULL; GlobalUnlock(hGlobal);
1 year, 1 month
1
0
0
0
← Newer
1
...
15
16
17
18
19
20
21
...
28
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
Results per page:
10
25
50
100
200