Skip to content
This repository was archived by the owner on Jan 22, 2022. It is now read-only.
This repository was archived by the owner on Jan 22, 2022. It is now read-only.

Can't query from Win32_VolumeChangeEvent #47

Description

@qwerty22121998
type Win32_VolumeChangeEvent struct {
	EventType uint16
	DriveName string
}

func main() {
	var dst []Win32_VolumeChangeEvent
	q := wmi.CreateQuery(&dst, "")
	fmt.Println(q)

	for {
		err := wmi.Query(q, &dst)
		if err != nil {
			log.Fatal(err)
		}
		if len(dst) == 0 {
			continue
		}
		for _, v := range dst {
			fmt.Println(v)
		}

	}
}

but the result always be empty. when the example run well, i don't know why :(

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions