| 1072 | } |
| 1073 | |
| 1074 | BOOL DumpDeviceStack(_In_ HDEVINFO Devs, _In_ PSP_DEVINFO_DATA DevInfo) |
| 1075 | /*++ |
| 1076 | |
| 1077 | Routine Description: |
| 1078 | |
| 1079 | Write expected stack information to stdout |
| 1080 | |
| 1081 | Arguments: |
| 1082 | |
| 1083 | Devs )_ uniquely identify device |
| 1084 | DevInfo ) |
| 1085 | |
| 1086 | Return Value: |
| 1087 | |
| 1088 | TRUE if success |
| 1089 | |
| 1090 | --*/ |
| 1091 | { |
| 1092 | LPTSTR * filters; |
| 1093 | LPTSTR service; |
| 1094 | HKEY hClassKey = (HKEY)INVALID_HANDLE_VALUE; |
| 1095 | SP_DEVINFO_LIST_DETAIL_DATA devInfoListDetail; |
| 1096 | |
| 1097 | // |
| 1098 | // we need machine information |
| 1099 | // |
| 1100 | devInfoListDetail.cbSize = sizeof(devInfoListDetail); |
| 1101 | if(!SetupDiGetDeviceInfoListDetail(Devs,&devInfoListDetail)) { |
| 1102 | return FALSE; |
| 1103 | } |
| 1104 | |
| 1105 | // |
| 1106 | // we need device setup class, we can use the GUID in DevInfo |
| 1107 | // note that this GUID is a snapshot, but works fine |
| 1108 | // if DevInfo isn't old |
| 1109 | // |
| 1110 | |
| 1111 | // |
| 1112 | // class upper/lower filters are in class registry |
| 1113 | // |
| 1114 | hClassKey = SetupDiOpenClassRegKeyEx(&DevInfo->ClassGuid, |
| 1115 | KEY_READ, |
| 1116 | DIOCR_INSTALLER, |
| 1117 | devInfoListDetail.RemoteMachineName[0] ? devInfoListDetail.RemoteMachineName : NULL, |
| 1118 | NULL); |
| 1119 | |
| 1120 | if(hClassKey != INVALID_HANDLE_VALUE) { |
| 1121 | // |
| 1122 | // dump upper class filters if available |
| 1123 | // |
| 1124 | filters = GetRegMultiSz(hClassKey,REGSTR_VAL_UPPERFILTERS); |
| 1125 | if(filters) { |
| 1126 | if(filters[0]) { |
| 1127 | Padding(1); |
| 1128 | FormatToStream(stdout,MSG_DUMP_DEVICESTACK_UPPERCLASSFILTERS); |
| 1129 | DumpArray(2,filters); |
| 1130 | } |
| 1131 | DelMultiSz(filters); |
no test coverage detected