Windows C++ : Getting the process name from a process ID

It seems the opposite is a better documented problem (e.g. Get Process ID (PID) from process name (string) – C++ Windows API), so just in case some one out there has a Process ID, and needs to translate it into the actual name, here goes: std::string ProcIDtoProcName(std::uint32_t pid) { std::string result = "UNKNOWN"; HANDLE hProcess … Continue reading Windows C++ : Getting the process name from a process ID

Golang Gotcha: Modifying an array of structs

Scenario Using Golang, we initialize an array of structs, within which we'd like to change a field by iterating over the initialized array. This would be necessary (for example) to initialize certain struct fields. An initial pass at the code may look something like this: // play with this code here: https://go.dev/play/p/VH0duYxZVZn package main import … Continue reading Golang Gotcha: Modifying an array of structs