MCPcopy
hub / github.com/safing/portmaster / loadDLL

Method loadDLL

service/integration/integration_windows.go:50–72  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

48}
49
50func (i *OSIntegration) loadDLL() error {
51 // Find path to the dll.
52 file, err := i.instance.BinaryUpdates().GetFile("portmaster-core.dll")
53 if err != nil {
54 return err
55 }
56 // Load the DLL.
57 i.os.dll, err = windows.LoadDLL(file.Path())
58 if err != nil {
59 return fmt.Errorf("failed to load dll: %q", err)
60 }
61
62 // Enumerate all needed dll functions.
63 i.os.etwFunctions, err = initializeETW(i.os.dll)
64 if err != nil {
65 return err
66 }
67
68 // Notify listeners
69 i.OnInitializedEvent.Submit(struct{}{})
70
71 return nil
72}
73
74// CleanUp releases any resources allocated during initialization.
75func (i *OSIntegration) CleanUp() error {

Callers 1

InitializeMethod · 0.95

Calls 6

initializeETWFunction · 0.85
GetFileMethod · 0.80
ErrorfMethod · 0.80
BinaryUpdatesMethod · 0.65
PathMethod · 0.65
SubmitMethod · 0.45

Tested by

no test coverage detected