-
Notifications
You must be signed in to change notification settings - Fork 259
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #61 from darrenstahlmsft/RemoveOldAPI
Deleting old API in preparation for v0.4.0
- Loading branch information
Showing
9 changed files
with
28 additions
and
292 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |
This file was deleted.
Oops, something went wrong.