Skip to content

proposal: x/sys/windows: Add ergonomic API for EnumProcesses #60289

@roman-mazur

Description

@roman-mazur

While fixing an issue (#60223) with the existing windows.EnumProcesses we had to introduce some manually written code wrapping what mkwinsyscall can generate and realized that the function signature we have is quite weird: it has *uint32 in its second parameter to return the number of bytes taken by the data added to the processIds slice.

It would be much more ergonomic to have an API that looks like

func EnumProcesses(processIds []uint32) (n int, err error)

where n has the number of items added to the input slice.

To keep backward compatibility, we would need to keep the old function and add a new one with a different name. So the final proposal is to add EnumProcs with the signature below and to mark EnumProcesses as deprecated.

func EnumProcs(processIds []uint32) (n int, err error)

I do have a need for this function, but am I alone?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions