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
2025
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
March 2010
----- 2025 -----
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
19 participants
896 discussions
Start a n
N
ew thread
[tkreuzer] 46008: Add some types and contants to ntpoapi.h
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Mon Mar 8 22:00:56 2010 New Revision: 46008 URL:
http://svn.reactos.org/svn/reactos?rev=46008&view=rev
Log: Add some types and contants to ntpoapi.h Modified: branches/header-work/include/ddk/ntpoapi.h Modified: branches/header-work/include/ddk/ntpoapi.h URL:
http://svn.reactos.org/svn/reactos/branches/header-work/include/ddk/ntpoapi…
============================================================================== --- branches/header-work/include/ddk/ntpoapi.h [iso-8859-1] (original) +++ branches/header-work/include/ddk/ntpoapi.h [iso-8859-1] Mon Mar 8 22:00:56 2010 @@ -270,6 +270,39 @@ ULONG CurrentIdleState; } PROCESSOR_POWER_INFORMATION, *PPROCESSOR_POWER_INFORMATION; +typedef struct _POWER_ACTION_POLICY { + POWER_ACTION Action; + ULONG Flags; + ULONG EventCode; +} POWER_ACTION_POLICY, *PPOWER_ACTION_POLICY; + +/* POWER_ACTION_POLICY.Flags constants */ +#define POWER_ACTION_QUERY_ALLOWED 0x00000001 +#define POWER_ACTION_UI_ALLOWED 0x00000002 +#define POWER_ACTION_OVERRIDE_APPS 0x00000004 +#define POWER_ACTION_LIGHTEST_FIRST 0x10000000 +#define POWER_ACTION_LOCK_CONSOLE 0x20000000 +#define POWER_ACTION_DISABLE_WAKES 0x40000000 +#define POWER_ACTION_CRITICAL 0x80000000 + +/* POWER_ACTION_POLICY.EventCode constants */ +#define POWER_LEVEL_USER_NOTIFY_TEXT 0x00000001 +#define POWER_LEVEL_USER_NOTIFY_SOUND 0x00000002 +#define POWER_LEVEL_USER_NOTIFY_EXEC 0x00000004 +#define POWER_USER_NOTIFY_BUTTON 0x00000008 +#define POWER_USER_NOTIFY_SHUTDOWN 0x00000010 +#define POWER_FORCE_TRIGGER_RESET 0x80000000 + +#define DISCHARGE_POLICY_CRITICAL 0 +#define DISCHARGE_POLICY_LOW 1 +#define NUM_DISCHARGE_POLICIES 4 + +#define PO_THROTTLE_NONE 0 +#define PO_THROTTLE_CONSTANT 1 +#define PO_THROTTLE_DEGRADE 2 +#define PO_THROTTLE_ADAPTIVE 3 +#define PO_THROTTLE_MAXIMUM 4 + #ifdef __cplusplus } #endif
14 years, 10 months
1
0
0
0
[jimtabor] 46007: [User32] - Andrew Nguyen : Ensure That WM_INITDIALOG passes the first tabstop control handle to the dialog procedure. - Henri Verbeet : Also show dialogs right after a WM_TIMER message.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Mon Mar 8 21:57:24 2010 New Revision: 46007 URL:
http://svn.reactos.org/svn/reactos?rev=46007&view=rev
Log: [User32] - Andrew Nguyen : Ensure That WM_INITDIALOG passes the first tabstop control handle to the dialog procedure. - Henri Verbeet : Also show dialogs right after a WM_TIMER message. Modified: trunk/reactos/dll/win32/user32/windows/dialog.c Modified: trunk/reactos/dll/win32/user32/windows/dialog.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/windows/d…
============================================================================== --- trunk/reactos/dll/win32/user32/windows/dialog.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/user32/windows/dialog.c [iso-8859-1] Mon Mar 8 21:57:24 2010 @@ -560,6 +560,12 @@ DispatchMessageW( &msg ); } if (dlgInfo->flags & DF_END) break; + + if (bFirstEmpty && msg.message == WM_TIMER) + { + ShowWindow( hwnd, SW_SHOWNORMAL ); + bFirstEmpty = FALSE; + } } } if (dlgInfo->flags & DF_OWNERENABLED) DIALOG_EnableOwner( owner ); @@ -968,10 +974,13 @@ if (dlgProc) { - if (SendMessageW( hwnd, WM_INITDIALOG, (WPARAM)dlgInfo->hwndFocus, param ) && + HWND focus = GetNextDlgTabItem( hwnd, 0, FALSE ); + if (SendMessageW( hwnd, WM_INITDIALOG, (WPARAM)focus, param ) && ((~template.style & DS_CONTROL) || (template.style & WS_VISIBLE))) { - /* By returning TRUE, app has requested a default focus assignment */ + /* By returning TRUE, app has requested a default focus assignment. + * WM_INITDIALOG may have changed the tab order, so find the first + * tabstop control again. */ dlgInfo->hwndFocus = GetNextDlgTabItem( hwnd, 0, FALSE); if( dlgInfo->hwndFocus ) SetFocus( dlgInfo->hwndFocus );
14 years, 10 months
1
0
0
0
[jimtabor] 46006: - [User32_winetest] - Win : Remove test_capture from service. This is related to TrackMouseEvent issues which use SetCapture.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Mon Mar 8 21:52:04 2010 New Revision: 46006 URL:
http://svn.reactos.org/svn/reactos?rev=46006&view=rev
Log: - [User32_winetest] - Win : Remove test_capture from service. This is related to TrackMouseEvent issues which use SetCapture. Modified: trunk/rostests/winetests/user32/win.c Modified: trunk/rostests/winetests/user32/win.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/user32/win.c?re…
============================================================================== --- trunk/rostests/winetests/user32/win.c [iso-8859-1] (original) +++ trunk/rostests/winetests/user32/win.c [iso-8859-1] Mon Mar 8 21:52:04 2010 @@ -5979,7 +5979,7 @@ test_capture_1(); test_capture_2(); test_capture_3(hwndMain, hwndMain2); - test_capture_4(); +// test_capture_4(); test_CreateWindow(); test_parent_owner();
14 years, 10 months
1
0
0
0
[fireball] 46005: [PSDK] - Update all IDLs to Wine-1.1.40. If you feel some of your change was lost, it wasn't needed for building. Please recommit if you still think it's of a high value.
by fireball@svn.reactos.org
Author: fireball Date: Mon Mar 8 21:51:33 2010 New Revision: 46005 URL:
http://svn.reactos.org/svn/reactos?rev=46005&view=rev
Log: [PSDK] - Update all IDLs to Wine-1.1.40. If you feel some of your change was lost, it wasn't needed for building. Please recommit if you still think it's of a high value. Added: trunk/reactos/include/psdk/access.idl trunk/reactos/include/psdk/asynot.idl trunk/reactos/include/psdk/asysta.idl trunk/reactos/include/psdk/binres.idl trunk/reactos/include/psdk/cmdbas.idl trunk/reactos/include/psdk/cmdtxt.idl trunk/reactos/include/psdk/crtrow.idl trunk/reactos/include/psdk/dbccmd.idl trunk/reactos/include/psdk/dbcses.idl trunk/reactos/include/psdk/dbdsad.idl trunk/reactos/include/psdk/opnrst.idl trunk/reactos/include/psdk/row.idl trunk/reactos/include/psdk/rowchg.idl trunk/reactos/include/psdk/rstbas.idl trunk/reactos/include/psdk/rstinf.idl trunk/reactos/include/psdk/rstloc.idl trunk/reactos/include/psdk/sesprp.idl Modified: trunk/reactos/dll/win32/msi/msiserver.idl trunk/reactos/dll/win32/shell32/dataobject.c trunk/reactos/dll/win32/shell32/pidl.c trunk/reactos/dll/win32/shell32/she_ocmenu.c trunk/reactos/dll/win32/shell32/shelllink.c trunk/reactos/dll/win32/shell32/shfldr_fs.c trunk/reactos/dll/win32/shell32/shlfolder.c trunk/reactos/dll/win32/shell32/shlview.c trunk/reactos/dll/win32/shell32/shv_def_cmenu.c trunk/reactos/dll/win32/shell32/stubs.c trunk/reactos/include/dxsdk/axextend.idl trunk/reactos/include/psdk/bits.idl trunk/reactos/include/psdk/control.idl trunk/reactos/include/psdk/dbprop.idl trunk/reactos/include/psdk/dbs.idl trunk/reactos/include/psdk/dimm.idl trunk/reactos/include/psdk/dispex.idl trunk/reactos/include/psdk/hlink.idl trunk/reactos/include/psdk/mlang.idl trunk/reactos/include/psdk/mscoree.idl trunk/reactos/include/psdk/msctf.idl trunk/reactos/include/psdk/objidl.idl trunk/reactos/include/psdk/oledb.idl trunk/reactos/include/psdk/propidl.idl trunk/reactos/include/psdk/sensevts.idl trunk/reactos/include/psdk/shlobj.h trunk/reactos/include/psdk/shobjidl.idl trunk/reactos/include/psdk/shtypes.idl trunk/reactos/include/psdk/tom.idl trunk/reactos/include/psdk/wtypes.idl trunk/reactos/include/reactos/wine/wined3d.idl [This mail would be too long, it was shortened to contain the URLs only.] Modified: trunk/reactos/dll/win32/msi/msiserver.idl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msi/msiserver.id…
Modified: trunk/reactos/dll/win32/shell32/dataobject.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/dataobje…
Modified: trunk/reactos/dll/win32/shell32/pidl.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/pidl.c?r…
Modified: trunk/reactos/dll/win32/shell32/she_ocmenu.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/she_ocme…
Modified: trunk/reactos/dll/win32/shell32/shelllink.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shelllin…
Modified: trunk/reactos/dll/win32/shell32/shfldr_fs.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shfldr_f…
Modified: trunk/reactos/dll/win32/shell32/shlfolder.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shlfolde…
Modified: trunk/reactos/dll/win32/shell32/shlview.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shlview.…
Modified: trunk/reactos/dll/win32/shell32/shv_def_cmenu.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shv_def_…
Modified: trunk/reactos/dll/win32/shell32/stubs.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/stubs.c?…
Modified: trunk/reactos/include/dxsdk/axextend.idl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/dxsdk/axextend.idl…
Added: trunk/reactos/include/psdk/access.idl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/access.idl?re…
Added: trunk/reactos/include/psdk/asynot.idl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/asynot.idl?re…
Added: trunk/reactos/include/psdk/asysta.idl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/asysta.idl?re…
Added: trunk/reactos/include/psdk/binres.idl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/binres.idl?re…
Modified: trunk/reactos/include/psdk/bits.idl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/bits.idl?rev=…
Added: trunk/reactos/include/psdk/cmdbas.idl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/cmdbas.idl?re…
Added: trunk/reactos/include/psdk/cmdtxt.idl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/cmdtxt.idl?re…
Modified: trunk/reactos/include/psdk/control.idl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/control.idl?r…
Added: trunk/reactos/include/psdk/crtrow.idl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/crtrow.idl?re…
Added: trunk/reactos/include/psdk/dbccmd.idl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/dbccmd.idl?re…
Added: trunk/reactos/include/psdk/dbcses.idl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/dbcses.idl?re…
Added: trunk/reactos/include/psdk/dbdsad.idl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/dbdsad.idl?re…
Modified: trunk/reactos/include/psdk/dbprop.idl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/dbprop.idl?re…
Modified: trunk/reactos/include/psdk/dbs.idl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/dbs.idl?rev=4…
Modified: trunk/reactos/include/psdk/dimm.idl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/dimm.idl?rev=…
Modified: trunk/reactos/include/psdk/dispex.idl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/dispex.idl?re…
Modified: trunk/reactos/include/psdk/hlink.idl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/hlink.idl?rev…
Modified: trunk/reactos/include/psdk/mlang.idl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/mlang.idl?rev…
Modified: trunk/reactos/include/psdk/mscoree.idl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/mscoree.idl?r…
Modified: trunk/reactos/include/psdk/msctf.idl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/msctf.idl?rev…
Modified: trunk/reactos/include/psdk/objidl.idl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/objidl.idl?re…
Modified: trunk/reactos/include/psdk/oledb.idl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/oledb.idl?rev…
Added: trunk/reactos/include/psdk/opnrst.idl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/opnrst.idl?re…
Modified: trunk/reactos/include/psdk/propidl.idl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/propidl.idl?r…
Added: trunk/reactos/include/psdk/row.idl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/row.idl?rev=4…
Added: trunk/reactos/include/psdk/rowchg.idl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/rowchg.idl?re…
Added: trunk/reactos/include/psdk/rstbas.idl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/rstbas.idl?re…
Added: trunk/reactos/include/psdk/rstinf.idl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/rstinf.idl?re…
Added: trunk/reactos/include/psdk/rstloc.idl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/rstloc.idl?re…
Modified: trunk/reactos/include/psdk/sensevts.idl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/sensevts.idl?…
Added: trunk/reactos/include/psdk/sesprp.idl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/sesprp.idl?re…
Modified: trunk/reactos/include/psdk/shlobj.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/shlobj.h?rev=…
Modified: trunk/reactos/include/psdk/shobjidl.idl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/shobjidl.idl?…
Modified: trunk/reactos/include/psdk/shtypes.idl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/shtypes.idl?r…
Modified: trunk/reactos/include/psdk/tom.idl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/tom.idl?rev=4…
Modified: trunk/reactos/include/psdk/wtypes.idl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/wtypes.idl?re…
Modified: trunk/reactos/include/reactos/wine/wined3d.idl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/wine/wined…
14 years, 10 months
1
0
0
0
[sir_richard] 46004: [NTOS]: Have I/O Manager Volume Device Objects register with the Power Manager so that they can receive dope. [NTOS]: Reimplement NtShutdownSystem. [NTOS]: Implement NtSetSystemPowerState for the shutdown/reboot cases. [NTOS]: Use the dope from the volume device objects to flush all writeable (non-floppy) devices. Pending hard-disk changes are now flushed to disks before shutdown. [NTOS]: Flush \\REGISTRY during shutdown. This flushes all pending changes. [NTOS]: Call into C
by sir_richard@svn.reactos.org
Author: sir_richard Date: Mon Mar 8 21:47:10 2010 New Revision: 46004 URL:
http://svn.reactos.org/svn/reactos?rev=46004&view=rev
Log: [NTOS]: Have I/O Manager Volume Device Objects register with the Power Manager so that they can receive dope. [NTOS]: Reimplement NtShutdownSystem. [NTOS]: Implement NtSetSystemPowerState for the shutdown/reboot cases. [NTOS]: Use the dope from the volume device objects to flush all writeable (non-floppy) devices. Pending hard-disk changes are now flushed to disks before shutdown. [NTOS]: Flush \\REGISTRY during shutdown. This flushes all pending changes. [NTOS]: Call into Cc to flush lazy writer during shutdown. [NTOS]: Stop killing processes on shutdown. The kernel should not be doing this. [NTOS]: Don't only shutdown disk file systems, but also cdrom and tape. [NTOS]: Don't only notify drivers of first-chance shutdown -- also parse the last-change shutdown list. [NTOS]: Reference drivers registering for shutdown notifications so that they remain loaded for them to get the notification at shutdown. [NTOS]: Notify drivers that have registered/opened the Power State callback. [NTOS]: A lot of the Po* power state code is highly simplified, but provides a good roadmap to anyone interested in this functionality long-term. Added: trunk/reactos/ntoskrnl/po/poshtdwn.c (with props) trunk/reactos/ntoskrnl/po/povolume.c (with props) Modified: trunk/reactos/ntoskrnl/ex/shutdown.c trunk/reactos/ntoskrnl/include/internal/io.h trunk/reactos/ntoskrnl/include/internal/po.h trunk/reactos/ntoskrnl/io/iomgr/device.c trunk/reactos/ntoskrnl/io/iomgr/volume.c trunk/reactos/ntoskrnl/ntoskrnl-generic.rbuild trunk/reactos/ntoskrnl/po/power.c Modified: trunk/reactos/ntoskrnl/ex/shutdown.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ex/shutdown.c?rev…
============================================================================== --- trunk/reactos/ntoskrnl/ex/shutdown.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ex/shutdown.c [iso-8859-1] Mon Mar 8 21:47:10 2010 @@ -14,123 +14,40 @@ /* FUNCTIONS *****************************************************************/ -VOID NTAPI -ShutdownThreadMain(PVOID Context) -{ - SHUTDOWN_ACTION Action = (SHUTDOWN_ACTION)Context; - PUCHAR Logo1, Logo2; - ULONG i; - - /* Run the thread on the boot processor */ - KeSetSystemAffinityThread(1); - - PspShutdownProcessManager(); - - CmShutdownSystem(); - IoShutdownRegisteredFileSystems(); - IoShutdownRegisteredDevices(); - - if (Action == ShutdownNoReboot) - { - /* Try the platform driver */ - PopSetSystemPowerState(PowerSystemShutdown); - - /* If that didn't work, try legacy switch off */ - //HalReturnToFirmware(HalPowerDownRoutine); - - /* If that still didn't work, stop all interrupts */ - KeRaiseIrqlToDpcLevel(); - _disable(); - - /* Do we have boot video */ - if (InbvIsBootDriverInstalled()) - { - /* Yes we do, cleanup for shutdown screen */ - if (!InbvCheckDisplayOwnership()) InbvAcquireDisplayOwnership(); - InbvResetDisplay(); - InbvSolidColorFill(0, 0, 639, 479, 0); - InbvEnableDisplayString(TRUE); - InbvSetScrollRegion(0, 0, 639, 479); - - /* Display shutdown logo and message */ - Logo1 = InbvGetResourceAddress(IDB_SHUTDOWN_LOGO); - Logo2 = InbvGetResourceAddress(IDB_LOGO); - if ((Logo1) && (Logo2)) - { - InbvBitBlt(Logo1, 215, 352); - InbvBitBlt(Logo2, 217, 111); - } - } - else - { - /* Do it in text-mode */ - for (i = 0; i < 25; i++) InbvDisplayString("\n"); - InbvDisplayString(" "); - InbvDisplayString("The system may be powered off now.\n"); - } - - /* Hang the system */ - for (;;) HalHaltSystem(); - } - else if (Action == ShutdownReboot) - { - HalReturnToFirmware (HalRebootRoutine); - } - else - { - HalReturnToFirmware (HalHaltRoutine); - } -} - - -NTSTATUS NTAPI -NtSetSystemPowerState(IN POWER_ACTION SystemAction, - IN SYSTEM_POWER_STATE MinSystemState, - IN ULONG Flags) -{ - /* Windows 2000 only */ - return(STATUS_NOT_IMPLEMENTED); -} - /* * @implemented */ -NTSTATUS NTAPI +NTSTATUS +NTAPI NtShutdownSystem(IN SHUTDOWN_ACTION Action) { - NTSTATUS Status; - HANDLE ThreadHandle; - PETHREAD ShutdownThread; - - if (Action > ShutdownPowerOff) - return STATUS_INVALID_PARAMETER; - Status = PsCreateSystemThread(&ThreadHandle, - THREAD_ALL_ACCESS, - NULL, - NULL, - NULL, - ShutdownThreadMain, - (PVOID)Action); - if (!NT_SUCCESS(Status)) - { - ASSERT(FALSE); - } - Status = ObReferenceObjectByHandle(ThreadHandle, - THREAD_ALL_ACCESS, - PsThreadType, - KernelMode, - (PVOID*)&ShutdownThread, - NULL); - NtClose(ThreadHandle); - if (!NT_SUCCESS(Status)) - { - ASSERT(FALSE); - } - - KeSetPriorityThread(&ShutdownThread->Tcb, LOW_REALTIME_PRIORITY + 1); - ObDereferenceObject(ShutdownThread); - - return STATUS_SUCCESS; + POWER_ACTION PowerAction; + + /* Convert to power action */ + if (Action == ShutdownNoReboot) + { + PowerAction = PowerActionShutdown; + } + else if (Action == ShutdownReboot) + { + PowerAction = PowerActionShutdownReset; + } + else if (Action == ShutdownPowerOff) + { + PowerAction = PowerActionShutdownOff; + } + else + { + return STATUS_INVALID_PARAMETER; + } + + /* Now call the power manager */ + DPRINT1("Setting state to: %lx\n", PowerAction); + return NtSetSystemPowerState(PowerAction, + PowerSystemSleeping3, + POWER_ACTION_OVERRIDE_APPS | + POWER_ACTION_DISABLE_WAKES | + POWER_ACTION_CRITICAL); } /* EOF */ Modified: trunk/reactos/ntoskrnl/include/internal/io.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
============================================================================== --- trunk/reactos/ntoskrnl/include/internal/io.h [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/include/internal/io.h [iso-8859-1] Mon Mar 8 21:47:10 2010 @@ -743,14 +743,14 @@ VOID NTAPI -IoShutdownRegisteredDevices( - VOID -); - -VOID -NTAPI -IoShutdownRegisteredFileSystems( - VOID +IoShutdownSystem( + IN ULONG Phase +); + +VOID +NTAPI +IopShutdownBaseFileSystems( + IN PLIST_ENTRY ListHead ); // Modified: trunk/reactos/ntoskrnl/include/internal/po.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
============================================================================== --- trunk/reactos/ntoskrnl/include/internal/po.h [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/include/internal/po.h [iso-8859-1] Mon Mar 8 21:47:10 2010 @@ -32,6 +32,228 @@ #define POTRACE(x, ...) DPRINT(__VA_ARGS__) #endif +typedef struct _PO_HIBER_PERF +{ + ULONGLONG IoTicks; + ULONGLONG InitTicks; + ULONGLONG CopyTicks; + ULONGLONG StartCount; + ULONG ElapsedTime; + ULONG IoTime; + ULONG CopyTime; + ULONG InitTime; + ULONG PagesWritten; + ULONG PagesProcessed; + ULONG BytesCopied; + ULONG DumpCount; + ULONG FileRuns; +} PO_HIBER_PERF, *PPO_HIBER_PERF; + +typedef struct _PO_MEMORY_IMAGE +{ + ULONG Signature; + ULONG Version; + ULONG CheckSum; + ULONG LengthSelf; + PFN_NUMBER PageSelf; + ULONG PageSize; + ULONG ImageType; + LARGE_INTEGER SystemTime; + ULONGLONG InterruptTime; + ULONG FeatureFlags; + UCHAR HiberFlags; + UCHAR spare[3]; + ULONG NoHiberPtes; + ULONG_PTR HiberVa; + PHYSICAL_ADDRESS HiberPte; + ULONG NoFreePages; + ULONG FreeMapCheck; + ULONG WakeCheck; + PFN_NUMBER TotalPages; + PFN_NUMBER FirstTablePage; + PFN_NUMBER LastFilePage; + PO_HIBER_PERF PerfInfo; +} PO_MEMORY_IMAGE, *PPO_MEMORY_IMAGE; + +typedef struct _PO_MEMORY_RANGE_ARRAY_RANGE +{ + PFN_NUMBER PageNo; + PFN_NUMBER StartPage; + PFN_NUMBER EndPage; + ULONG CheckSum; +} PO_MEMORY_RANGE_ARRAY_RANGE; + +typedef struct _PO_MEMORY_RANGE_ARRAY_LINK +{ + struct _PO_MEMORY_RANGE_ARRAY *Next; + PFN_NUMBER NextTable; + ULONG CheckSum; + ULONG EntryCount; +} PO_MEMORY_RANGE_ARRAY_LINK; + +typedef struct _PO_MEMORY_RANGE_ARRAY +{ + union + { + PO_MEMORY_RANGE_ARRAY_RANGE Range; + PO_MEMORY_RANGE_ARRAY_LINK Link; + }; +} PO_MEMORY_RANGE_ARRAY, *PPO_MEMORY_RANGE_ARRAY; + +typedef struct _POP_HIBER_CONTEXT +{ + BOOLEAN WriteToFile; + BOOLEAN ReserveLoaderMemory; + BOOLEAN ReserveFreeMemory; + BOOLEAN VerifyOnWake; + BOOLEAN Reset; + UCHAR HiberFlags; + BOOLEAN LinkFile; + HANDLE LinkFileHandle; + PKSPIN_LOCK Lock; + BOOLEAN MapFrozen; + RTL_BITMAP MemoryMap; + LIST_ENTRY ClonedRanges; + ULONG ClonedRangeCount; + PLIST_ENTRY NextCloneRange; + PFN_NUMBER NextPreserve; + PMDL LoaderMdl; + PMDL Clones; + PUCHAR NextClone; + ULONG NoClones; + PMDL Spares; + ULONGLONG PagesOut; + PVOID IoPage; + PVOID CurrentMcb; + PVOID DumpStack; + PKPROCESSOR_STATE WakeState; + ULONG NoRanges; + ULONG_PTR HiberVa; + PHYSICAL_ADDRESS HiberPte; + NTSTATUS Status; + PPO_MEMORY_IMAGE MemoryImage; + PPO_MEMORY_RANGE_ARRAY TableHead; + PVOID CompressionWorkspace; + PUCHAR CompressedWriteBuffer; + PULONG PerformanceStats; + PVOID CompressionBlock; + PVOID DmaIO; + PVOID TemporaryHeap; + PO_HIBER_PERF PerfInfo; +} POP_HIBER_CONTEXT, *PPOP_HIBER_CONTEXT; + +typedef struct _PO_NOTIFY_ORDER_LEVEL +{ + KEVENT LevelReady; + ULONG DeviceCount; + ULONG ActiveCount; + LIST_ENTRY WaitSleep; + LIST_ENTRY ReadySleep; + LIST_ENTRY Pending; + LIST_ENTRY Complete; + LIST_ENTRY ReadyS0; + LIST_ENTRY WaitS0; +} PO_NOTIFY_ORDER_LEVEL, *PPO_NOTIFY_ORDER_LEVEL; + +typedef struct _POP_SHUTDOWN_BUG_CHECK +{ + HANDLE ThreadHandle; + HANDLE ThreadId; + HANDLE ProcessId; + ULONG Code; + ULONG_PTR Parameter1; + ULONG_PTR Parameter2; + ULONG_PTR Parameter3; + ULONG_PTR Parameter4; +} POP_SHUTDOWN_BUG_CHECK, *PPOP_SHUTDOWN_BUG_CHECK; + +typedef struct _POP_DEVICE_POWER_IRP +{ + SINGLE_LIST_ENTRY Free; + PIRP Irp; + PPO_DEVICE_NOTIFY Notify; + LIST_ENTRY Pending; + LIST_ENTRY Complete; + LIST_ENTRY Abort; + LIST_ENTRY Failed; +} POP_DEVICE_POWER_IRP, *PPOP_DEVICE_POWER_IRP; + +typedef struct _PO_DEVICE_NOTIFY_ORDER +{ + ULONG DevNodeSequence; + PDEVICE_OBJECT *WarmEjectPdoPointer; + PO_NOTIFY_ORDER_LEVEL OrderLevel[8]; +} PO_DEVICE_NOTIFY_ORDER, *PPO_DEVICE_NOTIFY_ORDER; + +typedef struct _POP_DEVICE_SYS_STATE +{ + UCHAR IrpMinor; + SYSTEM_POWER_STATE SystemState; + PKEVENT Event; + KSPIN_LOCK SpinLock; + PKTHREAD Thread; + BOOLEAN GetNewDeviceList; + PO_DEVICE_NOTIFY_ORDER Order; + NTSTATUS Status; + PDEVICE_OBJECT FailedDevice; + BOOLEAN Waking; + BOOLEAN Cancelled; + BOOLEAN IgnoreErrors; + BOOLEAN IgnoreNotImplemented; + BOOLEAN _WaitAny; + BOOLEAN _WaitAll; + LIST_ENTRY PresentIrpQueue; + POP_DEVICE_POWER_IRP Head; + POP_DEVICE_POWER_IRP PowerIrpState[20]; +} POP_DEVICE_SYS_STATE, *PPOP_DEVICE_SYS_STATE; + +typedef struct _POP_POWER_ACTION +{ + UCHAR Updates; + UCHAR State; + BOOLEAN Shutdown; + POWER_ACTION Action; + SYSTEM_POWER_STATE LightestState; + ULONG Flags; + NTSTATUS Status; + UCHAR IrpMinor; + SYSTEM_POWER_STATE SystemState; + SYSTEM_POWER_STATE NextSystemState; + PPOP_SHUTDOWN_BUG_CHECK ShutdownBugCode; + PPOP_DEVICE_SYS_STATE DevState; + PPOP_HIBER_CONTEXT HiberContext; + ULONGLONG WakeTime; + ULONGLONG SleepTime; +} POP_POWER_ACTION, *PPOP_POWER_ACTION; + +typedef enum _POP_DEVICE_IDLE_TYPE +{ + DeviceIdleNormal, + DeviceIdleDisk, +} POP_DEVICE_IDLE_TYPE, *PPOP_DEVICE_IDLE_TYPE; + +typedef struct _POWER_CHANNEL_SUMMARY +{ + ULONG Signature; + ULONG TotalCount; + ULONG D0Count; + LIST_ENTRY NotifyList; +} POWER_CHANNEL_SUMMARY, *PPOWER_CHANNEL_SUMMARY; + +typedef struct _DEVICE_OBJECT_POWER_EXTENSION +{ + ULONG IdleCount; + ULONG ConservationIdleTime; + ULONG PerformanceIdleTime; + PDEVICE_OBJECT DeviceObject; + LIST_ENTRY IdleList; + DEVICE_POWER_STATE State; + LIST_ENTRY NotifySourceList; + LIST_ENTRY NotifyTargetList; + POWER_CHANNEL_SUMMARY PowerChannelSummary; + LIST_ENTRY Volume; +} DEVICE_OBJECT_POWER_EXTENSION, *PDEVICE_OBJECT_POWER_EXTENSION; + // // Initialization routines // @@ -45,6 +267,21 @@ NTAPI PoInitializePrcb( IN PKPRCB Prcb +); + +// +// I/O Routines +// +VOID +NTAPI +PoInitializeDeviceObject( + IN OUT PDEVOBJ_EXTENSION DeviceObjectExtension +); + +VOID +NTAPI +PoVolumeDevice( + IN PDEVICE_OBJECT DeviceObject ); // @@ -79,6 +316,32 @@ ); // +// Shutdown routines +// +VOID +NTAPI +PopReadShutdownPolicy( + VOID +); + +VOID +NTAPI +PopGracefulShutdown( + IN PVOID Context +); + +VOID +NTAPI +PopFlushVolumes( + IN BOOLEAN ShuttingDown +); + +// // Global data inside the Power Manager // extern PDEVICE_NODE PopSystemPowerDeviceNode; +extern KGUARDED_MUTEX PopVolumeLock; +extern LIST_ENTRY PopVolumeDevices; +extern KSPIN_LOCK PopDopeGlobalLock; +extern POP_POWER_ACTION PopAction; + Modified: trunk/reactos/ntoskrnl/io/iomgr/device.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/iomgr/device.c…
============================================================================== --- trunk/reactos/ntoskrnl/io/iomgr/device.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/io/iomgr/device.c [iso-8859-1] Mon Mar 8 21:47:10 2010 @@ -17,9 +17,11 @@ /* GLOBALS ********************************************************************/ ULONG IopDeviceObjectNumber = 0; - LIST_ENTRY ShutdownListHead, LastChanceShutdownListHead; KSPIN_LOCK ShutdownListLock; +extern LIST_ENTRY IopDiskFsListHead; +extern LIST_ENTRY IopCdRomFsListHead; +extern LIST_ENTRY IopTapeFsListHead; /* PRIVATE FUNCTIONS **********************************************************/ @@ -95,7 +97,15 @@ VOID NTAPI -IoShutdownRegisteredDevices(VOID) +IoShutdownPnpDevices(VOID) +{ + /* This routine is only used by Driver Verifier to validate shutdown */ + return; +} + +VOID +NTAPI +IoShutdownSystem(IN ULONG Phase) { PLIST_ENTRY ListEntry; PDEVICE_OBJECT DeviceObject; @@ -104,46 +114,108 @@ PIRP Irp; KEVENT Event; NTSTATUS Status; - + /* Initialize an event to wait on */ KeInitializeEvent(&Event, NotificationEvent, FALSE); - - /* Get the first entry and start looping */ - ListEntry = ExInterlockedRemoveHeadList(&ShutdownListHead, - &ShutdownListLock); - while (ListEntry) - { - /* Get the shutdown entry */ - ShutdownEntry = CONTAINING_RECORD(ListEntry, - SHUTDOWN_ENTRY, - ShutdownList); - - /* Get the attached device */ - DeviceObject = IoGetAttachedDevice(ShutdownEntry->DeviceObject); - - /* Build the shutdown IRP and call the driver */ - Irp = IoBuildSynchronousFsdRequest(IRP_MJ_SHUTDOWN, - DeviceObject, - NULL, - 0, - NULL, - &Event, - &StatusBlock); - Status = IoCallDriver(DeviceObject, Irp); - if (Status == STATUS_PENDING) - { - /* Wait on the driver */ - KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL); - } - - /* Free the shutdown entry and reset the event */ - ExFreePoolWithTag(ShutdownEntry, TAG_SHUTDOWN_ENTRY); - KeClearEvent(&Event); - - /* Go to the next entry */ + + /* What phase? */ + if (Phase == 0) + { + /* Shutdown PnP */ + IoShutdownPnpDevices(); + + /* Loop first-chance shutdown notifications */ ListEntry = ExInterlockedRemoveHeadList(&ShutdownListHead, &ShutdownListLock); - } + while (ListEntry) + { + /* Get the shutdown entry */ + ShutdownEntry = CONTAINING_RECORD(ListEntry, + SHUTDOWN_ENTRY, + ShutdownList); + + /* Get the attached device */ + DeviceObject = IoGetAttachedDevice(ShutdownEntry->DeviceObject); + + /* Build the shutdown IRP and call the driver */ + Irp = IoBuildSynchronousFsdRequest(IRP_MJ_SHUTDOWN, + DeviceObject, + NULL, + 0, + NULL, + &Event, + &StatusBlock); + Status = IoCallDriver(DeviceObject, Irp); + if (Status == STATUS_PENDING) + { + /* Wait on the driver */ + KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL); + } + + /* Get rid of our reference to it */ + ObDereferenceObject(DeviceObject); + + /* Free the shutdown entry and reset the event */ + ExFreePoolWithTag(ShutdownEntry, TAG_SHUTDOWN_ENTRY); + KeClearEvent(&Event); + + /* Go to the next entry */ + ListEntry = ExInterlockedRemoveHeadList(&ShutdownListHead, + &ShutdownListLock); + } + } + else if (Phase == 1) + { + /* Shutdown disk file systems */ + IopShutdownBaseFileSystems(&IopDiskFsListHead); + + /* Shutdown cdrom file systems */ + IopShutdownBaseFileSystems(&IopCdRomFsListHead); + + /* Shutdown tape filesystems */ + IopShutdownBaseFileSystems(&IopTapeFsListHead); + + /* Loop last-chance shutdown notifications */ + ListEntry = ExInterlockedRemoveHeadList(&LastChanceShutdownListHead, + &ShutdownListLock); + while (ListEntry) + { + /* Get the shutdown entry */ + ShutdownEntry = CONTAINING_RECORD(ListEntry, + SHUTDOWN_ENTRY, + ShutdownList); + + /* Get the attached device */ + DeviceObject = IoGetAttachedDevice(ShutdownEntry->DeviceObject); + + /* Build the shutdown IRP and call the driver */ + Irp = IoBuildSynchronousFsdRequest(IRP_MJ_SHUTDOWN, + DeviceObject, + NULL, + 0, + NULL, + &Event, + &StatusBlock); + Status = IoCallDriver(DeviceObject, Irp); + if (Status == STATUS_PENDING) + { + /* Wait on the driver */ + KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL); + } + + /* Get rid of our reference to it */ + ObDereferenceObject(DeviceObject); + + /* Free the shutdown entry and reset the event */ + ExFreePoolWithTag(ShutdownEntry, TAG_SHUTDOWN_ENTRY); + KeClearEvent(&Event); + + /* Go to the next entry */ + ListEntry = ExInterlockedRemoveHeadList(&LastChanceShutdownListHead, + &ShutdownListLock); + } + + } } NTSTATUS @@ -843,6 +915,9 @@ /* Set the Type and Size. Question: why is Size 0 on Windows? */ DeviceObjectExtension->Type = IO_TYPE_DEVICE_OBJECT_EXTENSION; DeviceObjectExtension->Size = 0; + + /* Initialize with Power Manager */ + PoInitializeDeviceObject(DeviceObjectExtension); /* Link the Object and Extension */ DeviceObjectExtension->DeviceObject = CreatedDeviceObject; @@ -932,6 +1007,9 @@ ASSERT((DriverObject->Flags & DRVO_UNLOAD_INVOKED) == 0); CreatedDeviceObject->DriverObject = DriverObject; IopEditDeviceList(DriverObject, CreatedDeviceObject, IopAdd); + + /* Link with the power manager */ + if (CreatedDeviceObject->Vpb) PoVolumeDevice(CreatedDeviceObject); /* Close the temporary handle and return to caller */ ObCloseHandle(TempHandle, KernelMode); @@ -1351,6 +1429,9 @@ /* Set the DO */ Entry->DeviceObject = DeviceObject; + + /* Reference it so it doesn't go away */ + ObReferenceObject(DeviceObject); /* Insert it into the list */ ExInterlockedInsertHeadList(&LastChanceShutdownListHead, @@ -1379,6 +1460,9 @@ /* Set the DO */ Entry->DeviceObject = DeviceObject; + + /* Reference it so it doesn't go away */ + ObReferenceObject(DeviceObject); /* Insert it into the list */ ExInterlockedInsertHeadList(&ShutdownListHead, @@ -1420,6 +1504,9 @@ /* Free the entry */ ExFreePoolWithTag(ShutdownEntry, TAG_SHUTDOWN_ENTRY); + + /* Get rid of our reference to it */ + ObDereferenceObject(DeviceObject); } /* Go to the next entry */ @@ -1444,6 +1531,9 @@ /* Free the entry */ ExFreePoolWithTag(ShutdownEntry, TAG_SHUTDOWN_ENTRY); + + /* Get rid of our reference to it */ + ObDereferenceObject(DeviceObject); } /* Go to the next entry */ Modified: trunk/reactos/ntoskrnl/io/iomgr/volume.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/iomgr/volume.c…
============================================================================== --- trunk/reactos/ntoskrnl/io/iomgr/volume.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/io/iomgr/volume.c [iso-8859-1] Mon Mar 8 21:47:10 2010 @@ -245,7 +245,7 @@ VOID NTAPI -IoShutdownRegisteredFileSystems(VOID) +IopShutdownBaseFileSystems(IN PLIST_ENTRY ListHead) { PLIST_ENTRY ListEntry; PDEVICE_OBJECT DeviceObject; @@ -260,8 +260,8 @@ KeInitializeEvent(&Event, NotificationEvent, FALSE); /* Get the first entry and start looping */ - ListEntry = IopDiskFsListHead.Flink; - while (ListEntry != &IopDiskFsListHead) + ListEntry = ListHead->Flink; + while (ListEntry != ListHead) { /* Get the device object */ DeviceObject = CONTAINING_RECORD(ListEntry, Modified: trunk/reactos/ntoskrnl/ntoskrnl-generic.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ntoskrnl-generic.…
============================================================================== --- trunk/reactos/ntoskrnl/ntoskrnl-generic.rbuild [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ntoskrnl-generic.rbuild [iso-8859-1] Mon Mar 8 21:47:10 2010 @@ -438,8 +438,10 @@ <file>obwait.c</file> </directory> <directory name="po"> + <file>events.c</file> <file>power.c</file> - <file>events.c</file> + <file>poshtdwn.c</file> + <file>povolume.c</file> </directory> <directory name="ps"> <if property="ARCH" value="i386"> Added: trunk/reactos/ntoskrnl/po/poshtdwn.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/po/poshtdwn.c?rev…
============================================================================== --- trunk/reactos/ntoskrnl/po/poshtdwn.c (added) +++ trunk/reactos/ntoskrnl/po/poshtdwn.c [iso-8859-1] Mon Mar 8 21:47:10 2010 @@ -1,0 +1,196 @@ +/* + * PROJECT: ReactOS Kernel + * LICENSE: BSD - See COPYING.ARM in the top level directory + * FILE: ntoskrnl/po/poshtdwn.c + * PURPOSE: Power Manager Shutdown Code + * PROGRAMMERS: ReactOS Portable Systems Group + */ + +/* INCLUDES ******************************************************************/ + +#include <ntoskrnl.h> +#define NDEBUG +#include <debug.h> + +/* GLOBALS *******************************************************************/ + +ULONG PopShutdownPowerOffPolicy; + +/* PRIVATE FUNCTIONS *********************************************************/ + +VOID +NTAPI +PopShutdownHandler(VOID) +{ + PUCHAR Logo1, Logo2; + ULONG i; + + /* Stop all interrupts */ + KeRaiseIrqlToDpcLevel(); + _disable(); + + /* Do we have boot video */ + if (InbvIsBootDriverInstalled()) + { + /* Yes we do, cleanup for shutdown screen */ + if (!InbvCheckDisplayOwnership()) InbvAcquireDisplayOwnership(); + InbvResetDisplay(); + InbvSolidColorFill(0, 0, 639, 479, 0); + InbvEnableDisplayString(TRUE); + InbvSetScrollRegion(0, 0, 639, 479); + + /* Display shutdown logo and message */ + Logo1 = InbvGetResourceAddress(IDB_SHUTDOWN_LOGO); + Logo2 = InbvGetResourceAddress(IDB_LOGO); + if ((Logo1) && (Logo2)) + { + InbvBitBlt(Logo1, 215, 352); + InbvBitBlt(Logo2, 217, 111); + } + } + else + { + /* Do it in text-mode */ + for (i = 0; i < 25; i++) InbvDisplayString("\n"); + InbvDisplayString(" "); + InbvDisplayString("The system may be powered off now.\n"); + } + + /* Hang the system */ + for (;;) HalHaltSystem(); +} + +VOID +NTAPI +PopShutdownSystem(IN POWER_ACTION SystemAction) +{ + /* Note should notify caller of NtPowerInformation(PowerShutdownNotification) */ + + /* Unload symbols */ + DPRINT1("It's the final countdown...%lx\n", SystemAction); + DbgUnLoadImageSymbols(NULL, (PVOID)-1, 0); + + /* Run the thread on the boot processor */ + KeSetSystemAffinityThread(1); + + /* Now check what the caller wants */ + switch (SystemAction) + { + /* Reset */ + case PowerActionShutdownReset: + + /* Try platform driver first, then legacy */ + //PopInvokeSystemStateHandler(PowerStateShutdownReset, NULL); + HalReturnToFirmware(HalRebootRoutine); + break; + + case PowerActionShutdown: + + /* Check for group policy that says to use "it is now safe" screen */ + if (PopShutdownPowerOffPolicy) + { + /* FIXFIX: Switch to legacy shutdown handler */ + //PopPowerStateHandlers[PowerStateShutdownOff].Handler = PopShutdownHandler; + } + + case PowerActionShutdownOff: + + /* Call shutdown handler */ + //PopInvokeSystemStateHandler(PowerStateShutdownOff, NULL); + + /* ReactOS Hack */ + PopSetSystemPowerState(PowerSystemShutdown); + PopShutdownHandler(); + + /* If that didn't work, call the HAL */ + HalReturnToFirmware(HalPowerDownRoutine); + break; + + default: + break; + } + + /* Anything else should not happen */ + KeBugCheckEx(INTERNAL_POWER_ERROR, 5, 0, 0, 0); +} + +VOID +NTAPI +PopGracefulShutdown(IN PVOID Context) +{ + /* First, the HAL handles any "end of boot" special functionality */ + DPRINT1("HAL shutting down\n"); + HalEndOfBoot(); + + /* In this step, the I/O manager does first-chance shutdown notification */ + DPRINT1("I/O manager shutting down in phase 0\n"); + IoShutdownSystem(0); + + /* In this step, all workers are killed and hives are flushed */ + DPRINT1("Configuration Manager shutting down\n"); + CmShutdownSystem(); + + /* Note that modified pages should be written here (MiShutdownSystem) */ + + /* In this step, the I/O manager does last-chance shutdown notification */ + DPRINT1("I/O manager shutting down in phase 1\n"); + IoShutdownSystem(1); + CcWaitForCurrentLazyWriterActivity(); + + /* Note that here, we should broadcast the power IRP to devices */ + + /* In this step, the HAL disables any wake timers */ + DPRINT1("Disabling wake timers\n"); + HalSetWakeEnable(FALSE); + + /* And finally the power request is sent */ + DPRINT1("Taking the system down\n"); + PopShutdownSystem(PopAction.Action); +} + +VOID +NTAPI +PopReadShutdownPolicy(VOID) +{ + UNICODE_STRING KeyString; + OBJECT_ATTRIBUTES ObjectAttributes; + NTSTATUS Status; + HANDLE KeyHandle; + ULONG Length; + UCHAR Buffer[sizeof(KEY_VALUE_PARTIAL_INFORMATION) + sizeof(ULONG)]; + PKEY_VALUE_PARTIAL_INFORMATION Info = (PVOID)Buffer; + + /* Setup object attributes */ + RtlInitUnicodeString(&KeyString, + L"\\Registry\\Machine\\Software\\Policies\\Microsoft\\Windows NT"); + InitializeObjectAttributes(&ObjectAttributes, + &KeyString, + OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE, + NULL, + NULL); + + /* Open the key */ + Status = ZwOpenKey(&KeyHandle, KEY_READ, &ObjectAttributes); + if (NT_SUCCESS(Status)) + { + /* Open the policy value and query it */ + RtlInitUnicodeString(&KeyString, L"DontPowerOffAfterShutdown"); + Status = ZwQueryValueKey(KeyHandle, + &KeyString, + KeyValuePartialInformation, + &Info, + sizeof(Info), + &Length); + if ((NT_SUCCESS(Status)) && (Info->Type == REG_DWORD)) + { + /* Read the policy */ + PopShutdownPowerOffPolicy = *Info->Data == 1; + } + + /* Close the key */ + ZwClose(KeyHandle); + } +} + +/* PUBLIC FUNCTIONS **********************************************************/ + Propchange: trunk/reactos/ntoskrnl/po/poshtdwn.c ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/ntoskrnl/po/povolume.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/po/povolume.c?rev…
============================================================================== --- trunk/reactos/ntoskrnl/po/povolume.c (added) +++ trunk/reactos/ntoskrnl/po/povolume.c [iso-8859-1] Mon Mar 8 21:47:10 2010 @@ -1,0 +1,334 @@ +/* + * PROJECT: ReactOS Kernel + * LICENSE: BSD - See COPYING.ARM in the top level directory + * FILE: ntoskrnl/po/povolume.c + * PURPOSE: Power Manager DOPE and Volume Management + * PROGRAMMERS: ReactOS Portable Systems Group + */ + +/* INCLUDES ******************************************************************/ + +#include <ntoskrnl.h> +#define NDEBUG +#include <debug.h> + +/* GLOBALS *******************************************************************/ + +typedef struct _POP_FLUSH_VOLUME +{ + LIST_ENTRY List; + LONG Count; + KEVENT Wait; +} POP_FLUSH_VOLUME, *PPOP_FLUSH_VOLUME; + +ULONG PopFlushPolicy = 0; + +KGUARDED_MUTEX PopVolumeLock; +LIST_ENTRY PopVolumeDevices; +KSPIN_LOCK PopDopeGlobalLock; + +/* PRIVATE FUNCTIONS *********************************************************/ + +PDEVICE_OBJECT_POWER_EXTENSION +NTAPI +PopGetDope(IN PDEVICE_OBJECT DeviceObject) +{ + PEXTENDED_DEVOBJ_EXTENSION DeviceExtension; + PDEVICE_OBJECT_POWER_EXTENSION Dope; + KIRQL OldIrql; + PAGED_CODE(); + + /* If the device already has the dope, return it */ + DeviceExtension = IoGetDevObjExtension(DeviceObject); + if (DeviceExtension->Dope) goto Return; + + /* Allocate some dope for the device */ + Dope = ExAllocatePoolWithTag(NonPagedPool, + sizeof(DEVICE_OBJECT_POWER_EXTENSION), + 'Dope'); + if (!Dope) goto Return; + + /* Initialize the initial contents of the dope */ + RtlZeroMemory(Dope, sizeof(DEVICE_OBJECT_POWER_EXTENSION)); + Dope->DeviceObject = DeviceObject; + Dope->State = PowerDeviceUnspecified; + InitializeListHead(&Dope->IdleList); + + /* Make sure only one caller can assign dope to a device */ + KeAcquireSpinLock(&PopDopeGlobalLock, &OldIrql); + + /* Make sure the device still has no dope */ + if (!DeviceExtension->Dope) + { + /* Give the local dope to this device, and remember we won the race */ + DeviceExtension->Dope = (PVOID)Dope; + Dope = NULL; + } + + /* Allow other dope transactions now */ + KeReleaseSpinLock(&PopDopeGlobalLock, OldIrql); + + /* Check if someone other than us already assigned the dope, so free ours */ + if (Dope) ExFreePoolWithTag(Dope, 'Dope'); + + /* Return the dope to the caller */ +Return: + return (PDEVICE_OBJECT_POWER_EXTENSION)DeviceExtension->Dope; +} + +VOID +NTAPI +PoVolumeDevice(IN PDEVICE_OBJECT DeviceObject) +{ + PDEVICE_OBJECT_POWER_EXTENSION Dope; + PAGED_CODE(); + + /* Get dope from the device (if the device has no dope, it will receive some) */ + DPRINT1("New volume: %p\n", DeviceObject); + Dope = PopGetDope(DeviceObject); + if (Dope) + { + /* Make sure we can flush safely */ + DPRINT1("Acquiring volume lock\n"); + KeAcquireGuardedMutex(&PopVolumeLock); + + /* Add this volume into the list of power-manager volumes */ + DPRINT1("Got DOPE: %p\n", Dope); + if (!Dope->Volume.Flink) InsertTailList(&PopVolumeDevices, &Dope->Volume); + + /* Allow flushes to go through */ + KeReleaseGuardedMutex(&PopVolumeLock); + } +} + +VOID +NTAPI +PopFlushVolumeWorker(IN PVOID Context) +{ + PPOP_FLUSH_VOLUME FlushContext = (PPOP_FLUSH_VOLUME)Context; + PDEVICE_OBJECT_POWER_EXTENSION Dope; + PLIST_ENTRY NextEntry; + NTSTATUS Status; + UCHAR Buffer[sizeof(OBJECT_NAME_INFORMATION) + 512]; + POBJECT_NAME_INFORMATION NameInfo = (PVOID)Buffer; + ULONG Length; + OBJECT_ATTRIBUTES ObjectAttributes; + HANDLE VolumeHandle; + IO_STATUS_BLOCK IoStatusBlock; + + /* Acquire the flush lock since we're messing with the list */ + KeAcquireGuardedMutex(&PopVolumeLock); + + /* Loop the flush list */ + while (!IsListEmpty(&FlushContext->List)) + { + /* Grab the next (ie: current) entry and remove it */ + NextEntry = FlushContext->List.Flink; + RemoveEntryList(NextEntry); + + /* Add it back on the volume list */ + InsertTailList(&PopVolumeDevices, NextEntry); + + /* Done touching the volume list */ + KeReleaseGuardedMutex(&PopVolumeLock); + + /* Get the dope from the volume link */ + Dope = CONTAINING_RECORD(NextEntry, DEVICE_OBJECT_POWER_EXTENSION, Volume); + + /* Get the name */ + Status = ObQueryNameString(Dope->DeviceObject, + NameInfo, + sizeof(Buffer), + &Length); + if ((NT_SUCCESS(Status)) && (NameInfo->Name.Buffer)) + { + /* Open the volume */ + DPRINT1("Opening: %wZ\n", &NameInfo->Name); + InitializeObjectAttributes(&ObjectAttributes, + &NameInfo->Name, + OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE, + 0, + 0); + Status = ZwCreateFile(&VolumeHandle, + SYNCHRONIZE | FILE_READ_DATA | FILE_WRITE_DATA, + &ObjectAttributes, + &IoStatusBlock, + NULL, + GENERIC_READ | GENERIC_WRITE, + FILE_SHARE_READ | FILE_SHARE_WRITE, + FILE_OPEN, + 0, + NULL, + 0); + if (NT_SUCCESS(Status)) + { + /* Flush it and close it */ + DPRINT1("Sending flush to: %lx\n", VolumeHandle); + ZwFlushBuffersFile(VolumeHandle, &IoStatusBlock); + ZwClose(VolumeHandle); + } + } + + /* Acquire the flush lock again since we'll touch the list */ + KeAcquireGuardedMutex(&PopVolumeLock); + } + + /* One more flush completed... if it was the last, signal the caller */ + if (!--FlushContext->Count) KeSetEvent(&FlushContext->Wait, IO_NO_INCREMENT, FALSE); + + /* Serialize with flushers */ + KeReleaseGuardedMutex(&PopVolumeLock); +} + +VOID +NTAPI +PopFlushVolumes(IN BOOLEAN ShuttingDown) +{ + POP_FLUSH_VOLUME FlushContext = {{0}}; + ULONG FlushPolicy; + UNICODE_STRING RegistryName = RTL_CONSTANT_STRING(L"\\Registry"); + OBJECT_ATTRIBUTES ObjectAttributes; + HANDLE RegistryHandle; + PLIST_ENTRY NextEntry; + PDEVICE_OBJECT_POWER_EXTENSION Dope; + ULONG VolumeCount = 0; + NTSTATUS Status; + HANDLE ThreadHandle; + ULONG ThreadCount; + + /* Setup the flush context */ + InitializeListHead(&FlushContext.List); + KeInitializeEvent(&FlushContext.Wait, NotificationEvent, FALSE); + + /* What to flush */ + FlushPolicy = ShuttingDown ? 1 | 2 : PopFlushPolicy; + if ((FlushPolicy & 1)) + { + /* Registry flush requested, so open it */ + DPRINT1("Opening registry\n"); + InitializeObjectAttributes(&ObjectAttributes, + &RegistryName, + OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE, + NULL, + NULL); + Status = ZwOpenKey(&RegistryHandle, KEY_READ, &ObjectAttributes); + if (NT_SUCCESS(Status)) + { + /* Flush the registry */ + DPRINT1("Flushing registry\n"); + ZwFlushKey(RegistryHandle); + ZwClose(RegistryHandle); + } + } + + /* Serialize with other flushes */ + KeAcquireGuardedMutex(&PopVolumeLock); + + /* Scan the volume list */ + NextEntry = PopVolumeDevices.Flink; + while (NextEntry != &PopVolumeDevices) + { + /* Get the dope from the link */ + Dope = CONTAINING_RECORD(NextEntry, DEVICE_OBJECT_POWER_EXTENSION, Volume); + + /* Grab the next entry now, since we'll be modifying the list */ + NextEntry = NextEntry->Flink; + + /* Make sure the object is mounted, writable, exists, and is not a floppy */ + if (!(Dope->DeviceObject->Vpb->Flags & VPB_MOUNTED) || + (Dope->DeviceObject->Characteristics & FILE_FLOPPY_DISKETTE) || + (Dope->DeviceObject->Characteristics & FILE_READ_ONLY_DEVICE) || + ((Dope->DeviceObject->Vpb->RealDevice) && + (Dope->DeviceObject->Vpb->RealDevice->Characteristics & FILE_FLOPPY_DISKETTE))) + { + /* Not flushable */ + continue; + } + + /* Remove it from the dope and add it to the flush context list */ + RemoveEntryList(&Dope->Volume); + InsertTailList(&FlushContext.List, &Dope->Volume); + + /* Next */ + VolumeCount++; + } + + /* Check if we should skip non-removable devices */ + if (!(FlushPolicy & 2)) + { + /* ReactOS only implements this routine for shutdown, which requires it */ + UNIMPLEMENTED; + while (TRUE); + } + + /* Check if there were no volumes at all */ + if (!VolumeCount) + { + /* Nothing to do */ + KeReleaseGuardedMutex(&PopVolumeLock); + return; + } + + /* Allocate up to 8 flusher threads */ + ThreadCount = min(VolumeCount, 8); + InitializeObjectAttributes(&ObjectAttributes, + NULL, + OBJ_KERNEL_HANDLE, + NULL, + NULL); + + /* We will ourselves become a flusher thread */ + FlushContext.Count = 1; + ThreadCount--; + + /* Look for any extra ones we might need */ + while (ThreadCount > 0) + { + /* Create a new one */ + ThreadCount--; + DPRINT1("Creating flush thread\n"); + Status = PsCreateSystemThread(&ThreadHandle, + THREAD_ALL_ACCESS, + &ObjectAttributes, + 0L, + NULL, + PopFlushVolumeWorker, + &FlushContext); + if (NT_SUCCESS(Status)) + { + /* One more created... */ + FlushContext.Count++; + ZwClose(ThreadHandle); + } + } + + /* Allow flushes to go through */ + KeReleaseGuardedMutex(&PopVolumeLock); + + /* Enter the flush work */ + DPRINT1("Local flush\n"); + PopFlushVolumeWorker(&FlushContext); + + /* Wait for all flushes to be over */ + DPRINT1("Waiting for flushes\n"); + KeWaitForSingleObject(&FlushContext.Wait, Executive, KernelMode, FALSE, NULL); + DPRINT1("Flushes have completed\n"); +} + +VOID +NTAPI +PoInitializeDeviceObject(IN OUT PDEVOBJ_EXTENSION DeviceObjectExtension) +{ + PEXTENDED_DEVOBJ_EXTENSION DeviceExtension = (PVOID)DeviceObjectExtension; + PAGED_CODE(); + + /* Initialize the power flags */ + DeviceExtension->PowerFlags = PowerSystemUnspecified & 0xF; + DeviceExtension->PowerFlags |= ((PowerDeviceUnspecified << 4) & 0xF0); + + /* The device object is not on drugs yet */ + DeviceExtension->Dope = NULL; +} + +/* PUBLIC FUNCTIONS **********************************************************/ + Propchange: trunk/reactos/ntoskrnl/po/povolume.c ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/ntoskrnl/po/power.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/po/power.c?rev=46…
============================================================================== --- trunk/reactos/ntoskrnl/po/power.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/po/power.c [iso-8859-1] Mon Mar 8 21:47:10 2010 @@ -24,6 +24,8 @@ PDEVICE_NODE PopSystemPowerDeviceNode = NULL; BOOLEAN PopAcpiPresent = FALSE; +POP_POWER_ACTION PopAction; +WORK_QUEUE_ITEM PopShutdownWorkItem; /* PRIVATE FUNCTIONS *********************************************************/ @@ -165,6 +167,13 @@ PopAcpiPresent = KeLoaderBlock->Extension->AcpiTable != NULL ? TRUE : FALSE; } + + /* Initialize volume support */ + InitializeListHead(&PopVolumeDevices); + KeInitializeGuardedMutex(&PopVolumeLock); + + /* Initialize support for dope */ + KeInitializeSpinLock(&PopDopeGlobalLock); return TRUE; } @@ -636,3 +645,138 @@ /* All is good */ return STATUS_SUCCESS; } + +NTSTATUS +NTAPI +NtSetSystemPowerState(IN POWER_ACTION SystemAction, + IN SYSTEM_POWER_STATE MinSystemState, + IN ULONG Flags) +{ + KPROCESSOR_MODE PreviousMode = KeGetPreviousMode(); + POP_POWER_ACTION Action = {0}; + NTSTATUS Status; + + /* Check for invalid parameter combinations */ + if ((MinSystemState >= PowerSystemMaximum) || + (MinSystemState <= PowerSystemUnspecified) || + (SystemAction > PowerActionWarmEject) || + (SystemAction < PowerActionReserved) || + (Flags & ~(POWER_ACTION_QUERY_ALLOWED | + POWER_ACTION_UI_ALLOWED | + POWER_ACTION_OVERRIDE_APPS | + POWER_ACTION_LIGHTEST_FIRST | + POWER_ACTION_LOCK_CONSOLE | + POWER_ACTION_DISABLE_WAKES | + POWER_ACTION_CRITICAL))) + { + DPRINT1("NtSetSystemPowerState: Bad parameters!\n"); + DPRINT1(" SystemAction: 0x%x\n", SystemAction); + DPRINT1(" MinSystemState: 0x%x\n", MinSystemState); + DPRINT1(" Flags: 0x%x\n", Flags); + return STATUS_INVALID_PARAMETER; + } + + /* Check for user caller */ + if (PreviousMode != KernelMode) + { + /* Check for shutdown permission */ + if (!SeSinglePrivilegeCheck(SeShutdownPrivilege, PreviousMode)) + { + /* Not granted */ + DPRINT1("ERROR: Privilege not held for shutdown\n"); + //return STATUS_PRIVILEGE_NOT_HELD; HACK! + } + + /* Do it as a kernel-mode caller for consistency with system state */ + return ZwSetSystemPowerState (SystemAction, MinSystemState, Flags); + } + + /* Read policy settings (partial shutdown vs. full shutdown) */ + if (SystemAction == PowerActionShutdown) PopReadShutdownPolicy(); + + /* Disable lazy flushing of registry */ + DPRINT1("Stopping lazy flush\n"); + CmSetLazyFlushState(FALSE); + + /* Setup the power action */ + Action.Action = SystemAction; + Action.Flags = Flags; + + /* Notify callbacks */ + DPRINT1("Notifying callbacks\n"); + ExNotifyCallback(PowerStateCallback, (PVOID)3, NULL); + + /* Swap in any worker thread stacks */ + DPRINT1("Swapping worker threads\n"); + ExSwapinWorkerThreads(FALSE); + + /* Make our action global */ + PopAction = Action; + + /* Start power loop */ + Status = STATUS_CANCELLED; + while (TRUE) + { + /* Break out if there's nothing to do */ + if (Action.Action == PowerActionNone) break; + + /* Check for first-pass or restart */ + if (Status == STATUS_CANCELLED) + { + /* Check for shutdown action */ + if ((PopAction.Action == PowerActionShutdown) || + (PopAction.Action == PowerActionShutdownReset) || + (PopAction.Action == PowerActionShutdownOff)) + { + /* Set the action */ + PopAction.Shutdown = TRUE; + } + + /* Now we are good to go */ + Status = STATUS_SUCCESS; + } + + /* Check if we're still in an invalid status */ + if (!NT_SUCCESS(Status)) break; + + /* Flush all volumes and the registry */ + DPRINT1("Flushing volumes\n"); + PopFlushVolumes(PopAction.Shutdown); + + /* Set IRP for drivers */ + PopAction.IrpMinor = IRP_MN_SET_POWER; + if (PopAction.Shutdown) + { + DPRINT1("Queueing shutdown thread\n"); + /* Check if we are running in the system context */ + if (PsGetCurrentProcess() != PsInitialSystemProcess) + { + /* We're not, so use a worker thread for shutdown */ + ExInitializeWorkItem(&PopShutdownWorkItem, + &PopGracefulShutdown, + NULL); + + ExQueueWorkItem(&PopShutdownWorkItem, CriticalWorkQueue); + + /* Spend us -- when we wake up, the system is good to go down */ + KeSuspendThread(KeGetCurrentThread()); + Status = STATUS_SYSTEM_SHUTDOWN; + goto Exit; + + } + else + { + /* Do the shutdown inline */ + PopGracefulShutdown(NULL); + } + } + + /* You should not have made it this far */ + ASSERT(FALSE && "System is still up and running?!"); + break; + } + +Exit: + /* We're done, return */ + return Status; +}
14 years, 10 months
1
0
0
0
[sir_richard] 46003: [CMLIB]: Just use UNIMPLEMENTED.
by sir_richard@svn.reactos.org
Author: sir_richard Date: Mon Mar 8 21:46:53 2010 New Revision: 46003 URL:
http://svn.reactos.org/svn/reactos?rev=46003&view=rev
Log: [CMLIB]: Just use UNIMPLEMENTED. Modified: trunk/reactos/lib/cmlib/hivewrt.c Modified: trunk/reactos/lib/cmlib/hivewrt.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/cmlib/hivewrt.c?rev=46…
============================================================================== --- trunk/reactos/lib/cmlib/hivewrt.c [iso-8859-1] (original) +++ trunk/reactos/lib/cmlib/hivewrt.c [iso-8859-1] Mon Mar 8 21:46:53 2010 @@ -23,7 +23,7 @@ PVOID BlockPtr; BOOLEAN Success; - DPRINT1("FIXME: HvpWriteLog doesn't do anything atm\n"); + UNIMPLEMENTED; return TRUE; ASSERT(RegistryHive->ReadOnly == FALSE);
14 years, 10 months
1
0
0
0
[ekohl] 46002: SEH-Protect the call to RSetServiceStatus in SetServiceStatus. This keeps services from crashing when the connection to the service manager fails.
by ekohl@svn.reactos.org
Author: ekohl Date: Mon Mar 8 21:42:48 2010 New Revision: 46002 URL:
http://svn.reactos.org/svn/reactos?rev=46002&view=rev
Log: SEH-Protect the call to RSetServiceStatus in SetServiceStatus. This keeps services from crashing when the connection to the service manager fails. Modified: trunk/reactos/dll/win32/advapi32/service/sctrl.c Modified: trunk/reactos/dll/win32/advapi32/service/sctrl.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/service…
============================================================================== --- trunk/reactos/dll/win32/advapi32/service/sctrl.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/advapi32/service/sctrl.c [iso-8859-1] Mon Mar 8 21:42:48 2010 @@ -651,9 +651,18 @@ TRACE("SetServiceStatus() called\n"); TRACE("hServiceStatus %lu\n", hServiceStatus); - /* Call to services.exe using RPC */ - dwError = RSetServiceStatus((RPC_SERVICE_STATUS_HANDLE)hServiceStatus, - lpServiceStatus); + RpcTryExcept + { + /* Call to services.exe using RPC */ + dwError = RSetServiceStatus((RPC_SERVICE_STATUS_HANDLE)hServiceStatus, + lpServiceStatus); + } + RpcExcept(EXCEPTION_EXECUTE_HANDLER) + { + dwError = ScmRpcStatusToWinError(RpcExceptionCode()); + } + RpcEndExcept; + if (dwError != ERROR_SUCCESS) { ERR("ScmrSetServiceStatus() failed (Error %lu)\n", dwError);
14 years, 10 months
1
0
0
0
[sir_richard] 46001: [NTOS]: Implement CmSetLazyFlushState to disable lazy writing in the Cm. [NTOS]: Implement ExSwapInWorkerThreads to in-swap any worker threads when needed. [NTOS]: Add HAL stubs for HalEndOfBoot and HalSetWakeEnable since most HALs set this to NULL. [DDK]: Add some missing definitions.
by sir_richard@svn.reactos.org
Author: sir_richard Date: Mon Mar 8 21:37:24 2010 New Revision: 46001 URL:
http://svn.reactos.org/svn/reactos?rev=46001&view=rev
Log: [NTOS]: Implement CmSetLazyFlushState to disable lazy writing in the Cm. [NTOS]: Implement ExSwapInWorkerThreads to in-swap any worker threads when needed. [NTOS]: Add HAL stubs for HalEndOfBoot and HalSetWakeEnable since most HALs set this to NULL. [DDK]: Add some missing definitions. Modified: trunk/reactos/include/ddk/winddk.h trunk/reactos/ntoskrnl/config/cmlazy.c trunk/reactos/ntoskrnl/ex/work.c trunk/reactos/ntoskrnl/fstub/halstub.c trunk/reactos/ntoskrnl/include/internal/cm.h trunk/reactos/ntoskrnl/include/internal/ex.h trunk/reactos/ntoskrnl/include/internal/hal.h Modified: trunk/reactos/include/ddk/winddk.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/winddk.h?rev=4…
============================================================================== --- trunk/reactos/include/ddk/winddk.h [iso-8859-1] (original) +++ trunk/reactos/include/ddk/winddk.h [iso-8859-1] Mon Mar 8 21:37:24 2010 @@ -897,6 +897,41 @@ SYSTEM_POWER_STATE SystemState; DEVICE_POWER_STATE DeviceState; } POWER_STATE, *PPOWER_STATE; + +typedef struct _POWER_ACTION_POLICY { + POWER_ACTION Action; + ULONG Flags; + ULONG EventCode; +} POWER_ACTION_POLICY, *PPOWER_ACTION_POLICY; + +/* POWER_ACTION_POLICY.Flags constants */ +#define POWER_ACTION_QUERY_ALLOWED 0x00000001 +#define POWER_ACTION_UI_ALLOWED 0x00000002 +#define POWER_ACTION_OVERRIDE_APPS 0x00000004 +#define POWER_ACTION_LIGHTEST_FIRST 0x10000000 +#define POWER_ACTION_LOCK_CONSOLE 0x20000000 +#define POWER_ACTION_DISABLE_WAKES 0x40000000 +#define POWER_ACTION_CRITICAL 0x80000000 + +/* POWER_ACTION_POLICY.EventCode constants */ +#define POWER_LEVEL_USER_NOTIFY_TEXT 0x00000001 +#define POWER_LEVEL_USER_NOTIFY_SOUND 0x00000002 +#define POWER_LEVEL_USER_NOTIFY_EXEC 0x00000004 +#define POWER_USER_NOTIFY_BUTTON 0x00000008 +#define POWER_USER_NOTIFY_SHUTDOWN 0x00000010 +#define POWER_FORCE_TRIGGER_RESET 0x80000000 + +#define DISCHARGE_POLICY_CRITICAL 0 +#define DISCHARGE_POLICY_LOW 1 +#define NUM_DISCHARGE_POLICIES 4 + +#define PO_THROTTLE_NONE 0 +#define PO_THROTTLE_CONSTANT 1 +#define PO_THROTTLE_DEGRADE 2 +#define PO_THROTTLE_ADAPTIVE 3 +#define PO_THROTTLE_MAXIMUM 4 + + typedef enum _POWER_STATE_TYPE { SystemPowerState, Modified: trunk/reactos/ntoskrnl/config/cmlazy.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/config/cmlazy.c?r…
============================================================================== --- trunk/reactos/ntoskrnl/config/cmlazy.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/config/cmlazy.c [iso-8859-1] Mon Mar 8 21:37:24 2010 @@ -298,4 +298,12 @@ KeCancelTimer(&CmpLazyFlushTimer); } +VOID +NTAPI +CmSetLazyFlushState(IN BOOLEAN Enable) +{ + /* Set state for lazy flusher */ + CmpHoldLazyFlush = !Enable; +} + /* EOF */ Modified: trunk/reactos/ntoskrnl/ex/work.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ex/work.c?rev=460…
============================================================================== --- trunk/reactos/ntoskrnl/ex/work.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ex/work.c [iso-8859-1] Mon Mar 8 21:37:24 2010 @@ -43,7 +43,7 @@ /* Future support for stack swapping worker threads */ BOOLEAN ExpWorkersCanSwap; LIST_ENTRY ExpWorkerListHead; -KMUTANT ExpWorkerSwapinMutex; +FAST_MUTEX ExpWorkerSwapinMutex; /* The worker balance set manager events */ KEVENT ExpThreadSetManagerEvent; @@ -513,7 +513,7 @@ ULONG i; /* Setup the stack swap support */ - KeInitializeMutex(&ExpWorkerSwapinMutex, FALSE); + ExInitializeFastMutex(&ExpWorkerSwapinMutex); InitializeListHead(&ExpWorkerListHead); ExpWorkersCanSwap = TRUE; @@ -587,6 +587,89 @@ /* Close the handle and return */ ObCloseHandle(ThreadHandle, KernelMode); +} + +VOID +NTAPI +ExpSetSwappingKernelApc(IN PKAPC Apc, + OUT PKNORMAL_ROUTINE *NormalRoutine, + IN OUT PVOID *NormalContext, + IN OUT PVOID *SystemArgument1, + IN OUT PVOID *SystemArgument2) +{ + PBOOLEAN AllowSwap; + PKEVENT Event = (PKEVENT)*SystemArgument1; + + /* Make sure it's an active worker */ + if (PsGetCurrentThread()->ActiveExWorker) + { + /* Read the setting from the context flag */ + AllowSwap = (PBOOLEAN)NormalContext; + KeSetKernelStackSwapEnable(*AllowSwap); + } + + /* Let caller know that we're done */ + KeSetEvent(Event, 0, FALSE); +} + +VOID +NTAPI +ExSwapinWorkerThreads(IN BOOLEAN AllowSwap) +{ + KEVENT Event; + PETHREAD CurrentThread = PsGetCurrentThread(), Thread; + PEPROCESS Process = PsInitialSystemProcess; + KAPC Apc; + PAGED_CODE(); + + /* Initialize an event so we know when we're done */ + KeInitializeEvent(&Event, NotificationEvent, FALSE); + + /* Lock this routine */ + ExAcquireFastMutex(&ExpWorkerSwapinMutex); + + /* New threads cannot swap anymore */ + ExpWorkersCanSwap = AllowSwap; + + /* Loop all threads in the system process */ + Thread = PsGetNextProcessThread(Process, NULL); + while (Thread) + { + /* Skip threads with explicit permission to do this */ + if (Thread->ExWorkerCanWaitUser) goto Next; + + /* Check if we reached ourselves */ + if (Thread == CurrentThread) + { + /* Do it inline */ + KeSetKernelStackSwapEnable(AllowSwap); + } + else + { + /* Queue an APC */ + KeInitializeApc(&Apc, + &Thread->Tcb, + InsertApcEnvironment, + ExpSetSwappingKernelApc, + NULL, + NULL, + KernelMode, + &AllowSwap); + if (KeInsertQueueApc(&Apc, &Event, NULL, 3)) + { + /* Wait for the APC to run */ + KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL); + KeClearEvent(&Event); + } + } + + /* Next thread */ +Next: + Thread = PsGetNextProcessThread(Process, Thread); + } + + /* Release the lock */ + ExReleaseFastMutex(&ExpWorkerSwapinMutex); } /* PUBLIC FUNCTIONS **********************************************************/ Modified: trunk/reactos/ntoskrnl/fstub/halstub.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/fstub/halstub.c?r…
============================================================================== --- trunk/reactos/ntoskrnl/fstub/halstub.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/fstub/halstub.c [iso-8859-1] Mon Mar 8 21:37:24 2010 @@ -36,7 +36,7 @@ (pHalStartMirroring)NULL, (pHalEndMirroring)NULL, (pHalMirrorPhysicalMemory)NULL, - (pHalEndOfBoot)NULL, + xHalEndOfBoot, (pHalMirrorVerify)NULL }; @@ -47,7 +47,7 @@ (pHalHandlerForConfigSpace)NULL, (pHalLocateHiberRanges)NULL, (pHalRegisterBusHandler)NULL, - (pHalSetWakeEnable)NULL, + xHalSetWakeEnable, (pHalSetWakeAlarm)NULL, (pHalTranslateBusAddress)NULL, (pHalAssignSlotResources)NULL, @@ -81,3 +81,19 @@ /* Halt execution */ while (TRUE); } + +VOID +NTAPI +xHalEndOfBoot(VOID) +{ + /* Nothing */ + return; +} + +VOID +NTAPI +xHalSetWakeEnable(IN BOOLEAN Enable) +{ + /* Nothing */ + return; +} Modified: trunk/reactos/ntoskrnl/include/internal/cm.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
============================================================================== --- trunk/reactos/ntoskrnl/include/internal/cm.h [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/include/internal/cm.h [iso-8859-1] Mon Mar 8 21:37:24 2010 @@ -1452,6 +1452,12 @@ NTAPI CmShutdownSystem( VOID +); + +VOID +NTAPI +CmSetLazyFlushState( + IN BOOLEAN Enable ); // Modified: trunk/reactos/ntoskrnl/include/internal/ex.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
============================================================================== --- trunk/reactos/ntoskrnl/include/internal/ex.h [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/include/internal/ex.h [iso-8859-1] Mon Mar 8 21:37:24 2010 @@ -26,6 +26,7 @@ extern ULONG ExpInitializationPhase; extern ULONG ExpAltTimeZoneBias; extern LIST_ENTRY ExSystemLookasideListHead; +extern PCALLBACK_OBJECT PowerStateCallback; typedef struct _EXHANDLE { @@ -157,6 +158,10 @@ VOID NTAPI ExpInitializeWorkerThreads(VOID); + +VOID +NTAPI +ExSwapinWorkerThreads(IN BOOLEAN AllowSwap); VOID NTAPI Modified: trunk/reactos/ntoskrnl/include/internal/hal.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
============================================================================== --- trunk/reactos/ntoskrnl/include/internal/hal.h [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/include/internal/hal.h [iso-8859-1] Mon Mar 8 21:37:24 2010 @@ -51,6 +51,18 @@ NTAPI xHalHaltSystem( VOID +); + +VOID +NTAPI +xHalEndOfBoot( + VOID +); + +VOID +NTAPI +xHalSetWakeEnable( + IN BOOLEAN Enable ); UCHAR
14 years, 10 months
1
0
0
0
[janderwald] 46000: - Silent traces
by janderwald@svn.reactos.org
Author: janderwald Date: Mon Mar 8 21:30:51 2010 New Revision: 46000 URL:
http://svn.reactos.org/svn/reactos?rev=46000&view=rev
Log: - Silent traces Modified: trunk/reactos/dll/directx/bdaplgin/precomp.h Modified: trunk/reactos/dll/directx/bdaplgin/precomp.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/bdaplgin/preco…
============================================================================== --- trunk/reactos/dll/directx/bdaplgin/precomp.h [iso-8859-1] (original) +++ trunk/reactos/dll/directx/bdaplgin/precomp.h [iso-8859-1] Mon Mar 8 21:30:51 2010 @@ -1,7 +1,7 @@ #ifndef PRECOMP_H__ #define PRECOMP_H__ -#define BDAPLGIN_TRACE +//#define BDAPLGIN_TRACE #define BUILDING_KS #define _KSDDK_ #include <dshow.h>
14 years, 10 months
1
0
0
0
[tkreuzer] 45999: Add a bunch of Zw apis. (see diff for more details)
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Mon Mar 8 21:26:45 2010 New Revision: 45999 URL:
http://svn.reactos.org/svn/reactos?rev=45999&view=rev
Log: Add a bunch of Zw apis. (see diff for more details) Modified: branches/header-work/include/ddk/wdm.h Modified: branches/header-work/include/ddk/wdm.h URL:
http://svn.reactos.org/svn/reactos/branches/header-work/include/ddk/wdm.h?r…
============================================================================== --- branches/header-work/include/ddk/wdm.h [iso-8859-1] (original) +++ branches/header-work/include/ddk/wdm.h [iso-8859-1] Mon Mar 8 21:26:45 2010 @@ -10236,43 +10236,61 @@ NTSYSAPI NTSTATUS NTAPI +ZwCreateSection( + OUT PHANDLE SectionHandle, + IN ACCESS_MASK DesiredAccess, + IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL, + IN PLARGE_INTEGER MaximumSize OPTIONAL, + IN ULONG SectionPageProtection, + IN ULONG AllocationAttributes, + IN HANDLE FileHandle OPTIONAL); + +NTSYSAPI +NTSTATUS +NTAPI ZwDeleteKey( - IN HANDLE KeyHandle); + IN HANDLE KeyHandle); NTSYSAPI NTSTATUS NTAPI ZwDeleteValueKey( IN HANDLE KeyHandle, - IN PUNICODE_STRING ValueName); + IN PUNICODE_STRING ValueName); NTSYSAPI NTSTATUS NTAPI ZwEnumerateKey( - IN HANDLE KeyHandle, - IN ULONG Index, - IN KEY_INFORMATION_CLASS KeyInformationClass, - OUT PVOID KeyInformation, - IN ULONG Length, - OUT PULONG ResultLength); + IN HANDLE KeyHandle, + IN ULONG Index, + IN KEY_INFORMATION_CLASS KeyInformationClass, + OUT PVOID KeyInformation OPTIONAL, + IN ULONG Length, + OUT PULONG ResultLength); NTSYSAPI NTSTATUS NTAPI ZwEnumerateValueKey( - IN HANDLE KeyHandle, - IN ULONG Index, - IN KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass, - OUT PVOID KeyValueInformation, - IN ULONG Length, - OUT PULONG ResultLength); + IN HANDLE KeyHandle, + IN ULONG Index, + IN KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass, + OUT PVOID KeyValueInformation OPTIONAL, + IN ULONG Length, + OUT PULONG ResultLength); NTSYSAPI NTSTATUS NTAPI ZwFlushKey( IN HANDLE KeyHandle); + +NTSYSAPI +NTSTATUS +NTAPI +ZwLoadDriver( + IN PUNICODE_STRING DriverServiceName); NTSYSAPI NTSTATUS @@ -10298,6 +10316,17 @@ NTSYSAPI NTSTATUS NTAPI +ZwOpenFile( + OUT PHANDLE FileHandle, + IN ACCESS_MASK DesiredAccess, + IN POBJECT_ATTRIBUTES ObjectAttributes, + OUT PIO_STATUS_BLOCK IoStatusBlock, + IN ULONG ShareAccess, + IN ULONG OpenOptions); + +NTSYSAPI +NTSTATUS +NTAPI ZwOpenKey( OUT PHANDLE KeyHandle, IN ACCESS_MASK DesiredAccess, @@ -10333,11 +10362,11 @@ NTSTATUS NTAPI ZwQueryKey( - IN HANDLE KeyHandle, - IN KEY_INFORMATION_CLASS KeyInformationClass, - OUT PVOID KeyInformation, - IN ULONG Length, - OUT PULONG ResultLength); + IN HANDLE KeyHandle, + IN KEY_INFORMATION_CLASS KeyInformationClass, + OUT PVOID KeyInformation OPTIONAL, + IN ULONG Length, + OUT PULONG ResultLength); NTSYSAPI NTSTATUS @@ -10351,12 +10380,12 @@ NTSTATUS NTAPI ZwQueryValueKey( - IN HANDLE KeyHandle, - IN PUNICODE_STRING ValueName, - IN KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass, - OUT PVOID KeyValueInformation, - IN ULONG Length, - OUT PULONG ResultLength); + IN HANDLE KeyHandle, + IN PUNICODE_STRING ValueName, + IN KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass, + OUT PVOID KeyValueInformation OPTIONAL, + IN ULONG Length, + OUT PULONG ResultLength); NTSYSAPI NTSTATUS @@ -10396,6 +10425,12 @@ NTSYSAPI NTSTATUS NTAPI +ZwUnloadDriver( + IN PUNICODE_STRING DriverServiceName); + +NTSYSAPI +NTSTATUS +NTAPI ZwUnmapViewOfSection( IN HANDLE ProcessHandle, IN PVOID BaseAddress OPTIONAL); @@ -10413,6 +10448,418 @@ IN ULONG Length, IN PLARGE_INTEGER ByteOffset OPTIONAL, IN PULONG Key OPTIONAL); + +NTSYSAPI +NTSTATUS +NTAPI +ZwQueryFullAttributesFile( + IN POBJECT_ATTRIBUTES ObjectAttributes, + OUT PFILE_NETWORK_OPEN_INFORMATION FileInformation); + +#endif + +#if (NTDDI_VERSION >= NTDDI_WIN2003) + +NTSYSCALLAPI +NTSTATUS +NTAPI +ZwOpenEvent( + OUT PHANDLE EventHandle, + IN ACCESS_MASK DesiredAccess, + IN POBJECT_ATTRIBUTES ObjectAttributes); + +#endif + +#if (NTDDI_VERSION >= NTDDI_VISTA) + +NTSYSAPI +NTSTATUS +ZwCreateKeyTransacted( + OUT PHANDLE KeyHandle, + IN ACCESS_MASK DesiredAccess, + IN POBJECT_ATTRIBUTES ObjectAttributes, + IN ULONG TitleIndex, + IN PUNICODE_STRING Class OPTIONAL, + IN ULONG CreateOptions, + IN HANDLE TransactionHandle, + OUT PULONG Disposition OPTIONAL); + +NTSYSAPI +NTSTATUS +NTAPI +ZwOpenKeyTransacted( + OUT PHANDLE KeyHandle, + IN ACCESS_MASK DesiredAccess, + IN POBJECT_ATTRIBUTES ObjectAttributes, + IN HANDLE TransactionHandle); + +NTSYSCALLAPI +NTSTATUS +NTAPI +ZwCreateTransactionManager( + OUT PHANDLE TmHandle, + IN ACCESS_MASK DesiredAccess, + IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL, + IN PUNICODE_STRING LogFileName OPTIONAL, + IN ULONG CreateOptions OPTIONAL, + IN ULONG CommitStrength OPTIONAL); + +NTSYSCALLAPI +NTSTATUS +NTAPI +ZwOpenTransactionManager( + OUT PHANDLE TmHandle, + IN ACCESS_MASK DesiredAccess, + IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL, + IN PUNICODE_STRING LogFileName OPTIONAL, + IN LPGUID TmIdentity OPTIONAL, + IN ULONG OpenOptions OPTIONAL); + +NTSYSCALLAPI +NTSTATUS +NTAPI +ZwRollforwardTransactionManager( + IN HANDLE TransactionManagerHandle, + IN PLARGE_INTEGER TmVirtualClock OPTIONAL); + +NTSYSCALLAPI +NTSTATUS +NTAPI +ZwRecoverTransactionManager( + IN HANDLE TransactionManagerHandle); + +NTSYSCALLAPI +NTSTATUS +NTAPI +ZwQueryInformationTransactionManager( + IN HANDLE TransactionManagerHandle, + IN TRANSACTIONMANAGER_INFORMATION_CLASS TransactionManagerInformationClass, + OUT PVOID TransactionManagerInformation, + IN ULONG TransactionManagerInformationLength, + OUT PULONG ReturnLength OPTIONAL); + +NTSYSCALLAPI +NTSTATUS +NTAPI +ZwSetInformationTransactionManager( + IN HANDLE TmHandle, + IN TRANSACTIONMANAGER_INFORMATION_CLASS TransactionManagerInformationClass, + IN PVOID TransactionManagerInformation, + IN ULONG TransactionManagerInformationLength); + +NTSYSCALLAPI +NTSTATUS +NTAPI +ZwEnumerateTransactionObject( + IN HANDLE RootObjectHandle OPTIONAL, + IN KTMOBJECT_TYPE QueryType, + IN OUT PKTMOBJECT_CURSOR ObjectCursor, + IN ULONG ObjectCursorLength, + OUT PULONG ReturnLength); + +NTSYSCALLAPI +NTSTATUS +NTAPI +ZwCreateTransaction( + OUT PHANDLE TransactionHandle, + IN ACCESS_MASK DesiredAccess, + IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL, + IN LPGUID Uow OPTIONAL, + IN HANDLE TmHandle OPTIONAL, + IN ULONG CreateOptions OPTIONAL, + IN ULONG IsolationLevel OPTIONAL, + IN ULONG IsolationFlags OPTIONAL, + IN PLARGE_INTEGER Timeout OPTIONAL, + IN PUNICODE_STRING Description OPTIONAL); + +NTSYSCALLAPI +NTSTATUS +NTAPI +ZwOpenTransaction( + OUT PHANDLE TransactionHandle, + IN ACCESS_MASK DesiredAccess, + IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL, + IN LPGUID Uow, + IN HANDLE TmHandle OPTIONAL); + +NTSYSCALLAPI +NTSTATUS +NTAPI +ZwQueryInformationTransaction( + IN HANDLE TransactionHandle, + IN TRANSACTION_INFORMATION_CLASS TransactionInformationClass, + OUT PVOID TransactionInformation, + IN ULONG TransactionInformationLength, + OUT PULONG ReturnLength OPTIONAL); + +NTSYSCALLAPI +NTSTATUS +NTAPI +ZwSetInformationTransaction( + IN HANDLE TransactionHandle, + IN TRANSACTION_INFORMATION_CLASS TransactionInformationClass, + IN PVOID TransactionInformation, + IN ULONG TransactionInformationLength); + +NTSYSCALLAPI +NTSTATUS +NTAPI +ZwCommitTransaction( + IN HANDLE TransactionHandle, + IN BOOLEAN Wait); + +NTSYSCALLAPI +NTSTATUS +NTAPI +ZwRollbackTransaction( + IN HANDLE TransactionHandle, + IN BOOLEAN Wait); + +NTSYSCALLAPI +NTSTATUS +NTAPI +ZwCreateResourceManager( + OUT PHANDLE ResourceManagerHandle, + IN ACCESS_MASK DesiredAccess, + IN HANDLE TmHandle, + IN LPGUID ResourceManagerGuid OPTIONAL, + IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL, + IN ULONG CreateOptions OPTIONAL, + IN PUNICODE_STRING Description OPTIONAL); + +NTSYSCALLAPI +NTSTATUS +NTAPI +ZwOpenResourceManager( + OUT PHANDLE ResourceManagerHandle, + IN ACCESS_MASK DesiredAccess, + IN HANDLE TmHandle, + IN LPGUID ResourceManagerGuid, + IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL); + +NTSYSCALLAPI +NTSTATUS +NTAPI +ZwRecoverResourceManager( + IN HANDLE ResourceManagerHandle); + +NTSYSCALLAPI +NTSTATUS +NTAPI +ZwGetNotificationResourceManager( + IN HANDLE ResourceManagerHandle, + OUT PTRANSACTION_NOTIFICATION TransactionNotification, + IN ULONG NotificationLength, + IN PLARGE_INTEGER Timeout, + IN PULONG ReturnLength OPTIONAL, + IN ULONG Asynchronous, + IN ULONG_PTR AsynchronousContext OPTIONAL); + +NTSYSCALLAPI +NTSTATUS +NTAPI +ZwQueryInformationResourceManager( + IN HANDLE ResourceManagerHandle, + IN RESOURCEMANAGER_INFORMATION_CLASS ResourceManagerInformationClass, + OUT PVOID ResourceManagerInformation, + IN ULONG ResourceManagerInformationLength, + IN PULONG ReturnLength OPTIONAL); + +NTSYSCALLAPI +NTSTATUS +NTAPI +ZwSetInformationResourceManager( + IN HANDLE ResourceManagerHandle, + IN RESOURCEMANAGER_INFORMATION_CLASS ResourceManagerInformationClass, + IN PVOID ResourceManagerInformation, + IN ULONG ResourceManagerInformationLength); + +NTSYSCALLAPI +NTSTATUS +NTAPI +ZwCreateEnlistment( + OUT PHANDLE EnlistmentHandle, + IN ACCESS_MASK DesiredAccess, + IN HANDLE ResourceManagerHandle, + IN HANDLE TransactionHandle, + IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL, + IN ULONG CreateOptions OPTIONAL, + IN NOTIFICATION_MASK NotificationMask, + IN PVOID EnlistmentKey OPTIONAL); + +NTSYSCALLAPI +NTSTATUS +NTAPI +ZwOpenEnlistment( + OUT PHANDLE EnlistmentHandle, + IN ACCESS_MASK DesiredAccess, + IN HANDLE RmHandle, + IN LPGUID EnlistmentGuid, + IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL); + +NTSYSCALLAPI +NTSTATUS +NTAPI +ZwQueryInformationEnlistment( + IN HANDLE EnlistmentHandle, + IN ENLISTMENT_INFORMATION_CLASS EnlistmentInformationClass, + OUT PVOID EnlistmentInformation, + IN ULONG EnlistmentInformationLength, + IN PULONG ReturnLength OPTIONAL); + +NTSYSCALLAPI +NTSTATUS +NTAPI +ZwSetInformationEnlistment( + IN HANDLE EnlistmentHandle, + IN ENLISTMENT_INFORMATION_CLASS EnlistmentInformationClass, + IN PVOID EnlistmentInformation, + IN ULONG EnlistmentInformationLength); + +NTSYSCALLAPI +NTSTATUS +NTAPI +ZwRecoverEnlistment( + IN HANDLE EnlistmentHandle, + IN PVOID EnlistmentKey OPTIONAL); + +NTSYSCALLAPI +NTSTATUS +NTAPI +ZwPrePrepareEnlistment( + IN HANDLE EnlistmentHandle, + IN PLARGE_INTEGER TmVirtualClock OPTIONAL); + +NTSYSCALLAPI +NTSTATUS +NTAPI +ZwPrepareEnlistment( + IN HANDLE EnlistmentHandle, + IN PLARGE_INTEGER TmVirtualClock OPTIONAL); + +NTSYSCALLAPI +NTSTATUS +NTAPI +ZwCommitEnlistment( + IN HANDLE EnlistmentHandle, + IN PLARGE_INTEGER TmVirtualClock OPTIONAL); + +NTSYSCALLAPI +NTSTATUS +NTAPI +ZwRollbackEnlistment( + IN HANDLE EnlistmentHandle, + IN PLARGE_INTEGER TmVirtualClock OPTIONAL); + +NTSYSCALLAPI +NTSTATUS +NTAPI +ZwPrePrepareComplete( + IN HANDLE EnlistmentHandle, + IN PLARGE_INTEGER TmVirtualClock OPTIONAL); + +NTSYSCALLAPI +NTSTATUS +NTAPI +ZwPrepareComplete( + IN HANDLE EnlistmentHandle, + IN PLARGE_INTEGER TmVirtualClock OPTIONAL); + +NTSYSCALLAPI +NTSTATUS +NTAPI +ZwCommitComplete( + IN HANDLE EnlistmentHandle, + IN PLARGE_INTEGER TmVirtualClock OPTIONAL); + +NTSYSCALLAPI +NTSTATUS +NTAPI +ZwReadOnlyEnlistment( + IN HANDLE EnlistmentHandle, + IN PLARGE_INTEGER TmVirtualClock OPTIONAL); + +NTSYSCALLAPI +NTSTATUS +NTAPI +ZwRollbackComplete( + IN HANDLE EnlistmentHandle, + IN PLARGE_INTEGER TmVirtualClock OPTIONAL); + +NTSYSCALLAPI +NTSTATUS +NTAPI +ZwSinglePhaseReject( + IN HANDLE EnlistmentHandle, + IN PLARGE_INTEGER TmVirtualClock OPTIONAL); + + +#endif + +#if (NTDDI_VERSION >= NTDDI_WIN7) + +NTSYSAPI +NTSTATUS +NTAPI +ZwOpenKeyEx( + OUT PHANDLE KeyHandle, + IN ACCESS_MASK DesiredAccess, + IN POBJECT_ATTRIBUTES ObjectAttributes, + IN ULONG OpenOptions); + +NTSYSAPI +NTSTATUS +NTAPI +ZwOpenKeyTransactedEx( + OUT PHANDLE KeyHandle, + IN ACCESS_MASK DesiredAccess, + IN POBJECT_ATTRIBUTES ObjectAttributes, + IN ULONG OpenOptions, + IN HANDLE TransactionHandle); + +NTSYSAPI +NTSTATUS +NTAPI +ZwNotifyChangeMultipleKeys( + IN HANDLE MasterKeyHandle, + IN ULONG Count OPTIONAL, + IN OBJECT_ATTRIBUTES SubordinateObjects[] OPTIONAL, + IN HANDLE Event OPTIONAL, + IN PIO_APC_ROUTINE ApcRoutine OPTIONAL, + IN PVOID ApcContext OPTIONAL, + OUT PIO_STATUS_BLOCK IoStatusBlock, + IN ULONG CompletionFilter, + IN BOOLEAN WatchTree, + OUT PVOID Buffer OPTIONAL, + IN ULONG BufferSize, + IN BOOLEAN Asynchronous); + +NTSYSAPI +NTSTATUS +NTAPI +ZwQueryMultipleValueKey( + IN HANDLE KeyHandle, + IN OUT PKEY_VALUE_ENTRY ValueEntries, + IN ULONG EntryCount, + OUT PVOID ValueBuffer, + IN OUT PULONG BufferLength, + OUT PULONG RequiredBufferLength OPTIONAL); + +NTSYSAPI +NTSTATUS +NTAPI +ZwRenameKey( + IN HANDLE KeyHandle, + IN PUNICODE_STRING NewName); + +NTSYSAPI +NTSTATUS +NTAPI +ZwSetInformationKey( + IN HANDLE KeyHandle, + IN KEY_SET_INFORMATION_CLASS KeySetInformationClass, + IN PVOID KeySetInformation, + IN ULONG KeySetInformationLength); #endif
14 years, 10 months
1
0
0
0
← Newer
1
...
60
61
62
63
64
65
66
...
90
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
Results per page:
10
25
50
100
200