Skip to content
This repository was archived by the owner on Feb 20, 2020. It is now read-only.
Merged
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
31 changes: 0 additions & 31 deletions diskspace_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,34 +20,3 @@ func freeDiskSpaceBytes(dir string) (uint64, error) {
log.Printf("Disk available: %v bytes", b)
return b, nil
}

// *************************************************************************
// We can probably delete this, it is an alternative version in case we have
// problems with simpler version above
// *************************************************************************
func freeDiskSpaceBytes2(dir string) (uint64, error) {
kernel32, err := syscall.LoadLibrary("Kernel32.dll")
if err != nil {
log.Panic(err)
}
defer syscall.FreeLibrary(kernel32)
GetDiskFreeSpaceEx, err := syscall.GetProcAddress(syscall.Handle(kernel32), "GetDiskFreeSpaceExW")
if err != nil {
return 0, err
}
lpFreeBytesAvailable := int64(0)
lpTotalNumberOfBytes := int64(0)
lpTotalNumberOfFreeBytes := int64(0)
r, a, b := syscall.Syscall6(
uintptr(GetDiskFreeSpaceEx),
4,
uintptr(unsafe.Pointer(syscall.StringToUTF16Ptr("C:"))),
uintptr(unsafe.Pointer(&lpFreeBytesAvailable)),
uintptr(unsafe.Pointer(&lpTotalNumberOfBytes)),
uintptr(unsafe.Pointer(&lpTotalNumberOfFreeBytes)),
0,
0,
)
log.Print("Disk space:", r, a, b, lpFreeBytesAvailable, lpTotalNumberOfBytes, lpTotalNumberOfFreeBytes)
return uint64(lpFreeBytesAvailable), nil
}
5 changes: 0 additions & 5 deletions feature.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,4 @@ type (
Start() *CommandExecutionError
Stop(err *ExecutionErrors)
}

EnabledFeatures struct {
// A certificate should be generated which will include information for downstream tasks to build a level of trust for the artifacts produced by the task and the environment it ran in.
ChainOfTrust bool `json:"chainOfTrust,omitempty"`
}
)
11 changes: 0 additions & 11 deletions plat_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,17 +114,6 @@ func immediateShutdown(cause string) {
}
}

func exceptionOrFailure(errCommand error) *CommandExecutionError {
switch errCommand.(type) {
case *exec.ExitError:
return &CommandExecutionError{
Cause: errCommand,
TaskStatus: failed,
}
}
panic(errCommand)
}

func processCommandOutput(callback func(line string), prog string, options ...string) error {
out, err := exec.Command(prog, options...).Output()
if err != nil {
Expand Down
22 changes: 0 additions & 22 deletions powershell_windows.go

This file was deleted.

11 changes: 0 additions & 11 deletions runasadministrator_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package main

import (
"fmt"
"net/http"

"github.com/taskcluster/generic-worker/win32"
"github.com/taskcluster/taskcluster-base-go/scopes"
Expand Down Expand Up @@ -47,9 +46,6 @@ func (l *RunAsAdministratorTask) RequiredScopes() scopes.Required {
}}
}

type RunAsAdministratorHandler struct {
}

func (l *RunAsAdministratorTask) Start() *CommandExecutionError {
if config.RunTasksAsCurrentUser {
// already running as LocalSystem with UAC elevation
Expand All @@ -73,12 +69,5 @@ func (l *RunAsAdministratorTask) Start() *CommandExecutionError {
return nil
}

func ProcessRequests(s *http.Server) {
// s.ListenAndServe()
}

func (l *RunAsAdministratorTask) Stop(err *ExecutionErrors) {
}

func (handler *RunAsAdministratorHandler) ServeHTTP(writer http.ResponseWriter, request *http.Request) {
}