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
December 2015
----- 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
12 participants
252 discussions
Start a n
N
ew thread
[hbelusca] 70347: [CLIPBRD] - Add support for scrolling with the mouse wheel, by Ricardo Hanke. - No need to check for CloseClipboard failure & display an error message if the clipboard was success...
by hbelusca@svn.reactos.org
Author: hbelusca Date: Mon Dec 14 22:55:55 2015 New Revision: 70347 URL:
http://svn.reactos.org/svn/reactos?rev=70347&view=rev
Log: [CLIPBRD] - Add support for scrolling with the mouse wheel, by Ricardo Hanke. - No need to check for CloseClipboard failure & display an error message if the clipboard was successfully opened just before. - Use ARRAYSIZE macro instead of hardcoding the length of available clipboard format list. CORE-10679 Modified: trunk/reactos/base/applications/clipbrd/clipbrd.c trunk/reactos/base/applications/clipbrd/cliputils.c trunk/reactos/base/applications/clipbrd/precomp.h trunk/reactos/base/applications/clipbrd/scrollutils.c trunk/reactos/base/applications/clipbrd/scrollutils.h Modified: trunk/reactos/base/applications/clipbrd/clipbrd.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/clipbrd/…
============================================================================== --- trunk/reactos/base/applications/clipbrd/clipbrd.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/clipbrd/clipbrd.c [iso-8859-1] Mon Dec 14 22:55:55 2015 @@ -12,6 +12,20 @@ CLIPBOARD_GLOBALS Globals; SCROLLSTATE Scrollstate; + +static void UpdateLinesToScroll(void) +{ + UINT uLinesToScroll; + + if (!SystemParametersInfo(SPI_GETWHEELSCROLLLINES, 0, &uLinesToScroll, 0)) + { + Globals.uLinesToScroll = 3; + } + else + { + Globals.uLinesToScroll = uLinesToScroll; + } +} static void SaveClipboardToFile(void) { @@ -122,7 +136,7 @@ } else { - Globals.uDisplayFormat = uFormat; + Globals.uDisplayFormat = uFormat; } if (Globals.hDspBmp) @@ -341,6 +355,12 @@ case WM_KEYDOWN: { HandleKeyboardScrollEvents(hWnd, uMsg, wParam, lParam); + break; + } + + case WM_MOUSEWHEEL: + { + HandleMouseScrollEvents(hWnd, uMsg, wParam, lParam, &Scrollstate); break; } @@ -472,6 +492,15 @@ case WM_SYSCOLORCHANGE: { SetDisplayFormat(Globals.uDisplayFormat); + break; + } + + case WM_SETTINGCHANGE: + { + if (wParam == SPI_SETWHEELSCROLLLINES) + { + UpdateLinesToScroll(); + } break; } @@ -545,6 +574,8 @@ ShowLastWin32Error(Globals.hMainWnd); } + UpdateLinesToScroll(); + while (GetMessageW(&msg, 0, 0, 0)) { if (!TranslateAcceleratorW(Globals.hMainWnd, hAccel, &msg)) Modified: trunk/reactos/base/applications/clipbrd/cliputils.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/clipbrd/…
============================================================================== --- trunk/reactos/base/applications/clipbrd/cliputils.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/clipbrd/cliputils.c [iso-8859-1] Mon Dec 14 22:55:55 2015 @@ -108,17 +108,21 @@ ShowLastWin32Error(Globals.hMainWnd); } - if (!CloseClipboard()) - { - ShowLastWin32Error(Globals.hMainWnd); - } + CloseClipboard(); } UINT GetAutomaticClipboardFormat(void) { - UINT uFormatList[] = {CF_UNICODETEXT, CF_ENHMETAFILE, CF_METAFILEPICT, CF_DIBV5, CF_DIB, CF_BITMAP}; + static UINT uFormatList[] = { + CF_UNICODETEXT, + CF_ENHMETAFILE, + CF_METAFILEPICT, + CF_DIBV5, + CF_DIB, + CF_BITMAP + }; - return GetPriorityClipboardFormat(uFormatList, 6); + return GetPriorityClipboardFormat(uFormatList, ARRAYSIZE(uFormatList)); } BOOL IsClipboardFormatSupported(UINT uFormat) Modified: trunk/reactos/base/applications/clipbrd/precomp.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/clipbrd/…
============================================================================== --- trunk/reactos/base/applications/clipbrd/precomp.h [iso-8859-1] (original) +++ trunk/reactos/base/applications/clipbrd/precomp.h [iso-8859-1] Mon Dec 14 22:55:55 2015 @@ -2,6 +2,8 @@ #define _CLIPBRD_PCH_ // #pragma once + +#include <limits.h> #include <windef.h> #include <winbase.h> @@ -29,6 +31,7 @@ HMENU hMenu; UINT uDisplayFormat; UINT uCheckedItem; + UINT uLinesToScroll; HBITMAP hDspBmp; } CLIPBOARD_GLOBALS; Modified: trunk/reactos/base/applications/clipbrd/scrollutils.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/clipbrd/…
============================================================================== --- trunk/reactos/base/applications/clipbrd/scrollutils.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/clipbrd/scrollutils.c [iso-8859-1] Mon Dec 14 22:55:55 2015 @@ -70,6 +70,53 @@ } } +void HandleMouseScrollEvents(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LPSCROLLSTATE state) +{ + SCROLLINFO si; + int Delta; + int NewPos; + + si.cbSize = sizeof(si); + si.fMask = SIF_PAGE; + GetScrollInfo(hWnd, SB_VERT, &si); + + if (Globals.uLinesToScroll == WHEEL_PAGESCROLL) + { + NewPos = si.nPage; + } + else + { + NewPos = Globals.uLinesToScroll * 5; + } + + if (GET_WHEEL_DELTA_WPARAM(wParam) > 0) + { + NewPos = state->CurrentY - NewPos; + } + else + { + NewPos = state->CurrentY + NewPos; + } + + NewPos = min(state->MaxY, max(0, NewPos)); + + if (NewPos == state->CurrentY) + { + return; + } + + Delta = NewPos - state->CurrentY; + + state->CurrentY = NewPos; + + ScrollWindowEx(hWnd, 0, -Delta, NULL, NULL, NULL, NULL, SW_INVALIDATE); + + si.cbSize = sizeof(si); + si.fMask = SIF_POS; + si.nPos = state->CurrentY; + SetScrollInfo(hWnd, SB_VERT, &si, TRUE); +} + void HandleHorizontalScrollEvents(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LPSCROLLSTATE state) { SCROLLINFO si; Modified: trunk/reactos/base/applications/clipbrd/scrollutils.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/clipbrd/…
============================================================================== --- trunk/reactos/base/applications/clipbrd/scrollutils.h [iso-8859-1] (original) +++ trunk/reactos/base/applications/clipbrd/scrollutils.h [iso-8859-1] Mon Dec 14 22:55:55 2015 @@ -15,6 +15,7 @@ } SCROLLSTATE, *LPSCROLLSTATE; void HandleKeyboardScrollEvents(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); +void HandleMouseScrollEvents(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LPSCROLLSTATE state); void HandleHorizontalScrollEvents(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LPSCROLLSTATE state); void HandleVerticalScrollEvents(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LPSCROLLSTATE state); void UpdateWindowScrollState(HWND hWnd, HBITMAP hBmp, LPSCROLLSTATE lpState);
9 years
1
0
0
0
[fireball] 70346: [ARWINSS] - Reduce patch to trunk by 1Kb by removing unnecessary debug prints and other misc stuff.
by fireball@svn.reactos.org
Author: fireball Date: Mon Dec 14 12:14:01 2015 New Revision: 70346 URL:
http://svn.reactos.org/svn/reactos?rev=70346&view=rev
Log: [ARWINSS] - Reduce patch to trunk by 1Kb by removing unnecessary debug prints and other misc stuff. Modified: branches/arwinss/trunk.diff Modified: branches/arwinss/trunk.diff URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/trunk.diff?rev=70346&r1…
============================================================================== --- branches/arwinss/trunk.diff [iso-8859-1] (original) +++ branches/arwinss/trunk.diff [iso-8859-1] Mon Dec 14 12:14:01 2015 @@ -1,6 +1,6 @@ Index: base/system/winlogon/winlogon.c =================================================================== ---- base/system/winlogon/winlogon.c (revision 70340) +--- base/system/winlogon/winlogon.c (revision 70342) +++ base/system/winlogon/winlogon.c (working copy) @@ -397,7 +397,7 @@ HandleShutdown(WLSession, WLX_SAS_ACTION_SHUTDOWN_REBOOT); @@ -13,7 +13,7 @@ #if 0 Index: cmake/baseaddress.cmake =================================================================== ---- cmake/baseaddress.cmake (revision 70340) +--- cmake/baseaddress.cmake (revision 70342) +++ cmake/baseaddress.cmake (working copy) @@ -2,9 +2,9 @@ set(baseaddress_kernel32 0x7c750000) @@ -30,7 +30,7 @@ set(baseaddress_iphlpapi 0x7c2b0000) Index: cmake/config.cmake =================================================================== ---- cmake/config.cmake (revision 70340) +--- cmake/config.cmake (revision 70342) +++ cmake/config.cmake (working copy) @@ -58,6 +58,9 @@ "Whether to compile support for ELF files. @@ -44,7 +44,7 @@ If you live in a country where software patents are valid/apply, don't Index: CMakeLists.txt =================================================================== ---- CMakeLists.txt (revision 70340) +--- CMakeLists.txt (revision 70342) +++ CMakeLists.txt (working copy) @@ -165,6 +165,10 @@ add_definitions(-D_WINKD_=1) @@ -67,22 +67,9 @@ # Create the registry hives create_registry_hives() -Index: dll/win32/kernel32/client/dllmain.c -=================================================================== ---- dll/win32/kernel32/client/dllmain.c (revision 70340) -+++ dll/win32/kernel32/client/dllmain.c (working copy) -@@ -131,7 +131,7 @@ - SessionId, - WIN_OBJ_DIR); - } -- -+DPRINT1("About to connect to CSR!\n"); - /* Connect to the Base Server */ - Status = CsrClientConnectToServer(SessionDir, - BASESRV_SERVERDLL_INDEX, Index: dll/win32/msgina/gui.c =================================================================== ---- dll/win32/msgina/gui.c (revision 70340) +--- dll/win32/msgina/gui.c (revision 70342) +++ dll/win32/msgina/gui.c (working copy) @@ -73,6 +73,7 @@ @@ -113,7 +100,7 @@ /* Index: include/asm/syscalls.inc =================================================================== ---- include/asm/syscalls.inc (revision 70340) +--- include/asm/syscalls.inc (revision 70342) +++ include/asm/syscalls.inc (working copy) @@ -1,4 +1,4 @@ - @@ -325,7 +312,7 @@ -#endif Index: include/psdk/winddi.h =================================================================== ---- include/psdk/winddi.h (revision 70340) +--- include/psdk/winddi.h (revision 70342) +++ include/psdk/winddi.h (working copy) @@ -2911,7 +2911,7 @@ _In_ ULONG cjSize, @@ -338,7 +325,7 @@ APIENTRY Index: include/reactos/wine/config.h =================================================================== ---- include/reactos/wine/config.h (revision 70340) +--- include/reactos/wine/config.h (revision 70342) +++ include/reactos/wine/config.h (working copy) @@ -1,3 +1,5 @@ +#include "reactos/buildno.h" @@ -348,7 +335,7 @@ /* Define to a function attribute for Microsoft hotpatch assembly prefix. */ Index: lib/3rdparty/CMakeLists.txt =================================================================== ---- lib/3rdparty/CMakeLists.txt (revision 70340) +--- lib/3rdparty/CMakeLists.txt (revision 70342) +++ lib/3rdparty/CMakeLists.txt (working copy) @@ -2,7 +2,9 @@ add_subdirectory(adns) @@ -360,22 +347,9 @@ add_subdirectory(fullfat) add_subdirectory(libmpg123) add_subdirectory(libsamplerate) -Index: subsystems/win32/csrsrv/init.c -=================================================================== ---- subsystems/win32/csrsrv/init.c (revision 70340) -+++ subsystems/win32/csrsrv/init.c (working copy) -@@ -20,7 +20,7 @@ - /* DATA ***********************************************************************/ - - // Debug Flag --ULONG CsrDebug = 0; // 0xFFFFFFFF; -+ULONG CsrDebug = 0xFFFFFFFF; - - HANDLE CsrHeap = NULL; - HANDLE CsrObjectDirectory = NULL; Index: win32ss/CMakeLists.txt =================================================================== ---- win32ss/CMakeLists.txt (revision 70340) +--- win32ss/CMakeLists.txt (revision 70342) +++ win32ss/CMakeLists.txt (working copy) @@ -10,7 +10,10 @@ PROJECT(WIN32SS) @@ -404,7 +378,7 @@ \ No newline at end of file Index: win32ss/drivers/CMakeLists.txt =================================================================== ---- win32ss/drivers/CMakeLists.txt (revision 70340) +--- win32ss/drivers/CMakeLists.txt (revision 70342) +++ win32ss/drivers/CMakeLists.txt (working copy) @@ -1,6 +1,8 @@ @@ -417,7 +391,7 @@ add_subdirectory(watchdog) Index: win32ss/include/ntgdihdl.h =================================================================== ---- win32ss/include/ntgdihdl.h (revision 70340) +--- win32ss/include/ntgdihdl.h (revision 70342) +++ win32ss/include/ntgdihdl.h (working copy) @@ -260,6 +260,7 @@ DWORD dwCFCount; @@ -449,7 +423,7 @@ FLONG AttrFlags; Index: win32ss/user/winsrv/consrv/conoutput.c =================================================================== ---- win32ss/user/winsrv/consrv/conoutput.c (revision 70340) +--- win32ss/user/winsrv/consrv/conoutput.c (revision 70342) +++ win32ss/user/winsrv/consrv/conoutput.c (working copy) @@ -99,9 +99,13 @@ * Indeed, the palette handle comes from a console app @@ -467,7 +441,7 @@ Buffer, Index: win32ss/user/winsrv/consrv/frontends/gui/conwnd.c =================================================================== ---- win32ss/user/winsrv/consrv/frontends/gui/conwnd.c (revision 70340) +--- win32ss/user/winsrv/consrv/frontends/gui/conwnd.c (revision 70342) +++ win32ss/user/winsrv/consrv/frontends/gui/conwnd.c (working copy) @@ -159,7 +159,11 @@ } @@ -483,7 +457,7 @@ return (WndClassAtom != 0); Index: win32ss/user/winsrv/consrv/frontends/gui/guiterm.c =================================================================== ---- win32ss/user/winsrv/consrv/frontends/gui/guiterm.c (revision 70340) +--- win32ss/user/winsrv/consrv/frontends/gui/guiterm.c (revision 70342) +++ win32ss/user/winsrv/consrv/frontends/gui/guiterm.c (working copy) @@ -161,9 +161,14 @@ /* Assign this console input thread to this desktop */ @@ -534,7 +508,7 @@ Index: win32ss/user/winsrv/usersrv/init.c =================================================================== ---- win32ss/user/winsrv/usersrv/init.c (revision 70340) +--- win32ss/user/winsrv/usersrv/init.c (revision 70342) +++ win32ss/user/winsrv/usersrv/init.c (working copy) @@ -199,9 +199,14 @@ @@ -565,7 +539,7 @@ Status = NtUserInitialize(USER_VERSION, Index: win32ss/user/winsrv/usersrv/shutdown.c =================================================================== ---- win32ss/user/winsrv/usersrv/shutdown.c (revision 70340) +--- win32ss/user/winsrv/usersrv/shutdown.c (revision 70342) +++ win32ss/user/winsrv/usersrv/shutdown.c (working copy) @@ -381,7 +381,12 @@ static BOOLEAN
9 years
1
0
0
0
[fireball] 70345: [ARWINSS] - Implement logon process registration in win32k and its shutdown notification. - Add a hack into server/queue.c which allows to send message to a thread without the des...
by fireball@svn.reactos.org
Author: fireball Date: Mon Dec 14 12:10:40 2015 New Revision: 70345 URL:
http://svn.reactos.org/svn/reactos?rev=70345&view=rev
Log: [ARWINSS] - Implement logon process registration in win32k and its shutdown notification. - Add a hack into server/queue.c which allows to send message to a thread without the desktop. Once the dektop issue is properly solved, this hack should go away. - Arwinss boots to the desktop now. - Remove redundant csr_shared.h, and use trunk's ntuser.h instead. Removed: branches/arwinss/arwinss/include/csr_shared.h Modified: branches/arwinss/arwinss/client/user32/csr.c branches/arwinss/arwinss/include/wine/rosuser.h branches/arwinss/arwinss/server/main/misc.c branches/arwinss/arwinss/server/main/shutdown.c branches/arwinss/arwinss/server/w32ksvc.db branches/arwinss/arwinss/server/w32ksvc.h branches/arwinss/arwinss/server/wine/queue.c Modified: branches/arwinss/arwinss/client/user32/csr.c URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/arwinss/client/user32/c…
============================================================================== --- branches/arwinss/arwinss/client/user32/csr.c [iso-8859-1] (original) +++ branches/arwinss/arwinss/client/user32/csr.c [iso-8859-1] Mon Dec 14 12:10:40 2015 @@ -28,13 +28,18 @@ /* CSRSS Headers */ #include <subsys/csr/csr.h> -#include <csr_shared.h> +#include <ntuser.h> #include <subsys/win/winmsg.h> + +#include "wine/rosuser.h" #include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(usercsr); +/* GLOBALS ********************************************************************/ + +BOOLEAN gfLogonProcess = FALSE; /* FUNCTIONS ******************************************************************/ @@ -89,31 +94,42 @@ return TRUE; } +EXTINLINE BOOL NtUserxRegisterLogonProcess(DWORD dwProcessId, BOOL bRegister) +{ + return (BOOL)NtUserCallTwoParam((DWORD_PTR)dwProcessId, (DWORD_PTR)bRegister, TWOPARAM_ROUTINE_REGISTERLOGONPROCESS); +} + /*********************************************************************** * RegisterLogonProcess (USER32.@) */ -BOOL WINAPI RegisterLogonProcess(DWORD dwProcessId, BOOL bRegister) +BOOL +WINAPI +RegisterLogonProcess(DWORD dwProcessId, + BOOL bRegister) { - NTSTATUS Status; + gfLogonProcess = NtUserxRegisterLogonProcess(dwProcessId, bRegister); + + if (gfLogonProcess) + { USER_API_MESSAGE ApiMessage; + PUSER_REGISTER_LOGON_PROCESS RegisterLogonProcessRequest = &ApiMessage.Data.RegisterLogonProcessRequest; - ApiMessage.Data.RegisterLogonProcessRequest.ProcessId = dwProcessId; - ApiMessage.Data.RegisterLogonProcessRequest.Register = bRegister; + RegisterLogonProcessRequest->ProcessId = dwProcessId; + RegisterLogonProcessRequest->Register = bRegister; - Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, - NULL, - CSR_CREATE_API_NUMBER(USERSRV_SERVERDLL_INDEX, UserpRegisterLogonProcess), - sizeof(USER_REGISTER_LOGON_PROCESS)); - if (!NT_SUCCESS(Status)) + CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, + NULL, + CSR_CREATE_API_NUMBER(USERSRV_SERVERDLL_INDEX, UserpRegisterLogonProcess), + sizeof(*RegisterLogonProcessRequest)); + if (!NT_SUCCESS(ApiMessage.Status)) { ERR("Failed to register logon process with CSRSS\n"); - SetLastError(RtlNtStatusToDosError(Status)); - return FALSE; + SetLastError(RtlNtStatusToDosError(ApiMessage.Status)); } + } - return TRUE; + return gfLogonProcess; } - /*********************************************************************** * SetLogonNotifyWindow (USER32.@) @@ -122,30 +138,7 @@ WINAPI SetLogonNotifyWindow (HWND Wnd) { -#if 0 - /* Maybe we should call NtUserSetLogonNotifyWindow and let that one inform CSRSS??? */ - CSR_API_MESSAGE Request; - ULONG CsrRequest; - NTSTATUS Status; - - CsrRequest = MAKE_CSR_API(SET_LOGON_NOTIFY_WINDOW, CSR_GUI); - Request.Data.SetLogonNotifyWindowRequest.LogonNotifyWindow = Wnd; - - Status = CsrClientCallServer(&Request, - NULL, - CsrRequest, - sizeof(CSR_API_MESSAGE)); - if (!NT_SUCCESS(Status) || !NT_SUCCESS(Status = Request.Status)) - { - SetLastError(RtlNtStatusToDosError(Status)); - return FALSE; - } - - return TRUE; -#else - ERR("SetLogonNotifyWindow is not yet implemented in Arwinss\n"); - return TRUE; -#endif + return NtUserSetLogonNotifyWindow(Wnd); } /* EOF */ Removed: branches/arwinss/arwinss/include/csr_shared.h URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/arwinss/include/csr_sha…
============================================================================== --- branches/arwinss/arwinss/include/csr_shared.h [iso-8859-1] (original) +++ branches/arwinss/arwinss/include/csr_shared.h (removed) @@ -1,72 +0,0 @@ -#pragma once - -/* FNID's for NtUserSetWindowFNID, NtUserMessageCall */ -#define FNID_FIRST 0x029A -#define FNID_SCROLLBAR 0x029A -#define FNID_ICONTITLE 0x029B -#define FNID_MENU 0x029C -#define FNID_DESKTOP 0x029D -#define FNID_DEFWINDOWPROC 0x029E -#define FNID_MESSAGEWND 0x029F -#define FNID_SWITCH 0x02A0 -#define FNID_BUTTON 0x02A1 -#define FNID_COMBOBOX 0x02A2 -#define FNID_COMBOLBOX 0x02A3 -#define FNID_DIALOG 0x02A4 -#define FNID_EDIT 0x02A5 -#define FNID_LISTBOX 0x02A6 -#define FNID_MDICLIENT 0x02A7 -#define FNID_STATIC 0x02A8 -#define FNID_IME 0x02A9 -#define FNID_GHOST 0x02AA -#define FNID_CALLWNDPROC 0x02AB -#define FNID_CALLWNDPROCRET 0x02AC -#define FNID_HKINLPCWPEXSTRUCT 0x02AD -#define FNID_HKINLPCWPRETEXSTRUCT 0x02AE -#define FNID_MB_DLGPROC 0x02AF -#define FNID_MDIACTIVATEDLGPROC 0x02B0 -#define FNID_SENDMESSAGE 0x02B1 -#define FNID_SENDMESSAGEFF 0x02B2 -/* Kernel has option to use TimeOut or normal msg send, based on type of msg. */ -#define FNID_SENDMESSAGEWTOOPTION 0x02B3 -#define FNID_SENDMESSAGECALLPROC 0x02B4 -#define FNID_BROADCASTSYSTEMMESSAGE 0x02B5 -#define FNID_TOOLTIPS 0x02B6 -#define FNID_SENDNOTIFYMESSAGE 0x02B7 -#define FNID_SENDMESSAGECALLBACK 0x02B8 -#define FNID_LAST 0x02B9 - -typedef struct _WNDMSG -{ - DWORD maxMsgs; - PINT abMsgs; -} WNDMSG, *PWNDMSG; - -typedef PVOID PSERVERINFO; - -typedef struct _SHAREDINFO -{ - PSERVERINFO psi; /* global Server Info */ - PVOID aheList; /* Handle Entry List */ - PVOID pDispInfo; /* global PDISPLAYINFO pointer */ - ULONG_PTR ulSharedDelta; /* Heap delta */ - WNDMSG awmControl[FNID_LAST - FNID_FIRST]; - WNDMSG DefWindowMsgs; - WNDMSG DefWindowSpecMsgs; -} SHAREDINFO, *PSHAREDINFO; - -/* See also the USERSRV_API_CONNECTINFO #define in include/reactos/subsys/win/winmsg.h */ -typedef struct _USERCONNECT -{ - ULONG ulVersion; - ULONG ulCurrentVersion; - DWORD dwDispatchCount; - SHAREDINFO siClient; -} USERCONNECT, *PUSERCONNECT; - -/* WinNT 5.0 compatible user32 / win32k */ -#define USER_VERSION MAKELONG(0x0000, 0x0005) - -#if defined(_M_IX86) -C_ASSERT(sizeof(USERCONNECT) == 0x124); -#endif Modified: branches/arwinss/arwinss/include/wine/rosuser.h URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/arwinss/include/wine/ro…
============================================================================== --- branches/arwinss/arwinss/include/wine/rosuser.h [iso-8859-1] (original) +++ branches/arwinss/arwinss/include/wine/rosuser.h [iso-8859-1] Mon Dec 14 12:10:40 2015 @@ -10,6 +10,14 @@ #ifndef __WIN32K_ROSUSER_H #define __WIN32K_ROSUSER_H + +#if defined(__GNUC__) +#define EXTINLINE extern inline __attribute__((always_inline)) +#elif defined(_MSC_VER) +#define EXTINLINE extern __forceinline +#else +#error +#endif /* DEFINES *******************************************************************/ @@ -181,6 +189,12 @@ BOOL NTAPI RosUserBuildShellHookHwndList(HWND *list, UINT *cbSize); +DWORD_PTR NTAPI +NtUserCallTwoParam(DWORD_PTR Param1, DWORD_PTR Param2, DWORD Routine); + +BOOL NTAPI +NtUserSetLogonNotifyWindow(HWND hWnd); + SWM_WINDOW_ID NTAPI SwmNewWindow(SWM_WINDOW_ID parent, RECT *WindowRect, HWND hWnd, DWORD ex_style); Modified: branches/arwinss/arwinss/server/main/misc.c URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/arwinss/server/main/mis…
============================================================================== --- branches/arwinss/arwinss/server/main/misc.c [iso-8859-1] (original) +++ branches/arwinss/arwinss/server/main/misc.c [iso-8859-1] Mon Dec 14 12:10:40 2015 @@ -10,7 +10,7 @@ #include <win32k.h> -//#define NDEBUG +#define NDEBUG #include <debug.h> #include <ntstatus.h> @@ -18,6 +18,25 @@ #include <csr.h> extern PEPROCESS CsrProcess; +extern HWND hwndSAS; + +/* Registered logon process ID */ +HANDLE gpidLogon = 0; + +BOOL +APIENTRY +NtUserSetLogonNotifyWindow(HWND hWnd) +{ + if (gpidLogon != PsGetCurrentProcessId()) + return FALSE; + + DPRINT("Logon hwnd %x\n", hWnd); + + hwndSAS = hWnd; + + return TRUE; +} + NTSTATUS APIENTRY @@ -163,3 +182,64 @@ UserLeave(); return Status; } + +BOOL +UserRegisterLogonProcess(HANDLE ProcessId, BOOL Register) +{ + NTSTATUS Status; + PEPROCESS Process; + + Status = PsLookupProcessByProcessId(ProcessId, &Process); + if (!NT_SUCCESS(Status)) + { + EngSetLastError(RtlNtStatusToDosError(Status)); + return FALSE; + } + + ProcessId = Process->UniqueProcessId; + ObDereferenceObject(Process); + + if (Register) + { + /* Register the logon process */ + if (gpidLogon != 0) return FALSE; + gpidLogon = ProcessId; + } + else + { + /* Deregister the logon process */ + if (gpidLogon != ProcessId) return FALSE; + gpidLogon = 0; + } + + return TRUE; +} + +DWORD_PTR +APIENTRY +NtUserCallTwoParam( + DWORD_PTR Param1, + DWORD_PTR Param2, + DWORD Routine) +{ + DWORD_PTR ReturnValue; + + DPRINT("Enter NtUserCallTwoParam\n"); + UserEnterExclusive(); + + switch(Routine) + { + case TWOPARAM_ROUTINE_REGISTERLOGONPROCESS: + ReturnValue = (DWORD_PTR)UserRegisterLogonProcess((HANDLE)Param1, (BOOL)Param2); + break; + + default: + DPRINT1("Calling invalid routine number 0x%x in NtUserCallTwoParam(), Param1=0x%x Parm2=0x%x\n", + Routine, Param1, Param2); + EngSetLastError(ERROR_INVALID_PARAMETER); + } + + DPRINT("Leave NtUserCallTwoParam, ret=%p\n", ReturnValue); + UserLeave(); + return ReturnValue; +} Modified: branches/arwinss/arwinss/server/main/shutdown.c URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/arwinss/server/main/shu…
============================================================================== --- branches/arwinss/arwinss/server/main/shutdown.c [iso-8859-1] (original) +++ branches/arwinss/arwinss/server/main/shutdown.c [iso-8859-1] Mon Dec 14 12:10:40 2015 @@ -9,16 +9,54 @@ /* INCLUDES ******************************************************************/ #include <win32k.h> - -//#define NDEBUG +#include <ntstatus.h> + +#include "object.h" +#include "request.h" +#include "user.h" + +#define NDEBUG #include <debug.h> - -#include <ntstatus.h> /* Our local copy of shutdown flags */ static ULONG gdwShutdownFlags = 0; +/* Registered logon window */ HWND hwndSAS = NULL; + +extern HANDLE gpidLogon; + +VOID +UserPostMessage(HWND hWnd, + UINT Msg, + WPARAM wParam, + LPARAM lParam) +{ + PTHREADINFO thread; + struct send_message_request req; + struct send_message_reply reply; + + // Get that window's thread + thread = get_window_thread((user_handle_t)hWnd); + if (!thread) return; + + req.id = (ULONG)thread->peThread->Cid.UniqueThread; + req.type = MSG_NOTIFY; // Or MSG_OTHER_PROCESS ? + req.flags = 0; + req.win = (user_handle_t)hWnd; + req.msg = Msg; + req.wparam = wParam; + req.lparam = lParam; + req.timeout = TIMEOUT_INFINITE; + + // No strings attached + req.__header.request_size = 0; + + // Zero reply's memory area + memset( &reply, 0, sizeof(reply) ); + + req_send_message(&req, &reply); +} NTSTATUS GetProcessLuid(IN PETHREAD Thread OPTIONAL, @@ -89,8 +127,7 @@ if (hwndSAS) { DPRINT("\tSending %s, Param 0x%x message to Winlogon\n", Notif == LN_LOGOFF ? "LN_LOGOFF" : "LN_LOGOFF_CANCELED", Param); - //UserPostMessage(hwndSAS, WM_LOGONNOTIFY, Notif, (LPARAM)Param); - UNIMPLEMENTED; + UserPostMessage(hwndSAS, WM_LOGONNOTIFY, Notif, (LPARAM)Param); return TRUE; } else @@ -110,12 +147,6 @@ ULONG Flags = *pFlags; LUID CallerLuid; LUID SystemLuid = SYSTEM_LUID; - /*static PRIVILEGE_SET ShutdownPrivilege = - { - 1, PRIVILEGE_SET_ALL_NECESSARY, - { {{SE_SHUTDOWN_PRIVILEGE, 0}, 0} } - };*/ - PPROCESSINFO ppi; DPRINT("UserInitiateShutdown\n"); @@ -145,8 +176,7 @@ if (ppi == NULL) return STATUS_INVALID_HANDLE; -#if 0 - /* If the caller is not Winlogon, do some security checks */ + /* If the caller is not Winlogon, do some security checks and notify it to perform the real shutdown */ if (PsGetThreadProcessId(Thread) != gpidLogon) { /* @@ -157,47 +187,16 @@ *pFlags = Flags; - /* Check whether the current process is attached to a window station */ - if (ppi->prpwinsta == NULL) - return STATUS_INVALID_HANDLE; - - /* Check whether the window station of the current process can send exit requests */ - if (!RtlAreAllAccessesGranted(ppi->amwinsta, WINSTA_EXITWINDOWS)) - return STATUS_ACCESS_DENIED; - - /* - * NOTE: USERSRV automatically adds the shutdown flag when we poweroff or reboot. - * - * If the caller wants to shutdown / reboot / power-off... - */ - if (Flags & EWX_SHUTDOWN) - { - /* ... check whether it has shutdown privilege */ - if (!HasPrivilege(&ShutdownPrivilege)) - return STATUS_PRIVILEGE_NOT_HELD; - } - else - { - /* - * ... but if it just wants to log-off, in case its - * window station is a non-IO one, fail the call. - */ - if (ppi->prpwinsta->Flags & WSS_NOIO) - return STATUS_INVALID_DEVICE_REQUEST; - } - } - - /* If the caller is not Winlogon, possibly notify it to perform the real shutdown */ - if (PsGetThreadProcessId(Thread) != gpidLogon) - { // FIXME: HACK!! Do more checks!! - ERR("UserInitiateShutdown -- Notify Winlogon for shutdown\n"); + + /* NOTE: USERSRV automatically adds the shutdown flag when we poweroff or reboot. */ + DPRINT("UserInitiateShutdown -- Notify Winlogon for shutdown\n"); NotifyLogon(hwndSAS, &CallerLuid, Flags, STATUS_SUCCESS); return STATUS_PENDING; } // If we reach this point, that means it's Winlogon that triggered the shutdown. - ERR("UserInitiateShutdown -- Winlogon is doing a shutdown\n"); + DPRINT("UserInitiateShutdown -- Winlogon is doing a shutdown\n"); /* * Update and save the shutdown flags globally for renotifying @@ -208,9 +207,7 @@ /* Save the shutdown flags now */ gdwShutdownFlags = Flags; -#else - UNIMPLEMENTED; -#endif + return STATUS_SUCCESS; } @@ -252,11 +249,7 @@ DPRINT("UserEndShutdown -- Notify Winlogon for end of shutdown\n"); -#if 0 NotifyLogon(hwndSAS, &CallerLuid, Flags, ShutdownStatus); -#else - UNIMPLEMENTED -#endif /* Always return success */ return STATUS_SUCCESS; Modified: branches/arwinss/arwinss/server/w32ksvc.db URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/arwinss/server/w32ksvc.…
============================================================================== --- branches/arwinss/arwinss/server/w32ksvc.db [iso-8859-1] (original) +++ branches/arwinss/arwinss/server/w32ksvc.db [iso-8859-1] Mon Dec 14 12:10:40 2015 @@ -92,5 +92,7 @@ SwmPosChanged 5 SwmGetWindowFromPoint 2 SwmShowWindow 3 +NtUserCallTwoParam 3 NtUserInitialize 3 -NtUserSetInformationThread 4 +NtUserSetInformationThread 4 +NtUserSetLogonNotifyWindow 1 Modified: branches/arwinss/arwinss/server/w32ksvc.h URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/arwinss/server/w32ksvc.…
============================================================================== --- branches/arwinss/arwinss/server/w32ksvc.h [iso-8859-1] (original) +++ branches/arwinss/arwinss/server/w32ksvc.h [iso-8859-1] Mon Dec 14 12:10:40 2015 @@ -95,5 +95,7 @@ SVC_(SwmPosChanged, 5) SVC_(SwmGetWindowFromPoint, 2) SVC_(SwmShowWindow, 3) +SVC_(NtUserCallTwoParam, 3) SVC_(NtUserInitialize, 3) -SVC_(NtUserSetInformationThread, 4) +SVC_(NtUserSetInformationThread, 4) +SVC_(NtUserSetLogonNotifyWindow, 1) Modified: branches/arwinss/arwinss/server/wine/queue.c URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/arwinss/server/wine/que…
============================================================================== --- branches/arwinss/arwinss/server/wine/queue.c [iso-8859-1] (original) +++ branches/arwinss/arwinss/server/wine/queue.c [iso-8859-1] Mon Dec 14 12:10:40 2015 @@ -236,9 +236,9 @@ if (!(input->desktop = get_thread_desktop( thread, 0 /* FIXME: access rights */ ))) { - DPRINT1("error getting thread desktop\n"); - release_object( input ); - return NULL; + DPRINT1("error getting thread desktop, SHOULD FAIL! BIG BUG\n"); + //release_object( input ); + //return NULL; } } return input;
9 years
1
0
0
0
[dquintana] 70344: [MAGNIFY] * Implement AppBar docking (defaults to floating because we don't properly support AppBars yet -- works in Windows). * Implement loading and saving the AppBar settings ...
by dquintana@svn.reactos.org
Author: dquintana Date: Mon Dec 14 05:03:06 2015 New Revision: 70344 URL:
http://svn.reactos.org/svn/reactos?rev=70344&view=rev
Log: [MAGNIFY] * Implement AppBar docking (defaults to floating because we don't properly support AppBars yet -- works in Windows). * Implement loading and saving the AppBar settings from the registry. * Remove the minimize button from the options dialog. CORE-10691 Modified: trunk/reactos/base/applications/magnify/lang/bg-BG.rc trunk/reactos/base/applications/magnify/lang/de-DE.rc trunk/reactos/base/applications/magnify/lang/en-US.rc trunk/reactos/base/applications/magnify/lang/es-ES.rc trunk/reactos/base/applications/magnify/lang/fr-FR.rc trunk/reactos/base/applications/magnify/lang/he-IL.rc trunk/reactos/base/applications/magnify/lang/it-IT.rc trunk/reactos/base/applications/magnify/lang/ja-JP.rc trunk/reactos/base/applications/magnify/lang/no-NO.rc trunk/reactos/base/applications/magnify/lang/pl-PL.rc trunk/reactos/base/applications/magnify/lang/pt-BR.rc trunk/reactos/base/applications/magnify/lang/ro-RO.rc trunk/reactos/base/applications/magnify/lang/ru-RU.rc trunk/reactos/base/applications/magnify/lang/sk-SK.rc trunk/reactos/base/applications/magnify/lang/sq-AL.rc trunk/reactos/base/applications/magnify/lang/sv-SE.rc trunk/reactos/base/applications/magnify/lang/tr-TR.rc trunk/reactos/base/applications/magnify/lang/uk-UA.rc trunk/reactos/base/applications/magnify/lang/zh-CN.rc trunk/reactos/base/applications/magnify/lang/zh-TW.rc trunk/reactos/base/applications/magnify/magnifier.c trunk/reactos/base/applications/magnify/magnifier.h trunk/reactos/base/applications/magnify/settings.c Modified: trunk/reactos/base/applications/magnify/lang/bg-BG.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/magnify/…
============================================================================== --- trunk/reactos/base/applications/magnify/lang/bg-BG.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/magnify/lang/bg-BG.rc [iso-8859-1] Mon Dec 14 05:03:06 2015 @@ -29,7 +29,7 @@ END IDD_DIALOGOPTIONS DIALOGEX 0, 0, 210, 182 -STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU +STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "ÐаÑÑÑойки на ÑвелиÑиÑелÑ" FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN Modified: trunk/reactos/base/applications/magnify/lang/de-DE.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/magnify/…
============================================================================== --- trunk/reactos/base/applications/magnify/lang/de-DE.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/magnify/lang/de-DE.rc [iso-8859-1] Mon Dec 14 05:03:06 2015 @@ -29,7 +29,7 @@ END IDD_DIALOGOPTIONS DIALOGEX 0, 0, 153, 182 -STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU +STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Einstellungen" FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN Modified: trunk/reactos/base/applications/magnify/lang/en-US.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/magnify/…
============================================================================== --- trunk/reactos/base/applications/magnify/lang/en-US.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/magnify/lang/en-US.rc [iso-8859-1] Mon Dec 14 05:03:06 2015 @@ -29,7 +29,7 @@ END IDD_DIALOGOPTIONS DIALOGEX 0, 0, 153, 182 -STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU +STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Magnifier Settings" FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN Modified: trunk/reactos/base/applications/magnify/lang/es-ES.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/magnify/…
============================================================================== --- trunk/reactos/base/applications/magnify/lang/es-ES.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/magnify/lang/es-ES.rc [iso-8859-1] Mon Dec 14 05:03:06 2015 @@ -33,7 +33,7 @@ END IDD_DIALOGOPTIONS DIALOGEX 0, 0, 153, 182 -STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU +STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Configurar lupa" FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN Modified: trunk/reactos/base/applications/magnify/lang/fr-FR.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/magnify/…
============================================================================== --- trunk/reactos/base/applications/magnify/lang/fr-FR.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/magnify/lang/fr-FR.rc [iso-8859-1] Mon Dec 14 05:03:06 2015 @@ -29,7 +29,7 @@ END IDD_DIALOGOPTIONS DIALOGEX 0, 0, 153, 182 -STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU +STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Paramètres de la loupe" FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN Modified: trunk/reactos/base/applications/magnify/lang/he-IL.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/magnify/…
============================================================================== --- trunk/reactos/base/applications/magnify/lang/he-IL.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/magnify/lang/he-IL.rc [iso-8859-1] Mon Dec 14 05:03:06 2015 @@ -31,7 +31,7 @@ END IDD_DIALOGOPTIONS DIALOGEX 0, 0, 153, 182 -STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU +STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "×××ר×ת ×××××ת ××××ת" FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN Modified: trunk/reactos/base/applications/magnify/lang/it-IT.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/magnify/…
============================================================================== --- trunk/reactos/base/applications/magnify/lang/it-IT.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/magnify/lang/it-IT.rc [iso-8859-1] Mon Dec 14 05:03:06 2015 @@ -29,7 +29,7 @@ END IDD_DIALOGOPTIONS DIALOGEX 0, 0, 153, 182 -STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU +STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Impostazioni di Magnifier" FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN Modified: trunk/reactos/base/applications/magnify/lang/ja-JP.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/magnify/…
============================================================================== --- trunk/reactos/base/applications/magnify/lang/ja-JP.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/magnify/lang/ja-JP.rc [iso-8859-1] Mon Dec 14 05:03:06 2015 @@ -29,7 +29,7 @@ END IDD_DIALOGOPTIONS DIALOGEX 0, 0, 153, 182 -STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU +STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "æ¡å¤§é¡ã®è¨å®" FONT 9, "MS UI Gothic", 400, 0, 0x1 BEGIN Modified: trunk/reactos/base/applications/magnify/lang/no-NO.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/magnify/…
============================================================================== --- trunk/reactos/base/applications/magnify/lang/no-NO.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/magnify/lang/no-NO.rc [iso-8859-1] Mon Dec 14 05:03:06 2015 @@ -29,7 +29,7 @@ END IDD_DIALOGOPTIONS DIALOGEX 0, 0, 153, 182 -STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU +STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Forstørrelse Innstilling" FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN Modified: trunk/reactos/base/applications/magnify/lang/pl-PL.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/magnify/…
============================================================================== --- trunk/reactos/base/applications/magnify/lang/pl-PL.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/magnify/lang/pl-PL.rc [iso-8859-1] Mon Dec 14 05:03:06 2015 @@ -37,7 +37,7 @@ END IDD_DIALOGOPTIONS DIALOGEX 0, 0, 153, 182 -STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU +STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Ustawienia" FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN Modified: trunk/reactos/base/applications/magnify/lang/pt-BR.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/magnify/…
============================================================================== --- trunk/reactos/base/applications/magnify/lang/pt-BR.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/magnify/lang/pt-BR.rc [iso-8859-1] Mon Dec 14 05:03:06 2015 @@ -31,7 +31,7 @@ END IDD_DIALOGOPTIONS DIALOGEX 0, 0, 153, 182 -STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU +STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Configurações da Lupa" FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN Modified: trunk/reactos/base/applications/magnify/lang/ro-RO.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/magnify/…
============================================================================== --- trunk/reactos/base/applications/magnify/lang/ro-RO.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/magnify/lang/ro-RO.rc [iso-8859-1] Mon Dec 14 05:03:06 2015 @@ -31,7 +31,7 @@ END IDD_DIALOGOPTIONS DIALOGEX 0, 0, 153, 182 -STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU +STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Configurare lupÄ" FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN Modified: trunk/reactos/base/applications/magnify/lang/ru-RU.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/magnify/…
============================================================================== --- trunk/reactos/base/applications/magnify/lang/ru-RU.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/magnify/lang/ru-RU.rc [iso-8859-1] Mon Dec 14 05:03:06 2015 @@ -29,7 +29,7 @@ END IDD_DIALOGOPTIONS DIALOGEX 0, 0, 185, 182 -STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU +STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "ÐаÑамеÑÑÑ" FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN Modified: trunk/reactos/base/applications/magnify/lang/sk-SK.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/magnify/…
============================================================================== --- trunk/reactos/base/applications/magnify/lang/sk-SK.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/magnify/lang/sk-SK.rc [iso-8859-1] Mon Dec 14 05:03:06 2015 @@ -34,7 +34,7 @@ END IDD_DIALOGOPTIONS DIALOGEX 0, 0, 153, 182 -STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU +STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Nastavenia Lupy" FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN Modified: trunk/reactos/base/applications/magnify/lang/sq-AL.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/magnify/…
============================================================================== --- trunk/reactos/base/applications/magnify/lang/sq-AL.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/magnify/lang/sq-AL.rc [iso-8859-1] Mon Dec 14 05:03:06 2015 @@ -33,7 +33,7 @@ END IDD_DIALOGOPTIONS DIALOGEX 0, 0, 153, 182 -STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU +STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Konfigurimet e zmadhuesit" FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN Modified: trunk/reactos/base/applications/magnify/lang/sv-SE.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/magnify/…
============================================================================== --- trunk/reactos/base/applications/magnify/lang/sv-SE.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/magnify/lang/sv-SE.rc [iso-8859-1] Mon Dec 14 05:03:06 2015 @@ -29,7 +29,7 @@ END IDD_DIALOGOPTIONS DIALOGEX 0, 0, 153, 182 -STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU +STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Förstoringsglaset Inställning" FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN Modified: trunk/reactos/base/applications/magnify/lang/tr-TR.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/magnify/…
============================================================================== --- trunk/reactos/base/applications/magnify/lang/tr-TR.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/magnify/lang/tr-TR.rc [iso-8859-1] Mon Dec 14 05:03:06 2015 @@ -37,7 +37,7 @@ END IDD_DIALOGOPTIONS DIALOGEX 0, 0, 153, 182 -STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU +STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Seçenekler" FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN Modified: trunk/reactos/base/applications/magnify/lang/uk-UA.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/magnify/…
============================================================================== --- trunk/reactos/base/applications/magnify/lang/uk-UA.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/magnify/lang/uk-UA.rc [iso-8859-1] Mon Dec 14 05:03:06 2015 @@ -37,7 +37,7 @@ END IDD_DIALOGOPTIONS DIALOGEX 0, 0, 153, 182 -STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU +STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "ÐаÑамеÑÑи екÑÐ°Ð½Ð½Ð¾Ñ Ð»Ñпи" FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN Modified: trunk/reactos/base/applications/magnify/lang/zh-CN.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/magnify/…
============================================================================== --- trunk/reactos/base/applications/magnify/lang/zh-CN.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/magnify/lang/zh-CN.rc [iso-8859-1] Mon Dec 14 05:03:06 2015 @@ -37,7 +37,7 @@ END IDD_DIALOGOPTIONS DIALOGEX 0, 0, 153, 182 -STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU +STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "æ¾å¤§é设å®" FONT 9, "MS Shell Dlg", 400, 0, 0x1 BEGIN Modified: trunk/reactos/base/applications/magnify/lang/zh-TW.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/magnify/…
============================================================================== --- trunk/reactos/base/applications/magnify/lang/zh-TW.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/magnify/lang/zh-TW.rc [iso-8859-1] Mon Dec 14 05:03:06 2015 @@ -37,7 +37,7 @@ END IDD_DIALOGOPTIONS DIALOGEX 0, 0, 153, 182 -STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU +STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "æ¾å¤§é¡è¨å®" FONT 9, "MS Shell Dlg", 400, 0, 0x1 BEGIN Modified: trunk/reactos/base/applications/magnify/magnifier.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/magnify/…
============================================================================== --- trunk/reactos/base/applications/magnify/magnifier.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/magnify/magnifier.c [iso-8859-1] Mon Dec 14 05:03:06 2015 @@ -8,7 +8,8 @@ * David Quintana <gigaherz(a)gmail.com> */ -/* TODO: AppBar */ +/* TODO: Support AppBar types other than ABE_TOP */ + #include "magnifier.h" #include <winbase.h> @@ -20,14 +21,16 @@ #include "resource.h" +#define APPMSG_NOTIFYICON (WM_APP+1) +#define APPMSG_APPBAR (WM_APP+2) + const TCHAR szWindowClass[] = TEXT("MAGNIFIER"); - -#define MAX_LOADSTRING 100 /* Global Variables */ HINSTANCE hInst; HWND hMainWnd; +#define MAX_LOADSTRING 100 TCHAR szTitle[MAX_LOADSTRING]; #define TIMER_SPEED 1 @@ -37,19 +40,19 @@ HWND hDesktopWindow = NULL; -#define APPMSG_NOTIFYICON (WM_APP+1) +NOTIFYICONDATA nid; HICON notifyIcon; -NOTIFYICONDATA nid; HMENU notifyMenu; -HWND hOptionsDialog; -BOOL bOptionsDialog = FALSE; - -BOOL bRecreateOffscreenDC = TRUE; -LONG sourceWidth = 0; -LONG sourceHeight = 0; -HDC hdcOffscreen = NULL; -HANDLE hbmpOld; +HWND hOptionsDialog; +BOOL bOptionsDialog = FALSE; +BOOL bRecreateOffscreenDC = TRUE; +LONG sourceWidth = 0; +LONG sourceHeight = 0; +HDC hdcOffscreen = NULL; HBITMAP hbmpOffscreen = NULL; +HANDLE hbmpOld; +POINT ptDragOffset; +INT nearEdge; /* Current magnified area */ POINT cp; @@ -132,23 +135,158 @@ return RegisterClass(&wc); } +void DoAppBarStuff(DWORD mode) +{ + UINT uState; + APPBARDATA data = {0}; + data.cbSize = sizeof(data); + data.hWnd = hMainWnd; + data.uCallbackMessage = APPMSG_APPBAR; + + if (mode == ABM_NEW || mode == ABM_SETPOS) + { + HWND hWndOrder = HWND_BOTTOM; + int rcw, rch; + RECT rcWorkArea; + SystemParametersInfo(SPI_GETWORKAREA, 0, &rcWorkArea, 0); + + if(mode == ABM_NEW) + { + SHAppBarMessage(ABM_NEW, &data); + + switch(AppBarConfig.uEdge) + { + case ABE_LEFT: + data.rc.top = rcWorkArea.top; + data.rc.bottom = rcWorkArea.bottom; + data.rc.left = rcWorkArea.left; + data.rc.right = data.rc.left + AppBarConfig.appBarSizes.left; + break; + case ABE_TOP: + data.rc.left = rcWorkArea.left; + data.rc.right = rcWorkArea.right; + data.rc.top = rcWorkArea.top; + data.rc.bottom = data.rc.top + AppBarConfig.appBarSizes.top; + break; + case ABE_RIGHT: + data.rc.top = rcWorkArea.top; + data.rc.bottom = rcWorkArea.bottom; + data.rc.right = rcWorkArea.left; + data.rc.left = data.rc.right - AppBarConfig.appBarSizes.right; + break; + case ABE_BOTTOM: + data.rc.left = rcWorkArea.left; + data.rc.right = rcWorkArea.right; + data.rc.bottom = rcWorkArea.bottom; + data.rc.top = data.rc.bottom - AppBarConfig.appBarSizes.bottom; + break; + } + } + else + { + GetWindowRect(hMainWnd, &data.rc); + } + + data.uEdge = AppBarConfig.uEdge; + uState = SHAppBarMessage(ABM_QUERYPOS, &data); + + uState = SHAppBarMessage(ABM_SETPOS, &data); + + rcw = data.rc.right-data.rc.left; + rch = data.rc.bottom-data.rc.top; + + uState = SHAppBarMessage(ABM_GETSTATE, &data); + if(uState & ABS_ALWAYSONTOP) + hWndOrder = HWND_TOPMOST; + + SetWindowPos(hMainWnd, hWndOrder, data.rc.left, data.rc.top, rcw, rch, SWP_SHOWWINDOW|SWP_NOCOPYBITS); + + } + else if(mode == ABM_GETSTATE) + { + HWND hWndOrder = HWND_BOTTOM; + uState = SHAppBarMessage(ABM_GETSTATE, &data); + if(uState & ABS_ALWAYSONTOP) + hWndOrder = HWND_TOPMOST; + SetWindowPos(hMainWnd, hWndOrder, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE); + } + else if(mode == ABM_ACTIVATE) + { + SHAppBarMessage(ABM_ACTIVATE, &data); + } + else if(mode == ABM_WINDOWPOSCHANGED) + { + SHAppBarMessage(ABM_WINDOWPOSCHANGED, &data); + } + else if(mode == ABM_REMOVE) + { + SHAppBarMessage(ABM_REMOVE, &data); + } +} + +void AttachAppBar(INT uEdge) +{ + if (AppBarConfig.uEdge == uEdge) + return; + + if(AppBarConfig.uEdge < 0 && uEdge >= 0) + { + SetWindowLongPtr(hMainWnd, GWL_STYLE, GetWindowLongPtr(hMainWnd, GWL_STYLE) & (~WS_CAPTION)); + } + else if(uEdge < 0 && AppBarConfig.uEdge>=0) + { + SetWindowLongPtr(hMainWnd, GWL_STYLE, GetWindowLongPtr(hMainWnd, GWL_STYLE) | WS_CAPTION); + SetWindowPos(hMainWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE|SWP_FRAMECHANGED); + } + + if(AppBarConfig.uEdge >= 0) + { + DoAppBarStuff(ABM_REMOVE); + } + + if (uEdge >=0) + { + AppBarConfig.uEdge = uEdge; + DoAppBarStuff(ABM_NEW); + } + else + { + RECT rc = AppBarConfig.rcFloating; + SetWindowPos(hMainWnd, HWND_TOPMOST, rc.left, rc.top, rc.right-rc.left, rc.bottom-rc.top, 0); + } + + AppBarConfig.uEdge = uEdge; +} + BOOL InitInstance(HINSTANCE hInstance, int nCmdShow) { - RECT rcWorkArea; + RECT rc; + DWORD exStyles = WS_EX_TOOLWINDOW | WS_EX_CONTROLPARENT; + DWORD dwStyles = WS_SIZEBOX | WS_SYSMENU | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_POPUP; + + /* Load settings from registry */ + LoadSettings(); + + rc = AppBarConfig.rcFloating; + hInst = hInstance; // Store instance handle in our global variable - SystemParametersInfo(SPI_GETWORKAREA, 0, &rcWorkArea, 0); + if (AppBarConfig.uEdge<0) + { + dwStyles |= WS_CAPTION; + exStyles |= WS_EX_TOPMOST; + } /* Create the Window */ hMainWnd = CreateWindowEx( - WS_EX_TOPMOST | WS_EX_PALETTEWINDOW, + exStyles, szWindowClass, szTitle, - WS_OVERLAPPEDWINDOW, - CW_USEDEFAULT, - CW_USEDEFAULT, - (rcWorkArea.right - rcWorkArea.left) * 2 / 3, - 200, + dwStyles, + rc.left, + rc.top, + rc.right-rc.left, + rc.bottom-rc.top, NULL, NULL, hInstance, @@ -157,12 +295,16 @@ if (!hMainWnd) return FALSE; - ShowWindow(hMainWnd, bStartMinimized ? SW_MINIMIZE : nCmdShow); - UpdateWindow(hMainWnd); - - // Windows 2003's Magnifier always shows this dialog, and exits when the dialog isclosed. - // Should we add a custom means to prevent opening it? + if (AppBarConfig.uEdge>=0) DoAppBarStuff(ABM_NEW); + else SetWindowPos(hMainWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE|SWP_SHOWWINDOW); + + // In Windows 2003's Magnifier, the "Start Minimized" setting + // refers exclusively to the options dialog, not the main window itself. hOptionsDialog = CreateDialog(hInstance, MAKEINTRESOURCE(IDD_DIALOGOPTIONS), hMainWnd, OptionsProc); + if (bStartMinimized) + ShowWindow(hOptionsDialog, SW_HIDE); + else + ShowWindow(hOptionsDialog, SW_SHOW); if (bShowWarning) DialogBox(hInstance, MAKEINTRESOURCE(IDD_WARNINGDIALOG), hMainWnd, WarningProc); @@ -363,8 +505,10 @@ //Get current mouse position GetCursorPos (&pNewMouse); +#define PointsAreEqual(pt1, pt2) (((pt1).x == (pt2).x) && ((pt1).y == (pt2).y)) + //If mouse has moved ... - if (((pMouse.x != pNewMouse.x) || (pMouse.y != pNewMouse.y))) + if (!PointsAreEqual(pMouse, pNewMouse)) { //Update to new position pMouse = pNewMouse; @@ -372,45 +516,64 @@ hasMoved = TRUE; } } - - if (bFollowCaret && guiInfo.hwndCaret) - { - POINT ptCaret; - ptCaret.x = (guiInfo.rcCaret.left + guiInfo.rcCaret.right) / 2; - ptCaret.y = (guiInfo.rcCaret.top + guiInfo.rcCaret.bottom) / 2; - - if (guiInfo.hwndCaret && ((pCaretWnd != guiInfo.hwndCaret) || (pCaret.x != ptCaret.x) || (pCaret.y != ptCaret.y))) + + if(guiInfo.hwndActive != hMainWnd) + { + if (bFollowCaret) { - //Update to new position - pCaret = ptCaret; - pCaretWnd = guiInfo.hwndCaret; - if(!hasMoved) - { - ClientToScreen (guiInfo.hwndCaret, (LPPOINT) &ptCaret); - cp = ptCaret; - } - hasMoved = TRUE; + if (guiInfo.hwndCaret) + { + POINT ptCaret; + ptCaret.x = (guiInfo.rcCaret.left + guiInfo.rcCaret.right) / 2; + ptCaret.y = (guiInfo.rcCaret.top + guiInfo.rcCaret.bottom) / 2; + + if ((pCaretWnd != guiInfo.hwndCaret) || !PointsAreEqual(pCaret, ptCaret)) + { + //Update to new position + pCaret = ptCaret; + pCaretWnd = guiInfo.hwndCaret; + if(!hasMoved) + { + ClientToScreen (guiInfo.hwndCaret, (LPPOINT) &ptCaret); + cp = ptCaret; + hasMoved = TRUE; + } + } + } + else + { + pCaretWnd = NULL; + } } - } - - if (bFollowFocus && guiInfo.hwndFocus) - { - POINT ptFocus; - RECT activeRect; - - //Get current control focus - GetWindowRect (guiInfo.hwndFocus, &activeRect); - ptFocus.x = (activeRect.left + activeRect.right) / 2; - ptFocus.y = (activeRect.top + activeRect.bottom) / 2; - - if(guiInfo.hwndFocus && ((guiInfo.hwndFocus != pFocusWnd) || (pFocus.x != ptFocus.x) || (pFocus.y != ptFocus.y))) + + if (bFollowFocus) { - //Update to new position - pFocus = ptFocus; - pFocusWnd = guiInfo.hwndFocus; - if(!hasMoved) - cp = ptFocus; - hasMoved = TRUE; + if(guiInfo.hwndFocus && !guiInfo.hwndCaret) + { + POINT ptFocus; + RECT activeRect; + + //Get current control focus + GetWindowRect(guiInfo.hwndFocus, &activeRect); + ptFocus.x = (activeRect.left + activeRect.right) / 2; + ptFocus.y = (activeRect.top + activeRect.bottom) / 2; + + if((guiInfo.hwndFocus != pFocusWnd) || !PointsAreEqual(pFocus, ptFocus)) + { + //Update to new position + pFocus = ptFocus; + pFocusWnd = guiInfo.hwndFocus; + if(!hasMoved) + { + cp = ptFocus; + hasMoved = TRUE; + } + } + } + else + { + pFocusWnd = NULL; + } } } @@ -429,8 +592,9 @@ lastTicks = GetTickCount(); Refresh(); } - } - break; + + return 0; + } case WM_COMMAND: { @@ -457,7 +621,7 @@ default: return DefWindowProc(hWnd, message, wParam, lParam); } - break; + return 0; } case WM_PAINT: @@ -467,24 +631,117 @@ dc = BeginPaint(hWnd, &PaintStruct); Draw(dc); EndPaint(hWnd, &PaintStruct); - break; + return 0; } case WM_CONTEXTMENU: TrackPopupMenu(notifyMenu, 0, GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam), 0, hWnd, NULL); - break; + return 0; + + case WM_LBUTTONDOWN: + { + RECT rc; + POINT pt; + SetCapture(hWnd); + + GetCursorPos(&pt); + GetWindowRect(hWnd, &rc); + ptDragOffset.x = pt.x - rc.left; + ptDragOffset.y = pt.y - rc.top; + + nearEdge = AppBarConfig.uEdge; + + break; + } + case WM_MOUSEMOVE: + if(GetCapture() == hWnd) + { + RECT rc; + POINT pt; + RECT rcWorkArea; + SystemParametersInfo(SPI_GETWORKAREA, 0, &rcWorkArea, 0); + GetCursorPos(&pt); + GetWindowRect(hWnd, &rc); + + if(AppBarConfig.uEdge>=0) + { + if (pt.x >= rcWorkArea.left && pt.x <= rcWorkArea.right && + pt.y >= rcWorkArea.top && pt.y <= rcWorkArea.bottom) + { + AttachAppBar(-2); + + // Fixup offset + GetWindowRect(hWnd, &rc); + ptDragOffset.x = (rc.right-rc.left)/2; + ptDragOffset.y = 2; + + rc.left = pt.x - ptDragOffset.x; + rc.top = pt.y - ptDragOffset.y; + + SetWindowPos(hWnd, HWND_TOPMOST, rc.left, rc.top, 0, 0, SWP_NOSIZE); + } + } + else + { + if(pt.x <= rcWorkArea.left+8 && nearEdge != ABE_LEFT) + { + AttachAppBar(ABE_LEFT); + nearEdge = ABE_LEFT; + } + else if(pt.y <= rcWorkArea.top+8 && nearEdge != ABE_TOP) + { + AttachAppBar(ABE_TOP); + nearEdge = ABE_TOP; + } + else if(pt.x >= rcWorkArea.right-8 && nearEdge != ABE_RIGHT) + { + AttachAppBar(ABE_RIGHT); + nearEdge = ABE_RIGHT; + } + else if(pt.y >= rcWorkArea.bottom-8 && nearEdge != ABE_BOTTOM) + { + AttachAppBar(ABE_BOTTOM); + nearEdge = ABE_BOTTOM; + } + else + { + rc.left = pt.x - ptDragOffset.x; + rc.top = pt.y - ptDragOffset.y; + + SetWindowPos(hWnd, HWND_TOPMOST, rc.left, rc.top, 0, 0, SWP_NOSIZE); + nearEdge = -1; + } + } + + pMouse = pt; + Refresh(); + } + break; + case WM_LBUTTONUP: + if(GetCapture() == hWnd) + { + if (AppBarConfig.uEdge>=0) + DoAppBarStuff(ABM_GETSTATE); + else + SetWindowPos(hWnd, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE); + ReleaseCapture(); + } case WM_SIZE: + if(AppBarConfig.uEdge>=0) DoAppBarStuff(ABM_SETPOS); + /* fallthrough */ case WM_DISPLAYCHANGE: bRecreateOffscreenDC = TRUE; Refresh(); - return DefWindowProc(hWnd, message, wParam, lParam); + break; case WM_ERASEBKGND: // handle WM_ERASEBKGND by simply returning non-zero because we did all the drawing in WM_PAINT. - break; + return 0; case WM_DESTROY: + if(AppBarConfig.uEdge>=0) DoAppBarStuff(ABM_REMOVE); + /* Save settings to registry */ SaveSettings(); KillTimer(hWnd , 1); @@ -501,14 +758,11 @@ DestroyIcon(notifyIcon); DestroyWindow(hOptionsDialog); - break; + return 0; case WM_CREATE: { HMENU tempMenu; - - /* Load settings from registry */ - LoadSettings(); /* Get the desktop window */ hDesktopWindow = GetDesktopWindow(); @@ -531,20 +785,57 @@ notifyMenu = GetSubMenu(tempMenu, 0); RemoveMenu(tempMenu, 0, MF_BYPOSITION); DestroyMenu(tempMenu); - - break; + return 0; + } + + case APPMSG_APPBAR: + { + switch (wParam) + { + case ABN_STATECHANGE: + DoAppBarStuff(ABM_GETSTATE); + break; + case ABN_POSCHANGED: + DoAppBarStuff(ABM_SETPOS); + break; + case ABN_FULLSCREENAPP: + { + if(!lParam) + { + DoAppBarStuff(ABM_GETSTATE); + break; + } + + SetWindowPos(hMainWnd, HWND_BOTTOM, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE); + break; + } + case ABN_WINDOWARRANGE: + if(lParam) + ShowWindow(hMainWnd, SW_HIDE); + else + ShowWindow(hMainWnd, SW_SHOW); + } + return 0; } case APPMSG_NOTIFYICON: HandleNotifyIconMessage(hWnd, wParam, lParam); - + return 0; + + case WM_ACTIVATE: + if(AppBarConfig.uEdge>=0) DoAppBarStuff(ABM_ACTIVATE); + break; + + case WM_WINDOWPOSCHANGED: + if(AppBarConfig.uEdge>=0) DoAppBarStuff(ABM_WINDOWPOSCHANGED); + Refresh(); break; default: - return DefWindowProc(hWnd, message, wParam, lParam); - } - - return 0; + break; + } + + return DefWindowProc(hWnd, message, wParam, lParam); } INT_PTR CALLBACK AboutProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) Modified: trunk/reactos/base/applications/magnify/magnifier.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/magnify/…
============================================================================== --- trunk/reactos/base/applications/magnify/magnifier.h [iso-8859-1] (original) +++ trunk/reactos/base/applications/magnify/magnifier.h [iso-8859-1] Mon Dec 14 05:03:06 2015 @@ -26,6 +26,16 @@ extern int iZoom; +struct _AppBarConfig_t { + DWORD cbSize; + INT uEdge; + DWORD value3; + DWORD value4; + RECT appBarSizes; + RECT rcFloating; +}; +extern struct _AppBarConfig_t AppBarConfig; + extern BOOL bShowWarning; extern BOOL bFollowMouse; Modified: trunk/reactos/base/applications/magnify/settings.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/magnify/…
============================================================================== --- trunk/reactos/base/applications/magnify/settings.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/magnify/settings.c [iso-8859-1] Mon Dec 14 05:03:06 2015 @@ -24,38 +24,64 @@ BOOL bStartMinimized = FALSE; BOOL bShowMagnifier = TRUE; +struct _AppBarConfig_t AppBarConfig = { + sizeof(struct _AppBarConfig_t), + -2 /* ABE_TOP */, + 0, 1, /* unknown */ + { 101,101,101,101 }, /* edge sizes */ + { 20, 20, 600, 200 }, /* floating window rect */ +}; + void LoadSettings() { HKEY hkey; LONG value; ULONG len; + struct _AppBarConfig_t config_temp; if (RegOpenKeyEx(HKEY_CURRENT_USER, _T("Software\\Microsoft\\Magnify"), 0, KEY_READ, &hkey) == ERROR_SUCCESS) { + len = sizeof(AppBarConfig); + if (RegQueryValueEx(hkey, _T("AppBar"), 0, 0, (BYTE *)&config_temp, &len) == ERROR_SUCCESS) + { + if(config_temp.cbSize == sizeof(AppBarConfig)) + { + AppBarConfig = config_temp; + } + } + + len = 4; if (RegQueryValueEx(hkey, _T("StationaryMagLevel"), 0, 0, (BYTE *)&value, &len) == ERROR_SUCCESS) { if (value >= 0 && value <= 9) iZoom = value; } + len = 4; if (RegQueryValueEx(hkey, _T("ShowWarning"), 0, 0, (BYTE *)&value, &len) == ERROR_SUCCESS) bShowWarning = (value == 0 ? FALSE : TRUE); + len = 4; if (RegQueryValueEx(hkey, _T("StationaryInvertColors"), 0, 0, (BYTE *)&value, &len) == ERROR_SUCCESS) bInvertColors = (value == 0 ? FALSE : TRUE); + len = 4; if (RegQueryValueEx(hkey, _T("StationaryStartMinimized"), 0, 0, (BYTE *)&value, &len) == ERROR_SUCCESS) bStartMinimized = (value == 0 ? FALSE : TRUE); + len = 4; if (RegQueryValueEx(hkey, _T("StationaryTrackCursor"), 0, 0, (BYTE *)&value, &len) == ERROR_SUCCESS) bFollowMouse = (value == 0 ? FALSE : TRUE); + len = 4; if (RegQueryValueEx(hkey, _T("StationaryTrackFocus"), 0, 0, (BYTE *)&value, &len) == ERROR_SUCCESS) bFollowFocus = (value == 0 ? FALSE : TRUE); + len = 4; if (RegQueryValueEx(hkey, _T("StationaryTrackSecondaryFocus"), 0, 0, (BYTE *)&value, &len) == ERROR_SUCCESS) bFollowFocus = (value == 0 ? FALSE : TRUE); + len = 4; if (RegQueryValueEx(hkey, _T("StationaryTrackText"), 0, 0, (BYTE *)&value, &len) == ERROR_SUCCESS) bFollowCaret = (value == 0 ? FALSE : TRUE); @@ -70,6 +96,8 @@ if (RegCreateKeyEx(HKEY_CURRENT_USER, _T("Software\\Microsoft\\Magnify"), 0, _T(""), 0, KEY_WRITE, NULL, &hkey, NULL) == ERROR_SUCCESS) { + RegSetValueEx(hkey, _T("AppBar"), 0, REG_BINARY, (BYTE *)&AppBarConfig, sizeof(AppBarConfig)); + value = iZoom; RegSetValueEx(hkey, _T("StationaryMagLevel"), 0, REG_DWORD, (BYTE *)&value, sizeof(value));
9 years
1
0
0
0
[fireball] 70343: [WIN32K] - Add (yet another) shutdown.c file, and import trunk's shutdown code there. Key parts are turned off now. - Enable respective parts in the NtUserSetInformationThread. - ...
by fireball@svn.reactos.org
Author: fireball Date: Sun Dec 13 23:16:41 2015 New Revision: 70343 URL:
http://svn.reactos.org/svn/reactos?rev=70343&view=rev
Log: [WIN32K] - Add (yet another) shutdown.c file, and import trunk's shutdown code there. Key parts are turned off now. - Enable respective parts in the NtUserSetInformationThread. - Include undocuser.h Added: branches/arwinss/arwinss/server/include/shutdown.h (with props) branches/arwinss/arwinss/server/main/shutdown.c (with props) Modified: branches/arwinss/arwinss/server/CMakeLists.txt branches/arwinss/arwinss/server/include/win32k.h branches/arwinss/arwinss/server/main/misc.c Modified: branches/arwinss/arwinss/server/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/arwinss/server/CMakeLis…
============================================================================== --- branches/arwinss/arwinss/server/CMakeLists.txt [iso-8859-1] (original) +++ branches/arwinss/arwinss/server/CMakeLists.txt [iso-8859-1] Sun Dec 13 23:16:41 2015 @@ -88,6 +88,7 @@ main/kbdlayout.c main/keyboard.c main/misc.c + main/shutdown.c swm/winman.c wine/atom.c wine/class.c Added: branches/arwinss/arwinss/server/include/shutdown.h URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/arwinss/server/include/…
============================================================================== --- branches/arwinss/arwinss/server/include/shutdown.h (added) +++ branches/arwinss/arwinss/server/include/shutdown.h [iso-8859-1] Sun Dec 13 23:16:41 2015 @@ -0,0 +1,9 @@ +#pragma once + +NTSTATUS +UserInitiateShutdown(IN PETHREAD Thread, + IN OUT PULONG pFlags); + +NTSTATUS +UserEndShutdown(IN PETHREAD Thread, + IN NTSTATUS ShutdownStatus); Propchange: branches/arwinss/arwinss/server/include/shutdown.h ------------------------------------------------------------------------------ svn:eol-style = native Modified: branches/arwinss/arwinss/server/include/win32k.h URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/arwinss/server/include/…
============================================================================== --- branches/arwinss/arwinss/server/include/win32k.h [iso-8859-1] (original) +++ branches/arwinss/arwinss/server/include/win32k.h [iso-8859-1] Sun Dec 13 23:16:41 2015 @@ -52,6 +52,9 @@ #include <ntgdihdl.h> #include <ntgdi.h> +/* Undocumented user definitions */ +#include <undocuser.h> + /* Internal Win32K Header */ #include <win32kp.h> Modified: branches/arwinss/arwinss/server/main/misc.c URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/arwinss/server/main/mis…
============================================================================== --- branches/arwinss/arwinss/server/main/misc.c [iso-8859-1] (original) +++ branches/arwinss/arwinss/server/main/misc.c [iso-8859-1] Sun Dec 13 23:16:41 2015 @@ -14,7 +14,7 @@ #include <debug.h> #include <ntstatus.h> -//#include <shutdown.h> +#include <shutdown.h> #include <csr.h> extern PEPROCESS CsrProcess; @@ -72,8 +72,7 @@ } _SEH2_END; - Status = STATUS_NOT_IMPLEMENTED; //UserInitiateShutdown(Thread, &CapturedFlags); - UNIMPLEMENTED; + Status = UserInitiateShutdown(Thread, &CapturedFlags); /* Return the modified value to the caller */ _SEH2_TRY @@ -115,8 +114,7 @@ } _SEH2_END; - Status = STATUS_NOT_IMPLEMENTED; //UserEndShutdown(Thread, ShutdownStatus); - UNIMPLEMENTED; + Status = UserEndShutdown(Thread, ShutdownStatus); break; } Added: branches/arwinss/arwinss/server/main/shutdown.c URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/arwinss/server/main/shu…
============================================================================== --- branches/arwinss/arwinss/server/main/shutdown.c (added) +++ branches/arwinss/arwinss/server/main/shutdown.c [iso-8859-1] Sun Dec 13 23:16:41 2015 @@ -0,0 +1,265 @@ +/* + * PROJECT: ReactOS Win32K + * LICENSE: GPL - See COPYING in the top level directory + * FILE: server/main/misc.c + * PURPOSE: Shutdown code + * PROGRAMMERS: Aleksey Bragin (aleksey(a)reactos.org) + */ + +/* INCLUDES ******************************************************************/ + +#include <win32k.h> + +//#define NDEBUG +#include <debug.h> + +#include <ntstatus.h> + +/* Our local copy of shutdown flags */ +static ULONG gdwShutdownFlags = 0; + +HWND hwndSAS = NULL; + +NTSTATUS +GetProcessLuid(IN PETHREAD Thread OPTIONAL, + OUT PLUID Luid) +{ + NTSTATUS Status; + PACCESS_TOKEN Token; + SECURITY_IMPERSONATION_LEVEL ImpersonationLevel; + BOOLEAN CopyOnOpen, EffectiveOnly; + + if (Thread == NULL) + Thread = PsGetCurrentThread(); + + /* Use a thread token */ + Token = PsReferenceImpersonationToken(Thread, + &CopyOnOpen, + &EffectiveOnly, + &ImpersonationLevel); + if (Token == NULL) + { + /* We don't have a thread token, use a process token */ + Token = PsReferencePrimaryToken(PsGetThreadProcess(Thread)); + + /* If no token, fail */ + if (Token == NULL) + return STATUS_NO_TOKEN; + } + + /* Query the LUID */ + Status = SeQueryAuthenticationIdToken(Token, Luid); + + /* Get rid of the token and return */ + ObDereferenceObject(Token); + return Status; +} + +BOOL +NotifyLogon(IN HWND hWndSta, + IN PLUID CallerLuid, + IN ULONG Flags, + IN NTSTATUS ShutdownStatus) +{ + // LUID SystemLuid = SYSTEM_LUID; + ULONG Notif, Param; + + DPRINT("NotifyLogon(0x%lx, 0x%lx)\n", Flags, ShutdownStatus); + + /* If no Winlogon notifications are needed, just return */ + if (Flags & EWX_NONOTIFY) + return FALSE; + + /* In case we cancelled the shutdown...*/ + if (Flags & EWX_SHUTDOWN_CANCELED) + { + /* ... send a LN_LOGOFF_CANCELED to Winlogon with the real cancel status... */ + Notif = LN_LOGOFF_CANCELED; + Param = ShutdownStatus; + } + else + { + /* ... otherwise it's a real logoff. Send the shutdown flags in that case. */ + Notif = LN_LOGOFF; + Param = Flags; + } + + // FIXME: At the moment, always send the notifications... In real world some checks are done. + // if (hwndSAS && ( (Flags & EWX_SHUTDOWN) || RtlEqualLuid(CallerLuid, &SystemLuid)) ) + if (hwndSAS) + { + DPRINT("\tSending %s, Param 0x%x message to Winlogon\n", Notif == LN_LOGOFF ? "LN_LOGOFF" : "LN_LOGOFF_CANCELED", Param); + //UserPostMessage(hwndSAS, WM_LOGONNOTIFY, Notif, (LPARAM)Param); + UNIMPLEMENTED; + return TRUE; + } + else + { + DPRINT1("hwndSAS == NULL\n"); + } + + return FALSE; +} + + +NTSTATUS +UserInitiateShutdown(IN PETHREAD Thread, + IN OUT PULONG pFlags) +{ + NTSTATUS Status; + ULONG Flags = *pFlags; + LUID CallerLuid; + LUID SystemLuid = SYSTEM_LUID; + /*static PRIVILEGE_SET ShutdownPrivilege = + { + 1, PRIVILEGE_SET_ALL_NECESSARY, + { {{SE_SHUTDOWN_PRIVILEGE, 0}, 0} } + };*/ + + PPROCESSINFO ppi; + + DPRINT("UserInitiateShutdown\n"); + + /* Get the caller's LUID */ + Status = GetProcessLuid(Thread, &CallerLuid); + if (!NT_SUCCESS(Status)) + { + DPRINT1("GetProcessLuid failed\n"); + return Status; + } + + /* + * Check if this is the System LUID, and adjust flags if needed. + * In particular, be sure there is no EWX_CALLER_SYSTEM flag + * spuriously set (could be the sign of malicous app!). + */ + if (RtlEqualLuid(&CallerLuid, &SystemLuid)) + Flags |= EWX_CALLER_SYSTEM; + else + Flags &= ~EWX_CALLER_SYSTEM; + + *pFlags = Flags; + + /* Retrieve the Win32 process info */ + ppi = PsGetProcessWin32Process(PsGetThreadProcess(Thread)); + if (ppi == NULL) + return STATUS_INVALID_HANDLE; + +#if 0 + /* If the caller is not Winlogon, do some security checks */ + if (PsGetThreadProcessId(Thread) != gpidLogon) + { + /* + * Here also, be sure there is no EWX_CALLER_WINLOGON flag + * spuriously set (could be the sign of malicous app!). + */ + Flags &= ~EWX_CALLER_WINLOGON; + + *pFlags = Flags; + + /* Check whether the current process is attached to a window station */ + if (ppi->prpwinsta == NULL) + return STATUS_INVALID_HANDLE; + + /* Check whether the window station of the current process can send exit requests */ + if (!RtlAreAllAccessesGranted(ppi->amwinsta, WINSTA_EXITWINDOWS)) + return STATUS_ACCESS_DENIED; + + /* + * NOTE: USERSRV automatically adds the shutdown flag when we poweroff or reboot. + * + * If the caller wants to shutdown / reboot / power-off... + */ + if (Flags & EWX_SHUTDOWN) + { + /* ... check whether it has shutdown privilege */ + if (!HasPrivilege(&ShutdownPrivilege)) + return STATUS_PRIVILEGE_NOT_HELD; + } + else + { + /* + * ... but if it just wants to log-off, in case its + * window station is a non-IO one, fail the call. + */ + if (ppi->prpwinsta->Flags & WSS_NOIO) + return STATUS_INVALID_DEVICE_REQUEST; + } + } + + /* If the caller is not Winlogon, possibly notify it to perform the real shutdown */ + if (PsGetThreadProcessId(Thread) != gpidLogon) + { + // FIXME: HACK!! Do more checks!! + ERR("UserInitiateShutdown -- Notify Winlogon for shutdown\n"); + NotifyLogon(hwndSAS, &CallerLuid, Flags, STATUS_SUCCESS); + return STATUS_PENDING; + } + + // If we reach this point, that means it's Winlogon that triggered the shutdown. + ERR("UserInitiateShutdown -- Winlogon is doing a shutdown\n"); + + /* + * Update and save the shutdown flags globally for renotifying + * Winlogon if needed, when calling EndShutdown. + */ + Flags |= EWX_CALLER_WINLOGON; // Winlogon is doing a shutdown, be sure the internal flag is set. + *pFlags = Flags; + + /* Save the shutdown flags now */ + gdwShutdownFlags = Flags; +#else + UNIMPLEMENTED; +#endif + return STATUS_SUCCESS; +} + +NTSTATUS +UserEndShutdown(IN PETHREAD Thread, + IN NTSTATUS ShutdownStatus) +{ + NTSTATUS Status; + ULONG Flags; + LUID CallerLuid; + + DPRINT("UserEndShutdown\n"); + + /* + * FIXME: Some cleanup should be done when shutdown succeeds, + * and some reset should be done when shutdown is cancelled. + */ + Status = GetProcessLuid(Thread, &CallerLuid); + if (!NT_SUCCESS(Status)) + { + DPRINT1("GetProcessLuid failed\n"); + return Status; + } + + /* Copy the global flags because we're going to modify them for our purposes */ + Flags = gdwShutdownFlags; + + if (NT_SUCCESS(ShutdownStatus)) + { + /* Just report success, and keep the shutdown flags as they are */ + ShutdownStatus = STATUS_SUCCESS; + } + else + { + /* Report the status to Winlogon and say that we cancel the shutdown */ + Flags |= EWX_SHUTDOWN_CANCELED; + // FIXME: Should we reset gdwShutdownFlags to 0 ?? + } + + DPRINT("UserEndShutdown -- Notify Winlogon for end of shutdown\n"); + +#if 0 + NotifyLogon(hwndSAS, &CallerLuid, Flags, ShutdownStatus); +#else + UNIMPLEMENTED +#endif + + /* Always return success */ + return STATUS_SUCCESS; +} + +/* EOF */ Propchange: branches/arwinss/arwinss/server/main/shutdown.c ------------------------------------------------------------------------------ svn:eol-style = native
9 years
1
0
0
0
[fireball] 70342: [ARWINSS] - Update patch for trunk. Size--; - Thanks to Konstantin Shkil for spotting and fixing that dhcpsvc.dll overlap!
by fireball@svn.reactos.org
Author: fireball Date: Sun Dec 13 22:31:27 2015 New Revision: 70342 URL:
http://svn.reactos.org/svn/reactos?rev=70342&view=rev
Log: [ARWINSS] - Update patch for trunk. Size--; - Thanks to Konstantin Shkil for spotting and fixing that dhcpsvc.dll overlap! Modified: branches/arwinss/trunk.diff Modified: branches/arwinss/trunk.diff URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/trunk.diff?rev=70342&r1…
============================================================================== --- branches/arwinss/trunk.diff [iso-8859-1] (original) +++ branches/arwinss/trunk.diff [iso-8859-1] Sun Dec 13 22:31:27 2015 @@ -1,6 +1,6 @@ Index: base/system/winlogon/winlogon.c =================================================================== ---- base/system/winlogon/winlogon.c (revision 69795) +--- base/system/winlogon/winlogon.c (revision 70340) +++ base/system/winlogon/winlogon.c (working copy) @@ -397,7 +397,7 @@ HandleShutdown(WLSession, WLX_SAS_ACTION_SHUTDOWN_REBOOT); @@ -13,22 +13,24 @@ #if 0 Index: cmake/baseaddress.cmake =================================================================== ---- cmake/baseaddress.cmake (revision 69795) +--- cmake/baseaddress.cmake (revision 70340) +++ cmake/baseaddress.cmake (working copy) -@@ -2,8 +2,8 @@ +@@ -2,9 +2,9 @@ set(baseaddress_kernel32 0x7c750000) set(baseaddress_msvcrt 0x7c6b0000) set(baseaddress_advapi32 0x7c610000) -set(baseaddress_gdi32 0x7c570000) -set(baseaddress_user32 0x7c3d0000) +-set(baseaddress_dhcpcsvc 0x7c380000) +set(baseaddress_gdi32 0x7c530000) +set(baseaddress_user32 0x7c380000) - set(baseaddress_dhcpcsvc 0x7c380000) ++set(baseaddress_dhcpcsvc 0x7cb80000) set(baseaddress_dnsapi 0x7c330000) set(baseaddress_icmp 0x7c300000) + set(baseaddress_iphlpapi 0x7c2b0000) Index: cmake/config.cmake =================================================================== ---- cmake/config.cmake (revision 69795) +--- cmake/config.cmake (revision 70340) +++ cmake/config.cmake (working copy) @@ -58,6 +58,9 @@ "Whether to compile support for ELF files. @@ -42,7 +44,7 @@ If you live in a country where software patents are valid/apply, don't Index: CMakeLists.txt =================================================================== ---- CMakeLists.txt (revision 69795) +--- CMakeLists.txt (revision 70340) +++ CMakeLists.txt (working copy) @@ -165,6 +165,10 @@ add_definitions(-D_WINKD_=1) @@ -67,7 +69,7 @@ create_registry_hives() Index: dll/win32/kernel32/client/dllmain.c =================================================================== ---- dll/win32/kernel32/client/dllmain.c (revision 69795) +--- dll/win32/kernel32/client/dllmain.c (revision 70340) +++ dll/win32/kernel32/client/dllmain.c (working copy) @@ -131,7 +131,7 @@ SessionId, @@ -80,7 +82,7 @@ BASESRV_SERVERDLL_INDEX, Index: dll/win32/msgina/gui.c =================================================================== ---- dll/win32/msgina/gui.c (revision 69795) +--- dll/win32/msgina/gui.c (revision 70340) +++ dll/win32/msgina/gui.c (working copy) @@ -73,6 +73,7 @@ @@ -111,7 +113,7 @@ /* Index: include/asm/syscalls.inc =================================================================== ---- include/asm/syscalls.inc (revision 69795) +--- include/asm/syscalls.inc (revision 70340) +++ include/asm/syscalls.inc (working copy) @@ -1,4 +1,4 @@ - @@ -323,7 +325,7 @@ -#endif Index: include/psdk/winddi.h =================================================================== ---- include/psdk/winddi.h (revision 69795) +--- include/psdk/winddi.h (revision 70340) +++ include/psdk/winddi.h (working copy) @@ -2911,7 +2911,7 @@ _In_ ULONG cjSize, @@ -336,7 +338,7 @@ APIENTRY Index: include/reactos/wine/config.h =================================================================== ---- include/reactos/wine/config.h (revision 69795) +--- include/reactos/wine/config.h (revision 70340) +++ include/reactos/wine/config.h (working copy) @@ -1,3 +1,5 @@ +#include "reactos/buildno.h" @@ -346,7 +348,7 @@ /* Define to a function attribute for Microsoft hotpatch assembly prefix. */ Index: lib/3rdparty/CMakeLists.txt =================================================================== ---- lib/3rdparty/CMakeLists.txt (revision 69795) +--- lib/3rdparty/CMakeLists.txt (revision 70340) +++ lib/3rdparty/CMakeLists.txt (working copy) @@ -2,7 +2,9 @@ add_subdirectory(adns) @@ -360,7 +362,7 @@ add_subdirectory(libsamplerate) Index: subsystems/win32/csrsrv/init.c =================================================================== ---- subsystems/win32/csrsrv/init.c (revision 69795) +--- subsystems/win32/csrsrv/init.c (revision 70340) +++ subsystems/win32/csrsrv/init.c (working copy) @@ -20,7 +20,7 @@ /* DATA ***********************************************************************/ @@ -373,7 +375,7 @@ HANDLE CsrObjectDirectory = NULL; Index: win32ss/CMakeLists.txt =================================================================== ---- win32ss/CMakeLists.txt (revision 69795) +--- win32ss/CMakeLists.txt (revision 70340) +++ win32ss/CMakeLists.txt (working copy) @@ -10,7 +10,10 @@ PROJECT(WIN32SS) @@ -402,7 +404,7 @@ \ No newline at end of file Index: win32ss/drivers/CMakeLists.txt =================================================================== ---- win32ss/drivers/CMakeLists.txt (revision 69795) +--- win32ss/drivers/CMakeLists.txt (revision 70340) +++ win32ss/drivers/CMakeLists.txt (working copy) @@ -1,6 +1,8 @@ @@ -415,7 +417,7 @@ add_subdirectory(watchdog) Index: win32ss/include/ntgdihdl.h =================================================================== ---- win32ss/include/ntgdihdl.h (revision 69795) +--- win32ss/include/ntgdihdl.h (revision 70340) +++ win32ss/include/ntgdihdl.h (working copy) @@ -260,6 +260,7 @@ DWORD dwCFCount; @@ -447,7 +449,7 @@ FLONG AttrFlags; Index: win32ss/user/winsrv/consrv/conoutput.c =================================================================== ---- win32ss/user/winsrv/consrv/conoutput.c (revision 69795) +--- win32ss/user/winsrv/consrv/conoutput.c (revision 70340) +++ win32ss/user/winsrv/consrv/conoutput.c (working copy) @@ -99,9 +99,13 @@ * Indeed, the palette handle comes from a console app @@ -465,7 +467,7 @@ Buffer, Index: win32ss/user/winsrv/consrv/frontends/gui/conwnd.c =================================================================== ---- win32ss/user/winsrv/consrv/frontends/gui/conwnd.c (revision 69795) +--- win32ss/user/winsrv/consrv/frontends/gui/conwnd.c (revision 70340) +++ win32ss/user/winsrv/consrv/frontends/gui/conwnd.c (working copy) @@ -159,7 +159,11 @@ } @@ -481,9 +483,9 @@ return (WndClassAtom != 0); Index: win32ss/user/winsrv/consrv/frontends/gui/guiterm.c =================================================================== ---- win32ss/user/winsrv/consrv/frontends/gui/guiterm.c (revision 69795) +--- win32ss/user/winsrv/consrv/frontends/gui/guiterm.c (revision 70340) +++ win32ss/user/winsrv/consrv/frontends/gui/guiterm.c (working copy) -@@ -160,9 +160,14 @@ +@@ -161,9 +161,14 @@ /* Assign this console input thread to this desktop */ DesktopConsoleThreadInfo.DesktopHandle = GuiInitInfo->Desktop; // Duplicated desktop handle DesktopConsoleThreadInfo.ThreadId = InputThreadId; @@ -498,7 +500,7 @@ if (!NT_SUCCESS(Status)) goto Quit; /* Connect this CSR thread to the USER subsystem */ -@@ -299,9 +304,13 @@ +@@ -301,9 +306,13 @@ /* Remove this console input thread from this desktop */ // DesktopConsoleThreadInfo.DesktopHandle; DesktopConsoleThreadInfo.ThreadId = 0; @@ -512,7 +514,7 @@ /* Close the duplicated desktop handle */ CloseDesktop(DesktopConsoleThreadInfo.DesktopHandle); // NtUserCloseDesktop -@@ -358,11 +367,16 @@ +@@ -366,11 +375,16 @@ { RtlInitUnicodeString(&DesktopPath, L"Default"); } @@ -532,27 +534,9 @@ Index: win32ss/user/winsrv/usersrv/init.c =================================================================== ---- win32ss/user/winsrv/usersrv/init.c (revision 69795) +--- win32ss/user/winsrv/usersrv/init.c (revision 70340) +++ win32ss/user/winsrv/usersrv/init.c (working copy) -@@ -173,6 +173,7 @@ - CsrApiPort = CsrQueryApiPort(); - - /* Inform win32k about the API port */ -+#ifndef _ARWINSS_ - Status = NtUserSetInformationThread(NtCurrentThread(), - UserThreadCsrApiPort, - &CsrApiPort, -@@ -181,6 +182,9 @@ - { - return Status; - } -+#else -+ UNIMPLEMENTED -+#endif - } - - /* Check connection info validity */ -@@ -199,9 +203,14 @@ +@@ -199,9 +199,14 @@ /* Pass the request to win32k */ ConnectInfo->dwDispatchCount = 0; // gDispatchTableValues; @@ -567,7 +551,7 @@ return Status; } -@@ -254,7 +263,11 @@ +@@ -254,7 +259,11 @@ } /* Set the process creation notify routine for BASE */ @@ -581,7 +565,7 @@ Status = NtUserInitialize(USER_VERSION, Index: win32ss/user/winsrv/usersrv/shutdown.c =================================================================== ---- win32ss/user/winsrv/usersrv/shutdown.c (revision 69795) +--- win32ss/user/winsrv/usersrv/shutdown.c (revision 70340) +++ win32ss/user/winsrv/usersrv/shutdown.c (working copy) @@ -381,7 +381,12 @@ static BOOLEAN @@ -596,32 +580,3 @@ } -@@ -678,9 +683,14 @@ - while (TRUE) - { - /* Notify Win32k and potentially Winlogon of the shutdown */ -+#ifndef _ARWINSS_ - Status = NtUserSetInformationThread(CsrThread->ThreadHandle, - UserThreadInitiateShutdown, - &Flags, sizeof(Flags)); -+#else -+ Status = STATUS_SUCCESS; -+ UNIMPLEMENTED -+#endif - DPRINT1("Win32k says: %lx\n", Status); - switch (Status) - { -@@ -736,9 +746,13 @@ - // FIXME: If Status == STATUS_CANCELLED, call RecordShutdownReason - - /* Tell Win32k and potentially Winlogon that we're done */ -+#ifndef _ARWINSS_ - NtUserSetInformationThread(CsrThread->ThreadHandle, - UserThreadEndShutdown, - &Status, sizeof(Status)); -+#else -+ UNIMPLEMENTED -+#endif - - DPRINT1("SrvExitWindowsEx returned 0x%08x\n", Status); -
9 years
1
0
0
0
[fireball] 70341: [WIN32K] - Add NtUserSetInformationThread stub, thanks to Konstantin Shkil. The general direction is that it's fine to add syscalls to Arwinss' win32k which are called by other co...
by fireball@svn.reactos.org
Author: fireball Date: Sun Dec 13 22:29:04 2015 New Revision: 70341 URL:
http://svn.reactos.org/svn/reactos?rev=70341&view=rev
Log: [WIN32K] - Add NtUserSetInformationThread stub, thanks to Konstantin Shkil. The general direction is that it's fine to add syscalls to Arwinss' win32k which are called by other components like usersrv/consrv, as the list is quite small really, and NtUserInitialize is already there. Added: branches/arwinss/arwinss/server/main/misc.c (with props) Modified: branches/arwinss/arwinss/server/CMakeLists.txt branches/arwinss/arwinss/server/w32ksvc.db branches/arwinss/arwinss/server/w32ksvc.h Modified: branches/arwinss/arwinss/server/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/arwinss/server/CMakeLis…
============================================================================== --- branches/arwinss/arwinss/server/CMakeLists.txt [iso-8859-1] (original) +++ branches/arwinss/arwinss/server/CMakeLists.txt [iso-8859-1] Sun Dec 13 22:29:04 2015 @@ -87,6 +87,7 @@ main/monitor.c main/kbdlayout.c main/keyboard.c + main/misc.c swm/winman.c wine/atom.c wine/class.c Added: branches/arwinss/arwinss/server/main/misc.c URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/arwinss/server/main/mis…
============================================================================== --- branches/arwinss/arwinss/server/main/misc.c (added) +++ branches/arwinss/arwinss/server/main/misc.c [iso-8859-1] Sun Dec 13 22:29:04 2015 @@ -0,0 +1,167 @@ +/* + * PROJECT: ReactOS Win32K + * LICENSE: GPL - See COPYING in the top level directory + * FILE: server/main/misc.c + * PURPOSE: Misc stuff + * PROGRAMMERS: Aleksey Bragin (aleksey(a)reactos.org) + */ + +/* INCLUDES ******************************************************************/ + +#include <win32k.h> + +//#define NDEBUG +#include <debug.h> + +#include <ntstatus.h> +//#include <shutdown.h> +#include <csr.h> + +extern PEPROCESS CsrProcess; + +NTSTATUS +APIENTRY +NtUserSetInformationThread(IN HANDLE ThreadHandle, + IN USERTHREADINFOCLASS ThreadInformationClass, + IN PVOID ThreadInformation, + IN ULONG ThreadInformationLength) +{ + NTSTATUS Status = STATUS_SUCCESS; + PETHREAD Thread; + + /* Allow only CSRSS to perform this operation */ + if (PsGetCurrentProcess() != CsrProcess) + return STATUS_ACCESS_DENIED; + + UserEnterExclusive(); + + /* Get the Thread */ + Status = ObReferenceObjectByHandle(ThreadHandle, + THREAD_SET_INFORMATION, + *PsThreadType, + UserMode, + (PVOID)&Thread, + NULL); + if (!NT_SUCCESS(Status)) goto Quit; + + switch (ThreadInformationClass) + { + case UserThreadInitiateShutdown: + { + ULONG CapturedFlags = 0; + + DPRINT("Shutdown initiated\n"); + + if (ThreadInformationLength != sizeof(ULONG)) + { + Status = STATUS_INFO_LENGTH_MISMATCH; + break; + } + + /* Capture the caller value */ + Status = STATUS_SUCCESS; + _SEH2_TRY + { + ProbeForWrite(ThreadInformation, sizeof(CapturedFlags), sizeof(PVOID)); + CapturedFlags = *(PULONG)ThreadInformation; + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + Status = _SEH2_GetExceptionCode(); + _SEH2_YIELD(break); + } + _SEH2_END; + + Status = STATUS_NOT_IMPLEMENTED; //UserInitiateShutdown(Thread, &CapturedFlags); + UNIMPLEMENTED; + + /* Return the modified value to the caller */ + _SEH2_TRY + { + *(PULONG)ThreadInformation = CapturedFlags; + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + Status = _SEH2_GetExceptionCode(); + } + _SEH2_END; + + break; + } + + case UserThreadEndShutdown: + { + NTSTATUS ShutdownStatus; + + DPRINT("Shutdown ended\n"); + + if (ThreadInformationLength != sizeof(ShutdownStatus)) + { + Status = STATUS_INFO_LENGTH_MISMATCH; + break; + } + + /* Capture the caller value */ + Status = STATUS_SUCCESS; + _SEH2_TRY + { + ProbeForRead(ThreadInformation, sizeof(ShutdownStatus), sizeof(PVOID)); + ShutdownStatus = *(NTSTATUS*)ThreadInformation; + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + Status = _SEH2_GetExceptionCode(); + _SEH2_YIELD(break); + } + _SEH2_END; + + Status = STATUS_NOT_IMPLEMENTED; //UserEndShutdown(Thread, ShutdownStatus); + UNIMPLEMENTED; + break; + } + + case UserThreadCsrApiPort: + { + HANDLE CsrPortHandle; + + DPRINT("Set CSR API Port for Win32k\n"); + + if (ThreadInformationLength != sizeof(CsrPortHandle)) + { + Status = STATUS_INFO_LENGTH_MISMATCH; + break; + } + + /* Capture the caller value */ + Status = STATUS_SUCCESS; + _SEH2_TRY + { + ProbeForRead(ThreadInformation, sizeof(CsrPortHandle), sizeof(PVOID)); + CsrPortHandle = *(PHANDLE)ThreadInformation; + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + Status = _SEH2_GetExceptionCode(); + _SEH2_YIELD(break); + } + _SEH2_END; + + Status = STATUS_NOT_IMPLEMENTED;//InitCsrApiPort(CsrPortHandle); + UNIMPLEMENTED; + break; + } + + default: + { + UNIMPLEMENTED; + Status = STATUS_NOT_IMPLEMENTED; + break; + } + } + + ObDereferenceObject(Thread); + +Quit: + UserLeave(); + return Status; +} Propchange: branches/arwinss/arwinss/server/main/misc.c ------------------------------------------------------------------------------ svn:eol-style = native Modified: branches/arwinss/arwinss/server/w32ksvc.db URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/arwinss/server/w32ksvc.…
============================================================================== --- branches/arwinss/arwinss/server/w32ksvc.db [iso-8859-1] (original) +++ branches/arwinss/arwinss/server/w32ksvc.db [iso-8859-1] Sun Dec 13 22:29:04 2015 @@ -92,4 +92,5 @@ SwmPosChanged 5 SwmGetWindowFromPoint 2 SwmShowWindow 3 -NtUserInitialize 3 +NtUserInitialize 3 +NtUserSetInformationThread 4 Modified: branches/arwinss/arwinss/server/w32ksvc.h URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/arwinss/server/w32ksvc.…
============================================================================== --- branches/arwinss/arwinss/server/w32ksvc.h [iso-8859-1] (original) +++ branches/arwinss/arwinss/server/w32ksvc.h [iso-8859-1] Sun Dec 13 22:29:04 2015 @@ -96,3 +96,4 @@ SVC_(SwmGetWindowFromPoint, 2) SVC_(SwmShowWindow, 3) SVC_(NtUserInitialize, 3) +SVC_(NtUserSetInformationThread, 4)
9 years
1
0
0
0
[tfaber] 70340: [RAPPS] - Remove checksum from uTorrent download, since the only available URL is for the latest build (so it changes)
by tfaber@svn.reactos.org
Author: tfaber Date: Sun Dec 13 13:20:31 2015 New Revision: 70340 URL:
http://svn.reactos.org/svn/reactos?rev=70340&view=rev
Log: [RAPPS] - Remove checksum from uTorrent download, since the only available URL is for the latest build (so it changes) Modified: trunk/reactos/media/rapps/utorrent.txt Modified: trunk/reactos/media/rapps/utorrent.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/rapps/utorrent.txt?r…
============================================================================== --- trunk/reactos/media/rapps/utorrent.txt [iso-8859-1] (original) +++ trunk/reactos/media/rapps/utorrent.txt [iso-8859-1] Sun Dec 13 13:20:31 2015 @@ -4,14 +4,13 @@ [Section] Name = µTorrent -Version = 3.4.3 +Version = 3.4.5 License = Freeware for non-commercial uses Description = Small and fast BitTorrent Client. -Size = 1.66 MB +Size = 1.93 MB Category = 5 URLSite =
http://www.utorrent.com/
URLDownload =
http://download-new.utorrent.com/endpoint/utorrent/os/windows/track/stable/…
-SHA1 = 8fffab0df9bf581c209337fc07ea93d2ba22cc8c CDPath = none [Section.0407]
9 years
1
0
0
0
[tfaber] 70339: [RAPPS] - Fix PuTTY URL (don't use /latest/)
by tfaber@svn.reactos.org
Author: tfaber Date: Sun Dec 13 13:05:00 2015 New Revision: 70339 URL:
http://svn.reactos.org/svn/reactos?rev=70339&view=rev
Log: [RAPPS] - Fix PuTTY URL (don't use /latest/) Modified: trunk/reactos/media/rapps/putty.txt Modified: trunk/reactos/media/rapps/putty.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/rapps/putty.txt?rev=…
============================================================================== --- trunk/reactos/media/rapps/putty.txt [iso-8859-1] (original) +++ trunk/reactos/media/rapps/putty.txt [iso-8859-1] Sun Dec 13 13:05:00 2015 @@ -10,7 +10,7 @@ Size = 1.84 MB Category = 5 URLSite =
http://www.chiark.greenend.org.uk/~sgtatham/putty/
-URLDownload =
http://the.earth.li/~sgtatham/putty/latest/x86/putty-0.65-installer.exe
+URLDownload =
http://the.earth.li/~sgtatham/putty/0.65/x86/putty-0.65-installer.exe
SHA1 = 119261bd53b792e13e7fd27384e86ea960597a7e CDPath = none
9 years
1
0
0
0
[dquintana] 70338: [WIN32K] * GetGUIThreadInfo: When they said "foreground thread", they meant the one with the keyboard focus, not the currently running one. NOTE: This needs verification, as I ha...
by dquintana@svn.reactos.org
Author: dquintana Date: Sun Dec 13 06:08:12 2015 New Revision: 70338 URL:
http://svn.reactos.org/svn/reactos?rev=70338&view=rev
Log: [WIN32K] * GetGUIThreadInfo: When they said "foreground thread", they meant the one with the keyboard focus, not the currently running one. NOTE: This needs verification, as I have no idea how to properly handle IntGetFocusMessageQueue() returning NULL. [MAGNIFY] * Make use of the new-found ability to call GetGUIThreadInfo with 0 as the threadId. CORE-10691 Modified: trunk/reactos/base/applications/magnify/magnifier.c trunk/reactos/win32ss/user/ntuser/misc.c Modified: trunk/reactos/base/applications/magnify/magnifier.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/magnify/…
============================================================================== --- trunk/reactos/base/applications/magnify/magnifier.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/magnify/magnifier.c [iso-8859-1] Sun Dec 13 06:08:12 2015 @@ -350,12 +350,11 @@ case WM_TIMER: { BOOL hasMoved = FALSE; - HWND hwndForeground = GetForegroundWindow (); - DWORD threadId = GetWindowThreadProcessId(hwndForeground, NULL); + GUITHREADINFO guiInfo; guiInfo.cbSize = sizeof(guiInfo); - GetGUIThreadInfo(threadId, &guiInfo); + GetGUIThreadInfo(0, &guiInfo); if (bFollowMouse) { @@ -374,7 +373,7 @@ } } - if (bFollowCaret && hwndForeground && guiInfo.hwndCaret) + if (bFollowCaret && guiInfo.hwndCaret) { POINT ptCaret; ptCaret.x = (guiInfo.rcCaret.left + guiInfo.rcCaret.right) / 2; @@ -394,7 +393,7 @@ } } - if (bFollowFocus && hwndForeground && guiInfo.hwndFocus) + if (bFollowFocus && guiInfo.hwndFocus) { POINT ptFocus; RECT activeRect; Modified: trunk/reactos/win32ss/user/ntuser/misc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/misc.c…
============================================================================== --- trunk/reactos/win32ss/user/ntuser/misc.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/misc.c [iso-8859-1] Sun Dec 13 06:08:12 2015 @@ -371,27 +371,31 @@ } W32Thread = (PTHREADINFO)Thread->Tcb.Win32Thread; Desktop = W32Thread->rpdesk; + + if (!Thread || !Desktop ) + { + if(Thread) + ObDereferenceObject(Thread); + EngSetLastError(ERROR_ACCESS_DENIED); + RETURN( FALSE); + } + + if ( W32Thread->MessageQueue ) + MsgQueue = W32Thread->MessageQueue; + else + { + if ( Desktop ) MsgQueue = Desktop->ActiveMessageQueue; + } } else { /* Get the foreground thread */ - Thread = PsGetCurrentThread(); - W32Thread = (PTHREADINFO)Thread->Tcb.Win32Thread; - Desktop = W32Thread->rpdesk; - } - - if (!Thread || !Desktop ) - { - if(idThread && Thread) - ObDereferenceObject(Thread); - EngSetLastError(ERROR_ACCESS_DENIED); - RETURN( FALSE); - } - - if ( W32Thread->MessageQueue ) - MsgQueue = W32Thread->MessageQueue; - else - { - if ( Desktop ) MsgQueue = Desktop->ActiveMessageQueue; + /* FIXME: Handle NULL queue properly? */ + MsgQueue = IntGetFocusMessageQueue(); + if(!MsgQueue) + { + EngSetLastError(ERROR_ACCESS_DENIED); + RETURN( FALSE); + } } CaretInfo = &MsgQueue->CaretInfo;
9 years
1
0
0
0
← Newer
1
...
11
12
13
14
15
16
17
...
26
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
Results per page:
10
25
50
100
200