MCPcopy Create free account
hub / github.com/NullArray/WinKernel-Resources / DumpDeviceStack

Function DumpDeviceStack

Drivers/Driver-SRC/setup/devcon/dump.cpp:1074–1194  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1072}
1073
1074BOOL DumpDeviceStack(_In_ HDEVINFO Devs, _In_ PSP_DEVINFO_DATA DevInfo)
1075/*++
1076
1077Routine Description:
1078
1079 Write expected stack information to stdout
1080
1081Arguments:
1082
1083 Devs )_ uniquely identify device
1084 DevInfo )
1085
1086Return 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);

Callers 1

FindCallbackFunction · 0.85

Calls 7

GetRegMultiSzFunction · 0.85
PaddingFunction · 0.85
FormatToStreamFunction · 0.85
DumpArrayFunction · 0.85
DelMultiSzFunction · 0.85
GetDevMultiSzFunction · 0.85
GetDeviceStringPropertyFunction · 0.85

Tested by

no test coverage detected