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
January 2012
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
19 participants
559 discussions
Start a n
N
ew thread
[rharabien] 54977: [SHELL32] - Don't load shell extensions from * key for background context menu. Fixes #6668 (background context menu not working after installing Notepad++) - Properly set pidlFo...
by rharabien@svn.reactos.org
Author: rharabien Date: Sun Jan 15 16:45:36 2012 New Revision: 54977 URL:
http://svn.reactos.org/svn/reactos?rev=54977&view=rev
Log: [SHELL32] - Don't load shell extensions from * key for background context menu. Fixes #6668 (background context menu not working after installing Notepad++) - Properly set pidlFolder argument in extensions Initialize function call - Fix openwithmenu.rgs file creating two keys instead of one Modified: trunk/reactos/dll/win32/shell32/defcontextmenu.cpp trunk/reactos/dll/win32/shell32/res/rgs/openwithmenu.rgs Modified: trunk/reactos/dll/win32/shell32/defcontextmenu.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/defconte…
============================================================================== --- trunk/reactos/dll/win32/shell32/defcontextmenu.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/defcontextmenu.cpp [iso-8859-1] Sun Jan 15 16:45:36 2012 @@ -42,6 +42,7 @@ private: DEFCONTEXTMENU m_Dcm; IDataObject *m_pDataObj; + LPCITEMIDLIST m_pidlFolder; DWORD m_bGroupPolicyActive; PDynamicShellEntry m_pDynamicEntries; /* first dynamic shell extension entry */ UINT m_iIdSHEFirst; /* first used id */ @@ -92,8 +93,9 @@ CDefaultContextMenu::CDefaultContextMenu() { - memset (&m_Dcm, 0, sizeof(m_Dcm)); + memset(&m_Dcm, 0, sizeof(m_Dcm)); m_pDataObj = NULL; + m_pidlFolder = NULL; m_bGroupPolicyActive = 0; m_pDynamicEntries = NULL; m_iIdSHEFirst = 0; @@ -108,7 +110,7 @@ PDynamicShellEntry dEntry, dNext; PStaticShellEntry sEntry, sNext; - /* free dynamic shell extension entries */ + /* Free dynamic shell extension entries */ dEntry = m_pDynamicEntries; while (dEntry) { @@ -117,7 +119,8 @@ HeapFree(GetProcessHeap(), 0, dEntry); dEntry = dNext; } - /* free static shell extension entries */ + + /* Free static shell extension entries */ sEntry = m_pStaticEntries; while (sEntry) { @@ -127,6 +130,11 @@ HeapFree(GetProcessHeap(), 0, sEntry); sEntry = sNext; } + + if (m_pidlFolder) + ILFree((_ITEMIDLIST*)m_pidlFolder); + if (m_pDataObj) + m_pDataObj->Release(); } HRESULT WINAPI CDefaultContextMenu::Initialize(const DEFCONTEXTMENU *pdcm) @@ -136,6 +144,25 @@ TRACE("cidl %u\n", pdcm->cidl); if (SUCCEEDED(SHCreateDataObject(pdcm->pidlFolder, pdcm->cidl, pdcm->apidl, NULL, IID_IDataObject, (void**)&pDataObj))) m_pDataObj = pDataObj; + + if (!pdcm->cidl) + { + /* Init pidlFolder only if is background context menu. See IShellExtInit::Initialize */ + if (pdcm->pidlFolder) + m_pidlFolder = ILClone(pdcm->pidlFolder); + else + { + IPersistFolder2 *pf = NULL; + if (SUCCEEDED(pdcm->psf->QueryInterface(IID_IPersistFolder2, (PVOID*)&pf))) + { + if (FAILED(pf->GetCurFolder((_ITEMIDLIST**)&m_pidlFolder))) + ERR("GetCurFolder failed\n"); + pf->Release(); + } + } + TRACE("pidlFolder %p\n", m_pidlFolder); + } + CopyMemory(&m_Dcm, pdcm, sizeof(DEFCONTEXTMENU)); return S_OK; } @@ -362,7 +389,7 @@ return hr; } - hr = shext->Initialize(NULL, m_pDataObj, hKey); + hr = shext->Initialize(m_pidlFolder, m_pDataObj, hKey); shext->Release(); if (hr != S_OK) { @@ -553,18 +580,8 @@ TRACE("disabling paste options\n"); DisablePasteOptions(hMenu); } - /* load extensions from HKCR\* key */ - if (RegOpenKeyExW(HKEY_CLASSES_ROOT, - L"*", - 0, - KEY_READ, - &hKey) == ERROR_SUCCESS) - { - EnumerateDynamicContextHandlerForKey(hKey); - RegCloseKey(hKey); - } - - /* load create new shell extension */ + + /* Load context menu handlers */ if (RegOpenKeyExW(HKEY_CLASSES_ROOT, L"Directory\\Background", 0, KEY_READ, &hKey) == ERROR_SUCCESS) { EnumerateDynamicContextHandlerForKey(hKey); Modified: trunk/reactos/dll/win32/shell32/res/rgs/openwithmenu.rgs URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/res/rgs/…
============================================================================== --- trunk/reactos/dll/win32/shell32/res/rgs/openwithmenu.rgs [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/res/rgs/openwithmenu.rgs [iso-8859-1] Sun Jan 15 16:45:36 2012 @@ -29,7 +29,7 @@ { NoRemove ContextMenuHandlers { - ForceRemove Open With = s '{09799AFB-AD67-11d1-ABCD-00C04FC30936}' + ForceRemove 'Open With' = s '{09799AFB-AD67-11d1-ABCD-00C04FC30936}' { } }
12 years, 11 months
1
0
0
0
[pschweitzer] 54976: [RAPPS] Update FireFox links. Convert CreateCabFile.bat to CreateCabFile.sh
by pschweitzer@svn.reactos.org
Author: pschweitzer Date: Sun Jan 15 15:22:28 2012 New Revision: 54976 URL:
http://svn.reactos.org/svn/reactos?rev=54976&view=rev
Log: [RAPPS] Update FireFox links. Convert CreateCabFile.bat to CreateCabFile.sh Added: trunk/reactos/base/applications/rapps/CreateCabFile.sh (with props) Modified: trunk/reactos/base/applications/rapps/rapps/firefox36.txt trunk/reactos/base/applications/rapps/rapps/firefox5.txt Added: trunk/reactos/base/applications/rapps/CreateCabFile.sh URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/Cr…
============================================================================== --- trunk/reactos/base/applications/rapps/CreateCabFile.sh (added) +++ trunk/reactos/base/applications/rapps/CreateCabFile.sh [iso-8859-1] Sun Jan 15 15:22:28 2012 @@ -1,0 +1,1 @@ +../../../output-MinGW-i386/host-tools/tools/cabman/cabman -M raw -S rappmgr.cab rapps/*.txt Propchange: trunk/reactos/base/applications/rapps/CreateCabFile.sh ------------------------------------------------------------------------------ svn:eol-style = native Propchange: trunk/reactos/base/applications/rapps/CreateCabFile.sh ------------------------------------------------------------------------------ svn:executable = * Modified: trunk/reactos/base/applications/rapps/rapps/firefox36.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
============================================================================== --- trunk/reactos/base/applications/rapps/rapps/firefox36.txt [iso-8859-1] (original) +++ trunk/reactos/base/applications/rapps/rapps/firefox36.txt [iso-8859-1] Sun Jan 15 15:22:28 2012 @@ -2,59 +2,59 @@ [Section] Name = Mozilla Firefox 3.6 -Version = 3.6.24 +Version = 3.6.25 Licence = MPL/GPL/LGPL Description = The most popular and one of the best free Web Browsers out there. -Size = 8.3M +Size = 7.5M Category = 5 URLSite =
http://www.mozilla.com/en-US/
-URLDownload =
http://releases.mozilla.org/pub/mozilla.org/firefox/releases/latest-3.6/win…
+URLDownload =
http://releases.mozilla.org/pub/mozilla.org/firefox/releases/latest-3.6/win…
CDPath = none [Section.0407] Description = Der populärste und einer der besten freien Webbrowser. -Size = 8.1M +Size = 7.4M URLSite =
http://www.mozilla-europe.org/de/
-URLDownload =
http://releases.mozilla.org/pub/mozilla.org/firefox/releases/latest-3.6/win…
+URLDownload =
http://releases.mozilla.org/pub/mozilla.org/firefox/releases/latest-3.6/win…
[Section.040a] Description = El más popular y uno de los mejores navegadores web gratuitos que hay. -Size = 8.1M +Size = 7.4M URLSite =
http://www.mozilla-europe.org/es/
-URLDownload =
http://releases.mozilla.org/pub/mozilla.org/firefox/releases/latest-3.6/win…
+URLDownload =
http://releases.mozilla.org/pub/mozilla.org/firefox/releases/latest-3.6/win…
[Section.040c] Description = Le navigateur web gratuit le plus populaire et l'un des meilleurs. -Size = 8.1M +Size = 7.6M URLSite =
http://www.mozilla-europe.org/fr/
-URLDownload =
http://releases.mozilla.org/pub/mozilla.org/firefox/releases/latest-3.6/win…
+URLDownload =
http://releases.mozilla.org/pub/mozilla.org/firefox/releases/latest-3.6/win…
[Section.0414] Description = Mest populære og best også gratis nettleserene der ute. -Size = 8.1M +Size = 7.4M URLSite =
http://www.mozilla-europe.org/no/
-URLDownload =
http://releases.mozilla.org/pub/mozilla.org/firefox/releases/latest-3.6/win…
+URLDownload =
http://releases.mozilla.org/pub/mozilla.org/firefox/releases/latest-3.6/win…
[Section.0415] Description = Najpopularniejsza i jedna z najlepszych darmowych przeglÄ darek internetowych. -Size = 9.0M +Size = 8.2M URLSite =
http://www.mozilla-europe.org/pl/
-URLDownload =
http://releases.mozilla.org/pub/mozilla.org/firefox/releases/latest-3.6/win…
+URLDownload =
http://releases.mozilla.org/pub/mozilla.org/firefox/releases/latest-3.6/win…
[Section.0419] Description = Ðдин из ÑамÑÑ Ð¿Ð¾Ð¿ÑлÑÑнÑÑ Ð¸ лÑÑÑÐ¸Ñ Ð±ÐµÑплаÑнÑÑ Ð±ÑаÑзеÑов. -Size = 8.5M +Size = 7.8M URLSite =
http://www.mozilla-europe.org/ru/
-URLDownload =
http://releases.mozilla.org/pub/mozilla.org/firefox/releases/latest-3.6/win…
+URLDownload =
http://releases.mozilla.org/pub/mozilla.org/firefox/releases/latest-3.6/win…
[Section.041b] Description = NajpopulárnejÅ¡Ã a jeden z najlepÅ¡Ãch slobodný webových prehliadaÄov. -Size = 8.5MB +Size = 7.8MB URLSite =
http://www.mozilla-europe.org/sk/
-URLDownload =
http://releases.mozilla.org/pub/mozilla.org/firefox/releases/latest-3.6/win…
+URLDownload =
http://releases.mozilla.org/pub/mozilla.org/firefox/releases/latest-3.6/win…
[Section.0422] Description = ÐайпопÑлÑÑнÑÑий Ñа один з кÑаÑÐ¸Ñ Ð±ÐµÐ·Ð¿Ð»Ð°ÑÐ½Ð¸Ñ Ð²ÐµÐ±-бÑаÑзеÑÑв. -Size = 8.5M +Size = 7.7M URLSite =
http://www.mozilla-europe.org/uk/
-URLDownload =
http://releases.mozilla.org/pub/mozilla.org/firefox/releases/latest-3.6/win…
+URLDownload =
http://releases.mozilla.org/pub/mozilla.org/firefox/releases/latest-3.6/win…
Modified: trunk/reactos/base/applications/rapps/rapps/firefox5.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
============================================================================== --- trunk/reactos/base/applications/rapps/rapps/firefox5.txt [iso-8859-1] (original) +++ trunk/reactos/base/applications/rapps/rapps/firefox5.txt [iso-8859-1] Sun Jan 15 15:22:28 2012 @@ -1,60 +1,60 @@ ; UTF-8 [Section] -Name = Mozilla Firefox 8 -Version = 8.0.1 +Name = Mozilla Firefox 9 +Version = 9.0.1 Licence = MPL/GPL/LGPL Description = The most popular and one of the best free Web Browsers out there. -Size = 14.1M +Size = 14.6M Category = 5 URLSite =
http://www.mozilla.com/en-US/
-URLDownload =
http://releases.mozilla.org/pub/mozilla.org/firefox/releases/8.0.1/win32/en…
+URLDownload =
http://releases.mozilla.org/pub/mozilla.org/firefox/releases/latest-9.0/win…
CDPath = none [Section.0407] Description = Der populärste und einer der besten freien Webbrowser. -Size = 13.9M +Size = 14.4M URLSite =
http://www.mozilla-europe.org/de/
-URLDownload =
http://releases.mozilla.org/pub/mozilla.org/firefox/releases/8.0.1/win32/de…
+URLDownload =
http://releases.mozilla.org/pub/mozilla.org/firefox/releases/latest-9.0/win…
[Section.040a] Description = El más popular y uno de los mejores navegadores web gratuitos que hay. -Size = 13.9M +Size = 14.4M URLSite =
http://www.mozilla-europe.org/es/
-URLDownload =
http://releases.mozilla.org/pub/mozilla.org/firefox/releases/8.0.1/win32/es…
+URLDownload =
http://releases.mozilla.org/pub/mozilla.org/firefox/releases/latest-9.0/win…
[Section.040c] Description = Le navigateur web gratuit le plus populaire et l'un des meilleurs. -Size = 14.2M +Size = 14.7M URLSite =
http://www.mozilla-europe.org/fr/
-URLDownload =
http://releases.mozilla.org/pub/mozilla.org/firefox/releases/8.0.1/win32/fr…
+URLDownload =
http://releases.mozilla.org/pub/mozilla.org/firefox/releases/latest-9.0/win…
[Section.0414] Description = Mest populære og best også gratis nettleserene der ute. -Size = 13.9M +Size = 14.4M URLSite =
http://www.mozilla-europe.org/no/
-URLDownload =
http://releases.mozilla.org/pub/mozilla.org/firefox/releases/8.0.1/win32/nb…
+URLDownload =
http://releases.mozilla.org/pub/mozilla.org/firefox/releases/latest-9.0/win…
[Section.0415] Description = Najpopularniejsza i jedna z najlepszych darmowych przeglÄ darek internetowych. -Size = 14.8M +Size = 15.3M URLSite =
http://www.mozilla-europe.org/pl/
-URLDownload =
http://releases.mozilla.org/pub/mozilla.org/firefox/releases/8.0.1/win32/pl…
+URLDownload =
http://releases.mozilla.org/pub/mozilla.org/firefox/releases/latest-9.0/win…
[Section.0419] Description = Ðдин из ÑамÑÑ Ð¿Ð¾Ð¿ÑлÑÑнÑÑ Ð¸ лÑÑÑÐ¸Ñ Ð±ÐµÑплаÑнÑÑ Ð±ÑаÑзеÑов. -Size = 14.3M +Size = 14.8M URLSite =
http://www.mozilla-europe.org/ru/
-URLDownload =
http://releases.mozilla.org/pub/mozilla.org/firefox/releases/8.0.1/win32/ru…
+URLDownload =
http://releases.mozilla.org/pub/mozilla.org/firefox/releases/latest-9.0/win…
[Section.041b] Description = NajpopulárnejÅ¡Ã a jeden z najlepÅ¡Ãch slobodný webových prehliadaÄov. -Size = 14.6MB +Size = 15.1MB URLSite =
http://www.mozilla-europe.org/sk/
-URLDownload =
http://releases.mozilla.org/pub/mozilla.org/firefox/releases/8.0.1/win32/sk…
+URLDownload =
http://releases.mozilla.org/pub/mozilla.org/firefox/releases/latest-9.0/win…
[Section.0422] Description = ÐайпопÑлÑÑнÑÑий Ñа один з кÑаÑÐ¸Ñ Ð±ÐµÐ·Ð¿Ð»Ð°ÑÐ½Ð¸Ñ Ð²ÐµÐ±-бÑаÑзеÑÑв. -Size = 14.3M +Size = 14.8M URLSite =
http://www.mozilla-europe.org/uk/
-URLDownload =
http://releases.mozilla.org/pub/mozilla.org/firefox/releases/8.0.1/win32/uk…
+URLDownload =
http://releases.mozilla.org/pub/mozilla.org/firefox/releases/latest-9.0/win…
12 years, 11 months
1
0
0
0
[ion] 54975: Note, none of this code is being used/called yet. [KERNEL32]: Implement BasepSxsCloseHandles, BasepReplaceProcessThreadTokens, BasepIsProcessAllowed, BasepCheckWebBladeHashes, BasepIsI...
by ion@svn.reactos.org
Author: ion Date: Sun Jan 15 14:49:49 2012 New Revision: 54975 URL:
http://svn.reactos.org/svn/reactos?rev=54975&view=rev
Log: Note, none of this code is being used/called yet. [KERNEL32]: Implement BasepSxsCloseHandles, BasepReplaceProcessThreadTokens, BasepIsProcessAllowed, BasepCheckWebBladeHashes, BasepIsImageVersionOk which will be needed for the future CreateProcess re-implementation. These functions partly support SxS, Safer (Authz) and Application Certification features added in XP/2003. We also emulate support for Computer Server, Web Blade Server and Embedded ReactOS. The last function does correct image version checks to prevent invalid binaries from running. [KERNEL32]: Implement BaseUpdateVDMEntry and BaseCheckForVDM using the new CSRSS messages (not implemented on the server-side yet). Stubplement BaseCheckVDM. These will be needed for future VDM-stub-support (primarly so we can run 16-bit installers). [KERNEL32]: Implement BasepFreeAppCompatData, BasepCheckBadapp, and IsShimInfrastructureDisabled (exported as BaseIsAppcompatInfrastructureDisabled). These stub most of the required/exported application compatibility APIs, as long as someone sets DisableAppCompat in \\Registry\\MACHINE\\System\\CurrentControlSet\\Control\\Session Manager\\AppCompatibility. Modified: trunk/reactos/dll/win32/kernel32/client/appcache.c trunk/reactos/dll/win32/kernel32/client/dllmain.c trunk/reactos/dll/win32/kernel32/client/proc.c trunk/reactos/dll/win32/kernel32/client/utils.c trunk/reactos/dll/win32/kernel32/client/vdm.c trunk/reactos/dll/win32/kernel32/include/kernel32.h trunk/reactos/dll/win32/kernel32/kernel32.pspec trunk/reactos/dll/win32/kernel32/kernel32.spec Modified: trunk/reactos/dll/win32/kernel32/client/appcache.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
============================================================================== --- trunk/reactos/dll/win32/kernel32/client/appcache.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/client/appcache.c [iso-8859-1] Sun Jan 15 14:49:49 2012 @@ -13,17 +13,171 @@ #define NDEBUG #include <debug.h> +/* GLOBALS ********************************************************************/ + +ULONG g_ShimsEnabled; + /* FUNCTIONS ******************************************************************/ -/* - * @unimplemented +BOOLEAN +WINAPI +IsShimInfrastructureDisabled(VOID) +{ + HANDLE KeyHandle; + NTSTATUS Status; + KEY_VALUE_PARTIAL_INFORMATION KeyInfo; + ULONG ResultLength; + UNICODE_STRING OptionKey = RTL_CONSTANT_STRING(L"\\Registry\\MACHINE\\System\\CurrentControlSet\\Control\\SafeBoot\\Option"); + UNICODE_STRING AppCompatKey = RTL_CONSTANT_STRING(L"\\Registry\\MACHINE\\System\\CurrentControlSet\\Control\\Session Manager\\AppCompatibility"); + UNICODE_STRING PolicyKey = RTL_CONSTANT_STRING(L"\\Registry\\MACHINE\\Software\\Policies\\Microsoft\\Windows\\AppCompat"); + UNICODE_STRING OptionValue = RTL_CONSTANT_STRING(L"OptionValue"); + UNICODE_STRING DisableAppCompat = RTL_CONSTANT_STRING(L"DisableAppCompat"); + UNICODE_STRING DisableEngine = RTL_CONSTANT_STRING(L"DisableEngine"); + OBJECT_ATTRIBUTES OptionKeyAttributes = RTL_CONSTANT_OBJECT_ATTRIBUTES(&OptionKey, OBJ_CASE_INSENSITIVE); + OBJECT_ATTRIBUTES AppCompatKeyAttributes = RTL_CONSTANT_OBJECT_ATTRIBUTES(&AppCompatKey, OBJ_CASE_INSENSITIVE); + OBJECT_ATTRIBUTES PolicyKeyAttributes = RTL_CONSTANT_OBJECT_ATTRIBUTES(&PolicyKey, OBJ_CASE_INSENSITIVE); + + /* + * This is a TROOLEAN, -1 means we haven't yet figured it out. + * 0 means shims are enabled, and 1 means shims are disabled! + */ + if (g_ShimsEnabled == -1) + { + /* Open the safe mode key */ + Status = NtOpenKey(&KeyHandle, 1, &OptionKeyAttributes); + if (NT_SUCCESS(Status)) + { + /* Check if this is safemode */ + Status = NtQueryValueKey(KeyHandle, + &OptionValue, + KeyValuePartialInformation, + &KeyInfo, + sizeof(KeyInfo), + &ResultLength); + NtClose(KeyHandle); + if ((NT_SUCCESS(Status)) && + (KeyInfo.Type == REG_DWORD) && + (KeyInfo.DataLength == sizeof(ULONG)) && + (KeyInfo.Data[0] == TRUE)) + { + /* It is, so disable shims! */ + g_ShimsEnabled = TRUE; + } + else + { + /* Open the app compatibility engine settings key */ + Status = NtOpenKey(&KeyHandle, 1, &AppCompatKeyAttributes); + if (NT_SUCCESS(Status)) + { + /* Check if the app compat engine is turned off */ + Status = NtQueryValueKey(KeyHandle, + &DisableAppCompat, + KeyValuePartialInformation, + &KeyInfo, + sizeof(KeyInfo), + &ResultLength); + NtClose(KeyHandle); + if ((NT_SUCCESS(Status)) && + (KeyInfo.Type == REG_DWORD) && + (KeyInfo.DataLength == sizeof(ULONG)) && + (KeyInfo.Data[0] == TRUE)) + { + /* It is, so disable shims! */ + g_ShimsEnabled = TRUE; + } + else + { + /* Finally, open the app compatibility policy key */ + Status = NtOpenKey(&KeyHandle, 1, &PolicyKeyAttributes); + if (NT_SUCCESS(Status)) + { + /* Check if the system policy disables app compat */ + Status = NtQueryValueKey(KeyHandle, + &DisableEngine, + KeyValuePartialInformation, + &KeyInfo, + sizeof(KeyInfo), + &ResultLength), + NtClose(KeyHandle); + if ((NT_SUCCESS(Status)) && + (KeyInfo.Type == REG_DWORD) && + (KeyInfo.DataLength == sizeof(ULONG)) && + (KeyInfo.Data[0] == TRUE)) + { + /* It does, so disable shims! */ + g_ShimsEnabled = TRUE; + } + else + { + /* No keys are set, so enable shims! */ + g_ShimsEnabled = FALSE; + } + } + } + } + } + } + } + + /* Return if shims are disabled or not ("Enabled == 1" means disabled!) */ + return g_ShimsEnabled ? TRUE : FALSE; +} + +/* + * @unimplemented + */ +BOOL +WINAPI +BaseCheckAppcompatCache(IN PWCHAR ApplicationName, + IN HANDLE FileHandle, + IN PWCHAR Environment, + OUT PULONG Reason) +{ + UNIMPLEMENTED; + if (Reason) *Reason = 0; + return TRUE; +} + +/* + * @implemented */ NTSTATUS WINAPI -BasepCheckBadapp(int a, wchar_t *Str, int b, int c, int d, int e, int f, int g, int h) -{ - STUB; - return STATUS_NOT_IMPLEMENTED; +BasepCheckBadapp(IN HANDLE FileHandle, + IN PWCHAR ApplicationName, + IN PWCHAR Environment, + IN USHORT ExeType, + IN PVOID* SdbQueryAppCompatData, + IN PULONG SdbQueryAppCompatDataSize, + IN PVOID* SxsData, + IN PULONG SxsDataSize, + OUT PULONG FusionFlags) +{ + NTSTATUS Status = STATUS_SUCCESS; + ULONG Reason = 0; + + /* Is shimming enabled by group policy? */ + if (IsShimInfrastructureDisabled()) + { + /* Nothing to worry about */ + Status = STATUS_SUCCESS; + } + else + { + /* It is, check if we know about this app */ + if (!BaseCheckAppcompatCache(ApplicationName, + FileHandle, + Environment, + &Reason)) + { + /* We don't support this yet */ + UNIMPLEMENTED; + Status = STATUS_ACCESS_DENIED; + } + } + + /* Return caller the status */ + return Status; } /* @@ -47,39 +201,16 @@ } /* - * @unimplemented - */ -VOID -WINAPI -BasepFreeAppCompatData(PVOID A, PVOID B) -{ - STUB; -} - -/* - * @unimplemented - */ -BOOL -WINAPI -BaseIsAppcompatInfrastructureDisabled(VOID) -{ - STUB; - return TRUE; -} - -/* - * @unimplemented - */ -BOOL -WINAPI -BaseCheckAppcompatCache(ULONG Unknown1, - ULONG Unknown2, - ULONG Unknown3, - PULONG Unknown4) -{ - STUB; - if (Unknown4) *Unknown4 = 0; - return TRUE; + * @implemented + */ +VOID +WINAPI +BasepFreeAppCompatData(IN PVOID AppCompatData, + IN PVOID AppCompatSxsData) +{ + /* Free the input pointers if present */ + if (AppCompatData) RtlFreeHeap(RtlGetProcessHeap(), 0, AppCompatData); + if (AppCompatSxsData) RtlFreeHeap(RtlGetProcessHeap(), 0, AppCompatSxsData); } /* @@ -94,6 +225,9 @@ STUB; } +/* + * @unimplemented + */ NTSTATUS WINAPI BaseCleanupAppcompatCache(VOID) @@ -102,6 +236,9 @@ return STATUS_NOT_IMPLEMENTED; } +/* + * @unimplemented + */ NTSTATUS WINAPI BaseCleanupAppcompatCacheSupport(PVOID pUnknown) @@ -110,6 +247,9 @@ return STATUS_NOT_IMPLEMENTED; } +/* + * @unimplemented + */ BOOL WINAPI BaseInitAppcompatCache(VOID) @@ -118,6 +258,9 @@ return FALSE; } +/* + * @unimplemented + */ BOOL WINAPI BaseInitAppcompatCacheSupport(VOID) @@ -126,6 +269,9 @@ return FALSE; } +/* + * @unimplemented + */ PVOID WINAPI GetComPlusPackageInstallStatus(VOID) @@ -134,15 +280,18 @@ return NULL; } +/* + * @unimplemented + */ BOOL WINAPI SetComPlusPackageInstallStatus(LPVOID lpInfo) -{ +{ STUB; return FALSE; } - - /* + +/* * @unimplemented */ VOID Modified: trunk/reactos/dll/win32/kernel32/client/dllmain.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
============================================================================== --- trunk/reactos/dll/win32/kernel32/client/dllmain.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/client/dllmain.c [iso-8859-1] Sun Jan 15 14:49:49 2012 @@ -303,6 +303,10 @@ return FALSE; } + /* Initialize application certification globals */ + InitializeListHead(&BasepAppCertDllsList); + RtlInitializeCriticalSection(&gcsAppCert); + /* Insert more dll attach stuff here! */ DllInitialized = TRUE; DPRINT("Initialization complete\n"); Modified: trunk/reactos/dll/win32/kernel32/client/proc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
============================================================================== --- trunk/reactos/dll/win32/kernel32/client/proc.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/client/proc.c [iso-8859-1] Sun Jan 15 14:49:49 2012 @@ -42,7 +42,406 @@ CALLBACK ConsoleControlDispatcher(DWORD CodeAndFlag); +BOOLEAN g_AppCertInitialized; +BOOLEAN g_HaveAppCerts; +LIST_ENTRY BasepAppCertDllsList; +RTL_CRITICAL_SECTION gcsAppCert; +PBASEP_APPCERT_EMBEDDED_FUNC fEmbeddedCertFunc; +NTSTATUS g_AppCertStatus; + +RTL_QUERY_REGISTRY_TABLE BasepAppCertTable[2] = +{ + { + BasepConfigureAppCertDlls, + 1, + L"AppCertDlls", + &BasepAppCertDllsList, + 0, + NULL, + 0 + }, + {} +}; + +PSAFER_REPLACE_PROCESS_THREAD_TOKENS g_SaferReplaceProcessThreadTokens; +HMODULE gSaferHandle = (HMODULE)-1; + /* FUNCTIONS ****************************************************************/ + +VOID +WINAPI +StuffStdHandle(IN HANDLE ProcessHandle, + IN HANDLE StandardHandle, + IN PHANDLE Address) +{ + NTSTATUS Status; + HANDLE DuplicatedHandle; + SIZE_T Dummy; + + /* Duplicate the handle */ + Status = NtDuplicateObject(NtCurrentProcess(), + StandardHandle, + ProcessHandle, + &DuplicatedHandle, + DUPLICATE_SAME_ACCESS | DUPLICATE_SAME_ATTRIBUTES, + 0, + 0); + if (NT_SUCCESS(Status)) + { + /* Write it */ + NtWriteVirtualMemory(ProcessHandle, + Address, + &DuplicatedHandle, + sizeof(HANDLE), + &Dummy); + } +} + +BOOLEAN +WINAPI +BuildSubSysCommandLine(IN LPWSTR SubsystemName, + IN LPWSTR ApplicationName, + IN LPWSTR CommandLine, + OUT PUNICODE_STRING SubsysCommandLine) +{ + UNICODE_STRING CommandLineString, ApplicationNameString; + PWCHAR Buffer; + ULONG Length; + + /* Convert to unicode strings */ + RtlInitUnicodeString(&CommandLineString, ApplicationName); + RtlInitUnicodeString(&ApplicationNameString, CommandLine); + + /* Allocate buffer for the output string */ + Length = CommandLineString.MaximumLength + ApplicationNameString.MaximumLength + 32; + Buffer = RtlAllocateHeap(RtlGetProcessHeap(), 0, Length); + RtlInitEmptyUnicodeString(SubsysCommandLine, Buffer, Length); + if (!Buffer) + { + /* Fail, no memory */ + BaseSetLastNTError(STATUS_NO_MEMORY); + return FALSE; + } + + /* Build the final subsystem command line */ + RtlAppendUnicodeToString(SubsysCommandLine, SubsystemName); + RtlAppendUnicodeStringToString(SubsysCommandLine, &CommandLineString); + RtlAppendUnicodeToString(SubsysCommandLine, L" /C "); + RtlAppendUnicodeStringToString(SubsysCommandLine, &ApplicationNameString); + return TRUE; +} + +BOOLEAN +WINAPI +BasepIsImageVersionOk(IN ULONG ImageMajorVersion, + IN ULONG ImageMinorVersion) +{ + /* Accept images for NT 3.1 or higher, as long as they're not newer than us */ + return ((ImageMajorVersion >= 3) && + ((ImageMajorVersion != 3) || + (ImageMinorVersion >= 10)) && + (ImageMajorVersion <= SharedUserData->NtMajorVersion) && + ((ImageMajorVersion != SharedUserData->NtMajorVersion) || + (ImageMinorVersion <= SharedUserData->NtMinorVersion))); +} + +NTSTATUS +WINAPI +BasepCheckWebBladeHashes(IN HANDLE FileHandle) +{ + NTSTATUS Status; + CHAR Hash[16]; + + /* Get all the MD5 hashes */ + Status = RtlComputeImportTableHash(FileHandle, Hash, 1); + if (!NT_SUCCESS(Status)) return Status; + + /* Depending on which suite this is, run a bsearch and block the appropriate ones */ + if (SharedUserData->SuiteMask & VER_SUITE_COMPUTE_SERVER) + { + DPRINT1("Egad! This is a ReactOS Compute Server and we should prevent you from using certain APIs...but we won't."); + } + else if (SharedUserData->SuiteMask & VER_SUITE_STORAGE_SERVER) + { + DPRINT1("Gasp! This is a ReactOS Storage Server and we should prevent you from using certain APIs...but we won't."); + } + else if (SharedUserData->SuiteMask & VER_SUITE_BLADE) + { + DPRINT1("Golly! This is a ReactOS Web Blade Server and we should prevent you from using certain APIs...but we won't."); + } + + /* Actually, fuck it, don't block anything, we're open source */ + return STATUS_SUCCESS; +} + +NTSTATUS +NTAPI +BasepSaveAppCertRegistryValue(IN PLIST_ENTRY List, + IN PWCHAR ComponentName, + IN PWCHAR DllName) +{ + /* Pretty much the only thing this key is used for, is malware */ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +NTSTATUS +NTAPI +BasepConfigureAppCertDlls(IN PWSTR ValueName, + IN ULONG ValueType, + IN PVOID ValueData, + IN ULONG ValueLength, + IN PVOID Context, + IN PVOID EntryContext) +{ + /* Add this to the certification list */ + return BasepSaveAppCertRegistryValue(Context, ValueName, ValueData); +} + +NTSTATUS +WINAPI +BasepIsProcessAllowed(IN PCHAR ApplicationName) +{ + NTSTATUS Status; + PWCHAR Buffer; + UINT Length; + HMODULE TrustLibrary; + PBASEP_APPCERT_ENTRY Entry; + ULONG CertFlag; + PLIST_ENTRY NextEntry; + HANDLE KeyHandle; + UNICODE_STRING CertKey = RTL_CONSTANT_STRING(L"\\Registry\\MACHINE\\System\\CurrentControlSet\\Control\\Session Manager\\AppCertDlls"); + OBJECT_ATTRIBUTES KeyAttributes = RTL_CONSTANT_OBJECT_ATTRIBUTES(&CertKey, OBJ_CASE_INSENSITIVE); + + /* Try to initialize the certification subsystem */ + while (!g_AppCertInitialized) + { + /* Defaults */ + Status = STATUS_SUCCESS; + Buffer = NULL; + + /* Acquire the lock while initializing and see if we lost a race */ + RtlEnterCriticalSection(&gcsAppCert); + if (g_AppCertInitialized) break; + + /* On embedded, there is a special DLL */ + if (SharedUserData->SuiteMask & VER_SUITE_EMBEDDEDNT) + { + /* Allocate a buffer for the name */ + Buffer = RtlAllocateHeap(RtlGetProcessHeap(), + 0, + MAX_PATH * sizeof(WCHAR) + + sizeof(UNICODE_NULL)); + if (!Buffer) + { + /* Fail if no memory */ + Status = STATUS_NO_MEMORY; + } + else + { + /* Now get the system32 directory in our buffer, make sure it fits */ + Length = GetSystemDirectoryW(Buffer, MAX_PATH - sizeof("EmbdTrst.DLL")); + if ((Length) && (Length <= MAX_PATH - sizeof("EmbdTrst.DLL"))) + { + /* Add a slash if needed, and add the embedded cert DLL name */ + if (Buffer[Length - 1] != '\\') Buffer[Length++] = '\\'; + RtlCopyMemory(&Buffer[Length], + L"EmbdTrst.DLL", + sizeof(L"EmbdTrst.DLL")); + + /* Try to load it */ + TrustLibrary = LoadLibraryW(Buffer); + if (TrustLibrary) + { + /* And extract the special function out of it */ + fEmbeddedCertFunc = (PVOID)GetProcAddress(TrustLibrary, + "ImageOkToRunOnEmbeddedNT"); + } + } + + /* If we didn't get this far, set a failure code */ + if (!fEmbeddedCertFunc) Status = STATUS_UNSUCCESSFUL; + } + } + else + { + /* Other systems have a registry entry for this */ + Status = NtOpenKey(&KeyHandle, KEY_READ, &KeyAttributes); + if (NT_SUCCESS(Status)) + { + /* Close it, we'll query it through Rtl */ + NtClose(KeyHandle); + + /* Do the query, which will call a special callback */ + Status = RtlQueryRegistryValues(2, + L"Session Manager", + BasepAppCertTable, + 0, + 0); + if (Status == 0xC0000034) Status = STATUS_SUCCESS; + } + } + + /* Free any buffer if we had one */ + if (Buffer) RtlFreeHeap(RtlGetProcessHeap(), 0, Buffer); + + /* Check for errors, or a missing embedded/custom certification DLL */ + if (!NT_SUCCESS(Status) || + (!(fEmbeddedCertFunc) && (IsListEmpty(&BasepAppCertDllsList)))) + { + /* The subsystem is not active on this machine, so give up */ + g_HaveAppCerts = FALSE; + g_AppCertStatus = Status; + } + else + { + /* We have certification DLLs active, remember this */ + g_HaveAppCerts = TRUE; + } + + /* We are done the initialization phase, release the lock */ + g_AppCertInitialized = TRUE; + RtlLeaveCriticalSection(&gcsAppCert); + } + + /* If there's no certification DLLs present, return the failure code */ + if (!g_HaveAppCerts) return g_AppCertStatus; + + /* Otherwise, assume success and make sure we have *something* */ + ASSERT(fEmbeddedCertFunc || !IsListEmpty(&BasepAppCertDllsList)); + Status = STATUS_SUCCESS; + + /* If the something is an embedded certification DLL, call it and return */ + if (fEmbeddedCertFunc) return fEmbeddedCertFunc(ApplicationName); + + /* Otherwise we have custom certification DLLs, parse them */ + NextEntry = BasepAppCertDllsList.Flink; + CertFlag = 2; + while (NextEntry != &BasepAppCertDllsList) + { + /* Make sure the entry has a callback */ + Entry = CONTAINING_RECORD(NextEntry, BASEP_APPCERT_ENTRY, Entry); + ASSERT(Entry->fPluginCertFunc != NULL); + + /* Call it and check if it failed */ + Status = Entry->fPluginCertFunc(ApplicationName, 1); + if (!NT_SUCCESS(Status)) CertFlag = 3; + + /* Move on */ + NextEntry = NextEntry->Flink; + } + + /* Now loop them again */ + NextEntry = BasepAppCertDllsList.Flink; + while (NextEntry != &BasepAppCertDllsList) + { + /* Make sure the entry has a callback */ + Entry = CONTAINING_RECORD(NextEntry, BASEP_APPCERT_ENTRY, Entry); + ASSERT(Entry->fPluginCertFunc != NULL); + + /* Call it, this time with the flag from the loop above */ + Status = Entry->fPluginCertFunc(ApplicationName, CertFlag); + } + + /* All done, return the status */ + return Status; +} + +NTSTATUS +WINAPI +BasepReplaceProcessThreadTokens(IN HANDLE TokenHandle, + IN HANDLE ProcessHandle, + IN HANDLE ThreadHandle) +{ + NTSTATUS Status; + ANSI_STRING SaferiReplaceProcessThreadTokens = RTL_CONSTANT_STRING("SaferiReplaceProcessThreadTokens"); + + /* Enter the application certification lock */ + RtlEnterCriticalSection(&gcsAppCert); + + /* Check if we already know the function */ + if (g_SaferReplaceProcessThreadTokens) + { + /* Call it */ + Status = g_SaferReplaceProcessThreadTokens(TokenHandle, + ProcessHandle, + ThreadHandle) ? + STATUS_SUCCESS : + STATUS_UNSUCCESSFUL; + } + else + { + /* Check if the app certification DLL isn't loaded */ + if (!(gSaferHandle) || + (gSaferHandle == (HMODULE)-1) || + (gSaferHandle == (HMODULE)-2)) + { + /* Then we can't call the function */ + Status = STATUS_ENTRYPOINT_NOT_FOUND; + } + else + { + /* We have the DLL, find the address of the Safer function */ + Status = LdrGetProcedureAddress(gSaferHandle, + &SaferiReplaceProcessThreadTokens, + 0, + (PVOID*)&g_SaferReplaceProcessThreadTokens); + if (NT_SUCCESS(Status)) + { + /* Found it, now call it */ + Status = g_SaferReplaceProcessThreadTokens(TokenHandle, + ProcessHandle, + ThreadHandle) ? + STATUS_SUCCESS : + STATUS_UNSUCCESSFUL; + } + else + { + /* We couldn't find it, so this must be an unsupported DLL */ + LdrUnloadDll(gSaferHandle); + gSaferHandle = NULL; + Status = STATUS_ENTRYPOINT_NOT_FOUND; + } + } + } + + /* Release the lock and return the result */ + RtlLeaveCriticalSection(&gcsAppCert); + return Status; +} + +VOID +WINAPI +BasepSxsCloseHandles(IN PBASE_MSG_SXS_HANDLES Handles) +{ + NTSTATUS Status; + + /* Sanity checks */ + ASSERT(Handles != NULL); + ASSERT(Handles->Process == NULL || Handles->Process == NtCurrentProcess()); + + /* Close the file handle */ + if (Handles->File) + { + Status = NtClose(Handles->File); + ASSERT(NT_SUCCESS(Status)); + } + + /* Close the section handle */ + if (Handles->Section) + { + Status = NtClose(Handles->Section); + ASSERT(NT_SUCCESS(Status)); + } + + /* Unmap the section view */ + if (Handles->ViewBase.QuadPart) + { + Status = NtUnmapViewOfSection(NtCurrentProcess(), + (PVOID)Handles->ViewBase.LowPart); + ASSERT(NT_SUCCESS(Status)); + } +} static LONG BaseExceptionFilter(EXCEPTION_POINTERS *ExceptionInfo) @@ -608,7 +1007,7 @@ { ProcessParameters->ConsoleFlags = 1; } - + /* See if the first 1MB should be reserved */ if ((ULONG_PTR)ApplicationPathName & 1) { Modified: trunk/reactos/dll/win32/kernel32/client/utils.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
============================================================================== --- trunk/reactos/dll/win32/kernel32/client/utils.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/client/utils.c [iso-8859-1] Sun Jan 15 14:49:49 2012 @@ -131,7 +131,7 @@ } } - + if (NT_SUCCESS(Status)) BaseNamedObjectDirectory = BnoHandle; Quickie: @@ -812,7 +812,7 @@ BasepUnicodeStringTo8BitString = RtlUnicodeStringToAnsiString; BasepUnicodeStringTo8BitSize = BasepUnicodeStringToAnsiSize; Basep8BitStringToUnicodeSize = BasepAnsiStringToUnicodeSize; - + /* FIXME: Old, deprecated way */ bIsFileApiAnsi = TRUE; } @@ -895,15 +895,39 @@ /* * @unimplemented */ -BOOL -WINAPI -BasepCheckWinSaferRestrictions(IN DWORD Unknown1, - IN DWORD Unknown2, - IN DWORD Unknown3, - IN DWORD Unknown4, - IN DWORD Unknown5, - IN DWORD Unknown6) -{ - STUB; - return FALSE; -} +NTSTATUS +WINAPI +BasepCheckWinSaferRestrictions(IN HANDLE UserToken, + IN LPWSTR ApplicationName, + IN HANDLE FileHandle, + OUT PBOOLEAN InJob, + OUT PHANDLE NewToken, + OUT PHANDLE JobHandle) +{ + NTSTATUS Status; + + /* Validate that there's a name */ + if ((ApplicationName) && *(ApplicationName)) + { + /* Validate that the required output parameters are there */ + if ((InJob) && (NewToken) && (JobHandle)) + { + /* Do the work (one day...) */ + UNIMPLEMENTED; + Status = STATUS_SUCCESS; + } + else + { + /* Act as if SEH hit this */ + Status = STATUS_ACCESS_VIOLATION; + } + } + else + { + /* Input is invalid */ + Status = STATUS_INVALID_PARAMETER; + } + + /* Return the status */ + return Status; +} Modified: trunk/reactos/dll/win32/kernel32/client/vdm.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
============================================================================== --- trunk/reactos/dll/win32/kernel32/client/vdm.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/client/vdm.c [iso-8859-1] Sun Jan 15 14:49:49 2012 @@ -65,22 +65,122 @@ BOOL WINAPI -BaseCheckForVDM(IN HANDLE hProcess, - OUT LPDWORD lpExitCode) +BaseCheckVDM(IN ULONG BinaryType, + IN PCWCH ApplicationName, + IN PCWCH CommandLine, + IN PCWCH CurrentDirectory, + IN PANSI_STRING AnsiEnvironment, + IN PCSR_API_MESSAGE Msg, + IN OUT PULONG iTask, + IN DWORD CreationFlags, + IN LPSTARTUPINFOW StartupInfo) +{ + /* This is not supported */ + UNIMPLEMENTED; + return FALSE; +} + +BOOL +WINAPI +BaseUpdateVDMEntry(IN ULONG UpdateIndex, + IN OUT PHANDLE WaitHandle, + IN ULONG IndexInfo, + IN ULONG BinaryType) +{ + NTSTATUS Status; + CSR_API_MESSAGE Msg; + ULONG CsrRequest = MAKE_CSR_API(UPDATE_VDM_ENTRY, CSR_CONSOLE); + + /* Check what update is being sent */ + switch (UpdateIndex) + { + /* VDM is being undone */ + case VdmEntryUndo: + + /* Tell the server how far we had gotten along */ + Msg.Data.UpdateVdmEntry.iTask = (ULONG)*WaitHandle; + Msg.Data.UpdateVdmEntry.VDMCreationState = IndexInfo; + break; + + /* VDM is ready with a new process handle */ + case VdmEntryUpdateProcess: + + /* Send it the process handle */ + Msg.Data.UpdateVdmEntry.VDMProcessHandle = *WaitHandle; + Msg.Data.UpdateVdmEntry.iTask = IndexInfo; + break; + } + + /* Also check what kind of binary this is for the console handle */ + if (BinaryType == BINARY_TYPE_WOW) + { + /* Magic value for 16-bit apps */ + Msg.Data.UpdateVdmEntry.ConsoleHandle = (HANDLE)-1; + } + else if (Msg.Data.UpdateVdmEntry.iTask) + { + /* No handle for true VDM */ + Msg.Data.UpdateVdmEntry.ConsoleHandle = 0; + } + else + { + /* Otherwise, send the regular consoel handle */ + Msg.Data.UpdateVdmEntry.ConsoleHandle = NtCurrentPeb()->ProcessParameters->ConsoleHandle; + } + + /* Finally write the index and binary type */ + Msg.Data.UpdateVdmEntry.EntryIndex = UpdateIndex; + Msg.Data.UpdateVdmEntry.BinaryType = BinaryType; + + /* Send the message to CSRSS */ + Status = CsrClientCallServer(&Msg, NULL, CsrRequest, sizeof(Msg)); + if (!(NT_SUCCESS(Status)) || !(NT_SUCCESS(Msg.Status))) + { + /* Handle failure */ + BaseSetLastNTError(Msg.Status); + return FALSE; + } + + /* If this was an update, CSRSS returns a new wait handle */ + if (UpdateIndex == VdmEntryUpdateProcess) + { + /* Return it to the caller */ + *WaitHandle = Msg.Data.UpdateVdmEntry.WaitObjectForParent; + } + + /* We made it */ + return TRUE; +} + +BOOL +WINAPI +BaseCheckForVDM(IN HANDLE ProcessHandle, + OUT LPDWORD ExitCode) { NTSTATUS Status; EVENT_BASIC_INFORMATION EventBasicInfo; + CSR_API_MESSAGE Msg; + ULONG CsrRequest = MAKE_CSR_API(GET_VDM_EXIT_CODE, CSR_CONSOLE); /* It's VDM if the process is actually a wait handle (an event) */ - Status = NtQueryEvent(hProcess, + Status = NtQueryEvent(ProcessHandle, EventBasicInformation, &EventBasicInfo, sizeof(EventBasicInfo), NULL); if (!NT_SUCCESS(Status)) return FALSE; - /* FIXME: Send a message to csrss */ - return FALSE; + /* Setup the input parameters */ + Msg.Data.GetVdmExitCode.ConsoleHandle = NtCurrentPeb()->ProcessParameters->ConsoleHandle; + Msg.Data.GetVdmExitCode.hParent = ProcessHandle; + + /* Call CSRSS */ + Status = CsrClientCallServer(&Msg, NULL, CsrRequest, sizeof(Msg)); + if (!NT_SUCCESS(Status)) return FALSE; + + /* Get the exit code from the reply */ + *ExitCode = Msg.Data.GetVdmExitCode.ExitCode; + return TRUE; } BOOL @@ -97,7 +197,7 @@ /* Clear the buffer in case we fail */ CmdLineString->Buffer = 0; - + /* Always return the same size */ *VdmSize = 0x1000000; @@ -109,7 +209,7 @@ SetLastError(ERROR_INVALID_NAME); return FALSE; } - + /* Check if this is VDM with a DOS Sequence ID */ if (DosSeqId) { @@ -132,7 +232,7 @@ (BinaryType == 0x10) ? L" " : L"-w", (BinaryType == 0x40) ? 's' : ' '); } - + /* Create the actual string */ return RtlCreateUnicodeString(CmdLineString, CommandLine); } @@ -147,13 +247,13 @@ /* Start by assuming unknown type */ NameType = 1; - + /* Loop all the environment names */ for (i = 0; i < (sizeof(BasepEnvNameType) / sizeof(ENV_INFO)); i++) { /* Get this entry */ EnvInfo = &BasepEnvNameType[i]; - + /* Check if it matches the name */ if ((EnvInfo->NameLength == NameLength) && !(_wcsnicmp(EnvInfo->Name, Name, NameLength))) @@ -163,7 +263,7 @@ break; } } - + /* Return what we found, or unknown if nothing */ return NameType; } @@ -174,10 +274,10 @@ IN PUNICODE_STRING UnicodeEnv) { ULONG Dummy = 0; - + /* Clear the ASCII buffer since Rtl creates this for us */ if (AnsiEnv->Buffer) RtlFreeAnsiString(AnsiEnv); - + /* The Unicode buffer is build by hand, though */ if (UnicodeEnv->Buffer) { @@ -231,7 +331,7 @@ SetLastError(ERROR_BAD_ENVIRONMENT); goto Quickie; } - + /* Count how much space the whole environment takes */ p = Environment; while ((*p++ != UNICODE_NULL) && (*p != UNICODE_NULL)) EnvironmentSize++; @@ -251,7 +351,7 @@ NewEnvironment = NULL; goto Quickie; } - + /* Begin parsing the new environment */ p = NewEnvironment; @@ -259,12 +359,12 @@ /* Terminate it */ *p++ = UNICODE_NULL; - + /* Initialize the unicode string to hold it */ EnvironmentSize = (p - NewEnvironment) * sizeof(WCHAR); RtlInitEmptyUnicodeString(UnicodeEnv, NewEnvironment, EnvironmentSize); UnicodeEnv->Length = EnvironmentSize; - + /* Create the ASCII version of it */ Status = RtlUnicodeStringToAnsiString(AnsiEnv, UnicodeEnv, TRUE); if (!NT_SUCCESS(Status)) @@ -282,14 +382,14 @@ Quickie: /* Cleanup path starts here, start by destroying the envrionment copy */ if (!(lpEnvironment) && (Environment)) RtlDestroyEnvironment(Environment); - + /* See if we are here due to failure */ if (NewEnvironment) { /* Initialize the paths to be empty */ RtlInitEmptyUnicodeString(UnicodeEnv, NULL, 0); RtlInitEmptyAnsiString(AnsiEnv, NULL, 0); - + /* Free the environment copy */ RegionSize = 0; Status = NtFreeVirtualMemory(NtCurrentProcess(), @@ -298,7 +398,7 @@ MEM_RELEASE); ASSERT(NT_SUCCESS(Status)); } - + /* Return the result */ return Result; } Modified: trunk/reactos/dll/win32/kernel32/include/kernel32.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/include…
============================================================================== --- trunk/reactos/dll/win32/kernel32/include/kernel32.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/include/kernel32.h [iso-8859-1] Sun Jan 15 14:49:49 2012 @@ -68,6 +68,42 @@ #define HANDLE_CREATE_NEW_CONSOLE (HANDLE)-3 #define HANDLE_CREATE_NO_WINDOW (HANDLE)-4 +// +// This stuff maybe should go in a vdm.h? +// +typedef enum _VDM_ENTRY_CODE +{ + VdmEntryUndo, + VdmEntryUpdateProcess, + VdmEntryUpdateControlCHandler +} VDM_ENTRY_CODE; + +// +// Undo States +// +#define VDM_UNDO_PARTIAL 0x01 +#define VDM_UNDO_FULL 0x02 +#define VDM_UNDO_REUSE 0x04 +#define VDM_UNDO_COMPLETED 0x08 + +// +// Binary Types to share with VDM +// +#define BINARY_TYPE_EXE 0x01 +#define BINARY_TYPE_COM 0x02 +#define BINARY_TYPE_PIF 0x03 +#define BINARY_TYPE_DOS 0x10 +#define BINARY_TYPE_SEPARATE_WOW 0x20 +#define BINARY_TYPE_WOW 0x40 +#define BINARY_TYPE_WOW_EX 0x80 + +// +// VDM States +// +#define VDM_NOT_LOADED 0x01 +#define VDM_NOT_READY 0x02 +#define VDM_READY 0x04 + /* Undocumented CreateProcess flag */ #define STARTF_SHELLPRIVATE 0x400 @@ -299,6 +335,64 @@ IN PVOID Environment ); +LPWSTR +WINAPI +BaseComputeProcessExePath( + IN LPWSTR FullPath +); + +ULONG +WINAPI +BaseIsDosApplication( + IN PUNICODE_STRING PathName, + IN NTSTATUS Status +); + +NTSTATUS +WINAPI +BasepCheckBadapp( + IN HANDLE FileHandle, + IN PWCHAR ApplicationName, + IN PWCHAR Environment, + IN USHORT ExeType, + IN PVOID* SdbQueryAppCompatData, + IN PULONG SdbQueryAppCompatDataSize, + IN PVOID* SxsData, + IN PULONG SxsDataSize, + OUT PULONG FusionFlags +); + +BOOLEAN +WINAPI +IsShimInfrastructureDisabled( + VOID +); + +BOOL +NTAPI +BaseDestroyVDMEnvironment( + IN PANSI_STRING AnsiEnv, + IN PUNICODE_STRING UnicodeEnv +); + +BOOL +WINAPI +BaseGetVdmConfigInfo( + IN LPCWSTR Reserved, + IN ULONG DosSeqId, + IN ULONG BinaryType, + IN PUNICODE_STRING CmdLineString, + OUT PULONG VdmSize +); + +BOOL +NTAPI +BaseCreateVDMEnvironment( + IN PWCHAR lpEnvironment, + IN PANSI_STRING AnsiEnv, + IN PUNICODE_STRING UnicodeEnv +); + VOID WINAPI InitCommandLines(VOID); @@ -323,7 +417,57 @@ IN PVOID Context, OUT BOOLEAN *StopEnumeration); -VOID -WINAPI -BaseMarkFileForDelete(IN HANDLE FileHandle, - IN ULONG FileAttributes); +typedef NTSTATUS +(NTAPI *PBASEP_APPCERT_PLUGIN_FUNC)( + IN PCHAR ApplicationName, + IN ULONG CertFlag +); + +typedef NTSTATUS +(NTAPI *PBASEP_APPCERT_EMBEDDED_FUNC)( + IN PCHAR ApplicationName +); + +typedef NTSTATUS +(NTAPI *PSAFER_REPLACE_PROCESS_THREAD_TOKENS)( + IN HANDLE Token, + IN HANDLE Process, + IN HANDLE Thread +); + +typedef struct _BASEP_APPCERT_ENTRY +{ + LIST_ENTRY Entry; + UNICODE_STRING Name; + PBASEP_APPCERT_PLUGIN_FUNC fPluginCertFunc; +} BASEP_APPCERT_ENTRY, *PBASEP_APPCERT_ENTRY; + +typedef struct _BASE_MSG_SXS_HANDLES +{ + HANDLE File; + HANDLE Process; + HANDLE Section; + LARGE_INTEGER ViewBase; +} BASE_MSG_SXS_HANDLES, *PBASE_MSG_SXS_HANDLES; + +NTSTATUS +NTAPI +BasepConfigureAppCertDlls( + IN PWSTR ValueName, + IN ULONG ValueType, + IN PVOID ValueData, + IN ULONG ValueLength, + IN PVOID Context, + IN PVOID EntryContext +); + +extern LIST_ENTRY BasepAppCertDllsList; +extern RTL_CRITICAL_SECTION gcsAppCert; + +VOID +WINAPI +BaseMarkFileForDelete( + IN HANDLE FileHandle, + IN ULONG FileAttributes +); + Modified: trunk/reactos/dll/win32/kernel32/kernel32.pspec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/kernel3…
============================================================================== --- trunk/reactos/dll/win32/kernel32/kernel32.pspec [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/kernel32.pspec [iso-8859-1] Sun Jan 15 14:49:49 2012 @@ -23,7 +23,7 @@ @ stdcall BaseDumpAppcompatCache() @ stdcall BaseFlushAppcompatCache() @ stdcall BaseInitAppcompatCacheSupport() -@ stdcall BaseIsAppcompatInfrastructureDisabled() +@ stdcall BaseIsAppcompatInfrastructureDisabled() IsShimInfrastructureDisabled @ stdcall BaseProcessInitPostImport() ; missing in Win 7 @ stdcall BaseQueryModuleData(str str ptr ptr ptr) ;check @ stdcall BaseUpdateAppcompatCache(long long long) Modified: trunk/reactos/dll/win32/kernel32/kernel32.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/kernel3…
============================================================================== --- trunk/reactos/dll/win32/kernel32/kernel32.spec [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/kernel32.spec [iso-8859-1] Sun Jan 15 14:49:49 2012 @@ -23,7 +23,7 @@ @ stdcall BaseDumpAppcompatCache() @ stdcall BaseFlushAppcompatCache() @ stdcall BaseInitAppcompatCacheSupport() -@ stdcall BaseIsAppcompatInfrastructureDisabled() +@ stdcall BaseIsAppcompatInfrastructureDisabled() IsShimInfrastructureDisabled @ stdcall BaseProcessInitPostImport() ; missing in Win 7 @ stdcall BaseQueryModuleData(str str ptr ptr ptr) ;check @ stdcall BaseUpdateAppcompatCache(long long long)
12 years, 11 months
1
0
0
0
[rharabien] 54974: [SHELL32] - Add New menu to context menu handlers. Fixes regression introduced by r54959. - Remove unwanted files See issue #6823 for more details.
by rharabien@svn.reactos.org
Author: rharabien Date: Sun Jan 15 14:25:11 2012 New Revision: 54974 URL:
http://svn.reactos.org/svn/reactos?rev=54974&view=rev
Log: [SHELL32] - Add New menu to context menu handlers. Fixes regression introduced by r54959. - Remove unwanted files See issue #6823 for more details. Removed: trunk/reactos/dll/win32/shell32/res/Copy of rgs/ Modified: trunk/reactos/dll/win32/shell32/res/rgs/newmenu.rgs Modified: trunk/reactos/dll/win32/shell32/res/rgs/newmenu.rgs URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/res/rgs/…
============================================================================== --- trunk/reactos/dll/win32/shell32/res/rgs/newmenu.rgs [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/res/rgs/newmenu.rgs [iso-8859-1] Sun Jan 15 14:25:11 2012 @@ -11,4 +11,19 @@ } } } + NoRemove Directory + { + NoRemove Background + { + NoRemove shellex + { + NoRemove ContextMenuHandlers + { + ForceRemove New = s '{D969A300-E7FF-11d0-A93B-00A0C90F2719}' + { + } + } + } + } + } }
12 years, 11 months
1
0
0
0
[rharabien] 54973: [SHELL32] - Revert r54967. Test bots should already work.
by rharabien@svn.reactos.org
Author: rharabien Date: Sun Jan 15 13:38:59 2012 New Revision: 54973 URL:
http://svn.reactos.org/svn/reactos?rev=54973&view=rev
Log: [SHELL32] - Revert r54967. Test bots should already work. Modified: trunk/reactos/dll/win32/shell32/control.cpp Modified: trunk/reactos/dll/win32/shell32/control.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/control.…
============================================================================== --- trunk/reactos/dll/win32/shell32/control.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/control.cpp [iso-8859-1] Sun Jan 15 13:38:59 2012 @@ -348,146 +348,102 @@ Control_DoInterface(panel, hWnd, hInst); } -static void Control_DoLaunch(CPanel* panel, HWND hWnd, LPCWSTR wszCmd) - /* forms to parse: - * foo.cpl,@sp,str - * foo.cpl,@sp - * foo.cpl,,str - * foo.cpl @sp - * foo.cpl str - * "a path\foo.cpl" - */ -{ - LPWSTR buffer; - LPWSTR beg = NULL; - LPWSTR end; - WCHAR ch; - LPCWSTR ptr, ptr2; - WCHAR szName[MAX_PATH]; - unsigned sp = 0; - LPWSTR extraPmts = NULL; - int quoted = 0; - BOOL spSet = FALSE; - HANDLE hMutex; - UINT Length; - - ptr = wcsrchr(wszCmd, L'\\'); - ptr2 = wcsrchr(wszCmd, L','); - if (!ptr2) - { - ptr2 = wszCmd + wcslen(wszCmd) + 1; - } - - if (ptr) - ptr++; +static void Control_DoLaunch(CPanel *pPanel, HWND hWnd, LPCWSTR pwszCmd) +{ + /* Make a pwszCmd copy so we can modify it */ + LPWSTR pwszCmdCopy = _wcsdup(pwszCmd); + if (!pwszCmdCopy) + return; + + LPWSTR pwszPath = pwszCmdCopy, pwszArg = NULL, pwszArg2 = NULL; + + /* Path can be quoted */ + if (pwszPath[0] == L'"') + { + ++pwszPath; + pwszArg = wcschr(pwszPath, L'"'); + if (pwszArg) + *(pwszArg++) = '\0'; + } else - ptr = wszCmd; - - Length = (ptr2 - ptr); - if (Length >= MAX_PATH) + pwszArg = pwszCmdCopy; + + /* First argument starts after space or ','. Note: we ignore characters between '"' and ',' or ' '. */ + if (pwszArg) + pwszArg = wcspbrk(pwszArg, L" ,"); + if (pwszArg) + { + /* NULL terminate path and find first character of arg */ + *(pwszArg++) = L'\0'; + if (pwszArg[0] == L'"') + { + ++pwszArg; + pwszArg2 = wcschr(pwszArg, L'"'); + if (pwszArg2) + *(pwszArg2++) = L'\0'; + } else + pwszArg2 = pwszArg; + + /* Second argument always starts with ','. Note: we ignore characters between '"' and ','. */ + if (pwszArg2) + pwszArg2 = wcschr(pwszArg2, L','); + } + + TRACE("Launch %ls, arg %ls, arg2 %ls\n", pwszPath, pwszArg, pwszArg2); + + /* Create a mutex to disallow running multiple instances */ + HANDLE hMutex = CreateMutexW(NULL, TRUE, PathFindFileNameW(pwszPath)); + if (!hMutex || GetLastError() == ERROR_ALREADY_EXISTS) + { + TRACE("Next instance disallowed\n"); + if (hMutex) + CloseHandle(hMutex); return; - - memcpy(szName, (LPVOID)ptr, Length * sizeof(WCHAR)); - szName[Length] = L'\0'; - hMutex = CreateMutexW(NULL, TRUE, szName); - - if ((!hMutex) || (GetLastError() == ERROR_ALREADY_EXISTS)) - return; - buffer = (LPWSTR)HeapAlloc(GetProcessHeap(), 0, (wcslen(wszCmd) + 1) * sizeof(*wszCmd)); - if (!buffer) - { - CloseHandle(hMutex); - return; - } - - TRACE("[shell32, Control_DoLaunch] wszCmd = %ws\n", wszCmd); - - end = wcscpy(buffer, wszCmd); - for (;;) - { - ch = *end; - if (ch == '"') - quoted = !quoted; - - if (!quoted && (ch == ',' || ch == '\0')) - { - *end = '\0'; - if (beg) - { - if (*beg == '@') - { - sp = atoiW(beg + 1); - spSet = TRUE; - } - else if (*beg == '\0') - { - sp = 0; - spSet = TRUE; - } - else - { - extraPmts = beg; - } - } - - if (ch == '\0') break; - beg = end + 1; - if (ch == ' ') - while (end[1] == ' ') - end++; - } - end++; - } - while ((ptr = StrChrW(buffer, '"'))) - memmove((LPVOID)ptr, ptr+1, wcslen(ptr)*sizeof(WCHAR)); - - while ((ptr = StrChrW(extraPmts, '"'))) - memmove((LPVOID)ptr, ptr+1, wcslen(ptr)*sizeof(WCHAR)); - - TRACE("[shell32, Control_DoLaunch] cmd %s, extra %s, sp %d\n", debugstr_w(buffer), debugstr_w(extraPmts), sp); - - Control_LoadApplet(hWnd, buffer, panel); - - if (panel->first) - { - CPlApplet* applet = panel->first; - - TRACE("[shell32, Control_DoLaunch] applet->count %d, applet->info[sp].szName %ws\n", applet->count, applet->info[sp].szName); - - assert(applet && applet->next == NULL); - if (sp >= applet->count) - { - WARN("Out of bounds (%u >= %u), setting to 0\n", sp, applet->count); - sp = 0; - } - - if ((extraPmts) && extraPmts[0] && (!spSet)) - { - while ((lstrcmpiW(extraPmts, applet->info[sp].szName)) && (sp < applet->count)) - sp++; - - if (sp >= applet->count) - { - ReleaseMutex(hMutex); - CloseHandle(hMutex); - Control_UnloadApplet(applet); - HeapFree(GetProcessHeap(), 0, buffer); - return; - } - } - - if (applet->info[sp].dwSize) - { - if (!applet->proc(applet->hWnd, CPL_DBLCLK, sp, applet->info[sp].lData)) - applet->proc(applet->hWnd, CPL_STARTWPARMSA, sp, (LPARAM)extraPmts); - } - - Control_UnloadApplet(applet); - } + } + + /* Load applet cpl */ + TRACE("Load applet %ls\n", pwszPath); + Control_LoadApplet(hWnd, pwszPath, pPanel); + if (pPanel->first) + { + /* First pPanel applet is the new one */ + CPlApplet *pApplet = pPanel->first; + assert(pApplet && pApplet->next == NULL); + TRACE("pApplet->count %d\n", pApplet->count); + + /* Note: if there is only one applet, first argument is ignored */ + INT i = 0; + if (pApplet->count > 1 && pwszArg && pwszArg[0]) + { + /* If arg begins with '@', number specifies applet index */ + if (pwszArg[0] == L'@') + i = _wtoi(pwszArg + 1); + else + { + /* Otherwise it's applet name */ + for (i = 0; i < (INT)pApplet->count; ++i) + if (!wcscmp(pwszArg, pApplet->info[i].szName)) + break; + } + } + + if (i >= 0 && i < (INT)pApplet->count && pApplet->info[i].dwSize) + { + /* Start the applet */ + TRACE("Starting applet %d\n", i); + if (!pApplet->proc(pApplet->hWnd, CPL_DBLCLK, i, pApplet->info[i].lData)) + pApplet->proc(pApplet->hWnd, CPL_STARTWPARMSA, i, (LPARAM)pwszArg); + } else + ERR("Applet not found: %ls\n", pwszArg ? pwszArg : L"NULL"); + + Control_UnloadApplet(pApplet); + } + else + ERR("Failed to load applet %ls\n", pwszPath); ReleaseMutex(hMutex); CloseHandle(hMutex); - HeapFree(GetProcessHeap(), 0, buffer); + free(pwszCmdCopy); } /************************************************************************* @@ -496,22 +452,22 @@ */ EXTERN_C void WINAPI Control_RunDLLW(HWND hWnd, HINSTANCE hInst, LPCWSTR cmd, DWORD nCmdShow) { - CPanel panel; + CPanel Panel; TRACE("(%p, %p, %s, 0x%08x)\n", hWnd, hInst, debugstr_w(cmd), nCmdShow); - memset(&panel, 0, sizeof(panel)); + memset(&Panel, 0, sizeof(Panel)); if (!cmd || !*cmd) { TRACE("[shell32, Control_RunDLLW] Calling Control_DoWindow\n"); - Control_DoWindow(&panel, hWnd, hInst); + Control_DoWindow(&Panel, hWnd, hInst); } else { TRACE("[shell32, Control_RunDLLW] Calling Control_DoLaunch\n"); - Control_DoLaunch(&panel, hWnd, cmd); + Control_DoLaunch(&Panel, hWnd, cmd); } }
12 years, 11 months
1
0
0
0
[rharabien] 54972: [INTL] - Add DPRINTs to track possible unattended setup timeouts
by rharabien@svn.reactos.org
Author: rharabien Date: Sun Jan 15 13:37:25 2012 New Revision: 54972 URL:
http://svn.reactos.org/svn/reactos?rev=54972&view=rev
Log: [INTL] - Add DPRINTs to track possible unattended setup timeouts Modified: trunk/reactos/dll/cpl/intl/CMakeLists.txt trunk/reactos/dll/cpl/intl/generalp.c trunk/reactos/dll/cpl/intl/intl.c trunk/reactos/dll/cpl/intl/intl.h Modified: trunk/reactos/dll/cpl/intl/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/intl/CMakeLists.tx…
============================================================================== --- trunk/reactos/dll/cpl/intl/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/intl/CMakeLists.txt [iso-8859-1] Sun Jan 15 13:37:25 2012 @@ -28,7 +28,8 @@ advapi32 setupapi shell32 - kernel32) + kernel32 + ntdll) add_pch(intl intl.h) add_cd_file(TARGET intl DESTINATION reactos/system32 FOR all) Modified: trunk/reactos/dll/cpl/intl/generalp.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/intl/generalp.c?re…
============================================================================== --- trunk/reactos/dll/cpl/intl/generalp.c [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/intl/generalp.c [iso-8859-1] Sun Jan 15 13:37:25 2012 @@ -331,7 +331,8 @@ { SetNewLocale(UnattendLCID); PostQuitMessage(0); - } + } else + DPRINT1("VerifyUnattendLCID failed\n"); return TRUE; } break; Modified: trunk/reactos/dll/cpl/intl/intl.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/intl/intl.c?rev=54…
============================================================================== --- trunk/reactos/dll/cpl/intl/intl.c [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/intl/intl.c [iso-8859-1] Sun Jan 15 13:37:25 2012 @@ -67,29 +67,26 @@ lpCmdLine = GetCommandLine(); lpSwitch = _tcsstr(lpCmdLine, _T("/f:\"")); - - if(!lpSwitch) - { + if (!lpSwitch) return FALSE; - } len = _tcslen(lpSwitch); - if (len < 5) - { + if (len < 5 || lpSwitch[len-1] != _T('\"')) + { + DPRINT1("Invalid switch: %ls\n", lpSwitch); return FALSE; } - if(lpSwitch[len-1] != _T('\"')) - { + lpSwitch[len-1] = _T('\0'); + + hSetupInf = SetupOpenInfFile(&lpSwitch[4], NULL, INF_STYLE_OLDNT, NULL); + if (hSetupInf == INVALID_HANDLE_VALUE) + { + DPRINT1("Failed to open INF file: %ls\n", &lpSwitch[4]); return FALSE; } - lpSwitch[len-1] = _T('\0'); - - hSetupInf = SetupOpenInfFile(&lpSwitch[4], NULL, - INF_STYLE_OLDNT, NULL); - - return (hSetupInf != INVALID_HANDLE_VALUE); + return TRUE; } VOID @@ -104,6 +101,7 @@ &InfContext)) { SetupCloseInfFile(hSetupInf); + DPRINT1("SetupFindFirstLine failed\n"); return; } @@ -111,6 +109,7 @@ sizeof(szBuffer) / sizeof(TCHAR), NULL)) { SetupCloseInfFile(hSetupInf); + DPRINT1("SetupGetStringField failed\n"); return; } Modified: trunk/reactos/dll/cpl/intl/intl.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/intl/intl.h?rev=54…
============================================================================== --- trunk/reactos/dll/cpl/intl/intl.h [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/intl/intl.h [iso-8859-1] Sun Jan 15 13:37:25 2012 @@ -7,6 +7,7 @@ #include <tchar.h> #include <prsht.h> #include <malloc.h> +#include <debug.h> #include "resource.h"
12 years, 11 months
1
0
0
0
[rharabien] 54971: [SYSSETUP] - Fix GetRosInstallCD - GetLogicalDriveStringsW returns drive paths, not letters. - When building intl.cpl command line for unattended setup don't use %S - swprint int...
by rharabien@svn.reactos.org
Author: rharabien Date: Sun Jan 15 13:24:26 2012 New Revision: 54971 URL:
http://svn.reactos.org/svn/reactos?rev=54971&view=rev
Log: [SYSSETUP] - Fix GetRosInstallCD - GetLogicalDriveStringsW returns drive paths, not letters. - When building intl.cpl command line for unattended setup don't use %S - swprint interprets it as multi-byte string. Use "%s" instead. This bug caused yesterdays KVM problems. Modified: trunk/reactos/dll/win32/syssetup/wizard.c Modified: trunk/reactos/dll/win32/syssetup/wizard.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/syssetup/wizard.…
============================================================================== --- trunk/reactos/dll/win32/syssetup/wizard.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/syssetup/wizard.c [iso-8859-1] Sun Jan 15 13:24:26 2012 @@ -46,7 +46,7 @@ /* FUNCTIONS ****************************************************************/ BOOL -GetRosInstallCD(WCHAR * szPath, DWORD dwPathLength); +GetRosInstallCD(WCHAR *pwszPath, DWORD cchPathMax); #ifdef VMWINST static BOOL @@ -883,7 +883,6 @@ LPARAM lParam) { PSETUPDATA SetupData; - WCHAR szBuffer[1024]; /* Retrieve pointer to the global setup data */ SetupData = (PSETUPDATA)GetWindowLongPtr (hwndDlg, GWL_USERDATA); @@ -907,19 +906,13 @@ switch (LOWORD(wParam)) { case IDC_CUSTOMLOCALE: - { - wcscpy(szBuffer, L"rundll32.exe shell32.dll,Control_RunDLL intl.cpl,,5"); - RunControlPanelApplet(hwndDlg, szBuffer); + RunControlPanelApplet(hwndDlg, L"rundll32.exe shell32.dll,Control_RunDLL intl.cpl,,5"); /* FIXME: Update input locale name */ - } - break; + break; case IDC_CUSTOMLAYOUT: - { - wcscpy(szBuffer, L"rundll32.exe shell32.dll,Control_RunDLL input.dll,@1"); - RunControlPanelApplet(hwndDlg, szBuffer); - } - break; + RunControlPanelApplet(hwndDlg, L"rundll32.exe shell32.dll,Control_RunDLL input.dll,@1"); + break; } } break; @@ -935,17 +928,13 @@ PropSheet_SetWizButtons(GetParent(hwndDlg), PSWIZB_BACK | PSWIZB_NEXT); if (SetupData->UnattendSetup) { - WCHAR szPath[MAX_PATH]; - if (GetRosInstallCD(szPath, MAX_PATH)) - { - swprintf(szBuffer, L"rundll32.exe shell32.dll,Control_RunDLL intl.cpl,,/f:\"%S\\reactos\\unattend.inf\"", szPath); - } + WCHAR wszPath[MAX_PATH], wszBuf[1024]; + if (GetRosInstallCD(wszPath, _countof(wszPath))) + swprintf(wszBuf, L"rundll32.exe shell32.dll,Control_RunDLL intl.cpl,,/f:\"%sreactos\\unattend.inf\"", wszPath); else - { - wcscpy(szBuffer, L"rundll32.exe shell32.dll,Control_RunDLL intl.cpl,,/f:\"unattend.inf\""); - } - - RunControlPanelApplet(hwndDlg, szBuffer); + wcscpy(wszBuf, L"rundll32.exe shell32.dll,Control_RunDLL intl.cpl,,/f:\"unattend.inf\""); + + RunControlPanelApplet(hwndDlg, wszBuf); SetWindowLongPtr(hwndDlg, DWL_MSGRESULT, IDD_DATETIMEPAGE); return TRUE; } @@ -2238,35 +2227,32 @@ */ BOOL -GetRosInstallCD(WCHAR * szPath, DWORD dwPathLength) -{ - WCHAR szDrives[512]; - WCHAR szDrive[] = L"D:\\"; - DWORD dwLength, dwIndex; - WCHAR * pDrive; - dwLength = GetLogicalDriveStringsW(sizeof(szDrives) / sizeof(WCHAR), szDrives); - - if (dwLength > (sizeof(szDrives) / sizeof(WCHAR)) || dwLength == 0) +GetRosInstallCD(WCHAR *pwszPath, DWORD cchPathMax) +{ + WCHAR wszDrives[512]; + DWORD cchDrives; + WCHAR *pwszDrive; + + cchDrives = GetLogicalDriveStringsW(_countof(wszDrives) - 1, wszDrives); + if (cchDrives == 0 || cchDrives >= _countof(wszDrives)) { /* buffer too small or failure */ LogItem(SYSSETUP_SEVERITY_INFORMATION, L"GetLogicalDriveStringsW failed"); return FALSE; } - pDrive = szDrives; - for (dwIndex = 0; dwIndex < dwLength; dwIndex++) - { - szDrive[0] = pDrive[dwIndex]; - if (GetDriveTypeW(szDrive) == DRIVE_CDROM) - { - WCHAR szBuffer[MAX_PATH]; - wcscpy(szBuffer, szDrive); - wcscat(szBuffer, L"reactos\\system32\\ntoskrnl.exe"); - LogItem(SYSSETUP_SEVERITY_INFORMATION, szBuffer); - if (GetFileAttributesW(szBuffer) != INVALID_FILE_ATTRIBUTES) + for (pwszDrive = wszDrives; pwszDrive[0]; pwszDrive += wcslen(pwszDrive) + 1) + { + if (GetDriveTypeW(pwszDrive) == DRIVE_CDROM) + { + WCHAR wszBuf[MAX_PATH]; + wsprintf(wszBuf, L"%sreactos\\system32\\ntoskrnl.exe", pwszDrive); + LogItem(SYSSETUP_SEVERITY_INFORMATION, wszBuf); + if (GetFileAttributesW(wszBuf) != INVALID_FILE_ATTRIBUTES) { /* the file exists, so this is the right drive */ - wcsncpy(szPath, szDrive, dwPathLength); + wcsncpy(pwszPath, pwszDrive, cchPathMax); + OutputDebugStringW(L"GetRosInstallCD: ");OutputDebugStringW(pwszPath);OutputDebugStringW(L"\n"); return TRUE; } }
12 years, 11 months
1
0
0
0
[akhaldi] 54970: [DDK] * Add fltuserstructures.h
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sun Jan 15 10:11:22 2012 New Revision: 54970 URL:
http://svn.reactos.org/svn/reactos?rev=54970&view=rev
Log: [DDK] * Add fltuserstructures.h Added: trunk/reactos/include/ddk/fltuserstructures.h (with props) Added: trunk/reactos/include/ddk/fltuserstructures.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/fltuserstructu…
============================================================================== --- trunk/reactos/include/ddk/fltuserstructures.h (added) +++ trunk/reactos/include/ddk/fltuserstructures.h [iso-8859-1] Sun Jan 15 10:11:22 2012 @@ -1,0 +1,239 @@ +/* + * fltuserstructures.h + * + * This file is part of the ReactOS DDK package. + * + * Contributors: + * Amine Khaldi (amine.khaldi(a)reactos.org) + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + */ +#pragma once + +#ifndef __FLT_USER_STRUCTURES_H__ +#define __FLT_USER_STRUCTURES_H__ + +#if FLT_MGR_BASELINE + +#define FLTAPI NTAPI + +#define FILTER_NAME_MAX_CHARS 255 +#define FILTER_NAME_MAX_BYTES (FILTER_NAME_MAX_CHARS * sizeof(WCHAR)) +#define VOLUME_NAME_MAX_CHARS 1024 +#define VOLUME_NAME_MAX_BYTES (VOLUME_NAME_MAX_CHARS * sizeof(WCHAR)) +#define INSTANCE_NAME_MAX_CHARS 255 +#define INSTANCE_NAME_MAX_BYTES (INSTANCE_NAME_MAX_CHARS * sizeof(WCHAR)) + +typedef HANDLE HFILTER, HFILTER_INSTANCE, HFILTER_VOLUME; + +typedef _Return_type_success_(return >= 0) LONG NTSTATUS, *PNTSTATUS; + +/* Known File System Types */ + +typedef enum _FLT_FILESYSTEM_TYPE { + FLT_FSTYPE_UNKNOWN, + FLT_FSTYPE_RAW, + FLT_FSTYPE_NTFS, + FLT_FSTYPE_FAT, + FLT_FSTYPE_CDFS, + FLT_FSTYPE_UDFS, + FLT_FSTYPE_LANMAN, + FLT_FSTYPE_WEBDAV, + FLT_FSTYPE_RDPDR, + FLT_FSTYPE_NFS, + FLT_FSTYPE_MS_NETWARE, + FLT_FSTYPE_NETWARE, + FLT_FSTYPE_BSUDF, + FLT_FSTYPE_MUP, + FLT_FSTYPE_RSFX, + FLT_FSTYPE_ROXIO_UDF1, + FLT_FSTYPE_ROXIO_UDF2, + FLT_FSTYPE_ROXIO_UDF3, + FLT_FSTYPE_TACIT, + FLT_FSTYPE_FS_REC, + FLT_FSTYPE_INCD, + FLT_FSTYPE_INCD_FAT, + FLT_FSTYPE_EXFAT, + FLT_FSTYPE_PSFS, + FLT_FSTYPE_GPFS, + FLT_FSTYPE_NPFS, + FLT_FSTYPE_MSFS, + FLT_FSTYPE_CSVFS +} FLT_FILESYSTEM_TYPE, *PFLT_FILESYSTEM_TYPE; + +typedef enum _FILTER_INFORMATION_CLASS { + FilterFullInformation, + FilterAggregateBasicInformation, + FilterAggregateStandardInformation +} FILTER_INFORMATION_CLASS, *PFILTER_INFORMATION_CLASS; + +typedef enum _FILTER_VOLUME_INFORMATION_CLASS { + FilterVolumeBasicInformation, + FilterVolumeStandardInformation +} FILTER_VOLUME_INFORMATION_CLASS, *PFILTER_VOLUME_INFORMATION_CLASS; + +typedef enum _INSTANCE_INFORMATION_CLASS { + InstanceBasicInformation, + InstancePartialInformation, + InstanceFullInformation, + InstanceAggregateStandardInformation +} INSTANCE_INFORMATION_CLASS, *PINSTANCE_INFORMATION_CLASS; + +typedef struct _FILTER_FULL_INFORMATION { + ULONG NextEntryOffset; + ULONG FrameID; + ULONG NumberOfInstances; + USHORT FilterNameLength; + WCHAR FilterNameBuffer[1]; +} FILTER_FULL_INFORMATION, *PFILTER_FULL_INFORMATION; + +typedef struct _FILTER_AGGREGATE_BASIC_INFORMATION { + ULONG NextEntryOffset; + ULONG Flags; + union { + struct { + ULONG FrameID; + ULONG NumberOfInstances; + USHORT FilterNameLength; + USHORT FilterNameBufferOffset; + USHORT FilterAltitudeLength; + USHORT FilterAltitudeBufferOffset; + } MiniFilter; + struct { + USHORT FilterNameLength; + USHORT FilterNameBufferOffset; + } LegacyFilter; + } Type; +} FILTER_AGGREGATE_BASIC_INFORMATION, *PFILTER_AGGREGATE_BASIC_INFORMATION; + +#if FLT_MGR_LONGHORN + +#define FLTFL_AGGREGATE_INFO_IS_MINIFILTER 0x00000001 +#define FLTFL_AGGREGATE_INFO_IS_LEGACYFILTER 0x00000002 +#define FLTFL_ASI_IS_MINIFILTER 0x00000001 +#define FLTFL_ASI_IS_LEGACYFILTER 0x00000002 +#define FLTFL_VSI_DETACHED_VOLUME 0x00000001 +#define FLTFL_IASI_IS_MINIFILTER 0x00000001 +#define FLTFL_IASI_IS_LEGACYFILTER 0x00000002 +#define FLTFL_IASIM_DETACHED_VOLUME 0x00000001 +#define FLTFL_IASIL_DETACHED_VOLUME 0x00000001 + +typedef struct _FILTER_AGGREGATE_STANDARD_INFORMATION { + ULONG NextEntryOffset; + ULONG Flags; + union { + struct { + ULONG Flags; + ULONG FrameID; + ULONG NumberOfInstances; + USHORT FilterNameLength; + USHORT FilterNameBufferOffset; + USHORT FilterAltitudeLength; + USHORT FilterAltitudeBufferOffset; + } MiniFilter; + struct { + ULONG Flags; + USHORT FilterNameLength; + USHORT FilterNameBufferOffset; + USHORT FilterAltitudeLength; + USHORT FilterAltitudeBufferOffset; + } LegacyFilter; + } Type; +} FILTER_AGGREGATE_STANDARD_INFORMATION, *PFILTER_AGGREGATE_STANDARD_INFORMATION; + +typedef struct _FILTER_VOLUME_STANDARD_INFORMATION { + ULONG NextEntryOffset; + ULONG Flags; + ULONG FrameID; + FLT_FILESYSTEM_TYPE FileSystemType; + USHORT FilterVolumeNameLength; + WCHAR FilterVolumeName[1]; +} FILTER_VOLUME_STANDARD_INFORMATION, *PFILTER_VOLUME_STANDARD_INFORMATION; + +typedef struct _INSTANCE_AGGREGATE_STANDARD_INFORMATION { + ULONG NextEntryOffset; + ULONG Flags; + union { + struct { + ULONG Flags; + ULONG FrameID; + FLT_FILESYSTEM_TYPE VolumeFileSystemType; + USHORT InstanceNameLength; + USHORT InstanceNameBufferOffset; + USHORT AltitudeLength; + USHORT AltitudeBufferOffset; + USHORT VolumeNameLength; + USHORT VolumeNameBufferOffset; + USHORT FilterNameLength; + USHORT FilterNameBufferOffset; + } MiniFilter; + struct { + ULONG Flags; + USHORT AltitudeLength; + USHORT AltitudeBufferOffset; + USHORT VolumeNameLength; + USHORT VolumeNameBufferOffset; + USHORT FilterNameLength; + USHORT FilterNameBufferOffset; + } LegacyFilter; + } Type; +} INSTANCE_AGGREGATE_STANDARD_INFORMATION, *PINSTANCE_AGGREGATE_STANDARD_INFORMATION; + +#endif /* FLT_MGR_LONGHORN */ + +typedef struct _FILTER_VOLUME_BASIC_INFORMATION { + USHORT FilterVolumeNameLength; + WCHAR FilterVolumeName[1]; +} FILTER_VOLUME_BASIC_INFORMATION, *PFILTER_VOLUME_BASIC_INFORMATION; + +_Struct_size_bytes_(sizeof(INSTANCE_BASIC_INFORMATION) * InstanceNameLength) +typedef struct _INSTANCE_BASIC_INFORMATION { + ULONG NextEntryOffset; + USHORT InstanceNameLength; + USHORT InstanceNameBufferOffset; +} INSTANCE_BASIC_INFORMATION, *PINSTANCE_BASIC_INFORMATION; + +_Struct_size_bytes_(sizeof(INSTANCE_PARTIAL_INFORMATION) + InstanceNameLength + AltitudeLength) +typedef struct _INSTANCE_PARTIAL_INFORMATION { + ULONG NextEntryOffset; + USHORT InstanceNameLength; + USHORT InstanceNameBufferOffset; + USHORT AltitudeLength; + USHORT AltitudeBufferOffset; +} INSTANCE_PARTIAL_INFORMATION, *PINSTANCE_PARTIAL_INFORMATION; + +_Struct_size_bytes_(sizeof(INSTANCE_FULL_INFORMATION) + InstanceNameLength + AltitudeLength + VolumeNameLength + FilterNameLength) +typedef struct _INSTANCE_FULL_INFORMATION { + ULONG NextEntryOffset; + USHORT InstanceNameLength; + USHORT InstanceNameBufferOffset; + USHORT AltitudeLength; + USHORT AltitudeBufferOffset; + USHORT VolumeNameLength; + USHORT VolumeNameBufferOffset; + USHORT FilterNameLength; + USHORT FilterNameBufferOffset; +} INSTANCE_FULL_INFORMATION, *PINSTANCE_FULL_INFORMATION; + +typedef struct _FILTER_MESSAGE_HEADER { + ULONG ReplyLength; + ULONGLONG MessageId; +} FILTER_MESSAGE_HEADER, *PFILTER_MESSAGE_HEADER; + +typedef struct _FILTER_REPLY_HEADER { + NTSTATUS Status; + ULONGLONG MessageId; +} FILTER_REPLY_HEADER, *PFILTER_REPLY_HEADER; + +#endif /* FLT_MGR_BASELINE */ + +#endif /* __FLT_USER_STRUCTURES_H__ */ Propchange: trunk/reactos/include/ddk/fltuserstructures.h ------------------------------------------------------------------------------ svn:eol-style = native
12 years, 11 months
1
0
0
0
[akhaldi] 54969: [PORTCLS] * Initializes object attributes with correct handle attributes. * Use the provided access rights and create options. See issue #5934 for more details.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sun Jan 15 10:10:54 2012 New Revision: 54969 URL:
http://svn.reactos.org/svn/reactos?rev=54969&view=rev
Log: [PORTCLS] * Initializes object attributes with correct handle attributes. * Use the provided access rights and create options. See issue #5934 for more details. Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/registry.cpp Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/registry.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
============================================================================== --- trunk/reactos/drivers/wdm/audio/backpln/portcls/registry.cpp [iso-8859-1] (original) +++ trunk/reactos/drivers/wdm/audio/backpln/portcls/registry.cpp [iso-8859-1] Sun Jan 15 10:10:54 2012 @@ -156,8 +156,8 @@ return STATUS_INVALID_HANDLE; } - InitializeObjectAttributes(&Attributes, SubKeyName, 0, m_hKey, NULL); - Status = ZwCreateKey(&hKey, KEY_READ | KEY_WRITE, &Attributes, 0, NULL, 0, Disposition); + InitializeObjectAttributes(&Attributes, SubKeyName, OBJ_INHERIT | OBJ_CASE_INSENSITIVE | OBJ_OPENIF | OBJ_KERNEL_HANDLE, m_hKey, NULL); + Status = ZwCreateKey(&hKey, DesiredAccess, &Attributes, 0, NULL, CreateOptions, Disposition); if (!NT_SUCCESS(Status)) { DPRINT("CRegistryKey::NewSubKey failed with %x\n", Status); @@ -176,8 +176,6 @@ delete RegistryKey; return Status; } - - *RegistrySubKey = (PREGISTRYKEY)RegistryKey; DPRINT("CRegistryKey::NewSubKey RESULT %p\n", *RegistrySubKey); return STATUS_SUCCESS;
12 years, 11 months
1
0
0
0
[ion] 54968: [NTDLL]: Add, export, and stubplement RtlComputeImportTableHash and document in NDK. [NTDLL]: Use HANDLE instead of Win32 HKEY. [NDK]: Add missing NtCreateProcessEx flags and some miss...
by ion@svn.reactos.org
Author: ion Date: Sun Jan 15 03:16:00 2012 New Revision: 54968 URL:
http://svn.reactos.org/svn/reactos?rev=54968&view=rev
Log: [NTDLL]: Add, export, and stubplement RtlComputeImportTableHash and document in NDK. [NTDLL]: Use HANDLE instead of Win32 HKEY. [NDK]: Add missing NtCreateProcessEx flags and some missing Ldr functions + missing RtlGetFullPathName_UstrEx. [CSRSS]: Define two new CSRSS messages (not implemented): UpdateVdmEntry and GetVdmExitCode. Modified: trunk/reactos/dll/ntdll/def/ntdll.pspec trunk/reactos/dll/ntdll/def/ntdll.spec trunk/reactos/dll/ntdll/ldr/ldrinit.c trunk/reactos/dll/ntdll/rtl/libsupp.c trunk/reactos/include/ndk/pstypes.h trunk/reactos/include/ndk/rtlfuncs.h trunk/reactos/include/ndk/umfuncs.h trunk/reactos/include/reactos/subsys/csrss/csrss.h Modified: trunk/reactos/dll/ntdll/def/ntdll.pspec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/ntdll/def/ntdll.pspec?…
============================================================================== --- trunk/reactos/dll/ntdll/def/ntdll.pspec [iso-8859-1] (original) +++ trunk/reactos/dll/ntdll/def/ntdll.pspec [iso-8859-1] Sun Jan 15 03:16:00 2012 @@ -485,7 +485,7 @@ @ stdcall RtlCompareUnicodeString (ptr ptr long) @ stdcall RtlCompressBuffer(long ptr long ptr long long ptr ptr) @ stdcall RtlComputeCrc32(long ptr long) -//@ stdcall RtlComputeImportTableHash +@ stdcall RtlComputeImportTableHash(ptr ptr long) //@ stdcall RtlComputePrivatizedDllName_U //@ stdcall RtlConsoleMultiByteToUnicodeN @ stdcall RtlConvertExclusiveToShared(ptr) Modified: trunk/reactos/dll/ntdll/def/ntdll.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/ntdll/def/ntdll.spec?r…
============================================================================== --- trunk/reactos/dll/ntdll/def/ntdll.spec [iso-8859-1] (original) +++ trunk/reactos/dll/ntdll/def/ntdll.spec [iso-8859-1] Sun Jan 15 03:16:00 2012 @@ -483,7 +483,7 @@ @ stdcall RtlCompareUnicodeString (ptr ptr long) @ stdcall RtlCompressBuffer(long ptr long ptr long long ptr ptr) @ stdcall RtlComputeCrc32(long ptr long) -;@ stdcall RtlComputeImportTableHash +@ stdcall RtlComputeImportTableHash(ptr ptr long) ;@ stdcall RtlComputePrivatizedDllName_U ;@ stdcall RtlConsoleMultiByteToUnicodeN @ stdcall RtlConvertExclusiveToShared(ptr) Modified: trunk/reactos/dll/ntdll/ldr/ldrinit.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/ntdll/ldr/ldrinit.c?re…
============================================================================== --- trunk/reactos/dll/ntdll/ldr/ldrinit.c [iso-8859-1] (original) +++ trunk/reactos/dll/ntdll/ldr/ldrinit.c [iso-8859-1] Sun Jan 15 03:16:00 2012 @@ -18,8 +18,8 @@ /* GLOBALS *******************************************************************/ -HKEY ImageExecOptionsKey; -HKEY Wow64ExecOptionsKey; +HANDLE ImageExecOptionsKey; +HANDLE Wow64ExecOptionsKey; UNICODE_STRING ImageExecOptionsString = RTL_CONSTANT_STRING(L"\\Registry\\Machine\\Software\\Microsoft\\Windows NT\\CurrentVersion\\Image File Execution Options"); UNICODE_STRING Wow64OptionsString = RTL_CONSTANT_STRING(L""); UNICODE_STRING NtDllString = RTL_CONSTANT_STRING(L"ntdll.dll"); @@ -104,9 +104,9 @@ NTAPI LdrOpenImageFileOptionsKey(IN PUNICODE_STRING SubKey, IN BOOLEAN Wow64, - OUT PHKEY NewKeyHandle) + OUT PHANDLE NewKeyHandle) { - PHKEY RootKeyLocation; + PHANDLE RootKeyLocation; HANDLE RootKey; UNICODE_STRING SubKeyString; OBJECT_ATTRIBUTES ObjectAttributes; @@ -174,7 +174,7 @@ */ NTSTATUS NTAPI -LdrQueryImageFileKeyOption(IN HKEY KeyHandle, +LdrQueryImageFileKeyOption(IN HANDLE KeyHandle, IN PCWSTR ValueName, IN ULONG Type, OUT PVOID Buffer, @@ -345,7 +345,7 @@ IN BOOLEAN Wow64) { NTSTATUS Status; - HKEY KeyHandle; + HANDLE KeyHandle; /* Open a handle to the key */ Status = LdrOpenImageFileOptionsKey(SubKey, Wow64, &KeyHandle); @@ -1326,10 +1326,10 @@ NTSTATUS NTAPI -LdrpInitializeExecutionOptions(PUNICODE_STRING ImagePathName, PPEB Peb, PHKEY OptionsKey) +LdrpInitializeExecutionOptions(PUNICODE_STRING ImagePathName, PPEB Peb, PHANDLE OptionsKey) { NTSTATUS Status; - HKEY KeyHandle; + HANDLE KeyHandle; ULONG ExecuteOptions, MinimumStackCommit = 0, GlobalFlag; /* Return error if we were not provided a pointer where to save the options key handle */ @@ -1467,12 +1467,12 @@ PPEB Peb = NtCurrentPeb(); BOOLEAN IsDotNetImage = FALSE; BOOLEAN FreeCurDir = FALSE; - //HKEY CompatKey; + //HANDLE CompatKey; PRTL_USER_PROCESS_PARAMETERS ProcessParameters; //LPWSTR ImagePathBuffer; ULONG ConfigSize; UNICODE_STRING CurrentDirectory; - HKEY OptionsKey; + HANDLE OptionsKey; ULONG HeapFlags; PIMAGE_NT_HEADERS NtHeader; LPWSTR NtDllName = NULL; Modified: trunk/reactos/dll/ntdll/rtl/libsupp.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/ntdll/rtl/libsupp.c?re…
============================================================================== --- trunk/reactos/dll/ntdll/rtl/libsupp.c [iso-8859-1] (original) +++ trunk/reactos/dll/ntdll/rtl/libsupp.c [iso-8859-1] Sun Jan 15 03:16:00 2012 @@ -562,4 +562,18 @@ return STATUS_NOT_IMPLEMENTED; } +/* + * @unimplemented + */ +NTSYSAPI +NTSTATUS +NTAPI +RtlComputeImportTableHash(IN HANDLE FileHandle, + OUT PCHAR Hash, + IN ULONG ImporTTableHashSize) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + /* EOF */ Modified: trunk/reactos/include/ndk/pstypes.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/pstypes.h?rev=…
============================================================================== --- trunk/reactos/include/ndk/pstypes.h [iso-8859-1] (original) +++ trunk/reactos/include/ndk/pstypes.h [iso-8859-1] Sun Jan 15 03:16:00 2012 @@ -72,6 +72,15 @@ #define FLG_HEAP_PAGE_ALLOCS 0x02000000 #define FLG_DEBUG_INITIAL_COMMAND_EX 0x04000000 #define FLG_VALID_BITS 0x07FFFFFF + +// +// Flags for NtCreateProcessEx +// +#define PROCESS_CREATE_FLAGS_BREAKAWAY 0x00000001 +#define PROCESS_CREATE_FLAGS_NO_DEBUG_INHERIT 0x00000002 +#define PROCESS_CREATE_FLAGS_INHERIT_HANDLES 0x00000004 +#define PROCESS_CREATE_FLAGS_OVERRIDE_ADDRESS_SPACE 0x00000008 +#define PROCESS_CREATE_FLAGS_LARGE_PAGES 0x00000010 // // Process priority classes Modified: trunk/reactos/include/ndk/rtlfuncs.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/rtlfuncs.h?rev…
============================================================================== --- trunk/reactos/include/ndk/rtlfuncs.h [iso-8859-1] (original) +++ trunk/reactos/include/ndk/rtlfuncs.h [iso-8859-1] Sun Jan 15 03:16:00 2012 @@ -2513,7 +2513,7 @@ RtlDosPathNameToRelativeNtPathName_U( IN PCWSTR DosName, OUT PUNICODE_STRING NtName, - OUT PCWSTR * PartName, + OUT PCWSTR *PartName, OUT PRTL_RELATIVE_NAME_U RelativeName ); @@ -2543,6 +2543,19 @@ IN ULONG Size, IN PWSTR Buffer, OUT PWSTR *ShortName +); + +ULONG +NTAPI +RtlGetFullPathName_UstrEx( + IN PUNICODE_STRING FileName, + IN PUNICODE_STRING StaticString, + IN PUNICODE_STRING DynamicString, + IN PUNICODE_STRING *StringUsed, + IN PSIZE_T FilePartSize, + OUT PBOOLEAN NameInvalid, + OUT RTL_PATH_TYPE* PathType, + OUT PULONG LengthNeeded ); NTSYSAPI @@ -3824,6 +3837,15 @@ RtlGUIDFromString( IN PUNICODE_STRING GuidString, OUT GUID *Guid); + +NTSYSAPI +NTSTATUS +NTAPI +RtlComputeImportTableHash( + IN HANDLE hFile, + OUT PCHAR Hash, + IN ULONG ImportTableHashRevision +); #endif #ifdef __cplusplus Modified: trunk/reactos/include/ndk/umfuncs.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/umfuncs.h?rev=…
============================================================================== --- trunk/reactos/include/ndk/umfuncs.h [iso-8859-1] (original) +++ trunk/reactos/include/ndk/umfuncs.h [iso-8859-1] Sun Jan 15 03:16:00 2012 @@ -314,4 +314,23 @@ OUT PUSHORT ImageCharacterstics ); +NTSTATUS +NTAPI +LdrOpenImageFileOptionsKey( + IN PUNICODE_STRING SubKey, + IN BOOLEAN Wow64, + OUT PHANDLE NewKeyHandle +); + +NTSTATUS +NTAPI +LdrQueryImageFileKeyOption( + IN HANDLE KeyHandle, + IN PCWSTR ValueName, + IN ULONG Type, + OUT PVOID Buffer, + IN ULONG BufferSize, + OUT PULONG ReturnedLength OPTIONAL +); + #endif Modified: trunk/reactos/include/reactos/subsys/csrss/csrss.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/subsys/csr…
============================================================================== --- trunk/reactos/include/reactos/subsys/csrss/csrss.h [iso-8859-1] (original) +++ trunk/reactos/include/reactos/subsys/csrss/csrss.h [iso-8859-1] Sun Jan 15 03:16:00 2012 @@ -529,6 +529,24 @@ { ULONG VideoMode; } CSRSS_SOUND_SENTRY, *PCSRSS_SOUND_SENTRY; + +typedef struct +{ + ULONG iTask; + ULONG BinaryType; + HANDLE ConsoleHandle; + HANDLE VDMProcessHandle; + HANDLE WaitObjectForParent; + USHORT EntryIndex; + USHORT VDMCreationState; +} CSRSS_UPDATE_VDM_ENTRY, *PCSRSS_UPDATE_VDM_ENTRY; + +typedef struct +{ + HANDLE ConsoleHandle; + HANDLE hParent; + ULONG ExitCode; +} CSRSS_GET_VDM_EXIT_CODE, *PCSRSS_GET_VDM_EXIT_CODE; #define CSR_API_MESSAGE_HEADER_SIZE(Type) (FIELD_OFFSET(CSR_API_MESSAGE, Data) + sizeof(Type)) #define CSRSS_MAX_WRITE_CONSOLE (LPC_MAX_DATA_LENGTH - CSR_API_MESSAGE_HEADER_SIZE(CSRSS_WRITE_CONSOLE)) @@ -612,6 +630,8 @@ #define GET_TEMP_FILE (0x48) #define DEFINE_DOS_DEVICE (0X49) #define SOUND_SENTRY (0x50) +#define UPDATE_VDM_ENTRY (0x51) +#define GET_VDM_EXIT_CODE (0x52) /* Keep in sync with definition below. */ #define CSRSS_HEADER_SIZE (sizeof(PORT_MESSAGE) + sizeof(ULONG) + sizeof(NTSTATUS)) @@ -696,6 +716,8 @@ CSRSS_GET_TEMP_FILE GetTempFile; CSRSS_DEFINE_DOS_DEVICE DefineDosDeviceRequest; CSRSS_SOUND_SENTRY SoundSentryRequest; + CSRSS_UPDATE_VDM_ENTRY UpdateVdmEntry; + CSRSS_GET_VDM_EXIT_CODE GetVdmExitCode; } Data; } CSR_API_MESSAGE, *PCSR_API_MESSAGE;
12 years, 11 months
1
0
0
0
← Newer
1
...
36
37
38
39
40
41
42
...
56
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
54
55
56
Results per page:
10
25
50
100
200