ejectwin

package module
v0.0.0-...-0ede66e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 15, 2020 License: MIT Imports: 5 Imported by: 0

README

ejectwin

Eject CD/DVD tray from golang. Only for windows.

How to use

$ go get gitlab.com/shigeya53/ejectwin
import "gitlab.com/shigeya53/ejectwin"

func main() {
    // first argument is Drive letter, second arugment is timeout in millisec
    ejectwin.EjectDrive("E", 100)
}

Documentation

Rendered for windows/amd64

Index

Constants

View Source
const (
	FSCTL_LOCK_VOLUME           = uint32(0x90018)
	FSCTL_DISMOUNT_VOLUME       = uint32(0x90020)
	IOCTL_STORAGE_MEDIA_REMOVAL = uint32(0x2d4804)
	IOCTL_STORAGE_EJECT_MEDIA   = uint32(0x2d4808)
)

Variables

This section is empty.

Functions

func EjectVolume

func EjectVolume(drive string, timeout uint32) error

EjectVolume Eject the tray of the drive with timeout

func GetDriveType

func GetDriveType(lpRootPathName *uint16) (driveType uint32, err error)

func GetTickCount

func GetTickCount() (tick uint32)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL