mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-20 13:23:18 -07:00
Update vendored windows libs
This commit is contained in:
parent
f61c211655
commit
b1cefa94e5
226 changed files with 33472 additions and 11882 deletions
|
@ -2,29 +2,30 @@
|
|||
API hooks for network stuff.
|
||||
"""
|
||||
|
||||
__all__ = ('AddConnection')
|
||||
__all__ = 'AddConnection'
|
||||
|
||||
from jaraco.windows.error import WindowsError
|
||||
from .api import net
|
||||
|
||||
|
||||
def AddConnection(
|
||||
remote_name, type=net.RESOURCETYPE_ANY, local_name=None,
|
||||
provider_name=None, user=None, password=None, flags=0):
|
||||
resource = net.NETRESOURCE(
|
||||
type=type,
|
||||
remote_name=remote_name,
|
||||
local_name=local_name,
|
||||
provider_name=provider_name,
|
||||
# WNetAddConnection2 ignores the other members of NETRESOURCE
|
||||
)
|
||||
remote_name,
|
||||
type=net.RESOURCETYPE_ANY,
|
||||
local_name=None,
|
||||
provider_name=None,
|
||||
user=None,
|
||||
password=None,
|
||||
flags=0,
|
||||
):
|
||||
resource = net.NETRESOURCE(
|
||||
type=type,
|
||||
remote_name=remote_name,
|
||||
local_name=local_name,
|
||||
provider_name=provider_name,
|
||||
# WNetAddConnection2 ignores the other members of NETRESOURCE
|
||||
)
|
||||
|
||||
result = net.WNetAddConnection2(
|
||||
resource,
|
||||
password,
|
||||
user,
|
||||
flags,
|
||||
)
|
||||
result = net.WNetAddConnection2(resource, password, user, flags)
|
||||
|
||||
if result != 0:
|
||||
raise WindowsError(result)
|
||||
if result != 0:
|
||||
raise WindowsError(result)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue