ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
October 2023
----- 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
21 participants
140 discussions
Start a n
N
ew thread
[reactos] 01/01: [SHELL32][SDK] Implement Activate_RunDLL (#5840)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=ad5df2d1996b619d5bbef…
commit ad5df2d1996b619d5bbef69d8d58985694f16a1a Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Sat Oct 28 14:56:27 2023 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Sat Oct 28 14:56:27 2023 +0900 [SHELL32][SDK] Implement Activate_RunDLL (#5840) - Add Activate_RunDLL function implementation. - Add Activate_RunDLL prototype to <undocshell.h>. --- dll/win32/shell32/stubs.cpp | 11 ----------- dll/win32/shell32/utils.cpp | 27 +++++++++++++++++++++++++++ sdk/include/reactos/undocshell.h | 7 +++++++ 3 files changed, 34 insertions(+), 11 deletions(-) diff --git a/dll/win32/shell32/stubs.cpp b/dll/win32/shell32/stubs.cpp index ee4452a9277..bae11321006 100644 --- a/dll/win32/shell32/stubs.cpp +++ b/dll/win32/shell32/stubs.cpp @@ -801,17 +801,6 @@ SHIsBadInterfacePtr(LPVOID pv, UINT ucb) return FALSE; } -/* - * Unimplemented - */ -EXTERN_C BOOL -WINAPI -Activate_RunDLL(DWORD dwProcessId, LPVOID lpUnused1, LPVOID lpUnused2, LPVOID lpUnused3) -{ - FIXME("Activate_RunDLL() stub\n"); - return FALSE; -} - /* * Unimplemented */ diff --git a/dll/win32/shell32/utils.cpp b/dll/win32/shell32/utils.cpp index 215be665a6c..7007ee78ca2 100644 --- a/dll/win32/shell32/utils.cpp +++ b/dll/win32/shell32/utils.cpp @@ -577,3 +577,30 @@ SHOpenPropSheetA( return SHOpenPropSheetW(pszCaptionW, ahKeys, cKeys, pclsidDefault, pDataObject, pShellBrowser, pszStartPageW); } + +/************************************************************************* + * Activate_RunDLL [SHELL32.105] + * + * Unlocks the foreground window and allows the shell window to become the + * foreground window. Every parameter is unused. + */ +EXTERN_C +BOOL WINAPI +Activate_RunDLL( + _In_ DWORD dwUnused1, + _In_ LPVOID lpUnused2, + _In_ LPVOID lpUnused3, + _In_ LPVOID lpUnused4) +{ + DWORD dwPID; + + UNREFERENCED_PARAMETER(dwUnused1); + UNREFERENCED_PARAMETER(lpUnused2); + UNREFERENCED_PARAMETER(lpUnused3); + UNREFERENCED_PARAMETER(lpUnused4); + + TRACE("(%lu, %p, %p, %p)\n", dwUnused1, lpUnused2, lpUnused3, lpUnused4); + + GetWindowThreadProcessId(GetShellWindow(), &dwPID); + return AllowSetForegroundWindow(dwPID); +} diff --git a/sdk/include/reactos/undocshell.h b/sdk/include/reactos/undocshell.h index a8dc8c2c145..b0391380d80 100644 --- a/sdk/include/reactos/undocshell.h +++ b/sdk/include/reactos/undocshell.h @@ -720,6 +720,13 @@ BOOL WINAPI SHTestTokenPrivilegeW(_In_opt_ HANDLE hToken, _In_z_ LPCWSTR lpName); BOOL WINAPI IsSuspendAllowed(VOID); +BOOL WINAPI +Activate_RunDLL( + _In_ DWORD dwUnused1, + _In_ LPVOID lpUnused2, + _In_ LPVOID lpUnused3, + _In_ LPVOID lpUnused4); + /***************************************************************************** * Shell32 resources */
1 year, 2 months
1
0
0
0
[reactos] 01/01: [SHELL32][SDK] Implement ShortSizeFormatW (#5829)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=2ccdd87809ba49093da9f…
commit 2ccdd87809ba49093da9f0143bd150228bd54b4a Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Sat Oct 28 14:55:25 2023 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Sat Oct 28 14:55:25 2023 +0900 [SHELL32][SDK] Implement ShortSizeFormatW (#5829) - Implement ShortSizeFormatW. - Add ShortSizeFormatW prototype into <undocshell.h>. - Modify shell32.spec. --- dll/win32/shell32/shell32.spec | 2 +- dll/win32/shell32/stubs.cpp | 11 ----------- dll/win32/shell32/utils.cpp | 13 +++++++++++++ sdk/include/reactos/undocshell.h | 5 +++++ 4 files changed, 19 insertions(+), 12 deletions(-) diff --git a/dll/win32/shell32/shell32.spec b/dll/win32/shell32/shell32.spec index 9cc8bfd8cdc..2aabb8efb2a 100644 --- a/dll/win32/shell32/shell32.spec +++ b/dll/win32/shell32/shell32.spec @@ -200,7 +200,7 @@ 201 stdcall -noname SHDesktopMessageLoop(ptr) 202 stub -noname DDEHandleViewFolderNotify 203 stdcall -noname AddCommasW(long wstr) -204 stdcall -noname ShortSizeFormatW(double) +204 stdcall -noname ShortSizeFormatW(long ptr) 205 stdcall -noname Printer_LoadIconsW(wstr ptr ptr) 206 stdcall ExtractAssociatedIconA(long str ptr) 207 stdcall ExtractAssociatedIconExA(long str long long) diff --git a/dll/win32/shell32/stubs.cpp b/dll/win32/shell32/stubs.cpp index 1faf6c87977..ee4452a9277 100644 --- a/dll/win32/shell32/stubs.cpp +++ b/dll/win32/shell32/stubs.cpp @@ -14,17 +14,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(shell); -/* - * Unimplemented - */ -EXTERN_C LPWSTR -WINAPI -ShortSizeFormatW(LONGLONG llNumber) -{ - FIXME("ShortSizeFormatW() stub\n"); - return NULL; -} - /* * Unimplemented */ diff --git a/dll/win32/shell32/utils.cpp b/dll/win32/shell32/utils.cpp index 512bd1b754f..215be665a6c 100644 --- a/dll/win32/shell32/utils.cpp +++ b/dll/win32/shell32/utils.cpp @@ -86,6 +86,19 @@ ExtractIconResInfoA( return ExtractIconResInfoW(hHandle, strFileNameW, wIndex, lpSize, lpIcon); } +/************************************************************************* + * ShortSizeFormatW (SHELL32.204) + */ +EXTERN_C +LPWSTR WINAPI +ShortSizeFormatW( + _In_ DWORD dwNumber, + _Out_writes_(0x8FFF) LPWSTR pszBuffer) +{ + TRACE("(%lu, %p)\n", dwNumber, pszBuffer); + return StrFormatByteSizeW(dwNumber, pszBuffer, 0x8FFF); +} + /************************************************************************* * SHOpenEffectiveToken (SHELL32.235) */ diff --git a/sdk/include/reactos/undocshell.h b/sdk/include/reactos/undocshell.h index e294e8c4e54..a8dc8c2c145 100644 --- a/sdk/include/reactos/undocshell.h +++ b/sdk/include/reactos/undocshell.h @@ -700,6 +700,11 @@ LargeIntegerToString( _In_opt_ const NUMBERFMTW *pNumberFormat, _In_ DWORD dwNumberFlags); +LPWSTR WINAPI +ShortSizeFormatW( + _In_ DWORD dwNumber, + _Out_writes_(0x8FFF) LPWSTR pszBuffer); + BOOL WINAPI SHOpenEffectiveToken(_Out_ LPHANDLE phToken); DWORD WINAPI SHGetUserSessionId(_In_opt_ HANDLE hToken);
1 year, 2 months
1
0
0
0
[reactos] 01/01: [SHELL32] Implement ExtractIconResInfoA (#5846)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=81e936486ede27c51179c…
commit 81e936486ede27c51179c462aace7b84aed79c27 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Sat Oct 28 11:38:29 2023 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Sat Oct 28 11:38:29 2023 +0900 [SHELL32] Implement ExtractIconResInfoA (#5846) - Add ExtractIconResInfoA implementation. - Add ExtractIconResInfo prototype to <undocshell.h>. --- dll/win32/shell32/stubs.cpp | 26 ++++++-------------------- dll/win32/shell32/utils.cpp | 21 +++++++++++++++++++++ sdk/include/reactos/undocshell.h | 16 ++++++++++++++++ 3 files changed, 43 insertions(+), 20 deletions(-) diff --git a/dll/win32/shell32/stubs.cpp b/dll/win32/shell32/stubs.cpp index 56480aae5bd..1faf6c87977 100644 --- a/dll/win32/shell32/stubs.cpp +++ b/dll/win32/shell32/stubs.cpp @@ -939,26 +939,12 @@ Printers_AddPrinterPropPages(LPVOID lpUnknown1, LPVOID lpUnknown2) */ EXTERN_C WORD WINAPI -ExtractIconResInfoA(HANDLE hHandle, - LPSTR lpFile, - WORD wIndex, - LPWORD lpSize, - LPHANDLE lpIcon) -{ - FIXME("ExtractIconResInfoA() stub\n"); - return 0; -} - -/* - * Unimplemented - */ -EXTERN_C WORD -WINAPI -ExtractIconResInfoW(HANDLE hHandle, - LPWSTR lpFile, - WORD wIndex, - LPWORD lpSize, - LPHANDLE lpIcon) +ExtractIconResInfoW( + _In_ HANDLE hHandle, + _In_ LPCWSTR lpFileName, + _In_ WORD wIndex, + _Out_ LPWORD lpSize, + _Out_ LPHANDLE lpIcon) { FIXME("ExtractIconResInfoW() stub\n"); return 0; diff --git a/dll/win32/shell32/utils.cpp b/dll/win32/shell32/utils.cpp index 6adeca8afd7..512bd1b754f 100644 --- a/dll/win32/shell32/utils.cpp +++ b/dll/win32/shell32/utils.cpp @@ -65,6 +65,27 @@ PathIsSlowA( return PathIsSlowW(strFileW, dwAttr); } +/************************************************************************* + * ExtractIconResInfoA (SHELL32.221) + */ +EXTERN_C +WORD WINAPI +ExtractIconResInfoA( + _In_ HANDLE hHandle, + _In_ LPCSTR lpFileName, + _In_ WORD wIndex, + _Out_ LPWORD lpSize, + _Out_ LPHANDLE lpIcon) +{ + TRACE("(%p, %s, %u, %p, %p)\n", hHandle, debugstr_a(lpFileName), wIndex, lpSize, lpIcon); + + if (!lpFileName) + return 0; + + CStringW strFileNameW(lpFileName); + return ExtractIconResInfoW(hHandle, strFileNameW, wIndex, lpSize, lpIcon); +} + /************************************************************************* * SHOpenEffectiveToken (SHELL32.235) */ diff --git a/sdk/include/reactos/undocshell.h b/sdk/include/reactos/undocshell.h index 5b6953e9204..e294e8c4e54 100644 --- a/sdk/include/reactos/undocshell.h +++ b/sdk/include/reactos/undocshell.h @@ -239,6 +239,22 @@ HICON WINAPI SHGetFileIcon( BOOL WINAPI FileIconInit(BOOL bFullInit); +WORD WINAPI +ExtractIconResInfoA( + _In_ HANDLE hHandle, + _In_ LPCSTR lpFileName, + _In_ WORD wIndex, + _Out_ LPWORD lpSize, + _Out_ LPHANDLE lpIcon); + +WORD WINAPI +ExtractIconResInfoW( + _In_ HANDLE hHandle, + _In_ LPCWSTR lpFileName, + _In_ WORD wIndex, + _Out_ LPWORD lpSize, + _Out_ LPHANDLE lpIcon); + /**************************************************************************** * File Menu Routines */
1 year, 2 months
1
0
0
0
[reactos] 01/01: [SHELL32][SDK] Implement PathIsSlowA and SHSetFolderPathA (#5841)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=9dfb3e8e051388f765de2…
commit 9dfb3e8e051388f765de20bc259e71276ad15eb6 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Sat Oct 28 09:59:12 2023 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Sat Oct 28 09:59:12 2023 +0900 [SHELL32][SDK] Implement PathIsSlowA and SHSetFolderPathA (#5841) - Implement PathIsSlowA and SHSetFolderPathA functions. - Add PathIsSlow and SHSetFolderPath prototypes to <shlobj.h>. - Fix some <shlobj.h>'s bugs. - Improve SHOpenPropSheetA function. --- dll/win32/shell32/stubs.cpp | 42 +++++++------------------- dll/win32/shell32/utils.cpp | 73 ++++++++++++++++++++++++++++++++++----------- sdk/include/psdk/shlobj.h | 43 ++++++++++++++++++++++---- 3 files changed, 103 insertions(+), 55 deletions(-) diff --git a/dll/win32/shell32/stubs.cpp b/dll/win32/shell32/stubs.cpp index ad3f31c2873..56480aae5bd 100644 --- a/dll/win32/shell32/stubs.cpp +++ b/dll/win32/shell32/stubs.cpp @@ -225,13 +225,13 @@ SHGetSetFolderCustomSettingsA(LPSHFOLDERCUSTOMSETTINGSA pfcs, */ BOOL WINAPI SHOpenPropSheetW( - _In_opt_z_ LPCWSTR pszCaption, + _In_opt_ LPCWSTR pszCaption, _In_opt_ HKEY *ahKeys, _In_ UINT cKeys, _In_ const CLSID *pclsidDefault, _In_ IDataObject *pDataObject, _In_opt_ IShellBrowser *pShellBrowser, - _In_opt_z_ LPCWSTR pszStartPage) + _In_opt_ LPCWSTR pszStartPage) { FIXME("SHOpenPropSheetW() stub\n"); return FALSE; @@ -1028,24 +1028,11 @@ FirstUserLogon(LPWSTR lpUnknown1, LPWSTR lpUnknown2) */ EXTERN_C HRESULT WINAPI -SHSetFolderPathA(int csidl, - HANDLE hToken, - DWORD dwFlags, - LPCSTR pszPath) -{ - FIXME("SHSetFolderPathA() stub\n"); - return E_FAIL; -} - -/* - * Unimplemented - */ -EXTERN_C HRESULT -WINAPI -SHSetFolderPathW(int csidl, - HANDLE hToken, - DWORD dwFlags, - LPCWSTR pszPath) +SHSetFolderPathW( + _In_ INT csidl, + _In_ HANDLE hToken, + _In_ DWORD dwFlags, + _In_ LPCWSTR pszPath) { FIXME("SHSetFolderPathW() stub\n"); return E_FAIL; @@ -1089,23 +1076,14 @@ SHShouldShowWizards(LPVOID lpUnknown) */ EXTERN_C BOOL WINAPI -PathIsSlowW(LPCWSTR pszFile, DWORD dwFileAttr) +PathIsSlowW( + _In_ LPCWSTR pszFile, + _In_ DWORD dwAttr) { FIXME("PathIsSlowW() stub\n"); return FALSE; } -/* - * Unimplemented - */ -EXTERN_C BOOL -WINAPI -PathIsSlowA(LPCSTR pszFile, DWORD dwFileAttr) -{ - FIXME("PathIsSlowA() stub\n"); - return FALSE; -} - /* * Unimplemented */ diff --git a/dll/win32/shell32/utils.cpp b/dll/win32/shell32/utils.cpp index c9170ff29af..6adeca8afd7 100644 --- a/dll/win32/shell32/utils.cpp +++ b/dll/win32/shell32/utils.cpp @@ -9,7 +9,10 @@ WINE_DEFAULT_DEBUG_CHANNEL(shell); -static BOOL OpenEffectiveToken(DWORD DesiredAccess, HANDLE *phToken) +static BOOL +OpenEffectiveToken( + _In_ DWORD DesiredAccess, + _Out_ HANDLE *phToken) { BOOL ret; @@ -28,6 +31,40 @@ static BOOL OpenEffectiveToken(DWORD DesiredAccess, HANDLE *phToken) return ret; } +/************************************************************************* + * SHSetFolderPathA (SHELL32.231) + * + * @see
https://learn.microsoft.com/en-us/windows/win32/api/shlobj_core/nf-shlobj_c…
+ */ +EXTERN_C +HRESULT WINAPI +SHSetFolderPathA( + _In_ INT csidl, + _In_ HANDLE hToken, + _In_ DWORD dwFlags, + _In_ LPCSTR pszPath) +{ + TRACE("(%d, %p, 0x%X, %s)\n", csidl, hToken, dwFlags, debugstr_a(pszPath)); + CStringW strPathW(pszPath); + return SHSetFolderPathW(csidl, hToken, dwFlags, strPathW); +} + +/************************************************************************* + * PathIsSlowA (SHELL32.240) + * + * @see
https://learn.microsoft.com/en-us/windows/win32/api/shlobj/nf-shlobj-pathis…
+ */ +EXTERN_C +BOOL WINAPI +PathIsSlowA( + _In_ LPCSTR pszFile, + _In_ DWORD dwAttr) +{ + TRACE("(%s, 0x%X)\n", debugstr_a(pszFile), dwAttr); + CStringW strFileW(pszFile); + return PathIsSlowW(strFileW, dwAttr); +} + /************************************************************************* * SHOpenEffectiveToken (SHELL32.235) */ @@ -68,7 +105,7 @@ EXTERN_C DWORD WINAPI SHGetUserSessionId(_In_opt_ HANDLE hToken) EXTERN_C HRESULT WINAPI SHInvokePrivilegedFunctionW( - _In_z_ LPCWSTR pszName, + _In_ LPCWSTR pszName, _In_ PRIVILEGED_FUNCTION fn, _In_opt_ LPARAM lParam) { @@ -110,7 +147,9 @@ SHInvokePrivilegedFunctionW( */ EXTERN_C BOOL WINAPI -SHTestTokenPrivilegeW(_In_opt_ HANDLE hToken, _In_z_ LPCWSTR lpName) +SHTestTokenPrivilegeW( + _In_opt_ HANDLE hToken, + _In_ LPCWSTR lpName) { LUID Luid; DWORD dwLength; @@ -314,7 +353,7 @@ SHFindComputer(LPCITEMIDLIST pidlRoot, LPCITEMIDLIST pidlSavedSearch) static HRESULT Int64ToStr( _In_ LONGLONG llValue, - _Out_writes_z_(cchValue) LPWSTR pszValue, + _Out_writes_(cchValue) LPWSTR pszValue, _In_ UINT cchValue) { WCHAR szBuff[40]; @@ -361,9 +400,9 @@ Int64GetNumFormat( _Out_ NUMBERFMTW *pDest, _In_opt_ const NUMBERFMTW *pSrc, _In_ DWORD dwNumberFlags, - _Out_writes_z_(cchDecimal) LPWSTR pszDecimal, + _Out_writes_(cchDecimal) LPWSTR pszDecimal, _In_ INT cchDecimal, - _Out_writes_z_(cchThousand) LPWSTR pszThousand, + _Out_writes_(cchThousand) LPWSTR pszThousand, _In_ INT cchThousand) { WCHAR szBuff[20]; @@ -419,7 +458,7 @@ EXTERN_C INT WINAPI Int64ToString( _In_ LONGLONG llValue, - _Out_writes_z_(cchOut) LPWSTR pszOut, + _Out_writes_(cchOut) LPWSTR pszOut, _In_ UINT cchOut, _In_ BOOL bUseFormat, _In_opt_ const NUMBERFMTW *pNumberFormat, @@ -457,7 +496,7 @@ EXTERN_C INT WINAPI LargeIntegerToString( _In_ const LARGE_INTEGER *pLargeInt, - _Out_writes_z_(cchOut) LPWSTR pszOut, + _Out_writes_(cchOut) LPWSTR pszOut, _In_ UINT cchOut, _In_ BOOL bUseFormat, _In_opt_ const NUMBERFMTW *pNumberFormat, @@ -475,30 +514,30 @@ LargeIntegerToString( EXTERN_C BOOL WINAPI SHOpenPropSheetA( - _In_opt_z_ LPCSTR pszCaption, + _In_opt_ LPCSTR pszCaption, _In_opt_ HKEY *ahKeys, _In_ UINT cKeys, _In_ const CLSID *pclsidDefault, _In_ IDataObject *pDataObject, _In_opt_ IShellBrowser *pShellBrowser, - _In_opt_z_ LPCSTR pszStartPage) + _In_opt_ LPCSTR pszStartPage) { - WCHAR szStartPageW[MAX_PATH], szCaptionW[MAX_PATH]; + CStringW strStartPageW, strCaptionW; LPCWSTR pszCaptionW = NULL, pszStartPageW = NULL; - TRACE("(%s, %p, %u, %p, %p, %p, %s)", pszCaption, ahKeys, cKeys, pclsidDefault, pDataObject, - pShellBrowser, pszStartPage); + TRACE("(%s, %p, %u, %p, %p, %p, %s)", debugstr_a(pszCaption), ahKeys, cKeys, pclsidDefault, + pDataObject, pShellBrowser, debugstr_a(pszStartPage)); if (pszCaption) { - SHAnsiToUnicode(pszCaption, szCaptionW, _countof(szCaptionW)); - pszCaptionW = szCaptionW; + strStartPageW = pszCaption; + pszCaptionW = strCaptionW; } if (pszStartPage) { - SHAnsiToUnicode(pszStartPage, szStartPageW, _countof(szStartPageW)); - pszStartPageW = szStartPageW; + strStartPageW = pszStartPage; + pszStartPageW = strStartPageW; } return SHOpenPropSheetW(pszCaptionW, ahKeys, cKeys, pclsidDefault, diff --git a/sdk/include/psdk/shlobj.h b/sdk/include/psdk/shlobj.h index 39124f6af41..a9c90ffc137 100644 --- a/sdk/include/psdk/shlobj.h +++ b/sdk/include/psdk/shlobj.h @@ -190,7 +190,35 @@ SHGetFolderPathAndSubDirW( _In_opt_ LPCWSTR, _Out_writes_(MAX_PATH) LPWSTR); -#define SHGetFolderPathAndSubDir WINELIB_NAME_AW(SHGetFolderPathAndSubDir); +#define SHGetFolderPathAndSubDir WINELIB_NAME_AW(SHGetFolderPathAndSubDir) + +HRESULT WINAPI +SHSetFolderPathA( + _In_ INT csidl, + _In_ HANDLE hToken, + _In_ DWORD dwFlags, + _In_ LPCSTR pszPath); + +HRESULT WINAPI +SHSetFolderPathW( + _In_ INT csidl, + _In_ HANDLE hToken, + _In_ DWORD dwFlags, + _In_ LPCWSTR pszPath); + +#define SHSetFolderPath WINELIB_NAME_AW(SHSetFolderPath) + +BOOL WINAPI +PathIsSlowA( + _In_ LPCSTR pszFile, + _In_ DWORD dwAttr); + +BOOL WINAPI +PathIsSlowW( + _In_ LPCWSTR pszFile, + _In_ DWORD dwAttr); + +#define PathIsSlow WINELIB_NAME_AW(PathIsSlow) _Success_(return != 0) BOOL @@ -242,7 +270,7 @@ SHPathPrepareForWriteW( _In_opt_ IUnknown*, _In_ LPCWSTR, DWORD); -#define SHPathPrepareForWrite WINELIB_NAME_AW(SHPathPrepareForWrite); +#define SHPathPrepareForWrite WINELIB_NAME_AW(SHPathPrepareForWrite) UINT WINAPI @@ -342,22 +370,25 @@ HINSTANCE WINAPI SHGetShellStyleHInstance(VOID); BOOL WINAPI SHOpenPropSheetA( - _In_opt_z_ LPCSTR pszCaption, + _In_opt_ LPCSTR pszCaption, _In_opt_ HKEY *ahKeys, _In_ UINT cKeys, _In_ const CLSID *pclsidDefault, _In_ IDataObject *pDataObject, _In_opt_ IShellBrowser *pShellBrowser, - _In_opt_z_ LPCSTR pszStartPage); + _In_opt_ LPCSTR pszStartPage); + BOOL WINAPI SHOpenPropSheetW( - _In_opt_z_ LPCWSTR pszCaption, + _In_opt_ LPCWSTR pszCaption, _In_opt_ HKEY *ahKeys, _In_ UINT cKeys, _In_ const CLSID *pclsidDefault, _In_ IDataObject *pDataObject, _In_opt_ IShellBrowser *pShellBrowser, - _In_opt_z_ LPCWSTR pszStartPage); + _In_opt_ LPCWSTR pszStartPage); + +#define SHOpenPropSheet WINELIB_NAME_AW(SHOpenPropSheet) /***************************************************************************** * IContextMenu interface
1 year, 2 months
1
0
0
0
[reactos] 01/01: [SHELL32][SDK] Implement SHOpenPropSheetA (#5830)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=dcc9a2d8f3c298401b1be…
commit dcc9a2d8f3c298401b1be40967264892b03188e3 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Fri Oct 27 19:34:02 2023 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Fri Oct 27 19:34:02 2023 +0900 [SHELL32][SDK] Implement SHOpenPropSheetA (#5830) - Add SHOpenPropSheetA and SHOpenPropSheetW prototypes to <shlobj.h>. - Implement SHOpenPropSheetA function. --- dll/win32/shell32/stubs.cpp | 43 ++++++++++++++----------------------------- dll/win32/shell32/utils.cpp | 38 ++++++++++++++++++++++++++++++++++++++ sdk/include/psdk/shlobj.h | 19 +++++++++++++++++++ 3 files changed, 71 insertions(+), 29 deletions(-) diff --git a/dll/win32/shell32/stubs.cpp b/dll/win32/shell32/stubs.cpp index 9ca95825c7f..ad3f31c2873 100644 --- a/dll/win32/shell32/stubs.cpp +++ b/dll/win32/shell32/stubs.cpp @@ -218,35 +218,20 @@ SHGetSetFolderCustomSettingsA(LPSHFOLDERCUSTOMSETTINGSA pfcs, return E_FAIL; } -/* - * Unimplemented - */ -EXTERN_C BOOL -WINAPI -SHOpenPropSheetA(LPCSTR lpCaption, - HKEY hKeys[], - UINT uCount, - const CLSID *pClsID, - IDataObject *pDataObject, - IShellBrowser *pShellBrowser, - LPCSTR lpStartPage) -{ - FIXME("SHOpenPropSheetA() stub\n"); - return FALSE; -} - -/* - * Unimplemented - */ -EXTERN_C BOOL -WINAPI -SHOpenPropSheetW(LPCWSTR lpCaption, - HKEY hKeys[], - UINT uCount, - const CLSID *pClsID, - IDataObject *pDataObject, - IShellBrowser *pShellBrowser, - LPCWSTR lpStartPage) +/************************************************************************* + * SHOpenPropSheetW [SHELL32.80] + * + * @see
https://learn.microsoft.com/en-us/windows/win32/api/shlobj/nf-shlobj-shopen…
+ */ +BOOL WINAPI +SHOpenPropSheetW( + _In_opt_z_ LPCWSTR pszCaption, + _In_opt_ HKEY *ahKeys, + _In_ UINT cKeys, + _In_ const CLSID *pclsidDefault, + _In_ IDataObject *pDataObject, + _In_opt_ IShellBrowser *pShellBrowser, + _In_opt_z_ LPCWSTR pszStartPage) { FIXME("SHOpenPropSheetW() stub\n"); return FALSE; diff --git a/dll/win32/shell32/utils.cpp b/dll/win32/shell32/utils.cpp index f10cb11e290..c9170ff29af 100644 --- a/dll/win32/shell32/utils.cpp +++ b/dll/win32/shell32/utils.cpp @@ -466,3 +466,41 @@ LargeIntegerToString( return Int64ToString(pLargeInt->QuadPart, pszOut, cchOut, bUseFormat, pNumberFormat, dwNumberFlags); } + +/************************************************************************* + * SHOpenPropSheetA [SHELL32.707] + * + * @see
https://learn.microsoft.com/en-us/windows/win32/api/shlobj/nf-shlobj-shopen…
+ */ +EXTERN_C +BOOL WINAPI +SHOpenPropSheetA( + _In_opt_z_ LPCSTR pszCaption, + _In_opt_ HKEY *ahKeys, + _In_ UINT cKeys, + _In_ const CLSID *pclsidDefault, + _In_ IDataObject *pDataObject, + _In_opt_ IShellBrowser *pShellBrowser, + _In_opt_z_ LPCSTR pszStartPage) +{ + WCHAR szStartPageW[MAX_PATH], szCaptionW[MAX_PATH]; + LPCWSTR pszCaptionW = NULL, pszStartPageW = NULL; + + TRACE("(%s, %p, %u, %p, %p, %p, %s)", pszCaption, ahKeys, cKeys, pclsidDefault, pDataObject, + pShellBrowser, pszStartPage); + + if (pszCaption) + { + SHAnsiToUnicode(pszCaption, szCaptionW, _countof(szCaptionW)); + pszCaptionW = szCaptionW; + } + + if (pszStartPage) + { + SHAnsiToUnicode(pszStartPage, szStartPageW, _countof(szStartPageW)); + pszStartPageW = szStartPageW; + } + + return SHOpenPropSheetW(pszCaptionW, ahKeys, cKeys, pclsidDefault, + pDataObject, pShellBrowser, pszStartPageW); +} diff --git a/sdk/include/psdk/shlobj.h b/sdk/include/psdk/shlobj.h index 601fd58f30c..39124f6af41 100644 --- a/sdk/include/psdk/shlobj.h +++ b/sdk/include/psdk/shlobj.h @@ -340,6 +340,25 @@ int WINAPI PathCleanupSpec(_In_opt_ LPCWSTR, _Inout_ LPWSTR); HINSTANCE WINAPI SHGetShellStyleHInstance(VOID); #endif +BOOL WINAPI +SHOpenPropSheetA( + _In_opt_z_ LPCSTR pszCaption, + _In_opt_ HKEY *ahKeys, + _In_ UINT cKeys, + _In_ const CLSID *pclsidDefault, + _In_ IDataObject *pDataObject, + _In_opt_ IShellBrowser *pShellBrowser, + _In_opt_z_ LPCSTR pszStartPage); +BOOL WINAPI +SHOpenPropSheetW( + _In_opt_z_ LPCWSTR pszCaption, + _In_opt_ HKEY *ahKeys, + _In_ UINT cKeys, + _In_ const CLSID *pclsidDefault, + _In_ IDataObject *pDataObject, + _In_opt_ IShellBrowser *pShellBrowser, + _In_opt_z_ LPCWSTR pszStartPage); + /***************************************************************************** * IContextMenu interface */
1 year, 2 months
1
0
0
0
[reactos] 01/01: [SHELL32] Fix copyto/moveto actions of Search Results (#5816)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=8f6b01696316bd4213f4f…
commit 8f6b01696316bd4213f4f8b2157f032f3c8a1047 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Fri Oct 27 12:34:51 2023 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Fri Oct 27 12:34:51 2023 +0900 [SHELL32] Fix copyto/moveto actions of Search Results (#5816) - Extend CDefView::InvokeContextMenuCommand 2nd parameter to LPCSTR. - Add CDefView::_DoCopyToMoveToFolder method. - Use CDefView::_DoCopyToMoveToFolder for FCIDM_SHVIEW_COPYTO and FCIDM_SHVIEW_MOVETO command actions. CORE-18426 --- dll/win32/shell32/CDefView.cpp | 47 ++++++++++++++++++++++++++++++++++-------- 1 file changed, 38 insertions(+), 9 deletions(-) diff --git a/dll/win32/shell32/CDefView.cpp b/dll/win32/shell32/CDefView.cpp index 9f12fd09549..a06feb085b4 100644 --- a/dll/win32/shell32/CDefView.cpp +++ b/dll/win32/shell32/CDefView.cpp @@ -163,6 +163,7 @@ class CDefView : INT _FindInsertableIndexFromPoint(POINT pt); void _HandleStatusBarResize(int width); void _ForceStatusBarResize(); + void _DoCopyToMoveToFolder(BOOL bCopy); public: CDefView(); @@ -197,7 +198,7 @@ class CDefView : void OnDeactivate(); void DoActivate(UINT uState); HRESULT drag_notify_subitem(DWORD grfKeyState, POINTL pt, DWORD *pdwEffect); - HRESULT InvokeContextMenuCommand(CComPtr<IContextMenu> &pCM, UINT uCommand, POINT* pt); + HRESULT InvokeContextMenuCommand(CComPtr<IContextMenu>& pCM, LPCSTR lpVerb, POINT* pt = NULL); LRESULT OnExplorerCommand(UINT uCommand, BOOL bUseSelection); // *** IOleWindow methods *** @@ -1513,14 +1514,14 @@ UINT CDefView::GetSelections() return m_cidl; } -HRESULT CDefView::InvokeContextMenuCommand(CComPtr<IContextMenu> &pCM, UINT uCommand, POINT* pt) +HRESULT CDefView::InvokeContextMenuCommand(CComPtr<IContextMenu>& pCM, LPCSTR lpVerb, POINT* pt) { CMINVOKECOMMANDINFOEX cmi; ZeroMemory(&cmi, sizeof(cmi)); cmi.cbSize = sizeof(cmi); - cmi.lpVerb = MAKEINTRESOURCEA(uCommand); cmi.hwnd = m_hWnd; + cmi.lpVerb = lpVerb; if (GetKeyState(VK_SHIFT) & 0x8000) cmi.fMask |= CMIC_MASK_SHIFT_DOWN; @@ -1583,7 +1584,7 @@ HRESULT CDefView::OpenSelectedItems() return E_FAIL; } - InvokeContextMenuCommand(pCM, uCommand, NULL); + InvokeContextMenuCommand(pCM, MAKEINTRESOURCEA(uCommand), NULL); return hResult; } @@ -1682,7 +1683,7 @@ LRESULT CDefView::OnContextMenu(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &b if (uCommand == FCIDM_SHVIEW_OPEN && OnDefaultCommand() == S_OK) return 0; - InvokeContextMenuCommand(m_pCM, uCommand - CONTEXT_MENU_BASE_ID, &pt); + InvokeContextMenuCommand(m_pCM, MAKEINTRESOURCEA(uCommand - CONTEXT_MENU_BASE_ID), &pt); return 0; } @@ -1731,7 +1732,7 @@ LRESULT CDefView::OnExplorerCommand(UINT uCommand, BOOL bUseSelection) } // FIXME: We should probably use the objects position? - InvokeContextMenuCommand(pCM, uCommand, NULL); + InvokeContextMenuCommand(pCM, MAKEINTRESOURCEA(uCommand), NULL); return 0; } @@ -1818,6 +1819,29 @@ void CDefView::DoActivate(UINT uState) TRACE("--\n"); } +void CDefView::_DoCopyToMoveToFolder(BOOL bCopy) +{ + if (!GetSelections()) + return; + + SFGAOF rfg = SFGAO_CANCOPY | SFGAO_CANMOVE | SFGAO_FILESYSTEM; + HRESULT hr = m_pSFParent->GetAttributesOf(m_cidl, m_apidl, &rfg); + if (FAILED_UNEXPECTEDLY(hr)) + return; + + if (!bCopy && !(rfg & SFGAO_CANMOVE)) + return; + if (bCopy && !(rfg & SFGAO_CANCOPY)) + return; + + CComPtr<IContextMenu> pCM; + hr = m_pSFParent->GetUIObjectOf(m_hWnd, m_cidl, m_apidl, IID_IContextMenu, 0, (void **)&pCM); + if (FAILED_UNEXPECTEDLY(hr)) + return; + + InvokeContextMenuCommand(pCM, (bCopy ? "copyto" : "moveto"), NULL); +} + /********************************************************** * ShellView_OnActivate() */ @@ -1954,26 +1978,31 @@ LRESULT CDefView::OnCommand(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHand case FCIDM_SHVIEW_COPY: case FCIDM_SHVIEW_RENAME: case FCIDM_SHVIEW_PROPERTIES: - case FCIDM_SHVIEW_COPYTO: - case FCIDM_SHVIEW_MOVETO: if (SHRestricted(REST_NOVIEWCONTEXTMENU)) return 0; return OnExplorerCommand(dwCmdID, TRUE); + case FCIDM_SHVIEW_COPYTO: + case FCIDM_SHVIEW_MOVETO: + _DoCopyToMoveToFolder(dwCmdID == FCIDM_SHVIEW_COPYTO); + return 0; + case FCIDM_SHVIEW_INSERT: case FCIDM_SHVIEW_UNDO: case FCIDM_SHVIEW_INSERTLINK: case FCIDM_SHVIEW_NEWFOLDER: return OnExplorerCommand(dwCmdID, FALSE); default: + { /* WM_COMMAND messages from the file menu are routed to the CDefView so as to let m_pFileMenu handle the command */ if (m_pFileMenu && dwCmd == 0) { HMENU Dummy = NULL; MenuCleanup _(m_pFileMenu, Dummy); - InvokeContextMenuCommand(m_pFileMenu, dwCmdID, NULL); + InvokeContextMenuCommand(m_pFileMenu, MAKEINTRESOURCEA(dwCmdID), NULL); } + } } return 0;
1 year, 2 months
1
0
0
0
[reactos] 01/01: [IPHLPAPI] Silence obsolete FIXME in GetAdaptersAddresses (#5834)
by Doug Lyons
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=4eace8d762426e9ca7de0…
commit 4eace8d762426e9ca7de0b357eb92d17299d9a9b Author: Doug Lyons <douglyons(a)douglyons.com> AuthorDate: Thu Oct 26 11:45:44 2023 -0500 Commit: GitHub <noreply(a)github.com> CommitDate: Thu Oct 26 16:45:44 2023 +0000 [IPHLPAPI] Silence obsolete FIXME in GetAdaptersAddresses (#5834) --- dll/win32/iphlpapi/address.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dll/win32/iphlpapi/address.c b/dll/win32/iphlpapi/address.c index fb40963c7d4..e3ac92588c5 100644 --- a/dll/win32/iphlpapi/address.c +++ b/dll/win32/iphlpapi/address.c @@ -331,8 +331,8 @@ GetAdaptersAddresses( DWORD MIN_SIZE = 15 * 1024; PIP_ADAPTER_ADDRESSES PreviousAA = NULL; - FIXME("GetAdaptersAddresses - Semi Stub: Family %u, Flags 0x%08x, Reserved %p, pAdapterAddress %p, pOutBufLen %p.\n", - Family, Flags, Reserved, pAdapterAddresses, pOutBufLen); + TRACE("Family %u, Flags 0x%08x, Reserved %p, pAdapterAddress %p, pOutBufLen %p\n", + Family, Flags, Reserved, pAdapterAddresses, pOutBufLen); if (!pOutBufLen) return ERROR_INVALID_PARAMETER;
1 year, 3 months
1
0
0
0
[reactos] 01/01: [SHELL32][SDK] Implement IsSuspendAllowed (#5831)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=995f56d1d34a8a8a93dea…
commit 995f56d1d34a8a8a93deac5fb576f767a8552a85 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Thu Oct 26 23:27:45 2023 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Thu Oct 26 23:27:45 2023 +0900 [SHELL32][SDK] Implement IsSuspendAllowed (#5831) - Add IsShutdownAllowed helper function. - Add IsSuspendAllowed prototype to <undocshell.h>. - Implement IsSuspendAllowed function. --- dll/win32/shell32/stubs.cpp | 11 ----------- dll/win32/shell32/utils.cpp | 14 ++++++++++++++ sdk/include/reactos/undocshell.h | 1 + 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/dll/win32/shell32/stubs.cpp b/dll/win32/shell32/stubs.cpp index f8518336906..9ca95825c7f 100644 --- a/dll/win32/shell32/stubs.cpp +++ b/dll/win32/shell32/stubs.cpp @@ -783,17 +783,6 @@ DAD_DragEnterEx2(HWND hwndTarget, return FALSE; } -/* - * Unimplemented - */ -EXTERN_C BOOL -WINAPI -IsSuspendAllowed(VOID) -{ - FIXME("IsSuspendAllowed() stub\n"); - return FALSE; -} - /* * Unimplemented */ diff --git a/dll/win32/shell32/utils.cpp b/dll/win32/shell32/utils.cpp index 57ade40713e..f10cb11e290 100644 --- a/dll/win32/shell32/utils.cpp +++ b/dll/win32/shell32/utils.cpp @@ -164,6 +164,20 @@ Quit: return ret; } +BOOL IsShutdownAllowed(VOID) +{ + return SHTestTokenPrivilegeW(NULL, SE_SHUTDOWN_NAME); +} + +/************************************************************************* + * IsSuspendAllowed (SHELL32.53) + */ +BOOL WINAPI IsSuspendAllowed(VOID) +{ + TRACE("()\n"); + return IsShutdownAllowed() && IsPwrSuspendAllowed(); +} + /************************************************************************* * SHGetShellStyleHInstance (SHELL32.749) */ diff --git a/sdk/include/reactos/undocshell.h b/sdk/include/reactos/undocshell.h index 1577466ab9f..5b6953e9204 100644 --- a/sdk/include/reactos/undocshell.h +++ b/sdk/include/reactos/undocshell.h @@ -697,6 +697,7 @@ SHInvokePrivilegedFunctionW( BOOL WINAPI SHTestTokenPrivilegeW(_In_opt_ HANDLE hToken, _In_z_ LPCWSTR lpName); +BOOL WINAPI IsSuspendAllowed(VOID); /***************************************************************************** * Shell32 resources
1 year, 3 months
1
0
0
0
[reactos] 01/01: [REGEDIT] Improve error handling (#5833)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=be8a6f8af19b7b9f7be29…
commit be8a6f8af19b7b9f7be29ea6b81ed8da029daa2c Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Thu Oct 26 19:57:42 2023 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Thu Oct 26 19:57:42 2023 +0900 [REGEDIT] Improve error handling (#5833) - Don't exit the main program on error. - Improve output_message function. - Use output_message instead of some error_exit function calls. CORE-19188 --- base/applications/regedit/regedit.c | 8 +++++--- base/applications/regedit/regproc.c | 25 +++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/base/applications/regedit/regedit.c b/base/applications/regedit/regedit.c index 35fa13f037d..0e3cc27f669 100644 --- a/base/applications/regedit/regedit.c +++ b/base/applications/regedit/regedit.c @@ -37,9 +37,7 @@ static void output_writeconsole(const WCHAR *str, DWORD wlen) #ifdef __REACTOS__ /* This is win32gui application, don't ever try writing to console. * For the console version we have a separate reg.exe application. */ - WCHAR AppStr[255]; - LoadStringW(hInst, IDS_APP_TITLE, AppStr, ARRAY_SIZE(AppStr)); - MessageBoxW(NULL, str, AppStr, MB_OK | MB_ICONINFORMATION); + MessageBoxW(NULL, str, NULL, MB_ICONERROR); #else DWORD count; @@ -219,7 +217,11 @@ static void PerformRegAction(REGEDIT_ACTION action, WCHAR **argv, int *i) break; } default: +#ifdef __REACTOS__ + output_message(STRING_UNHANDLED_ACTION); +#else error_exit(STRING_UNHANDLED_ACTION); +#endif break; } } diff --git a/base/applications/regedit/regproc.c b/base/applications/regedit/regproc.c index f140b672381..1ef1fc9e6c2 100644 --- a/base/applications/regedit/regproc.c +++ b/base/applications/regedit/regproc.c @@ -1105,11 +1105,23 @@ void delete_registry_key(WCHAR *reg_key_name) if (!(key_class = parse_key_name(reg_key_name, &key_name))) { if (key_name) *(key_name - 1) = 0; +#ifdef __REACTOS__ + output_message(STRING_INVALID_SYSTEM_KEY, reg_key_name); + return; +#else error_exit(STRING_INVALID_SYSTEM_KEY, reg_key_name); +#endif } if (!key_name || !*key_name) +#ifdef __REACTOS__ + { + output_message(STRING_DELETE_FAILED, reg_key_name); + return; + } +#else error_exit(STRING_DELETE_FAILED, reg_key_name); +#endif #ifdef __REACTOS__ SHDeleteKey(key_class, key_name); @@ -1460,7 +1472,12 @@ static FILE *REGPROC_open_export_file(WCHAR *file_name, BOOL unicode) if (!file) { _wperror(L"regedit"); +#ifdef __REACTOS__ + output_message(STRING_CANNOT_OPEN_FILE, file_name); + return NULL; +#else error_exit(STRING_CANNOT_OPEN_FILE, file_name); +#endif } } @@ -1506,6 +1523,10 @@ static BOOL export_key(WCHAR *file_name, WCHAR *path, BOOL unicode) return FALSE; fp = REGPROC_open_export_file(file_name, unicode); +#ifdef __REACTOS__ + if (!fp) + return TRUE; /* Error message is already displayed */ +#endif export_registry_data(fp, key, path, unicode); export_newline(fp, unicode); fclose(fp); @@ -1522,6 +1543,10 @@ static BOOL export_all(WCHAR *file_name, WCHAR *path, BOOL unicode) WCHAR *class_name; fp = REGPROC_open_export_file(file_name, unicode); +#ifdef __REACTOS__ + if (!fp) + return TRUE; /* Error message is already displayed */ +#endif for (i = 0; i < ARRAY_SIZE(classes); i++) {
1 year, 3 months
1
0
0
0
[reactos] 01/01: [REGEDIT] Use <strsafe.h> functions strictly Part 2 (#5832)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=fea414b9ed2cc7a81fdda…
commit fea414b9ed2cc7a81fddad18bc90f9d023beee15 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Thu Oct 26 10:39:12 2023 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Thu Oct 26 10:39:12 2023 +0900 [REGEDIT] Use <strsafe.h> functions strictly Part 2 (#5832) Follow-up to #5825. Use StringCchPrintfW instead of swprintf. CORE-18876 --- base/applications/regedit/regproc.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/base/applications/regedit/regproc.c b/base/applications/regedit/regproc.c index 8311a477712..f140b672381 100644 --- a/base/applications/regedit/regproc.c +++ b/base/applications/regedit/regproc.c @@ -1191,7 +1191,8 @@ static size_t export_value_name(FILE *fp, WCHAR *name, size_t len, BOOL unicode) WCHAR *str = REGPROC_escape_string(name, len, &line_len); WCHAR *buf = malloc((line_len + 4) * sizeof(WCHAR)); #ifdef __REACTOS__ - line_len = swprintf(buf, L"\"%s\"=", str); + StringCchPrintfW(buf, line_len + 4, L"\"%s\"=", str); + line_len = wcslen(buf); #else line_len = swprintf(buf, line_len + 4, L"\"%s\"=", str); #endif @@ -1218,7 +1219,7 @@ static void export_string_data(WCHAR **buf, WCHAR *data, size_t size) str = REGPROC_escape_string(data, len, &line_len); *buf = malloc((line_len + 3) * sizeof(WCHAR)); #ifdef __REACTOS__ - swprintf(*buf, L"\"%s\"", str); + StringCchPrintfW(*buf, line_len + 3, L"\"%s\"", str); #else swprintf(*buf, line_len + 3, L"\"%s\"", str); #endif @@ -1229,7 +1230,7 @@ static void export_dword_data(WCHAR **buf, DWORD *data) { *buf = malloc(15 * sizeof(WCHAR)); #ifdef __REACTOS__ - swprintf(*buf, L"dword:%08x", *data); + StringCchPrintfW(*buf, 15, L"dword:%08x", *data); #else swprintf(*buf, 15, L"dword:%08x", *data); #endif @@ -1249,7 +1250,8 @@ static size_t export_hex_data_type(FILE *fp, DWORD type, BOOL unicode) { WCHAR *buf = malloc(15 * sizeof(WCHAR)); #ifdef __REACTOS__ - line_len = swprintf(buf, L"hex(%x):", type); + StringCchPrintfW(buf, 15, L"hex(%x):", type); + line_len = wcslen(buf); #else line_len = swprintf(buf, 15, L"hex(%x):", type); #endif @@ -1280,7 +1282,8 @@ static void export_hex_data(FILE *fp, WCHAR **buf, DWORD type, DWORD line_len, for (i = 0, pos = 0; i < size; i++) { #ifdef __REACTOS__ - pos += swprintf(*buf + pos, L"%02x", ((BYTE *)data)[i]); + StringCchPrintfW(*buf + pos, 3, L"%02x", ((BYTE *)data)[i]); + pos += wcslen(*buf + pos); #else pos += swprintf(*buf + pos, 3, L"%02x", ((BYTE *)data)[i]); #endif @@ -1346,7 +1349,7 @@ static WCHAR *build_subkey_path(WCHAR *path, DWORD path_len, WCHAR *subkey_name, subkey_path = malloc((path_len + subkey_len + 2) * sizeof(WCHAR)); #ifdef __REACTOS__ - swprintf(subkey_path, L"%s\\%s", path, subkey_name); + StringCchPrintfW(subkey_path, path_len + subkey_len + 2, L"%s\\%s", path, subkey_name); #else swprintf(subkey_path, path_len + subkey_len + 2, L"%s\\%s", path, subkey_name); #endif @@ -1360,7 +1363,7 @@ static void export_key_name(FILE *fp, WCHAR *name, BOOL unicode) buf = malloc((lstrlenW(name) + 7) * sizeof(WCHAR)); #ifdef __REACTOS__ - swprintf(buf, L"\r\n[%s]\r\n", name); + StringCchPrintfW(buf, lstrlenW(name) + 7, L"\r\n[%s]\r\n", name); #else swprintf(buf, lstrlenW(name) + 7, L"\r\n[%s]\r\n", name); #endif
1 year, 3 months
1
0
0
0
← Newer
1
2
3
4
5
6
...
14
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Results per page:
10
25
50
100
200