From d58f6558e022c6426d1ef06e210d2af62c57be48 Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Tue, 9 Oct 2018 23:19:48 +0200 Subject: [PATCH] [NETCFGX] NetworkPropertySheetProvider: Fix property selection because the property list box is sorted. CORE-15095 --- dll/win32/netcfgx/propertypage.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/dll/win32/netcfgx/propertypage.c b/dll/win32/netcfgx/propertypage.c index 1c37083c9f2..b069cf60629 100644 --- a/dll/win32/netcfgx/propertypage.c +++ b/dll/win32/netcfgx/propertypage.c @@ -789,6 +789,7 @@ OnInitDialog( HWND hwndControl; PWSTR pszText; DWORD i; + INT idx; TRACE("OnInitDialog()\n"); @@ -811,13 +812,15 @@ OnInitDialog( else pszText = pParamArray->Array[i].pszName; - ListBox_AddString(hwndControl, pszText); + idx = ListBox_AddString(hwndControl, pszText); + if (idx != LB_ERR) + ListBox_SetItemData(hwndControl, idx, (LPARAM)&pParamArray->Array[i]); } if (pParamArray->dwCount > 0) { ListBox_SetCurSel(hwndControl, 0); - pParamArray->pCurrentParam = &pParamArray->Array[0]; + pParamArray->pCurrentParam = (PPARAMETER)ListBox_GetItemData(hwndControl, 0); DisplayParameter(hwnd, pParamArray->pCurrentParam); } } @@ -855,7 +858,7 @@ OnCommand( iIndex = ListBox_GetCurSel((HWND)lParam); if (iIndex != LB_ERR && iIndex < pParamArray->dwCount) { - pParamArray->pCurrentParam = &pParamArray->Array[iIndex]; + pParamArray->pCurrentParam = (PPARAMETER)ListBox_GetItemData((HWND)lParam, iIndex); DisplayParameter(hwnd, pParamArray->pCurrentParam); } } -- 2.17.1