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
August 2016
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
20 participants
462 discussions
Start a n
N
ew thread
[dchapyshev] 72168: [INPUT] - Implement editing input methods - Marking default layout - Other bugfixes
by dchapyshev@svn.reactos.org
Author: dchapyshev Date: Tue Aug 9 18:26:43 2016 New Revision: 72168 URL:
http://svn.reactos.org/svn/reactos?rev=72168&view=rev
Log: [INPUT] - Implement editing input methods - Marking default layout - Other bugfixes Modified: trunk/reactos/dll/cpl/input_new/edit_dialog.c trunk/reactos/dll/cpl/input_new/input_list.c trunk/reactos/dll/cpl/input_new/input_list.h trunk/reactos/dll/cpl/input_new/key_settings_dialog.c trunk/reactos/dll/cpl/input_new/lang/bg-BG.rc trunk/reactos/dll/cpl/input_new/lang/cs-CZ.rc trunk/reactos/dll/cpl/input_new/lang/de-DE.rc trunk/reactos/dll/cpl/input_new/lang/el-GR.rc trunk/reactos/dll/cpl/input_new/lang/en-US.rc trunk/reactos/dll/cpl/input_new/lang/es-ES.rc trunk/reactos/dll/cpl/input_new/lang/fr-FR.rc trunk/reactos/dll/cpl/input_new/lang/he-IL.rc trunk/reactos/dll/cpl/input_new/lang/it-IT.rc trunk/reactos/dll/cpl/input_new/lang/no-NO.rc trunk/reactos/dll/cpl/input_new/lang/pl-PL.rc trunk/reactos/dll/cpl/input_new/lang/pt-BR.rc trunk/reactos/dll/cpl/input_new/lang/ro-RO.rc trunk/reactos/dll/cpl/input_new/lang/ru-RU.rc trunk/reactos/dll/cpl/input_new/lang/sk-SK.rc trunk/reactos/dll/cpl/input_new/lang/sq-AL.rc trunk/reactos/dll/cpl/input_new/lang/tr-TR.rc trunk/reactos/dll/cpl/input_new/lang/uk-UA.rc trunk/reactos/dll/cpl/input_new/lang/zh-CN.rc trunk/reactos/dll/cpl/input_new/lang/zh-TW.rc trunk/reactos/dll/cpl/input_new/settings_page.c Modified: trunk/reactos/dll/cpl/input_new/edit_dialog.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/input_new/edit_dia…
============================================================================== --- trunk/reactos/dll/cpl/input_new/edit_dialog.c [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/input_new/edit_dialog.c [iso-8859-1] Tue Aug 9 18:26:43 2016 @@ -6,29 +6,83 @@ */ #include "input.h" +#include "locale_list.h" +#include "input_list.h" INT_PTR CALLBACK -EditDialogProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) +EditDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { UNREFERENCED_PARAMETER(lParam); switch (uMsg) { case WM_INITDIALOG: - break; + { + LAYOUT_LIST_NODE *pCurrentLayout; + INPUT_LIST_NODE *pInput; + HWND hwndList; + + pInput = (INPUT_LIST_NODE*) lParam; + + if (pInput == NULL) + return TRUE; + + SetWindowLongPtrW(hwndDlg, GWLP_USERDATA, (LONG_PTR) pInput); + + SetWindowTextW(GetDlgItem(hwndDlg, IDC_INPUT_LANG_STR), pInput->pLocale->pszName); + + hwndList = GetDlgItem(hwndDlg, IDC_KB_LAYOUT_IME_COMBO); + + for (pCurrentLayout = LayoutList_GetFirst(); + pCurrentLayout != NULL; + pCurrentLayout = pCurrentLayout->pNext) + { + INT iItemIndex; + + iItemIndex = ComboBox_AddString(hwndList, pCurrentLayout->pszName); + ComboBox_SetItemData(hwndList, iItemIndex, pCurrentLayout); + } + + ComboBox_SelectString(hwndList, 0, pInput->pLayout->pszName); + } + break; case WM_COMMAND: { switch (LOWORD(wParam)) { case IDOK: - EndDialog(hDlg, LOWORD(wParam)); - break; + { + INPUT_LIST_NODE *pInput; + HWND hwndList; + + hwndList = GetDlgItem(hwndDlg, IDC_KB_LAYOUT_IME_COMBO); + + pInput = (INPUT_LIST_NODE*) GetWindowLongPtrW(hwndDlg, GWLP_USERDATA); + + if (pInput != NULL) + { + LAYOUT_LIST_NODE *pNewLayout; + + pNewLayout = (LAYOUT_LIST_NODE*)ComboBox_GetItemData(hwndList, + ComboBox_GetCurSel(hwndList)); + if (pNewLayout != NULL) + { + pInput->pLayout = pNewLayout; + pInput->wFlags |= INPUT_LIST_NODE_FLAG_EDITED; + } + } + + EndDialog(hwndDlg, LOWORD(wParam)); + } + break; case IDCANCEL: - EndDialog(hDlg, LOWORD(wParam)); - break; + { + EndDialog(hwndDlg, LOWORD(wParam)); + } + break; } } break; Modified: trunk/reactos/dll/cpl/input_new/input_list.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/input_new/input_li…
============================================================================== --- trunk/reactos/dll/cpl/input_new/input_list.c [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/input_new/input_list.c [iso-8859-1] Tue Aug 9 18:26:43 2016 @@ -215,28 +215,37 @@ } } - if (pNode->dwFlags & INPUT_LIST_NODE_FLAG_ADDED) + if ((pNode->wFlags & INPUT_LIST_NODE_FLAG_ADDED) || + (pNode->wFlags & INPUT_LIST_NODE_FLAG_EDITED)) { pNode->hkl = LoadKeyboardLayoutW(szPreload, KLF_SUBSTITUTE_OK | KLF_NOTELLSHELL); } } +/* + * Writes any changes in input methods to the registry + */ VOID InputList_Process(VOID) { INPUT_LIST_NODE *pCurrent; DWORD dwIndex; - /* Process deleted input methods */ + /* Process deleted and edited input methods */ for (pCurrent = _InputList; pCurrent != NULL; pCurrent = pCurrent->pNext) { - if (!(pCurrent->dwFlags & INPUT_LIST_NODE_FLAG_DELETED)) - continue; - - if (UnloadKeyboardLayout(pCurrent->hkl)) - { - InputList_RemoveNode(pCurrent); + if ((pCurrent->wFlags & INPUT_LIST_NODE_FLAG_DELETED) || + (pCurrent->wFlags & INPUT_LIST_NODE_FLAG_EDITED)) + { + if (UnloadKeyboardLayout(pCurrent->hkl)) + { + /* Only unload the edited input method, but does not delete it from the list */ + if (!(pCurrent->wFlags & INPUT_LIST_NODE_FLAG_EDITED)) + { + InputList_RemoveNode(pCurrent); + } + } } } @@ -245,7 +254,7 @@ /* Find default input method */ for (pCurrent = _InputList; pCurrent != NULL; pCurrent = pCurrent->pNext) { - if (pCurrent->dwFlags & INPUT_LIST_NODE_FLAG_DEFAULT) + if (pCurrent->wFlags & INPUT_LIST_NODE_FLAG_DEFAULT) { InputList_AddInputMethodToUserRegistry(1, pCurrent); break; @@ -273,7 +282,7 @@ for (pCurrent = _InputList; pCurrent != NULL; pCurrent = pCurrent->pNext) { - if (pCurrent->dwFlags & INPUT_LIST_NODE_FLAG_DEFAULT) + if (pCurrent->wFlags & INPUT_LIST_NODE_FLAG_DEFAULT) continue; InputList_AddInputMethodToUserRegistry(dwIndex, pCurrent); @@ -283,7 +292,7 @@ } -VOID +BOOL InputList_Add(LOCALE_LIST_NODE *pLocale, LAYOUT_LIST_NODE *pLayout) { WCHAR szIndicator[MAX_STR_LEN]; @@ -291,12 +300,20 @@ if (pLocale == NULL || pLayout == NULL) { - return; + return FALSE; + } + + for (pInput = _InputList; pInput != NULL; pInput = pInput->pNext) + { + if (pInput->pLocale == pLocale && pInput->pLayout == pLayout) + { + return FALSE; + } } pInput = InputList_AppendNode(); - pInput->dwFlags |= INPUT_LIST_NODE_FLAG_ADDED; + pInput->wFlags = INPUT_LIST_NODE_FLAG_ADDED; pInput->pLocale = pLocale; pInput->pLayout = pLayout; @@ -314,6 +331,8 @@ pInput->pszIndicator = DublicateString(szIndicator); } } + + return TRUE; } @@ -329,34 +348,56 @@ { if (pCurrent == pNode) { - pCurrent->dwFlags |= INPUT_LIST_NODE_FLAG_DEFAULT; + pCurrent->wFlags |= INPUT_LIST_NODE_FLAG_DEFAULT; } else { - pCurrent->dwFlags &= ~INPUT_LIST_NODE_FLAG_DEFAULT; - } - } -} - - + pCurrent->wFlags &= ~INPUT_LIST_NODE_FLAG_DEFAULT; + } + } +} + + +/* + * It marks the input method for deletion, but does not delete it directly. + * To apply the changes using InputList_Process() + */ VOID InputList_Remove(INPUT_LIST_NODE *pNode) { + BOOL bRemoveNode = FALSE; + if (pNode == NULL) return; - pNode->dwFlags |= INPUT_LIST_NODE_FLAG_DELETED; - - if (pNode->dwFlags & INPUT_LIST_NODE_FLAG_DEFAULT) + if (pNode->wFlags & INPUT_LIST_NODE_FLAG_ADDED) + { + /* + * If the input method has been added to the list, but not yet written + * in the registry, then simply remove it from the list + */ + bRemoveNode = TRUE; + } + else + { + pNode->wFlags = INPUT_LIST_NODE_FLAG_DELETED; + } + + if (pNode->wFlags & INPUT_LIST_NODE_FLAG_DEFAULT) { if (pNode->pNext != NULL) { - pNode->pNext->dwFlags |= INPUT_LIST_NODE_FLAG_DEFAULT; + pNode->pNext->wFlags |= INPUT_LIST_NODE_FLAG_DEFAULT; } else if (pNode->pPrev != NULL) { - pNode->pPrev->dwFlags |= INPUT_LIST_NODE_FLAG_DEFAULT; - } + pNode->pPrev->wFlags |= INPUT_LIST_NODE_FLAG_DEFAULT; + } + } + + if (bRemoveNode != FALSE) + { + InputList_RemoveNode(pNode); } } @@ -368,7 +409,7 @@ HKL *pLayoutList; iLayoutCount = GetKeyboardLayoutList(0, NULL); - pLayoutList = (HKL*)malloc(iLayoutCount * sizeof(HKL)); + pLayoutList = (HKL*) malloc(iLayoutCount * sizeof(HKL)); if (pLayoutList != NULL) { @@ -403,7 +444,7 @@ if (pInput->hkl == hklDefault) { - pInput->dwFlags |= INPUT_LIST_NODE_FLAG_DEFAULT; + pInput->wFlags |= INPUT_LIST_NODE_FLAG_DEFAULT; } if (GetLocaleInfoW(LOWORD(pInput->pLocale->dwId), Modified: trunk/reactos/dll/cpl/input_new/input_list.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/input_new/input_li…
============================================================================== --- trunk/reactos/dll/cpl/input_new/input_list.h [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/input_new/input_list.h [iso-8859-1] Tue Aug 9 18:26:43 2016 @@ -5,20 +5,20 @@ #include "layout_list.h" -#define INPUT_LIST_NODE_FLAG_EDITED 0x00000001 -#define INPUT_LIST_NODE_FLAG_ADDED 0x00000002 -#define INPUT_LIST_NODE_FLAG_DELETED 0x00000004 -#define INPUT_LIST_NODE_FLAG_DEFAULT 0x00000008 +#define INPUT_LIST_NODE_FLAG_EDITED 0x0001 +#define INPUT_LIST_NODE_FLAG_ADDED 0x0002 +#define INPUT_LIST_NODE_FLAG_DELETED 0x0004 +#define INPUT_LIST_NODE_FLAG_DEFAULT 0x0008 typedef struct _INPUT_LIST_NODE { - DWORD dwFlags; + WORD wFlags; LOCALE_LIST_NODE *pLocale; LAYOUT_LIST_NODE *pLayout; - HKL hkl; + HKL hkl; /* Only for loaded input methods */ WCHAR *pszIndicator; @@ -33,7 +33,7 @@ VOID InputList_Process(VOID); -VOID +BOOL InputList_Add(LOCALE_LIST_NODE *pLocale, LAYOUT_LIST_NODE *pLayout); VOID Modified: trunk/reactos/dll/cpl/input_new/key_settings_dialog.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/input_new/key_sett…
============================================================================== --- trunk/reactos/dll/cpl/input_new/key_settings_dialog.c [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/input_new/key_settings_dialog.c [iso-8859-1] Tue Aug 9 18:26:43 2016 @@ -9,7 +9,43 @@ INT_PTR CALLBACK -KeySettingsDialogProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) +ChangeKeySeqDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) +{ + UNREFERENCED_PARAMETER(lParam); + + switch (uMsg) + { + case WM_INITDIALOG: + { + + } + break; + + case WM_COMMAND: + { + switch (LOWORD(wParam)) + { + case IDOK: + { + EndDialog(hwndDlg, LOWORD(wParam)); + } + break; + + case IDCANCEL: + { + EndDialog(hwndDlg, LOWORD(wParam)); + } + break; + } + } + break; + } + + return FALSE; +} + +INT_PTR CALLBACK +KeySettingsDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { UNREFERENCED_PARAMETER(lParam); @@ -22,13 +58,29 @@ { switch (LOWORD(wParam)) { + case IDC_CHANGE_KEY_SEQ_BTN: + { + if (DialogBoxW(hApplet, + MAKEINTRESOURCEW(IDD_CHANGE_KEY_SEQ), + hwndDlg, + ChangeKeySeqDialogProc) == IDOK) + { + + } + } + break; + case IDOK: - EndDialog(hDlg, LOWORD(wParam)); - break; + { + EndDialog(hwndDlg, LOWORD(wParam)); + } + break; case IDCANCEL: - EndDialog(hDlg, LOWORD(wParam)); - break; + { + EndDialog(hwndDlg, LOWORD(wParam)); + } + break; } } break; Modified: trunk/reactos/dll/cpl/input_new/lang/bg-BG.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/input_new/lang/bg-…
============================================================================== --- trunk/reactos/dll/cpl/input_new/lang/bg-BG.rc [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/input_new/lang/bg-BG.rc [iso-8859-1] Tue Aug 9 18:26:43 2016 @@ -6,10 +6,10 @@ FONT 8, "MS Shell Dlg" BEGIN LTEXT "ÐоÑоÑеÑе избÑаниÑе Ð¾Ñ Ð²Ð°Ñ ÑÑлÑги за вÑеки поÑоÑен в ÑпиÑÑка език.\nÐÑомÑнаÑа на ÑпиÑÑка ÑÑава Ñ âÐÑÐµÐ¼Ð°Ñ Ð²Ð°Ð½Ðµâ и âÐобавÑнеâ.", -1, 9, 6, 238, 25 - CONTROL "TEXT", IDC_KEYLAYOUT_LIST, "SYSLISTVIEW32", WS_BORDER | WS_VSCROLL | WS_TABSTOP | LVS_SORTASCENDING | LVS_REPORT | 0x0000808D, 8, 36, 237, 101 + CONTROL "TEXT", IDC_KEYLAYOUT_LIST, "SYSLISTVIEW32", WS_BORDER | WS_VSCROLL | WS_TABSTOP | LVS_SINGLESEL | LVS_NOSORTHEADER | LVS_SHOWSELALWAYS | LVS_REPORT, 8, 36, 237, 101 PUSHBUTTON "&ÐÑилагане на подÑазбиÑаниÑе", IDC_SET_DEFAULT, 101, 159, 144, 14 PUSHBUTTON "&ÐобавÑне...", IDC_ADD_BUTTON, 27, 142, 70, 14 - PUSHBUTTON "ÐÑе&Ð¼Ð°Ñ Ð²Ð°Ð½Ðµ...", IDC_REMOVE_BUTTON, 101, 142, 70, 14 + PUSHBUTTON "ÐÑе&Ð¼Ð°Ñ Ð²Ð°Ð½Ðµ", IDC_REMOVE_BUTTON, 101, 142, 70, 14 PUSHBUTTON "&СвойÑÑва...", IDC_PROP_BUTTON, 175, 142, 70, 14 GROUPBOX "ÐÑедпоÑиÑаниÑ", -1, 7, 185, 240, 36 PUSHBUTTON "ÐаÑÑÑойка на &клавиÑиÑе...", IDC_KEY_SET_BTN, 14, 198, 110, 14 Modified: trunk/reactos/dll/cpl/input_new/lang/cs-CZ.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/input_new/lang/cs-…
============================================================================== --- trunk/reactos/dll/cpl/input_new/lang/cs-CZ.rc [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/input_new/lang/cs-CZ.rc [iso-8859-1] Tue Aug 9 18:26:43 2016 @@ -11,10 +11,10 @@ FONT 8, "MS Shell Dlg" BEGIN LTEXT "Zvolte služby pro každý vstupnà jazyk v seznamu.\nSeznam lze mÄnit pomocà tlaÄÃtek PÅidat a Odebrat.", -1, 9, 6, 238, 25 - CONTROL "TEXT", IDC_KEYLAYOUT_LIST, "SYSLISTVIEW32", WS_BORDER | WS_VSCROLL | WS_TABSTOP | LVS_SORTASCENDING | LVS_REPORT | 0x0000808D, 8, 36, 237, 101 + CONTROL "TEXT", IDC_KEYLAYOUT_LIST, "SYSLISTVIEW32", WS_BORDER | WS_VSCROLL | WS_TABSTOP | LVS_SINGLESEL | LVS_NOSORTHEADER | LVS_SHOWSELALWAYS | LVS_REPORT, 8, 36, 237, 101 PUSHBUTTON "Nas&tavit výchozÃ", IDC_SET_DEFAULT, 101, 159, 144, 14 PUSHBUTTON "&PÅidat...", IDC_ADD_BUTTON, 27, 142, 70, 14 - PUSHBUTTON "&Odebrat...", IDC_REMOVE_BUTTON, 101, 142, 70, 14 + PUSHBUTTON "&Odebrat", IDC_REMOVE_BUTTON, 101, 142, 70, 14 PUSHBUTTON "&Vlastnosti...", IDC_PROP_BUTTON, 175, 142, 70, 14 GROUPBOX "PÅedvolby", -1, 7, 185, 240, 36 PUSHBUTTON "&Nastavenà kláves...", IDC_KEY_SET_BTN, 14, 198, 110, 14 Modified: trunk/reactos/dll/cpl/input_new/lang/de-DE.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/input_new/lang/de-…
============================================================================== --- trunk/reactos/dll/cpl/input_new/lang/de-DE.rc [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/input_new/lang/de-DE.rc [iso-8859-1] Tue Aug 9 18:26:43 2016 @@ -6,10 +6,10 @@ FONT 8, "MS Shell Dlg" BEGIN LTEXT "Wählen Sie die Dienste aus, die Sie für die Eingabesprachen in der Liste verwenden wollen.\nVerwenden Sie ""Hinzufügen"" und ""Entfernen"", um die Liste zu bearbeiten.", -1, 9, 6, 238, 25 - CONTROL "TEXT", IDC_KEYLAYOUT_LIST, "SYSLISTVIEW32", WS_BORDER | WS_VSCROLL | WS_TABSTOP | LVS_SORTASCENDING | LVS_REPORT | 0x0000808D, 8, 36, 237, 101 + CONTROL "TEXT", IDC_KEYLAYOUT_LIST, "SYSLISTVIEW32", WS_BORDER | WS_VSCROLL | WS_TABSTOP | LVS_SINGLESEL | LVS_NOSORTHEADER | LVS_SHOWSELALWAYS | LVS_REPORT, 8, 36, 237, 101 PUSHBUTTON "&Als Standard", IDC_SET_DEFAULT, 101, 159, 144, 14 PUSHBUTTON "&Hinzufügen...", IDC_ADD_BUTTON, 27, 142, 70, 14 - PUSHBUTTON "Ent&fernen...", IDC_REMOVE_BUTTON, 101, 142, 70, 14 + PUSHBUTTON "Ent&fernen", IDC_REMOVE_BUTTON, 101, 142, 70, 14 PUSHBUTTON "&Eigenschaften...", IDC_PROP_BUTTON, 175, 142, 70, 14 GROUPBOX "Einstellungen", -1, 7, 185, 240, 36 PUSHBUTTON "&Tasteneinstellungen...", IDC_KEY_SET_BTN, 14, 198, 110, 14 Modified: trunk/reactos/dll/cpl/input_new/lang/el-GR.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/input_new/lang/el-…
============================================================================== --- trunk/reactos/dll/cpl/input_new/lang/el-GR.rc [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/input_new/lang/el-GR.rc [iso-8859-1] Tue Aug 9 18:26:43 2016 @@ -6,10 +6,10 @@ FONT 8, "MS Shell Dlg" BEGIN LTEXT "ÎÏιλÎξÏε ÏÎ¹Ï Ï ÏηÏεÏÎ¯ÎµÏ ÏÎ¿Ï Î¸ÎλεÏε για κάθε γλÏÏÏα ειÏαγÏÎ³Î®Ï ÏÎ¿Ï ÎµÎ¼ÏανίζεÏαι ÏÏη λίÏÏα.\nΧÏηÏιμοÏοιήÏÏε Ïα ÎºÎ¿Ï Î¼Ïιά Î ÏοÏθήκη και ÎαÏάÏγηÏη για Ïην ÏÏοÏοÏοίηÏη Î±Ï ÏÎ®Ï ÏÎ·Ï Î»Î¯ÏÏαÏ.", -1, 9, 6, 238, 33 - CONTROL "TEXT", IDC_KEYLAYOUT_LIST, "SYSLISTVIEW32", WS_BORDER | WS_VSCROLL | WS_TABSTOP | LVS_SORTASCENDING | LVS_REPORT | 0x0000808D, 8, 42, 237, 95 + CONTROL "TEXT", IDC_KEYLAYOUT_LIST, "SYSLISTVIEW32", WS_BORDER | WS_VSCROLL | WS_TABSTOP | LVS_SINGLESEL | LVS_NOSORTHEADER | LVS_SHOWSELALWAYS | LVS_REPORT, 8, 42, 237, 95 PUSHBUTTON "&Set Default", IDC_SET_DEFAULT, 101, 159, 144, 14 PUSHBUTTON "Î &ÏοÏθήκη...", IDC_ADD_BUTTON, 27, 142, 70, 14 - PUSHBUTTON "&ÎαÏάÏγηÏη...", IDC_REMOVE_BUTTON, 101, 142, 70, 14 + PUSHBUTTON "&ÎαÏάÏγηÏη", IDC_REMOVE_BUTTON, 101, 142, 70, 14 PUSHBUTTON "&ÎδιÏÏηÏεÏ...", IDC_PROP_BUTTON, 175, 142, 70, 14 GROUPBOX "Î ÏοÏιμήÏειÏ", -1, 7, 185, 240, 36 PUSHBUTTON "&Î¡Ï Î¸Î¼Î¯ÏÎµÎ¹Ï ÏλήκÏÏÏν...", IDC_KEY_SET_BTN, 14, 198, 110, 14 Modified: trunk/reactos/dll/cpl/input_new/lang/en-US.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/input_new/lang/en-…
============================================================================== --- trunk/reactos/dll/cpl/input_new/lang/en-US.rc [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/input_new/lang/en-US.rc [iso-8859-1] Tue Aug 9 18:26:43 2016 @@ -6,10 +6,10 @@ FONT 8, "MS Shell Dlg" BEGIN LTEXT "Select the services that you want for each input language shown in the list.\nUse the Add and Remove buttons to modify this list.", -1, 9, 6, 238, 25 - CONTROL "TEXT", IDC_KEYLAYOUT_LIST, "SYSLISTVIEW32", WS_BORDER | WS_VSCROLL | WS_TABSTOP | LVS_SORTASCENDING | LVS_REPORT | 0x0000808D, 8, 36, 237, 101 + CONTROL "TEXT", IDC_KEYLAYOUT_LIST, "SYSLISTVIEW32", WS_BORDER | WS_VSCROLL | WS_TABSTOP | LVS_SINGLESEL | LVS_NOSORTHEADER | LVS_SHOWSELALWAYS | LVS_REPORT, 8, 36, 237, 101 PUSHBUTTON "&Set Default", IDC_SET_DEFAULT, 101, 159, 144, 14 PUSHBUTTON "A&dd...", IDC_ADD_BUTTON, 27, 142, 70, 14 - PUSHBUTTON "&Remove...", IDC_REMOVE_BUTTON, 101, 142, 70, 14 + PUSHBUTTON "&Remove", IDC_REMOVE_BUTTON, 101, 142, 70, 14 PUSHBUTTON "&Properties...", IDC_PROP_BUTTON, 175, 142, 70, 14 GROUPBOX "Preferences", -1, 7, 185, 240, 36 PUSHBUTTON "&Key Settings...", IDC_KEY_SET_BTN, 14, 198, 110, 14 Modified: trunk/reactos/dll/cpl/input_new/lang/es-ES.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/input_new/lang/es-…
============================================================================== --- trunk/reactos/dll/cpl/input_new/lang/es-ES.rc [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/input_new/lang/es-ES.rc [iso-8859-1] Tue Aug 9 18:26:43 2016 @@ -8,10 +8,10 @@ FONT 8, "MS Shell Dlg" BEGIN LTEXT "Seleccione los servicios que desea para cada idioma mostrado en la lista. Use los botones de Agregar y Quitar para modificar esta lista.", -1, 9, 6, 238, 17 - CONTROL "TEXT", IDC_KEYLAYOUT_LIST, "SYSLISTVIEW32", WS_BORDER | WS_VSCROLL | WS_TABSTOP | LVS_SORTASCENDING | LVS_REPORT | 0x0000808D, 8, 28, 237, 109 + CONTROL "TEXT", IDC_KEYLAYOUT_LIST, "SYSLISTVIEW32", WS_BORDER | WS_VSCROLL | WS_TABSTOP | LVS_SINGLESEL | LVS_NOSORTHEADER | LVS_SHOWSELALWAYS | LVS_REPORT, 8, 28, 237, 109 PUSHBUTTON "Pr&edeterminado", IDC_SET_DEFAULT, 101, 159, 144, 14 PUSHBUTTON "Ag®ar...", IDC_ADD_BUTTON, 27, 142, 70, 14 - PUSHBUTTON "&Quitar...", IDC_REMOVE_BUTTON, 101, 142, 70, 14 + PUSHBUTTON "&Quitar", IDC_REMOVE_BUTTON, 101, 142, 70, 14 PUSHBUTTON "&Propiedades...", IDC_PROP_BUTTON, 175, 142, 70, 14 GROUPBOX "Pre&ferencias ", -1, 7, 185, 240, 36 PUSHBUTTON "C&onfiguración de teclas...", IDC_KEY_SET_BTN, 14, 198, 110, 14 Modified: trunk/reactos/dll/cpl/input_new/lang/fr-FR.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/input_new/lang/fr-…
============================================================================== --- trunk/reactos/dll/cpl/input_new/lang/fr-FR.rc [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/input_new/lang/fr-FR.rc [iso-8859-1] Tue Aug 9 18:26:43 2016 @@ -6,10 +6,10 @@ FONT 8, "MS Shell Dlg" BEGIN LTEXT "Sélectionnez les services que vous désirez pour chaque langue de saisie affichée dans la liste.\nUtilisez les boutons Ajouter et Supprimer pour modifier la liste.", -1, 9, 6, 238, 25 - CONTROL "TEXT", IDC_KEYLAYOUT_LIST, "SYSLISTVIEW32", WS_BORDER | WS_VSCROLL | WS_TABSTOP | LVS_SORTASCENDING | LVS_REPORT | 0x0000808D, 8, 36, 237, 101 + CONTROL "TEXT", IDC_KEYLAYOUT_LIST, "SYSLISTVIEW32", WS_BORDER | WS_VSCROLL | WS_TABSTOP | LVS_SINGLESEL | LVS_NOSORTHEADER | LVS_SHOWSELALWAYS | LVS_REPORT, 8, 36, 237, 101 PUSHBUTTON "Par &défaut", IDC_SET_DEFAULT, 101, 159, 144, 14 PUSHBUTTON "A&jouter...", IDC_ADD_BUTTON, 27, 142, 70, 14 - PUSHBUTTON "Supp&rimer...", IDC_REMOVE_BUTTON, 101, 142, 70, 14 + PUSHBUTTON "Supp&rimer", IDC_REMOVE_BUTTON, 101, 142, 70, 14 PUSHBUTTON "&Propriétés...", IDC_PROP_BUTTON, 175, 142, 70, 14 GROUPBOX "Pré&férences", -1, 7, 185, 240, 36 PUSHBUTTON "Para&mètres des touches...", IDC_KEY_SET_BTN, 14, 198, 110, 14 Modified: trunk/reactos/dll/cpl/input_new/lang/he-IL.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/input_new/lang/he-…
============================================================================== --- trunk/reactos/dll/cpl/input_new/lang/he-IL.rc [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/input_new/lang/he-IL.rc [iso-8859-1] Tue Aug 9 18:26:43 2016 @@ -8,10 +8,10 @@ FONT 8, "MS Shell Dlg" BEGIN LTEXT "Select the services that you want for each input language shown in the list.\nUse the Add and Remove buttons to modify this list.", -1, 9, 6, 238, 25 - CONTROL "TEXT", IDC_KEYLAYOUT_LIST, "SYSLISTVIEW32", WS_BORDER | WS_VSCROLL | WS_TABSTOP | LVS_SORTASCENDING | LVS_REPORT | 0x0000808D, 8, 36, 237, 101 + CONTROL "TEXT", IDC_KEYLAYOUT_LIST, "SYSLISTVIEW32", WS_BORDER | WS_VSCROLL | WS_TABSTOP | LVS_SINGLESEL | LVS_NOSORTHEADER | LVS_SHOWSELALWAYS | LVS_REPORT, 8, 36, 237, 101 PUSHBUTTON "ק××¢ ××ר×רת ××××...", IDC_SET_DEFAULT, 101, 159, 144, 14 PUSHBUTTON "××סף...", IDC_ADD_BUTTON, 27, 142, 70, 14 - PUSHBUTTON "×סר...", IDC_REMOVE_BUTTON, 101, 142, 70, 14 + PUSHBUTTON "×סר", IDC_REMOVE_BUTTON, 101, 142, 70, 14 PUSHBUTTON "××פ×× ×××...", IDC_PROP_BUTTON, 175, 142, 70, 14 GROUPBOX "××¢×פ×ת", -1, 7, 185, 240, 36 PUSHBUTTON "×××ר×ת ×קש××...", IDC_KEY_SET_BTN, 14, 198, 110, 14 Modified: trunk/reactos/dll/cpl/input_new/lang/it-IT.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/input_new/lang/it-…
============================================================================== --- trunk/reactos/dll/cpl/input_new/lang/it-IT.rc [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/input_new/lang/it-IT.rc [iso-8859-1] Tue Aug 9 18:26:43 2016 @@ -6,10 +6,10 @@ FONT 8, "MS Shell Dlg" BEGIN LTEXT "Scegliere i servizi desiderati per ognuna delle lingue nella lista.\nUsare Aggiungi e Rimuovi per modificare la lista.", -1, 9, 6, 238, 17 - CONTROL "TEXT", IDC_KEYLAYOUT_LIST, "SYSLISTVIEW32", WS_BORDER | WS_VSCROLL | WS_TABSTOP | LVS_SORTASCENDING | LVS_REPORT | 0x0000808D, 8, 28, 237, 109 + CONTROL "TEXT", IDC_KEYLAYOUT_LIST, "SYSLISTVIEW32", WS_BORDER | WS_VSCROLL | WS_TABSTOP | LVS_SINGLESEL | LVS_NOSORTHEADER | LVS_SHOWSELALWAYS | LVS_REPORT, 8, 28, 237, 109 PUSHBUTTON "&Predefinito", IDC_SET_DEFAULT, 101, 159, 144, 14 PUSHBUTTON "&Aggiungi...", IDC_ADD_BUTTON, 27, 142, 70, 14 - PUSHBUTTON "&Rimuovi...", IDC_REMOVE_BUTTON, 101, 142, 70, 14 + PUSHBUTTON "&Rimuovi", IDC_REMOVE_BUTTON, 101, 142, 70, 14 PUSHBUTTON "&Proprietà ...", IDC_PROP_BUTTON, 175, 142, 70, 14 GROUPBOX "Preferenze", -1, 7, 185, 240, 36 PUSHBUTTON "&Impostazioni tasti...", IDC_KEY_SET_BTN, 14, 198, 110, 14 Modified: trunk/reactos/dll/cpl/input_new/lang/no-NO.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/input_new/lang/no-…
============================================================================== --- trunk/reactos/dll/cpl/input_new/lang/no-NO.rc [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/input_new/lang/no-NO.rc [iso-8859-1] Tue Aug 9 18:26:43 2016 @@ -6,10 +6,10 @@ FONT 8, "MS Shell Dlg" BEGIN LTEXT "Velg tjenesten som du vil ha for hver inndataspråk som er vist i listen.\nBruk legg til og fjern knappen for å endre denne listen.", -1, 9, 6, 238, 25 - CONTROL "TEKST", IDC_KEYLAYOUT_LIST, "SYSLISTVIEW32", WS_BORDER | WS_VSCROLL | WS_TABSTOP | LVS_SORTASCENDING | LVS_REPORT | 0x0000808D, 8, 36, 237, 101 + CONTROL "TEXT", IDC_KEYLAYOUT_LIST, "SYSLISTVIEW32", WS_BORDER | WS_VSCROLL | WS_TABSTOP | LVS_SINGLESEL | LVS_NOSORTHEADER | LVS_SHOWSELALWAYS | LVS_REPORT, 8, 36, 237, 101 PUSHBUTTON "&Sett Standard", IDC_SET_DEFAULT, 101, 159, 144, 14 PUSHBUTTON "Le&gg til...", IDC_ADD_BUTTON, 27, 142, 70, 14 - PUSHBUTTON "&Fjern...", IDC_REMOVE_BUTTON, 101, 142, 70, 14 + PUSHBUTTON "&Fjern", IDC_REMOVE_BUTTON, 101, 142, 70, 14 PUSHBUTTON "&Egenskaper...", IDC_PROP_BUTTON, 175, 142, 70, 14 GROUPBOX "Innstillinger", -1, 7, 185, 240, 36 PUSHBUTTON "&Tasteinnstillinger...", IDC_KEY_SET_BTN, 14, 198, 110, 14 Modified: trunk/reactos/dll/cpl/input_new/lang/pl-PL.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/input_new/lang/pl-…
============================================================================== --- trunk/reactos/dll/cpl/input_new/lang/pl-PL.rc [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/input_new/lang/pl-PL.rc [iso-8859-1] Tue Aug 9 18:26:43 2016 @@ -14,10 +14,10 @@ FONT 8, "MS Shell Dlg" BEGIN LTEXT "Wybierz usÅugi dla kadego używanego jÄzyka z listy.\nListÄ można modyfikowaÄ przyciskami Dodaj i UsuÅ.", -1, 9, 6, 238, 17 - CONTROL "TEXT", IDC_KEYLAYOUT_LIST, "SYSLISTVIEW32", WS_BORDER | WS_VSCROLL | WS_TABSTOP | LVS_SORTASCENDING | LVS_REPORT | 0x0000808D, 8, 28, 237, 109 + CONTROL "TEXT", IDC_KEYLAYOUT_LIST, "SYSLISTVIEW32", WS_BORDER | WS_VSCROLL | WS_TABSTOP | LVS_SINGLESEL | LVS_NOSORTHEADER | LVS_SHOWSELALWAYS | LVS_REPORT, 8, 28, 237, 109 PUSHBUTTON "&Ustaw domyÅlne", IDC_SET_DEFAULT, 101, 159, 144, 14 PUSHBUTTON "&Dodaj...", IDC_ADD_BUTTON, 27, 142, 70, 14 - PUSHBUTTON "U&suÅ...", IDC_REMOVE_BUTTON, 101, 142, 70, 14 + PUSHBUTTON "U&suÅ", IDC_REMOVE_BUTTON, 101, 142, 70, 14 PUSHBUTTON "&WÅaÅciwoÅci...", IDC_PROP_BUTTON, 175, 142, 70, 14 GROUPBOX "Preferencje", -1, 7, 185, 240, 36 PUSHBUTTON "Us&tawienia klawiszy...", IDC_KEY_SET_BTN, 14, 198, 110, 14 Modified: trunk/reactos/dll/cpl/input_new/lang/pt-BR.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/input_new/lang/pt-…
============================================================================== --- trunk/reactos/dll/cpl/input_new/lang/pt-BR.rc [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/input_new/lang/pt-BR.rc [iso-8859-1] Tue Aug 9 18:26:43 2016 @@ -6,7 +6,7 @@ FONT 8, "MS Shell Dlg" BEGIN LTEXT "Selecione os serviços desejados para cada idioma de entrada mostrado na lista. Use os botões 'Adicionar' e 'Remover' para modificar essa lista.", -1, 9, 6, 238, 25 - CONTROL "TEXT", IDC_KEYLAYOUT_LIST, "SYSLISTVIEW32", WS_BORDER | WS_VSCROLL | WS_TABSTOP | LVS_SORTASCENDING | LVS_REPORT | 0x0000808D, 8, 36, 237, 101 + CONTROL "TEXT", IDC_KEYLAYOUT_LIST, "SYSLISTVIEW32", WS_BORDER | WS_VSCROLL | WS_TABSTOP | LVS_SINGLESEL | LVS_NOSORTHEADER | LVS_SHOWSELALWAYS | LVS_REPORT, 8, 36, 237, 101 PUSHBUTTON "De&finir padrão", IDC_SET_DEFAULT, 101, 159, 144, 14 PUSHBUTTON "&Adicionar...", IDC_ADD_BUTTON, 27, 142, 70, 14 PUSHBUTTON "&Remover", IDC_REMOVE_BUTTON, 101, 142, 70, 14 Modified: trunk/reactos/dll/cpl/input_new/lang/ro-RO.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/input_new/lang/ro-…
============================================================================== --- trunk/reactos/dll/cpl/input_new/lang/ro-RO.rc [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/input_new/lang/ro-RO.rc [iso-8859-1] Tue Aug 9 18:26:43 2016 @@ -8,7 +8,7 @@ FONT 8, "MS Shell Dlg" BEGIN LTEXT "GestionaÈi serviciile aferente limbilor de intrare utilizate în sistem. UtilizaÈi butoanele pentru a aduce modificÄri listei.", -1, 9, 6, 238, 25 - CONTROL "TEXT", IDC_KEYLAYOUT_LIST, "SYSLISTVIEW32", WS_BORDER | WS_VSCROLL | WS_TABSTOP | LVS_SORTASCENDING | LVS_REPORT | 0x0000808D, 8, 36, 237, 101 + CONTROL "TEXT", IDC_KEYLAYOUT_LIST, "SYSLISTVIEW32", WS_BORDER | WS_VSCROLL | WS_TABSTOP | LVS_SINGLESEL | LVS_NOSORTHEADER | LVS_SHOWSELALWAYS | LVS_REPORT, 8, 36, 237, 101 PUSHBUTTON "&RestabileÈte opÈiunile implicite", IDC_SET_DEFAULT, 101, 159, 144, 14 PUSHBUTTON "A&dÄugareâ¦", IDC_ADD_BUTTON, 27, 142, 70, 14 PUSHBUTTON "&EliminÄ", IDC_REMOVE_BUTTON, 101, 142, 70, 14 Modified: trunk/reactos/dll/cpl/input_new/lang/ru-RU.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/input_new/lang/ru-…
============================================================================== --- trunk/reactos/dll/cpl/input_new/lang/ru-RU.rc [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/input_new/lang/ru-RU.rc [iso-8859-1] Tue Aug 9 18:26:43 2016 @@ -6,10 +6,10 @@ FONT 8, "MS Shell Dlg" BEGIN LTEXT "ÐÑбеÑиÑе нÑжнÑе ÑаÑкладки Ð´Ð»Ñ ÐºÐ°Ð¶Ð´Ð¾Ð³Ð¾ ÑзÑка ввода из ÑпиÑка. ÐÐ»Ñ Ð¸Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ ÑпиÑка ÑлÑÐ¶Ð°Ñ ÐºÐ½Ð¾Ð¿ÐºÐ¸ ""ÐобавиÑÑ"" и ""УдалиÑÑ"".", -1, 9, 6, 238, 17 - CONTROL "TEXT", IDC_KEYLAYOUT_LIST, "SYSLISTVIEW32", WS_BORDER | WS_VSCROLL | WS_TABSTOP | LVS_SORTASCENDING | LVS_REPORT | 0x0000808D, 8, 28, 237, 109 + CONTROL "TEXT", IDC_KEYLAYOUT_LIST, "SYSLISTVIEW32", WS_BORDER | WS_VSCROLL | WS_TABSTOP | LVS_SINGLESEL | LVS_NOSORTHEADER | LVS_SHOWSELALWAYS | LVS_REPORT, 8, 28, 237, 109 PUSHBUTTON "УÑ&ÑановиÑÑ Ð¿Ð¾ ÑмолÑаниÑ", IDC_SET_DEFAULT, 101, 159, 144, 14 PUSHBUTTON "&ÐобавиÑÑ...", IDC_ADD_BUTTON, 27, 142, 70, 14 - PUSHBUTTON "&УдалиÑÑ...", IDC_REMOVE_BUTTON, 101, 142, 70, 14 + PUSHBUTTON "&УдалиÑÑ", IDC_REMOVE_BUTTON, 101, 142, 70, 14 PUSHBUTTON "&СвойÑÑва...", IDC_PROP_BUTTON, 175, 142, 70, 14 GROUPBOX "ÐаÑамеÑÑÑ", -1, 7, 185, 240, 36 PUSHBUTTON "&ÐаÑамеÑÑÑ ÐºÐ»Ð°Ð²Ð¸Ð°ÑÑÑÑ...", IDC_KEY_SET_BTN, 14, 198, 110, 14 Modified: trunk/reactos/dll/cpl/input_new/lang/sk-SK.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/input_new/lang/sk-…
============================================================================== --- trunk/reactos/dll/cpl/input_new/lang/sk-SK.rc [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/input_new/lang/sk-SK.rc [iso-8859-1] Tue Aug 9 18:26:43 2016 @@ -11,10 +11,10 @@ FONT 8, "MS Shell Dlg" BEGIN LTEXT "Vyberte služby, ktoré chcete priradiÅ¥ ku každému vstupnému jazyku uvedenému v zozname.\nPoužite tlaÄidlá PridaÅ¥ a OdstrániÅ¥ k úprave zoznamu.", -1, 9, 6, 238, 25 - CONTROL "TEXT", IDC_KEYLAYOUT_LIST, "SYSLISTVIEW32", WS_BORDER | WS_VSCROLL | WS_TABSTOP | LVS_SORTASCENDING | LVS_REPORT | 0x0000808D, 8, 36, 237, 101 + CONTROL "TEXT", IDC_KEYLAYOUT_LIST, "SYSLISTVIEW32", WS_BORDER | WS_VSCROLL | WS_TABSTOP | LVS_SINGLESEL | LVS_NOSORTHEADER | LVS_SHOWSELALWAYS | LVS_REPORT, 8, 36, 237, 101 PUSHBUTTON "Pred&voliÅ¥", IDC_SET_DEFAULT, 101, 159, 144, 14 PUSHBUTTON "&PridaÅ¥...", IDC_ADD_BUTTON, 27, 142, 70, 14 - PUSHBUTTON "O&dstrániÅ¥...", IDC_REMOVE_BUTTON, 101, 142, 70, 14 + PUSHBUTTON "O&dstrániÅ¥", IDC_REMOVE_BUTTON, 101, 142, 70, 14 PUSHBUTTON "Vl&astnosti...", IDC_PROP_BUTTON, 175, 142, 70, 14 GROUPBOX "Preferencie", -1, 7, 185, 240, 36 PUSHBUTTON "Nastavenie &klávesov...", IDC_KEY_SET_BTN, 14, 198, 110, 14 Modified: trunk/reactos/dll/cpl/input_new/lang/sq-AL.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/input_new/lang/sq-…
============================================================================== --- trunk/reactos/dll/cpl/input_new/lang/sq-AL.rc [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/input_new/lang/sq-AL.rc [iso-8859-1] Tue Aug 9 18:26:43 2016 @@ -10,10 +10,10 @@ FONT 8, "MS Shell Dlg" BEGIN LTEXT "Zgjidhni shërbimet që ju dëshironi për çdo gjuhë të dhënash treguar në listë.\nPërdor Shto dhe Hiq butonat për të modifikuar këtë listë.", -1, 9, 6, 238, 25 - CONTROL "TEXT", IDC_KEYLAYOUT_LIST, "SYSLISTVIEW32", WS_BORDER | WS_VSCROLL | WS_TABSTOP | LVS_SORTASCENDING | LVS_REPORT | 0x0000808D, 8, 36, 237, 101 + CONTROL "TEXT", IDC_KEYLAYOUT_LIST, "SYSLISTVIEW32", WS_BORDER | WS_VSCROLL | WS_TABSTOP | LVS_SINGLESEL | LVS_NOSORTHEADER | LVS_SHOWSELALWAYS | LVS_REPORT, 8, 36, 237, 101 PUSHBUTTON "&Vendos Parazgjedhur", IDC_SET_DEFAULT, 101, 159, 144, 14 PUSHBUTTON "Sh&to...", IDC_ADD_BUTTON, 27, 142, 70, 14 - PUSHBUTTON "&Hiq...", IDC_REMOVE_BUTTON, 101, 142, 70, 14 + PUSHBUTTON "&Hiq", IDC_REMOVE_BUTTON, 101, 142, 70, 14 PUSHBUTTON "&Karakteristikat...", IDC_PROP_BUTTON, 175, 142, 70, 14 GROUPBOX "Preferenca", -1, 7, 185, 240, 36 PUSHBUTTON "&Ãeles cilësimesh...", IDC_KEY_SET_BTN, 14, 198, 110, 14 Modified: trunk/reactos/dll/cpl/input_new/lang/tr-TR.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/input_new/lang/tr-…
============================================================================== --- trunk/reactos/dll/cpl/input_new/lang/tr-TR.rc [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/input_new/lang/tr-TR.rc [iso-8859-1] Tue Aug 9 18:26:43 2016 @@ -8,10 +8,10 @@ FONT 8, "MS Shell Dlg" BEGIN LTEXT "Dizelgede gösterilen tüm giriÅ dilleri için istediÄiniz hizmetleri seçiniz.\nBu dizelgeyi deÄiÅtirmek için Ekle veyâ Sil düÄmelerini kullanınız.", -1, 9, 6, 238, 25 - CONTROL "TEXT", IDC_KEYLAYOUT_LIST, "SYSLISTVIEW32", WS_BORDER | WS_VSCROLL | WS_TABSTOP | LVS_SORTASCENDING | LVS_REPORT | 0x0000808D, 8, 36, 237, 101 + CONTROL "TEXT", IDC_KEYLAYOUT_LIST, "SYSLISTVIEW32", WS_BORDER | WS_VSCROLL | WS_TABSTOP | LVS_SINGLESEL | LVS_NOSORTHEADER | LVS_SHOWSELALWAYS | LVS_REPORT, 8, 36, 237, 101 PUSHBUTTON "&Ãn Tanımlı Yap", IDC_SET_DEFAULT, 101, 159, 144, 14 PUSHBUTTON "&Ekle...", IDC_ADD_BUTTON, 27, 142, 70, 14 - PUSHBUTTON "&Sil...", IDC_REMOVE_BUTTON, 101, 142, 70, 14 + PUSHBUTTON "&Sil", IDC_REMOVE_BUTTON, 101, 142, 70, 14 PUSHBUTTON "&Husûsiyetler...", IDC_PROP_BUTTON, 175, 142, 70, 14 GROUPBOX "YeÄlemeler", -1, 7, 185, 240, 36 PUSHBUTTON "&DüÄme Ayarları...", IDC_KEY_SET_BTN, 14, 198, 110, 14 Modified: trunk/reactos/dll/cpl/input_new/lang/uk-UA.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/input_new/lang/uk-…
============================================================================== --- trunk/reactos/dll/cpl/input_new/lang/uk-UA.rc [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/input_new/lang/uk-UA.rc [iso-8859-1] Tue Aug 9 18:26:43 2016 @@ -14,10 +14,10 @@ FONT 8, "MS Shell Dlg" BEGIN LTEXT "ÐибеÑÑÑÑ Ð¿Ð¾ÑÑÑÐ±Ð½Ñ Ñозкладки Ð´Ð»Ñ ÐºÐ¾Ð¶Ð½Ð¾Ñ Ð¼Ð¾Ð²Ð¸ Ð²Ð²ÐµÐ´ÐµÐ½Ð½Ñ Ð·Ñ ÑпиÑкÑ. ÐÐ»Ñ Ð·Ð¼Ñни ÑпиÑÐºÑ Ð²Ð¸ÐºÐ¾ÑиÑÑовÑйÑе кнопки ""ÐодаÑи"" Ñ ""ÐидалиÑи"".", -1, 9, 6, 238, 25 - CONTROL "TEXT", IDC_KEYLAYOUT_LIST, "SYSLISTVIEW32", WS_BORDER | WS_VSCROLL | WS_TABSTOP | LVS_SORTASCENDING | LVS_REPORT | 0x0000808D, 8, 36, 237, 101 + CONTROL "TEXT", IDC_KEYLAYOUT_LIST, "SYSLISTVIEW32", WS_BORDER | WS_VSCROLL | WS_TABSTOP | LVS_SINGLESEL | LVS_NOSORTHEADER | LVS_SHOWSELALWAYS | LVS_REPORT, 8, 36, 237, 101 PUSHBUTTON "ÐÑÑановиÑи за замов&ÑÑваннÑм", IDC_SET_DEFAULT, 101, 159, 144, 14 PUSHBUTTON "&ÐодаÑи...", IDC_ADD_BUTTON, 27, 142, 70, 14 - PUSHBUTTON "Ð&идалиÑи...", IDC_REMOVE_BUTTON, 101, 142, 70, 14 + PUSHBUTTON "Ð&идалиÑи", IDC_REMOVE_BUTTON, 101, 142, 70, 14 PUSHBUTTON "Ð&лаÑÑивоÑÑÑ...", IDC_PROP_BUTTON, 175, 142, 70, 14 GROUPBOX "ÐалаÑÑÑваннÑ", -1, 7, 185, 240, 36 PUSHBUTTON "&ÐаÑамеÑÑи клавÑаÑÑÑи...", IDC_KEY_SET_BTN, 14, 198, 110, 14 Modified: trunk/reactos/dll/cpl/input_new/lang/zh-CN.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/input_new/lang/zh-…
============================================================================== --- trunk/reactos/dll/cpl/input_new/lang/zh-CN.rc [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/input_new/lang/zh-CN.rc [iso-8859-1] Tue Aug 9 18:26:43 2016 @@ -8,7 +8,7 @@ FONT 9, "MS Shell Dlg" BEGIN LTEXT "为å表ä¸æ¾ç¤ºçæ¯ä¸ªè¾å ¥è¯è¨éæ©æå¡ã\n使ç¨âæ·»å âåâå é¤âæé®æ¥ä¿®æ¹è¿ä¸ªå表ã", -1, 9, 6, 238, 25 - CONTROL "TEXT", IDC_KEYLAYOUT_LIST, "SYSLISTVIEW32", WS_BORDER | WS_VSCROLL | WS_TABSTOP | LVS_SORTASCENDING | LVS_REPORT | 0x0000808D, 8, 36, 237, 101 + CONTROL "TEXT", IDC_KEYLAYOUT_LIST, "SYSLISTVIEW32", WS_BORDER | WS_VSCROLL | WS_TABSTOP | LVS_SINGLESEL | LVS_NOSORTHEADER | LVS_SHOWSELALWAYS | LVS_REPORT, 8, 36, 237, 101 PUSHBUTTON "设为é»è®¤å¼(&S)", IDC_SET_DEFAULT, 101, 159, 144, 14 PUSHBUTTON "æ·»å (&D)...", IDC_ADD_BUTTON, 27, 142, 70, 14 PUSHBUTTON "å é¤(&R)", IDC_REMOVE_BUTTON, 101, 142, 70, 14 Modified: trunk/reactos/dll/cpl/input_new/lang/zh-TW.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/input_new/lang/zh-…
============================================================================== --- trunk/reactos/dll/cpl/input_new/lang/zh-TW.rc [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/input_new/lang/zh-TW.rc [iso-8859-1] Tue Aug 9 18:26:43 2016 @@ -8,7 +8,7 @@ FONT 9, "MS Shell Dlg" BEGIN LTEXT "çºå表ä¸é¡¯ç¤ºçæ¯åè¼¸å ¥èªè¨é¸ææåã\n使ç¨âæ·»å âåâåªé¤âæéä¾ä¿®æ¹éåå表ã", -1, 9, 6, 238, 25 - CONTROL "TEXT", IDC_KEYLAYOUT_LIST, "SYSLISTVIEW32", WS_BORDER | WS_VSCROLL | WS_TABSTOP | LVS_SORTASCENDING | LVS_REPORT | 0x0000808D, 8, 36, 237, 101 + CONTROL "TEXT", IDC_KEYLAYOUT_LIST, "SYSLISTVIEW32", WS_BORDER | WS_VSCROLL | WS_TABSTOP | LVS_SINGLESEL | LVS_NOSORTHEADER | LVS_SHOWSELALWAYS | LVS_REPORT, 8, 36, 237, 101 PUSHBUTTON "è¨çºé è¨å¼(&S)", IDC_SET_DEFAULT, 101, 159, 144, 14 PUSHBUTTON "æ·»å (&D)...", IDC_ADD_BUTTON, 27, 142, 70, 14 PUSHBUTTON "åªé¤(&R)", IDC_REMOVE_BUTTON, 101, 142, 70, 14 Modified: trunk/reactos/dll/cpl/input_new/settings_page.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/input_new/settings…
============================================================================== --- trunk/reactos/dll/cpl/input_new/settings_page.c [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/input_new/settings_page.c [iso-8859-1] Tue Aug 9 18:26:43 2016 @@ -12,8 +12,10 @@ static HICON -CreateLayoutIcon(LPWSTR szLayout) -{ +CreateLayoutIcon(LPWSTR szLayout, BOOL bIsDefault) +{ + INT width = GetSystemMetrics(SM_CXSMICON) * 2; + INT height = GetSystemMetrics(SM_CYSMICON); HDC hdc; HDC hdcsrc; HBITMAP hBitmap; @@ -21,60 +23,83 @@ hdcsrc = GetDC(NULL); hdc = CreateCompatibleDC(hdcsrc); - hBitmap = CreateCompatibleBitmap(hdcsrc, - GetSystemMetrics(SM_CXSMICON), - GetSystemMetrics(SM_CYSMICON)); + hBitmap = CreateCompatibleBitmap(hdcsrc, width, height); + ReleaseDC(NULL, hdcsrc); if (hdc && hBitmap) { HBITMAP hBmpNew; - hBmpNew = CreateBitmap(GetSystemMetrics(SM_CXSMICON), - GetSystemMetrics(SM_CYSMICON), - 1, 1, NULL); + hBmpNew = CreateBitmap(width, height, 1, 1, NULL); if (hBmpNew) { - ICONINFO IconInfo; - HBITMAP hBmpOld; - HFONT hFont; - RECT rect; - - hBmpOld = SelectObject(hdc, hBitmap); - rect.right = GetSystemMetrics(SM_CXSMICON); - rect.left = 0; - rect.bottom = GetSystemMetrics(SM_CYSMICON); - rect.top = 0; - - SetBkColor(hdc, GetSysColor(COLOR_HIGHLIGHT)); - SetTextColor(hdc, GetSysColor(COLOR_HIGHLIGHTTEXT)); - - ExtTextOut(hdc, rect.left, rect.top, ETO_OPAQUE, &rect, L"", 0, NULL); - - hFont = CreateFontW(-11, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, ANSI_CHARSET, - OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, - DEFAULT_QUALITY, FF_DONTCARE, L"Tahoma"); - - SelectObject(hdc, hFont); - DrawTextW(hdc, szLayout, 2, &rect, DT_SINGLELINE|DT_CENTER|DT_VCENTER); - SelectObject(hdc, hBmpNew); - - PatBlt(hdc, 0, 0, - GetSystemMetrics(SM_CXSMICON), - GetSystemMetrics(SM_CYSMICON), - BLACKNESS); - - SelectObject(hdc, hBmpOld); - - IconInfo.hbmColor = hBitmap; - IconInfo.hbmMask = hBmpNew; - IconInfo.fIcon = TRUE; - - hIcon = CreateIconIndirect(&IconInfo); + LOGFONT lf; + + if (SystemParametersInfoW(SPI_GETICONTITLELOGFONT, sizeof(LOGFONT), &lf, 0)) + { + ICONINFO IconInfo; + HFONT hFont; + + hFont = CreateFontIndirectW(&lf); + + if (hFont != NULL) + { + HBITMAP hBmpOld; + + hBmpOld = SelectObject(hdc, hBitmap); + + if (hBmpOld != NULL) + { + RECT rect; + + SetRect(&rect, 0, 0, width / 2, height); + + if (bIsDefault != FALSE) + { + SetBkColor(hdc, GetSysColor(COLOR_WINDOW)); + SetTextColor(hdc, GetSysColor(COLOR_WINDOWTEXT)); + + ExtTextOutW(hdc, rect.left, rect.top, ETO_OPAQUE, &rect, L"", 0, NULL); + + SelectObject(hdc, hFont); + DrawTextW(hdc, L"\x25CF", 1, &rect, DT_SINGLELINE | DT_CENTER | DT_VCENTER); + } + else + { + FillRect(hdc, &rect, GetSysColorBrush(COLOR_WINDOW)); + } + + SetRect(&rect, width / 2, 0, width, height); + + SetBkColor(hdc, GetSysColor(COLOR_HIGHLIGHT)); + SetTextColor(hdc, GetSysColor(COLOR_HIGHLIGHTTEXT)); + + ExtTextOutW(hdc, rect.left, rect.top, ETO_OPAQUE, &rect, L"", 0, NULL); + + SelectObject(hdc, hFont); + DrawTextW(hdc, szLayout, 2, &rect, DT_SINGLELINE | DT_CENTER | DT_VCENTER); + + SelectObject(hdc, hBmpNew); + + PatBlt(hdc, 0, 0, width, height, BLACKNESS); + + SelectObject(hdc, hBmpOld); + + IconInfo.hbmColor = hBitmap; + IconInfo.hbmMask = hBmpNew; + IconInfo.fIcon = TRUE; + + hIcon = CreateIconIndirect(&IconInfo); + + DeleteObject(hBmpOld); + } + + DeleteObject(hFont); + } + } DeleteObject(hBmpNew); - DeleteObject(hBmpOld); - DeleteObject(hFont); } } @@ -82,6 +107,15 @@ DeleteObject(hBitmap); return hIcon; +} + + +static VOID +SetControlsState(HWND hwndDlg, BOOL bIsEnabled) +{ + EnableWindow(GetDlgItem(hwndDlg, IDC_REMOVE_BUTTON), bIsEnabled); + EnableWindow(GetDlgItem(hwndDlg, IDC_PROP_BUTTON), bIsEnabled); + EnableWindow(GetDlgItem(hwndDlg, IDC_SET_DEFAULT), bIsEnabled); } @@ -99,7 +133,8 @@ { HICON hLayoutIcon; - hLayoutIcon = CreateLayoutIcon(pInputNode->pszIndicator); + hLayoutIcon = CreateLayoutIcon(pInputNode->pszIndicator, + (pInputNode->wFlags & INPUT_LIST_NODE_FLAG_DEFAULT)); if (hLayoutIcon != NULL) { @@ -110,9 +145,9 @@ memset(&item, 0, sizeof(LV_ITEM)); - item.mask = LVIF_TEXT | LVIF_PARAM | LVIF_STATE | LVIF_IMAGE; + item.mask = LVIF_TEXT | LVIF_PARAM | LVIF_IMAGE; item.pszText = pInputNode->pLocale->pszName; - item.iItem = -1; + item.iItem = ListView_GetItemCount(hwndList) + 1; item.lParam = (LPARAM)pInputNode; item.iImage = ImageIndex; @@ -140,7 +175,7 @@ pCurrentInputNode != NULL; pCurrentInputNode = pCurrentInputNode->pNext) { - if (!(pCurrentInputNode->dwFlags & INPUT_LIST_NODE_FLAG_DELETED)) + if (!(pCurrentInputNode->wFlags & INPUT_LIST_NODE_FLAG_DELETED)) { AddToInputListView(hwndList, pCurrentInputNode); } @@ -185,7 +220,7 @@ column.pszText = szBuffer; ListView_InsertColumn(hwndInputList, 1, &column); - hLayoutImageList = ImageList_Create(GetSystemMetrics(SM_CXSMICON), + hLayoutImageList = ImageList_Create(GetSystemMetrics(SM_CXSMICON) * 2, GetSystemMetrics(SM_CYSMICON), ILC_COLOR8 | ILC_MASK, 0, 0); if (hLayoutImageList != NULL) @@ -195,6 +230,8 @@ UpdateInputListView(hwndInputList); } + + SetControlsState(hwndDlg, FALSE); } @@ -236,7 +273,9 @@ case IDC_REMOVE_BUTTON: { - HWND hwndList = GetDlgItem(hwndDlg, IDC_KEYLAYOUT_LIST); + HWND hwndList; + + hwndList = GetDlgItem(hwndDlg, IDC_KEYLAYOUT_LIST); if (hwndList != NULL) { @@ -247,8 +286,8 @@ if (ListView_GetItem(hwndList, &item) != FALSE) { - InputList_Remove((INPUT_LIST_NODE*)item.lParam); - UpdateInputListView(GetDlgItem(hwndDlg, IDC_KEYLAYOUT_LIST)); + InputList_Remove((INPUT_LIST_NODE*) item.lParam); + UpdateInputListView(hwndList); PropSheet_Changed(GetParent(hwndDlg), hwndDlg); } } @@ -257,20 +296,9 @@ case IDC_PROP_BUTTON: { - if (DialogBoxW(hApplet, - MAKEINTRESOURCEW(IDD_INPUT_LANG_PROP), - hwndDlg, - EditDialogProc) == IDOK) - { - UpdateInputListView(GetDlgItem(hwndDlg, IDC_KEYLAYOUT_LIST)); - PropSheet_Changed(GetParent(hwndDlg), hwndDlg); - } - } - break; - - case IDC_SET_DEFAULT: - { - HWND hwndList = GetDlgItem(hwndDlg, IDC_KEYLAYOUT_LIST); + HWND hwndList; + + hwndList = GetDlgItem(hwndDlg, IDC_KEYLAYOUT_LIST); if (hwndList != NULL) { @@ -281,14 +309,37 @@ if (ListView_GetItem(hwndList, &item) != FALSE) { - INPUT_LIST_NODE *pSelected; - - pSelected = (INPUT_LIST_NODE*) item.lParam; - if (pSelected != NULL) + if (DialogBoxParamW(hApplet, + MAKEINTRESOURCEW(IDD_INPUT_LANG_PROP), + hwndDlg, + EditDialogProc, + item.lParam) == IDOK) { - InputList_SetDefault(pSelected); + UpdateInputListView(hwndList); + PropSheet_Changed(GetParent(hwndDlg), hwndDlg); } - + } + } + } + break; + + case IDC_SET_DEFAULT: + { + HWND hwndList; + + hwndList = GetDlgItem(hwndDlg, IDC_KEYLAYOUT_LIST); + + if (hwndList != NULL) + { + LVITEM item = { 0 }; + + item.mask = LVIF_PARAM; + item.iItem = ListView_GetNextItem(hwndList, -1, LVNI_SELECTED); + + if (ListView_GetItem(hwndList, &item) != FALSE) + { + InputList_SetDefault((INPUT_LIST_NODE*) item.lParam); + UpdateInputListView(hwndList); PropSheet_Changed(GetParent(hwndDlg), hwndDlg); } } @@ -313,9 +364,33 @@ static VOID OnNotifySettingsPage(HWND hwndDlg, LPARAM lParam) { - if (((LPPSHNOTIFY)lParam)->hdr.code == PSN_APPLY) - { - InputList_Process(); + LPNMHDR header; + + header = (LPNMHDR)lParam; + + switch (header->code) + { + case NM_CLICK: + { + if (header->idFrom == IDC_KEYLAYOUT_LIST) + { + if (ListView_GetNextItem(header->hwndFrom, -1, LVNI_SELECTED) != -1) + { + SetControlsState(hwndDlg, TRUE); + } + else + { + SetControlsState(hwndDlg, FALSE); + } + } + } + break; + + case PSN_APPLY: + { + InputList_Process(); + } + break; } }
8 years, 4 months
1
0
0
0
[gadamopoulos] 72167: [SHELL32] - Don't hardcode the path in the shell namespace in any folder appart for CDesktopFolder and CDrivesFolder. - Make SHELL32_CoCreateInitSF slightly more generic and u...
by gadamopoulos@svn.reactos.org
Author: gadamopoulos Date: Tue Aug 9 18:05:50 2016 New Revision: 72167 URL:
http://svn.reactos.org/svn/reactos?rev=72167&view=rev
Log: [SHELL32] - Don't hardcode the path in the shell namespace in any folder appart for CDesktopFolder and CDrivesFolder. - Make SHELL32_CoCreateInitSF slightly more generic and use it when we need to create and initialise a shell folder. - Now SHELL32_BindToFS is used only by CFSFolder but SHELL32_CoCreateInitSF still uses the generic _ILSimpleGetTextW (it accesses the pidl). Modified: trunk/reactos/dll/win32/shell32/folders/CAdminToolsFolder.cpp trunk/reactos/dll/win32/shell32/folders/CAdminToolsFolder.h trunk/reactos/dll/win32/shell32/folders/CControlPanelFolder.cpp trunk/reactos/dll/win32/shell32/folders/CControlPanelFolder.h trunk/reactos/dll/win32/shell32/folders/CDesktopFolder.cpp trunk/reactos/dll/win32/shell32/folders/CDrivesFolder.cpp trunk/reactos/dll/win32/shell32/folders/CFontsFolder.cpp trunk/reactos/dll/win32/shell32/folders/CFontsFolder.h trunk/reactos/dll/win32/shell32/folders/CMyDocsFolder.cpp trunk/reactos/dll/win32/shell32/folders/CMyDocsFolder.h trunk/reactos/dll/win32/shell32/folders/CNetFolder.cpp trunk/reactos/dll/win32/shell32/folders/CNetFolder.h trunk/reactos/dll/win32/shell32/folders/CPrinterFolder.cpp trunk/reactos/dll/win32/shell32/folders/CPrinterFolder.h trunk/reactos/dll/win32/shell32/shfldr.h trunk/reactos/dll/win32/shell32/shlfolder.cpp Modified: trunk/reactos/dll/win32/shell32/folders/CAdminToolsFolder.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/folders/…
============================================================================== --- trunk/reactos/dll/win32/shell32/folders/CAdminToolsFolder.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/folders/CAdminToolsFolder.cpp [iso-8859-1] Tue Aug 9 18:05:50 2016 @@ -25,37 +25,13 @@ CAdminToolsFolder::CAdminToolsFolder() { - m_pisfInner = NULL; + m_pidlInner = NULL; } CAdminToolsFolder::~CAdminToolsFolder() { - m_pisfInner.Release(); -} - -HRESULT WINAPI CAdminToolsFolder::FinalConstruct() -{ - HRESULT hr; - CComPtr<IPersistFolder3> ppf3; - - hr = SHCoCreateInstance(NULL, &CLSID_ShellFSFolder, NULL, IID_PPV_ARG(IShellFolder2, &m_pisfInner)); - if (FAILED(hr)) - return hr; - - hr = m_pisfInner->QueryInterface(IID_PPV_ARG(IPersistFolder3, &ppf3)); - if (FAILED(hr)) - return hr; - - LPITEMIDLIST pidlRoot = _ILCreateAdminTools(); - - PERSIST_FOLDER_TARGET_INFO info; - ZeroMemory(&info, sizeof(PERSIST_FOLDER_TARGET_INFO)); - info.csidl = CSIDL_COMMON_ADMINTOOLS; - hr = ppf3->InitializeEx(NULL, pidlRoot, &info); - - SHFree(pidlRoot); - - return hr; + if(m_pidlInner) + SHFree(m_pidlInner); } HRESULT WINAPI CAdminToolsFolder::ParseDisplayName(HWND hwndOwner, LPBC pbc, LPOLESTR lpszDisplayName, @@ -194,13 +170,22 @@ HRESULT WINAPI CAdminToolsFolder::Initialize(LPCITEMIDLIST pidl) { - return S_OK; + m_pidlInner = ILClone(pidl); + if (!m_pidlInner) + return E_OUTOFMEMORY; + + return SHELL32_CoCreateInitSF(m_pidlInner, + NULL, + NULL, + &CLSID_ShellFSFolder, + CSIDL_COMMON_ADMINTOOLS, + IID_PPV_ARG(IShellFolder2, &m_pisfInner)); } HRESULT WINAPI CAdminToolsFolder::GetCurFolder(LPITEMIDLIST *pidl) { if (!pidl) return E_POINTER; - *pidl = _ILCreateAdminTools(); + *pidl = ILClone(m_pidlInner); return S_OK; } Modified: trunk/reactos/dll/win32/shell32/folders/CAdminToolsFolder.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/folders/…
============================================================================== --- trunk/reactos/dll/win32/shell32/folders/CAdminToolsFolder.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/folders/CAdminToolsFolder.h [iso-8859-1] Tue Aug 9 18:05:50 2016 @@ -30,10 +30,10 @@ { private: CComPtr<IShellFolder2> m_pisfInner; - public: + LPITEMIDLIST m_pidlInner; + public: CAdminToolsFolder(); ~CAdminToolsFolder(); - HRESULT WINAPI FinalConstruct(); // IShellFolder virtual HRESULT WINAPI ParseDisplayName(HWND hwndOwner, LPBC pbc, LPOLESTR lpszDisplayName, ULONG *pchEaten, PIDLIST_RELATIVE *ppidl, ULONG *pdwAttributes); Modified: trunk/reactos/dll/win32/shell32/folders/CControlPanelFolder.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/folders/…
============================================================================== --- trunk/reactos/dll/win32/shell32/folders/CControlPanelFolder.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/folders/CControlPanelFolder.cpp [iso-8859-1] Tue Aug 9 18:05:50 2016 @@ -293,14 +293,6 @@ SHFree(pidlRoot); } -HRESULT WINAPI CControlPanelFolder::FinalConstruct() -{ - pidlRoot = _ILCreateControlPanel(); /* my qualified pidl */ - if (pidlRoot == NULL) - return E_OUTOFMEMORY; - return S_OK; -} - /************************************************************************** * CControlPanelFolder::ParseDisplayName */ Modified: trunk/reactos/dll/win32/shell32/folders/CControlPanelFolder.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/folders/…
============================================================================== --- trunk/reactos/dll/win32/shell32/folders/CControlPanelFolder.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/folders/CControlPanelFolder.h [iso-8859-1] Tue Aug 9 18:05:50 2016 @@ -38,7 +38,6 @@ public: CControlPanelFolder(); ~CControlPanelFolder(); - HRESULT WINAPI FinalConstruct(); // IShellFolder virtual HRESULT WINAPI ParseDisplayName(HWND hwndOwner, LPBC pbc, LPOLESTR lpszDisplayName, DWORD *pchEaten, PIDLIST_RELATIVE *ppidl, DWORD *pdwAttributes); Modified: trunk/reactos/dll/win32/shell32/folders/CDesktopFolder.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/folders/…
============================================================================== --- trunk/reactos/dll/win32/shell32/folders/CDesktopFolder.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/folders/CDesktopFolder.cpp [iso-8859-1] Tue Aug 9 18:05:50 2016 @@ -258,43 +258,42 @@ HRESULT WINAPI CDesktopFolder::FinalConstruct() { - WCHAR szMyPath[MAX_PATH]; - HRESULT hr; - CComPtr<IPersistFolder3> ppf3; + WCHAR szMyPath[MAX_PATH]; HRESULT hr; /* Create the root pidl */ pidlRoot = _ILCreateDesktop(); + if (!pidlRoot) + return E_OUTOFMEMORY; /* Create the inner fs folder */ - hr = SHCoCreateInstance(NULL, &CLSID_ShellFSFolder, NULL, IID_PPV_ARG(IShellFolder2, &m_DesktopFSFolder)); - if (FAILED(hr)) + hr = SHELL32_CoCreateInitSF(pidlRoot, + NULL, + NULL, + &CLSID_ShellFSFolder, + CSIDL_DESKTOPDIRECTORY, + IID_PPV_ARG(IShellFolder2, &m_DesktopFSFolder)); + if (FAILED_UNEXPECTEDLY(hr)) return hr; - hr = m_DesktopFSFolder->QueryInterface(IID_PPV_ARG(IPersistFolder3, &ppf3)); - if (FAILED(hr)) + /* Create the inner shared fs folder. Dont fail on failure. */ + hr = SHELL32_CoCreateInitSF(pidlRoot, + NULL, + NULL, + &CLSID_ShellFSFolder, + CSIDL_COMMON_DESKTOPDIRECTORY, + IID_PPV_ARG(IShellFolder2, &m_SharedDesktopFSFolder)); + if (FAILED_UNEXPECTEDLY(hr)) return hr; - PERSIST_FOLDER_TARGET_INFO info; - ZeroMemory(&info, sizeof(PERSIST_FOLDER_TARGET_INFO)); - info.csidl = CSIDL_DESKTOPDIRECTORY; - hr = ppf3->InitializeEx(NULL, pidlRoot, &info); - - /* Create the inner shared fs folder */ - hr = SHCoCreateInstance(NULL, &CLSID_ShellFSFolder, NULL, IID_PPV_ARG(IShellFolder2, &m_SharedDesktopFSFolder)); - if (FAILED(hr)) - return hr; - - hr = m_SharedDesktopFSFolder->QueryInterface(IID_PPV_ARG(IPersistFolder3, &ppf3)); - if (FAILED(hr)) - return hr; - - info.csidl = CSIDL_COMMON_DESKTOPDIRECTORY; - hr = ppf3->InitializeEx(NULL, pidlRoot, &info); - + + /* Cache the path to the user desktop directory */ if (!SHGetSpecialFolderPathW( 0, szMyPath, CSIDL_DESKTOPDIRECTORY, TRUE )) return E_UNEXPECTED; sPathTarget = (LPWSTR)SHAlloc((wcslen(szMyPath) + 1) * sizeof(WCHAR)); + if (!sPathTarget) + return E_OUTOFMEMORY; + wcscpy(sPathTarget, szMyPath); return S_OK; } Modified: trunk/reactos/dll/win32/shell32/folders/CDrivesFolder.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/folders/…
============================================================================== --- trunk/reactos/dll/win32/shell32/folders/CDrivesFolder.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/folders/CDrivesFolder.cpp [iso-8859-1] Tue Aug 9 18:05:50 2016 @@ -312,7 +312,31 @@ if (_ILIsSpecialFolder(pidl)) return SHELL32_BindToGuidItem(pidlRoot, pidl, pbcReserved, riid, ppvOut); - return SHELL32_BindToFS(pidlRoot, NULL, pidl, riid, ppvOut); + LPITEMIDLIST pidlChild = ILCloneFirst (pidl); + if (!pidlChild) + return E_OUTOFMEMORY; + + CComPtr<IShellFolder> psf; + HRESULT hr = SHELL32_CoCreateInitSF(pidlRoot, + NULL, + pidlChild, + &CLSID_ShellFSFolder, + -1, + IID_PPV_ARG(IShellFolder, &psf)); + + ILFree(pidlChild); + + if (FAILED(hr)) + return hr; + + if (_ILIsPidlSimple (pidl)) + { + return psf->QueryInterface(riid, ppvOut); + } + else + { + return psf->BindToObject(ILGetNext (pidl), pbcReserved, riid, ppvOut); + } } /************************************************************************** Modified: trunk/reactos/dll/win32/shell32/folders/CFontsFolder.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/folders/…
============================================================================== --- trunk/reactos/dll/win32/shell32/folders/CFontsFolder.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/folders/CFontsFolder.cpp [iso-8859-1] Tue Aug 9 18:05:50 2016 @@ -25,37 +25,13 @@ CFontsFolder::CFontsFolder() { - m_pisfInner = NULL; + m_pidlInner = NULL; } CFontsFolder::~CFontsFolder() { -} - -HRESULT WINAPI CFontsFolder::FinalConstruct() -{ - HRESULT hr; - CComPtr<IPersistFolder3> ppf3; - hr = SHCoCreateInstance(NULL, &CLSID_ShellFSFolder, NULL, IID_PPV_ARG(IShellFolder2, &m_pisfInner)); - if (FAILED(hr)) - return hr; - - hr = m_pisfInner->QueryInterface(IID_PPV_ARG(IPersistFolder3, &ppf3)); - if (FAILED(hr)) - return hr; - - LPITEMIDLIST pidl = _ILCreateGuid(PT_GUID, CLSID_FontsFolderShortcut); - if (!pidl) - return E_OUTOFMEMORY; - - PERSIST_FOLDER_TARGET_INFO info; - ZeroMemory(&info, sizeof(PERSIST_FOLDER_TARGET_INFO)); - info.csidl = CSIDL_FONTS; - hr = ppf3->InitializeEx(NULL, pidl, &info); - - ILFree(pidl); - - return hr; + if(m_pidlInner) + SHFree(m_pidlInner); } HRESULT WINAPI CFontsFolder::ParseDisplayName(HWND hwndOwner, LPBC pbc, LPOLESTR lpszDisplayName, @@ -195,15 +171,22 @@ HRESULT WINAPI CFontsFolder::Initialize(LPCITEMIDLIST pidl) { - return S_OK; + m_pidlInner = ILClone(pidl); + if (!m_pidlInner) + return E_OUTOFMEMORY; + + return SHELL32_CoCreateInitSF(m_pidlInner, + NULL, + NULL, + &CLSID_ShellFSFolder, + CSIDL_FONTS, + IID_PPV_ARG(IShellFolder2, &m_pisfInner)); } HRESULT WINAPI CFontsFolder::GetCurFolder(LPITEMIDLIST *pidl) { if (!pidl) return E_POINTER; - - *pidl = _ILCreateGuid(PT_GUID, CLSID_FontsFolderShortcut); - + *pidl = ILClone(m_pidlInner); return S_OK; } Modified: trunk/reactos/dll/win32/shell32/folders/CFontsFolder.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/folders/…
============================================================================== --- trunk/reactos/dll/win32/shell32/folders/CFontsFolder.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/folders/CFontsFolder.h [iso-8859-1] Tue Aug 9 18:05:50 2016 @@ -30,10 +30,10 @@ { private: CComPtr<IShellFolder2> m_pisfInner; + LPITEMIDLIST m_pidlInner; public: CFontsFolder(); ~CFontsFolder(); - HRESULT WINAPI FinalConstruct(); // IShellFolder virtual HRESULT WINAPI ParseDisplayName(HWND hwndOwner, LPBC pbc, LPOLESTR lpszDisplayName, DWORD *pchEaten, PIDLIST_RELATIVE *ppidl, DWORD *pdwAttributes); Modified: trunk/reactos/dll/win32/shell32/folders/CMyDocsFolder.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/folders/…
============================================================================== --- trunk/reactos/dll/win32/shell32/folders/CMyDocsFolder.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/folders/CMyDocsFolder.cpp [iso-8859-1] Tue Aug 9 18:05:50 2016 @@ -25,37 +25,13 @@ CMyDocsFolder::CMyDocsFolder() { - m_pisfInner = NULL; + m_pidlInner = NULL; } CMyDocsFolder::~CMyDocsFolder() { - m_pisfInner.Release(); -} - -HRESULT WINAPI CMyDocsFolder::FinalConstruct() -{ - HRESULT hr; - CComPtr<IPersistFolder3> ppf3; - - hr = SHCoCreateInstance(NULL, &CLSID_ShellFSFolder, NULL, IID_PPV_ARG(IShellFolder2, &m_pisfInner)); - if (FAILED(hr)) - return hr; - - hr = m_pisfInner->QueryInterface(IID_PPV_ARG(IPersistFolder3, &ppf3)); - if (FAILED(hr)) - return hr; - - LPITEMIDLIST pidlRoot = _ILCreateMyDocuments(); - - PERSIST_FOLDER_TARGET_INFO info; - ZeroMemory(&info, sizeof(PERSIST_FOLDER_TARGET_INFO)); - info.csidl = CSIDL_PERSONAL; - hr = ppf3->InitializeEx(NULL, pidlRoot, &info); - - SHFree(pidlRoot); - - return hr; + if(m_pidlInner) + SHFree(m_pidlInner); } HRESULT WINAPI CMyDocsFolder::ParseDisplayName(HWND hwndOwner, LPBC pbc, LPOLESTR lpszDisplayName, @@ -194,13 +170,22 @@ HRESULT WINAPI CMyDocsFolder::Initialize(LPCITEMIDLIST pidl) { - return S_OK; + m_pidlInner = ILClone(pidl); + if (!m_pidlInner) + return E_OUTOFMEMORY; + + return SHELL32_CoCreateInitSF(m_pidlInner, + NULL, + NULL, + &CLSID_ShellFSFolder, + CSIDL_PERSONAL, + IID_PPV_ARG(IShellFolder2, &m_pisfInner)); } HRESULT WINAPI CMyDocsFolder::GetCurFolder(LPITEMIDLIST *pidl) { if (!pidl) return E_POINTER; - *pidl = _ILCreateMyDocuments(); + *pidl = ILClone(m_pidlInner); return S_OK; } Modified: trunk/reactos/dll/win32/shell32/folders/CMyDocsFolder.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/folders/…
============================================================================== --- trunk/reactos/dll/win32/shell32/folders/CMyDocsFolder.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/folders/CMyDocsFolder.h [iso-8859-1] Tue Aug 9 18:05:50 2016 @@ -30,10 +30,10 @@ { private: CComPtr<IShellFolder2> m_pisfInner; + LPITEMIDLIST m_pidlInner; public: CMyDocsFolder(); ~CMyDocsFolder(); - HRESULT WINAPI FinalConstruct(); // IShellFolder virtual HRESULT WINAPI ParseDisplayName(HWND hwndOwner, LPBC pbc, LPOLESTR lpszDisplayName, DWORD *pchEaten, PIDLIST_RELATIVE *ppidl, DWORD *pdwAttributes); Modified: trunk/reactos/dll/win32/shell32/folders/CNetFolder.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/folders/…
============================================================================== --- trunk/reactos/dll/win32/shell32/folders/CNetFolder.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/folders/CNetFolder.cpp [iso-8859-1] Tue Aug 9 18:05:50 2016 @@ -204,16 +204,8 @@ CNetFolder::~CNetFolder() { - TRACE("-- destroying IShellFolder(%p)\n", this); - SHFree(pidlRoot); -} - -HRESULT WINAPI CNetFolder::FinalConstruct() -{ - pidlRoot = _ILCreateGuid(PT_GUID, CLSID_NetworkPlaces); /* my qualified pidl */ - if (pidlRoot == NULL) - return E_OUTOFMEMORY; - return S_OK; + if (pidlRoot) + SHFree(pidlRoot); } /************************************************************************** @@ -272,36 +264,31 @@ HRESULT WINAPI CNetFolder::BindToObject(PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut) { #ifdef HACKY_UNC_PATHS - HRESULT hr; - CComPtr<IPersistFolder3> ppf3; - hr = SHCoCreateInstance(NULL, &CLSID_ShellFSFolder, NULL, IID_PPV_ARG(IPersistFolder3, &ppf3)); - if (FAILED(hr)) + PITEMID_CHILD pidlChild = ILCloneFirst (pidl); + if (!pidlChild) + return E_FAIL; + + PIDLIST_ABSOLUTE pidlAbsolute = ILCombine(pidlRoot,pidlChild); + if (!pidlAbsolute) + return E_FAIL; + + CComPtr<IShellFolder> psf; + HRESULT hr = SHELL32_CoCreateInitSF(pidlAbsolute, + (WCHAR*)pidl->mkid.abID, + NULL, + &CLSID_ShellFSFolder, + -1, + IID_PPV_ARG(IShellFolder, &psf)); + ILFree(pidlChild); + ILFree(pidlAbsolute); + + if (FAILED_UNEXPECTEDLY(hr)) return hr; - PERSIST_FOLDER_TARGET_INFO pfti = {0}; - pfti.csidl = -1; - wcscpy(pfti.szTargetParsingName, (WCHAR*)pidl->mkid.abID); - - PCUIDLIST_RELATIVE pidlChild = ILCloneFirst (pidl); - - hr = ppf3->InitializeEx(NULL, ILCombine(pidlRoot,pidlChild), &pfti); - if (FAILED(hr)) - return hr; - if (_ILIsPidlSimple (pidl)) - { - return ppf3->QueryInterface(riid, ppvOut); - } + return psf->QueryInterface(riid, ppvOut); else - { - CComPtr<IShellFolder> psf; - hr = ppf3->QueryInterface(IID_PPV_ARG(IShellFolder, &psf)); - if (FAILED(hr)) - return hr; - return psf->BindToObject(ILGetNext (pidl), pbcReserved, riid, ppvOut); - } - #else return E_NOTIMPL; #endif @@ -584,8 +571,10 @@ */ HRESULT WINAPI CNetFolder::Initialize(LPCITEMIDLIST pidl) { - TRACE("(%p)->(%p)\n", this, pidl); - + if (pidlRoot) + SHFree((LPVOID)pidlRoot); + + pidlRoot = ILClone(pidl); return S_OK; } Modified: trunk/reactos/dll/win32/shell32/folders/CNetFolder.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/folders/…
============================================================================== --- trunk/reactos/dll/win32/shell32/folders/CNetFolder.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/folders/CNetFolder.h [iso-8859-1] Tue Aug 9 18:05:50 2016 @@ -36,7 +36,6 @@ public: CNetFolder(); ~CNetFolder(); - HRESULT WINAPI FinalConstruct(); // IShellFolder virtual HRESULT WINAPI ParseDisplayName(HWND hwndOwner, LPBC pbc, LPOLESTR lpszDisplayName, DWORD *pchEaten, PIDLIST_RELATIVE *ppidl, DWORD *pdwAttributes); Modified: trunk/reactos/dll/win32/shell32/folders/CPrinterFolder.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/folders/…
============================================================================== --- trunk/reactos/dll/win32/shell32/folders/CPrinterFolder.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/folders/CPrinterFolder.cpp [iso-8859-1] Tue Aug 9 18:05:50 2016 @@ -190,14 +190,6 @@ TRACE("-- destroying IShellFolder(%p)\n", this); if (pidlRoot) SHFree(pidlRoot); -} - -HRESULT WINAPI CPrinterFolder::FinalConstruct() -{ - pidlRoot = _ILCreatePrinters(); /* my qualified pidl */ - if (pidlRoot == NULL) - return E_OUTOFMEMORY; - return S_OK; } /************************************************************************** Modified: trunk/reactos/dll/win32/shell32/folders/CPrinterFolder.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/folders/…
============================================================================== --- trunk/reactos/dll/win32/shell32/folders/CPrinterFolder.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/folders/CPrinterFolder.h [iso-8859-1] Tue Aug 9 18:05:50 2016 @@ -39,7 +39,6 @@ public: CPrinterFolder(); ~CPrinterFolder(); - HRESULT WINAPI FinalConstruct(); // IShellFolder virtual HRESULT WINAPI ParseDisplayName(HWND hwndOwner, LPBC pbc, LPOLESTR lpszDisplayName, DWORD *pchEaten, PIDLIST_RELATIVE *ppidl, DWORD *pdwAttributes); Modified: trunk/reactos/dll/win32/shell32/shfldr.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shfldr.h…
============================================================================== --- trunk/reactos/dll/win32/shell32/shfldr.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/shfldr.h [iso-8859-1] Tue Aug 9 18:05:50 2016 @@ -77,6 +77,9 @@ HRESULT SHELL32_CompareGuidItems(IShellFolder2* isf, LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2); +HRESULT SHELL32_CoCreateInitSF (LPCITEMIDLIST pidlRoot, LPCWSTR pathRoot, + LPCITEMIDLIST pidlChild, const GUID* clsid, int csidl, REFIID riid, LPVOID *ppvOut); + extern "C" BOOL HCR_RegOpenClassIDKey(REFIID riid, HKEY *hkey); Modified: trunk/reactos/dll/win32/shell32/shlfolder.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shlfolde…
============================================================================== --- trunk/reactos/dll/win32/shell32/shlfolder.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/shlfolder.cpp [iso-8859-1] Tue Aug 9 18:05:50 2016 @@ -148,60 +148,56 @@ * pathRoot can be NULL for Folders being a drive. * In this case the absolute path is built from pidlChild (eg. C:) */ -static HRESULT SHELL32_CoCreateInitSF (LPCITEMIDLIST pidlRoot, LPCWSTR pathRoot, - LPCITEMIDLIST pidlChild, REFCLSID clsid, IShellFolder** ppsfOut) +HRESULT SHELL32_CoCreateInitSF (LPCITEMIDLIST pidlRoot, LPCWSTR pathRoot, + LPCITEMIDLIST pidlChild, const GUID* clsid, int csidl, REFIID riid, LPVOID *ppvOut) { HRESULT hr; CComPtr<IShellFolder> pShellFolder; TRACE ("%p %s %p\n", pidlRoot, debugstr_w(pathRoot), pidlChild); - hr = SHCoCreateInstance(NULL, &clsid, NULL, IID_PPV_ARG(IShellFolder, &pShellFolder)); - if (SUCCEEDED (hr)) - { - LPITEMIDLIST pidlAbsolute = ILCombine (pidlRoot, pidlChild); - CComPtr<IPersistFolder> ppf; - CComPtr<IPersistFolder3> ppf3; - - if (SUCCEEDED(pShellFolder->QueryInterface(IID_PPV_ARG(IPersistFolder3, &ppf3)))) - { - PERSIST_FOLDER_TARGET_INFO ppfti; - - ZeroMemory (&ppfti, sizeof (ppfti)); - - /* fill the PERSIST_FOLDER_TARGET_INFO */ - ppfti.dwAttributes = -1; - ppfti.csidl = -1; - - /* build path */ - if (pathRoot) - { - lstrcpynW (ppfti.szTargetParsingName, pathRoot, MAX_PATH - 1); - PathAddBackslashW(ppfti.szTargetParsingName); /* FIXME: why have drives a backslash here ? */ - } - - if (pidlChild) - { - int len = wcslen(ppfti.szTargetParsingName); - - if (!_ILSimpleGetTextW(pidlChild, ppfti.szTargetParsingName + len, MAX_PATH - len)) - hr = E_INVALIDARG; - } - - ppf3->InitializeEx(NULL, pidlAbsolute, &ppfti); - } - else if (SUCCEEDED((hr = pShellFolder->QueryInterface(IID_PPV_ARG(IPersistFolder, &ppf))))) - { - ppf->Initialize(pidlAbsolute); - } - ILFree (pidlAbsolute); - } - - *ppsfOut = pShellFolder.Detach(); - - TRACE ("-- (%p) ret=0x%08x\n", *ppsfOut, hr); - - return hr; + hr = SHCoCreateInstance(NULL, clsid, NULL, IID_PPV_ARG(IShellFolder, &pShellFolder)); + if (FAILED(hr)) + return hr; + + LPITEMIDLIST pidlAbsolute = ILCombine (pidlRoot, pidlChild); + CComPtr<IPersistFolder> ppf; + CComPtr<IPersistFolder3> ppf3; + + if (SUCCEEDED(pShellFolder->QueryInterface(IID_PPV_ARG(IPersistFolder3, &ppf3)))) + { + PERSIST_FOLDER_TARGET_INFO ppfti; + + ZeroMemory (&ppfti, sizeof (ppfti)); + + /* fill the PERSIST_FOLDER_TARGET_INFO */ + ppfti.dwAttributes = -1; + ppfti.csidl = csidl; + + /* build path */ + if (pathRoot) + { + lstrcpynW (ppfti.szTargetParsingName, pathRoot, MAX_PATH - 1); + PathAddBackslashW(ppfti.szTargetParsingName); /* FIXME: why have drives a backslash here ? */ + } + + if (pidlChild) + { + int len = wcslen(ppfti.szTargetParsingName); + + if (!_ILSimpleGetTextW(pidlChild, ppfti.szTargetParsingName + len, MAX_PATH - len)) + hr = E_INVALIDARG; + } + + ppf3->InitializeEx(NULL, pidlAbsolute, &ppfti); + } + else if (SUCCEEDED(pShellFolder->QueryInterface(IID_PPV_ARG(IPersistFolder, &ppf)))) + { + ppf->Initialize(pidlAbsolute); + } + ILFree (pidlAbsolute); + + return pShellFolder->QueryInterface(riid, ppvOut); } void SHELL32_GetCLSIDForDirectory(LPCWSTR pathRoot, LPCITEMIDLIST pidl, CLSID* pclsidFolder) @@ -271,7 +267,7 @@ if ((attributes & (FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_READONLY)) != 0) SHELL32_GetCLSIDForDirectory(pathRoot, pidlChild, &clsidFolder); - hr = SHELL32_CoCreateInitSF (pidlRoot, pathRoot, pidlChild, clsidFolder, &pSF); + hr = SHELL32_CoCreateInitSF (pidlRoot, pathRoot, pidlChild, &clsidFolder, -1, IID_PPV_ARG(IShellFolder, &pSF)); if (pidlChild != pidlComplete) ILFree ((LPITEMIDLIST)pidlChild); @@ -312,34 +308,22 @@ return E_INVALIDARG; } - hr = SHCoCreateInstance(NULL, pGUID, NULL, IID_PPV_ARG(IPersistFolder, &pFolder)); + LPITEMIDLIST pidlChild = ILCloneFirst (pidl); + if (!pidlChild) + return E_OUTOFMEMORY; + + CComPtr<IShellFolder> psf; + hr = SHELL32_CoCreateInitSF(pidlRoot, NULL, pidlChild, pGUID, -1, IID_PPV_ARG(IShellFolder, &psf)); + ILFree(pidlChild); if (FAILED(hr)) return hr; if (_ILIsPidlSimple (pidl)) { - hr = pFolder->Initialize(ILCombine(pidlRoot, pidl)); - if (FAILED(hr)) - return hr; - - return pFolder->QueryInterface(riid, ppvOut); - } - else - { - LPITEMIDLIST pidlChild = ILCloneFirst (pidl); - if (!pidlChild) - return E_OUTOFMEMORY; - - hr = pFolder->Initialize(ILCombine(pidlRoot, pidlChild)); - ILFree(pidlChild); - if (FAILED(hr)) - return hr; - - CComPtr<IShellFolder> psf; - hr = pFolder->QueryInterface(IID_PPV_ARG(IShellFolder, &psf)); - if (FAILED(hr)) - return hr; - + return psf->QueryInterface(riid, ppvOut); + } + else + { return psf->BindToObject(ILGetNext (pidl), pbcReserved, riid, ppvOut); } }
8 years, 4 months
1
0
0
0
[dchapyshev] 72166: [INPUT] - Implement 'Remove', 'Set Default' for input methods
by dchapyshev@svn.reactos.org
Author: dchapyshev Date: Tue Aug 9 14:01:52 2016 New Revision: 72166 URL:
http://svn.reactos.org/svn/reactos?rev=72166&view=rev
Log: [INPUT] - Implement 'Remove', 'Set Default' for input methods Modified: trunk/reactos/dll/cpl/input_new/add_dialog.c trunk/reactos/dll/cpl/input_new/edit_dialog.c trunk/reactos/dll/cpl/input_new/input.h trunk/reactos/dll/cpl/input_new/input_list.c trunk/reactos/dll/cpl/input_new/input_list.h trunk/reactos/dll/cpl/input_new/key_settings_dialog.c trunk/reactos/dll/cpl/input_new/layout_list.c trunk/reactos/dll/cpl/input_new/layout_list.h trunk/reactos/dll/cpl/input_new/locale_list.c trunk/reactos/dll/cpl/input_new/locale_list.h trunk/reactos/dll/cpl/input_new/settings_page.c Modified: trunk/reactos/dll/cpl/input_new/add_dialog.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/input_new/add_dial…
============================================================================== --- trunk/reactos/dll/cpl/input_new/add_dialog.c [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/input_new/add_dialog.c [iso-8859-1] Tue Aug 9 14:01:52 2016 @@ -71,7 +71,7 @@ dwDefaultLocaleId = GetSystemDefaultLCID(); - for (pCurrentLocale = LocaleList_Get(); + for (pCurrentLocale = LocaleList_GetFirst(); pCurrentLocale != NULL; pCurrentLocale = pCurrentLocale->pNext) { @@ -86,7 +86,7 @@ dwDefaultLayoutId = GetDefaultLayoutForLocale(dwDefaultLocaleId); - for (pCurrentLayout = LayoutList_Get(); + for (pCurrentLayout = LayoutList_GetFirst(); pCurrentLayout != NULL; pCurrentLayout = pCurrentLayout->pNext) { @@ -158,9 +158,11 @@ LAYOUT_LIST_NODE *pCurrentLayout; pCurrentLayout = (LAYOUT_LIST_NODE*)ComboBox_GetItemData(hwndLayoutCombo, iIndex); + if (pCurrentLayout != NULL && pCurrentLayout->dwId == dwLayoutId) { ComboBox_SetCurSel(hwndLayoutCombo, iIndex); + break; } } } Modified: trunk/reactos/dll/cpl/input_new/edit_dialog.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/input_new/edit_dia…
============================================================================== --- trunk/reactos/dll/cpl/input_new/edit_dialog.c [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/input_new/edit_dialog.c [iso-8859-1] Tue Aug 9 14:01:52 2016 @@ -6,3 +6,33 @@ */ #include "input.h" + + +INT_PTR CALLBACK +EditDialogProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) +{ + UNREFERENCED_PARAMETER(lParam); + + switch (uMsg) + { + case WM_INITDIALOG: + break; + + case WM_COMMAND: + { + switch (LOWORD(wParam)) + { + case IDOK: + EndDialog(hDlg, LOWORD(wParam)); + break; + + case IDCANCEL: + EndDialog(hDlg, LOWORD(wParam)); + break; + } + } + break; + } + + return FALSE; +} Modified: trunk/reactos/dll/cpl/input_new/input.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/input_new/input.h?…
============================================================================== --- trunk/reactos/dll/cpl/input_new/input.h [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/input_new/input.h [iso-8859-1] Tue Aug 9 14:01:52 2016 @@ -51,6 +51,15 @@ INT_PTR CALLBACK AddDialogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); +/* edit_dialog.c */ +INT_PTR CALLBACK +EditDialogProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); + +/* key_settings_dialog.c */ +INT_PTR CALLBACK +KeySettingsDialogProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); + + static inline WCHAR* DublicateString(const WCHAR *pszString) { Modified: trunk/reactos/dll/cpl/input_new/input_list.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/input_new/input_li…
============================================================================== --- trunk/reactos/dll/cpl/input_new/input_list.c [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/input_new/input_list.c [iso-8859-1] Tue Aug 9 14:01:52 2016 @@ -44,8 +44,8 @@ } -VOID -InputList_Remove(INPUT_LIST_NODE *pNode) +static VOID +InputList_RemoveNode(INPUT_LIST_NODE *pNode) { INPUT_LIST_NODE *pCurrent = pNode; @@ -57,6 +57,7 @@ INPUT_LIST_NODE *pNext = pCurrent->pNext; INPUT_LIST_NODE *pPrev = pCurrent->pPrev; + free(pCurrent->pszIndicator); free(pCurrent); if (pNext != NULL) @@ -84,6 +85,7 @@ { INPUT_LIST_NODE *pNext = pCurrent->pNext; + free(pCurrent->pszIndicator); free(pCurrent); pCurrent = pNext; @@ -234,7 +236,7 @@ if (UnloadKeyboardLayout(pCurrent->hkl)) { - InputList_Remove(pCurrent); + InputList_RemoveNode(pCurrent); } } @@ -267,12 +269,16 @@ } /* Add methods to registry */ - for (pCurrent = _InputList, dwIndex = 2; pCurrent != NULL; pCurrent = pCurrent->pNext, dwIndex++) + dwIndex = 2; + + for (pCurrent = _InputList; pCurrent != NULL; pCurrent = pCurrent->pNext) { if (pCurrent->dwFlags & INPUT_LIST_NODE_FLAG_DEFAULT) continue; InputList_AddInputMethodToUserRegistry(dwIndex, pCurrent); + + dwIndex++; } } @@ -280,6 +286,7 @@ VOID InputList_Add(LOCALE_LIST_NODE *pLocale, LAYOUT_LIST_NODE *pLayout) { + WCHAR szIndicator[MAX_STR_LEN]; INPUT_LIST_NODE *pInput; if (pLocale == NULL || pLayout == NULL) @@ -293,6 +300,64 @@ pInput->pLocale = pLocale; pInput->pLayout = pLayout; + + if (GetLocaleInfoW(LOWORD(pInput->pLocale->dwId), + LOCALE_SABBREVLANGNAME | LOCALE_NOUSEROVERRIDE, + szIndicator, + ARRAYSIZE(szIndicator))) + { + size_t len = wcslen(szIndicator); + + if (len > 0) + { + szIndicator[len - 1] = 0; + pInput->pszIndicator = DublicateString(szIndicator); + } + } +} + + +VOID +InputList_SetDefault(INPUT_LIST_NODE *pNode) +{ + INPUT_LIST_NODE *pCurrent; + + if (pNode == NULL) + return; + + for (pCurrent = _InputList; pCurrent != NULL; pCurrent = pCurrent->pNext) + { + if (pCurrent == pNode) + { + pCurrent->dwFlags |= INPUT_LIST_NODE_FLAG_DEFAULT; + } + else + { + pCurrent->dwFlags &= ~INPUT_LIST_NODE_FLAG_DEFAULT; + } + } +} + + +VOID +InputList_Remove(INPUT_LIST_NODE *pNode) +{ + if (pNode == NULL) + return; + + pNode->dwFlags |= INPUT_LIST_NODE_FLAG_DELETED; + + if (pNode->dwFlags & INPUT_LIST_NODE_FLAG_DEFAULT) + { + if (pNode->pNext != NULL) + { + pNode->pNext->dwFlags |= INPUT_LIST_NODE_FLAG_DEFAULT; + } + else if (pNode->pPrev != NULL) + { + pNode->pPrev->dwFlags |= INPUT_LIST_NODE_FLAG_DEFAULT; + } + } } @@ -318,14 +383,42 @@ if (pLocale != NULL && pLayout != NULL) { + WCHAR szIndicator[MAX_STR_LEN] = { 0 }; INPUT_LIST_NODE *pInput; + HKL hklDefault; pInput = InputList_AppendNode(); - pInput->dwFlags = 0; pInput->pLocale = pLocale; pInput->pLayout = pLayout; pInput->hkl = pLayoutList[iIndex]; + + if (SystemParametersInfoW(SPI_GETDEFAULTINPUTLANG, + 0, + (LPVOID)((LPDWORD)&hklDefault), + 0) == FALSE) + { + hklDefault = GetKeyboardLayout(0); + } + + if (pInput->hkl == hklDefault) + { + pInput->dwFlags |= INPUT_LIST_NODE_FLAG_DEFAULT; + } + + if (GetLocaleInfoW(LOWORD(pInput->pLocale->dwId), + LOCALE_SABBREVLANGNAME | LOCALE_NOUSEROVERRIDE, + szIndicator, + ARRAYSIZE(szIndicator))) + { + size_t len = wcslen(szIndicator); + + if (len > 0) + { + szIndicator[len - 1] = 0; + pInput->pszIndicator = DublicateString(szIndicator); + } + } } } } @@ -336,7 +429,7 @@ INPUT_LIST_NODE* -InputList_Get(VOID) +InputList_GetFirst(VOID) { return _InputList; } Modified: trunk/reactos/dll/cpl/input_new/input_list.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/input_new/input_li…
============================================================================== --- trunk/reactos/dll/cpl/input_new/input_list.h [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/input_new/input_list.h [iso-8859-1] Tue Aug 9 14:01:52 2016 @@ -20,6 +20,8 @@ HKL hkl; + WCHAR *pszIndicator; + struct _INPUT_LIST_NODE *pPrev; struct _INPUT_LIST_NODE *pNext; } INPUT_LIST_NODE; @@ -35,10 +37,13 @@ InputList_Add(LOCALE_LIST_NODE *pLocale, LAYOUT_LIST_NODE *pLayout); VOID +InputList_SetDefault(INPUT_LIST_NODE *pNode); + +VOID InputList_Remove(INPUT_LIST_NODE *pNode); VOID InputList_Destroy(VOID); INPUT_LIST_NODE* -InputList_Get(VOID); +InputList_GetFirst(VOID); Modified: trunk/reactos/dll/cpl/input_new/key_settings_dialog.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/input_new/key_sett…
============================================================================== --- trunk/reactos/dll/cpl/input_new/key_settings_dialog.c [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/input_new/key_settings_dialog.c [iso-8859-1] Tue Aug 9 14:01:52 2016 @@ -6,3 +6,33 @@ */ #include "input.h" + + +INT_PTR CALLBACK +KeySettingsDialogProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) +{ + UNREFERENCED_PARAMETER(lParam); + + switch (uMsg) + { + case WM_INITDIALOG: + break; + + case WM_COMMAND: + { + switch (LOWORD(wParam)) + { + case IDOK: + EndDialog(hDlg, LOWORD(wParam)); + break; + + case IDCANCEL: + EndDialog(hDlg, LOWORD(wParam)); + break; + } + } + break; + } + + return FALSE; +} Modified: trunk/reactos/dll/cpl/input_new/layout_list.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/input_new/layout_l…
============================================================================== --- trunk/reactos/dll/cpl/input_new/layout_list.c [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/input_new/layout_list.c [iso-8859-1] Tue Aug 9 14:01:52 2016 @@ -12,12 +12,12 @@ static LAYOUT_LIST_NODE* -LayoutList_Append(DWORD dwId, DWORD dwSpecialId, const WCHAR *pszName, const WCHAR *pszFile) +LayoutList_AppendNode(DWORD dwId, DWORD dwSpecialId, const WCHAR *pszName) { LAYOUT_LIST_NODE *pCurrent; LAYOUT_LIST_NODE *pNew; - if (pszName == NULL || pszFile == NULL) + if (pszName == NULL) return NULL; pCurrent = _LayoutList; @@ -35,14 +35,6 @@ return NULL; } - pNew->pszFile = DublicateString(pszFile); - if (pNew->pszFile == NULL) - { - free(pNew->pszName); - free(pNew); - return NULL; - } - pNew->dwId = dwId; pNew->dwSpecialId = dwSpecialId; @@ -80,7 +72,6 @@ LAYOUT_LIST_NODE *pNext = pCurrent->pNext; free(pCurrent->pszName); - free(pCurrent->pszFile); free(pCurrent); pCurrent = pNext; @@ -163,10 +154,7 @@ { DWORD dwLayoutId = DWORDfromString(szLayoutId); - LayoutList_Append(dwLayoutId, - dwSpecialId, - szBuffer, - szFilePath); + LayoutList_AppendNode(dwLayoutId, dwSpecialId, szBuffer); } } } @@ -215,7 +203,7 @@ LAYOUT_LIST_NODE* -LayoutList_Get(VOID) +LayoutList_GetFirst(VOID) { return _LayoutList; } Modified: trunk/reactos/dll/cpl/input_new/layout_list.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/input_new/layout_l…
============================================================================== --- trunk/reactos/dll/cpl/input_new/layout_list.h [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/input_new/layout_list.h [iso-8859-1] Tue Aug 9 14:01:52 2016 @@ -5,9 +5,10 @@ typedef struct _LAYOUT_LIST_NODE { WCHAR *pszName; - WCHAR *pszFile; + DWORD dwId; DWORD dwSpecialId; + struct _LAYOUT_LIST_NODE *pPrev; struct _LAYOUT_LIST_NODE *pNext; } LAYOUT_LIST_NODE; @@ -22,4 +23,4 @@ LayoutList_GetByHkl(HKL hkl); LAYOUT_LIST_NODE* -LayoutList_Get(VOID); +LayoutList_GetFirst(VOID); Modified: trunk/reactos/dll/cpl/input_new/locale_list.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/input_new/locale_l…
============================================================================== --- trunk/reactos/dll/cpl/input_new/locale_list.c [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/input_new/locale_list.c [iso-8859-1] Tue Aug 9 14:01:52 2016 @@ -12,12 +12,12 @@ static LOCALE_LIST_NODE* -LocaleList_Append(DWORD dwId, const WCHAR *pszName, const WCHAR *pszIndicator) +LocaleList_Append(DWORD dwId, const WCHAR *pszName) { LOCALE_LIST_NODE *pCurrent; LOCALE_LIST_NODE *pNew; - if (pszName == NULL || pszIndicator == NULL) + if (pszName == NULL) return NULL; pCurrent = _LocaleList; @@ -31,14 +31,6 @@ pNew->pszName = DublicateString(pszName); if (pNew->pszName == NULL) { - free(pNew); - return NULL; - } - - pNew->pszIndicator = DublicateString(pszIndicator); - if (pNew->pszIndicator == NULL) - { - free(pNew->pszName); free(pNew); return NULL; } @@ -79,7 +71,6 @@ LOCALE_LIST_NODE *pNext = pCurrent->pNext; free(pCurrent->pszName); - free(pCurrent->pszIndicator); free(pCurrent); pCurrent = pNext; @@ -121,22 +112,7 @@ LOCALE_SLANGUAGE, szName, ARRAYSIZE(szName))) { - WCHAR szIndicator[MAX_STR_LEN] = { 0 }; - - if (GetLocaleInfoW(LOWORD(dwId), - LOCALE_SABBREVLANGNAME | LOCALE_NOUSEROVERRIDE, - szIndicator, - ARRAYSIZE(szIndicator))) - { - size_t len = wcslen(szIndicator); - - if (len > 0) - { - szIndicator[len - 1] = 0; - } - } - - LocaleList_Append(dwId, szName, szIndicator); + LocaleList_Append(dwId, szName); } dwSize = sizeof(szValue); @@ -165,7 +141,7 @@ LOCALE_LIST_NODE* -LocaleList_Get(VOID) +LocaleList_GetFirst(VOID) { return _LocaleList; } Modified: trunk/reactos/dll/cpl/input_new/locale_list.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/input_new/locale_l…
============================================================================== --- trunk/reactos/dll/cpl/input_new/locale_list.h [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/input_new/locale_list.h [iso-8859-1] Tue Aug 9 14:01:52 2016 @@ -5,8 +5,9 @@ typedef struct _LOCALE_LIST_NODE { WCHAR *pszName; - WCHAR *pszIndicator; + DWORD dwId; + struct _LOCALE_LIST_NODE *pPrev; struct _LOCALE_LIST_NODE *pNext; } LOCALE_LIST_NODE; @@ -21,4 +22,4 @@ LocaleList_GetByHkl(HKL hkl); LOCALE_LIST_NODE* -LocaleList_Get(VOID); +LocaleList_GetFirst(VOID); Modified: trunk/reactos/dll/cpl/input_new/settings_page.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/input_new/settings…
============================================================================== --- trunk/reactos/dll/cpl/input_new/settings_page.c [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/input_new/settings_page.c [iso-8859-1] Tue Aug 9 14:01:52 2016 @@ -99,7 +99,7 @@ { HICON hLayoutIcon; - hLayoutIcon = CreateLayoutIcon(pInputNode->pLocale->pszIndicator); + hLayoutIcon = CreateLayoutIcon(pInputNode->pszIndicator); if (hLayoutIcon != NULL) { @@ -136,11 +136,14 @@ ListView_DeleteAllItems(hwndList); - for (pCurrentInputNode = InputList_Get(); + for (pCurrentInputNode = InputList_GetFirst(); pCurrentInputNode != NULL; pCurrentInputNode = pCurrentInputNode->pNext) { - AddToInputListView(hwndList, pCurrentInputNode); + if (!(pCurrentInputNode->dwFlags & INPUT_LIST_NODE_FLAG_DELETED)) + { + AddToInputListView(hwndList, pCurrentInputNode); + } } } @@ -158,7 +161,6 @@ if (hwndInputList != NULL) { - INPUT_LIST_NODE *pCurrentInputNode; WCHAR szBuffer[MAX_STR_LEN]; HIMAGELIST hLayoutImageList; LV_COLUMN column; @@ -191,12 +193,7 @@ ListView_SetImageList(hwndInputList, hLayoutImageList, LVSIL_SMALL); } - for (pCurrentInputNode = InputList_Get(); - pCurrentInputNode != NULL; - pCurrentInputNode = pCurrentInputNode->pNext) - { - AddToInputListView(hwndInputList, pCurrentInputNode); - } + UpdateInputListView(hwndInputList); } } @@ -239,25 +236,74 @@ case IDC_REMOVE_BUTTON: { - PropSheet_Changed(GetParent(hwndDlg), hwndDlg); + HWND hwndList = GetDlgItem(hwndDlg, IDC_KEYLAYOUT_LIST); + + if (hwndList != NULL) + { + LVITEM item = { 0 }; + + item.mask = LVIF_PARAM; + item.iItem = ListView_GetNextItem(hwndList, -1, LVNI_SELECTED); + + if (ListView_GetItem(hwndList, &item) != FALSE) + { + InputList_Remove((INPUT_LIST_NODE*)item.lParam); + UpdateInputListView(GetDlgItem(hwndDlg, IDC_KEYLAYOUT_LIST)); + PropSheet_Changed(GetParent(hwndDlg), hwndDlg); + } + } } break; case IDC_PROP_BUTTON: { - + if (DialogBoxW(hApplet, + MAKEINTRESOURCEW(IDD_INPUT_LANG_PROP), + hwndDlg, + EditDialogProc) == IDOK) + { + UpdateInputListView(GetDlgItem(hwndDlg, IDC_KEYLAYOUT_LIST)); + PropSheet_Changed(GetParent(hwndDlg), hwndDlg); + } } break; case IDC_SET_DEFAULT: { - PropSheet_Changed(GetParent(hwndDlg), hwndDlg); + HWND hwndList = GetDlgItem(hwndDlg, IDC_KEYLAYOUT_LIST); + + if (hwndList != NULL) + { + LVITEM item = { 0 }; + + item.mask = LVIF_PARAM; + item.iItem = ListView_GetNextItem(hwndList, -1, LVNI_SELECTED); + + if (ListView_GetItem(hwndList, &item) != FALSE) + { + INPUT_LIST_NODE *pSelected; + + pSelected = (INPUT_LIST_NODE*) item.lParam; + if (pSelected != NULL) + { + InputList_SetDefault(pSelected); + } + + PropSheet_Changed(GetParent(hwndDlg), hwndDlg); + } + } } break; case IDC_KEY_SET_BTN: { - + if (DialogBoxW(hApplet, + MAKEINTRESOURCEW(IDD_KEYSETTINGS), + hwndDlg, + KeySettingsDialogProc) == IDOK) + { + PropSheet_Changed(GetParent(hwndDlg), hwndDlg); + } } break; }
8 years, 4 months
1
0
0
0
[pschweitzer] 72165: [KMTESTS:CC] Complete the tests for Cc: not only check for alignment, but also check that expected data are returned. Thanks to Thomas for his help on this :-). CORE-11003
by pschweitzer@svn.reactos.org
Author: pschweitzer Date: Tue Aug 9 12:43:18 2016 New Revision: 72165 URL:
http://svn.reactos.org/svn/reactos?rev=72165&view=rev
Log: [KMTESTS:CC] Complete the tests for Cc: not only check for alignment, but also check that expected data are returned. Thanks to Thomas for his help on this :-). CORE-11003 Modified: trunk/rostests/kmtests/ntos_cc/CcCopyRead_drv.c trunk/rostests/kmtests/ntos_cc/CcCopyRead_user.c Modified: trunk/rostests/kmtests/ntos_cc/CcCopyRead_drv.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/kmtests/ntos_cc/CcCopyRea…
============================================================================== --- trunk/rostests/kmtests/ntos_cc/CcCopyRead_drv.c [iso-8859-1] (original) +++ trunk/rostests/kmtests/ntos_cc/CcCopyRead_drv.c [iso-8859-1] Tue Aug 9 12:43:18 2016 @@ -118,17 +118,34 @@ static PVOID -MapUserBuffer( - _In_ _Out_ PIRP Irp) -{ +MapAndLockUserBuffer( + _In_ _Out_ PIRP Irp, + _In_ ULONG BufferLength) +{ + PMDL Mdl; + if (Irp->MdlAddress == NULL) { - return Irp->UserBuffer; - } - else - { - return MmGetSystemAddressForMdlSafe(Irp->MdlAddress, NormalPagePriority); - } + Mdl = IoAllocateMdl(Irp->UserBuffer, BufferLength, FALSE, FALSE, Irp); + if (Mdl == NULL) + { + return NULL; + } + + _SEH2_TRY + { + MmProbeAndLockPages(Mdl, Irp->RequestorMode, IoWriteAccess); + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + IoFreeMdl(Mdl); + Irp->MdlAddress = NULL; + _SEH2_YIELD(return NULL); + } + _SEH2_END; + } + + return MmGetSystemAddressForMdlSafe(Irp->MdlAddress, NormalPagePriority); } @@ -184,7 +201,7 @@ Fcb->Header.FileSize.QuadPart = 512; Fcb->Header.ValidDataLength.QuadPart = 512; } - Fcb->Header.IsFastIoPossible = FALSE; + Fcb->Header.IsFastIoPossible = FastIoIsNotPossible; IoStack->FileObject->FsContext = Fcb; IoStack->FileObject->SectionObjectPointer = &Fcb->SectionObjectPointers; @@ -214,7 +231,7 @@ ok(Offset.QuadPart % 512 != 0, "Offset is aligned: %I64i\n", Offset.QuadPart); ok(Length % 512 != 0, "Length is aligned: %I64i\n", Length); - Buffer = MapUserBuffer(Irp); + Buffer = Irp->AssociatedIrp.SystemBuffer; ok(Buffer != NULL, "Null pointer!\n"); _SEH2_TRY @@ -230,13 +247,34 @@ _SEH2_END; Status = Irp->IoStatus.Status; + + if (NT_SUCCESS(Status)) + { + if (Offset.QuadPart <= 1000LL && Offset.QuadPart + Length > 1000LL) + { + ok_eq_hex(*(PUSHORT)((ULONG_PTR)Buffer + (ULONG_PTR)(1000LL - Offset.QuadPart)), 0xFFFF); + } + else + { + ok_eq_hex(*(PUSHORT)Buffer, 0xBABA); + } + } } else { ok(Offset.QuadPart % 512 == 0, "Offset is not aligned: %I64i\n", Offset.QuadPart); ok(Length % 512 == 0, "Length is not aligned: %I64i\n", Length); + ok(Irp->AssociatedIrp.SystemBuffer == NULL, "A SystemBuffer was allocated!\n"); + Buffer = MapAndLockUserBuffer(Irp, Length); + ok(Buffer != NULL, "Null pointer!\n"); + RtlFillMemory(Buffer, Length, 0xBA); + Status = STATUS_SUCCESS; + if (Offset.QuadPart <= 1000LL && Offset.QuadPart + Length > 1000LL) + { + *(PUSHORT)((ULONG_PTR)Buffer + (ULONG_PTR)(1000LL - Offset.QuadPart)) = 0xFFFF; + } } if (NT_SUCCESS(Status)) Modified: trunk/rostests/kmtests/ntos_cc/CcCopyRead_user.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/kmtests/ntos_cc/CcCopyRea…
============================================================================== --- trunk/rostests/kmtests/ntos_cc/CcCopyRead_user.c [iso-8859-1] (original) +++ trunk/rostests/kmtests/ntos_cc/CcCopyRead_user.c [iso-8859-1] Tue Aug 9 12:43:18 2016 @@ -28,10 +28,19 @@ ByteOffset.QuadPart = 3; Status = NtReadFile(Handle, NULL, NULL, NULL, &IoStatusBlock, Buffer, 3, &ByteOffset, NULL); ok_eq_hex(Status, STATUS_SUCCESS); + ok_eq_hex(((USHORT *)Buffer)[0], 0xBABA); ByteOffset.QuadPart = 514; Status = NtReadFile(Handle, NULL, NULL, NULL, &IoStatusBlock, Buffer, 514, &ByteOffset, NULL); ok_eq_hex(Status, STATUS_SUCCESS); + ok_eq_hex(((USHORT *)Buffer)[242], 0xBABA); + ok_eq_hex(((USHORT *)Buffer)[243], 0xFFFF); + + ByteOffset.QuadPart = 1000; + Status = NtReadFile(Handle, NULL, NULL, NULL, &IoStatusBlock, Buffer, 2, &ByteOffset, NULL); + ok_eq_hex(Status, STATUS_SUCCESS); + ok_eq_hex(((USHORT *)Buffer)[0], 0xFFFF); + ok_eq_hex(((USHORT *)Buffer)[1], 0xBABA); NtClose(Handle); @@ -42,14 +51,24 @@ ByteOffset.QuadPart = 3; Status = NtReadFile(Handle, NULL, NULL, NULL, &IoStatusBlock, Buffer, 3, &ByteOffset, NULL); ok_eq_hex(Status, STATUS_SUCCESS); + ok_eq_hex(((USHORT *)Buffer)[0], 0xBABA); ByteOffset.QuadPart = 514; Status = NtReadFile(Handle, NULL, NULL, NULL, &IoStatusBlock, Buffer, 514, &ByteOffset, NULL); ok_eq_hex(Status, STATUS_SUCCESS); + ok_eq_hex(((USHORT *)Buffer)[242], 0xBABA); + ok_eq_hex(((USHORT *)Buffer)[243], 0xFFFF); ByteOffset.QuadPart = 300000; Status = NtReadFile(Handle, NULL, NULL, NULL, &IoStatusBlock, Buffer, 10, &ByteOffset, NULL); ok_eq_hex(Status, STATUS_SUCCESS); + ok_eq_hex(((USHORT *)Buffer)[0], 0xBABA); + + ByteOffset.QuadPart = 1000; + Status = NtReadFile(Handle, NULL, NULL, NULL, &IoStatusBlock, Buffer, 2, &ByteOffset, NULL); + ok_eq_hex(Status, STATUS_SUCCESS); + ok_eq_hex(((USHORT *)Buffer)[0], 0xFFFF); + ok_eq_hex(((USHORT *)Buffer)[1], 0xBABA); NtClose(Handle);
8 years, 4 months
1
0
0
0
[tfaber] 72164: [NTOS:CC] - Gracefully handle failure to obtain virtual memory when creating a VACB. We now no longer crash when running out of virtual memory during (large) file operations (but wi...
by tfaber@svn.reactos.org
Author: tfaber Date: Tue Aug 9 07:59:07 2016 New Revision: 72164 URL:
http://svn.reactos.org/svn/reactos?rev=72164&view=rev
Log: [NTOS:CC] - Gracefully handle failure to obtain virtual memory when creating a VACB. We now no longer crash when running out of virtual memory during (large) file operations (but will still crash when running out of physical memory). CORE-11533 Modified: trunk/reactos/ntoskrnl/cc/view.c Modified: trunk/reactos/ntoskrnl/cc/view.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/cc/view.c?rev=721…
============================================================================== --- trunk/reactos/ntoskrnl/cc/view.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/cc/view.c [iso-8859-1] Tue Aug 9 07:59:07 2016 @@ -594,7 +594,8 @@ MmUnlockAddressSpace(MmGetKernelAddressSpace()); if (!NT_SUCCESS(Status)) { - KeBugCheck(CACHE_MANAGER); + DPRINT1("MmCreateMemoryArea failed with %lx for VACB %p\n", Status, Vacb); + return Status; } ASSERT(((ULONG_PTR)Vacb->BaseAddress % PAGE_SIZE) == 0); @@ -746,6 +747,13 @@ #endif Status = CcRosMapVacb(current); + if (!NT_SUCCESS(Status)) + { + RemoveEntryList(¤t->CacheMapVacbListEntry); + RemoveEntryList(¤t->VacbLruListEntry); + CcRosReleaseVacbLock(current); + ExFreeToNPagedLookasideList(&VacbLookasideList, current); + } return Status; }
8 years, 4 months
1
0
0
0
[tfaber] 72163: [NTOS:MM] - Correctly reserve the whole 4 MB of HAL address space instead of just 2 pages CORE-11533
by tfaber@svn.reactos.org
Author: tfaber Date: Tue Aug 9 07:48:09 2016 New Revision: 72163 URL:
http://svn.reactos.org/svn/reactos?rev=72163&view=rev
Log: [NTOS:MM] - Correctly reserve the whole 4 MB of HAL address space instead of just 2 pages CORE-11533 Modified: trunk/reactos/ntoskrnl/mm/mminit.c Modified: trunk/reactos/ntoskrnl/mm/mminit.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/mminit.c?rev=7…
============================================================================== --- trunk/reactos/ntoskrnl/mm/mminit.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/mminit.c [iso-8859-1] Tue Aug 9 07:48:09 2016 @@ -100,22 +100,21 @@ // Paged pool MiCreateArm3StaticMemoryArea(MmPagedPoolStart, MmSizeOfPagedPoolInBytes, FALSE); + // Debugger mapping + MiCreateArm3StaticMemoryArea(MI_DEBUG_MAPPING, PAGE_SIZE, FALSE); + +#if defined(_X86_) + // Reserved HAL area (includes KUSER_SHARED_DATA and KPCR) + MiCreateArm3StaticMemoryArea((PVOID)MM_HAL_VA_START, MM_HAL_VA_END - MM_HAL_VA_START + 1, FALSE); +#else /* _X86_ */ #ifndef _M_AMD64 // KPCR, one page per CPU. Only for 32-bit kernel. MiCreateArm3StaticMemoryArea(PCR, PAGE_SIZE * KeNumberProcessors, FALSE); -#endif +#endif /* _M_AMD64 */ // KUSER_SHARED_DATA MiCreateArm3StaticMemoryArea((PVOID)KI_USER_SHARED_DATA, PAGE_SIZE, FALSE); - - // Debugger mapping - MiCreateArm3StaticMemoryArea(MI_DEBUG_MAPPING, PAGE_SIZE, FALSE); - -#if defined(_X86_) - // Reserve the 2 pages we currently make use of for HAL mappings. - // TODO: Remove hard-coded constant and replace with a define. - MiCreateArm3StaticMemoryArea((PVOID)0xFFC00000, PAGE_SIZE * 2, FALSE); -#endif +#endif /* _X86_ */ } VOID
8 years, 4 months
1
0
0
0
[tfaber] 72162: [NTOS:MM] - Accept memory areas that end at 0xffffffff CORE-11533
by tfaber@svn.reactos.org
Author: tfaber Date: Tue Aug 9 07:43:51 2016 New Revision: 72162 URL:
http://svn.reactos.org/svn/reactos?rev=72162&view=rev
Log: [NTOS:MM] - Accept memory areas that end at 0xffffffff CORE-11533 Modified: trunk/reactos/ntoskrnl/mm/marea.c Modified: trunk/reactos/ntoskrnl/mm/marea.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/marea.c?rev=72…
============================================================================== --- trunk/reactos/ntoskrnl/mm/marea.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/marea.c [iso-8859-1] Tue Aug 9 07:43:51 2016 @@ -175,7 +175,7 @@ marea->VadNode.u.VadFlags.Protection = MiMakeProtectionMask(marea->Protect); /* Build a lame VAD if this is a user-space allocation */ - if (MA_GetEndingAddress(marea) < (ULONG_PTR)MmSystemRangeStart) + if (marea->EndingVpn + 1 < (ULONG_PTR)MmSystemRangeStart >> PAGE_SHIFT) { ASSERT(Process != NULL); if (marea->Type != MEMORY_AREA_OWNED_BY_ARM3) @@ -360,7 +360,7 @@ //if (MemoryArea->VadNode.StartingVpn < (ULONG_PTR)MmSystemRangeStart >> PAGE_SHIFT if (MemoryArea->Vad) { - ASSERT(MA_GetEndingAddress(MemoryArea) < (ULONG_PTR)MmSystemRangeStart); + ASSERT(MemoryArea->EndingVpn + 1 < (ULONG_PTR)MmSystemRangeStart >> PAGE_SHIFT); ASSERT(MemoryArea->Type == MEMORY_AREA_SECTION_VIEW || MemoryArea->Type == MEMORY_AREA_CACHE); /* MmCleanProcessAddressSpace might have removed it (and this would be MmDeleteProcessAdressSpace) */
8 years, 4 months
1
0
0
0
[tfaber] 72161: [NTOS:MM] - In debug builds, invalidate the MEMORY_AREA's Magic on destroy to catch potential uses after free
by tfaber@svn.reactos.org
Author: tfaber Date: Tue Aug 9 07:28:02 2016 New Revision: 72161 URL:
http://svn.reactos.org/svn/reactos?rev=72161&view=rev
Log: [NTOS:MM] - In debug builds, invalidate the MEMORY_AREA's Magic on destroy to catch potential uses after free Modified: trunk/reactos/ntoskrnl/mm/marea.c Modified: trunk/reactos/ntoskrnl/mm/marea.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/marea.c?rev=72…
============================================================================== --- trunk/reactos/ntoskrnl/mm/marea.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/marea.c [iso-8859-1] Tue Aug 9 07:28:02 2016 @@ -378,6 +378,9 @@ } } +#if DBG + MemoryArea->Magic = 'daeD'; +#endif ExFreePoolWithTag(MemoryArea, TAG_MAREA); DPRINT("MmFreeMemoryAreaByNode() succeeded\n");
8 years, 4 months
1
0
0
0
[dchapyshev] 72160: [INPUT] - Implement add input methods - Some improvents
by dchapyshev@svn.reactos.org
Author: dchapyshev Date: Mon Aug 8 20:30:36 2016 New Revision: 72160 URL:
http://svn.reactos.org/svn/reactos?rev=72160&view=rev
Log: [INPUT] - Implement add input methods - Some improvents Added: trunk/reactos/dll/cpl/input_new/add_dialog.c (with props) trunk/reactos/dll/cpl/input_new/advanced_settings_page.c (with props) trunk/reactos/dll/cpl/input_new/edit_dialog.c (with props) trunk/reactos/dll/cpl/input_new/input_list.c (with props) trunk/reactos/dll/cpl/input_new/input_list.h (with props) trunk/reactos/dll/cpl/input_new/key_settings_dialog.c (with props) Modified: trunk/reactos/dll/cpl/input_new/CMakeLists.txt trunk/reactos/dll/cpl/input_new/input.c trunk/reactos/dll/cpl/input_new/input.h trunk/reactos/dll/cpl/input_new/layout_list.c trunk/reactos/dll/cpl/input_new/layout_list.h trunk/reactos/dll/cpl/input_new/locale_list.c trunk/reactos/dll/cpl/input_new/locale_list.h trunk/reactos/dll/cpl/input_new/settings_page.c Modified: trunk/reactos/dll/cpl/input_new/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/input_new/CMakeLis…
============================================================================== --- trunk/reactos/dll/cpl/input_new/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/input_new/CMakeLists.txt [iso-8859-1] Mon Aug 8 20:30:36 2016 @@ -1,14 +1,21 @@ +PROJECT(INPUT_NEW) spec2def(input_new.dll input.spec) list(APPEND SOURCE input.c input.h + input_list.c + input_list.h layout_list.c layout_list.h locale_list.c locale_list.h - settings_page.c) + settings_page.c + advanced_settings_page.c + add_dialog.c + edit_dialog.c + key_settings_dialog.c) add_rc_deps(input.rc ${CMAKE_CURRENT_SOURCE_DIR}/resources/keyboard-shortcuts.ico) @@ -18,6 +25,6 @@ ${CMAKE_CURRENT_BINARY_DIR}/input_new.def) set_module_type(input_new win32dll UNICODE) -add_importlibs(input_new advapi32 user32 comctl32 gdi32 msvcrt kernel32) +add_importlibs(input_new advapi32 user32 comctl32 gdi32 msvcrt kernel32 setupapi) add_pch(input_new input.h SOURCE) add_cd_file(TARGET input_new DESTINATION reactos/system32 FOR all) Added: trunk/reactos/dll/cpl/input_new/add_dialog.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/input_new/add_dial…
============================================================================== --- trunk/reactos/dll/cpl/input_new/add_dialog.c (added) +++ trunk/reactos/dll/cpl/input_new/add_dialog.c [iso-8859-1] Mon Aug 8 20:30:36 2016 @@ -0,0 +1,192 @@ +/* +* PROJECT: input.dll +* FILE: dll/cpl/input/add_dialog.c +* PURPOSE: input.dll +* PROGRAMMER: Dmitry Chapyshev (dmitry(a)reactos.org) +*/ + +#include "input.h" +#include "locale_list.h" +#include "layout_list.h" +#include "input_list.h" + + +static DWORD +GetDefaultLayoutForLocale(DWORD dwLocaleId) +{ + DWORD dwResult = 0; + HINF hIntlInf; + + hIntlInf = SetupOpenInfFileW(L"intl.inf", NULL, INF_STYLE_WIN4, NULL); + if (hIntlInf != INVALID_HANDLE_VALUE) + { + WCHAR szLangID[MAX_STR_LEN]; + INFCONTEXT InfContext; + + StringCchPrintfW(szLangID, ARRAYSIZE(szLangID), L"%08X", dwLocaleId); + + if (SetupFindFirstLineW(hIntlInf, L"Locales", szLangID, &InfContext)) + { + if (SetupGetFieldCount(&InfContext) >= 5) + { + WCHAR szField[MAX_STR_LEN]; + + if (SetupGetStringFieldW(&InfContext, 5, szField, ARRAYSIZE(szField), NULL)) + { + if (wcslen(szField) == 13) // like 0409:00000409 (13 chars) + { + WCHAR *pszSeparator = L":"; + WCHAR *pszToken; + + pszToken = wcstok(szField, pszSeparator); + if (pszToken != NULL) + pszToken = wcstok(NULL, pszSeparator); + + if (pszToken != NULL) + { + dwResult = DWORDfromString(pszToken); + } + } + } + } + } + + SetupCloseInfFile(hIntlInf); + } + + return dwResult; +} + + +static VOID +OnInitAddDialog(HWND hwndDlg) +{ + HWND hwndLocaleCombo = GetDlgItem(hwndDlg, IDC_INPUT_LANG_COMBO); + HWND hwndLayoutCombo = GetDlgItem(hwndDlg, IDC_KEYBOARD_LO_COMBO); + LOCALE_LIST_NODE *pCurrentLocale; + LAYOUT_LIST_NODE *pCurrentLayout; + DWORD dwDefaultLocaleId; + DWORD dwDefaultLayoutId; + INT iItemIndex; + + dwDefaultLocaleId = GetSystemDefaultLCID(); + + for (pCurrentLocale = LocaleList_Get(); + pCurrentLocale != NULL; + pCurrentLocale = pCurrentLocale->pNext) + { + iItemIndex = ComboBox_AddString(hwndLocaleCombo, pCurrentLocale->pszName); + ComboBox_SetItemData(hwndLocaleCombo, iItemIndex, pCurrentLocale); + + if (pCurrentLocale->dwId == dwDefaultLocaleId) + { + ComboBox_SetCurSel(hwndLocaleCombo, iItemIndex); + } + } + + dwDefaultLayoutId = GetDefaultLayoutForLocale(dwDefaultLocaleId); + + for (pCurrentLayout = LayoutList_Get(); + pCurrentLayout != NULL; + pCurrentLayout = pCurrentLayout->pNext) + { + iItemIndex = ComboBox_AddString(hwndLayoutCombo, pCurrentLayout->pszName); + ComboBox_SetItemData(hwndLayoutCombo, iItemIndex, pCurrentLayout); + + if (pCurrentLayout->dwId == dwDefaultLayoutId) + { + ComboBox_SetCurSel(hwndLayoutCombo, iItemIndex); + } + } + + if (dwDefaultLayoutId == 0) + ComboBox_SetCurSel(hwndLayoutCombo, 0); +} + + +static VOID +OnCommandAddDialog(HWND hwndDlg, WPARAM wParam) +{ + switch (LOWORD(wParam)) + { + case IDOK: + { + HWND hwndLocaleCombo = GetDlgItem(hwndDlg, IDC_INPUT_LANG_COMBO); + HWND hwndLayoutCombo = GetDlgItem(hwndDlg, IDC_KEYBOARD_LO_COMBO); + LOCALE_LIST_NODE *pCurrentLocale; + LAYOUT_LIST_NODE *pCurrentLayout; + + pCurrentLocale = (LOCALE_LIST_NODE*)ComboBox_GetItemData(hwndLocaleCombo, + ComboBox_GetCurSel(hwndLocaleCombo)); + pCurrentLayout = (LAYOUT_LIST_NODE*)ComboBox_GetItemData(hwndLayoutCombo, + ComboBox_GetCurSel(hwndLayoutCombo)); + + InputList_Add(pCurrentLocale, pCurrentLayout); + + EndDialog(hwndDlg, LOWORD(wParam)); + } + break; + + case IDCANCEL: + { + EndDialog(hwndDlg, LOWORD(wParam)); + } + break; + + case IDC_INPUT_LANG_COMBO: + { + if (HIWORD(wParam) == CBN_SELCHANGE) + { + HWND hwndLocaleCombo = GetDlgItem(hwndDlg, IDC_INPUT_LANG_COMBO); + HWND hwndLayoutCombo = GetDlgItem(hwndDlg, IDC_KEYBOARD_LO_COMBO); + LOCALE_LIST_NODE *pCurrentLocale; + + pCurrentLocale = (LOCALE_LIST_NODE*)ComboBox_GetItemData(hwndLocaleCombo, + ComboBox_GetCurSel(hwndLocaleCombo)); + if (pCurrentLocale != NULL) + { + DWORD dwLayoutId; + INT iIndex; + INT iCount; + + dwLayoutId = GetDefaultLayoutForLocale(pCurrentLocale->dwId); + + iCount = ComboBox_GetCount(hwndLayoutCombo); + + for (iIndex = 0; iIndex < iCount; iIndex++) + { + LAYOUT_LIST_NODE *pCurrentLayout; + + pCurrentLayout = (LAYOUT_LIST_NODE*)ComboBox_GetItemData(hwndLayoutCombo, iIndex); + if (pCurrentLayout != NULL && pCurrentLayout->dwId == dwLayoutId) + { + ComboBox_SetCurSel(hwndLayoutCombo, iIndex); + } + } + } + } + } + break; + } +} + + +INT_PTR CALLBACK +AddDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) +{ + switch (uMsg) + { + case WM_INITDIALOG: + OnInitAddDialog(hwndDlg); + break; + + case WM_COMMAND: + OnCommandAddDialog(hwndDlg, wParam); + break; + + case WM_DESTROY: + break; + } + + return FALSE; +} Propchange: trunk/reactos/dll/cpl/input_new/add_dialog.c ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/cpl/input_new/advanced_settings_page.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/input_new/advanced…
============================================================================== --- trunk/reactos/dll/cpl/input_new/advanced_settings_page.c (added) +++ trunk/reactos/dll/cpl/input_new/advanced_settings_page.c [iso-8859-1] Mon Aug 8 20:30:36 2016 @@ -0,0 +1,15 @@ +/* +* PROJECT: input.dll +* FILE: dll/cpl/input/advanced_settings_page.c +* PURPOSE: input.dll +* PROGRAMMER: Dmitry Chapyshev (dmitry(a)reactos.org) +*/ + +#include "input.h" + + +INT_PTR CALLBACK +AdvancedSettingsPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) +{ + return FALSE; +} Propchange: trunk/reactos/dll/cpl/input_new/advanced_settings_page.c ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/cpl/input_new/edit_dialog.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/input_new/edit_dia…
============================================================================== --- trunk/reactos/dll/cpl/input_new/edit_dialog.c (added) +++ trunk/reactos/dll/cpl/input_new/edit_dialog.c [iso-8859-1] Mon Aug 8 20:30:36 2016 @@ -0,0 +1,8 @@ +/* +* PROJECT: input.dll +* FILE: dll/cpl/input/edit_dialog.c +* PURPOSE: input.dll +* PROGRAMMER: Dmitry Chapyshev (dmitry(a)reactos.org) +*/ + +#include "input.h" Propchange: trunk/reactos/dll/cpl/input_new/edit_dialog.c ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/dll/cpl/input_new/input.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/input_new/input.c?…
============================================================================== --- trunk/reactos/dll/cpl/input_new/input.c [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/input_new/input.c [iso-8859-1] Mon Aug 8 20:30:36 2016 @@ -14,9 +14,10 @@ #define NUM_APPLETS (1) -LONG CALLBACK SystemApplet(VOID); +static LONG CALLBACK SystemApplet(VOID); + HINSTANCE hApplet = NULL; -HWND hCPLWindow; +static HWND hCPLWindow; /* Applets */ static APPLET Applets[NUM_APPLETS] = @@ -25,35 +26,28 @@ }; -VOID -InitPropSheetPage(PROPSHEETPAGE *page, WORD idDlg, DLGPROC DlgProc) +static VOID +InitPropSheetPage(PROPSHEETPAGEW *page, WORD idDlg, DLGPROC DlgProc) { - memset(page, 0, sizeof(PROPSHEETPAGE)); + memset(page, 0, sizeof(PROPSHEETPAGEW)); - page->dwSize = sizeof(PROPSHEETPAGE); + page->dwSize = sizeof(PROPSHEETPAGEW); page->dwFlags = PSP_DEFAULT; page->hInstance = hApplet; - page->pszTemplate = MAKEINTRESOURCE(idDlg); + page->pszTemplate = MAKEINTRESOURCEW(idDlg); page->pfnDlgProc = DlgProc; } -INT_PTR CALLBACK -AdvancedSettingsPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) -{ - return FALSE; -} - - /* First Applet */ -LONG CALLBACK +static LONG CALLBACK SystemApplet(VOID) { - PROPSHEETPAGE page[2]; - PROPSHEETHEADER header; + PROPSHEETPAGEW page[2]; + PROPSHEETHEADERW header; WCHAR szCaption[MAX_STR_LEN]; - LoadString(hApplet, IDS_CPLSYSTEMNAME, szCaption, ARRAYSIZE(szCaption)); + LoadStringW(hApplet, IDS_CPLSYSTEMNAME, szCaption, ARRAYSIZE(szCaption)); memset(&header, 0, sizeof(PROPSHEETHEADER)); @@ -61,7 +55,7 @@ header.dwFlags = PSH_PROPSHEETPAGE; header.hwndParent = hCPLWindow; header.hInstance = hApplet; - header.hIcon = LoadIcon(hApplet, MAKEINTRESOURCE(IDI_CPLSYSTEM)); + header.hIcon = LoadIconW(hApplet, MAKEINTRESOURCE(IDI_CPLSYSTEM)); header.pszCaption = szCaption; header.nPages = ARRAYSIZE(page); header.nStartPage = 0; @@ -74,7 +68,7 @@ /* Advanced Settings */ InitPropSheetPage(&page[1], IDD_PROPPAGEADVANCEDSETTINGS, AdvancedSettingsPageProc); - return (LONG)(PropertySheet(&header) != -1); + return (LONG)(PropertySheetW(&header) != -1); } Modified: trunk/reactos/dll/cpl/input_new/input.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/input_new/input.h?…
============================================================================== --- trunk/reactos/dll/cpl/input_new/input.h [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/input_new/input.h [iso-8859-1] Mon Aug 8 20:30:36 2016 @@ -11,6 +11,8 @@ #include <winuser.h> #include <wingdi.h> #include <commctrl.h> +#include <windowsx.h> +#include <setupapi.h> #include <wchar.h> #include <strsafe.h> #include <stdlib.h> @@ -37,15 +39,17 @@ #define MAX_STR_LEN 256 -/* input.c */ -VOID -InitPropSheetPage(PROPSHEETPAGE *page, WORD idDlg, DLGPROC DlgProc); - -/* settings_dialog.c */ +/* settings_page.c */ INT_PTR CALLBACK SettingsPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); -void ShowLastWin32Error(HWND hWndOwner); +/* advanced_settings_page.c */ +INT_PTR CALLBACK +AdvancedSettingsPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); + +/* add_dialog.c */ +INT_PTR CALLBACK +AddDialogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); static inline WCHAR* DublicateString(const WCHAR *pszString) @@ -64,4 +68,12 @@ return pszDublicate; } +static inline DWORD +DWORDfromString(const WCHAR *pszString) +{ + WCHAR *pszEnd; + + return wcstoul(pszString, &pszEnd, 16); +} + #endif /* _INPUT_H */ Added: trunk/reactos/dll/cpl/input_new/input_list.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/input_new/input_li…
============================================================================== --- trunk/reactos/dll/cpl/input_new/input_list.c (added) +++ trunk/reactos/dll/cpl/input_new/input_list.c [iso-8859-1] Mon Aug 8 20:30:36 2016 @@ -0,0 +1,342 @@ +/* +* PROJECT: input.dll +* FILE: dll/cpl/input/input_list.c +* PURPOSE: input.dll +* PROGRAMMER: Dmitry Chapyshev (dmitry(a)reactos.org) +*/ + +#include "input_list.h" + + +static INPUT_LIST_NODE *_InputList = NULL; + + +static INPUT_LIST_NODE* +InputList_AppendNode(VOID) +{ + INPUT_LIST_NODE *pCurrent; + INPUT_LIST_NODE *pNew; + + pCurrent = _InputList; + + pNew = (INPUT_LIST_NODE*)malloc(sizeof(INPUT_LIST_NODE)); + if (pNew == NULL) + return NULL; + + memset(pNew, 0, sizeof(INPUT_LIST_NODE)); + + if (pCurrent == NULL) + { + _InputList = pNew; + } + else + { + while (pCurrent->pNext != NULL) + { + pCurrent = pCurrent->pNext; + } + + pNew->pPrev = pCurrent; + pCurrent->pNext = pNew; + } + + return pNew; +} + + +VOID +InputList_Remove(INPUT_LIST_NODE *pNode) +{ + INPUT_LIST_NODE *pCurrent = pNode; + + if (_InputList == NULL) + return; + + if (pCurrent != NULL) + { + INPUT_LIST_NODE *pNext = pCurrent->pNext; + INPUT_LIST_NODE *pPrev = pCurrent->pPrev; + + free(pCurrent); + + if (pNext != NULL) + pNext->pPrev = pPrev; + + if (pPrev != NULL) + pPrev->pNext = pNext; + else + _InputList = pNext; + } +} + + +VOID +InputList_Destroy(VOID) +{ + INPUT_LIST_NODE *pCurrent; + + if (_InputList == NULL) + return; + + pCurrent = _InputList; + + while (pCurrent != NULL) + { + INPUT_LIST_NODE *pNext = pCurrent->pNext; + + free(pCurrent); + + pCurrent = pNext; + } + + _InputList = NULL; +} + + +static BOOL +InputList_PrepareUserRegistry(VOID) +{ + BOOL bResult = FALSE; + HKEY hTempKey = NULL; + HKEY hKey = NULL; + + if (RegOpenKeyExW(HKEY_CURRENT_USER, + L"Keyboard Layout", + 0, + KEY_ALL_ACCESS, + &hKey) == ERROR_SUCCESS) + { + RegDeleteKeyW(hKey, L"Preload"); + RegDeleteKeyW(hKey, L"Substitutes"); + //RegDeleteKeyW(hKey, L"Toggle"); + + RegCloseKey(hKey); + + RegDeleteKeyW(HKEY_CURRENT_USER, L"Keyboard Layout"); + } + + if (RegCreateKeyW(HKEY_CURRENT_USER, L"Keyboard Layout", &hKey) != ERROR_SUCCESS) + { + goto Cleanup; + } + + if (RegCreateKeyW(hKey, L"Preload", &hTempKey) != ERROR_SUCCESS) + { + goto Cleanup; + } + + RegCloseKey(hTempKey); + + if (RegCreateKeyW(hKey, L"Substitutes", &hTempKey) != ERROR_SUCCESS) + { + goto Cleanup; + } + + RegCloseKey(hTempKey); + + if (RegCreateKeyW(hKey, L"Toggle", &hTempKey) != ERROR_SUCCESS) + { + goto Cleanup; + } + + RegCloseKey(hTempKey); + + bResult = TRUE; + +Cleanup: + if (hTempKey != NULL) + RegCloseKey(hTempKey); + if (hKey != NULL) + RegCloseKey(hKey); + + return bResult; +} + + +static VOID +InputList_AddInputMethodToUserRegistry(DWORD dwIndex, INPUT_LIST_NODE *pNode) +{ + WCHAR szMethodIndex[MAX_PATH]; + WCHAR szPreload[MAX_PATH]; + BOOL bIsImeMethod = FALSE; + HKEY hKey; + + StringCchPrintfW(szMethodIndex, ARRAYSIZE(szMethodIndex), L"%lu", dwIndex); + + /* Check is IME method */ + if ((HIWORD(pNode->pLayout->dwId) & 0xF000) == 0xE000) + { + StringCchPrintfW(szPreload, ARRAYSIZE(szPreload), L"%08X", pNode->pLayout->dwId); + bIsImeMethod = TRUE; + } + else + { + StringCchPrintfW(szPreload, ARRAYSIZE(szPreload), L"%08X", pNode->pLocale->dwId); + } + + if (RegOpenKeyExW(HKEY_CURRENT_USER, + L"Keyboard Layout\\Preload", + 0, + KEY_SET_VALUE, + &hKey) == ERROR_SUCCESS) + { + RegSetValueExW(hKey, + szMethodIndex, + 0, + REG_SZ, + (LPBYTE)szPreload, + (wcslen(szPreload) + 1) * sizeof(WCHAR)); + + RegCloseKey(hKey); + } + + if (pNode->pLocale->dwId != pNode->pLayout->dwId && bIsImeMethod == FALSE) + { + if (RegOpenKeyExW(HKEY_CURRENT_USER, + L"Keyboard Layout\\Substitutes", + 0, + KEY_SET_VALUE, + &hKey) == ERROR_SUCCESS) + { + WCHAR szSubstitues[MAX_PATH]; + + StringCchPrintfW(szSubstitues, ARRAYSIZE(szSubstitues), L"%08X", pNode->pLayout->dwId); + + RegSetValueExW(hKey, + szPreload, + 0, + REG_SZ, + (LPBYTE)szSubstitues, + (wcslen(szSubstitues) + 1) * sizeof(WCHAR)); + + RegCloseKey(hKey); + } + } + + if (pNode->dwFlags & INPUT_LIST_NODE_FLAG_ADDED) + { + pNode->hkl = LoadKeyboardLayoutW(szPreload, KLF_SUBSTITUTE_OK | KLF_NOTELLSHELL); + } +} + + +VOID +InputList_Process(VOID) +{ + INPUT_LIST_NODE *pCurrent; + DWORD dwIndex; + + /* Process deleted input methods */ + for (pCurrent = _InputList; pCurrent != NULL; pCurrent = pCurrent->pNext) + { + if (!(pCurrent->dwFlags & INPUT_LIST_NODE_FLAG_DELETED)) + continue; + + if (UnloadKeyboardLayout(pCurrent->hkl)) + { + InputList_Remove(pCurrent); + } + } + + InputList_PrepareUserRegistry(); + + /* Find default input method */ + for (pCurrent = _InputList; pCurrent != NULL; pCurrent = pCurrent->pNext) + { + if (pCurrent->dwFlags & INPUT_LIST_NODE_FLAG_DEFAULT) + { + InputList_AddInputMethodToUserRegistry(1, pCurrent); + break; + } + } + + if (SystemParametersInfoW(SPI_SETDEFAULTINPUTLANG, + 0, + (LPVOID)((LPDWORD)&pCurrent->hkl), + 0)) + { + DWORD dwRecipients; + + dwRecipients = BSM_ALLCOMPONENTS; + + BroadcastSystemMessageW(BSF_POSTMESSAGE, + &dwRecipients, + WM_INPUTLANGCHANGEREQUEST, + 0, + (LPARAM)pCurrent->hkl); + } + + /* Add methods to registry */ + for (pCurrent = _InputList, dwIndex = 2; pCurrent != NULL; pCurrent = pCurrent->pNext, dwIndex++) + { + if (pCurrent->dwFlags & INPUT_LIST_NODE_FLAG_DEFAULT) + continue; + + InputList_AddInputMethodToUserRegistry(dwIndex, pCurrent); + } +} + + +VOID +InputList_Add(LOCALE_LIST_NODE *pLocale, LAYOUT_LIST_NODE *pLayout) +{ + INPUT_LIST_NODE *pInput; + + if (pLocale == NULL || pLayout == NULL) + { + return; + } + + pInput = InputList_AppendNode(); + + pInput->dwFlags |= INPUT_LIST_NODE_FLAG_ADDED; + + pInput->pLocale = pLocale; + pInput->pLayout = pLayout; +} + + +VOID +InputList_Create(VOID) +{ + INT iLayoutCount; + HKL *pLayoutList; + + iLayoutCount = GetKeyboardLayoutList(0, NULL); + pLayoutList = (HKL*)malloc(iLayoutCount * sizeof(HKL)); + + if (pLayoutList != NULL) + { + if (GetKeyboardLayoutList(iLayoutCount, pLayoutList) > 0) + { + INT iIndex; + + for (iIndex = 0; iIndex < iLayoutCount; iIndex++) + { + LOCALE_LIST_NODE *pLocale = LocaleList_GetByHkl(pLayoutList[iIndex]); + LAYOUT_LIST_NODE *pLayout = LayoutList_GetByHkl(pLayoutList[iIndex]); + + if (pLocale != NULL && pLayout != NULL) + { + INPUT_LIST_NODE *pInput; + + pInput = InputList_AppendNode(); + + pInput->dwFlags = 0; + pInput->pLocale = pLocale; + pInput->pLayout = pLayout; + pInput->hkl = pLayoutList[iIndex]; + } + } + } + + free(pLayoutList); + } +} + + +INPUT_LIST_NODE* +InputList_Get(VOID) +{ + return _InputList; +} Propchange: trunk/reactos/dll/cpl/input_new/input_list.c ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/cpl/input_new/input_list.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/input_new/input_li…
============================================================================== --- trunk/reactos/dll/cpl/input_new/input_list.h (added) +++ trunk/reactos/dll/cpl/input_new/input_list.h [iso-8859-1] Mon Aug 8 20:30:36 2016 @@ -0,0 +1,44 @@ +#pragma once + +#include "input.h" +#include "locale_list.h" +#include "layout_list.h" + + +#define INPUT_LIST_NODE_FLAG_EDITED 0x00000001 +#define INPUT_LIST_NODE_FLAG_ADDED 0x00000002 +#define INPUT_LIST_NODE_FLAG_DELETED 0x00000004 +#define INPUT_LIST_NODE_FLAG_DEFAULT 0x00000008 + + +typedef struct _INPUT_LIST_NODE +{ + DWORD dwFlags; + + LOCALE_LIST_NODE *pLocale; + LAYOUT_LIST_NODE *pLayout; + + HKL hkl; + + struct _INPUT_LIST_NODE *pPrev; + struct _INPUT_LIST_NODE *pNext; +} INPUT_LIST_NODE; + + +VOID +InputList_Create(VOID); + +VOID +InputList_Process(VOID); + +VOID +InputList_Add(LOCALE_LIST_NODE *pLocale, LAYOUT_LIST_NODE *pLayout); + +VOID +InputList_Remove(INPUT_LIST_NODE *pNode); + +VOID +InputList_Destroy(VOID); + +INPUT_LIST_NODE* +InputList_Get(VOID); Propchange: trunk/reactos/dll/cpl/input_new/input_list.h ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/cpl/input_new/key_settings_dialog.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/input_new/key_sett…
============================================================================== --- trunk/reactos/dll/cpl/input_new/key_settings_dialog.c (added) +++ trunk/reactos/dll/cpl/input_new/key_settings_dialog.c [iso-8859-1] Mon Aug 8 20:30:36 2016 @@ -0,0 +1,8 @@ +/* +* PROJECT: input.dll +* FILE: dll/cpl/input/key_settings_dialog.c +* PURPOSE: input.dll +* PROGRAMMER: Dmitry Chapyshev (dmitry(a)reactos.org) +*/ + +#include "input.h" Propchange: trunk/reactos/dll/cpl/input_new/key_settings_dialog.c ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/dll/cpl/input_new/layout_list.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/input_new/layout_l…
============================================================================== --- trunk/reactos/dll/cpl/input_new/layout_list.c [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/input_new/layout_list.c [iso-8859-1] Mon Aug 8 20:30:36 2016 @@ -22,7 +22,7 @@ pCurrent = _LayoutList; - pNew = (LAYOUT_LIST_NODE*)malloc(sizeof(LAYOUT_LIST_NODE)); + pNew = (LAYOUT_LIST_NODE*) malloc(sizeof(LAYOUT_LIST_NODE)); if (pNew == NULL) return NULL; @@ -99,7 +99,10 @@ DWORD dwSize; HKEY hKey; - GetSystemDirectoryW(szSystemDirectory, ARRAYSIZE(szSystemDirectory)); + if (!GetSystemDirectoryW(szSystemDirectory, ARRAYSIZE(szSystemDirectory))) + { + return; + } if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"SYSTEM\\CurrentControlSet\\Control\\Keyboard Layouts", @@ -137,10 +140,9 @@ StringCchPrintfW(szFilePath, ARRAYSIZE(szFilePath), L"%s\\%s", szSystemDirectory, szBuffer); - if (GetFileAttributes(szFilePath) != INVALID_FILE_ATTRIBUTES) + if (GetFileAttributesW(szFilePath) != INVALID_FILE_ATTRIBUTES) { DWORD dwSpecialId = 0; - WCHAR *pszEnd; dwSize = sizeof(szBuffer); @@ -149,7 +151,7 @@ NULL, NULL, (LPBYTE)szBuffer, &dwSize) == ERROR_SUCCESS) { - dwSpecialId = wcstoul(szBuffer, &pszEnd, 16); + dwSpecialId = DWORDfromString(szBuffer); } dwSize = sizeof(szBuffer); @@ -159,9 +161,7 @@ NULL, NULL, (LPBYTE)szBuffer, &dwSize) == ERROR_SUCCESS) { - DWORD dwLayoutId; - - dwLayoutId = wcstoul(szLayoutId, &pszEnd, 16); + DWORD dwLayoutId = DWORDfromString(szLayoutId); LayoutList_Append(dwLayoutId, dwSpecialId, @@ -182,8 +182,8 @@ } -WCHAR* -LayoutList_GetNameByHkl(HKL hkl) +LAYOUT_LIST_NODE* +LayoutList_GetByHkl(HKL hkl) { LAYOUT_LIST_NODE *pCurrent; @@ -195,7 +195,7 @@ { if (dwSpecialId == pCurrent->dwSpecialId) { - return pCurrent->pszName; + return pCurrent; } } } @@ -205,7 +205,7 @@ { if (HIWORD(hkl) == LOWORD(pCurrent->dwId)) { - return pCurrent->pszName; + return pCurrent; } } } Modified: trunk/reactos/dll/cpl/input_new/layout_list.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/input_new/layout_l…
============================================================================== --- trunk/reactos/dll/cpl/input_new/layout_list.h [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/input_new/layout_list.h [iso-8859-1] Mon Aug 8 20:30:36 2016 @@ -18,8 +18,8 @@ VOID LayoutList_Destroy(VOID); -WCHAR* -LayoutList_GetNameByHkl(HKL hkl); +LAYOUT_LIST_NODE* +LayoutList_GetByHkl(HKL hkl); LAYOUT_LIST_NODE* LayoutList_Get(VOID); Modified: trunk/reactos/dll/cpl/input_new/locale_list.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/input_new/locale_l…
============================================================================== --- trunk/reactos/dll/cpl/input_new/locale_list.c [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/input_new/locale_list.c [iso-8859-1] Mon Aug 8 20:30:36 2016 @@ -12,7 +12,7 @@ static LOCALE_LIST_NODE* -LocaleList_Append(DWORD dwId, WCHAR *pszName, WCHAR *pszIndicator) +LocaleList_Append(DWORD dwId, const WCHAR *pszName, const WCHAR *pszIndicator) { LOCALE_LIST_NODE *pCurrent; LOCALE_LIST_NODE *pNew; @@ -79,6 +79,7 @@ LOCALE_LIST_NODE *pNext = pCurrent->pNext; free(pCurrent->pszName); + free(pCurrent->pszIndicator); free(pCurrent); pCurrent = pNext; @@ -112,16 +113,15 @@ NULL, NULL, NULL, NULL) == ERROR_SUCCESS) { WCHAR szName[MAX_STR_LEN]; - WCHAR *End; DWORD dwId; - dwId = wcstoul(szValue, &End, 16); + dwId = DWORDfromString(szValue); if (GetLocaleInfoW(LOWORD(dwId), LOCALE_SLANGUAGE, szName, ARRAYSIZE(szName))) { - WCHAR szIndicator[MAX_STR_LEN]; + WCHAR szIndicator[MAX_STR_LEN] = { 0 }; if (GetLocaleInfoW(LOWORD(dwId), LOCALE_SABBREVLANGNAME | LOCALE_NOUSEROVERRIDE, @@ -148,6 +148,23 @@ LOCALE_LIST_NODE* +LocaleList_GetByHkl(HKL hkl) +{ + LOCALE_LIST_NODE *pCurrent; + + for (pCurrent = _LocaleList; pCurrent != NULL; pCurrent = pCurrent->pNext) + { + if (LOWORD(pCurrent->dwId) == LOWORD(hkl)) + { + return pCurrent; + } + } + + return NULL; +} + + +LOCALE_LIST_NODE* LocaleList_Get(VOID) { return _LocaleList; Modified: trunk/reactos/dll/cpl/input_new/locale_list.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/input_new/locale_l…
============================================================================== --- trunk/reactos/dll/cpl/input_new/locale_list.h [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/input_new/locale_list.h [iso-8859-1] Mon Aug 8 20:30:36 2016 @@ -18,4 +18,7 @@ LocaleList_Destroy(VOID); LOCALE_LIST_NODE* +LocaleList_GetByHkl(HKL hkl); + +LOCALE_LIST_NODE* LocaleList_Get(VOID); Modified: trunk/reactos/dll/cpl/input_new/settings_page.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/input_new/settings…
============================================================================== --- trunk/reactos/dll/cpl/input_new/settings_page.c [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/input_new/settings_page.c [iso-8859-1] Mon Aug 8 20:30:36 2016 @@ -8,16 +8,15 @@ #include "input.h" #include "layout_list.h" #include "locale_list.h" +#include "input_list.h" static HICON CreateLayoutIcon(LPWSTR szLayout) { - HDC hdc, hdcsrc; - HBITMAP hBitmap, hBmpNew, hBmpOld; - RECT rect; - HFONT hFont = NULL; - ICONINFO IconInfo; + HDC hdc; + HDC hdcsrc; + HBITMAP hBitmap; HICON hIcon = NULL; hdcsrc = GetDC(NULL); @@ -29,11 +28,18 @@ if (hdc && hBitmap) { + HBITMAP hBmpNew; + hBmpNew = CreateBitmap(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 1, 1, NULL); if (hBmpNew) { + ICONINFO IconInfo; + HBITMAP hBmpOld; + HFONT hFont; + RECT rect; + hBmpOld = SelectObject(hdc, hBitmap); rect.right = GetSystemMetrics(SM_CXSMICON); rect.left = 0; @@ -45,12 +51,12 @@ ExtTextOut(hdc, rect.left, rect.top, ETO_OPAQUE, &rect, L"", 0, NULL); - hFont = CreateFont(-11, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, ANSI_CHARSET, - OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, - DEFAULT_QUALITY, FF_DONTCARE, L"Tahoma"); + hFont = CreateFontW(-11, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, ANSI_CHARSET, + OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, + DEFAULT_QUALITY, FF_DONTCARE, L"Tahoma"); SelectObject(hdc, hFont); - DrawText(hdc, szLayout, 2, &rect, DT_SINGLELINE|DT_CENTER|DT_VCENTER); + DrawTextW(hdc, szLayout, 2, &rect, DT_SINGLELINE|DT_CENTER|DT_VCENTER); SelectObject(hdc, hBmpNew); PatBlt(hdc, 0, 0, @@ -80,10 +86,7 @@ static VOID -AddToLayoutListView(HWND hwndList, - WCHAR *pszLanguageName, - WCHAR *pszLayoutName, - WCHAR *pszIndicatorTitle) +AddToInputListView(HWND hwndList, INPUT_LIST_NODE *pInputNode) { INT ItemIndex = -1; INT ImageIndex = -1; @@ -91,11 +94,13 @@ HIMAGELIST hImageList; hImageList = ListView_GetImageList(hwndList, LVSIL_SMALL); + if (hImageList != NULL) { HICON hLayoutIcon; - hLayoutIcon = CreateLayoutIcon(pszIndicatorTitle); + hLayoutIcon = CreateLayoutIcon(pInputNode->pLocale->pszIndicator); + if (hLayoutIcon != NULL) { ImageIndex = ImageList_AddIcon(hImageList, hLayoutIcon); @@ -106,88 +111,92 @@ memset(&item, 0, sizeof(LV_ITEM)); item.mask = LVIF_TEXT | LVIF_PARAM | LVIF_STATE | LVIF_IMAGE; - item.pszText = pszLanguageName; + item.pszText = pInputNode->pLocale->pszName; item.iItem = -1; - item.lParam = (LPARAM)NULL; + item.lParam = (LPARAM)pInputNode; item.iImage = ImageIndex; ItemIndex = ListView_InsertItem(hwndList, &item); - ListView_SetItemText(hwndList, ItemIndex, 1, pszLayoutName); + ListView_SetItemText(hwndList, ItemIndex, 1, pInputNode->pLayout->pszName); +} + + +static VOID +UpdateInputListView(HWND hwndList) +{ + INPUT_LIST_NODE *pCurrentInputNode; + HIMAGELIST hImageList; + + hImageList = ListView_GetImageList(hwndList, LVSIL_SMALL); + if (hImageList != NULL) + { + ImageList_RemoveAll(hImageList); + } + + ListView_DeleteAllItems(hwndList); + + for (pCurrentInputNode = InputList_Get(); + pCurrentInputNode != NULL; + pCurrentInputNode = pCurrentInputNode->pNext) + { + AddToInputListView(hwndList, pCurrentInputNode); + } } static VOID OnInitSettingsPage(HWND hwndDlg) { - WCHAR szBuffer[MAX_STR_LEN]; - LV_COLUMN column; - HWND hLayoutList; - HIMAGELIST hLayoutImageList; - INT iLayoutCount; - HKL *pActiveLayoutList; - - hLayoutList = GetDlgItem(hwndDlg, IDC_KEYLAYOUT_LIST); - - ListView_SetExtendedListViewStyle(hLayoutList, LVS_EX_FULLROWSELECT); - - memset(&column, 0, sizeof(LV_COLUMN)); - - column.mask = LVCF_FMT | LVCF_TEXT | LVCF_WIDTH | LVCF_SUBITEM; - - LoadString(hApplet, IDS_LANGUAGE, szBuffer, ARRAYSIZE(szBuffer)); - column.fmt = LVCFMT_LEFT; - column.iSubItem = 0; - column.pszText = szBuffer; - column.cx = 175; - ListView_InsertColumn(hLayoutList, 0, &column); - - LoadString(hApplet, IDS_LAYOUT, szBuffer, ARRAYSIZE(szBuffer)); - column.fmt = LVCFMT_RIGHT; - column.cx = 155; - column.iSubItem = 1; - column.pszText = szBuffer; - ListView_InsertColumn(hLayoutList, 1, &column); - - hLayoutImageList = ImageList_Create(GetSystemMetrics(SM_CXSMICON), - GetSystemMetrics(SM_CYSMICON), - ILC_COLOR8 | ILC_MASK, 0, 0); - if (hLayoutImageList != NULL) - { - ListView_SetImageList(hLayoutList, hLayoutImageList, LVSIL_SMALL); - } + HWND hwndInputList; LayoutList_Create(); LocaleList_Create(); - - iLayoutCount = GetKeyboardLayoutList(0, NULL); - pActiveLayoutList = (HKL*) malloc(iLayoutCount * sizeof(HKL)); - if (pActiveLayoutList != NULL) - { - if (GetKeyboardLayoutList(iLayoutCount, pActiveLayoutList) > 0) - { - INT iIndex; - - for (iIndex = 0; iIndex < iLayoutCount; iIndex++) - { - LOCALE_LIST_NODE *CurrentLocale; - - for (CurrentLocale = LocaleList_Get(); - CurrentLocale != NULL; - CurrentLocale = CurrentLocale->pNext) - { - if (LOWORD(CurrentLocale->dwId) == LOWORD(pActiveLayoutList[iIndex])) - { - AddToLayoutListView(hLayoutList, - CurrentLocale->pszName, - LayoutList_GetNameByHkl(pActiveLayoutList[iIndex]), - CurrentLocale->pszIndicator); - } - } - } - } - - free(pActiveLayoutList); + InputList_Create(); + + hwndInputList = GetDlgItem(hwndDlg, IDC_KEYLAYOUT_LIST); + + if (hwndInputList != NULL) + { + INPUT_LIST_NODE *pCurrentInputNode; + WCHAR szBuffer[MAX_STR_LEN]; + HIMAGELIST hLayoutImageList; + LV_COLUMN column; + + ListView_SetExtendedListViewStyle(hwndInputList, LVS_EX_FULLROWSELECT); + + memset(&column, 0, sizeof(LV_COLUMN)); + + column.mask = LVCF_FMT | LVCF_TEXT | LVCF_WIDTH | LVCF_SUBITEM; + + LoadStringW(hApplet, IDS_LANGUAGE, szBuffer, ARRAYSIZE(szBuffer)); + column.fmt = LVCFMT_LEFT; + column.iSubItem = 0; + column.pszText = szBuffer; + column.cx = 175; + ListView_InsertColumn(hwndInputList, 0, &column); + + LoadStringW(hApplet, IDS_LAYOUT, szBuffer, ARRAYSIZE(szBuffer)); + column.fmt = LVCFMT_RIGHT; + column.cx = 155; + column.iSubItem = 1; + column.pszText = szBuffer; + ListView_InsertColumn(hwndInputList, 1, &column); + + hLayoutImageList = ImageList_Create(GetSystemMetrics(SM_CXSMICON), + GetSystemMetrics(SM_CYSMICON), + ILC_COLOR8 | ILC_MASK, 0, 0); + if (hLayoutImageList != NULL) + { + ListView_SetImageList(hwndInputList, hLayoutImageList, LVSIL_SMALL); + } + + for (pCurrentInputNode = InputList_Get(); + pCurrentInputNode != NULL; + pCurrentInputNode = pCurrentInputNode->pNext) + { + AddToInputListView(hwndInputList, pCurrentInputNode); + } } } @@ -199,6 +208,7 @@ LayoutList_Destroy(); LocaleList_Destroy(); + InputList_Destroy(); hImageList = ListView_GetImageList(GetDlgItem(hwndDlg, IDC_KEYLAYOUT_LIST), LVSIL_SMALL); @@ -209,6 +219,61 @@ } +VOID +OnCommandSettingsPage(HWND hwndDlg, WPARAM wParam) +{ + switch (LOWORD(wParam)) + { + case IDC_ADD_BUTTON: + { + if (DialogBoxW(hApplet, + MAKEINTRESOURCEW(IDD_ADD), + hwndDlg, + AddDialogProc) == IDOK) + { + UpdateInputListView(GetDlgItem(hwndDlg, IDC_KEYLAYOUT_LIST)); + PropSheet_Changed(GetParent(hwndDlg), hwndDlg); + } + } + break; + + case IDC_REMOVE_BUTTON: + { + PropSheet_Changed(GetParent(hwndDlg), hwndDlg); + } + break; + + case IDC_PROP_BUTTON: + { + + } + break; + + case IDC_SET_DEFAULT: + { + PropSheet_Changed(GetParent(hwndDlg), hwndDlg); + } + break; + + case IDC_KEY_SET_BTN: + { + + } + break; + } +} + + +static VOID +OnNotifySettingsPage(HWND hwndDlg, LPARAM lParam) +{ + if (((LPPSHNOTIFY)lParam)->hdr.code == PSN_APPLY) + { + InputList_Process(); + } +} + + INT_PTR CALLBACK SettingsPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { @@ -223,10 +288,12 @@ break; case WM_COMMAND: - { - - } - break; + OnCommandSettingsPage(hwndDlg, wParam); + break; + + case WM_NOTIFY: + OnNotifySettingsPage(hwndDlg, lParam); + break; } return FALSE;
8 years, 4 months
1
0
0
0
[zhu] 72159: Massively simplified the mutex guarding each TCP_CONTEXT struct. Before, manually handled recursion. Now uses KMUTEX to handle recursion. Corrected the way debug printouts get the curr...
by zhu@svn.reactos.org
Author: zhu Date: Mon Aug 8 16:49:04 2016 New Revision: 72159 URL:
http://svn.reactos.org/svn/reactos?rev=72159&view=rev
Log: Massively simplified the mutex guarding each TCP_CONTEXT struct. Before, manually handled recursion. Now uses KMUTEX to handle recursion. Corrected the way debug printouts get the current thread context. Added code to walk Request linked lists for pending TDI_SEND and TDI_RECEIVE requests upon completion of a TDI_SEND and TDI_RECEIVE request, respectively. Without this check, backed-up request were left hanging forever. Split off the lwIP tcp_write() call into a helper function to aid this. Various deadlock fixes. Modified: branches/GSoC_2016/lwIP-tcpip/base/applications/network/tcpclient/main.c branches/GSoC_2016/lwIP-tcpip/drivers/network/tcpip/address.c branches/GSoC_2016/lwIP-tcpip/drivers/network/tcpip/address.h branches/GSoC_2016/lwIP-tcpip/drivers/network/tcpip/main.c branches/GSoC_2016/lwIP-tcpip/sdk/lib/drivers/lwip/src/include/lwip/tcp.h Modified: branches/GSoC_2016/lwIP-tcpip/base/applications/network/tcpclient/main.c URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2016/lwIP-tcpip/base/appli…
============================================================================== --- branches/GSoC_2016/lwIP-tcpip/base/applications/network/tcpclient/main.c [iso-8859-1] (original) +++ branches/GSoC_2016/lwIP-tcpip/base/applications/network/tcpclient/main.c [iso-8859-1] Mon Aug 8 16:49:04 2016 @@ -3,7 +3,7 @@ #include <winsock2.h> #define LENGTH 255 -#define NUM_CLIENTS 32 +#define NUM_CLIENTS 16 DWORD WINAPI ClientThreadMain(LPVOID lpParam) { SOCKET Sock; Modified: branches/GSoC_2016/lwIP-tcpip/drivers/network/tcpip/address.c URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2016/lwIP-tcpip/drivers/ne…
============================================================================== --- branches/GSoC_2016/lwIP-tcpip/drivers/network/tcpip/address.c [iso-8859-1] (original) +++ branches/GSoC_2016/lwIP-tcpip/drivers/network/tcpip/address.c [iso-8859-1] Mon Aug 8 16:49:04 2016 @@ -219,6 +219,7 @@ /* Forward-declare helper function */ VOID CloseAddress(PADDRESS_FILE AddressFile); NTSTATUS DisassociateAddress(PTCP_CONTEXT Context); +NTSTATUS DoSend(PIRP Irp, PTCP_CONTEXT Context); #define AddrIsUnspecified(Address) ((Address->in_addr == 0) || (Address->in_addr == 0xFFFFFFFF)) @@ -233,27 +234,14 @@ Context->TcpState &= ~State /** - * Recursive mutex guarding a TCP_CONTEXT using a KSPIN_LOCK residing in the Context's associated - * ADDRESS_FILE. This mutex guards against concurrent access from multiple execution contexts if and - * only if the Context is associated with an Address File. If TcpIpAssociateAddress has been called - * on a TCP_CONTEXT struct, this mutex should be held when reading from or writing to any and all - * fields in the struct until TcpIpDisassociateAddress is called on the same struct. - * - * Mutex acquisition returns TRUE if the mutex has been acquired. Returns FALSE if the mutex could - * not be acquired due to the Context having no association to any Address File. - * - * A disassociated context should be inherently safe from concurrent access because the only - * remaining reference to it should reside in an lwIP Protocol Control Block as the callback - * argument. Thus, lwIP callback functions can safely ignore the return value while all other - * functions should treat a return value of FALSE as a non-recoverable error. + * TODO: distributed mutex discription **/ VOID InitializeContextMutex( PTCP_CONTEXT Context ) { - Context->MutexOwner = NULL; - Context->MutexDepth = 0; + KeInitializeMutex(&Context->Mutex, 0); } BOOLEAN @@ -261,50 +249,30 @@ PTCP_CONTEXT Context ) { - HANDLE Thread; - KIRQL OldIrql; - PADDRESS_FILE AddressFile; - PKSPIN_LOCK Lock; - -#ifndef NDEBUG - Thread = PsGetCurrentThreadId(); + +#ifndef NDEBUG + PKTHREAD Thread; + Thread = KeGetCurrentThread(); DPRINT("Thread %p acquiring lock on Context %p\n", Thread, Context); #endif + KeWaitForMutexObject(&Context->Mutex, Executive, KernelMode, FALSE, NULL); AddressFile = Context->AddressFile; if (AddressFile == NULL) { - /* Context has been disassociated. There is no lock to acquire. */ - InterlockedIncrement(&Context->MutexDepth); + /* Context has been disassociated. Do not continue. */ return FALSE; } - Lock = &AddressFile->AssociatedContextsLock; - - Thread = PsGetCurrentThreadId(); - -AGAIN: - /* Start mutex acquisition */ - KeAcquireSpinLock(Lock, &OldIrql); if (Context->AddressFile == NULL) { /* Context was disassociated while we tried to acquire lock. IRP processing should stop. */ - KeReleaseSpinLock(Lock, OldIrql); - InterlockedIncrement(&Context->MutexDepth); return FALSE; } - if (Context->MutexOwner != NULL && Context->MutexOwner != Thread) - { - /* Context was acquired by another thread, try again */ - KeReleaseSpinLock(Lock, OldIrql); - goto AGAIN; - } - - /* We passed all tests, we have exclusive access to this Context. */ - Context->MutexOwner = Thread; - KeReleaseSpinLock(Lock, OldIrql); - InterlockedIncrement(&Context->MutexDepth); - + +#ifndef NDEBUG + DPRINT("Thread %p acquired lock on Context %p\n", Thread, Context); +#endif return TRUE; } @@ -313,23 +281,17 @@ PTCP_CONTEXT Context ) { - HANDLE Thread; +#ifndef NDEBUG + PKTHREAD Thread; + Thread = KeGetCurrentThread(); + DPRINT("Thread %p releasing lock on Context %p\n", Thread, Context); +#endif + + KeReleaseMutex(&Context->Mutex, FALSE); - Thread = PsGetCurrentThreadId(); - DPRINT("Thread %p releasing lock on Context %p\n", Thread, Context); - - /* If the releasing call came from the mutex owner, do release. Otherwise, do nothing. */ - if (Context->MutexOwner == Thread) - { - if (InterlockedDecrement(&Context->MutexDepth) == 0) - { - Context->MutexOwner = NULL; - } - } - else - { - DPRINT1("Release mutex from non-owner\n"); - } +#ifndef NDEBUG + DPRINT("Thread %p released lock on Context %p\n", Thread, Context); +#endif } /* Get exclusive access to the corresponding TCP Context before calling */ @@ -375,7 +337,7 @@ NTSTATUS Status; /* Check that the IRP was not already canceled */ - if (Irp->Cancel) + if (Irp->Cancel == TRUE) { DPRINT("IRP already canceled\n"); Irp->IoStatus.Status = STATUS_CANCELLED; @@ -404,14 +366,18 @@ ) { #ifndef NDEBUG + INT i; KIRQL OldIrql; - INT i; PIO_STACK_LOCATION IrpSp; #endif LONG ContextCount; PIRP Irp; + PIRP PendingIrp; + PLIST_ENTRY Entry; + PLIST_ENTRY Head; PTCP_CONTEXT AcceptingContext; + PTCP_REQUEST TemporaryRequest; /* If this was just a request completion, skip lwIP PCB cleanup and go straight to IRP * completion */ @@ -496,13 +462,55 @@ goto COMPLETE_IRP; case TCP_REQUEST_CANCEL_MODE_PRESERVE : /* For requests that do not deallocate the PCB when canceled, determine and clear the - * appropriate TCP State bit */ + * appropriate TCP State bit only if there are no more Requests of that type. */ + Head = &Context->RequestListHead; + Entry = Head->Flink; switch (Request->PendingMode) { case TCP_REQUEST_PENDING_SEND : + /* If there is another Send request, execute it. */ + while (Entry != Head) + { + TemporaryRequest = CONTAINING_RECORD(Entry, TCP_REQUEST, ListEntry); + if (TemporaryRequest->PendingMode == TCP_REQUEST_PENDING_SEND) + { + PendingIrp = TemporaryRequest->Payload.PendingIrp; + if (DoSend(PendingIrp, Context) == STATUS_SUCCESS) + { + /* We successfully initiated another Send with lwIP */ + goto COMPLETE_IRP; + } + else + { + /* If the send failed, cancel the pending IRP and continue + * walking the list for another Send. */ + Entry = Entry->Flink; + RemoveEntryList(&TemporaryRequest->ListEntry); + PendingIrp->Cancel = TRUE; + IoSetCancelRoutine(PendingIrp, NULL); + PendingIrp->IoStatus.Information = 0; + CleanupRequest(TemporaryRequest, STATUS_CANCELLED, Context); + continue; + } + } + Entry = Entry->Flink; + } + /* We walked the entire list without finding and successfully doing a send, so + * remote the SENDING state bit. */ TCP_RMV_STATE(TCP_STATE_SENDING, Context); break; case TCP_REQUEST_PENDING_RECEIVE : + /* If there is another Receive request, we don't need to do anything but keep + * waiting for a callback. */ + while (Entry != Head) + { + TemporaryRequest = CONTAINING_RECORD(Entry, TCP_REQUEST, ListEntry); + if (TemporaryRequest->PendingMode == TCP_REQUEST_PENDING_RECEIVE) + { + goto COMPLETE_IRP; + } + Entry = Entry->Flink; + } TCP_RMV_STATE(TCP_STATE_RECEIVING, Context); break; default : @@ -524,7 +532,7 @@ REMOVE_IRP(Irp); REMOVE_IRPSP(IrpSp); #endif - IoCompleteRequest(Irp, IO_NETWORK_INCREMENT); + _IoCompleteRequest(Irp, IO_NETWORK_INCREMENT); FINISH: /* Deallocate the TCP Request */ @@ -547,20 +555,11 @@ PLIST_ENTRY Entry; PLIST_ENTRY Head; PTCP_CONTEXT Context; + PTCP_CONTEXT OldContext; PTCP_REQUEST Request; - /* Check that the IRP isn't already being canceled */ - if (Irp->Cancel == TRUE) - { - IoReleaseCancelSpinLock(Irp->CancelIrql); - return; - } - - /* Block potential repeated cancellations */ - Irp->Cancel = TRUE; - IoSetCancelRoutine(Irp, NULL); - - /* This function is always called with the Cancel lock held */ + /* This function is always called with the Cancel lock held, Irp->Cancel set to TRUE, and + * Irp->CancelRoutine set to NULL. */ IoReleaseCancelSpinLock(Irp->CancelIrql); /* The file types distinguishes between some protocols */ @@ -590,7 +589,9 @@ if (IrpSp->MinorFunction == TDI_LISTEN) { /* Disassociate the listening Context, which we grab from the AddressFile. */ + OldContext = Context; Context = Context->AddressFile->Listener; + ReleaseExclusiveContextAccess(OldContext); DisassociateAddress(Context); /* If the lwIP PCB still exists, close it. Since we are deallocating the PCB's associated @@ -613,6 +614,7 @@ #endif ExFreePoolWithTag(Context, TAG_TCP_CONTEXT); + DPRINT("Return for TDI_LISTEN cancel\n"); return; } @@ -630,6 +632,7 @@ Irp->IoStatus.Information = 0; CleanupRequest(Request, STATUS_CANCELLED, Context); ReleaseExclusiveContextAccess(Context); + DPRINT("Return after IRP completion\n"); return; } @@ -645,7 +648,8 @@ REMOVE_IRP(Irp); REMOVE_IRPSP(IrpSp); #endif - IoCompleteRequest(Irp, IO_NETWORK_INCREMENT); + _IoCompleteRequest(Irp, IO_NETWORK_INCREMENT); + DPRINT("Return after skipping most things\n"); return; } @@ -745,7 +749,6 @@ /* TCP variables */ AddressFile->HasListener = FALSE; - KeInitializeSpinLock(&AddressFile->AssociatedContextsLock); /* UDP and RAW variables */ KeInitializeSpinLock(&AddressFile->RequestLock); @@ -990,27 +993,31 @@ #endif /* Sanity check */ - if (Context->AddressFile != NULL) - { + if (GetExclusiveContextAccess(Context) == TRUE) + { + ReleaseExclusiveContextAccess(Context); DPRINT1("Context retains address association\n"); return STATUS_INVALID_PARAMETER; } /* If the lwIP PCB still exists, close it. Since we are deallocating the PCB's associated * Context, we also need to clear the Context pointer in the PCB. */ + ReleaseExclusiveContextAccess(Context); + ACQUIRE_SERIAL_MUTEX(); + GetExclusiveContextAccess(Context); if (Context->lwip_tcp_pcb) { #ifndef NDEBUG REMOVE_PCB(Context->lwip_tcp_pcb); #endif - ACQUIRE_SERIAL_MUTEX(); tcp_arg(Context->lwip_tcp_pcb, NULL); tcp_close(Context->lwip_tcp_pcb); - RELEASE_SERIAL_MUTEX(); - } + } + RELEASE_SERIAL_MUTEX(); /* Deallocate the Context. The corresponding Address File's ContextCount should have been * decremented when the Context was disassociated. */ + ReleaseExclusiveContextAccess(Context); #ifndef NDEBUG REMOVE_CONTEXT(Context); #endif @@ -1172,7 +1179,6 @@ } AddressFile = Context->AddressFile; Context->AddressFile = NULL; - ReleaseExclusiveContextAccess(Context); /* Walk the Context's Request list to finish all outstanding IRPs. */ Head = &Context->RequestListHead; @@ -1204,6 +1210,8 @@ CloseAddress(AddressFile); } } + + ReleaseExclusiveContextAccess(Context); return STATUS_SUCCESS; } @@ -1260,8 +1268,8 @@ Context = IrpSp->FileObject->FsContext; if (GetExclusiveContextAccess(Context) == FALSE) { + ReleaseExclusiveContextAccess(Context); DPRINT("Context has been disassociated\n"); - ReleaseExclusiveContextAccess(Context); return STATUS_ADDRESS_CLOSED; } if (Context->TcpState != TCP_STATE_BOUND) @@ -1280,8 +1288,8 @@ ListenContext = AddressFile->Listener; if (GetExclusiveContextAccess(ListenContext) == FALSE) { + ReleaseExclusiveContextAccess(ListenContext); DPRINT1("TDI_LISTEN on disassociated Listen Context? SNAFU.\n"); - ReleaseExclusiveContextAccess(ListenContext); ReleaseExclusiveContextAccess(Context); return STATUS_ADDRESS_CLOSED; } @@ -1351,7 +1359,7 @@ ExFreePoolWithTag(Request, TAG_TCP_REQUEST); - /* main.c will call IoCompleteRequest() on this IRP */ + /* main.c will call _IoCompleteRequest() on this IRP */ return STATUS_SUCCESS; } @@ -1454,8 +1462,8 @@ Context = IrpSp->FileObject->FsContext; if (GetExclusiveContextAccess(Context) == FALSE) { + ReleaseExclusiveContextAccess(Context); DPRINT1("Context has been disassociated\n"); - ReleaseExclusiveContextAccess(Context); return STATUS_ADDRESS_CLOSED; } if (Context->TcpState != TCP_STATE_BOUND) @@ -1533,18 +1541,13 @@ _Inout_ PIRP Irp ) { -#ifndef NDEBUG - INT i; - KIRQL OldIrql; -#endif - PIO_STACK_LOCATION IrpSp; PTCP_CONTEXT Context; IrpSp = IoGetCurrentIrpStackLocation(Irp); /* Sanity checks. We do not acquire the Context mutex because TDI_DISCONNECT results from an - * IoCompleteRequest() called with the Context mutex held. */ + * _IoCompleteRequest() called with the Context mutex held. */ if (IrpSp->FileObject->FsContext2 != (PVOID)TDI_CONNECTION_FILE) { DPRINT1("Disconnection on something that is not a TCP Context\n"); @@ -1578,8 +1581,8 @@ Context = IrpSp->FileObject->FsContext; if (GetExclusiveContextAccess(Context) == FALSE) { + ReleaseExclusiveContextAccess(Context); DPRINT("Context has been disassociated\n"); - ReleaseExclusiveContextAccess(Context); return STATUS_ADDRESS_CLOSED; } if (!(Context->TcpState & TCP_STATE_CONNECTED)) @@ -1608,19 +1611,53 @@ } NTSTATUS +DoSend( + _In_ PIRP Irp, + _In_ PTCP_CONTEXT Context +) +{ + UINT SendBytes; + + PVOID Buffer; + + err_t lwip_err; + + /* Get send buffer and length */ + NdisQueryBuffer(Irp->MdlAddress, &Buffer, &SendBytes); + + /* Call into lwIP to initiate send */ + ACQUIRE_SERIAL_MUTEX(); + lwip_err = tcp_write(Context->lwip_tcp_pcb, Buffer, SendBytes, 0); + RELEASE_SERIAL_MUTEX(); + switch (lwip_err) + { + case ERR_OK: + /* If the lwIP call succeeded, set the TCP State variable */ + return STATUS_SUCCESS; + case ERR_MEM: + DPRINT1("lwIP ERR_MEM\n"); + return STATUS_NO_MEMORY; + case ERR_ARG: + DPRINT1("lwIP ERR_ARG\n"); + return STATUS_INVALID_PARAMETER; + case ERR_CONN: + DPRINT1("lwIP ERR_CONN\n"); + return STATUS_CONNECTION_ACTIVE; + default: + DPRINT1("Unknwon lwIP Error: %d\n", lwip_err); + return STATUS_NOT_IMPLEMENTED; + } +} + +NTSTATUS TcpIpSend( _Inout_ PIRP Irp ) { NTSTATUS Status; - UINT SendBytes; PIO_STACK_LOCATION IrpSp; - PTDI_REQUEST_KERNEL_SEND RequestInfo; PTCP_CONTEXT Context; - PVOID Buffer; - - err_t lwip_err; IrpSp = IoGetCurrentIrpStackLocation(Irp); @@ -1633,8 +1670,8 @@ Context = IrpSp->FileObject->FsContext; if (GetExclusiveContextAccess(Context) == FALSE) { + ReleaseExclusiveContextAccess(Context); DPRINT1("Context has been disassociated\n"); - ReleaseExclusiveContextAccess(Context); return STATUS_ADDRESS_CLOSED; } if (!(Context->TcpState & TCP_STATE_CONNECTED)) @@ -1644,44 +1681,23 @@ return STATUS_ONLY_IF_CONNECTED; } - /* Get send buffer and length */ - NdisQueryBuffer(Irp->MdlAddress, &Buffer, &SendBytes); - RequestInfo = (PTDI_REQUEST_KERNEL_SEND)&IrpSp->Parameters; - /* If the Context is already servicing a Send request, do not initiate another one right now */ if (Context->TcpState & TCP_STATE_SENDING) { goto WAIT_TO_SEND; } - - /* Call into lwIP to initiate send */ - ACQUIRE_SERIAL_MUTEX(); - lwip_err = tcp_write(Context->lwip_tcp_pcb, Buffer, RequestInfo->SendLength, 0); - RELEASE_SERIAL_MUTEX(); - switch (lwip_err) - { - case ERR_OK: - /* If the lwIP call succeeded, set the TCP State variable */ - TCP_ADD_STATE(TCP_STATE_SENDING, Context); - break; - case ERR_MEM: - DPRINT1("lwIP ERR_MEM\n"); - Status = STATUS_NO_MEMORY; - goto FINISH; - case ERR_ARG: - DPRINT1("lwIP ERR_ARG\n"); - Status = STATUS_INVALID_PARAMETER; - goto FINISH; - case ERR_CONN: - DPRINT1("lwIP ERR_CONN\n"); - Status = STATUS_CONNECTION_ACTIVE; - goto FINISH; - default: - DPRINT1("Unknwon lwIP Error: %d\n", lwip_err); - Status = STATUS_NOT_IMPLEMENTED; - goto FINISH; - } - + + /* Perform lwIP call */ + Status = DoSend(Irp, Context); + if (Status == STATUS_SUCCESS) + { + TCP_ADD_STATE(TCP_STATE_SENDING, Context); + } + else + { + goto FINISH; + } + WAIT_TO_SEND: Status = PrepareIrpForCancel( Irp, @@ -1824,7 +1840,7 @@ REMOVE_IRP(Irp); REMOVE_IRPSP(IrpSp); #endif - IoCompleteRequest(Irp, IO_NETWORK_INCREMENT); + _IoCompleteRequest(Irp, IO_NETWORK_INCREMENT); ExFreePoolWithTag(Request, TAG_DGRAM_REQST); } @@ -1914,7 +1930,7 @@ REMOVE_IRP(Irp); REMOVE_IRPSP(IrpSp); #endif - IoCompleteRequest(Irp, IO_NETWORK_INCREMENT); + _IoCompleteRequest(Irp, IO_NETWORK_INCREMENT); return Status; } @@ -2064,7 +2080,7 @@ REMOVE_IRP(Irp); REMOVE_IRPSP(IrpSp); #endif - IoCompleteRequest(Irp, IO_NETWORK_INCREMENT); + _IoCompleteRequest(Irp, IO_NETWORK_INCREMENT); return Status; } @@ -2125,10 +2141,9 @@ TcpState = TCP_STATE_ABORTED; break; case ERR_RST : - /* This is the only case that indicates the lwIP PCB still exists */ DPRINT1("lwIP socket reset\n"); TcpState = TCP_STATE_CLOSED; - goto RETAIN_PCB; + break; case ERR_CLSD : DPRINT1("lwIP socket closed\n"); TcpState = TCP_STATE_CLOSED; @@ -2159,7 +2174,6 @@ GetExclusiveContextAccess(Context); Context->lwip_tcp_pcb = NULL; -RETAIN_PCB: ProcessPCBError(Context, TcpState); ReleaseExclusiveContextAccess(Context); } @@ -2404,6 +2418,7 @@ err_t err ) { + BOOLEAN Acquired; INT CopiedLength; INT RemainingDestBytes; UCHAR *CurrentDestLocation; @@ -2434,9 +2449,9 @@ } /* Sanity checks */ - if (!(Context->TcpState & TCP_STATE_RECEIVING)) - { - DPRINT1("Receive callback on Context that is not currently receiving\n"); + if (!(Context->TcpState & TCP_STATE_CONNECTED)) + { + DPRINT1("Receive callback on Context that is not currently connected\n"); ReleaseExclusiveContextAccess(Context); return ERR_ARG; } Modified: branches/GSoC_2016/lwIP-tcpip/drivers/network/tcpip/address.h URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2016/lwIP-tcpip/drivers/ne…
============================================================================== --- branches/GSoC_2016/lwIP-tcpip/drivers/network/tcpip/address.h [iso-8859-1] (original) +++ branches/GSoC_2016/lwIP-tcpip/drivers/network/tcpip/address.h [iso-8859-1] Mon Aug 8 16:49:04 2016 @@ -130,6 +130,10 @@ IRPSPCount--; \ KeReleaseSpinLockFromDpcLevel(&IRPSPArrayLock) #endif + +#define _IoCompleteRequest(Irp,Mode) \ + DPRINT("Complete IRP %p with IO Status %08X\n", Irp, Irp->IoStatus.Status); \ + IoCompleteRequest(Irp, Mode) struct _TCP_CONTEXT; typedef struct _TCP_CONTEXT TCP_CONTEXT, *PTCP_CONTEXT; @@ -151,7 +155,6 @@ struct udp_pcb* lwip_udp_pcb; PTCP_CONTEXT Listener; }; - KSPIN_LOCK AssociatedContextsLock; } ADDRESS_FILE, *PADDRESS_FILE; struct _TCP_CONTEXT { @@ -160,8 +163,7 @@ LIST_ENTRY RequestListHead; struct tcp_pcb* lwip_tcp_pcb; BOOLEAN ReferencedByUpperLayer; - HANDLE MutexOwner; - volatile long MutexDepth; + KMUTEX Mutex; }; typedef struct _TCP_REQUEST { Modified: branches/GSoC_2016/lwIP-tcpip/drivers/network/tcpip/main.c URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2016/lwIP-tcpip/drivers/ne…
============================================================================== --- branches/GSoC_2016/lwIP-tcpip/drivers/network/tcpip/main.c [iso-8859-1] (original) +++ branches/GSoC_2016/lwIP-tcpip/drivers/network/tcpip/main.c [iso-8859-1] Mon Aug 8 16:49:04 2016 @@ -347,7 +347,7 @@ REMOVE_IRP(Irp); REMOVE_IRPSP(IrpSp); #endif - IoCompleteRequest(Irp, IO_NETWORK_INCREMENT); + _IoCompleteRequest(Irp, IO_NETWORK_INCREMENT); } return Status; @@ -418,7 +418,7 @@ REMOVE_IRP(Irp); REMOVE_IRPSP(IrpSp); #endif - IoCompleteRequest(Irp, IO_NETWORK_INCREMENT); + _IoCompleteRequest(Irp, IO_NETWORK_INCREMENT); return Status; } @@ -572,7 +572,6 @@ Status = STATUS_NOT_IMPLEMENTED; } -FINISH: Irp->IoStatus.Status = Status; if (Status == STATUS_PENDING) { @@ -584,7 +583,7 @@ REMOVE_IRP(Irp); REMOVE_IRPSP(IrpSp); #endif - IoCompleteRequest(Irp, IO_NETWORK_INCREMENT); + _IoCompleteRequest(Irp, IO_NETWORK_INCREMENT); } return Status; Modified: branches/GSoC_2016/lwIP-tcpip/sdk/lib/drivers/lwip/src/include/lwip/tcp.h URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2016/lwIP-tcpip/sdk/lib/dr…
============================================================================== --- branches/GSoC_2016/lwIP-tcpip/sdk/lib/drivers/lwip/src/include/lwip/tcp.h [iso-8859-1] (original) +++ branches/GSoC_2016/lwIP-tcpip/sdk/lib/drivers/lwip/src/include/lwip/tcp.h [iso-8859-1] Mon Aug 8 16:49:04 2016 @@ -371,24 +371,25 @@ /** * REACT_OS Global Mutex * Serializes all kernel network activity to circumvent lwIP core's lack of thread-safety. - */ + **/ KMUTEX MTSerialMutex; +/* #define ACQUIRE_SERIAL_MUTEX() \ KeWaitForMutexObject(&MTSerialMutex, Executive, KernelMode, FALSE, NULL) #define RELEASE_SERIAL_MUTEX() \ KeReleaseMutex(&MTSerialMutex, FALSE) -/* +*/ #define ACQUIRE_SERIAL_MUTEX() \ - DPRINT("Acquiring MTSerialMutex on thread %p\n", PsGetCurrentThreadId()); \ + DPRINT("Acquiring MTSerialMutex on thread %p\n", KeGetCurrentThread()); \ KeWaitForMutexObject(&MTSerialMutex, Executive, KernelMode, FALSE, NULL); \ - DPRINT("MTSerialMutex acquired on thread %p\n", PsGetCurrentThreadId()) + DPRINT("MTSerialMutex acquired on thread %p\n", KeGetCurrentThread()) #define RELEASE_SERIAL_MUTEX() \ - DPRINT("Releasing MTSerialMutex on thread %p\n", PsGetCurrentThreadId()); \ + DPRINT("Releasing MTSerialMutex on thread %p\n", KeGetCurrentThread()); \ KeReleaseMutex(&MTSerialMutex, FALSE); \ - DPRINT("MTSerialMutex released on thread %p\n", PsGetCurrentThreadId()) -*/ + DPRINT("MTSerialMutex released on thread %p\n", KeGetCurrentThread()) + const char* tcp_debug_state_str(enum tcp_state s); #ifdef __cplusplus
8 years, 4 months
1
0
0
0
← Newer
1
...
34
35
36
37
38
39
40
...
47
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
Results per page:
10
25
50
100
200