https://bugs.winehq.org/show_bug.cgi?id=56291
Bug ID: 56291 Summary: Kodu game lab crashes:Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object. Product: Wine Version: 9.1 Hardware: x86-64 URL: https://kodugamelab.blob.core.windows.net/blob/Builds/ KoduSetup_1.6.18.0.exe OS: Linux Status: NEW Keywords: dotnet, download Severity: normal Priority: P2 Component: wmi&wbemprox Assignee: wine-bugs@winehq.org Reporter: xerox.xerox2000x@gmail.com Distribution: Debian
Created attachment 76010 --> https://bugs.winehq.org/attachment.cgi?id=76010 patch for 1st missing prop
A user reported crash on the forum: https://forum.winehq.org/viewtopic.php?t=38495
Steps to reproduce: install dotnet48 with winetricks and install https://kodugamelab.blob.core.windows.net/blob/Builds/KoduSetup_1.6.18.0.exe and https://kodugamelab.blob.core.windows.net/blob/xnafx40_redist.msi
It seemingly crashes besause of two missing properties in Win32_PnPEntity:
0024:trace:wbemprox:wbem_services_ExecQuery 0418C7C8, L"WQL", L"SELECT * FROM Win32_PnPEntity", 0x10, 00000000, 0012F1D8 . 0024:trace:wbemprox:class_object_Get 0418D000, L"Caption", 0, 0012F224, 0255B7C4, 0255B7C8 . 0024:err:eventlog:ReportEventW L"Exception Info: System.NullReferenceException\n" . Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object. at Boku.Program2.Main(String[] args)
After adding previous property there is:
0024:trace:wbemprox:wbem_services_ExecQuery 041923E0, L"WQL", L"Select * From Win32_PnPEntity where ClassGuid = '{4d36e967-e325-11ce-bfc1-08002be10318}'", 0x10, 00000000, 0012F1D8 . 0024:err:eventlog:ReportEventW L"Description: The process was terminated due to an unhandled exception.\n" . Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object. at Boku.Program2.Main(String[] args)
After adding something for that the program starts but crashes again, because it cannot find XnaNative.dll. That seems like another bug, don't know what goes wrong there. After putting xnanative.dll from ./drive_c/Program Files (x86)/Common Files/Microsoft Shared/XNA/Framework/v4.0/XnaNative.dll into a path (like in syswow64) the program starts and seems to work fine.
Attached patch for the 1st missing prop
https://bugs.winehq.org/show_bug.cgi?id=56291
Vijay Kamuju infyquest@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |infyquest@gmail.com
--- Comment #1 from Vijay Kamuju infyquest@gmail.com --- Create a MR for it.
https://bugs.winehq.org/show_bug.cgi?id=56291
--- Comment #2 from Vijay Kamuju infyquest@gmail.com --- Create a MR for it.
https://bugs.winehq.org/show_bug.cgi?id=56291
--- Comment #3 from Louis Lenders xerox.xerox2000x@gmail.com --- (In reply to Vijay Kamuju from comment #2)
Create a MR for it.
1st patch sent: https://gitlab.winehq.org/wine/wine/-/merge_requests/5014
https://bugs.winehq.org/show_bug.cgi?id=56291
--- Comment #4 from Hans Leidekker hans@meelstraat.net --- (In reply to Louis Lenders from comment #0)
After adding previous property there is:
0024:trace:wbemprox:wbem_services_ExecQuery 041923E0, L"WQL", L"Select * From Win32_PnPEntity where ClassGuid = '{4d36e967-e325-11ce-bfc1-08002be10318}'", 0x10, 00000000, 0012F1D8
That's the DiskDrive class GUID, so it's looking for a disk drive. It can be retrieved with SetupDiGetDeviceProperty(DEVPKEY_Device_ClassGuid) but we don't create registry entries for disk drives yet. I think mountmgr would be the right place to do that.
https://bugs.winehq.org/show_bug.cgi?id=56291
--- Comment #5 from Louis Lenders xerox.xerox2000x@gmail.com --- Created attachment 76011 --> https://bugs.winehq.org/attachment.cgi?id=76011 patch for 2nd missing prop
Hi Hans,
In current code there is already a call for SetupDiGetDeviceInstanceIdW to get the device_id, and device_info also has a member "classguid", which seems to give the correct guids like in attached patch. Wouldn't that be enough to fix this?
I tested with one-liner: ([wmisearcher]"SELECT * FROM Win32_PnPEntity").Get()
and i seem to get correct entries afaict:
PS C:> ([wmisearcher]"SELECT * FROM Win32_PnPEntity").Get()
__GENUS : 2 __CLASS : Win32_PnPEntity __RELPATH : Win32_PnPEntity __PROPERTY_COUNT : 5 __DERIVATION : {} __SERVER : DEBIAN __NAMESPACE : ROOT\CIMV2 __PATH : \DEBIAN\ROOT\CIMV2:Win32_PnPEntity Caption : Wine PnP Device ClassGuid : {4D36E96E-E325-11CE-BFC1-08002BE10318} DeviceId : DISPLAY\DEFAULT_MONITOR\0000&0000 Manufacturer : The Wine Project Name : Wine PnP Device PSComputerName : DEBIAN
__GENUS : 2 __CLASS : Win32_PnPEntity __RELPATH : Win32_PnPEntity __PROPERTY_COUNT : 5 __DERIVATION : {} __SERVER : DEBIAN __NAMESPACE : ROOT\CIMV2 __PATH : \DEBIAN\ROOT\CIMV2:Win32_PnPEntity Caption : Wine PnP Device ClassGuid : {745A17A0-74D3-11D0-B6FE-00A0C90F57DA} DeviceId : HID\VID_845E&PID_0001\0&0000&0&0&0 Manufacturer : The Wine Project Name : Wine PnP Device PSComputerName : DEBIAN
__GENUS : 2 __CLASS : Win32_PnPEntity __RELPATH : Win32_PnPEntity __PROPERTY_COUNT : 5 __DERIVATION : {} __SERVER : DEBIAN __NAMESPACE : ROOT\CIMV2 __PATH : \DEBIAN\ROOT\CIMV2:Win32_PnPEntity Caption : Wine PnP Device ClassGuid : {745A17A0-74D3-11D0-B6FE-00A0C90F57DA} DeviceId : HID\VID_845E&PID_0002\0&0000&0&0&0 Manufacturer : The Wine Project Name : Wine PnP Device PSComputerName : DEBIAN
__GENUS : 2 __CLASS : Win32_PnPEntity __RELPATH : Win32_PnPEntity __PROPERTY_COUNT : 5 __DERIVATION : {} __SERVER : DEBIAN __NAMESPACE : ROOT\CIMV2 __PATH : \DEBIAN\ROOT\CIMV2:Win32_PnPEntity Caption : Wine PnP Device ClassGuid : {4D36E968-E325-11CE-BFC1-08002BE10318} DeviceId : PCI\VEN_0000&DEV_0000&SUBSYS_00000000&REV_00\00000000 Manufacturer : The Wine Project Name : Wine PnP Device PSComputerName : DEBIAN
__GENUS : 2 __CLASS : Win32_PnPEntity __RELPATH : Win32_PnPEntity __PROPERTY_COUNT : 5 __DERIVATION : {} __SERVER : DEBIAN __NAMESPACE : ROOT\CIMV2 __PATH : \DEBIAN\ROOT\CIMV2:Win32_PnPEntity Caption : Wine PnP Device ClassGuid : {4D36E97D-E325-11CE-BFC1-08002BE10318} DeviceId : ROOT\WINE\WINEBUS Manufacturer : The Wine Project Name : Wine PnP Device PSComputerName : DEBIAN
__GENUS : 2 __CLASS : Win32_PnPEntity __RELPATH : Win32_PnPEntity __PROPERTY_COUNT : 5 __DERIVATION : {} __SERVER : DEBIAN __NAMESPACE : ROOT\CIMV2 __PATH : \DEBIAN\ROOT\CIMV2:Win32_PnPEntity Caption : Wine PnP Device ClassGuid : {4D36E97D-E325-11CE-BFC1-08002BE10318} DeviceId : ROOT\WINE\WINEUSB Manufacturer : The Wine Project Name : Wine PnP Device PSComputerName : DEBIAN
__GENUS : 2 __CLASS : Win32_PnPEntity __RELPATH : Win32_PnPEntity __PROPERTY_COUNT : 5 __DERIVATION : {} __SERVER : DEBIAN __NAMESPACE : ROOT\CIMV2 __PATH : \DEBIAN\ROOT\CIMV2:Win32_PnPEntity Caption : Wine PnP Device ClassGuid : {745A17A0-74D3-11D0-B6FE-00A0C90F57DA} DeviceId : WINEBUS\VID_845E&PID_0001\0&0000&0&0&0 Manufacturer : The Wine Project Name : Wine PnP Device PSComputerName : DEBIAN
__GENUS : 2 __CLASS : Win32_PnPEntity __RELPATH : Win32_PnPEntity __PROPERTY_COUNT : 5 __DERIVATION : {} __SERVER : DEBIAN __NAMESPACE : ROOT\CIMV2 __PATH : \DEBIAN\ROOT\CIMV2:Win32_PnPEntity Caption : Wine PnP Device ClassGuid : {745A17A0-74D3-11D0-B6FE-00A0C90F57DA} DeviceId : WINEBUS\VID_845E&PID_0002\0&0000&0&0&0 Manufacturer : The Wine Project Name : Wine PnP Device PSComputerName : DEBIAN
https://bugs.winehq.org/show_bug.cgi?id=56291
--- Comment #6 from Hans Leidekker hans@meelstraat.net --- (In reply to Louis Lenders from comment #5)
Created attachment 76011 [details] patch for 2nd missing prop
Hi Hans,
In current code there is already a call for SetupDiGetDeviceInstanceIdW to get the device_id, and device_info also has a member "classguid", which seems to give the correct guids like in attached patch. Wouldn't that be enough to fix this?
Right, the class guid can be taken from that field too. For the other fields we'll need to query the properties.
https://bugs.winehq.org/show_bug.cgi?id=56291
--- Comment #7 from Louis Lenders xerox.xerox2000x@gmail.com --- (In reply to Hans Leidekker from comment #6)
(In reply to Louis Lenders from comment #5)
Created attachment 76011 [details] patch for 2nd missing prop
Hi Hans,
In current code there is already a call for SetupDiGetDeviceInstanceIdW to get the device_id, and device_info also has a member "classguid", which seems to give the correct guids like in attached patch. Wouldn't that be enough to fix this?
Right, the class guid can be taken from that field too. For the other fields we'll need to query the properties.
I'm afraid I don't get exactly what you're trying to say. What other fields are you referring to? The application only needs the property "classguid" to be present (nothing more), to prevent a crash. It doesn't seem to care that there are no device disks found. So couldn't we just report the classguids for other devices like in the patch (to prevent a crash)?
https://bugs.winehq.org/show_bug.cgi?id=56291
--- Comment #8 from Hans Leidekker hans@meelstraat.net --- (In reply to Louis Lenders from comment #7)
Right, the class guid can be taken from that field too. For the other fields we'll need to query the properties.
I'm afraid I don't get exactly what you're trying to say. What other fields are you referring to? The application only needs the property "classguid" to be present (nothing more), to prevent a crash. It doesn't seem to care that there are no device disks found. So couldn't we just report the classguids for other devices like in the patch (to prevent a crash)?
Sure, I was mostly thinking about how to implement more of Win32_PnPEntity.
https://bugs.winehq.org/show_bug.cgi?id=56291
--- Comment #9 from Louis Lenders xerox.xerox2000x@gmail.com --- @Hans, thanks for the help with the patches.
The game now starts but to make this fix more robust there's one more patch that I'd like to include:
The game now starts because no diskdrive guid is found, but if you hack it to return that guid there's a crash again (see end of post)
This means that when this piece of wmi code is more fleshed out , and actually returns a diskdrive, the program will crash again.
I'll send fix for this upstream.
Crash:
0024:trace:wbemprox:wbem_services_ExecQuery 033C1A78, L"WQL", L"Select * from Win32_DiskDrive", 0x10, 00000000, 0012F1D8 . 0024:trace:wbemprox:class_object_Get 033C8E50, L"Caption", 0, 0012F224, 018961A4, 018961A8 . 0024:err:eventlog:ReportEventW L"Description: The process was terminated due to an unhandled exception.\n" . Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object. at Boku.Program2.Main(String[] args) wine: Unhandled page fault on read access to 00000000 at address 04A075A2 (thread 0024), starting debugger... 0168:err:environ:init_peb starting L"C:\windows\syswow64\winedbg.exe" in experimental wow64 mode
https://bugs.winehq.org/show_bug.cgi?id=56291
Louis Lenders xerox.xerox2000x@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |988253a69bd0a48d027ba4e65ee | |735d9936d9144 Status|NEW |RESOLVED Summary|Kodu game lab |Kodu game lab crashes (with |crashes:Unhandled |xnafx40_redist+dotnet48 |Exception: |preinstalled): Object |System.NullReferenceExcepti |reference not set to an |on: Object reference not |instance of an object. |set to an instance of an | |object. | Resolution|--- |FIXED
--- Comment #10 from Louis Lenders xerox.xerox2000x@gmail.com --- This was fixed by 988253a69bd0a48d027ba4e65ee735d9936d9144
Also change title to reflect that xnafx40_redist should be pre-installed to run the program.
https://bugs.winehq.org/show_bug.cgi?id=56291
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #11 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 9.2.