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
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
April 2017
----- 2024 -----
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
14 participants
179 discussions
Start a n
N
ew thread
[hbelusca] 74366: [CONSOLE.CPL]: Paint the text samples using the correct character set (derived from the current code page). This e.g. fixes display for the backslash symbol in CJK languages (that...
by hbelusca@svn.reactos.org
Author: hbelusca Date: Mon Apr 17 23:26:07 2017 New Revision: 74366 URL:
http://svn.reactos.org/svn/reactos?rev=74366&view=rev
Log: [CONSOLE.CPL]: Paint the text samples using the correct character set (derived from the current code page). This e.g. fixes display for the backslash symbol in CJK languages (that should appear as the Chinese "yuan" / Japanese "yen" currency symbol ¥, or the Korean "won" currency symbol ₩). CORE-12451 Modified: trunk/reactos/dll/cpl/console/layout.c trunk/reactos/dll/cpl/console/options.c Modified: trunk/reactos/dll/cpl/console/layout.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/console/layout.c?r…
============================================================================== --- trunk/reactos/dll/cpl/console/layout.c [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/console/layout.c [iso-8859-1] Mon Apr 17 23:26:07 2017 @@ -131,7 +131,7 @@ FALSE, FALSE, FALSE, - OEM_CHARSET, + CodePageToCharSet(pConInfo->CodePage), OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, @@ -233,11 +233,11 @@ case WM_NOTIFY: { - LPNMUPDOWN lpnmud = (LPNMUPDOWN)lParam; - LPPSHNOTIFY lppsn = (LPPSHNOTIFY)lParam; + LPPSHNOTIFY lppsn = (LPPSHNOTIFY)lParam; if (lppsn->hdr.code == UDN_DELTAPOS) { + LPNMUPDOWN lpnmud = (LPNMUPDOWN)lParam; DWORD wheight, wwidth; DWORD sheight, swidth; DWORD left, top; Modified: trunk/reactos/dll/cpl/console/options.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/console/options.c?…
============================================================================== --- trunk/reactos/dll/cpl/console/options.c [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/console/options.c [iso-8859-1] Mon Apr 17 23:26:07 2017 @@ -107,11 +107,12 @@ case WM_NOTIFY: { - LPNMUPDOWN lpnmud = (LPNMUPDOWN)lParam; - LPPSHNOTIFY lppsn = (LPPSHNOTIFY)lParam; + LPPSHNOTIFY lppsn = (LPPSHNOTIFY)lParam; if (lppsn->hdr.code == UDN_DELTAPOS) { + LPNMUPDOWN lpnmud = (LPNMUPDOWN)lParam; + if (lppsn->hdr.idFrom == IDC_UPDOWN_BUFFER_SIZE) { lpnmud->iPos = min(max(lpnmud->iPos + lpnmud->iDelta, 1), 999);
7 years, 6 months
1
0
0
0
[hbelusca] 74365: [CONSOLE.CPL]: Add support for Asian fonts & CJK codepage in the console properties dialog. Based on a patch by Katayama Hirofumi MZ. CORE-12451
by hbelusca@svn.reactos.org
Author: hbelusca Date: Mon Apr 17 23:21:13 2017 New Revision: 74365 URL:
http://svn.reactos.org/svn/reactos?rev=74365&view=rev
Log: [CONSOLE.CPL]: Add support for Asian fonts & CJK codepage in the console properties dialog. Based on a patch by Katayama Hirofumi MZ. CORE-12451 Modified: trunk/reactos/dll/cpl/console/console.h trunk/reactos/dll/cpl/console/font.c Modified: trunk/reactos/dll/cpl/console/console.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/console/console.h?…
============================================================================== --- trunk/reactos/dll/cpl/console/console.h [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/console/console.h [iso-8859-1] Mon Apr 17 23:21:13 2017 @@ -8,6 +8,7 @@ #include <windef.h> #include <winbase.h> #include <wingdi.h> +#include <winnls.h> #include <winreg.h> #include <winuser.h> #include <wincon.h> @@ -32,6 +33,7 @@ extern PCONSOLE_STATE_INFO ConInfo; VOID ApplyConsoleInfo(HWND hwndDlg); +BYTE CodePageToCharSet(UINT CodePage); VOID PaintConsole(LPDRAWITEMSTRUCT drawItem, PCONSOLE_STATE_INFO pConInfo); BOOL PaintText(LPDRAWITEMSTRUCT drawItem, PCONSOLE_STATE_INFO pConInfo, TEXT_TYPE TextMode); Modified: trunk/reactos/dll/cpl/console/font.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/console/font.c?rev…
============================================================================== --- trunk/reactos/dll/cpl/console/font.c [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/console/font.c [iso-8859-1] Mon Apr 17 23:21:13 2017 @@ -5,6 +5,7 @@ * PURPOSE: Font dialog * PROGRAMMERS: Johannes Anderwald (johannes.anderwald(a)reactos.org) * Hermes Belusca-Maito (hermes.belusca(a)sfr.fr) + * Katayama Hirofumi MZ (katayama.hirofumi.mz(a)gmail.com) */ #include "console.h" @@ -92,6 +93,26 @@ // 22, 24, 26, 28, 36, 48, 72 5, 6, 7, 8, 10, 12, 14, 16, 18, 20, 24, 28, 36, 72 }; + +#define CP_SHIFTJIS 932 // Japanese Shift-JIS +#define CP_HANGUL 949 // Korean Hangul +#define CP_GB2312 936 // Chinese Simplified (GB2312) +#define CP_BIG5 950 // Chinese Traditional (Big5) + +/* IsFarEastCP(CodePage) */ +#define IsCJKCodePage(CodePage) \ + ((CodePage) == CP_SHIFTJIS || (CodePage) == CP_HANGUL || \ + (CodePage) == CP_BIG5 || (CodePage) == CP_GB2312) + +/* Retrieves the character set associated with a given code page */ +BYTE CodePageToCharSet(UINT CodePage) +{ + CHARSETINFO CharInfo; + if (TranslateCharsetInfo((LPDWORD)CodePage, &CharInfo, TCI_SRCCODEPAGE)) + return CharInfo.ciCharset; + else + return DEFAULT_CHARSET; +} static BOOL CALLBACK EnumFontNamesProc(PLOGFONTW lplf, @@ -134,7 +155,6 @@ * that can be italic or have negative A or C space. * - If it is not a TrueType font, it can be from another character set * than OEM_CHARSET. - * - We do not support Asian criteria at the moment. * - We do not look into the magic registry key mentioned above. */ @@ -162,23 +182,42 @@ return TRUE; } - /* Reject non-TrueType fonts that are not OEM */ -#if 0 - if ((FontType != TRUETYPE_FONTTYPE) && (lplf->lfCharSet != OEM_CHARSET)) - { - DPRINT1("Non-TrueType font '%S' rejected because it's not OEM_CHARSET %d\n", - pszName, lplf->lfCharSet); - return TRUE; - } -#else // Improved criterium - if ((FontType != TRUETYPE_FONTTYPE) && - ((lplf->lfCharSet != ANSI_CHARSET) && (lplf->lfCharSet != DEFAULT_CHARSET) && (lplf->lfCharSet != OEM_CHARSET))) - { - DPRINT1("Non-TrueType font '%S' rejected because it's not ANSI_CHARSET or DEFAULT_CHARSET or OEM_CHARSET (lfCharSet = %d)\n", - pszName, lplf->lfCharSet); - return TRUE; - } -#endif + /* Is the current code page Chinese, Japanese or Korean? */ + if (IsCJKCodePage(ConInfo->CodePage)) + { + /* It's Asian */ + if (FontType == TRUETYPE_FONTTYPE) + { + if (lplf->lfCharSet != CodePageToCharSet(ConInfo->CodePage)) + { + DPRINT1("TrueType font '%S' rejected because it's not user Asian charset (lfCharSet = %d)\n", + pszName, lplf->lfCharSet); + return TRUE; + } + } + else + { + /* Reject non-TrueType fonts that are not Terminal */ + if (wcscmp(pszName, L"Terminal") != 0) + { + DPRINT1("Non-TrueType font '%S' rejected because it's not Terminal\n", pszName); + return TRUE; + } + } + } + else + { + /* Not CJK */ + if ((FontType != TRUETYPE_FONTTYPE) && + (lplf->lfCharSet != ANSI_CHARSET) && + (lplf->lfCharSet != DEFAULT_CHARSET) && + (lplf->lfCharSet != OEM_CHARSET)) + { + DPRINT1("Non-TrueType font '%S' rejected because it's not ANSI_CHARSET or DEFAULT_CHARSET or OEM_CHARSET (lfCharSet = %d)\n", + pszName, lplf->lfCharSet); + return TRUE; + } + } /* Reject fonts that are vertical (tategaki) */ if (pszName[0] == L'@') @@ -186,17 +225,6 @@ DPRINT1("Font '%S' rejected because it's vertical\n", pszName); return TRUE; } - -#if 0 // For Asian installations only - /* Reject non-TrueType fonts that are not Terminal */ - if ((FontType != TRUETYPE_FONTTYPE) && (wcscmp(pszName, L"Terminal") != 0)) - { - DPRINT1("Non-TrueType font '%S' rejected because it's not Terminal\n", pszName); - return TRUE; - } - - // TODO: Asian TrueType font must also be an Asian character set. -#endif /* Make sure the font doesn't already exist in the list */ if (SendMessageW(hwndCombo, LB_FINDSTRINGEXACT, 0, (LPARAM)pszName) == LB_ERR) @@ -314,7 +342,7 @@ /* Enumerate the available sizes for the selected font */ ZeroMemory(&lf, sizeof(lf)); - lf.lfCharSet = DEFAULT_CHARSET; // OEM_CHARSET; + lf.lfCharSet = DEFAULT_CHARSET; // CodePageToCharSet(pConInfo->CodePage); // lf.lfPitchAndFamily = FIXED_PITCH | FF_DONTCARE; wcsncpy(lf.lfFaceName, FaceName, LF_FACESIZE); lf.lfFaceName[Length] = L'\0'; @@ -386,13 +414,39 @@ INT idx; ZeroMemory(&lf, sizeof(lf)); - lf.lfCharSet = DEFAULT_CHARSET; // OEM_CHARSET; + lf.lfCharSet = DEFAULT_CHARSET; // CodePageToCharSet(ConInfo->CodePage); // lf.lfPitchAndFamily = FIXED_PITCH | FF_DONTCARE; hDC = GetDC(NULL); EnumFontFamiliesExW(hDC, &lf, (FONTENUMPROCW)EnumFontNamesProc, (LPARAM)GetDlgItem(hwndDlg, IDC_LBOX_FONTTYPE), 0); ReleaseDC(NULL, hDC); + + idx = (INT)SendDlgItemMessageW(hwndDlg, IDC_LBOX_FONTTYPE, LB_GETCOUNT, 0, 0); + if ((idx == 0) || (idx == LB_ERR)) + { + DPRINT1("The ideal console fonts are not found; manually add default ones.\n"); + + /* This world is not ideal. We have to do it realistically. */ + idx = (INT)SendDlgItemMessageW(hwndDlg, IDC_LBOX_FONTTYPE, LB_ADDSTRING, 0, + (LPARAM)L"Lucida Console"); + if (idx != LB_ERR) + { + SendDlgItemMessageW(hwndDlg, IDC_LBOX_FONTTYPE, + LB_SETITEMDATA, idx, TRUETYPE_FONTTYPE); + } + + if (CodePageToCharSet(ConInfo->CodePage) != DEFAULT_CHARSET) + { + idx = (INT)SendDlgItemMessageW(hwndDlg, IDC_LBOX_FONTTYPE, LB_ADDSTRING, 0, + (LPARAM)L"Droid Sans Fallback"); + if (idx != LB_ERR) + { + SendDlgItemMessageW(hwndDlg, IDC_LBOX_FONTTYPE, + LB_SETITEMDATA, idx, TRUETYPE_FONTTYPE); + } + } + } DPRINT1("ConInfo->FaceName = '%S'\n", ConInfo->FaceName); idx = (INT)SendDlgItemMessageW(hwndDlg, IDC_LBOX_FONTTYPE,
7 years, 6 months
1
0
0
0
[ekohl] 74364: [AT] Applied hotfix for russian translation. Patch by Sergey Stopkin. CORE-12961
by ekohl@svn.reactos.org
Author: ekohl Date: Mon Apr 17 22:28:42 2017 New Revision: 74364 URL:
http://svn.reactos.org/svn/reactos?rev=74364&view=rev
Log: [AT] Applied hotfix for russian translation. Patch by Sergey Stopkin. CORE-12961 Modified: trunk/reactos/base/applications/cmdutils/at/lang/ru-RU.rc Modified: trunk/reactos/base/applications/cmdutils/at/lang/ru-RU.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/cmdutils…
============================================================================== --- trunk/reactos/base/applications/cmdutils/at/lang/ru-RU.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/cmdutils/at/lang/ru-RU.rc [iso-8859-1] Mon Apr 17 22:28:42 2017 @@ -11,7 +11,7 @@ \\\\имÑ_компÑÑÑеÑа ÐÐ¼Ñ Ñдаленного компÑÑÑеÑа. ÐÑли ÑÑÐ¾Ñ Ð¿Ð°ÑамеÑÑ Ð½Ðµ Ñказан, \n\ иÑполÑзÑеÑÑÑ Ð»Ð¾ÐºÐ°Ð»ÑнÑй компÑÑÑеÑ.\n\ id ÐоÑÑдковÑй Ð½Ð¾Ð¼ÐµÑ Ð·Ð°Ð¿Ð»Ð°Ð½Ð¸Ñованной задаÑи.\n\ -/DELETE ÐÑменÑÐµÑ Ð·Ð°Ð¿Ð»Ð°Ð½Ð¸ÑованнÑÑ ÐºÐ¾Ð¼Ð°Ð½Ð´Ñ. ÐÑли паÑамеÑÑ is не Ñказан, Ñо\n\ +/DELETE ÐÑменÑÐµÑ Ð·Ð°Ð¿Ð»Ð°Ð½Ð¸ÑованнÑÑ ÐºÐ¾Ð¼Ð°Ð½Ð´Ñ. ÐÑли паÑамеÑÑ id не Ñказан, Ñо\n\ вÑе командÑ, запланиÑованнÑе на данном компÑÑÑеÑе, бÑдÑÑ Ð¾ÑмененÑ.\n\ /YES ÐÑмена запÑоÑа на подÑвеÑждение пÑи оÑмене вÑÐµÑ \n\ запланиÑованнÑÑ Ð·Ð°Ð´Ð°Ñ.\n\ @@ -27,7 +27,7 @@ ""команда"" Ðоманда или Ð¸Ð¼Ñ Ð¿Ð°ÐºÐµÑного Ñайла Ð´Ð»Ñ Ð·Ð°Ð¿ÑÑка.\n" IDS_CONFIRM_QUESTION "ÐÑодолжиÑÑ Ð²Ñполнение опеÑаÑии? (Y-да/N-неÑ) [N] " - IDS_CONFIRM_INVALID "\nThis is an invalid response.\n" + IDS_CONFIRM_INVALID "\nÐедопÑÑÑимÑй оÑвеÑ.\n" IDS_CONFIRM_YES "Y" IDS_CONFIRM_NO "N" @@ -49,6 +49,6 @@ IDS_STATUS "СоÑÑоÑние: %s\n" IDS_SCHEDULE "РаÑпиÑание: %s\n" IDS_TIME "ÐÑÐµÐ¼Ñ ÑÑÑок: %s\n" - IDS_INTERACTIVE "Interactive: %s\n" + IDS_INTERACTIVE "ÐнÑеÑакÑивнÑй: %s\n" IDS_COMMAND "Ðоманда: %s\n" END
7 years, 6 months
1
0
0
0
[ekohl] 74363: [NEWDEV] When the driver installation fails, set the CONFIGFLAG_FAILEDINSTALL flag only if the user checked the 'Do not show this dialog anymore' checkbox. CORE-13095
by ekohl@svn.reactos.org
Author: ekohl Date: Mon Apr 17 22:20:44 2017 New Revision: 74363 URL:
http://svn.reactos.org/svn/reactos?rev=74363&view=rev
Log: [NEWDEV] When the driver installation fails, set the CONFIGFLAG_FAILEDINSTALL flag only if the user checked the 'Do not show this dialog anymore' checkbox. CORE-13095 Modified: trunk/reactos/dll/win32/newdev/wizard.c Modified: trunk/reactos/dll/win32/newdev/wizard.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/newdev/wizard.c?…
============================================================================== --- trunk/reactos/dll/win32/newdev/wizard.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/newdev/wizard.c [iso-8859-1] Mon Apr 17 22:20:44 2017 @@ -1010,6 +1010,12 @@ 0, NULL); } + else + { + SetFailedInstall(DevInstData->hDevInfo, + &DevInstData->devInfoData, + FALSE); + } break; }
7 years, 6 months
1
0
0
0
[ekohl] 74362: [NETID] Load, display and store the computer description. Patch by Grzegorz Araminowicz. - Moved most of the code into separate functions and got rid of its deeply nested structure. ...
by ekohl@svn.reactos.org
Author: ekohl Date: Mon Apr 17 21:05:02 2017 New Revision: 74362 URL:
http://svn.reactos.org/svn/reactos?rev=74362&view=rev
Log: [NETID] Load, display and store the computer description. Patch by Grzegorz Araminowicz. - Moved most of the code into separate functions and got rid of its deeply nested structure. - Added some notification code, so that the Apply button gets enabled when the user changes the description. CORE-12337 Modified: trunk/reactos/dll/win32/netid/netid.c Modified: trunk/reactos/dll/win32/netid/netid.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netid/netid.c?re…
============================================================================== --- trunk/reactos/dll/win32/netid/netid.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/netid/netid.c [iso-8859-1] Mon Apr 17 21:05:02 2017 @@ -13,11 +13,15 @@ #include <windef.h> #include <winbase.h> #include <winuser.h> +#include <winreg.h> #include <tchar.h> #include <lm.h> #include <prsht.h> #include "resource.h" + + +#define MAX_COMPUTERDESCRIPTION_LENGTH 256 static INT_PTR CALLBACK NetIDPageProc(IN HWND hwndDlg, @@ -266,54 +270,153 @@ return FALSE; } +static +VOID +NetIDPage_OnInitDialog( + HWND hwndDlg) +{ + WCHAR ComputerDescription[MAX_COMPUTERDESCRIPTION_LENGTH + 1]; + WCHAR ComputerName[MAX_COMPUTERNAME_LENGTH + 1]; + DWORD RegSize = sizeof(ComputerDescription); + DWORD Size = MAX_COMPUTERNAME_LENGTH + 1; + HKEY KeyHandle; + LPWKSTA_INFO_101 wki; + LONG lError; + + /* Display computer name and description */ + SendDlgItemMessage(hwndDlg, IDC_COMPDESC, EM_SETLIMITTEXT, MAX_COMPUTERDESCRIPTION_LENGTH, 0); + + lError = RegOpenKeyExW(HKEY_LOCAL_MACHINE, + L"SYSTEM\\CurrentControlSet\\Services\\LanmanServer\\Parameters", + 0, + KEY_QUERY_VALUE, + &KeyHandle); + if (lError == ERROR_SUCCESS) + { + lError = RegQueryValueExW(KeyHandle, + L"srvcomment", + 0, + NULL, + (LPBYTE)ComputerDescription, + &RegSize); + if (lError == ERROR_SUCCESS) + { + ComputerDescription[RegSize / sizeof(WCHAR)] = UNICODE_NULL; + SetDlgItemText(hwndDlg, IDC_COMPDESC, ComputerDescription); + } + + RegCloseKey(KeyHandle); + } + + if (GetComputerName(ComputerName,&Size)) + { + SetDlgItemText(hwndDlg, IDC_COMPUTERNAME, ComputerName); + } + + if (NetWkstaGetInfo(NULL, 101, (LPBYTE*)&wki) == NERR_Success) + { + SetDlgItemText(hwndDlg, IDC_WORKGROUPDOMAIN_NAME, wki->wki101_langroup); + NetApiBufferFree(wki); + } +} + +static +LONG +NetIDPage_OnApply( + HWND hwndDlg) +{ + WCHAR ComputerDescription[MAX_COMPUTERDESCRIPTION_LENGTH + 1]; + WCHAR NewComputerDescription[MAX_COMPUTERDESCRIPTION_LENGTH + 1]; + HKEY KeyHandle = NULL; + DWORD dwSize; + LONG lError; + + lError = RegOpenKeyExW(HKEY_LOCAL_MACHINE, + L"SYSTEM\\CurrentControlSet\\Services\\LanmanServer\\Parameters", + 0, + KEY_QUERY_VALUE | KEY_SET_VALUE, + &KeyHandle); + if (lError != ERROR_SUCCESS) + return lError; + + GetDlgItemTextW(hwndDlg, + IDC_COMPDESC, + NewComputerDescription, + ARRAYSIZE(NewComputerDescription)); + if (GetLastError() != ERROR_SUCCESS) + { + lError = GetLastError(); + goto done; + } + + dwSize = sizeof(ComputerDescription); + lError = RegQueryValueExW(KeyHandle, + L"srvcomment", + 0, + NULL, + (PBYTE)ComputerDescription, + &dwSize); + if (lError != ERROR_SUCCESS && lError != ERROR_FILE_NOT_FOUND) + goto done; + + lError = ERROR_SUCCESS; + if (wcscmp(ComputerDescription, NewComputerDescription) != 0) + { + lError = RegSetValueExW(KeyHandle, + L"srvcomment", + 0, + REG_SZ, + (PBYTE)NewComputerDescription, + (wcslen(NewComputerDescription) + 1) * sizeof(WCHAR)); + } + +done: + if (KeyHandle != NULL) + RegCloseKey(KeyHandle); + + return lError; +} + static INT_PTR CALLBACK NetIDPageProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam) { + static BOOL bEnable = FALSE; INT_PTR Ret = 0; - UNREFERENCED_PARAMETER(lParam); - switch (uMsg) { case WM_INITDIALOG: - { - /* Display computer name */ - LPWKSTA_INFO_101 wki = NULL; - DWORD Size = MAX_COMPUTERNAME_LENGTH + 1; - TCHAR ComputerName[MAX_COMPUTERNAME_LENGTH + 1]; - if (GetComputerName(ComputerName,&Size)) - { - SetDlgItemText(hwndDlg, - IDC_COMPUTERNAME, - ComputerName); - } - if (NetWkstaGetInfo(NULL, - 101, - (LPBYTE*)&wki) == NERR_Success) - { - SetDlgItemText(hwndDlg, - IDC_WORKGROUPDOMAIN_NAME, - wki->wki101_langroup); - } - - if (wki) NetApiBufferFree(wki); - + NetIDPage_OnInitDialog(hwndDlg); + bEnable = TRUE; Ret = TRUE; break; - } + + case WM_NOTIFY: + switch (((LPNMHDR)lParam)->code) + { + case PSN_APPLY: + NetIDPage_OnApply(hwndDlg); + break; + } + break; case WM_COMMAND: switch (LOWORD(wParam)) { + case IDC_COMPDESC: + if (HIWORD(wParam) == EN_CHANGE && bEnable == TRUE) + PropSheet_Changed(GetParent(hwndDlg), hwndDlg); + break; + case IDC_NETWORK_PROPERTY: DialogBox(hDllInstance, MAKEINTRESOURCE(IDD_PROPPAGECOMPNAMECHENGE), hwndDlg, NetworkPropDlgProc); - break; + break; } break; }
7 years, 6 months
1
0
0
0
[tfaber] 74361: [KMTESTS:MM] - Add some missing newlines and skip()s
by tfaber@svn.reactos.org
Author: tfaber Date: Mon Apr 17 20:37:26 2017 New Revision: 74361 URL:
http://svn.reactos.org/svn/reactos?rev=74361&view=rev
Log: [KMTESTS:MM] - Add some missing newlines and skip()s Modified: trunk/rostests/kmtests/ntos_mm/ZwCreateSection.c trunk/rostests/kmtests/ntos_mm/ZwMapViewOfSection.c Modified: trunk/rostests/kmtests/ntos_mm/ZwCreateSection.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/kmtests/ntos_mm/ZwCreateS…
============================================================================== --- trunk/rostests/kmtests/ntos_mm/ZwCreateSection.c [iso-8859-1] (original) +++ trunk/rostests/kmtests/ntos_mm/ZwCreateSection.c [iso-8859-1] Mon Apr 17 20:37:26 2017 @@ -272,7 +272,7 @@ ok_eq_hex(Status, STATUS_SUCCESS); ok_eq_ulongptr(IoStatusBlock.Information, FILE_CREATED); ok(*WriteOnlyFile != NULL, "WriteOnlyFile is NULL\n"); - if (*WriteOnlyFile) + if (!skip(*WriteOnlyFile != NULL, "No WriteOnlyFile\n")) { FileOffset.QuadPart = 0; Status = ZwWriteFile(*WriteOnlyFile, NULL, NULL, NULL, &IoStatusBlock, (PVOID)TestString, TestStringSize, &FileOffset, NULL); @@ -324,7 +324,7 @@ CREATE_SECTION(Section, SECTION_ALL_ACCESS, NULL, MaximumSize, PAGE_READWRITE, SEC_COMMIT, NULL, STATUS_INVALID_PARAMETER_4, IGNORE); //division by zero in ROS - if (!skip(SharedUserData->LargePageMinimum > 0, "LargePageMinimum is 0")) + if (!skip(SharedUserData->LargePageMinimum > 0, "LargePageMinimum is 0\n")) { MaximumSize.QuadPart = (_4mb / SharedUserData->LargePageMinimum) * SharedUserData->LargePageMinimum; //4mb CREATE_SECTION(Section, SECTION_ALL_ACCESS, NULL, MaximumSize, PAGE_READWRITE, (SEC_LARGE_PAGES | SEC_COMMIT), NULL, STATUS_SUCCESS, STATUS_SUCCESS); @@ -425,7 +425,7 @@ //MaximumSize Status = ZwQueryInformationFile(FileHandleExecuteOnly, &IoStatusBlock, &FileStandardInfo, sizeof(FILE_STANDARD_INFORMATION), FileStandardInformation); - if (!skip(NT_SUCCESS(Status), "Cannot query file information")) + if (!skip(NT_SUCCESS(Status), "Cannot query file information\n")) { //as big as file MaximumSize = FileStandardInfo.EndOfFile; @@ -503,7 +503,7 @@ KmtInitTestFiles(&FileHandleReadOnly, &FileHandleWriteOnly, &FileHandleExecuteOnly); - if (FileHandleReadOnly && FileHandleWriteOnly && FileHandleExecuteOnly) + if (!skip(FileHandleReadOnly && FileHandleWriteOnly && FileHandleExecuteOnly, "Missing one or more file handles\n")) { FileSectionViewPermissionCheck(FileHandleReadOnly, FileHandleWriteOnly, FileHandleExecuteOnly); SimpleErrorChecks(FileHandleReadOnly, FileHandleWriteOnly, FileHandleExecuteOnly); Modified: trunk/rostests/kmtests/ntos_mm/ZwMapViewOfSection.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/kmtests/ntos_mm/ZwMapView…
============================================================================== --- trunk/rostests/kmtests/ntos_mm/ZwMapViewOfSection.c [iso-8859-1] (original) +++ trunk/rostests/kmtests/ntos_mm/ZwMapViewOfSection.c [iso-8859-1] Mon Apr 17 20:37:26 2017 @@ -81,7 +81,7 @@ ok_eq_hex(Status, STATUS_SUCCESS); ok_eq_ulongptr(IoStatusBlock.Information, FILE_CREATED); ok(*WriteOnlyFile != NULL, "WriteOnlyFile is NULL\n"); - if (*WriteOnlyFile) + if (!skip(*WriteOnlyFile != NULL, "No WriteOnlyFile\n")) { FileOffset.QuadPart = 0; Status = ZwWriteFile(*WriteOnlyFile, NULL, NULL, NULL, &IoStatusBlock, (PVOID)TestString, TestStringSize, &FileOffset, NULL);
7 years, 6 months
1
0
0
0
[tfaber] 74360: [WIN32K] Fix automatic resolution change when resizing the VirtualBox window. Based on a patch by Ismael Ferreras Morezuelas. - Provide a function, PDEVOBJ_vRefreshModeList, to relo...
by tfaber@svn.reactos.org
Author: tfaber Date: Mon Apr 17 20:25:55 2017 New Revision: 74360 URL:
http://svn.reactos.org/svn/reactos?rev=74360&view=rev
Log: [WIN32K] Fix automatic resolution change when resizing the VirtualBox window. Based on a patch by Ismael Ferreras Morezuelas. - Provide a function, PDEVOBJ_vRefreshModeList, to reload the list of display modes - Call PDEVOBJ_vRefreshModeList from UserEnumDisplaySettings to get an updated list of modes each time CORE-6742 #resolve Modified: trunk/reactos/win32ss/gdi/eng/device.h trunk/reactos/win32ss/gdi/eng/pdevobj.c trunk/reactos/win32ss/user/ntuser/display.c Modified: trunk/reactos/win32ss/gdi/eng/device.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/eng/device.h?r…
============================================================================== --- trunk/reactos/win32ss/gdi/eng/device.h [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/eng/device.h [iso-8859-1] Mon Apr 17 20:25:55 2017 @@ -2,6 +2,11 @@ #pragma once #define TAG_GDEV 'gdev' + +VOID +NTAPI +PDEVOBJ_vRefreshModeList( + PPDEVOBJ ppdev); extern PGRAPHICS_DEVICE gpPrimaryGraphicsDevice; extern PGRAPHICS_DEVICE gpVgaGraphicsDevice; Modified: trunk/reactos/win32ss/gdi/eng/pdevobj.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/eng/pdevobj.c?…
============================================================================== --- trunk/reactos/win32ss/gdi/eng/pdevobj.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/eng/pdevobj.c [iso-8859-1] Mon Apr 17 20:25:55 2017 @@ -256,6 +256,45 @@ DPRINT("PDEVOBJ_pSurface() returning %p\n", ppdev->pSurface); return ppdev->pSurface; +} + +VOID +NTAPI +PDEVOBJ_vRefreshModeList( + PPDEVOBJ ppdev) +{ + PGRAPHICS_DEVICE pGraphicsDevice; + PDEVMODEINFO pdminfo, pdmiNext; + DEVMODEW dmDefault; + + /* Lock the PDEV */ + EngAcquireSemaphore(ppdev->hsemDevLock); + + pGraphicsDevice = ppdev->pGraphicsDevice; + + /* Remember our default mode */ + dmDefault = *pGraphicsDevice->pDevModeList[pGraphicsDevice->iDefaultMode].pdm; + + /* Clear out the modes */ + for (pdminfo = pGraphicsDevice->pdevmodeInfo; + pdminfo; + pdminfo = pdmiNext) + { + pdmiNext = pdminfo->pdmiNext; + ExFreePoolWithTag(pdminfo, GDITAG_DEVMODE); + } + pGraphicsDevice->pdevmodeInfo = NULL; + ExFreePoolWithTag(pGraphicsDevice->pDevModeList, GDITAG_GDEVICE); + pGraphicsDevice->pDevModeList = NULL; + + /* Now re-populate the list */ + if (!EngpPopulateDeviceModeList(pGraphicsDevice, &dmDefault)) + { + DPRINT1("FIXME: EngpPopulateDeviceModeList failed, we just destroyed a perfectly good mode list\n"); + } + + /* Unlock PDEV */ + EngReleaseSemaphore(ppdev->hsemDevLock); } PDEVMODEW Modified: trunk/reactos/win32ss/user/ntuser/display.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/displa…
============================================================================== --- trunk/reactos/win32ss/user/ntuser/display.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/display.c [iso-8859-1] Mon Apr 17 20:25:55 2017 @@ -463,19 +463,27 @@ PGRAPHICS_DEVICE pGraphicsDevice; PDEVMODEENTRY pdmentry; ULONG i, iFoundMode; + PPDEVOBJ ppdev; TRACE("Enter UserEnumDisplaySettings('%wZ', %lu)\n", pustrDevice, iModeNum); /* Ask GDI for the GRAPHICS_DEVICE */ pGraphicsDevice = EngpFindGraphicsDevice(pustrDevice, 0, 0); - - if (!pGraphicsDevice) + ppdev = EngpGetPDEV(pustrDevice); + + if (!pGraphicsDevice || !ppdev) { /* No device found */ ERR("No device found!\n"); return STATUS_INVALID_PARAMETER_1; } + + /* let's politely ask the driver for an updated mode list, + just in case there's something new in there (vbox) */ + + PDEVOBJ_vRefreshModeList(ppdev); + PDEVOBJ_vRelease(ppdev); iFoundMode = 0; for (i = 0; i < pGraphicsDevice->cDevModes; i++)
7 years, 6 months
1
0
0
0
[tfaber] 74359: [WIN32K:ENG] - Split populating the display mode list out from EngpRegisterGraphicsDevice, into its own function, EngpPopulateDeviceModeList. Based on a patch by Ismael Ferreras Mor...
by tfaber@svn.reactos.org
Author: tfaber Date: Mon Apr 17 19:44:32 2017 New Revision: 74359 URL:
http://svn.reactos.org/svn/reactos?rev=74359&view=rev
Log: [WIN32K:ENG] - Split populating the display mode list out from EngpRegisterGraphicsDevice, into its own function, EngpPopulateDeviceModeList. Based on a patch by Ismael Ferreras Morezuelas. CORE-6742 Modified: trunk/reactos/win32ss/gdi/eng/device.c trunk/reactos/win32ss/gdi/eng/device.h Modified: trunk/reactos/win32ss/gdi/eng/device.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/eng/device.c?r…
============================================================================== --- trunk/reactos/win32ss/gdi/eng/device.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/eng/device.c [iso-8859-1] Mon Apr 17 19:44:32 2017 @@ -30,99 +30,22 @@ return STATUS_SUCCESS; } - -PGRAPHICS_DEVICE -NTAPI -EngpRegisterGraphicsDevice( - _In_ PUNICODE_STRING pustrDeviceName, - _In_ PUNICODE_STRING pustrDiplayDrivers, - _In_ PUNICODE_STRING pustrDescription, +BOOLEAN +EngpPopulateDeviceModeList( + _Inout_ PGRAPHICS_DEVICE pGraphicsDevice, _In_ PDEVMODEW pdmDefault) { - PGRAPHICS_DEVICE pGraphicsDevice; - PDEVICE_OBJECT pDeviceObject; - PFILE_OBJECT pFileObject; - NTSTATUS Status; PWSTR pwsz; - ULONG i, cj, cModes = 0; - SIZE_T cjWritten; - BOOL bEnable = TRUE; + PLDEVOBJ pldev; PDEVMODEINFO pdminfo; PDEVMODEW pdm, pdmEnd; - PLDEVOBJ pldev; + ULONG i, cModes = 0; BOOLEAN bModeMatch = FALSE; - TRACE("EngpRegisterGraphicsDevice(%wZ)\n", pustrDeviceName); - - /* Allocate a GRAPHICS_DEVICE structure */ - pGraphicsDevice = ExAllocatePoolWithTag(PagedPool, - sizeof(GRAPHICS_DEVICE), - GDITAG_GDEVICE); - if (!pGraphicsDevice) - { - ERR("ExAllocatePoolWithTag failed\n"); - return NULL; - } - - /* Try to open the driver */ - Status = IoGetDeviceObjectPointer(pustrDeviceName, - FILE_READ_DATA | FILE_WRITE_DATA, - &pFileObject, - &pDeviceObject); - if (!NT_SUCCESS(Status)) - { - ERR("Could not open driver %wZ, 0x%lx\n", pustrDeviceName, Status); - ExFreePoolWithTag(pGraphicsDevice, GDITAG_GDEVICE); - return NULL; - } - - /* Enable the device */ - EngFileWrite(pFileObject, &bEnable, sizeof(BOOL), &cjWritten); - - /* Copy the device and file object pointers */ - pGraphicsDevice->DeviceObject = pDeviceObject; - pGraphicsDevice->FileObject = pFileObject; - - /* Copy device name */ - RtlStringCbCopyNW(pGraphicsDevice->szNtDeviceName, - sizeof(pGraphicsDevice->szNtDeviceName), - pustrDeviceName->Buffer, - pustrDeviceName->Length); - - /* Create a win device name (FIXME: virtual devices!) */ - swprintf(pGraphicsDevice->szWinDeviceName, L"\\\\.\\DISPLAY%d", (int)giDevNum); - - /* Allocate a buffer for the strings */ - cj = pustrDiplayDrivers->Length + pustrDescription->Length + sizeof(WCHAR); - pwsz = ExAllocatePoolWithTag(PagedPool, cj, GDITAG_DRVSUP); - if (!pwsz) - { - ERR("Could not allocate string buffer\n"); - ASSERT(FALSE); // FIXME - ExFreePoolWithTag(pGraphicsDevice, GDITAG_GDEVICE); - return NULL; - } - - /* Copy display driver names */ - pGraphicsDevice->pDiplayDrivers = pwsz; - RtlCopyMemory(pGraphicsDevice->pDiplayDrivers, - pustrDiplayDrivers->Buffer, - pustrDiplayDrivers->Length); - - /* Copy description */ - pGraphicsDevice->pwszDescription = pwsz + pustrDiplayDrivers->Length / sizeof(WCHAR); - RtlCopyMemory(pGraphicsDevice->pwszDescription, - pustrDescription->Buffer, - pustrDescription->Length); - pGraphicsDevice->pwszDescription[pustrDescription->Length/sizeof(WCHAR)] = 0; - - /* Initialize the pdevmodeInfo list and default index */ - pGraphicsDevice->pdevmodeInfo = NULL; - pGraphicsDevice->iDefaultMode = 0; - pGraphicsDevice->iCurrentMode = 0; - - // FIXME: initialize state flags - pGraphicsDevice->StateFlags = 0; + ASSERT(pGraphicsDevice->pdevmodeInfo == NULL); + ASSERT(pGraphicsDevice->pDevModeList == NULL); + + pwsz = pGraphicsDevice->pDiplayDrivers; /* Loop through the driver names * This is a REG_MULTI_SZ string */ @@ -138,7 +61,7 @@ } /* Get the mode list from the driver */ - pdminfo = LDEVOBJ_pdmiGetModes(pldev, pDeviceObject); + pdminfo = LDEVOBJ_pdmiGetModes(pldev, pGraphicsDevice->DeviceObject); if (!pdminfo) { ERR("Could not get mode list for '%ls'\n", pwsz); @@ -170,8 +93,7 @@ if (!pGraphicsDevice->pdevmodeInfo || cModes == 0) { ERR("No devmodes\n"); - ExFreePoolWithTag(pGraphicsDevice, GDITAG_GDEVICE); - return NULL; + return FALSE; } /* Allocate an index buffer */ @@ -182,8 +104,7 @@ if (!pGraphicsDevice->pDevModeList) { ERR("No devmode list\n"); - ExFreePoolWithTag(pGraphicsDevice, GDITAG_GDEVICE); - return NULL; + return FALSE; } TRACE("Looking for mode %lux%lux%lu(%lu Hz)\n", @@ -232,7 +153,106 @@ pGraphicsDevice->pDevModeList[i].pdm = pdm; i++; } - } + } + return TRUE; +} + +PGRAPHICS_DEVICE +NTAPI +EngpRegisterGraphicsDevice( + _In_ PUNICODE_STRING pustrDeviceName, + _In_ PUNICODE_STRING pustrDiplayDrivers, + _In_ PUNICODE_STRING pustrDescription, + _In_ PDEVMODEW pdmDefault) +{ + PGRAPHICS_DEVICE pGraphicsDevice; + PDEVICE_OBJECT pDeviceObject; + PFILE_OBJECT pFileObject; + NTSTATUS Status; + PWSTR pwsz; + ULONG cj; + SIZE_T cjWritten; + BOOL bEnable = TRUE; + + TRACE("EngpRegisterGraphicsDevice(%wZ)\n", pustrDeviceName); + + /* Allocate a GRAPHICS_DEVICE structure */ + pGraphicsDevice = ExAllocatePoolWithTag(PagedPool, + sizeof(GRAPHICS_DEVICE), + GDITAG_GDEVICE); + if (!pGraphicsDevice) + { + ERR("ExAllocatePoolWithTag failed\n"); + return NULL; + } + + /* Try to open the driver */ + Status = IoGetDeviceObjectPointer(pustrDeviceName, + FILE_READ_DATA | FILE_WRITE_DATA, + &pFileObject, + &pDeviceObject); + if (!NT_SUCCESS(Status)) + { + ERR("Could not open driver %wZ, 0x%lx\n", pustrDeviceName, Status); + ExFreePoolWithTag(pGraphicsDevice, GDITAG_GDEVICE); + return NULL; + } + + /* Enable the device */ + EngFileWrite(pFileObject, &bEnable, sizeof(BOOL), &cjWritten); + + /* Copy the device and file object pointers */ + pGraphicsDevice->DeviceObject = pDeviceObject; + pGraphicsDevice->FileObject = pFileObject; + + /* Copy device name */ + RtlStringCbCopyNW(pGraphicsDevice->szNtDeviceName, + sizeof(pGraphicsDevice->szNtDeviceName), + pustrDeviceName->Buffer, + pustrDeviceName->Length); + + /* Create a win device name (FIXME: virtual devices!) */ + swprintf(pGraphicsDevice->szWinDeviceName, L"\\\\.\\DISPLAY%d", (int)giDevNum); + + /* Allocate a buffer for the strings */ + cj = pustrDiplayDrivers->Length + pustrDescription->Length + sizeof(WCHAR); + pwsz = ExAllocatePoolWithTag(PagedPool, cj, GDITAG_DRVSUP); + if (!pwsz) + { + ERR("Could not allocate string buffer\n"); + ASSERT(FALSE); // FIXME + ExFreePoolWithTag(pGraphicsDevice, GDITAG_GDEVICE); + return NULL; + } + + /* Copy display driver names */ + pGraphicsDevice->pDiplayDrivers = pwsz; + RtlCopyMemory(pGraphicsDevice->pDiplayDrivers, + pustrDiplayDrivers->Buffer, + pustrDiplayDrivers->Length); + + /* Copy description */ + pGraphicsDevice->pwszDescription = pwsz + pustrDiplayDrivers->Length / sizeof(WCHAR); + RtlCopyMemory(pGraphicsDevice->pwszDescription, + pustrDescription->Buffer, + pustrDescription->Length); + pGraphicsDevice->pwszDescription[pustrDescription->Length/sizeof(WCHAR)] = 0; + + /* Initialize the pdevmodeInfo list and default index */ + pGraphicsDevice->pdevmodeInfo = NULL; + pGraphicsDevice->iDefaultMode = 0; + pGraphicsDevice->iCurrentMode = 0; + + // FIXME: initialize state flags + pGraphicsDevice->StateFlags = 0; + + /* Create the mode list */ + pGraphicsDevice->pDevModeList = NULL; + if (!EngpPopulateDeviceModeList(pGraphicsDevice, pdmDefault)) + { + ExFreePoolWithTag(pGraphicsDevice, GDITAG_GDEVICE); + return NULL; + } /* Lock loader */ EngAcquireSemaphore(ghsemGraphicsDeviceList); @@ -250,7 +270,7 @@ /* Unlock loader */ EngReleaseSemaphore(ghsemGraphicsDeviceList); - TRACE("Prepared %lu modes for %ls\n", cModes, pGraphicsDevice->pwszDescription); + TRACE("Prepared %lu modes for %ls\n", pGraphicsDevice->cDevModes, pGraphicsDevice->pwszDescription); return pGraphicsDevice; } Modified: trunk/reactos/win32ss/gdi/eng/device.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/eng/device.h?r…
============================================================================== --- trunk/reactos/win32ss/gdi/eng/device.h [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/eng/device.h [iso-8859-1] Mon Apr 17 19:44:32 2017 @@ -29,6 +29,11 @@ _In_ PUNICODE_STRING pustrDescription, _In_ PDEVMODEW pdmDefault); +BOOLEAN +EngpPopulateDeviceModeList( + _Inout_ PGRAPHICS_DEVICE pGraphicsDevice, + _In_ PDEVMODEW pdmDefault); + INIT_FUNCTION NTSTATUS NTAPI
7 years, 6 months
1
0
0
0
[tfaber] 74358: [NTOS:CC] - Respect the TruncateSize parameter in CcUninitializeCacheMap. Avoids "freeing dirty VACB" messages for cache views beyond the end of the file. CORE-12893 #resolve
by tfaber@svn.reactos.org
Author: tfaber Date: Mon Apr 17 18:37:12 2017 New Revision: 74358 URL:
http://svn.reactos.org/svn/reactos?rev=74358&view=rev
Log: [NTOS:CC] - Respect the TruncateSize parameter in CcUninitializeCacheMap. Avoids "freeing dirty VACB" messages for cache views beyond the end of the file. CORE-12893 #resolve Modified: trunk/reactos/ntoskrnl/cc/fs.c Modified: trunk/reactos/ntoskrnl/cc/fs.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/cc/fs.c?rev=74358…
============================================================================== --- trunk/reactos/ntoskrnl/cc/fs.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/cc/fs.c [iso-8859-1] Mon Apr 17 18:37:12 2017 @@ -286,13 +286,34 @@ IN PCACHE_UNINITIALIZE_EVENT UninitializeCompleteEvent OPTIONAL) { NTSTATUS Status; + PROS_SHARED_CACHE_MAP SharedCacheMap; + KIRQL OldIrql; CCTRACE(CC_API_DEBUG, "FileObject=%p TruncateSize=%p UninitializeCompleteEvent=%p\n", FileObject, TruncateSize, UninitializeCompleteEvent); + if (TruncateSize != NULL && + FileObject->SectionObjectPointer != NULL && + FileObject->SectionObjectPointer->SharedCacheMap != NULL) + { + SharedCacheMap = FileObject->SectionObjectPointer->SharedCacheMap; + KeAcquireSpinLock(&SharedCacheMap->CacheMapLock, &OldIrql); + if (SharedCacheMap->FileSize.QuadPart > TruncateSize->QuadPart) + { + SharedCacheMap->FileSize = *TruncateSize; + } + KeReleaseSpinLock(&SharedCacheMap->CacheMapLock, OldIrql); + CcPurgeCacheSection(FileObject->SectionObjectPointer, + TruncateSize, + 0, + FALSE); + } + Status = CcRosReleaseFileCache(FileObject); if (UninitializeCompleteEvent) + { KeSetEvent(&UninitializeCompleteEvent->Event, IO_NO_INCREMENT, FALSE); + } return NT_SUCCESS(Status); }
7 years, 6 months
1
0
0
0
[tfaber] 74357: [NTOS:CC] - Simplify CcSetFileSizes by using CcPurgeCacheSection CORE-12893
by tfaber@svn.reactos.org
Author: tfaber Date: Mon Apr 17 18:13:17 2017 New Revision: 74357 URL:
http://svn.reactos.org/svn/reactos?rev=74357&view=rev
Log: [NTOS:CC] - Simplify CcSetFileSizes by using CcPurgeCacheSection CORE-12893 Modified: trunk/reactos/ntoskrnl/cc/fs.c Modified: trunk/reactos/ntoskrnl/cc/fs.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/cc/fs.c?rev=74357…
============================================================================== --- trunk/reactos/ntoskrnl/cc/fs.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/cc/fs.c [iso-8859-1] Mon Apr 17 18:13:17 2017 @@ -225,10 +225,6 @@ { KIRQL oldirql; PROS_SHARED_CACHE_MAP SharedCacheMap; - PLIST_ENTRY current_entry; - PROS_VACB current; - LIST_ENTRY FreeListHead; - NTSTATUS Status; CCTRACE(CC_API_DEBUG, "FileObject=%p FileSizes=%p\n", FileObject, FileSizes); @@ -251,63 +247,16 @@ if (FileSizes->AllocationSize.QuadPart < SharedCacheMap->SectionSize.QuadPart) { - InitializeListHead(&FreeListHead); - KeAcquireGuardedMutex(&ViewLock); - KeAcquireSpinLock(&SharedCacheMap->CacheMapLock, &oldirql); - - current_entry = SharedCacheMap->CacheMapVacbListHead.Flink; - while (current_entry != &SharedCacheMap->CacheMapVacbListHead) - { - current = CONTAINING_RECORD(current_entry, - ROS_VACB, - CacheMapVacbListEntry); - current_entry = current_entry->Flink; - if (current->FileOffset.QuadPart >= FileSizes->AllocationSize.QuadPart) - { - if ((current->ReferenceCount == 0) || ((current->ReferenceCount == 1) && current->Dirty)) - { - RemoveEntryList(¤t->CacheMapVacbListEntry); - RemoveEntryList(¤t->VacbLruListEntry); - if (current->Dirty) - { - RemoveEntryList(¤t->DirtyVacbListEntry); - DirtyPageCount -= VACB_MAPPING_GRANULARITY / PAGE_SIZE; - } - InsertHeadList(&FreeListHead, ¤t->CacheMapVacbListEntry); - } - else - { - DPRINT1("Someone has referenced a VACB behind the new size.\n"); - KeBugCheck(CACHE_MANAGER); - } - } - } - - SharedCacheMap->SectionSize = FileSizes->AllocationSize; - SharedCacheMap->FileSize = FileSizes->FileSize; - KeReleaseSpinLock(&SharedCacheMap->CacheMapLock, oldirql); - KeReleaseGuardedMutex(&ViewLock); - - current_entry = FreeListHead.Flink; - while(current_entry != &FreeListHead) - { - current = CONTAINING_RECORD(current_entry, ROS_VACB, CacheMapVacbListEntry); - current_entry = current_entry->Flink; - Status = CcRosInternalFreeVacb(current); - if (!NT_SUCCESS(Status)) - { - DPRINT1("CcRosInternalFreeVacb failed, status = %x\n", Status); - KeBugCheck(CACHE_MANAGER); - } - } - } - else - { - KeAcquireSpinLock(&SharedCacheMap->CacheMapLock, &oldirql); - SharedCacheMap->SectionSize = FileSizes->AllocationSize; - SharedCacheMap->FileSize = FileSizes->FileSize; - KeReleaseSpinLock(&SharedCacheMap->CacheMapLock, oldirql); - } + CcPurgeCacheSection(FileObject->SectionObjectPointer, + &FileSizes->AllocationSize, + 0, + FALSE); + } + + KeAcquireSpinLock(&SharedCacheMap->CacheMapLock, &oldirql); + SharedCacheMap->SectionSize = FileSizes->AllocationSize; + SharedCacheMap->FileSize = FileSizes->FileSize; + KeReleaseSpinLock(&SharedCacheMap->CacheMapLock, oldirql); } /*
7 years, 6 months
1
0
0
0
← Newer
1
...
5
6
7
8
9
10
11
...
18
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
Results per page:
10
25
50
100
200