Skip to content

Commit

Permalink
[HOTPLUG] Main dialog: Use hwndDeviceTree from pHotplugData
Browse files Browse the repository at this point in the history
  • Loading branch information
TAN-Gaming committed Oct 31, 2023
1 parent d3235ad commit 880ef80
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions dll/cpl/hotplug/hotplug.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,20 +140,20 @@ ShowContextMenu(
static
DEVINST
GetSelectedDeviceInst(
_In_ HWND hwndDeviceTree)
_In_ PHOTPLUG_DATA pHotplugData)
{
HTREEITEM hTreeItem;
TVITEMW item;

hTreeItem = TreeView_GetSelection(hwndDeviceTree);
hTreeItem = TreeView_GetSelection(pHotplugData->hwndDeviceTree);
if (hTreeItem == NULL)
return 0;

ZeroMemory(&item, sizeof(item));
item.mask = TVIF_PARAM;
item.hItem = hTreeItem;

TreeView_GetItem(hwndDeviceTree, &item);
TreeView_GetItem(pHotplugData->hwndDeviceTree, &item);

return item.lParam;
}
Expand Down Expand Up @@ -255,7 +255,7 @@ SafeRemovalDlgProc(
if (pHotplugData->dwFlags & HOTPLUG_DISPLAY_DEVICE_COMPONENTS)
Button_SetCheck(GetDlgItem(hwndDlg, IDC_SAFE_REMOVE_DISPLAY_COMPONENTS), BST_CHECKED);

TreeView_SetImageList(GetDlgItem(hwndDlg, IDC_SAFE_REMOVE_DEVICE_TREE),
TreeView_SetImageList(pHotplugData->hwndDeviceTree,
pHotplugData->ImageListData.ImageList,
TVSIL_NORMAL);

Expand Down Expand Up @@ -292,11 +292,8 @@ SafeRemovalDlgProc(

case IDC_SAFE_REMOVE_PROPERTIES:
case IDM_PROPERTIES:
{
HWND hwndDevTree = GetDlgItem(hwndDlg, IDC_SAFE_REMOVE_DEVICE_TREE);
ShowDeviceProperties(hwndDlg, GetSelectedDeviceInst(hwndDevTree));
ShowDeviceProperties(hwndDlg, GetSelectedDeviceInst(pHotplugData));
break;
}

case IDC_SAFE_REMOVE_STOP:
case IDM_STOP:
Expand Down

0 comments on commit 880ef80

Please sign in to comment.