MCPcopy
hub / github.com/Velocidex/velociraptor / DLLVar

Method DLLVar

tools/mkwinsyscall.go:508–521  ·  view source on GitHub ↗

DLLVar returns a valid Go identifier that represents DLLName.

()

Source from the content-addressed store, hash-verified

506
507// DLLVar returns a valid Go identifier that represents DLLName.
508func (f *Fn) DLLVar() string {
509 id := strings.Map(func(r rune) rune {
510 switch r {
511 case '.', '-':
512 return '_'
513 default:
514 return r
515 }
516 }, f.DLLName())
517 if !token.IsIdentifier(id) {
518 panic(fmt.Errorf("could not create Go identifier for DLLName %q", f.DLLName()))
519 }
520 return id
521}
522
523// DLLFuncName returns DLL function name for function f.
524//

Callers 1

DLLsMethod · 0.80

Calls 2

DLLNameMethod · 0.95
ErrorfMethod · 0.45

Tested by

no test coverage detected