wnetapi

package
v0.0.0-...-c8f0667 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 24, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddConnection2

func AddConnection2(userName, password string, flags netresource.Option, resource netresource.Data) (err error)

AddConnection2 attempts to map the given local name to a remote resource. If persistent is true it creates a persistent connection that survives logon/logoff cycles. It calls the WNetAddConnection2 windows API function.

https://learn.microsoft.com/en-us/windows/win32/api/winnetwk/nf-winnetwk-wnetaddconnection2w

func CancelConnection2

func CancelConnection2(name string, flags netresource.Option, force bool) (err error)

CancelConnection2 attempts to unmap the given local resource name that has previously been mapped to a remote resource. It calls the WNetCancelConnection2W windows API function.

If the ConnectUpdateProfile flag is provided, the connection will be permanently removed from the user profile.

If force is true, it will forcefully close open files if necessary.

https://learn.microsoft.com/en-us/windows/win32/api/winnetwk/nf-winnetwk-wnetcancelconnection2w

func GetConnection

func GetConnection(local string) (remote string, err error)

GetConnection returns the remote resource that the given local name is mapped to. It calls the WNetGetConnectionW windows API function.

https://learn.microsoft.com/en-us/windows/win32/api/winnetwk/nf-winnetwk-wnetgetconnectionw

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL