Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions internal/hcs/process.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,10 @@ func (process *Process) ResizeConsole(width, height uint16) error {
modifyRequestStr := string(modifyRequestb)

var resultp *uint16
completed := false
go syscallWatcher(fmt.Sprintf("ModifyProcess %s: %d", process.SystemID(), process.Pid()), &completed)
err = hcsModifyProcess(process.handle, modifyRequestStr, &resultp)
completed = true
events := processHcsResult(resultp)
if err != nil {
return makeProcessError(process, operation, err, events)
Expand Down Expand Up @@ -279,7 +282,10 @@ func (process *Process) Stdio() (io.WriteCloser, io.ReadCloser, io.ReadCloser, e
processInfo hcsProcessInformation
resultp *uint16
)
completed := false
go syscallWatcher(fmt.Sprintf("GetProcessInfo %s: %d", process.SystemID(), process.Pid()), &completed)
err := hcsGetProcessInfo(process.handle, &processInfo, &resultp)
completed = true
events := processHcsResult(resultp)
if err != nil {
return nil, nil, nil, makeProcessError(process, operation, err, events)
Expand Down Expand Up @@ -331,7 +337,10 @@ func (process *Process) CloseStdin() error {
modifyRequestStr := string(modifyRequestb)

var resultp *uint16
completed := false
go syscallWatcher(fmt.Sprintf("ModifyProcess %s: %d", process.SystemID(), process.Pid()), &completed)
err = hcsModifyProcess(process.handle, modifyRequestStr, &resultp)
completed = true
events := processHcsResult(resultp)
if err != nil {
return makeProcessError(process, operation, err, events)
Expand Down Expand Up @@ -359,9 +368,13 @@ func (process *Process) Close() error {
return makeProcessError(process, operation, err, nil)
}

completed := false
go syscallWatcher(fmt.Sprintf("CloseProcess %s: %d", process.SystemID(), process.Pid()), &completed)
if err := hcsCloseProcess(process.handle); err != nil {
completed = true
return makeProcessError(process, operation, err, nil)
}
completed = true

process.handle = 0

Expand Down
3 changes: 3 additions & 0 deletions internal/hcs/system.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,10 @@ func OpenComputeSystem(id string) (*System, error) {
handle hcsSystem
resultp *uint16
)
completed := false
go syscallWatcher(fmt.Sprintf("OpenComputeSystem %s", id), &completed)
err := hcsOpenComputeSystem(id, &handle, &resultp)
completed = true
events := processHcsResult(resultp)
if err != nil {
return nil, makeSystemError(computeSystem, operation, "", err, events)
Expand Down