其实网上搜一圈,有相当一部分人都遇到这个问题,包括在中英文的Microsoft Community中,但是最后都无解,不了了之。其它人似乎并没有详细分析问题的起因,我找到了起因,并一定程度上尝试解决了,但是这次又出现了并且解决不了。
这个问题的现象是:在应用商店或者Xbox App中,所有依赖“游戏服务”的游戏(绝大多数xgp游戏)无法下载安装,卡住不动,已安装的游戏无法启动。
并且打开Xbox App中会显示这个绿条条“安装或启动游戏遇到问题”。

这个无法通过“立即修复”里的那个建议,也就是无法通过
Get-AppxPackage *gamingservices* -allusers | remove-appxpackage -allusers
重新安装“游戏服务”App来解决。
归根到底的原因是Gaming Service无法启动 :

再深一层的原因:
这个GamingServices.exe启动时会尝试加载(安装)两个驱动:一个xvdd.inf(.sys),一个gameflt.inf(.sys)。xvdd.inf是可以正常加载的,并且会安装一个虚拟设备:SWD\XvddEnum\XvddRootDevice_Instance
(用pnputil.exe /enum-devices /drivers可以找到)。gameflt.sys会作为service加载,不会产生虚拟设备。
但是奇怪的是,当GamingServices.exe试图安装 gameflt.inf时,Windows会认为已经有一个更新的版本已经安装了,不让继续。这是这个问题的根本原因!
从C:\Windows\INF\setupapi.dev.log里可以看出来,每次GamingServices尝试启动都会尝试安装这个gameflt.inf驱动,然后Windows不让安装。
>>> [Device Install (DiInstallDriver) - C:\Program Files\WindowsApps\Microsoft.GamingServices_3.59.11001.0_x64__8wekyb3d8bbwe\drivers\gameflt.inf]
>>> Section start 2021/12/02 22:43:02.223
cmd: "C:\Program Files\WindowsApps\Microsoft.GamingServices_3.59.11001.0_x64__8wekyb3d8bbwe\GamingServices.exe"
ndv: Flags: 0x00000000
ndv: INF path: C:\Program Files\WindowsApps\Microsoft.GamingServices_3.59.11001.0_x64__8wekyb3d8bbwe\drivers\gameflt.inf
dvs: {DrvSetupInstallDriver - C:\Program Files\WindowsApps\Microsoft.GamingServices_3.59.11001.0_x64__8wekyb3d8bbwe\drivers\gameflt.inf}
dvs: Flags: 0x00000000
dvs: {Driver Setup Import Driver Package: C:\Program Files\WindowsApps\Microsoft.GamingServices_3.59.11001.0_x64__8wekyb3d8bbwe\drivers\gameflt.inf} 22:43:02.270
dvs: Driver package already imported as 'oem78.inf'.
inf: Driver package is fully isolated.
dvs: {Driver Setup Import Driver Package - exit (0x00000000)} 22:43:02.289
inf: Driver package is fully isolated.
ump: {Plug and Play Service: Driver Install for C:\WINDOWS\System32\DriverStore\FileRepository\gameflt.inf_amd64_522fdd92caccac75\gameflt.inf}
pol: {Driver package policy check} 22:43:02.310
pol: {Driver package policy check - exit(0x00000000)} 22:43:02.312
sto: {Configure Driver Package: C:\WINDOWS\System32\DriverStore\FileRepository\gameflt.inf_amd64_522fdd92caccac75\gameflt.inf}
inf: Class GUID = {d546500a-2aeb-45f6-9482-f4b1799c3177}
inf: Class Options = Configurable
inf: {Configure Driver: Game mini-filter driver}
inf: Section Name = DefaultInstall.NTamd64
inf: Driver Type = Primitive
sto: Finding all driver package versions
! sto: Skipping driver superceded by newer driver package ''.
inf: {Configure Driver: exit(0x00000000)}
flq: {FILE_QUEUE_COMMIT} 22:43:02.338
flq: {FILE_QUEUE_COMMIT - exit(0x00000000)} 22:43:02.341
sto: {Configure Driver Package: exit(0x00000000)}
ump: {Plug and Play Service: Driver Install exit(00000000)}
dvs: {DrvSetupInstallDriver - exit(00000000)}
<<< Section end 2021/12/02 22:43:02.353
<<< [Exit status: SUCCESS]
之前我有次通过pnputil.exe /enum-devices /drivers无意间发现,这个gameflt.inf以某种形式挂在了上面提到的那个xvdd虚拟设备上,卸掉之后(通过pnputil.exe /remove-device SWD\XvddEnum\XvddRootDevice_Instance卸载),gameflt这个驱动就能挂上了,Gaming Service就能正常启动了。
但是过了段时间这个问题似乎又自己出现了,然后我又通过同样的方法卸载,也解决了。
但是这次,不行了。setupapi.dev.log中的现象一样,都是Windows认为有一个更新版本的驱动已经安装,不让打上这个gameflt驱动。但是从pnputil列出来的列表中,似乎并没有发现哪个设备或虚拟设备挂有它。尝试通过各种工具(如DriverStoreExplorer)删除DriverStore里的这个驱动,也无济于事。目前我暂时没找到解决方法。
感觉原因有三个:
- 这个Gaming Service卸载时及启动时没有清理环境,只是无脑的挂驱动,挂不上就罢工。如果是我写这个代码,我会发现在环境不干净时(比如发现先前已挂过驱动或产生过虚拟设备),卸载掉老的驱动以及虚拟设备,确保环境干净再尝试安装。
- 这个gameflt驱动因为某种原因挂在了某个设备或虚拟设备上,作为一个以service存在的驱动,这个是不应该出现的。
- 是似乎Windows存在某种bug,在试图安装一个不存在的驱动时,也会报告“Skipping driver superceded by newer driver package”导致无法安装。
请微软排查一下问题,谢谢。