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
June 2017
----- 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
526 discussions
Start a n
N
ew thread
[hbelusca] 75221: [CMLIB]: Adjust the old-style parameter annotations for two functions.
by hbelusca@svn.reactos.org
Author: hbelusca Date: Tue Jun 27 23:46:17 2017 New Revision: 75221 URL:
http://svn.reactos.org/svn/reactos?rev=75221&view=rev
Log: [CMLIB]: Adjust the old-style parameter annotations for two functions. Modified: trunk/reactos/sdk/lib/cmlib/cmlib.h trunk/reactos/sdk/lib/cmlib/cmname.c Modified: trunk/reactos/sdk/lib/cmlib/cmlib.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/lib/cmlib/cmlib.h?rev=…
============================================================================== --- trunk/reactos/sdk/lib/cmlib/cmlib.h [iso-8859-1] (original) +++ trunk/reactos/sdk/lib/cmlib/cmlib.h [iso-8859-1] Tue Jun 27 23:46:17 2017 @@ -576,14 +576,14 @@ NTAPI CmpCopyName( IN PHHIVE Hive, - IN PWCHAR Destination, + OUT PWCHAR Destination, IN PUNICODE_STRING Source ); VOID NTAPI CmpCopyCompressedName( - IN PWCHAR Destination, + OUT PWCHAR Destination, IN ULONG DestinationLength, IN PWCHAR Source, IN ULONG SourceLength Modified: trunk/reactos/sdk/lib/cmlib/cmname.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/lib/cmlib/cmname.c?rev…
============================================================================== --- trunk/reactos/sdk/lib/cmlib/cmname.c [iso-8859-1] (original) +++ trunk/reactos/sdk/lib/cmlib/cmname.c [iso-8859-1] Tue Jun 27 23:46:17 2017 @@ -19,7 +19,7 @@ USHORT NTAPI CmpCopyName(IN PHHIVE Hive, - IN PWCHAR Destination, + OUT PWCHAR Destination, IN PUNICODE_STRING Source) { ULONG i; @@ -53,7 +53,7 @@ VOID NTAPI -CmpCopyCompressedName(IN PWCHAR Destination, +CmpCopyCompressedName(OUT PWCHAR Destination, IN ULONG DestinationLength, IN PWCHAR Source, IN ULONG SourceLength)
7 years, 5 months
1
0
0
0
[ashaposhnikov] 75220: [FORMATTING][RAPPS] available.cpp: Fix braces
by ashaposhnikov@svn.reactos.org
Author: ashaposhnikov Date: Tue Jun 27 23:33:15 2017 New Revision: 75220 URL:
http://svn.reactos.org/svn/reactos?rev=75220&view=rev
Log: [FORMATTING][RAPPS] available.cpp: Fix braces Modified: branches/GSoC_2017/rapps/reactos/base/applications/rapps/available.cpp Modified: branches/GSoC_2017/rapps/reactos/base/applications/rapps/available.cpp URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2017/rapps/reactos/base/ap…
============================================================================== --- branches/GSoC_2017/rapps/reactos/base/applications/rapps/available.cpp [iso-8859-1] (original) +++ branches/GSoC_2017/rapps/reactos/base/applications/rapps/available.cpp [iso-8859-1] Tue Jun 27 23:33:15 2017 @@ -9,17 +9,19 @@ #include "rapps.h" -inline void _AddText(UINT a, LPCWSTR b, DWORD c, DWORD d) { - if (b[0] != '\0') - { - WCHAR szText[MAX_STR_LEN]; - LoadStringW(hInst, a, szText, _countof(szText)); - InsertRichEditText(szText, c); - InsertRichEditText(b, d); - } -} - -inline void _AddTextNewl(UINT a, DWORD b) { +inline void _AddText(UINT a, LPCWSTR b, DWORD c, DWORD d) +{ + if (b[0] != '\0') + { + WCHAR szText[MAX_STR_LEN]; + LoadStringW(hInst, a, szText, _countof(szText)); + InsertRichEditText(szText, c); + InsertRichEditText(b, d); + } +} + +inline void _AddTextNewl(UINT a, DWORD b) +{ WCHAR szText[MAX_STR_LEN]; LoadStringW(hInst, a, szText, _countof(szText)); InsertRichEditText(L"\n", 0); @@ -28,15 +30,18 @@ } template<typename T, size_t N, size_t N2> -inline BOOL _GetString(LPCWSTR a, T(&b)[N], T (&cFileName)[N2]) { - return ParserGetString(a, b, N, cFileName); +inline BOOL _GetString(LPCWSTR a, T(&b)[N], T(&cFileName)[N2]) +{ + return ParserGetString(a, b, N, cFileName); } template<typename T, size_t N, size_t N2> -inline void _GetStringNullFailure(LPCWSTR a, T(&b)[N], T (&cFileName)[N2]) { - if (!_GetString(a, b, cFileName)) { - b[0] = '\0'; - } +inline void _GetStringNullFailure(LPCWSTR a, T(&b)[N], T(&cFileName)[N2]) +{ + if (!_GetString(a, b, cFileName)) + { + b[0] = '\0'; + } } //App is "installed" if the RegName or Name is in the registry @@ -52,9 +57,10 @@ //Check both registry keys in 64bit system //TODO: check system type beforehand to avoid double checks? -inline BOOL _AppInstallCheck(PAPPLICATION_INFO Info) { - return _AppInstallCheckWithKey(Info, KEY_WOW64_32KEY) - || _AppInstallCheckWithKey(Info, KEY_WOW64_64KEY); +inline BOOL _AppInstallCheck(PAPPLICATION_INFO Info) +{ + return _AppInstallCheckWithKey(Info, KEY_WOW64_32KEY) + || _AppInstallCheckWithKey(Info, KEY_WOW64_64KEY); } //App is "installed" if the RegName or Name is in the registry @@ -74,7 +80,7 @@ || _GetInstalledVersionWithKey(Info, szVersion, iVersionSize, KEY_WOW64_64KEY); } -LIST_ENTRY CachedEntriesHead = { &CachedEntriesHead, &CachedEntriesHead }; +LIST_ENTRY CachedEntriesHead = {&CachedEntriesHead, &CachedEntriesHead}; PLIST_ENTRY pCachedEntry = &CachedEntriesHead; BOOL @@ -89,14 +95,15 @@ NewRichEditText(Info->szName, CFE_BOLD); if (bIsInstalled) { - _AddTextNewl(IDS_STATUS_INSTALLED, CFE_ITALIC); - if (_GetInstalledVersion(Info, szVersion, _countof(szVersion))) - { - _AddText(IDS_AINFO_VERSION, szVersion, CFE_BOLD, 0); - } - } else - { - _AddTextNewl(IDS_STATUS_NOTINSTALLED, CFE_ITALIC); + _AddTextNewl(IDS_STATUS_INSTALLED, CFE_ITALIC); + if (_GetInstalledVersion(Info, szVersion, _countof(szVersion))) + { + _AddText(IDS_AINFO_VERSION, szVersion, CFE_BOLD, 0); + } + } + else + { + _AddTextNewl(IDS_STATUS_NOTINSTALLED, CFE_ITALIC); } _AddText(IDS_AINFO_AVAILABLEVERSION, Info->szVersion, CFE_BOLD, 0); @@ -125,8 +132,8 @@ return FALSE; hr = StringCbPrintfW(szCabPath, sizeof(szCabPath), - L"%ls\\rappmgr.cab", - szPath); + L"%ls\\rappmgr.cab", + szPath); if (FAILED(hr)) return FALSE; @@ -138,8 +145,8 @@ return FALSE; hr = StringCbPrintfW(szSearchPath, sizeof(szSearchPath), - L"%ls*.txt", - szPath); + L"%ls*.txt", + szPath); if (FAILED(hr)) return FALSE; @@ -151,13 +158,14 @@ do { hr = StringCbPrintfW(szTmp, sizeof(szTmp), - L"%ls%ls", - szPath, FindFileData.cFileName); + L"%ls%ls", + szPath, FindFileData.cFileName); if (FAILED(hr)) continue; result = result && DeleteFileW(szTmp); - } while (FindNextFileW(hFind, &FindFileData) != 0); + } + while (FindNextFileW(hFind, &FindFileData) != 0); FindClose(hFind); @@ -181,15 +189,15 @@ return FALSE; if (FAILED(StringCbPrintfW(szCabPath, sizeof(szCabPath), - L"%ls\\rappmgr.cab", - szPath))) + L"%ls\\rappmgr.cab", + szPath))) { return FALSE; } if (FAILED(StringCbPrintfW(szAppsPath, sizeof(szAppsPath), - L"%ls\\rapps\\", - szPath))) + L"%ls\\rapps\\", + szPath))) { return FALSE; } @@ -215,8 +223,8 @@ return FALSE; hr = StringCbPrintfW(szCabPath, sizeof(szCabPath), - L"%ls\\rappmgr.cab", - szPath); + L"%ls\\rappmgr.cab", + szPath); if (FAILED(hr)) return FALSE; @@ -263,7 +271,7 @@ Info = CONTAINING_RECORD(pCachedEntry, APPLICATION_INFO, List); /* do we already have this entry in cache? */ - if(_wcsicmp(FindFileData.cFileName, Info->cFileName) == 0) + if (_wcsicmp(FindFileData.cFileName, Info->cFileName) == 0) { /* is it current enough, or the file has been modified since our last time here? */ if (CompareFileTime(&FindFileData.ftLastWriteTime, &Info->ftCacheStamp) == 1) @@ -283,21 +291,21 @@ } /* create a new entry */ - Info = (PAPPLICATION_INFO)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(APPLICATION_INFO)); - - if(!Info) + Info = (PAPPLICATION_INFO) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(APPLICATION_INFO)); + + if (!Info) break; Info->Category = ParserGetInt(L"Category", FindFileData.cFileName); /* copy the cache-related fields for the next time */ - RtlCopyMemory(&Info->cFileName, &FindFileData.cFileName, MAX_PATH); + RtlCopyMemory(&Info->cFileName, &FindFileData.cFileName, MAX_PATH); RtlCopyMemory(&Info->ftCacheStamp, &FindFileData.ftLastWriteTime, sizeof(FILETIME)); /* add our cached entry to the cached list */ InsertTailList(&CachedEntriesHead, &Info->List); -skip_if_cached: + skip_if_cached: if (Info->Category == FALSE) continue; @@ -310,26 +318,27 @@ if (Info->szUrlDownload[0] == 0) { - if (!_GetString(L"Name", Info->szName, FindFileData.cFileName) - || !_GetString(L"URLDownload", Info->szUrlDownload, FindFileData.cFileName)) - { - continue; - } - - _GetStringNullFailure(L"RegName", Info->szRegName, FindFileData.cFileName); - _GetStringNullFailure(L"Version", Info->szVersion, FindFileData.cFileName); - _GetStringNullFailure(L"License", Info->szLicense, FindFileData.cFileName); - _GetStringNullFailure(L"Description", Info->szDesc, FindFileData.cFileName); - _GetStringNullFailure(L"Size", Info->szSize, FindFileData.cFileName); - _GetStringNullFailure(L"URLSite", Info->szUrlSite, FindFileData.cFileName); - _GetStringNullFailure(L"CDPath", Info->szCDPath, FindFileData.cFileName); - _GetStringNullFailure(L"SHA1", Info->szSHA1, FindFileData.cFileName); + if (!_GetString(L"Name", Info->szName, FindFileData.cFileName) + || !_GetString(L"URLDownload", Info->szUrlDownload, FindFileData.cFileName)) + { + continue; + } + + _GetStringNullFailure(L"RegName", Info->szRegName, FindFileData.cFileName); + _GetStringNullFailure(L"Version", Info->szVersion, FindFileData.cFileName); + _GetStringNullFailure(L"License", Info->szLicense, FindFileData.cFileName); + _GetStringNullFailure(L"Description", Info->szDesc, FindFileData.cFileName); + _GetStringNullFailure(L"Size", Info->szSize, FindFileData.cFileName); + _GetStringNullFailure(L"URLSite", Info->szUrlSite, FindFileData.cFileName); + _GetStringNullFailure(L"CDPath", Info->szCDPath, FindFileData.cFileName); + _GetStringNullFailure(L"SHA1", Info->szSHA1, FindFileData.cFileName); } if (!lpEnumProc(Info)) break; - } while (FindNextFileW(hFind, &FindFileData) != 0); + } + while (FindNextFileW(hFind, &FindFileData) != 0); FindClose(hFind); @@ -338,16 +347,16 @@ VOID FreeCachedAvailableEntries(VOID) { - PAPPLICATION_INFO Info; - + PAPPLICATION_INFO Info; + /* loop and deallocate all the cached app infos in the list */ for (pCachedEntry = CachedEntriesHead.Flink; pCachedEntry != &CachedEntriesHead;) { - Info = CONTAINING_RECORD(pCachedEntry, APPLICATION_INFO, List); - + Info = CONTAINING_RECORD(pCachedEntry, APPLICATION_INFO, List); + /* grab a reference to the next linked entry before getting rid of the current one */ pCachedEntry = pCachedEntry->Flink; - + /* flush them down the toilet :D */ RemoveEntryList(&Info->List); HeapFree(GetProcessHeap(), 0, Info);
7 years, 5 months
1
0
0
0
[ashaposhnikov] 75219: [RAPPS] * Separated available and installed version. If the app is installed it's DisplayVersion is shown. * Reduced registry key access checks * Version parser WIP
by ashaposhnikov@svn.reactos.org
Author: ashaposhnikov Date: Tue Jun 27 23:21:58 2017 New Revision: 75219 URL:
http://svn.reactos.org/svn/reactos?rev=75219&view=rev
Log: [RAPPS] * Separated available and installed version. If the app is installed it's DisplayVersion is shown. * Reduced registry key access checks * Version parser WIP Modified: branches/GSoC_2017/rapps/reactos/base/applications/rapps/available.cpp branches/GSoC_2017/rapps/reactos/base/applications/rapps/installed.cpp branches/GSoC_2017/rapps/reactos/base/applications/rapps/lang/en-US.rc branches/GSoC_2017/rapps/reactos/base/applications/rapps/lang/ru-RU.rc branches/GSoC_2017/rapps/reactos/base/applications/rapps/lang/uk-UA.rc branches/GSoC_2017/rapps/reactos/base/applications/rapps/misc.cpp branches/GSoC_2017/rapps/reactos/base/applications/rapps/rapps.h branches/GSoC_2017/rapps/reactos/base/applications/rapps/resource.h Modified: branches/GSoC_2017/rapps/reactos/base/applications/rapps/available.cpp URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2017/rapps/reactos/base/ap…
============================================================================== --- branches/GSoC_2017/rapps/reactos/base/applications/rapps/available.cpp [iso-8859-1] (original) +++ branches/GSoC_2017/rapps/reactos/base/applications/rapps/available.cpp [iso-8859-1] Tue Jun 27 23:21:58 2017 @@ -9,20 +9,19 @@ #include "rapps.h" - -template<typename T, size_t N, size_t N2> -inline void _AddText(T (&szText)[N], UINT a, T (&b)[N2], DWORD c, DWORD d) { +inline void _AddText(UINT a, LPCWSTR b, DWORD c, DWORD d) { if (b[0] != '\0') { - LoadStringW(hInst, a, szText, N); + WCHAR szText[MAX_STR_LEN]; + LoadStringW(hInst, a, szText, _countof(szText)); InsertRichEditText(szText, c); InsertRichEditText(b, d); } } -template<typename T, size_t N> -inline void _AddTextNewl(T (&szText)[N], UINT a, DWORD b) { - LoadStringW(hInst, a, szText, N); +inline void _AddTextNewl(UINT a, DWORD b) { + WCHAR szText[MAX_STR_LEN]; + LoadStringW(hInst, a, szText, _countof(szText)); InsertRichEditText(L"\n", 0); InsertRichEditText(szText, b); InsertRichEditText(L"\n", 0); @@ -41,7 +40,7 @@ } //App is "installed" if the RegName or Name is in the registry -inline bool _AppInstallCheckKey(PAPPLICATION_INFO Info, REGSAM key) +inline BOOL _AppInstallCheckWithKey(PAPPLICATION_INFO Info, REGSAM key) { return (*Info->szRegName && (IsInstalledApplication(Info->szRegName, TRUE, key) @@ -53,11 +52,27 @@ //Check both registry keys in 64bit system //TODO: check system type beforehand to avoid double checks? -inline bool _AppInstallCheck(PAPPLICATION_INFO Info) { - return _AppInstallCheckKey(Info, KEY_WOW64_32KEY) - || _AppInstallCheckKey(Info, KEY_WOW64_64KEY); -} - +inline BOOL _AppInstallCheck(PAPPLICATION_INFO Info) { + return _AppInstallCheckWithKey(Info, KEY_WOW64_32KEY) + || _AppInstallCheckWithKey(Info, KEY_WOW64_64KEY); +} + +//App is "installed" if the RegName or Name is in the registry +inline BOOL _GetInstalledVersionWithKey(PAPPLICATION_INFO Info, LPWSTR szVersion, UINT iVersionSize, REGSAM key) +{ + return (*Info->szRegName + && (InstalledVersion(szVersion, iVersionSize, Info->szRegName, TRUE, key) + || InstalledVersion(szVersion, iVersionSize, Info->szRegName, FALSE, key))) + || (*Info->szName && (InstalledVersion(szVersion, iVersionSize, Info->szName, TRUE, key) + || InstalledVersion(szVersion, iVersionSize, Info->szName, FALSE, key))); +} + +//App is "installed" if the RegName or Name is in the registry +inline BOOL _GetInstalledVersion(PAPPLICATION_INFO Info, LPWSTR szVersion, UINT iVersionSize) +{ + return _GetInstalledVersionWithKey(Info, szVersion, iVersionSize, KEY_WOW64_32KEY) + || _GetInstalledVersionWithKey(Info, szVersion, iVersionSize, KEY_WOW64_64KEY); +} LIST_ENTRY CachedEntriesHead = { &CachedEntriesHead, &CachedEntriesHead }; PLIST_ENTRY pCachedEntry = &CachedEntriesHead; @@ -66,25 +81,30 @@ ShowAvailableAppInfo(INT Index) { PAPPLICATION_INFO Info = (PAPPLICATION_INFO) ListViewGetlParam(Index); - WCHAR szText[MAX_STR_LEN]; + BOOL bIsInstalled = _AppInstallCheck(Info); + WCHAR szVersion[MAX_PATH]; if (!Info) return FALSE; NewRichEditText(Info->szName, CFE_BOLD); - if (_AppInstallCheck(Info)) - { - _AddTextNewl(szText, IDS_STATUS_INSTALLED, CFE_ITALIC); + if (bIsInstalled) + { + _AddTextNewl(IDS_STATUS_INSTALLED, CFE_ITALIC); + if (_GetInstalledVersion(Info, szVersion, _countof(szVersion))) + { + _AddText(IDS_AINFO_VERSION, szVersion, CFE_BOLD, 0); + } } else { - _AddTextNewl(szText, IDS_STATUS_NOTINSTALLED, CFE_ITALIC); - } - - _AddText(szText, IDS_AINFO_VERSION, Info->szVersion, CFE_BOLD, 0); - _AddText(szText, IDS_AINFO_LICENSE, Info->szLicense, CFE_BOLD, 0); - _AddText(szText, IDS_AINFO_SIZE, Info->szSize, CFE_BOLD, 0); - _AddText(szText, IDS_AINFO_URLSITE, Info->szUrlSite, CFE_BOLD, CFE_LINK); - _AddText(szText, IDS_AINFO_DESCRIPTION, Info->szDesc, CFE_BOLD, 0); - _AddText(szText, IDS_AINFO_URLDOWNLOAD, Info->szUrlDownload, CFE_BOLD, CFE_LINK); + _AddTextNewl(IDS_STATUS_NOTINSTALLED, CFE_ITALIC); + } + + _AddText(IDS_AINFO_AVAILABLEVERSION, Info->szVersion, CFE_BOLD, 0); + _AddText(IDS_AINFO_LICENSE, Info->szLicense, CFE_BOLD, 0); + _AddText(IDS_AINFO_SIZE, Info->szSize, CFE_BOLD, 0); + _AddText(IDS_AINFO_URLSITE, Info->szUrlSite, CFE_BOLD, CFE_LINK); + _AddText(IDS_AINFO_DESCRIPTION, Info->szDesc, CFE_BOLD, 0); + _AddText(IDS_AINFO_URLDOWNLOAD, Info->szUrlDownload, CFE_BOLD, CFE_LINK); return TRUE; } Modified: branches/GSoC_2017/rapps/reactos/base/applications/rapps/installed.cpp URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2017/rapps/reactos/base/ap…
============================================================================== --- branches/GSoC_2017/rapps/reactos/base/applications/rapps/installed.cpp [iso-8859-1] (original) +++ branches/GSoC_2017/rapps/reactos/base/applications/rapps/installed.cpp [iso-8859-1] Tue Jun 27 23:21:58 2017 @@ -35,11 +35,12 @@ { HKEY hKey = NULL; BOOL IsInstalled = FALSE; - - if ((RegOpenKeyExW(IsUserKey ? HKEY_CURRENT_USER : HKEY_LOCAL_MACHINE, - L"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall", 0, keyWow | KEY_ENUMERATE_SUB_KEYS, - &hKey) == ERROR_SUCCESS) \ - && FindRegistryKeyByName(hKey, keyWow, lpRegName, NULL)) + WCHAR szPath[MAX_PATH] = L"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall"; + StringCbPrintfW(szPath, _countof(szPath), L"%ls\\%ls", szPath, lpRegName); + + if (RegOpenKeyExW(IsUserKey ? HKEY_CURRENT_USER : HKEY_LOCAL_MACHINE, + szPath, 0, keyWow | KEY_READ, + &hKey) == ERROR_SUCCESS) { IsInstalled = TRUE; } @@ -52,35 +53,31 @@ { DWORD dwSize = MAX_PATH; DWORD dwType = REG_SZ; - WCHAR szVersion[MAX_PATH]; - HKEY hKey, hSubKey; - BOOL HasVersion = FALSE; + WCHAR szVersion[MAX_PATH] = L""; + HKEY hKey; + BOOL bHasVersion = FALSE; iVersionResultSize = 0; + WCHAR szPath[MAX_PATH] = L"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall"; + StringCbPrintfW(szPath, _countof(szPath), L"%ls\\%ls", szPath, lpRegName); if (RegOpenKeyExW(IsUserKey ? HKEY_CURRENT_USER : HKEY_LOCAL_MACHINE, - L"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall", 0, keyWow | KEY_ENUMERATE_SUB_KEYS, + szPath, 0, keyWow | KEY_READ, &hKey) == ERROR_SUCCESS) { - if (FindRegistryKeyByName(hKey, keyWow, lpRegName, &hSubKey)) + dwSize = MAX_PATH; + if (RegQueryValueExW(hKey, + L"DisplayVersion", + NULL, + &dwType, + (LPBYTE) szVersion, + &dwSize) == ERROR_SUCCESS) { - dwSize = sizeof(szVersion); - if (RegQueryValueExW(hSubKey, - L"DisplayVersion", - NULL, - &dwType, - (LPBYTE) szVersion, - &dwSize) == ERROR_SUCCESS) - { - szVersionResult = szVersion; - iVersionResultSize = dwSize; - HasVersion = TRUE; - } + StringCbCopyW(szVersionResult, dwSize, szVersion); + bHasVersion = TRUE; } - RegCloseKey(hSubKey); - } - + } RegCloseKey(hKey); - return HasVersion; + return bHasVersion; } Modified: branches/GSoC_2017/rapps/reactos/base/applications/rapps/lang/en-US.rc URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2017/rapps/reactos/base/ap…
============================================================================== --- branches/GSoC_2017/rapps/reactos/base/applications/rapps/lang/en-US.rc [iso-8859-1] (original) +++ branches/GSoC_2017/rapps/reactos/base/applications/rapps/lang/en-US.rc [iso-8859-1] Tue Jun 27 23:21:58 2017 @@ -152,6 +152,7 @@ STRINGTABLE BEGIN IDS_AINFO_VERSION "\nVersion: " + IDS_AINFO_AVAILABLEVERSION "\nAvailable Version: " IDS_AINFO_DESCRIPTION "\nDescription: " IDS_AINFO_SIZE "\nSize: " IDS_AINFO_URLSITE "\nHome Page: " Modified: branches/GSoC_2017/rapps/reactos/base/applications/rapps/lang/ru-RU.rc URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2017/rapps/reactos/base/ap…
============================================================================== --- branches/GSoC_2017/rapps/reactos/base/applications/rapps/lang/ru-RU.rc [iso-8859-1] (original) +++ branches/GSoC_2017/rapps/reactos/base/applications/rapps/lang/ru-RU.rc [iso-8859-1] Tue Jun 27 23:21:58 2017 @@ -152,6 +152,7 @@ STRINGTABLE BEGIN IDS_AINFO_VERSION "\nÐеÑÑиÑ: " + IDS_AINFO_AVAILABLEVERSION "\nÐоÑÑÑÐ¿Ð½Ð°Ñ Ð²ÐµÑÑиÑ: " IDS_AINFO_DESCRIPTION "\nÐпиÑание: " IDS_AINFO_SIZE "\nРазмеÑ: " IDS_AINFO_URLSITE "\nÐомаÑнÑÑ ÑÑÑаниÑа: " Modified: branches/GSoC_2017/rapps/reactos/base/applications/rapps/lang/uk-UA.rc URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2017/rapps/reactos/base/ap…
============================================================================== --- branches/GSoC_2017/rapps/reactos/base/applications/rapps/lang/uk-UA.rc [iso-8859-1] (original) +++ branches/GSoC_2017/rapps/reactos/base/applications/rapps/lang/uk-UA.rc [iso-8859-1] Tue Jun 27 23:21:58 2017 @@ -160,6 +160,7 @@ STRINGTABLE BEGIN IDS_AINFO_VERSION "\nÐеÑÑÑÑ: " + IDS_AINFO_AVAILABLEVERSION "\nÐоÑÑÑпна веÑÑÑÑ: " IDS_AINFO_DESCRIPTION "\nÐпиÑ: " IDS_AINFO_SIZE "\nРозмÑÑ: " IDS_AINFO_URLSITE "\nÐомаÑÐ½Ñ ÑÑоÑÑнка: " Modified: branches/GSoC_2017/rapps/reactos/base/applications/rapps/misc.cpp URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2017/rapps/reactos/base/ap…
============================================================================== --- branches/GSoC_2017/rapps/reactos/base/applications/rapps/misc.cpp [iso-8859-1] (original) +++ branches/GSoC_2017/rapps/reactos/base/applications/rapps/misc.cpp [iso-8859-1] Tue Jun 27 23:21:58 2017 @@ -8,6 +8,8 @@ */ #include "rapps.h" +#include <atlsimpcoll.h> +#include <atlstr.h> /* SESSION Operation */ #define EXTRACT_FILLFILELIST 0x00000001 @@ -495,29 +497,70 @@ RtlInitUnicodeString(&BufferW, Buffer); RtlUnicodeStringToInteger(&BufferW, 0, &Result); - return Result; -} - - + return (UINT)Result; +} + +//Parses version string that can be formatted as 1.2.3.4-5 +//Returns int buffer and it's size BOOL -ParseVersion(LPWSTR szVersion, INT* version) -{ +ParseVersion(_In_z_ LPCWSTR szVersion, _Outptr_ INT* parrVersion, _Out_opt_ UINT iVersionSize) +{ + ATL::CSimpleArray<int> arrVersionResult; + ATL::CStringW szVersionSingleInt = L""; + ATL::CStringW sDelimiters = L".-"; + BOOL bHasParsed = TRUE; + INT iVersionCharCount = 0; + //INT iVersionSingleCharCount = 0; + INT iIntResult; + iVersionSize = 0; + while(szVersion[iVersionCharCount] != L'\0') + { + for (;!sDelimiters.Find(szVersion[iVersionCharCount]); ++iVersionCharCount) + { + szVersionSingleInt += szVersion[iVersionCharCount]; + } + szVersionSingleInt += L'\0'; + iIntResult = StrToIntW(szVersionSingleInt.GetBuffer()); + if (iIntResult) + { + arrVersionResult.Add(iIntResult); + iVersionSize++; + } + else + { + bHasParsed = FALSE; + } + ++iVersionCharCount; + } + parrVersion = arrVersionResult.GetData(); + return bHasParsed; +} + +//Compares versions +//In: Zero terminated strings of versions +//Out: TRUE if first is bigger than second, FALSE if else +BOOL +CompareVersionsBigger(_In_z_ LPCWSTR sczVersion1, _In_z_ LPCWSTR sczVersion2, _Out_ BOOL bResult) +{ + UINT iVersionSize1 = 0; + UINT iVersionSize2 = 0; + INT *parrVersion1 = NULL, *parrVersion2 = NULL; + bResult = FALSE; + + if (!ParseVersion(sczVersion1, parrVersion1, iVersionSize1) + || !ParseVersion(sczVersion2, parrVersion2, iVersionSize2)) + { + return FALSE; + } + + for (INT i = 0; i < iVersionSize1 && i < iVersionSize2; ++i) + { + if (parrVersion1[i] > parrVersion2[i]) + { + bResult = TRUE; + return TRUE; + } + } + return TRUE; -} - - -//Finds subkey in key by name or path and returns it -BOOL -FindRegistryKeyByName(_In_ HKEY hKeyBase, _In_ REGSAM keyWow, _In_ LPCWSTR lpcKey, _Out_opt_ PHKEY hKeyResult) -{ - HKEY hSubKey; - if (RegOpenKeyExW(hKeyBase, lpcKey, 0, keyWow | KEY_READ, &hSubKey) == ERROR_SUCCESS) - { - hKeyResult = &hSubKey; - return TRUE; - } - hKeyResult = NULL; - RegCloseKey(hSubKey); - return FALSE; -} - +} Modified: branches/GSoC_2017/rapps/reactos/base/applications/rapps/rapps.h URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2017/rapps/reactos/base/ap…
============================================================================== --- branches/GSoC_2017/rapps/reactos/base/applications/rapps/rapps.h [iso-8859-1] (original) +++ branches/GSoC_2017/rapps/reactos/base/applications/rapps/rapps.h [iso-8859-1] Tue Jun 27 23:21:58 2017 @@ -181,7 +181,9 @@ UINT ParserGetString(LPCWSTR lpKeyName, LPWSTR lpReturnedString, UINT nSize, LPCWSTR lpFileName); UINT ParserGetInt(LPCWSTR lpKeyName, LPCWSTR lpFileName); +BOOL ParseVersion(_In_z_ LPCWSTR szVersion, _Outptr_ INT* parrVersion, _Out_opt_ UINT iVersionSize); BOOL FindRegistryKeyByName(_In_ HKEY hKeyBase, _In_ REGSAM keyWow, _In_ LPCWSTR lpcKey, _Out_opt_ PHKEY hKeyResult); +BOOL CompareVersionsBigger(_In_z_ LPCWSTR sczVersion1, _In_z_ LPCWSTR sczVersion2, _Out_ BOOL bResult = FALSE); /* settingsdlg.c */ VOID CreateSettingsDlg(HWND hwnd); Modified: branches/GSoC_2017/rapps/reactos/base/applications/rapps/resource.h URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2017/rapps/reactos/base/ap…
============================================================================== --- branches/GSoC_2017/rapps/reactos/base/applications/rapps/resource.h [iso-8859-1] (original) +++ branches/GSoC_2017/rapps/reactos/base/applications/rapps/resource.h [iso-8859-1] Tue Jun 27 23:21:58 2017 @@ -119,31 +119,33 @@ #define IDS_APP_DESCRIPTION 252 /* Apps info */ -#define IDS_INFO_VERSION 280 -#define IDS_INFO_DESCRIPTION 281 -#define IDS_INFO_PUBLISHER 282 -#define IDS_INFO_HELPLINK 283 -#define IDS_INFO_HELPPHONE 284 -#define IDS_INFO_README 285 -#define IDS_INFO_REGOWNER 286 -#define IDS_INFO_PRODUCTID 287 -#define IDS_INFO_CONTACT 288 -#define IDS_INFO_UPDATEINFO 289 -#define IDS_INFO_INFOABOUT 290 -#define IDS_INFO_COMMENTS 291 -#define IDS_INFO_INSTLOCATION 292 -#define IDS_INFO_INSTALLSRC 293 -#define IDS_INFO_UNINSTALLSTR 294 -#define IDS_INFO_MODIFYPATH 295 -#define IDS_INFO_INSTALLDATE 296 +#define IDS_INFO_VERSION 280 +#define IDS_INFO_DESCRIPTION 281 +#define IDS_INFO_PUBLISHER 282 +#define IDS_INFO_HELPLINK 283 +#define IDS_INFO_HELPPHONE 284 +#define IDS_INFO_README 285 +#define IDS_INFO_REGOWNER 286 +#define IDS_INFO_PRODUCTID 287 +#define IDS_INFO_CONTACT 288 +#define IDS_INFO_UPDATEINFO 289 +#define IDS_INFO_INFOABOUT 290 +#define IDS_INFO_COMMENTS 291 +#define IDS_INFO_INSTLOCATION 292 +#define IDS_INFO_INSTALLSRC 293 +#define IDS_INFO_UNINSTALLSTR 294 +#define IDS_INFO_MODIFYPATH 295 +#define IDS_INFO_INSTALLDATE 296 /* Info for available apps */ -#define IDS_AINFO_VERSION 350 -#define IDS_AINFO_DESCRIPTION 351 -#define IDS_AINFO_SIZE 352 -#define IDS_AINFO_URLSITE 353 -#define IDS_AINFO_LICENSE 354 -#define IDS_AINFO_URLDOWNLOAD 355 +#define IDS_AINFO_VERSION 350 +#define IDS_AINFO_DESCRIPTION 351 +#define IDS_AINFO_SIZE 352 +#define IDS_AINFO_URLSITE 353 +#define IDS_AINFO_LICENSE 354 +#define IDS_AINFO_URLDOWNLOAD 355 +#define IDS_AINFO_AVAILABLEVERSION 356 + /* Names of categories */ #define IDS_CAT_AUDIO 700
7 years, 5 months
1
0
0
0
[mjansen] 75218: [SHIMDBG] Add option to dump file properties.
by mjansen@svn.reactos.org
Author: mjansen Date: Tue Jun 27 20:27:31 2017 New Revision: 75218 URL:
http://svn.reactos.org/svn/reactos?rev=75218&view=rev
Log: [SHIMDBG] Add option to dump file properties. Modified: trunk/rosapps/applications/devutils/shimdbg/shimdbg.c Modified: trunk/rosapps/applications/devutils/shimdbg/shimdbg.c URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/applications/devutils/shim…
============================================================================== --- trunk/rosapps/applications/devutils/shimdbg/shimdbg.c [iso-8859-1] (original) +++ trunk/rosapps/applications/devutils/shimdbg/shimdbg.c [iso-8859-1] Tue Jun 27 20:27:31 2017 @@ -66,7 +66,7 @@ int IsOpt(char* argv, const char* check) { if( argv && (argv[0] == '-' || argv[0] == '/') ) { - return !stricmp(argv + 1, check); + return !_strnicmp(argv + 1, check, strlen(check)); } return 0; } @@ -86,6 +86,129 @@ return 1; } +typedef WORD TAG; +typedef UINT64 QWORD; + +#define TAG_TYPE_MASK 0xF000 +#define TAG_TYPE_DWORD 0x4000 +#define TAG_TYPE_QWORD 0x5000 +#define TAG_TYPE_STRINGREF 0x6000 + +#define ATTRIBUTE_AVAILABLE 0x1 +#define ATTRIBUTE_FAILED 0x2 + +typedef struct tagATTRINFO +{ + TAG type; + DWORD flags; /* ATTRIBUTE_AVAILABLE, ATTRIBUTE_FAILED */ + union + { + QWORD qwattr; + DWORD dwattr; + WCHAR *lpattr; + }; +} ATTRINFO, *PATTRINFO; + +static PVOID hdll; +static LPCWSTR (WINAPI *pSdbTagToString)(TAG); +static BOOL (WINAPI *pSdbGetFileAttributes)(LPCWSTR, PATTRINFO *, LPDWORD); +static BOOL (WINAPI *pSdbFreeFileAttributes)(PATTRINFO); + +static BOOL InitApphelp() +{ + if (!hdll) + { + static UNICODE_STRING DllName = RTL_CONSTANT_STRING(L"apphelp.dll"); + static ANSI_STRING SdbTagToString = RTL_CONSTANT_STRING("SdbTagToString"); + static ANSI_STRING SdbGetFileAttributes = RTL_CONSTANT_STRING("SdbGetFileAttributes"); + static ANSI_STRING SdbFreeFileAttributes = RTL_CONSTANT_STRING("SdbFreeFileAttributes"); + if (!NT_SUCCESS(LdrLoadDll(NULL, NULL, &DllName, &hdll))) + { + printf("Unable to load apphelp.dll\n"); + return FALSE; + } + if (!NT_SUCCESS(LdrGetProcedureAddress(hdll, &SdbTagToString, 0, (PVOID)&pSdbTagToString)) || + !NT_SUCCESS(LdrGetProcedureAddress(hdll, &SdbGetFileAttributes, 0, (PVOID)&pSdbGetFileAttributes)) || + !NT_SUCCESS(LdrGetProcedureAddress(hdll, &SdbFreeFileAttributes, 0, (PVOID)&pSdbFreeFileAttributes))) + { + LdrUnloadDll(hdll); + hdll = NULL; + printf("Unable to resolve functions\n"); + return FALSE; + } + } + return TRUE; +} + + +int HandleDumpAttributes(int argc, char* argv[], int* pn, const char* opt) +{ + UNICODE_STRING FileName; + PATTRINFO attr; + DWORD num_attr, n; + int argn = *pn; + const char* arg; + + if (!InitApphelp()) + return 1; + + if (strlen(argv[argn]) > (strlen(opt)+1)) + { + arg = argv[argn] + strlen(opt); + } + else if (argn+1 >= argc) + { + printf("Error: no image name specified\n"); + return 1; + } + else + { + arg = argv[argn+1]; + (*pn) += 1; + } + + RtlCreateUnicodeStringFromAsciiz(&FileName, arg); + + if (pSdbGetFileAttributes(FileName.Buffer, &attr, &num_attr)) + { + printf("Dumping attributes for %s\n", arg); + for (n = 0; n < num_attr; ++n) + { + TAG tagType; + LPCWSTR tagName; + if (attr[n].flags != ATTRIBUTE_AVAILABLE) + continue; + + tagName = pSdbTagToString(attr[n].type); + + tagType = attr[n].type & TAG_TYPE_MASK; + switch (tagType) + { + case TAG_TYPE_DWORD: + printf("<%ls>0x%lx</%ls><!-- %ld -->\n", tagName, attr[n].dwattr, tagName, attr[n].dwattr); + break; + case TAG_TYPE_STRINGREF: + printf("<%ls>0x%ls</%ls>\n", tagName, attr[n].lpattr, tagName); + break; + case TAG_TYPE_QWORD: + printf("<%ls>0x%I64x</%ls><!-- %I64d -->\n", tagName, attr[n].qwattr, tagName, attr[n].qwattr); + break; + default: + printf("<!-- Unknown tag type: 0x%x (from 0x%x)\n", tagType, attr[n].type); + break; + } + } + printf("Done\n"); + } + else + { + printf("Unable to get attributes from %s\n", arg); + } + + + RtlFreeUnicodeString(&FileName); + return 0; +} UNICODE_STRING AppCompatCacheKey = RTL_CONSTANT_STRING(L"\\Registry\\MACHINE\\System\\CurrentControlSet\\Control\\Session Manager\\AppCompatCache"); OBJECT_ATTRIBUTES AppCompatKeyAttributes = RTL_CONSTANT_OBJECT_ATTRIBUTES(&AppCompatCacheKey, OBJ_CASE_INSENSITIVE); @@ -221,6 +344,10 @@ { unhandled |= HandleImageArg(argc, argv, &n, 'r', ApphelpCacheServiceRemove, "ApphelpCacheServiceRemove"); + } + else if (IsOpt(arg, "a")) + { + unhandled |= HandleDumpAttributes(argc, argv, &n, "a"); } else if (IsOpt(arg, "k")) { @@ -246,6 +373,7 @@ printf(" -U: Update (insert) <image> in the shim cache without mapping it\n"); printf(" -r: Remove <image> from the shim cache\n"); printf(" -R: Remove <image> from the shim cache without mapping it\n"); + printf(" -a: Dump file attributes as used in the appcompat database\n"); printf(" -k: Keep the console open\n"); } if (keepopen)
7 years, 5 months
1
0
0
0
[mjansen] 75217: [APPWIZ] Enable the 'Cancel' button while downloading. Patch by Jared Smudde and 'thc'. CORE-9629
by mjansen@svn.reactos.org
Author: mjansen Date: Tue Jun 27 20:09:53 2017 New Revision: 75217 URL:
http://svn.reactos.org/svn/reactos?rev=75217&view=rev
Log: [APPWIZ] Enable the 'Cancel' button while downloading. Patch by Jared Smudde and 'thc'. CORE-9629 Modified: trunk/reactos/dll/cpl/appwiz/addons.c Modified: trunk/reactos/dll/cpl/appwiz/addons.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/appwiz/addons.c?re…
============================================================================== --- trunk/reactos/dll/cpl/appwiz/addons.c [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/appwiz/addons.c [iso-8859-1] Tue Jun 27 20:09:53 2017 @@ -59,6 +59,7 @@ static const addon_info_t *addon; static HWND install_dialog = NULL; +static IBinding *download_binding; static WCHAR GeckoUrl[] = L"
https://svn.reactos.org/amine/wine_gecko-2.40-x86.msi
"; @@ -259,6 +260,9 @@ DWORD dwReserved, IBinding *pib) { set_status(IDS_DOWNLOADING); + IBinding_AddRef(pib); + download_binding = pib; + return S_OK; } @@ -290,8 +294,16 @@ static HRESULT WINAPI InstallCallback_OnStopBinding(IBindStatusCallback *iface, HRESULT hresult, LPCWSTR szError) { + if(download_binding) { + IBinding_Release(download_binding); + download_binding = NULL; + } + if(FAILED(hresult)) { - ERR("Binding failed %08x\n", hresult); + if(hresult == E_ABORT) + TRACE("Binding aborted\n"); + else + ERR("Binding failed %08x\n", hresult); return S_OK; } @@ -350,16 +362,15 @@ hres = URLDownloadToFileW(NULL, GeckoUrl, tmp_file, 0, &InstallCallback); if(FAILED(hres)) { ERR("URLDownloadToFile failed: %08x\n", hres); - return 0; - } - - if(sha_check(tmp_file)) { - install_file(tmp_file); - }else { - WCHAR message[256]; - - if(LoadStringW(hApplet, IDS_INVALID_SHA, message, sizeof(message)/sizeof(WCHAR))) { - MessageBoxW(NULL, message, NULL, MB_ICONERROR); + } else { + if(sha_check(tmp_file)) { + install_file(tmp_file); + }else { + WCHAR message[256]; + + if(LoadStringW(hApplet, IDS_INVALID_SHA, message, sizeof(message)/sizeof(WCHAR))) { + MessageBoxW(NULL, message, NULL, MB_ICONERROR); + } } } @@ -382,13 +393,17 @@ case WM_COMMAND: switch(wParam) { case IDCANCEL: - EndDialog(hwnd, 0); + if(download_binding) { + IBinding_Abort(download_binding); + } + else { + EndDialog(hwnd, 0); + } return FALSE; case ID_DWL_INSTALL: ShowWindow(GetDlgItem(hwnd, ID_DWL_PROGRESS), SW_SHOW); EnableWindow(GetDlgItem(hwnd, ID_DWL_INSTALL), 0); - EnableWindow(GetDlgItem(hwnd, IDCANCEL), 0); /* FIXME */ CloseHandle( CreateThread(NULL, 0, download_proc, NULL, 0, NULL)); return FALSE; }
7 years, 5 months
1
0
0
0
[gadamopoulos] 75216: [BROWSEUI] -CBandSite: Implement the context menu of the rebar. It queries the IContextMenu if the band and appends to it a static menu part that can show or hide the title an...
by gadamopoulos@svn.reactos.org
Author: gadamopoulos Date: Tue Jun 27 10:05:59 2017 New Revision: 75216 URL:
http://svn.reactos.org/svn/reactos?rev=75216&view=rev
Log: [BROWSEUI] -CBandSite: Implement the context menu of the rebar. It queries the IContextMenu if the band and appends to it a static menu part that can show or hide the title and close the toolbar. Showing or hiding the title isn't implemented yet. Modified: trunk/reactos/dll/win32/browseui/lang/bg-BG.rc trunk/reactos/dll/win32/browseui/lang/de-DE.rc trunk/reactos/dll/win32/browseui/lang/en-US.rc trunk/reactos/dll/win32/browseui/lang/es-ES.rc trunk/reactos/dll/win32/browseui/lang/fr-FR.rc trunk/reactos/dll/win32/browseui/lang/he-IL.rc trunk/reactos/dll/win32/browseui/lang/it-IT.rc trunk/reactos/dll/win32/browseui/lang/ja-JP.rc trunk/reactos/dll/win32/browseui/lang/pl-PL.rc trunk/reactos/dll/win32/browseui/lang/pt-BR.rc trunk/reactos/dll/win32/browseui/lang/ro-RO.rc trunk/reactos/dll/win32/browseui/lang/ru-RU.rc trunk/reactos/dll/win32/browseui/lang/sq-AL.rc trunk/reactos/dll/win32/browseui/lang/tr-TR.rc trunk/reactos/dll/win32/browseui/lang/uk-UA.rc trunk/reactos/dll/win32/browseui/lang/zh-CN.rc trunk/reactos/dll/win32/browseui/lang/zh-TW.rc trunk/reactos/dll/win32/browseui/resource.h trunk/reactos/dll/win32/browseui/shellbars/CBandSite.cpp trunk/reactos/dll/win32/browseui/shellbars/CBandSite.h trunk/reactos/dll/win32/browseui/shellbars/shellbars.h Modified: trunk/reactos/dll/win32/browseui/lang/bg-BG.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/browseui/lang/bg…
============================================================================== --- trunk/reactos/dll/win32/browseui/lang/bg-BG.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/browseui/lang/bg-BG.rc [iso-8859-1] Tue Jun 27 10:05:59 2017 @@ -87,6 +87,12 @@ END END +IDM_BAND_MENU MENUEX +BEGIN + MENUITEM "Sho&w title", IDM_BAND_TITLE + MENUITEM "&Close toolbar", IDM_BAND_CLOSE +END + /* Dialogs */ IDD_PROGRESS_DLG DIALOGEX 0, 0, 260, 85 Modified: trunk/reactos/dll/win32/browseui/lang/de-DE.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/browseui/lang/de…
============================================================================== --- trunk/reactos/dll/win32/browseui/lang/de-DE.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/browseui/lang/de-DE.rc [iso-8859-1] Tue Jun 27 10:05:59 2017 @@ -105,6 +105,12 @@ END END +IDM_BAND_MENU MENUEX +BEGIN + MENUITEM "Sho&w title", IDM_BAND_TITLE + MENUITEM "&Close toolbar", IDM_BAND_CLOSE +END + /* Dialogs */ IDD_PROGRESS_DLG DIALOGEX 0, 0, 260, 85 Modified: trunk/reactos/dll/win32/browseui/lang/en-US.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/browseui/lang/en…
============================================================================== --- trunk/reactos/dll/win32/browseui/lang/en-US.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/browseui/lang/en-US.rc [iso-8859-1] Tue Jun 27 10:05:59 2017 @@ -105,6 +105,12 @@ END END +IDM_BAND_MENU MENUEX +BEGIN + MENUITEM "Sho&w title", IDM_BAND_TITLE + MENUITEM "&Close toolbar", IDM_BAND_CLOSE +END + /* Dialogs */ IDD_PROGRESS_DLG DIALOGEX 0, 0, 260, 85 Modified: trunk/reactos/dll/win32/browseui/lang/es-ES.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/browseui/lang/es…
============================================================================== --- trunk/reactos/dll/win32/browseui/lang/es-ES.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/browseui/lang/es-ES.rc [iso-8859-1] Tue Jun 27 10:05:59 2017 @@ -89,6 +89,12 @@ END END +IDM_BAND_MENU MENUEX +BEGIN + MENUITEM "Sho&w title", IDM_BAND_TITLE + MENUITEM "&Close toolbar", IDM_BAND_CLOSE +END + /* Dialogs */ IDD_PROGRESS_DLG DIALOGEX 0, 0, 260, 85 Modified: trunk/reactos/dll/win32/browseui/lang/fr-FR.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/browseui/lang/fr…
============================================================================== --- trunk/reactos/dll/win32/browseui/lang/fr-FR.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/browseui/lang/fr-FR.rc [iso-8859-1] Tue Jun 27 10:05:59 2017 @@ -105,6 +105,12 @@ END END +IDM_BAND_MENU MENUEX +BEGIN + MENUITEM "Sho&w title", IDM_BAND_TITLE + MENUITEM "&Close toolbar", IDM_BAND_CLOSE +END + /* Dialogs */ IDD_PROGRESS_DLG DIALOGEX 0, 0, 260, 85 Modified: trunk/reactos/dll/win32/browseui/lang/he-IL.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/browseui/lang/he…
============================================================================== --- trunk/reactos/dll/win32/browseui/lang/he-IL.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/browseui/lang/he-IL.rc [iso-8859-1] Tue Jun 27 10:05:59 2017 @@ -89,6 +89,12 @@ END END +IDM_BAND_MENU MENUEX +BEGIN + MENUITEM "Sho&w title", IDM_BAND_TITLE + MENUITEM "&Close toolbar", IDM_BAND_CLOSE +END + /* Dialogs */ IDD_PROGRESS_DLG DIALOGEX 0, 0, 260, 85 Modified: trunk/reactos/dll/win32/browseui/lang/it-IT.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/browseui/lang/it…
============================================================================== --- trunk/reactos/dll/win32/browseui/lang/it-IT.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/browseui/lang/it-IT.rc [iso-8859-1] Tue Jun 27 10:05:59 2017 @@ -87,6 +87,12 @@ END END +IDM_BAND_MENU MENUEX +BEGIN + MENUITEM "Sho&w title", IDM_BAND_TITLE + MENUITEM "&Close toolbar", IDM_BAND_CLOSE +END + /* Dialogs */ IDD_PROGRESS_DLG DIALOGEX 0, 0, 260, 85 Modified: trunk/reactos/dll/win32/browseui/lang/ja-JP.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/browseui/lang/ja…
============================================================================== --- trunk/reactos/dll/win32/browseui/lang/ja-JP.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/browseui/lang/ja-JP.rc [iso-8859-1] Tue Jun 27 10:05:59 2017 @@ -105,6 +105,12 @@ END END +IDM_BAND_MENU MENUEX +BEGIN + MENUITEM "Sho&w title", IDM_BAND_TITLE + MENUITEM "&Close toolbar", IDM_BAND_CLOSE +END + /* Dialogs */ IDD_PROGRESS_DLG DIALOGEX 0, 0, 260, 85 Modified: trunk/reactos/dll/win32/browseui/lang/pl-PL.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/browseui/lang/pl…
============================================================================== --- trunk/reactos/dll/win32/browseui/lang/pl-PL.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/browseui/lang/pl-PL.rc [iso-8859-1] Tue Jun 27 10:05:59 2017 @@ -95,6 +95,12 @@ END END +IDM_BAND_MENU MENUEX +BEGIN + MENUITEM "Sho&w title", IDM_BAND_TITLE + MENUITEM "&Close toolbar", IDM_BAND_CLOSE +END + /* Dialogs */ IDD_PROGRESS_DLG DIALOGEX 0, 0, 260, 85 Modified: trunk/reactos/dll/win32/browseui/lang/pt-BR.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/browseui/lang/pt…
============================================================================== --- trunk/reactos/dll/win32/browseui/lang/pt-BR.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/browseui/lang/pt-BR.rc [iso-8859-1] Tue Jun 27 10:05:59 2017 @@ -89,6 +89,12 @@ END END +IDM_BAND_MENU MENUEX +BEGIN + MENUITEM "Sho&w title", IDM_BAND_TITLE + MENUITEM "&Close toolbar", IDM_BAND_CLOSE +END + /* Dialogs */ IDD_PROGRESS_DLG DIALOGEX 0, 0, 260, 85 Modified: trunk/reactos/dll/win32/browseui/lang/ro-RO.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/browseui/lang/ro…
============================================================================== --- trunk/reactos/dll/win32/browseui/lang/ro-RO.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/browseui/lang/ro-RO.rc [iso-8859-1] Tue Jun 27 10:05:59 2017 @@ -89,6 +89,12 @@ END END +IDM_BAND_MENU MENUEX +BEGIN + MENUITEM "Sho&w title", IDM_BAND_TITLE + MENUITEM "&Close toolbar", IDM_BAND_CLOSE +END + /* Dialogs */ IDD_PROGRESS_DLG DIALOGEX 0, 0, 260, 85 Modified: trunk/reactos/dll/win32/browseui/lang/ru-RU.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/browseui/lang/ru…
============================================================================== --- trunk/reactos/dll/win32/browseui/lang/ru-RU.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/browseui/lang/ru-RU.rc [iso-8859-1] Tue Jun 27 10:05:59 2017 @@ -89,6 +89,12 @@ END END +IDM_BAND_MENU MENUEX +BEGIN + MENUITEM "Sho&w title", IDM_BAND_TITLE + MENUITEM "&Close toolbar", IDM_BAND_CLOSE +END + /* Dialogs */ IDD_PROGRESS_DLG DIALOGEX 0, 0, 260, 85 Modified: trunk/reactos/dll/win32/browseui/lang/sq-AL.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/browseui/lang/sq…
============================================================================== --- trunk/reactos/dll/win32/browseui/lang/sq-AL.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/browseui/lang/sq-AL.rc [iso-8859-1] Tue Jun 27 10:05:59 2017 @@ -106,6 +106,12 @@ END END +IDM_BAND_MENU MENUEX +BEGIN + MENUITEM "Sho&w title", IDM_BAND_TITLE + MENUITEM "&Close toolbar", IDM_BAND_CLOSE +END + /* Dialogs */ IDD_PROGRESS_DLG DIALOGEX 0, 0, 260, 85 Modified: trunk/reactos/dll/win32/browseui/lang/tr-TR.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/browseui/lang/tr…
============================================================================== --- trunk/reactos/dll/win32/browseui/lang/tr-TR.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/browseui/lang/tr-TR.rc [iso-8859-1] Tue Jun 27 10:05:59 2017 @@ -89,6 +89,12 @@ END END +IDM_BAND_MENU MENUEX +BEGIN + MENUITEM "Sho&w title", IDM_BAND_TITLE + MENUITEM "&Close toolbar", IDM_BAND_CLOSE +END + /* Dialogs */ IDD_PROGRESS_DLG DIALOGEX 0, 0, 260, 85 Modified: trunk/reactos/dll/win32/browseui/lang/uk-UA.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/browseui/lang/uk…
============================================================================== --- trunk/reactos/dll/win32/browseui/lang/uk-UA.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/browseui/lang/uk-UA.rc [iso-8859-1] Tue Jun 27 10:05:59 2017 @@ -89,6 +89,12 @@ END END +IDM_BAND_MENU MENUEX +BEGIN + MENUITEM "Sho&w title", IDM_BAND_TITLE + MENUITEM "&Close toolbar", IDM_BAND_CLOSE +END + /* Dialogs */ IDD_PROGRESS_DLG DIALOGEX 0, 0, 260, 85 Modified: trunk/reactos/dll/win32/browseui/lang/zh-CN.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/browseui/lang/zh…
============================================================================== --- trunk/reactos/dll/win32/browseui/lang/zh-CN.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/browseui/lang/zh-CN.rc [iso-8859-1] Tue Jun 27 10:05:59 2017 @@ -107,6 +107,12 @@ END END +IDM_BAND_MENU MENUEX +BEGIN + MENUITEM "Sho&w title", IDM_BAND_TITLE + MENUITEM "&Close toolbar", IDM_BAND_CLOSE +END + /* Dialogs */ IDD_PROGRESS_DLG DIALOGEX 0, 0, 260, 85 Modified: trunk/reactos/dll/win32/browseui/lang/zh-TW.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/browseui/lang/zh…
============================================================================== --- trunk/reactos/dll/win32/browseui/lang/zh-TW.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/browseui/lang/zh-TW.rc [iso-8859-1] Tue Jun 27 10:05:59 2017 @@ -107,6 +107,12 @@ END END +IDM_BAND_MENU MENUEX +BEGIN + MENUITEM "Sho&w title", IDM_BAND_TITLE + MENUITEM "&Close toolbar", IDM_BAND_CLOSE +END + /* Dialogs */ IDD_PROGRESS_DLG DIALOGEX 0, 0, 260, 85 Modified: trunk/reactos/dll/win32/browseui/resource.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/browseui/resourc…
============================================================================== --- trunk/reactos/dll/win32/browseui/resource.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/browseui/resource.h [iso-8859-1] Tue Jun 27 10:05:59 2017 @@ -59,6 +59,10 @@ #define IDM_TASKBAR_TOOLBARS_DESKTOP 3 #define IDM_TASKBAR_TOOLBARS_QUICKLAUNCH 4 #define IDM_TASKBAR_TOOLBARS_NEW 1 + +#define IDM_BAND_MENU 269 +#define IDM_BAND_TITLE 0xA200 +#define IDM_BAND_CLOSE 0xA201 /* Random id for band close button, feel free to change it */ #define IDM_BASEBAR_CLOSE 0xA200 Modified: trunk/reactos/dll/win32/browseui/shellbars/CBandSite.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/browseui/shellba…
============================================================================== --- trunk/reactos/dll/win32/browseui/shellbars/CBandSite.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/browseui/shellbars/CBandSite.cpp [iso-8859-1] Tue Jun 27 10:05:59 2017 @@ -221,6 +221,83 @@ return UpdateSingleBand(Band); } +HRESULT CBandSiteBase::OnContextMenu(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *plrResult) +{ + /* Find the index fo the band that was clicked */ + int x = GET_X_LPARAM(lParam); + int y = GET_Y_LPARAM(lParam); + + RBHITTESTINFO htInfo = {{x, y}}; + ScreenToClient(fRebarWindow, &htInfo.pt); + int iBand = SendMessageW(fRebarWindow, RB_HITTEST, 0, (LPARAM)&htInfo); + if (iBand < 0) + { + /* FIXME: what to do here? */ + return S_OK; + } + + /* Now get the id of the band that was clicked */ + REBARBANDINFOW bandInfo = {sizeof(bandInfo), RBBIM_ID}; + SendMessageW(fRebarWindow, RB_GETBANDINFOW, htInfo.iBand, (LPARAM)&bandInfo); + + /* Finally get the band */ + DWORD dwBandID = bandInfo.wID; + struct BandObject *Band = GetBandByID(dwBandID); + if (Band == NULL) + return E_FAIL; + + HMENU hMenu = CreatePopupMenu(); + if (hMenu == NULL) + return E_OUTOFMEMORY; + + /* Try to load the menu of the band */ + UINT idBandLast = 0; + CComPtr<IContextMenu> pcm; + HRESULT hr = Band->DeskBand->QueryInterface(IID_PPV_ARG(IContextMenu, &pcm)); + if (SUCCEEDED(hr)) + { + hr = pcm->QueryContextMenu(hMenu, 0, 0, UINT_MAX, CMF_NORMAL); + if (SUCCEEDED(hr)) + { + idBandLast = HRESULT_CODE(hr); + } + } + + /* Load the static part of the menu */ + HMENU hMenuStatic = LoadMenuW(GetModuleHandleW(L"browseui.dll"), MAKEINTRESOURCEW(IDM_BAND_MENU)); + if (hMenuStatic) + Shell_MergeMenus(hMenu, hMenuStatic, UINT_MAX, 0, UINT_MAX, MM_DONTREMOVESEPS | MM_SUBMENUSHAVEIDS); + + EnableMenuItem(hMenu, IDM_BAND_TITLE, MF_GRAYED); + /* TODO: Show IDM_BAND_TITLE as checked if the band title is shown */ + + /* TODO: Query the menu of our site */ + + UINT uCommand = ::TrackPopupMenuEx(hMenu, TPM_RETURNCMD, x, y, fRebarWindow, NULL); + if (uCommand < idBandLast) + { + CMINVOKECOMMANDINFO cmi = { sizeof(cmi), 0, fRebarWindow, MAKEINTRESOURCEA(uCommand)}; + hr = pcm->InvokeCommand(&cmi); + if (FAILED_UNEXPECTEDLY(hr)) + return hr; + } + else + { + if (uCommand == IDM_BAND_TITLE) + { + /* TODO: Implement showing or hiding the title */ + } + else if(uCommand == IDM_BAND_CLOSE) + { + hr = RemoveBand(dwBandID); + if (FAILED_UNEXPECTEDLY(hr)) + return hr; + } + } + + return S_OK; +} + struct CBandSiteBase::BandObject *CBandSiteBase::GetBandFromHwnd(HWND hwnd) { HRESULT hRet; @@ -567,6 +644,15 @@ if (fRebarWindow == NULL) return E_FAIL; + if (uMsg == WM_CONTEXTMENU) + { + HRESULT hr = OnContextMenu(hWnd, uMsg, wParam, lParam, plrResult); + if (FAILED_UNEXPECTEDLY(hr)) + return hr; + + return S_OK; + } + if (hWnd == fRebarWindow) { /* FIXME: Just send the message? */ Modified: trunk/reactos/dll/win32/browseui/shellbars/CBandSite.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/browseui/shellba…
============================================================================== --- trunk/reactos/dll/win32/browseui/shellbars/CBandSite.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/browseui/shellbars/CBandSite.h [iso-8859-1] Tue Jun 27 10:05:59 2017 @@ -120,6 +120,7 @@ HRESULT UpdateAllBands(); HRESULT UpdateBand(DWORD dwBandID); struct BandObject *GetBandFromHwnd(HWND hwnd); + HRESULT OnContextMenu(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *plrResult); BEGIN_COM_MAP(CBandSiteBase) COM_INTERFACE_ENTRY_IID(IID_IBandSite, IBandSite) Modified: trunk/reactos/dll/win32/browseui/shellbars/shellbars.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/browseui/shellba…
============================================================================== --- trunk/reactos/dll/win32/browseui/shellbars/shellbars.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/browseui/shellbars/shellbars.h [iso-8859-1] Tue Jun 27 10:05:59 2017 @@ -33,4 +33,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(browseui); +#define GET_X_LPARAM(lp) ((int)(short)LOWORD(lp)) +#define GET_Y_LPARAM(lp) ((int)(short)HIWORD(lp)) + #endif /* _BROWSEUI_PCH_ */
7 years, 6 months
1
0
0
0
[cfinck] 75215: [PRINTING] Fix all EnumPrintProcessorDatatypes API tests.
by cfinck@svn.reactos.org
Author: cfinck Date: Tue Jun 27 07:25:04 2017 New Revision: 75215 URL:
http://svn.reactos.org/svn/reactos?rev=75215&view=rev
Log: [PRINTING] Fix all EnumPrintProcessorDatatypes API tests. Modified: trunk/reactos/win32ss/printing/base/spoolss/printprocessors.c trunk/reactos/win32ss/printing/base/spoolsv/printprocessors.c trunk/reactos/win32ss/printing/base/winspool/printprocessors.c trunk/reactos/win32ss/printing/processors/winprint/main.c Modified: trunk/reactos/win32ss/printing/base/spoolss/printprocessors.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/printing/base/spoo…
============================================================================== --- trunk/reactos/win32ss/printing/base/spoolss/printprocessors.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/printing/base/spoolss/printprocessors.c [iso-8859-1] Tue Jun 27 07:25:04 2017 @@ -2,7 +2,7 @@ * PROJECT: ReactOS Spooler Router * LICENSE: GNU LGPL v2.1 or any later version as published by the Free Software Foundation * PURPOSE: Functions related to Print Processors - * COPYRIGHT: Copyright 2015-2016 Colin Finck <colin(a)reactos.org> + * COPYRIGHT: Copyright 2015-2017 Colin Finck <colin(a)reactos.org> */ #include "precomp.h" @@ -10,8 +10,17 @@ BOOL WINAPI EnumPrintProcessorDatatypesW(PWSTR pName, PWSTR pPrintProcessorName, DWORD Level, PBYTE pDatatypes, DWORD cbBuf, PDWORD pcbNeeded, PDWORD pcReturned) { + PSPOOLSS_PRINT_PROVIDER pPrintProvider; + + // Sanity checks + if (cbBuf && !pDatatypes) + { + SetLastError(ERROR_INVALID_USER_BUFFER); + return FALSE; + } + // Always call this function on the Local Spooler. - PSPOOLSS_PRINT_PROVIDER pPrintProvider = CONTAINING_RECORD(PrintProviderList.Flink, SPOOLSS_PRINT_PROVIDER, Entry); + pPrintProvider = CONTAINING_RECORD(PrintProviderList.Flink, SPOOLSS_PRINT_PROVIDER, Entry); return pPrintProvider->PrintProvider.fpEnumPrintProcessorDatatypes(pName, pPrintProcessorName, Level, pDatatypes, cbBuf, pcbNeeded, pcReturned); } Modified: trunk/reactos/win32ss/printing/base/spoolsv/printprocessors.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/printing/base/spoo…
============================================================================== --- trunk/reactos/win32ss/printing/base/spoolsv/printprocessors.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/printing/base/spoolsv/printprocessors.c [iso-8859-1] Tue Jun 27 07:25:04 2017 @@ -8,17 +8,21 @@ #include "precomp.h" static void -_MarshallDownDatatypesInfo(PDATATYPES_INFO_1W pDatatypesInfo1) +_MarshallDownDatatypesInfo(PDATATYPES_INFO_1W* ppDatatypesInfo1) { // Replace absolute pointer addresses in the output by relative offsets. + PDATATYPES_INFO_1W pDatatypesInfo1 = *ppDatatypesInfo1; pDatatypesInfo1->pName = (PWSTR)((ULONG_PTR)pDatatypesInfo1->pName - (ULONG_PTR)pDatatypesInfo1); + *ppDatatypesInfo1 += sizeof(DATATYPES_INFO_1W); } static void -_MarshallDownPrintProcessorInfo(PPRINTPROCESSOR_INFO_1W pPrintProcessorInfo1) +_MarshallDownPrintProcessorInfo(PPRINTPROCESSOR_INFO_1W* ppPrintProcessorInfo1) { // Replace absolute pointer addresses in the output by relative offsets. + PPRINTPROCESSOR_INFO_1W pPrintProcessorInfo1 = *ppPrintProcessorInfo1; pPrintProcessorInfo1->pName = (PWSTR)((ULONG_PTR)pPrintProcessorInfo1->pName - (ULONG_PTR)pPrintProcessorInfo1); + *ppPrintProcessorInfo1 += sizeof(PRINTPROCESSOR_INFO_1W); } DWORD @@ -39,8 +43,7 @@ _RpcEnumPrintProcessorDatatypes(WINSPOOL_HANDLE pName, WCHAR* pPrintProcessorName, DWORD Level, BYTE* pDatatypes, DWORD cbBuf, DWORD* pcbNeeded, DWORD* pcReturned) { DWORD dwErrorCode; - DWORD i; - PBYTE p = pDatatypes; + PBYTE pDatatypesAligned; dwErrorCode = RpcImpersonateClient(NULL); if (dwErrorCode != ERROR_SUCCESS) @@ -49,20 +52,25 @@ return dwErrorCode; } - EnumPrintProcessorDatatypesW(pName, pPrintProcessorName, Level, pDatatypes, cbBuf, pcbNeeded, pcReturned); - dwErrorCode = GetLastError(); + pDatatypesAligned = AlignRpcPtr(pDatatypes, &cbBuf); - if (dwErrorCode == ERROR_SUCCESS) + if (EnumPrintProcessorDatatypesW(pName, pPrintProcessorName, Level, pDatatypesAligned, cbBuf, pcbNeeded, pcReturned)) { // Replace absolute pointer addresses in the output by relative offsets. + DWORD i; + PDATATYPES_INFO_1W p = (PDATATYPES_INFO_1W)pDatatypesAligned; + for (i = 0; i < *pcReturned; i++) - { - _MarshallDownDatatypesInfo((PDATATYPES_INFO_1W)p); - p += sizeof(DATATYPES_INFO_1W); - } + _MarshallDownDatatypesInfo(&p); + } + else + { + dwErrorCode = GetLastError(); } RpcRevertToSelf(); + UndoAlignRpcPtr(pDatatypes, pDatatypesAligned, cbBuf, pcbNeeded); + return dwErrorCode; } @@ -70,8 +78,6 @@ _RpcEnumPrintProcessors(WINSPOOL_HANDLE pName, WCHAR* pEnvironment, DWORD Level, BYTE* pPrintProcessorInfo, DWORD cbBuf, DWORD* pcbNeeded, DWORD* pcReturned) { DWORD dwErrorCode; - DWORD i; - PBYTE p = pPrintProcessorInfo; dwErrorCode = RpcImpersonateClient(NULL); if (dwErrorCode != ERROR_SUCCESS) @@ -86,11 +92,11 @@ if (dwErrorCode == ERROR_SUCCESS) { // Replace absolute pointer addresses in the output by relative offsets. + DWORD i; + PPRINTPROCESSOR_INFO_1W p = (PPRINTPROCESSOR_INFO_1W)pPrintProcessorInfo; + for (i = 0; i < *pcReturned; i++) - { - _MarshallDownPrintProcessorInfo((PPRINTPROCESSOR_INFO_1W)p); - p += sizeof(PRINTPROCESSOR_INFO_1W); - } + _MarshallDownPrintProcessorInfo(&p); } RpcRevertToSelf(); Modified: trunk/reactos/win32ss/printing/base/winspool/printprocessors.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/printing/base/wins…
============================================================================== --- trunk/reactos/win32ss/printing/base/winspool/printprocessors.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/printing/base/winspool/printprocessors.c [iso-8859-1] Tue Jun 27 07:25:04 2017 @@ -9,17 +9,21 @@ #include <prtprocenv.h> static void -_MarshallUpDatatypesInfo(PDATATYPES_INFO_1W pDatatypesInfo1) +_MarshallUpDatatypesInfo(PDATATYPES_INFO_1W* ppDatatypesInfo1) { // Replace relative offset addresses in the output by absolute pointers. + PDATATYPES_INFO_1W pDatatypesInfo1 = *ppDatatypesInfo1; pDatatypesInfo1->pName = (PWSTR)((ULONG_PTR)pDatatypesInfo1->pName + (ULONG_PTR)pDatatypesInfo1); + *ppDatatypesInfo1 += sizeof(DATATYPES_INFO_1W); } static void -_MarshallUpPrintProcessorInfo(PPRINTPROCESSOR_INFO_1W pPrintProcessorInfo1) +_MarshallUpPrintProcessorInfo(PPRINTPROCESSOR_INFO_1W* ppPrintProcessorInfo1) { // Replace relative offset addresses in the output by absolute pointers. + PPRINTPROCESSOR_INFO_1W pPrintProcessorInfo1 = *ppPrintProcessorInfo1; pPrintProcessorInfo1->pName = (PWSTR)((ULONG_PTR)pPrintProcessorInfo1->pName + (ULONG_PTR)pPrintProcessorInfo1); + *ppPrintProcessorInfo1 += sizeof(PRINTPROCESSOR_INFO_1W); } BOOL WINAPI @@ -47,8 +51,13 @@ EnumPrintProcessorDatatypesW(PWSTR pName, LPWSTR pPrintProcessorName, DWORD Level, PBYTE pDatatypes, DWORD cbBuf, PDWORD pcbNeeded, PDWORD pcReturned) { DWORD dwErrorCode; - DWORD i; - PBYTE p = pDatatypes; + + // Sanity checks + if (Level != 1) + { + dwErrorCode = ERROR_INVALID_LEVEL; + goto Cleanup; + } // Do the RPC call RpcTryExcept @@ -64,14 +73,14 @@ if (dwErrorCode == ERROR_SUCCESS) { - // Replace relative offset addresses in the output by absolute pointers. + DWORD i; + PDATATYPES_INFO_1W p = (PDATATYPES_INFO_1W)pDatatypes; + for (i = 0; i < *pcReturned; i++) - { - _MarshallUpDatatypesInfo((PDATATYPES_INFO_1W)p); - p += sizeof(DATATYPES_INFO_1W); - } - } - + _MarshallUpDatatypesInfo(&p); + } + +Cleanup: SetLastError(dwErrorCode); return (dwErrorCode == ERROR_SUCCESS); } @@ -80,8 +89,6 @@ EnumPrintProcessorsW(PWSTR pName, PWSTR pEnvironment, DWORD Level, PBYTE pPrintProcessorInfo, DWORD cbBuf, PDWORD pcbNeeded, PDWORD pcReturned) { DWORD dwErrorCode; - DWORD i; - PBYTE p = pPrintProcessorInfo; // Choose our current environment if the caller didn't give any. if (!pEnvironment) @@ -100,12 +107,11 @@ if (dwErrorCode == ERROR_SUCCESS) { - // Replace relative offset addresses in the output by absolute pointers. + DWORD i; + PPRINTPROCESSOR_INFO_1W p = (PPRINTPROCESSOR_INFO_1W)pPrintProcessorInfo; + for (i = 0; i < *pcReturned; i++) - { - _MarshallUpPrintProcessorInfo((PPRINTPROCESSOR_INFO_1W)p); - p += sizeof(PRINTPROCESSOR_INFO_1W); - } + _MarshallUpPrintProcessorInfo(&p); } SetLastError(dwErrorCode); Modified: trunk/reactos/win32ss/printing/processors/winprint/main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/printing/processor…
============================================================================== --- trunk/reactos/win32ss/printing/processors/winprint/main.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/printing/processors/winprint/main.c [iso-8859-1] Tue Jun 27 07:25:04 2017 @@ -2,7 +2,7 @@ * PROJECT: ReactOS Standard Print Processor * LICENSE: GNU LGPL v2.1 or any later version as published by the Free Software Foundation * PURPOSE: Main functions - * COPYRIGHT: Copyright 2015 Colin Finck <colin(a)reactos.org> + * COPYRIGHT: Copyright 2015-2017 Colin Finck <colin(a)reactos.org> */ #include "precomp.h" @@ -112,7 +112,6 @@ { DWORD cbDatatype; DWORD dwDatatypeCount = 0; - DWORD dwErrorCode; DWORD dwOffsets[_countof(_pwszDatatypes)]; PWSTR* pCurrentDatatype; PDWORD pCurrentOffset = dwOffsets; @@ -121,10 +120,7 @@ // Sanity checks if (Level != 1 || !pcbNeeded || !pcReturned) - { - dwErrorCode = ERROR_INVALID_PARAMETER; - goto Cleanup; - } + return FALSE; // Count the required buffer size and the number of datatypes. *pcbNeeded = 0; @@ -145,15 +141,15 @@ // Check if the supplied buffer is large enough. if (cbBuf < *pcbNeeded) { - dwErrorCode = ERROR_INSUFFICIENT_BUFFER; - goto Cleanup; + SetLastError(ERROR_INSUFFICIENT_BUFFER); + return FALSE; } // Check if a buffer was supplied at all. if (!pDatatypes) { - dwErrorCode = ERROR_INVALID_PARAMETER; - goto Cleanup; + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; } // Copy over all datatypes. @@ -161,11 +157,7 @@ PackStrings(_pwszDatatypes, pDatatypes, dwOffsets, &pDatatypes[*pcbNeeded]); *pcReturned = dwDatatypeCount; - dwErrorCode = ERROR_SUCCESS; - -Cleanup: - SetLastError(dwErrorCode); - return (dwErrorCode == ERROR_SUCCESS); + return TRUE; }
7 years, 6 months
1
0
0
0
[ekohl] 75214: [IDL] Prevent duplicate declaration of NTSTATUS.
by ekohl@svn.reactos.org
Author: ekohl Date: Mon Jun 26 22:58:26 2017 New Revision: 75214 URL:
http://svn.reactos.org/svn/reactos?rev=75214&view=rev
Log: [IDL] Prevent duplicate declaration of NTSTATUS. Modified: trunk/reactos/sdk/include/reactos/idl/netlogon.idl Modified: trunk/reactos/sdk/include/reactos/idl/netlogon.idl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/include/reactos/idl/ne…
============================================================================== --- trunk/reactos/sdk/include/reactos/idl/netlogon.idl [iso-8859-1] (original) +++ trunk/reactos/sdk/include/reactos/idl/netlogon.idl [iso-8859-1] Mon Jun 26 22:58:26 2017 @@ -4,11 +4,9 @@ #include <ms-dtyp.idl> -cpp_quote("#if 0") +cpp_quote("#ifndef _NTSECAPI_H") typedef ULONG NTSTATUS; -cpp_quote("#endif") - -cpp_quote("#ifndef _NTSECAPI_H") + typedef struct _STRING { USHORT Length;
7 years, 6 months
1
0
0
0
[ekohl] 75213: [IDL] Prevent duplicate declaration of STRING and PSTRING.
by ekohl@svn.reactos.org
Author: ekohl Date: Mon Jun 26 22:52:40 2017 New Revision: 75213 URL:
http://svn.reactos.org/svn/reactos?rev=75213&view=rev
Log: [IDL] Prevent duplicate declaration of STRING and PSTRING. Modified: trunk/reactos/sdk/include/reactos/idl/netlogon.idl Modified: trunk/reactos/sdk/include/reactos/idl/netlogon.idl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/include/reactos/idl/ne…
============================================================================== --- trunk/reactos/sdk/include/reactos/idl/netlogon.idl [iso-8859-1] (original) +++ trunk/reactos/sdk/include/reactos/idl/netlogon.idl [iso-8859-1] Mon Jun 26 22:52:40 2017 @@ -6,7 +6,9 @@ cpp_quote("#if 0") typedef ULONG NTSTATUS; - +cpp_quote("#endif") + +cpp_quote("#ifndef _NTSECAPI_H") typedef struct _STRING { USHORT Length;
7 years, 6 months
1
0
0
0
[ekohl] 75212: [NETAPI32] - Add netlogon RPC binding code. - Implement NetGetAnyDCName. This function calls its counterpart in the netlogon service.
by ekohl@svn.reactos.org
Author: ekohl Date: Mon Jun 26 22:08:37 2017 New Revision: 75212 URL:
http://svn.reactos.org/svn/reactos?rev=75212&view=rev
Log: [NETAPI32] - Add netlogon RPC binding code. - Implement NetGetAnyDCName. This function calls its counterpart in the netlogon service. Modified: trunk/reactos/dll/win32/netapi32/CMakeLists.txt trunk/reactos/dll/win32/netapi32/netlogon.c trunk/reactos/sdk/include/reactos/idl/netlogon.idl Modified: trunk/reactos/dll/win32/netapi32/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netapi32/CMakeLi…
============================================================================== --- trunk/reactos/dll/win32/netapi32/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/dll/win32/netapi32/CMakeLists.txt [iso-8859-1] Mon Jun 26 22:08:37 2017 @@ -9,6 +9,7 @@ ${REACTOS_SOURCE_DIR}/sdk/include/reactos/idl/atsvc.idl ${REACTOS_SOURCE_DIR}/sdk/include/reactos/idl/browser.idl ${REACTOS_SOURCE_DIR}/sdk/include/reactos/idl/dssetup.idl + ${REACTOS_SOURCE_DIR}/sdk/include/reactos/idl/netlogon.idl ${REACTOS_SOURCE_DIR}/sdk/include/reactos/idl/srvsvc.idl ${REACTOS_SOURCE_DIR}/sdk/include/reactos/idl/wkssvc.idl) @@ -37,6 +38,7 @@ ${CMAKE_CURRENT_BINARY_DIR}/atsvc_c.c ${CMAKE_CURRENT_BINARY_DIR}/browser_c.c ${CMAKE_CURRENT_BINARY_DIR}/dssetup_c.c + ${CMAKE_CURRENT_BINARY_DIR}/netlogon_c.c ${CMAKE_CURRENT_BINARY_DIR}/srvsvc_c.c ${CMAKE_CURRENT_BINARY_DIR}/wkssvc_c.c) Modified: trunk/reactos/dll/win32/netapi32/netlogon.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netapi32/netlogo…
============================================================================== --- trunk/reactos/dll/win32/netapi32/netlogon.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/netapi32/netlogon.c [iso-8859-1] Mon Jun 26 22:08:37 2017 @@ -9,10 +9,67 @@ /* INCLUDES ******************************************************************/ #include "netapi32.h" +#include <rpc.h> +#include "netlogon_c.h" WINE_DEFAULT_DEBUG_CHANNEL(netapi32); /* FUNCTIONS *****************************************************************/ + +handle_t __RPC_USER +LOGONSRV_HANDLE_bind(LOGONSRV_HANDLE pszSystemName) +{ + handle_t hBinding = NULL; + LPWSTR pszStringBinding; + RPC_STATUS status; + + TRACE("LOGONSRV_HANDLE_bind() called\n"); + + status = RpcStringBindingComposeW(NULL, + L"ncacn_np", + pszSystemName, + L"\\pipe\\netlogon", + NULL, + &pszStringBinding); + if (status) + { + TRACE("RpcStringBindingCompose returned 0x%x\n", status); + return NULL; + } + + /* Set the binding handle that will be used to bind to the server. */ + status = RpcBindingFromStringBindingW(pszStringBinding, + &hBinding); + if (status) + { + TRACE("RpcBindingFromStringBinding returned 0x%x\n", status); + } + + status = RpcStringFreeW(&pszStringBinding); + if (status) + { +// TRACE("RpcStringFree returned 0x%x\n", status); + } + + return hBinding; +} + + +void __RPC_USER +LOGONSRV_HANDLE_unbind(LOGONSRV_HANDLE pszSystemName, + handle_t hBinding) +{ + RPC_STATUS status; + + TRACE("LOGONSRV_HANDLE_unbind() called\n"); + + status = RpcBindingFree(&hBinding); + if (status) + { + TRACE("RpcBindingFree returned 0x%x\n", status); + } +} + NTSTATUS WINAPI @@ -30,14 +87,30 @@ NET_API_STATUS WINAPI NetGetAnyDCName( - _In_ LPCWSTR servername, - _In_ LPCWSTR domainname, - _Out_ LPBYTE *bufptr) + _In_opt_ LPCWSTR ServerName, + _In_opt_ LPCWSTR DomainName, + _Out_ LPBYTE *BufPtr) { - FIXME("NetGetAnyDCName(%s, %s, %p)\n", - debugstr_w(servername), debugstr_w(domainname), bufptr); + NET_API_STATUS status; - return ERROR_NO_LOGON_SERVERS; + TRACE("NetGetAnyDCName(%s, %s, %p)\n", + debugstr_w(ServerName), debugstr_w(DomainName), BufPtr); + + *BufPtr = NULL; + + RpcTryExcept + { + status = NetrGetAnyDCName((PWSTR)ServerName, + (PWSTR)DomainName, + (PWSTR*)BufPtr); + } + RpcExcept(EXCEPTION_EXECUTE_HANDLER) + { + status = I_RpcMapWin32Status(RpcExceptionCode()); + } + RpcEndExcept; + + return status; } Modified: trunk/reactos/sdk/include/reactos/idl/netlogon.idl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/include/reactos/idl/ne…
============================================================================== --- trunk/reactos/sdk/include/reactos/idl/netlogon.idl [iso-8859-1] (original) +++ trunk/reactos/sdk/include/reactos/idl/netlogon.idl [iso-8859-1] Mon Jun 26 22:08:37 2017 @@ -978,10 +978,11 @@ [ uuid(12345678-1234-ABCD-EF00-01234567CFFB), version(1.0), + pointer_default(unique), #ifdef __midl ms_union, #endif - pointer_default(unique) + endpoint("ncacn_np:[\\pipe\\netlogon]") #ifndef __midl ,implicit_handle(handle_t hBinding) #endif
7 years, 6 months
1
0
0
0
← Newer
1
2
3
4
5
6
7
...
53
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
Results per page:
10
25
50
100
200