Handmade Hero»Forums»Code
Caio Takano
2 posts
HMH Con - Refenes talk, debug pc version
I loved the whole Con.
In the talk with Tommy he talked about how troublesome was to ship SMB on
the pc because you never know what people have installed in their pcs.

So how would you debug a problem where a program/driver that you maybe never
heard about is messing with your game setup? Is there some way to add this
kind of debug capability where users can send you info about all software
running in their machines?
Ginger Bill
222 posts / 3 projects
I am ginger thus have no soul.
HMH Con - Refenes talk, debug pc version
Edited by Ginger Bill on
One way is to survey what the user's hardware, firmware, and software is.

On windows, to find the information for the current computer system, you can use
1
GetSystemInfo(SYSTEM_INFO* system_info)
.
1
SYSTEM_INFO
contains the processor architecture; page size; number of processors; processor type; etc. There is also
1
GlobalMemoryStatus(MEMORYSTATUS* buffer)
to get the system currrent usage of physical and virtual memory.

Off the top of my head, I cannot tell you how to get other hardware (sound card, graphics card, etc.).


For finding software installed on windows, there is tool called
1
wmic
(Windows Management Instrumentation Command-line tool). Once you call it (in administrator mode), enter
1
/output:C:\install_list.txt product get name,version
. To do this, you will probably need to ask the user's permission to do this. There may be a better way to do it but I don't know at this moment in time.

As for drivers/firmware: the command line tool is
1
driverquery
. You can just output this to a text file.
Caio Takano
2 posts
HMH Con - Refenes talk, debug pc version
I see... Didn't know about wmic. But even with this log things should
be pretty difficult to debug I guess... Maybe there is some API that
can show some system logs about configuration changes? Like what process
changed something?
Ginger Bill
222 posts / 3 projects
I am ginger thus have no soul.
HMH Con - Refenes talk, debug pc version
The problem is that you may have to independently invent the wheel.

I don't know of any available APIs or software that does what exactly this.
Bryan Taylor
55 posts
HMH Con - Refenes talk, debug pc version
ctakano
I see... Didn't know about wmic. But even with this log things should
be pretty difficult to debug I guess... Maybe there is some API that
can show some system logs about configuration changes? Like what process
changed something?

Windows does log these things. At a cursory glance, it seems like they've even got an API for reading that log:
https://msdn.microsoft.com/en-us/...ws/desktop/aa385466(v=vs.85).aspx

(I dunno the specifics of using this.)

On a slightly related note: don't do this without explicitly asking the user's permission. Don't be malware. (I would log hardware configs automatically, but only do the event log if the user has a crash and wants to report it.)