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
January 2007
----- 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
21 participants
401 discussions
Start a n
N
ew thread
[ekohl] 25318: - Draw the Scrollbar. - Draw the Titlebar using DrawCaptionTemp. - Clean up the code structure.
by ekohl@svn.reactos.org
Author: ekohl Date: Fri Jan 5 23:58:24 2007 New Revision: 25318 URL:
http://svn.reactos.org/svn/reactos?rev=25318&view=rev
Log: - Draw the Scrollbar. - Draw the Titlebar using DrawCaptionTemp. - Clean up the code structure. Modified: trunk/reactos/dll/cpl/desk/preview.c Modified: trunk/reactos/dll/cpl/desk/preview.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/preview.c?rev…
============================================================================== --- trunk/reactos/dll/cpl/desk/preview.c (original) +++ trunk/reactos/dll/cpl/desk/preview.c Fri Jan 5 23:58:24 2007 @@ -18,6 +18,9 @@ DWORD clrWindow; HBRUSH hbrWindow; + + DWORD clrScrollbar; + HBRUSH hbrScrollbar; INT cxEdge; INT cyEdge; @@ -56,21 +59,6 @@ } PREVIEW_DATA, *PPREVIEW_DATA; -/* HACK: fill the caption bar squares due to NULL text */ -static VOID -FillSquare(HDC hdc, PRECT rect) -{ - INT x, y, i; - - x = rect->left + 2; - y = rect->top + 2; - - for (i = 3; i < 12; i++) - { - BitBlt(hdc, x, y + i, 10, 1, hdc, x, y, SRCCOPY); - } -} - static VOID DrawCaptionButtons(HDC hdc, LPRECT lpRect, BOOL bMinMax) @@ -104,6 +92,75 @@ } } +static VOID +DrawScrollbar(HDC hdc, LPRECT rc, HBRUSH hbrScrollbar) +{ + RECT rcTop; + RECT rcBottom; + RECT rcMiddle; + int width; + + width = rc->right - rc->left; + + rcTop.left = rc->left; + rcTop.right = rc->right; + rcTop.top = rc->top; + rcTop.bottom = rc->top + width; + + rcMiddle.left = rc->left; + rcMiddle.right = rc->right; + rcMiddle.top = rc->top + width; + rcMiddle.bottom = rc->bottom - width; + + rcBottom.left = rc->left; + rcBottom.right = rc->right; + rcBottom.top = rc->bottom - width; + rcBottom.bottom = rc->bottom; + + DrawFrameControl(hdc, &rcTop, DFC_SCROLL, DFCS_SCROLLUP); + DrawFrameControl(hdc, &rcBottom, DFC_SCROLL, DFCS_SCROLLDOWN); + + FillRect(hdc, &rcMiddle, hbrScrollbar); +} + + +static VOID +OnCreate(PPREVIEW_DATA pPreviewData) +{ + NONCLIENTMETRICS NonClientMetrics; + + pPreviewData->clrScrollbar = GetSysColor(COLOR_SCROLLBAR); + pPreviewData->hbrScrollbar = CreateSolidBrush(pPreviewData->clrScrollbar); + + pPreviewData->clrDesktop = GetSysColor(COLOR_DESKTOP); + pPreviewData->hbrDesktop = CreateSolidBrush(pPreviewData->clrDesktop); + pPreviewData->clrWindow = GetSysColor(COLOR_WINDOW); + pPreviewData->hbrWindow = CreateSolidBrush(pPreviewData->clrWindow); + + pPreviewData->cxEdge = GetSystemMetrics(SM_CXEDGE); + pPreviewData->cyEdge = GetSystemMetrics(SM_CXEDGE); + + pPreviewData->cyCaption = 20; //GetSystemMetrics(SM_CYCAPTION); + + /* load font info */ + NonClientMetrics.cbSize = sizeof(NONCLIENTMETRICS); + SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(NONCLIENTMETRICS), &NonClientMetrics, 0); + pPreviewData->CaptionFont = NonClientMetrics.lfCaptionFont; + pPreviewData->MenuFont = NonClientMetrics.lfMenuFont; + pPreviewData->DialogFont = NonClientMetrics.lfMessageFont; + + AllocAndLoadString(&pPreviewData->lpInAct, hApplet, IDS_INACTWIN); + AllocAndLoadString(&pPreviewData->lpAct, hApplet, IDS_ACTWIN); + AllocAndLoadString(&pPreviewData->lpWinTxt, hApplet, IDS_WINTEXT); + AllocAndLoadString(&pPreviewData->lpMessBox, hApplet, IDS_MESSBOX); + AllocAndLoadString(&pPreviewData->lpMessText, hApplet, IDS_MESSTEXT); + AllocAndLoadString(&pPreviewData->lpButText, hApplet, IDS_BUTTEXT); + AllocAndLoadString(&pPreviewData->lpMenNorm, hApplet, IDS_NORMAL); + AllocAndLoadString(&pPreviewData->lpMenDis, hApplet, IDS_DISABLED); + AllocAndLoadString(&pPreviewData->lpMenSel, hApplet, IDS_SELECTED); + +} + static VOID OnSize(INT cx, INT cy, PPREVIEW_DATA pPreviewData) @@ -165,7 +222,7 @@ pPreviewData->rcDialogCaption.left = pPreviewData->rcDialogFrame.left + 3; pPreviewData->rcDialogCaption.top = pPreviewData->rcDialogFrame.top + 3; pPreviewData->rcDialogCaption.right = pPreviewData->rcDialogFrame.right - 3; - pPreviewData->rcDialogCaption.bottom = pPreviewData->rcDialogFrame.top + 20 + 2; + pPreviewData->rcDialogCaption.bottom = pPreviewData->rcDialogFrame.top + 20 + 1; /* Calculate the dialog client rectangle */ pPreviewData->rcDialogClient.left = pPreviewData->rcDialogFrame.left + 3; @@ -186,9 +243,107 @@ static VOID -DrawScrollbar(HDC hdc, LPRECT rc) -{ - +OnPaint(HWND hwnd, PPREVIEW_DATA pPreviewData) +{ + PAINTSTRUCT ps; + HDC hdc; + HFONT hFont; + RECT rc; + + hdc = BeginPaint(hwnd, &ps); + + /* Desktop */ + FillRect(hdc, &pPreviewData->rcDesktop, pPreviewData->hbrDesktop); + + /* Inactive Window */ + DrawEdge(hdc, &pPreviewData->rcInactiveFrame, EDGE_RAISED, BF_RECT | BF_MIDDLE); + SetTextColor(hdc, RGB(212,208,200)); + + hFont = CreateFontIndirect(&pPreviewData->CaptionFont); + DrawCaptionTemp(NULL, hdc, &pPreviewData->rcInactiveCaption, hFont, + NULL, pPreviewData->lpInAct, DC_GRADIENT | DC_ICON | DC_TEXT); + DeleteObject(hFont); + + DrawCaptionButtons(hdc, &pPreviewData->rcInactiveCaption, TRUE); + + /* Active Window */ + DrawEdge(hdc, &pPreviewData->rcActiveFrame, EDGE_RAISED, BF_RECT | BF_MIDDLE); + SetTextColor(hdc, RGB(255,255,255)); // FIXME: don't hardcode colors + + hFont = CreateFontIndirect(&pPreviewData->CaptionFont); + DrawCaptionTemp(NULL, hdc, &pPreviewData->rcActiveCaption, hFont, + NULL, pPreviewData->lpAct, DC_ACTIVE | DC_GRADIENT | DC_ICON | DC_TEXT); + DeleteObject(hFont); + + DrawCaptionButtons(hdc, &pPreviewData->rcActiveCaption, TRUE); + + /* FIXME: Draw the menu bar */ + + /* Draw the client area */ + CopyRect(&rc, &pPreviewData->rcActiveClient); + DrawEdge(hdc, &rc, EDGE_SUNKEN, BF_RECT | BF_ADJUST); + FillRect(hdc, &rc, pPreviewData->hbrWindow); + + /* Draw the client text */ + CopyRect(&rc, &pPreviewData->rcActiveClient); + rc.left += 4; + rc.top += 2; + SetTextColor(hdc, RGB(0,0,0)); + SelectObject(hdc, CreateFontIndirect(&pPreviewData->DialogFont)); + DrawText(hdc, pPreviewData->lpWinTxt, lstrlen(pPreviewData->lpWinTxt), &rc, DT_LEFT); + DeleteObject(SelectObject(hdc, GetStockObject(SYSTEM_FONT))); + + /* Draw the scroll bar */ + DrawScrollbar(hdc, &pPreviewData->rcActiveScroll, pPreviewData->hbrScrollbar); + + /* Dialog Window */ + DrawEdge(hdc, &pPreviewData->rcDialogFrame, EDGE_RAISED, BF_RECT | BF_MIDDLE); + SetTextColor(hdc, RGB(255,255,255)); + + hFont = CreateFontIndirect(&pPreviewData->CaptionFont); + DrawCaptionTemp(NULL, hdc, &pPreviewData->rcDialogCaption, hFont, + NULL, pPreviewData->lpMessBox, DC_ACTIVE | DC_GRADIENT | DC_ICON | DC_TEXT); + DeleteObject(hFont); + + DrawCaptionButtons(hdc, &pPreviewData->rcDialogCaption, FALSE); + + /* Draw the dialog text */ + CopyRect(&rc, &pPreviewData->rcDialogClient); + rc.left += 4; + rc.top += 2; + SetTextColor(hdc, RGB(0,0,0)); + SelectObject(hdc, CreateFontIndirect(&pPreviewData->DialogFont)); + DrawText(hdc, pPreviewData->lpMessText, lstrlen(pPreviewData->lpMessText), &rc, DT_LEFT); + DeleteObject(SelectObject(hdc, GetStockObject(SYSTEM_FONT))); + + /* Draw Button */ + DrawFrameControl(hdc, &pPreviewData->rcDialogButton, DFC_BUTTON, DFCS_BUTTONPUSH); + CopyRect(&rc, &pPreviewData->rcDialogButton); + rc.top += 6; + SelectObject(hdc, CreateFontIndirect(&pPreviewData->DialogFont)); + DrawText(hdc, pPreviewData->lpButText, lstrlen(pPreviewData->lpButText), &rc, DT_CENTER); + DeleteObject(SelectObject(hdc, GetStockObject(SYSTEM_FONT))); + + EndPaint(hwnd, &ps); +} + + +static VOID +OnDestroy(PPREVIEW_DATA pPreviewData) +{ + DeleteObject(pPreviewData->hbrScrollbar); + DeleteObject(pPreviewData->hbrDesktop); + DeleteObject(pPreviewData->hbrWindow); + + LocalFree((HLOCAL)pPreviewData->lpInAct); + LocalFree((HLOCAL)pPreviewData->lpAct); + LocalFree((HLOCAL)pPreviewData->lpWinTxt); + LocalFree((HLOCAL)pPreviewData->lpMessBox); + LocalFree((HLOCAL)pPreviewData->lpMessText); + LocalFree((HLOCAL)pPreviewData->lpButText); + LocalFree((HLOCAL)pPreviewData->lpMenNorm); + LocalFree((HLOCAL)pPreviewData->lpMenDis); + LocalFree((HLOCAL)pPreviewData->lpMenSel); } @@ -199,18 +354,12 @@ LPARAM lParam) { PPREVIEW_DATA pPreviewData; - HDC hdc; - PAINTSTRUCT ps; - RECT rc; pPreviewData = (PPREVIEW_DATA)GetWindowLongPtr(hwnd, GWLP_USERDATA); switch (uMsg) { case WM_CREATE: - { - NONCLIENTMETRICS NonClientMetrics; - pPreviewData = (PPREVIEW_DATA)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(PREVIEW_DATA)); @@ -218,140 +367,19 @@ return -1; SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)pPreviewData); - pPreviewData->clrDesktop = GetSysColor(COLOR_DESKTOP); - pPreviewData->hbrDesktop = CreateSolidBrush(pPreviewData->clrDesktop); - pPreviewData->clrWindow = GetSysColor(COLOR_WINDOW); - pPreviewData->hbrWindow = CreateSolidBrush(pPreviewData->clrWindow); - - pPreviewData->cxEdge = GetSystemMetrics(SM_CXEDGE); - pPreviewData->cyEdge = GetSystemMetrics(SM_CXEDGE); - - pPreviewData->cyCaption = 20; //GetSystemMetrics(SM_CYCAPTION); - - /* load font info */ - NonClientMetrics.cbSize = sizeof(NONCLIENTMETRICS); - SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(NONCLIENTMETRICS), &NonClientMetrics, 0); - pPreviewData->CaptionFont = NonClientMetrics.lfCaptionFont; - pPreviewData->MenuFont = NonClientMetrics.lfMenuFont; - pPreviewData->DialogFont = NonClientMetrics.lfMessageFont; - - AllocAndLoadString(&pPreviewData->lpInAct, hApplet, IDS_INACTWIN); - AllocAndLoadString(&pPreviewData->lpAct, hApplet, IDS_ACTWIN); - AllocAndLoadString(&pPreviewData->lpWinTxt, hApplet, IDS_WINTEXT); - AllocAndLoadString(&pPreviewData->lpMessBox, hApplet, IDS_MESSBOX); - AllocAndLoadString(&pPreviewData->lpMessText, hApplet, IDS_MESSTEXT); - AllocAndLoadString(&pPreviewData->lpButText, hApplet, IDS_BUTTEXT); - AllocAndLoadString(&pPreviewData->lpMenNorm, hApplet, IDS_NORMAL); - AllocAndLoadString(&pPreviewData->lpMenDis, hApplet, IDS_DISABLED); - AllocAndLoadString(&pPreviewData->lpMenSel, hApplet, IDS_SELECTED); - + OnCreate(pPreviewData); break; - } case WM_SIZE: OnSize(LOWORD(lParam), HIWORD(lParam), pPreviewData); break; case WM_PAINT: - { - RECT tmpRc; - - hdc = BeginPaint(hwnd, &ps); - - /* Desktop */ - FillRect(hdc, &pPreviewData->rcDesktop, pPreviewData->hbrDesktop); - - /* Inactive Window */ - DrawEdge(hdc, &pPreviewData->rcInactiveFrame, EDGE_RAISED, BF_RECT | BF_MIDDLE); - DrawCaption(hwnd, hdc, &pPreviewData->rcInactiveCaption, DC_GRADIENT | DC_TEXT); - DrawCaptionButtons(hdc, &pPreviewData->rcInactiveCaption, TRUE); - FillSquare(hdc, &pPreviewData->rcInactiveCaption); - CopyRect(&tmpRc, &pPreviewData->rcInactiveCaption); - tmpRc.left += 4; - tmpRc.top += 2; - SelectObject(hdc, CreateFontIndirect(&pPreviewData->CaptionFont)); - SetTextColor(hdc, RGB(212,208,200)); - DrawText(hdc, pPreviewData->lpInAct, lstrlen(pPreviewData->lpInAct), &tmpRc, DT_LEFT); - DeleteObject(SelectObject(hdc, GetStockObject(SYSTEM_FONT))); - - /* Active Window */ - DrawEdge(hdc, &pPreviewData->rcActiveFrame, EDGE_RAISED, BF_RECT | BF_MIDDLE); - DrawCaption(hwnd, hdc, &pPreviewData->rcActiveCaption, DC_ACTIVE | DC_GRADIENT | DC_TEXT); - DrawCaptionButtons(hdc, &pPreviewData->rcActiveCaption, TRUE); - FillSquare(hdc, &pPreviewData->rcActiveCaption); - CopyRect(&tmpRc, &pPreviewData->rcActiveCaption); - tmpRc.left += 4; - tmpRc.top += 2; - SetTextColor(hdc, RGB(255,255,255)); // FIXME: don't hardcode colors - SelectObject(hdc, CreateFontIndirect(&pPreviewData->CaptionFont)); - DrawText(hdc, pPreviewData->lpAct, lstrlen(pPreviewData->lpAct), &tmpRc, DT_LEFT); - DeleteObject(SelectObject(hdc, GetStockObject(SYSTEM_FONT))); - - /* FIXME: Draw the menu bar */ - CopyRect(&rc, &pPreviewData->rcActiveClient); - DrawEdge(hdc, &rc, EDGE_SUNKEN, BF_RECT | BF_ADJUST); - FillRect(hdc, &rc, pPreviewData->hbrWindow); - - /* Draw the client text */ - CopyRect(&tmpRc, &pPreviewData->rcActiveClient); - tmpRc.left += 4; - tmpRc.top += 2; - SetTextColor(hdc, RGB(0,0,0)); - SelectObject(hdc, CreateFontIndirect(&pPreviewData->DialogFont)); - DrawText(hdc, pPreviewData->lpWinTxt, lstrlen(pPreviewData->lpWinTxt), &tmpRc, DT_LEFT); - DeleteObject(SelectObject(hdc, GetStockObject(SYSTEM_FONT))); - - /* Draw the scroll bar */ - DrawScrollbar(hdc, &pPreviewData->rcActiveScroll); - - /* Dialog Window */ - DrawEdge(hdc, &pPreviewData->rcDialogFrame, EDGE_RAISED, BF_RECT | BF_MIDDLE); - DrawCaption(hwnd, hdc, &pPreviewData->rcDialogCaption, DC_ACTIVE | DC_GRADIENT | DC_TEXT); - DrawCaptionButtons(hdc, &pPreviewData->rcDialogCaption, FALSE); - FillSquare(hdc, &pPreviewData->rcDialogCaption); - CopyRect(&tmpRc, &pPreviewData->rcDialogCaption); - tmpRc.left += 4; - tmpRc.top += 2; - SetTextColor(hdc, RGB(255,255,255)); - SelectObject(hdc, CreateFontIndirect(&pPreviewData->CaptionFont)); - DrawText(hdc, pPreviewData->lpMessBox, lstrlen(pPreviewData->lpMessBox), &tmpRc, DT_LEFT); - DeleteObject(SelectObject(hdc, GetStockObject(SYSTEM_FONT))); - - /* draw the dialog text */ - CopyRect(&tmpRc, &pPreviewData->rcDialogClient); - tmpRc.left += 4; - tmpRc.top += 2; - SetTextColor(hdc, RGB(0,0,0)); - SelectObject(hdc, CreateFontIndirect(&pPreviewData->DialogFont)); - DrawText(hdc, pPreviewData->lpMessText, lstrlen(pPreviewData->lpMessText), &tmpRc, DT_LEFT); - DeleteObject(SelectObject(hdc, GetStockObject(SYSTEM_FONT))); - - /* Draw Button */ - DrawFrameControl(hdc, &pPreviewData->rcDialogButton, DFC_BUTTON, DFCS_BUTTONPUSH); - CopyRect(&tmpRc, &pPreviewData->rcDialogButton); - tmpRc.top += 6; - SelectObject(hdc, CreateFontIndirect(&pPreviewData->DialogFont)); - DrawText(hdc, pPreviewData->lpButText, lstrlen(pPreviewData->lpButText), &tmpRc, DT_CENTER); - DeleteObject(SelectObject(hdc, GetStockObject(SYSTEM_FONT))); - - EndPaint(hwnd, &ps); + OnPaint(hwnd, pPreviewData); break; - } case WM_DESTROY: - DeleteObject(pPreviewData->hbrDesktop); - DeleteObject(pPreviewData->hbrWindow); - - LocalFree((HLOCAL)pPreviewData->lpInAct); - LocalFree((HLOCAL)pPreviewData->lpAct); - LocalFree((HLOCAL)pPreviewData->lpWinTxt); - LocalFree((HLOCAL)pPreviewData->lpMessBox); - LocalFree((HLOCAL)pPreviewData->lpMessText); - LocalFree((HLOCAL)pPreviewData->lpButText); - LocalFree((HLOCAL)pPreviewData->lpMenNorm); - LocalFree((HLOCAL)pPreviewData->lpMenDis); - LocalFree((HLOCAL)pPreviewData->lpMenSel); - + OnDestroy(pPreviewData); HeapFree(GetProcessHeap(), 0, pPreviewData); break;
17 years, 11 months
1
0
0
0
[mbosma] 25317: Merge changes from HEAD. It compiles but does not boot yet, because of changes in PS.
by mbosma@svn.reactos.org
Author: mbosma Date: Fri Jan 5 23:28:18 2007 New Revision: 25317 URL:
http://svn.reactos.org/svn/reactos?rev=25317&view=rev
Log: Merge changes from HEAD. It compiles but does not boot yet, because of changes in PS. Removed: branches/cache_manager_rewrite/mm/i386/memsafe.s branches/cache_manager_rewrite/mm/i386/pfault.c Modified: branches/cache_manager_rewrite/Instructions.txt branches/cache_manager_rewrite/cc/cacheman.c branches/cache_manager_rewrite/cc/pin.c branches/cache_manager_rewrite/mm/elf.inc.h branches/cache_manager_rewrite/mm/elf32.c branches/cache_manager_rewrite/mm/freelist.c branches/cache_manager_rewrite/mm/i386/page.c branches/cache_manager_rewrite/mm/iospace.c branches/cache_manager_rewrite/mm/mdl.c branches/cache_manager_rewrite/mm/mm.c branches/cache_manager_rewrite/mm/mminit.c branches/cache_manager_rewrite/mm/pagefile.c branches/cache_manager_rewrite/mm/pe.c branches/cache_manager_rewrite/mm/pool.c branches/cache_manager_rewrite/mm/process.c branches/cache_manager_rewrite/mm/rmap.c branches/cache_manager_rewrite/mm/section.c branches/cache_manager_rewrite/mm/verifier.c branches/cache_manager_rewrite/mm/virtual.c Modified: branches/cache_manager_rewrite/Instructions.txt URL:
http://svn.reactos.org/svn/reactos/branches/cache_manager_rewrite/Instructi…
============================================================================== --- branches/cache_manager_rewrite/Instructions.txt (original) +++ branches/cache_manager_rewrite/Instructions.txt Fri Jan 5 23:28:18 2007 @@ -1,2 +1,2 @@ To build this branch apply the patch to trunk. And replace ntoskrnl/mm, ntoskrnl/cc with the folders from here. -Please note that the version are very likely to be outdated you might want to use svn merge to keep them up to date. +This branch currently applies against: r25313 Modified: branches/cache_manager_rewrite/cc/cacheman.c URL:
http://svn.reactos.org/svn/reactos/branches/cache_manager_rewrite/cc/cachem…
============================================================================== --- branches/cache_manager_rewrite/cc/cacheman.c (original) +++ branches/cache_manager_rewrite/cc/cacheman.c Fri Jan 5 23:28:18 2007 @@ -17,7 +17,7 @@ /* FUNCTIONS *****************************************************************/ VOID NTAPI -CcInit (VOID) +CcInitializeCacheManager (VOID) { CcInitView (); } Modified: branches/cache_manager_rewrite/cc/pin.c URL:
http://svn.reactos.org/svn/reactos/branches/cache_manager_rewrite/cc/pin.c?…
============================================================================== --- branches/cache_manager_rewrite/cc/pin.c (original) +++ branches/cache_manager_rewrite/cc/pin.c Fri Jan 5 23:28:18 2007 @@ -34,7 +34,7 @@ CcMapData (IN PFILE_OBJECT FileObject, IN PLARGE_INTEGER FileOffset, IN ULONG Length, - IN BOOLEAN Wait, + IN ULONG Flags, OUT PVOID * piBcb, OUT PVOID * pBuffer) { @@ -55,8 +55,9 @@ ASSERT (piBcb); ASSERT (pBuffer); - if (!Wait) - { + if (Flags) + { + DPRINT1("No Flags implemented yet."); *piBcb = NULL; *pBuffer = NULL; return FALSE; Modified: branches/cache_manager_rewrite/mm/elf.inc.h URL:
http://svn.reactos.org/svn/reactos/branches/cache_manager_rewrite/mm/elf.in…
============================================================================== --- branches/cache_manager_rewrite/mm/elf.inc.h (original) +++ branches/cache_manager_rewrite/mm/elf.inc.h Fri Jan 5 23:28:18 2007 @@ -448,7 +448,6 @@ nReadStatus = ReadFileCb ( File, - ImageSectionObject->BytesPerSector, &lnOffset, cbPHdrSize, &pData, Modified: branches/cache_manager_rewrite/mm/elf32.c URL:
http://svn.reactos.org/svn/reactos/branches/cache_manager_rewrite/mm/elf32.…
============================================================================== --- branches/cache_manager_rewrite/mm/elf32.c (original) +++ branches/cache_manager_rewrite/mm/elf32.c Fri Jan 5 23:28:18 2007 @@ -10,11 +10,6 @@ #define __ELF_WORD_SIZE 32 #include "elf.inc.h" - -#define IMAGE_FILE_MACHINE_ARM 0x01c0 // ARM little-endian -#define IMAGE_FILE_MACHINE_AXP64 IMAGE_FILE_MACHINE_ALPHA64 -#define IMAGE_FILE_MACHINE_ALPHA64 0x0284 // Alpha AXP, full 64-bit support -#define IMAGE_FILE_MACHINE_M32R 0x9041 // M32R little-endian extern NTSTATUS NTAPI Elf64FmtCreateSection ( Modified: branches/cache_manager_rewrite/mm/freelist.c URL:
http://svn.reactos.org/svn/reactos/branches/cache_manager_rewrite/mm/freeli…
============================================================================== --- branches/cache_manager_rewrite/mm/freelist.c (original) +++ branches/cache_manager_rewrite/mm/freelist.c Fri Jan 5 23:28:18 2007 @@ -17,7 +17,6 @@ #if defined (ALLOC_PRAGMA) #pragma alloc_text(INIT, MmInitializePageList) -#pragma alloc_text(INIT, MmInitZeroPageThread) #endif @@ -63,8 +62,6 @@ static LIST_ENTRY FreeUnzeroedPageListHead; static LIST_ENTRY BiosPageListHead; -static PETHREAD ZeroPageThread; -static CLIENT_ID ZeroPageThreadId; static KEVENT ZeroPageThreadEvent; static BOOLEAN ZeroPageThreadShouldTerminate = FALSE; @@ -336,6 +333,7 @@ NTSTATUS Status; PFN_TYPE LastPage; PFN_TYPE FirstUninitializedPage; + ULONG PdeStart = PsGetCurrentProcess()->Pcb.DirectoryTableBase.LowPart; DPRINT("MmInitializePageList(FirstPhysKernelAddress %x, " "LastPhysKernelAddress %x, " @@ -456,7 +454,7 @@ MmStats.NrReservedPages++; } /* Protect the Page Directory. This will be changed in r3 */ - else if (j >= (KeLoaderBlock.PageDirectoryStart / PAGE_SIZE) && j < (KeLoaderBlock.PageDirectoryEnd / PAGE_SIZE)) + else if (j >= (PdeStart / PAGE_SIZE) && j < (MmFreeLdrPageDirectoryEnd / PAGE_SIZE)) { MmPageArray[j].Flags.Type = MM_PHYSICAL_PAGE_BIOS; MmPageArray[j].Flags.Zero = 0; @@ -1216,7 +1214,8 @@ return NumberOfPagesFound; } -VOID STDCALL +NTSTATUS +NTAPI MmZeroPageThreadMain(PVOID Ignored) { NTSTATUS Status; @@ -1225,6 +1224,13 @@ PPHYSICAL_PAGE PageDescriptor; PFN_TYPE Pfn; ULONG Count; + + /* Free initial kernel memory */ + MiFreeInitMemory(); + + /* Set our priority to 0 */ + KeGetCurrentThread()->BasePriority = 0; + KeSetPriorityThread(KeGetCurrentThread(), 0); while(1) { @@ -1237,13 +1243,12 @@ { DbgPrint("ZeroPageThread: Wait failed\n"); KEBUGCHECK(0); - return; } if (ZeroPageThreadShouldTerminate) { DbgPrint("ZeroPageThread: Terminating\n"); - return; + return STATUS_SUCCESS; } Count = 0; KeAcquireSpinLock(&PageListLock, &oldIrql); @@ -1282,42 +1287,7 @@ KeResetEvent(&ZeroPageThreadEvent); KeReleaseSpinLock(&PageListLock, oldIrql); } -} - -NTSTATUS -INIT_FUNCTION -NTAPI -MmInitZeroPageThread(VOID) -{ - NTSTATUS Status; - HANDLE ThreadHandle; - - ZeroPageThreadShouldTerminate = FALSE; - Status = PsCreateSystemThread(&ThreadHandle, - THREAD_ALL_ACCESS, - NULL, - NULL, - &ZeroPageThreadId, - MmZeroPageThreadMain, - NULL); - if (!NT_SUCCESS(Status)) - { - KEBUGCHECK(0); - } - - Status = ObReferenceObjectByHandle(ThreadHandle, - THREAD_ALL_ACCESS, - PsThreadType, - KernelMode, - (PVOID*)&ZeroPageThread, - NULL); - if (!NT_SUCCESS(Status)) - { - KEBUGCHECK(0); - } - - KeSetPriorityThread(&ZeroPageThread->Tcb, LOW_PRIORITY); - NtClose(ThreadHandle); + return STATUS_SUCCESS; } Removed: branches/cache_manager_rewrite/mm/i386/memsafe.s URL:
http://svn.reactos.org/svn/reactos/branches/cache_manager_rewrite/mm/i386/m…
============================================================================== --- branches/cache_manager_rewrite/mm/i386/memsafe.s (original) +++ branches/cache_manager_rewrite/mm/i386/memsafe.s (removed) @@ -1,17 +1,0 @@ -.globl @MmSafeReadPtr@4 -.globl _MmSafeReadPtrStart -.globl _MmSafeReadPtrEnd - -/*****************************************************************************/ - - /* - * PVOID FASTCALL MmSafeReadPtr(PVOID Source) - */ -@MmSafeReadPtr@4: -_MmSafeReadPtrStart: - /* - * If we incur a pagefault, eax will be set NULL - */ - movl (%ecx),%eax -_MmSafeReadPtrEnd: - ret Modified: branches/cache_manager_rewrite/mm/i386/page.c URL:
http://svn.reactos.org/svn/reactos/branches/cache_manager_rewrite/mm/i386/p…
============================================================================== --- branches/cache_manager_rewrite/mm/i386/page.c (original) +++ branches/cache_manager_rewrite/mm/i386/page.c Fri Jan 5 23:28:18 2007 @@ -70,7 +70,6 @@ extern BOOLEAN Ke386Pae; extern BOOLEAN Ke386NoExecute; -extern BOOLEAN Ke386GlobalPagesEnabled; /* FUNCTIONS ***************************************************************/ @@ -86,11 +85,11 @@ } else if (Address == (PVOID)0xfffffffe) { - FLUSH_TLB; - } - else - { - FLUSH_TLB_ONE(Address); + KeFlushCurrentTb(); + } + else + { + __invlpg(Address); } } @@ -113,7 +112,7 @@ #else if ((Pt && MmUnmapPageTable(Pt)) || Address >= MmSystemRangeStart) { - FLUSH_TLB_ONE(Address); + __invlpg(Address); } #endif } @@ -123,9 +122,7 @@ PULONG MmGetPageDirectory(VOID) { - unsigned int page_dir=0; - Ke386GetPageTableDirectory(page_dir); - return((PULONG)page_dir); + return (PULONG)__readcr3(); } static ULONG @@ -2223,7 +2220,7 @@ } } Address = (PVOID)((ULONG_PTR)HYPERSPACE + i * PAGE_SIZE); - FLUSH_TLB_ONE(Address); + __invlpg(Address); return Address; } @@ -2245,7 +2242,7 @@ Entry = InterlockedExchange((PLONG)ADDR_TO_PTE(Address), PFN_TO_PTE(NewPage) | PA_PRESENT | PA_READWRITE); Pfn = PTE_TO_PFN(Entry); } - FLUSH_TLB_ONE(Address); + __invlpg(Address); return Pfn; } @@ -2267,7 +2264,7 @@ Entry = InterlockedExchange((PLONG)ADDR_TO_PTE(Address), 0); Pfn = PTE_TO_PFN(Entry); } - FLUSH_TLB_ONE(Address); + __invlpg(Address); return Pfn; } Removed: branches/cache_manager_rewrite/mm/i386/pfault.c URL:
http://svn.reactos.org/svn/reactos/branches/cache_manager_rewrite/mm/i386/p…
============================================================================== --- branches/cache_manager_rewrite/mm/i386/pfault.c (original) +++ branches/cache_manager_rewrite/mm/i386/pfault.c (removed) @@ -1,135 +1,0 @@ -/* $Id$ - * - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel - * FILE: ntoskrnl/mm/i386/pfault.c - * PURPOSE: Paging file functions - * - * PROGRAMMERS: David Welch (welch(a)mcmail.com) - */ - -/* INCLUDES *****************************************************************/ - -#include <ntoskrnl.h> -#define NDEBUG -#include <internal/debug.h> - -/* EXTERNS *******************************************************************/ - -extern VOID MmSafeReadPtrStart(VOID); -extern VOID MmSafeReadPtrEnd(VOID); - - -extern BOOLEAN Mmi386MakeKernelPageTableGlobal(PVOID Address); -extern ULONG KiKernelTrapHandler(PKTRAP_FRAME Tf, ULONG ExceptionNr, PVOID Cr2); - -extern BOOLEAN Ke386NoExecute; - -/* FUNCTIONS *****************************************************************/ - -ULONG KiPageFaultHandler(PKTRAP_FRAME Tf, ULONG ExceptionNr) -{ - ULONG_PTR cr2; - NTSTATUS Status; - KPROCESSOR_MODE Mode; - - ASSERT(ExceptionNr == 14); - - /* Store the exception number in an unused field in the trap frame. */ - Tf->DbgArgMark = 14; - - /* get the faulting address */ - cr2 = Ke386GetCr2(); - Tf->DbgArgPointer = cr2; - - /* it's safe to enable interrupts after cr2 has been saved */ - if (Tf->EFlags & (X86_EFLAGS_VM|X86_EFLAGS_IF)) - { - Ke386EnableInterrupts(); - } - - if (cr2 >= (ULONG_PTR)MmSystemRangeStart) - { - /* check for an invalid page directory in kernel mode */ - if (!(Tf->ErrCode & 0x5) && Mmi386MakeKernelPageTableGlobal((PVOID)cr2)) - { - return 0; - } - - /* check for non executable memory in kernel mode */ - if (Ke386NoExecute && Tf->ErrCode & 0x10) - { - KEBUGCHECKWITHTF(ATTEMPTED_EXECUTE_OF_NOEXECUTE_MEMORY, 0, 0, 0, 0, Tf); - } - } - - Mode = Tf->ErrCode & 0x4 ? UserMode : KernelMode; - - /* handle the fault */ - if (Tf->ErrCode & 0x1) - { - Status = MmAccessFault(Mode, cr2, FALSE); - } - else - { - Status = MmNotPresentFault(Mode, cr2, FALSE); - } - - /* handle the return for v86 mode */ - if (Tf->EFlags & X86_EFLAGS_VM) - { - if (!NT_SUCCESS(Status)) - { - /* FIXME: This should use ->VdmObjects */ - if(!KeGetCurrentProcess()->Unused) - { - *((PKV86M_TRAP_FRAME)Tf)->regs->PStatus = STATUS_NONCONTINUABLE_EXCEPTION; - } - return 1; - } - return 0; - } - - if (Mode == KernelMode) - { - if (!NT_SUCCESS(Status)) - { - if (Tf->Eip >= (ULONG_PTR)MmSafeReadPtrStart && - Tf->Eip < (ULONG_PTR)MmSafeReadPtrEnd) - { - Tf->Eip = (ULONG_PTR)MmSafeReadPtrEnd; - Tf->Eax = 0; - return 0; - } - } - } - else - { - if (KeGetCurrentThread()->ApcState.UserApcPending) - { - KIRQL oldIrql; - - KeRaiseIrql(APC_LEVEL, &oldIrql); - KiDeliverApc(UserMode, NULL, NULL); - KeLowerIrql(oldIrql); - } - } - - if (NT_SUCCESS(Status)) - { - return 0; - } - - /* - * Handle user exceptions differently - */ - if (Mode == KernelMode) - { - return(KiKernelTrapHandler(Tf, 14, (PVOID)cr2)); - } - else - { - return(KiUserTrapHandler(Tf, 14, (PVOID)cr2)); - } -} - Modified: branches/cache_manager_rewrite/mm/iospace.c URL:
http://svn.reactos.org/svn/reactos/branches/cache_manager_rewrite/mm/iospac…
============================================================================== --- branches/cache_manager_rewrite/mm/iospace.c (original) +++ branches/cache_manager_rewrite/mm/iospace.c Fri Jan 5 23:28:18 2007 @@ -140,7 +140,7 @@ MmUnmapIoSpace (IN PVOID BaseAddress, IN ULONG NumberOfBytes) { - ULONG Offset; + LONG Offset; PVOID Address = BaseAddress; Offset = (ULONG_PTR)Address % PAGE_SIZE; Modified: branches/cache_manager_rewrite/mm/mdl.c URL:
http://svn.reactos.org/svn/reactos/branches/cache_manager_rewrite/mm/mdl.c?…
============================================================================== --- branches/cache_manager_rewrite/mm/mdl.c (original) +++ branches/cache_manager_rewrite/mm/mdl.c Fri Jan 5 23:28:18 2007 @@ -433,7 +433,7 @@ if (!MmIsPagePresent(NULL, Address)) { - Status = MmNotPresentFault(Mode, (ULONG_PTR)Address, TRUE); + Status = MmAccessFault(FALSE, Address, Mode, NULL); if (!NT_SUCCESS(Status)) { for (j = 0; j < i; j++) @@ -457,7 +457,7 @@ if ((Operation == IoWriteAccess || Operation == IoModifyAccess) && (!(MmGetPageProtect(NULL, (PVOID)Address) & PAGE_READWRITE))) { - Status = MmAccessFault(Mode, (ULONG_PTR)Address, TRUE); + Status = MmAccessFault(TRUE, Address, Mode, NULL); if (!NT_SUCCESS(Status)) { for (j = 0; j < i; j++) Modified: branches/cache_manager_rewrite/mm/mm.c URL:
http://svn.reactos.org/svn/reactos/branches/cache_manager_rewrite/mm/mm.c?r…
============================================================================== --- branches/cache_manager_rewrite/mm/mm.c (original) +++ branches/cache_manager_rewrite/mm/mm.c Fri Jan 5 23:28:18 2007 @@ -14,9 +14,6 @@ #include <internal/debug.h> /* GLOBALS *****************************************************************/ - -extern LDR_DATA_TABLE_ENTRY NtoskrnlModuleObject; -extern LDR_DATA_TABLE_ENTRY HalModuleObject; ULONG MmUserProbeAddress = 0; PVOID MmHighestUserAddress = NULL; @@ -78,9 +75,9 @@ NTSTATUS NTAPI -MmAccessFault(KPROCESSOR_MODE Mode, - ULONG_PTR Address, - BOOLEAN FromMdl) +MmpAccessFault(KPROCESSOR_MODE Mode, + ULONG_PTR Address, + BOOLEAN FromMdl) { PMADDRESS_SPACE AddressSpace; MEMORY_AREA* MemoryArea; @@ -112,7 +109,7 @@ { DPRINT1("MmAccessFault(Mode %d, Address %x)\n", Mode, Address); DbgPrint("%s:%d\n",__FILE__,__LINE__); - return(STATUS_UNSUCCESSFUL); + return(STATUS_ACCESS_VIOLATION); } AddressSpace = MmGetKernelAddressSpace(); } @@ -134,13 +131,13 @@ { MmUnlockAddressSpace(AddressSpace); } - return (STATUS_UNSUCCESSFUL); + return (STATUS_ACCESS_VIOLATION); } switch (MemoryArea->Type) { case MEMORY_AREA_SYSTEM: - Status = STATUS_UNSUCCESSFUL; + Status = STATUS_ACCESS_VIOLATION; break; case MEMORY_AREA_PAGED_POOL: @@ -155,15 +152,15 @@ break; case MEMORY_AREA_VIRTUAL_MEMORY: - Status = STATUS_UNSUCCESSFUL; + Status = STATUS_ACCESS_VIOLATION; break; case MEMORY_AREA_SHARED_DATA: - Status = STATUS_UNSUCCESSFUL; + Status = STATUS_ACCESS_VIOLATION; break; default: - Status = STATUS_UNSUCCESSFUL; + Status = STATUS_ACCESS_VIOLATION; break; } } @@ -173,32 +170,6 @@ if (!FromMdl) { MmUnlockAddressSpace(AddressSpace); - } - return(Status); -} - -NTSTATUS -NTAPI -MmCommitPagedPoolAddress(PVOID Address, BOOLEAN Locked) -{ - NTSTATUS Status; - PFN_TYPE AllocatedPage; - Status = MmRequestPageMemoryConsumer(MC_PPOOL, FALSE, &AllocatedPage); - if (!NT_SUCCESS(Status)) - { - MmUnlockAddressSpace(MmGetKernelAddressSpace()); - Status = MmRequestPageMemoryConsumer(MC_PPOOL, TRUE, &AllocatedPage); - MmLockAddressSpace(MmGetKernelAddressSpace()); - } - Status = - MmCreateVirtualMapping(NULL, - (PVOID)PAGE_ROUND_DOWN(Address), - PAGE_READWRITE, - &AllocatedPage, - 1); - if (Locked) - { - MmLockPage(AllocatedPage); } return(Status); } @@ -230,7 +201,7 @@ DPRINT("No current process\n"); if (Address < (ULONG_PTR)MmSystemRangeStart) { - return(STATUS_UNSUCCESSFUL); + return(STATUS_ACCESS_VIOLATION); } } @@ -245,7 +216,7 @@ if (Mode != KernelMode) { CPRINT("Address: %x\n", Address); - return(STATUS_UNSUCCESSFUL); + return(STATUS_ACCESS_VIOLATION); } AddressSpace = MmGetKernelAddressSpace(); } @@ -271,7 +242,7 @@ { MmUnlockAddressSpace(AddressSpace); } - return (STATUS_UNSUCCESSFUL); + return (STATUS_ACCESS_VIOLATION); } switch (MemoryArea->Type) @@ -283,7 +254,7 @@ } case MEMORY_AREA_SYSTEM: - Status = STATUS_UNSUCCESSFUL; + Status = STATUS_ACCESS_VIOLATION; break; case MEMORY_AREA_SECTION_VIEW: @@ -313,7 +284,7 @@ break; default: - Status = STATUS_UNSUCCESSFUL; + Status = STATUS_ACCESS_VIOLATION; break; } } @@ -326,6 +297,67 @@ } return(Status); } + +extern BOOLEAN Mmi386MakeKernelPageTableGlobal(PVOID Address); + +NTSTATUS +NTAPI +MmAccessFault(IN BOOLEAN StoreInstruction, + IN PVOID Address, + IN KPROCESSOR_MODE Mode, + IN PVOID TrapInformation) +{ + /* Cute little hack for ROS */ + if ((ULONG_PTR)Address >= (ULONG_PTR)MmSystemRangeStart) + { + /* Check for an invalid page directory in kernel mode */ + if (Mmi386MakeKernelPageTableGlobal(Address)) + { + /* All is well with the world */ + return STATUS_SUCCESS; + } + } + + /* Keep same old ReactOS Behaviour */ + if (StoreInstruction) + { + /* Call access fault */ + return MmpAccessFault(Mode, (ULONG_PTR)Address, TrapInformation ? FALSE : TRUE); + } + else + { + /* Call not present */ + return MmNotPresentFault(Mode, (ULONG_PTR)Address, TrapInformation ? FALSE : TRUE); + } +} + +NTSTATUS +NTAPI +MmCommitPagedPoolAddress(PVOID Address, BOOLEAN Locked) +{ + NTSTATUS Status; + PFN_TYPE AllocatedPage; + Status = MmRequestPageMemoryConsumer(MC_PPOOL, FALSE, &AllocatedPage); + if (!NT_SUCCESS(Status)) + { + MmUnlockAddressSpace(MmGetKernelAddressSpace()); + Status = MmRequestPageMemoryConsumer(MC_PPOOL, TRUE, &AllocatedPage); + MmLockAddressSpace(MmGetKernelAddressSpace()); + } + Status = + MmCreateVirtualMapping(NULL, + (PVOID)PAGE_ROUND_DOWN(Address), + PAGE_READWRITE, + &AllocatedPage, + 1); + if (Locked) + { + MmLockPage(AllocatedPage); + } + return(Status); +} + + /* Miscellanea functions: they may fit somewhere else */ @@ -371,38 +403,88 @@ * @implemented */ PVOID -STDCALL -MmGetSystemRoutineAddress ( - IN PUNICODE_STRING SystemRoutineName - ) -{ - PVOID ProcAddress; - ANSI_STRING AnsiRoutineName; - NTSTATUS Status; - - if(!NT_SUCCESS(RtlUnicodeStringToAnsiString(&AnsiRoutineName, - SystemRoutineName, - TRUE))) - { - return NULL; - } - - Status = LdrGetProcedureAddress(NtoskrnlModuleObject.DllBase, - &AnsiRoutineName, - 0, - &ProcAddress); - - if(!NT_SUCCESS(Status)) - { - Status = LdrGetProcedureAddress(HalModuleObject.DllBase, - &AnsiRoutineName, - 0, - &ProcAddress); - } - - RtlFreeAnsiString(&AnsiRoutineName); - - return (NT_SUCCESS(Status) ? ProcAddress : NULL); +NTAPI +MmGetSystemRoutineAddress(IN PUNICODE_STRING SystemRoutineName) +{ + PVOID ProcAddress; + ANSI_STRING AnsiRoutineName; + NTSTATUS Status; + PLIST_ENTRY NextEntry; + extern LIST_ENTRY ModuleListHead; + PLDR_DATA_TABLE_ENTRY LdrEntry; + BOOLEAN Found = FALSE; + UNICODE_STRING KernelName = RTL_CONSTANT_STRING(L"ntoskrnl.exe"); + UNICODE_STRING HalName = RTL_CONSTANT_STRING(L"hal.dll"); + + /* Convert routine to ansi name */ + Status = RtlUnicodeStringToAnsiString(&AnsiRoutineName, + SystemRoutineName, + TRUE); + if (!NT_SUCCESS(Status)) return NULL; + + /* Loop the loaded module list */ + NextEntry = ModuleListHead.Flink; + while (NextEntry != &ModuleListHead) + { + /* Get the entry */ + LdrEntry = CONTAINING_RECORD(NextEntry, + LDR_DATA_TABLE_ENTRY, + InLoadOrderLinks); + + /* Check if it's the kernel or HAL */ + if (RtlEqualUnicodeString(&KernelName, &LdrEntry->BaseDllName, TRUE)) + { + /* Found it */ + Found = TRUE; + } + else if (RtlEqualUnicodeString(&HalName, &LdrEntry->BaseDllName, TRUE)) + { + /* Found it */ + Found = TRUE; + } + + /* Check if we found a valid binary */ + if (Found) + { + /* Find the procedure name */ + Status = LdrGetProcedureAddress(LdrEntry->DllBase, + &AnsiRoutineName, + 0, + &ProcAddress); + break; + } + + /* Keep looping */ + NextEntry = NextEntry->Flink; + } + + /* Free the string and return */ + RtlFreeAnsiString(&AnsiRoutineName); + return (NT_SUCCESS(Status) ? ProcAddress : NULL); +} + +NTSTATUS +NTAPI +NtGetWriteWatch(IN HANDLE ProcessHandle, + IN ULONG Flags, + IN PVOID BaseAddress, + IN ULONG RegionSize, + IN PVOID *UserAddressArray, + OUT PULONG EntriesInUserAddressArray, + OUT PULONG Granularity) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +NTSTATUS +NTAPI +NtResetWriteWatch(IN HANDLE ProcessHandle, + IN PVOID BaseAddress, + IN ULONG RegionSize) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; } /* EOF */ Modified: branches/cache_manager_rewrite/mm/mminit.c URL:
http://svn.reactos.org/svn/reactos/branches/cache_manager_rewrite/mm/mminit…
============================================================================== --- branches/cache_manager_rewrite/mm/mminit.c (original) +++ branches/cache_manager_rewrite/mm/mminit.c Fri Jan 5 23:28:18 2007 @@ -19,6 +19,7 @@ /* * Compiler defined symbols */ +extern unsigned int _image_base__; extern unsigned int _text_start__; extern unsigned int _text_end__; @@ -158,8 +159,8 @@ 0, BoundaryAddressMultiple); - BaseAddress = (PVOID)KERNEL_BASE; - Length = PAGE_ROUND_UP(((ULONG_PTR)&_text_end__)) - KERNEL_BASE; + BaseAddress = (PVOID)&_image_base__; + Length = PAGE_ROUND_UP(((ULONG_PTR)&_text_end__)) - (ULONG_PTR)&_image_base__; ParamLength = ParamLength - Length; /* @@ -299,11 +300,15 @@ ULONG i; ULONG kernel_len; ULONG_PTR MappingAddress; + PLDR_DATA_TABLE_ENTRY LdrEntry; DPRINT("MmInit1(FirstKrnlPhysAddr, %p, LastKrnlPhysAddr %p, LastKernelAddress %p)\n", FirstKrnlPhysAddr, LastKrnlPhysAddr, LastKernelAddress); + + /* Set the page directory */ + PsGetCurrentProcess()->Pcb.DirectoryTableBase.LowPart = (ULONG)MmGetPageDirectory(); if ((BIOSMemoryMap != NULL) && (AddressRangeCount > 0)) { @@ -317,15 +322,31 @@ last = (BIOSMemoryMap[i].BaseAddrLow + BIOSMemoryMap[i].LengthLow + PAGE_SIZE -1) / PAGE_SIZE; } } - if ((last - 256) * 4 > KeLoaderBlock.MemHigher) + if ((last - 256) * 4 > MmFreeLdrMemHigher) { - KeLoaderBlock.MemHigher = (last - 256) * 4; + MmFreeLdrMemHigher = (last - 256) * 4; } } - if (KeLoaderBlock.MemHigher >= (MaxMem - 1) * 1024) - { - KeLoaderBlock.MemHigher = (MaxMem - 1) * 1024; + /* NTLDR Hacks */ + if (!MmFreeLdrMemHigher) MmFreeLdrMemHigher = 65536; + if (!MmFreeLdrPageDirectoryEnd) MmFreeLdrPageDirectoryEnd = 0x40000; + if (!FirstKrnlPhysAddr) + { + /* Get the kernel entry */ + LdrEntry = CONTAINING_RECORD(KeLoaderBlock->LoadOrderListHead.Flink, + LDR_DATA_TABLE_ENTRY, + InLoadOrderLinks); + + /* Get the addresses */ + FirstKrnlPhysAddr = (ULONG_PTR)LdrEntry->DllBase - KSEG0_BASE; + + /* FIXME: How do we get the last address? */ + } + + if (MmFreeLdrMemHigher >= (MaxMem - 1) * 1024) + { + MmFreeLdrMemHigher = (MaxMem - 1) * 1024; } /* Set memory limits */ @@ -357,7 +378,7 @@ /* * Free physical memory not used by the kernel */ - MmStats.NrTotalPages = KeLoaderBlock.MemHigher/4; + MmStats.NrTotalPages = MmFreeLdrMemHigher/4; if (!MmStats.NrTotalPages) { DbgPrint("Memory not detected, default to 8 MB\n"); @@ -413,9 +434,9 @@ #endif DPRINT("Invalidating between %x and %x\n", - LastKernelAddress, KERNEL_BASE + 0x00600000); + LastKernelAddress, KSEG0_BASE + 0x00600000); for (MappingAddress = LastKernelAddress; - MappingAddress < KERNEL_BASE + 0x00600000; + MappingAddress < KSEG0_BASE + 0x00600000; MappingAddress += PAGE_SIZE) { MmRawDeleteVirtualMapping((PVOID)MappingAddress); @@ -458,7 +479,6 @@ MmDeletePageTable(NULL, 0); #endif - MmInitZeroPageThread(); MmCreatePhysicalMemorySection(); MiInitBalancerThread(); Modified: branches/cache_manager_rewrite/mm/pagefile.c URL:
http://svn.reactos.org/svn/reactos/branches/cache_manager_rewrite/mm/pagefi…
============================================================================== --- branches/cache_manager_rewrite/mm/pagefile.c (original) +++ branches/cache_manager_rewrite/mm/pagefile.c Fri Jan 5 23:28:18 2007 @@ -586,7 +586,7 @@ RetrievalPointers = PagingFileList[MmCoreDumpPageFile]->RetrievalPointers; /* Dump the header. */ - MdlMap[0] = MmGetPhysicalAddress(MmCoreDumpPageFrame).QuadPart >> PAGE_SHIFT; + MdlMap[0] = (ULONG)(MmGetPhysicalAddress(MmCoreDumpPageFrame).QuadPart >> PAGE_SHIFT); #if defined(__GNUC__) DiskOffset = MmGetOffsetPageFile(RetrievalPointers, (LARGE_INTEGER)0LL); Modified: branches/cache_manager_rewrite/mm/pe.c URL:
http://svn.reactos.org/svn/reactos/branches/cache_manager_rewrite/mm/pe.c?r…
============================================================================== --- branches/cache_manager_rewrite/mm/pe.c (original) +++ branches/cache_manager_rewrite/mm/pe.c Fri Jan 5 23:28:18 2007 @@ -677,4 +677,108 @@ return nStatus; } +BOOLEAN +NTAPI +MmVerifyImageIsOkForMpUse(IN PVOID BaseAddress) +{ + PIMAGE_NT_HEADERS NtHeader; + PAGED_CODE(); + + /* Get NT Headers */ + NtHeader = RtlImageNtHeader(BaseAddress); + if (NtHeader) + { + /* Check if this image is only safe for UP while we have 2+ CPUs */ + if ((KeNumberProcessors > 1) && + (NtHeader->FileHeader.Characteristics & IMAGE_FILE_UP_SYSTEM_ONLY)) + { + /* Fail */ + return FALSE; + } + } + + /* Otherwise, it's safe */ + return TRUE; +} + +NTSTATUS +NTAPI +MmCheckSystemImage(IN HANDLE ImageHandle, + IN BOOLEAN PurgeSection) +{ + NTSTATUS Status; + HANDLE SectionHandle; + PVOID ViewBase = NULL; + SIZE_T ViewSize = 0; + IO_STATUS_BLOCK IoStatusBlock; + FILE_STANDARD_INFORMATION FileStandardInfo; + KAPC_STATE ApcState; + PAGED_CODE(); + + /* Create a section for the DLL */ + Status = ZwCreateSection(&SectionHandle, + SECTION_MAP_EXECUTE, + NULL, + NULL, + PAGE_EXECUTE, + SEC_COMMIT, + ImageHandle); + if (!NT_SUCCESS(Status)) return Status; + + /* Make sure we're in the system process */ + KeStackAttachProcess(&PsInitialSystemProcess->Pcb, &ApcState); + + /* Map it */ + Status = ZwMapViewOfSection(SectionHandle, + NtCurrentProcess(), + &ViewBase, + 0, + 0, + NULL, + &ViewSize, + ViewShare, + 0, + PAGE_EXECUTE); + if (!NT_SUCCESS(Status)) + { + /* We failed, close the handle and return */ + KeUnstackDetachProcess(&ApcState); + ZwClose(SectionHandle); + return Status; + } + + /* Now query image information */ + Status = ZwQueryInformationFile(ImageHandle, + &IoStatusBlock, + &FileStandardInfo, + sizeof(FileStandardInfo), + FileStandardInformation); + if ( NT_SUCCESS(Status) ) + { + /* First, verify the checksum */ + if (!LdrVerifyMappedImageMatchesChecksum(ViewBase, + FileStandardInfo. + EndOfFile.LowPart, + FileStandardInfo. + EndOfFile.LowPart)) + { + /* Set checksum failure */ + Status = STATUS_IMAGE_CHECKSUM_MISMATCH; + } + + /* Check that it's a valid SMP image if we have more then one CPU */ + if (!MmVerifyImageIsOkForMpUse(ViewBase)) + { + /* Otherwise it's not the right image */ + Status = STATUS_IMAGE_MP_UP_MISMATCH; + } + } + + /* Unmap the section, close the handle, and return status */ + ZwUnmapViewOfSection(NtCurrentProcess(), ViewBase); + KeUnstackDetachProcess(&ApcState); + ZwClose(SectionHandle); + return Status; +} + /* EOF */ Modified: branches/cache_manager_rewrite/mm/pool.c URL:
http://svn.reactos.org/svn/reactos/branches/cache_manager_rewrite/mm/pool.c…
============================================================================== --- branches/cache_manager_rewrite/mm/pool.c (original) +++ branches/cache_manager_rewrite/mm/pool.c Fri Jan 5 23:28:18 2007 @@ -161,53 +161,62 @@ return ExAllocatePoolWithTag(PoolType, NumberOfBytes, Tag); } -/* - * @implemented - */ -PVOID STDCALL +_SEH_DEFINE_LOCALS(ExQuotaPoolVars) +{ + PVOID Block; +}; + +_SEH_FILTER(FreeAndGoOn) +{ + _SEH_ACCESS_LOCALS(ExQuotaPoolVars); + + /* Couldn't charge, so free the pool and let the caller SEH manage */ + ExFreePool(_SEH_VAR(Block)); + return EXCEPTION_CONTINUE_SEARCH; +} + +/* + * @implemented + */ +PVOID +NTAPI ExAllocatePoolWithQuotaTag (IN POOL_TYPE PoolType, - IN ULONG NumberOfBytes, - IN ULONG Tag) -{ - PVOID Block; + IN ULONG NumberOfBytes, + IN ULONG Tag) +{ PEPROCESS Process; + _SEH_DECLARE_LOCALS(ExQuotaPoolVars); /* Allocate the Pool First */ - Block = EiAllocatePool(PoolType, - NumberOfBytes, - Tag, - &ExAllocatePoolWithQuotaTag); + _SEH_VAR(Block) = EiAllocatePool(PoolType, + NumberOfBytes, + Tag, + &ExAllocatePoolWithQuotaTag); /* "Quota is not charged to the thread for allocations >= PAGE_SIZE" - OSR Docs */ - if (!(NumberOfBytes >= PAGE_SIZE)) { - + if (!(NumberOfBytes >= PAGE_SIZE)) + { /* Get the Current Process */ Process = PsGetCurrentProcess(); /* PsChargePoolQuota returns an exception, so this needs SEH */ -#if defined(__GNUC__) - _SEH_FILTER(FreeAndGoOn) { - /* Couldn't charge, so free the pool and let the caller SEH manage */ - ExFreePool(Block); - return EXCEPTION_CONTINUE_SEARCH; - } _SEH_TRY { - //* FIXME: Is there a way to get the actual Pool size allocated from the pool header? */ - PsChargePoolQuota(Process, PoolType & PAGED_POOL_MASK, NumberOfBytes); - } _SEH_EXCEPT(FreeAndGoOn) { + _SEH_TRY + { + /* FIXME: Is there a way to get the actual Pool size allocated from the pool header? */ + PsChargePoolQuota(Process, + PoolType & PAGED_POOL_MASK, + NumberOfBytes); + } + _SEH_EXCEPT(FreeAndGoOn) + { /* Quota Exceeded and the caller had no SEH! */ KeBugCheck(STATUS_QUOTA_EXCEEDED); - } _SEH_END; -#else /* assuming all other Win32 compilers understand SEH */ - __try { - PsChargePoolQuota(Process, PoolType & PAGED_POOL_MASK, NumberOfBytes); - } - __except (ExFreePool(Block), EXCEPTION_CONTINUE_SEARCH) { - KeBugCheck(STATUS_QUOTA_EXCEEDED); - } -#endif + } + _SEH_END; } - return Block; + /* Return the allocated block */ + return _SEH_VAR(Block); } /* Modified: branches/cache_manager_rewrite/mm/process.c URL:
http://svn.reactos.org/svn/reactos/branches/cache_manager_rewrite/mm/proces…
============================================================================== --- branches/cache_manager_rewrite/mm/process.c (original) +++ branches/cache_manager_rewrite/mm/process.c Fri Jan 5 23:28:18 2007 @@ -291,7 +291,7 @@ /* Map NLS Tables */ DPRINT("Mapping NLS\n"); - Status = MmMapViewOfSection(NlsSectionObject, + Status = MmMapViewOfSection(ExpNlsSectionPointer, (PEPROCESS)Process, &TableBase, 0, @@ -322,9 +322,9 @@ Peb->Mutant = NULL; /* NLS */ - Peb->AnsiCodePageData = (char*)TableBase + NlsAnsiTableOffset; - Peb->OemCodePageData = (char*)TableBase + NlsOemTableOffset; - Peb->UnicodeCaseTableData = (char*)TableBase + NlsUnicodeTableOffset; + Peb->AnsiCodePageData = (PCHAR)TableBase + ExpAnsiCodePageDataOffset; + Peb->OemCodePageData = (PCHAR)TableBase + ExpOemCodePageDataOffset; + Peb->UnicodeCaseTableData = (PCHAR)TableBase + ExpUnicodeCaseTableDataOffset; /* Default Version Data (could get changed below) */ Peb->OSMajorVersion = NtMajorVersion; Modified: branches/cache_manager_rewrite/mm/rmap.c URL:
http://svn.reactos.org/svn/reactos/branches/cache_manager_rewrite/mm/rmap.c…
============================================================================== --- branches/cache_manager_rewrite/mm/rmap.c (original) +++ branches/cache_manager_rewrite/mm/rmap.c Fri Jan 5 23:28:18 2007 @@ -408,7 +408,7 @@ KEBUGCHECK(0); } new_entry->Address = Address; - new_entry->Process = Process; + new_entry->Process = (PEPROCESS)Process; #ifdef DBG new_entry->Caller = __builtin_return_address(0); #endif @@ -510,7 +510,7 @@ current_entry = MmGetRmapListHeadPage(Page); while (current_entry != NULL) { - if (current_entry->Process == Process && + if (current_entry->Process == (PEPROCESS)Process && current_entry->Address == Address) { if (previous_entry == NULL) Modified: branches/cache_manager_rewrite/mm/section.c URL:
http://svn.reactos.org/svn/reactos/branches/cache_manager_rewrite/mm/sectio…
============================================================================== --- branches/cache_manager_rewrite/mm/section.c (original) +++ branches/cache_manager_rewrite/mm/section.c Fri Jan 5 23:28:18 2007 @@ -142,6 +142,65 @@ /* Return the file object */ return Section->FileObject; // Section->ControlArea->FileObject on NT +} + +NTSTATUS +NTAPI +MmGetFileNameForSection(IN PROS_SECTION_OBJECT Section, + OUT POBJECT_NAME_INFORMATION *ModuleName) +{ + POBJECT_NAME_INFORMATION ObjectNameInfo; + NTSTATUS Status; + ULONG ReturnLength; + + /* Make sure it's an image section */ + *ModuleName = NULL; + if (!(Section->AllocationAttributes & SEC_IMAGE)) + { + /* It's not, fail */ + return STATUS_SECTION_NOT_IMAGE; + } + + /* Allocate memory for our structure */ + ObjectNameInfo = ExAllocatePoolWithTag(PagedPool, + 1024, + TAG('M', 'm', ' ', ' ')); + if (!ObjectNameInfo) return STATUS_NO_MEMORY; + + /* Query the name */ + Status = ObQueryNameString(Section->FileObject, + ObjectNameInfo, + 1024, + &ReturnLength); + if (!NT_SUCCESS(Status)) + { + /* Failed, free memory */ + ExFreePool(ObjectNameInfo); + return Status; + } + + /* Success */ + *ModuleName = ObjectNameInfo; + return STATUS_SUCCESS; +} + +NTSTATUS +NTAPI +MmGetFileNameForAddress(IN PVOID Address, + OUT PUNICODE_STRING ModuleName) +{ + /* + * FIXME: TODO. + * Filip says to get the MADDRESS_SPACE from EPROCESS, + * then use the MmMarea routines to locate the Marea that + * corresponds to the address. Then make sure it's a section + * view type (MEMORY_AREA_SECTION_VIEW) and use the marea's + * per-type union to get the .u.SectionView.Section pointer to + * the SECTION_OBJECT. Then we can use MmGetFileNameForSection + * to get the full filename. + */ + RtlCreateUnicodeString(ModuleName, L"C:\\ReactOS\\system32\\ntdll.dll"); + return STATUS_SUCCESS; } /* Note: Mmsp prefix denotes "Memory Manager Section Private". */ @@ -2916,7 +2975,7 @@ return(STATUS_SUCCESS); } -VOID STATIC +VOID static MmAlterViewAttributes(PMADDRESS_SPACE AddressSpace, PVOID BaseAddress, ULONG RegionSize, @@ -4586,7 +4645,7 @@ return(Status); } -NTSTATUS STATIC +NTSTATUS static MmMapViewOfSegment(PMADDRESS_SPACE AddressSpace, PROS_SECTION_OBJECT Section, PMM_SECTION_SEGMENT Segment, @@ -4835,7 +4894,7 @@ return(Status); } -VOID STATIC +VOID static MmFreeSectionPage(PVOID Context, MEMORY_AREA* MemoryArea, PVOID Address, PFN_TYPE Page, SWAPENTRY SwapEntry, BOOLEAN Dirty) { @@ -4927,7 +4986,7 @@ } } -STATIC NTSTATUS +static NTSTATUS MmUnmapViewOfSegment(PMADDRESS_SPACE AddressSpace, PVOID BaseAddress) { @@ -5066,7 +5125,8 @@ * and calculate the image base address */ for (i = 0; i < NrSegments; i++) { - if (!(SectionSegments[i].Characteristics & IMAGE_SCN_TYPE_NOLOAD)) + // This field is RESERVED and not respected by Windows + //if (!(SectionSegments[i].Characteristics & IMAGE_SCN_TYPE_NOLOAD)) { if (Segment == &SectionSegments[i]) { @@ -5082,7 +5142,8 @@ for (i = 0; i < NrSegments; i++) { - if (!(SectionSegments[i].Characteristics & IMAGE_SCN_TYPE_NOLOAD)) + // This field is RESERVED and not respected by Windows + //if (!(SectionSegments[i].Characteristics & IMAGE_SCN_TYPE_NOLOAD)) { PVOID SBaseAddress = (PVOID) ((char*)ImageBaseAddress + (ULONG_PTR)SectionSegments[i].VirtualAddress); @@ -5626,7 +5687,8 @@ ImageSize = 0; for (i = 0; i < NrSegments; i++) { - if (!(SectionSegments[i].Characteristics & IMAGE_SCN_TYPE_NOLOAD)) + // This field is RESERVED and not respected by Windows + //if (!(SectionSegments[i].Characteristics & IMAGE_SCN_TYPE_NOLOAD)) { ULONG_PTR MaxExtent; MaxExtent = (ULONG_PTR)SectionSegments[i].VirtualAddress + @@ -5656,7 +5718,8 @@ for (i = 0; i < NrSegments; i++) { - if (!(SectionSegments[i].Characteristics & IMAGE_SCN_TYPE_NOLOAD)) + // This field is RESERVED and not respected by Windows + //if (!(SectionSegments[i].Characteristics & IMAGE_SCN_TYPE_NOLOAD)) { PVOID SBaseAddress = (PVOID) ((char*)ImageBase + (ULONG_PTR)SectionSegments[i].VirtualAddress); @@ -6629,4 +6692,54 @@ return STATUS_SUCCESS; } +NTSTATUS +NTAPI +NtAllocateUserPhysicalPages(IN HANDLE ProcessHandle, + IN OUT PULONG NumberOfPages, + IN OUT PULONG UserPfnArray) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +NTSTATUS +NTAPI +NtMapUserPhysicalPages(IN PVOID *VirtualAddresses, + IN ULONG NumberOfPages, + IN OUT PULONG UserPfnArray) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +NTSTATUS +NTAPI +NtMapUserPhysicalPagesScatter(IN PVOID *VirtualAddresses, + IN ULONG NumberOfPages, + IN OUT PULONG UserPfnArray) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +NTSTATUS +NTAPI +NtFreeUserPhysicalPages(IN HANDLE ProcessHandle, + IN OUT PULONG NumberOfPages, + IN OUT PULONG UserPfnArray) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +NTSTATUS +NTAPI +NtAreMappedFilesTheSame(IN PVOID File1MappedAsAnImage, + IN PVOID File2MappedAsFile) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + + /* EOF */ Modified: branches/cache_manager_rewrite/mm/verifier.c URL:
http://svn.reactos.org/svn/reactos/branches/cache_manager_rewrite/mm/verifi…
============================================================================== --- branches/cache_manager_rewrite/mm/verifier.c (original) +++ branches/cache_manager_rewrite/mm/verifier.c Fri Jan 5 23:28:18 2007 @@ -1,63 +1,190 @@ -/* $Id$ - * - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel - * FILE: ntoskrnl/mm/verifier.c - * PURPOSE: Driver Verifier functions - * - * PROGRAMMERS: Alex Ionescu (alex(a)relsoft.net) - */ +/* +* PROJECT: ReactOS Kernel +* LICENSE: GPL - See COPYING in the top level directory +* FILE: ntoskrnl/mm/verifier.c +* PURPOSE: Mm Driver Verifier Routines +* PROGRAMMERS: Alex Ionescu (alex.ionescu(a)reactos.org) +*/ -/* INCLUDES *****************************************************************/ +/* INCLUDES ******************************************************************/ #include <ntoskrnl.h> +#define NDEBUG #include <internal/debug.h> +/* GLOBALS *******************************************************************/ -/* FUNCTIONS *****************************************************************/ +MM_DRIVER_VERIFIER_DATA MmVerifierData; +LIST_ENTRY MiVerifierDriverAddedThunkListHead; +KMUTANT MmSystemLoadLock; +ULONG MiActiveVerifierThunks; +extern LIST_ENTRY ModuleListHead; + +/* PRIVATE FUNCTIONS *********************************************************/ + +PLDR_DATA_TABLE_ENTRY +NTAPI +MiLookupDataTableEntry(IN PVOID Address) +{ + PLDR_DATA_TABLE_ENTRY LdrEntry, FoundEntry = NULL; + PLIST_ENTRY NextEntry; + PAGED_CODE(); + + /* Loop entries */ + NextEntry = ModuleListHead.Flink; + do + { + /* Get the loader entry */ + LdrEntry = CONTAINING_RECORD(NextEntry, + LDR_DATA_TABLE_ENTRY, + InLoadOrderLinks); + + /* Check if the address matches */ + if ((Address >= LdrEntry->DllBase) && + (Address < (PVOID)((ULONG_PTR)LdrEntry->DllBase + LdrEntry->SizeOfImage))) + { + /* Found a match */ + FoundEntry = LdrEntry; + break; + } + + /* Move on */ + NextEntry = NextEntry->Flink; + } while(NextEntry != &ModuleListHead); + + /* Return the entry */ + return FoundEntry; +} + +/* PUBLIC FUNCTIONS **********************************************************/ /* - * @unimplemented + * @implemented */ NTSTATUS -STDCALL -MmAddVerifierThunks ( - IN PVOID ThunkBuffer, - IN ULONG ThunkBufferSize - ) +NTAPI +MmAddVerifierThunks(IN PVOID ThunkBuffer, + IN ULONG ThunkBufferSize) { - UNIMPLEMENTED; - return STATUS_NOT_IMPLEMENTED; + PDRIVER_VERIFIER_THUNK_PAIRS ThunkPairs, DriverThunkTable; + ULONG ThunkCount; + PDRIVER_SPECIFIED_VERIFIER_THUNKS ThunkTable; + PLDR_DATA_TABLE_ENTRY LdrEntry; + PVOID ModuleBase, ModuleEnd; + ULONG i; + NTSTATUS Status = STATUS_SUCCESS; + PAGED_CODE(); + + /* Make sure the driver verifier is initialized */ + if (!MiVerifierDriverAddedThunkListHead.Flink) return STATUS_NOT_SUPPORTED; + + /* Get the thunk pairs and count them */ + ThunkPairs = (PDRIVER_VERIFIER_THUNK_PAIRS)ThunkBuffer; + ThunkCount = ThunkBufferSize / sizeof(DRIVER_VERIFIER_THUNK_PAIRS); + if (!ThunkCount) return STATUS_INVALID_PARAMETER_1; + + /* Now allocate our own thunk table */ + ThunkTable = ExAllocatePoolWithTag(PagedPool, + sizeof(DRIVER_SPECIFIED_VERIFIER_THUNKS) + + ThunkCount * + sizeof(DRIVER_VERIFIER_THUNK_PAIRS), + TAG('M', 'm', 'V', 't')); + if (!ThunkTable) return STATUS_INSUFFICIENT_RESOURCES; + + /* Now copy the driver-fed part */ + DriverThunkTable = (PDRIVER_VERIFIER_THUNK_PAIRS)(ThunkTable + 1); + RtlCopyMemory(DriverThunkTable, + ThunkPairs, + ThunkCount * sizeof(DRIVER_VERIFIER_THUNK_PAIRS)); + + /* Acquire the system load lock */ + KeEnterCriticalRegion(); + KeWaitForSingleObject(&MmSystemLoadLock, + WrVirtualMemory, + KernelMode, + FALSE, + NULL); + + /* Get the loader entry */ + LdrEntry = MiLookupDataTableEntry(DriverThunkTable->PristineRoutine); + if (!LdrEntry) + { + /* Fail */ + Status = STATUS_INVALID_PARAMETER_2; + goto Cleanup; + } + + /* Get driver base and end */ + ModuleBase = LdrEntry->DllBase; + ModuleEnd = (PVOID)((ULONG_PTR)LdrEntry->DllBase + LdrEntry->SizeOfImage); + + /* Loop all the thunks */ + for (i = 0; i < ThunkCount; i++) + { + /* Make sure it's in the driver */ + if (((ULONG_PTR)DriverThunkTable->PristineRoutine < (ULONG_PTR)ModuleBase) || + ((ULONG_PTR)DriverThunkTable->PristineRoutine >= (ULONG_PTR)ModuleEnd)) + { + /* Nope, fail */ + Status = STATUS_INVALID_PARAMETER_2; + goto Cleanup; + } + } + + /* Otherwise, add this entry */ + ThunkTable->DataTableEntry = LdrEntry; + ThunkTable->NumberOfThunks = ThunkCount; + MiActiveVerifierThunks++; + InsertTailList(&MiVerifierDriverAddedThunkListHead, + &ThunkTable->ListEntry); + ThunkTable = NULL; + +Cleanup: + /* Release the lock */ + KeReleaseMutant(&MmSystemLoadLock, 1, FALSE, FALSE); + KeLeaveCriticalRegion(); + + /* Free the table if we failed and return status */ + ExFreePool(ThunkTable); + return Status; } +/* + * @implemented + */ +LOGICAL +NTAPI +MmIsDriverVerifying(IN PDRIVER_OBJECT DriverObject) +{ + PLDR_DATA_TABLE_ENTRY LdrEntry; + + /* Get the loader entry */ + LdrEntry = (PLDR_DATA_TABLE_ENTRY)DriverObject->DriverSection; + if (!LdrEntry) return FALSE; + + /* Check if we're verifying or not */ + return (LdrEntry->Flags & LDRP_DRIVER_VERIFYING) ? TRUE: FALSE; +} /* - * @unimplemented - */ - -ULONG -STDCALL -MmIsDriverVerifying ( - IN struct _DRIVER_OBJECT *DriverObject - ) -{ - UNIMPLEMENTED; - return 0; -} - - -/* - * @unimplemented + * @implemented */ NTSTATUS -STDCALL -MmIsVerifierEnabled ( - OUT PULONG VerifierFlags - ) +NTAPI +MmIsVerifierEnabled(OUT PULONG VerifierFlags) { - UNIMPLEMENTED; - return STATUS_NOT_IMPLEMENTED; + /* Check if we've actually added anything to the list */ + if (MiVerifierDriverAddedThunkListHead.Flink) + { + /* We have, read the verifier level */ + *VerifierFlags = MmVerifierData.Level; + return STATUS_SUCCESS; + } + + /* Otherwise, we're disabled */ + *VerifierFlags = 0; + return STATUS_NOT_SUPPORTED; } /* EOF */ Modified: branches/cache_manager_rewrite/mm/virtual.c URL:
http://svn.reactos.org/svn/reactos/branches/cache_manager_rewrite/mm/virtua…
============================================================================== --- branches/cache_manager_rewrite/mm/virtual.c (original) +++ branches/cache_manager_rewrite/mm/virtual.c Fri Jan 5 23:28:18 2007 @@ -263,6 +263,7 @@ MmUnlockAddressSpace(AddressSpace); if (Address < MmSystemRangeStart) { + ASSERT(Process); ObDereferenceObject(Process); }
17 years, 11 months
1
0
0
0
[cwittich] 25316: * fixed some warnings
by cwittich@svn.reactos.org
Author: cwittich Date: Fri Jan 5 23:22:44 2007 New Revision: 25316 URL:
http://svn.reactos.org/svn/reactos?rev=25316&view=rev
Log: * fixed some warnings Modified: trunk/reactos/base/services/dhcp/adapter.c trunk/reactos/base/services/eventlog/file.c trunk/reactos/base/setup/welcome/welcome.c trunk/reactos/base/shell/cmd/batch.c trunk/reactos/base/system/expand/expand.rbuild trunk/reactos/base/system/msiexec/msiexec.c trunk/reactos/base/system/services/database.c trunk/reactos/base/system/services/driver.c trunk/reactos/base/system/services/groupdb.c trunk/reactos/base/system/services/rpcserver.c trunk/reactos/base/system/userinit/userinit.c Modified: trunk/reactos/base/services/dhcp/adapter.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/dhcp/adapter…
============================================================================== --- trunk/reactos/base/services/dhcp/adapter.c (original) +++ trunk/reactos/base/services/dhcp/adapter.c Fri Jan 5 23:22:44 2007 @@ -31,7 +31,7 @@ DH_DbgPrint(MID_TRACE,("AppendLen: %d, CharTotal: %d\n", AppendLen, CharTotal)); - Out = malloc( CharTotal ); + Out = (CHAR**) malloc( CharTotal ); OutKeyName = ((PCHAR)&Out[MaxSubKeys+1]); if( !Out ) { RegCloseKey( MainKey ); return NULL; } @@ -73,7 +73,7 @@ DH_DbgPrint(MID_TRACE,("Value %s has size %d\n", Value, SubOutLen)); - if( !(SubOut = malloc(SubOutLen)) ) + if( !(SubOut = (CHAR*) malloc(SubOutLen)) ) goto regerror; if( (Error = RegQueryValueEx( ValueKey, Value, NULL, NULL, @@ -128,7 +128,7 @@ RootDevice && !strcmp( DriverDesc, Adapter->DhclientInfo.name ) ) { TargetKeyName = - malloc( strlen( TargetKeyNameStart ) + + (CHAR*) malloc( strlen( TargetKeyNameStart ) + strlen( RootDevice ) + strlen( TargetKeyNameEnd ) + 1 ); if( !TargetKeyName ) goto cleanup; @@ -219,7 +219,7 @@ */ void AdapterInit() { - PMIB_IFTABLE Table = malloc(sizeof(MIB_IFTABLE)); + PMIB_IFTABLE Table = (PMIB_IFTABLE) malloc(sizeof(MIB_IFTABLE)); DWORD Error, Size, i; PDHCP_ADAPTER Adapter = NULL; @@ -233,7 +233,7 @@ ERROR_INSUFFICIENT_BUFFER ) { DH_DbgPrint(MID_TRACE,("Error %d, New Buffer Size: %d\n", Error, Size)); free( Table ); - Table = malloc( Size ); + Table = (PMIB_IFTABLE) malloc( Size ); } if( Error != NO_ERROR ) goto term; @@ -243,7 +243,7 @@ for( i = 0; i < Table->dwNumEntries; i++ ) { DH_DbgPrint(MID_TRACE,("Getting adapter %d attributes\n", Table->table[i].dwIndex)); - Adapter = calloc( sizeof( DHCP_ADAPTER ) + Table->table[i].dwMtu, 1 ); + Adapter = (DHCP_ADAPTER*) calloc( sizeof( DHCP_ADAPTER ) + Table->table[i].dwMtu, 1 ); if( Adapter && Table->table[i].dwType == MIB_IF_TYPE_ETHERNET ) { memcpy( &Adapter->IfMib, &Table->table[i], @@ -258,9 +258,9 @@ Adapter->IfMib.dwPhysAddrLen); Adapter->DhclientInfo.hw_address.hlen = Adapter->IfMib.dwPhysAddrLen; - /* I'm not sure where else to set this, but + /* I'm not sure where else to set this, but some DHCP servers won't take a zero. - We checked the hardware type earlier in + We checked the hardware type earlier in the if statement. */ Adapter->DhclientInfo.hw_address.htype = HTYPE_ETHER; Modified: trunk/reactos/base/services/eventlog/file.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/eventlog/fil…
============================================================================== --- trunk/reactos/base/services/eventlog/file.c (original) +++ trunk/reactos/base/services/eventlog/file.c Fri Jan 5 23:22:44 2007 @@ -3,9 +3,9 @@ * LICENSE: GPL - See COPYING in the top level directory * FILE: services/eventlog/file.c * PURPOSE: Event logging service - * COPYRIGHT: Copyright 2005 Saveliy Tretiakov + * COPYRIGHT: Copyright 2005 Saveliy Tretiakov */ - + #include "eventlog.h" PLOGFILE LogListHead = NULL; @@ -16,11 +16,11 @@ { DWORD dwWritten; EOF_RECORD EofRec; - + ZeroMemory(&LogFile->Header, sizeof(FILE_HEADER)); SetFilePointer(LogFile->hFile, 0, NULL, FILE_BEGIN); SetEndOfFile(LogFile->hFile); - + LogFile->Header.SizeOfHeader = sizeof(FILE_HEADER); LogFile->Header.SizeOfHeader2 = sizeof(FILE_HEADER); LogFile->Header.FirstRecordOffset = sizeof(FILE_HEADER); @@ -51,22 +51,22 @@ EofRec.StartOffset = LogFile->Header.FirstRecordOffset; EofRec.EndOffset = LogFile->Header.EofOffset; - if(!WriteFile(LogFile->hFile, - &EofRec, - sizeof(EOF_RECORD), - &dwWritten, + if(!WriteFile(LogFile->hFile, + &EofRec, + sizeof(EOF_RECORD), + &dwWritten, NULL)) { DPRINT1("WriteFile failed:%d!\n", GetLastError()); return FALSE; } - + if(!FlushFileBuffers(LogFile->hFile)) { DPRINT1("FlushFileBuffers failed:%d!\n", GetLastError()); return FALSE; } - + return TRUE; } @@ -84,32 +84,32 @@ DPRINT1("SetFilePointer failed! %d\n", GetLastError()); return FALSE; } - - if(!ReadFile(LogFile->hFile, - &LogFile->Header, - sizeof(FILE_HEADER), + + if(!ReadFile(LogFile->hFile, + &LogFile->Header, + sizeof(FILE_HEADER), &dwRead, NULL)) { DPRINT1("ReadFile failed! %d\n", GetLastError()); return FALSE; } - + if(dwRead != sizeof(FILE_HEADER)) { DPRINT("EventLog: Invalid file %S.\n", LogFile->FileName); return LogfInitializeNew(LogFile); } - + if(LogFile->Header.SizeOfHeader != sizeof(FILE_HEADER) || LogFile->Header.SizeOfHeader2 != sizeof(FILE_HEADER)) { DPRINT("EventLog: Invalid header size in %S.\n", LogFile->FileName); return LogfInitializeNew(LogFile); } - + if(LogFile->Header.Signature != LOGFILE_SIGNATURE) { - DPRINT("EventLog: Invalid signature %x in %S.\n", + DPRINT("EventLog: Invalid signature %x in %S.\n", LogFile->Header.Signature, LogFile->FileName); return LogfInitializeNew(LogFile); @@ -117,7 +117,7 @@ if(LogFile->Header.EofOffset > GetFileSize(LogFile->hFile, NULL)+1) { - DPRINT("EventLog: Invalid eof offset %x in %S.\n", + DPRINT("EventLog: Invalid eof offset %x in %S.\n", LogFile->Header.EofOffset, LogFile->FileName); return LogfInitializeNew(LogFile); @@ -125,21 +125,21 @@ for(;;) { - dwFilePointer = SetFilePointer(LogFile->hFile, - 0, - NULL, + dwFilePointer = SetFilePointer(LogFile->hFile, + 0, + NULL, FILE_CURRENT); - + if(dwFilePointer == INVALID_SET_FILE_POINTER) { DPRINT1("SetFilePointer failed! %d\n", GetLastError()); return FALSE; } - if(!ReadFile(LogFile->hFile, - &dwRecSize, - sizeof(dwRecSize), - &dwRead, + if(!ReadFile(LogFile->hFile, + &dwRecSize, + sizeof(dwRecSize), + &dwRead, NULL)) { DPRINT1("ReadFile failed! %d\n", GetLastError()); @@ -158,34 +158,34 @@ DPRINT1("ReadFile() failed! %d\n", GetLastError()); return FALSE; } - + if(dwRead != sizeof(dwRecSize)) break; - + if(dwRecSign != LOGFILE_SIGNATURE || dwRecSize + dwFilePointer > GetFileSize(LogFile->hFile, NULL)+1 || dwRecSize < sizeof(EVENTLOGRECORD)) { break; } - - if(SetFilePointer(LogFile->hFile, - -((LONG)sizeof(DWORD)*2), - NULL, + + if(SetFilePointer(LogFile->hFile, + -((LONG)sizeof(DWORD)*2), + NULL, FILE_CURRENT) == INVALID_SET_FILE_POINTER) { DPRINT1("SetFilePointer() failed! %d", GetLastError()); return FALSE; } - + RecBuf = (PEVENTLOGRECORD) HeapAlloc(MyHeap, 0, dwRecSize); - + if(!RecBuf) { DPRINT1("Can't allocate heap!\n"); return FALSE; } - + if(!ReadFile(LogFile->hFile, RecBuf, dwRecSize, @@ -196,7 +196,7 @@ HeapFree(MyHeap, 0, RecBuf); return FALSE; } - + if(dwRead != dwRecSize) { HeapFree(MyHeap, 0, RecBuf); @@ -206,7 +206,7 @@ pdwRecSize2 = (PDWORD)(((PBYTE)RecBuf)+dwRecSize-4); if(*pdwRecSize2 != dwRecSize) { - DPRINT1("Invalid size2 of record %d (%x) in %s\n", + DPRINT1("Invalid size2 of record %d (%x) in %s\n", dwRecordsNumber, *pdwRecSize2, LogFile->LogName); @@ -215,7 +215,7 @@ } dwRecordsNumber++; - + if(!LogfAddOffsetInformation(LogFile, RecBuf->RecordNumber, dwFilePointer)) { DPRINT1("LogfAddOffsetInformation() failed!\n"); @@ -235,75 +235,75 @@ DPRINT1("SetFilePointer() failed! %d\n", GetLastError()); return FALSE; } - + if(!WriteFile(LogFile->hFile, &LogFile->Header, sizeof(FILE_HEADER), - &dwRead, + &dwRead, NULL)) { DPRINT1("WriteFile failed! %d\n", GetLastError()); return FALSE; } - + if(!FlushFileBuffers(LogFile->hFile)) { DPRINT1("FlushFileBuffers failed! %d\n", GetLastError()); return FALSE; } - + return TRUE; } -PLOGFILE LogfCreate(WCHAR *LogName, +PLOGFILE LogfCreate(WCHAR *LogName, WCHAR *FileName) { PLOGFILE LogFile; BOOL bResult, bCreateNew = FALSE; - - LogFile = HeapAlloc(MyHeap, - HEAP_ZERO_MEMORY, + + LogFile = (LOGFILE*) HeapAlloc(MyHeap, + HEAP_ZERO_MEMORY, sizeof(LOGFILE)); if(!LogFile) { DPRINT1("Can't allocate heap!\n"); return NULL; } - - LogFile->hFile = CreateFile(FileName, - GENERIC_READ | GENERIC_WRITE, - FILE_SHARE_READ, - NULL, + + LogFile->hFile = CreateFile(FileName, + GENERIC_READ | GENERIC_WRITE, + FILE_SHARE_READ, + NULL, OPEN_ALWAYS, - FILE_ATTRIBUTE_NORMAL | + FILE_ATTRIBUTE_NORMAL | FILE_FLAG_RANDOM_ACCESS, NULL); - + if(LogFile->hFile == INVALID_HANDLE_VALUE) { DPRINT1("Can't create file %S.\n", FileName); - HeapFree(MyHeap, 0, LogFile); + HeapFree(MyHeap, 0, LogFile); return NULL; } - + bCreateNew = (GetLastError() == ERROR_ALREADY_EXISTS) ? FALSE : TRUE; - - LogFile->LogName = HeapAlloc(MyHeap, + + LogFile->LogName = (WCHAR*) HeapAlloc(MyHeap, HEAP_ZERO_MEMORY, (lstrlenW(LogName)+1)*sizeof(WCHAR)); - + if(LogFile->LogName) lstrcpyW(LogFile->LogName, LogName); - else + else { DPRINT1("Can't allocate heap\n"); HeapFree(MyHeap, 0, LogFile); return NULL; } - - LogFile->FileName = HeapAlloc(MyHeap, + + LogFile->FileName = (WCHAR*) HeapAlloc(MyHeap, HEAP_ZERO_MEMORY, (lstrlenW(FileName)+1)*sizeof(WCHAR)); - + if(LogFile->FileName) lstrcpyW(LogFile->FileName, FileName); else { @@ -311,7 +311,7 @@ goto fail; } - LogFile->OffsetInfo = (PEVENT_OFFSET_INFO) + LogFile->OffsetInfo = (PEVENT_OFFSET_INFO) HeapAlloc(MyHeap, HEAP_ZERO_MEMORY, sizeof(EVENT_OFFSET_INFO)*64); if(!LogFile->OffsetInfo) @@ -327,7 +327,7 @@ else bResult = LogfInitializeExisting(LogFile); if(!bResult) goto fail; - + InitializeCriticalSection(&LogFile->cs); LogfListAddItem(LogFile); return LogFile; @@ -349,34 +349,34 @@ return; EnterCriticalSection(&LogFile->cs); - + FlushFileBuffers(LogFile->hFile); CloseHandle(LogFile->hFile); - + LogfListRemoveItem(LogFile); DeleteCriticalSection(&LogFile->cs); - + HeapFree(MyHeap, 0, LogFile->LogName); HeapFree(MyHeap, 0, LogFile->FileName); HeapFree(MyHeap, 0, LogFile->OffsetInfo); HeapFree(MyHeap, 0, LogFile); - + return; } PLOGFILE LogfListItemByName(WCHAR *Name) { PLOGFILE Item, Ret = NULL; - + EnterCriticalSection(&LogListCs); - + for(Item = LogListHead; Item; Item = (PLOGFILE)Item->Next) if(Item->LogName && lstrcmpi(Item->LogName, Name)==0) { Ret = Item; break; } - + LeaveCriticalSection(&LogListCs); return Ret; } @@ -395,7 +395,7 @@ ret = i; break; } - + LeaveCriticalSection(&LogListCs); return ret; } @@ -405,11 +405,11 @@ { INT i = 1; PLOGFILE Item = LogListHead; - + EnterCriticalSection(&LogListCs); - for(; Item && i<Index; Item = (PLOGFILE)Item->Next, i++); + for(; Item && i<Index; Item = (PLOGFILE)Item->Next, i++); LeaveCriticalSection(&LogListCs); - + return Item; } @@ -417,40 +417,40 @@ { PLOGFILE Item = LogListHead; INT i = 0; - + EnterCriticalSection(&LogListCs); - while(Item) + while(Item) { i++; Item = (PLOGFILE) Item->Next; } LeaveCriticalSection(&LogListCs); - + return i; } VOID LogfListAddItem(PLOGFILE Item) { EnterCriticalSection(&LogListCs); - + if(LogListHead) { PLOGFILE List = LogListHead; - - while(List->Next) + + while(List->Next) List = (PLOGFILE)List->Next; - + Item->Prev = (PVOID)List; Item->Next = NULL; List->Next = Item; } - else + else { Item->Next = NULL; Item->Prev = NULL; LogListHead = Item; } - + LeaveCriticalSection(&LogListCs); } @@ -458,7 +458,7 @@ { PLOGFILE prev = (PLOGFILE)Item->Prev; PLOGFILE next = (PLOGFILE)Item->Next; - + EnterCriticalSection(&LogListCs); if(prev && next) @@ -473,7 +473,7 @@ } else if(prev) prev->Next = NULL; else LogListHead = NULL; - + LeaveCriticalSection(&LogListCs); } @@ -505,11 +505,11 @@ { return FALSE; } - + dwRecNum = RecordNumber; EnterCriticalSection(&LogFile->cs); dwOffset = LogfOffsetByNumber(LogFile, dwRecNum); - + if(!dwOffset) { LeaveCriticalSection(&LogFile->cs); @@ -523,14 +523,14 @@ LeaveCriticalSection(&LogFile->cs); return FALSE; } - + if(!ReadFile(LogFile->hFile, &dwRecSize, sizeof(DWORD), &dwRead, NULL)) { DPRINT1("ReadFile() failed! %d\n", GetLastError()); LeaveCriticalSection(&LogFile->cs); return FALSE; } - + if(dwRecSize > BufSize) { *BytesRead = 0; @@ -540,9 +540,9 @@ return FALSE; } - if(SetFilePointer(LogFile->hFile, - -((LONG)sizeof(DWORD)), - NULL, + if(SetFilePointer(LogFile->hFile, + -((LONG)sizeof(DWORD)), + NULL, FILE_CURRENT) == INVALID_SET_FILE_POINTER) { DPRINT1("SetFilePointer() failed! %d\n", GetLastError()); @@ -556,7 +556,7 @@ LeaveCriticalSection(&LogFile->cs); return FALSE; } - + dwBufferUsage+=dwRead; while(dwBufferUsage<BufSize) @@ -575,17 +575,17 @@ LeaveCriticalSection(&LogFile->cs); return FALSE; } - + if(!ReadFile(LogFile->hFile, &dwRecSize, sizeof(DWORD), &dwRead, NULL)) { DPRINT1("ReadFile() failed! %d\n", GetLastError()); LeaveCriticalSection(&LogFile->cs); return FALSE; } - + if(dwBufferUsage+dwRecSize>BufSize)break; - if(SetFilePointer(LogFile->hFile, + if(SetFilePointer(LogFile->hFile, -((LONG)sizeof(DWORD)), NULL, FILE_CURRENT) == INVALID_SET_FILE_POINTER) @@ -594,8 +594,8 @@ LeaveCriticalSection(&LogFile->cs); return FALSE; } - - if(!ReadFile(LogFile->hFile, + + if(!ReadFile(LogFile->hFile, Buffer+dwBufferUsage, dwRecSize, &dwRead, @@ -629,18 +629,18 @@ GetSystemTime(&st); SystemTimeToEventTime(&st, &((PEVENTLOGRECORD)Buffer)->TimeWritten); - + EnterCriticalSection(&LogFile->cs); - if(SetFilePointer(LogFile->hFile, - LogFile->Header.EofOffset, + if(SetFilePointer(LogFile->hFile, + LogFile->Header.EofOffset, NULL, FILE_BEGIN) == INVALID_SET_FILE_POINTER) { DPRINT1("SetFilePointer() failed! %d\n", GetLastError()); LeaveCriticalSection(&LogFile->cs); return FALSE; } - + if(!WriteFile(LogFile->hFile, Buffer, BufSize, &dwWritten, NULL)) { DPRINT1("WriteFile() failed! %d\n", GetLastError()); @@ -648,8 +648,8 @@ return FALSE; } - if(!LogfAddOffsetInformation(LogFile, - LogFile->Header.NextRecord, + if(!LogfAddOffsetInformation(LogFile, + LogFile->Header.NextRecord, LogFile->Header.EofOffset)) { LeaveCriticalSection(&LogFile->cs); @@ -658,7 +658,7 @@ LogFile->Header.NextRecord++; LogFile->Header.EofOffset += dwWritten; - + if(LogFile->Header.OldestRecord == 0) LogFile->Header.OldestRecord = 1; @@ -673,9 +673,9 @@ EofRec.StartOffset = LogFile->Header.FirstRecordOffset; EofRec.EndOffset = LogFile->Header.EofOffset; - if(!WriteFile(LogFile->hFile, - &EofRec, - sizeof(EOF_RECORD), + if(!WriteFile(LogFile->hFile, + &EofRec, + sizeof(EOF_RECORD), &dwWritten, NULL)) { DPRINT1("WriteFile() failed! %d\n", GetLastError()); @@ -683,25 +683,25 @@ return FALSE; } - if(SetFilePointer(LogFile->hFile, 0, NULL, FILE_BEGIN) + if(SetFilePointer(LogFile->hFile, 0, NULL, FILE_BEGIN) == INVALID_SET_FILE_POINTER) { DPRINT1("SetFilePointer() failed! %d\n", GetLastError()); LeaveCriticalSection(&LogFile->cs); return FALSE; } - - if(!WriteFile(LogFile->hFile, - &LogFile->Header, - sizeof(FILE_HEADER), - &dwWritten, + + if(!WriteFile(LogFile->hFile, + &LogFile->Header, + sizeof(FILE_HEADER), + &dwWritten, NULL)) { DPRINT1("WriteFile failed! LastError = %d\n", GetLastError()); LeaveCriticalSection(&LogFile->cs); return FALSE; } - + if(!FlushFileBuffers(LogFile->hFile)) { LeaveCriticalSection(&LogFile->cs); @@ -711,7 +711,7 @@ LeaveCriticalSection(&LogFile->cs); return TRUE; -} +} ULONG LogfOffsetByNumber(PLOGFILE LogFile, DWORD RecordNumber) @@ -729,15 +729,15 @@ return LogFile->Header.OldestRecord; } -BOOL LogfAddOffsetInformation(PLOGFILE LogFile, +BOOL LogfAddOffsetInformation(PLOGFILE LogFile, ULONG ulNumber, ULONG ulOffset) { LPVOID NewOffsetInfo; - + if(LogFile->OffsetInfoNext == LogFile->OffsetInfoSize) { - NewOffsetInfo = HeapReAlloc(MyHeap, + NewOffsetInfo = HeapReAlloc(MyHeap, HEAP_ZERO_MEMORY, LogFile->OffsetInfo, (LogFile->OffsetInfoSize+64)* @@ -780,7 +780,7 @@ UINT i, pos, nStrings; PBYTE Buffer; - dwRecSize = sizeof(EVENTLOGRECORD) + (lstrlenW(ComputerName) + + dwRecSize = sizeof(EVENTLOGRECORD) + (lstrlenW(ComputerName) + lstrlenW(SourceName) + 2)*sizeof(WCHAR); if(dwRecSize % 4 != 0) dwRecSize += 4 - (dwRecSize % 4); @@ -796,7 +796,7 @@ if(dwRecSize % 4 != 0) dwRecSize += 4 - (dwRecSize % 4); dwRecSize+=4; - Buffer = HeapAlloc(MyHeap, HEAP_ZERO_MEMORY, dwRecSize); + Buffer = (BYTE*) HeapAlloc(MyHeap, HEAP_ZERO_MEMORY, dwRecSize); if(!Buffer) { DPRINT1("Can't allocate heap!\n"); @@ -854,7 +854,7 @@ if(pos % 4 != 0) pos += 4 - (pos % 4); *((PDWORD)(Buffer+pos)) = dwRecSize; - + *lpRecSize = dwRecSize; return Buffer; } Modified: trunk/reactos/base/setup/welcome/welcome.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/welcome/welcome…
============================================================================== --- trunk/reactos/base/setup/welcome/welcome.c (original) +++ trunk/reactos/base/setup/welcome/welcome.c Fri Jan 5 23:22:44 2007 @@ -300,7 +300,7 @@ rect.top = 0; rect.bottom = 25; - hOldFont = SelectObject(hDC, hFont); + hOldFont = (HFONT) SelectObject(hDC, hFont); DrawText(hDC, szText, -1, &rect, DT_TOP | DT_CALCRECT | DT_WORDBREAK); SelectObject(hDC, hOldFont); @@ -487,7 +487,7 @@ HBRUSH hOldBrush; /* Title bitmap */ - hOldBitmap = SelectObject(hdcMem, hTitleBitmap); + hOldBitmap = (HBITMAP) SelectObject(hdcMem, hTitleBitmap); BitBlt(hdc, rcPanel->left, rcPanel->top, @@ -497,7 +497,7 @@ SelectObject(hdcMem, hOldBitmap); /* Dark blue line */ - hOldBrush = SelectObject(hdc, hbrDarkBlue); + hOldBrush = (HBRUSH) SelectObject(hdc, hbrDarkBlue); PatBlt(hdc, rcPanel->left, rcPanel->bottom - 3, @@ -535,7 +535,7 @@ PaintBanner(hdc, &rcTitlePanel); /* Left panel */ - hOldBrush = SelectObject (hdc, hbrLightBlue); + hOldBrush = (HBRUSH) SelectObject (hdc, hbrLightBlue); PatBlt(hdc, rcLeftPanel.left, rcLeftPanel.top, @@ -545,7 +545,7 @@ SelectObject(hdc, hOldBrush); /* Right panel */ - hOldBrush = SelectObject (hdc, WHITE_BRUSH); + hOldBrush = (HBRUSH) SelectObject (hdc, WHITE_BRUSH); PatBlt(hdc, rcRightPanel.left, rcRightPanel.top, @@ -556,7 +556,7 @@ /* Draw dark verical line */ hPen = CreatePen(PS_SOLID, 0, DARK_BLUE); - hOldPen = SelectObject(hdc, hPen); + hOldPen = (HPEN) SelectObject(hdc, hPen); MoveToEx(hdc, rcRightPanel.left, rcRightPanel.top, NULL); LineTo(hdc, rcRightPanel.left, rcRightPanel.bottom); SelectObject(hdc, hOldPen); @@ -566,7 +566,7 @@ if ((nTopic == -1) && (hDefaultTopicBitmap != 0)) { GetObject(hDefaultTopicBitmap, sizeof(BITMAP), &bmpInfo); - hOldBitmap = SelectObject (hdcMem, hDefaultTopicBitmap); + hOldBitmap = (HBITMAP) SelectObject (hdcMem, hDefaultTopicBitmap); BitBlt(hdc, rcRightPanel.right - bmpInfo.bmWidth, rcRightPanel.bottom - bmpInfo.bmHeight, @@ -580,7 +580,7 @@ else if ((nTopic != -1) && (hTopicBitmap[nTopic] != 0)) { GetObject(hTopicBitmap[nTopic], sizeof(BITMAP), &bmpInfo); - hOldBitmap = SelectObject (hdcMem, hTopicBitmap[nTopic]); + hOldBitmap = (HBITMAP) SelectObject (hdcMem, hTopicBitmap[nTopic]); BitBlt(hdc, rcRightPanel.right - bmpInfo.bmWidth, rcRightPanel.bottom - bmpInfo.bmHeight, @@ -626,7 +626,7 @@ rcTitle.right = rcLeftPanel.right - 5; rcTitle.top = rcLeftPanel.bottom - 40; rcTitle.bottom = rcLeftPanel.bottom - 5; - hOldFont = SelectObject(hdc, hfontTopicDescription); + hOldFont = (HFONT) SelectObject(hdc, hfontTopicDescription); DrawText(hdc, version, -1, &rcTitle, DT_BOTTOM | DT_CALCRECT | DT_SINGLELINE); DrawText(hdc, version, -1, &rcTitle, DT_BOTTOM | DT_SINGLELINE); SelectObject(hdc, hOldFont); @@ -636,7 +636,7 @@ rcTitle.right = rcRightPanel.right - 8; rcTitle.top = rcRightPanel.top + 8; rcTitle.bottom = rcTitle.top + 57; - hOldFont = SelectObject(hdc, hfontTopicTitle); + hOldFont = (HFONT) SelectObject(hdc, hfontTopicTitle); DrawText(hdc, szTopicTitle, -1, &rcTitle, DT_TOP | DT_CALCRECT); SetTextColor(hdc, DARK_BLUE); @@ -686,9 +686,9 @@ else { if (lpDis->CtlID == (ULONG)nTopic) - hOldBrush = SelectObject(lpDis->hDC, hbrRightPanel); + hOldBrush = (HBRUSH) SelectObject(lpDis->hDC, hbrRightPanel); else - hOldBrush = SelectObject(lpDis->hDC, hbrLightBlue); + hOldBrush = (HBRUSH) SelectObject(lpDis->hDC, hbrLightBlue); PatBlt(lpDis->hDC, lpDis->rcItem.left, @@ -699,7 +699,7 @@ SelectObject(lpDis->hDC, hOldBrush); hPen = CreatePen(PS_SOLID, 0, DARK_BLUE); - hOldPen = SelectObject(lpDis->hDC, hPen); + hOldPen = (HPEN) SelectObject(lpDis->hDC, hPen); MoveToEx(lpDis->hDC, lpDis->rcItem.left, lpDis->rcItem.bottom-1, NULL); LineTo(lpDis->hDC, lpDis->rcItem.right, lpDis->rcItem.bottom-1); SelectObject(lpDis->hDC, hOldPen); @@ -723,7 +723,7 @@ { UNREFERENCED_PARAMETER(wParam); UNREFERENCED_PARAMETER(lParam); - + if (nTopic != -1) { nTopic = -1; Modified: trunk/reactos/base/shell/cmd/batch.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/batch.c?rev…
============================================================================== --- trunk/reactos/base/shell/cmd/batch.c (original) +++ trunk/reactos/base/shell/cmd/batch.c Fri Jan 5 23:22:44 2007 @@ -221,7 +221,7 @@ SetLastError(0); hFile = CreateFile (fullname, GENERIC_READ, FILE_SHARE_WRITE | FILE_SHARE_READ | FILE_SHARE_DELETE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | - FILE_FLAG_SEQUENTIAL_SCAN, NULL); + FILE_FLAG_SEQUENTIAL_SCAN, NULL); #ifdef _DEBUG DebugPrintf (_T("Batch: (\'%s\', \'%s\', \'%s\') hFile = %x\n"), @@ -264,7 +264,7 @@ } bc->hBatchFile = hFile; - SetFilePointer (bc->hBatchFile, 0, NULL, FILE_BEGIN); + SetFilePointer (bc->hBatchFile, 0, NULL, FILE_BEGIN); bc->bEcho = bEcho; /* Preserve echo across batch calls */ bc->shiftlevel = 0; @@ -275,7 +275,7 @@ // // Allocate enough memory to hold the params and copy them over without modifications // - bc->raw_params = malloc((_tcslen(param)+1) * sizeof(TCHAR)); + bc->raw_params = (TCHAR*) malloc((_tcslen(param)+1) * sizeof(TCHAR)); if (bc->raw_params != NULL) { memset (bc->raw_params, 0, _tcslen(bc->raw_params) * sizeof(TCHAR)); Modified: trunk/reactos/base/system/expand/expand.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/expand/expand.…
============================================================================== --- trunk/reactos/base/system/expand/expand.rbuild (original) +++ trunk/reactos/base/system/expand/expand.rbuild Fri Jan 5 23:22:44 2007 @@ -2,7 +2,7 @@ <!DOCTYPE project SYSTEM "tools/rbuild/project.dtd"> <module name="expand" type="win32cui" installbase="system32" installname="expand.exe" usewrc="false"> <include base="ReactOS">include/reactos/wine</include> - <include base="cmd">.</include> + <include base="expand">.</include> <define name="__USE_W32API" /> <define name="ANONYMOUSUNIONS" /> <define name="_WIN32_WINNT">0x0501</define> Modified: trunk/reactos/base/system/msiexec/msiexec.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/msiexec/msiexe…
============================================================================== --- trunk/reactos/base/system/msiexec/msiexec.c (original) +++ trunk/reactos/base/system/msiexec/msiexec.c Fri Jan 5 23:22:44 2007 @@ -135,7 +135,7 @@ for(list = property_list; list; list = list->next) len += lstrlenW(list->str) + 3; - ret = HeapAlloc( GetProcessHeap(), 0, len*sizeof(WCHAR) ); + ret = (WCHAR*) HeapAlloc( GetProcessHeap(), 0, len*sizeof(WCHAR) ); /* add a space before each string, and quote the value */ p = ret; @@ -179,7 +179,7 @@ for(list = transform_list; list; list = list->next) len += lstrlenW(list->str) + 1; - ret = HeapAlloc( GetProcessHeap(), 0, len*sizeof(WCHAR) ); + ret = (WCHAR*) HeapAlloc( GetProcessHeap(), 0, len*sizeof(WCHAR) ); /* add all the transforms with a semicolon between each one */ p = ret; @@ -211,7 +211,7 @@ static LPWSTR msi_strdup(LPCWSTR str) { DWORD len = lstrlenW(str)+1; - LPWSTR ret = HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR)*len); + LPWSTR ret = (WCHAR*) HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR)*len); lstrcpyW(ret, str); return ret; } @@ -227,7 +227,7 @@ return TRUE; if( lstrlenW(str1) != (len-1) ) return TRUE; - strW = HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR)*len); + strW = (WCHAR*) HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR)*len); MultiByteToWideChar( CP_ACP, 0, str2, -1, strW, len); ret = CompareStringW(GetThreadLocale(), NORM_IGNORECASE, str1, len, strW, len); HeapFree(GetProcessHeap(), 0, strW); @@ -245,7 +245,7 @@ return TRUE; if( lstrlenW(str1) < (len-1) ) return TRUE; - strW = HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR)*len); + strW = (WCHAR*) HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR)*len); MultiByteToWideChar( CP_ACP, 0, str2, -1, strW, len); ret = CompareStringW(GetThreadLocale(), NORM_IGNORECASE, str1, len-1, strW, len-1); HeapFree(GetProcessHeap(), 0, strW); @@ -393,7 +393,7 @@ int i, n; n = chomp( p ); - argv = HeapAlloc(GetProcessHeap(), 0, sizeof (WCHAR*)*(n+1)); + argv = (WCHAR**) HeapAlloc(GetProcessHeap(), 0, sizeof (WCHAR*)*(n+1)); for( i=0; i<n; i++ ) { argv[i] = p; @@ -419,7 +419,7 @@ r = RegQueryValueExW(hkey, ident, 0, &type, 0, &sz); if(r == ERROR_SUCCESS && type == REG_SZ) { - buf = HeapAlloc(GetProcessHeap(), 0, sz); + buf = (WCHAR*) HeapAlloc(GetProcessHeap(), 0, sz); r = RegQueryValueExW(hkey, ident, 0, &type, (LPBYTE)buf, &sz); if( r == ERROR_SUCCESS ) { @@ -781,23 +781,23 @@ } else if(!msi_strequal(argvW[i]+2, "f")) { - InstallUILevel = INSTALLUILEVEL_FULL|INSTALLUILEVEL_ENDDIALOG; + InstallUILevel = (INSTALLUILEVEL) (INSTALLUILEVEL_FULL|INSTALLUILEVEL_ENDDIALOG); } else if(!msi_strequal(argvW[i]+2, "n+")) { - InstallUILevel = INSTALLUILEVEL_NONE|INSTALLUILEVEL_ENDDIALOG; + InstallUILevel = (INSTALLUILEVEL) (INSTALLUILEVEL_NONE|INSTALLUILEVEL_ENDDIALOG); } else if(!msi_strequal(argvW[i]+2, "b+")) { - InstallUILevel = INSTALLUILEVEL_BASIC|INSTALLUILEVEL_ENDDIALOG; + InstallUILevel = (INSTALLUILEVEL) (INSTALLUILEVEL_BASIC|INSTALLUILEVEL_ENDDIALOG); } else if(!msi_strequal(argvW[i]+2, "b-")) { - InstallUILevel = INSTALLUILEVEL_BASIC|INSTALLUILEVEL_PROGRESSONLY; + InstallUILevel = (INSTALLUILEVEL) (INSTALLUILEVEL_BASIC|INSTALLUILEVEL_PROGRESSONLY); } else if(!msi_strequal(argvW[i]+2, "b+!")) { - InstallUILevel = INSTALLUILEVEL_BASIC|INSTALLUILEVEL_ENDDIALOG; + InstallUILevel = (INSTALLUILEVEL) (INSTALLUILEVEL_BASIC|INSTALLUILEVEL_ENDDIALOG); WINE_FIXME("Unknown modifier: !\n"); } else Modified: trunk/reactos/base/system/services/database.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/services/datab…
============================================================================== --- trunk/reactos/base/system/services/database.c (original) +++ trunk/reactos/base/system/services/database.c Fri Jan 5 23:22:44 2007 @@ -137,7 +137,7 @@ DPRINT("Service: '%S'\n", lpServiceName); /* Allocate service entry */ - lpService = HeapAlloc(GetProcessHeap(), + lpService = (SERVICE*) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(SERVICE) + ((wcslen(lpServiceName) + 1) * sizeof(WCHAR))); if (lpService == NULL) @@ -449,7 +449,7 @@ BufferLength = sizeof(OBJECT_DIRECTORY_INFORMATION) + 2 * MAX_PATH * sizeof(WCHAR); - DirInfo = HeapAlloc(GetProcessHeap(), + DirInfo = (OBJECT_DIRECTORY_INFORMATION*) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, BufferLength); @@ -541,7 +541,7 @@ DPRINT("ScmControlService() called\n"); - ControlPacket = HeapAlloc(GetProcessHeap(), + ControlPacket = (SCM_CONTROL_PACKET*) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(SCM_CONTROL_PACKET)); if (ControlPacket == NULL) @@ -600,7 +600,7 @@ DPRINT("ArgsLength: %ld\nTotalLength: %ld\n\n", ArgsLength, TotalLength); /* Allocate a control packet */ - ControlPacket = HeapAlloc(GetProcessHeap(), + ControlPacket = (SCM_CONTROL_PACKET*) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(SCM_CONTROL_PACKET) + (TotalLength - 1) * sizeof(WCHAR)); if (ControlPacket == NULL) Modified: trunk/reactos/base/system/services/driver.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/services/drive…
============================================================================== --- trunk/reactos/base/system/services/driver.c (original) +++ trunk/reactos/base/system/services/driver.c Fri Jan 5 23:22:44 2007 @@ -123,7 +123,7 @@ BufferLength = sizeof(OBJECT_DIRECTORY_INFORMATION) + 2 * MAX_PATH * sizeof(WCHAR); - DirInfo = HeapAlloc(GetProcessHeap(), + DirInfo = (OBJECT_DIRECTORY_INFORMATION*) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, BufferLength); Modified: trunk/reactos/base/system/services/groupdb.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/services/group…
============================================================================== --- trunk/reactos/base/system/services/groupdb.c (original) +++ trunk/reactos/base/system/services/groupdb.c Fri Jan 5 23:22:44 2007 @@ -139,13 +139,13 @@ Group = (PSERVICE_GROUP)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, - sizeof(SERVICE_GROUP) + (wcslen(ValueData) * sizeof(WCHAR))); + sizeof(SERVICE_GROUP) + (wcslen((const wchar_t*) ValueData) * sizeof(WCHAR))); if (Group == NULL) { return STATUS_INSUFFICIENT_RESOURCES; } - wcscpy(Group->szGroupName, ValueData); + wcscpy(Group->szGroupName, (const wchar_t*) ValueData); Group->lpGroupName = Group->szGroupName; Group->dwRefCount = (DWORD)-1; Modified: trunk/reactos/base/system/services/rpcserver.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/services/rpcse…
============================================================================== --- trunk/reactos/base/system/services/rpcserver.c (original) +++ trunk/reactos/base/system/services/rpcserver.c Fri Jan 5 23:22:44 2007 @@ -146,7 +146,7 @@ if (lpDatabaseName == NULL) lpDatabaseName = SERVICES_ACTIVE_DATABASEW; - Ptr = HeapAlloc(GetProcessHeap(), + Ptr = (MANAGER_HANDLE*) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(MANAGER_HANDLE) + wcslen(lpDatabaseName) * sizeof(WCHAR)); if (Ptr == NULL) @@ -171,7 +171,7 @@ { PSERVICE_HANDLE Ptr; - Ptr = HeapAlloc(GetProcessHeap(), + Ptr = (SERVICE_HANDLE*) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(SERVICE_HANDLE)); if (Ptr == NULL) @@ -1033,7 +1033,7 @@ * first part of full file name is the OS directory */ if (lpBinaryPathName[1] == ':') lpBinaryPathName += GetWindowsDirectoryW(NULL, 0); - lpImagePath = HeapAlloc(GetProcessHeap(), + lpImagePath = (WCHAR*) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (wcslen(lpBinaryPathName) + 1) * sizeof(WCHAR)); if (lpImagePath == NULL) @@ -1060,7 +1060,7 @@ *lpDisplayName != 0 && wcsicmp(lpService->lpDisplayName, lpDisplayName) != 0) { - lpService->lpDisplayName = HeapAlloc(GetProcessHeap(), 0, + lpService->lpDisplayName = (WCHAR*) HeapAlloc(GetProcessHeap(), 0, (wcslen(lpDisplayName) + 1) * sizeof(WCHAR)); if (lpService->lpDisplayName == NULL) { Modified: trunk/reactos/base/system/userinit/userinit.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/userinit/useri…
============================================================================== --- trunk/reactos/base/system/userinit/userinit.c (original) +++ trunk/reactos/base/system/userinit/userinit.c Fri Jan 5 23:22:44 2007 @@ -51,7 +51,7 @@ return rc; if (dwType != REG_SZ) return ERROR_FILE_NOT_FOUND; - Value = HeapAlloc(GetProcessHeap(), 0, cbData + sizeof(WCHAR)); + Value = (WCHAR*) HeapAlloc(GetProcessHeap(), 0, cbData + sizeof(WCHAR)); if (!Value) return ERROR_NOT_ENOUGH_MEMORY; rc = RegQueryValueExW(hKey, pszKey, NULL, NULL, (LPBYTE)Value, &cbData);
17 years, 11 months
1
0
0
0
[cwittich] 25315: * fixed a bug in AddPartitionToList (value must be of type FORMATSTATE instead of MEDIA_TYPE * fixed some warnings
by cwittich@svn.reactos.org
Author: cwittich Date: Fri Jan 5 23:19:21 2007 New Revision: 25315 URL:
http://svn.reactos.org/svn/reactos?rev=25315&view=rev
Log: * fixed a bug in AddPartitionToList (value must be of type FORMATSTATE instead of MEDIA_TYPE * fixed some warnings Modified: trunk/reactos/base/setup/usetup/filequeue.c trunk/reactos/base/setup/usetup/inicache.c trunk/reactos/base/setup/usetup/interface/usetup.c trunk/reactos/base/setup/usetup/native/utils/console.c trunk/reactos/base/setup/usetup/partlist.c trunk/reactos/base/setup/usetup/registry.c trunk/reactos/base/setup/usetup/settings.c Modified: trunk/reactos/base/setup/usetup/filequeue.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/filequeu…
============================================================================== --- trunk/reactos/base/setup/usetup/filequeue.c (original) +++ trunk/reactos/base/setup/usetup/filequeue.c Fri Jan 5 23:19:21 2007 @@ -170,7 +170,7 @@ if (SourceCabinet != NULL) { Length = wcslen(SourceCabinet); - Entry->SourceCabinet = RtlAllocateHeap(ProcessHeap, + Entry->SourceCabinet = (WCHAR*) RtlAllocateHeap(ProcessHeap, 0, (Length + 1) * sizeof(WCHAR)); if (Entry->SourceCabinet == NULL) @@ -188,7 +188,7 @@ /* Copy source root path */ Length = wcslen(SourceRootPath); - Entry->SourceRootPath = RtlAllocateHeap(ProcessHeap, + Entry->SourceRootPath = (WCHAR*) RtlAllocateHeap(ProcessHeap, 0, (Length + 1) * sizeof(WCHAR)); if (Entry->SourceRootPath == NULL) @@ -207,7 +207,7 @@ if (SourcePath != NULL) { Length = wcslen(SourcePath); - Entry->SourcePath = RtlAllocateHeap(ProcessHeap, + Entry->SourcePath = (WCHAR*) RtlAllocateHeap(ProcessHeap, 0, (Length + 1) * sizeof(WCHAR)); if (Entry->SourcePath == NULL) @@ -226,7 +226,7 @@ /* Copy source file name */ Length = wcslen(SourceFilename); - Entry->SourceFilename = RtlAllocateHeap(ProcessHeap, + Entry->SourceFilename = (WCHAR*) RtlAllocateHeap(ProcessHeap, 0, (Length + 1) * sizeof(WCHAR)); if (Entry->SourceFilename == NULL) @@ -247,7 +247,7 @@ Length = wcslen(TargetDirectory); if (TargetDirectory[Length] == '\\') Length--; - Entry->TargetDirectory = RtlAllocateHeap(ProcessHeap, + Entry->TargetDirectory = (WCHAR*) RtlAllocateHeap(ProcessHeap, 0, (Length + 1) * sizeof(WCHAR)); if (Entry->TargetDirectory == NULL) @@ -269,7 +269,7 @@ if (TargetFilename != NULL) { Length = wcslen(TargetFilename); - Entry->TargetFilename = RtlAllocateHeap(ProcessHeap, + Entry->TargetFilename = (WCHAR*) RtlAllocateHeap(ProcessHeap, 0, (Length + 1) * sizeof(WCHAR)); if (Entry->TargetFilename == NULL) Modified: trunk/reactos/base/setup/usetup/inicache.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/inicache…
============================================================================== --- trunk/reactos/base/setup/usetup/inicache.c (original) +++ trunk/reactos/base/setup/usetup/inicache.c Fri Jan 5 23:19:21 2007 @@ -160,7 +160,7 @@ sizeof(INICACHEKEY)); - Key->Name = RtlAllocateHeap(ProcessHeap, + Key->Name = (WCHAR*) RtlAllocateHeap(ProcessHeap, 0, (NameLength + 1) * sizeof(WCHAR)); if (Key->Name == NULL) @@ -180,7 +180,7 @@ Key->Name[NameLength] = 0; - Key->Data = RtlAllocateHeap(ProcessHeap, + Key->Data = (WCHAR*) RtlAllocateHeap(ProcessHeap, 0, (DataLength + 1) * sizeof(WCHAR)); if (Key->Data == NULL) @@ -277,7 +277,7 @@ sizeof(INICACHESECTION)); /* Allocate and initialize section name */ - Section->Name = RtlAllocateHeap(ProcessHeap, + Section->Name = (WCHAR*) RtlAllocateHeap(ProcessHeap, 0, (NameLength + 1) * sizeof(WCHAR)); if (Section->Name == NULL) @@ -576,7 +576,7 @@ DPRINT("File size: %lu\n", FileLength); /* Allocate file buffer */ - FileBuffer = RtlAllocateHeap(ProcessHeap, + FileBuffer = (CHAR*) RtlAllocateHeap(ProcessHeap, 0, FileLength + 1); if (FileBuffer == NULL) @@ -891,7 +891,7 @@ sizeof(INICACHEKEY)); /* Allocate name buffer */ - Key->Name = RtlAllocateHeap(ProcessHeap, + Key->Name = (WCHAR*) RtlAllocateHeap(ProcessHeap, 0, (wcslen(Name) + 1) * sizeof(WCHAR)); if (Key->Name == NULL) @@ -907,7 +907,7 @@ wcscpy(Key->Name, Name); /* Allocate data buffer */ - Key->Data = RtlAllocateHeap(ProcessHeap, + Key->Data = (WCHAR*) RtlAllocateHeap(ProcessHeap, 0, (wcslen(Data) + 1) * sizeof(WCHAR)); if (Key->Data == NULL) @@ -1035,7 +1035,7 @@ DPRINT1("BufferSize: %lu\n", BufferSize); /* Allocate file buffer */ - Buffer = RtlAllocateHeap(ProcessHeap, + Buffer = (CHAR*) RtlAllocateHeap(ProcessHeap, 0, BufferSize); if (Buffer == NULL) @@ -1153,7 +1153,7 @@ sizeof(INICACHESECTION)); /* Allocate and initialize section name */ - Section->Name = RtlAllocateHeap(ProcessHeap, + Section->Name = (WCHAR*) RtlAllocateHeap(ProcessHeap, 0, (wcslen(Name) + 1) * sizeof(WCHAR)); if (Section->Name == NULL) Modified: trunk/reactos/base/setup/usetup/interface/usetup.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/interfac…
============================================================================== --- trunk/reactos/base/setup/usetup/interface/usetup.c (original) +++ trunk/reactos/base/setup/usetup/interface/usetup.c Fri Jan 5 23:19:21 2007 @@ -753,7 +753,7 @@ { return LICENSE_PAGE; break; - } + } } return INTRO_PAGE; @@ -815,7 +815,7 @@ CONSOLE_SetTextXY(6, 12, "The repair functions are not implemented yet."); CONSOLE_SetTextXY(8, 15, "\x07 Press R for the Recovery Console."); - + CONSOLE_SetTextXY(8, 17, "\x07 Press ESC to return to the main page."); CONSOLE_SetTextXY(8, 19, "\x07 Press ENTER to reboot your computer."); @@ -2806,7 +2806,7 @@ Ir, POPUP_WAIT_ENTER); return(QUIT_PAGE); } - + if (!PrepareCopyPageInfFile(SetupInf, NULL, Ir)) { return QUIT_PAGE; @@ -2859,9 +2859,9 @@ return QUIT_PAGE; } - InfHandle = INF_OpenBufferedFileA(InfFileData, + InfHandle = INF_OpenBufferedFileA((CHAR*) InfFileData, InfFileSize, - NULL, + (const CHAR*) NULL, INF_STYLE_WIN4, &ErrorLine); if (InfHandle == INVALID_HANDLE_VALUE) @@ -3156,12 +3156,12 @@ (Ir->Event.KeyEvent.wVirtualKeyCode == VK_DOWN)) /* DOWN */ { CONSOLE_NormalTextXY (8, Line, 48, 1); - + Line++; if (Line<12) Line=14; if (Line>14) Line=12; - - + + CONSOLE_InvertTextXY (8, Line, 48, 1); } @@ -3169,7 +3169,7 @@ (Ir->Event.KeyEvent.wVirtualKeyCode == VK_UP)) /* UP */ { CONSOLE_NormalTextXY (8, Line, 48, 1); - + Line--; if (Line<12) Line=14; if (Line>14) Line=12; @@ -3518,11 +3518,11 @@ break; case FORMAT_PARTITION_PAGE: - Page = FormatPartitionPage(&Ir); + Page = (PAGE_NUMBER) FormatPartitionPage(&Ir); break; case CHECK_FILE_SYSTEM_PAGE: - Page = CheckFileSystemPage(&Ir); + Page = (PAGE_NUMBER) CheckFileSystemPage(&Ir); break; case INSTALL_DIRECTORY_PAGE: Modified: trunk/reactos/base/setup/usetup/native/utils/console.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/native/u…
============================================================================== --- trunk/reactos/base/setup/usetup/native/utils/console.c (original) +++ trunk/reactos/base/setup/usetup/native/utils/console.c Fri Jan 5 23:19:21 2007 @@ -194,7 +194,7 @@ PCHAR pText; NTSTATUS Status; - Buffer = RtlAllocateHeap( + Buffer = (CHAR*) RtlAllocateHeap( ProcessHeap, 0, nLength + sizeof(COORD)); @@ -242,7 +242,7 @@ NTSTATUS Status; ULONG i; - Buffer = RtlAllocateHeap( + Buffer = (CHAR*) RtlAllocateHeap( ProcessHeap, 0, nLength + sizeof(COORD)); Modified: trunk/reactos/base/setup/usetup/partlist.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/partlist…
============================================================================== --- trunk/reactos/base/setup/usetup/partlist.c (original) +++ trunk/reactos/base/setup/usetup/partlist.c Fri Jan 5 23:19:21 2007 @@ -287,7 +287,7 @@ } else { - PartEntry->FormatState = Unknown; + PartEntry->FormatState = UnknownFormat; } InsertTailList (&DiskEntry->PartListHead, @@ -514,7 +514,7 @@ FullResourceDescriptor->PartialResourceList.PartialDescriptors[i].u.DeviceSpecificData.DataSize % sizeof(CM_INT13_DRIVE_PARAMETER) != 0) continue; - *Int13Drives = RtlAllocateHeap(ProcessHeap, 0, FullResourceDescriptor->PartialResourceList.PartialDescriptors[i].u.DeviceSpecificData.DataSize); + *Int13Drives = (CM_INT13_DRIVE_PARAMETER*) RtlAllocateHeap(ProcessHeap, 0, FullResourceDescriptor->PartialResourceList.PartialDescriptors[i].u.DeviceSpecificData.DataSize); if (*Int13Drives == NULL) return STATUS_NO_MEMORY; memcpy( @@ -567,7 +567,7 @@ { break; } - + swprintf(Name, L"%s\\%lu\\DiskController", ROOT_NAME, AdapterCount); Status = RtlQueryRegistryValues(RTL_REGISTRY_ABSOLUTE, Name, @@ -589,7 +589,7 @@ RtlFreeHeap(ProcessHeap, 0, Int13Drives); return; } - + swprintf(Name, L"%s\\%lu\\DiskController\\0\\DiskPeripheral", ROOT_NAME, AdapterCount); Status = RtlQueryRegistryValues(RTL_REGISTRY_ABSOLUTE, Name, @@ -605,7 +605,7 @@ DiskCount = 0; while (1) { - BiosDiskEntry = RtlAllocateHeap(ProcessHeap, HEAP_ZERO_MEMORY, sizeof(BIOSDISKENTRY)); + BiosDiskEntry = (BIOSDISKENTRY*) RtlAllocateHeap(ProcessHeap, HEAP_ZERO_MEMORY, sizeof(BIOSDISKENTRY)); if (BiosDiskEntry == NULL) { break; @@ -716,7 +716,7 @@ return; } - Mbr = RtlAllocateHeap(ProcessHeap, + Mbr = (PARTITION_SECTOR*) RtlAllocateHeap(ProcessHeap, 0, DiskGeometry.BytesPerSector); @@ -724,7 +724,7 @@ { return; } - + FileOffset.QuadPart = 0; Status = NtReadFile(FileHandle, NULL, @@ -785,7 +785,7 @@ /* FIXME: * Compare the size from bios and the reported size from driver. * If we have more than one disk with a zero or with the same signatur - * we must create new signatures and reboot. After the reboot, + * we must create new signatures and reboot. After the reboot, * it is possible to identify the disks. */ if (BiosDiskEntry->Signature == Signature && @@ -1036,7 +1036,7 @@ { Entry = RemoveHeadList(&List->BiosDiskListHead); BiosDiskEntry = CONTAINING_RECORD(Entry, BIOSDISKENTRY, ListEntry); - + RtlFreeHeap(ProcessHeap, 0, BiosDiskEntry); } @@ -1311,7 +1311,7 @@ { WriteConsoleOutputCharacterA (StdOutput, LineBuffer, - min (strlen (LineBuffer), Width - 2), + min ((USHORT)strlen (LineBuffer), Width - 2), coPos, &Written); } @@ -2380,7 +2380,7 @@ else { DriveLayout->PartitionCount = PartitionCount; - + Index = 0; Entry2 = DiskEntry1->PartListHead.Flink; while (Entry2 != &DiskEntry1->PartListHead) @@ -2423,7 +2423,7 @@ /* check if the signature already exist */ /* FIXME: - * Check also signatures from disks, which are + * Check also signatures from disks, which are * not visible (bootable) by the bios. */ Entry2 = List->DiskListHead.Flink; @@ -2442,7 +2442,7 @@ break; } } - + /* set one partition entry to dirty, this will update the signature */ DriveLayout->PartitionEntry[0].RewritePartition = TRUE; @@ -2466,7 +2466,7 @@ FILE_ALL_ACCESS, &ObjectAttributes, &Iosb, - 0, + 0, FILE_SYNCHRONOUS_IO_NONALERT); if (!NT_SUCCESS (Status)) Modified: trunk/reactos/base/setup/usetup/registry.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/registry…
============================================================================== --- trunk/reactos/base/setup/usetup/registry.c (original) +++ trunk/reactos/base/setup/usetup/registry.c Fri Jan 5 23:19:21 2007 @@ -270,7 +270,7 @@ if (Size) { - Str = RtlAllocateHeap (ProcessHeap, 0, Size * sizeof(WCHAR)); + Str = (WCHAR*) RtlAllocateHeap (ProcessHeap, 0, Size * sizeof(WCHAR)); if (Str == NULL) return FALSE; @@ -296,7 +296,7 @@ if (Size) { - Str = RtlAllocateHeap (ProcessHeap, 0, Size * sizeof(WCHAR)); + Str = (WCHAR*) RtlAllocateHeap (ProcessHeap, 0, Size * sizeof(WCHAR)); if (Str == NULL) return FALSE; @@ -363,7 +363,7 @@ if (Size) { - Data = RtlAllocateHeap (ProcessHeap, 0, Size); + Data = (unsigned char*) RtlAllocateHeap (ProcessHeap, 0, Size); if (Data == NULL) return FALSE; @@ -659,7 +659,7 @@ HANDLE KeyHandle; NTSTATUS Status; - /* Create the 'secret' InstallPath key */ + /* Create the 'secret' InstallPath key */ InitializeObjectAttributes (&ObjectAttributes, &KeyName, OBJ_CASE_INSENSITIVE, @@ -703,7 +703,7 @@ swprintf(ValueNameBuffer, L"\\DosDevices\\%C:", Letter); RtlInitUnicodeString(&ValueName, ValueNameBuffer); - + InitializeObjectAttributes (&ObjectAttributes, &KeyName, OBJ_CASE_INSENSITIVE, @@ -714,7 +714,7 @@ &ObjectAttributes); if (!NT_SUCCESS(Status)) { - Status = NtCreateKey(&KeyHandle, + Status = NtCreateKey(&KeyHandle, KEY_ALL_ACCESS, &ObjectAttributes, 0, Modified: trunk/reactos/base/setup/usetup/settings.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/settings…
============================================================================== --- trunk/reactos/base/setup/usetup/settings.c (original) +++ trunk/reactos/base/setup/usetup/settings.c Fri Jan 5 23:19:21 2007 @@ -187,7 +187,7 @@ break; } - UserData = RtlAllocateHeap(ProcessHeap, + UserData = (WCHAR*) RtlAllocateHeap(ProcessHeap, 0, (wcslen(KeyName) + 1) * sizeof(WCHAR)); if (UserData == NULL) @@ -308,7 +308,7 @@ BufferLength = sizeof(KEY_VALUE_PARTIAL_INFORMATION) + 256 * sizeof(WCHAR); - ValueInfo = RtlAllocateHeap(RtlGetProcessHeap(), + ValueInfo = (KEY_VALUE_PARTIAL_INFORMATION*) RtlAllocateHeap(RtlGetProcessHeap(), 0, BufferLength); if (ValueInfo == NULL) @@ -443,7 +443,7 @@ break; } - UserData = RtlAllocateHeap(ProcessHeap, + UserData = (WCHAR*) RtlAllocateHeap(ProcessHeap, 0, (wcslen(KeyName) + 1) * sizeof(WCHAR)); if (UserData == NULL) @@ -486,7 +486,7 @@ } wcscpy(SectionName, L"Files."); - wcscat(SectionName, Entry->UserData); + wcscat(SectionName, (const wchar_t*) Entry->UserData); *AdditionalSectionName = SectionName; return TRUE; @@ -514,7 +514,7 @@ return FALSE; } - if (!SetupFindFirstLineW(InfFile, L"Display", Entry->UserData, &Context)) + if (!SetupFindFirstLineW(InfFile, L"Display", (WCHAR*) Entry->UserData, &Context)) { DPRINT("SetupFindFirstLineW() failed\n"); return FALSE; @@ -554,7 +554,7 @@ } Width = wcstoul(Buffer, NULL, 10); Status = RtlWriteRegistryValue(RTL_REGISTRY_ABSOLUTE, - RegPath, + RegPath, L"DefaultSettings.XResolution", REG_DWORD, &Width, @@ -565,7 +565,7 @@ return FALSE; } - + if (!INF_GetDataField(&Context, 5, &Buffer)) { DPRINT("INF_GetDataField() failed\n"); @@ -637,7 +637,7 @@ break; } - UserData = RtlAllocateHeap(ProcessHeap, + UserData = (WCHAR*) RtlAllocateHeap(ProcessHeap, 0, (wcslen(KeyName) + 1) * sizeof(WCHAR)); if (UserData == NULL) @@ -695,7 +695,7 @@ break; } - UserData = RtlAllocateHeap(ProcessHeap, + UserData = (WCHAR*) RtlAllocateHeap(ProcessHeap, 0, (wcslen(KeyName) + 1) * sizeof(WCHAR)); if (UserData == NULL)
17 years, 11 months
1
0
0
0
[cwittich] 25314: * handle REG_EXPAND_SZ in GetAutostartEntriesFromRegistry * changed license to LGPL
by cwittich@svn.reactos.org
Author: cwittich Date: Fri Jan 5 23:15:07 2007 New Revision: 25314 URL:
http://svn.reactos.org/svn/reactos?rev=25314&view=rev
Log: * handle REG_EXPAND_SZ in GetAutostartEntriesFromRegistry * changed license to LGPL Modified: trunk/reactos/base/applications/msconfig/freeldrpage.c trunk/reactos/base/applications/msconfig/generalpage.c trunk/reactos/base/applications/msconfig/msconfig.c trunk/reactos/base/applications/msconfig/srvpage.c trunk/reactos/base/applications/msconfig/startuppage.c trunk/reactos/base/applications/msconfig/systempage.c trunk/reactos/base/applications/msconfig/toolspage.c Modified: trunk/reactos/base/applications/msconfig/freeldrpage.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/msconfig…
============================================================================== --- trunk/reactos/base/applications/msconfig/freeldrpage.c (original) +++ trunk/reactos/base/applications/msconfig/freeldrpage.c Fri Jan 5 23:15:07 2007 @@ -1,6 +1,6 @@ /* * PROJECT: ReactOS Applications - * LICENSE: GPL - See COPYING in the top level directory + * LICENSE: LGPL - See COPYING in the top level directory * FILE: base/applications/freeldrpage.c * PURPOSE: Freeloader configuration page message handler * COPYRIGHT: Copyright 2005-2006 Christoph von Wittich <Christoph(a)ApiViewer.de> Modified: trunk/reactos/base/applications/msconfig/generalpage.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/msconfig…
============================================================================== --- trunk/reactos/base/applications/msconfig/generalpage.c (original) +++ trunk/reactos/base/applications/msconfig/generalpage.c Fri Jan 5 23:15:07 2007 @@ -1,6 +1,6 @@ /* * PROJECT: ReactOS Applications - * LICENSE: GPL - See COPYING in the top level directory + * LICENSE: LGPL - See COPYING in the top level directory * FILE: base/applications/generalpage.c * PURPOSE: General page message handler * COPYRIGHT: Copyright 2005-2006 Christoph von Wittich <Christoph(a)ApiViewer.de> Modified: trunk/reactos/base/applications/msconfig/msconfig.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/msconfig…
============================================================================== --- trunk/reactos/base/applications/msconfig/msconfig.c (original) +++ trunk/reactos/base/applications/msconfig/msconfig.c Fri Jan 5 23:15:07 2007 @@ -1,6 +1,6 @@ /* * PROJECT: ReactOS Applications - * LICENSE: GPL - See COPYING in the top level directory + * LICENSE: LGPL - See COPYING in the top level directory * FILE: base/applications/msconfig.c * PURPOSE: msconfig main dialog * COPYRIGHT: Copyright 2005-2006 Christoph von Wittich <Christoph(a)ApiViewer.de> Modified: trunk/reactos/base/applications/msconfig/srvpage.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/msconfig…
============================================================================== --- trunk/reactos/base/applications/msconfig/srvpage.c (original) +++ trunk/reactos/base/applications/msconfig/srvpage.c Fri Jan 5 23:15:07 2007 @@ -1,6 +1,6 @@ /* * PROJECT: ReactOS Applications - * LICENSE: GPL - See COPYING in the top level directory + * LICENSE: LGPL - See COPYING in the top level directory * FILE: base/applications/srvpage.c * PURPOSE: Services page message handler * COPYRIGHT: Copyright 2005-2006 Christoph von Wittich <Christoph(a)ApiViewer.de> Modified: trunk/reactos/base/applications/msconfig/startuppage.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/msconfig…
============================================================================== --- trunk/reactos/base/applications/msconfig/startuppage.c (original) +++ trunk/reactos/base/applications/msconfig/startuppage.c Fri Jan 5 23:15:07 2007 @@ -1,6 +1,6 @@ /* * PROJECT: ReactOS Applications - * LICENSE: GPL - See COPYING in the top level directory + * LICENSE: LGPL - See COPYING in the top level directory * FILE: base/applications/startuppage.c * PURPOSE: Startup page message handler * COPYRIGHT: Copyright 2005-2006 Christoph von Wittich <Christoph(a)ApiViewer.de> @@ -116,25 +116,17 @@ dwDataLength = MAX_VALUE_NAME; if(RegEnumValue(hSubKey, SubIndex, szSubValueName, &dwValueLength, NULL, NULL, (LPBYTE)Data, &dwDataLength) == ERROR_SUCCESS) { + item.iSubItem = -1; if (!_tcscmp(szSubValueName, _T("command"))) - { + item.iSubItem = 1; + else if (!_tcscmp(szSubValueName, _T("key")) || !_tcscmp(szSubValueName, _T("location"))) + item.iSubItem = 2; + else if (!_tcscmp(szSubValueName, _T("item"))) + item.iSubItem = 0; + if (item.iSubItem != -1) + { GetLongPathName(Data, Data, (DWORD) _tcsclen(Data)); item.pszText = Data; - item.iSubItem = 1; - SendMessage(hStartupListCtrl, LVM_SETITEMTEXT, item.iItem, (LPARAM) &item); - } - else if (!_tcscmp(szSubValueName, _T("key")) || !_tcscmp(szSubValueName, _T("location"))) - { - GetLongPathName(Data, Data, (DWORD) _tcsclen(Data)); - item.pszText = Data; - item.iSubItem = 2; - SendMessage(hStartupListCtrl, LVM_SETITEMTEXT, item.iItem, (LPARAM) &item); - } - else if (!_tcscmp(szSubValueName, _T("item"))) - { - GetLongPathName(Data, Data, (DWORD) _tcsclen(Data)); - item.pszText = Data; - item.iSubItem = 0; SendMessage(hStartupListCtrl, LVM_SETITEMTEXT, item.iItem, (LPARAM) &item); } } @@ -183,7 +175,7 @@ (void)ListView_InsertItem(hStartupListCtrl, &item); ListView_SetCheckState(hStartupListCtrl, item.iItem, TRUE); - if (dwType == REG_SZ) + if ((dwType == REG_SZ) || (dwType == REG_EXPAND_SZ)) { GetLongPathName(Data, Data, (DWORD) _tcsclen(Data)); item.pszText = Data; Modified: trunk/reactos/base/applications/msconfig/systempage.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/msconfig…
============================================================================== --- trunk/reactos/base/applications/msconfig/systempage.c (original) +++ trunk/reactos/base/applications/msconfig/systempage.c Fri Jan 5 23:15:07 2007 @@ -1,6 +1,6 @@ /* * PROJECT: ReactOS Applications - * LICENSE: GPL - See COPYING in the top level directory + * LICENSE: LGPL - See COPYING in the top level directory * FILE: base/applications/systempage.c * PURPOSE: System page message handler * COPYRIGHT: Copyright 2005-2006 Christoph von Wittich <Christoph(a)ApiViewer.de> Modified: trunk/reactos/base/applications/msconfig/toolspage.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/msconfig…
============================================================================== --- trunk/reactos/base/applications/msconfig/toolspage.c (original) +++ trunk/reactos/base/applications/msconfig/toolspage.c Fri Jan 5 23:15:07 2007 @@ -1,6 +1,6 @@ /* * PROJECT: ReactOS Applications - * LICENSE: GPL - See COPYING in the top level directory + * LICENSE: LGPL - See COPYING in the top level directory * FILE: base/applications/toolspage.c * PURPOSE: Tools page message handler * COPYRIGHT: Copyright 2005-2006 Christoph von Wittich <Christoph(a)ApiViewer.de>
17 years, 11 months
1
0
0
0
[fireball] 25313: Don't call ReadCacheSegmentChain() twice (thanks Maarten).
by fireball@svn.reactos.org
Author: fireball Date: Fri Jan 5 22:41:19 2007 New Revision: 25313 URL:
http://svn.reactos.org/svn/reactos?rev=25313&view=rev
Log: Don't call ReadCacheSegmentChain() twice (thanks Maarten). Modified: trunk/reactos/ntoskrnl/cc/copy.c Modified: trunk/reactos/ntoskrnl/cc/copy.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/cc/copy.c?rev=253…
============================================================================== --- trunk/reactos/ntoskrnl/cc/copy.c (original) +++ trunk/reactos/ntoskrnl/cc/copy.c Fri Jan 5 22:41:19 2007 @@ -381,7 +381,6 @@ while (Length > 0) { TempLength = min(max(Bcb->CacheSegmentSize, MAX_RW_LENGTH), Length); - ReadCacheSegmentChain(Bcb, ReadOffset, TempLength, Buffer); Status = ReadCacheSegmentChain(Bcb, ReadOffset, TempLength, Buffer); if (!NT_SUCCESS(Status)) {
17 years, 11 months
1
0
0
0
[gedmurphy] 25312: fix build
by gedmurphy@svn.reactos.org
Author: gedmurphy Date: Fri Jan 5 21:41:48 2007 New Revision: 25312 URL:
http://svn.reactos.org/svn/reactos?rev=25312&view=rev
Log: fix build Modified: trunk/reactos/dll/cpl/desk/desk.rbuild Modified: trunk/reactos/dll/cpl/desk/desk.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/desk.rbuild?r…
============================================================================== --- trunk/reactos/dll/cpl/desk/desk.rbuild (original) +++ trunk/reactos/dll/cpl/desk/desk.rbuild Fri Jan 5 21:41:48 2007 @@ -20,13 +20,14 @@ <library>ntdll</library> <library>msimg32</library> <library>msvcrt</library> + <file>appearance.c</file> + <file>background.c</file> <file>classinst.c</file> <file>desk.c</file> - <file>background.c</file> + <file>dibitmap.c</file> + <file>misc.c</file> + <file>preview.c</file> <file>screensaver.c</file> - <file>appearance.c</file> <file>settings.c</file> - <file>dibitmap.c</file> - <file>preview.c</file> <file>desk.rc</file> </module>
17 years, 11 months
1
0
0
0
[ekohl] 25311: Add DrawCaptionTempA/W prototypes.
by ekohl@svn.reactos.org
Author: ekohl Date: Fri Jan 5 21:28:32 2007 New Revision: 25311 URL:
http://svn.reactos.org/svn/reactos?rev=25311&view=rev
Log: Add DrawCaptionTempA/W prototypes. Modified: trunk/reactos/include/psdk/winuser.h Modified: trunk/reactos/include/psdk/winuser.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/winuser.h?rev…
============================================================================== --- trunk/reactos/include/psdk/winuser.h (original) +++ trunk/reactos/include/psdk/winuser.h Fri Jan 5 21:28:32 2007 @@ -3500,6 +3500,8 @@ DWORD WINAPI DragObject(HWND,HWND,UINT,DWORD,HCURSOR); BOOL WINAPI DrawAnimatedRects(HWND,int,LPCRECT,LPCRECT); BOOL WINAPI DrawCaption(HWND,HDC,LPCRECT,UINT); +BOOL WINAPI DrawCaptionTempA(HWND,HDC,const RECT*,HFONT,HICON,LPCSTR,UINT); +BOOL WINAPI DrawCaptionTempW(HWND,HDC,const RECT*,HFONT,HICON,LPCWSTR,UINT); BOOL WINAPI DrawEdge(HDC,LPRECT,UINT,UINT); BOOL WINAPI DrawFocusRect(HDC,LPCRECT); BOOL WINAPI DrawFrameControl(HDC,LPRECT,UINT,UINT); @@ -4107,6 +4109,7 @@ #define DlgDirListComboBox DlgDirListComboBoxW #define DlgDirSelectComboBoxEx DlgDirSelectComboBoxExW #define DlgDirSelectEx DlgDirSelectExW +#define DrawCaptionTemp DrawCaptionTempW #define DrawState DrawStateW #define DrawText DrawTextW #define DrawTextEx DrawTextExW @@ -4273,6 +4276,7 @@ #define DlgDirListComboBox DlgDirListComboBoxA #define DlgDirSelectComboBoxEx DlgDirSelectComboBoxExA #define DlgDirSelectEx DlgDirSelectExA +#define DrawCaptionTemp DrawCaptionTempA #define DrawState DrawStateA #define DrawText DrawTextA #define DrawTextEx DrawTextExA
17 years, 11 months
1
0
0
0
[gedmurphy] 25310: comment out monitor blits until I (or someone else) gets around to writing a custom control to take changes of dialog units into account.
by gedmurphy@svn.reactos.org
Author: gedmurphy Date: Fri Jan 5 21:16:32 2007 New Revision: 25310 URL:
http://svn.reactos.org/svn/reactos?rev=25310&view=rev
Log: comment out monitor blits until I (or someone else) gets around to writing a custom control to take changes of dialog units into account. Modified: trunk/reactos/dll/cpl/desk/background.c trunk/reactos/dll/cpl/desk/settings.c Modified: trunk/reactos/dll/cpl/desk/background.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/background.c?…
============================================================================== --- trunk/reactos/dll/cpl/desk/background.c (original) +++ trunk/reactos/dll/cpl/desk/background.c Fri Jan 5 21:16:32 2007 @@ -720,11 +720,11 @@ hdcMem = CreateCompatibleDC(hdc); SelectObject(hdcMem, pGlobalData->hBitmap); - +/* TransparentBlt(hdc, 98, 0, pGlobalData->cxSource, pGlobalData->cySource, hdcMem, 0, 0, pGlobalData->cxSource, pGlobalData->cySource, 0xFF80FF); - +*/ DeleteDC(hdcMem); EndPaint(hwndDlg, &ps); } Modified: trunk/reactos/dll/cpl/desk/settings.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/settings.c?re…
============================================================================== --- trunk/reactos/dll/cpl/desk/settings.c (original) +++ trunk/reactos/dll/cpl/desk/settings.c Fri Jan 5 21:16:32 2007 @@ -601,13 +601,13 @@ hdcMem = CreateCompatibleDC(hdc); SelectObject(hdcMem, pGlobalData->hBitmap); - +/* TransparentBlt(hdc, 98, 0, pGlobalData->cxSource, pGlobalData->cySource, hdcMem, 0, 0, pGlobalData->cxSource, pGlobalData->cySource, 0xFF80FF); - +*/ DeleteDC(hdcMem); EndPaint(hwndDlg, &ps);
17 years, 11 months
1
0
0
0
[gedmurphy] 25309: - Add a bit of a hack to paint over the NULL text values in the caption bar. At least they look pretty now until a better fix is found - load resource strings onto heap to avoid overfows from translations
by gedmurphy@svn.reactos.org
Author: gedmurphy Date: Fri Jan 5 20:51:05 2007 New Revision: 25309 URL:
http://svn.reactos.org/svn/reactos?rev=25309&view=rev
Log: - Add a bit of a hack to paint over the NULL text values in the caption bar. At least they look pretty now until a better fix is found - load resource strings onto heap to avoid overfows from translations Added: trunk/reactos/dll/cpl/desk/misc.c Modified: trunk/reactos/dll/cpl/desk/Fr.rc trunk/reactos/dll/cpl/desk/It.rc trunk/reactos/dll/cpl/desk/Ja.rc trunk/reactos/dll/cpl/desk/Ru.rc trunk/reactos/dll/cpl/desk/Uk.rc trunk/reactos/dll/cpl/desk/cz.rc trunk/reactos/dll/cpl/desk/de.rc trunk/reactos/dll/cpl/desk/desk.h trunk/reactos/dll/cpl/desk/desk.rc trunk/reactos/dll/cpl/desk/en.rc trunk/reactos/dll/cpl/desk/es.rc trunk/reactos/dll/cpl/desk/gr.rc trunk/reactos/dll/cpl/desk/hu.rc trunk/reactos/dll/cpl/desk/nl.rc trunk/reactos/dll/cpl/desk/pl.rc trunk/reactos/dll/cpl/desk/preview.c trunk/reactos/dll/cpl/desk/resource.h trunk/reactos/dll/cpl/desk/sv.rc Modified: trunk/reactos/dll/cpl/desk/Fr.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/Fr.rc?rev=253…
============================================================================== --- trunk/reactos/dll/cpl/desk/Fr.rc (original) +++ trunk/reactos/dll/cpl/desk/Fr.rc Fri Jan 5 20:51:05 2007 @@ -131,4 +131,7 @@ IDS_MESSBOX "Message Box" IDS_MESSTEXT "Message Text" IDS_BUTTEXT "OK" + IDS_NORMAL "Normal" + IDS_DISABLED "Disabled" + IDS_SELECTED "Selected" END Modified: trunk/reactos/dll/cpl/desk/It.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/It.rc?rev=253…
============================================================================== --- trunk/reactos/dll/cpl/desk/It.rc (original) +++ trunk/reactos/dll/cpl/desk/It.rc Fri Jan 5 20:51:05 2007 @@ -125,4 +125,7 @@ IDS_MESSBOX "Message Box" IDS_MESSTEXT "Message Text" IDS_BUTTEXT "OK" + IDS_NORMAL "Normal" + IDS_DISABLED "Disabled" + IDS_SELECTED "Selected" END Modified: trunk/reactos/dll/cpl/desk/Ja.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/Ja.rc?rev=253…
============================================================================== --- trunk/reactos/dll/cpl/desk/Ja.rc (original) +++ trunk/reactos/dll/cpl/desk/Ja.rc Fri Jan 5 20:51:05 2007 @@ -129,4 +129,7 @@ IDS_MESSBOX "Message Box" IDS_MESSTEXT "Message Text" IDS_BUTTEXT "OK" + IDS_NORMAL "Normal" + IDS_DISABLED "Disabled" + IDS_SELECTED "Selected" END Modified: trunk/reactos/dll/cpl/desk/Ru.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/Ru.rc?rev=253…
============================================================================== --- trunk/reactos/dll/cpl/desk/Ru.rc (original) +++ trunk/reactos/dll/cpl/desk/Ru.rc Fri Jan 5 20:51:05 2007 @@ -151,4 +151,7 @@ IDS_MESSBOX "Message Box" IDS_MESSTEXT "Message Text" IDS_BUTTEXT "OK" + IDS_NORMAL "Normal" + IDS_DISABLED "Disabled" + IDS_SELECTED "Selected" END Modified: trunk/reactos/dll/cpl/desk/Uk.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/Uk.rc?rev=253…
============================================================================== --- trunk/reactos/dll/cpl/desk/Uk.rc (original) +++ trunk/reactos/dll/cpl/desk/Uk.rc Fri Jan 5 20:51:05 2007 @@ -133,4 +133,7 @@ IDS_MESSBOX "Message Box" IDS_MESSTEXT "Message Text" IDS_BUTTEXT "OK" + IDS_NORMAL "Normal" + IDS_DISABLED "Disabled" + IDS_SELECTED "Selected" END Modified: trunk/reactos/dll/cpl/desk/cz.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/cz.rc?rev=253…
============================================================================== --- trunk/reactos/dll/cpl/desk/cz.rc (original) +++ trunk/reactos/dll/cpl/desk/cz.rc Fri Jan 5 20:51:05 2007 @@ -123,4 +123,7 @@ IDS_MESSBOX "Message Box" IDS_MESSTEXT "Message Text" IDS_BUTTEXT "OK" + IDS_NORMAL "Normal" + IDS_DISABLED "Disabled" + IDS_SELECTED "Selected" END Modified: trunk/reactos/dll/cpl/desk/de.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/de.rc?rev=253…
============================================================================== --- trunk/reactos/dll/cpl/desk/de.rc (original) +++ trunk/reactos/dll/cpl/desk/de.rc Fri Jan 5 20:51:05 2007 @@ -127,4 +127,7 @@ IDS_MESSBOX "Message Box" IDS_MESSTEXT "Message Text" IDS_BUTTEXT "OK" + IDS_NORMAL "Normal" + IDS_DISABLED "Disabled" + IDS_SELECTED "Selected" END Modified: trunk/reactos/dll/cpl/desk/desk.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/desk.h?rev=25…
============================================================================== --- trunk/reactos/dll/cpl/desk/desk.h (original) +++ trunk/reactos/dll/cpl/desk/desk.h Fri Jan 5 20:51:05 2007 @@ -33,6 +33,10 @@ PDIBITMAP DibLoadImage(LPTSTR lpFilename); VOID DibFreeImage(PDIBITMAP lpBitmap); +INT AllocAndLoadString(LPTSTR *lpTarget, + HINSTANCE hInst, + UINT uID); + DWORD DbgPrint(PCH Format,...); #endif /* __CPL_DESK_H__ */ Modified: trunk/reactos/dll/cpl/desk/desk.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/desk.rc?rev=2…
============================================================================== --- trunk/reactos/dll/cpl/desk/desk.rc (original) +++ trunk/reactos/dll/cpl/desk/desk.rc Fri Jan 5 20:51:05 2007 @@ -8,7 +8,7 @@ #define REACTOS_STR_INTERNAL_NAME "desk\0" #define REACTOS_STR_ORIGINAL_FILENAME "desk.cpl\0" -#include <reactos/version.rc> +//#include <reactos/version.rc> IDC_DESK_ICON ICON "resources/applet.ico" IDC_DESK_ICON2 ICON "resources/applet.ico" Modified: trunk/reactos/dll/cpl/desk/en.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/en.rc?rev=253…
============================================================================== --- trunk/reactos/dll/cpl/desk/en.rc (original) +++ trunk/reactos/dll/cpl/desk/en.rc Fri Jan 5 20:51:05 2007 @@ -125,4 +125,7 @@ IDS_MESSBOX "Message Box" IDS_MESSTEXT "Message Text" IDS_BUTTEXT "OK" + IDS_NORMAL "Normal" + IDS_DISABLED "Disabled" + IDS_SELECTED "Selected" END Modified: trunk/reactos/dll/cpl/desk/es.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/es.rc?rev=253…
============================================================================== --- trunk/reactos/dll/cpl/desk/es.rc (original) +++ trunk/reactos/dll/cpl/desk/es.rc Fri Jan 5 20:51:05 2007 @@ -130,4 +130,7 @@ IDS_MESSBOX "Message Box" IDS_MESSTEXT "Message Text" IDS_BUTTEXT "OK" + IDS_NORMAL "Normal" + IDS_DISABLED "Disabled" + IDS_SELECTED "Selected" END Modified: trunk/reactos/dll/cpl/desk/gr.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/gr.rc?rev=253…
============================================================================== --- trunk/reactos/dll/cpl/desk/gr.rc (original) +++ trunk/reactos/dll/cpl/desk/gr.rc Fri Jan 5 20:51:05 2007 @@ -129,4 +129,7 @@ IDS_MESSBOX "Message Box" IDS_MESSTEXT "Message Text" IDS_BUTTEXT "OK" + IDS_NORMAL "Normal" + IDS_DISABLED "Disabled" + IDS_SELECTED "Selected" END Modified: trunk/reactos/dll/cpl/desk/hu.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/hu.rc?rev=253…
============================================================================== --- trunk/reactos/dll/cpl/desk/hu.rc (original) +++ trunk/reactos/dll/cpl/desk/hu.rc Fri Jan 5 20:51:05 2007 @@ -117,4 +117,7 @@ IDS_MESSBOX "Message Box" IDS_MESSTEXT "Message Text" IDS_BUTTEXT "OK" + IDS_NORMAL "Normal" + IDS_DISABLED "Disabled" + IDS_SELECTED "Selected" END Added: trunk/reactos/dll/cpl/desk/misc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/misc.c?rev=25…
============================================================================== --- trunk/reactos/dll/cpl/desk/misc.c (added) +++ trunk/reactos/dll/cpl/desk/misc.c Fri Jan 5 20:51:05 2007 @@ -1,0 +1,63 @@ +#include "desk.h" + +static INT +LengthOfStrResource(IN HINSTANCE hInst, + IN UINT uID) +{ + HRSRC hrSrc; + HGLOBAL hRes; + LPWSTR lpName, lpStr; + + if (hInst == NULL) + { + return -1; + } + + /* There are always blocks of 16 strings */ + lpName = (LPWSTR)MAKEINTRESOURCE((uID >> 4) + 1); + + /* Find the string table block */ + if ((hrSrc = FindResourceW(hInst, lpName, (LPWSTR)RT_STRING)) && + (hRes = LoadResource(hInst, hrSrc)) && + (lpStr = LockResource(hRes))) + { + UINT x; + + /* Find the string we're looking for */ + uID &= 0xF; /* position in the block, same as % 16 */ + for (x = 0; x < uID; x++) + { + lpStr += (*lpStr) + 1; + } + + /* Found the string */ + return (int)(*lpStr); + } + return -1; +} + +INT +AllocAndLoadString(OUT LPTSTR *lpTarget, + IN HINSTANCE hInst, + IN UINT uID) +{ + INT ln; + + ln = LengthOfStrResource(hInst, + uID); + if (ln++ > 0) + { + (*lpTarget) = (LPTSTR)LocalAlloc(LMEM_FIXED, + ln * sizeof(TCHAR)); + if ((*lpTarget) != NULL) + { + INT Ret; + if (!(Ret = LoadString(hInst, uID, *lpTarget, ln))) + { + LocalFree((HLOCAL)(*lpTarget)); + } + return Ret; + } + } + return 0; +} Modified: trunk/reactos/dll/cpl/desk/nl.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/nl.rc?rev=253…
============================================================================== --- trunk/reactos/dll/cpl/desk/nl.rc (original) +++ trunk/reactos/dll/cpl/desk/nl.rc Fri Jan 5 20:51:05 2007 @@ -123,4 +123,7 @@ IDS_MESSBOX "Message Box" IDS_MESSTEXT "Message Text" IDS_BUTTEXT "OK" + IDS_NORMAL "Normal" + IDS_DISABLED "Disabled" + IDS_SELECTED "Selected" END Modified: trunk/reactos/dll/cpl/desk/pl.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/pl.rc?rev=253…
============================================================================== --- trunk/reactos/dll/cpl/desk/pl.rc (original) +++ trunk/reactos/dll/cpl/desk/pl.rc Fri Jan 5 20:51:05 2007 @@ -124,4 +124,7 @@ IDS_MESSBOX "Message Box" IDS_MESSTEXT "Message Text" IDS_BUTTEXT "OK" + IDS_NORMAL "Normal" + IDS_DISABLED "Disabled" + IDS_SELECTED "Selected" END Modified: trunk/reactos/dll/cpl/desk/preview.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/preview.c?rev…
============================================================================== --- trunk/reactos/dll/cpl/desk/preview.c (original) +++ trunk/reactos/dll/cpl/desk/preview.c Fri Jan 5 20:51:05 2007 @@ -39,11 +39,37 @@ RECT rcDialogButton; + LPTSTR lpInAct; + LPTSTR lpAct; + LPTSTR lpWinTxt; + LPTSTR lpMessBox; + LPTSTR lpMessText; + LPTSTR lpButText; + LPTSTR lpMenNorm; + LPTSTR lpMenDis; + LPTSTR lpMenSel; + LOGFONT CaptionFont; LOGFONT DialogFont; LOGFONT MenuFont; } PREVIEW_DATA, *PPREVIEW_DATA; + + +/* HACK: fill the caption bar squares due to NULL text */ +static VOID +FillSquare(HDC hdc, PRECT rect) +{ + INT x, y, i; + + x = rect->left + 2; + y = rect->top + 2; + + for (i = 3; i < 12; i++) + { + BitBlt(hdc, x, y + i, 10, 1, hdc, x, y, SRCCOPY); + } +} static VOID @@ -176,13 +202,6 @@ HDC hdc; PAINTSTRUCT ps; RECT rc; - static NONCLIENTMETRICS NonClientMetrics; - static TCHAR szInAct[32]; - static TCHAR szAct[32]; - static TCHAR szWinTxt[32]; - static TCHAR szMessBox[32]; - static TCHAR szMessText[32]; - static TCHAR szButText[4]; pPreviewData = (PPREVIEW_DATA)GetWindowLongPtr(hwnd, GWLP_USERDATA); @@ -190,6 +209,8 @@ { case WM_CREATE: { + NONCLIENTMETRICS NonClientMetrics; + pPreviewData = (PPREVIEW_DATA)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(PREVIEW_DATA)); @@ -214,12 +235,15 @@ pPreviewData->MenuFont = NonClientMetrics.lfMenuFont; pPreviewData->DialogFont = NonClientMetrics.lfMessageFont; - LoadString(hApplet, IDS_INACTWIN, szInAct, sizeof(szInAct)); - LoadString(hApplet, IDS_ACTWIN, szAct, sizeof(szAct)); - LoadString(hApplet, IDS_WINTEXT, szWinTxt, sizeof(szWinTxt)); - LoadString(hApplet, IDS_MESSBOX, szMessBox, sizeof(szMessBox)); - LoadString(hApplet, IDS_MESSTEXT, szMessText, sizeof(szMessText)); - LoadString(hApplet, IDS_BUTTEXT, szButText, sizeof(szButText)); + AllocAndLoadString(&pPreviewData->lpInAct, hApplet, IDS_INACTWIN); + AllocAndLoadString(&pPreviewData->lpAct, hApplet, IDS_ACTWIN); + AllocAndLoadString(&pPreviewData->lpWinTxt, hApplet, IDS_WINTEXT); + AllocAndLoadString(&pPreviewData->lpMessBox, hApplet, IDS_MESSBOX); + AllocAndLoadString(&pPreviewData->lpMessText, hApplet, IDS_MESSTEXT); + AllocAndLoadString(&pPreviewData->lpButText, hApplet, IDS_BUTTEXT); + AllocAndLoadString(&pPreviewData->lpMenNorm, hApplet, IDS_NORMAL); + AllocAndLoadString(&pPreviewData->lpMenDis, hApplet, IDS_DISABLED); + AllocAndLoadString(&pPreviewData->lpMenSel, hApplet, IDS_SELECTED); break; } @@ -241,25 +265,26 @@ DrawEdge(hdc, &pPreviewData->rcInactiveFrame, EDGE_RAISED, BF_RECT | BF_MIDDLE); DrawCaption(hwnd, hdc, &pPreviewData->rcInactiveCaption, DC_GRADIENT | DC_TEXT); DrawCaptionButtons(hdc, &pPreviewData->rcInactiveCaption, TRUE); - CopyMemory(&tmpRc, &pPreviewData->rcInactiveCaption, sizeof(RECT)); + FillSquare(hdc, &pPreviewData->rcInactiveCaption); + CopyRect(&tmpRc, &pPreviewData->rcInactiveCaption); tmpRc.left += 4; tmpRc.top += 2; SelectObject(hdc, CreateFontIndirect(&pPreviewData->CaptionFont)); SetTextColor(hdc, RGB(212,208,200)); - DrawText(hdc, szInAct, lstrlen(szInAct), &tmpRc, DT_LEFT); - DeleteObject(SelectObject(hdc, GetStockObject(SYSTEM_FONT))); - + DrawText(hdc, pPreviewData->lpInAct, lstrlen(pPreviewData->lpInAct), &tmpRc, DT_LEFT); + DeleteObject(SelectObject(hdc, GetStockObject(SYSTEM_FONT))); /* Active Window */ DrawEdge(hdc, &pPreviewData->rcActiveFrame, EDGE_RAISED, BF_RECT | BF_MIDDLE); DrawCaption(hwnd, hdc, &pPreviewData->rcActiveCaption, DC_ACTIVE | DC_GRADIENT | DC_TEXT); DrawCaptionButtons(hdc, &pPreviewData->rcActiveCaption, TRUE); - CopyMemory(&tmpRc, &pPreviewData->rcActiveCaption, sizeof(RECT)); + FillSquare(hdc, &pPreviewData->rcActiveCaption); + CopyRect(&tmpRc, &pPreviewData->rcActiveCaption); tmpRc.left += 4; tmpRc.top += 2; SetTextColor(hdc, RGB(255,255,255)); // FIXME: don't hardcode colors SelectObject(hdc, CreateFontIndirect(&pPreviewData->CaptionFont)); - DrawText(hdc, szAct, lstrlen(szAct), &tmpRc, DT_LEFT); + DrawText(hdc, pPreviewData->lpAct, lstrlen(pPreviewData->lpAct), &tmpRc, DT_LEFT); DeleteObject(SelectObject(hdc, GetStockObject(SYSTEM_FONT))); /* FIXME: Draw the menu bar */ @@ -268,47 +293,46 @@ FillRect(hdc, &rc, pPreviewData->hbrWindow); /* Draw the client text */ - CopyMemory(&tmpRc, &pPreviewData->rcActiveClient, sizeof(RECT)); + CopyRect(&tmpRc, &pPreviewData->rcActiveClient); tmpRc.left += 4; tmpRc.top += 2; SetTextColor(hdc, RGB(0,0,0)); SelectObject(hdc, CreateFontIndirect(&pPreviewData->DialogFont)); - DrawText(hdc, szWinTxt, lstrlen(szWinTxt), &tmpRc, DT_LEFT); + DrawText(hdc, pPreviewData->lpWinTxt, lstrlen(pPreviewData->lpWinTxt), &tmpRc, DT_LEFT); DeleteObject(SelectObject(hdc, GetStockObject(SYSTEM_FONT))); /* Draw the scroll bar */ DrawScrollbar(hdc, &pPreviewData->rcActiveScroll); - /* Dialog Window */ DrawEdge(hdc, &pPreviewData->rcDialogFrame, EDGE_RAISED, BF_RECT | BF_MIDDLE); DrawCaption(hwnd, hdc, &pPreviewData->rcDialogCaption, DC_ACTIVE | DC_GRADIENT | DC_TEXT); DrawCaptionButtons(hdc, &pPreviewData->rcDialogCaption, FALSE); - CopyMemory(&tmpRc, &pPreviewData->rcDialogCaption, sizeof(RECT)); + FillSquare(hdc, &pPreviewData->rcDialogCaption); + CopyRect(&tmpRc, &pPreviewData->rcDialogCaption); tmpRc.left += 4; tmpRc.top += 2; SetTextColor(hdc, RGB(255,255,255)); SelectObject(hdc, CreateFontIndirect(&pPreviewData->CaptionFont)); - DrawText(hdc, szMessBox, lstrlen(szMessBox), &tmpRc, DT_LEFT); + DrawText(hdc, pPreviewData->lpMessBox, lstrlen(pPreviewData->lpMessBox), &tmpRc, DT_LEFT); DeleteObject(SelectObject(hdc, GetStockObject(SYSTEM_FONT))); /* draw the dialog text */ - CopyMemory(&tmpRc, &pPreviewData->rcDialogClient, sizeof(RECT)); + CopyRect(&tmpRc, &pPreviewData->rcDialogClient); tmpRc.left += 4; tmpRc.top += 2; SetTextColor(hdc, RGB(0,0,0)); SelectObject(hdc, CreateFontIndirect(&pPreviewData->DialogFont)); - DrawText(hdc, szMessText, lstrlen(szMessText), &tmpRc, DT_LEFT); + DrawText(hdc, pPreviewData->lpMessText, lstrlen(pPreviewData->lpMessText), &tmpRc, DT_LEFT); DeleteObject(SelectObject(hdc, GetStockObject(SYSTEM_FONT))); /* Draw Button */ DrawFrameControl(hdc, &pPreviewData->rcDialogButton, DFC_BUTTON, DFCS_BUTTONPUSH); - CopyMemory(&tmpRc, &pPreviewData->rcDialogButton, sizeof(RECT)); + CopyRect(&tmpRc, &pPreviewData->rcDialogButton); tmpRc.top += 6; SelectObject(hdc, CreateFontIndirect(&pPreviewData->DialogFont)); - DrawText(hdc, szButText, lstrlen(szButText), &tmpRc, DT_CENTER); - DeleteObject(SelectObject(hdc, GetStockObject(SYSTEM_FONT))); - + DrawText(hdc, pPreviewData->lpButText, lstrlen(pPreviewData->lpButText), &tmpRc, DT_CENTER); + DeleteObject(SelectObject(hdc, GetStockObject(SYSTEM_FONT))); EndPaint(hwnd, &ps); break; @@ -317,6 +341,16 @@ case WM_DESTROY: DeleteObject(pPreviewData->hbrDesktop); DeleteObject(pPreviewData->hbrWindow); + + LocalFree((HLOCAL)pPreviewData->lpInAct); + LocalFree((HLOCAL)pPreviewData->lpAct); + LocalFree((HLOCAL)pPreviewData->lpWinTxt); + LocalFree((HLOCAL)pPreviewData->lpMessBox); + LocalFree((HLOCAL)pPreviewData->lpMessText); + LocalFree((HLOCAL)pPreviewData->lpButText); + LocalFree((HLOCAL)pPreviewData->lpMenNorm); + LocalFree((HLOCAL)pPreviewData->lpMenDis); + LocalFree((HLOCAL)pPreviewData->lpMenSel); HeapFree(GetProcessHeap(), 0, pPreviewData); break; Modified: trunk/reactos/dll/cpl/desk/resource.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/resource.h?re…
============================================================================== --- trunk/reactos/dll/cpl/desk/resource.h (original) +++ trunk/reactos/dll/cpl/desk/resource.h Fri Jan 5 20:51:05 2007 @@ -88,6 +88,9 @@ #define IDS_MESSBOX 1513 #define IDS_MESSTEXT 1514 #define IDS_BUTTEXT 1515 +#define IDS_NORMAL 1516 +#define IDS_DISABLED 1517 +#define IDS_SELECTED 1518 #endif /* __CPL_DESK_RESOURCE_H__ */ Modified: trunk/reactos/dll/cpl/desk/sv.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/sv.rc?rev=253…
============================================================================== --- trunk/reactos/dll/cpl/desk/sv.rc (original) +++ trunk/reactos/dll/cpl/desk/sv.rc Fri Jan 5 20:51:05 2007 @@ -126,4 +126,7 @@ IDS_MESSBOX "Message Box" IDS_MESSTEXT "Message Text" IDS_BUTTEXT "OK" + IDS_NORMAL "Normal" + IDS_DISABLED "Disabled" + IDS_SELECTED "Selected" END
17 years, 11 months
1
0
0
0
← Newer
1
...
32
33
34
35
36
37
38
...
41
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
Results per page:
10
25
50
100
200