ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
March 2013
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
14 participants
249 discussions
Start a n
N
ew thread
[gadamopoulos] 58411: [csrsrv] - Remove CsrSetLogonNotifyWindow - Use a reactos only TWOPARAM_ROUTINE_EXITREACTOS call in order to start the shut down process in winlogon - Use a NOPARAM_ROUTINE_IS...
by gadamopoulos@svn.reactos.org
Author: gadamopoulos Date: Sat Mar 2 22:22:56 2013 New Revision: 58411 URL:
http://svn.reactos.org/svn/reactos?rev=58411&view=rev
Log: [csrsrv] - Remove CsrSetLogonNotifyWindow - Use a reactos only TWOPARAM_ROUTINE_EXITREACTOS call in order to start the shut down process in winlogon - Use a NOPARAM_ROUTINE_ISCONSOLEMODE call in DtbgIsDesktopVisible to fix detecting console mode in gui-on-demand mode Modified: trunk/reactos/win32ss/include/ntuser.h trunk/reactos/win32ss/pch.h trunk/reactos/win32ss/user/ntuser/simplecall.c trunk/reactos/win32ss/user/win32csr/desktopbg.c trunk/reactos/win32ss/user/win32csr/exitros.c Modified: trunk/reactos/win32ss/include/ntuser.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/include/ntuser.h?r…
============================================================================== --- trunk/reactos/win32ss/include/ntuser.h [iso-8859-1] (original) +++ trunk/reactos/win32ss/include/ntuser.h [iso-8859-1] Sat Mar 2 22:22:56 2013 @@ -3301,12 +3301,14 @@ * ReactOS-specific NtUser calls and their related structures, both which shouldn't exist. */ +#define NOPARAM_ROUTINE_ISCONSOLEMODE 0xffff0001 #define NOPARAM_ROUTINE_GETMESSAGEEXTRAINFO 0xffff0005 #define ONEPARAM_ROUTINE_CSRSS_GUICHECK 0xffff0008 #define ONEPARAM_ROUTINE_SWITCHCARETSHOWING 0xfffe0008 #define ONEPARAM_ROUTINE_ENABLEPROCWNDGHSTING 0xfffe000d #define ONEPARAM_ROUTINE_GETDESKTOPMAPPING 0xfffe000e #define TWOPARAM_ROUTINE_SETMENUBARHEIGHT 0xfffd0050 +#define TWOPARAM_ROUTINE_EXITREACTOS 0xfffd0051 #define TWOPARAM_ROUTINE_SETGUITHRDHANDLE 0xfffd0052 #define MSQ_STATE_CAPTURE 0x1 #define MSQ_STATE_ACTIVE 0x2 Modified: trunk/reactos/win32ss/pch.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/pch.h?rev=58411&r1…
============================================================================== --- trunk/reactos/win32ss/pch.h [iso-8859-1] (original) +++ trunk/reactos/win32ss/pch.h [iso-8859-1] Sat Mar 2 22:22:56 2013 @@ -86,6 +86,7 @@ /* Undocumented user definitions */ #include <undocuser.h> +#include <winlogon.h> /* Freetype headers */ #include <ft2build.h> Modified: trunk/reactos/win32ss/user/ntuser/simplecall.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/simple…
============================================================================== --- trunk/reactos/win32ss/user/ntuser/simplecall.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/simplecall.c [iso-8859-1] Sat Mar 2 22:22:56 2013 @@ -128,6 +128,10 @@ pti->MessageQueue->spwndActive = NULL; RETURN(0); } + + /* this is a Reactos only case and is needed for gui-on-demand */ + case NOPARAM_ROUTINE_ISCONSOLEMODE: + RETURN( ScreenDeviceContext == NULL ); default: ERR("Calling invalid routine number 0x%x in NtUserCallNoParam\n", Routine); @@ -473,6 +477,13 @@ case TWOPARAM_ROUTINE_UNHOOKWINDOWSHOOK: RETURN( IntUnhookWindowsHook((int)Param1, (HOOKPROC)Param2)); + case TWOPARAM_ROUTINE_EXITREACTOS: + if(hwndSAS == NULL) + { + ASSERT(hwndSAS); + RETURN(STATUS_NOT_FOUND); + } + RETURN( co_IntSendMessage (hwndSAS, PM_WINLOGON_EXITWINDOWS, (WPARAM) Param1, (LPARAM)Param2)); } ERR("Calling invalid routine number 0x%x in NtUserCallTwoParam(), Param1=0x%x Parm2=0x%x\n", Routine, Param1, Param2); Modified: trunk/reactos/win32ss/user/win32csr/desktopbg.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/win32csr/desk…
============================================================================== --- trunk/reactos/win32ss/user/win32csr/desktopbg.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/win32csr/desktopbg.c [iso-8859-1] Sat Mar 2 22:22:56 2013 @@ -21,15 +21,7 @@ BOOL FASTCALL DtbgIsDesktopVisible(VOID) { - HWND VisibleDesktopWindow = GetDesktopWindow(); // DESKTOPWNDPROC - - if (VisibleDesktopWindow != NULL && - !IsWindowVisible(VisibleDesktopWindow)) - { - VisibleDesktopWindow = NULL; - } - - return VisibleDesktopWindow != NULL; + return !((BOOL)NtUserCallNoParam(NOPARAM_ROUTINE_ISCONSOLEMODE)); } /* EOF */ Modified: trunk/reactos/win32ss/user/win32csr/exitros.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/win32csr/exit…
============================================================================== --- trunk/reactos/win32ss/user/win32csr/exitros.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/win32csr/exitros.c [iso-8859-1] Sat Mar 2 22:22:56 2013 @@ -13,7 +13,6 @@ #include "resource.h" #include <debug.h> -static HWND LogonNotifyWindow = NULL; static HANDLE LogonProcess = NULL; CSR_API(CsrRegisterLogonProcess) @@ -42,22 +41,6 @@ CSR_API(CsrSetLogonNotifyWindow) { - DWORD WindowCreator; - - if (0 == GetWindowThreadProcessId(Request->Data.SetLogonNotifyWindowRequest.LogonNotifyWindow, - &WindowCreator)) - { - DPRINT1("Can't get window creator\n"); - return STATUS_INVALID_HANDLE; - } - if (WindowCreator != (DWORD_PTR)LogonProcess) - { - DPRINT1("Trying to register window not created by winlogon as notify window\n"); - return STATUS_ACCESS_DENIED; - } - - LogonNotifyWindow = Request->Data.SetLogonNotifyWindowRequest.LogonNotifyWindow; - return STATUS_SUCCESS; } @@ -888,16 +871,9 @@ { NTSTATUS Status; - if (NULL == LogonNotifyWindow) - { - DPRINT1("No LogonNotifyWindow registered\n"); - return STATUS_NOT_FOUND; - } - /* FIXME Inside 2000 says we should impersonate the caller here */ - Status = SendMessageW(LogonNotifyWindow, PM_WINLOGON_EXITWINDOWS, - (WPARAM) UserProcessId, - (LPARAM) Flags); + Status = NtUserCallTwoParam (UserProcessId, Flags, TWOPARAM_ROUTINE_EXITREACTOS); + /* If the message isn't handled, the return value is 0, so 0 doesn't indicate success. Success is indicated by a 1 return value, if anything besides 0 or 1 it's a NTSTATUS value */
11 years, 9 months
1
0
0
0
[spetreolle] 58410: [REGEDIT] - Katayama Hirofumi: Fix Japanese resource. CORE-6988 #resolve #comment Commited in r58410, thanks.
by spetreolle@svn.reactos.org
Author: spetreolle Date: Sat Mar 2 21:44:01 2013 New Revision: 58410 URL:
http://svn.reactos.org/svn/reactos?rev=58410&view=rev
Log: [REGEDIT] - Katayama Hirofumi: Fix Japanese resource. CORE-6988 #resolve #comment Commited in r58410,thanks. Modified: trunk/reactos/base/applications/regedit/lang/ja-JP.rc 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] Sat Mar 2 21:44:01 2013 @@ -55,7 +55,7 @@ MENUITEM SEPARATOR MENUITEM "ãã¤ãã®èªã¿è¾¼ã¿...", ID_REGISTRY_LOADHIVE, GRAYED - MENUITEM "ãã¤ãã®ã¢ã³ãã¼ã...", ID_REGISTRY_UNLOADHIVE, GRAYED + MENUITEM "ãã¤ãã®ã¢ã³ãã¼ã...", ID_REGISTRY_UNLOADHIVE, GRAYED MENUITEM SEPARATOR MENUITEM "ãããã¯ã¼ã¯ ã¬ã¸ã¹ããªã¸ã®æ¥ç¶(&C)...", ID_REGISTRY_CONNECTNETWORKREGISTRY @@ -80,7 +80,7 @@ MENUITEM "ãã¤ããªå¤(&B)", ID_EDIT_NEW_BINARYVALUE MENUITEM "DWORD å¤(&D)", ID_EDIT_NEW_DWORDVALUE MENUITEM "è¤æ°è¡æååå¤(&M)", ID_EDIT_NEW_MULTISTRINGVALUE - MENUITEM "å±éå¯è½ ãªæååå¤(&E)", ID_EDIT_NEW_EXPANDABLESTRINGVALUE + MENUITEM "å±éå¯è½ãªæååå¤(&E)", ID_EDIT_NEW_EXPANDABLESTRINGVALUE END MENUITEM SEPARATOR MENUITEM "ã¢ã¯ã»ã¹è¨±å¯(&P)...", ID_EDIT_PERMISSIONS @@ -93,7 +93,7 @@ MENUITEM "æ¤ç´¢(&F)\tCtrl+F", ID_EDIT_FIND MENUITEM "次ãæ¤ç´¢(&X)\tF3", ID_EDIT_FINDNEXT END - POPUP "表 示(&V)" + POPUP "表示(&V)" BEGIN MENUITEM "ã¹ãã¼ã¿ã¹ ãã¼(&B)", ID_VIEW_STATUSBAR MENUITEM SEPARATOR @@ -134,7 +134,7 @@ MENUITEM "ãã¤ããªå¤(&B)", ID_EDIT_NEW_BINARYVALUE MENUITEM "DWORD å¤(&D)", ID_EDIT_NEW_DWORDVALUE MENUITEM "è¤æ°è¡æååå¤(&M)", ID_EDIT_NEW_MULTISTRINGVALUE - MENUITEM "å±éå¯è½ ãªæååå¤(&E)", ID_EDIT_NEW_EXPANDABLESTRINGVALUE + MENUITEM "å±éå¯è½ãªæååå¤(&E)", ID_EDIT_NEW_EXPANDABLESTRINGVALUE END END POPUP "" @@ -148,7 +148,7 @@ MENUITEM "ãã¤ããªå¤(&B)", ID_EDIT_NEW_BINARYVALUE MENUITEM "DWORD å¤(&D)", ID_EDIT_NEW_DWORDVALUE MENUITEM "è¤æ°è¡æååå¤(&M)", ID_EDIT_NEW_MULTISTRINGVALUE - MENUITEM "å±éå¯è½ ãªæååå¤(&E)", ID_EDIT_NEW_EXPANDABLESTRINGVALUE + MENUITEM "å±éå¯è½ãªæååå¤(&E)", ID_EDIT_NEW_EXPANDABLESTRINGVALUE END MENUITEM "æ¤ç´¢(&F)", ID_EDIT_FIND MENUITEM SEPARATOR @@ -240,12 +240,12 @@ IDD_EDIT_RESOURCE_LIST DIALOGEX 32, 24, 170, 120 STYLE DS_SHELLFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU -CAPTION "Resource List" -FONT 8, "MS Shell Dlg" +CAPTION "ãªã½ã¼ã¹ ãªã¹ã" +FONT 9, "MS UI Gothic" { CONTROL "", IDC_RESOURCE_LIST, "SysListView32", LVS_REPORT | LVS_NOSORTHEADER | LVS_SINGLESEL | LVS_SHOWSELALWAYS | WS_BORDER | WS_TABSTOP, 10, 10, 150, 75 DEFPUSHBUTTON "OK", IDOK, 27, 100, 50, 14 - PUSHBUTTON "Show...", IDC_SHOW_RESOURCE, 93, 100, 50, 14, WS_DISABLED + PUSHBUTTON "表示(S)...", IDC_SHOW_RESOURCE, 93, 100, 50, 14, WS_DISABLED } @@ -307,7 +307,7 @@ ID_EDIT_MENU "å¤ããã¼ãç·¨éããã³ãã³ãã§ãã" ID_VIEW_MENU "ã¬ã¸ã¹ã㪠ã¦ã£ã³ãã¦ãã«ã¹ã¿ãã¤ãºããã³ãã³ãã§ãã" ID_FAVOURITES_MENU "é »ç¹ã«ä½¿ç¨ããããã¼ã«ã¢ã¯ã»ã¹ããã³ãã³ãã§ãã" - ID_HELP_MENU "ãã«ãã¨ã¬ã¸ã¹ã㪠ã¨ãã£ã¿ã®ãã¼ã¸ã§ã³æ å ±ã表 示ããã³ãã³ãã§ãã" + ID_HELP_MENU "ãã«ãã¨ã¬ã¸ã¹ã㪠ã¨ãã£ã¿ã®ãã¼ã¸ã§ã³æ å ±ã表示ããã³ãã³ãã§ãã" ID_EDIT_NEW_MENU "æ°ãããã¼ãå¤ãä½æããã³ãã³ãã§ãã" END @@ -317,21 +317,21 @@ ID_EDIT_NEW_KEY "æ°ãããã¼ã追å ãã¾ãã" ID_EDIT_NEW_STRINGVALUE "æ°ããæååå¤ã追å ãã¾ãã" ID_EDIT_NEW_BINARYVALUE "æ°ãããã¤ããªå¤ã追å ãã¾ãã" - ID_EDIT_NEW_DWORDVALUE "æ°ããè¤æ°è¡æååå¤ã追å ãã¾ãã" + ID_EDIT_NEW_DWORDVALUE "æ°ãã DWORD å¤ã追å ãã¾ãã" ID_REGISTRY_IMPORTREGISTRYFILE "ããã¹ã ãã¡ã¤ã«ãã¬ã¸ã¹ããªã«ã¤ã³ãã¼ããã¾ãã" ID_REGISTRY_EXPORTREGISTRYFILE "ã¬ã¸ã¹ããªã®ä¸é¨ã¾ãã¯å ¨ä½ãããã¹ã ãã¡ã¤ã«ã«ã¨ã¯ã¹ãã¼ããã¾ãã" ID_REGISTRY_LOADHIVE - "Loads a hive file into the registry" + "ãã¤ã ãã¡ã¤ã«ãã¬ã¸ã¹ããªã«èªã¿è¾¼ã¿ã¾ãã" ID_REGISTRY_UNLOADHIVE - "Unloads a hive from the registry" + "ã¬ã¸ã¹ããªãããã¤ããã¢ã³ãã¼ããã¾ãã" ID_REGISTRY_CONNECTNETWORKREGISTRY "ãªã¢ã¼ã ã³ã³ãã¥ã¼ã¿ã®ã¬ã¸ã¹ããªã«æ¥ç¶ãã¾ãã" ID_REGISTRY_DISCONNECTNETWORKREGISTRY "ãªã¢ã¼ã ã³ã³ãã¥ã¼ã¿ã®ã¬ã¸ã¹ããªãåæãã¾ãã" ID_REGISTRY_PRINT "ã¬ã¸ã¹ããªã®ä¸é¨ã¾ãã¯å ¨ä½ãå°å·ãã¾ãã" /* ID_HELP_HELPTOPICS "ã¬ã¸ã¹ã㪠ã¨ãã£ã¿ã®ãã«ããéãã¾ãã" */ - ID_HELP_ABOUT "ããã°ã©ã ã®æ å ±ããã¼ã¸ã§ã³çªå·ããã³èä½æ¨©ã表 示ãã¾ãã" + ID_HELP_ABOUT "ããã°ã©ã ã®æ å ±ããã¼ã¸ã§ã³çªå·ããã³èä½æ¨©ã表示ãã¾ãã" END STRINGTABLE DISCARDABLE @@ -339,8 +339,8 @@ ID_REGISTRY_EXIT "ã¬ã¸ã¹ã㪠ã¨ãã£ã¿ãçµäºãã¾ãã" ID_FAVOURITES_ADDTOFAVOURITES "ãæ°ã«å ¥ãã®ä¸è¦§ã«ãã¼ã追å ãã¾ãã" ID_FAVOURITES_REMOVEFAVOURITE "ãæ°ã«å ¥ãã®ä¸è¦§ãããã¼ãåé¤ãã¾ãã" - ID_VIEW_STATUSBAR "ã¹ãã¼ã¿ã¹ ãã¼ã®è¡¨ 示/é表 示ãåãæ¿ãã¾ãã" - ID_VIEW_SPLIT "2 ã¤ã®ããã«ã®å¢çã®ä½ç½®ãå¤æ´ãã¾ãã" + ID_VIEW_STATUSBAR "ã¹ãã¼ã¿ã¹ ãã¼ã®è¡¨ç¤º/é表示ãåãæ¿ãã¾ãã" + ID_VIEW_SPLIT "2ã¤ã®ããã«ã®å¢çã®ä½ç½®ãå¤æ´ãã¾ãã" ID_VIEW_REFRESH "ã¦ã£ã³ãã¦ã®å 容ãææ°ã®æ å ±ã«æ´æ°ãã¾ãã" ID_EDIT_DELETE "é¸æç¯å²ãåé¤ãã¾ãã" ID_EDIT_RENAME "ååãå¤æ´ãã¾ãã" @@ -369,7 +369,7 @@ IDS_ERR_RENVAL_CAPTION "å¤ã®ååãå¤æ´ããã¨ãã«ã¨ã©ã¼ãçºçãã¾ããã" IDS_ERR_RENVAL_TOEMPTY "%s ã®ååãå¤æ´ã§ãã¾ãããæå®ãããå¤ã®ååã«ã¯æåãå«ã¾ãã¦ãã¾ãããå¥ã®ååã§ããç´ãã¦ãã ããã" IDS_QUERY_IMPORT_HIVE_CAPTION "Confirm Key Restoration" - IDS_QUERY_IMPORT_HIVE_MSG "A key will be restored on top of the currently selected key.\nAll values and subkeys of this key will be deleted.\nDo you want to continue the operation?" + IDS_QUERY_IMPORT_HIVE_MSG "ç¾å¨é¸æä¸ã®ãã¼ã®æä¸é¨ã«ãã¼ãæ ¼ç´ããã¾ãã\nãã®ãã¼ã®ãã¹ã¦ã®å¤ã¨ãµããã¼ãåé¤ããã¾ãã\nãã®å¦çãç¶è¡ãã¾ãã?" IDS_NEW_KEY "æ°ãããã¼ #%d" IDS_NEW_VALUE "æ°ããå¤ #%d" END @@ -383,8 +383,8 @@ IDS_MY_COMPUTER "ã㤠ã³ã³ãã¥ã¼ã¿" IDS_IMPORT_REG_FILE "ã¬ã¸ã¹ã㪠ãã¡ã¤ã«ã®ã¤ã³ãã¼ã" IDS_EXPORT_REG_FILE "ã¬ã¸ã¹ã㪠ãã¡ã¤ã«ã®ã¨ã¯ã¹ãã¼ã" - IDS_LOAD_HIVE "Load Hive" - IDS_UNLOAD_HIVE "Unload Hive" + IDS_LOAD_HIVE "ãã¤ããèªã¿è¾¼ã" + IDS_UNLOAD_HIVE "ãã¤ããã¢ã³ãã¼ããã" IDS_INVALID_DWORD "(ç¡å¹ãª DWORD å¤)" END @@ -434,10 +434,10 @@ STRINGTABLE DISCARDABLE BEGIN - IDS_IMPORT_PROMPT "Adding information can unintentionally change or delete values and cause components to stop working correctly.\nIf you do not trust the source of this information in '%s', do not add it to registry.\n\nAre you sure you want to continue?" - IDS_IMPORT_OK "The keys and values contained in '%s' have been successfully added to the registry." - IDS_IMPORT_ERROR "Cannot import '%s': Error opening the file. There may be a disk, file system error or file may not exist." - IDS_EXPORT_ERROR "Cannot export '%s': Error creating or writing to the file. There may be a disk or file system error." + IDS_IMPORT_PROMPT "æ å ±ã追å ãããã¨ã¯ãæå³ããã«å¤ãå¤æ´ã¾ãã¯åé¤ããã³ã³ãã¼ãã³ãã®æ£ããåä½ã®åæ¢ãå¼ãèµ·ããããç¥ãã¾ããã\nãã '%1' ã®æ å ±ã®å ¥æå ãä¿¡é ¼ãã¦ããªãã®ãªããã¬ã¸ã¹ããªã«è¿½å ããªãã§ä¸ããã\n\nç¶è¡ãã¾ãã?" + IDS_IMPORT_OK "'%1' ã«å«ã¾ãããã¼ã¨å¤ã¯ãæ£ããã¬ã¸ã¹ããªã«è¿½å ããã¾ããã" + IDS_IMPORT_ERROR "'%1' ãã¤ã³ãã¼ãã§ãã¾ãã: ãã¡ã¤ã«ãéãã¨ãã«ã¨ã©ã¼ãçºçãã¾ããããã£ã¹ã¯ããã¡ã¤ã« ã·ã¹ãã ã®ã¨ã©ã¼ããããã¯ãã¡ã¤ã«ãåå¨ãã¦ããªãã®ããç¥ãã¾ããã" + IDS_EXPORT_ERROR "'%1' ãã¨ã¯ã¹ãã¼ãã§ãã¾ãã: ãã¡ã¤ã«ãä½æã¾ãã¯æ¸ãè¾¼ãã¨ãã«ã¨ã©ã¼ãçºçãã¾ããããã£ã¹ã¯ããã¡ã¤ã« ã·ã¹ãã ã®ã¨ã©ã¼ããç¥ãã¾ããã" END STRINGTABLE DISCARDABLE @@ -506,20 +506,20 @@ FONT 9, "MS UI Gothic" BEGIN GROUPBOX "ã¨ã¯ã¹ãã¼ãç¯å²",IDC_STATIC,2,0,366,48 - CONTROL "ãã¹ã¦(&A)",IDC_EXPORT_ALL,"Button",BS_AUTORADIOBUTTON,10,10, 29,11 - CONTROL "é¸æãããé¨å(&E)",IDC_EXPORT_BRANCH,"Button",BS_AUTORADIOBUTTON,10,22, 100,11 + CONTROL "ãã¹ã¦(&A)",IDC_EXPORT_ALL,"Button",BS_AUTORADIOBUTTON,10,10,100,11 + CONTROL "é¸æãããé¨å(&E)",IDC_EXPORT_BRANCH,"Button",BS_AUTORADIOBUTTON,10,22,100,11 EDITTEXT IDC_EXPORT_BRANCH_TEXT,30,34,335,12 END IDD_LOADHIVE DIALOGEX DISCARDABLE 0, 0, 193, 34 STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Load Hive" -FONT 8, "Ms Shell Dlg" +CAPTION "ãã¤ããèªã¿è¾¼ã" +FONT 9, "MS UI Gothic" { - LTEXT "&Key:", IDC_STATIC, 4, 4, 15, 8, SS_LEFT - EDITTEXT IDC_EDIT_KEY, 23, 2, 167, 13 + LTEXT "ãã¼(&K):", IDC_STATIC, 4, 4, 25, 8, SS_LEFT + EDITTEXT IDC_EDIT_KEY, 33, 2, 157, 13 DEFPUSHBUTTON "OK", IDOK, 140, 17, 50, 14 - PUSHBUTTON "Cancel", IDCANCEL, 89, 17, 50, 14 + PUSHBUTTON "ãã£ã³ã»ã«", IDCANCEL, 89, 17, 50, 14 } IDD_ADDFAVORITES DIALOGEX DISCARDABLE 0, 0, 186, 46 @@ -553,8 +553,8 @@ DEFPUSHBUTTON "次ãæ¤ç´¢(&F)",IDOK,197,7,50,14 PUSHBUTTON "ãã£ã³ã»ã«",IDCANCEL,197,24,50,14 GROUPBOX "æ¤ç´¢å¯¾è±¡",IDC_STATIC,7,25,63,51 - LTEXT "æ¤ç´¢ããå¤(&N):",IDC_STATIC,7,8,37,10 - EDITTEXT IDC_FINDWHAT,47,7,142,13,ES_AUTOHSCROLL + LTEXT "æ¤ç´¢ããå¤(&N):",IDC_STATIC,7,8,50,10 + EDITTEXT IDC_FINDWHAT,57,7,135,13,ES_AUTOHSCROLL CONTROL "ãã¼(&K)",IDC_LOOKAT_KEYS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,36,35,8 CONTROL "å¤(&V)",IDC_LOOKAT_VALUES,"Button",BS_AUTOCHECKBOX | @@ -597,7 +597,7 @@ *STRINGTABLE DISCARDABLE *BEGIN * ID_HELP_HELPTOPICS "ã¬ã¸ã¹ã㪠ã¨ãã£ã¿ã®ãã«ããéãã¾ãã" - * ID_HELP_ABOUT "ããã°ã©ã ã®æ å ±ããã¼ã¸ã§ã³çªå·ããã³èä½æ¨©ã表\示ãã¾ãã" + * ID_HELP_ABOUT "ããã°ã©ã ã®æ å ±ããã¼ã¸ã§ã³çªå·ããã³èä½æ¨©ã表示ãã¾ãã" *END */
11 years, 9 months
1
0
0
0
[dgorbachev] 58409: [TRANSLATION] Turkish translation for Solitaire and Spider by Erdem Ersoy (erdemersoy~AT~live~DOT~com). CORE-6989.
by dgorbachev@svn.reactos.org
Author: dgorbachev Date: Sat Mar 2 20:56:12 2013 New Revision: 58409 URL:
http://svn.reactos.org/svn/reactos?rev=58409&view=rev
Log: [TRANSLATION] Turkish translation for Solitaire and Spider by Erdem Ersoy (erdemersoy~AT~live~DOT~com). CORE-6989. Added: trunk/reactos/base/applications/games/solitaire/lang/tr-TR.rc (with props) trunk/reactos/base/applications/games/spider/lang/tr-TR.rc (with props) Modified: trunk/reactos/base/applications/games/solitaire/lang/en-US.rc trunk/reactos/base/applications/games/solitaire/rsrc.rc trunk/reactos/base/applications/games/spider/rsrc.rc Modified: trunk/reactos/base/applications/games/solitaire/lang/en-US.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/games/so…
============================================================================== --- trunk/reactos/base/applications/games/solitaire/lang/en-US.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/games/solitaire/lang/en-US.rc [iso-8859-1] Sat Mar 2 20:56:12 2013 @@ -5,6 +5,7 @@ * PURPOSE: English Language File for Solitaire * PROGRAMMERS: Daniel "EmuandCo" Reimer (reimer.daniel(a)freenet.de) */ + LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US Added: trunk/reactos/base/applications/games/solitaire/lang/tr-TR.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/games/so…
============================================================================== --- trunk/reactos/base/applications/games/solitaire/lang/tr-TR.rc (added) +++ trunk/reactos/base/applications/games/solitaire/lang/tr-TR.rc [iso-8859-1] Sat Mar 2 20:56:12 2013 @@ -1,0 +1,94 @@ +/* + * PROJECT: Solitaire + * LICENSE: Freeware, permission to use under Public Domain + * FILE: base/applications/games/solitaire/lang/tr-TR.rc + * PURPOSE: Turkish Language File for Solitaire + * PROGRAMMERS: Daniel "EmuandCo" Reimer (reimer.daniel(a)freenet.de) + * TRANSLATOR: Erdem ERSOY (eersoy93) + */ + +LANGUAGE LANG_TURKISH, SUBLANG_DEFAULT + + +/* Dialogs */ + +IDD_OPTIONS DIALOGEX DISCARDABLE 0, 0, 186, 118 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | DS_SHELLFONT +CAPTION "Ayarlar" +FONT 8, "MS Shell Dlg" +BEGIN + GROUPBOX "KaÄıtlar", -1, 7, 7, 90, 40 + AUTORADIOBUTTON "&Tekli çekme", IDC_OPT_DRAWONE, 14, 19, 70, 10, WS_GROUP | WS_TABSTOP + AUTORADIOBUTTON "&Ãçlü çekme", IDC_OPT_DRAWTHREE, 14, 32, 70, 10 + + AUTOCHECKBOX "&Zamanı göster", IDC_OPT_SHOWTIME, 7 ,51 ,65 ,10, WS_TABSTOP | WS_DISABLED + AUTOCHECKBOX "&Durum çubuÄu", IDC_OPT_STATUSBAR, 7, 66, 64, 10, WS_TABSTOP + + DEFPUSHBUTTON "Tamam", IDOK, 35, 97, 50, 14 + PUSHBUTTON "Vazgeç", IDCANCEL, 101, 97, 50, 14 +END + + +IDD_CARDBACK DIALOGEX 6, 6, 186, 104 +CAPTION "Deste Seç" +FONT 8, "MS Shell Dlg" +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | DS_SHELLFONT +BEGIN + CONTROL "", IDC_CARDBACK1, "Static", SS_NOTIFY, 4, 7, 26, 32 + CONTROL "", IDC_CARDBACK2, "Static", SS_NOTIFY, 34, 7, 26, 32 + CONTROL "", IDC_CARDBACK3, "Static", SS_NOTIFY, 64, 7, 26, 32 + CONTROL "", IDC_CARDBACK4, "Static", SS_NOTIFY, 94, 7, 26, 32 + CONTROL "", IDC_CARDBACK5, "Static", SS_NOTIFY, 124, 7, 26, 32 + CONTROL "", IDC_CARDBACK6, "Static", SS_NOTIFY, 154, 7, 26, 32 + CONTROL "", IDC_CARDBACK7, "Static", SS_NOTIFY, 4, 46, 26, 32 + CONTROL "", IDC_CARDBACK8, "Static", SS_NOTIFY, 34, 46, 26, 32 + CONTROL "", IDC_CARDBACK9, "Static", SS_NOTIFY, 64, 46, 26, 32 + CONTROL "", IDC_CARDBACK10, "Static", SS_NOTIFY, 94, 46, 26, 32 + CONTROL "", IDC_CARDBACK11, "Static", SS_NOTIFY, 124, 46, 26, 32 + CONTROL "", IDC_CARDBACK12, "Static", SS_NOTIFY, 154, 46, 26, 32 + DEFPUSHBUTTON "Tamam", IDOK, 66, 84, 54, 13 + PUSHBUTTON "Vazgeç", IDCANCEL, 126, 84, 54, 13 +END + + +/* Strings */ + +STRINGTABLE +BEGIN + IDS_SOL_NAME "Solitaire" + IDS_SOL_ABOUT "Solitaire, J Brown tarafından yapılmıÅtır.\n\nCardLib sürümü: 1.0" + IDS_SOL_QUIT "Bu oyundan çıkmak ister misiniz?" + IDS_SOL_WIN "Tebrikler, kazandınız!" + IDS_SOL_DEAL "Tekrar daÄıtılsın mı?" +END + + +/* Menus */ + +IDR_MENU1 MENU DISCARDABLE +BEGIN + POPUP "&Oyun" + BEGIN + MENUITEM "&DaÄıt\tF2", IDM_GAME_NEW + MENUITEM SEPARATOR + MENUITEM "D&esteler", IDM_GAME_DECK + MENUITEM "&Ayarlar", IDM_GAME_OPTIONS + MENUITEM SEPARATOR + MENUITEM "&ÃıkıÅ", IDM_GAME_EXIT + END + POPUP "&Yardım" + BEGIN + MENUITEM "&İçerik\tF1", IDM_HELP_CONTENTS + MENUITEM "&Hakkında", IDM_HELP_ABOUT + END +END + + + +/* Accelerator */ + +IDR_ACCELERATOR1 ACCELERATORS DISCARDABLE +BEGIN + VK_F1, IDM_HELP_CONTENTS, VIRTKEY, NOINVERT + VK_F2, IDM_GAME_NEW, VIRTKEY, NOINVERT +END Propchange: trunk/reactos/base/applications/games/solitaire/lang/tr-TR.rc ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/base/applications/games/solitaire/rsrc.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/games/so…
============================================================================== --- trunk/reactos/base/applications/games/solitaire/rsrc.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/games/solitaire/rsrc.rc [iso-8859-1] Sat Mar 2 20:56:12 2013 @@ -81,6 +81,9 @@ #ifdef LANGUAGE_TH_TH #include "lang/th-TH.rc" #endif +#ifdef LANGUAGE_TR_TR + #include "lang/tr-TR.rc" +#endif #ifdef LANGUAGE_UK_UA #include "lang/uk-UA.rc" #endif Added: trunk/reactos/base/applications/games/spider/lang/tr-TR.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/games/sp…
============================================================================== --- trunk/reactos/base/applications/games/spider/lang/tr-TR.rc (added) +++ trunk/reactos/base/applications/games/spider/lang/tr-TR.rc [iso-8859-1] Sat Mar 2 20:56:12 2013 @@ -1,0 +1,86 @@ +/* + * PROJECT: Spider Solitaire + * LICENSE: See COPYING in top level directory + * FILE: base/applications/games/spider/lang/tr-TR.rc + * PURPOSE: Turkish Language File for Spider Solitaire + * TRANSLATOR: Erdem ERSOY (eersoy93) + */ + +LANGUAGE LANG_TURKISH, SUBLANG_DEFAULT + +/* Dialogs */ + +IDD_CARDBACK DIALOGEX 6, 6, 186, 104 +CAPTION "Deste Seç" +FONT 8, "MS Shell Dlg" +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | DS_SHELLFONT +BEGIN + CONTROL "", IDC_CARDBACK1, "Static", SS_NOTIFY, 4, 7, 26, 32 + CONTROL "", IDC_CARDBACK2, "Static", SS_NOTIFY, 34, 7, 26, 32 + CONTROL "", IDC_CARDBACK3, "Static", SS_NOTIFY, 64, 7, 26, 32 + CONTROL "", IDC_CARDBACK4, "Static", SS_NOTIFY, 94, 7, 26, 32 + CONTROL "", IDC_CARDBACK5, "Static", SS_NOTIFY, 124, 7, 26, 32 + CONTROL "", IDC_CARDBACK6, "Static", SS_NOTIFY, 154, 7, 26, 32 + CONTROL "", IDC_CARDBACK7, "Static", SS_NOTIFY, 4, 46, 26, 32 + CONTROL "", IDC_CARDBACK8, "Static", SS_NOTIFY, 34, 46, 26, 32 + CONTROL "", IDC_CARDBACK9, "Static", SS_NOTIFY, 64, 46, 26, 32 + CONTROL "", IDC_CARDBACK10, "Static", SS_NOTIFY, 94, 46, 26, 32 + CONTROL "", IDC_CARDBACK11, "Static", SS_NOTIFY, 124, 46, 26, 32 + CONTROL "", IDC_CARDBACK12, "Static", SS_NOTIFY, 154, 46, 26, 32 + DEFPUSHBUTTON "Tamam", IDOK, 66, 84, 54, 13 + PUSHBUTTON "Vazgeç", IDCANCEL, 126, 84, 54, 13 +END + +IDD_DIFFICULTY DIALOGEX DISCARDABLE 100, 100, 106, 80 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | DS_SHELLFONT +CAPTION "Zorluk" +FONT 8, "MS Shell Dlg" +BEGIN + AUTORADIOBUTTON "Kolay: &Tek renk", IDC_DIF_ONECOLOR, 8, 10, 80, 10, WS_GROUP | WS_TABSTOP + AUTORADIOBUTTON "Orta: &Ä°ki renk", IDC_DIF_TWOCOLORS, 8, 23, 80, 10 + AUTORADIOBUTTON "Zor: &Dört Renk", IDC_DIF_FOURCOLORS, 8, 36, 80, 10 + + DEFPUSHBUTTON "Tamam", IDOK, 8, 58, 40, 14 + PUSHBUTTON "Vazgeç", IDCANCEL, 58, 58, 40, 14 +END + +/* Strings */ + +STRINGTABLE +BEGIN + IDS_SPI_NAME "Spider" + IDS_SPI_ABOUT "Spider Solitaire Gregor Schneider tarafından yapılmıÅtır.\n\nCardLib sürümü: 1.0" + IDS_SPI_QUIT "Bu oyundan çıkmak ister misiniz?" + IDS_SPI_WIN "Tebrikler, kazandınız!" + IDS_SPI_DEAL "Tekrar daÄıtılsın mı?" +END + + +/* Menus */ + +IDR_MENU1 MENU DISCARDABLE +BEGIN + POPUP "&Oyun" + BEGIN + MENUITEM "&Yeni oyun\tF2", IDM_GAME_NEW + MENUITEM SEPARATOR + MENUITEM "&Desteler", IDM_GAME_DECK + MENUITEM SEPARATOR + MENUITEM "&ÃıkıÅ", IDM_GAME_EXIT + END + POPUP "&Yardım" + BEGIN + MENUITEM "&İçerik\tF1", IDM_HELP_CONTENTS + MENUITEM "&Hakkında", IDM_HELP_ABOUT + END +END + + + +/* Accelerator */ + +IDR_ACCELERATOR1 ACCELERATORS DISCARDABLE +BEGIN + VK_F1, IDM_HELP_CONTENTS, VIRTKEY, NOINVERT + VK_F2, IDM_GAME_NEW, VIRTKEY, NOINVERT +END Propchange: trunk/reactos/base/applications/games/spider/lang/tr-TR.rc ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/base/applications/games/spider/rsrc.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/games/sp…
============================================================================== --- trunk/reactos/base/applications/games/spider/rsrc.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/games/spider/rsrc.rc [iso-8859-1] Sat Mar 2 20:56:12 2013 @@ -57,6 +57,9 @@ #ifdef LANGUAGE_SV_SE #include "lang/sv-SE.rc" #endif +#ifdef LANGUAGE_TR_TR + #include "lang/tr-TR.rc" +#endif #ifdef LANGUAGE_UK_UA #include "lang/uk-UA.rc" #endif
11 years, 9 months
1
0
0
0
[hbelusca] 58408: [PAINT] - Fix the "grey panel" bug when doing File --> New. - Add the possibility, when doing File --> New, to save the drawing the user did before actually reset it, and take int...
by hbelusca@svn.reactos.org
Author: hbelusca Date: Sat Mar 2 20:44:09 2013 New Revision: 58408 URL:
http://svn.reactos.org/svn/reactos?rev=58408&view=rev
Log: [PAINT] - Fix the "grey panel" bug when doing File --> New. - Add the possibility, when doing File --> New, to save the drawing the user did before actually reset it, and take into account whether he/she cancels the operation in the middle. Patch by Marco Vaiano, slightly modified by me. CORE-5642 #resolve #comment Committed in revision r58408. Thanks :) Modified: trunk/reactos/base/applications/mspaint/winproc.c Modified: trunk/reactos/base/applications/mspaint/winproc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mspaint/…
============================================================================== --- trunk/reactos/base/applications/mspaint/winproc.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/mspaint/winproc.c [iso-8859-1] Sat Mar 2 20:44:09 2013 @@ -710,12 +710,38 @@ SendMessage(hwnd, WM_CLOSE, wParam, lParam); break; case IDM_FILENEW: - ShowWindow(hSelection, SW_HIDE); - clearHistory(); - - Rectangle(hDrawingDC, 0 - 1, 0 - 1, imgXRes + 1, imgYRes + 1); - SendMessage(hImageArea, WM_PAINT, 0, 0); - break; + { + BOOL reset = TRUE; + if (!imageSaved) + { + TCHAR programname[20]; + TCHAR saveprompttext[100]; + TCHAR temptext[500]; + LoadString(hProgInstance, IDS_PROGRAMNAME, programname, SIZEOF(programname)); + LoadString(hProgInstance, IDS_SAVEPROMPTTEXT, saveprompttext, SIZEOF(saveprompttext)); + _stprintf(temptext, saveprompttext, filename); + switch (MessageBox(hwnd, temptext, programname, MB_YESNOCANCEL | MB_ICONQUESTION)) + { + case IDNO: + imageSaved = TRUE; + break; + case IDYES: + SendMessage(hwnd, WM_COMMAND, IDM_FILESAVEAS, 0); + break; + case IDCANCEL: + reset = FALSE; + break; + } + } + if (reset && imageSaved) + { + Rectangle(hDrawingDC, 0 - 1, 0 - 1, imgXRes + 1, imgYRes + 1); + SendMessage(hImageArea, WM_PAINT, 0, 0); + updateCanvasAndScrollbars(); + clearHistory(); + } + break; + } case IDM_FILEOPEN: if (GetOpenFileName(&ofn) != 0) {
11 years, 9 months
1
0
0
0
[akhaldi] 58407: [PSDK] * Annotate aclapi.h.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sat Mar 2 20:40:44 2013 New Revision: 58407 URL:
http://svn.reactos.org/svn/reactos?rev=58407&view=rev
Log: [PSDK] * Annotate aclapi.h. Modified: trunk/reactos/include/psdk/aclapi.h Modified: trunk/reactos/include/psdk/aclapi.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/aclapi.h?rev=…
============================================================================== --- trunk/reactos/include/psdk/aclapi.h [iso-8859-1] (original) +++ trunk/reactos/include/psdk/aclapi.h [iso-8859-1] Sat Mar 2 20:40:44 2013 @@ -8,64 +8,196 @@ extern "C" { #endif -VOID WINAPI BuildExplicitAccessWithNameA(PEXPLICIT_ACCESS_A,LPSTR,DWORD,ACCESS_MODE,DWORD); -VOID WINAPI BuildExplicitAccessWithNameW(PEXPLICIT_ACCESS_W,LPWSTR,DWORD,ACCESS_MODE,DWORD); -DWORD WINAPI BuildSecurityDescriptorA(PTRUSTEE_A,PTRUSTEE_A ,ULONG,PEXPLICIT_ACCESS_A, - ULONG,PEXPLICIT_ACCESS_A,PSECURITY_DESCRIPTOR,PULONG,PSECURITY_DESCRIPTOR*); -DWORD WINAPI BuildSecurityDescriptorW(PTRUSTEE_W,PTRUSTEE_W ,ULONG,PEXPLICIT_ACCESS_W, - ULONG,PEXPLICIT_ACCESS_W,PSECURITY_DESCRIPTOR,PULONG,PSECURITY_DESCRIPTOR*); -VOID WINAPI BuildTrusteeWithNameA(PTRUSTEE_A,LPSTR); -VOID WINAPI BuildTrusteeWithNameW(PTRUSTEE_W,LPWSTR); -VOID WINAPI BuildTrusteeWithObjectsAndNameA(PTRUSTEE_A,POBJECTS_AND_NAME_A,SE_OBJECT_TYPE, - LPSTR,LPSTR,LPSTR); -VOID WINAPI BuildTrusteeWithObjectsAndNameW(PTRUSTEE_W,POBJECTS_AND_NAME_W,SE_OBJECT_TYPE, - LPWSTR,LPWSTR,LPWSTR); -VOID WINAPI BuildTrusteeWithObjectsAndSidA(PTRUSTEE_A,POBJECTS_AND_SID,GUID*,GUID*,PSID); -VOID WINAPI BuildTrusteeWithObjectsAndSidW(PTRUSTEE_W,POBJECTS_AND_SID,GUID*,GUID*,PSID); -VOID WINAPI BuildTrusteeWithSidA(PTRUSTEE_A,PSID); -VOID WINAPI BuildTrusteeWithSidW(PTRUSTEE_W,PSID); +VOID WINAPI BuildExplicitAccessWithNameA(_Inout_ PEXPLICIT_ACCESS_A, _In_opt_ LPSTR, _In_ DWORD, _In_ ACCESS_MODE, _In_ DWORD); +VOID WINAPI BuildExplicitAccessWithNameW(_Inout_ PEXPLICIT_ACCESS_W, _In_opt_ LPWSTR, _In_ DWORD, _In_ ACCESS_MODE, _In_ DWORD); + +DWORD +WINAPI +BuildSecurityDescriptorA( + _In_opt_ PTRUSTEE_A pOwner, + _In_opt_ PTRUSTEE_A pGroup, + _In_ ULONG cCountOfAccessEntries, + _In_reads_opt_(cCountOfAccessEntries) PEXPLICIT_ACCESS_A pListOfAccessEntries, + _In_ ULONG cCountOfAuditEntries, + _In_reads_opt_(cCountOfAuditEntries) PEXPLICIT_ACCESS_A pListOfAuditEntries, + _In_opt_ PSECURITY_DESCRIPTOR pOldSD, + _Out_ PULONG pSizeNewSD, + _Outptr_result_bytebuffer_(*pSizeNewSD) PSECURITY_DESCRIPTOR *pNewSD); + +DWORD +WINAPI +BuildSecurityDescriptorW( + _In_opt_ PTRUSTEE_W pOwner, + _In_opt_ PTRUSTEE_W pGroup, + _In_ ULONG cCountOfAccessEntries, + _In_reads_opt_(cCountOfAccessEntries) PEXPLICIT_ACCESS_W pListOfAccessEntries, + _In_ ULONG cCountOfAuditEntries, + _In_reads_opt_(cCountOfAuditEntries) PEXPLICIT_ACCESS_W pListOfAuditEntries, + _In_opt_ PSECURITY_DESCRIPTOR pOldSD, + _Out_ PULONG pSizeNewSD, + _Outptr_result_bytebuffer_(*pSizeNewSD) PSECURITY_DESCRIPTOR *pNewSD); + +VOID WINAPI BuildTrusteeWithNameA(_Inout_ PTRUSTEE_A, _In_opt_ LPSTR); +VOID WINAPI BuildTrusteeWithNameW(_Inout_ PTRUSTEE_W, _In_opt_ LPWSTR); +VOID WINAPI BuildTrusteeWithObjectsAndNameA(_Inout_ PTRUSTEE_A, _In_opt_ POBJECTS_AND_NAME_A, _In_opt_ SE_OBJECT_TYPE, _In_opt_ LPSTR, _In_opt_ LPSTR, _In_opt_ LPSTR); +VOID WINAPI BuildTrusteeWithObjectsAndNameW(_Inout_ PTRUSTEE_W, _In_opt_ POBJECTS_AND_NAME_W, _In_opt_ SE_OBJECT_TYPE, _In_opt_ LPWSTR, _In_opt_ LPWSTR, _In_opt_ LPWSTR); +VOID WINAPI BuildTrusteeWithObjectsAndSidA(_Inout_ PTRUSTEE_A, _In_opt_ POBJECTS_AND_SID, _In_opt_ GUID*, _In_opt_ GUID*, _In_opt_ PSID); +VOID WINAPI BuildTrusteeWithObjectsAndSidW(_Inout_ PTRUSTEE_W, _In_opt_ POBJECTS_AND_SID, _In_opt_ GUID*, _In_opt_ GUID*, _In_opt_ PSID); +VOID WINAPI BuildTrusteeWithSidA(_Inout_ PTRUSTEE_A, _In_opt_ PSID); +VOID WINAPI BuildTrusteeWithSidW(_Inout_ PTRUSTEE_W, _In_opt_ PSID); + #if (_WIN32_WINNT >= 0x0501) -DWORD WINAPI FreeInheritedFromArray(PINHERITED_FROMW,USHORT,PFN_OBJECT_MGR_FUNCTS); -#endif -DWORD WINAPI GetAuditedPermissionsFromAclA(PACL,PTRUSTEE_A,PACCESS_MASK,PACCESS_MASK); -DWORD WINAPI GetAuditedPermissionsFromAclW(PACL,PTRUSTEE_W,PACCESS_MASK,PACCESS_MASK); -DWORD WINAPI GetEffectiveRightsFromAclA(PACL,PTRUSTEE_A,PACCESS_MASK); -DWORD WINAPI GetEffectiveRightsFromAclW(PACL,PTRUSTEE_W,PACCESS_MASK); -DWORD WINAPI GetExplicitEntriesFromAclA(PACL,PULONG,PEXPLICIT_ACCESS_A*); -DWORD WINAPI GetExplicitEntriesFromAclW(PACL,PULONG,PEXPLICIT_ACCESS_W*); +DWORD +WINAPI +FreeInheritedFromArray( + _In_reads_(AceCnt) PINHERITED_FROMW pInheritArray, + _In_ USHORT AceCnt, + _In_opt_ PFN_OBJECT_MGR_FUNCTS pfnArray); +#endif + +DWORD WINAPI GetAuditedPermissionsFromAclA(_In_ PACL, _In_ PTRUSTEE_A, _Out_ PACCESS_MASK, _Out_ PACCESS_MASK); +DWORD WINAPI GetAuditedPermissionsFromAclW(_In_ PACL, _In_ PTRUSTEE_W, _Out_ PACCESS_MASK, _Out_ PACCESS_MASK); +DWORD WINAPI GetEffectiveRightsFromAclA(_In_ PACL, _In_ PTRUSTEE_A, _Out_ PACCESS_MASK); +DWORD WINAPI GetEffectiveRightsFromAclW(_In_ PACL, _In_ PTRUSTEE_W, _Out_ PACCESS_MASK); + +DWORD +WINAPI +GetExplicitEntriesFromAclA( + _In_ PACL pacl, + _Out_ PULONG pcCountOfExplicitEntries, + _Outptr_result_buffer_(*pcCountOfExplicitEntries) PEXPLICIT_ACCESS_A *pListOfExplicitEntries); + +DWORD +WINAPI +GetExplicitEntriesFromAclW( + _In_ PACL pacl, + _Out_ PULONG pcCountOfExplicitEntries, + _Outptr_result_buffer_(*pcCountOfExplicitEntries) PEXPLICIT_ACCESS_W *pListOfExplicitEntries); + #if (_WIN32_WINNT >= 0x0501) -DWORD WINAPI GetInheritanceSourceA(LPSTR,SE_OBJECT_TYPE,SECURITY_INFORMATION,BOOL,GUID**,DWORD,PACL,PFN_OBJECT_MGR_FUNCTS,PGENERIC_MAPPING,PINHERITED_FROMA); -DWORD WINAPI GetInheritanceSourceW(LPWSTR,SE_OBJECT_TYPE,SECURITY_INFORMATION,BOOL,GUID**,DWORD,PACL,PFN_OBJECT_MGR_FUNCTS,PGENERIC_MAPPING,PINHERITED_FROMW); -#endif -DWORD WINAPI GetNamedSecurityInfoA(LPSTR,SE_OBJECT_TYPE,SECURITY_INFORMATION, - PSID*,PSID*,PACL*,PACL*,PSECURITY_DESCRIPTOR*); -DWORD WINAPI GetNamedSecurityInfoW(LPWSTR,SE_OBJECT_TYPE,SECURITY_INFORMATION, - PSID*,PSID*,PACL*,PACL*,PSECURITY_DESCRIPTOR*); -DWORD WINAPI GetSecurityInfo(HANDLE,SE_OBJECT_TYPE,SECURITY_INFORMATION, - PSID*,PSID*,PACL*,PACL*,PSECURITY_DESCRIPTOR*); -TRUSTEE_FORM WINAPI GetTrusteeFormA(PTRUSTEE_A); -TRUSTEE_FORM WINAPI GetTrusteeFormW(PTRUSTEE_W); -LPSTR WINAPI GetTrusteeNameA(PTRUSTEE_A); -LPWSTR WINAPI GetTrusteeNameW(PTRUSTEE_W); -TRUSTEE_TYPE WINAPI GetTrusteeTypeA(PTRUSTEE_A); -TRUSTEE_TYPE WINAPI GetTrusteeTypeW(PTRUSTEE_W); -DWORD WINAPI LookupSecurityDescriptorPartsA(PTRUSTEE_A*,PTRUSTEE_A*,PULONG,PEXPLICIT_ACCESS_A*, - PULONG,PEXPLICIT_ACCESS_A*,PSECURITY_DESCRIPTOR); -DWORD WINAPI LookupSecurityDescriptorPartsW(PTRUSTEE_W*,PTRUSTEE_W*,PULONG,PEXPLICIT_ACCESS_W*, - PULONG,PEXPLICIT_ACCESS_W*,PSECURITY_DESCRIPTOR); -DWORD WINAPI SetEntriesInAclA(ULONG,PEXPLICIT_ACCESS_A,PACL,PACL*); -DWORD WINAPI SetEntriesInAclW(ULONG,PEXPLICIT_ACCESS_W,PACL,PACL*); -DWORD WINAPI SetNamedSecurityInfoA(LPSTR,SE_OBJECT_TYPE,SECURITY_INFORMATION,PSID,PSID,PACL,PACL); -DWORD WINAPI SetNamedSecurityInfoW(LPWSTR,SE_OBJECT_TYPE,SECURITY_INFORMATION,PSID,PSID,PACL,PACL); -DWORD WINAPI SetSecurityInfo(HANDLE,SE_OBJECT_TYPE,SECURITY_INFORMATION,PSID,PSID,PACL,PACL); -VOID WINAPI BuildImpersonateExplicitAccessWithNameA(PEXPLICIT_ACCESS_A,LPSTR,PTRUSTEE_A,DWORD,ACCESS_MODE,DWORD); -VOID WINAPI BuildImpersonateExplicitAccessWithNameW(PEXPLICIT_ACCESS_W,LPWSTR,PTRUSTEE_W,DWORD,ACCESS_MODE,DWORD); -VOID WINAPI BuildImpersonateTrusteeA(PTRUSTEE_A,PTRUSTEE_A); -VOID WINAPI BuildImpersonateTrusteeW(PTRUSTEE_W,PTRUSTEE_W); -PTRUSTEE_A WINAPI GetMultipleTrusteeA(PTRUSTEE_A); -PTRUSTEE_W WINAPI GetMultipleTrusteeW(PTRUSTEE_W); -MULTIPLE_TRUSTEE_OPERATION WINAPI GetMultipleTrusteeOperationA(PTRUSTEE_A); -MULTIPLE_TRUSTEE_OPERATION WINAPI GetMultipleTrusteeOperationW(PTRUSTEE_W); + +DWORD +WINAPI +GetInheritanceSourceA( + _In_ LPSTR pObjectName, + _In_ SE_OBJECT_TYPE ObjectType, + _In_ SECURITY_INFORMATION SecurityInfo, + _In_ BOOL Container, + _In_reads_opt_(GuidCount) GUID **pObjectClassGuids, + _In_ DWORD GuidCount, + _In_ PACL pAcl, + _In_opt_ PFN_OBJECT_MGR_FUNCTS pfnArray, + _In_ PGENERIC_MAPPING pGenericMapping, + _Out_ PINHERITED_FROMA pInheritArray); + +DWORD +WINAPI +GetInheritanceSourceW( + _In_ LPWSTR pObjectName, + _In_ SE_OBJECT_TYPE ObjectType, + _In_ SECURITY_INFORMATION SecurityInfo, + _In_ BOOL Container, + _In_reads_opt_(GuidCount) GUID **pObjectClassGuids, + _In_ DWORD GuidCount, + _In_ PACL pAcl, + _In_opt_ PFN_OBJECT_MGR_FUNCTS pfnArray, + _In_ PGENERIC_MAPPING pGenericMapping, + _Out_ PINHERITED_FROMW pInheritArray); + +#endif + +DWORD +WINAPI +GetNamedSecurityInfoA( + _In_ LPSTR pObjectName, + _In_ SE_OBJECT_TYPE ObjectType, + _In_ SECURITY_INFORMATION SecurityInfo, + _Out_opt_ PSID *ppsidOwner, + _Out_opt_ PSID *ppsidGroup, + _Out_opt_ PACL *ppDacl, + _Out_opt_ PACL *ppSacl, + _Out_ PSECURITY_DESCRIPTOR *ppSecurityDescriptor); + +DWORD +WINAPI +GetNamedSecurityInfoW( + _In_ LPWSTR pObjectName, + _In_ SE_OBJECT_TYPE ObjectType, + _In_ SECURITY_INFORMATION SecurityInfo, + _Out_opt_ PSID *ppsidOwner, + _Out_opt_ PSID *ppsidGroup, + _Out_opt_ PACL *ppDacl, + _Out_opt_ PACL *ppSacl, + _Out_ PSECURITY_DESCRIPTOR *ppSecurityDescriptor); + +DWORD +WINAPI +GetSecurityInfo( + _In_ HANDLE handle, + _In_ SE_OBJECT_TYPE ObjectType, + _In_ SECURITY_INFORMATION SecurityInfo, + _Out_opt_ PSID *ppsidOwner, + _Out_opt_ PSID *ppsidGroup, + _Out_opt_ PACL *ppDacl, + _Out_opt_ PACL *ppSacl, + _Out_opt_ PSECURITY_DESCRIPTOR *ppSecurityDescriptor); + +TRUSTEE_FORM WINAPI GetTrusteeFormA(_In_ PTRUSTEE_A); +TRUSTEE_FORM WINAPI GetTrusteeFormW(_In_ PTRUSTEE_W); +LPSTR WINAPI GetTrusteeNameA(_In_ PTRUSTEE_A); +LPWSTR WINAPI GetTrusteeNameW(_In_ PTRUSTEE_W); +TRUSTEE_TYPE WINAPI GetTrusteeTypeA(_In_opt_ PTRUSTEE_A); +TRUSTEE_TYPE WINAPI GetTrusteeTypeW(_In_opt_ PTRUSTEE_W); + +DWORD +WINAPI +LookupSecurityDescriptorPartsA( + _Out_opt_ PTRUSTEE_A *ppOwner, + _Out_opt_ PTRUSTEE_A *ppGroup, + _Out_opt_ PULONG pcCountOfAccessEntries, + _Outptr_result_buffer_maybenull_(*pcCountOfAccessEntries) PEXPLICIT_ACCESS_A *ppListOfAccessEntries, + _Out_opt_ PULONG pcCountOfAuditEntries, + _Outptr_result_buffer_maybenull_(*pcCountOfAuditEntries) PEXPLICIT_ACCESS_A *ppListOfAuditEntries, + _In_ PSECURITY_DESCRIPTOR pSD); + +DWORD +WINAPI +LookupSecurityDescriptorPartsW( + _Out_opt_ PTRUSTEE_W *ppOwner, + _Out_opt_ PTRUSTEE_W *ppGroup, + _Out_opt_ PULONG pcCountOfAccessEntries, + _Outptr_result_buffer_maybenull_(*pcCountOfAccessEntries) PEXPLICIT_ACCESS_W *ppListOfAccessEntries, + _Out_opt_ PULONG pcCountOfAuditEntries, + _Outptr_result_buffer_maybenull_(*pcCountOfAuditEntries) PEXPLICIT_ACCESS_W *ppListOfAuditEntries, + _In_ PSECURITY_DESCRIPTOR pSD); + +DWORD +WINAPI +SetEntriesInAclA( + _In_ ULONG cCountOfExplicitEntries, + _In_reads_opt_(cCountOfExplicitEntries) PEXPLICIT_ACCESS_A pListOfExplicitEntries, + _In_opt_ PACL OldAcl, + _Out_ PACL *NewAcl); + +DWORD +WINAPI +SetEntriesInAclW( + _In_ ULONG cCountOfExplicitEntries, + _In_reads_opt_(cCountOfExplicitEntries) PEXPLICIT_ACCESS_W pListOfExplicitEntries, + _In_opt_ PACL OldAcl, + _Out_ PACL *NewAcl); + +DWORD WINAPI SetNamedSecurityInfoA(_In_ LPSTR, _In_ SE_OBJECT_TYPE, _In_ SECURITY_INFORMATION, _In_opt_ PSID, _In_opt_ PSID, _In_opt_ PACL, _In_opt_ PACL); +DWORD WINAPI SetNamedSecurityInfoW(_In_ LPWSTR, _In_ SE_OBJECT_TYPE, _In_ SECURITY_INFORMATION, _In_opt_ PSID, _In_opt_ PSID, _In_opt_ PACL, _In_opt_ PACL); +DWORD WINAPI SetSecurityInfo(_In_ HANDLE, _In_ SE_OBJECT_TYPE, _In_ SECURITY_INFORMATION, _In_opt_ PSID, _In_opt_ PSID, _In_opt_ PACL, _In_opt_ PACL); +VOID WINAPI BuildImpersonateExplicitAccessWithNameA(_Inout_ PEXPLICIT_ACCESS_A, _In_opt_ LPSTR, _In_opt_ PTRUSTEE_A, _In_ DWORD, _In_ ACCESS_MODE, _In_ DWORD); +VOID WINAPI BuildImpersonateExplicitAccessWithNameW(_Inout_ PEXPLICIT_ACCESS_W, _In_opt_ LPWSTR, _In_opt_ PTRUSTEE_W, _In_ DWORD, _In_ ACCESS_MODE, _In_ DWORD); +VOID WINAPI BuildImpersonateTrusteeA(_Inout_ PTRUSTEE_A, _In_opt_ PTRUSTEE_A); +VOID WINAPI BuildImpersonateTrusteeW(_Inout_ PTRUSTEE_W, _In_opt_ PTRUSTEE_W); +PTRUSTEE_A WINAPI GetMultipleTrusteeA(_In_opt_ PTRUSTEE_A); +PTRUSTEE_W WINAPI GetMultipleTrusteeW(_In_opt_ PTRUSTEE_W); +MULTIPLE_TRUSTEE_OPERATION WINAPI GetMultipleTrusteeOperationA(_In_opt_ PTRUSTEE_A); +MULTIPLE_TRUSTEE_OPERATION WINAPI GetMultipleTrusteeOperationW(_In_opt_ PTRUSTEE_W); #ifdef UNICODE #define BuildExplicitAccessWithName BuildExplicitAccessWithNameW
11 years, 9 months
1
0
0
0
[ekohl] 58406: [WINLOGON] Formatting. No code changes.
by ekohl@svn.reactos.org
Author: ekohl Date: Sat Mar 2 20:30:36 2013 New Revision: 58406 URL:
http://svn.reactos.org/svn/reactos?rev=58406&view=rev
Log: [WINLOGON] Formatting. No code changes. Modified: trunk/reactos/base/system/winlogon/screensaver.c trunk/reactos/base/system/winlogon/setup.c trunk/reactos/base/system/winlogon/winlogon.c trunk/reactos/base/system/winlogon/winlogon.h Modified: trunk/reactos/base/system/winlogon/screensaver.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/winlogon/scree…
============================================================================== --- trunk/reactos/base/system/winlogon/screensaver.c [iso-8859-1] (original) +++ trunk/reactos/base/system/winlogon/screensaver.c [iso-8859-1] Sat Mar 2 20:30:36 2013 @@ -15,348 +15,362 @@ /* FUNCTIONS ****************************************************************/ #ifndef USE_GETLASTINPUTINFO -static LRESULT CALLBACK -KeyboardActivityProc( - IN INT nCode, - IN WPARAM wParam, - IN LPARAM lParam) -{ - InterlockedExchange((LONG*)&WLSession->LastActivity, ((PKBDLLHOOKSTRUCT)lParam)->time); - return CallNextHookEx(NULL, nCode, wParam, lParam); -} - -static LRESULT CALLBACK -MouseActivityProc( - IN INT nCode, - IN WPARAM wParam, - IN LPARAM lParam) -{ - InterlockedExchange((LONG*)&WLSession->LastActivity, ((PMSLLHOOKSTRUCT)lParam)->time); - return CallNextHookEx(NULL, nCode, wParam, lParam); -} -#endif - -static VOID -LoadScreenSaverParameters( - OUT LPDWORD Timeout) -{ - BOOL Enabled; - - if (!SystemParametersInfoW(SPI_GETSCREENSAVETIMEOUT, 0, Timeout, 0)) - { - WARN("WL: Unable to get screen saver timeout (error %lu). Disabling it\n", GetLastError()); - *Timeout = INFINITE; - } - else if (!SystemParametersInfoW(SPI_GETSCREENSAVEACTIVE, 0, &Enabled, 0)) - { - WARN("WL: Unable to check if screen saver is enabled (error %lu). Disabling it\n", GetLastError()); - *Timeout = INFINITE; - } - else if (!Enabled) - { - TRACE("WL: Screen saver is disabled\n"); - *Timeout = INFINITE; - } - else - { - TRACE("WL: Screen saver timeout: %lu seconds\n", *Timeout); - *Timeout *= 1000; - } -} - -static DWORD WINAPI -ScreenSaverThreadMain( - IN LPVOID lpParameter) -{ - PWLSESSION Session = (PWLSESSION)lpParameter; - HANDLE HandleArray[3]; +static +LRESULT +CALLBACK +KeyboardActivityProc(IN INT nCode, + IN WPARAM wParam, + IN LPARAM lParam) +{ + InterlockedExchange((LONG*)&WLSession->LastActivity, ((PKBDLLHOOKSTRUCT)lParam)->time); + return CallNextHookEx(NULL, nCode, wParam, lParam); +} + + +static +LRESULT +CALLBACK +MouseActivityProc(IN INT nCode, + IN WPARAM wParam, + IN LPARAM lParam) +{ + InterlockedExchange((LONG*)&WLSession->LastActivity, ((PMSLLHOOKSTRUCT)lParam)->time); + return CallNextHookEx(NULL, nCode, wParam, lParam); +} +#endif + + +static +VOID +LoadScreenSaverParameters(OUT LPDWORD Timeout) +{ + BOOL Enabled; + + if (!SystemParametersInfoW(SPI_GETSCREENSAVETIMEOUT, 0, Timeout, 0)) + { + WARN("WL: Unable to get screen saver timeout (error %lu). Disabling it\n", GetLastError()); + *Timeout = INFINITE; + } + else if (!SystemParametersInfoW(SPI_GETSCREENSAVEACTIVE, 0, &Enabled, 0)) + { + WARN("WL: Unable to check if screen saver is enabled (error %lu). Disabling it\n", GetLastError()); + *Timeout = INFINITE; + } + else if (!Enabled) + { + TRACE("WL: Screen saver is disabled\n"); + *Timeout = INFINITE; + } + else + { + TRACE("WL: Screen saver timeout: %lu seconds\n", *Timeout); + *Timeout *= 1000; + } +} + + +static +DWORD +WINAPI +ScreenSaverThreadMain(IN LPVOID lpParameter) +{ + PWLSESSION Session = (PWLSESSION)lpParameter; + HANDLE HandleArray[3]; #ifdef USE_GETLASTINPUTINFO - LASTINPUTINFO lastInputInfo; + LASTINPUTINFO lastInputInfo; #else - DWORD LastActivity; -#endif - DWORD TimeToWait; - DWORD Timeout; /* Timeout before screen saver starts, in milliseconds */ - DWORD ret; - - if (!ImpersonateLoggedOnUser(Session->UserToken)) - { - ERR("ImpersonateLoggedOnUser() failed with error %lu\n", GetLastError()); - return 0; - } - - Session->hUserActivity = CreateEventW(NULL, FALSE, FALSE, NULL); - if (!Session->hUserActivity) - { - ERR("WL: Unable to create event (error %lu)\n", GetLastError()); - goto cleanup; - } - - Session->hEndOfScreenSaver = CreateEventW(NULL, FALSE, FALSE, NULL); - if (!Session->hEndOfScreenSaver) - { - ERR("WL: Unable to create event (error %lu)\n", GetLastError()); - goto cleanup; - } - - HandleArray[0] = Session->hEndOfScreenSaverThread; - HandleArray[1] = Session->hScreenSaverParametersChanged; - HandleArray[2] = Session->hEndOfScreenSaver; - - LoadScreenSaverParameters(&Timeout); - -#ifndef USE_GETLASTINPUTINFO - InterlockedExchange((LONG*)&Session->LastActivity, GetTickCount()); + DWORD LastActivity; +#endif + DWORD TimeToWait; + DWORD Timeout; /* Timeout before screen saver starts, in milliseconds */ + DWORD ret; + + if (!ImpersonateLoggedOnUser(Session->UserToken)) + { + ERR("ImpersonateLoggedOnUser() failed with error %lu\n", GetLastError()); + return 0; + } + + Session->hUserActivity = CreateEventW(NULL, FALSE, FALSE, NULL); + if (!Session->hUserActivity) + { + ERR("WL: Unable to create event (error %lu)\n", GetLastError()); + goto cleanup; + } + + Session->hEndOfScreenSaver = CreateEventW(NULL, FALSE, FALSE, NULL); + if (!Session->hEndOfScreenSaver) + { + ERR("WL: Unable to create event (error %lu)\n", GetLastError()); + goto cleanup; + } + + HandleArray[0] = Session->hEndOfScreenSaverThread; + HandleArray[1] = Session->hScreenSaverParametersChanged; + HandleArray[2] = Session->hEndOfScreenSaver; + + LoadScreenSaverParameters(&Timeout); + +#ifndef USE_GETLASTINPUTINFO + InterlockedExchange((LONG*)&Session->LastActivity, GetTickCount()); #else - lastInputInfo.cbSize = sizeof(LASTINPUTINFO); -#endif - for (;;) - { - /* See the time of last activity and calculate a timeout */ -#ifndef USE_GETLASTINPUTINFO - LastActivity = InterlockedCompareExchange((LONG*)&Session->LastActivity, 0, 0); - TimeToWait = Timeout - (GetTickCount() - LastActivity); + lastInputInfo.cbSize = sizeof(LASTINPUTINFO); +#endif + for (;;) + { + /* See the time of last activity and calculate a timeout */ +#ifndef USE_GETLASTINPUTINFO + LastActivity = InterlockedCompareExchange((LONG*)&Session->LastActivity, 0, 0); + TimeToWait = Timeout - (GetTickCount() - LastActivity); #else - if (GetLastInputInfo(&lastInputInfo)) - TimeToWait = Timeout - (GetTickCount() - lastInputInfo.dwTime); - else - { - WARN("GetLastInputInfo() failed with error %lu\n", GetLastError()); - TimeToWait = 10; /* Try again in 10 ms */ - } -#endif - if (TimeToWait > Timeout) - { - /* GetTickCount() got back to 0 */ - TimeToWait = Timeout; - } - - /* Wait for the timeout, or the end of this thread */ - ret = WaitForMultipleObjects(2, HandleArray, FALSE, TimeToWait); - if (ret == WAIT_OBJECT_0) - break; - else if (ret == WAIT_OBJECT_0 + 1) - LoadScreenSaverParameters(&Timeout); - - /* Check if we didn't had recent activity */ -#ifndef USE_GETLASTINPUTINFO - LastActivity = InterlockedCompareExchange((LONG*)&Session->LastActivity, 0, 0); - if (LastActivity + Timeout > GetTickCount()) - continue; + if (GetLastInputInfo(&lastInputInfo)) + TimeToWait = Timeout - (GetTickCount() - lastInputInfo.dwTime); + else + { + WARN("GetLastInputInfo() failed with error %lu\n", GetLastError()); + TimeToWait = 10; /* Try again in 10 ms */ + } +#endif + + if (TimeToWait > Timeout) + { + /* GetTickCount() got back to 0 */ + TimeToWait = Timeout; + } + + /* Wait for the timeout, or the end of this thread */ + ret = WaitForMultipleObjects(2, HandleArray, FALSE, TimeToWait); + if (ret == WAIT_OBJECT_0) + break; + else if (ret == WAIT_OBJECT_0 + 1) + LoadScreenSaverParameters(&Timeout); + + /* Check if we didn't had recent activity */ +#ifndef USE_GETLASTINPUTINFO + LastActivity = InterlockedCompareExchange((LONG*)&Session->LastActivity, 0, 0); + if (LastActivity + Timeout > GetTickCount()) + continue; #else - if (!GetLastInputInfo(&lastInputInfo)) - { - WARN("GetLastInputInfo() failed with error %lu\n", GetLastError()); - continue; - } - if (lastInputInfo.dwTime + Timeout > GetTickCount()) - continue; -#endif - - /* Run screen saver */ - PostMessageW(Session->SASWindow, WLX_WM_SAS, WLX_SAS_TYPE_SCRNSVR_TIMEOUT, 0); - - /* Wait for the end of this thread or of the screen saver */ - ret = WaitForMultipleObjects(3, HandleArray, FALSE, INFINITE); - if (ret == WAIT_OBJECT_0) - break; - else if (ret == WAIT_OBJECT_0 + 1) - LoadScreenSaverParameters(&Timeout); - else if (ret == WAIT_OBJECT_0 + 2) - SystemParametersInfoW(SPI_SETSCREENSAVERRUNNING, FALSE, NULL, 0); - } + if (!GetLastInputInfo(&lastInputInfo)) + { + WARN("GetLastInputInfo() failed with error %lu\n", GetLastError()); + continue; + } + + if (lastInputInfo.dwTime + Timeout > GetTickCount()) + continue; +#endif + + /* Run screen saver */ + PostMessageW(Session->SASWindow, WLX_WM_SAS, WLX_SAS_TYPE_SCRNSVR_TIMEOUT, 0); + + /* Wait for the end of this thread or of the screen saver */ + ret = WaitForMultipleObjects(3, HandleArray, FALSE, INFINITE); + if (ret == WAIT_OBJECT_0) + break; + else if (ret == WAIT_OBJECT_0 + 1) + LoadScreenSaverParameters(&Timeout); + else if (ret == WAIT_OBJECT_0 + 2) + SystemParametersInfoW(SPI_SETSCREENSAVERRUNNING, FALSE, NULL, 0); + } cleanup: - RevertToSelf(); - if (Session->hUserActivity) - CloseHandle(Session->hUserActivity); - if (Session->hEndOfScreenSaver) - CloseHandle(Session->hEndOfScreenSaver); -#ifndef USE_GETLASTINPUTINFO - if (Session->KeyboardHook) - UnhookWindowsHookEx(Session->KeyboardHook); - if (Session->MouseHook) - UnhookWindowsHookEx(Session->MouseHook); -#endif - CloseHandle(Session->hEndOfScreenSaverThread); - CloseHandle(Session->hScreenSaverParametersChanged); - return 0; -} + RevertToSelf(); + if (Session->hUserActivity) + CloseHandle(Session->hUserActivity); + + if (Session->hEndOfScreenSaver) + CloseHandle(Session->hEndOfScreenSaver); + +#ifndef USE_GETLASTINPUTINFO + if (Session->KeyboardHook) + UnhookWindowsHookEx(Session->KeyboardHook); + + if (Session->MouseHook) + UnhookWindowsHookEx(Session->MouseHook); +#endif + + CloseHandle(Session->hEndOfScreenSaverThread); + CloseHandle(Session->hScreenSaverParametersChanged); + return 0; +} + BOOL -InitializeScreenSaver( - IN OUT PWLSESSION Session) -{ - HANDLE ScreenSaverThread; - -#ifndef USE_GETLASTINPUTINFO - /* Register hooks to detect keyboard and mouse activity */ - Session->KeyboardHook = SetWindowsHookEx(WH_KEYBOARD_LL, KeyboardActivityProc, hAppInstance, 0); - if (!Session->KeyboardHook) - { - ERR("WL: Unable to register keyboard hook\n"); - return FALSE; - } - Session->MouseHook = SetWindowsHookEx(WH_MOUSE_LL, MouseActivityProc, hAppInstance, 0); - if (!Session->MouseHook) - { - ERR("WL: Unable to register mouse hook\n"); - return FALSE; - } -#endif - - Session->hScreenSaverParametersChanged = CreateEventW(NULL, FALSE, FALSE, NULL); - if (!Session->hScreenSaverParametersChanged) - { - WARN("WL: Unable to create screen saver event (error %lu)\n", GetLastError()); - return TRUE; - } - Session->hEndOfScreenSaverThread = CreateEventW(NULL, FALSE, FALSE, NULL); - if (!Session->hEndOfScreenSaverThread) - { - WARN("WL: Unable to create screen saver event (error %lu)\n", GetLastError()); - CloseHandle(Session->hScreenSaverParametersChanged); - return TRUE; - } - - ScreenSaverThread = CreateThread( - NULL, - 0, - ScreenSaverThreadMain, - Session, - 0, - NULL); - if (ScreenSaverThread) - CloseHandle(ScreenSaverThread); - else - ERR("WL: Unable to start screen saver thread\n"); - - return TRUE; -} +InitializeScreenSaver(IN OUT PWLSESSION Session) +{ + HANDLE ScreenSaverThread; + +#ifndef USE_GETLASTINPUTINFO + /* Register hooks to detect keyboard and mouse activity */ + Session->KeyboardHook = SetWindowsHookEx(WH_KEYBOARD_LL, KeyboardActivityProc, hAppInstance, 0); + if (!Session->KeyboardHook) + { + ERR("WL: Unable to register keyboard hook\n"); + return FALSE; + } + + Session->MouseHook = SetWindowsHookEx(WH_MOUSE_LL, MouseActivityProc, hAppInstance, 0); + if (!Session->MouseHook) + { + ERR("WL: Unable to register mouse hook\n"); + return FALSE; + } +#endif + + Session->hScreenSaverParametersChanged = CreateEventW(NULL, FALSE, FALSE, NULL); + if (!Session->hScreenSaverParametersChanged) + { + WARN("WL: Unable to create screen saver event (error %lu)\n", GetLastError()); + return TRUE; + } + + Session->hEndOfScreenSaverThread = CreateEventW(NULL, FALSE, FALSE, NULL); + if (!Session->hEndOfScreenSaverThread) + { + WARN("WL: Unable to create screen saver event (error %lu)\n", GetLastError()); + CloseHandle(Session->hScreenSaverParametersChanged); + return TRUE; + } + + ScreenSaverThread = CreateThread(NULL, + 0, + ScreenSaverThreadMain, + Session, + 0, + NULL); + if (ScreenSaverThread) + CloseHandle(ScreenSaverThread); + else + ERR("WL: Unable to start screen saver thread\n"); + + return TRUE; +} + VOID -StartScreenSaver( - IN PWLSESSION Session) -{ - HKEY hKey = NULL, hCurrentUser = NULL; - WCHAR szApplicationName[MAX_PATH]; - WCHAR szCommandLine[MAX_PATH + 3]; - DWORD bufferSize = sizeof(szApplicationName) - sizeof(WCHAR); - DWORD dwType; - STARTUPINFOW StartupInfo; - PROCESS_INFORMATION ProcessInformation; - HANDLE HandleArray[2]; - LONG rc; - DWORD Status; - BOOL ret = FALSE; - - if (!ImpersonateLoggedOnUser(Session->UserToken)) - { - ERR("WL: ImpersonateLoggedOnUser() failed with error %lu\n", GetLastError()); - goto cleanup; - } - - rc = RegOpenCurrentUser( - KEY_READ, - &hCurrentUser); - if (rc != ERROR_SUCCESS) - { - ERR("WL: RegOpenCurrentUser Error!\n"); - goto cleanup; - } - - rc = RegOpenKeyExW( - hCurrentUser, - L"Control Panel\\Desktop", - 0, - KEY_QUERY_VALUE, - &hKey); - if (rc != ERROR_SUCCESS) - { - ERR("WL: RegOpenKeyEx Error!\n"); - goto cleanup; - } - - rc = RegQueryValueExW( - hKey, - L"SCRNSAVE.EXE", - 0, - &dwType, - (LPBYTE)szApplicationName, - &bufferSize); - if (rc != ERROR_SUCCESS || dwType != REG_SZ) - { - ERR("WL: RegQueryValueEx Error!\n"); - goto cleanup; - } - - if (bufferSize == 0) - { - ERR("WL: Buffer size is NULL!\n"); - goto cleanup; - } - - szApplicationName[bufferSize / sizeof(WCHAR)] = 0; /* Terminate the string */ - - if (wcslen(szApplicationName) == 0) - { - ERR("WL: Application Name length is zero!\n"); - goto cleanup; - } - - wsprintfW(szCommandLine, L"%s /s", szApplicationName); - TRACE("WL: Executing %S\n", szCommandLine); - - ZeroMemory(&StartupInfo, sizeof(STARTUPINFOW)); - ZeroMemory(&ProcessInformation, sizeof(PROCESS_INFORMATION)); - StartupInfo.cb = sizeof(STARTUPINFOW); - StartupInfo.dwFlags = STARTF_SCRNSAVER; - /* FIXME: run the screen saver on the screen saver desktop */ - ret = CreateProcessW( - szApplicationName, - szCommandLine, - NULL, - NULL, - FALSE, - 0, - NULL, - NULL, - &StartupInfo, - &ProcessInformation); - if (!ret) - { - ERR("WL: Unable to start %S, error %lu\n", szApplicationName, GetLastError()); - goto cleanup; - } - CloseHandle(ProcessInformation.hThread); - - SystemParametersInfoW(SPI_SETSCREENSAVERRUNNING, TRUE, NULL, 0); - - /* Wait the end of the process or some other activity */ - ResetEvent(Session->hUserActivity); - HandleArray[0] = ProcessInformation.hProcess; - HandleArray[1] = Session->hUserActivity; - Status = WaitForMultipleObjects(2, HandleArray, FALSE, INFINITE); - if (Status == WAIT_OBJECT_0 + 1) - { - /* Kill the screen saver */ - TerminateProcess(ProcessInformation.hProcess, 0); - } - SetEvent(Session->hEndOfScreenSaver); - - CloseHandle(ProcessInformation.hProcess); +StartScreenSaver(IN PWLSESSION Session) +{ + HKEY hKey = NULL, hCurrentUser = NULL; + WCHAR szApplicationName[MAX_PATH]; + WCHAR szCommandLine[MAX_PATH + 3]; + DWORD bufferSize = sizeof(szApplicationName) - sizeof(WCHAR); + DWORD dwType; + STARTUPINFOW StartupInfo; + PROCESS_INFORMATION ProcessInformation; + HANDLE HandleArray[2]; + LONG rc; + DWORD Status; + BOOL ret = FALSE; + + if (!ImpersonateLoggedOnUser(Session->UserToken)) + { + ERR("WL: ImpersonateLoggedOnUser() failed with error %lu\n", GetLastError()); + goto cleanup; + } + + rc = RegOpenCurrentUser(KEY_READ, + &hCurrentUser); + if (rc != ERROR_SUCCESS) + { + ERR("WL: RegOpenCurrentUser Error!\n"); + goto cleanup; + } + + rc = RegOpenKeyExW(hCurrentUser, + L"Control Panel\\Desktop", + 0, + KEY_QUERY_VALUE, + &hKey); + if (rc != ERROR_SUCCESS) + { + ERR("WL: RegOpenKeyEx Error!\n"); + goto cleanup; + } + + rc = RegQueryValueExW(hKey, + L"SCRNSAVE.EXE", + 0, + &dwType, + (LPBYTE)szApplicationName, + &bufferSize); + if (rc != ERROR_SUCCESS || dwType != REG_SZ) + { + ERR("WL: RegQueryValueEx Error!\n"); + goto cleanup; + } + + if (bufferSize == 0) + { + ERR("WL: Buffer size is NULL!\n"); + goto cleanup; + } + + szApplicationName[bufferSize / sizeof(WCHAR)] = 0; /* Terminate the string */ + + if (wcslen(szApplicationName) == 0) + { + ERR("WL: Application Name length is zero!\n"); + goto cleanup; + } + + wsprintfW(szCommandLine, L"%s /s", szApplicationName); + TRACE("WL: Executing %S\n", szCommandLine); + + ZeroMemory(&StartupInfo, sizeof(STARTUPINFOW)); + ZeroMemory(&ProcessInformation, sizeof(PROCESS_INFORMATION)); + StartupInfo.cb = sizeof(STARTUPINFOW); + StartupInfo.dwFlags = STARTF_SCRNSAVER; + + /* FIXME: run the screen saver on the screen saver desktop */ + ret = CreateProcessW(szApplicationName, + szCommandLine, + NULL, + NULL, + FALSE, + 0, + NULL, + NULL, + &StartupInfo, + &ProcessInformation); + if (!ret) + { + ERR("WL: Unable to start %S, error %lu\n", szApplicationName, GetLastError()); + goto cleanup; + } + + CloseHandle(ProcessInformation.hThread); + + SystemParametersInfoW(SPI_SETSCREENSAVERRUNNING, TRUE, NULL, 0); + + /* Wait the end of the process or some other activity */ + ResetEvent(Session->hUserActivity); + HandleArray[0] = ProcessInformation.hProcess; + HandleArray[1] = Session->hUserActivity; + Status = WaitForMultipleObjects(2, HandleArray, FALSE, INFINITE); + if (Status == WAIT_OBJECT_0 + 1) + { + /* Kill the screen saver */ + TerminateProcess(ProcessInformation.hProcess, 0); + } + + SetEvent(Session->hEndOfScreenSaver); + + CloseHandle(ProcessInformation.hProcess); cleanup: - RevertToSelf(); - if (hKey) - RegCloseKey(hKey); - if (hCurrentUser) - RegCloseKey(hCurrentUser); - if (!ret) - { - PostMessageW(Session->SASWindow, WLX_WM_SAS, WLX_SAS_TYPE_SCRNSVR_ACTIVITY, 0); -#ifndef USE_GETLASTINPUTINFO - InterlockedExchange((LONG*)&Session->LastActivity, GetTickCount()); -#endif - } -} + RevertToSelf(); + if (hKey) + RegCloseKey(hKey); + + if (hCurrentUser) + RegCloseKey(hCurrentUser); + + if (!ret) + { + PostMessageW(Session->SASWindow, WLX_WM_SAS, WLX_SAS_TYPE_SCRNSVR_ACTIVITY, 0); +#ifndef USE_GETLASTINPUTINFO + InterlockedExchange((LONG*)&Session->LastActivity, GetTickCount()); +#endif + } +} Modified: trunk/reactos/base/system/winlogon/setup.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/winlogon/setup…
============================================================================== --- trunk/reactos/base/system/winlogon/setup.c [iso-8859-1] (original) +++ trunk/reactos/base/system/winlogon/setup.c [iso-8859-1] Sat Mar 2 20:30:36 2013 @@ -17,142 +17,147 @@ DWORD GetSetupType(VOID) { - DWORD dwError; - HKEY hKey; - DWORD dwType; - DWORD dwSize; - DWORD dwSetupType; + DWORD dwError; + HKEY hKey; + DWORD dwType; + DWORD dwSize; + DWORD dwSetupType; - TRACE("GetSetupType()\n"); + TRACE("GetSetupType()\n"); - /* Open key */ - dwError = RegOpenKeyExW( - HKEY_LOCAL_MACHINE, - L"SYSTEM\\Setup", - 0, - KEY_QUERY_VALUE, - &hKey); - if (dwError != ERROR_SUCCESS) - return 0; + /* Open key */ + dwError = RegOpenKeyExW(HKEY_LOCAL_MACHINE, + L"SYSTEM\\Setup", + 0, + KEY_QUERY_VALUE, + &hKey); + if (dwError != ERROR_SUCCESS) + return 0; - /* Read key */ - dwSize = sizeof(DWORD); - dwError = RegQueryValueExW( - hKey, - L"SetupType", - NULL, - &dwType, - (LPBYTE)&dwSetupType, - &dwSize); + /* Read key */ + dwSize = sizeof(DWORD); + dwError = RegQueryValueExW(hKey, + L"SetupType", + NULL, + &dwType, + (LPBYTE)&dwSetupType, + &dwSize); - /* Close key, and check if returned values are correct */ - RegCloseKey(hKey); - if (dwError != ERROR_SUCCESS || dwType != REG_DWORD || dwSize != sizeof(DWORD)) - return 0; + /* Close key, and check if returned values are correct */ + RegCloseKey(hKey); + if (dwError != ERROR_SUCCESS || dwType != REG_DWORD || dwSize != sizeof(DWORD)) + return 0; - TRACE("GetSetupType() returns %lu\n", dwSetupType); - return dwSetupType; + TRACE("GetSetupType() returns %lu\n", dwSetupType); + return dwSetupType; } -static DWORD WINAPI -RunSetupThreadProc( - IN LPVOID lpParameter) + +static +DWORD +WINAPI +RunSetupThreadProc(IN LPVOID lpParameter) { - PROCESS_INFORMATION ProcessInformation; - STARTUPINFOW StartupInfo; - WCHAR Shell[MAX_PATH]; - WCHAR CommandLine[MAX_PATH]; - BOOL Result; - DWORD dwError; - HKEY hKey; - DWORD dwType; - DWORD dwSize; - DWORD dwExitCode; + PROCESS_INFORMATION ProcessInformation; + STARTUPINFOW StartupInfo; + WCHAR Shell[MAX_PATH]; + WCHAR CommandLine[MAX_PATH]; + BOOL Result; + DWORD dwError; + HKEY hKey; + DWORD dwType; + DWORD dwSize; + DWORD dwExitCode; - TRACE("RunSetup() called\n"); + TRACE("RunSetup() called\n"); - /* Open key */ - dwError = RegOpenKeyExW( - HKEY_LOCAL_MACHINE, - L"SYSTEM\\Setup", - 0, - KEY_QUERY_VALUE, - &hKey); - if (dwError != ERROR_SUCCESS) - return FALSE; + /* Open key */ + dwError = RegOpenKeyExW(HKEY_LOCAL_MACHINE, + L"SYSTEM\\Setup", + 0, + KEY_QUERY_VALUE, + &hKey); + if (dwError != ERROR_SUCCESS) + return FALSE; - /* Read key */ - dwSize = (sizeof(Shell) / sizeof(Shell[0])) - 1; - dwError = RegQueryValueExW( - hKey, - L"CmdLine", - NULL, - &dwType, - (LPBYTE)Shell, - &dwSize); - RegCloseKey(hKey); - if (dwError != ERROR_SUCCESS) - return FALSE; + /* Read key */ + dwSize = (sizeof(Shell) / sizeof(Shell[0])) - 1; + dwError = RegQueryValueExW(hKey, + L"CmdLine", + NULL, + &dwType, + (LPBYTE)Shell, + &dwSize); + RegCloseKey(hKey); + if (dwError != ERROR_SUCCESS) + return FALSE; - /* Finish string */ - Shell[dwSize / sizeof(WCHAR)] = UNICODE_NULL; + /* Finish string */ + Shell[dwSize / sizeof(WCHAR)] = UNICODE_NULL; - /* Expand string (if applicable) */ - if (dwType == REG_EXPAND_SZ) - ExpandEnvironmentStringsW(Shell, CommandLine, MAX_PATH); - else if (dwType == REG_SZ) - wcscpy(CommandLine, Shell); - else - return FALSE; + /* Expand string (if applicable) */ + if (dwType == REG_EXPAND_SZ) + ExpandEnvironmentStringsW(Shell, CommandLine, MAX_PATH); + else if (dwType == REG_SZ) + wcscpy(CommandLine, Shell); + else + return FALSE; - TRACE("Should run '%s' now\n", debugstr_w(CommandLine)); + TRACE("Should run '%s' now\n", debugstr_w(CommandLine)); - /* Start process */ - StartupInfo.cb = sizeof(StartupInfo); - StartupInfo.lpReserved = NULL; - StartupInfo.lpDesktop = NULL; - StartupInfo.lpTitle = NULL; - StartupInfo.dwFlags = 0; - StartupInfo.cbReserved2 = 0; - StartupInfo.lpReserved2 = 0; - Result = CreateProcessW( - NULL, - CommandLine, - NULL, - NULL, - FALSE, - DETACHED_PROCESS, - NULL, - NULL, - &StartupInfo, - &ProcessInformation); - if (!Result) - { - TRACE("Failed to run setup process\n"); - return FALSE; - } + /* Start process */ + StartupInfo.cb = sizeof(StartupInfo); + StartupInfo.lpReserved = NULL; + StartupInfo.lpDesktop = NULL; + StartupInfo.lpTitle = NULL; + StartupInfo.dwFlags = 0; + StartupInfo.cbReserved2 = 0; + StartupInfo.lpReserved2 = 0; - /* Wait for process termination */ - WaitForSingleObject(ProcessInformation.hProcess, INFINITE); + Result = CreateProcessW(NULL, + CommandLine, + NULL, + NULL, + FALSE, + DETACHED_PROCESS, + NULL, + NULL, + &StartupInfo, + &ProcessInformation); + if (!Result) + { + TRACE("Failed to run setup process\n"); + return FALSE; + } - GetExitCodeProcess(ProcessInformation.hProcess, &dwExitCode); + /* Wait for process termination */ + WaitForSingleObject(ProcessInformation.hProcess, INFINITE); - /* Close handles */ - CloseHandle(ProcessInformation.hThread); - CloseHandle(ProcessInformation.hProcess); + GetExitCodeProcess(ProcessInformation.hProcess, &dwExitCode); - TRACE ("RunSetup() done\n"); + /* Close handles */ + CloseHandle(ProcessInformation.hThread); + CloseHandle(ProcessInformation.hProcess); - return TRUE; + TRACE ("RunSetup() done\n"); + + return TRUE; } + BOOL RunSetup(VOID) { - HANDLE hThread; + HANDLE hThread; - hThread = CreateThread(NULL, 0, RunSetupThreadProc, NULL, 0, NULL); - return hThread != NULL; + hThread = CreateThread(NULL, + 0, + RunSetupThreadProc, + NULL, + 0, + NULL); + + return hThread != NULL; } /* EOF */ Modified: trunk/reactos/base/system/winlogon/winlogon.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/winlogon/winlo…
============================================================================== --- trunk/reactos/base/system/winlogon/winlogon.c [iso-8859-1] (original) +++ trunk/reactos/base/system/winlogon/winlogon.c [iso-8859-1] Sat Mar 2 20:30:36 2013 @@ -21,96 +21,97 @@ /* FUNCTIONS *****************************************************************/ -static BOOL +static +BOOL StartServicesManager(VOID) { - STARTUPINFOW StartupInfo; - PROCESS_INFORMATION ProcessInformation; - LPCWSTR ServiceString = L"services.exe"; - BOOL res; - - /* Start the service control manager (services.exe) */ - ZeroMemory(&StartupInfo, sizeof(STARTUPINFOW)); - StartupInfo.cb = sizeof(StartupInfo); - StartupInfo.lpReserved = NULL; - StartupInfo.lpDesktop = NULL; - StartupInfo.lpTitle = NULL; - StartupInfo.dwFlags = 0; - StartupInfo.cbReserved2 = 0; - StartupInfo.lpReserved2 = 0; - - TRACE("WL: Creating new process - %S\n", ServiceString); - - res = CreateProcessW( - ServiceString, - NULL, - NULL, - NULL, - FALSE, - DETACHED_PROCESS, - NULL, - NULL, - &StartupInfo, - &ProcessInformation); - if (!res) - { - ERR("WL: Failed to execute services (error %lu)\n", GetLastError()); - return FALSE; - } - - TRACE("WL: Created new process - %S\n", ServiceString); - - CloseHandle(ProcessInformation.hThread); - CloseHandle(ProcessInformation.hProcess); - - TRACE("WL: StartServicesManager() done.\n"); - - return TRUE; -} - - -static BOOL + STARTUPINFOW StartupInfo; + PROCESS_INFORMATION ProcessInformation; + LPCWSTR ServiceString = L"services.exe"; + BOOL res; + + /* Start the service control manager (services.exe) */ + ZeroMemory(&StartupInfo, sizeof(STARTUPINFOW)); + StartupInfo.cb = sizeof(StartupInfo); + StartupInfo.lpReserved = NULL; + StartupInfo.lpDesktop = NULL; + StartupInfo.lpTitle = NULL; + StartupInfo.dwFlags = 0; + StartupInfo.cbReserved2 = 0; + StartupInfo.lpReserved2 = 0; + + TRACE("WL: Creating new process - %S\n", ServiceString); + + res = CreateProcessW(ServiceString, + NULL, + NULL, + NULL, + FALSE, + DETACHED_PROCESS, + NULL, + NULL, + &StartupInfo, + &ProcessInformation); + if (!res) + { + ERR("WL: Failed to execute services (error %lu)\n", GetLastError()); + return FALSE; + } + + TRACE("WL: Created new process - %S\n", ServiceString); + + CloseHandle(ProcessInformation.hThread); + CloseHandle(ProcessInformation.hProcess); + + TRACE("WL: StartServicesManager() done.\n"); + + return TRUE; +} + + +static +BOOL StartLsass(VOID) { - STARTUPINFOW StartupInfo; - PROCESS_INFORMATION ProcessInformation; - LPCWSTR ServiceString = L"lsass.exe"; - BOOL res; - - /* Start the local security authority subsystem (lsass.exe) */ - ZeroMemory(&StartupInfo, sizeof(STARTUPINFOW)); - StartupInfo.cb = sizeof(StartupInfo); - StartupInfo.lpReserved = NULL; - StartupInfo.lpDesktop = NULL; - StartupInfo.lpTitle = NULL; - StartupInfo.dwFlags = 0; - StartupInfo.cbReserved2 = 0; - StartupInfo.lpReserved2 = 0; - - TRACE("WL: Creating new process - %S\n", ServiceString); - - res = CreateProcessW( - ServiceString, - NULL, - NULL, - NULL, - FALSE, - DETACHED_PROCESS, - NULL, - NULL, - &StartupInfo, - &ProcessInformation); - - TRACE("WL: Created new process - %S\n", ServiceString); - - CloseHandle(ProcessInformation.hThread); - CloseHandle(ProcessInformation.hProcess); - - return res; -} - - -static VOID + STARTUPINFOW StartupInfo; + PROCESS_INFORMATION ProcessInformation; + LPCWSTR ServiceString = L"lsass.exe"; + BOOL res; + + /* Start the local security authority subsystem (lsass.exe) */ + ZeroMemory(&StartupInfo, sizeof(STARTUPINFOW)); + StartupInfo.cb = sizeof(StartupInfo); + StartupInfo.lpReserved = NULL; + StartupInfo.lpDesktop = NULL; + StartupInfo.lpTitle = NULL; + StartupInfo.dwFlags = 0; + StartupInfo.cbReserved2 = 0; + StartupInfo.lpReserved2 = 0; + + TRACE("WL: Creating new process - %S\n", ServiceString); + + res = CreateProcessW(ServiceString, + NULL, + NULL, + NULL, + FALSE, + DETACHED_PROCESS, + NULL, + NULL, + &StartupInfo, + &ProcessInformation); + + TRACE("WL: Created new process - %S\n", ServiceString); + + CloseHandle(ProcessInformation.hThread); + CloseHandle(ProcessInformation.hProcess); + + return res; +} + + +static +VOID WaitForLsass(VOID) { HANDLE hEvent; @@ -146,18 +147,19 @@ } -static BOOL -InitKeyboardLayouts() +static +BOOL +InitKeyboardLayouts(VOID) { WCHAR wszKeyName[12], wszKLID[10]; - DWORD dwSize = sizeof(wszKLID), dwType, i = 1; + DWORD dwSize = sizeof(wszKLID), dwType, i = 1; HKEY hKey; UINT Flags; BOOL bRet = FALSE; /* Open registry key with preloaded layouts */ - if (RegOpenKeyExW(HKEY_CURRENT_USER, L"Keyboard Layout\\Preload", 0, KEY_READ, &hKey) == ERROR_SUCCESS) - { + if (RegOpenKeyExW(HKEY_CURRENT_USER, L"Keyboard Layout\\Preload", 0, KEY_READ, &hKey) == ERROR_SUCCESS) + { while(TRUE) { /* Read values with integer names only */ @@ -195,9 +197,9 @@ /* Close the key now */ RegCloseKey(hKey); - } - else - WARN("RegOpenKeyExW(Keyboard Layout\\Preload) failed!\n"); + } + else + WARN("RegOpenKeyExW(Keyboard Layout\\Preload) failed!\n"); if (!bRet) { @@ -211,234 +213,242 @@ BOOL -DisplayStatusMessage( - IN PWLSESSION Session, - IN HDESK hDesktop, - IN UINT ResourceId) -{ - WCHAR StatusMsg[MAX_PATH]; - - if (Session->Gina.Version < WLX_VERSION_1_3) - return TRUE; - - if (Session->SuppressStatus) - return TRUE; - - if (LoadStringW(hAppInstance, ResourceId, StatusMsg, MAX_PATH) == 0) - return FALSE; - - return Session->Gina.Functions.WlxDisplayStatusMessage(Session->Gina.Context, hDesktop, 0, NULL, StatusMsg); -} +DisplayStatusMessage(IN PWLSESSION Session, + IN HDESK hDesktop, + IN UINT ResourceId) +{ + WCHAR StatusMsg[MAX_PATH]; + + if (Session->Gina.Version < WLX_VERSION_1_3) + return TRUE; + + if (Session->SuppressStatus) + return TRUE; + + if (LoadStringW(hAppInstance, ResourceId, StatusMsg, MAX_PATH) == 0) + return FALSE; + + return Session->Gina.Functions.WlxDisplayStatusMessage(Session->Gina.Context, hDesktop, 0, NULL, StatusMsg); +} + BOOL -RemoveStatusMessage( - IN PWLSESSION Session) -{ - if (Session->Gina.Version < WLX_VERSION_1_3) - return TRUE; - - return Session->Gina.Functions.WlxRemoveStatusMessage(Session->Gina.Context); -} - -static INT_PTR CALLBACK -GinaLoadFailedWindowProc( - IN HWND hwndDlg, - IN UINT uMsg, - IN WPARAM wParam, - IN LPARAM lParam) -{ - switch (uMsg) - { - case WM_COMMAND: - { - switch (LOWORD(wParam)) - { - case IDOK: - EndDialog(hwndDlg, IDOK); - return TRUE; - } - break; - } - case WM_INITDIALOG: - { - int len; - WCHAR templateText[MAX_PATH], text[MAX_PATH]; - - len = GetDlgItemTextW(hwndDlg, IDC_GINALOADFAILED, templateText, MAX_PATH); - if (len) - { - wsprintfW(text, templateText, (LPWSTR)lParam); - SetDlgItemTextW(hwndDlg, IDC_GINALOADFAILED, text); - } - SetFocus(GetDlgItem(hwndDlg, IDOK)); - return TRUE; - } - case WM_CLOSE: - { - EndDialog(hwndDlg, IDCANCEL); - return TRUE; - } - } - - return FALSE; -} - -int WINAPI -WinMain( - IN HINSTANCE hInstance, - IN HINSTANCE hPrevInstance, - IN LPSTR lpCmdLine, - IN int nShowCmd) +RemoveStatusMessage(IN PWLSESSION Session) +{ + if (Session->Gina.Version < WLX_VERSION_1_3) + return TRUE; + + return Session->Gina.Functions.WlxRemoveStatusMessage(Session->Gina.Context); +} + + +static +INT_PTR +CALLBACK +GinaLoadFailedWindowProc(IN HWND hwndDlg, + IN UINT uMsg, + IN WPARAM wParam, + IN LPARAM lParam) +{ + switch (uMsg) + { + case WM_COMMAND: + { + switch (LOWORD(wParam)) + { + case IDOK: + EndDialog(hwndDlg, IDOK); + return TRUE; + } + break; + } + + case WM_INITDIALOG: + { + int len; + WCHAR templateText[MAX_PATH], text[MAX_PATH]; + + len = GetDlgItemTextW(hwndDlg, IDC_GINALOADFAILED, templateText, MAX_PATH); + if (len) + { + wsprintfW(text, templateText, (LPWSTR)lParam); + SetDlgItemTextW(hwndDlg, IDC_GINALOADFAILED, text); + } + + SetFocus(GetDlgItem(hwndDlg, IDOK)); + return TRUE; + } + + case WM_CLOSE: + { + EndDialog(hwndDlg, IDCANCEL); + return TRUE; + } + } + + return FALSE; +} + + +int +WINAPI +WinMain(IN HINSTANCE hInstance, + IN HINSTANCE hPrevInstance, + IN LPSTR lpCmdLine, + IN int nShowCmd) { #if 0 - LSA_STRING ProcessName, PackageName; - HANDLE LsaHandle; - LSA_OPERATIONAL_MODE Mode; - BOOLEAN Old; - ULONG AuthenticationPackage; - NTSTATUS Status; + LSA_STRING ProcessName, PackageName; + HANDLE LsaHandle; + LSA_OPERATIONAL_MODE Mode; + BOOLEAN Old; + ULONG AuthenticationPackage; + NTSTATUS Status; #endif - ULONG HardErrorResponse; - MSG Msg; - - UNREFERENCED_PARAMETER(hPrevInstance); - UNREFERENCED_PARAMETER(lpCmdLine); - UNREFERENCED_PARAMETER(nShowCmd); - - hAppInstance = hInstance; - - if (!RegisterLogonProcess(GetCurrentProcessId(), TRUE)) - { - ERR("WL: Could not register logon process\n"); - NtShutdownSystem(ShutdownNoReboot); - ExitProcess(0); - } - - WLSession = (PWLSESSION)HeapAlloc(GetProcessHeap(), 0, sizeof(WLSESSION)); - if (!WLSession) - { - ERR("WL: Could not allocate memory for winlogon instance\n"); - NtRaiseHardError(STATUS_SYSTEM_PROCESS_TERMINATED, 0, 0, NULL, OptionOk, &HardErrorResponse); - ExitProcess(1); - } - ZeroMemory(WLSession, sizeof(WLSESSION)); - WLSession->DialogTimeout = 120; /* 2 minutes */ - - if (!CreateWindowStationAndDesktops(WLSession)) - { - ERR("WL: Could not create window station and desktops\n"); - NtRaiseHardError(STATUS_SYSTEM_PROCESS_TERMINATED, 0, 0, NULL, OptionOk, &HardErrorResponse); - ExitProcess(1); - } - LockWorkstation(WLSession); + ULONG HardErrorResponse; + MSG Msg; + + UNREFERENCED_PARAMETER(hPrevInstance); + UNREFERENCED_PARAMETER(lpCmdLine); + UNREFERENCED_PARAMETER(nShowCmd); + + hAppInstance = hInstance; + + if (!RegisterLogonProcess(GetCurrentProcessId(), TRUE)) + { + ERR("WL: Could not register logon process\n"); + NtShutdownSystem(ShutdownNoReboot); + ExitProcess(0); + } + + WLSession = (PWLSESSION)HeapAlloc(GetProcessHeap(), 0, sizeof(WLSESSION)); + if (!WLSession) + { + ERR("WL: Could not allocate memory for winlogon instance\n"); + NtRaiseHardError(STATUS_SYSTEM_PROCESS_TERMINATED, 0, 0, NULL, OptionOk, &HardErrorResponse); + ExitProcess(1); + } + + ZeroMemory(WLSession, sizeof(WLSESSION)); + WLSession->DialogTimeout = 120; /* 2 minutes */ + + if (!CreateWindowStationAndDesktops(WLSession)) + { + ERR("WL: Could not create window station and desktops\n"); + NtRaiseHardError(STATUS_SYSTEM_PROCESS_TERMINATED, 0, 0, NULL, OptionOk, &HardErrorResponse); + ExitProcess(1); + } + + LockWorkstation(WLSession); /* Load default keyboard layouts */ if (!InitKeyboardLayouts()) { ERR("WL: Could not preload keyboard layouts\n"); - NtRaiseHardError(STATUS_SYSTEM_PROCESS_TERMINATED, 0, 0, NULL, OptionOk, &HardErrorResponse); - ExitProcess(1); - } - - if (!StartServicesManager()) - { - ERR("WL: Could not start services.exe\n"); - NtRaiseHardError(STATUS_SYSTEM_PROCESS_TERMINATED, 0, 0, NULL, OptionOk, &HardErrorResponse); - ExitProcess(1); - } - - if (!StartLsass()) - { - ERR("WL: Failed to start lsass.exe service (error %lu)\n", GetLastError()); - NtRaiseHardError(STATUS_SYSTEM_PROCESS_TERMINATED, 0, 0, 0, OptionOk, &HardErrorResponse); - ExitProcess(1); - } - - /* Load and initialize gina */ - if (!GinaInit(WLSession)) - { - ERR("WL: Failed to initialize Gina\n"); - DialogBoxParam(hAppInstance, MAKEINTRESOURCE(IDD_GINALOADFAILED), GetDesktopWindow(), GinaLoadFailedWindowProc, (LPARAM)L""); - HandleShutdown(WLSession, WLX_SAS_ACTION_SHUTDOWN_REBOOT); - ExitProcess(1); - } - - DisplayStatusMessage(WLSession, WLSession->WinlogonDesktop, IDS_REACTOSISSTARTINGUP); - - - /* Wait for the LSA server */ - WaitForLsass(); + NtRaiseHardError(STATUS_SYSTEM_PROCESS_TERMINATED, 0, 0, NULL, OptionOk, &HardErrorResponse); + ExitProcess(1); + } + + if (!StartServicesManager()) + { + ERR("WL: Could not start services.exe\n"); + NtRaiseHardError(STATUS_SYSTEM_PROCESS_TERMINATED, 0, 0, NULL, OptionOk, &HardErrorResponse); + ExitProcess(1); + } + + if (!StartLsass()) + { + ERR("WL: Failed to start lsass.exe service (error %lu)\n", GetLastError()); + NtRaiseHardError(STATUS_SYSTEM_PROCESS_TERMINATED, 0, 0, 0, OptionOk, &HardErrorResponse); + ExitProcess(1); + } + + /* Load and initialize gina */ + if (!GinaInit(WLSession)) + { + ERR("WL: Failed to initialize Gina\n"); + DialogBoxParam(hAppInstance, MAKEINTRESOURCE(IDD_GINALOADFAILED), GetDesktopWindow(), GinaLoadFailedWindowProc, (LPARAM)L""); + HandleShutdown(WLSession, WLX_SAS_ACTION_SHUTDOWN_REBOOT); + ExitProcess(1); + } + + DisplayStatusMessage(WLSession, WLSession->WinlogonDesktop, IDS_REACTOSISSTARTINGUP); + + /* Wait for the LSA server */ + WaitForLsass(); #if 0 - /* Connect to NetLogon service (lsass.exe) */ - /* Real winlogon uses "Winlogon" */ - RtlInitUnicodeString((PUNICODE_STRING)&ProcessName, L"Winlogon"); - Status = LsaRegisterLogonProcess(&ProcessName, &LsaHandle, &Mode); - if (Status == STATUS_PORT_CONNECTION_REFUSED) - { - /* Add the 'SeTcbPrivilege' privilege and try again */ - Status = RtlAdjustPrivilege(SE_TCB_PRIVILEGE, TRUE, TRUE, &Old); - if (!NT_SUCCESS(Status)) - { - ERR("RtlAdjustPrivilege() failed with error %lu\n", LsaNtStatusToWinError(Status)); - return 1; - } - Status = LsaRegisterLogonProcess(&ProcessName, &LsaHandle, &Mode); - } - if (!NT_SUCCESS(Status)) - { - ERR("LsaRegisterLogonProcess() failed with error %lu\n", LsaNtStatusToWinError(Status)); - return 1; - } - - RtlInitUnicodeString((PUNICODE_STRING)&PackageName, MICROSOFT_KERBEROS_NAME_W); - Status = LsaLookupAuthenticationPackage(LsaHandle, &PackageName, &AuthenticationPackage); - if (!NT_SUCCESS(Status)) - { - ERR("LsaLookupAuthenticationPackage() failed with error %lu\n", LsaNtStatusToWinError(Status)); - LsaDeregisterLogonProcess(LsaHandle); - return 1; - } + /* Connect to NetLogon service (lsass.exe) */ + /* Real winlogon uses "Winlogon" */ + RtlInitUnicodeString((PUNICODE_STRING)&ProcessName, L"Winlogon"); + Status = LsaRegisterLogonProcess(&ProcessName, &LsaHandle, &Mode); + if (Status == STATUS_PORT_CONNECTION_REFUSED) + { + /* Add the 'SeTcbPrivilege' privilege and try again */ + Status = RtlAdjustPrivilege(SE_TCB_PRIVILEGE, TRUE, TRUE, &Old); + if (!NT_SUCCESS(Status)) + { + ERR("RtlAdjustPrivilege() failed with error %lu\n", LsaNtStatusToWinError(Status)); + return 1; + } + + Status = LsaRegisterLogonProcess(&ProcessName, &LsaHandle, &Mode); + } + + if (!NT_SUCCESS(Status)) + { + ERR("LsaRegisterLogonProcess() failed with error %lu\n", LsaNtStatusToWinError(Status)); + return 1; + } + + RtlInitUnicodeString((PUNICODE_STRING)&PackageName, MICROSOFT_KERBEROS_NAME_W); + Status = LsaLookupAuthenticationPackage(LsaHandle, &PackageName, &AuthenticationPackage); + if (!NT_SUCCESS(Status)) + { + ERR("LsaLookupAuthenticationPackage() failed with error %lu\n", LsaNtStatusToWinError(Status)); + LsaDeregisterLogonProcess(LsaHandle); + return 1; + } #endif - /* Create a hidden window to get SAS notifications */ - if (!InitializeSAS(WLSession)) - { - ERR("WL: Failed to initialize SAS\n"); - ExitProcess(2); - } - - //DisplayStatusMessage(Session, Session->WinlogonDesktop, IDS_PREPARENETWORKCONNECTIONS); - //DisplayStatusMessage(Session, Session->WinlogonDesktop, IDS_APPLYINGCOMPUTERSETTINGS); - - /* Display logged out screen */ - WLSession->LogonState = STATE_LOGGED_OFF; - RemoveStatusMessage(WLSession); - - /* Check for pending setup */ - if (GetSetupType() != 0) - { - TRACE("WL: Setup mode detected\n"); - - /* Run setup and reboot when done */ - SwitchDesktop(WLSession->ApplicationDesktop); - RunSetup(); - } - else - PostMessageW(WLSession->SASWindow, WLX_WM_SAS, WLX_SAS_TYPE_TIMEOUT, 0); - - /* Tell kernel that CurrentControlSet is good (needed - * to support Last good known configuration boot) */ - NtInitializeRegistry(CM_BOOT_FLAG_ACCEPTED | 1); - - /* Message loop for the SAS window */ - while (GetMessageW(&Msg, WLSession->SASWindow, 0, 0)) - { - TranslateMessage(&Msg); - DispatchMessageW(&Msg); - } - - /* We never go there */ - - return 0; -} + /* Create a hidden window to get SAS notifications */ + if (!InitializeSAS(WLSession)) + { + ERR("WL: Failed to initialize SAS\n"); + ExitProcess(2); + } + + //DisplayStatusMessage(Session, Session->WinlogonDesktop, IDS_PREPARENETWORKCONNECTIONS); + //DisplayStatusMessage(Session, Session->WinlogonDesktop, IDS_APPLYINGCOMPUTERSETTINGS); + + /* Display logged out screen */ + WLSession->LogonState = STATE_LOGGED_OFF; + RemoveStatusMessage(WLSession); + + /* Check for pending setup */ + if (GetSetupType() != 0) + { + TRACE("WL: Setup mode detected\n"); + + /* Run setup and reboot when done */ + SwitchDesktop(WLSession->ApplicationDesktop); + RunSetup(); + } + else + PostMessageW(WLSession->SASWindow, WLX_WM_SAS, WLX_SAS_TYPE_TIMEOUT, 0); + + /* Tell kernel that CurrentControlSet is good (needed + * to support Last good known configuration boot) */ + NtInitializeRegistry(CM_BOOT_FLAG_ACCEPTED | 1); + + /* Message loop for the SAS window */ + while (GetMessageW(&Msg, WLSession->SASWindow, 0, 0)) + { + TranslateMessage(&Msg); + DispatchMessageW(&Msg); + } + + /* We never go there */ + + return 0; +} Modified: trunk/reactos/base/system/winlogon/winlogon.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/winlogon/winlo…
============================================================================== --- trunk/reactos/base/system/winlogon/winlogon.h [iso-8859-1] (original) +++ trunk/reactos/base/system/winlogon/winlogon.h [iso-8859-1] Sat Mar 2 20:30:36 2013 @@ -79,44 +79,44 @@ typedef struct _GINAFUNCTIONS { - /* Functions always available for a valid GINA */ - PFWLXNEGOTIATE WlxNegotiate; /* optional */ - PFWLXINITIALIZE WlxInitialize; - - /* Functions available if WlxVersion >= WLX_VERSION_1_0 (MS Windows 3.5.0) */ - PFWLXDISPLAYSASNOTICE WlxDisplaySASNotice; - PFWLXLOGGEDOUTSAS WlxLoggedOutSAS; - PFWLXACTIVATEUSERSHELL WlxActivateUserShell; - PFWLXLOGGEDONSAS WlxLoggedOnSAS; - PFWLXDISPLAYLOCKEDNOTICE WlxDisplayLockedNotice; - PFWLXWKSTALOCKEDSAS WlxWkstaLockedSAS; - PFWLXISLOCKOK WlxIsLockOk; - PFWLXISLOGOFFOK WlxIsLogoffOk; - PFWLXLOGOFF WlxLogoff; - PFWLXSHUTDOWN WlxShutdown; - - /* Functions available if WlxVersion >= WLX_VERSION_1_1 (MS Windows 3.5.1) */ - PFWLXSCREENSAVERNOTIFY WlxScreenSaverNotify; /* optional */ - PFWLXSTARTAPPLICATION WlxStartApplication; /* optional */ - - /* Functions available if WlxVersion >= WLX_VERSION_1_2 (MS Windows NT 4.0) */ - - /* Functions available if WlxVersion >= WLX_VERSION_1_3 (MS Windows 2000) */ - PFWLXNETWORKPROVIDERLOAD WlxNetworkProviderLoad; /* not called ATM */ - PFWLXDISPLAYSTATUSMESSAGE WlxDisplayStatusMessage; - PFWLXGETSTATUSMESSAGE WlxGetStatusMessage; /* doesn't need to be called */ - PFWLXREMOVESTATUSMESSAGE WlxRemoveStatusMessage; - - /* Functions available if WlxVersion >= WLX_VERSION_1_4 (MS Windows XP) */ + /* Functions always available for a valid GINA */ + PFWLXNEGOTIATE WlxNegotiate; /* optional */ + PFWLXINITIALIZE WlxInitialize; + + /* Functions available if WlxVersion >= WLX_VERSION_1_0 (MS Windows 3.5.0) */ + PFWLXDISPLAYSASNOTICE WlxDisplaySASNotice; + PFWLXLOGGEDOUTSAS WlxLoggedOutSAS; + PFWLXACTIVATEUSERSHELL WlxActivateUserShell; + PFWLXLOGGEDONSAS WlxLoggedOnSAS; + PFWLXDISPLAYLOCKEDNOTICE WlxDisplayLockedNotice; + PFWLXWKSTALOCKEDSAS WlxWkstaLockedSAS; + PFWLXISLOCKOK WlxIsLockOk; + PFWLXISLOGOFFOK WlxIsLogoffOk; + PFWLXLOGOFF WlxLogoff; + PFWLXSHUTDOWN WlxShutdown; + + /* Functions available if WlxVersion >= WLX_VERSION_1_1 (MS Windows 3.5.1) */ + PFWLXSCREENSAVERNOTIFY WlxScreenSaverNotify; /* optional */ + PFWLXSTARTAPPLICATION WlxStartApplication; /* optional */ + + /* Functions available if WlxVersion >= WLX_VERSION_1_2 (MS Windows NT 4.0) */ + + /* Functions available if WlxVersion >= WLX_VERSION_1_3 (MS Windows 2000) */ + PFWLXNETWORKPROVIDERLOAD WlxNetworkProviderLoad; /* not called ATM */ + PFWLXDISPLAYSTATUSMESSAGE WlxDisplayStatusMessage; + PFWLXGETSTATUSMESSAGE WlxGetStatusMessage; /* doesn't need to be called */ + PFWLXREMOVESTATUSMESSAGE WlxRemoveStatusMessage; + + /* Functions available if WlxVersion >= WLX_VERSION_1_4 (MS Windows XP) */ } GINAFUNCTIONS, *PGINAFUNCTIONS; typedef struct _GINAINSTANCE { - HMODULE hDllInstance; - GINAFUNCTIONS Functions; - PVOID Context; - DWORD Version; - BOOL UseCtrlAltDelete; + HMODULE hDllInstance; + GINAFUNCTIONS Functions; + PVOID Context; + DWORD Version; + BOOL UseCtrlAltDelete; } GINAINSTANCE, *PGINAINSTANCE; @@ -206,39 +206,39 @@ typedef struct _WLSESSION { - GINAINSTANCE Gina; - DWORD SASAction; - BOOL SuppressStatus; - BOOL TaskManHotkey; - HWND SASWindow; - HWINSTA InteractiveWindowStation; - LPWSTR InteractiveWindowStationName; - HDESK ApplicationDesktop; - HDESK WinlogonDesktop; - HDESK ScreenSaverDesktop; - LUID LogonId; - HANDLE UserToken; - HANDLE hProfileInfo; - LOGON_STATE LogonState; - DWORD DialogTimeout; /* Timeout for dialog boxes, in seconds */ - - /* Screen-saver informations */ + GINAINSTANCE Gina; + DWORD SASAction; + BOOL SuppressStatus; + BOOL TaskManHotkey; + HWND SASWindow; + HWINSTA InteractiveWindowStation; + LPWSTR InteractiveWindowStationName; + HDESK ApplicationDesktop; + HDESK WinlogonDesktop; + HDESK ScreenSaverDesktop; + LUID LogonId; + HANDLE UserToken; + HANDLE hProfileInfo; + LOGON_STATE LogonState; + DWORD DialogTimeout; /* Timeout for dialog boxes, in seconds */ + + /* Screen-saver informations */ #ifndef USE_GETLASTINPUTINFO - HHOOK KeyboardHook; - HHOOK MouseHook; + HHOOK KeyboardHook; + HHOOK MouseHook; #endif - HANDLE hEndOfScreenSaverThread; - HANDLE hScreenSaverParametersChanged; - HANDLE hUserActivity; - HANDLE hEndOfScreenSaver; + HANDLE hEndOfScreenSaverThread; + HANDLE hScreenSaverParametersChanged; + HANDLE hUserActivity; + HANDLE hEndOfScreenSaver; #ifndef USE_GETLASTINPUTINFO - DWORD LastActivity; + DWORD LastActivity; #endif - /* Logon informations */ - DWORD Options; - WLX_MPR_NOTIFY_INFO MprNotifyInfo; - WLX_PROFILE_V2_0 *Profile; + /* Logon informations */ + DWORD Options; + WLX_MPR_NOTIFY_INFO MprNotifyInfo; + WLX_PROFILE_V2_0 *Profile; } WLSESSION, *PWLSESSION; extern HINSTANCE hAppInstance; @@ -262,52 +262,43 @@ /* sas.c */ BOOL -SetDefaultLanguage( - IN BOOL UserProfile); - -BOOL -InitializeSAS( - IN OUT PWLSESSION Session); +SetDefaultLanguage(IN BOOL UserProfile); + +BOOL +InitializeSAS(IN OUT PWLSESSION Session); /* screensaver.c */ BOOL -InitializeScreenSaver( - IN OUT PWLSESSION Session); +InitializeScreenSaver(IN OUT PWLSESSION Session); VOID -StartScreenSaver( - IN PWLSESSION Session); +StartScreenSaver(IN PWLSESSION Session); /* winlogon.c */ BOOL -PlaySoundRoutine( - IN LPCWSTR FileName, - IN UINT Logon, - IN UINT Flags); - -BOOL -DisplayStatusMessage( - IN PWLSESSION Session, - IN HDESK hDesktop, - IN UINT ResourceId); - -BOOL -RemoveStatusMessage( - IN PWLSESSION Session); +PlaySoundRoutine(IN LPCWSTR FileName, + IN UINT Logon, + IN UINT Flags); + +BOOL +DisplayStatusMessage(IN PWLSESSION Session, + IN HDESK hDesktop, + IN UINT ResourceId); + +BOOL +RemoveStatusMessage(IN PWLSESSION Session); /* wlx.c */ BOOL -GinaInit( - IN OUT PWLSESSION Session); -BOOL -CreateWindowStationAndDesktops( - IN OUT PWLSESSION Session); +GinaInit(IN OUT PWLSESSION Session); + +BOOL +CreateWindowStationAndDesktops(IN OUT PWLSESSION Session); NTSTATUS -HandleShutdown( - IN OUT PWLSESSION Session, - IN DWORD wlxAction); +HandleShutdown(IN OUT PWLSESSION Session, + IN DWORD wlxAction); VOID WINAPI WlxUseCtrlAltDel(HANDLE hWlx); VOID WINAPI WlxSetContextPointer(HANDLE hWlx, PVOID pWlxContext);
11 years, 9 months
1
0
0
0
[tkreuzer] 58405: [WIN32K] Improve formatting
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Sat Mar 2 20:23:22 2013 New Revision: 58405 URL:
http://svn.reactos.org/svn/reactos?rev=58405&view=rev
Log: [WIN32K] Improve formatting Modified: trunk/reactos/win32ss/gdi/ntgdi/icm.c Modified: trunk/reactos/win32ss/gdi/ntgdi/icm.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/icm.c?re…
============================================================================== --- trunk/reactos/win32ss/gdi/ntgdi/icm.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/ntgdi/icm.c [iso-8859-1] Sat Mar 2 20:23:22 2013 @@ -19,17 +19,17 @@ IntGdiCreateColorSpace( PLOGCOLORSPACEEXW pLogColorSpace) { - PCOLORSPACE pCS; - HCOLORSPACE hCS; - - pCS = COLORSPACEOBJ_AllocCSWithHandle(); - hCS = pCS->BaseObject.hHmgr; - - pCS->lcsColorSpace = pLogColorSpace->lcsColorSpace; - pCS->dwFlags = pLogColorSpace->dwFlags; - - COLORSPACEOBJ_UnlockCS(pCS); - return hCS; + PCOLORSPACE pCS; + HCOLORSPACE hCS; + + pCS = COLORSPACEOBJ_AllocCSWithHandle(); + hCS = pCS->BaseObject.hHmgr; + + pCS->lcsColorSpace = pLogColorSpace->lcsColorSpace; + pCS->dwFlags = pLogColorSpace->dwFlags; + + COLORSPACEOBJ_UnlockCS(pCS); + return hCS; } BOOL @@ -37,15 +37,16 @@ IntGdiDeleteColorSpace( HCOLORSPACE hColorSpace) { - BOOL Ret = FALSE; - - if ( hColorSpace != hStockColorSpace && - GDI_HANDLE_GET_TYPE(hColorSpace) == GDILoObjType_LO_ICMLCS_TYPE) - { - Ret = GreDeleteObject(hColorSpace); - if ( !Ret ) EngSetLastError(ERROR_INVALID_PARAMETER); - } - return Ret; + BOOL Ret = FALSE; + + if ((hColorSpace != hStockColorSpace) && + (GDI_HANDLE_GET_TYPE(hColorSpace) == GDILoObjType_LO_ICMLCS_TYPE)) + { + Ret = GreDeleteObject(hColorSpace); + if (!Ret) EngSetLastError(ERROR_INVALID_PARAMETER); + } + + return Ret; } HANDLE @@ -53,28 +54,27 @@ NtGdiCreateColorSpace( IN PLOGCOLORSPACEEXW pLogColorSpace) { - LOGCOLORSPACEEXW Safelcs; - NTSTATUS Status = STATUS_SUCCESS; - - _SEH2_TRY - { - ProbeForRead( pLogColorSpace, - sizeof(LOGCOLORSPACEEXW), - 1); - RtlCopyMemory(&Safelcs, pLogColorSpace, sizeof(LOGCOLORSPACEEXW)); - } - _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) - { - Status = _SEH2_GetExceptionCode(); - } - _SEH2_END; - - if (!NT_SUCCESS(Status)) - { - SetLastNtError(Status); - return NULL; - } - return IntGdiCreateColorSpace(&Safelcs); + LOGCOLORSPACEEXW Safelcs; + NTSTATUS Status = STATUS_SUCCESS; + + _SEH2_TRY + { + ProbeForRead( pLogColorSpace, sizeof(LOGCOLORSPACEEXW), 1); + RtlCopyMemory(&Safelcs, pLogColorSpace, sizeof(LOGCOLORSPACEEXW)); + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + Status = _SEH2_GetExceptionCode(); + } + _SEH2_END; + + if (!NT_SUCCESS(Status)) + { + SetLastNtError(Status); + return NULL; + } + + return IntGdiCreateColorSpace(&Safelcs); } BOOL @@ -82,92 +82,95 @@ NtGdiDeleteColorSpace( IN HANDLE hColorSpace) { - return IntGdiDeleteColorSpace(hColorSpace); + return IntGdiDeleteColorSpace(hColorSpace); } BOOL FASTCALL IntGetDeviceGammaRamp(HDEV hPDev, PGAMMARAMP Ramp) { - PPDEVOBJ pGDev = (PPDEVOBJ) hPDev; - int i; - - if (!(pGDev->flFlags & PDEV_DISPLAY )) return FALSE; - - if ((pGDev->devinfo.iDitherFormat == BMF_8BPP) || - (pGDev->devinfo.iDitherFormat == BMF_16BPP) || - (pGDev->devinfo.iDitherFormat == BMF_24BPP) || - (pGDev->devinfo.iDitherFormat == BMF_32BPP)) - { - if (pGDev->flFlags & PDEV_GAMMARAMP_TABLE) - RtlCopyMemory( Ramp, - pGDev->pvGammaRamp, - sizeof(GAMMARAMP)); - else - // Generate the 256-colors array - for(i=0; i<256; i++ ) - { - int NewValue = i * 256; - - Ramp->Red[i] = Ramp->Green[i] = Ramp->Blue[i] = ((WORD)NewValue); - } - return TRUE; - } - else - return FALSE; -} - -BOOL -APIENTRY -NtGdiGetDeviceGammaRamp(HDC hDC, - LPVOID Ramp) -{ - BOOL Ret; - PDC dc; - NTSTATUS Status = STATUS_SUCCESS; - PGAMMARAMP SafeRamp; - - if (!Ramp) return FALSE; - - dc = DC_LockDc(hDC); - if (!dc) - { - EngSetLastError(ERROR_INVALID_HANDLE); - return FALSE; - } - - SafeRamp = ExAllocatePoolWithTag(PagedPool, sizeof(GAMMARAMP), GDITAG_ICM); - if (!SafeRamp) - { - DC_UnlockDc(dc); - EngSetLastError(STATUS_NO_MEMORY); - return FALSE; - } - - Ret = IntGetDeviceGammaRamp((HDEV)dc->ppdev, SafeRamp); - - if (!Ret) return Ret; - - _SEH2_TRY - { - ProbeForWrite(Ramp, sizeof(GAMMARAMP), 1); - RtlCopyMemory(Ramp, SafeRamp, sizeof(GAMMARAMP)); - } - _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) - { - Status = _SEH2_GetExceptionCode(); - } - _SEH2_END; - - DC_UnlockDc(dc); - ExFreePoolWithTag(SafeRamp, GDITAG_ICM); - - if (!NT_SUCCESS(Status)) - { - SetLastNtError(Status); - return FALSE; - } - return Ret; + PPDEVOBJ pGDev = (PPDEVOBJ) hPDev; + int i; + + if (!(pGDev->flFlags & PDEV_DISPLAY)) return FALSE; + + if ((pGDev->devinfo.iDitherFormat == BMF_8BPP) || + (pGDev->devinfo.iDitherFormat == BMF_16BPP) || + (pGDev->devinfo.iDitherFormat == BMF_24BPP) || + (pGDev->devinfo.iDitherFormat == BMF_32BPP)) + { + if (pGDev->flFlags & PDEV_GAMMARAMP_TABLE) + { + RtlCopyMemory(Ramp, pGDev->pvGammaRamp, sizeof(GAMMARAMP)); + } + else + { + // Generate the 256-colors array + for (i = 0; i < 256; i++ ) + { + int NewValue = i * 256; + + Ramp->Red[i] = Ramp->Green[i] = Ramp->Blue[i] = ((WORD)NewValue); + } + } + return TRUE; + } + + return FALSE; +} + +BOOL +APIENTRY +NtGdiGetDeviceGammaRamp( + HDC hDC, + LPVOID Ramp) +{ + BOOL Ret; + PDC dc; + NTSTATUS Status = STATUS_SUCCESS; + PGAMMARAMP SafeRamp; + + if (!Ramp) return FALSE; + + dc = DC_LockDc(hDC); + if (!dc) + { + EngSetLastError(ERROR_INVALID_HANDLE); + return FALSE; + } + + SafeRamp = ExAllocatePoolWithTag(PagedPool, sizeof(GAMMARAMP), GDITAG_ICM); + if (!SafeRamp) + { + DC_UnlockDc(dc); + EngSetLastError(STATUS_NO_MEMORY); + return FALSE; + } + + Ret = IntGetDeviceGammaRamp((HDEV)dc->ppdev, SafeRamp); + + if (!Ret) return Ret; + + _SEH2_TRY + { + ProbeForWrite(Ramp, sizeof(GAMMARAMP), 1); + RtlCopyMemory(Ramp, SafeRamp, sizeof(GAMMARAMP)); + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + Status = _SEH2_GetExceptionCode(); + } + _SEH2_END; + + DC_UnlockDc(dc); + ExFreePoolWithTag(SafeRamp, GDITAG_ICM); + + if (!NT_SUCCESS(Status)) + { + SetLastNtError(Status); + return FALSE; + } + return Ret; } BOOL @@ -175,94 +178,94 @@ NtGdiSetColorSpace(IN HDC hdc, IN HCOLORSPACE hColorSpace) { - PDC pDC; - PDC_ATTR pdcattr; - PCOLORSPACE pCS; - - pDC = DC_LockDc(hdc); - if (!pDC) - { - EngSetLastError(ERROR_INVALID_HANDLE); - return FALSE; - } - pdcattr = pDC->pdcattr; - - if (pdcattr->hColorSpace == hColorSpace) - { - DC_UnlockDc(pDC); - return TRUE; - } - - pCS = COLORSPACEOBJ_LockCS(hColorSpace); - if (!pCS) - { - EngSetLastError(ERROR_INVALID_HANDLE); - return FALSE; - } - - if (pDC->dclevel.pColorSpace) - { - GDIOBJ_vDereferenceObject((POBJ) pDC->dclevel.pColorSpace); - } - - pDC->dclevel.pColorSpace = pCS; - pdcattr->hColorSpace = hColorSpace; - - COLORSPACEOBJ_UnlockCS(pCS); - DC_UnlockDc(pDC); - return TRUE; + PDC pDC; + PDC_ATTR pdcattr; + PCOLORSPACE pCS; + + pDC = DC_LockDc(hdc); + if (!pDC) + { + EngSetLastError(ERROR_INVALID_HANDLE); + return FALSE; + } + pdcattr = pDC->pdcattr; + + if (pdcattr->hColorSpace == hColorSpace) + { + DC_UnlockDc(pDC); + return TRUE; + } + + pCS = COLORSPACEOBJ_LockCS(hColorSpace); + if (!pCS) + { + EngSetLastError(ERROR_INVALID_HANDLE); + return FALSE; + } + + if (pDC->dclevel.pColorSpace) + { + GDIOBJ_vDereferenceObject((POBJ) pDC->dclevel.pColorSpace); + } + + pDC->dclevel.pColorSpace = pCS; + pdcattr->hColorSpace = hColorSpace; + + COLORSPACEOBJ_UnlockCS(pCS); + DC_UnlockDc(pDC); + return TRUE; } BOOL FASTCALL -UpdateDeviceGammaRamp( HDEV hPDev ) -{ - BOOL Ret = FALSE; - PPALETTE palGDI; - PALOBJ *palPtr; - PPDEVOBJ pGDev = (PPDEVOBJ) hPDev; - - if ((pGDev->devinfo.iDitherFormat == BMF_8BPP) || - (pGDev->devinfo.iDitherFormat == BMF_16BPP) || - (pGDev->devinfo.iDitherFormat == BMF_24BPP) || - (pGDev->devinfo.iDitherFormat == BMF_32BPP)) - { - if (pGDev->DriverFunctions.IcmSetDeviceGammaRamp) - return pGDev->DriverFunctions.IcmSetDeviceGammaRamp( pGDev->dhpdev, - IGRF_RGB_256WORDS, - pGDev->pvGammaRamp); - - if ( (pGDev->devinfo.iDitherFormat != BMF_8BPP) || - !(pGDev->gdiinfo.flRaster & RC_PALETTE)) return FALSE; - - if (!(pGDev->flFlags & PDEV_GAMMARAMP_TABLE)) return FALSE; - - palGDI = PALETTE_ShareLockPalette(pGDev->devinfo.hpalDefault); - if(!palGDI) return FALSE; - palPtr = (PALOBJ*) palGDI; - - if (pGDev->flFlags & PDEV_GAMMARAMP_TABLE) - palGDI->flFlags |= PAL_GAMMACORRECTION; - else - palGDI->flFlags &= ~PAL_GAMMACORRECTION; - - if (!(pGDev->flFlags & PDEV_DRIVER_PUNTED_CALL)) // No punting, we hook - { - // BMF_8BPP only! - // PALOBJ_cGetColors check mode flags and update Gamma Correction. - // Set the HDEV to pal and go. - palGDI->hPDev = hPDev; - Ret = pGDev->DriverFunctions.SetPalette(pGDev->dhpdev, - palPtr, - 0, - 0, - palGDI->NumColors); - } - PALETTE_ShareUnlockPalette(palGDI); - return Ret; - } - else - return FALSE; +UpdateDeviceGammaRamp(HDEV hPDev) +{ + BOOL Ret = FALSE; + PPALETTE palGDI; + PALOBJ *palPtr; + PPDEVOBJ pGDev = (PPDEVOBJ)hPDev; + + if ((pGDev->devinfo.iDitherFormat == BMF_8BPP) || + (pGDev->devinfo.iDitherFormat == BMF_16BPP) || + (pGDev->devinfo.iDitherFormat == BMF_24BPP) || + (pGDev->devinfo.iDitherFormat == BMF_32BPP)) + { + if (pGDev->DriverFunctions.IcmSetDeviceGammaRamp) + return pGDev->DriverFunctions.IcmSetDeviceGammaRamp( pGDev->dhpdev, + IGRF_RGB_256WORDS, + pGDev->pvGammaRamp); + + if ((pGDev->devinfo.iDitherFormat != BMF_8BPP) || + !(pGDev->gdiinfo.flRaster & RC_PALETTE)) return FALSE; + + if (!(pGDev->flFlags & PDEV_GAMMARAMP_TABLE)) return FALSE; + + palGDI = PALETTE_ShareLockPalette(pGDev->devinfo.hpalDefault); + if(!palGDI) return FALSE; + palPtr = (PALOBJ*) palGDI; + + if (pGDev->flFlags & PDEV_GAMMARAMP_TABLE) + palGDI->flFlags |= PAL_GAMMACORRECTION; + else + palGDI->flFlags &= ~PAL_GAMMACORRECTION; + + if (!(pGDev->flFlags & PDEV_DRIVER_PUNTED_CALL)) // No punting, we hook + { + // BMF_8BPP only! + // PALOBJ_cGetColors check mode flags and update Gamma Correction. + // Set the HDEV to pal and go. + palGDI->hPDev = hPDev; + Ret = pGDev->DriverFunctions.SetPalette(pGDev->dhpdev, + palPtr, + 0, + 0, + palGDI->NumColors); + } + PALETTE_ShareUnlockPalette(palGDI); + return Ret; + } + else + return FALSE; } // @@ -274,125 +277,134 @@ FASTCALL IntSetDeviceGammaRamp(HDEV hPDev, PGAMMARAMP Ramp, BOOL Test) { - WORD IcmGR, i, R, G, B; - BOOL Ret = FALSE, TstPeak; - PPDEVOBJ pGDev = (PPDEVOBJ) hPDev; - - if (!hPDev) return FALSE; - - if (!(pGDev->flFlags & PDEV_DISPLAY )) return FALSE; - - if ((pGDev->devinfo.iDitherFormat == BMF_8BPP) || - (pGDev->devinfo.iDitherFormat == BMF_16BPP) || - (pGDev->devinfo.iDitherFormat == BMF_24BPP) || - (pGDev->devinfo.iDitherFormat == BMF_32BPP)) - { - if (!pGDev->DriverFunctions.IcmSetDeviceGammaRamp) - { // No driver support - if (!(pGDev->devinfo.flGraphicsCaps2 & GCAPS2_CHANGEGAMMARAMP)) - { // Driver does not support Gamma Ramp, so test to see we - // have BMF_8BPP only and palette operation support. - if ((pGDev->devinfo.iDitherFormat != BMF_8BPP) || - !(pGDev->gdiinfo.flRaster & RC_PALETTE)) return FALSE; - } - } - - if (pGDev->flFlags & PDEV_GAMMARAMP_TABLE) - if (RtlCompareMemory( pGDev->pvGammaRamp, Ramp, sizeof(GAMMARAMP)) == - sizeof(GAMMARAMP)) return TRUE; - // Verify Ramp is inside range. - IcmGR = -IcmGammaRangeSet; - TstPeak = (Test == FALSE); - for (i = 0; i < 256; i++) - { - R = Ramp->Red[i] / 256; - G = Ramp->Green[i] / 256; - B = Ramp->Blue[i] / 256; - if ( R >= IcmGR) - { - if ( R <= IcmGammaRangeSet + i) + WORD IcmGR, i, R, G, B; + BOOL Ret = FALSE, TstPeak; + PPDEVOBJ pGDev = (PPDEVOBJ) hPDev; + + if (!hPDev) return FALSE; + + if (!(pGDev->flFlags & PDEV_DISPLAY )) return FALSE; + + if ((pGDev->devinfo.iDitherFormat == BMF_8BPP) || + (pGDev->devinfo.iDitherFormat == BMF_16BPP) || + (pGDev->devinfo.iDitherFormat == BMF_24BPP) || + (pGDev->devinfo.iDitherFormat == BMF_32BPP)) + { + if (!pGDev->DriverFunctions.IcmSetDeviceGammaRamp) + { + // No driver support + if (!(pGDev->devinfo.flGraphicsCaps2 & GCAPS2_CHANGEGAMMARAMP)) { - if ( G >= IcmGR && - (G <= IcmGammaRangeSet + i) && - B >= IcmGR && - (B <= IcmGammaRangeSet + i) ) continue; + // Driver does not support Gamma Ramp, so test to see we + // have BMF_8BPP only and palette operation support. + if ((pGDev->devinfo.iDitherFormat != BMF_8BPP) || + !(pGDev->gdiinfo.flRaster & RC_PALETTE)) return FALSE; } - } - if (Test) return Ret; // Don't set and return. - // No test override, check max range - if (TstPeak) - { - if ( R != (IcmGR * 256) || - G != (IcmGR * 256) || - B != (IcmGR * 256) ) TstPeak = FALSE; // W/i range. - } - } - // ReactOS allocates a ramp even if it is 8BPP and Palette only. - // This way we have a record of the change in memory. - if (!pGDev->pvGammaRamp && !(pGDev->flFlags & PDEV_GAMMARAMP_TABLE)) - { // If the above is true and we have nothing allocated, create it. - pGDev->pvGammaRamp = ExAllocatePoolWithTag(PagedPool, sizeof(GAMMARAMP), GDITAG_ICM); - pGDev->flFlags |= PDEV_GAMMARAMP_TABLE; - } - if (pGDev->pvGammaRamp) - RtlCopyMemory( pGDev->pvGammaRamp, Ramp, sizeof(GAMMARAMP)); - - Ret = UpdateDeviceGammaRamp(hPDev); - - return Ret; - } - else - return Ret; -} - -BOOL -APIENTRY -NtGdiSetDeviceGammaRamp(HDC hDC, - LPVOID Ramp) -{ - BOOL Ret; - PDC dc; - NTSTATUS Status = STATUS_SUCCESS; - PGAMMARAMP SafeRamp; - if (!Ramp) return FALSE; - - dc = DC_LockDc(hDC); - if (!dc) - { - EngSetLastError(ERROR_INVALID_HANDLE); - return FALSE; - } - - SafeRamp = ExAllocatePoolWithTag(PagedPool, sizeof(GAMMARAMP), GDITAG_ICM); - if (!SafeRamp) - { - DC_UnlockDc(dc); - EngSetLastError(STATUS_NO_MEMORY); - return FALSE; - } - _SEH2_TRY - { - ProbeForRead(Ramp, sizeof(GAMMARAMP), 1); - RtlCopyMemory(SafeRamp, Ramp, sizeof(GAMMARAMP)); - } - _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) - { - Status = _SEH2_GetExceptionCode(); - } - _SEH2_END; - - if (!NT_SUCCESS(Status)) - { - DC_UnlockDc(dc); - ExFreePoolWithTag(SafeRamp, GDITAG_ICM); - SetLastNtError(Status); - return FALSE; - } - - Ret = IntSetDeviceGammaRamp((HDEV)dc->ppdev, SafeRamp, TRUE); - DC_UnlockDc(dc); - ExFreePoolWithTag(SafeRamp, GDITAG_ICM); - return Ret; + } + + if (pGDev->flFlags & PDEV_GAMMARAMP_TABLE) + { + if (RtlCompareMemory(pGDev->pvGammaRamp, Ramp, sizeof(GAMMARAMP)) == + sizeof(GAMMARAMP)) return TRUE; + } + + // Verify Ramp is inside range. + IcmGR = -IcmGammaRangeSet; + TstPeak = (Test == FALSE); + for (i = 0; i < 256; i++) + { + R = Ramp->Red[i] / 256; + G = Ramp->Green[i] / 256; + B = Ramp->Blue[i] / 256; + + if (R >= IcmGR) + { + if (R <= IcmGammaRangeSet + i) + { + if ((G >= IcmGR) && + (G <= IcmGammaRangeSet + i) && + (B >= IcmGR) && + (B <= IcmGammaRangeSet + i) ) continue; + } + } + + if (Test) return Ret; // Don't set and return. + + // No test override, check max range + if (TstPeak) + { + if ((R != (IcmGR * 256)) || + (G != (IcmGR * 256)) || + (B != (IcmGR * 256)) ) TstPeak = FALSE; // W/i range. + } + } + // ReactOS allocates a ramp even if it is 8BPP and Palette only. + // This way we have a record of the change in memory. + if (!pGDev->pvGammaRamp && !(pGDev->flFlags & PDEV_GAMMARAMP_TABLE)) + { + // If the above is true and we have nothing allocated, create it. + pGDev->pvGammaRamp = ExAllocatePoolWithTag(PagedPool, sizeof(GAMMARAMP), GDITAG_ICM); + pGDev->flFlags |= PDEV_GAMMARAMP_TABLE; + } + + if (pGDev->pvGammaRamp) + RtlCopyMemory(pGDev->pvGammaRamp, Ramp, sizeof(GAMMARAMP)); + + Ret = UpdateDeviceGammaRamp(hPDev); + } + + return Ret; +} + +BOOL +APIENTRY +NtGdiSetDeviceGammaRamp( + HDC hDC, + LPVOID Ramp) +{ + BOOL Ret; + PDC dc; + NTSTATUS Status = STATUS_SUCCESS; + PGAMMARAMP SafeRamp; + if (!Ramp) return FALSE; + + dc = DC_LockDc(hDC); + if (!dc) + { + EngSetLastError(ERROR_INVALID_HANDLE); + return FALSE; + } + + SafeRamp = ExAllocatePoolWithTag(PagedPool, sizeof(GAMMARAMP), GDITAG_ICM); + if (!SafeRamp) + { + DC_UnlockDc(dc); + EngSetLastError(STATUS_NO_MEMORY); + return FALSE; + } + _SEH2_TRY + { + ProbeForRead(Ramp, sizeof(GAMMARAMP), 1); + RtlCopyMemory(SafeRamp, Ramp, sizeof(GAMMARAMP)); + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + Status = _SEH2_GetExceptionCode(); + } + _SEH2_END; + + if (!NT_SUCCESS(Status)) + { + DC_UnlockDc(dc); + ExFreePoolWithTag(SafeRamp, GDITAG_ICM); + SetLastNtError(Status); + return FALSE; + } + + Ret = IntSetDeviceGammaRamp((HDEV)dc->ppdev, SafeRamp, TRUE); + DC_UnlockDc(dc); + ExFreePoolWithTag(SafeRamp, GDITAG_ICM); + return Ret; } INT @@ -401,21 +413,21 @@ ULONG nCommand, ULONG EnableICM) // ulMode { - /* FIXME: This should be coded someday */ - if (EnableICM == ICM_OFF) - { - return ICM_OFF; - } - if (EnableICM == ICM_ON) - { - return 0; - } - if (EnableICM == ICM_QUERY) - { - return ICM_OFF; - } - - return 0; + /* FIXME: This should be coded someday */ + if (EnableICM == ICM_OFF) + { + return ICM_OFF; + } + if (EnableICM == ICM_ON) + { + return 0; + } + if (EnableICM == ICM_QUERY) + { + return ICM_OFF; + } + + return 0; } /* EOF */
11 years, 9 months
1
0
0
0
[akhaldi] 58404: [PSDK] * Remove FrameRgn and GetWindowExtEx from winuser.h.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sat Mar 2 19:37:13 2013 New Revision: 58404 URL:
http://svn.reactos.org/svn/reactos?rev=58404&view=rev
Log: [PSDK] * Remove FrameRgn and GetWindowExtEx from winuser.h. Modified: trunk/reactos/include/psdk/winuser.h Modified: trunk/reactos/include/psdk/winuser.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/winuser.h?rev…
============================================================================== --- trunk/reactos/include/psdk/winuser.h [iso-8859-1] (original) +++ trunk/reactos/include/psdk/winuser.h [iso-8859-1] Sat Mar 2 19:37:13 2013 @@ -4358,7 +4358,6 @@ BOOL WINAPI FlashWindowEx(_In_ PFLASHWINFO); #endif int WINAPI FrameRect(_In_ HDC, _In_ LPCRECT, _In_ HBRUSH); -BOOL WINAPI FrameRgn(HDC,HRGN,HBRUSH,int,int); HWND WINAPI GetActiveWindow(void); HWND WINAPI GetAncestor(_In_ HWND, _In_ UINT); SHORT WINAPI GetAsyncKeyState(_In_ int); @@ -4678,7 +4677,6 @@ HWND WINAPI GetWindow(_In_ HWND, _In_ UINT); DWORD WINAPI GetWindowContextHelpId(_In_ HWND); HDC WINAPI GetWindowDC(_In_opt_ HWND); -BOOL WINAPI GetWindowExtEx(HDC,LPSIZE); BOOL WINAPI GetWindowPlacement(_In_ HWND, _Inout_ WINDOWPLACEMENT*); BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT); int WINAPI GetWindowRgn(_In_ HWND, _In_ HRGN);
11 years, 9 months
1
0
0
0
[tkreuzer] 58403: [WIN32K] Improve formatting
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Sat Mar 2 19:25:48 2013 New Revision: 58403 URL:
http://svn.reactos.org/svn/reactos?rev=58403&view=rev
Log: [WIN32K] Improve formatting Modified: trunk/reactos/win32ss/gdi/ntgdi/pen.c Modified: trunk/reactos/win32ss/gdi/ntgdi/pen.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/pen.c?re…
============================================================================== --- trunk/reactos/win32ss/gdi/ntgdi/pen.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/ntgdi/pen.c [iso-8859-1] Sat Mar 2 19:25:48 2013 @@ -17,8 +17,8 @@ FASTCALL PEN_ShareLockPen(HGDIOBJ hobj) { - if (GDI_HANDLE_GET_TYPE(hobj) != GDILoObjType_LO_PEN_TYPE && - GDI_HANDLE_GET_TYPE(hobj) != GDILoObjType_LO_EXTPEN_TYPE) + if ((GDI_HANDLE_GET_TYPE(hobj) != GDILoObjType_LO_PEN_TYPE) && + (GDI_HANDLE_GET_TYPE(hobj) != GDILoObjType_LO_EXTPEN_TYPE)) { return NULL; } @@ -26,121 +26,122 @@ return (PBRUSH)GDIOBJ_ReferenceObjectByHandle(hobj, GDIObjType_BRUSH_TYPE); } -HPEN APIENTRY +HPEN +APIENTRY IntGdiExtCreatePen( - DWORD dwPenStyle, - DWORD dwWidth, - IN ULONG ulBrushStyle, - IN ULONG ulColor, - IN ULONG_PTR ulClientHatch, - IN ULONG_PTR ulHatch, - DWORD dwStyleCount, - PULONG pStyle, - IN ULONG cjDIB, - IN BOOL bOldStylePen, - IN OPTIONAL HBRUSH hbrush) -{ - HPEN hPen; - PBRUSH pbrushPen; - static const BYTE PatternAlternate[] = {0x55, 0x55, 0x55, 0}; - static const BYTE PatternDash[] = {0xFF, 0xFF, 0xC0, 0}; - static const BYTE PatternDot[] = {0xE3, 0x8E, 0x38, 0}; - static const BYTE PatternDashDot[] = {0xFF, 0x81, 0xC0, 0}; - static const BYTE PatternDashDotDot[] = {0xFF, 0x8E, 0x38, 0}; - - dwWidth = abs(dwWidth); - - if ( (dwPenStyle & PS_STYLE_MASK) == PS_NULL) - { - return StockObjects[NULL_PEN]; - } - - if (bOldStylePen) - { - pbrushPen = PEN_AllocPenWithHandle(); - } - else - { - pbrushPen = PEN_AllocExtPenWithHandle(); - } - - if (!pbrushPen) - { - EngSetLastError(ERROR_NOT_ENOUGH_MEMORY); - DPRINT("Can't allocate pen\n"); - return 0; - } - hPen = pbrushPen->BaseObject.hHmgr; - - // If nWidth is zero, the pen is a single pixel wide, regardless of the current transformation. - if ((bOldStylePen) && (!dwWidth) && (dwPenStyle & PS_STYLE_MASK) != PS_SOLID) - dwWidth = 1; - - pbrushPen->ptPenWidth.x = dwWidth; - pbrushPen->ptPenWidth.y = 0; - pbrushPen->ulPenStyle = dwPenStyle; - pbrushPen->BrushAttr.lbColor = ulColor; - pbrushPen->ulStyle = ulBrushStyle; - // FIXME: Copy the bitmap first ? - pbrushPen->hbmClient = (HANDLE)ulClientHatch; - pbrushPen->dwStyleCount = dwStyleCount; - pbrushPen->pStyle = pStyle; - - pbrushPen->flAttrs = bOldStylePen? BR_IS_OLDSTYLEPEN : BR_IS_PEN; - - // If dwPenStyle is PS_COSMETIC, the width must be set to 1. - if ( !(bOldStylePen) && ((dwPenStyle & PS_TYPE_MASK) == PS_COSMETIC) && ( dwWidth != 1) ) - goto ExitCleanup; - - switch (dwPenStyle & PS_STYLE_MASK) - { - case PS_NULL: - pbrushPen->flAttrs |= BR_IS_NULL; - break; - - case PS_SOLID: - pbrushPen->flAttrs |= BR_IS_SOLID; - break; - - case PS_ALTERNATE: - pbrushPen->flAttrs |= BR_IS_BITMAP; - pbrushPen->hbmPattern = GreCreateBitmap(24, 1, 1, 1, (LPBYTE)PatternAlternate); - break; - - case PS_DOT: - pbrushPen->flAttrs |= BR_IS_BITMAP; - pbrushPen->hbmPattern = GreCreateBitmap(24, 1, 1, 1, (LPBYTE)PatternDot); - break; - - case PS_DASH: - pbrushPen->flAttrs |= BR_IS_BITMAP; - pbrushPen->hbmPattern = GreCreateBitmap(24, 1, 1, 1, (LPBYTE)PatternDash); - break; - - case PS_DASHDOT: - pbrushPen->flAttrs |= BR_IS_BITMAP; - pbrushPen->hbmPattern = GreCreateBitmap(24, 1, 1, 1, (LPBYTE)PatternDashDot); - break; - - case PS_DASHDOTDOT: - pbrushPen->flAttrs |= BR_IS_BITMAP; - pbrushPen->hbmPattern = GreCreateBitmap(24, 1, 1, 1, (LPBYTE)PatternDashDotDot); - break; - - case PS_INSIDEFRAME: - pbrushPen->flAttrs |= (BR_IS_SOLID|BR_IS_INSIDEFRAME); - break; - - case PS_USERSTYLE: - if ((dwPenStyle & PS_TYPE_MASK) == PS_COSMETIC) - { + DWORD dwPenStyle, + DWORD dwWidth, + IN ULONG ulBrushStyle, + IN ULONG ulColor, + IN ULONG_PTR ulClientHatch, + IN ULONG_PTR ulHatch, + DWORD dwStyleCount, + PULONG pStyle, + IN ULONG cjDIB, + IN BOOL bOldStylePen, + IN OPTIONAL HBRUSH hbrush) +{ + HPEN hPen; + PBRUSH pbrushPen; + static const BYTE PatternAlternate[] = {0x55, 0x55, 0x55, 0}; + static const BYTE PatternDash[] = {0xFF, 0xFF, 0xC0, 0}; + static const BYTE PatternDot[] = {0xE3, 0x8E, 0x38, 0}; + static const BYTE PatternDashDot[] = {0xFF, 0x81, 0xC0, 0}; + static const BYTE PatternDashDotDot[] = {0xFF, 0x8E, 0x38, 0}; + + dwWidth = abs(dwWidth); + + if ( (dwPenStyle & PS_STYLE_MASK) == PS_NULL) + { + return StockObjects[NULL_PEN]; + } + + if (bOldStylePen) + { + pbrushPen = PEN_AllocPenWithHandle(); + } + else + { + pbrushPen = PEN_AllocExtPenWithHandle(); + } + + if (!pbrushPen) + { + EngSetLastError(ERROR_NOT_ENOUGH_MEMORY); + DPRINT("Can't allocate pen\n"); + return 0; + } + hPen = pbrushPen->BaseObject.hHmgr; + + // If nWidth is zero, the pen is a single pixel wide, regardless of the current transformation. + if ((bOldStylePen) && (!dwWidth) && ((dwPenStyle & PS_STYLE_MASK) != PS_SOLID)) + dwWidth = 1; + + pbrushPen->ptPenWidth.x = dwWidth; + pbrushPen->ptPenWidth.y = 0; + pbrushPen->ulPenStyle = dwPenStyle; + pbrushPen->BrushAttr.lbColor = ulColor; + pbrushPen->ulStyle = ulBrushStyle; + // FIXME: Copy the bitmap first ? + pbrushPen->hbmClient = (HANDLE)ulClientHatch; + pbrushPen->dwStyleCount = dwStyleCount; + pbrushPen->pStyle = pStyle; + + pbrushPen->flAttrs = bOldStylePen ? BR_IS_OLDSTYLEPEN : BR_IS_PEN; + + // If dwPenStyle is PS_COSMETIC, the width must be set to 1. + if ( !(bOldStylePen) && ((dwPenStyle & PS_TYPE_MASK) == PS_COSMETIC) && ( dwWidth != 1) ) + goto ExitCleanup; + + switch (dwPenStyle & PS_STYLE_MASK) + { + case PS_NULL: + pbrushPen->flAttrs |= BR_IS_NULL; + break; + + case PS_SOLID: + pbrushPen->flAttrs |= BR_IS_SOLID; + break; + + case PS_ALTERNATE: + pbrushPen->flAttrs |= BR_IS_BITMAP; + pbrushPen->hbmPattern = GreCreateBitmap(24, 1, 1, 1, (LPBYTE)PatternAlternate); + break; + + case PS_DOT: + pbrushPen->flAttrs |= BR_IS_BITMAP; + pbrushPen->hbmPattern = GreCreateBitmap(24, 1, 1, 1, (LPBYTE)PatternDot); + break; + + case PS_DASH: + pbrushPen->flAttrs |= BR_IS_BITMAP; + pbrushPen->hbmPattern = GreCreateBitmap(24, 1, 1, 1, (LPBYTE)PatternDash); + break; + + case PS_DASHDOT: + pbrushPen->flAttrs |= BR_IS_BITMAP; + pbrushPen->hbmPattern = GreCreateBitmap(24, 1, 1, 1, (LPBYTE)PatternDashDot); + break; + + case PS_DASHDOTDOT: + pbrushPen->flAttrs |= BR_IS_BITMAP; + pbrushPen->hbmPattern = GreCreateBitmap(24, 1, 1, 1, (LPBYTE)PatternDashDotDot); + break; + + case PS_INSIDEFRAME: + pbrushPen->flAttrs |= (BR_IS_SOLID | BR_IS_INSIDEFRAME); + break; + + case PS_USERSTYLE: + if ((dwPenStyle & PS_TYPE_MASK) == PS_COSMETIC) + { /* FIXME: PS_USERSTYLE workaround */ DPRINT1("PS_COSMETIC | PS_USERSTYLE not handled\n"); pbrushPen->flAttrs |= BR_IS_SOLID; break; - } - else - { + } + else + { UINT i; BOOL has_neg = FALSE, all_zero = TRUE; @@ -154,220 +155,228 @@ { goto ExitCleanup; } - } - /* FIXME: What style here? */ - pbrushPen->flAttrs |= 0; - break; - - default: - DPRINT1("IntGdiExtCreatePen unknown penstyle %x\n", dwPenStyle); - } - PEN_UnlockPen(pbrushPen); - return hPen; + } + /* FIXME: What style here? */ + pbrushPen->flAttrs |= 0; + break; + + default: + DPRINT1("IntGdiExtCreatePen unknown penstyle %x\n", dwPenStyle); + } + + PEN_UnlockPen(pbrushPen); + return hPen; ExitCleanup: - EngSetLastError(ERROR_INVALID_PARAMETER); - pbrushPen->pStyle = NULL; - GDIOBJ_vDeleteObject(&pbrushPen->BaseObject); - return NULL; -} - -VOID FASTCALL + EngSetLastError(ERROR_INVALID_PARAMETER); + pbrushPen->pStyle = NULL; + GDIOBJ_vDeleteObject(&pbrushPen->BaseObject); + + return NULL; +} + +VOID +FASTCALL IntGdiSetSolidPenColor(HPEN hPen, COLORREF Color) { - PBRUSH pbrPen; - - pbrPen = PEN_ShareLockPen(hPen); - if (pbrPen) - { - if (pbrPen->flAttrs & BR_IS_SOLID) - { - pbrPen->BrushAttr.lbColor = Color & 0xFFFFFF; - } - PEN_ShareUnlockPen(pbrPen); - } -} - -INT APIENTRY + PBRUSH pbrPen; + + pbrPen = PEN_ShareLockPen(hPen); + if (pbrPen) + { + if (pbrPen->flAttrs & BR_IS_SOLID) + { + pbrPen->BrushAttr.lbColor = Color & 0xFFFFFF; + } + PEN_ShareUnlockPen(pbrPen); + } +} + +INT +APIENTRY PEN_GetObject(PBRUSH pbrushPen, INT cbCount, PLOGPEN pBuffer) { - PLOGPEN pLogPen; - PEXTLOGPEN pExtLogPen; - INT cbRetCount; - - if (pbrushPen->flAttrs & BR_IS_OLDSTYLEPEN) - { - cbRetCount = sizeof(LOGPEN); - if (pBuffer) - { - - if (cbCount < cbRetCount) return 0; - - if ( (pbrushPen->ulPenStyle & PS_STYLE_MASK) == PS_NULL && - cbCount == sizeof(EXTLOGPEN)) - { + PLOGPEN pLogPen; + PEXTLOGPEN pExtLogPen; + INT cbRetCount; + + if (pbrushPen->flAttrs & BR_IS_OLDSTYLEPEN) + { + cbRetCount = sizeof(LOGPEN); + if (pBuffer) + { + if (cbCount < cbRetCount) return 0; + + if (((pbrushPen->ulPenStyle & PS_STYLE_MASK) == PS_NULL) && + (cbCount == sizeof(EXTLOGPEN))) + { + pExtLogPen = (PEXTLOGPEN)pBuffer; + pExtLogPen->elpPenStyle = pbrushPen->ulPenStyle; + pExtLogPen->elpWidth = 0; + pExtLogPen->elpBrushStyle = pbrushPen->ulStyle; + pExtLogPen->elpColor = pbrushPen->BrushAttr.lbColor; + pExtLogPen->elpHatch = 0; + pExtLogPen->elpNumEntries = 0; + cbRetCount = sizeof(EXTLOGPEN); + } + else + { + pLogPen = (PLOGPEN)pBuffer; + pLogPen->lopnWidth = pbrushPen->ptPenWidth; + pLogPen->lopnStyle = pbrushPen->ulPenStyle; + pLogPen->lopnColor = pbrushPen->BrushAttr.lbColor; + } + } + } + else + { + // FIXME: Can we trust in dwStyleCount being <= 16? + cbRetCount = sizeof(EXTLOGPEN) - sizeof(DWORD) + pbrushPen->dwStyleCount * sizeof(DWORD); + if (pBuffer) + { + ULONG i; + + if (cbCount < cbRetCount) return 0; pExtLogPen = (PEXTLOGPEN)pBuffer; pExtLogPen->elpPenStyle = pbrushPen->ulPenStyle; - pExtLogPen->elpWidth = 0; + pExtLogPen->elpWidth = pbrushPen->ptPenWidth.x; pExtLogPen->elpBrushStyle = pbrushPen->ulStyle; pExtLogPen->elpColor = pbrushPen->BrushAttr.lbColor; - pExtLogPen->elpHatch = 0; - pExtLogPen->elpNumEntries = 0; - cbRetCount = sizeof(EXTLOGPEN); - } - else - { - pLogPen = (PLOGPEN)pBuffer; - pLogPen->lopnWidth = pbrushPen->ptPenWidth; - pLogPen->lopnStyle = pbrushPen->ulPenStyle; - pLogPen->lopnColor = pbrushPen->BrushAttr.lbColor; - } - } - } - else - { - // FIXME: Can we trust in dwStyleCount being <= 16? - cbRetCount = sizeof(EXTLOGPEN) - sizeof(DWORD) + pbrushPen->dwStyleCount * sizeof(DWORD); - if (pBuffer) - { - ULONG i; - - if (cbCount < cbRetCount) return 0; - pExtLogPen = (PEXTLOGPEN)pBuffer; - pExtLogPen->elpPenStyle = pbrushPen->ulPenStyle; - pExtLogPen->elpWidth = pbrushPen->ptPenWidth.x; - pExtLogPen->elpBrushStyle = pbrushPen->ulStyle; - pExtLogPen->elpColor = pbrushPen->BrushAttr.lbColor; - pExtLogPen->elpHatch = (ULONG_PTR)pbrushPen->hbmClient; - pExtLogPen->elpNumEntries = pbrushPen->dwStyleCount; - for (i = 0; i < pExtLogPen->elpNumEntries; i++) - { - pExtLogPen->elpStyleEntry[i] = pbrushPen->pStyle[i]; - } - } - } - - return cbRetCount; + pExtLogPen->elpHatch = (ULONG_PTR)pbrushPen->hbmClient; + pExtLogPen->elpNumEntries = pbrushPen->dwStyleCount; + for (i = 0; i < pExtLogPen->elpNumEntries; i++) + { + pExtLogPen->elpStyleEntry[i] = pbrushPen->pStyle[i]; + } + } + } + + return cbRetCount; } /* PUBLIC FUNCTIONS ***********************************************************/ -HPEN APIENTRY +HPEN +APIENTRY NtGdiCreatePen( - INT PenStyle, - INT Width, - COLORREF Color, - IN HBRUSH hbr) -{ - if ( PenStyle < PS_SOLID || PenStyle > PS_INSIDEFRAME ) - { - EngSetLastError(ERROR_INVALID_PARAMETER); - return NULL; - } - - return IntGdiExtCreatePen(PenStyle, - Width, - BS_SOLID, - Color, - 0, - 0, - 0, - NULL, - 0, - TRUE, - hbr); -} - -HPEN APIENTRY + INT PenStyle, + INT Width, + COLORREF Color, + IN HBRUSH hbr) +{ + if ((PenStyle < PS_SOLID) ||( PenStyle > PS_INSIDEFRAME)) + { + EngSetLastError(ERROR_INVALID_PARAMETER); + return NULL; + } + + return IntGdiExtCreatePen(PenStyle, + Width, + BS_SOLID, + Color, + 0, + 0, + 0, + NULL, + 0, + TRUE, + hbr); +} + +HPEN +APIENTRY NtGdiExtCreatePen( - DWORD dwPenStyle, - DWORD ulWidth, - IN ULONG ulBrushStyle, - IN ULONG ulColor, - IN ULONG_PTR ulClientHatch, - IN ULONG_PTR ulHatch, - DWORD dwStyleCount, - PULONG pUnsafeStyle, - IN ULONG cjDIB, - IN BOOL bOldStylePen, - IN OPTIONAL HBRUSH hBrush) -{ - NTSTATUS Status = STATUS_SUCCESS; - DWORD* pSafeStyle = NULL; - HPEN hPen; - - if ((int)dwStyleCount < 0) return 0; - if (dwStyleCount > 16) - { - EngSetLastError(ERROR_INVALID_PARAMETER); - return 0; - } - - if (dwStyleCount > 0) - { - pSafeStyle = ExAllocatePoolWithTag(NonPagedPool, dwStyleCount * sizeof(DWORD), GDITAG_PENSTYLE); - if (!pSafeStyle) - { - SetLastNtError(ERROR_NOT_ENOUGH_MEMORY); - return 0; - } - _SEH2_TRY - { - ProbeForRead(pUnsafeStyle, dwStyleCount * sizeof(DWORD), 1); - RtlCopyMemory(pSafeStyle, - pUnsafeStyle, - dwStyleCount * sizeof(DWORD)); - } - _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) - { - Status = _SEH2_GetExceptionCode(); - } - _SEH2_END - if(!NT_SUCCESS(Status)) - { - SetLastNtError(Status); - ExFreePoolWithTag(pSafeStyle, GDITAG_PENSTYLE); - return 0; - } - } - - if (ulBrushStyle == BS_PATTERN) - { - _SEH2_TRY - { - ProbeForRead((PVOID)ulHatch, cjDIB, 1); - } - _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) - { - Status = _SEH2_GetExceptionCode(); - } - _SEH2_END - if(!NT_SUCCESS(Status)) - { - SetLastNtError(Status); - if (pSafeStyle) ExFreePoolWithTag(pSafeStyle, GDITAG_PENSTYLE); - return 0; - } - } - - hPen = IntGdiExtCreatePen(dwPenStyle, - ulWidth, - ulBrushStyle, - ulColor, - ulClientHatch, - ulHatch, - dwStyleCount, - pSafeStyle, - cjDIB, - bOldStylePen, - hBrush); - - if (!hPen && pSafeStyle) - { - ExFreePoolWithTag(pSafeStyle, GDITAG_PENSTYLE); - } - return hPen; + DWORD dwPenStyle, + DWORD ulWidth, + IN ULONG ulBrushStyle, + IN ULONG ulColor, + IN ULONG_PTR ulClientHatch, + IN ULONG_PTR ulHatch, + DWORD dwStyleCount, + PULONG pUnsafeStyle, + IN ULONG cjDIB, + IN BOOL bOldStylePen, + IN OPTIONAL HBRUSH hBrush) +{ + NTSTATUS Status = STATUS_SUCCESS; + DWORD* pSafeStyle = NULL; + HPEN hPen; + + if ((int)dwStyleCount < 0) return 0; + if (dwStyleCount > 16) + { + EngSetLastError(ERROR_INVALID_PARAMETER); + return 0; + } + + if (dwStyleCount > 0) + { + pSafeStyle = ExAllocatePoolWithTag(NonPagedPool, + dwStyleCount * sizeof(DWORD), + GDITAG_PENSTYLE); + if (!pSafeStyle) + { + SetLastNtError(ERROR_NOT_ENOUGH_MEMORY); + return 0; + } + _SEH2_TRY + { + ProbeForRead(pUnsafeStyle, dwStyleCount * sizeof(DWORD), 1); + RtlCopyMemory(pSafeStyle, + pUnsafeStyle, + dwStyleCount * sizeof(DWORD)); + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + Status = _SEH2_GetExceptionCode(); + } + _SEH2_END + if(!NT_SUCCESS(Status)) + { + SetLastNtError(Status); + ExFreePoolWithTag(pSafeStyle, GDITAG_PENSTYLE); + return 0; + } + } + + if (ulBrushStyle == BS_PATTERN) + { + _SEH2_TRY + { + ProbeForRead((PVOID)ulHatch, cjDIB, 1); + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + Status = _SEH2_GetExceptionCode(); + } + _SEH2_END + if(!NT_SUCCESS(Status)) + { + SetLastNtError(Status); + if (pSafeStyle) ExFreePoolWithTag(pSafeStyle, GDITAG_PENSTYLE); + return 0; + } + } + + hPen = IntGdiExtCreatePen(dwPenStyle, + ulWidth, + ulBrushStyle, + ulColor, + ulClientHatch, + ulHatch, + dwStyleCount, + pSafeStyle, + cjDIB, + bOldStylePen, + hBrush); + + if (!hPen && pSafeStyle) + { + ExFreePoolWithTag(pSafeStyle, GDITAG_PENSTYLE); + } + + return hPen; } /* EOF */
11 years, 9 months
1
0
0
0
[akhaldi] 58402: [WIN32K] * Avoid inconsistent annotations for EngSaveFloatingPointState.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sat Mar 2 19:22:27 2013 New Revision: 58402 URL:
http://svn.reactos.org/svn/reactos?rev=58402&view=rev
Log: [WIN32K] * Avoid inconsistent annotations for EngSaveFloatingPointState. Modified: trunk/reactos/win32ss/gdi/eng/float.c Modified: trunk/reactos/win32ss/gdi/eng/float.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/eng/float.c?re…
============================================================================== --- trunk/reactos/win32ss/gdi/eng/float.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/eng/float.c [iso-8859-1] Sat Mar 2 19:22:27 2013 @@ -34,8 +34,8 @@ ULONG APIENTRY EngSaveFloatingPointState( - _Out_ VOID *Buffer, - _In_ ULONG BufferSize) + VOID *Buffer, + ULONG BufferSize) { KFLOATING_SAVE TempBuffer; NTSTATUS Status;
11 years, 9 months
1
0
0
0
← Newer
1
...
20
21
22
23
24
25
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
Results per page:
10
25
50
100
200