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
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
October 2012
----- 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
14 participants
211 discussions
Start a n
N
ew thread
[hbelusca] 57490: [REGEDIT] - Re-number some resource IDs. - Add key exportation message-box error (thus removing some fwprintf calls). - Use IDS_MY_COMPUTER localized string instead of hardcoded one.
by hbelusca@svn.reactos.org
Author: hbelusca Date: Fri Oct 5 20:08:16 2012 New Revision: 57490 URL:
http://svn.reactos.org/svn/reactos?rev=57490&view=rev
Log: [REGEDIT] - Re-number some resource IDs. - Add key exportation message-box error (thus removing some fwprintf calls). - Use IDS_MY_COMPUTER localized string instead of hardcoded one. Modified: trunk/reactos/base/applications/regedit/childwnd.c trunk/reactos/base/applications/regedit/framewnd.c trunk/reactos/base/applications/regedit/lang/bg-BG.rc trunk/reactos/base/applications/regedit/lang/cs-CZ.rc trunk/reactos/base/applications/regedit/lang/de-DE.rc trunk/reactos/base/applications/regedit/lang/el-GR.rc trunk/reactos/base/applications/regedit/lang/en-US.rc trunk/reactos/base/applications/regedit/lang/es-ES.rc trunk/reactos/base/applications/regedit/lang/fr-FR.rc trunk/reactos/base/applications/regedit/lang/hu-HU.rc trunk/reactos/base/applications/regedit/lang/id-ID.rc trunk/reactos/base/applications/regedit/lang/it-IT.rc trunk/reactos/base/applications/regedit/lang/ja-JP.rc trunk/reactos/base/applications/regedit/lang/ko-KR.rc trunk/reactos/base/applications/regedit/lang/nl-NL.rc trunk/reactos/base/applications/regedit/lang/no-NO.rc trunk/reactos/base/applications/regedit/lang/pl-PL.rc trunk/reactos/base/applications/regedit/lang/pt-BR.rc trunk/reactos/base/applications/regedit/lang/pt-PT.rc trunk/reactos/base/applications/regedit/lang/ro-RO.rc trunk/reactos/base/applications/regedit/lang/ru-RU.rc trunk/reactos/base/applications/regedit/lang/sk-SK.rc trunk/reactos/base/applications/regedit/lang/sl-SI.rc trunk/reactos/base/applications/regedit/lang/sv-SE.rc trunk/reactos/base/applications/regedit/lang/th-TH.rc trunk/reactos/base/applications/regedit/lang/uk-UA.rc trunk/reactos/base/applications/regedit/lang/zh-CN.rc trunk/reactos/base/applications/regedit/lang/zh-TW.rc trunk/reactos/base/applications/regedit/regedit.c trunk/reactos/base/applications/regedit/resource.h trunk/reactos/base/applications/regedit/settings.c trunk/reactos/base/applications/regedit/treeview.c Modified: trunk/reactos/base/applications/regedit/childwnd.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/regedit/…
============================================================================== --- trunk/reactos/base/applications/regedit/childwnd.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/regedit/childwnd.c [iso-8859-1] Fri Oct 5 20:08:16 2012 @@ -325,7 +325,8 @@ WNDPROC oldproc; HFONT hFont; WCHAR buffer[MAX_PATH]; - /* load "My Computer" string */ + + /* Load "My Computer" string */ LoadStringW(hInst, IDS_MY_COMPUTER, buffer, COUNT_OF(buffer)); g_pChildWnd = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(ChildWnd)); Modified: trunk/reactos/base/applications/regedit/framewnd.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/regedit/…
============================================================================== --- trunk/reactos/base/applications/regedit/framewnd.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/regedit/framewnd.c [iso-8859-1] Fri Oct 5 20:08:16 2012 @@ -85,8 +85,7 @@ } else { - while(RemoveMenu(hMenu, s_nFavoriteMenuSubPos, MF_BYPOSITION)) - ; + while(RemoveMenu(hMenu, s_nFavoriteMenuSubPos, MF_BYPOSITION)) ; } lResult = RegOpenKeyW(HKEY_CURRENT_USER, s_szFavoritesRegKey, &hKey); @@ -436,7 +435,7 @@ { BOOL bRet = FALSE; OPENFILENAME ofn; - WCHAR Caption[128], szTitle[256], szText[256]; + WCHAR Caption[128], szTitle[512], szText[512]; HKEY hKeyRoot; LPCWSTR pszKeyPath; @@ -455,14 +454,15 @@ wcsicmp(ofn.lpstrFile + ofn.nFileExtension, L"reg") == 0) /* REGEDIT4 or Windows Registry Editor Version 5.00 */ { /* Open the file */ - FILE *fp = _wfopen(ofn.lpstrFile, L"r"); + FILE* fp = _wfopen(ofn.lpstrFile, L"r"); /* Import it */ if (fp == NULL || !import_registry_file(fp)) { - LPSTR p = GetMultiByteString(ofn.lpstrFile); - fwprintf(stderr, L"Can't open file \"%s\"\n", p); - HeapFree(GetProcessHeap(), 0, p); + /* Error opening the file */ + LoadStringW(hInst, IDS_APP_TITLE, szTitle, COUNT_OF(szTitle)); + LoadStringW(hInst, IDS_IMPORT_ERROR, szText, COUNT_OF(szText)); + InfoMessageBox(hWnd, MB_OK | MB_ICONERROR, szTitle, szText, ofn.lpstrFile); bRet = FALSE; } else @@ -470,7 +470,7 @@ /* Show successful import */ LoadStringW(hInst, IDS_APP_TITLE, szTitle, COUNT_OF(szTitle)); LoadStringW(hInst, IDS_IMPORT_OK, szText, COUNT_OF(szText)); - MessageBoxW(NULL, szText, szTitle, MB_OK); + InfoMessageBox(hWnd, MB_OK | MB_ICONINFORMATION, szTitle, szText, ofn.lpstrFile); bRet = TRUE; } @@ -582,7 +582,7 @@ BOOL bRet = FALSE; OPENFILENAME ofn; WCHAR ExportKeyPath[_MAX_PATH]; - WCHAR Caption[128]; + WCHAR Caption[128], szTitle[512], szText[512]; HKEY hKeyRoot; LPCWSTR pszKeyPath; @@ -664,9 +664,10 @@ (ofn.nFilterIndex == 3 ? REG_FORMAT_4 : REG_FORMAT_5))) { - LPSTR p = GetMultiByteString(ofn.lpstrFile); - fwprintf(stderr, L"Can't open file \"%s\"\n", p); - HeapFree(GetProcessHeap(), 0, p); + /* Error creating the file */ + LoadStringW(hInst, IDS_APP_TITLE, szTitle, COUNT_OF(szTitle)); + LoadStringW(hInst, IDS_EXPORT_ERROR, szText, COUNT_OF(szText)); + InfoMessageBox(hWnd, MB_OK | MB_ICONERROR, szTitle, szText, ofn.lpstrFile); bRet = FALSE; } else Modified: trunk/reactos/base/applications/regedit/lang/bg-BG.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/regedit/…
============================================================================== --- trunk/reactos/base/applications/regedit/lang/bg-BG.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/regedit/lang/bg-BG.rc [iso-8859-1] Fri Oct 5 20:08:16 2012 @@ -452,6 +452,7 @@ IDS_IMPORT_PROMPT "Adding information can unintentionally change or delete values and cause components to stop working correctly. If you do not trust the source of this information in '%1', do not add it to registry.\n\nAre you sure you want to continue?" IDS_IMPORT_OK "The keys and values contained in '%1' have been successfully added to the registry." IDS_IMPORT_ERROR "Cannot import '%1': Error opening the file. There may be a disk, file system error or file may not exist." + IDS_EXPORT_ERROR "Cannot export '%1': Error creating or writing to the file. There may be a disk or file system error." END STRINGTABLE DISCARDABLE Modified: trunk/reactos/base/applications/regedit/lang/cs-CZ.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/regedit/…
============================================================================== --- trunk/reactos/base/applications/regedit/lang/cs-CZ.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/regedit/lang/cs-CZ.rc [iso-8859-1] Fri Oct 5 20:08:16 2012 @@ -437,6 +437,7 @@ IDS_IMPORT_PROMPT "Adding information can unintentionally change or delete values and cause components to stop working correctly. If you do not trust the source of this information in '%1', do not add it to registry.\n\nAre you sure you want to continue?" IDS_IMPORT_OK "The keys and values contained in '%1' have been successfully added to the registry." IDS_IMPORT_ERROR "Cannot import '%1': Error opening the file. There may be a disk, file system error or file may not exist." + IDS_EXPORT_ERROR "Cannot export '%1': Error creating or writing to the file. There may be a disk or file system error." END STRINGTABLE DISCARDABLE Modified: trunk/reactos/base/applications/regedit/lang/de-DE.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/regedit/…
============================================================================== --- trunk/reactos/base/applications/regedit/lang/de-DE.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/regedit/lang/de-DE.rc [iso-8859-1] Fri Oct 5 20:08:16 2012 @@ -437,6 +437,7 @@ IDS_IMPORT_PROMPT "Adding information can unintentionally change or delete values and cause components to stop working correctly. If you do not trust the source of this information in '%1', do not add it to registry.\n\nAre you sure you want to continue?" IDS_IMPORT_OK "The keys and values contained in '%1' have been successfully added to the registry." IDS_IMPORT_ERROR "Cannot import '%1': Error opening the file. There may be a disk, file system error or file may not exist." + IDS_EXPORT_ERROR "Cannot export '%1': Error creating or writing to the file. There may be a disk or file system error." END STRINGTABLE DISCARDABLE Modified: trunk/reactos/base/applications/regedit/lang/el-GR.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/regedit/…
============================================================================== --- trunk/reactos/base/applications/regedit/lang/el-GR.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/regedit/lang/el-GR.rc [iso-8859-1] Fri Oct 5 20:08:16 2012 @@ -437,6 +437,7 @@ IDS_IMPORT_PROMPT "Adding information can unintentionally change or delete values and cause components to stop working correctly. If you do not trust the source of this information in '%1', do not add it to registry.\n\nAre you sure you want to continue?" IDS_IMPORT_OK "The keys and values contained in '%1' have been successfully added to the registry." IDS_IMPORT_ERROR "Cannot import '%1': Error opening the file. There may be a disk, file system error or file may not exist." + IDS_EXPORT_ERROR "Cannot export '%1': Error creating or writing to the file. There may be a disk or file system error." END STRINGTABLE DISCARDABLE Modified: trunk/reactos/base/applications/regedit/lang/en-US.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/regedit/…
============================================================================== --- trunk/reactos/base/applications/regedit/lang/en-US.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/regedit/lang/en-US.rc [iso-8859-1] Fri Oct 5 20:08:16 2012 @@ -437,6 +437,7 @@ IDS_IMPORT_PROMPT "Adding information can unintentionally change or delete values and cause components to stop working correctly. If you do not trust the source of this information in '%1', do not add it to registry.\n\nAre you sure you want to continue?" IDS_IMPORT_OK "The keys and values contained in '%1' have been successfully added to the registry." IDS_IMPORT_ERROR "Cannot import '%1': Error opening the file. There may be a disk, file system error or file may not exist." + IDS_EXPORT_ERROR "Cannot export '%1': Error creating or writing to the file. There may be a disk or file system error." END STRINGTABLE DISCARDABLE Modified: trunk/reactos/base/applications/regedit/lang/es-ES.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/regedit/…
============================================================================== --- trunk/reactos/base/applications/regedit/lang/es-ES.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/regedit/lang/es-ES.rc [iso-8859-1] Fri Oct 5 20:08:16 2012 @@ -440,6 +440,7 @@ IDS_IMPORT_PROMPT "Adding information can unintentionally change or delete values and cause components to stop working correctly. If you do not trust the source of this information in '%1', do not add it to registry.\n\nAre you sure you want to continue?" IDS_IMPORT_OK "The keys and values contained in '%1' have been successfully added to the registry." IDS_IMPORT_ERROR "Cannot import '%1': Error opening the file. There may be a disk, file system error or file may not exist." + IDS_EXPORT_ERROR "Cannot export '%1': Error creating or writing to the file. There may be a disk or file system error." END STRINGTABLE DISCARDABLE Modified: trunk/reactos/base/applications/regedit/lang/fr-FR.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/regedit/…
============================================================================== --- trunk/reactos/base/applications/regedit/lang/fr-FR.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/regedit/lang/fr-FR.rc [iso-8859-1] Fri Oct 5 20:08:16 2012 @@ -432,7 +432,8 @@ BEGIN IDS_IMPORT_PROMPT "L'ajout d'informations peut involontairement modifier ou supprimer des valeurs et endommager le fonctionnement de composants. Si vous n'êtes pas sûr de la source de ces informations dans '%1', ne les ajoutez pas au Registre.\n\nÃtes-vous sûr de vouloir continuer ?" IDS_IMPORT_OK "Les clés et valeurs contenues dans '%1' ont été correctement ajoutées au Registre." - IDS_IMPORT_ERROR "Impossible dâimporter '%1' à la suite dâune erreur lors de la lecture de ce fichier. Il sâagit dâune erreur disque, ou le fichier est endommagé." + IDS_IMPORT_ERROR "Impossible d'importer '%1' à la suite d'une erreur lors de la lecture de ce fichier. Il s'agit d'une erreur disque, ou le fichier est endommagé." + IDS_EXPORT_ERROR "Impossible d'exporter dans le fichier '%1' à la suite d'une erreur lors de sa création ou d'une tentative d'écriture, pouvant être due à une erreur de disque ou de système de fichiers." END STRINGTABLE DISCARDABLE Modified: trunk/reactos/base/applications/regedit/lang/hu-HU.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/regedit/…
============================================================================== --- trunk/reactos/base/applications/regedit/lang/hu-HU.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/regedit/lang/hu-HU.rc [iso-8859-1] Fri Oct 5 20:08:16 2012 @@ -438,6 +438,7 @@ IDS_IMPORT_PROMPT "Adding information can unintentionally change or delete values and cause components to stop working correctly. If you do not trust the source of this information in '%1', do not add it to registry.\n\nAre you sure you want to continue?" IDS_IMPORT_OK "The keys and values contained in '%1' have been successfully added to the registry." IDS_IMPORT_ERROR "Cannot import '%1': Error opening the file. There may be a disk, file system error or file may not exist." + IDS_EXPORT_ERROR "Cannot export '%1': Error creating or writing to the file. There may be a disk or file system error." END STRINGTABLE DISCARDABLE Modified: trunk/reactos/base/applications/regedit/lang/id-ID.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/regedit/…
============================================================================== --- trunk/reactos/base/applications/regedit/lang/id-ID.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/regedit/lang/id-ID.rc [iso-8859-1] Fri Oct 5 20:08:16 2012 @@ -436,6 +436,7 @@ IDS_IMPORT_PROMPT "Adding information can unintentionally change or delete values and cause components to stop working correctly. If you do not trust the source of this information in '%1', do not add it to registry.\n\nAre you sure you want to continue?" IDS_IMPORT_OK "The keys and values contained in '%1' have been successfully added to the registry." IDS_IMPORT_ERROR "Cannot import '%1': Error opening the file. There may be a disk, file system error or file may not exist." + IDS_EXPORT_ERROR "Cannot export '%1': Error creating or writing to the file. There may be a disk or file system error." END STRINGTABLE DISCARDABLE Modified: trunk/reactos/base/applications/regedit/lang/it-IT.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/regedit/…
============================================================================== --- trunk/reactos/base/applications/regedit/lang/it-IT.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/regedit/lang/it-IT.rc [iso-8859-1] Fri Oct 5 20:08:16 2012 @@ -439,6 +439,7 @@ IDS_IMPORT_PROMPT "Adding information can unintentionally change or delete values and cause components to stop working correctly. If you do not trust the source of this information in '%1', do not add it to registry.\n\nAre you sure you want to continue?" IDS_IMPORT_OK "The keys and values contained in '%1' have been successfully added to the registry." IDS_IMPORT_ERROR "Cannot import '%1': Error opening the file. There may be a disk, file system error or file may not exist." + IDS_EXPORT_ERROR "Cannot export '%1': Error creating or writing to the file. There may be a disk or file system error." END STRINGTABLE DISCARDABLE Modified: trunk/reactos/base/applications/regedit/lang/ja-JP.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/regedit/…
============================================================================== --- trunk/reactos/base/applications/regedit/lang/ja-JP.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/regedit/lang/ja-JP.rc [iso-8859-1] Fri Oct 5 20:08:16 2012 @@ -437,6 +437,7 @@ IDS_IMPORT_PROMPT "Adding information can unintentionally change or delete values and cause components to stop working correctly. If you do not trust the source of this information in '%1', do not add it to registry.\n\nAre you sure you want to continue?" IDS_IMPORT_OK "The keys and values contained in '%1' have been successfully added to the registry." IDS_IMPORT_ERROR "Cannot import '%1': Error opening the file. There may be a disk, file system error or file may not exist." + IDS_EXPORT_ERROR "Cannot export '%1': Error creating or writing to the file. There may be a disk or file system error." END STRINGTABLE DISCARDABLE Modified: trunk/reactos/base/applications/regedit/lang/ko-KR.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/regedit/…
============================================================================== --- trunk/reactos/base/applications/regedit/lang/ko-KR.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/regedit/lang/ko-KR.rc [iso-8859-1] Fri Oct 5 20:08:16 2012 @@ -422,6 +422,7 @@ IDS_IMPORT_PROMPT "Adding information can unintentionally change or delete values and cause components to stop working correctly. If you do not trust the source of this information in '%1', do not add it to registry.\n\nAre you sure you want to continue?" IDS_IMPORT_OK "The keys and values contained in '%1' have been successfully added to the registry." IDS_IMPORT_ERROR "Cannot import '%1': Error opening the file. There may be a disk, file system error or file may not exist." + IDS_EXPORT_ERROR "Cannot export '%1': Error creating or writing to the file. There may be a disk or file system error." END STRINGTABLE DISCARDABLE Modified: trunk/reactos/base/applications/regedit/lang/nl-NL.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/regedit/…
============================================================================== --- trunk/reactos/base/applications/regedit/lang/nl-NL.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/regedit/lang/nl-NL.rc [iso-8859-1] Fri Oct 5 20:08:16 2012 @@ -437,6 +437,7 @@ IDS_IMPORT_PROMPT "Adding information can unintentionally change or delete values and cause components to stop working correctly. If you do not trust the source of this information in '%1', do not add it to registry.\n\nAre you sure you want to continue?" IDS_IMPORT_OK "The keys and values contained in '%1' have been successfully added to the registry." IDS_IMPORT_ERROR "Cannot import '%1': Error opening the file. There may be a disk, file system error or file may not exist." + IDS_EXPORT_ERROR "Cannot export '%1': Error creating or writing to the file. There may be a disk or file system error." END STRINGTABLE DISCARDABLE Modified: trunk/reactos/base/applications/regedit/lang/no-NO.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/regedit/…
============================================================================== --- trunk/reactos/base/applications/regedit/lang/no-NO.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/regedit/lang/no-NO.rc [iso-8859-1] Fri Oct 5 20:08:16 2012 @@ -437,6 +437,7 @@ IDS_IMPORT_PROMPT "Adding information can unintentionally change or delete values and cause components to stop working correctly. If you do not trust the source of this information in '%1', do not add it to registry.\n\nAre you sure you want to continue?" IDS_IMPORT_OK "The keys and values contained in '%1' have been successfully added to the registry." IDS_IMPORT_ERROR "Cannot import '%1': Error opening the file. There may be a disk, file system error or file may not exist." + IDS_EXPORT_ERROR "Cannot export '%1': Error creating or writing to the file. There may be a disk or file system error." END STRINGTABLE DISCARDABLE Modified: trunk/reactos/base/applications/regedit/lang/pl-PL.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/regedit/…
============================================================================== --- trunk/reactos/base/applications/regedit/lang/pl-PL.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/regedit/lang/pl-PL.rc [iso-8859-1] Fri Oct 5 20:08:16 2012 @@ -444,6 +444,7 @@ IDS_IMPORT_PROMPT "Adding information can unintentionally change or delete values and cause components to stop working correctly. If you do not trust the source of this information in '%1', do not add it to registry.\n\nAre you sure you want to continue?" IDS_IMPORT_OK "The keys and values contained in '%1' have been successfully added to the registry." IDS_IMPORT_ERROR "Cannot import '%1': Error opening the file. There may be a disk, file system error or file may not exist." + IDS_EXPORT_ERROR "Cannot export '%1': Error creating or writing to the file. There may be a disk or file system error." END STRINGTABLE DISCARDABLE Modified: trunk/reactos/base/applications/regedit/lang/pt-BR.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/regedit/…
============================================================================== --- trunk/reactos/base/applications/regedit/lang/pt-BR.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/regedit/lang/pt-BR.rc [iso-8859-1] Fri Oct 5 20:08:16 2012 @@ -438,6 +438,7 @@ IDS_IMPORT_PROMPT "Adding information can unintentionally change or delete values and cause components to stop working correctly. If you do not trust the source of this information in '%1', do not add it to registry.\n\nAre you sure you want to continue?" IDS_IMPORT_OK "The keys and values contained in '%1' have been successfully added to the registry." IDS_IMPORT_ERROR "Cannot import '%1': Error opening the file. There may be a disk, file system error or file may not exist." + IDS_EXPORT_ERROR "Cannot export '%1': Error creating or writing to the file. There may be a disk or file system error." END STRINGTABLE DISCARDABLE Modified: trunk/reactos/base/applications/regedit/lang/pt-PT.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/regedit/…
============================================================================== --- trunk/reactos/base/applications/regedit/lang/pt-PT.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/regedit/lang/pt-PT.rc [iso-8859-1] Fri Oct 5 20:08:16 2012 @@ -439,6 +439,7 @@ IDS_IMPORT_PROMPT "Adding information can unintentionally change or delete values and cause components to stop working correctly. If you do not trust the source of this information in '%1', do not add it to registry.\n\nAre you sure you want to continue?" IDS_IMPORT_OK "The keys and values contained in '%1' have been successfully added to the registry." IDS_IMPORT_ERROR "Cannot import '%1': Error opening the file. There may be a disk, file system error or file may not exist." + IDS_EXPORT_ERROR "Cannot export '%1': Error creating or writing to the file. There may be a disk or file system error." END STRINGTABLE DISCARDABLE Modified: trunk/reactos/base/applications/regedit/lang/ro-RO.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/regedit/…
============================================================================== --- trunk/reactos/base/applications/regedit/lang/ro-RO.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/regedit/lang/ro-RO.rc [iso-8859-1] Fri Oct 5 20:08:16 2012 @@ -435,6 +435,7 @@ IDS_IMPORT_PROMPT "Adding information can unintentionally change or delete values and cause components to stop working correctly. If you do not trust the source of this information in '%1', do not add it to registry.\n\nAre you sure you want to continue?" IDS_IMPORT_OK "The keys and values contained in '%1' have been successfully added to the registry." IDS_IMPORT_ERROR "Cannot import '%1': Error opening the file. There may be a disk, file system error or file may not exist." + IDS_EXPORT_ERROR "Cannot export '%1': Error creating or writing to the file. There may be a disk or file system error." END STRINGTABLE DISCARDABLE Modified: trunk/reactos/base/applications/regedit/lang/ru-RU.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/regedit/…
============================================================================== --- trunk/reactos/base/applications/regedit/lang/ru-RU.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/regedit/lang/ru-RU.rc [iso-8859-1] Fri Oct 5 20:08:16 2012 @@ -434,6 +434,7 @@ IDS_IMPORT_PROMPT "Adding information can unintentionally change or delete values and cause components to stop working correctly. If you do not trust the source of this information in '%1', do not add it to registry.\n\nAre you sure you want to continue?" IDS_IMPORT_OK "The keys and values contained in '%1' have been successfully added to the registry." IDS_IMPORT_ERROR "Cannot import '%1': Error opening the file. There may be a disk, file system error or file may not exist." + IDS_EXPORT_ERROR "Cannot export '%1': Error creating or writing to the file. There may be a disk or file system error." END STRINGTABLE DISCARDABLE Modified: trunk/reactos/base/applications/regedit/lang/sk-SK.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/regedit/…
============================================================================== --- trunk/reactos/base/applications/regedit/lang/sk-SK.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/regedit/lang/sk-SK.rc [iso-8859-1] Fri Oct 5 20:08:16 2012 @@ -422,6 +422,7 @@ IDS_IMPORT_PROMPT "Adding information can unintentionally change or delete values and cause components to stop working correctly. If you do not trust the source of this information in '%1', do not add it to registry.\n\nAre you sure you want to continue?" IDS_IMPORT_OK "The keys and values contained in '%1' have been successfully added to the registry." IDS_IMPORT_ERROR "Cannot import '%1': Error opening the file. There may be a disk, file system error or file may not exist." + IDS_EXPORT_ERROR "Cannot export '%1': Error creating or writing to the file. There may be a disk or file system error." END STRINGTABLE DISCARDABLE Modified: trunk/reactos/base/applications/regedit/lang/sl-SI.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/regedit/…
============================================================================== --- trunk/reactos/base/applications/regedit/lang/sl-SI.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/regedit/lang/sl-SI.rc [iso-8859-1] Fri Oct 5 20:08:16 2012 @@ -437,6 +437,7 @@ IDS_IMPORT_PROMPT "Adding information can unintentionally change or delete values and cause components to stop working correctly. If you do not trust the source of this information in '%1', do not add it to registry.\n\nAre you sure you want to continue?" IDS_IMPORT_OK "The keys and values contained in '%1' have been successfully added to the registry." IDS_IMPORT_ERROR "Cannot import '%1': Error opening the file. There may be a disk, file system error or file may not exist." + IDS_EXPORT_ERROR "Cannot export '%1': Error creating or writing to the file. There may be a disk or file system error." END STRINGTABLE DISCARDABLE Modified: trunk/reactos/base/applications/regedit/lang/sv-SE.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/regedit/…
============================================================================== --- trunk/reactos/base/applications/regedit/lang/sv-SE.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/regedit/lang/sv-SE.rc [iso-8859-1] Fri Oct 5 20:08:16 2012 @@ -437,6 +437,7 @@ IDS_IMPORT_PROMPT "Adding information can unintentionally change or delete values and cause components to stop working correctly. If you do not trust the source of this information in '%1', do not add it to registry.\n\nAre you sure you want to continue?" IDS_IMPORT_OK "The keys and values contained in '%1' have been successfully added to the registry." IDS_IMPORT_ERROR "Cannot import '%1': Error opening the file. There may be a disk, file system error or file may not exist." + IDS_EXPORT_ERROR "Cannot export '%1': Error creating or writing to the file. There may be a disk or file system error." END STRINGTABLE DISCARDABLE Modified: trunk/reactos/base/applications/regedit/lang/th-TH.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/regedit/…
============================================================================== --- trunk/reactos/base/applications/regedit/lang/th-TH.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/regedit/lang/th-TH.rc [iso-8859-1] Fri Oct 5 20:08:16 2012 @@ -437,6 +437,7 @@ IDS_IMPORT_PROMPT "Adding information can unintentionally change or delete values and cause components to stop working correctly. If you do not trust the source of this information in '%1', do not add it to registry.\n\nAre you sure you want to continue?" IDS_IMPORT_OK "The keys and values contained in '%1' have been successfully added to the registry." IDS_IMPORT_ERROR "Cannot import '%1': Error opening the file. There may be a disk, file system error or file may not exist." + IDS_EXPORT_ERROR "Cannot export '%1': Error creating or writing to the file. There may be a disk or file system error." END STRINGTABLE DISCARDABLE Modified: trunk/reactos/base/applications/regedit/lang/uk-UA.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/regedit/…
============================================================================== --- trunk/reactos/base/applications/regedit/lang/uk-UA.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/regedit/lang/uk-UA.rc [iso-8859-1] Fri Oct 5 20:08:16 2012 @@ -438,6 +438,7 @@ IDS_IMPORT_PROMPT "Adding information can unintentionally change or delete values and cause components to stop working correctly. If you do not trust the source of this information in '%1', do not add it to registry.\n\nAre you sure you want to continue?" IDS_IMPORT_OK "The keys and values contained in '%1' have been successfully added to the registry." IDS_IMPORT_ERROR "Cannot import '%1': Error opening the file. There may be a disk, file system error or file may not exist." + IDS_EXPORT_ERROR "Cannot export '%1': Error creating or writing to the file. There may be a disk or file system error." END STRINGTABLE DISCARDABLE Modified: trunk/reactos/base/applications/regedit/lang/zh-CN.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/regedit/…
============================================================================== --- trunk/reactos/base/applications/regedit/lang/zh-CN.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/regedit/lang/zh-CN.rc [iso-8859-1] Fri Oct 5 20:08:16 2012 @@ -437,6 +437,7 @@ IDS_IMPORT_PROMPT "Adding information can unintentionally change or delete values and cause components to stop working correctly. If you do not trust the source of this information in '%1', do not add it to registry.\n\nAre you sure you want to continue?" IDS_IMPORT_OK "The keys and values contained in '%1' have been successfully added to the registry." IDS_IMPORT_ERROR "Cannot import '%1': Error opening the file. There may be a disk, file system error or file may not exist." + IDS_EXPORT_ERROR "Cannot export '%1': Error creating or writing to the file. There may be a disk or file system error." END STRINGTABLE DISCARDABLE Modified: trunk/reactos/base/applications/regedit/lang/zh-TW.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/regedit/…
============================================================================== --- trunk/reactos/base/applications/regedit/lang/zh-TW.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/regedit/lang/zh-TW.rc [iso-8859-1] Fri Oct 5 20:08:16 2012 @@ -438,6 +438,7 @@ IDS_IMPORT_PROMPT "Adding information can unintentionally change or delete values and cause components to stop working correctly. If you do not trust the source of this information in '%1', do not add it to registry.\n\nAre you sure you want to continue?" IDS_IMPORT_OK "The keys and values contained in '%1' have been successfully added to the registry." IDS_IMPORT_ERROR "Cannot import '%1': Error opening the file. There may be a disk, file system error or file may not exist." + IDS_EXPORT_ERROR "Cannot export '%1': Error creating or writing to the file. There may be a disk or file system error." END STRINGTABLE DISCARDABLE Modified: trunk/reactos/base/applications/regedit/regedit.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/regedit/…
============================================================================== --- trunk/reactos/base/applications/regedit/regedit.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/regedit/regedit.c [iso-8859-1] Fri Oct 5 20:08:16 2012 @@ -146,9 +146,8 @@ get_file_name(&s, filename); if (!filename[0]) { - fwprintf(stderr, L"%s: No file name is specified\n", getAppName()); - // fwprintf(stderr, usage); - MessageBoxW(NULL, usage, NULL, MB_OK | MB_ICONINFORMATION); + InfoMessageBox(NULL, MB_OK | MB_ICONINFORMATION, NULL, L"No file name is specified."); + InfoMessageBox(NULL, MB_OK | MB_ICONINFORMATION, NULL, usage); exit(4); } @@ -165,34 +164,31 @@ goto cont; } + /* Open the file */ fp = _wfopen(filename, L"r"); - if (fp != NULL) - { - import_registry_file(fp); - + + /* Import it */ + if (fp == NULL || !import_registry_file(fp)) + { + /* Error opening the file */ + if (!silent) + { + LoadStringW(hInst, IDS_IMPORT_ERROR, szText, COUNT_OF(szText)); + InfoMessageBox(NULL, MB_OK | MB_ICONERROR, szTitle, szText, filename); + } + } + else + { /* Show successful import */ if (!silent) { LoadStringW(hInst, IDS_IMPORT_OK, szText, COUNT_OF(szText)); InfoMessageBox(NULL, MB_OK | MB_ICONINFORMATION, szTitle, szText, filename); } - - fclose(fp); - } - else - { - //LPSTR p = GetMultiByteString(filename); - //perror(""); - fwprintf(stderr, L"%s: Can't open file \"%s\"\n", getAppName(), filename /*p*/); - //HeapFree(GetProcessHeap(), 0, p); - - /* Error opening the file */ - if (!silent) - { - LoadStringW(hInst, IDS_IMPORT_ERROR, szText, COUNT_OF(szText)); - InfoMessageBox(NULL, MB_OK | MB_ICONERROR, szTitle, szText, filename); - } - } + } + + /* Close the file */ + if (fp) fclose(fp); cont: get_file_name(&s, filename); @@ -206,9 +202,8 @@ get_file_name(&s, reg_key_name); if (!reg_key_name[0]) { - fwprintf(stderr, L"%s: No registry key is specified for removal\n", getAppName()); - // fwprintf(stderr, usage); - MessageBoxW(NULL, usage, NULL, MB_OK | MB_ICONINFORMATION); + InfoMessageBox(NULL, MB_OK | MB_ICONINFORMATION, NULL, L"No registry key is specified for removal."); + InfoMessageBox(NULL, MB_OK | MB_ICONINFORMATION, NULL, usage); exit(6); } delete_registry_key(reg_key_name); @@ -223,9 +218,8 @@ get_file_name(&s, filename); if (!filename[0]) { - fwprintf(stderr, L"%s: No file name is specified\n", getAppName()); - // fwprintf(stderr, usage); - MessageBoxW(NULL, usage, NULL, MB_OK | MB_ICONINFORMATION); + InfoMessageBox(NULL, MB_OK | MB_ICONINFORMATION, NULL, L"No file name is specified."); + InfoMessageBox(NULL, MB_OK | MB_ICONINFORMATION, NULL, usage); exit(7); } @@ -310,8 +304,7 @@ action = ACTION_EXPORT; break; case L'?': - //fwprintf(stderr, usage); - MessageBoxW(NULL, usage, NULL, MB_OK | MB_ICONINFORMATION); + InfoMessageBox(NULL, MB_OK | MB_ICONINFORMATION, NULL, usage); exit(3); break; default: Modified: trunk/reactos/base/applications/regedit/resource.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/regedit/…
============================================================================== --- trunk/reactos/base/applications/regedit/resource.h [iso-8859-1] (original) +++ trunk/reactos/base/applications/regedit/resource.h [iso-8859-1] Fri Oct 5 20:08:16 2012 @@ -167,79 +167,80 @@ #define IDS_FLT_ALLFILES 31007 #define IDS_FLT_ALLFILES_FLT 31008 -#define IDS_ACCESS_FULLCONTROL 31101 -#define IDS_ACCESS_READ 31102 -#define IDS_ACCESS_QUERYVALUE 31103 -#define IDS_ACCESS_SETVALUE 31104 -#define IDS_ACCESS_CREATESUBKEY 31105 -#define IDS_ACCESS_ENUMERATESUBKEYS 31106 -#define IDS_ACCESS_NOTIFY 31107 -#define IDS_ACCESS_CREATELINK 31108 -#define IDS_ACCESS_DELETE 31109 -#define IDS_ACCESS_WRITEDAC 31110 -#define IDS_ACCESS_WRITEOWNER 31111 -#define IDS_ACCESS_READCONTROL 31112 - -#define IDS_INHERIT_THISKEYONLY 31121 -#define IDS_INHERIT_THISKEYANDSUBKEYS 31122 -#define IDS_INHERIT_SUBKEYSONLY 31123 -#define IDS_EXPAND 31124 -#define IDS_COLLAPSE 31125 -#define IDS_NEW_KEY 31126 -#define IDS_NEW_VALUE 31127 -#define IDS_GOTO_SUGGESTED_KEY 31128 - -#define IDS_IMPORT_PROMPT 31129 -#define IDS_IMPORT_OK 31130 -#define IDS_IMPORT_ERROR 31131 - -#define IDS_FINISHEDFIND 31132 - -#define IDS_BUSNUMBER 31133 -#define IDS_INTERFACE 31134 - -#define IDS_DMA_CHANNEL 31135 -#define IDS_DMA_PORT 31136 -#define IDS_INTERRUPT_VECTOR 31137 -#define IDS_INTERRUPT_LEVEL 31138 -#define IDS_INTERRUPT_AFFINITY 31139 -#define IDS_INTERRUPT_TYPE 31140 -#define IDS_MEMORY_ADDRESS 31141 -#define IDS_MEMORY_LENGTH 31142 -#define IDS_MEMORY_ACCESS 31143 -#define IDS_PORT_ADDRESS 31144 -#define IDS_PORT_LENGTH 31145 -#define IDS_PORT_ACCESS 31146 -#define IDS_SPECIFIC_RESERVED1 31147 -#define IDS_SPECIFIC_RESERVED2 31148 -#define IDS_SPECIFIC_DATASIZE 31149 - -#define IDS_PORT_PORT_IO 31150 -#define IDS_PORT_MEMORY_IO 31151 -#define IDS_INTERRUPT_EDGE_SENSITIVE 31152 -#define IDS_INTERRUPT_LEVEL_SENSITIVE 31153 -#define IDS_MEMORY_READ_ONLY 31154 -#define IDS_MEMORY_WRITE_ONLY 31155 -#define IDS_MEMORY_READ_WRITE 31156 - -#define IDS_BUS_UNDEFINED 31157 -#define IDS_BUS_INTERNAL 31158 -#define IDS_BUS_ISA 31159 -#define IDS_BUS_EISA 31160 -#define IDS_BUS_MICROCHANNEL 31161 -#define IDS_BUS_TURBOCHANNEL 31162 -#define IDS_BUS_PCIBUS 31163 -#define IDS_BUS_VMEBUS 31164 -#define IDS_BUS_NUBUS 31165 -#define IDS_BUS_PCMCIABUS 31166 -#define IDS_BUS_CBUS 31167 -#define IDS_BUS_MPIBUS 31168 -#define IDS_BUS_MPSABUS 31169 -#define IDS_BUS_PROCESSORINTERNAL 31170 -#define IDS_BUS_INTERNALPOWERBUS 31171 -#define IDS_BUS_PNPISABUS 31172 -#define IDS_BUS_PNPBUS 31173 -#define IDS_BUS_UNKNOWNTYPE 31174 +#define IDS_ACCESS_FULLCONTROL 31100 +#define IDS_ACCESS_READ 31101 +#define IDS_ACCESS_QUERYVALUE 31102 +#define IDS_ACCESS_SETVALUE 31103 +#define IDS_ACCESS_CREATESUBKEY 31104 +#define IDS_ACCESS_ENUMERATESUBKEYS 31105 +#define IDS_ACCESS_NOTIFY 31106 +#define IDS_ACCESS_CREATELINK 31107 +#define IDS_ACCESS_DELETE 31108 +#define IDS_ACCESS_WRITEDAC 31109 +#define IDS_ACCESS_WRITEOWNER 31110 +#define IDS_ACCESS_READCONTROL 31111 + +#define IDS_INHERIT_THISKEYONLY 31200 +#define IDS_INHERIT_THISKEYANDSUBKEYS 31201 +#define IDS_INHERIT_SUBKEYSONLY 31202 +#define IDS_EXPAND 31203 +#define IDS_COLLAPSE 31204 +#define IDS_NEW_KEY 31205 +#define IDS_NEW_VALUE 31206 +#define IDS_GOTO_SUGGESTED_KEY 31207 + +#define IDS_IMPORT_PROMPT 31300 +#define IDS_IMPORT_OK 31301 +#define IDS_IMPORT_ERROR 31302 +#define IDS_EXPORT_ERROR 31303 + +#define IDS_FINISHEDFIND 31304 + +#define IDS_BUSNUMBER 31400 +#define IDS_INTERFACE 31401 + +#define IDS_DMA_CHANNEL 31500 +#define IDS_DMA_PORT 31501 +#define IDS_INTERRUPT_VECTOR 31502 +#define IDS_INTERRUPT_LEVEL 31503 +#define IDS_INTERRUPT_AFFINITY 31504 +#define IDS_INTERRUPT_TYPE 31505 +#define IDS_MEMORY_ADDRESS 31506 +#define IDS_MEMORY_LENGTH 31507 +#define IDS_MEMORY_ACCESS 31508 +#define IDS_PORT_ADDRESS 31509 +#define IDS_PORT_LENGTH 31510 +#define IDS_PORT_ACCESS 31511 +#define IDS_SPECIFIC_RESERVED1 31512 +#define IDS_SPECIFIC_RESERVED2 31513 +#define IDS_SPECIFIC_DATASIZE 31514 + +#define IDS_PORT_PORT_IO 31520 +#define IDS_PORT_MEMORY_IO 31521 +#define IDS_INTERRUPT_EDGE_SENSITIVE 31522 +#define IDS_INTERRUPT_LEVEL_SENSITIVE 31523 +#define IDS_MEMORY_READ_ONLY 31524 +#define IDS_MEMORY_WRITE_ONLY 31525 +#define IDS_MEMORY_READ_WRITE 31526 + +#define IDS_BUS_UNDEFINED 31530 +#define IDS_BUS_INTERNAL 31531 +#define IDS_BUS_ISA 31532 +#define IDS_BUS_EISA 31533 +#define IDS_BUS_MICROCHANNEL 31534 +#define IDS_BUS_TURBOCHANNEL 31535 +#define IDS_BUS_PCIBUS 31536 +#define IDS_BUS_VMEBUS 31537 +#define IDS_BUS_NUBUS 31538 +#define IDS_BUS_PCMCIABUS 31539 +#define IDS_BUS_CBUS 31540 +#define IDS_BUS_MPIBUS 31541 +#define IDS_BUS_MPSABUS 31542 +#define IDS_BUS_PROCESSORINTERNAL 31543 +#define IDS_BUS_INTERNALPOWERBUS 31544 +#define IDS_BUS_PNPISABUS 31545 +#define IDS_BUS_PNPBUS 31546 +#define IDS_BUS_UNKNOWNTYPE 31547 #define IDD_EDIT_STRING 2000 #define IDC_VALUE_NAME 2001 Modified: trunk/reactos/base/applications/regedit/settings.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/regedit/…
============================================================================== --- trunk/reactos/base/applications/regedit/settings.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/regedit/settings.c [iso-8859-1] Fri Oct 5 20:08:16 2012 @@ -129,8 +129,13 @@ if (keyPath) { rootName = get_root_key_name(hRootKey); - _snwprintf(szBuffer, COUNT_OF(szBuffer), L"My Computer\\%s\\%s", rootName, keyPath); - RegSetValueExW(hKey, L"LastKey", 0, REG_SZ, (LPBYTE) szBuffer, (DWORD)wcslen(szBuffer) * sizeof(WCHAR)); + + /* Load "My Computer" string and complete it */ + LoadStringW(hInst, IDS_MY_COMPUTER, szBuffer, COUNT_OF(szBuffer)); + wcscat(szBuffer, L"\\"); wcscat(szBuffer, rootName); + wcscat(szBuffer, L"\\"); wcscat(szBuffer, keyPath); + + RegSetValueExW(hKey, L"LastKey", 0, REG_SZ, (LPBYTE)szBuffer, (DWORD)wcslen(szBuffer) * sizeof(WCHAR)); } /* Get statusbar settings */ Modified: trunk/reactos/base/applications/regedit/treeview.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/regedit/…
============================================================================== --- trunk/reactos/base/applications/regedit/treeview.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/regedit/treeview.c [iso-8859-1] Fri Oct 5 20:08:16 2012 @@ -601,9 +601,7 @@ } else if (!hNewKey) { - WCHAR sz[256]; - wsprintf(sz, L"Cannot create new key!\n\nError Code: %d", nResult); - MessageBoxW(hFrameWnd, sz, NULL, MB_ICONERROR); + InfoMessageBox(hFrameWnd, MB_OK | MB_ICONERROR, NULL, L"Cannot create new key!\n\nError Code: %d", nResult); goto done; } } @@ -668,9 +666,16 @@ LPCWSTR s; TVITEM tvi; - /* Total no-good hack */ - if (!_wcsnicmp(keyPath, L"My Computer\\", 12)) - keyPath += 12; + /* Load "My Computer" string... */ + LoadStringW(hInst, IDS_MY_COMPUTER, szBuffer, COUNT_OF(szBuffer)); + wcscat(szBuffer, L"\\"); + + /* ... and remove it from the key path */ + if (!_wcsnicmp(keyPath, szBuffer, wcslen(szBuffer))) + keyPath += wcslen(szBuffer); + + /* Reinitialize szBuffer */ + szBuffer[0] = L'\0'; hRoot = TreeView_GetRoot(hwndTV); hItem = hRoot;
12 years, 1 month
1
0
0
0
[ekohl] 57489: [LSASRV] - Change LsapLookupSids to match LsarLookupSids2 and LsarLookupSids3. - Implement LsarLookupSids2 and LsarLookupSids3. - Update the call to LsapLookupSids in LsarLookupSids ...
by ekohl@svn.reactos.org
Author: ekohl Date: Fri Oct 5 19:41:14 2012 New Revision: 57489 URL:
http://svn.reactos.org/svn/reactos?rev=57489&view=rev
Log: [LSASRV] - Change LsapLookupSids to match LsarLookupSids2 and LsarLookupSids3. - Implement LsarLookupSids2 and LsarLookupSids3. - Update the call to LsapLookupSids in LsarLookupSids and convert the translated names list after calling LsapLookupSids. Modified: trunk/reactos/dll/win32/lsasrv/lsarpc.c trunk/reactos/dll/win32/lsasrv/lsasrv.h trunk/reactos/dll/win32/lsasrv/sids.c Modified: trunk/reactos/dll/win32/lsasrv/lsarpc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/lsasrv/lsarpc.c?…
============================================================================== --- trunk/reactos/dll/win32/lsasrv/lsarpc.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/lsasrv/lsarpc.c [iso-8859-1] Fri Oct 5 19:41:14 2012 @@ -647,23 +647,49 @@ LSAP_LOOKUP_LEVEL LookupLevel, DWORD *MappedCount) { + LSAPR_TRANSLATED_NAMES_EX TranslatedNamesEx; + ULONG i; NTSTATUS Status; - TRACE("LsarLookupSids(%p, %p, %p, %p, %d, %p)\n", + TRACE("(%p %p %p %p %d %p)\n", PolicyHandle, SidEnumBuffer, ReferencedDomains, TranslatedNames, LookupLevel, MappedCount); + /* FIXME: Fail, if there is an invalid SID in the SidEnumBuffer */ + TranslatedNames->Entries = SidEnumBuffer->Entries; - TranslatedNames->Names = NULL; + TranslatedNames->Names = MIDL_user_allocate(SidEnumBuffer->Entries * sizeof(LSAPR_TRANSLATED_NAME)); + if (TranslatedNames->Names == NULL) + return STATUS_INSUFFICIENT_RESOURCES; + *ReferencedDomains = NULL; - /* FIXME: Fail, if there is an invalid SID in the SidEnumBuffer */ + TranslatedNamesEx.Entries = SidEnumBuffer->Entries; + TranslatedNamesEx.Names = NULL;; Status = LsapLookupSids(SidEnumBuffer, ReferencedDomains, - TranslatedNames, + &TranslatedNamesEx, LookupLevel, - MappedCount); + MappedCount, + 0, + 0); + if (!NT_SUCCESS(Status)) + { + MIDL_user_free(TranslatedNamesEx.Names); + return Status; + } + + for (i = 0; i < TranslatedNamesEx.Entries; i++) + { + TranslatedNames->Names[i].Use = TranslatedNamesEx.Names[i].Use; + TranslatedNames->Names[i].Name.Length = TranslatedNamesEx.Names[i].Name.Length; + TranslatedNames->Names[i].Name.MaximumLength = TranslatedNamesEx.Names[i].Name.MaximumLength; + TranslatedNames->Names[i].Name.Buffer = TranslatedNamesEx.Names[i].Name.Buffer; + TranslatedNames->Names[i].DomainIndex = TranslatedNamesEx.Names[i].DomainIndex; + } + + MIDL_user_free(TranslatedNamesEx.Names); return Status; } @@ -1915,8 +1941,27 @@ DWORD LookupOptions, DWORD ClientRevision) { - UNIMPLEMENTED; - return STATUS_NOT_IMPLEMENTED; + NTSTATUS Status; + + TRACE("(%p %p %p %p %d %p %lu %lu)\n", + PolicyHandle, SidEnumBuffer, ReferencedDomains, TranslatedNames, + LookupLevel, MappedCount, LookupOptions, ClientRevision); + + TranslatedNames->Entries = SidEnumBuffer->Entries; + TranslatedNames->Names = NULL; + *ReferencedDomains = NULL; + + /* FIXME: Fail, if there is an invalid SID in the SidEnumBuffer */ + + Status = LsapLookupSids(SidEnumBuffer, + ReferencedDomains, + TranslatedNames, + LookupLevel, + MappedCount, + LookupOptions, + ClientRevision); + + return Status; } @@ -2142,8 +2187,27 @@ DWORD LookupOptions, DWORD ClientRevision) { - UNIMPLEMENTED; - return STATUS_NOT_IMPLEMENTED; + NTSTATUS Status; + + TRACE("(%p %p %p %p %d %p %lu %lu)\n", + PolicyHandle, SidEnumBuffer, ReferencedDomains, TranslatedNames, + LookupLevel, MappedCount, LookupOptions, ClientRevision); + + TranslatedNames->Entries = SidEnumBuffer->Entries; + TranslatedNames->Names = NULL; + *ReferencedDomains = NULL; + + /* FIXME: Fail, if there is an invalid SID in the SidEnumBuffer */ + + Status = LsapLookupSids(SidEnumBuffer, + ReferencedDomains, + TranslatedNames, + LookupLevel, + MappedCount, + LookupOptions, + ClientRevision); + + return Status; } Modified: trunk/reactos/dll/win32/lsasrv/lsasrv.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/lsasrv/lsasrv.h?…
============================================================================== --- trunk/reactos/dll/win32/lsasrv/lsasrv.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/lsasrv/lsasrv.h [iso-8859-1] Fri Oct 5 19:41:14 2012 @@ -205,8 +205,10 @@ NTSTATUS LsapLookupSids(PLSAPR_SID_ENUM_BUFFER SidEnumBuffer, PLSAPR_REFERENCED_DOMAIN_LIST *ReferencedDomains, - PLSAPR_TRANSLATED_NAMES TranslatedNames, + PLSAPR_TRANSLATED_NAMES_EX TranslatedNames, LSAP_LOOKUP_LEVEL LookupLevel, - DWORD *MappedCount); + DWORD *MappedCount, + DWORD LookupOptions, + DWORD ClientRevision); /* EOF */ Modified: trunk/reactos/dll/win32/lsasrv/sids.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/lsasrv/sids.c?re…
============================================================================== --- trunk/reactos/dll/win32/lsasrv/sids.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/lsasrv/sids.c [iso-8859-1] Fri Oct 5 19:41:14 2012 @@ -1009,12 +1009,14 @@ NTSTATUS LsapLookupSids(PLSAPR_SID_ENUM_BUFFER SidEnumBuffer, PLSAPR_REFERENCED_DOMAIN_LIST *ReferencedDomains, - PLSAPR_TRANSLATED_NAMES TranslatedNames, + PLSAPR_TRANSLATED_NAMES_EX TranslatedNames, LSAP_LOOKUP_LEVEL LookupLevel, - DWORD *MappedCount) + DWORD *MappedCount, + DWORD LookupOptions, + DWORD ClientRevision) { PLSAPR_REFERENCED_DOMAIN_LIST DomainsBuffer = NULL; - PLSAPR_TRANSLATED_NAME NamesBuffer = NULL; + PLSAPR_TRANSLATED_NAME_EX NamesBuffer = NULL; ULONG NamesBufferLength; ULONG DomainIndex; ULONG i; @@ -1030,7 +1032,7 @@ ULONG SidLength; - NamesBufferLength = SidEnumBuffer->Entries * sizeof(LSA_TRANSLATED_NAME); + NamesBufferLength = SidEnumBuffer->Entries * sizeof(LSAPR_TRANSLATED_NAME_EX); NamesBuffer = MIDL_user_allocate(NamesBufferLength); if (NamesBuffer == NULL) { @@ -1063,6 +1065,7 @@ NamesBuffer[i].Name.MaximumLength = 0; NamesBuffer[i].Name.Buffer = NULL; NamesBuffer[i].DomainIndex = -1; + NamesBuffer[i].Flags = 0; } @@ -1085,6 +1088,7 @@ if (ptr != NULL) { NamesBuffer[i].Use = ptr->Use; + NamesBuffer[i].Flags = 0; NamesBuffer[i].Name.Buffer = MIDL_user_allocate(ptr->Name.MaximumLength); NamesBuffer[i].Name.Length = ptr->Name.Length; @@ -1109,6 +1113,7 @@ /* Hack: Map the SID to the Admin Account if it is not a well-known SID */ NamesBuffer[i].Use = SidTypeWellKnownGroup; + NamesBuffer[i].Flags = 0; NamesBuffer[i].Name.Length = AdminName.Length; NamesBuffer[i].Name.MaximumLength = AdminName.MaximumLength; NamesBuffer[i].Name.Buffer = MIDL_user_allocate(AdminName.MaximumLength);
12 years, 1 month
1
0
0
0
[ekohl] 57488: [LSASRV] - Move most of the code from LsarLookupSids into LsapLookupSids. - Use the code from LsapLookupNames to handle the referenced domains list in LsapLookupSids.
by ekohl@svn.reactos.org
Author: ekohl Date: Fri Oct 5 17:34:23 2012 New Revision: 57488 URL:
http://svn.reactos.org/svn/reactos?rev=57488&view=rev
Log: [LSASRV] - Move most of the code from LsarLookupSids into LsapLookupSids. - Use the code from LsapLookupNames to handle the referenced domains list in LsapLookupSids. Modified: trunk/reactos/dll/win32/lsasrv/lsarpc.c trunk/reactos/dll/win32/lsasrv/lsasrv.h trunk/reactos/dll/win32/lsasrv/sids.c Modified: trunk/reactos/dll/win32/lsasrv/lsarpc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/lsasrv/lsarpc.c?…
============================================================================== --- trunk/reactos/dll/win32/lsasrv/lsarpc.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/lsasrv/lsarpc.c [iso-8859-1] Fri Oct 5 17:34:23 2012 @@ -647,14 +647,6 @@ LSAP_LOOKUP_LEVEL LookupLevel, DWORD *MappedCount) { - SID_IDENTIFIER_AUTHORITY IdentifierAuthority = {SECURITY_NT_AUTHORITY}; - static const UNICODE_STRING DomainName = RTL_CONSTANT_STRING(L"DOMAIN"); - PLSAPR_REFERENCED_DOMAIN_LIST OutputDomains = NULL; - PLSAPR_TRANSLATED_NAME OutputNames = NULL; - ULONG OutputNamesLength; - ULONG i; - PSID Sid; - ULONG SidLength; NTSTATUS Status; TRACE("LsarLookupSids(%p, %p, %p, %p, %d, %p)\n", @@ -665,67 +657,13 @@ TranslatedNames->Names = NULL; *ReferencedDomains = NULL; - OutputNamesLength = SidEnumBuffer->Entries * sizeof(LSA_TRANSLATED_NAME); - OutputNames = MIDL_user_allocate(OutputNamesLength); - if (OutputNames == NULL) - { - return STATUS_INSUFFICIENT_RESOURCES; - } - - RtlZeroMemory(OutputNames, OutputNamesLength); - - OutputDomains = MIDL_user_allocate(sizeof(LSAPR_REFERENCED_DOMAIN_LIST)); - if (OutputDomains == NULL) - { - MIDL_user_free(OutputNames); - return STATUS_INSUFFICIENT_RESOURCES; - } - - OutputDomains->Entries = SidEnumBuffer->Entries; - OutputDomains->Domains = MIDL_user_allocate(SidEnumBuffer->Entries * sizeof(LSA_TRUST_INFORMATION)); - if (OutputDomains->Domains == NULL) - { - MIDL_user_free(OutputDomains); - MIDL_user_free(OutputNames); - return STATUS_INSUFFICIENT_RESOURCES; - } - - Status = RtlAllocateAndInitializeSid(&IdentifierAuthority, - 2, - SECURITY_BUILTIN_DOMAIN_RID, - DOMAIN_ALIAS_RID_ADMINS, - 0, 0, 0, 0, 0, 0, - &Sid); - if (!NT_SUCCESS(Status)) - { - MIDL_user_free(OutputDomains->Domains); - MIDL_user_free(OutputDomains); - MIDL_user_free(OutputNames); - return Status; - } - - SidLength = RtlLengthSid(Sid); - - for (i = 0; i < SidEnumBuffer->Entries; i++) - { - OutputDomains->Domains[i].Sid = MIDL_user_allocate(SidLength); - RtlCopyMemory(OutputDomains->Domains[i].Sid, Sid, SidLength); - - OutputDomains->Domains[i].Name.Buffer = MIDL_user_allocate(DomainName.MaximumLength); - OutputDomains->Domains[i].Name.Length = DomainName.Length; - OutputDomains->Domains[i].Name.MaximumLength = DomainName.MaximumLength; - RtlCopyMemory(OutputDomains->Domains[i].Name.Buffer, DomainName.Buffer, DomainName.MaximumLength); - } + /* FIXME: Fail, if there is an invalid SID in the SidEnumBuffer */ Status = LsapLookupSids(SidEnumBuffer, - OutputNames); - - *ReferencedDomains = OutputDomains; - - *MappedCount = SidEnumBuffer->Entries; - - TranslatedNames->Entries = SidEnumBuffer->Entries; - TranslatedNames->Names = OutputNames; + ReferencedDomains, + TranslatedNames, + LookupLevel, + MappedCount); return Status; } Modified: trunk/reactos/dll/win32/lsasrv/lsasrv.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/lsasrv/lsasrv.h?…
============================================================================== --- trunk/reactos/dll/win32/lsasrv/lsasrv.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/lsasrv/lsasrv.h [iso-8859-1] Fri Oct 5 17:34:23 2012 @@ -193,10 +193,6 @@ LsapInitSids(VOID); NTSTATUS -LsapLookupSids(PLSAPR_SID_ENUM_BUFFER SidEnumBuffer, - PLSAPR_TRANSLATED_NAME OutputNames); - -NTSTATUS LsapLookupNames(DWORD Count, PRPC_UNICODE_STRING Names, PLSAPR_REFERENCED_DOMAIN_LIST *ReferencedDomains, @@ -206,4 +202,11 @@ DWORD LookupOptions, DWORD ClientRevision); +NTSTATUS +LsapLookupSids(PLSAPR_SID_ENUM_BUFFER SidEnumBuffer, + PLSAPR_REFERENCED_DOMAIN_LIST *ReferencedDomains, + PLSAPR_TRANSLATED_NAMES TranslatedNames, + LSAP_LOOKUP_LEVEL LookupLevel, + DWORD *MappedCount); + /* EOF */ Modified: trunk/reactos/dll/win32/lsasrv/sids.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/lsasrv/sids.c?re…
============================================================================== --- trunk/reactos/dll/win32/lsasrv/sids.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/lsasrv/sids.c [iso-8859-1] Fri Oct 5 17:34:23 2012 @@ -161,7 +161,7 @@ PULONG p; ULONG i; - SidEntry = RtlAllocateHeap(RtlGetProcessHeap(), 0, sizeof(WELL_KNOWN_SID)); + SidEntry = RtlAllocateHeap(RtlGetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(WELL_KNOWN_SID)); if (SidEntry == NULL) return FALSE; @@ -204,9 +204,17 @@ NTSTATUS LsapInitSids(VOID) { - ULONG SubAuthorities[5]; + ULONG SubAuthorities[8]; InitializeListHead(&WellKnownSidListHead); + + /* NT Authority */ + LsapCreateSid(&NtAuthority, + 0, + NULL, + L"NT AUTHORITY", + L"NT AUTHORITY", + SidTypeDomain); /* Null Sid */ SubAuthorities[0] = SECURITY_NULL_RID; @@ -270,14 +278,6 @@ L"CREATOR GROUP SERVER", L"", SidTypeWellKnownGroup); - - /* NT Domain Sid */ - LsapCreateSid(&NtAuthority, - 0, - NULL, - L"NT AUTHORITY", - L"NT AUTHORITY", - SidTypeDomain); /* Dialup Sid */ SubAuthorities[0] = SECURITY_DIALUP_RID; @@ -603,78 +603,6 @@ } -NTSTATUS -LsapLookupSids(PLSAPR_SID_ENUM_BUFFER SidEnumBuffer, - PLSAPR_TRANSLATED_NAME OutputNames) -{ - static const UNICODE_STRING UserName = RTL_CONSTANT_STRING(L"Administrator"); - PWELL_KNOWN_SID ptr; - ULONG Mapped = 0; - ULONG i; - NTSTATUS Status; - - PSID *Sids = (PSID *) SidEnumBuffer->SidInfo; - -TRACE("LsapLookupSids(%p, %p)\n", SidEnumBuffer, OutputNames); -TRACE("SidEnumBuffer->Entries: %lu\n", SidEnumBuffer->Entries); -TRACE("SidEnumBuffer->SidInfo: %p\n", SidEnumBuffer->SidInfo); - - for (i = 0; i < SidEnumBuffer->Entries; i++) - { -TRACE("i: %lu\n", i); - ptr = LsapLookupWellKnownSid(Sids[i]); - if (ptr != NULL) - { - OutputNames[i].Use = ptr->Use; - - OutputNames[i].DomainIndex = i; /* Fixme */ - - OutputNames[i].Name.Buffer = MIDL_user_allocate(ptr->Name.MaximumLength); - OutputNames[i].Name.Length = ptr->Name.Length; - OutputNames[i].Name.MaximumLength = ptr->Name.MaximumLength; - RtlCopyMemory(OutputNames[i].Name.Buffer, ptr->Name.Buffer, ptr->Name.MaximumLength); - - Mapped++; - continue; - } - - /* Check for buildin domain SID */ - - /* Check for account domain SID */ - - /* Check for primary domain SID (later) */ - - /* Check for trusted domain SID (later) */ - - /* Check for builtin domain account SID */ - - /* Check for account domain account SID */ - - /* Check for primary domain account SID (later) */ - - - /* Unknown SID */ - OutputNames[i].Use = SidTypeWellKnownGroup; - OutputNames[i].DomainIndex = i; - OutputNames[i].Name.Buffer = MIDL_user_allocate(UserName.MaximumLength); - OutputNames[i].Name.Length = UserName.Length; - OutputNames[i].Name.MaximumLength = UserName.MaximumLength; - RtlCopyMemory(OutputNames[i].Name.Buffer, UserName.Buffer, UserName.MaximumLength); - - Mapped++; - } - - if (Mapped == 0) - Status = STATUS_NONE_MAPPED; - else if (Mapped < SidEnumBuffer->Entries) - Status = STATUS_SOME_NOT_MAPPED; - else - Status = STATUS_SUCCESS; - - return Status; -} - - PWELL_KNOWN_SID LsapLookupWellKnownName(PUNICODE_STRING Name) { @@ -688,7 +616,9 @@ WELL_KNOWN_SID, ListEntry); if (RtlEqualUnicodeString(Name, &Ptr->Name, TRUE)) + { return Ptr; + } ListEntry = ListEntry->Flink; } @@ -1075,4 +1005,160 @@ return Status; } + +NTSTATUS +LsapLookupSids(PLSAPR_SID_ENUM_BUFFER SidEnumBuffer, + PLSAPR_REFERENCED_DOMAIN_LIST *ReferencedDomains, + PLSAPR_TRANSLATED_NAMES TranslatedNames, + LSAP_LOOKUP_LEVEL LookupLevel, + DWORD *MappedCount) +{ + PLSAPR_REFERENCED_DOMAIN_LIST DomainsBuffer = NULL; + PLSAPR_TRANSLATED_NAME NamesBuffer = NULL; + ULONG NamesBufferLength; + ULONG DomainIndex; + ULONG i; + ULONG Mapped = 0; + NTSTATUS Status = STATUS_SUCCESS; + + PWELL_KNOWN_SID ptr, ptr2; + + SID_IDENTIFIER_AUTHORITY IdentifierAuthority = {SECURITY_NT_AUTHORITY}; + static const UNICODE_STRING DomainName = RTL_CONSTANT_STRING(L"DOMAIN"); + static const UNICODE_STRING AdminName = RTL_CONSTANT_STRING(L"Administrator"); + PSID AdminsSid = NULL; + ULONG SidLength; + + + NamesBufferLength = SidEnumBuffer->Entries * sizeof(LSA_TRANSLATED_NAME); + NamesBuffer = MIDL_user_allocate(NamesBufferLength); + if (NamesBuffer == NULL) + { + Status = STATUS_INSUFFICIENT_RESOURCES; + goto done; + } + + DomainsBuffer = MIDL_user_allocate(sizeof(LSAPR_REFERENCED_DOMAIN_LIST)); + if (DomainsBuffer == NULL) + { + Status = STATUS_INSUFFICIENT_RESOURCES; + goto done; + } + + DomainsBuffer->Domains = MIDL_user_allocate(SidEnumBuffer->Entries * sizeof(LSA_TRUST_INFORMATION)); + if (DomainsBuffer->Domains == NULL) + { + Status = STATUS_INSUFFICIENT_RESOURCES; + goto done; + } + + DomainsBuffer->Entries = 0; + DomainsBuffer->MaxEntries = SidEnumBuffer->Entries; + + /* Initialize all name entries */ + for (i = 0; i < SidEnumBuffer->Entries; i++) + { + NamesBuffer[i].Use = SidTypeUnknown; + NamesBuffer[i].Name.Length = 0; + NamesBuffer[i].Name.MaximumLength = 0; + NamesBuffer[i].Name.Buffer = NULL; + NamesBuffer[i].DomainIndex = -1; + } + + + Status = RtlAllocateAndInitializeSid(&IdentifierAuthority, + 2, + SECURITY_BUILTIN_DOMAIN_RID, + DOMAIN_ALIAS_RID_ADMINS, + 0, 0, 0, 0, 0, 0, + &AdminsSid); + if (!NT_SUCCESS(Status)) + goto done; + + + SidLength = RtlLengthSid(AdminsSid); + + + for (i = 0; i < SidEnumBuffer->Entries; i++) + { + ptr = LsapLookupWellKnownSid(SidEnumBuffer->SidInfo[i].Sid); + if (ptr != NULL) + { + NamesBuffer[i].Use = ptr->Use; + + NamesBuffer[i].Name.Buffer = MIDL_user_allocate(ptr->Name.MaximumLength); + NamesBuffer[i].Name.Length = ptr->Name.Length; + NamesBuffer[i].Name.MaximumLength = ptr->Name.MaximumLength; + RtlCopyMemory(NamesBuffer[i].Name.Buffer, ptr->Name.Buffer, ptr->Name.MaximumLength); + + ptr2= LsapLookupWellKnownName(&ptr->Domain); + if (ptr2 != NULL) + { + Status = LsapAddDomainToDomainsList(DomainsBuffer, + &ptr2->Name, + ptr2->Sid, + &DomainIndex); + if (NT_SUCCESS(Status)) + NamesBuffer[i].DomainIndex = DomainIndex; + } + + Mapped++; + continue; + } + + + /* Hack: Map the SID to the Admin Account if it is not a well-known SID */ + NamesBuffer[i].Use = SidTypeWellKnownGroup; + NamesBuffer[i].Name.Length = AdminName.Length; + NamesBuffer[i].Name.MaximumLength = AdminName.MaximumLength; + NamesBuffer[i].Name.Buffer = MIDL_user_allocate(AdminName.MaximumLength); + RtlCopyMemory(NamesBuffer[i].Name.Buffer, AdminName.Buffer, AdminName.MaximumLength); + + Status = LsapAddDomainToDomainsList(DomainsBuffer, + (PUNICODE_STRING)&DomainName, + AdminsSid, + &DomainIndex); + if (NT_SUCCESS(Status)) + NamesBuffer[i].DomainIndex = DomainIndex; + + Mapped++; + continue; + + + } + +done: + if (AdminsSid != NULL) + RtlFreeSid(AdminsSid); + + + if (!NT_SUCCESS(Status)) + { + if (DomainsBuffer != NULL) + { + if (DomainsBuffer->Domains != NULL) + MIDL_user_free(DomainsBuffer->Domains); + + MIDL_user_free(DomainsBuffer); + } + + if (NamesBuffer != NULL) + MIDL_user_free(NamesBuffer); + } + else + { + *ReferencedDomains = DomainsBuffer; + TranslatedNames->Entries = SidEnumBuffer->Entries; + TranslatedNames->Names = NamesBuffer; + *MappedCount = Mapped; + + if (Mapped == 0) + Status = STATUS_NONE_MAPPED; + else if (Mapped < SidEnumBuffer->Entries) + Status = STATUS_SOME_NOT_MAPPED; + } + + return Status; +} + /* EOF */
12 years, 1 month
1
0
0
0
[ion] 57487: [RTL]: Fix typo in RtlValidAcl.
by ion@svn.reactos.org
Author: ion Date: Fri Oct 5 15:20:10 2012 New Revision: 57487 URL:
http://svn.reactos.org/svn/reactos?rev=57487&view=rev
Log: [RTL]: Fix typo in RtlValidAcl. Modified: trunk/reactos/lib/rtl/acl.c Modified: trunk/reactos/lib/rtl/acl.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/acl.c?rev=57487&r1…
============================================================================== --- trunk/reactos/lib/rtl/acl.c [iso-8859-1] (original) +++ trunk/reactos/lib/rtl/acl.c [iso-8859-1] Fri Oct 5 15:20:10 2012 @@ -932,8 +932,8 @@ { DPRINT1("Unsupported ACE in ReactOS, assuming valid\n"); } - else if ((Ace->AceType >= ACCESS_MIN_MS_ACE_TYPE) || - (Ace->AceType <= ACCESS_MAX_MS_V2_ACE_TYPE)) + else if ((Ace->AceType >= ACCESS_MIN_MS_OBJECT_ACE_TYPE) || + (Ace->AceType <= ACCESS_MAX_MS_OBJECT_ACE_TYPE)) { DPRINT1("Unsupported ACE in ReactOS, assuming valid\n"); }
12 years, 1 month
1
0
0
0
[tfaber] 57486: [SHELL32] - Fix yet another missing "this->", spotted by Igor Sudarikov CORE-6722 #resolve #comment Good catch, thanks.
by tfaber@svn.reactos.org
Author: tfaber Date: Fri Oct 5 10:51:54 2012 New Revision: 57486 URL:
http://svn.reactos.org/svn/reactos?rev=57486&view=rev
Log: [SHELL32] - Fix yet another missing "this->", spotted by Igor Sudarikov CORE-6722 #resolve #comment Good catch, thanks. Modified: trunk/reactos/dll/win32/shell32/folders/mycomp.cpp Modified: trunk/reactos/dll/win32/shell32/folders/mycomp.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/folders/…
============================================================================== --- trunk/reactos/dll/win32/shell32/folders/mycomp.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/folders/mycomp.cpp [iso-8859-1] Fri Oct 5 10:51:54 2012 @@ -727,7 +727,7 @@ } wcscpy(sName, lpName); - SHFree(sName); + SHFree(this->sName); this->sName = sName; TRACE("result %s\n", debugstr_w(sName)); return S_OK;
12 years, 1 month
1
0
0
0
[tfaber] 57485: [SHELL32] - Fix what might finally be the last missing "this->" instances left over from the C++ conversion (used a regex this time)
by tfaber@svn.reactos.org
Author: tfaber Date: Thu Oct 4 23:46:59 2012 New Revision: 57485 URL:
http://svn.reactos.org/svn/reactos?rev=57485&view=rev
Log: [SHELL32] - Fix what might finally be the last missing "this->" instances left over from the C++ conversion (used a regex this time) Modified: trunk/reactos/dll/win32/shell32/folders/cpanel.cpp trunk/reactos/dll/win32/shell32/folders/mycomp.cpp trunk/reactos/dll/win32/shell32/shlview.cpp Modified: trunk/reactos/dll/win32/shell32/folders/cpanel.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/folders/…
============================================================================== --- trunk/reactos/dll/win32/shell32/folders/cpanel.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/folders/cpanel.cpp [iso-8859-1] Thu Oct 4 23:46:59 2012 @@ -540,7 +540,7 @@ // pObj = (IContextMenu *)this; this->apidl = apidl; - cidl = cidl; + this->cidl = cidl; pObj->AddRef(); hr = S_OK; } else if (IsEqualIID(riid, IID_IDataObject) && (cidl >= 1)) { Modified: trunk/reactos/dll/win32/shell32/folders/mycomp.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/folders/…
============================================================================== --- trunk/reactos/dll/win32/shell32/folders/mycomp.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/folders/mycomp.cpp [iso-8859-1] Thu Oct 4 23:46:59 2012 @@ -728,7 +728,7 @@ wcscpy(sName, lpName); SHFree(sName); - sName = sName; + this->sName = sName; TRACE("result %s\n", debugstr_w(sName)); return S_OK; } Modified: trunk/reactos/dll/win32/shell32/shlview.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shlview.…
============================================================================== --- trunk/reactos/dll/win32/shell32/shlview.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/shlview.cpp [iso-8859-1] Thu Oct 4 23:46:59 2012 @@ -2828,7 +2828,7 @@ FIXME("partial stub: %p %08x %08x %p\n", this, aspects, advf, pAdvSink); /* FIXME: we set the AdviseSink, but never use it to send any advice */ - pAdvSink = pAdvSink; + this->pAdvSink = pAdvSink; dwAspects = aspects; dwAdvf = advf;
12 years, 1 month
1
0
0
0
[ekohl] 57484: [LSASRV] Implement LsarEnumerateAccountRights. It is still WIP (Work In Progress).
by ekohl@svn.reactos.org
Author: ekohl Date: Thu Oct 4 21:59:23 2012 New Revision: 57484 URL:
http://svn.reactos.org/svn/reactos?rev=57484&view=rev
Log: [LSASRV] Implement LsarEnumerateAccountRights. It is still WIP (Work In Progress). Modified: trunk/reactos/dll/win32/lsasrv/lsarpc.c Modified: trunk/reactos/dll/win32/lsasrv/lsarpc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/lsasrv/lsarpc.c?…
============================================================================== --- trunk/reactos/dll/win32/lsasrv/lsarpc.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/lsasrv/lsarpc.c [iso-8859-1] Thu Oct 4 21:59:23 2012 @@ -1633,22 +1633,109 @@ PRPC_SID AccountSid, PLSAPR_USER_RIGHT_SET UserRights) { - PLSA_DB_OBJECT PolicyObject; + LSAPR_HANDLE AccountHandle; + PLSAPR_PRIVILEGE_SET PrivilegeSet = NULL; + PRPC_UNICODE_STRING RightsBuffer = NULL; + PRPC_UNICODE_STRING PrivilegeString; + ULONG RightsCount; + ULONG RightsIndex; + ULONG PrivIndex; NTSTATUS Status; TRACE("LsarEnumerateAccountRights(%p %p %p)\n", PolicyHandle, AccountSid, UserRights); - Status = LsapValidateDbObject(PolicyHandle, - LsaDbPolicyObject, - ACCOUNT_VIEW, - &PolicyObject); - if (!NT_SUCCESS(Status)) + /* Open the account */ + Status = LsarOpenAccount(PolicyHandle, + AccountSid, + ACCOUNT_VIEW, + &AccountHandle); + if (!NT_SUCCESS(Status)) + { + ERR("LsarOpenAccount returned 0x%08lx\n", Status); return Status; - - UserRights->Entries = 0; - UserRights->UserRights = NULL; - return STATUS_OBJECT_NAME_NOT_FOUND; + } + + /* Enumerate the privileges */ + Status = LsarEnumeratePrivilegesAccount(AccountHandle, + &PrivilegeSet); + if (!NT_SUCCESS(Status)) + { + ERR("LsarEnumeratePrivilegesAccount returned 0x%08lx\n", Status); + goto done; + } + + /* FIXME: Get account rights */ + + + RightsCount = PrivilegeSet->PrivilegeCount; + + /* FIXME: Count account rights */ + + + /* We are done if there are no rights to be enumerated */ + if (RightsCount == 0) + { + UserRights->Entries = 0; + UserRights->UserRights = NULL; + Status = STATUS_SUCCESS; + goto done; + } + + /* Allocate a buffer for the account rights */ + RightsBuffer = MIDL_user_allocate(RightsCount * sizeof(RPC_UNICODE_STRING)); + if (RightsBuffer == NULL) + { + Status = STATUS_INSUFFICIENT_RESOURCES; + goto done; + } + + /* Copy the privileges into the buffer */ + RightsIndex = 0; + for (PrivIndex = 0; PrivIndex < PrivilegeSet->PrivilegeCount; PrivIndex++) + { + PrivilegeString = NULL; + Status = LsarLookupPrivilegeName(PolicyHandle, + (PLUID)&PrivilegeSet->Privilege[PrivIndex].Luid, + (PRPC_UNICODE_STRING *)&PrivilegeString); + if (!NT_SUCCESS(Status)) + goto done; + + RightsBuffer[RightsIndex].Length = PrivilegeString->Length; + RightsBuffer[RightsIndex].MaximumLength = PrivilegeString->MaximumLength; + RightsBuffer[RightsIndex].Buffer = PrivilegeString->Buffer; + + MIDL_user_free(PrivilegeString); + RightsIndex++; + } + + /* FIXME: Copy account rights into the buffer */ + + + UserRights->Entries = RightsCount; + UserRights->UserRights = (PRPC_UNICODE_STRING)RightsBuffer; + +done: + if (!NT_SUCCESS(Status)) + { + if (RightsBuffer != NULL) + { + for (RightsIndex = 0; RightsIndex < RightsCount; RightsIndex++) + { + if (RightsBuffer[RightsIndex].Buffer != NULL) + MIDL_user_free(RightsBuffer[RightsIndex].Buffer); + } + + MIDL_user_free(RightsBuffer); + } + } + + if (PrivilegeSet != NULL) + MIDL_user_free(PrivilegeSet); + + LsarClose(&AccountHandle); + + return Status; }
12 years, 1 month
1
0
0
0
[jimtabor] 57483: [NtUser] - Fix all but one DCE scroll test. - Old patch at least two year old or more.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Thu Oct 4 20:00:28 2012 New Revision: 57483 URL:
http://svn.reactos.org/svn/reactos?rev=57483&view=rev
Log: [NtUser] - Fix all but one DCE scroll test. - Old patch at least two year old or more. Modified: trunk/reactos/win32ss/user/ntuser/windc.c Modified: trunk/reactos/win32ss/user/ntuser/windc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/windc.…
============================================================================== --- trunk/reactos/win32ss/user/ntuser/windc.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/windc.c [iso-8859-1] Thu Oct 4 20:00:28 2012 @@ -172,6 +172,88 @@ /* Make it dirty so that the vis rgn gets recomputed next time */ Dce->DCXFlags |= DCX_DCEDIRTY; + IntGdiSetHookFlags(Dce->hDC, DCHF_INVALIDATEVISRGN); +} + +static VOID FASTCALL +DceUpdateVisRgn(DCE *Dce, PWND Window, ULONG Flags) +{ + HANDLE hRgnVisible = NULL; + ULONG DcxFlags; + PWND DesktopWindow; + + if (Flags & DCX_PARENTCLIP) + { + PWND Parent; + + Parent = Window->spwndParent; + if(!Parent) + { + hRgnVisible = NULL; + goto noparent; + } + + if (Parent->style & WS_CLIPSIBLINGS) + { + DcxFlags = DCX_CLIPSIBLINGS | + (Flags & ~(DCX_CLIPCHILDREN | DCX_WINDOW)); + } + else + { + DcxFlags = Flags & ~(DCX_CLIPSIBLINGS | DCX_CLIPCHILDREN | DCX_WINDOW); + } + hRgnVisible = DceGetVisRgn(Parent, DcxFlags, Window->head.h, Flags); + } + else if (Window == NULL) + { + DesktopWindow = UserGetWindowObject(IntGetDesktopWindow()); + if (NULL != DesktopWindow) + { + hRgnVisible = IntSysCreateRectRgnIndirect(&DesktopWindow->rcWindow); + } + else + { + hRgnVisible = NULL; + } + } + else + { + hRgnVisible = DceGetVisRgn(Window, Flags, 0, 0); + } + +noparent: + if (Flags & DCX_INTERSECTRGN) + { + if(Dce->hrgnClip != NULL) + { + NtGdiCombineRgn(hRgnVisible, hRgnVisible, Dce->hrgnClip, RGN_AND); + } + else + { + if(hRgnVisible != NULL) + { + GreDeleteObject(hRgnVisible); + } + hRgnVisible = IntSysCreateRectRgn(0, 0, 0, 0); + } + } + else if (Flags & DCX_EXCLUDERGN && Dce->hrgnClip != NULL) + { + NtGdiCombineRgn(hRgnVisible, hRgnVisible, Dce->hrgnClip, RGN_DIFF); + } + + Dce->DCXFlags &= ~DCX_DCEDIRTY; + GdiSelectVisRgn(Dce->hDC, hRgnVisible); + + if (Window != NULL) + { + IntEngWindowChanged(Window, WOC_RGN_CLIENT); + } + + if (hRgnVisible != NULL) + { + GreDeleteObject(hRgnVisible); + } } static INT FASTCALL @@ -183,6 +265,11 @@ } /* Restore previous visible region */ + if (EndPaint) + { + DceUpdateVisRgn(dce, dce->pwndOrg, dce->DCXFlags); + } + if ((dce->DCXFlags & (DCX_INTERSECTRGN | DCX_EXCLUDERGN)) && ((dce->DCXFlags & DCX_CACHE) || EndPaint)) { @@ -193,9 +280,6 @@ { if (!(dce->DCXFlags & DCX_NORESETATTRS)) { - /* Make the DC clean so that SetDCState doesn't try to update the vis rgn */ - IntGdiSetHookFlags(dce->hDC, DCHF_VALIDATEVISRGN); - // Clean the DC if (!IntGdiCleanDC(dce->hDC)) return 0; @@ -205,6 +289,8 @@ * because SetDCState() disables hVisRgn updates * by removing dirty bit. */ dce->hwndCurrent = 0; + dce->pwndOrg = NULL; + dce->pwndClip = NULL; dce->DCXFlags &= DCX_CACHE; dce->DCXFlags |= DCX_DCEEMPTY; } @@ -237,86 +323,6 @@ return 1; // Released! } -static VOID FASTCALL -DceUpdateVisRgn(DCE *Dce, PWND Window, ULONG Flags) -{ - HANDLE hRgnVisible = NULL; - ULONG DcxFlags; - PWND DesktopWindow; - - if (Flags & DCX_PARENTCLIP) - { - PWND Parent; - - Parent = Window->spwndParent; - if(!Parent) - { - hRgnVisible = NULL; - goto noparent; - } - - if (Parent->style & WS_CLIPSIBLINGS) - { - DcxFlags = DCX_CLIPSIBLINGS | - (Flags & ~(DCX_CLIPCHILDREN | DCX_WINDOW)); - } - else - { - DcxFlags = Flags & ~(DCX_CLIPSIBLINGS | DCX_CLIPCHILDREN | DCX_WINDOW); - } - hRgnVisible = DceGetVisRgn(Parent, DcxFlags, Window->head.h, Flags); - } - else if (Window == NULL) - { - DesktopWindow = UserGetWindowObject(IntGetDesktopWindow()); - if (NULL != DesktopWindow) - { - hRgnVisible = IntSysCreateRectRgnIndirect(&DesktopWindow->rcWindow); - } - else - { - hRgnVisible = NULL; - } - } - else - { - hRgnVisible = DceGetVisRgn(Window, Flags, 0, 0); - } - -noparent: - if (Flags & DCX_INTERSECTRGN) - { - if(Dce->hrgnClip != NULL) - { - NtGdiCombineRgn(hRgnVisible, hRgnVisible, Dce->hrgnClip, RGN_AND); - } - else - { - if(hRgnVisible != NULL) - { - GreDeleteObject(hRgnVisible); - } - hRgnVisible = IntSysCreateRectRgn(0, 0, 0, 0); - } - } - else if (Flags & DCX_EXCLUDERGN && Dce->hrgnClip != NULL) - { - NtGdiCombineRgn(hRgnVisible, hRgnVisible, Dce->hrgnClip, RGN_DIFF); - } - - Dce->DCXFlags &= ~DCX_DCEDIRTY; - GdiSelectVisRgn(Dce->hDC, hRgnVisible); - - if (Window != NULL) - { - IntEngWindowChanged(Window, WOC_RGN_CLIENT); - } - - if (hRgnVisible != NULL) - { - GreDeleteObject(hRgnVisible); - } -} HDC FASTCALL UserGetDCEx(PWND Wnd OPTIONAL, HANDLE ClipRegion, ULONG Flags) @@ -325,6 +331,7 @@ ULONG DcxFlags; DCE* Dce = NULL; BOOL UpdateClipOrigin = FALSE; + BOOL bUpdateVisRgn = TRUE; HDC hDC = NULL; PPROCESSINFO ppi; PLIST_ENTRY pLE; @@ -360,12 +367,7 @@ TRACE("We have CLASS!!\n"); } } -/* else // For Testing! - { - ERR("We have POWNER!!\n"); - if (Window->Dce) ERR("We have POWNER with DCE!!\n"); - } -*/ + if (Wnd->style & WS_CLIPSIBLINGS) { Flags |= DCX_CLIPSIBLINGS; @@ -441,7 +443,7 @@ do { // The reason for this you may ask? -// Well, it seems ReactOS calls GetDC with out first creating a desktop DC window! +// Well, it seems ReactOS calls GetDC without first creating a desktop DC window! // Need to test for null here. Not sure if this is a bug or a feature. // First time use hax, need to use DceAllocDCE during window display init. if (!Dce) break; @@ -460,6 +462,7 @@ ((Dce->DCXFlags & DCX_CACHECOMPAREMASK) == DcxFlags)) { UpdateClipOrigin = TRUE; + //bUpdateVisRgn = FALSE; break; } } @@ -478,6 +481,7 @@ if (!Dce) return NULL; Dce->hwndCurrent = (Wnd ? Wnd->head.h : NULL); + Dce->pwndOrg = Dce->pwndClip = Wnd; } else // If we are here, we are POWNED or having CLASS. { @@ -486,9 +490,12 @@ Dce = CONTAINING_RECORD(pLE, DCE, List); do { // Check for Window handle than HDC match for CLASS. - if ((Dce->hwndCurrent == Wnd->head.h) || - (Dce->hDC == hDC)) + if (Dce->hwndCurrent == Wnd->head.h) + { + bUpdateVisRgn = FALSE; break; + } + if (Dce->hDC == hDC) break; pLE = Dce->List.Flink; Dce = CONTAINING_RECORD(pLE, DCE, List); } @@ -535,6 +542,7 @@ Flags |= DCX_INTERSECTRGN | DCX_KEEPCLIPRGN; Dce->DCXFlags |= DCX_INTERSECTRGN | DCX_KEEPCLIPRGN; ClipRegion = Wnd->hrgnUpdate; + bUpdateVisRgn = TRUE; } if (ClipRegion == HRGN_WINDOW) @@ -548,6 +556,7 @@ Dce->hrgnClip = IntSysCreateRectRgnIndirect(&Wnd->rcWindow); } Dce->DCXFlags &= ~DCX_KEEPCLIPRGN; + bUpdateVisRgn = TRUE; } else if (ClipRegion != NULL) { @@ -558,11 +567,14 @@ Dce->hrgnClip = NULL; } Dce->hrgnClip = ClipRegion; - } + bUpdateVisRgn = TRUE; + } + + if (IntGdiSetHookFlags(Dce->hDC, DCHF_VALIDATEVISRGN)) bUpdateVisRgn = TRUE; DceSetDrawable(Wnd, Dce->hDC, Flags, UpdateClipOrigin); - DceUpdateVisRgn(Dce, Wnd, Flags); + if (bUpdateVisRgn) DceUpdateVisRgn(Dce, Wnd, Flags); if (Dce->DCXFlags & DCX_CACHE) { @@ -697,6 +709,7 @@ DceUpdateVisRgn(pDCE, Window, pDCE->DCXFlags); pDCE->DCXFlags = DCX_DCEEMPTY|DCX_CACHE; pDCE->hwndCurrent = 0; + pDCE->pwndOrg = pDCE->pwndClip = NULL; TRACE("POWNED DCE going Cheap!! DCX_CACHE!! hDC-> %x \n", pDCE->hDC); if (!GreSetDCOwner( pDCE->hDC, GDI_OBJ_HMGR_NONE)) @@ -734,6 +747,7 @@ } pDCE->DCXFlags |= DCX_DCEEMPTY; pDCE->hwndCurrent = 0; + pDCE->pwndOrg = pDCE->pwndClip = NULL; } } pLE = pDCE->List.Flink; @@ -872,6 +886,7 @@ dc->ptlDCOrig.x = CurrentWindow->rcClient.left; dc->ptlDCOrig.y = CurrentWindow->rcClient.top; } + if (NULL != dc->rosdc.hClipRgn) { NtGdiOffsetRgn(dc->rosdc.hClipRgn, DeltaX, DeltaY); @@ -885,6 +900,7 @@ DC_UnlockDc(dc); DceUpdateVisRgn(pDCE, CurrentWindow, pDCE->DCXFlags); + IntGdiSetHookFlags(pDCE->hDC, DCHF_VALIDATEVISRGN); if (Window->head.h != pDCE->hwndCurrent) {
12 years, 1 month
1
0
0
0
[ion] 57482: [RTL]: Implement and half-plement the Object Security APIs. In most cases, ultimately forward to an internal (unimplemented) worker function, but some APIs were implemented fully. Also...
by ion@svn.reactos.org
Author: ion Date: Thu Oct 4 19:32:18 2012 New Revision: 57482 URL:
http://svn.reactos.org/svn/reactos?rev=57482&view=rev
Log: [RTL]: Implement and half-plement the Object Security APIs. In most cases, ultimately forward to an internal (unimplemented) worker function, but some APIs were implemented fully. Also add missing RtlCreateAndSetSD and export it (unimplemented). Modified: trunk/reactos/dll/ntdll/def/ntdll.spec trunk/reactos/lib/rtl/security.c 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] Thu Oct 4 19:32:18 2012 @@ -508,7 +508,7 @@ @ stdcall RtlCopyUnicodeString(ptr ptr) @ stdcall RtlCreateAcl(ptr long long) @ stdcall RtlCreateActivationContext(ptr ptr) -;@ stdcall RtlCreateAndSetSD +@ stdcall RtlCreateAndSetSD(ptr long ptr ptr ptr) @ stdcall RtlCreateAtomTable(long ptr) @ stdcall RtlCreateBootStatusDataFile() @ stdcall RtlCreateEnvironment(long ptr) Modified: trunk/reactos/lib/rtl/security.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/security.c?rev=574…
============================================================================== --- trunk/reactos/lib/rtl/security.c [iso-8859-1] (original) +++ trunk/reactos/lib/rtl/security.c [iso-8859-1] Thu Oct 4 19:32:18 2012 @@ -9,11 +9,71 @@ /* INCLUDES *****************************************************************/ #include <rtl.h> - #define NDEBUG #include <debug.h> -/* FUNCTIONS ***************************************************************/ +/* PRIVATE FUNCTIONS **********************************************************/ + +NTSTATUS +NTAPI +RtlpSetSecurityObject(IN PVOID Object, + IN SECURITY_INFORMATION SecurityInformation, + IN PSECURITY_DESCRIPTOR ModificationDescriptor, + OUT PSECURITY_DESCRIPTOR *ObjectsSecurityDescriptor, + IN ULONG AutoInheritFlags, + IN ULONG PoolType, + IN PGENERIC_MAPPING GenericMapping, + IN HANDLE Token OPTIONAL) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +NTSTATUS +NTAPI +RtlpNewSecurityObject(IN PSECURITY_DESCRIPTOR ParentDescriptor, + IN PSECURITY_DESCRIPTOR CreatorDescriptor, + OUT PSECURITY_DESCRIPTOR *NewDescriptor, + IN LPGUID *ObjectTypes, + IN ULONG GuidCount, + IN BOOLEAN IsDirectoryObject, + IN ULONG AutoInheritFlags, + IN HANDLE Token, + IN PGENERIC_MAPPING GenericMapping) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +NTSTATUS +NTAPI +RtlpConvertToAutoInheritSecurityObject(IN PSECURITY_DESCRIPTOR ParentDescriptor, + IN PSECURITY_DESCRIPTOR CreatorDescriptor, + OUT PSECURITY_DESCRIPTOR *NewDescriptor, + IN LPGUID ObjectType, + IN BOOLEAN IsDirectoryObject, + IN PGENERIC_MAPPING GenericMapping) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +/* PUBLIC FUNCTIONS ***********************************************************/ + +/* + * @unimplemented + */ +NTSTATUS +NTAPI +RtlCreateAndSetSD(IN PVOID AceData, + IN ULONG AceCount, + IN PSID OwnerSid OPTIONAL, + IN PSID GroupSid OPTIONAL, + OUT PSECURITY_DESCRIPTOR *NewDescriptor) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} /* * @implemented @@ -22,18 +82,15 @@ NTAPI RtlDeleteSecurityObject(IN PSECURITY_DESCRIPTOR *ObjectDescriptor) { - DPRINT("RtlDeleteSecurityObject(%p)\n", ObjectDescriptor); - - RtlFreeHeap(RtlGetProcessHeap(), - 0, - *ObjectDescriptor); - + DPRINT1("RtlDeleteSecurityObject(%p)\n", ObjectDescriptor); + + /* Free the object from the heap */ + RtlFreeHeap(RtlGetProcessHeap(), 0, *ObjectDescriptor); return STATUS_SUCCESS; } - -/* - * @unimplemented +/* + * @implemented */ NTSTATUS NTAPI @@ -44,12 +101,22 @@ IN HANDLE Token, IN PGENERIC_MAPPING GenericMapping) { - UNIMPLEMENTED; - return STATUS_NOT_IMPLEMENTED; -} - -/* - * @unimplemented + DPRINT1("RtlNewSecurityObject(%p)\n", ParentDescriptor); + + /* Call the internal API */ + return RtlpNewSecurityObject(ParentDescriptor, + CreatorDescriptor, + NewDescriptor, + NULL, + 0, + IsDirectoryObject, + 0, + Token, + GenericMapping); +} + +/* + * @implemented */ NTSTATUS NTAPI @@ -62,12 +129,22 @@ IN HANDLE Token, IN PGENERIC_MAPPING GenericMapping) { - UNIMPLEMENTED; - return STATUS_NOT_IMPLEMENTED; -} - -/* - * @unimplemented + DPRINT1("RtlNewSecurityObjectEx(%p)\n", ParentDescriptor); + + /* Call the internal API */ + return RtlpNewSecurityObject(ParentDescriptor, + CreatorDescriptor, + NewDescriptor, + ObjectType ? &ObjectType : NULL, + ObjectType ? 1 : 0, + IsDirectoryObject, + AutoInheritFlags, + Token, + GenericMapping); +} + +/* + * @implemented */ NTSTATUS NTAPI @@ -81,28 +158,75 @@ IN HANDLE Token, IN PGENERIC_MAPPING GenericMapping) { - UNIMPLEMENTED; - return STATUS_NOT_IMPLEMENTED; -} - -/* - * @unimplemented - */ -NTSTATUS -NTAPI -RtlConvertToAutoInheritSecurityObject(IN PSECURITY_DESCRIPTOR ParentDescriptor, - IN PSECURITY_DESCRIPTOR CreatorDescriptor, - OUT PSECURITY_DESCRIPTOR *NewDescriptor, - IN LPGUID ObjectType, - IN BOOLEAN IsDirectoryObject, - IN PGENERIC_MAPPING GenericMapping) -{ - UNIMPLEMENTED; - return STATUS_NOT_IMPLEMENTED; -} - -/* - * @unimplemented + DPRINT1("RtlNewSecurityObjectWithMultipleInheritance(%p)\n", ParentDescriptor); + + /* Call the internal API */ + return RtlpNewSecurityObject(ParentDescriptor, + CreatorDescriptor, + NewDescriptor, + ObjectTypes, + GuidCount, + IsDirectoryObject, + AutoInheritFlags, + Token, + GenericMapping); +} + +/* + * @implemented + */ +NTSTATUS +NTAPI +RtlNewInstanceSecurityObject(IN BOOLEAN ParentDescriptorChanged, + IN BOOLEAN CreatorDescriptorChanged, + IN PLUID OldClientTokenModifiedId, + OUT PLUID NewClientTokenModifiedId, + IN PSECURITY_DESCRIPTOR ParentDescriptor, + IN PSECURITY_DESCRIPTOR CreatorDescriptor, + OUT PSECURITY_DESCRIPTOR *NewDescriptor, + IN BOOLEAN IsDirectoryObject, + IN HANDLE Token, + IN PGENERIC_MAPPING GenericMapping) +{ + TOKEN_STATISTICS TokenStats; + ULONG Size; + NTSTATUS Status; + DPRINT1("RtlNewInstanceSecurityObject(%p)\n", ParentDescriptor); + + /* Query the token statistics */ + Status = NtQueryInformationToken(Token, + TokenStatistics, + &TokenStats, + sizeof(TokenStats), + &Size); + if (!NT_SUCCESS(Status)) return Status; + + /* Return the LUID */ + *NewClientTokenModifiedId = TokenStats.ModifiedId; + + /* Check if the LUID changed */ + if (RtlEqualLuid(NewClientTokenModifiedId, OldClientTokenModifiedId)) + { + /* Did nothing change? */ + if (!(ParentDescriptorChanged) && !(CreatorDescriptorChanged)) + { + /* There's no new descriptor, we're done */ + *NewDescriptor = NULL; + return STATUS_SUCCESS; + } + } + + /* Call the standard API */ + return RtlNewSecurityObject(ParentDescriptor, + CreatorDescriptor, + NewDescriptor, + IsDirectoryObject, + Token, + GenericMapping); +} + +/* + * @implemented */ NTSTATUS NTAPI @@ -114,32 +238,42 @@ IN PGENERIC_MAPPING GenericMapping, OUT PSECURITY_DESCRIPTOR *NewDescriptor) { - UNIMPLEMENTED; - return STATUS_NOT_IMPLEMENTED; -} - -/* - * @unimplemented - */ -NTSTATUS -NTAPI -RtlNewInstanceSecurityObject(IN BOOLEAN ParentDescriptorChanged, - IN BOOLEAN CreatorDescriptorChanged, - IN PLUID OldClientTokenModifiedI, - OUT PLUID NewClientTokenModifiedId, - IN PSECURITY_DESCRIPTOR ParentDescriptor, - IN PSECURITY_DESCRIPTOR CreatorDescriptor, - OUT PSECURITY_DESCRIPTOR *NewDescriptor, - IN BOOLEAN IsDirectoryObject, - IN HANDLE Token, - IN PGENERIC_MAPPING GenericMapping) -{ - UNIMPLEMENTED; - return STATUS_NOT_IMPLEMENTED; -} - -/* - * @unimplemented + NTSTATUS Status; + PSECURITY_DESCRIPTOR Sd; + HANDLE TokenHandle; + DPRINT1("RtlCreateUserSecurityObject(%p)\n", AceData); + + /* Create the security descriptor based on the ACE Data */ + Status = RtlCreateAndSetSD(AceData, + AceCount, + OwnerSid, + GroupSid, + &Sd); + if (!NT_SUCCESS(Status)) return Status; + + /* Open the process token */ + Status = NtOpenProcessToken(NtCurrentProcess(), TOKEN_QUERY, &TokenHandle); + if (!NT_SUCCESS(Status)) goto Quickie; + + /* Create the security object */ + Status = RtlNewSecurityObject(NULL, + Sd, + NewDescriptor, + IsDirectoryObject, + TokenHandle, + GenericMapping); + + /* We're done, close the token handle */ + NtClose(TokenHandle); + +Quickie: + /* Free the SD and return status */ + RtlFreeHeap(RtlGetProcessHeap(), 0, Sd); + return Status; +} + +/* + * @implemented */ NTSTATUS NTAPI @@ -150,8 +284,81 @@ IN PGENERIC_MAPPING GenericMapping, OUT PACCESS_MASK RemainingDesiredAccess) { - UNIMPLEMENTED; - return STATUS_NOT_IMPLEMENTED; + NTSTATUS Status; + BOOLEAN Granted, CallerToken; + TOKEN_STATISTICS TokenStats; + ULONG Size; + DPRINT1("RtlNewSecurityGrantedAccess(%p)\n", DesiredAccess); + + /* Has the caller passed a token? */ + if (!Token) + { + /* Remember that we'll have to close the handle */ + CallerToken = FALSE; + + /* Nope, open it */ + Status = NtOpenThreadToken(NtCurrentThread(), TOKEN_QUERY, TRUE, &Token); + if (!NT_SUCCESS(Status)) return Status; + } + else + { + /* Yep, use it */ + CallerToken = TRUE; + } + + /* Get information on the token */ + Status = NtQueryInformationToken(Token, + TokenStatistics, + &TokenStats, + sizeof(TokenStats), + &Size); + ASSERT(NT_SUCCESS(Status)); + + /* Windows doesn't do anything with the token statistics! */ + + /* Map the access and return it back decoded */ + RtlMapGenericMask(&DesiredAccess, GenericMapping); + *RemainingDesiredAccess = DesiredAccess; + + /* Check if one of the rights requested was the SACL right */ + if (DesiredAccess & ACCESS_SYSTEM_SECURITY) + { + /* Pretend that it's allowed FIXME: Do privilege check */ + DPRINT1("Missing privilege check for SE_SECURITY_PRIVILEGE"); + Granted = TRUE; + *RemainingDesiredAccess &= ~ACCESS_SYSTEM_SECURITY; + } + else + { + /* Nothing to grant */ + Granted = FALSE; + } + + /* If the caller did not pass in a token, close the handle to ours */ + if (!CallerToken) NtClose(Token); + + /* We need space to return only 1 privilege -- already part of the struct */ + Size = sizeof(PRIVILEGE_SET); + if (Size > *Length) + { + /* Tell the caller how much space we need and fail */ + *Length = Size; + return STATUS_BUFFER_TOO_SMALL; + } + + /* Check if the SACL right was granted... */ + RtlZeroMemory(&Privileges, Size); + if (Granted) + { + /* Yes, return it in the structure */ + Privileges->PrivilegeCount = 1; + Privileges->Privilege[0].Luid.LowPart = SE_SECURITY_PRIVILEGE; + Privileges->Privilege[0].Luid.HighPart = 0; + Privileges->Privilege[0].Attributes = SE_PRIVILEGE_USED_FOR_ACCESS; + } + + /* All done */ + return STATUS_SUCCESS; } /* @@ -212,7 +419,7 @@ /* - * @unimplemented + * @implemented */ NTSTATUS NTAPI @@ -222,12 +429,19 @@ IN PGENERIC_MAPPING GenericMapping, IN HANDLE Token) { - UNIMPLEMENTED; - return STATUS_NOT_IMPLEMENTED; -} - -/* - * @unimplemented + /* Call the internal API */ + return RtlpSetSecurityObject(NULL, + SecurityInformation, + ModificationDescriptor, + ObjectsSecurityDescriptor, + 0, + PagedPool, + GenericMapping, + Token); +} + +/* + * @implemented */ NTSTATUS NTAPI @@ -238,6 +452,46 @@ IN PGENERIC_MAPPING GenericMapping, IN HANDLE Token) { + /* Call the internal API */ + return RtlpSetSecurityObject(NULL, + SecurityInformation, + ModificationDescriptor, + ObjectsSecurityDescriptor, + AutoInheritFlags, + PagedPool, + GenericMapping, + Token); + +} + +/* + * @implemented + */ +NTSTATUS +NTAPI +RtlConvertToAutoInheritSecurityObject(IN PSECURITY_DESCRIPTOR ParentDescriptor, + IN PSECURITY_DESCRIPTOR CreatorDescriptor, + OUT PSECURITY_DESCRIPTOR *NewDescriptor, + IN LPGUID ObjectType, + IN BOOLEAN IsDirectoryObject, + IN PGENERIC_MAPPING GenericMapping) +{ + /* Call the internal API */ + return RtlpConvertToAutoInheritSecurityObject(ParentDescriptor, + CreatorDescriptor, + NewDescriptor, + ObjectType, + IsDirectoryObject, + GenericMapping); +} + +/* + * @unimplemented + */ +NTSTATUS +NTAPI +RtlRegisterSecureMemoryCacheCallback(IN PRTL_SECURE_MEMORY_CACHE_CALLBACK Callback) +{ UNIMPLEMENTED; return STATUS_NOT_IMPLEMENTED; } @@ -245,17 +499,6 @@ /* * @unimplemented */ -NTSTATUS -NTAPI -RtlRegisterSecureMemoryCacheCallback(IN PRTL_SECURE_MEMORY_CACHE_CALLBACK Callback) -{ - UNIMPLEMENTED; - return STATUS_NOT_IMPLEMENTED; -} - -/* - * @unimplemented - */ BOOLEAN NTAPI RtlFlushSecureMemoryCache(IN PVOID MemoryCache,
12 years, 1 month
1
0
0
0
[ion] 57481: [RTL]: Add all the missing Rtl*Security*Object APIs and put them all in security.c. Move privilege functions into a new file, priv.c. No functional/code changes, just more stubs/export...
by ion@svn.reactos.org
Author: ion Date: Thu Oct 4 18:48:15 2012 New Revision: 57481 URL:
http://svn.reactos.org/svn/reactos?rev=57481&view=rev
Log: [RTL]: Add all the missing Rtl*Security*Object APIs and put them all in security.c. Move privilege functions into a new file, priv.c. No functional/code changes, just more stubs/exports and moving things around. Added: trunk/reactos/lib/rtl/priv.c (with props) Modified: trunk/reactos/dll/ntdll/def/ntdll.spec trunk/reactos/lib/rtl/CMakeLists.txt trunk/reactos/lib/rtl/security.c 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] Thu Oct 4 18:48:15 2012 @@ -491,7 +491,7 @@ ;@ stdcall RtlConvertPropertyToVariant @ stdcall RtlConvertSharedToExclusive(ptr) @ stdcall RtlConvertSidToUnicodeString(ptr ptr long) -;@ stdcall RtlConvertToAutoInheritSecurityObject +@ stdcall RtlConvertToAutoInheritSecurityObject(ptr ptr ptr ptr long ptr) ;@ stdcall RtlConvertUiListToApiList @ stdcall -arch=win32 -ret64 RtlConvertUlongToLargeInteger(long) ;@ stdcall RtlConvertVariantToProperty @@ -525,7 +525,7 @@ @ stdcall RtlCreateUnicodeString(ptr wstr) @ stdcall RtlCreateUnicodeStringFromAsciiz(ptr str) @ stdcall RtlCreateUserProcess(ptr long ptr ptr ptr ptr long ptr ptr ptr) -;@ stdcall RtlCreateUserSecurityObject +@ stdcall RtlCreateUserSecurityObject(ptr long ptr ptr long ptr ptr) @ stdcall RtlCreateUserThread(long ptr long ptr long long ptr ptr ptr ptr) @ stdcall RtlCustomCPToUnicodeN(ptr wstr long ptr str long) @ stdcall RtlCutoverTimeToSystemTime(ptr ptr ptr long) @@ -788,11 +788,11 @@ ;@ stdcall RtlMultiAppendUnicodeStringBuffer @ stdcall RtlMultiByteToUnicodeN(ptr long ptr ptr long) @ stdcall RtlMultiByteToUnicodeSize(ptr str long) -;@ stdcall RtlNewInstanceSecurityObject -;@ stdcall RtlNewSecurityGrantedAccess +@ stdcall RtlNewInstanceSecurityObject(long long ptr ptr ptr ptr ptr long ptr ptr) +@ stdcall RtlNewSecurityGrantedAccess(long ptr ptr ptr ptr ptr) @ stdcall RtlNewSecurityObject(ptr ptr ptr long ptr ptr) -;@ stdcall RtlNewSecurityObjectEx -;@ stdcall RtlNewSecurityObjectWithMultipleInheritance +@ stdcall RtlNewSecurityObjectEx(ptr ptr ptr ptr long long ptr ptr) +@ stdcall RtlNewSecurityObjectWithMultipleInheritance(ptr ptr ptr ptr long long long ptr ptr) @ stdcall RtlNormalizeProcessParams(ptr) @ stdcall RtlNtPathNameToDosPathName(ptr ptr ptr ptr) ; CHECKME @ stdcall RtlNtStatusToDosError(long) @@ -893,7 +893,7 @@ @ stdcall RtlSetSaclSecurityDescriptor(ptr long ptr long) @ stdcall RtlSetSecurityDescriptorRMControl(ptr ptr) @ stdcall RtlSetSecurityObject(long ptr ptr ptr ptr) -;@ stdcall RtlSetSecurityObjectEx +@ stdcall RtlSetSecurityObjectEx(long ptr ptr long ptr ptr) @ stdcall RtlSetThreadErrorMode(long ptr) @ stdcall RtlSetThreadIsCritical(long ptr long) @ stdcall RtlSetThreadPoolStartFunc(ptr ptr) Modified: trunk/reactos/lib/rtl/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/CMakeLists.txt?rev…
============================================================================== --- trunk/reactos/lib/rtl/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/lib/rtl/CMakeLists.txt [iso-8859-1] Thu Oct 4 18:48:15 2012 @@ -39,6 +39,7 @@ nls.c path.c ppb.c + priv.c process.c propvar.c random.c Added: trunk/reactos/lib/rtl/priv.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/priv.c?rev=57481&v…
============================================================================== --- trunk/reactos/lib/rtl/priv.c (added) +++ trunk/reactos/lib/rtl/priv.c [iso-8859-1] Thu Oct 4 18:48:15 2012 @@ -1,0 +1,185 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS system libraries + * FILE: lib/rtl/priv.c + * PURPOSE: Security related functions and Security Objects + * PROGRAMMER: Eric Kohl + */ + +/* INCLUDES *****************************************************************/ + +#include <rtl.h> + +#define NDEBUG +#include <debug.h> + +/* FUNCTIONS ***************************************************************/ + +/* + * @implemented + */ +NTSTATUS +NTAPI +RtlImpersonateSelf(IN SECURITY_IMPERSONATION_LEVEL ImpersonationLevel) +{ + HANDLE ProcessToken; + HANDLE ImpersonationToken; + NTSTATUS Status; + OBJECT_ATTRIBUTES ObjAttr; + SECURITY_QUALITY_OF_SERVICE Sqos; + + PAGED_CODE_RTL(); + + Status = ZwOpenProcessToken(NtCurrentProcess(), + TOKEN_DUPLICATE, + &ProcessToken); + if (!NT_SUCCESS(Status)) + { + DPRINT1("NtOpenProcessToken() failed (Status %lx)\n", Status); + return Status; + } + + Sqos.Length = sizeof(SECURITY_QUALITY_OF_SERVICE); + Sqos.ImpersonationLevel = ImpersonationLevel; + Sqos.ContextTrackingMode = 0; + Sqos.EffectiveOnly = FALSE; + + InitializeObjectAttributes(&ObjAttr, + NULL, + 0, + NULL, + NULL); + + ObjAttr.SecurityQualityOfService = &Sqos; + + Status = ZwDuplicateToken(ProcessToken, + TOKEN_IMPERSONATE, + &ObjAttr, + Sqos.EffectiveOnly, /* why both here _and_ in Sqos? */ + TokenImpersonation, + &ImpersonationToken); + if (!NT_SUCCESS(Status)) + { + DPRINT1("NtDuplicateToken() failed (Status %lx)\n", Status); + NtClose(ProcessToken); + return Status; + } + + Status = ZwSetInformationThread(NtCurrentThread(), + ThreadImpersonationToken, + &ImpersonationToken, + sizeof(HANDLE)); + if (!NT_SUCCESS(Status)) + { + DPRINT1("NtSetInformationThread() failed (Status %lx)\n", Status); + } + + ZwClose(ImpersonationToken); + ZwClose(ProcessToken); + + return Status; +} + +/* + * @unimplemented + */ +NTSTATUS +NTAPI +RtlAcquirePrivilege(IN PULONG Privilege, + IN ULONG NumPriv, + IN ULONG Flags, + OUT PVOID *ReturnedState) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +/* + * @unimplemented + */ +VOID +NTAPI +RtlReleasePrivilege(IN PVOID ReturnedState) +{ + UNIMPLEMENTED; +} + +/* + * @implemented + */ +NTSTATUS +NTAPI +RtlAdjustPrivilege(IN ULONG Privilege, + IN BOOLEAN Enable, + IN BOOLEAN CurrentThread, + OUT PBOOLEAN Enabled) +{ + TOKEN_PRIVILEGES NewState; + TOKEN_PRIVILEGES OldState; + ULONG ReturnLength; + HANDLE TokenHandle; + NTSTATUS Status; + + PAGED_CODE_RTL(); + + DPRINT("RtlAdjustPrivilege() called\n"); + + if (CurrentThread) + { + Status = ZwOpenThreadToken(NtCurrentThread(), + TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, + FALSE, + &TokenHandle); + } + else + { + Status = ZwOpenProcessToken(NtCurrentProcess(), + TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, + &TokenHandle); + } + + if (!NT_SUCCESS (Status)) + { + DPRINT1("Retrieving token handle failed (Status %lx)\n", Status); + return Status; + } + + OldState.PrivilegeCount = 1; + + NewState.PrivilegeCount = 1; + NewState.Privileges[0].Luid.LowPart = Privilege; + NewState.Privileges[0].Luid.HighPart = 0; + NewState.Privileges[0].Attributes = (Enable) ? SE_PRIVILEGE_ENABLED : 0; + + Status = ZwAdjustPrivilegesToken(TokenHandle, + FALSE, + &NewState, + sizeof(TOKEN_PRIVILEGES), + &OldState, + &ReturnLength); + ZwClose (TokenHandle); + if (Status == STATUS_NOT_ALL_ASSIGNED) + { + DPRINT1("Failed to assign all privileges\n"); + return STATUS_PRIVILEGE_NOT_HELD; + } + + if (!NT_SUCCESS(Status)) + { + DPRINT1("NtAdjustPrivilegesToken() failed (Status %lx)\n", Status); + return Status; + } + + if (OldState.PrivilegeCount == 0) + { + *Enabled = Enable; + } + else + { + *Enabled = (OldState.Privileges[0].Attributes & SE_PRIVILEGE_ENABLED); + } + + DPRINT("RtlAdjustPrivilege() done\n"); + + return STATUS_SUCCESS; +} Propchange: trunk/reactos/lib/rtl/priv.c ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/lib/rtl/security.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/security.c?rev=574…
============================================================================== --- trunk/reactos/lib/rtl/security.c [iso-8859-1] (original) +++ trunk/reactos/lib/rtl/security.c [iso-8859-1] Thu Oct 4 18:48:15 2012 @@ -14,175 +14,6 @@ #include <debug.h> /* FUNCTIONS ***************************************************************/ - -/* - * @implemented - */ -NTSTATUS -NTAPI -RtlImpersonateSelf(IN SECURITY_IMPERSONATION_LEVEL ImpersonationLevel) -{ - HANDLE ProcessToken; - HANDLE ImpersonationToken; - NTSTATUS Status; - OBJECT_ATTRIBUTES ObjAttr; - SECURITY_QUALITY_OF_SERVICE Sqos; - - PAGED_CODE_RTL(); - - Status = ZwOpenProcessToken(NtCurrentProcess(), - TOKEN_DUPLICATE, - &ProcessToken); - if (!NT_SUCCESS(Status)) - { - DPRINT1("NtOpenProcessToken() failed (Status %lx)\n", Status); - return Status; - } - - Sqos.Length = sizeof(SECURITY_QUALITY_OF_SERVICE); - Sqos.ImpersonationLevel = ImpersonationLevel; - Sqos.ContextTrackingMode = 0; - Sqos.EffectiveOnly = FALSE; - - InitializeObjectAttributes(&ObjAttr, - NULL, - 0, - NULL, - NULL); - - ObjAttr.SecurityQualityOfService = &Sqos; - - Status = ZwDuplicateToken(ProcessToken, - TOKEN_IMPERSONATE, - &ObjAttr, - Sqos.EffectiveOnly, /* why both here _and_ in Sqos? */ - TokenImpersonation, - &ImpersonationToken); - if (!NT_SUCCESS(Status)) - { - DPRINT1("NtDuplicateToken() failed (Status %lx)\n", Status); - NtClose(ProcessToken); - return Status; - } - - Status = ZwSetInformationThread(NtCurrentThread(), - ThreadImpersonationToken, - &ImpersonationToken, - sizeof(HANDLE)); - if (!NT_SUCCESS(Status)) - { - DPRINT1("NtSetInformationThread() failed (Status %lx)\n", Status); - } - - ZwClose(ImpersonationToken); - ZwClose(ProcessToken); - - return Status; -} - -/* - * @unimplemented - */ -NTSTATUS -NTAPI -RtlAcquirePrivilege(IN PULONG Privilege, - IN ULONG NumPriv, - IN ULONG Flags, - OUT PVOID *ReturnedState) -{ - UNIMPLEMENTED; - return STATUS_NOT_IMPLEMENTED; -} - -/* - * @unimplemented - */ -VOID -NTAPI -RtlReleasePrivilege(IN PVOID ReturnedState) -{ - UNIMPLEMENTED; -} - -/* - * @implemented - */ -NTSTATUS -NTAPI -RtlAdjustPrivilege(IN ULONG Privilege, - IN BOOLEAN Enable, - IN BOOLEAN CurrentThread, - OUT PBOOLEAN Enabled) -{ - TOKEN_PRIVILEGES NewState; - TOKEN_PRIVILEGES OldState; - ULONG ReturnLength; - HANDLE TokenHandle; - NTSTATUS Status; - - PAGED_CODE_RTL(); - - DPRINT("RtlAdjustPrivilege() called\n"); - - if (CurrentThread) - { - Status = ZwOpenThreadToken(NtCurrentThread(), - TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, - FALSE, - &TokenHandle); - } - else - { - Status = ZwOpenProcessToken(NtCurrentProcess(), - TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, - &TokenHandle); - } - - if (!NT_SUCCESS (Status)) - { - DPRINT1("Retrieving token handle failed (Status %lx)\n", Status); - return Status; - } - - OldState.PrivilegeCount = 1; - - NewState.PrivilegeCount = 1; - NewState.Privileges[0].Luid.LowPart = Privilege; - NewState.Privileges[0].Luid.HighPart = 0; - NewState.Privileges[0].Attributes = (Enable) ? SE_PRIVILEGE_ENABLED : 0; - - Status = ZwAdjustPrivilegesToken(TokenHandle, - FALSE, - &NewState, - sizeof(TOKEN_PRIVILEGES), - &OldState, - &ReturnLength); - ZwClose (TokenHandle); - if (Status == STATUS_NOT_ALL_ASSIGNED) - { - DPRINT1("Failed to assign all privileges\n"); - return STATUS_PRIVILEGE_NOT_HELD; - } - - if (!NT_SUCCESS(Status)) - { - DPRINT1("NtAdjustPrivilegesToken() failed (Status %lx)\n", Status); - return Status; - } - - if (OldState.PrivilegeCount == 0) - { - *Enabled = Enable; - } - else - { - *Enabled = (OldState.Privileges[0].Attributes & SE_PRIVILEGE_ENABLED); - } - - DPRINT("RtlAdjustPrivilege() done\n"); - - return STATUS_SUCCESS; -} /* * @implemented @@ -217,6 +48,111 @@ return STATUS_NOT_IMPLEMENTED; } +/* + * @unimplemented + */ +NTSTATUS +NTAPI +RtlNewSecurityObjectEx(IN PSECURITY_DESCRIPTOR ParentDescriptor, + IN PSECURITY_DESCRIPTOR CreatorDescriptor, + OUT PSECURITY_DESCRIPTOR *NewDescriptor, + IN LPGUID ObjectType, + IN BOOLEAN IsDirectoryObject, + IN ULONG AutoInheritFlags, + IN HANDLE Token, + IN PGENERIC_MAPPING GenericMapping) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +/* + * @unimplemented + */ +NTSTATUS +NTAPI +RtlNewSecurityObjectWithMultipleInheritance(IN PSECURITY_DESCRIPTOR ParentDescriptor, + IN PSECURITY_DESCRIPTOR CreatorDescriptor, + OUT PSECURITY_DESCRIPTOR *NewDescriptor, + IN LPGUID *ObjectTypes, + IN ULONG GuidCount, + IN BOOLEAN IsDirectoryObject, + IN ULONG AutoInheritFlags, + IN HANDLE Token, + IN PGENERIC_MAPPING GenericMapping) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +/* + * @unimplemented + */ +NTSTATUS +NTAPI +RtlConvertToAutoInheritSecurityObject(IN PSECURITY_DESCRIPTOR ParentDescriptor, + IN PSECURITY_DESCRIPTOR CreatorDescriptor, + OUT PSECURITY_DESCRIPTOR *NewDescriptor, + IN LPGUID ObjectType, + IN BOOLEAN IsDirectoryObject, + IN PGENERIC_MAPPING GenericMapping) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +/* + * @unimplemented + */ +NTSTATUS +NTAPI +RtlCreateUserSecurityObject(IN PVOID AceData, + IN ULONG AceCount, + IN PSID OwnerSid, + IN PSID GroupSid, + IN BOOLEAN IsDirectoryObject, + IN PGENERIC_MAPPING GenericMapping, + OUT PSECURITY_DESCRIPTOR *NewDescriptor) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +/* + * @unimplemented + */ +NTSTATUS +NTAPI +RtlNewInstanceSecurityObject(IN BOOLEAN ParentDescriptorChanged, + IN BOOLEAN CreatorDescriptorChanged, + IN PLUID OldClientTokenModifiedI, + OUT PLUID NewClientTokenModifiedId, + IN PSECURITY_DESCRIPTOR ParentDescriptor, + IN PSECURITY_DESCRIPTOR CreatorDescriptor, + OUT PSECURITY_DESCRIPTOR *NewDescriptor, + IN BOOLEAN IsDirectoryObject, + IN HANDLE Token, + IN PGENERIC_MAPPING GenericMapping) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +/* + * @unimplemented + */ +NTSTATUS +NTAPI +RtlNewSecurityGrantedAccess(IN ACCESS_MASK DesiredAccess, + OUT PPRIVILEGE_SET Privileges, + IN OUT PULONG Length, + IN HANDLE Token, + IN PGENERIC_MAPPING GenericMapping, + OUT PACCESS_MASK RemainingDesiredAccess) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} /* * @unimplemented @@ -295,6 +231,22 @@ */ NTSTATUS NTAPI +RtlSetSecurityObjectEx(IN SECURITY_INFORMATION SecurityInformation, + IN PSECURITY_DESCRIPTOR ModificationDescriptor, + OUT PSECURITY_DESCRIPTOR *ObjectsSecurityDescriptor, + IN ULONG AutoInheritFlags, + IN PGENERIC_MAPPING GenericMapping, + IN HANDLE Token) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +/* + * @unimplemented + */ +NTSTATUS +NTAPI RtlRegisterSecureMemoryCacheCallback(IN PRTL_SECURE_MEMORY_CACHE_CALLBACK Callback) { UNIMPLEMENTED;
12 years, 1 month
1
0
0
0
← Newer
1
...
15
16
17
18
19
20
21
22
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
Results per page:
10
25
50
100
200