Skip to content

Commit

Permalink
Merge pull request #61 from darrenstahlmsft/RemoveOldAPI
Browse files Browse the repository at this point in the history
Deleting old API in preparation for v0.4.0
  • Loading branch information
swernli authored Aug 10, 2016
2 parents 7b7051e + 4f10c13 commit 6a6862b
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 292 deletions.
22 changes: 0 additions & 22 deletions createcomputesystem.go

This file was deleted.

101 changes: 0 additions & 101 deletions createprocess.go

This file was deleted.

43 changes: 0 additions & 43 deletions getcomputesystemproperties.go

This file was deleted.

22 changes: 0 additions & 22 deletions resizeconsole.go

This file was deleted.

43 changes: 0 additions & 43 deletions shutdownterminatecomputesystem.go

This file was deleted.

21 changes: 0 additions & 21 deletions startcomputesystem.go

This file was deleted.

20 changes: 0 additions & 20 deletions terminateprocess.go

This file was deleted.

28 changes: 28 additions & 0 deletions utils.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,39 @@
package hcsshim

import (
"io"
"syscall"

"github.com/Microsoft/go-winio"
)

var (
vmcomputedll = syscall.NewLazyDLL("vmcompute.dll")
hcsCallbackAPI = vmcomputedll.NewProc("HcsRegisterComputeSystemCallback")
hcsCallbacksSupported = hcsCallbackAPI.Find() == nil
)

// makeOpenFiles calls winio.MakeOpenFile for each handle in a slice but closes all the handles
// if there is an error.
func makeOpenFiles(hs []syscall.Handle) (_ []io.ReadWriteCloser, err error) {
fs := make([]io.ReadWriteCloser, len(hs))
for i, h := range hs {
if h != syscall.Handle(0) {
if err == nil {
fs[i], err = winio.MakeOpenFile(h)
}
if err != nil {
syscall.Close(h)
}
}
}
if err != nil {
for _, f := range fs {
if f != nil {
f.Close()
}
}
return nil, err
}
return fs, nil
}
20 changes: 0 additions & 20 deletions waitprocess.go

This file was deleted.

0 comments on commit 6a6862b

Please sign in to comment.