Skip to content

Commit fd594a8

Browse files
committed
refactor(handle): Use fs dev mapper singleton in file path resolution
1 parent 5caa9a5 commit fd594a8

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

pkg/handle/object.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,14 @@ package handle
2424
import (
2525
"errors"
2626
"fmt"
27+
2728
"github.com/rabbitstack/fibratus/pkg/fs"
2829
htypes "github.com/rabbitstack/fibratus/pkg/handle/types"
2930
"github.com/rabbitstack/fibratus/pkg/sys"
3031
"github.com/rabbitstack/fibratus/pkg/util/key"
3132
"golang.org/x/sys/windows"
3233
)
3334

34-
var devMapper = fs.NewDevMapper()
35-
3635
// Duplicate duplicates the handle in the caller process's address space.
3736
func Duplicate(handle windows.Handle, pid uint32, access uint32) (windows.Handle, error) {
3837
// handle to the process with the handle to be duplicated.
@@ -91,7 +90,7 @@ func QueryName(handle windows.Handle, typ string, withTimeout bool) (string, hty
9190
if err != nil {
9291
return "", nil, err
9392
}
94-
name = devMapper.Convert(name)
93+
name = fs.GetDevMapper().Convert(name)
9594
fileInfo := &htypes.FileInfo{IsDirectory: sys.PathIsDirectory(name)}
9695
return name, fileInfo, nil
9796
case ALPCPort:

0 commit comments

Comments
 (0)