File tree Expand file tree Collapse file tree 3 files changed +7
-0
lines changed Expand file tree Collapse file tree 3 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -3450,6 +3450,7 @@ PPH_DEVICE_ITEM NTAPI PhpAddDeviceItem(
3450
3450
3451
3451
item = PhCreateObjectZero (sizeof (PH_DEVICE_ITEM ), PhDeviceItemType );
3452
3452
3453
+ item -> Tree = Tree ;
3453
3454
item -> DeviceInfo = PhReferenceObject (Tree -> DeviceInfo );
3454
3455
RtlCopyMemory (& item -> DeviceInfoData .DeviceData , DeviceInfoData , sizeof (SP_DEVINFO_DATA ));
3455
3456
RtlCopyMemory (& item -> ClassGuid , & DeviceInfoData -> ClassGuid , sizeof (GUID ));
@@ -3540,6 +3541,7 @@ PPH_DEVICE_ITEM NTAPI PhpAddDeviceInterfaceItem(
3540
3541
3541
3542
item = PhCreateObjectZero (sizeof (PH_DEVICE_ITEM ), PhDeviceItemType );
3542
3543
3544
+ item -> Tree = Tree ;
3543
3545
item -> DeviceInfo = PhReferenceObject (Tree -> DeviceInfo );
3544
3546
item -> DeviceInfoData .Interface = TRUE;
3545
3547
RtlCopyMemory (& item -> DeviceInfoData .InterfaceData , DeviceInterfaceData , sizeof (SP_DEVICE_INTERFACE_DATA ));
Original file line number Diff line number Diff line change @@ -308,6 +308,7 @@ typedef struct _PH_DEVINFO_DATA
308
308
309
309
typedef struct _PH_DEVICE_ITEM
310
310
{
311
+ struct _PH_DEVICE_TREE * Tree ;
311
312
struct _PH_DEVICE_ITEM * Parent ;
312
313
struct _PH_DEVICE_ITEM * Sibling ;
313
314
struct _PH_DEVICE_ITEM * Child ;
Original file line number Diff line number Diff line change @@ -973,6 +973,8 @@ NTSTATUS DevicePropertiesThreadStart(
973
973
PhDereferenceObject (propContext );
974
974
}
975
975
976
+ PhDereferenceObject (context -> DeviceItem -> Tree );
977
+ PhDereferenceObject (context -> DeviceItem );
976
978
PhFree (context );
977
979
978
980
return STATUS_SUCCESS ;
@@ -989,6 +991,8 @@ BOOLEAN DeviceShowProperties(
989
991
990
992
context -> ParentWindowHandle = ParentWindowHandle ;
991
993
context -> DeviceItem = PhReferenceObject (DeviceItem );
994
+ // Since we might use the relationships of the device item, we must reference the tree too.
995
+ PhReferenceObject (context -> DeviceItem -> Tree );
992
996
993
997
PhCreateThread2 (DevicePropertiesThreadStart , context );
994
998
return TRUE;
You can’t perform that action at this time.
0 commit comments