Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-fonts
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Aleksandr Isakov
wine-fonts
Commits
c0916208
Commit
c0916208
authored
Feb 01, 2022
by
Paul Gofman
Committed by
Alexandre Julliard
Feb 01, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hnetcfg: Open connection to gateway in init_gateway_connection().
Signed-off-by:
Paul Gofman
<
pgofman@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
583605be
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
1 deletion
+42
-1
Makefile.in
dlls/hnetcfg/Makefile.in
+1
-1
port.c
dlls/hnetcfg/port.c
+41
-0
No files found.
dlls/hnetcfg/Makefile.in
View file @
c0916208
EXTRADEFS
=
-DWINE_NO_LONG_TYPES
MODULE
=
hnetcfg.dll
IMPORTS
=
oleaut32 ole32 advapi32 mpr uuid
DELAYIMPORTS
=
ws2_32
DELAYIMPORTS
=
ws2_32
winhttp
EXTRADLLFLAGS
=
-Wb
,--prefer-native
C_SRCS
=
\
...
...
dlls/hnetcfg/port.c
View file @
c0916208
...
...
@@ -42,6 +42,7 @@ static struct
LONG
refs
;
BOOL
winsock_initialized
;
WCHAR
locationW
[
256
];
HINTERNET
session
,
connection
;
}
upnp_gateway_connection
;
...
...
@@ -84,9 +85,43 @@ static BOOL parse_search_response( char *response, WCHAR *locationW, unsigned in
return
FALSE
;
}
static
BOOL
open_gateway_connection
(
void
)
{
static
const
int
timeout
=
3000
;
WCHAR
hostname
[
64
],
urlpath
[
128
];
URL_COMPONENTS
url
;
memset
(
&
url
,
0
,
sizeof
(
url
)
);
url
.
dwStructSize
=
sizeof
(
url
);
url
.
lpszHostName
=
hostname
;
url
.
dwHostNameLength
=
ARRAY_SIZE
(
hostname
);
url
.
lpszUrlPath
=
urlpath
;
url
.
dwUrlPathLength
=
ARRAY_SIZE
(
urlpath
);
if
(
!
WinHttpCrackUrl
(
upnp_gateway_connection
.
locationW
,
0
,
0
,
&
url
))
return
FALSE
;
upnp_gateway_connection
.
session
=
WinHttpOpen
(
L"hnetcfg"
,
WINHTTP_ACCESS_TYPE_NO_PROXY
,
WINHTTP_NO_PROXY_NAME
,
WINHTTP_NO_PROXY_BYPASS
,
0
);
if
(
!
upnp_gateway_connection
.
session
)
return
FALSE
;
if
(
!
WinHttpSetTimeouts
(
upnp_gateway_connection
.
session
,
timeout
,
timeout
,
timeout
,
timeout
))
return
FALSE
;
TRACE
(
"hostname %s, urlpath %s, port %u.
\n
"
,
debugstr_w
(
hostname
),
debugstr_w
(
urlpath
),
url
.
nPort
);
upnp_gateway_connection
.
connection
=
WinHttpConnect
(
upnp_gateway_connection
.
session
,
hostname
,
url
.
nPort
,
0
);
if
(
!
upnp_gateway_connection
.
connection
)
{
WARN
(
"WinHttpConnect error %u.
\n
"
,
GetLastError
()
);
return
FALSE
;
}
return
TRUE
;
}
static
void
gateway_connection_cleanup
(
void
)
{
TRACE
(
".
\n
"
);
WinHttpCloseHandle
(
upnp_gateway_connection
.
connection
);
WinHttpCloseHandle
(
upnp_gateway_connection
.
session
);
if
(
upnp_gateway_connection
.
winsock_initialized
)
WSACleanup
();
memset
(
&
upnp_gateway_connection
,
0
,
sizeof
(
upnp_gateway_connection
)
);
}
...
...
@@ -164,6 +199,12 @@ static BOOL init_gateway_connection(void)
return
FALSE
;
}
TRACE
(
"Gateway description location %s.
\n
"
,
debugstr_w
(
upnp_gateway_connection
.
locationW
)
);
if
(
!
open_gateway_connection
())
{
WARN
(
"Error opening gateway connection.
\n
"
);
return
FALSE
;
}
TRACE
(
"Opened gateway connection.
\n
"
);
return
TRUE
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment