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
September 2011
----- 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
20 participants
399 discussions
Start a n
N
ew thread
[gadamopoulos] 53830: [user32_apitest] - Implement logging post messages or winevents - For SetActiveWindow test, also test the parameters of WM_WINDOWPOSCHANGING and WM_WINDOWPOSCHANGED messages -...
by gadamopoulos@svn.reactos.org
Author: gadamopoulos Date: Sat Sep 24 11:55:19 2011 New Revision: 53830 URL:
http://svn.reactos.org/svn/reactos?rev=53830&view=rev
Log: [user32_apitest] - Implement logging post messages or winevents - For SetActiveWindow test, also test the parameters of WM_WINDOWPOSCHANGING and WM_WINDOWPOSCHANGED messages - For TrackMouseEvent test, also test the WM_SYSTIMER that is possible to be logged now Modified: trunk/rostests/apitests/user32/SetActiveWindow.c trunk/rostests/apitests/user32/TrackMouseEvent.c trunk/rostests/apitests/user32/helper.c trunk/rostests/apitests/user32/helper.h Modified: trunk/rostests/apitests/user32/SetActiveWindow.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/user32/SetActive…
============================================================================== --- trunk/rostests/apitests/user32/SetActiveWindow.c [iso-8859-1] (original) +++ trunk/rostests/apitests/user32/SetActiveWindow.c [iso-8859-1] Sat Sep 24 11:55:19 2011 @@ -9,10 +9,12 @@ #include <wine/test.h> #include <windows.h> #include "helper.h" +#include <undocuser.h> MSG_ENTRY message_cache[100]; HWND hWnd1, hWnd2, hWnd3, hWnd4; +/* FIXME: test for HWND_TOP, etc...*/ static int get_iwnd(HWND hWnd) { if(hWnd == hWnd1) return 1; @@ -24,24 +26,43 @@ LRESULT CALLBACK OwnerTestProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { - if(message < WM_USER && - message != WM_IME_SETCONTEXT && - message != WM_IME_NOTIFY && - message != WM_KEYUP && - message != WM_GETICON && - message != WM_GETTEXT && /* the following messages have to be ignroed because dwm changes the time they are sent */ - message != WM_NCPAINT && - message != WM_ERASEBKGND && - message != WM_PAINT && - message != 0x031f /*WM_DWMNCRENDERINGCHANGED*/) + int iwnd = get_iwnd(hWnd); + + if(message > WM_USER || !iwnd || IsDWmMsg(message) || IseKeyMsg(message)) + return DefWindowProc(hWnd, message, wParam, lParam); + + switch(message) { - int iwnd; - iwnd = get_iwnd(hWnd); - if(iwnd) - record_message(iwnd, message, FALSE, 0,0); + case WM_IME_SETCONTEXT: + case WM_IME_NOTIFY : + case WM_GETICON : + case WM_GETTEXT: + break; + case WM_WINDOWPOSCHANGING: + case WM_WINDOWPOSCHANGED: + { + WINDOWPOS* pwp = (WINDOWPOS*)lParam; + ok(wParam==0,"expected wParam=0\n"); + record_message(iwnd, message, SENT, get_iwnd(pwp->hwndInsertAfter), pwp->flags); + break; + } + default: + record_message(iwnd, message, SENT, 0,0); } - return DefWindowProc(hWnd, message, wParam, lParam); +} + +static void FlushMessages() +{ + MSG msg; + + while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE )) + { + int iwnd = get_iwnd(msg.hwnd); + if(!(msg.message > WM_USER || !iwnd || IsDWmMsg(msg.message) || IseKeyMsg(msg.message))) + record_message(iwnd, msg.message, POST,0,0); + DispatchMessageA( &msg ); + } } static void create_test_windows() @@ -58,17 +79,15 @@ hWnd4 = CreateWindowW(L"ownertest", L"ownertest", WS_OVERLAPPEDWINDOW, 250, 250, 200, 200, hWnd1, NULL, 0, NULL); - - trace("1:%p, 2:%p, 3:%p,4:%p\n", hWnd1, hWnd2, hWnd3, hWnd4); } /* the actual test begins here */ MSG_ENTRY Activate1_chain[]={{4,WM_NCACTIVATE}, {4,WM_ACTIVATE}, - {4,WM_WINDOWPOSCHANGING}, - {2,WM_WINDOWPOSCHANGING}, - {1,WM_WINDOWPOSCHANGING}, + {4,WM_WINDOWPOSCHANGING,SENT,0,SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE}, + {2,WM_WINDOWPOSCHANGING,SENT,4,SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE}, + {1,WM_WINDOWPOSCHANGING,SENT,2,SWP_NOMOVE | SWP_NOSIZE}, {1,WM_NCACTIVATE}, {1,WM_ACTIVATE}, {4,WM_KILLFOCUS}, @@ -77,8 +96,8 @@ MSG_ENTRY Activate2_chain[]={{1,WM_NCACTIVATE}, {1,WM_ACTIVATE}, - {3,WM_WINDOWPOSCHANGING}, - {3,WM_WINDOWPOSCHANGED}, + {3,WM_WINDOWPOSCHANGING,SENT, 0, SWP_NOMOVE | SWP_NOSIZE}, + {3,WM_WINDOWPOSCHANGED ,SENT, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOCLIENTMOVE|SWP_NOCLIENTSIZE}, {3,WM_NCACTIVATE}, {3,WM_ACTIVATE}, {1,WM_KILLFOCUS}, @@ -87,23 +106,23 @@ MSG_ENTRY Activate3_chain[]={{3,WM_NCACTIVATE}, {3,WM_ACTIVATE}, - {2,WM_WINDOWPOSCHANGING}, - {4,WM_WINDOWPOSCHANGING}, - {1,WM_WINDOWPOSCHANGING}, - {2,WM_WINDOWPOSCHANGED}, - {4,WM_WINDOWPOSCHANGED}, - {1,WM_WINDOWPOSCHANGED}, + {2,WM_WINDOWPOSCHANGING, SENT,0, SWP_NOMOVE | SWP_NOSIZE }, + {4,WM_WINDOWPOSCHANGING, SENT,2, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE}, + {1,WM_WINDOWPOSCHANGING, SENT,4, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE}, + {2,WM_WINDOWPOSCHANGED, SENT,0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOCLIENTMOVE |SWP_NOCLIENTSIZE }, + {4,WM_WINDOWPOSCHANGED, SENT,2, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE |SWP_NOCLIENTMOVE|SWP_NOCLIENTSIZE}, + {1,WM_WINDOWPOSCHANGED, SENT,4, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE |SWP_NOCLIENTMOVE|SWP_NOCLIENTSIZE}, {2,WM_NCACTIVATE}, {2,WM_ACTIVATE}, {3,WM_KILLFOCUS}, {2,WM_SETFOCUS}, {0,0}}; -MSG_ENTRY Activate4_chain[]={{2,WM_NCACTIVATE}, +MSG_ENTRY Activate4_chain[]={{2,WM_NCACTIVATE, }, {2,WM_ACTIVATE}, - {2,WM_WINDOWPOSCHANGING}, - {4,WM_WINDOWPOSCHANGING}, - {1,WM_WINDOWPOSCHANGING}, + {2,WM_WINDOWPOSCHANGING, SENT ,0 ,SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE}, + {4,WM_WINDOWPOSCHANGING, SENT, 2, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE} , + {1,WM_WINDOWPOSCHANGING, SENT, 4, SWP_NOMOVE | SWP_NOSIZE}, {1,WM_NCACTIVATE}, {1,WM_ACTIVATE}, {2,WM_KILLFOCUS}, @@ -112,34 +131,32 @@ void Test_SetActiveWindow() { - MSG msg; - SetCursorPos(0,0); create_test_windows(); ShowWindow(hWnd1, SW_SHOW); UpdateWindow(hWnd1); - FLUSH_MESSAGES(msg); + FlushMessages(); EXPECT_NEXT(hWnd4,hWnd2); EXPECT_NEXT(hWnd1,hWnd3); ShowWindow(hWnd2, SW_SHOW); UpdateWindow(hWnd2); - FLUSH_MESSAGES(msg); + FlushMessages(); EXPECT_NEXT(hWnd2,hWnd4); EXPECT_NEXT(hWnd4,hWnd1); ShowWindow(hWnd3, SW_SHOW); UpdateWindow(hWnd3); - FLUSH_MESSAGES(msg); + FlushMessages(); EXPECT_NEXT(hWnd3,hWnd2); EXPECT_NEXT(hWnd2,hWnd4); EXPECT_NEXT(hWnd4,hWnd1); ShowWindow(hWnd4, SW_SHOW); UpdateWindow(hWnd4); - FLUSH_MESSAGES(msg); + FlushMessages(); EXPECT_NEXT(hWnd4,hWnd2); EXPECT_NEXT(hWnd2,hWnd1); EXPECT_NEXT(hWnd1,hWnd3); @@ -148,7 +165,7 @@ empty_message_cache(); SetActiveWindow(hWnd1); - FLUSH_MESSAGES(msg); + FlushMessages(); EXPECT_NEXT(hWnd4,hWnd2); EXPECT_NEXT(hWnd2,hWnd1); EXPECT_NEXT(hWnd1,hWnd3); @@ -156,7 +173,7 @@ COMPARE_CACHE(Activate1_chain); SetActiveWindow(hWnd3); - FLUSH_MESSAGES(msg); + FlushMessages(); EXPECT_NEXT(hWnd3,hWnd4); EXPECT_NEXT(hWnd4,hWnd2); EXPECT_NEXT(hWnd2,hWnd1); @@ -164,7 +181,7 @@ COMPARE_CACHE(Activate2_chain); SetActiveWindow(hWnd2); - FLUSH_MESSAGES(msg); + FlushMessages(); EXPECT_NEXT(hWnd2,hWnd4); EXPECT_NEXT(hWnd4,hWnd1); EXPECT_NEXT(hWnd1,hWnd3); @@ -172,7 +189,7 @@ COMPARE_CACHE(Activate3_chain); SetActiveWindow(hWnd1); - FLUSH_MESSAGES(msg); + FlushMessages(); EXPECT_NEXT(hWnd2,hWnd4); EXPECT_NEXT(hWnd4,hWnd1); EXPECT_NEXT(hWnd1,hWnd3); Modified: trunk/rostests/apitests/user32/TrackMouseEvent.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/user32/TrackMous…
============================================================================== --- trunk/rostests/apitests/user32/TrackMouseEvent.c [iso-8859-1] (original) +++ trunk/rostests/apitests/user32/TrackMouseEvent.c [iso-8859-1] Sat Sep 24 11:55:19 2011 @@ -9,6 +9,7 @@ #include <wine/test.h> #include <windows.h> #include "helper.h" +#include <undocuser.h> HWND hWnd1, hWnd2, hWnd3; HHOOK hMouseHookLL, hMouseHook; @@ -23,21 +24,7 @@ LRESULT CALLBACK TmeTestProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { - if(message < WM_USER && - message != WM_IME_SETCONTEXT && - message != WM_IME_NOTIFY && - message != WM_KEYUP && - message != WM_GETICON && - message != WM_GETTEXT && /* the following messages have to be ignroed because dwm changes the time they are sent */ - message != WM_NCPAINT && - message != WM_ERASEBKGND && - message != WM_PAINT && - message != 0x031f /*WM_DWMNCRENDERINGCHANGED*/) - { - int iwnd = get_iwnd(hWnd); - if(iwnd) - record_message(iwnd, message, FALSE,0,0); - } + int iwnd = get_iwnd(hWnd); if(message == WM_PAINT) { @@ -46,21 +33,52 @@ Rectangle(ps.hdc, ps.rcPaint.left, ps.rcPaint.top, ps.rcPaint.right, ps.rcPaint.bottom); EndPaint(hWnd, &ps); } - + + if(message > WM_USER || !iwnd || IsDWmMsg(message) || IseKeyMsg(message)) + return DefWindowProc(hWnd, message, wParam, lParam); + + switch(message) + { + case WM_IME_SETCONTEXT: + case WM_IME_NOTIFY : + case WM_GETICON : + case WM_GETTEXT: + break; + default: + record_message(iwnd, message, SENT, 0,0); + } return DefWindowProc(hWnd, message, wParam, lParam); } static LRESULT CALLBACK MouseLLHookProc(int nCode, WPARAM wParam, LPARAM lParam) { - record_message(0, WH_MOUSE_LL, TRUE, wParam, 0); + record_message(0, WH_MOUSE_LL, HOOK, wParam, 0); return CallNextHookEx(hMouseHookLL, nCode, wParam, lParam); } static LRESULT CALLBACK MouseHookProc(int nCode, WPARAM wParam, LPARAM lParam) { MOUSEHOOKSTRUCT *hs = (MOUSEHOOKSTRUCT*) lParam; - record_message(get_iwnd(hs->hwnd), WH_MOUSE, TRUE, wParam, hs->wHitTestCode); + record_message(get_iwnd(hs->hwnd), WH_MOUSE, HOOK, wParam, hs->wHitTestCode); return CallNextHookEx(hMouseHook, nCode, wParam, lParam); +} + +static void FlushMessages() +{ + MSG msg; + + while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE )) + { + int iwnd = get_iwnd(msg.hwnd); + if(iwnd) + { + if(msg.message == WM_SYSTIMER) + record_message(iwnd, msg.message, POST,msg.wParam,0); + else if(!(msg.message > WM_USER || !iwnd || IsDWmMsg(msg.message) || IseKeyMsg(msg.message))) + record_message(iwnd, msg.message, POST,0,0); + } + DispatchMessageA( &msg ); + } } static void create_test_windows() @@ -114,73 +132,63 @@ return tme.dwFlags; } -#define FLUSH_MESSAGES(msg) while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessageA( &msg ); #define EXPECT_TME_FLAGS(hWnd, expected) \ { DWORD flags = TmeQuery(hWnd); \ ok(flags == (expected),"wrong tme flags. expected %li, and got %li\n", (DWORD)(expected), flags); \ } -#define EXPECT_QUEUE_STATUS(expected, notexpected) \ - { \ - DWORD status = HIWORD(GetQueueStatus(QS_ALLEVENTS)); \ - ok(((status) & (expected))== (expected),"wrong queue status. expected %li, and got %li\n", (DWORD)(expected), status); \ - if(notexpected) \ - ok((status & (notexpected))!=(notexpected), "wrong queue status. got non expected %li\n", (DWORD)(notexpected)); \ - } - MSG_ENTRY empty_chain[]= {{0,0}}; /* the mouse moves over hwnd2 */ MSG_ENTRY mousemove2_chain[]={{2, WM_NCHITTEST}, - {2, WH_MOUSE,1, WM_MOUSEMOVE, HTCLIENT}, + {2, WH_MOUSE,HOOK, WM_MOUSEMOVE, HTCLIENT}, {2, WM_SETCURSOR}, {1, WM_SETCURSOR}, - {2, WM_MOUSEMOVE}, + {2, WM_MOUSEMOVE, POST}, {0,0}}; /* the mouse hovers hwnd2 */ MSG_ENTRY mousehover2_chain[]={{2, WM_NCHITTEST}, - {2, WH_MOUSE,1, WM_MOUSEMOVE, HTCLIENT}, + {2, WH_MOUSE,HOOK, WM_MOUSEMOVE, HTCLIENT}, {2, WM_SETCURSOR}, {1, WM_SETCURSOR}, - {2, WM_MOUSEMOVE}, - {2, WM_MOUSEHOVER}, + {2, WM_MOUSEMOVE, POST}, + {2, WM_SYSTIMER, POST, ID_TME_TIMER}, + {2, WM_MOUSEHOVER, POST}, {0,0}}; /* the mouse leaves hwnd2 and moves to hwnd1 */ MSG_ENTRY mouseleave2to1_chain[]={{1, WM_NCHITTEST}, - {1, WH_MOUSE,1, WM_MOUSEMOVE, HTCLIENT}, + {1, WH_MOUSE,HOOK, WM_MOUSEMOVE, HTCLIENT}, {1, WM_SETCURSOR}, - {1, WM_MOUSEMOVE}, - {2, WM_MOUSELEAVE}, + {1, WM_MOUSEMOVE, POST}, + {2, WM_MOUSELEAVE, POST}, {0,0}}; /* the mouse leaves hwnd2 and moves to hwnd3 */ MSG_ENTRY mouseleave2to3_chain[]={{3, WM_NCHITTEST}, - {3, WH_MOUSE,1, WM_MOUSEMOVE, HTCLIENT}, + {3, WH_MOUSE,HOOK, WM_MOUSEMOVE, HTCLIENT}, {3, WM_SETCURSOR}, {1, WM_SETCURSOR}, - {3, WM_MOUSEMOVE}, - {2, WM_MOUSELEAVE}, + {3, WM_MOUSEMOVE, POST}, + {2, WM_MOUSELEAVE, POST}, {0,0}}; void Test_TrackMouseEvent() { - MSG msg; - SetCursorPos(0,0); create_test_windows(); - FLUSH_MESSAGES(msg); + FlushMessages(); empty_message_cache(); /* the mouse moves over hwnd2 */ SetCursorPos(220,220); - FLUSH_MESSAGES(msg); + FlushMessages(); COMPARE_CACHE(mousemove2_chain); EXPECT_TME_FLAGS(hWnd2, 0); TmeStartTracking(hWnd2, TME_HOVER|TME_LEAVE); EXPECT_TME_FLAGS(hWnd2, TME_HOVER|TME_LEAVE); - FLUSH_MESSAGES(msg); + FlushMessages(); COMPARE_CACHE(empty_chain); /* the mouse hovers hwnd2 */ @@ -188,7 +196,7 @@ Sleep(100); EXPECT_QUEUE_STATUS(QS_TIMER|QS_MOUSEMOVE, 0); EXPECT_TME_FLAGS(hWnd2, TME_HOVER|TME_LEAVE); - FLUSH_MESSAGES(msg); + FlushMessages(); EXPECT_TME_FLAGS(hWnd2, TME_LEAVE); COMPARE_CACHE(mousehover2_chain); @@ -196,17 +204,17 @@ SetCursorPos(150,150); EXPECT_QUEUE_STATUS(QS_MOUSEMOVE,QS_TIMER ); EXPECT_TME_FLAGS(hWnd2, TME_LEAVE); - FLUSH_MESSAGES(msg); + FlushMessages(); EXPECT_TME_FLAGS(hWnd2, 0); COMPARE_CACHE(mouseleave2to1_chain); - FLUSH_MESSAGES(msg); + FlushMessages(); COMPARE_CACHE(empty_chain); /* the mouse moves over hwnd2 */ SetCursorPos(220,220); EXPECT_QUEUE_STATUS(QS_MOUSEMOVE, QS_TIMER); - FLUSH_MESSAGES(msg); + FlushMessages(); COMPARE_CACHE(mousemove2_chain); EXPECT_TME_FLAGS(hWnd2, 0); COMPARE_CACHE(empty_chain); @@ -215,31 +223,31 @@ TmeStartTracking(hWnd2, TME_HOVER|TME_LEAVE); TmeStartTracking(hWnd2, TME_HOVER|TME_LEAVE); EXPECT_QUEUE_STATUS(0, QS_TIMER|QS_MOUSEMOVE); - FLUSH_MESSAGES(msg); - COMPARE_CACHE(empty_chain); - EXPECT_TME_FLAGS(hWnd2, TME_HOVER|TME_LEAVE); - - FLUSH_MESSAGES(msg); + FlushMessages(); + COMPARE_CACHE(empty_chain); + EXPECT_TME_FLAGS(hWnd2, TME_HOVER|TME_LEAVE); + + FlushMessages(); COMPARE_CACHE(empty_chain); /* the mouse moves from hwnd2 to the intersection of hwnd2 and hwnd3 */ SetCursorPos(300,300); EXPECT_QUEUE_STATUS(QS_MOUSEMOVE, QS_TIMER); - FLUSH_MESSAGES(msg); + FlushMessages(); EXPECT_TME_FLAGS(hWnd2, TME_HOVER|TME_LEAVE); COMPARE_CACHE(mousemove2_chain); - FLUSH_MESSAGES(msg); + FlushMessages(); COMPARE_CACHE(empty_chain); /* the mouse moves from hwnd2 to hwnd3 */ SetCursorPos(400,400); EXPECT_QUEUE_STATUS(QS_MOUSEMOVE, QS_TIMER); - FLUSH_MESSAGES(msg); + FlushMessages(); EXPECT_TME_FLAGS(hWnd2, 0); COMPARE_CACHE(mouseleave2to3_chain); - FLUSH_MESSAGES(msg); + FlushMessages(); COMPARE_CACHE(empty_chain); } Modified: trunk/rostests/apitests/user32/helper.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/user32/helper.c?…
============================================================================== --- trunk/rostests/apitests/user32/helper.c [iso-8859-1] (original) +++ trunk/rostests/apitests/user32/helper.c [iso-8859-1] Sat Sep 24 11:55:19 2011 @@ -9,7 +9,9 @@ #include <wine/test.h> #include <windows.h> #include "helper.h" - +#include <undocuser.h> + +MSG_ENTRY last_post_message; MSG_ENTRY message_cache[100]; static int message_cache_size = 0; @@ -38,6 +40,7 @@ case WM_NCHITTEST: return "WM_NCHITTEST"; case WM_SETCURSOR: return "WM_SETCURSOR"; case WM_MOUSEMOVE: return "WM_MOUSEMOVE"; + case WM_SYSTIMER: return "WM_SYSTIMER"; default: return NULL; } } @@ -56,6 +59,7 @@ void empty_message_cache() { + memset(&last_post_message, 0, sizeof(last_post_message)); memset(message_cache, 0, sizeof(message_cache)); message_cache_size = 0; } @@ -68,8 +72,29 @@ } else { - char* msgName = msg->hook ? get_hook_name(msg->msg) : get_msg_name(msg->msg); - char* msgType = msg->hook ? "hook" : "msg"; + char* msgName; + char* msgType; + + switch (msg->type) + { + case POST: + msgName = get_msg_name(msg->msg); + msgType = "post msg"; + break; + case SENT: + msgName = get_msg_name(msg->msg); + msgType = "sent msg"; + break; + case HOOK: + msgName = get_hook_name(msg->msg); + msgType = "hook"; + break; + case EVENT: + msgName = NULL; + msgType = "event"; + break; + } + if(msgName) sprintf(buffer, "hwnd%d %s %s %d %d", msg->iwnd, msgType, msgName, msg->param1, msg->param2); else @@ -126,18 +151,39 @@ empty_message_cache(); } -void record_message(int iwnd, UINT message, BOOL hook, int param1,int param2) +void record_message(int iwnd, UINT message, MSG_TYPE type, int param1,int param2) { if(message_cache_size>=100) { + return; + } + + /* do not report a post message a second time */ + if(type == SENT && + last_post_message.iwnd == iwnd && + last_post_message.msg == message && + last_post_message.param1 == param1 && + last_post_message.param2 == param2) + { + memset(&last_post_message, 0, sizeof(last_post_message)); return; } message_cache[message_cache_size].iwnd = iwnd; message_cache[message_cache_size].msg = message; - message_cache[message_cache_size].hook = hook; + message_cache[message_cache_size].type = type; message_cache[message_cache_size].param1 = param1; message_cache[message_cache_size].param2 = param2; + + if(message_cache[message_cache_size].type == POST) + { + last_post_message = message_cache[message_cache_size]; + } + else + { + memset(&last_post_message, 0, sizeof(last_post_message)); + } + message_cache_size++; } Modified: trunk/rostests/apitests/user32/helper.h URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/user32/helper.h?…
============================================================================== --- trunk/rostests/apitests/user32/helper.h [iso-8859-1] (original) +++ trunk/rostests/apitests/user32/helper.h [iso-8859-1] Sat Sep 24 11:55:19 2011 @@ -1,24 +1,49 @@ +typedef enum _MSG_TYPE +{ + SENT, + POST, + HOOK, + EVENT +} MSG_TYPE; typedef struct _MSG_ENTRY { int iwnd; UINT msg; - BOOL hook; + MSG_TYPE type; int param1; int param2; } MSG_ENTRY; -void record_message(int iwnd, UINT message, BOOL hook, int param1,int param2); +void record_message(int iwnd, UINT message, MSG_TYPE type, int param1,int param2); void compare_cache(const char* file, int line, MSG_ENTRY *msg_chain); void trace_cache(const char* file, int line); void empty_message_cache(); ATOM RegisterSimpleClass(WNDPROC lpfnWndProc, LPCWSTR lpszClassName); +/* filter messages that are affected by dwm */ +static _inline BOOL IsDWmMsg(UINT msg) +{ + switch(msg) + { + case WM_NCPAINT: + case WM_ERASEBKGND: + case WM_PAINT: + case 0x031f: /*WM_DWMNCRENDERINGCHANGED*/ + return TRUE; + } + return FALSE; +} + +static _inline BOOL IseKeyMsg(UINT msg) +{ + return (msg == WM_KEYUP || msg == WM_KEYDOWN); +} + #define COMPARE_CACHE(...) compare_cache(__FILE__, __LINE__, ##__VA_ARGS__) #define TRACE_CACHE() trace_cache(__FILE__, __LINE__) -#define FLUSH_MESSAGES(msg) while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessageA( &msg ); #define EXPECT_NEXT(hWnd1, hWnd2) ok(GetWindow(hWnd1,GW_HWNDNEXT) == hWnd2, "Expected %p after %p, not %p\n",hWnd2,hWnd1,GetWindow(hWnd1,GW_HWNDNEXT) ) #define EXPECT_ACTIVE(hwnd) ok(GetActiveWindow() == hwnd, "Expected %p to be the active window, not %p\n",hwnd,GetActiveWindow())
13 years, 3 months
1
0
0
0
[gadamopoulos] 53829: [undocuser.h] - Add a definition for TrackMouseEvent timer
by gadamopoulos@svn.reactos.org
Author: gadamopoulos Date: Sat Sep 24 11:51:45 2011 New Revision: 53829 URL:
http://svn.reactos.org/svn/reactos?rev=53829&view=rev
Log: [undocuser.h] - Add a definition for TrackMouseEvent timer Modified: trunk/reactos/include/reactos/undocuser.h Modified: trunk/reactos/include/reactos/undocuser.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/undocuser.…
============================================================================== --- trunk/reactos/include/reactos/undocuser.h [iso-8859-1] (original) +++ trunk/reactos/include/reactos/undocuser.h [iso-8859-1] Sat Sep 24 11:51:45 2011 @@ -57,6 +57,7 @@ /* Caret timer ID */ #define IDCARETTIMER (0xffff) +#define ID_TME_TIMER (0xFFFA) /* SetWindowPos undocumented flags */ #define SWP_NOCLIENTSIZE 0x0800
13 years, 3 months
1
0
0
0
[khornicek] 53828: fix the cmake build?
by khornicek@svn.reactos.org
Author: khornicek Date: Sat Sep 24 11:47:17 2011 New Revision: 53828 URL:
http://svn.reactos.org/svn/reactos?rev=53828&view=rev
Log: fix the cmake build? Modified: trunk/reactos/base/system/diskpart/CMakeLists.txt Modified: trunk/reactos/base/system/diskpart/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/diskpart/CMake…
============================================================================== --- trunk/reactos/base/system/diskpart/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/base/system/diskpart/CMakeLists.txt [iso-8859-1] Sat Sep 24 11:47:17 2011 @@ -39,9 +39,9 @@ setid.c shrink.c uniqueid.c - resource.rc) + diskpart.rc) -set_module_type(calc win32cui) +set_module_type(diskpart win32cui) add_importlibs(diskpart user32 msvcrt kernel32) if(MSVC) add_importlibs(diskpart ntdll)
13 years, 3 months
1
0
0
0
[tkreuzer] 53827: [NTOSKRNL/AMD64] Cleanup amd64 specific code
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Sat Sep 24 11:46:20 2011 New Revision: 53827 URL:
http://svn.reactos.org/svn/reactos?rev=53827&view=rev
Log: [NTOSKRNL/AMD64] Cleanup amd64 specific code Modified: trunk/reactos/ntoskrnl/mm/amd64/init.c Modified: trunk/reactos/ntoskrnl/mm/amd64/init.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/amd64/init.c?r…
============================================================================== --- trunk/reactos/ntoskrnl/mm/amd64/init.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/amd64/init.c [iso-8859-1] Sat Sep 24 11:46:20 2011 @@ -20,10 +20,6 @@ extern PMMPTE MmDebugPte; #endif -VOID -NTAPI -HalInitializeBios(ULONG Unknown, PLOADER_PARAMETER_BLOCK LoaderBlock); - /* GLOBALS *****************************************************************/ /* Template PTE and PDE for a kernel page */ @@ -39,50 +35,16 @@ PTE_PROTOTYPE | (MI_PTE_LOOKUP_NEEDED << PAGE_SHIFT)}}; /* Sizes */ -///SIZE_T MmSessionSize = MI_SESSION_SIZE; -extern SIZE_T MmSessionViewSize; -extern SIZE_T MmSessionPoolSize; -extern SIZE_T MmSessionImageSize; -extern SIZE_T MmSystemViewSize; SIZE_T MiNonPagedSystemSize; /* Address ranges */ -//ULONG64 MmUserProbeAddress = 0x7FFFFFF0000ULL; -//PVOID MmHighestUserAddress = (PVOID)0x7FFFFFEFFFFULL; -//PVOID MmSystemRangeStart = (PVOID)0xFFFF080000000000ULL; -PVOID MmSessionBase; // FFFFF90000000000 = MiSessionPoolStart -PVOID MiSessionPoolStart; // FFFFF90000000000 = MiSessionPoolEnd - MmSessionPoolSize -PVOID MiSessionPoolEnd; // = MiSessionViewStart -PVOID MiSessionViewStart; // = MiSessionViewEnd - MmSessionViewSize -PVOID MiSessionViewEnd; // FFFFF97FFF000000 -PVOID MiSessionImageStart; // ?FFFFF97FFF000000 = MiSessionImageEnd - MmSessionImageSize -PVOID MiSessionImageEnd; // FFFFF98000000000 = MiSessionSpaceEnd -PVOID MiSessionSpaceEnd = MI_SESSION_SPACE_END; // FFFFF98000000000 -PVOID MmSystemCacheStart; // FFFFF98000000000 -PVOID MmSystemCacheEnd; // FFFFFA8000000000 -/// PVOID MmPagedPoolStart = MI_PAGED_POOL_START; // FFFFFA8000000000 -PVOID MmPagedPoolEnd; // FFFFFAA000000000 -PVOID MiSystemViewStart; -PVOID MmNonPagedSystemStart; // FFFFFAA000000000 -PVOID MmNonPagedPoolStart; -PVOID MmNonPagedPoolExpansionStart; -///PVOID MmNonPagedPoolEnd = MI_NONPAGED_POOL_END; // 0xFFFFFAE000000000 -PVOID MmHyperSpaceEnd = (PVOID)HYPER_SPACE_END; - -MMSUPPORT MmSystemCacheWs; +PVOID MiSessionViewEnd; ULONG64 MxPfnSizeInBytes; - -PMEMORY_ALLOCATION_DESCRIPTOR MxFreeDescriptor; -MEMORY_ALLOCATION_DESCRIPTOR MxOldFreeDescriptor; -PFN_NUMBER MiSystemPages = 0; BOOLEAN MiIncludeType[LoaderMaximum]; - PFN_NUMBER MxFreePageBase; ULONG64 MxFreePageCount = 0; -extern PFN_NUMBER MmSystemPageDirectory[PD_COUNT]; - BOOLEAN MiPfnsInitialized = FALSE; /* FUNCTIONS *****************************************************************/ @@ -92,6 +54,7 @@ INIT_FUNCTION MiInitializeSessionSpaceLayout() { + MmSessionSize = MI_SESSION_SIZE; MmSessionViewSize = MI_SESSION_VIEW_SIZE; MmSessionPoolSize = MI_SESSION_POOL_SIZE; MmSessionImageSize = MI_SESSION_IMAGE_SIZE; @@ -128,188 +91,92 @@ ASSERT(MmSessionBase <= MiSessionPoolStart); } -ULONG -NoDbgPrint(const char *Format, ...) -{ - return 0; -} - -PFN_NUMBER -NTAPI -MiEarlyAllocPage() -{ - PFN_NUMBER Pfn; - - if (MiPfnsInitialized) - { - return MmAllocPage(MC_SYSTEM); - } - - /* Make sure we have enough pages */ - if (!MxFreePageCount) - { - /* Crash the system */ - KeBugCheckEx(INSTALL_MORE_MEMORY, - MmNumberOfPhysicalPages, - MxFreeDescriptor->PageCount, - MxOldFreeDescriptor.PageCount, - 1); - } - - /* Use our lowest usable free pages */ - Pfn = MxFreePageBase; - MxFreePageBase++; - MxFreePageCount--; - return Pfn; -} - -PMMPTE -NTAPI -MxGetPte(PVOID Address) -{ - PMMPTE Pte; - MMPTE TmplPte; - - /* Setup template pte */ - TmplPte.u.Long = 0; - TmplPte.u.Flush.Valid = 1; - TmplPte.u.Flush.Write = 1; - - /* Get a pointer to the PXE */ - Pte = MiAddressToPxe(Address); - if (!Pte->u.Hard.Valid) - { - /* It's not valid, map it! */ - TmplPte.u.Hard.PageFrameNumber = MiEarlyAllocPage(); - *Pte = TmplPte; - - /* Zero the page */ - RtlZeroMemory(MiPteToAddress(Pte), PAGE_SIZE); - } - - /* Get a pointer to the PPE */ - Pte = MiAddressToPpe(Address); - if (!Pte->u.Hard.Valid) - { - /* It's not valid, map it! */ - TmplPte.u.Hard.PageFrameNumber = MiEarlyAllocPage(); - *Pte = TmplPte; - - /* Zero the page */ - RtlZeroMemory(MiPteToAddress(Pte), PAGE_SIZE); - } - - /* Get a pointer to the PDE */ - Pte = MiAddressToPde(Address); - if (!Pte->u.Hard.Valid) - { - /* It's not valid, map it! */ - TmplPte.u.Hard.PageFrameNumber = MiEarlyAllocPage(); - *Pte = TmplPte; - - /* Zero the page */ - RtlZeroMemory(MiPteToAddress(Pte), PAGE_SIZE); - } - - /* Get a pointer to the PTE */ - Pte = MiAddressToPte(Address); - return Pte; -} - -VOID -NTAPI -MxMapPage(PVOID Address) -{ - MMPTE TmplPte, *Pte; - - /* Setup template pte */ - TmplPte.u.Long = 0; - TmplPte.u.Flush.Valid = 1; - TmplPte.u.Flush.Write = 1; - TmplPte.u.Hard.PageFrameNumber = MiEarlyAllocPage(); - - /* Get the PTE for that page */ - Pte = MxGetPte(Address); - ASSERT(Pte->u.Hard.Valid == 0); - - /* Map a physical page */ - *Pte = TmplPte; -} - -VOID -MxMapPageRange(PVOID Address, ULONG64 PageCount) -{ - while (PageCount--) - { - /* Map the page */ - MxMapPage(Address); - - /* Goto next page */ - Address = (PVOID)((ULONG64)Address + PAGE_SIZE); - } -} - -VOID -NTAPI -MiPreparePfnDatabse(IN PLOADER_PARAMETER_BLOCK LoaderBlock) -{ - PMEMORY_ALLOCATION_DESCRIPTOR Descriptor; - PLIST_ENTRY ListEntry; - PUCHAR Page, FirstPage; - SIZE_T Size; - - /* Calculate the size of the PFN database and convert to pages */ - MxPfnSizeInBytes = ROUND_TO_PAGES((MmHighestPhysicalPage + 1) * sizeof(MMPFN)); - MxPfnAllocation = MxPfnSizeInBytes >> PAGE_SHIFT; - - /* Simply start at hardcoded address */ - MmPfnDatabase = MI_PFN_DATABASE; - - /* Loop the memory descriptors */ - for (ListEntry = LoaderBlock->MemoryDescriptorListHead.Flink; - ListEntry != &LoaderBlock->MemoryDescriptorListHead; - ListEntry = ListEntry->Flink) - { - /* Get the memory descriptor */ - Descriptor = CONTAINING_RECORD(ListEntry, - MEMORY_ALLOCATION_DESCRIPTOR, - ListEntry); - - /* Skip pages that are not part of the PFN database */ - if (MiIncludeType[Descriptor->MemoryType]) +VOID +NTAPI +MiMapPPEs( + PVOID StartAddress, + PVOID EndAddress) +{ + PMMPDE PointerPpe; + MMPDE TmplPde = ValidKernelPde; + + /* Loop the PPEs */ + for (PointerPpe = MiAddressToPpe(StartAddress); + PointerPpe <= MiAddressToPpe(EndAddress); + PointerPpe++) + { + /* Check if its already mapped */ + if (!PointerPpe->u.Hard.Valid) { - /* Get the base and size of this pfn database entry */ - FirstPage = PAGE_ALIGN(&MmPfnDatabase[Descriptor->BasePage]); - Size = ROUND_TO_PAGES(Descriptor->PageCount * sizeof(MMPFN)); - - /* Loop the pages of this Pfn database entry */ - for (Page = FirstPage; Page < FirstPage + Size; Page += PAGE_SIZE) - { - /* Is the page already mapped? */ - if (!MmIsAddressValid(Page)) - { - /* It's not, map it now */ - MxMapPage(Page); - RtlZeroMemory(Page, PAGE_SIZE); - } - } - - /* Zero out the pages */ - RtlZeroMemory(FirstPage, Size); + /* No, map it! */ + TmplPde.u.Hard.PageFrameNumber = MxGetNextPage(1); + *PointerPpe = TmplPde; + + /* Zero out the page table */ + RtlZeroMemory(MiPteToAddress(PointerPpe), PAGE_SIZE); } } } - -VOID +VOID +NTAPI +MiMapPDEs( + PVOID StartAddress, + PVOID EndAddress) +{ + PMMPDE PointerPde; + MMPDE TmplPde = ValidKernelPde; + + /* Loop the PDEs */ + for (PointerPde = MiAddressToPde(StartAddress); + PointerPde <= MiAddressToPde(EndAddress); + PointerPde++) + { + /* Check if its already mapped */ + if (!PointerPde->u.Hard.Valid) + { + /* No, map it! */ + TmplPde.u.Hard.PageFrameNumber = MxGetNextPage(1); + *PointerPde = TmplPde; + + /* Zero out the page table */ + RtlZeroMemory(MiPteToAddress(PointerPde), PAGE_SIZE); + } + } +} + +VOID +NTAPI +MiMapPTEs( + PVOID StartAddress, + PVOID EndAddress) +{ + PMMPTE PointerPte; + MMPTE TmplPte = ValidKernelPte; + + /* Loop the PTEs */ + for (PointerPte = MiAddressToPte(StartAddress); + PointerPte <= MiAddressToPte(EndAddress); + PointerPte++) + { + /* Check if its already mapped */ + if (!PointerPte->u.Hard.Valid) + { + /* No, map it! */ + TmplPte.u.Hard.PageFrameNumber = MxGetNextPage(1); + *PointerPte = TmplPte; + } + } +} + +VOID +NTAPI +INIT_FUNCTION MiInitializePageTable() { ULONG64 PxePhysicalAddress; - MMPTE TmplPte, *Pte; + MMPTE TmplPte, *PointerPxe; PFN_NUMBER PxePfn; - - /* HACK: don't use freeldr debug print anymore */ - //FrLdrDbgPrint = NoDbgPrint; /* Get current directory base */ PxePfn = ((PMMPTE)PXE_SELFMAP)->u.Hard.PageFrameNumber; @@ -327,12 +194,12 @@ __writemsr(X86_MSR_EFER, __readmsr(X86_MSR_EFER) | EFER_NXE); /* Loop the user mode PXEs */ - for (Pte = MiAddressToPxe(0); - Pte <= MiAddressToPxe(MmHighestUserAddress); - Pte++) + for (PointerPxe = MiAddressToPxe(0); + PointerPxe <= MiAddressToPxe(MmHighestUserAddress); + PointerPxe++) { /* Zero the PXE, clear all mappings */ - Pte->u.Long = 0; + PointerPxe->u.Long = 0; } /* Flush the TLB */ @@ -348,40 +215,44 @@ * skip page tables and hyperspace */ /* Loop the PXEs */ - for (Pte = MiAddressToPxe((PVOID)(HYPER_SPACE_END + 1)); - Pte <= MiAddressToPxe(MI_HIGHEST_SYSTEM_ADDRESS); - Pte++) + for (PointerPxe = MiAddressToPxe((PVOID)(HYPER_SPACE_END + 1)); + PointerPxe <= MiAddressToPxe(MI_HIGHEST_SYSTEM_ADDRESS); + PointerPxe++) { /* Is the PXE already valid? */ - if (!Pte->u.Hard.Valid) + if (!PointerPxe->u.Hard.Valid) { /* It's not Initialize it */ - TmplPte.u.Flush.PageFrameNumber = MiEarlyAllocPage(0); - *Pte = TmplPte; + TmplPte.u.Flush.PageFrameNumber = MxGetNextPage(1); + *PointerPxe = TmplPte; /* Zero the page. The PXE is the PTE for the PDPT. */ - RtlZeroMemory(MiPteToAddress(Pte), PAGE_SIZE); + RtlZeroMemory(MiPteToAddress(PointerPxe), PAGE_SIZE); } } + /* Setup the mapping PPEs and PDEs */ + MiMapPPEs((PVOID)MI_MAPPING_RANGE_START, (PVOID)MI_MAPPING_RANGE_END); + MiMapPDEs((PVOID)MI_MAPPING_RANGE_START, (PVOID)MI_MAPPING_RANGE_END); + /* Setup the mapping PTEs */ - MmFirstReservedMappingPte = MxGetPte((PVOID)MI_MAPPING_RANGE_START); + MmFirstReservedMappingPte = MiAddressToPte((PVOID)MI_MAPPING_RANGE_START); + MmLastReservedMappingPte = MiAddressToPte((PVOID)MI_MAPPING_RANGE_END); MmFirstReservedMappingPte->u.Hard.PageFrameNumber = MI_HYPERSPACE_PTES; - MmLastReservedMappingPte = MiAddressToPte((PVOID)MI_MAPPING_RANGE_END); #ifdef _WINKD_ /* Setup debug mapping PTE */ - MmDebugPte = MxGetPte(MI_DEBUG_MAPPING); + MiMapPPEs((PVOID)MI_DEBUG_MAPPING, (PVOID)MI_DEBUG_MAPPING); + MiMapPDEs((PVOID)MI_DEBUG_MAPPING, (PVOID)MI_DEBUG_MAPPING); + MmDebugPte = MiAddressToPte((PVOID)MI_DEBUG_MAPPING); #endif } VOID NTAPI +INIT_FUNCTION MiBuildNonPagedPool(VOID) { - PMMPTE Pte; - PFN_COUNT PageCount; - /* Check if this is a machine with less than 256MB of RAM, and no overide */ if ((MmNumberOfPhysicalPages <= MI_MIN_PAGES_FOR_NONPAGED_POOL_TUNING) && !(MmSizeOfNonPagedPoolInBytes)) @@ -459,18 +330,12 @@ MmSizeOfNonPagedPoolInBytes; ASSERT(IS_PAGE_ALIGNED(MmNonPagedPoolExpansionStart)); - /* Map the nonpaged pool */ - PageCount = (PFN_COUNT)((MmSizeOfNonPagedPoolInBytes + PAGE_SIZE - 1) / PAGE_SIZE); - MxMapPageRange(MmNonPagedPoolStart, PageCount); - - /* Loop the non paged pool extension PTEs */ - for (Pte = MiAddressToPte(MmNonPagedPoolExpansionStart); - Pte <= MiAddressToPte(MmNonPagedPoolEnd); - Pte++) - { - /* Create PXE, PPE, PDE and zero the PTE */ - MxGetPte(MiPteToAddress(Pte))->u.Long = 0; - } + /* Map PPEs and PDEs for non paged pool (including expansion) */ + MiMapPPEs(MmNonPagedPoolStart, MmNonPagedPoolEnd); + MiMapPDEs(MmNonPagedPoolStart, MmNonPagedPoolEnd); + + /* Map the nonpaged pool PTEs (without expansion) */ + MiMapPTEs(MmNonPagedPoolStart, (PUCHAR)MmNonPagedPoolExpansionStart - 1); /* Initialize the ARM3 nonpaged pool */ MiInitializeNonPagedPool(); @@ -481,9 +346,10 @@ VOID NTAPI +INIT_FUNCTION MiBuildSystemPteSpace() { - PMMPTE Pte, StartPte, EndPte; + PMMPTE PointerPte; /* Use the default numer of system PTEs */ MmNumberOfSystemPtes = MI_NUMBER_SYSTEM_PTES; @@ -507,20 +373,13 @@ ASSERT(MmNumberOfSystemPtes > 1000); } - /* Set the range of system PTEs */ - StartPte = MiAddressToPte(MI_SYSTEM_PTE_START); - EndPte = StartPte + MmNumberOfSystemPtes - 1; - - /* Loop the system PTEs */ - for (Pte = StartPte; Pte <= EndPte; Pte++) - { - /* Create PXE, PPE, PDE and zero the PTE */ - MxGetPte(MiPteToAddress(Pte))->u.Long = 0; - } + /* Map the PDEs and PPEs for the system PTEs */ + MiMapPPEs(MI_SYSTEM_PTE_START, MI_SYSTEM_PTE_END); + MiMapPDEs(MI_SYSTEM_PTE_START, MI_SYSTEM_PTE_END); /* Create the system PTE space */ - Pte = MiAddressToPte(MI_SYSTEM_PTE_START); - MiInitializeSystemPtes(Pte, MmNumberOfSystemPtes, SystemPteSpace); + PointerPte = MiAddressToPte(MI_SYSTEM_PTE_START); + MiInitializeSystemPtes(PointerPte, MmNumberOfSystemPtes, SystemPteSpace); /* Reserve system PTEs for zeroing PTEs and clear them */ MiFirstReservedZeroingPte = MiReserveSystemPtes(MI_ZERO_PTES, SystemPteSpace); @@ -530,200 +389,19 @@ MiFirstReservedZeroingPte->u.Hard.PageFrameNumber = MI_ZERO_PTES - 1; } -VOID -NTAPI -MiBuildPagedPool_x(VOID) -{ - PMMPTE Pte; - MMPTE TmplPte; - ULONG Size, BitMapSize; - - /* Default size for paged pool is 4 times non paged pool */ - MmSizeOfPagedPoolInBytes = 4 * MmMaximumNonPagedPoolInBytes; - - /* Make sure it doesn't overflow */ - if (MmSizeOfPagedPoolInBytes > ((ULONG64)MmNonPagedSystemStart - - (ULONG64)MmPagedPoolStart)) - { - MmSizeOfPagedPoolInBytes = (ULONG64)MmNonPagedSystemStart - - (ULONG64)MmPagedPoolStart; - } - - /* Make sure paged pool is big enough */ - if (MmSizeOfPagedPoolInBytes < MI_MIN_INIT_PAGED_POOLSIZE) - { - MmSizeOfPagedPoolInBytes = MI_MIN_INIT_PAGED_POOLSIZE; - } - - /* Align down to a PDE boundary */ - MmSizeOfPagedPoolInBytes = ROUND_DOWN(MmSizeOfPagedPoolInBytes, - 512 * PAGE_SIZE); - MmSizeOfPagedPoolInPages = MmSizeOfPagedPoolInBytes >> PAGE_SHIFT; - - /* This is where paged pool ends */ - MmPagedPoolEnd = (PCHAR)MmPagedPoolStart + MmSizeOfPagedPoolInBytes - 1; - - /* Sanity check */ - ASSERT(MmPagedPoolEnd < MmNonPagedSystemStart); - - /* setup a template PTE */ - TmplPte.u.Long = 0; - TmplPte.u.Flush.Valid = 1; - TmplPte.u.Flush.Write = 1; - - /* Make sure the PXE is valid */ - Pte = MiAddressToPxe(MmPagedPoolStart); - if (!Pte->u.Flush.Valid) - { - /* Map it! */ - TmplPte.u.Flush.PageFrameNumber = MmAllocPage(MC_SYSTEM); - *Pte = TmplPte; - } - - /* Map all page directories (max 128) */ - for (Pte = MiAddressToPpe(MmPagedPoolStart); - Pte <= MiAddressToPpe(MmPagedPoolEnd); - Pte++) - { - if (!Pte->u.Flush.Valid) - { - /* Map it! */ - TmplPte.u.Flush.PageFrameNumber = MiEarlyAllocPage(); - *Pte = TmplPte; - } - } - - /* Create and map the first PTE for paged pool */ - Pte = MxGetPte(MmPagedPoolStart); - TmplPte.u.Flush.PageFrameNumber = MiEarlyAllocPage(); - *Pte = TmplPte; - - /* Save the first and last paged pool PTE */ - MmPagedPoolInfo.FirstPteForPagedPool = MiAddressToPte(MmPagedPoolStart); - MmPagedPoolInfo.LastPteForPagedPool = MiAddressToPte(MmPagedPoolEnd); - MmPagedPoolInfo.NextPdeForPagedPoolExpansion = MiAddressToPde(MmPagedPoolStart) + 1; - - // We keep track of each page via a bit, so check how big the bitmap will - // have to be (make sure to align our page count such that it fits nicely - // into a 4-byte aligned bitmap. - - /* The size of the bitmap in bits is the size in pages */ - BitMapSize = (ULONG)MmSizeOfPagedPoolInPages; - - /* Calculate buffer size in bytes, aligned to 32 bits */ - Size = sizeof(RTL_BITMAP) + ROUND_UP(BitMapSize, 32) / 8; - - // Allocate the allocation bitmap, which tells us which regions have not yet - // been mapped into memory - - MmPagedPoolInfo.PagedPoolAllocationMap = - ExAllocatePoolWithTag(NonPagedPool, Size, ' mM'); - ASSERT(MmPagedPoolInfo.PagedPoolAllocationMap); - - // Initialize it such that at first, only the first page's worth of PTEs is - // marked as allocated (incidentially, the first PDE we allocated earlier). - RtlInitializeBitMap(MmPagedPoolInfo.PagedPoolAllocationMap, - (PULONG)(MmPagedPoolInfo.PagedPoolAllocationMap + 1), - BitMapSize); - RtlSetAllBits(MmPagedPoolInfo.PagedPoolAllocationMap); - RtlClearBits(MmPagedPoolInfo.PagedPoolAllocationMap, 0, 512); - - // We have a second bitmap, which keeps track of where allocations end. - // Given the allocation bitmap and a base address, we can therefore figure - // out which page is the last page of that allocation, and thus how big the - // entire allocation is. - MmPagedPoolInfo.EndOfPagedPoolBitmap = - ExAllocatePoolWithTag(NonPagedPool, Size, ' mM'); - ASSERT(MmPagedPoolInfo.EndOfPagedPoolBitmap); - - /* Initialize the bitmap */ - RtlInitializeBitMap(MmPagedPoolInfo.EndOfPagedPoolBitmap, - (PULONG)(MmPagedPoolInfo.EndOfPagedPoolBitmap + 1), - BitMapSize); - - /* No allocations, no allocation ends; clear all bits. */ - RtlClearAllBits(MmPagedPoolInfo.EndOfPagedPoolBitmap); - - /* Initialize the paged pool mutex */ - KeInitializeGuardedMutex(&MmPagedPoolMutex); - - /* Initialize the paged pool */ - InitializePool(PagedPool, 0); -} - - NTSTATUS NTAPI -MmArmInitSystem_x(IN ULONG Phase, - IN PLOADER_PARAMETER_BLOCK LoaderBlock) -{ - if (Phase == 0) - { - MmBootImageSize = KeLoaderBlock->Extension->LoaderPagesSpanned * PAGE_SIZE; - MmBootImageSize = ROUND_UP(MmBootImageSize, PAGE_SIZE); - - /* Parse memory descriptors, find free pages */ - //MiEvaluateMemoryDescriptors(LoaderBlock); - - /* Start PFN database at hardcoded address */ - MmPfnDatabase = MI_PFN_DATABASE; - - /* Prepare PFN database mappings */ - MiPreparePfnDatabse(LoaderBlock); - - /* Initialize some mappings */ - MiInitializePageTable(); - - /* Update the memory descriptor, to make sure the pages we used - won't get inserted into the PFN database */ - MxOldFreeDescriptor = *MxFreeDescriptor; - MxFreeDescriptor->BasePage = MxFreePageBase; - MxFreeDescriptor->PageCount = MxFreePageCount; - } - else if (Phase == 1) - { - /* The PFN database was created, restore the free descriptor */ - *MxFreeDescriptor = MxOldFreeDescriptor; - - /* The pfn database is ready now */ - MiPfnsInitialized = TRUE; - - /* Initialize the nonpaged pool */ - MiBuildNonPagedPool(); - - /* Initialize system PTE handling */ - MiBuildSystemPteSpace(); - - /* Build the physical memory block */ - //MiBuildPhysicalMemoryBlock(LoaderBlock); - - /* Size up paged pool and build the shadow system page directory */ - //MiBuildPagedPool(); - - // This is the old stuff: - //MmPagedPoolBase = (PVOID)((PCHAR)MmPagedPoolEnd + 1); - //MmPagedPoolSize = MM_PAGED_POOL_SIZE; - //ASSERT((PCHAR)MmPagedPoolBase + MmPagedPoolSize < (PCHAR)MmNonPagedSystemStart); - - - HalInitializeBios(0, LoaderBlock); - } +INIT_FUNCTION +MiInitMachineDependent(IN PLOADER_PARAMETER_BLOCK LoaderBlock) +{ + + MmHyperSpaceEnd = (PVOID)HYPER_SPACE_END; + + MiInitializePageTable(); + + MiBuildNonPagedPool(); + + MiBuildSystemPteSpace(); return STATUS_SUCCESS; } - -VOID -FASTCALL -MiSyncARM3WithROS(IN PVOID AddressStart, - IN PVOID AddressEnd) -{ - -} - -NTSTATUS -NTAPI -MiInitMachineDependent(IN PLOADER_PARAMETER_BLOCK LoaderBlock) -{ - UNIMPLEMENTED; - return STATUS_NOT_IMPLEMENTED; -}
13 years, 3 months
1
0
0
0
[ekohl] 53826: Add the Diskpart utility by Lee Schroeder (milawynsrealm). The following modifications were made: - Removed the help texts because they were copied from Windows Diskpart. - Used a si...
by ekohl@svn.reactos.org
Author: ekohl Date: Sat Sep 24 10:33:33 2011 New Revision: 53826 URL:
http://svn.reactos.org/svn/reactos?rev=53826&view=rev
Log: Add the Diskpart utility by Lee Schroeder (milawynsrealm). The following modifications were made: - Removed the help texts because they were copied from Windows Diskpart. - Used a single string resource per help text. - Used only Unicode strings and Unicode string functions. - Replaced the giant if-statement in the command dispatcher in interpreter.c by a command-table and a little loop. - Improved the command-line parser. Argument count and argument vector are passed to the command and help functions for easy evaluation. - Moved the help function for commands into the command specific file. TODO: - Implement all commands as the utility is only an empty frame. - Add help texts. - Translate help texts. See issue #6402 for more details. Added: trunk/reactos/base/system/diskpart/ (with props) trunk/reactos/base/system/diskpart/CMakeLists.txt (with props) trunk/reactos/base/system/diskpart/active.c (with props) trunk/reactos/base/system/diskpart/add.c (with props) trunk/reactos/base/system/diskpart/assign.c (with props) trunk/reactos/base/system/diskpart/attach.c (with props) trunk/reactos/base/system/diskpart/attributes.c (with props) trunk/reactos/base/system/diskpart/automount.c (with props) trunk/reactos/base/system/diskpart/break.c (with props) trunk/reactos/base/system/diskpart/clean.c (with props) trunk/reactos/base/system/diskpart/compact.c (with props) trunk/reactos/base/system/diskpart/convert.c (with props) trunk/reactos/base/system/diskpart/create.c (with props) trunk/reactos/base/system/diskpart/delete.c (with props) trunk/reactos/base/system/diskpart/detach.c (with props) trunk/reactos/base/system/diskpart/detail.c (with props) trunk/reactos/base/system/diskpart/diskpart.c (with props) trunk/reactos/base/system/diskpart/diskpart.h (with props) trunk/reactos/base/system/diskpart/diskpart.rbuild (with props) trunk/reactos/base/system/diskpart/diskpart.rc (with props) trunk/reactos/base/system/diskpart/expand.c (with props) trunk/reactos/base/system/diskpart/extend.c (with props) trunk/reactos/base/system/diskpart/filesystems.c (with props) trunk/reactos/base/system/diskpart/format.c (with props) trunk/reactos/base/system/diskpart/gpt.c (with props) trunk/reactos/base/system/diskpart/help.c (with props) trunk/reactos/base/system/diskpart/import.c (with props) trunk/reactos/base/system/diskpart/inactive.c (with props) trunk/reactos/base/system/diskpart/interpreter.c (with props) trunk/reactos/base/system/diskpart/lang/ (with props) trunk/reactos/base/system/diskpart/lang/en-US.rc (with props) trunk/reactos/base/system/diskpart/list.c (with props) trunk/reactos/base/system/diskpart/merge.c (with props) trunk/reactos/base/system/diskpart/offline.c (with props) trunk/reactos/base/system/diskpart/online.c (with props) trunk/reactos/base/system/diskpart/recover.c (with props) trunk/reactos/base/system/diskpart/remove.c (with props) trunk/reactos/base/system/diskpart/remove.h (with props) trunk/reactos/base/system/diskpart/repair.c (with props) trunk/reactos/base/system/diskpart/rescan.c (with props) trunk/reactos/base/system/diskpart/resource.h (with props) trunk/reactos/base/system/diskpart/retain.c (with props) trunk/reactos/base/system/diskpart/san.c (with props) trunk/reactos/base/system/diskpart/select.c (with props) trunk/reactos/base/system/diskpart/setid.c (with props) trunk/reactos/base/system/diskpart/shrink.c (with props) trunk/reactos/base/system/diskpart/uniqueid.c (with props) Modified: trunk/reactos/base/system/CMakeLists.txt trunk/reactos/base/system/system.rbuild Modified: trunk/reactos/base/system/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/CMakeLists.txt…
============================================================================== --- trunk/reactos/base/system/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/base/system/CMakeLists.txt [iso-8859-1] Sat Sep 24 10:33:33 2011 @@ -1,6 +1,7 @@ add_subdirectory(autochk) add_subdirectory(bootok) +add_subdirectory(diskpart) add_subdirectory(expand) add_subdirectory(format) add_subdirectory(lsass) Propchange: trunk/reactos/base/system/diskpart/ ------------------------------------------------------------------------------ --- bugtraq:logregex (added) +++ bugtraq:logregex Sat Sep 24 10:33:33 2011 @@ -1,0 +1,2 @@ +([Ii]ssue|[Bb]ug)s? #?(\d+)(,? ?#?(\d+))*(,? ?(and |or )?#?(\d+))? +(\d+) Propchange: trunk/reactos/base/system/diskpart/ ------------------------------------------------------------------------------ bugtraq:message = See issue #%BUGID% for more details. Propchange: trunk/reactos/base/system/diskpart/ ------------------------------------------------------------------------------ bugtraq:url =
http://www.reactos.org/bugzilla/show_bug.cgi?id=%BUGID%
Propchange: trunk/reactos/base/system/diskpart/ ------------------------------------------------------------------------------ tsvn:logminsize = 10 Added: trunk/reactos/base/system/diskpart/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/diskpart/CMake…
============================================================================== --- trunk/reactos/base/system/diskpart/CMakeLists.txt (added) +++ trunk/reactos/base/system/diskpart/CMakeLists.txt [iso-8859-1] Sat Sep 24 10:33:33 2011 @@ -1,0 +1,49 @@ +set_rc_compiler() + +add_executable(diskpart + active.c + add.c + assign.c + attach.c + attributes.c + automount.c + break.c + clean.c + compact.c + convert.c + create.c + delete.c + detach.c + detail.c + diskpart.c + expand.c + extend.c + filesystems.c + format.c + gpt.c + help.c + import.c + inactive.c + interpreter.c + list.c + merge.c + offline.c + online.c + recover.c + remove.c + repair.c + rescan.c + retain.c + san.c + select.c + setid.c + shrink.c + uniqueid.c + resource.rc) + +set_module_type(calc win32cui) +add_importlibs(diskpart user32 msvcrt kernel32) +if(MSVC) +add_importlibs(diskpart ntdll) +endif() +add_cd_file(TARGET diskpart DESTINATION reactos/system32 FOR all) Propchange: trunk/reactos/base/system/diskpart/CMakeLists.txt ------------------------------------------------------------------------------ svn:eol-style = native Propchange: trunk/reactos/base/system/diskpart/CMakeLists.txt ------------------------------------------------------------------------------ svn:keywords = author date id revision Added: trunk/reactos/base/system/diskpart/active.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/diskpart/activ…
============================================================================== --- trunk/reactos/base/system/diskpart/active.c (added) +++ trunk/reactos/base/system/diskpart/active.c [iso-8859-1] Sat Sep 24 10:33:33 2011 @@ -1,0 +1,25 @@ +/* + * PROJECT: ReactOS DiskPart + * LICENSE: GPL - See COPYING in the top level directory + * FILE: base/system/diskpart/active.c + * PURPOSE: Manages all the partitions of the OS in an interactive way + * PROGRAMMERS: Lee Schroeder + */ + +#include "diskpart.h" + +BOOL active_main(INT argc, WCHAR **argv) +{ + printf("\nActive\n"); + + return TRUE; +} + +/* + * help_active(): + * Shows the description and explains each argument type of the active command + */ +VOID help_active(INT argc, WCHAR **argv) +{ + PrintResourceString(IDS_HELP_CMD_ACTIVE); +} Propchange: trunk/reactos/base/system/diskpart/active.c ------------------------------------------------------------------------------ svn:eol-style = native Propchange: trunk/reactos/base/system/diskpart/active.c ------------------------------------------------------------------------------ svn:keywords = author date id revision Added: trunk/reactos/base/system/diskpart/add.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/diskpart/add.c…
============================================================================== --- trunk/reactos/base/system/diskpart/add.c (added) +++ trunk/reactos/base/system/diskpart/add.c [iso-8859-1] Sat Sep 24 10:33:33 2011 @@ -1,0 +1,23 @@ +/* + * PROJECT: ReactOS DiskPart + * LICENSE: GPL - See COPYING in the top level directory + * FILE: base/system/diskpart/add.c + * PURPOSE: Manages all the partitions of the OS in an interactive way + * PROGRAMMERS: Lee Schroeder + */ + +#include "diskpart.h" + +BOOL add_main(INT argc, WCHAR **argv) +{ + return TRUE; +} + +/* + * help_add(): + * Shows the description and explains each argument type of the add command + */ +VOID help_add(INT argc, WCHAR **argv) +{ + PrintResourceString(IDS_HELP_CMD_ADD); +} Propchange: trunk/reactos/base/system/diskpart/add.c ------------------------------------------------------------------------------ svn:eol-style = native Propchange: trunk/reactos/base/system/diskpart/add.c ------------------------------------------------------------------------------ svn:keywords = author date id revision Added: trunk/reactos/base/system/diskpart/assign.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/diskpart/assig…
============================================================================== --- trunk/reactos/base/system/diskpart/assign.c (added) +++ trunk/reactos/base/system/diskpart/assign.c [iso-8859-1] Sat Sep 24 10:33:33 2011 @@ -1,0 +1,22 @@ +/* + * PROJECT: ReactOS DiskPart + * LICENSE: GPL - See COPYING in the top level directory + * FILE: base/system/diskpart/assign.c + * PURPOSE: Manages all the partitions of the OS in an interactive way + * PROGRAMMERS: Lee Schroeder + */ +#include "diskpart.h" + +BOOL assign_main(INT argc, WCHAR **argv) +{ + return TRUE; +} + +/* + * help_assign(): + * Shows the description and explains each argument type of the assign command + */ +VOID help_assign(INT argc, WCHAR **argv) +{ + PrintResourceString(IDS_HELP_CMD_ASSIGN); +} Propchange: trunk/reactos/base/system/diskpart/assign.c ------------------------------------------------------------------------------ svn:eol-style = native Propchange: trunk/reactos/base/system/diskpart/assign.c ------------------------------------------------------------------------------ svn:keywords = author date id revision Added: trunk/reactos/base/system/diskpart/attach.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/diskpart/attac…
============================================================================== --- trunk/reactos/base/system/diskpart/attach.c (added) +++ trunk/reactos/base/system/diskpart/attach.c [iso-8859-1] Sat Sep 24 10:33:33 2011 @@ -1,0 +1,23 @@ +/* + * PROJECT: ReactOS DiskPart + * LICENSE: GPL - See COPYING in the top level directory + * FILE: base/system/diskpart/attach.c + * PURPOSE: Manages all the partitions of the OS in an interactive way + * PROGRAMMERS: Lee Schroeder + */ +#include "diskpart.h" + +BOOL attach_main(INT argc, WCHAR **argv) +{ + return TRUE; +} + + +/* + * help_attach(): + * Shows the description and explains each argument type of the attach command + */ +VOID help_attach(INT argc, WCHAR **argv) +{ + PrintResourceString(IDS_HELP_CMD_ATTACH); +} Propchange: trunk/reactos/base/system/diskpart/attach.c ------------------------------------------------------------------------------ svn:eol-style = native Propchange: trunk/reactos/base/system/diskpart/attach.c ------------------------------------------------------------------------------ svn:keywords = author date id revision Added: trunk/reactos/base/system/diskpart/attributes.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/diskpart/attri…
============================================================================== --- trunk/reactos/base/system/diskpart/attributes.c (added) +++ trunk/reactos/base/system/diskpart/attributes.c [iso-8859-1] Sat Sep 24 10:33:33 2011 @@ -1,0 +1,22 @@ +/* + * PROJECT: ReactOS DiskPart + * LICENSE: GPL - See COPYING in the top level directory + * FILE: base/system/diskpart/attributes.c + * PURPOSE: Manages all the partitions of the OS in an interactive way + * PROGRAMMERS: Lee Schroeder + */ +#include "diskpart.h" + +BOOL attributes_main(INT argc, WCHAR **argv) +{ + return TRUE; +} + +/* + * help_attributes(): + * Shows the description and explains each argument type of the attributes command + */ +VOID help_attributes(INT argc, WCHAR **argv) +{ + PrintResourceString(IDS_HELP_CMD_ATTRIBUTES); +} Propchange: trunk/reactos/base/system/diskpart/attributes.c ------------------------------------------------------------------------------ svn:eol-style = native Propchange: trunk/reactos/base/system/diskpart/attributes.c ------------------------------------------------------------------------------ svn:keywords = author date id revision Added: trunk/reactos/base/system/diskpart/automount.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/diskpart/autom…
============================================================================== --- trunk/reactos/base/system/diskpart/automount.c (added) +++ trunk/reactos/base/system/diskpart/automount.c [iso-8859-1] Sat Sep 24 10:33:33 2011 @@ -1,0 +1,23 @@ +/* + * PROJECT: ReactOS DiskPart + * LICENSE: GPL - See COPYING in the top level directory + * FILE: base/system/diskpart/automount.c + * PURPOSE: Manages all the partitions of the OS in an interactive way + * PROGRAMMERS: Lee Schroeder + */ +#include "diskpart.h" + +BOOL automount_main(INT argc, WCHAR **argv) +{ + printf("Automount\n"); + return TRUE; +} + +/* + * help_automount(): + * Shows the description and explains each argument type of the automount command + */ +VOID help_automount(INT argc, WCHAR **argv) +{ + PrintResourceString(IDS_HELP_CMD_AUTOMOUNT); +} Propchange: trunk/reactos/base/system/diskpart/automount.c ------------------------------------------------------------------------------ svn:eol-style = native Propchange: trunk/reactos/base/system/diskpart/automount.c ------------------------------------------------------------------------------ svn:keywords = author date id revision Added: trunk/reactos/base/system/diskpart/break.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/diskpart/break…
============================================================================== --- trunk/reactos/base/system/diskpart/break.c (added) +++ trunk/reactos/base/system/diskpart/break.c [iso-8859-1] Sat Sep 24 10:33:33 2011 @@ -1,0 +1,25 @@ +/* + * PROJECT: ReactOS DiskPart + * LICENSE: GPL - See COPYING in the top level directory + * FILE: base/system/diskpart/break.c + * PURPOSE: Manages all the partitions of the OS in + * an interactive way + * PROGRAMMERS: Lee Schroeder + */ +#include "diskpart.h" + +BOOL break_main(INT argc, WCHAR **argv) +{ + printf("\nTODO: Add code later since Win 7 Home Premium doesn't have this feature.\n"); + + return TRUE; +} + +/* + * help_break(): + * Shows the description and explains each argument type of the break command + */ +VOID help_break(INT argc, WCHAR **argv) +{ + PrintResourceString(IDS_HELP_CMD_BREAK); +} Propchange: trunk/reactos/base/system/diskpart/break.c ------------------------------------------------------------------------------ svn:eol-style = native Propchange: trunk/reactos/base/system/diskpart/break.c ------------------------------------------------------------------------------ svn:keywords = author date id revision Added: trunk/reactos/base/system/diskpart/clean.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/diskpart/clean…
============================================================================== --- trunk/reactos/base/system/diskpart/clean.c (added) +++ trunk/reactos/base/system/diskpart/clean.c [iso-8859-1] Sat Sep 24 10:33:33 2011 @@ -1,0 +1,24 @@ +/* + * PROJECT: ReactOS DiskPart + * LICENSE: GPL - See COPYING in the top level directory + * FILE: base/system/diskpart/clean.c + * PURPOSE: Manages all the partitions of the OS in + * an interactive way + * PROGRAMMERS: Lee Schroeder + */ +#include "diskpart.h" + +BOOL clean_main(INT argc, WCHAR **argv) +{ + return TRUE; +} + + +/* + * help_clean(): + * Shows the description and explains each argument type of the clean command + */ +VOID help_clean(INT argc, WCHAR **argv) +{ + PrintResourceString(IDS_HELP_CMD_CLEAN); +} Propchange: trunk/reactos/base/system/diskpart/clean.c ------------------------------------------------------------------------------ svn:eol-style = native Propchange: trunk/reactos/base/system/diskpart/clean.c ------------------------------------------------------------------------------ svn:keywords = author date id revision Added: trunk/reactos/base/system/diskpart/compact.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/diskpart/compa…
============================================================================== --- trunk/reactos/base/system/diskpart/compact.c (added) +++ trunk/reactos/base/system/diskpart/compact.c [iso-8859-1] Sat Sep 24 10:33:33 2011 @@ -1,0 +1,24 @@ +/* + * PROJECT: ReactOS DiskPart + * LICENSE: GPL - See COPYING in the top level directory + * FILE: base/system/diskpart/compact.c + * PURPOSE: Manages all the partitions of the OS in + * an interactive way + * PROGRAMMERS: Lee Schroeder + */ +#include "diskpart.h" + +BOOL compact_main(INT argc, WCHAR **argv) +{ + return 0; +} + + +/* + * help_compact(): + * Shows the description and explains each argument type of the compact command + */ +VOID help_compact(INT argc, WCHAR **argv) +{ + PrintResourceString(IDS_HELP_CMD_COMPACT); +} Propchange: trunk/reactos/base/system/diskpart/compact.c ------------------------------------------------------------------------------ svn:eol-style = native Propchange: trunk/reactos/base/system/diskpart/compact.c ------------------------------------------------------------------------------ svn:keywords = author date id revision Added: trunk/reactos/base/system/diskpart/convert.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/diskpart/conve…
============================================================================== --- trunk/reactos/base/system/diskpart/convert.c (added) +++ trunk/reactos/base/system/diskpart/convert.c [iso-8859-1] Sat Sep 24 10:33:33 2011 @@ -1,0 +1,24 @@ +/* + * PROJECT: ReactOS DiskPart + * LICENSE: GPL - See COPYING in the top level directory + * FILE: base/system/diskpart/convert.c + * PURPOSE: Manages all the partitions of the OS in + * an interactive way + * PROGRAMMERS: Lee Schroeder + */ +#include "diskpart.h" + +BOOL convert_main(INT argc, WCHAR **argv) +{ + return TRUE; +} + + +/* + * help_convert(): + * Shows the description and explains each argument type of the convert command + */ +VOID help_convert(INT argc, WCHAR **argv) +{ + PrintResourceString(IDS_HELP_CMD_CONVERT); +} Propchange: trunk/reactos/base/system/diskpart/convert.c ------------------------------------------------------------------------------ svn:eol-style = native Propchange: trunk/reactos/base/system/diskpart/convert.c ------------------------------------------------------------------------------ svn:keywords = author date id revision Added: trunk/reactos/base/system/diskpart/create.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/diskpart/creat…
============================================================================== --- trunk/reactos/base/system/diskpart/create.c (added) +++ trunk/reactos/base/system/diskpart/create.c [iso-8859-1] Sat Sep 24 10:33:33 2011 @@ -1,0 +1,24 @@ +/* + * PROJECT: ReactOS DiskPart + * LICENSE: GPL - See COPYING in the top level directory + * FILE: base/system/diskpart/create.c + * PURPOSE: Manages all the partitions of the OS in + * an interactive way + * PROGRAMMERS: Lee Schroeder + */ +#include "diskpart.h" + +BOOL create_main(INT argc, WCHAR **argv) +{ + return TRUE; +} + + +/* + * help_create(): + * Shows the description and explains each argument type of the create command + */ +VOID help_create(INT argc, WCHAR **argv) +{ + PrintResourceString(IDS_HELP_CMD_CREATE); +} Propchange: trunk/reactos/base/system/diskpart/create.c ------------------------------------------------------------------------------ svn:eol-style = native Propchange: trunk/reactos/base/system/diskpart/create.c ------------------------------------------------------------------------------ svn:keywords = author date id revision Added: trunk/reactos/base/system/diskpart/delete.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/diskpart/delet…
============================================================================== --- trunk/reactos/base/system/diskpart/delete.c (added) +++ trunk/reactos/base/system/diskpart/delete.c [iso-8859-1] Sat Sep 24 10:33:33 2011 @@ -1,0 +1,23 @@ +/* + * PROJECT: ReactOS DiskPart + * LICENSE: GPL - See COPYING in the top level directory + * FILE: base/system/diskpart/delete.c + * PURPOSE: Manages all the partitions of the OS in + * an interactive way + * PROGRAMMERS: Lee Schroeder + */ +#include "diskpart.h" + +BOOL delete_main(INT argc, WCHAR **argv) +{ + return TRUE; +} + +/* + * help_delete(): + * Shows the description and explains each argument type of the delete command + */ +VOID help_delete(INT argc, WCHAR **argv) +{ + PrintResourceString(IDS_HELP_CMD_DELETE); +} Propchange: trunk/reactos/base/system/diskpart/delete.c ------------------------------------------------------------------------------ svn:eol-style = native Propchange: trunk/reactos/base/system/diskpart/delete.c ------------------------------------------------------------------------------ svn:keywords = author date id revision Added: trunk/reactos/base/system/diskpart/detach.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/diskpart/detac…
============================================================================== --- trunk/reactos/base/system/diskpart/detach.c (added) +++ trunk/reactos/base/system/diskpart/detach.c [iso-8859-1] Sat Sep 24 10:33:33 2011 @@ -1,0 +1,20 @@ +/* + * PROJECT: ReactOS DiskPart + * LICENSE: GPL - See COPYING in the top level directory + * FILE: base/system/diskpart/detach.h + * PURPOSE: Manages all the partitions of the OS in + * an interactive way + * PROGRAMMERS: Lee Schroeder + */ +#include "diskpart.h" + +BOOL detach_main(INT argc, WCHAR **argv) +{ + return TRUE; +} + + +VOID help_detach(INT argc, WCHAR **argv) +{ + PrintResourceString(IDS_HELP_CMD_DETACH); +} Propchange: trunk/reactos/base/system/diskpart/detach.c ------------------------------------------------------------------------------ svn:eol-style = native Propchange: trunk/reactos/base/system/diskpart/detach.c ------------------------------------------------------------------------------ svn:keywords = author date id revision Added: trunk/reactos/base/system/diskpart/detail.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/diskpart/detai…
============================================================================== --- trunk/reactos/base/system/diskpart/detail.c (added) +++ trunk/reactos/base/system/diskpart/detail.c [iso-8859-1] Sat Sep 24 10:33:33 2011 @@ -1,0 +1,20 @@ +/* + * PROJECT: ReactOS DiskPart + * LICENSE: GPL - See COPYING in the top level directory + * FILE: base/system/diskpart/detail.c + * PURPOSE: Manages all the partitions of the OS in + * an interactive way + * PROGRAMMERS: Lee Schroeder + */ +#include "diskpart.h" + +BOOL detail_main(INT argc, WCHAR **argv) +{ + return TRUE; +} + + +VOID help_detail(INT argc, WCHAR **argv) +{ + PrintResourceString(IDS_HELP_CMD_DETAIL); +} Propchange: trunk/reactos/base/system/diskpart/detail.c ------------------------------------------------------------------------------ svn:eol-style = native Propchange: trunk/reactos/base/system/diskpart/detail.c ------------------------------------------------------------------------------ svn:keywords = author date id revision Added: trunk/reactos/base/system/diskpart/diskpart.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/diskpart/diskp…
============================================================================== --- trunk/reactos/base/system/diskpart/diskpart.c (added) +++ trunk/reactos/base/system/diskpart/diskpart.c [iso-8859-1] Sat Sep 24 10:33:33 2011 @@ -1,0 +1,110 @@ +/* + * PROJECT: ReactOS DiskPart + * LICENSE: GPL - See COPYING in the top level directory + * FILE: base/system/diskpart/diskpart.c + * PURPOSE: Manages all the partitions of the OS in + * an interactive way + * PROGRAMMERS: Lee Schroeder + */ + +/* INCLUDES ******************************************************************/ +#include "diskpart.h" + +/* FUNCTIONS ******************************************************************/ + +VOID +PrintResourceString(INT resID, ...) +{ + WCHAR szMsg[3072]; + va_list arg_ptr; + + va_start(arg_ptr, resID); + LoadStringW(GetModuleHandle(NULL), resID, szMsg, 3072); + vwprintf(szMsg, arg_ptr); + va_end(arg_ptr); +} + + +/* + * run_script(const char *filename): + * opens the file, reads the contents, convert the text into readable + * code for the computer, and then execute commands in order. + */ +BOOL run_script(LPCWSTR filename) +{ + FILE *script_file; + WCHAR tmp_string[MAX_STRING_SIZE]; + + /* Open the file for processing */ + script_file = _wfopen(filename, L"r"); + if (script_file == NULL) + { + /* if there was problems opening the file */ + PrintResourceString(IDS_ERROR_MSG_NO_SCRIPT, filename); + return FALSE; /* if there is no script, exit the program */ + } + + /* Read and process the script */ + while (fgetws(tmp_string, MAX_STRING_SIZE, script_file) != NULL) + { + if (interpret_script(tmp_string) == FALSE) + return FALSE; + } + + /* Close the file */ + fclose(script_file); + + return TRUE; +} + +/* + * main(): + * Main entry point of the application. + */ +int wmain(int argc, const WCHAR *argv[]) +{ + /* Gets the current name of the computer */ + WCHAR comp_name[MAX_STRING_SIZE]; //used to store the name of the computer */ + DWORD comp_size = MAX_STRING_SIZE; // used for the char size of comp_name */ + BOOL interpreter_running = TRUE; //used for the main program loop */ + + /* Get the name of the computer for us and change the value of comp_name */ + GetComputerName(comp_name, &comp_size); + + /* TODO: Remove this section of code when program becomes stable enough for production use. */ + wprintf(L"\n*WARNING*: This program is incomplete and may not work properly.\n"); + + /* Print the header information */ + PrintResourceString(IDS_APP_HEADER, DISKPART_VERSION); + PrintResourceString(IDS_APP_LICENSE); + PrintResourceString(IDS_APP_CURR_COMPUTER, comp_name); + + /* Find out if the user is loading a script */ + if (argc >= 2) + { + /* if there are arguments when starting the program + determine if the script flag is enabled */ + if ((wcsicmp(argv[1], L"/s") == 0) || + (wcsicmp(argv[1], L"-s") == 0)) + { + /* see if the user has put anything after the script flag; if not, + then it doesn't run the run_script() command. */ + /* Alternative comment: Fail if the script name is missing */ + if (argc == 3) + return EXIT_FAILURE; + + interpreter_running = run_script(argv[2]); + } + } + + /* the main program loop */ + while (interpreter_running) + { + interpreter_running = interpret_main(); + } + + /* Let the user know the program is exiting */ + PrintResourceString(IDS_APP_LEAVING); + + return EXIT_SUCCESS; +} Propchange: trunk/reactos/base/system/diskpart/diskpart.c ------------------------------------------------------------------------------ svn:eol-style = native Propchange: trunk/reactos/base/system/diskpart/diskpart.c ------------------------------------------------------------------------------ svn:keywords = author date id revision Added: trunk/reactos/base/system/diskpart/diskpart.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/diskpart/diskp…
============================================================================== --- trunk/reactos/base/system/diskpart/diskpart.h (added) +++ trunk/reactos/base/system/diskpart/diskpart.h [iso-8859-1] Sat Sep 24 10:33:33 2011 @@ -1,0 +1,201 @@ +/* + * PROJECT: ReactOS DiskPart + * LICENSE: GPL - See COPYING in the top level directory + * FILE: base/system/diskpart/diskpart.c + * PURPOSE: Manages all the partitions of the OS in + * an interactive way + * PROGRAMMERS: Lee Schroeder + */ +#ifndef DISKPART_H +#define DISKPART_H + +/* INCLUDES ******************************************************************/ + +#include <windows.h> +#include <stdio.h> +#include <string.h> +#include <ctype.h> + +#include "resource.h" + +/* DEFINES *******************************************************************/ + +typedef struct _COMMAND +{ + WCHAR *name; + BOOL (*func)(INT, WCHAR**); + VOID (*help)(INT, WCHAR**); +} COMMAND, *PCOMMAND; + +extern COMMAND cmds[]; + +/* NOERR codes for the program */ +#define ERROR_NONE 0 +#define ERROR_FATAL 1 +#define ERROR_CMD_ARG 2 +#define ERROR_FILE 3 +#define ERROR_SERVICE 4 +#define ERROR_SYNTAX 5 + +#define DISKPART_VERSION L"0.0.019" + +#define MAX_STRING_SIZE 1024 +#define MAX_ARGS_COUNT 256 + +/* PROTOTYPES *****************************************************************/ + +/* active.c */ +BOOL active_main(INT argc, WCHAR **argv); +VOID help_active(INT argc, WCHAR **argv); + +/* add.c */ +BOOL add_main(INT argc, WCHAR **argv); +VOID help_add(INT argc, WCHAR **argv); + +/* assign.c */ +BOOL assign_main(INT argc, WCHAR **argv); +VOID help_assign(INT argc, WCHAR **argv); + +/* attach.c */ +BOOL attach_main(INT argc, WCHAR **argv); +VOID help_attach(INT argc, WCHAR **argv); + +/* attributes.h */ +VOID help_attributes(INT argc, WCHAR **argv); +BOOL attributes_main(INT argc, WCHAR **argv); + +/* automount.c */ +BOOL automount_main(INT argc, WCHAR **argv); +VOID help_automount(INT argc, WCHAR **argv); + +/* break.c */ +BOOL break_main(INT argc, WCHAR **argv); +VOID help_break(INT argc, WCHAR **argv); + +/* clean.c */ +BOOL clean_main(INT argc, WCHAR **argv); +VOID help_clean(INT argc, WCHAR **argv); + +/* compact.c */ +BOOL compact_main(INT argc, WCHAR **argv); +VOID help_compact(INT argc, WCHAR **argv); + +/* convert.c */ +BOOL convert_main(INT argc, WCHAR **argv); +VOID help_convert(INT argc, WCHAR **argv); + +/* create.c */ +BOOL create_main(INT argc, WCHAR **argv); +VOID help_create(INT argc, WCHAR **argv); + +/* delete.c */ +BOOL delete_main(INT argc, WCHAR **argv); +VOID help_delete(INT argc, WCHAR **argv); + +/* detach.c */ +BOOL detach_main(INT argc, WCHAR **argv); +VOID help_detach(INT argc, WCHAR **argv); + +/* detail.c */ +BOOL detail_main(INT argc, WCHAR **argv); +VOID help_detail(INT argc, WCHAR **argv); + +/* diskpart.c */ +VOID PrintResourceString(INT resID, ...); + +/* expand.c */ +BOOL expand_main(INT argc, WCHAR **argv); +VOID help_expand(INT argc, WCHAR **argv); + +/* extend.c */ +BOOL extend_main(INT argc, WCHAR **argv); +VOID help_extend(INT argc, WCHAR **argv); + +/* filesystem.c */ +BOOL filesystems_main(INT argc, WCHAR **argv); +VOID help_filesystems(INT argc, WCHAR **argv); + +/* format.c */ +BOOL format_main(INT argc, WCHAR **argv); +VOID help_format(INT argc, WCHAR **argv); + +/* gpt.c */ +BOOL gpt_main(INT argc, WCHAR **argv); +VOID help_gpt(INT argc, WCHAR **argv); + +/* help.c */ +BOOL help_main(INT argc, WCHAR **argv); +VOID help_help(INT argc, WCHAR **argv); +VOID help_cmdlist(VOID); +VOID help_print_noerr(VOID); + +/* import. c */ +BOOL import_main(INT argc, WCHAR **argv); +VOID help_import(INT argc, WCHAR **argv); + +/* inactive.c */ +BOOL inactive_main(INT argc, WCHAR **argv); +VOID help_inactive(INT argc, WCHAR **argv); + +/* interpreter.c */ +BOOL interpret_script(WCHAR *line); +BOOL interpret_main(VOID); +BOOL interpret_cmd(INT argc, WCHAR **argv); + +/* list.c */ +BOOL list_main(INT argc, WCHAR **argv); +VOID help_list(INT argc, WCHAR **argv); + +/* merge.c */ +BOOL merge_main(INT argc, WCHAR **argv); +VOID help_merge(INT argc, WCHAR **argv); + +/* offline.c */ +BOOL offline_main(INT argc, WCHAR **argv); +VOID help_offline(INT argc, WCHAR **argv); + +/* online.c */ +BOOL online_main(INT argc, WCHAR **argv); +VOID help_online(INT argc, WCHAR **argv); + +/* recover.c */ +BOOL recover_main(INT argc, WCHAR **argv); +VOID help_recover(INT argc, WCHAR **argv); + +/* remove.c */ +BOOL remove_main(INT argc, WCHAR **argv); +VOID help_remove(INT argc, WCHAR **argv); + +/* repair.c */ +BOOL repair_main(INT argc, WCHAR **argv); +VOID help_repair(INT argc, WCHAR **argv); + +/* rescan.c */ +BOOL rescan_main(INT argc, WCHAR **argv); +VOID help_rescan(INT argc, WCHAR **argv); + +/* retain.c */ +BOOL retain_main(INT argc, WCHAR **argv); +VOID help_retain(INT argc, WCHAR **argv); + +/* san.c */ +BOOL san_main(INT argc, WCHAR **argv); +VOID help_san(INT argc, WCHAR **argv); + +/* select.c */ +BOOL select_main(INT argc, WCHAR **argv); +VOID help_select(INT argc, WCHAR **argv); + +/* setid.c */ +BOOL setid_main(INT argc, WCHAR **argv); +VOID help_setid(INT argc, WCHAR **argv); + +/* shrink.c */ +BOOL shrink_main(INT argc, WCHAR **argv); +VOID help_shrink(INT argc, WCHAR **argv); + +/* uniqueid.c */ +BOOL uniqueid_main(INT argc, WCHAR **argv); +VOID help_uniqueid(INT argc, WCHAR **argv); + +#endif /* DISKPART_H */ Propchange: trunk/reactos/base/system/diskpart/diskpart.h ------------------------------------------------------------------------------ svn:eol-style = native Propchange: trunk/reactos/base/system/diskpart/diskpart.h ------------------------------------------------------------------------------ svn:keywords = author date id revision Added: trunk/reactos/base/system/diskpart/diskpart.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/diskpart/diskp…
============================================================================== --- trunk/reactos/base/system/diskpart/diskpart.rbuild (added) +++ trunk/reactos/base/system/diskpart/diskpart.rbuild [iso-8859-1] Sat Sep 24 10:33:33 2011 @@ -1,0 +1,46 @@ +<?xml version="1.0"?> +<!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd"> +<module name="diskpart" type="win32cui" installbase="system32" installname="diskpart.exe" unicode="true" > + <include base="diskpart">.</include> + <!-- library>ntdll</library --> + <library>user32</library> + <file>active.c</file> + <file>add.c</file> + <file>assign.c</file> + <file>attach.c</file> + <file>attributes.c</file> + <file>automount.c</file> + <file>break.c</file> + <file>clean.c</file> + <file>compact.c</file> + <file>convert.c</file> + <file>create.c</file> + <file>delete.c</file> + <file>detach.c</file> + <file>detail.c</file> + <file>diskpart.c</file> + <file>expand.c</file> + <file>extend.c</file> + <file>filesystems.c</file> + <file>format.c</file> + <file>gpt.c</file> + <file>help.c</file> + <file>import.c</file> + <file>inactive.c</file> + <file>interpreter.c</file> + <file>list.c</file> + <file>merge.c</file> + <file>offline.c</file> + <file>online.c</file> + <file>recover.c</file> + <file>remove.c</file> + <file>repair.c</file> + <file>rescan.c</file> + <file>retain.c</file> + <file>san.c</file> + <file>select.c</file> + <file>setid.c</file> + <file>shrink.c</file> + <file>uniqueid.c</file> + <file>diskpart.rc</file> +</module> Propchange: trunk/reactos/base/system/diskpart/diskpart.rbuild ------------------------------------------------------------------------------ svn:eol-style = native Propchange: trunk/reactos/base/system/diskpart/diskpart.rbuild ------------------------------------------------------------------------------ svn:keywords = author date id revision Added: trunk/reactos/base/system/diskpart/diskpart.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/diskpart/diskp…
============================================================================== --- trunk/reactos/base/system/diskpart/diskpart.rc (added) +++ trunk/reactos/base/system/diskpart/diskpart.rc [iso-8859-1] Sat Sep 24 10:33:33 2011 @@ -1,0 +1,7 @@ +#define REACTOS_STR_FILE_DESCRIPTION "Disk Partitioning Tool\0" +#define REACTOS_STR_INTERNAL_NAME "diskpart\0" +#define REACTOS_STR_ORIGINAL_FILENAME "diskpart.exe\0" +#define REACTOS_STR_ORIGINAL_COPYRIGHT "(C) 2011 Lee Schroeder\0" +#include <reactos/version.rc> + +#include "lang/en-US.rc" Propchange: trunk/reactos/base/system/diskpart/diskpart.rc ------------------------------------------------------------------------------ svn:eol-style = native Propchange: trunk/reactos/base/system/diskpart/diskpart.rc ------------------------------------------------------------------------------ svn:keywords = author date id revision Added: trunk/reactos/base/system/diskpart/expand.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/diskpart/expan…
============================================================================== --- trunk/reactos/base/system/diskpart/expand.c (added) +++ trunk/reactos/base/system/diskpart/expand.c [iso-8859-1] Sat Sep 24 10:33:33 2011 @@ -1,0 +1,20 @@ +/* + * PROJECT: ReactOS DiskPart + * LICENSE: GPL - See COPYING in the top level directory + * FILE: base/system/diskpart/expand.c + * PURPOSE: Manages all the partitions of the OS in + * an interactive way + * PROGRAMMERS: Lee Schroeder + */ +#include "diskpart.h" + +BOOL expand_main(INT argc, WCHAR **argv) +{ + return TRUE; +} + + +VOID help_expand(INT argc, WCHAR **argv) +{ + PrintResourceString(IDS_HELP_CMD_EXPAND); +} Propchange: trunk/reactos/base/system/diskpart/expand.c ------------------------------------------------------------------------------ svn:eol-style = native Propchange: trunk/reactos/base/system/diskpart/expand.c ------------------------------------------------------------------------------ svn:keywords = author date id revision Added: trunk/reactos/base/system/diskpart/extend.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/diskpart/exten…
============================================================================== --- trunk/reactos/base/system/diskpart/extend.c (added) +++ trunk/reactos/base/system/diskpart/extend.c [iso-8859-1] Sat Sep 24 10:33:33 2011 @@ -1,0 +1,20 @@ +/* + * PROJECT: ReactOS DiskPart + * LICENSE: GPL - See COPYING in the top level directory + * FILE: base/system/diskpart/extend.c + * PURPOSE: Manages all the partitions of the OS in + * an interactive way + * PROGRAMMERS: Lee Schroeder + */ +#include "diskpart.h" + +BOOL extend_main(INT argc, WCHAR **argv) +{ + return TRUE; +} + + +VOID help_extend(INT argc, WCHAR **argv) +{ + PrintResourceString(IDS_HELP_CMD_EXTEND); +} Propchange: trunk/reactos/base/system/diskpart/extend.c ------------------------------------------------------------------------------ svn:eol-style = native Propchange: trunk/reactos/base/system/diskpart/extend.c ------------------------------------------------------------------------------ svn:keywords = author date id revision Added: trunk/reactos/base/system/diskpart/filesystems.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/diskpart/files…
============================================================================== --- trunk/reactos/base/system/diskpart/filesystems.c (added) +++ trunk/reactos/base/system/diskpart/filesystems.c [iso-8859-1] Sat Sep 24 10:33:33 2011 @@ -1,0 +1,20 @@ +/* + * PROJECT: ReactOS DiskPart + * LICENSE: GPL - See COPYING in the top level directory + * FILE: base/system/diskpart/filesystems.c + * PURPOSE: Manages all the partitions of the OS in + * an interactive way + * PROGRAMMERS: Lee Schroeder + */ +#include "diskpart.h" + +BOOL filesystems_main(INT argc, WCHAR **argv) +{ + return TRUE; +} + + +VOID help_filesystems(INT argc, WCHAR **argv) +{ + PrintResourceString(IDS_HELP_CMD_FILESYSTEMS); +} Propchange: trunk/reactos/base/system/diskpart/filesystems.c ------------------------------------------------------------------------------ svn:eol-style = native Propchange: trunk/reactos/base/system/diskpart/filesystems.c ------------------------------------------------------------------------------ svn:keywords = author date id revision Added: trunk/reactos/base/system/diskpart/format.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/diskpart/forma…
============================================================================== --- trunk/reactos/base/system/diskpart/format.c (added) +++ trunk/reactos/base/system/diskpart/format.c [iso-8859-1] Sat Sep 24 10:33:33 2011 @@ -1,0 +1,20 @@ +/* + * PROJECT: ReactOS DiskPart + * LICENSE: GPL - See COPYING in the top level directory + * FILE: base/system/diskpart/format.c + * PURPOSE: Manages all the partitions of the OS in + * an interactive way + * PROGRAMMERS: Lee Schroeder + */ +#include "diskpart.h" + +BOOL format_main(INT argc, WCHAR **argv) +{ + return TRUE; +} + + +VOID help_format(INT argc, WCHAR **argv) +{ + PrintResourceString(IDS_HELP_CMD_FORMAT); +} Propchange: trunk/reactos/base/system/diskpart/format.c ------------------------------------------------------------------------------ svn:eol-style = native Propchange: trunk/reactos/base/system/diskpart/format.c ------------------------------------------------------------------------------ svn:keywords = author date id revision Added: trunk/reactos/base/system/diskpart/gpt.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/diskpart/gpt.c…
============================================================================== --- trunk/reactos/base/system/diskpart/gpt.c (added) +++ trunk/reactos/base/system/diskpart/gpt.c [iso-8859-1] Sat Sep 24 10:33:33 2011 @@ -1,0 +1,19 @@ +/* + * PROJECT: ReactOS DiskPart + * LICENSE: GPL - See COPYING in the top level directory + * FILE: base/system/diskpart/gpt.c + * PURPOSE: Manages all the partitions of the OS in + * an interactive way + * PROGRAMMERS: Lee Schroeder + */ +#include "diskpart.h" + +BOOL gpt_main(INT argc, WCHAR **argv) +{ + return TRUE; +} + +VOID help_gpt(INT argc, WCHAR **argv) +{ + PrintResourceString(IDS_HELP_CMD_GPT); +} Propchange: trunk/reactos/base/system/diskpart/gpt.c ------------------------------------------------------------------------------ svn:eol-style = native Propchange: trunk/reactos/base/system/diskpart/gpt.c ------------------------------------------------------------------------------ svn:keywords = author date id revision Added: trunk/reactos/base/system/diskpart/help.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/diskpart/help.…
============================================================================== --- trunk/reactos/base/system/diskpart/help.c (added) +++ trunk/reactos/base/system/diskpart/help.c [iso-8859-1] Sat Sep 24 10:33:33 2011 @@ -1,0 +1,97 @@ +/* + * PROJECT: ReactOS DiskPart + * LICENSE: GPL - See COPYING in the top level directory + * FILE: base/system/diskpart/help.c + * PURPOSE: Manages all the partitions of the OS in an interactive way + * PROGRAMMERS: Lee Schroeder + */ + +#include "diskpart.h" + + +/* + * help_cmdlist(): + * shows all the available commands and basic descriptions for diskpart + */ +VOID help_cmdlist(VOID) +{ + /* Print the header information */ + PrintResourceString(IDS_APP_HEADER, DISKPART_VERSION); + + /* lists all the commands and the basic descriptions */ + PrintResourceString(IDS_HELP_CMD_DESC_ACTIVE); + PrintResourceString(IDS_HELP_CMD_DESC_ADD); + PrintResourceString(IDS_HELP_CMD_DESC_ASSIGN); + PrintResourceString(IDS_HELP_CMD_DESC_ATTACH); + PrintResourceString(IDS_HELP_CMD_DESC_ATTRIBUTES); + PrintResourceString(IDS_HELP_CMD_DESC_AUTOMOUNT); + PrintResourceString(IDS_HELP_CMD_DESC_BREAK); + PrintResourceString(IDS_HELP_CMD_DESC_CLEAN); + PrintResourceString(IDS_HELP_CMD_DESC_COMPACT); + PrintResourceString(IDS_HELP_CMD_DESC_CONVERT); + PrintResourceString(IDS_HELP_CMD_DESC_CREATE); + PrintResourceString(IDS_HELP_CMD_DESC_DELETE); + PrintResourceString(IDS_HELP_CMD_DESC_DETACH); + PrintResourceString(IDS_HELP_CMD_DESC_DETAIL); + PrintResourceString(IDS_HELP_CMD_DESC_EXIT); + PrintResourceString(IDS_HELP_CMD_DESC_EXPAND); + PrintResourceString(IDS_HELP_CMD_DESC_EXTEND); + PrintResourceString(IDS_HELP_CMD_DESC_FS); + PrintResourceString(IDS_HELP_CMD_DESC_FORMAT); + PrintResourceString(IDS_HELP_CMD_DESC_GPT); + PrintResourceString(IDS_HELP_CMD_DESC_HELP); + PrintResourceString(IDS_HELP_CMD_DESC_IMPORT); + PrintResourceString(IDS_HELP_CMD_DESC_INACTIVE); + PrintResourceString(IDS_HELP_CMD_DESC_LIST); + PrintResourceString(IDS_HELP_CMD_DESC_MERGE); + PrintResourceString(IDS_HELP_CMD_DESC_OFFLINE); + PrintResourceString(IDS_HELP_CMD_DESC_ONLINE); + PrintResourceString(IDS_HELP_CMD_DESC_RECOVER); + PrintResourceString(IDS_HELP_CMD_DESC_REM); + PrintResourceString(IDS_HELP_CMD_DESC_REMOVE); + PrintResourceString(IDS_HELP_CMD_DESC_REPAIR); + PrintResourceString(IDS_HELP_CMD_DESC_RESCAN); + PrintResourceString(IDS_HELP_CMD_DESC_RETAIN); + PrintResourceString(IDS_HELP_CMD_DESC_SAN); + PrintResourceString(IDS_HELP_CMD_DESC_SELECT); + PrintResourceString(IDS_HELP_CMD_DESC_SETID); + PrintResourceString(IDS_HELP_CMD_DESC_SHRINK); + PrintResourceString(IDS_HELP_CMD_DESC_UNIQUEID); + printf("\n"); +} + + +VOID help_help(INT argc, WCHAR **argv) +{ + PrintResourceString(IDS_HELP_CMD_HELP); +} + + + +/* help_main(char *arg): + * main entry point for the help command. Gives help to users who needs it. + */ +BOOL help_main(INT argc, WCHAR **argv) +{ + PCOMMAND cmdptr; + + if (argc == 1) + { + help_cmdlist(); + return TRUE; + } + + /* Scan internal command table */ + for (cmdptr = cmds; cmdptr->name; cmdptr++) + { + if (_wcsicmp(argv[0], cmdptr->name) == 0 && cmdptr->help != NULL) + { + cmdptr->help(argc, argv); + return TRUE; + } + } + + help_cmdlist(); + + return TRUE; +} Propchange: trunk/reactos/base/system/diskpart/help.c ------------------------------------------------------------------------------ svn:eol-style = native Propchange: trunk/reactos/base/system/diskpart/help.c ------------------------------------------------------------------------------ svn:keywords = author date id revision Added: trunk/reactos/base/system/diskpart/import.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/diskpart/impor…
============================================================================== --- trunk/reactos/base/system/diskpart/import.c (added) +++ trunk/reactos/base/system/diskpart/import.c [iso-8859-1] Sat Sep 24 10:33:33 2011 @@ -1,0 +1,19 @@ +/* + * PROJECT: ReactOS DiskPart + * LICENSE: GPL - See COPYING in the top level directory + * FILE: base/system/diskpart/import.c + * PURPOSE: Manages all the partitions of the OS in + * an interactive way + * PROGRAMMERS: Lee Schroeder + */ +#include "diskpart.h" + +BOOL import_main(INT argc, WCHAR **argv) +{ + return TRUE; +} + +VOID help_import(INT argc, WCHAR **argv) +{ + PrintResourceString(IDS_HELP_CMD_IMPORT); +} Propchange: trunk/reactos/base/system/diskpart/import.c ------------------------------------------------------------------------------ svn:eol-style = native Propchange: trunk/reactos/base/system/diskpart/import.c ------------------------------------------------------------------------------ svn:keywords = author date id revision Added: trunk/reactos/base/system/diskpart/inactive.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/diskpart/inact…
============================================================================== --- trunk/reactos/base/system/diskpart/inactive.c (added) +++ trunk/reactos/base/system/diskpart/inactive.c [iso-8859-1] Sat Sep 24 10:33:33 2011 @@ -1,0 +1,20 @@ +/* + * PROJECT: ReactOS DiskPart + * LICENSE: GPL - See COPYING in the top level directory + * FILE: base/system/diskpart/inactive.c + * PURPOSE: Manages all the partitions of the OS in + * an interactive way + * PROGRAMMERS: Lee Schroeder + */ +#include "diskpart.h" + +BOOL inactive_main(INT argc, WCHAR **argv) +{ + return TRUE; +} + + +VOID help_inactive(INT argc, WCHAR **argv) +{ + PrintResourceString(IDS_HELP_CMD_INACTIVE); +} Propchange: trunk/reactos/base/system/diskpart/inactive.c ------------------------------------------------------------------------------ svn:eol-style = native Propchange: trunk/reactos/base/system/diskpart/inactive.c ------------------------------------------------------------------------------ svn:keywords = author date id revision Added: trunk/reactos/base/system/diskpart/interpreter.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/diskpart/inter…
============================================================================== --- trunk/reactos/base/system/diskpart/interpreter.c (added) +++ trunk/reactos/base/system/diskpart/interpreter.c [iso-8859-1] Sat Sep 24 10:33:33 2011 @@ -1,0 +1,188 @@ +/* + * PROJECT: ReactOS DiskPart + * LICENSE: GPL - See COPYING in the top level directory + * FILE: base/system/diskpart/interpreter.c + * PURPOSE: Reads the user input and then envokes the selected + * command by the user. + * PROGRAMMERS: Lee Schroeder + */ + +#include "diskpart.h" + +BOOL exit_main(INT argc, WCHAR **argv); +BOOL rem_main(INT argc, WCHAR **argv); + + +COMMAND cmds[] = +{ + {L"active", active_main, help_active}, + {L"add", add_main, help_add}, + {L"assign", assign_main, help_assign}, + {L"attributes", attributes_main, help_attributes}, + {L"automount", automount_main, help_automount}, + {L"break", break_main, help_break}, + {L"clean", clean_main, help_clean}, + {L"compact", compact_main, help_compact}, + {L"convert", convert_main, help_convert}, + {L"create", create_main, help_create}, + {L"delete", delete_main, help_delete}, + {L"detail", detail_main, help_detail}, + {L"detach", detach_main, help_detach}, + {L"exit", exit_main, NULL}, + {L"expand", expand_main, help_expand}, + {L"extend", extend_main, help_extend}, + {L"filesystems", filesystems_main, help_filesystems}, + {L"format", format_main, help_format}, + {L"gpt", gpt_main, help_gpt}, + {L"help", help_main, help_help}, + {L"list", list_main, help_list}, + {L"import", import_main, help_import}, + {L"inactive", inactive_main, help_inactive}, + {L"merge", merge_main, help_merge}, + {L"offline", offline_main, help_offline}, + {L"online", online_main, help_online}, + {L"recover", recover_main, help_recover}, + {L"rem", rem_main, NULL}, + {L"remove", remove_main, help_remove}, + {L"repair", repair_main, help_repair}, + {L"rescan", rescan_main, help_rescan}, + {L"retain", retain_main, help_retain}, + {L"san", san_main, help_san}, + {L"select", select_main, help_select}, + {L"setid", setid_main, help_setid}, + {L"shrink", shrink_main, help_shrink}, + {L"uniqueid", uniqueid_main, help_uniqueid}, + {NULL, NULL, NULL} +}; + + +/* FUNCTIONS *****************************************************************/ + +BOOL +exit_main(INT argc, WCHAR **argv) +{ + return FALSE; +} + + +BOOL +rem_main(INT argc, WCHAR **argv) +{ + return TRUE; +} + + +/* + * interpret_cmd(char *cmd_line, char *arg_line): + * compares the command name to a list of available commands, and + * determines which function to envoke. + */ +BOOL +interpret_cmd(int argc, WCHAR **argv) +{ + PCOMMAND cmdptr; + + /* Scan internal command table */ + for (cmdptr = cmds; cmdptr->name; cmdptr++) + { + if (wcsicmp(argv[0], cmdptr->name) == 0) + { + return cmdptr->func(argc, argv); + } + } + + help_cmdlist(); + + return TRUE; +} + + +/* + * interpret_script(char *line): + * The main function used for when reading commands from scripts. + */ +BOOL +interpret_script(WCHAR *input_line) +{ + WCHAR *args_vector[MAX_ARGS_COUNT]; + INT args_count = 0; + BOOL bWhiteSpace = TRUE; + WCHAR *ptr; + + memset(args_vector, 0, sizeof(args_vector)); + + ptr = input_line; + while (*ptr != 0) + { + if (iswspace(*ptr) || *ptr == L'\n') + { + *ptr = 0; + bWhiteSpace = TRUE; + } + else + { + if ((bWhiteSpace == TRUE) && (args_count < MAX_ARGS_COUNT)) + { + args_vector[args_count] = ptr; + args_count++; + } + + bWhiteSpace = FALSE; + } + + ptr++; + } + + /* sends the string to find the command */ + return interpret_cmd(args_count, args_vector); +} + + +/* + * interpret_main(): + * Contents for the main program loop as it reads each line, and then + * it sends the string to interpret_line, where it determines what + * command to use. + */ +BOOL +interpret_main(VOID) +{ + WCHAR input_line[MAX_STRING_SIZE]; + WCHAR *args_vector[MAX_ARGS_COUNT]; + INT args_count = 0; + BOOL bWhiteSpace = TRUE; + WCHAR *ptr; + + memset(args_vector, 0, sizeof(args_vector)); + + /* shown just before the input where the user places commands */ + PrintResourceString(IDS_APP_PROMPT); + + /* gets input from the user. */ + fgetws(input_line, MAX_STRING_SIZE, stdin); + + ptr = input_line; + while (*ptr != 0) + { + if (iswspace(*ptr) || *ptr == L'\n') + { + *ptr = 0; + bWhiteSpace = TRUE; + } + else + { + if ((bWhiteSpace == TRUE) && (args_count < MAX_ARGS_COUNT)) + { + args_vector[args_count] = ptr; + args_count++; + } + + bWhiteSpace = FALSE; + } + + ptr++; + } + + /* sends the string to find the command */ + return interpret_cmd(args_count, args_vector); +} Propchange: trunk/reactos/base/system/diskpart/interpreter.c ------------------------------------------------------------------------------ svn:eol-style = native Propchange: trunk/reactos/base/system/diskpart/interpreter.c ------------------------------------------------------------------------------ svn:keywords = author date id revision Propchange: trunk/reactos/base/system/diskpart/lang/ ------------------------------------------------------------------------------ --- bugtraq:logregex (added) +++ bugtraq:logregex Sat Sep 24 10:33:33 2011 @@ -1,0 +1,2 @@ +([Ii]ssue|[Bb]ug)s? #?(\d+)(,? ?#?(\d+))*(,? ?(and |or )?#?(\d+))? +(\d+) Propchange: trunk/reactos/base/system/diskpart/lang/ ------------------------------------------------------------------------------ bugtraq:message = See issue #%BUGID% for more details. Propchange: trunk/reactos/base/system/diskpart/lang/ ------------------------------------------------------------------------------ bugtraq:url =
http://www.reactos.org/bugzilla/show_bug.cgi?id=%BUGID%
Propchange: trunk/reactos/base/system/diskpart/lang/ ------------------------------------------------------------------------------ tsvn:logminsize = 10 Added: trunk/reactos/base/system/diskpart/lang/en-US.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/diskpart/lang/…
============================================================================== --- trunk/reactos/base/system/diskpart/lang/en-US.rc (added) +++ trunk/reactos/base/system/diskpart/lang/en-US.rc [iso-8859-1] Sat Sep 24 10:33:33 2011 @@ -1,0 +1,359 @@ +/* + * ReactOS DiskPart Resource File + * Langauge: US English (en-US) + * Author: Lee Schroeder + */ + +#include <windows.h> + +#include "../resource.h" + +LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT + +/* Basic application information */ +STRINGTABLE DISCARDABLE +BEGIN + IDS_APP_HEADER, "\nReactOS DiskPart version %s\n" + IDS_APP_LICENSE, "Licensed under the GNU GPLv2\n" + IDS_APP_CURR_COMPUTER, "On computer: %s\n\n" + IDS_APP_LEAVING, "\nLeaving DiskPart...\n" + IDS_APP_PROMPT, "DISKPART> " +END + +/* Disk Information Labels */ +STRINGTABLE DISCARDABLE +BEGIN + IDS_DETAIL_INFO_DISK_ID, "Disk" + IDS_DETAIL_INFO_TYPE, "Type" + IDS_DETAIL_INFO_STATUS, "Status" + IDS_DETAIL_INFO_PATH, "Path" + IDS_DETAIL_INFO_TARGET, "Target" + IDS_DETAIL_INFO_LUN_ID, "LUN ID" + IDS_DETAIL_INFO_LOC_PATH, "Location Path" + IDS_DETAIL_INFO_CURR_RO_STATE, "Current Read-only State" + IDS_DETAIL_INFO_RO, "Read-only" + IDS_DETAIL_INFO_BOOT_DSK, "Boot Disk" + IDS_DETAIL_INFO_PAGE_FILE_DSK, "Pagefile Disk" + IDS_DETAIL_INFO_HIBER_FILE_DSK, "Hibernation File Disk" + IDS_DETAIL_INFO_CRASH_DSK, "Crashdump Disk" + IDS_DETAIL_INFO_CLST_DSK, "Clustered Disk" +END + +/* Detail header titles */ +STRINGTABLE DISCARDABLE +BEGIN + IDS_LIST_DISK_HEAD "Disk ### Status\tSize\tFree\tDyn\tGpt\n" + IDS_LIST_DISK_LINE "-------- ------\t----\t----\t---\t---\n" + IDS_LIST_VOLUME_HEAD "Volume ###\tLtr\tLabel\n" +END + +/* Disk Status */ +STRINGTABLE DISCARDABLE +BEGIN + IDS_STATUS_YES "Yes" + IDS_STATUS_NO "No" + IDS_STATUS_DISK_HEALTHY "Healthy" + IDS_STATUS_DISK_SICK "Sick" + IDS_STATUS_UNAVAILABLE "UNAVAILABLE" + IDS_STATUS_ONLINE "Online" + IDS_STATUS_OFFLINE "Offline" + IDS_STATUS_NO_MEDIA "No Media" +END + +/* CMD Messages for commands */ +STRINGTABLE DISCARDABLE +BEGIN + IDS_MSG_CURRENT_DSK_STATUS "is now the selected disk." + IDS_MSG_NO_DISK "There is no disk currently selected.\nPlease select a disk and try again." + IDS_MSG_ARG_SYNTAX_ERROR "The argument(s) specified for this command are not valid.\nFor more information on the command type:" +END + + +/* Help Command Descripions */ +STRINGTABLE DISCARDABLE +BEGIN + IDS_HELP_CMD_DESC_ACTIVE "ACTIVE\t\t- Mark the selected partition as active.\n" + IDS_HELP_CMD_DESC_ADD "ADD\t\t- Add a mirror to a simple volume.\n" + IDS_HELP_CMD_DESC_ASSIGN "ASSIGN\t\t- Assign a drive letter or mount point to the selected volume.\n" + IDS_HELP_CMD_DESC_ATTACH "ATTACH\t\t- Attaches a virtual disk file.\n" + IDS_HELP_CMD_DESC_ATTRIBUTES "ATTRIBUTES\t- Manipulate volume or disk attributes.\n" + IDS_HELP_CMD_DESC_AUTOMOUNT "AUTOMOUNT\t- Enable and Disable automatic mounting of basic volumes.\n" + IDS_HELP_CMD_DESC_BREAK "BREAK\t\t- Break a mirror set.\n" + IDS_HELP_CMD_DESC_CLEAN "CLEAN\t\t- Clear the configuration information, or all information, off\n\t\t the disk.\n" + IDS_HELP_CMD_DESC_COMPACT "COMPACT\t\t- Attempts to reduce the physical size of the file.\n" + IDS_HELP_CMD_DESC_CONVERT "CONVERT\t\t- Convert between different disk formats.\n" + IDS_HELP_CMD_DESC_CREATE "CREATE\t\t- Create a volume, partition, or virtual disk.\n" + IDS_HELP_CMD_DESC_DELETE "DELETE\t\t- Delete an object.\n" + IDS_HELP_CMD_DESC_DETACH "DETACH\t\t- Detaches a virtual disk file.\n" + IDS_HELP_CMD_DESC_DETAIL "DETAIL\t\t- Provide details about an object.\n" + IDS_HELP_CMD_DESC_EXIT "EXIT\t\t- Exit DiskPart.\n" + IDS_HELP_CMD_DESC_EXPAND "EXPAND\t\t- Expands the maximum size available on a virtual disk.\n" + IDS_HELP_CMD_DESC_EXTEND "EXTEND\t\t- Extend a volume.\n" + IDS_HELP_CMD_DESC_FS "FILESYSTEMS\t- Display current and supported file systems on the volume.\n" + IDS_HELP_CMD_DESC_FORMAT "FORMAT\t\t- Format the volume or partition.\n" + IDS_HELP_CMD_DESC_GPT "GPT\t\t- Assign attributes to the selected GPT partition.\n" + IDS_HELP_CMD_DESC_HELP "HELP\t\t- Display a list of commands.\n" + IDS_HELP_CMD_DESC_IMPORT "IMPORT\t\t- Import a disk group.\n" + IDS_HELP_CMD_DESC_INACTIVE "INACTIVE\t- Mark the selected partition as inactive.\n" + IDS_HELP_CMD_DESC_LIST "LIST\t\t- Display a list of objects.\n" + IDS_HELP_CMD_DESC_MERGE "MERGE\t\t- Merges a child disk with its parents.\n" + IDS_HELP_CMD_DESC_OFFLINE "OFFLINE\t\t- Offline an object that is currently marked as online.\n" + IDS_HELP_CMD_DESC_ONLINE "ONLINE\t\t- Online an object that is currently marked as offline.\n" + IDS_HELP_CMD_DESC_RECOVER "RECOVER\t\t- Refreshes the state of all disks in the invalid pack,\n\t\t and resynchronizes mirrored volumes and RAID5 volumes\n\t\t that have stale plex or parity data.\n" + IDS_HELP_CMD_DESC_REM "REM\t\t- Does nothing. This is used to comment scripts.\n" + IDS_HELP_CMD_DESC_REMOVE "REMOVE\t\t- Remove a drive letter or mount point assignment.\n" + IDS_HELP_CMD_DESC_REPAIR "REPAIR\t\t- Repair a RAID-5 volume with a failed member.\n" + IDS_HELP_CMD_DESC_RESCAN "RESCAN\t\t- Rescan the computer looking for disks and volumes.\n" + IDS_HELP_CMD_DESC_RETAIN "RETAIN\t\t- Place a retained partition under a simple volume.\n" + IDS_HELP_CMD_DESC_SAN "SAN\t\t- Display or set the SAN policy for the currently booted OS.\n" + IDS_HELP_CMD_DESC_SELECT "SELECT\t\t- Shift the focus to an object.\n" + IDS_HELP_CMD_DESC_SETID "SETID\t\t- Change the partition type.\n" + IDS_HELP_CMD_DESC_SHRINK "SHRINK\t\t- Reduce the size of the selected volume.\n" + IDS_HELP_CMD_DESC_UNIQUEID "UNIQUEID\t- Displays or sets the GUID partition table (GPT) identifier\n\t\t or master boot record (MBR) signature of a disk." +END + +/* Common Error Messages */ +STRINGTABLE DISCARDABLE +BEGIN + IDS_ERROR_MSG_NO_SCRIPT "Error opening script file: %s\n" +END + + + +/* Active help descriptions */ +STRINGTABLE DISCARDABLE +BEGIN + IDS_HELP_CMD_ACTIVE "\n\ +<Add active command help text here>\n\n" +END + +/* Add help descriptions */ +STRINGTABLE DISCARDABLE +BEGIN + IDS_HELP_CMD_ADD "\n\ +<Add add command help text here>\n\n" +END + +/* Assign help descriptions */ +STRINGTABLE DISCARDABLE +BEGIN + IDS_HELP_CMD_ASSIGN "\n\ +<Add assign command help text here>\n\n" +END + +/* Attach help description */ +STRINGTABLE DISCARDABLE +BEGIN + IDS_HELP_CMD_ATTACH "\n\ +<Add attach command help text here>\n\n" +END + +/* Attributes Command Messages */ +STRINGTABLE DISCARDABLE +BEGIN + IDS_HELP_CMD_ATTRIBUTES "\n\ +<Add attributes command help text here>\n\n" +END + +/* Automount help descriptions */ +STRINGTABLE DISCARDABLE +BEGIN + IDS_HELP_CMD_AUTOMOUNT "\n\ +<Add automount command help text here>\n\n" +END + +/* Break help descriptions */ +STRINGTABLE DISCARDABLE +BEGIN + IDS_HELP_CMD_BREAK "\n\ +<Add break command help text here>\n\n" +END + +/* Clean help descriptions */ +STRINGTABLE DISCARDABLE +BEGIN + IDS_HELP_CMD_CLEAN "\n\ +<Add clean command help text here>\n\n" +END + +/* Compact help description */ +STRINGTABLE DISCARDABLE +BEGIN + IDS_HELP_CMD_COMPACT "\n\ +<Add compact command help text here>\n\n" +END + +/* Convert help description */ +STRINGTABLE DISCARDABLE +BEGIN + IDS_HELP_CMD_CONVERT "\n\ +<Add convert command help text here>\n\n" +END + +/* Delete help description */ +STRINGTABLE DISCARDABLE +BEGIN + IDS_HELP_CMD_DELETE "\n\ +<Add delete command help text here>\n\n" +END + +/* Detach help description */ +STRINGTABLE DISCARDABLE +BEGIN + IDS_HELP_CMD_DETACH "\n\ +<Add detach command help text here>\n\n" +END + +/* Expand help description */ +STRINGTABLE DISCARDABLE +BEGIN + IDS_HELP_CMD_EXPAND "\n\ +<Add expand command help text here>\n\n" +END + +/* Extend help description */ +STRINGTABLE DISCARDABLE +BEGIN + IDS_HELP_CMD_EXTEND "\n\ +<Add extend command help text here>\n\n" +END + +/* Filesystems help description */ +STRINGTABLE DISCARDABLE +BEGIN + IDS_HELP_CMD_FILESYSTEMS "\n\ +<Add filesystems command help text here>\n\n" +END + +/* Format help description */ +STRINGTABLE DISCARDABLE +BEGIN + IDS_HELP_CMD_FORMAT "\n\ +<Add format command help text here>\n\n" +END + +/* GPT help description */ +STRINGTABLE DISCARDABLE +BEGIN + IDS_HELP_CMD_GPT "\n\ +<Add gpt command help text here>\n\n" +END + +/* Help help descriptions */ +STRINGTABLE DISCARDABLE +BEGIN + IDS_HELP_CMD_HELP "\n\ +<Add help command help text here>\n\n" +END + +/* Import help descriptions */ +STRINGTABLE DISCARDABLE +BEGIN + IDS_HELP_CMD_IMPORT "\n\ +<Add import command help text here>\n\n" +END + +/* Inactive help descriptions */ +STRINGTABLE DISCARDABLE +BEGIN + IDS_HELP_CMD_INACTIVE "\n\ +<Add inactive command help text here>\n\n" +END + +/* List help descriptions */ +STRINGTABLE DISCARDABLE +BEGIN + IDS_HELP_CMD_LIST "\n\ +<Add list command help text here>\n\n" +END + +/* Merge help descriptions */ +STRINGTABLE DISCARDABLE +BEGIN + IDS_HELP_CMD_MERGE "\n\ +<Add merge command help text here>\n\n" +END + +/* Offline help descriptions */ +STRINGTABLE DISCARDABLE +BEGIN + IDS_HELP_CMD_OFFLINE "\n\ +<Add OFFLINE command help text here>\n\n" +END + +/* Online help descriptions */ +STRINGTABLE DISCARDABLE +BEGIN + IDS_HELP_CMD_ONLINE "\n\ +<Add ONLINE command help text here>\n\n" +END + +/* Recover help descriptions */ +STRINGTABLE DISCARDABLE +BEGIN + IDS_HELP_CMD_RECOVER "\n\ +<Add RECOVER command help text here>\n\n" +END + +/* Remove help descriptions */ +STRINGTABLE DISCARDABLE +BEGIN + IDS_HELP_CMD_REMOVE "\n\ +<Add REMOVE command help text here>\n\n" +END + +/* Repair help descriptions */ +STRINGTABLE DISCARDABLE +BEGIN + IDS_HELP_CMD_REPAIR "\n\ +<Add REPAIR command help text here>\n\n" +END + +/* Rescan help descriptions */ +STRINGTABLE DISCARDABLE +BEGIN + IDS_HELP_CMD_RESCAN "\n\ +<Add RESCAN command help text here>\n\n" +END + +/* Retain help descriptions */ +STRINGTABLE DISCARDABLE +BEGIN + IDS_HELP_CMD_RETAIN "\n\ +<Add RETAIN command help text here>\n\n" +END + +/* San help descriptions */ +STRINGTABLE DISCARDABLE +BEGIN + IDS_HELP_CMD_SAN "\n\ +<Add SAN command help text here>\n\n" +END + +/* Select help descriptions */ +STRINGTABLE DISCARDABLE +BEGIN + IDS_HELP_CMD_SELECT "\n\ +<Add SELECT command help text here>\n\n" +END + +/* Setid help descriptions */ +STRINGTABLE DISCARDABLE +BEGIN + IDS_HELP_CMD_SETID "\n\ +<Add SETID command help text here>\n\n" +END + +/* Setid help descriptions */ +STRINGTABLE DISCARDABLE +BEGIN + IDS_HELP_CMD_SHRINK "\n\ +<Add SHRINK command help text here>\n\n" +END + +/* Uniqueid help descriptions */ +STRINGTABLE DISCARDABLE +BEGIN + IDS_HELP_CMD_UNIQUEID "\n\ +<Add UNIQUEID command help text here>\n\n" +END Propchange: trunk/reactos/base/system/diskpart/lang/en-US.rc ------------------------------------------------------------------------------ svn:eol-style = native Propchange: trunk/reactos/base/system/diskpart/lang/en-US.rc ------------------------------------------------------------------------------ svn:keywords = author date id revision Added: trunk/reactos/base/system/diskpart/list.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/diskpart/list.…
============================================================================== --- trunk/reactos/base/system/diskpart/list.c (added) +++ trunk/reactos/base/system/diskpart/list.c [iso-8859-1] Sat Sep 24 10:33:33 2011 @@ -1,0 +1,73 @@ +/* + * PROJECT: ReactOS DiskPart + * LICENSE: GPL - See COPYING in the top level directory + * FILE: base/system/diskpart/list.c + * PURPOSE: Manages all the partitions of the OS in + * an interactive way + * PROGRAMMERS: Lee Schroeder + */ +#include "diskpart.h" + +static VOID list_disk(VOID) +{ + /* Header labels */ + PrintResourceString(IDS_LIST_DISK_HEAD); + PrintResourceString(IDS_LIST_DISK_LINE); + + printf("\n\n"); +} + +static VOID list_partition(VOID) +{ + printf("List Partition!!\n"); +} + +static VOID list_volume(VOID) +{ + PrintResourceString(IDS_LIST_VOLUME_HEAD); +} + +static VOID list_vdisk(VOID) +{ + printf("List VDisk!!\n"); +} + +BOOL list_main(INT argc, WCHAR **argv) +{ + /* gets the first word from the string */ + if (argc == 1) + { + help_list(0, NULL); + return TRUE; + } + + /* determines which to list (disk, partition, etc.) */ + if(!wcsicmp(argv[1], L"disk")) + { + list_disk(); + } + else if(!wcsicmp(argv[1], L"partition")) + { + list_partition(); + } + else if(!wcsicmp(argv[1], L"volume")) + { + list_volume(); + } + else if(!wcsicmp(argv[1], L"vdisk")) + { + list_vdisk(); + } + else + { + help_list(0, NULL); + } + + return TRUE; +} + + +VOID help_list(INT argc, WCHAR **argv) +{ + PrintResourceString(IDS_HELP_CMD_LIST); +} Propchange: trunk/reactos/base/system/diskpart/list.c ------------------------------------------------------------------------------ svn:eol-style = native Propchange: trunk/reactos/base/system/diskpart/list.c ------------------------------------------------------------------------------ svn:keywords = author date id revision Added: trunk/reactos/base/system/diskpart/merge.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/diskpart/merge…
============================================================================== --- trunk/reactos/base/system/diskpart/merge.c (added) +++ trunk/reactos/base/system/diskpart/merge.c [iso-8859-1] Sat Sep 24 10:33:33 2011 @@ -1,0 +1,20 @@ +/* + * PROJECT: ReactOS DiskPart + * LICENSE: GPL - See COPYING in the top level directory + * FILE: base/system/diskpart/merge.c + * PURPOSE: Manages all the partitions of the OS in + * an interactive way + * PROGRAMMERS: Lee Schroeder + */ +#include "diskpart.h" + +BOOL merge_main(INT argc, WCHAR **argv) +{ + return TRUE; +} + + +VOID help_merge(INT argc, WCHAR **argv) +{ + PrintResourceString(IDS_HELP_CMD_MERGE); +} Propchange: trunk/reactos/base/system/diskpart/merge.c ------------------------------------------------------------------------------ svn:eol-style = native Propchange: trunk/reactos/base/system/diskpart/merge.c ------------------------------------------------------------------------------ svn:keywords = author date id revision Added: trunk/reactos/base/system/diskpart/offline.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/diskpart/offli…
============================================================================== --- trunk/reactos/base/system/diskpart/offline.c (added) +++ trunk/reactos/base/system/diskpart/offline.c [iso-8859-1] Sat Sep 24 10:33:33 2011 @@ -1,0 +1,20 @@ +/* + * PROJECT: ReactOS DiskPart + * LICENSE: GPL - See COPYING in the top level directory + * FILE: base/system/diskpart/offline.c + * PURPOSE: Manages all the partitions of the OS in + * an interactive way + * PROGRAMMERS: Lee Schroeder + */ +#include "diskpart.h" + +BOOL offline_main(INT argc, WCHAR **argv) +{ + return TRUE; +} + + +VOID help_offline(INT argc, WCHAR **argv) +{ + PrintResourceString(IDS_HELP_CMD_OFFLINE); +} Propchange: trunk/reactos/base/system/diskpart/offline.c ------------------------------------------------------------------------------ svn:eol-style = native Propchange: trunk/reactos/base/system/diskpart/offline.c ------------------------------------------------------------------------------ svn:keywords = author date id revision Added: trunk/reactos/base/system/diskpart/online.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/diskpart/onlin…
============================================================================== --- trunk/reactos/base/system/diskpart/online.c (added) +++ trunk/reactos/base/system/diskpart/online.c [iso-8859-1] Sat Sep 24 10:33:33 2011 @@ -1,0 +1,22 @@ +/* + * PROJECT: ReactOS DiskPart + * LICENSE: GPL - See COPYING in the top level directory + * FILE: base/system/diskpart/online.h + * PURPOSE: Manages all the partitions of the OS in + * an interactive way + * PROGRAMMERS: Lee Schroeder + */ +#include "diskpart.h" + +BOOL online_main(INT argc, WCHAR **argv) +{ + help_online(0, NULL); + + return TRUE; +} + + +VOID help_online(INT argc, WCHAR **argv) +{ + PrintResourceString(IDS_HELP_CMD_ONLINE); +} Propchange: trunk/reactos/base/system/diskpart/online.c ------------------------------------------------------------------------------ svn:eol-style = native Propchange: trunk/reactos/base/system/diskpart/online.c ------------------------------------------------------------------------------ svn:keywords = author date id revision Added: trunk/reactos/base/system/diskpart/recover.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/diskpart/recov…
============================================================================== --- trunk/reactos/base/system/diskpart/recover.c (added) +++ trunk/reactos/base/system/diskpart/recover.c [iso-8859-1] Sat Sep 24 10:33:33 2011 @@ -1,0 +1,20 @@ +/* + * PROJECT: ReactOS DiskPart + * LICENSE: GPL - See COPYING in the top level directory + * FILE: base/system/diskpart/recover.c + * PURPOSE: Manages all the partitions of the OS in + * an interactive way + * PROGRAMMERS: Lee Schroeder + */ +#include "diskpart.h" + +BOOL recover_main(INT argc, WCHAR **argv) +{ + return TRUE; +} + + +VOID help_recover(INT argc, WCHAR **argv) +{ + PrintResourceString(IDS_HELP_CMD_RECOVER); +} Propchange: trunk/reactos/base/system/diskpart/recover.c ------------------------------------------------------------------------------ svn:eol-style = native Propchange: trunk/reactos/base/system/diskpart/recover.c ------------------------------------------------------------------------------ svn:keywords = author date id revision Added: trunk/reactos/base/system/diskpart/remove.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/diskpart/remov…
============================================================================== --- trunk/reactos/base/system/diskpart/remove.c (added) +++ trunk/reactos/base/system/diskpart/remove.c [iso-8859-1] Sat Sep 24 10:33:33 2011 @@ -1,0 +1,20 @@ +/* + * PROJECT: ReactOS DiskPart + * LICENSE: GPL - See COPYING in the top level directory + * FILE: base/system/diskpart/remove.c + * PURPOSE: Manages all the partitions of the OS in + * an interactive way + * PROGRAMMERS: Lee Schroeder + */ +#include "diskpart.h" + +BOOL remove_main(INT argc, WCHAR **argv) +{ + return TRUE; +} + + +VOID help_remove(INT argc, WCHAR **argv) +{ + PrintResourceString(IDS_HELP_CMD_REMOVE); +} Propchange: trunk/reactos/base/system/diskpart/remove.c ------------------------------------------------------------------------------ svn:eol-style = native Propchange: trunk/reactos/base/system/diskpart/remove.c ------------------------------------------------------------------------------ svn:keywords = author date id revision Added: trunk/reactos/base/system/diskpart/remove.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/diskpart/remov…
============================================================================== --- trunk/reactos/base/system/diskpart/remove.h (added) +++ trunk/reactos/base/system/diskpart/remove.h [iso-8859-1] Sat Sep 24 10:33:33 2011 @@ -1,0 +1,16 @@ +/* + * PROJECT: ReactOS DiskPart + * LICENSE: GPL - See COPYING in the top level directory + * FILE: base/system/diskpart/remove.h + * PURPOSE: Manages all the partitions of the OS in + * an interactive way + * PROGRAMMERS: Lee Schroeder + */ +#ifndef REMOVE_H_INCLUDED +#define REMOVE_H_INCLUDED + +/* FUNCTIONS *****************************************************************/ +BOOL remove_main(INT argc, WCHAR **argv); +VOID help_remove(INT argc, WCHAR **argv); + +#endif // REMOVE_H_INCLUDED Propchange: trunk/reactos/base/system/diskpart/remove.h ------------------------------------------------------------------------------ svn:eol-style = native Propchange: trunk/reactos/base/system/diskpart/remove.h ------------------------------------------------------------------------------ svn:keywords = author date id revision Added: trunk/reactos/base/system/diskpart/repair.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/diskpart/repai…
============================================================================== --- trunk/reactos/base/system/diskpart/repair.c (added) +++ trunk/reactos/base/system/diskpart/repair.c [iso-8859-1] Sat Sep 24 10:33:33 2011 @@ -1,0 +1,22 @@ +/* + * PROJECT: ReactOS DiskPart + * LICENSE: GPL - See COPYING in the top level directory + * FILE: base/system/diskpart/repair.c + * PURPOSE: Manages all the partitions of the OS in + * an interactive way + * PROGRAMMERS: Lee Schroeder + */ +#include "diskpart.h" + +BOOL repair_main(INT argc, WCHAR **argv) +{ + printf("\nTODO: Add code later since Win 7 Home Premium doesn't have this feature.\n"); + + return TRUE; +} + + +VOID help_repair(INT argc, WCHAR **argv) +{ + PrintResourceString(IDS_HELP_CMD_REPAIR); +} Propchange: trunk/reactos/base/system/diskpart/repair.c ------------------------------------------------------------------------------ svn:eol-style = native Propchange: trunk/reactos/base/system/diskpart/repair.c ------------------------------------------------------------------------------ svn:keywords = author date id revision Added: trunk/reactos/base/system/diskpart/rescan.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/diskpart/resca…
============================================================================== --- trunk/reactos/base/system/diskpart/rescan.c (added) +++ trunk/reactos/base/system/diskpart/rescan.c [iso-8859-1] Sat Sep 24 10:33:33 2011 @@ -1,0 +1,20 @@ +/* + * PROJECT: ReactOS DiskPart + * LICENSE: GPL - See COPYING in the top level directory + * FILE: base/system/diskpart/rescan.c + * PURPOSE: Manages all the partitions of the OS in + * an interactive way + * PROGRAMMERS: Lee Schroeder + */ +#include "diskpart.h" + +BOOL rescan_main(INT argc, WCHAR **argv) +{ + return TRUE; +} + + +VOID help_rescan(INT argc, WCHAR **argv) +{ + PrintResourceString(IDS_HELP_CMD_RESCAN); +} Propchange: trunk/reactos/base/system/diskpart/rescan.c ------------------------------------------------------------------------------ svn:eol-style = native Propchange: trunk/reactos/base/system/diskpart/rescan.c ------------------------------------------------------------------------------ svn:keywords = author date id revision Added: trunk/reactos/base/system/diskpart/resource.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/diskpart/resou…
============================================================================== --- trunk/reactos/base/system/diskpart/resource.h (added) +++ trunk/reactos/base/system/diskpart/resource.h [iso-8859-1] Sat Sep 24 10:33:33 2011 @@ -1,0 +1,128 @@ +/* + * PROJECT: ReactOS DiskPart + * LICENSE: GPL - See COPYING in the top level directory + * FILE: base/system/diskpart/lang/resource.h + * PURPOSE: Manages all the partitions of the OS in + * an interactive way + * PROGRAMMERS: Lee Schroeder + */ +#ifndef RESOURCE_H +#define RESOURCE_H + +#define IDS_APP_HEADER 0 +#define IDS_APP_LICENSE 2 +#define IDS_APP_CURR_COMPUTER 3 +#define IDS_APP_LEAVING 4 +#define IDS_APP_PROMPT 5 + +#define IDS_DETAIL_INFO_DISK_ID 6 +#define IDS_DETAIL_INFO_TYPE 7 +#define IDS_DETAIL_INFO_STATUS 8 +#define IDS_DETAIL_INFO_PATH 9 +#define IDS_DETAIL_INFO_TARGET 10 +#define IDS_DETAIL_INFO_LUN_ID 11 +#define IDS_DETAIL_INFO_LOC_PATH 12 +#define IDS_DETAIL_INFO_CURR_RO_STATE 13 +#define IDS_DETAIL_INFO_RO 14 +#define IDS_DETAIL_INFO_BOOT_DSK 15 +#define IDS_DETAIL_INFO_PAGE_FILE_DSK 16 +#define IDS_DETAIL_INFO_HIBER_FILE_DSK 17 +#define IDS_DETAIL_INFO_CRASH_DSK 18 +#define IDS_DETAIL_INFO_CLST_DSK 19 + +#define IDS_LIST_DISK_HEAD 20 +#define IDS_LIST_DISK_LINE 21 +#define IDS_LIST_VOLUME_HEAD 22 + +#define IDS_STATUS_YES 31 +#define IDS_STATUS_NO 32 +#define IDS_STATUS_DISK_HEALTHY 33 +#define IDS_STATUS_DISK_SICK 34 +#define IDS_STATUS_UNAVAILABLE 35 +#define IDS_STATUS_ONLINE 36 +#define IDS_STATUS_OFFLINE 37 +#define IDS_STATUS_NO_MEDIA 38 + +#define IDS_MSG_CURRENT_DSK_STATUS 39 +#define IDS_MSG_NO_DISK 40 +#define IDS_MSG_ARG_SYNTAX_ERROR 41 + +#define IDS_HELP_CMD_DESC_ACTIVE 58 +#define IDS_HELP_CMD_DESC_ADD 59 +#define IDS_HELP_CMD_DESC_ASSIGN 60 +#define IDS_HELP_CMD_DESC_ATTRIBUTES 61 +#define IDS_HELP_CMD_DESC_ATTACH 62 +#define IDS_HELP_CMD_DESC_AUTOMOUNT 63 +#define IDS_HELP_CMD_DESC_BREAK 64 +#define IDS_HELP_CMD_DESC_CLEAN 65 +#define IDS_HELP_CMD_DESC_COMPACT 66 +#define IDS_HELP_CMD_DESC_CONVERT 67 +#define IDS_HELP_CMD_DESC_CREATE 68 +#define IDS_HELP_CMD_DESC_DELETE 69 +#define IDS_HELP_CMD_DESC_DETAIL 70 +#define IDS_HELP_CMD_DESC_DETACH 71 +#define IDS_HELP_CMD_DESC_EXIT 72 +#define IDS_HELP_CMD_DESC_EXTEND 73 +#define IDS_HELP_CMD_DESC_EXPAND 74 +#define IDS_HELP_CMD_DESC_FS 75 +#define IDS_HELP_CMD_DESC_FORMAT 76 +#define IDS_HELP_CMD_DESC_GPT 77 +#define IDS_HELP_CMD_DESC_HELP 78 +#define IDS_HELP_CMD_DESC_IMPORT 79 +#define IDS_HELP_CMD_DESC_INACTIVE 80 +#define IDS_HELP_CMD_DESC_LIST 81 +#define IDS_HELP_CMD_DESC_MERGE 82 +#define IDS_HELP_CMD_DESC_ONLINE 83 +#define IDS_HELP_CMD_DESC_OFFLINE 84 +#define IDS_HELP_CMD_DESC_RECOVER 85 +#define IDS_HELP_CMD_DESC_REM 88 +#define IDS_HELP_CMD_DESC_REMOVE 89 +#define IDS_HELP_CMD_DESC_REPAIR 90 +#define IDS_HELP_CMD_DESC_RESCAN 91 +#define IDS_HELP_CMD_DESC_RETAIN 92 +#define IDS_HELP_CMD_DESC_SAN 93 +#define IDS_HELP_CMD_DESC_SELECT 94 +#define IDS_HELP_CMD_DESC_SETID 95 +#define IDS_HELP_CMD_DESC_SHRINK 96 +#define IDS_HELP_CMD_DESC_UNIQUEID 97 + +#define IDS_ERROR_MSG_NO_SCRIPT 104 + +#define IDS_HELP_CMD_ACTIVE 105 +#define IDS_HELP_CMD_ADD 106 +#define IDS_HELP_CMD_ASSIGN 107 +#define IDS_HELP_CMD_ATTACH 108 +#define IDS_HELP_CMD_ATTRIBUTES 109 +#define IDS_HELP_CMD_AUTOMOUNT 110 +#define IDS_HELP_CMD_BREAK 111 +#define IDS_HELP_CMD_CLEAN 112 +#define IDS_HELP_CMD_COMPACT 113 +#define IDS_HELP_CMD_CONVERT 114 +#define IDS_HELP_CMD_CREATE 115 +#define IDS_HELP_CMD_DELETE 116 +#define IDS_HELP_CMD_DETACH 117 +#define IDS_HELP_CMD_DETAIL 118 +#define IDS_HELP_CMD_EXPAND 119 +#define IDS_HELP_CMD_EXTEND 120 +#define IDS_HELP_CMD_FILESYSTEMS 121 +#define IDS_HELP_CMD_FORMAT 122 +#define IDS_HELP_CMD_GPT 123 +#define IDS_HELP_CMD_HELP 124 +#define IDS_HELP_CMD_IMPORT 125 +#define IDS_HELP_CMD_INACTIVE 126 +#define IDS_HELP_CMD_LIST 127 +#define IDS_HELP_CMD_MERGE 128 +#define IDS_HELP_CMD_OFFLINE 129 +#define IDS_HELP_CMD_ONLINE 130 +#define IDS_HELP_CMD_RECOVER 131 +#define IDS_HELP_CMD_REMOVE 132 +#define IDS_HELP_CMD_REPAIR 133 +#define IDS_HELP_CMD_RESCAN 134 +#define IDS_HELP_CMD_RETAIN 135 +#define IDS_HELP_CMD_SAN 136 +#define IDS_HELP_CMD_SELECT 137 +#define IDS_HELP_CMD_SETID 138 +#define IDS_HELP_CMD_SHRINK 139 +#define IDS_HELP_CMD_UNIQUEID 140 + +#endif // RESOURCE_H Propchange: trunk/reactos/base/system/diskpart/resource.h ------------------------------------------------------------------------------ svn:eol-style = native Propchange: trunk/reactos/base/system/diskpart/resource.h ------------------------------------------------------------------------------ svn:keywords = author date id revision Added: trunk/reactos/base/system/diskpart/retain.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/diskpart/retai…
============================================================================== --- trunk/reactos/base/system/diskpart/retain.c (added) +++ trunk/reactos/base/system/diskpart/retain.c [iso-8859-1] Sat Sep 24 10:33:33 2011 @@ -1,0 +1,20 @@ +/* + * PROJECT: ReactOS DiskPart + * LICENSE: GPL - See COPYING in the top level directory + * FILE: base/system/diskpart/retain.c + * PURPOSE: Manages all the partitions of the OS in + * an interactive way + * PROGRAMMERS: Lee Schroeder + */ +#include "diskpart.h" + +BOOL retain_main(INT argc, WCHAR **argv) +{ + return TRUE; +} + + +VOID help_retain(INT argc, WCHAR **argv) +{ + PrintResourceString(IDS_HELP_CMD_RETAIN); +} Propchange: trunk/reactos/base/system/diskpart/retain.c ------------------------------------------------------------------------------ svn:eol-style = native Propchange: trunk/reactos/base/system/diskpart/retain.c ------------------------------------------------------------------------------ svn:keywords = author date id revision Added: trunk/reactos/base/system/diskpart/san.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/diskpart/san.c…
============================================================================== --- trunk/reactos/base/system/diskpart/san.c (added) +++ trunk/reactos/base/system/diskpart/san.c [iso-8859-1] Sat Sep 24 10:33:33 2011 @@ -1,0 +1,20 @@ +/* + * PROJECT: ReactOS DiskPart + * LICENSE: GPL - See COPYING in the top level directory + * FILE: base/system/diskpart/san.c + * PURPOSE: Manages all the partitions of the OS in + * an interactive way + * PROGRAMMERS: Lee Schroeder + */ +#include "diskpart.h" + +BOOL san_main(INT argc, WCHAR **argv) +{ + return TRUE; +} + + +VOID help_san(INT argc, WCHAR **argv) +{ + PrintResourceString(IDS_HELP_CMD_SAN); +} Propchange: trunk/reactos/base/system/diskpart/san.c ------------------------------------------------------------------------------ svn:eol-style = native Propchange: trunk/reactos/base/system/diskpart/san.c ------------------------------------------------------------------------------ svn:keywords = author date id revision Added: trunk/reactos/base/system/diskpart/select.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/diskpart/selec…
============================================================================== --- trunk/reactos/base/system/diskpart/select.c (added) +++ trunk/reactos/base/system/diskpart/select.c [iso-8859-1] Sat Sep 24 10:33:33 2011 @@ -1,0 +1,20 @@ +/* + * PROJECT: ReactOS DiskPart + * LICENSE: GPL - See COPYING in the top level directory + * FILE: base/system/diskpart/select.c + * PURPOSE: Manages all the partitions of the OS in + * an interactive way + * PROGRAMMERS: Lee Schroeder + */ +#include "diskpart.h" + +BOOL select_main(INT argc, WCHAR **argv) +{ + return TRUE; +} + + +VOID help_select(INT argc, WCHAR **argv) +{ + PrintResourceString(IDS_HELP_CMD_SELECT); +} Propchange: trunk/reactos/base/system/diskpart/select.c ------------------------------------------------------------------------------ svn:eol-style = native Propchange: trunk/reactos/base/system/diskpart/select.c ------------------------------------------------------------------------------ svn:keywords = author date id revision Added: trunk/reactos/base/system/diskpart/setid.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/diskpart/setid…
============================================================================== --- trunk/reactos/base/system/diskpart/setid.c (added) +++ trunk/reactos/base/system/diskpart/setid.c [iso-8859-1] Sat Sep 24 10:33:33 2011 @@ -1,0 +1,20 @@ +/* + * PROJECT: ReactOS DiskPart + * LICENSE: GPL - See COPYING in the top level directory + * FILE: base/system/diskpart/setid.c + * PURPOSE: Manages all the partitions of the OS in + * an interactive way + * PROGRAMMERS: Lee Schroeder + */ +#include "diskpart.h" + +BOOL setid_main(INT argc, WCHAR **argv) +{ + return TRUE; +} + + +VOID help_setid(INT argc, WCHAR **argv) +{ + PrintResourceString(IDS_HELP_CMD_SETID); +} Propchange: trunk/reactos/base/system/diskpart/setid.c ------------------------------------------------------------------------------ svn:eol-style = native Propchange: trunk/reactos/base/system/diskpart/setid.c ------------------------------------------------------------------------------ svn:keywords = author date id revision Added: trunk/reactos/base/system/diskpart/shrink.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/diskpart/shrin…
============================================================================== --- trunk/reactos/base/system/diskpart/shrink.c (added) +++ trunk/reactos/base/system/diskpart/shrink.c [iso-8859-1] Sat Sep 24 10:33:33 2011 @@ -1,0 +1,20 @@ +/* + * PROJECT: ReactOS DiskPart + * LICENSE: GPL - See COPYING in the top level directory + * FILE: base/system/diskpart/shrink.c + * PURPOSE: Manages all the partitions of the OS in + * an interactive way + * PROGRAMMERS: Lee Schroeder + */ +#include "diskpart.h" + +BOOL shrink_main(INT argc, WCHAR **argv) +{ + return TRUE; +} + + +VOID help_shrink(INT argc, WCHAR **argv) +{ + PrintResourceString(IDS_HELP_CMD_SHRINK); +} Propchange: trunk/reactos/base/system/diskpart/shrink.c ------------------------------------------------------------------------------ svn:eol-style = native Propchange: trunk/reactos/base/system/diskpart/shrink.c ------------------------------------------------------------------------------ svn:keywords = author date id revision Added: trunk/reactos/base/system/diskpart/uniqueid.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/diskpart/uniqu…
============================================================================== --- trunk/reactos/base/system/diskpart/uniqueid.c (added) +++ trunk/reactos/base/system/diskpart/uniqueid.c [iso-8859-1] Sat Sep 24 10:33:33 2011 @@ -1,0 +1,20 @@ +/* + * PROJECT: ReactOS DiskPart + * LICENSE: GPL - See COPYING in the top level directory + * FILE: base/system/diskpart/uniqueid.c + * PURPOSE: Manages all the partitions of the OS in + * an interactive way + * PROGRAMMERS: Lee Schroeder + */ +#include "diskpart.h" + +BOOL uniqueid_main(INT argc, WCHAR **argv) +{ + return TRUE; +} + + +VOID help_uniqueid(INT argc, WCHAR **argv) +{ + PrintResourceString(IDS_HELP_CMD_UNIQUEID); +} Propchange: trunk/reactos/base/system/diskpart/uniqueid.c ------------------------------------------------------------------------------ svn:eol-style = native Propchange: trunk/reactos/base/system/diskpart/uniqueid.c ------------------------------------------------------------------------------ svn:keywords = author date id revision Modified: trunk/reactos/base/system/system.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/system.rbuild?…
============================================================================== --- trunk/reactos/base/system/system.rbuild [iso-8859-1] (original) +++ trunk/reactos/base/system/system.rbuild [iso-8859-1] Sat Sep 24 10:33:33 2011 @@ -6,6 +6,9 @@ </directory> <directory name="bootok"> <xi:include href="bootok/bootok.rbuild" /> + </directory> + <directory name="diskpart"> + <xi:include href="diskpart/diskpart.rbuild" /> </directory> <directory name="expand"> <xi:include href="expand/expand.rbuild" />
13 years, 3 months
1
0
0
0
[tkreuzer] 53825: [NTOSKRNL] - Session space address layout is architecture specific, move its initialization into MiInitializeSesseionSpaceLayout() in architecture specific file - Use dedicated co...
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Sat Sep 24 08:52:26 2011 New Revision: 53825 URL:
http://svn.reactos.org/svn/reactos?rev=53825&view=rev
Log: [NTOSKRNL] - Session space address layout is architecture specific, move its initialization into MiInitializeSesseionSpaceLayout() in architecture specific file - Use dedicated constants for setting MmSystemRangeStart, MmUserProbeAddress and MmHighestUserAddress isnetad of making assumptions. Modified: trunk/reactos/ntoskrnl/include/internal/amd64/mm.h trunk/reactos/ntoskrnl/mm/ARM3/i386/init.c trunk/reactos/ntoskrnl/mm/ARM3/miarm.h trunk/reactos/ntoskrnl/mm/ARM3/mminit.c trunk/reactos/ntoskrnl/mm/amd64/init.c Modified: trunk/reactos/ntoskrnl/include/internal/amd64/mm.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
============================================================================== --- trunk/reactos/ntoskrnl/include/internal/amd64/mm.h [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/include/internal/amd64/mm.h [iso-8859-1] Sat Sep 24 08:52:26 2011 @@ -11,6 +11,9 @@ #define PAE_PAGE_MASK(x) ((x)&(~0xfffLL)) /* Memory layout base addresses */ +#define MI_HIGHEST_USER_ADDRESS (PVOID)0x000007FFFFFEFFFFULL +#define MI_USER_PROBE_ADDRESS (PVOID)0x000007FFFFFF0000ULL +#define MI_DEFAULT_SYSTEM_RANGE_START (PVOID)0xFFFF080000000000ULL #define HYPER_SPACE 0xFFFFF70000000000ULL #define HYPER_SPACE_END 0xFFFFF77FFFFFFFFFULL #define MI_SESSION_SPACE_MINIMUM (PVOID)0xFFFFF90000000000ULL Modified: trunk/reactos/ntoskrnl/mm/ARM3/i386/init.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/i386/init…
============================================================================== --- trunk/reactos/ntoskrnl/mm/ARM3/i386/init.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/ARM3/i386/init.c [iso-8859-1] Sat Sep 24 08:52:26 2011 @@ -29,9 +29,82 @@ MMPTE PrototypePte = {{(MM_READWRITE << MM_PTE_SOFTWARE_PROTECTION_BITS) | PTE_PROTOTYPE | (MI_PTE_LOOKUP_NEEDED << PAGE_SHIFT)}}; -extern PFN_NUMBER MiNumberOfFreePages; /* PRIVATE FUNCTIONS **********************************************************/ + +VOID +NTAPI +INIT_FUNCTION +MiInitializeSessionSpaceLayout() +{ + // + // Set the size of session view, pool, and image + // + MmSessionSize = MI_SESSION_SIZE; + MmSessionViewSize = MI_SESSION_VIEW_SIZE; + MmSessionPoolSize = MI_SESSION_POOL_SIZE; + MmSessionImageSize = MI_SESSION_IMAGE_SIZE; + + // + // Set the size of system view + // + MmSystemViewSize = MI_SYSTEM_VIEW_SIZE; + + // + // This is where it all ends + // + MiSessionImageEnd = (PVOID)PTE_BASE; + + // + // This is where we will load Win32k.sys and the video driver + // + MiSessionImageStart = (PVOID)((ULONG_PTR)MiSessionImageEnd - + MmSessionImageSize); + + // + // So the view starts right below the session working set (itself below + // the image area) + // + MiSessionViewStart = (PVOID)((ULONG_PTR)MiSessionImageEnd - + MmSessionImageSize - + MI_SESSION_WORKING_SET_SIZE - + MmSessionViewSize); + + // + // Session pool follows + // + MiSessionPoolEnd = MiSessionViewStart; + MiSessionPoolStart = (PVOID)((ULONG_PTR)MiSessionPoolEnd - + MmSessionPoolSize); + + // + // And it all begins here + // + MmSessionBase = MiSessionPoolStart; + + // + // Sanity check that our math is correct + // + ASSERT((ULONG_PTR)MmSessionBase + MmSessionSize == PTE_BASE); + + // + // Session space ends wherever image session space ends + // + MiSessionSpaceEnd = MiSessionImageEnd; + + // + // System view space ends at session space, so now that we know where + // this is, we can compute the base address of system view space itself. + // + MiSystemViewStart = (PVOID)((ULONG_PTR)MmSessionBase - + MmSystemViewSize); + + /* Compute the PTE addresses for all the addresses we carved out */ + MiSessionImagePteStart = MiAddressToPte(MiSessionImageStart); + MiSessionImagePteEnd = MiAddressToPte(MiSessionImageEnd); + MiSessionBasePte = MiAddressToPte(MmSessionBase); + MiSessionLastPte = MiAddressToPte(MiSessionSpaceEnd); +} VOID NTAPI Modified: trunk/reactos/ntoskrnl/mm/ARM3/miarm.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/miarm.h?r…
============================================================================== --- trunk/reactos/ntoskrnl/mm/ARM3/miarm.h [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/ARM3/miarm.h [iso-8859-1] Sat Sep 24 08:52:26 2011 @@ -28,6 +28,9 @@ #define MI_SYSTEM_VIEW_SIZE (16 * _1MB) +#define MI_HIGHEST_USER_ADDRESS (PVOID)0x7FFEFFFF +#define MI_USER_PROBE_ADDRESS (PVOID)0x7FFF0000 +#define MI_DEFAULT_SYSTEM_RANGE_START (PVOID)0x80000000 #define MI_SYSTEM_CACHE_WS_START (PVOID)0xC0C00000 #define MI_PAGED_POOL_START (PVOID)0xE1000000 #define MI_NONPAGED_POOL_END (PVOID)0xFFBE0000 @@ -526,6 +529,14 @@ extern ULONG MmSystemPageColor; extern ULONG MmProcessColorSeed; extern PMMWSL MmWorkingSetList; +extern PFN_NUMBER MiNumberOfFreePages; +extern SIZE_T MmSessionViewSize; +extern SIZE_T MmSessionPoolSize; +extern SIZE_T MmSessionImageSize; +extern PVOID MiSystemViewStart; +extern PVOID MiSessionPoolEnd; // 0xBE000000 +extern PVOID MiSessionPoolStart; // 0xBD000000 +extern PVOID MiSessionViewStart; // 0xBE000000 // // Figures out the hardware bits for a PTE @@ -910,6 +921,10 @@ IN PLOADER_PARAMETER_BLOCK LoaderBlock ); +VOID +NTAPI +MiInitializeSessionSpaceLayout(); + NTSTATUS NTAPI MiInitMachineDependent( Modified: trunk/reactos/ntoskrnl/mm/ARM3/mminit.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/mminit.c?…
============================================================================== --- trunk/reactos/ntoskrnl/mm/ARM3/mminit.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/ARM3/mminit.c [iso-8859-1] Sat Sep 24 08:52:26 2011 @@ -410,7 +410,7 @@ if (Descriptor->MemoryType != LoaderBad) { /* Count this in the total of pages */ - MmNumberOfPhysicalPages += Descriptor->PageCount; + MmNumberOfPhysicalPages += (PFN_COUNT)Descriptor->PageCount; } /* Check if this is the new lowest page */ @@ -1898,9 +1898,9 @@ // // Define the basic user vs. kernel address space separation // - MmSystemRangeStart = (PVOID)KSEG0_BASE; - MmUserProbeAddress = (ULONG_PTR)MmSystemRangeStart - 0x10000; - MmHighestUserAddress = (PVOID)(MmUserProbeAddress - 1); + MmSystemRangeStart = (PVOID)MI_DEFAULT_SYSTEM_RANGE_START; + MmUserProbeAddress = (ULONG_PTR)MI_HIGHEST_USER_ADDRESS; + MmHighestUserAddress = (PVOID)MI_HIGHEST_USER_ADDRESS; /* Highest PTE and PDE based on the addresses above */ MiHighestUserPte = MiAddressToPte(MmHighestUserAddress); @@ -1922,73 +1922,8 @@ MmBootImageSize = (MmBootImageSize + PDE_MAPPED_VA - 1) & ~(PDE_MAPPED_VA - 1); ASSERT((MmBootImageSize % PDE_MAPPED_VA) == 0); - // - // Set the size of session view, pool, and image - // - MmSessionSize = MI_SESSION_SIZE; - MmSessionViewSize = MI_SESSION_VIEW_SIZE; - MmSessionPoolSize = MI_SESSION_POOL_SIZE; - MmSessionImageSize = MI_SESSION_IMAGE_SIZE; - - // - // Set the size of system view - // - MmSystemViewSize = MI_SYSTEM_VIEW_SIZE; - - // - // This is where it all ends - // - MiSessionImageEnd = (PVOID)PTE_BASE; - - // - // This is where we will load Win32k.sys and the video driver - // - MiSessionImageStart = (PVOID)((ULONG_PTR)MiSessionImageEnd - - MmSessionImageSize); - - // - // So the view starts right below the session working set (itself below - // the image area) - // - MiSessionViewStart = (PVOID)((ULONG_PTR)MiSessionImageEnd - - MmSessionImageSize - - MI_SESSION_WORKING_SET_SIZE - - MmSessionViewSize); - - // - // Session pool follows - // - MiSessionPoolEnd = MiSessionViewStart; - MiSessionPoolStart = (PVOID)((ULONG_PTR)MiSessionPoolEnd - - MmSessionPoolSize); - - // - // And it all begins here - // - MmSessionBase = MiSessionPoolStart; - - // - // Sanity check that our math is correct - // - ASSERT((ULONG_PTR)MmSessionBase + MmSessionSize == PTE_BASE); - - // - // Session space ends wherever image session space ends - // - MiSessionSpaceEnd = MiSessionImageEnd; - - // - // System view space ends at session space, so now that we know where - // this is, we can compute the base address of system view space itself. - // - MiSystemViewStart = (PVOID)((ULONG_PTR)MmSessionBase - - MmSystemViewSize); - - /* Compute the PTE addresses for all the addresses we carved out */ - MiSessionImagePteStart = MiAddressToPte(MiSessionImageStart); - MiSessionImagePteEnd = MiAddressToPte(MiSessionImageEnd); - MiSessionBasePte = MiAddressToPte(MmSessionBase); - MiSessionLastPte = MiAddressToPte(MiSessionSpaceEnd); + /* Initialize session space address layout */ + MiInitializeSessionSpaceLayout(); /* Initialize the user mode image list */ InitializeListHead(&MmLoadedUserImageList); Modified: trunk/reactos/ntoskrnl/mm/amd64/init.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/amd64/init.c?r…
============================================================================== --- trunk/reactos/ntoskrnl/mm/amd64/init.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/amd64/init.c [iso-8859-1] Sat Sep 24 08:52:26 2011 @@ -40,16 +40,16 @@ /* Sizes */ ///SIZE_T MmSessionSize = MI_SESSION_SIZE; -SIZE_T MmSessionViewSize = MI_SESSION_VIEW_SIZE; -SIZE_T MmSessionPoolSize = MI_SESSION_POOL_SIZE; -SIZE_T MmSessionImageSize = MI_SESSION_IMAGE_SIZE; -SIZE_T MmSystemViewSize = MI_SYSTEM_VIEW_SIZE; +extern SIZE_T MmSessionViewSize; +extern SIZE_T MmSessionPoolSize; +extern SIZE_T MmSessionImageSize; +extern SIZE_T MmSystemViewSize; SIZE_T MiNonPagedSystemSize; /* Address ranges */ -ULONG64 MmUserProbeAddress = 0x7FFFFFF0000ULL; -PVOID MmHighestUserAddress = (PVOID)0x7FFFFFEFFFFULL; -PVOID MmSystemRangeStart = (PVOID)0xFFFF080000000000ULL; +//ULONG64 MmUserProbeAddress = 0x7FFFFFF0000ULL; +//PVOID MmHighestUserAddress = (PVOID)0x7FFFFFEFFFFULL; +//PVOID MmSystemRangeStart = (PVOID)0xFFFF080000000000ULL; PVOID MmSessionBase; // FFFFF90000000000 = MiSessionPoolStart PVOID MiSessionPoolStart; // FFFFF90000000000 = MiSessionPoolEnd - MmSessionPoolSize PVOID MiSessionPoolEnd; // = MiSessionViewStart @@ -75,7 +75,6 @@ PMEMORY_ALLOCATION_DESCRIPTOR MxFreeDescriptor; MEMORY_ALLOCATION_DESCRIPTOR MxOldFreeDescriptor; -ULONG MiNumberDescriptors = 0; PFN_NUMBER MiSystemPages = 0; BOOLEAN MiIncludeType[LoaderMaximum]; @@ -88,90 +87,51 @@ /* FUNCTIONS *****************************************************************/ +VOID +NTAPI +INIT_FUNCTION +MiInitializeSessionSpaceLayout() +{ + MmSessionViewSize = MI_SESSION_VIEW_SIZE; + MmSessionPoolSize = MI_SESSION_POOL_SIZE; + MmSessionImageSize = MI_SESSION_IMAGE_SIZE; + MmSystemViewSize = MI_SYSTEM_VIEW_SIZE; + + /* Set up session space */ + MiSessionSpaceEnd = (PVOID)MI_SESSION_SPACE_END; + + /* This is where we will load Win32k.sys and the video driver */ + MiSessionImageEnd = MiSessionSpaceEnd; + MiSessionImageStart = (PCHAR)MiSessionImageEnd - MmSessionImageSize; + + /* The view starts right below the session working set (itself below + * the image area) */ + MiSessionViewEnd = MI_SESSION_VIEW_END; + MiSessionViewStart = (PCHAR)MiSessionViewEnd - MmSessionViewSize; + ASSERT(IS_PAGE_ALIGNED(MiSessionViewStart)); + + /* Session pool follows */ + MiSessionPoolEnd = MiSessionViewStart; + MiSessionPoolStart = (PCHAR)MiSessionPoolEnd - MmSessionPoolSize; + ASSERT(IS_PAGE_ALIGNED(MiSessionPoolStart)); + + /* And it all begins here */ + MmSessionBase = MiSessionPoolStart; + + /* System view space ends at session space, so now that we know where + * this is, we can compute the base address of system view space itself. */ + MiSystemViewStart = (PCHAR)MmSessionBase - MmSystemViewSize; + ASSERT(IS_PAGE_ALIGNED(MiSystemViewStart)); + + /* Sanity checks */ + ASSERT(MiSessionViewEnd <= MiSessionImageStart); + ASSERT(MmSessionBase <= MiSessionPoolStart); +} + ULONG NoDbgPrint(const char *Format, ...) { return 0; -} - -VOID -NTAPI -MiEvaluateMemoryDescriptors(IN PLOADER_PARAMETER_BLOCK LoaderBlock) -{ - PMEMORY_ALLOCATION_DESCRIPTOR Descriptor; - PLIST_ENTRY ListEntry; - PFN_NUMBER LastPage; - ULONG i; - - /* Get the size of the boot loader's image allocations */ - MmBootImageSize = KeLoaderBlock->Extension->LoaderPagesSpanned * PAGE_SIZE; - MmBootImageSize = ROUND_UP(MmBootImageSize, 4 * 1024 * 1024); - - /* Instantiate memory that we don't consider RAM/usable */ - for (i = 0; i < LoaderMaximum; i++) MiIncludeType[i] = TRUE; - MiIncludeType[LoaderBad] = FALSE; - MiIncludeType[LoaderFirmwarePermanent] = FALSE; - MiIncludeType[LoaderSpecialMemory] = FALSE; - MiIncludeType[LoaderBBTMemory] = FALSE; - - /* Loop the memory descriptors */ - for (ListEntry = LoaderBlock->MemoryDescriptorListHead.Flink; - ListEntry != &LoaderBlock->MemoryDescriptorListHead; - ListEntry = ListEntry->Flink) - { - /* Get the memory descriptor */ - Descriptor = CONTAINING_RECORD(ListEntry, - MEMORY_ALLOCATION_DESCRIPTOR, - ListEntry); - - /* Count it */ - MiNumberDescriptors++; - - /* Skip pages that are not part of the PFN database */ - if (!MiIncludeType[Descriptor->MemoryType]) - { - continue; - } - - /* Add this to the total of pages */ - MmNumberOfPhysicalPages += (PFN_COUNT)Descriptor->PageCount; - - /* Check if this is the new lowest page */ - if (Descriptor->BasePage < MmLowestPhysicalPage) - { - /* Update the lowest page */ - MmLowestPhysicalPage = Descriptor->BasePage; - } - - /* Check if this is the new highest page */ - LastPage = Descriptor->BasePage + Descriptor->PageCount - 1; - if (LastPage > MmHighestPhysicalPage) - { - /* Update the highest page */ - MmHighestPhysicalPage = LastPage; - } - - /* Check if this is currently free memory */ - if ((Descriptor->MemoryType == LoaderFree) || - (Descriptor->MemoryType == LoaderLoadedProgram) || - (Descriptor->MemoryType == LoaderFirmwareTemporary) || - (Descriptor->MemoryType == LoaderOsloaderStack)) - { - /* Check if this is the largest memory descriptor */ - if (Descriptor->PageCount > MxFreePageCount) - { - /* For now, it is */ - MxFreeDescriptor = Descriptor; - MxFreePageBase = Descriptor->BasePage; - MxFreePageCount = Descriptor->PageCount; - } - } - else - { - /* Add it to the amount of system used pages */ - MiSystemPages += Descriptor->PageCount; - } - } } PFN_NUMBER @@ -342,41 +302,6 @@ VOID -NTAPI -MiInitializeSessionSpace(IN PLOADER_PARAMETER_BLOCK LoaderBlock) -{ - /* Set up session space */ - MiSessionSpaceEnd = (PVOID)MI_SESSION_SPACE_END; - - /* This is where we will load Win32k.sys and the video driver */ - MiSessionImageEnd = MiSessionSpaceEnd; - MiSessionImageStart = (PCHAR)MiSessionImageEnd - MmSessionImageSize; - - /* The view starts right below the session working set (itself below - * the image area) */ - MiSessionViewEnd = MI_SESSION_VIEW_END; - MiSessionViewStart = (PCHAR)MiSessionViewEnd - MmSessionViewSize; - ASSERT(IS_PAGE_ALIGNED(MiSessionViewStart)); - - /* Session pool follows */ - MiSessionPoolEnd = MiSessionViewStart; - MiSessionPoolStart = (PCHAR)MiSessionPoolEnd - MmSessionPoolSize; - ASSERT(IS_PAGE_ALIGNED(MiSessionPoolStart)); - - /* And it all begins here */ - MmSessionBase = MiSessionPoolStart; - - /* System view space ends at session space, so now that we know where - * this is, we can compute the base address of system view space itself. */ - MiSystemViewStart = (PCHAR)MmSessionBase - MmSystemViewSize; - ASSERT(IS_PAGE_ALIGNED(MiSystemViewStart)); - - /* Sanity checks */ - ASSERT(MiSessionViewEnd <= MiSessionImageStart); - ASSERT(MmSessionBase <= MiSessionPoolStart); -} - -VOID MiInitializePageTable() { ULONG64 PxePhysicalAddress; @@ -603,92 +528,6 @@ /* Set the counter to maximum */ MiFirstReservedZeroingPte->u.Hard.PageFrameNumber = MI_ZERO_PTES - 1; -} - -VOID -NTAPI -MiBuildPhysicalMemoryBlock(IN PLOADER_PARAMETER_BLOCK LoaderBlock) -{ - PPHYSICAL_MEMORY_DESCRIPTOR Buffer; - PMEMORY_ALLOCATION_DESCRIPTOR Descriptor; - PLIST_ENTRY ListEntry; - PFN_NUMBER NextPage = -1; - PULONG Bitmap; - ULONG Runs = 0; - ULONG_PTR Size; - - /* Calculate size for the PFN bitmap */ - Size = ROUND_UP(MmHighestPhysicalPage + 1, sizeof(ULONG)); - - /* Allocate the PFN bitmap */ - Bitmap = ExAllocatePoolWithTag(NonPagedPool, Size, ' mM'); - - /* Allocate enough memory for the physical memory block */ - Buffer = ExAllocatePoolWithTag(NonPagedPool, - sizeof(PHYSICAL_MEMORY_DESCRIPTOR) + - sizeof(PHYSICAL_MEMORY_RUN) * - (MiNumberDescriptors - 1), - 'lMmM'); - if (!Bitmap || !Buffer) - { - /* This is critical */ - KeBugCheckEx(INSTALL_MORE_MEMORY, - MmNumberOfPhysicalPages, - MmLowestPhysicalPage, - MmHighestPhysicalPage, - 0x101); - } - - /* Initialize the bitmap and clear all bits */ - RtlInitializeBitMap(&MiPfnBitMap, - Bitmap, - (ULONG)MmHighestPhysicalPage + 1); - RtlClearAllBits(&MiPfnBitMap); - - /* Loop the memory descriptors */ - for (ListEntry = LoaderBlock->MemoryDescriptorListHead.Flink; - ListEntry != &LoaderBlock->MemoryDescriptorListHead; - ListEntry = ListEntry->Flink) - { - /* Get the memory descriptor */ - Descriptor = CONTAINING_RECORD(ListEntry, - MEMORY_ALLOCATION_DESCRIPTOR, - ListEntry); - - /* Skip pages that are not part of the PFN database */ - if (!MiIncludeType[Descriptor->MemoryType]) - { - continue; - } - - /* Does the memory block begin where the last ended? */ - if (Descriptor->BasePage == NextPage) - { - /* Add it to the current run */ - Buffer->Run[Runs - 1].PageCount += Descriptor->PageCount; - } - else - { - /* Create a new run */ - Runs++; - Buffer->Run[Runs - 1].BasePage = Descriptor->BasePage; - Buffer->Run[Runs - 1].PageCount = Descriptor->PageCount; - } - - /* Set the bits in the PFN bitmap */ - RtlSetBits(&MiPfnBitMap, - (ULONG)Descriptor->BasePage, - (ULONG)Descriptor->PageCount); - - /* Set the next page */ - NextPage = Descriptor->BasePage + Descriptor->PageCount; - } - - // FIXME: allocate a buffer of better size - - Buffer->NumberOfRuns = Runs; - Buffer->NumberOfPages = MmNumberOfPhysicalPages; - MmPhysicalMemoryBlock = Buffer; } VOID @@ -824,16 +663,13 @@ MmBootImageSize = ROUND_UP(MmBootImageSize, PAGE_SIZE); /* Parse memory descriptors, find free pages */ - MiEvaluateMemoryDescriptors(LoaderBlock); + //MiEvaluateMemoryDescriptors(LoaderBlock); /* Start PFN database at hardcoded address */ MmPfnDatabase = MI_PFN_DATABASE; /* Prepare PFN database mappings */ MiPreparePfnDatabse(LoaderBlock); - - /* Initialize the session space */ - MiInitializeSessionSpace(LoaderBlock); /* Initialize some mappings */ MiInitializePageTable(); @@ -859,7 +695,7 @@ MiBuildSystemPteSpace(); /* Build the physical memory block */ - MiBuildPhysicalMemoryBlock(LoaderBlock); + //MiBuildPhysicalMemoryBlock(LoaderBlock); /* Size up paged pool and build the shadow system page directory */ //MiBuildPagedPool();
13 years, 3 months
1
0
0
0
[rharabien] 53824: [WPP] - Sync to Wine 1.3.29 to fix a warning
by rharabien@svn.reactos.org
Author: rharabien Date: Sat Sep 24 07:58:49 2011 New Revision: 53824 URL:
http://svn.reactos.org/svn/reactos?rev=53824&view=rev
Log: [WPP] - Sync to Wine 1.3.29 to fix a warning Modified: trunk/reactos/tools/wpp/ppl.l trunk/reactos/tools/wpp/preproc.c trunk/reactos/tools/wpp/wpp_private.h Modified: trunk/reactos/tools/wpp/ppl.l URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/wpp/ppl.l?rev=53824&…
============================================================================== --- trunk/reactos/tools/wpp/ppl.l [iso-8859-1] (original) +++ trunk/reactos/tools/wpp/ppl.l [iso-8859-1] Sat Sep 24 07:58:49 2011 @@ -680,7 +680,7 @@ <pp_iqs,pp_dqs,pp_sqs>\n { newline(1); add_string(ppy_text, ppy_leng); - ppy_warning("Newline in string constant encounterd (started line %d)", string_start()); + ppy_warning("Newline in string constant encountered (started line %d)", string_start()); } /* Modified: trunk/reactos/tools/wpp/preproc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/wpp/preproc.c?rev=53…
============================================================================== --- trunk/reactos/tools/wpp/preproc.c [iso-8859-1] (original) +++ trunk/reactos/tools/wpp/preproc.c [iso-8859-1] Sat Sep 24 07:58:49 2011 @@ -729,7 +729,7 @@ wpp_default_warning, }; -struct wpp_callbacks *wpp_callbacks = &default_callbacks; +const struct wpp_callbacks *wpp_callbacks = &default_callbacks; int ppy_error(const char *s, ...) { Modified: trunk/reactos/tools/wpp/wpp_private.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/wpp/wpp_private.h?re…
============================================================================== --- trunk/reactos/tools/wpp/wpp_private.h [iso-8859-1] (original) +++ trunk/reactos/tools/wpp/wpp_private.h [iso-8859-1] Sat Sep 24 07:58:49 2011 @@ -218,7 +218,7 @@ #define __attribute__(x) /*nothing*/ #endif -extern struct wpp_callbacks *wpp_callbacks; +extern const struct wpp_callbacks *wpp_callbacks; int ppy_error(const char *s, ...) __attribute__((format (printf, 1, 2))); int ppy_warning(const char *s, ...) __attribute__((format (printf, 1, 2)));
13 years, 3 months
1
0
0
0
[pschweitzer] 53823: [KERNEL32] Simplify overcomplicated function CreateHardlinkW(), and SEHify it.
by pschweitzer@svn.reactos.org
Author: pschweitzer Date: Sat Sep 24 07:51:21 2011 New Revision: 53823 URL:
http://svn.reactos.org/svn/reactos?rev=53823&view=rev
Log: [KERNEL32] Simplify overcomplicated function CreateHardlinkW(), and SEHify it. Modified: trunk/reactos/dll/win32/kernel32/client/file/hardlink.c Modified: trunk/reactos/dll/win32/kernel32/client/file/hardlink.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
============================================================================== --- trunk/reactos/dll/win32/kernel32/client/file/hardlink.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/client/file/hardlink.c [iso-8859-1] Sat Sep 24 07:51:21 2011 @@ -2,11 +2,10 @@ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries - * FILE: lib/kernel32/file/hardlink.c + * FILE: dll/win32/kernel32/client/file/hardlink.c * PURPOSE: Hardlink functions * PROGRAMMER: Thomas Weidenmueller (w3seek(a)users.sourceforge.net) - * UPDATE HISTORY: - * Created 13/03/2004 + * Pierre Schweitzer (pierre.schweitzer(a)reactos.org) */ /* INCLUDES *****************************************************************/ @@ -27,169 +26,110 @@ LPCWSTR lpExistingFileName, LPSECURITY_ATTRIBUTES lpSecurityAttributes) { - UNICODE_STRING LinkTarget, LinkName; - LPVOID lpSecurityDescriptor; - PFILE_LINK_INFORMATION LinkInformation; - IO_STATUS_BLOCK IoStatus; - NTSTATUS Status; - BOOL Ret = FALSE; + NTSTATUS Status; + BOOL Ret = FALSE; + ULONG NeededSize; + IO_STATUS_BLOCK IoStatusBlock; + OBJECT_ATTRIBUTES ObjectAttributes; + HANDLE hTarget = INVALID_HANDLE_VALUE; + PFILE_LINK_INFORMATION LinkInformation = NULL; + UNICODE_STRING LinkTarget = {0, 0, NULL}, LinkName = {0, 0, NULL}; - if(!lpFileName || !lpExistingFileName) - { - SetLastError(ERROR_INVALID_PARAMETER); - return FALSE; - } + TRACE("CreateHardLinkW: %S, %S, %p\n", lpFileName, lpExistingFileName, lpSecurityAttributes); - lpSecurityDescriptor = (lpSecurityAttributes ? lpSecurityAttributes->lpSecurityDescriptor : NULL); + /* Validate parameters */ + if(!lpFileName || !lpExistingFileName) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } - if(RtlDetermineDosPathNameType_U((LPWSTR)lpFileName) == 1 || - RtlDetermineDosPathNameType_U((LPWSTR)lpExistingFileName) == 1) - { - WARN("CreateHardLinkW() cannot handle UNC Paths!\n"); - SetLastError(ERROR_INVALID_NAME); - return FALSE; - } + _SEH2_TRY + { + /* Get target UNC path */ + if (!RtlDosPathNameToNtPathName_U(lpExistingFileName, &LinkTarget, NULL, NULL)) + { + SetLastError(ERROR_PATH_NOT_FOUND); + _SEH2_LEAVE; + } - if(RtlDosPathNameToNtPathName_U(lpExistingFileName, &LinkTarget, NULL, NULL)) - { - ULONG NeededSize = RtlGetFullPathName_U((LPWSTR)lpExistingFileName, 0, NULL, NULL); - if(NeededSize > 0) + /* Open target */ + InitializeObjectAttributes(&ObjectAttributes, + &LinkTarget, + OBJ_CASE_INSENSITIVE, + NULL, + (lpSecurityAttributes ? lpSecurityAttributes->lpSecurityDescriptor : NULL)); + + Status = NtOpenFile(&hTarget, + SYNCHRONIZE | FILE_WRITE_ATTRIBUTES, + &ObjectAttributes, + &IoStatusBlock, + FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, + FILE_SYNCHRONOUS_IO_NONALERT | FILE_OPEN_REPARSE_POINT); + if (!NT_SUCCESS(Status)) + { + BaseSetLastNTError(Status); + _SEH2_LEAVE; + } + + /* Get UNC path name for link */ + if (!RtlDosPathNameToNtPathName_U(lpFileName, &LinkName, NULL, NULL)) + { + SetLastError(ERROR_PATH_NOT_FOUND); + _SEH2_LEAVE; + } + + /* Prepare data for link */ + NeededSize = sizeof(FILE_LINK_INFORMATION) + LinkName.Length; + LinkInformation = RtlAllocateHeap(RtlGetProcessHeap(), 0, NeededSize); + if (!LinkInformation) + { + SetLastError(ERROR_NOT_ENOUGH_MEMORY); + _SEH2_LEAVE; + } + + RtlMoveMemory(LinkInformation->FileName, LinkName.Buffer, LinkName.Length); + LinkInformation->ReplaceIfExists = FALSE; + LinkInformation->RootDirectory = 0; + LinkInformation->FileNameLength = LinkName.Length; + + /* Create hard link */ + Status = NtSetInformationFile(hTarget, + &IoStatusBlock, + LinkInformation, + NeededSize, + FileLinkInformation); + if (NT_SUCCESS(Status)) + { + Ret = TRUE; + } + } + _SEH2_FINALLY { - LPWSTR lpNtLinkTarget = RtlAllocateHeap(RtlGetProcessHeap(), HEAP_ZERO_MEMORY, NeededSize * sizeof(WCHAR)); - if(lpNtLinkTarget != NULL) - { - LPWSTR lpFilePart; + if (LinkTarget.Buffer) + { + RtlFreeHeap(RtlGetProcessHeap(), 0, LinkTarget.Buffer); + } - if(RtlGetFullPathName_U((LPWSTR)lpExistingFileName, NeededSize, lpNtLinkTarget, &lpFilePart) && - (*lpNtLinkTarget) != L'\0') + if (hTarget != INVALID_HANDLE_VALUE) { - UNICODE_STRING CheckDrive, LinkDrive; - WCHAR wCheckDrive[10]; + NtClose(hTarget); + } - swprintf(wCheckDrive, L"\\??\\%c:", (WCHAR)(*lpNtLinkTarget)); - RtlInitUnicodeString(&CheckDrive, wCheckDrive); + if (LinkName.Buffer) + { + RtlFreeHeap(RtlGetProcessHeap(), 0, LinkName.Buffer); + } - RtlZeroMemory(&LinkDrive, sizeof(UNICODE_STRING)); + if (LinkInformation) + { + RtlFreeHeap(RtlGetProcessHeap(), 0, LinkInformation); + } + } + _SEH2_END; - LinkDrive.Buffer = RtlAllocateHeap(RtlGetProcessHeap(), HEAP_ZERO_MEMORY, (MAX_PATH + 1) * sizeof(WCHAR)); - if(LinkDrive.Buffer != NULL) - { - HANDLE hFile, hTarget; - OBJECT_ATTRIBUTES ObjectAttributes; - - InitializeObjectAttributes(&ObjectAttributes, - &CheckDrive, - OBJ_CASE_INSENSITIVE, - NULL, - NULL); - - Status = NtOpenSymbolicLinkObject(&hFile, 1, &ObjectAttributes); - if(NT_SUCCESS(Status)) - { - UNICODE_STRING LanManager; - - RtlInitUnicodeString(&LanManager, L"\\Device\\LanmanRedirector\\"); - - NtQuerySymbolicLinkObject(hFile, &LinkDrive, NULL); - - if(!RtlPrefixUnicodeString(&LanManager, &LinkDrive, TRUE)) - { - InitializeObjectAttributes(&ObjectAttributes, - &LinkTarget, - OBJ_CASE_INSENSITIVE, - NULL, - lpSecurityDescriptor); - Status = NtOpenFile(&hTarget, - SYNCHRONIZE | DELETE, - &ObjectAttributes, - &IoStatus, - FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, - FILE_SYNCHRONOUS_IO_NONALERT | FILE_OPEN_FOR_BACKUP_INTENT | FILE_OPEN_REPARSE_POINT); - if(NT_SUCCESS(Status)) - { - if(RtlDosPathNameToNtPathName_U(lpFileName, &LinkName, NULL, NULL)) - { - NeededSize = sizeof(FILE_LINK_INFORMATION) + LinkName.Length + sizeof(WCHAR); - LinkInformation = RtlAllocateHeap(RtlGetProcessHeap(), HEAP_ZERO_MEMORY, NeededSize); - if(LinkInformation != NULL) - { - LinkInformation->ReplaceIfExists = FALSE; - LinkInformation->RootDirectory = 0; - LinkInformation->FileNameLength = LinkName.Length; - RtlCopyMemory(LinkInformation->FileName, LinkName.Buffer, LinkName.Length); - - Status = NtSetInformationFile(hTarget, &IoStatus, LinkInformation, NeededSize, FileLinkInformation); - if(NT_SUCCESS(Status)) - { - Ret = TRUE; - } - else - { - BaseSetLastNTError(Status); - } - - RtlFreeHeap(RtlGetProcessHeap(), 0, LinkInformation); - } - else - { - SetLastError(ERROR_NOT_ENOUGH_MEMORY); - } - } - else - { - SetLastError(ERROR_PATH_NOT_FOUND); - } - NtClose(hTarget); - } - else - { - WARN("Unable to open link destination \"%wZ\"!\n", &LinkTarget); - BaseSetLastNTError(Status); - } - } - else - { - WARN("Path \"%wZ\" must not be a mapped drive!\n", &LinkDrive); - SetLastError(ERROR_INVALID_NAME); - } - - NtClose(hFile); - } - else - { - BaseSetLastNTError(Status); - } - } - else - { - SetLastError(ERROR_NOT_ENOUGH_MEMORY); - } - } - else - { - SetLastError(ERROR_INVALID_NAME); - } - RtlFreeHeap(RtlGetProcessHeap(), 0, lpNtLinkTarget); - } - else - { - SetLastError(ERROR_NOT_ENOUGH_MEMORY); - } - } - else - { - SetLastError(ERROR_INVALID_NAME); - } - RtlFreeHeap(RtlGetProcessHeap(), 0, LinkTarget.Buffer); - } - else - { - SetLastError(ERROR_PATH_NOT_FOUND); - } - - return Ret; + return Ret; } - /* * @implemented @@ -199,26 +139,32 @@ LPCSTR lpExistingFileName, LPSECURITY_ATTRIBUTES lpSecurityAttributes) { - PWCHAR FileNameW, ExistingFileNameW; - BOOL Ret; + BOOL Ret; + PUNICODE_STRING lpFileNameW; + UNICODE_STRING ExistingFileNameW; - if(!lpFileName || !lpExistingFileName) - { - SetLastError(ERROR_INVALID_PARAMETER); - return FALSE; - } + lpFileNameW = Basep8BitStringToStaticUnicodeString(lpFileName); + if (!lpFileNameW) + { + return FALSE; + } - if (!(FileNameW = FilenameA2W(lpFileName, FALSE))) - return FALSE; + if (!lpExistingFileName) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } - if (!(ExistingFileNameW = FilenameA2W(lpExistingFileName, TRUE))) - return FALSE; + if (!Basep8BitStringToDynamicUnicodeString(&ExistingFileNameW, lpExistingFileName)) + { + return FALSE; + } - Ret = CreateHardLinkW(FileNameW , ExistingFileNameW , lpSecurityAttributes); + Ret = CreateHardLinkW(lpFileNameW->Buffer, ExistingFileNameW.Buffer, lpSecurityAttributes); - RtlFreeHeap(RtlGetProcessHeap(), 0, ExistingFileNameW); + RtlFreeHeap(RtlGetProcessHeap(), 0, ExistingFileNameW.Buffer); - return Ret; + return Ret; } /* EOF */
13 years, 3 months
1
0
0
0
[tkreuzer] 53822: [NTOSKRNL] Add MiScanMemoryDescriptors, that combines the work of MiPagesInLoaderBlock, the loop in MmInitializeMemoryLimits and the loop in MiInitMachineDependent.
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Sat Sep 24 00:12:58 2011 New Revision: 53822 URL:
http://svn.reactos.org/svn/reactos?rev=53822&view=rev
Log: [NTOSKRNL] Add MiScanMemoryDescriptors, that combines the work of MiPagesInLoaderBlock, the loop in MmInitializeMemoryLimits and the loop in MiInitMachineDependent. Modified: trunk/reactos/ntoskrnl/mm/ARM3/i386/init.c trunk/reactos/ntoskrnl/mm/ARM3/mminit.c Modified: trunk/reactos/ntoskrnl/mm/ARM3/i386/init.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/i386/init…
============================================================================== --- trunk/reactos/ntoskrnl/mm/ARM3/i386/init.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/ARM3/i386/init.c [iso-8859-1] Sat Sep 24 00:12:58 2011 @@ -28,6 +28,8 @@ /* Template PTE for prototype page */ MMPTE PrototypePte = {{(MM_READWRITE << MM_PTE_SOFTWARE_PROTECTION_BITS) | PTE_PROTOTYPE | (MI_PTE_LOOKUP_NEEDED << PAGE_SHIFT)}}; + +extern PFN_NUMBER MiNumberOfFreePages; /* PRIVATE FUNCTIONS **********************************************************/ @@ -152,9 +154,6 @@ INIT_FUNCTION MiInitMachineDependent(IN PLOADER_PARAMETER_BLOCK LoaderBlock) { - PLIST_ENTRY NextEntry; - PMEMORY_ALLOCATION_DESCRIPTOR MdBlock; - ULONG FreePages = 0; PFN_NUMBER PageFrameIndex; PMMPTE StartPde, EndPde, PointerPte, LastPte; MMPTE TempPde, TempPte; @@ -190,101 +189,8 @@ EndPde = MiAddressToPde(KSEG0_BASE); RtlZeroMemory(StartPde, (EndPde - StartPde) * sizeof(MMPTE)); - // - // Loop the memory descriptors - // - NextEntry = LoaderBlock->MemoryDescriptorListHead.Flink; - while (NextEntry != &LoaderBlock->MemoryDescriptorListHead) - { - // - // Get the memory block - // - MdBlock = CONTAINING_RECORD(NextEntry, - MEMORY_ALLOCATION_DESCRIPTOR, - ListEntry); - - // - // Skip invisible memory - // - if ((MdBlock->MemoryType != LoaderFirmwarePermanent) && - (MdBlock->MemoryType != LoaderSpecialMemory) && - (MdBlock->MemoryType != LoaderHALCachedMemory) && - (MdBlock->MemoryType != LoaderBBTMemory)) - { - // - // Check if BURNMEM was used - // - if (MdBlock->MemoryType != LoaderBad) - { - // - // Count this in the total of pages - // - MmNumberOfPhysicalPages += MdBlock->PageCount; - } - - // - // Check if this is the new lowest page - // - if (MdBlock->BasePage < MmLowestPhysicalPage) - { - // - // Update the lowest page - // - MmLowestPhysicalPage = MdBlock->BasePage; - } - - // - // Check if this is the new highest page - // - PageFrameIndex = MdBlock->BasePage + MdBlock->PageCount; - if (PageFrameIndex > MmHighestPhysicalPage) - { - // - // Update the highest page - // - MmHighestPhysicalPage = PageFrameIndex - 1; - } - - // - // Check if this is free memory - // - if ((MdBlock->MemoryType == LoaderFree) || - (MdBlock->MemoryType == LoaderLoadedProgram) || - (MdBlock->MemoryType == LoaderFirmwareTemporary) || - (MdBlock->MemoryType == LoaderOsloaderStack)) - { - // - // Check if this is the largest memory descriptor - // - if (MdBlock->PageCount > FreePages) - { - // - // For now, it is - // - MxFreeDescriptor = MdBlock; - } - - // - // More free pages - // - FreePages += MdBlock->PageCount; - } - } - - // - // Keep going - // - NextEntry = MdBlock->ListEntry.Flink; - } - - // - // Save original values of the free descriptor, since it'll be - // altered by early allocations - // - MxOldFreeDescriptor = *MxFreeDescriptor; - /* Compute non paged pool limits and size */ - MiComputeNonPagedPoolVa(FreePages); + MiComputeNonPagedPoolVa(MiNumberOfFreePages); /* Compute color information (L2 cache-separated paging lists) */ MiComputeColorInformation(); Modified: trunk/reactos/ntoskrnl/mm/ARM3/mminit.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/mminit.c?…
============================================================================== --- trunk/reactos/ntoskrnl/mm/ARM3/mminit.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/ARM3/mminit.c [iso-8859-1] Sat Sep 24 00:12:58 2011 @@ -364,7 +364,93 @@ FALSE; #endif +/* Number of memory descriptors in the loader block */ +ULONG MiNumberDescriptors = 0; + +/* Number of free pages in the loader block */ +PFN_NUMBER MiNumberOfFreePages = 0; + + /* PRIVATE FUNCTIONS **********************************************************/ + +VOID +NTAPI +MiScanMemoryDescriptors(IN PLOADER_PARAMETER_BLOCK LoaderBlock) +{ + PLIST_ENTRY ListEntry; + PMEMORY_ALLOCATION_DESCRIPTOR Descriptor; + PFN_NUMBER PageFrameIndex, FreePages = 0; + + /* Loop the memory descriptors */ + for (ListEntry = LoaderBlock->MemoryDescriptorListHead.Flink; + ListEntry != &LoaderBlock->MemoryDescriptorListHead; + ListEntry = ListEntry->Flink) + { + /* Get the descriptor */ + Descriptor = CONTAINING_RECORD(ListEntry, + MEMORY_ALLOCATION_DESCRIPTOR, + ListEntry); + DPRINT("MD Type: %lx Base: %lx Count: %lx\n", + Descriptor->MemoryType, Descriptor->BasePage, Descriptor->PageCount); + + /* Count this descriptor */ + MiNumberDescriptors++; + + /* Check if this is invisible memory */ + if ((Descriptor->MemoryType == LoaderFirmwarePermanent) && + (Descriptor->MemoryType == LoaderSpecialMemory) && + (Descriptor->MemoryType == LoaderHALCachedMemory) && + (Descriptor->MemoryType == LoaderBBTMemory)) + { + /* Skip this descriptor */ + continue; + } + + /* Check if this is bad memory */ + if (Descriptor->MemoryType != LoaderBad) + { + /* Count this in the total of pages */ + MmNumberOfPhysicalPages += Descriptor->PageCount; + } + + /* Check if this is the new lowest page */ + if (Descriptor->BasePage < MmLowestPhysicalPage) + { + /* Update the lowest page */ + MmLowestPhysicalPage = Descriptor->BasePage; + } + + /* Check if this is the new highest page */ + PageFrameIndex = Descriptor->BasePage + Descriptor->PageCount; + if (PageFrameIndex > MmHighestPhysicalPage) + { + /* Update the highest page */ + MmHighestPhysicalPage = PageFrameIndex - 1; + } + + /* Check if this is free memory */ + if ((Descriptor->MemoryType == LoaderFree) || + (Descriptor->MemoryType == LoaderLoadedProgram) || + (Descriptor->MemoryType == LoaderFirmwareTemporary) || + (Descriptor->MemoryType == LoaderOsloaderStack)) + { + /* Count it too free pages */ + MiNumberOfFreePages += Descriptor->PageCount; + + /* Check if this is the largest memory descriptor */ + if (Descriptor->PageCount > FreePages) + { + /* Remember it */ + MxFreeDescriptor = Descriptor; + FreePages = Descriptor->PageCount; + } + } + } + + /* Save original values of the free descriptor, since it'll be + * altered by early allocations */ + MxOldFreeDescriptor = *MxFreeDescriptor; +} PFN_NUMBER NTAPI @@ -1375,48 +1461,6 @@ KeLowerIrql(OldIrql); } -PFN_NUMBER -NTAPI -MiPagesInLoaderBlock(IN PLOADER_PARAMETER_BLOCK LoaderBlock, - IN PBOOLEAN IncludeType) -{ - PLIST_ENTRY NextEntry; - PFN_NUMBER PageCount = 0; - PMEMORY_ALLOCATION_DESCRIPTOR MdBlock; - - // - // Now loop through the descriptors - // - NextEntry = LoaderBlock->MemoryDescriptorListHead.Flink; - while (NextEntry != &LoaderBlock->MemoryDescriptorListHead) - { - // - // Grab each one, and check if it's one we should include - // - MdBlock = CONTAINING_RECORD(NextEntry, - MEMORY_ALLOCATION_DESCRIPTOR, - ListEntry); - if ((MdBlock->MemoryType < LoaderMaximum) && - (IncludeType[MdBlock->MemoryType])) - { - // - // Add this to our running total - // - PageCount += MdBlock->PageCount; - } - - // - // Try the next descriptor - // - NextEntry = MdBlock->ListEntry.Flink; - } - - // - // Return the total - // - return PageCount; -} - PPHYSICAL_MEMORY_DESCRIPTOR NTAPI INIT_FUNCTION @@ -1424,23 +1468,15 @@ IN PBOOLEAN IncludeType) { PLIST_ENTRY NextEntry; - ULONG Run = 0, InitialRuns = 0; + ULONG Run = 0, InitialRuns; PFN_NUMBER NextPage = -1, PageCount = 0; PPHYSICAL_MEMORY_DESCRIPTOR Buffer, NewBuffer; PMEMORY_ALLOCATION_DESCRIPTOR MdBlock; // - // Scan the memory descriptors - // - NextEntry = LoaderBlock->MemoryDescriptorListHead.Flink; - while (NextEntry != &LoaderBlock->MemoryDescriptorListHead) - { - // - // For each one, increase the memory allocation estimate - // - InitialRuns++; - NextEntry = NextEntry->Flink; - } + // Start with the maximum we might need + // + InitialRuns = MiNumberDescriptors; // // Allocate the maximum we'll ever need @@ -1970,7 +2006,8 @@ // // Count physical pages on the system // - PageCount = MiPagesInLoaderBlock(LoaderBlock, IncludeType); + MiScanMemoryDescriptors(LoaderBlock); + PageCount = MmNumberOfPhysicalPages; // // Check if this is a machine with less than 19MB of RAM
13 years, 3 months
1
0
0
0
[akhaldi] 53821: [SHELL32_WINETEST] * Sync to Wine 1.3.29.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Fri Sep 23 23:14:50 2011 New Revision: 53821 URL:
http://svn.reactos.org/svn/reactos?rev=53821&view=rev
Log: [SHELL32_WINETEST] * Sync to Wine 1.3.29. Added: trunk/rostests/winetests/shell32/brsfolder.c (with props) trunk/rostests/winetests/shell32/ebrowser.c (with props) trunk/rostests/winetests/shell32/recyclebin.c (with props) trunk/rostests/winetests/shell32/shelldispatch.c (with props) trunk/rostests/winetests/shell32/shellole.c (with props) Modified: trunk/rostests/winetests/shell32/CMakeLists.txt trunk/rostests/winetests/shell32/autocomplete.c trunk/rostests/winetests/shell32/progman_dde.c trunk/rostests/winetests/shell32/shell32.rbuild trunk/rostests/winetests/shell32/shell32_test.h trunk/rostests/winetests/shell32/shelllink.c trunk/rostests/winetests/shell32/shellpath.c trunk/rostests/winetests/shell32/shfldr_special.c trunk/rostests/winetests/shell32/shlexec.c trunk/rostests/winetests/shell32/shlfileop.c trunk/rostests/winetests/shell32/shlfolder.c trunk/rostests/winetests/shell32/shlview.c trunk/rostests/winetests/shell32/systray.c trunk/rostests/winetests/shell32/testlist.c [This mail would be too long, it was shortened to contain the URLs only.] Modified: trunk/rostests/winetests/shell32/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/shell32/CMakeLi…
Modified: trunk/rostests/winetests/shell32/autocomplete.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/shell32/autocom…
Added: trunk/rostests/winetests/shell32/brsfolder.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/shell32/brsfold…
Added: trunk/rostests/winetests/shell32/ebrowser.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/shell32/ebrowse…
Modified: trunk/rostests/winetests/shell32/progman_dde.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/shell32/progman…
Added: trunk/rostests/winetests/shell32/recyclebin.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/shell32/recycle…
Modified: trunk/rostests/winetests/shell32/shell32.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/shell32/shell32…
Modified: trunk/rostests/winetests/shell32/shell32_test.h URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/shell32/shell32…
Added: trunk/rostests/winetests/shell32/shelldispatch.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/shell32/shelldi…
Modified: trunk/rostests/winetests/shell32/shelllink.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/shell32/shellli…
Added: trunk/rostests/winetests/shell32/shellole.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/shell32/shellol…
Modified: trunk/rostests/winetests/shell32/shellpath.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/shell32/shellpa…
Modified: trunk/rostests/winetests/shell32/shfldr_special.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/shell32/shfldr_…
Modified: trunk/rostests/winetests/shell32/shlexec.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/shell32/shlexec…
Modified: trunk/rostests/winetests/shell32/shlfileop.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/shell32/shlfile…
Modified: trunk/rostests/winetests/shell32/shlfolder.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/shell32/shlfold…
Modified: trunk/rostests/winetests/shell32/shlview.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/shell32/shlview…
Modified: trunk/rostests/winetests/shell32/systray.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/shell32/systray…
Modified: trunk/rostests/winetests/shell32/testlist.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/shell32/testlis…
13 years, 3 months
1
0
0
0
← Newer
1
...
6
7
8
9
10
11
12
...
40
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
Results per page:
10
25
50
100
200