Skip to content

Commit e9a541c

Browse files
committed
[WLANWIZ] Access WLAN_AVAILABLE_NETWORK through pointers
1 parent a9e961b commit e9a541c

File tree

2 files changed

+18
-18
lines changed

2 files changed

+18
-18
lines changed

dll/shellext/wlanwiz/draw.cpp

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* PROJECT: ReactOS Shell
33
* LICENSE: LGPL-2.1-or-later (https://spdx.org/licenses/LGPL-2.1-or-later)
44
* PURPOSE: ReactOS Wizard for Wireless Network Connections (Drawing Routines)
5-
* COPYRIGHT: Copyright 2024 Vitaly Orekhov <[email protected]>
5+
* COPYRIGHT: Copyright 2024-2025 Vitaly Orekhov <[email protected]>
66
*/
77
#include "main.h"
88

@@ -158,7 +158,7 @@ LRESULT CWlanWizard::OnDrawItem(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& b
158158
UINT uSSIDLength = static_cast<UINT>(SendDlgItemMessageW(pdis->CtlID, LB_GETTEXTLEN, pdis->itemID, NULL));
159159
DWORD uItemRealID = static_cast<DWORD>(SendDlgItemMessageW(pdis->CtlID, LB_GETITEMDATA, pdis->itemID, NULL));
160160

161-
WLAN_AVAILABLE_NETWORK wlanNetwork = this->lstWlanNetworks->Network[uItemRealID];
161+
PWLAN_AVAILABLE_NETWORK pWlanNetwork = &this->lstWlanNetworks->Network[uItemRealID];
162162

163163
/* Step 1: draw listbox item's graphics, starting with the background */
164164
if (!(pdis->itemState & ODS_SELECTED))
@@ -210,7 +210,7 @@ LRESULT CWlanWizard::OnDrawItem(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& b
210210
}
211211

212212
/* Signal quality bar */
213-
WLAN_SIGNAL_QUALITY ulSQ = wlanNetwork.wlanSignalQuality;
213+
WLAN_SIGNAL_QUALITY ulSQ = pWlanNetwork->wlanSignalQuality;
214214
int iSQResIcon = IDI_WLANICON;
215215

216216
if (16 <= ulSQ && ulSQ < 36)
@@ -239,7 +239,7 @@ LRESULT CWlanWizard::OnDrawItem(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& b
239239
/* Network type */
240240
int iBSSIcon = IDI_BSS_INFRA;
241241

242-
if (wlanNetwork.dot11BssType == dot11_BSS_type_independent)
242+
if (pWlanNetwork->dot11BssType == dot11_BSS_type_independent)
243243
iBSSIcon = IDI_BSS_ADHOC;
244244

245245
hicnRes = static_cast<HICON>(LoadImageW(wlanwiz_hInstance, MAKEINTRESOURCEW(iBSSIcon), IMAGE_ICON, 48, 48, LR_LOADTRANSPARENT));
@@ -255,7 +255,7 @@ LRESULT CWlanWizard::OnDrawItem(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& b
255255
DestroyIcon(hicnRes);
256256

257257
/* Authentication standard strength */
258-
if (wlanNetwork.bSecurityEnabled)
258+
if (pWlanNetwork->bSecurityEnabled)
259259
{
260260
HICON hicnSecurity = LoadIconW(GetModuleHandleW(L"shell32.dll"), MAKEINTRESOURCEW(48)); /* lock icon */
261261

@@ -268,7 +268,7 @@ LRESULT CWlanWizard::OnDrawItem(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& b
268268
DI_NORMAL);
269269

270270
/* WEP is not secure for decades */
271-
if (wlanNetwork.dot11DefaultAuthAlgorithm < DOT11_AUTH_ALGO_WPA)
271+
if (pWlanNetwork->dot11DefaultAuthAlgorithm < DOT11_AUTH_ALGO_WPA)
272272
{
273273
DrawIconEx(pdis->hDC,
274274
54, pdis->rcItem.top + 37,
@@ -305,9 +305,9 @@ LRESULT CWlanWizard::OnDrawItem(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& b
305305
ATL::CStringW cswNetworkSecurityAlgo = L"";
306306
ATL::CStringW cswNetworkSecurity = L"";
307307

308-
if (wlanNetwork.bSecurityEnabled)
308+
if (pWlanNetwork->bSecurityEnabled)
309309
{
310-
switch (wlanNetwork.dot11DefaultAuthAlgorithm)
310+
switch (pWlanNetwork->dot11DefaultAuthAlgorithm)
311311
{
312312
case DOT11_AUTH_ALGO_80211_OPEN:
313313
case DOT11_AUTH_ALGO_80211_SHARED_KEY:
@@ -331,15 +331,15 @@ LRESULT CWlanWizard::OnDrawItem(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& b
331331
}
332332
}
333333

334-
if (wlanNetwork.dot11BssType == dot11_BSS_type_infrastructure)
335-
cswNetworkSecurity.LoadStringW(wlanNetwork.bSecurityEnabled ? IDS_WLANWIZ_ENCRYPTED_AP : IDS_WLANWIZ_UNENCRYPTED_AP);
336-
else if (wlanNetwork.dot11BssType == dot11_BSS_type_independent)
337-
cswNetworkSecurity.LoadStringW(wlanNetwork.bSecurityEnabled ? IDS_WLANWIZ_ENCRYPTED_IBSS : IDS_WLANWIZ_UNENCRYPTED_IBSS);
334+
if (pWlanNetwork->dot11BssType == dot11_BSS_type_infrastructure)
335+
cswNetworkSecurity.LoadStringW(pWlanNetwork->bSecurityEnabled ? IDS_WLANWIZ_ENCRYPTED_AP : IDS_WLANWIZ_UNENCRYPTED_AP);
336+
else if (pWlanNetwork->dot11BssType == dot11_BSS_type_independent)
337+
cswNetworkSecurity.LoadStringW(pWlanNetwork->bSecurityEnabled ? IDS_WLANWIZ_ENCRYPTED_IBSS : IDS_WLANWIZ_UNENCRYPTED_IBSS);
338338

339339
cswNetworkSecurity += cswNetworkSecurityAlgo;
340340

341341
TextOutW(pdis->hDC,
342-
wlanNetwork.bSecurityEnabled ? 72 : 52,
342+
pWlanNetwork->bSecurityEnabled ? 72 : 52,
343343
pdis->rcItem.top + 38,
344344
cswNetworkSecurity, cswNetworkSecurity.GetLength());
345345

@@ -349,13 +349,13 @@ LRESULT CWlanWizard::OnDrawItem(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& b
349349
{
350350
ATL::CStringW cswExpandedText = L"";
351351

352-
if (wlanNetwork.dwFlags & WLAN_AVAILABLE_NETWORK_CONNECTED)
352+
if (pWlanNetwork->dwFlags & WLAN_AVAILABLE_NETWORK_CONNECTED)
353353
cswExpandedText.LoadStringW(IDS_WLANWIZ_EXPAND_CONNECTED);
354354
else
355355
{
356-
if (wlanNetwork.bSecurityEnabled)
356+
if (pWlanNetwork->bSecurityEnabled)
357357
{
358-
wlanNetwork.dot11DefaultAuthAlgorithm < DOT11_AUTH_ALGO_WPA
358+
pWlanNetwork->dot11DefaultAuthAlgorithm < DOT11_AUTH_ALGO_WPA
359359
? cswExpandedText.LoadStringW(IDS_WLANWIZ_EXPAND_ENCRYPTED_OBSOLETE)
360360
: cswExpandedText.LoadStringW(IDS_WLANWIZ_EXPAND_ENCRYPTED);
361361
}

dll/shellext/wlanwiz/scan.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,8 @@ LRESULT CWlanWizard::OnScanNetworks(WORD wNotifyCode, WORD wID, HWND hWndCtl, BO
213213

214214
for (const auto& dwNetwork : vecIndexesBySignalQuality)
215215
{
216-
WLAN_AVAILABLE_NETWORK wlanNetwork = this->lstWlanNetworks->Network[dwNetwork];
217-
ATL::CStringW cswSSID = APNameToUnicode(&wlanNetwork.dot11Ssid);
216+
PWLAN_AVAILABLE_NETWORK pWlanNetwork = &this->lstWlanNetworks->Network[dwNetwork];
217+
ATL::CStringW cswSSID = APNameToUnicode(&pWlanNetwork->dot11Ssid);
218218

219219
if (cswSSID.IsEmpty())
220220
cswSSID.LoadStringW(IDS_WLANWIZ_HIDDEN_NETWORK);

0 commit comments

Comments
 (0)