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

Function DumpDeviceStatus

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

Source from the content-addressed store, hash-verified

158}
159
160BOOL DumpDeviceStatus(_In_ HDEVINFO Devs, _In_ PSP_DEVINFO_DATA DevInfo)
161/*++
162
163Routine Description:
164
165 Write device status to stdout
166
167Arguments:
168
169 Devs )_ uniquely identify device
170 DevInfo )
171
172Return Value:
173
174 none
175
176--*/
177{
178 SP_DEVINFO_LIST_DETAIL_DATA devInfoListDetail;
179 ULONG status = 0;
180 ULONG problem = 0;
181 BOOL hasInfo = FALSE;
182 BOOL isPhantom = FALSE;
183 CONFIGRET cr = CR_SUCCESS;
184
185 devInfoListDetail.cbSize = sizeof(devInfoListDetail);
186 if((!SetupDiGetDeviceInfoListDetail(Devs,&devInfoListDetail)) ||
187 ((cr = CM_Get_DevNode_Status_Ex(&status,&problem,DevInfo->DevInst,0,devInfoListDetail.RemoteMachineHandle))!=CR_SUCCESS)) {
188 if ((cr == CR_NO_SUCH_DEVINST) || (cr == CR_NO_SUCH_VALUE)) {
189 isPhantom = TRUE;
190 } else {
191 Padding(1);
192 FormatToStream(stdout,MSG_DUMP_STATUS_ERROR);
193 return FALSE;
194 }
195 }
196 //
197 // handle off the status/problem codes
198 //
199 if (isPhantom) {
200 Padding(1);
201 FormatToStream(stdout,MSG_DUMP_PHANTOM);
202 return TRUE;
203 }
204 if((status & DN_HAS_PROBLEM) && problem == CM_PROB_DISABLED) {
205 hasInfo = TRUE;
206 Padding(1);
207 FormatToStream(stdout,MSG_DUMP_DISABLED);
208 return TRUE;
209 }
210 if(status & DN_HAS_PROBLEM) {
211 hasInfo = TRUE;
212 Padding(1);
213 FormatToStream(stdout,MSG_DUMP_PROBLEM,problem);
214 }
215 if(status & DN_PRIVATE_PROBLEM) {
216 hasInfo = TRUE;
217 Padding(1);

Callers 1

FindCallbackFunction · 0.85

Calls 2

PaddingFunction · 0.85
FormatToStreamFunction · 0.85

Tested by

no test coverage detected