Skip to content
12 changes: 11 additions & 1 deletion scripts/capture-hw-details.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,17 @@ done

function libigc_version {
if [[ $OSTYPE = msys ]]; then
powershell -Command "(Get-ChildItem c:/Windows/System32/DriverStore/FileRepository/*/igc64.dll).VersionInfo.ProductVersion"
pwsh -Command '
$igc = @(Get-Process -Name dwm -Module | Where-Object ModuleName -eq 'igc64.dll').FileVersionInfo.FileVersion | Sort-Object -Unique
if ($igc.Count -gt 1) {
Write-Host "MULTIPLE"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a possible scenario? I understand when it comes to DriverStore (previous approach), which can contain multiple drivers, but we've switched to an approach where the driver currently in use is requested. Is it possible that multiple drivers are in use at the same time?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, after updating the driver, but before reboot, It lists 2 versions of igc64 loaded for dwm.exe. I suppose this it is done on purpose to allow fast fallback on driver crashes.

For example, see #5440 (comment).

However your comment highlighted another issue: when an interactive session is present on machine, this will return "MULTIPLE" despite there's only one library, since we have 2 dwms in this case: one for a login screen, and one for a session. I'll fix it with something like sort -u

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now it handles multiple objects

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you plan to do if script return MULTIPLE? Will this be a signal that the machine needs to be rebooted?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ping @kwasd

}
elseif ($igc.Count -eq 1) {
Write-Host $igc
}
else {
Write-Host "Not Found"
}'
return
fi
if dpkg-query --show libigc2 &> /dev/null; then
Expand Down