99#define COPY_BSTR_CHECK(name) if (src->name && !(dst->name = SysAllocString( src->name ))) \
101 free_port_mapping( dst ); \
109#undef COPY_BSTR_CHECK
111 dst->external =
src->external;
112 dst->internal =
src->internal;
113 dst->enabled =
src->enabled;
119 char *saveptr =
NULL, *tok, *tok2;
122 tok =
strtok_s( response,
"\n", &saveptr );
123 if (!tok)
return FALSE;
126 tok2 =
strtok( tok,
" " );
127 if (!tok2)
return FALSE;
129 if (!tok2)
return FALSE;
138 tok2 =
strtok( tok,
" " );
140 if (!
stricmp( tok2,
"LOCATION:" ))
145 WARN(
"Error parsing location.\n" );
156 static const WCHAR urn_wanipconnection[] =
L"urn:schemas-upnp-org:service:WANIPConnection:";
158 BOOL service_type_matches, control_url_found, found =
FALSE;
170 IStream_Release(
stream );
181 control_url_found = service_type_matches =
FALSE;
187 WARN(
"IXmlReader_GetLocalName failed.\n" );
197 if (
FAILED(IXmlReader_Read(
reader, &node_type )))
goto done;
202 service_type_matches =
version >= 1;
206 if (
FAILED(IXmlReader_Read(
reader, &node_type )))
goto done;
211 control_url_found =
TRUE;
214 if (service_type_matches && control_url_found)
218 FIXME(
"Found another WANIPConnection service, ignoring.\n" );
229 IXmlReader_Release(
reader );
230 IStream_Release(
stream );
249 IStream_Release(
stream );
259 for (
i = 0;
i < value_count; ++
i)
261 if (
i == value_count)
continue;
262 if (
FAILED(IXmlReader_Read(
reader, &node_type )))
goto done;
284 for (
i = 0;
i < value_count; ++
i)
290 IXmlReader_Release(
reader );
291 IStream_Release(
stream );
297 static const int timeout = 3000;
303 url.dwStructSize =
sizeof(
url);
317 TRACE(
"hostname %s, urlpath %s, port %u.\n",
330 static const WCHAR *accept_types[] =
335 unsigned int desc_xml_size,
offset;
365 desc_xml_size = 1024;
366 desc_xml =
malloc( desc_xml_size );
371 if (
offset + 1 == desc_xml_size)
376 if (!(
new =
realloc( desc_xml, desc_xml_size )))
378 ERR(
"No memory.\n" );
403 unsigned int result_count,
DWORD *http_status,
BSTR *server_error_code_str )
405 static const char request_template_header[] =
406 "<?xml version=\"1.0\"?>\r\n"
407 "<SOAP-ENV:Envelope xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\" "
408 "SOAP-ENV:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\">\r\n"
409 " <SOAP-ENV:Body>\r\n"
410 " <m:%S xmlns:m=\"urn:schemas-upnp-org:service:WANIPConnection:%u\">\r\n";
411 static const char request_template_footer[] =
413 " </SOAP-ENV:Body>\r\n"
414 "</SOAP-ENV:Envelope>\r\n";
416 unsigned int request_data_size, request_len,
offset,
i, reply_buffer_size;
417 char *request_data, *reply_buffer =
NULL, *
ptr;
419 WCHAR request_headers[1024];
424 *server_error_code_str =
NULL;
425 request_data_size =
strlen(request_template_header) +
strlen(request_template_footer) + 2 *
wcslen( function )
427 for (
i = 0;
i < request_param_count; ++
i)
431 if (!(request_data =
malloc( request_data_size )))
return FALSE;
441 request_data_size -=
offset;
442 for (
i = 0;
i < request_param_count; ++
i)
444 snprintf(
ptr, request_data_size,
" <%S>%S</%S>\r\n",
448 request_data_size -=
offset;
450 snprintf(
ptr, request_data_size, request_template_footer, function );
452 request_len =
strlen( request_data );
454 L"SOAPAction: \"urn:schemas-upnp-org:service:WANIPConnection:%u#%s\"\r\n"
455 L"Content-Type: text/xml",
467 size =
sizeof(*http_status);
479 reply_buffer_size = 1024;
480 if (!(reply_buffer =
malloc( reply_buffer_size )))
goto done;
484 if (
offset + 1 == reply_buffer_size)
488 reply_buffer_size *= 2;
489 if (!(
new =
realloc( reply_buffer, reply_buffer_size )))
goto done;
498 error_value_desc.
name =
L"errorCode";
501 *server_error_code_str = error_value_desc.
value;
505 free( reply_buffer );
506 free( request_data );
527 {
L"NewRemoteHost" },
528 {
L"NewExternalPort" },
530 {
L"NewInternalPort" },
531 {
L"NewInternalClient" },
533 {
L"NewPortMappingDescription" },
534 {
L"NewLeaseDuration" },
554 ERR(
"No memory.\n" );
572 index_param.
name =
L"NewPortMappingIndex";
578 if (!new_mappings)
break;
647 WARN(
"Request failed.\n" );
661 WCHAR externalW[6], internalW[6];
689 WARN(
"Request failed.\n" );
704 static const char upnp_search_request[] =
705 "M-SEARCH * HTTP/1.1\r\n"
706 "HOST:239.255.255.250:1900\r\n"
707 "ST:upnp:rootdevice\r\n"
709 "MAN:\"ssdp:discover\"\r\n"
713 int len, address_len;
745 FIXME(
"Waiting for reply from router.\n" );
746 for (
i = 0;
i < 2; ++
i)
748 address_len =
sizeof(
addr);
764 TRACE(
"No reply from router.\n" );
767 TRACE(
"Received reply from gateway, len %d.\n",
len );
771 WARN(
"Error parsing response.\n" );
777 WARN(
"Error opening gateway connection.\n" );
780 TRACE(
"Opened gateway connection.\n" );
783 WARN(
"Could not get_control URL.\n" );
843 ERR(
"No memory.\n" );
920 IStaticPortMapping_AddRef( iface );
964 hr = ITypeInfo_GetIDsOfNames(
typeinfo, rgszNames, cNames, rgDispId );
976 DISPPARAMS *pDispParams,
978 EXCEPINFO *pExcepInfo,
986 lcid,
wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
991 hr = ITypeInfo_Invoke(
typeinfo, &
mapping->IStaticPortMapping_iface, dispIdMember,
992 wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr );
1004 TRACE(
"iface %p, value %p.\n", iface,
value );
1018 TRACE(
"iface %p, value %p.\n", iface,
value );
1031 TRACE(
"iface %p, value %p.\n", iface,
value );
1044 TRACE(
"iface %p, value %p.\n", iface,
value );
1058 TRACE(
"iface %p, value %p.\n", iface,
value );
1072 TRACE(
"iface %p, value %p.\n", iface,
value );
1085 TRACE(
"iface %p, value %p.\n", iface,
value );
1106 FIXME(
"iface %p, value %d stub.\n", iface,
value );
1124 FIXME(
"iface %p, value %ld stub.\n", iface,
value );
1159 mapping->data = *mapping_data;
1190 TRACE(
"destroying %p\n", mapping_enum);
1191 free( mapping_enum );
1216 IEnumVARIANT_AddRef( iface );
1228 TRACE(
"iface %p, celt %lu, var %p, fetched %p.\n", iface, celt,
var, fetched );
1230 if (fetched) *fetched = 0;
1231 if (!celt)
return S_OK;
1244 mapping_enum->
index +=
i;
1245 if (fetched) *fetched =
i;
1252 for ( ;
i < celt; ++
i)
1264 TRACE(
"iface %p, celt %lu.\n", iface, celt );
1266 mapping_enum->
index += celt;
1274 TRACE(
"iface %p.\n", iface );
1276 mapping_enum->
index = 0;
1287 TRACE(
"iface %p, ret %p.\n", iface,
ret );
1315 mapping_enum->
refs = 1;
1317 mapping_enum->
index = 0;
1348 TRACE(
"destroying %p\n", ports);
1375 IStaticPortMappingCollection_AddRef( iface );
1385 TRACE(
"%p %p\n", ports, pctinfo);
1398 TRACE(
"%p %u %lu %p\n", ports, iTInfo,
lcid, ppTInfo);
1405 LPOLESTR *rgszNames,
1419 hr = ITypeInfo_GetIDsOfNames(
typeinfo, rgszNames, cNames, rgDispId );
1431 DISPPARAMS *pDispParams,
1433 EXCEPINFO *pExcepInfo,
1441 lcid,
wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
1447 wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr );
1457 TRACE(
"iface %p, ret %p.\n", iface,
ret );
1490 TRACE(
"iface %p, count %p.\n", iface,
count );
1525 TRACE(
"iface %p, external %ld, protocol %s, internal %ld, client %s, enabled %d, description %s, mapping %p.\n",
1533 if (external < 0 || external > 65535)
return E_INVALIDARG;
1534 if (internal < 0 || internal > 65535)
return E_INVALIDARG;
1581 if (!(ports =
calloc( 1,
sizeof(*ports) )))
1647 INetFwOpenPort_AddRef( iface );
1677 LPOLESTR *rgszNames,
1691 hr = ITypeInfo_GetIDsOfNames(
typeinfo, rgszNames, cNames, rgDispId );
1703 DISPPARAMS *pDispParams,
1705 EXCEPINFO *pExcepInfo,
1713 lcid,
wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
1718 hr = ITypeInfo_Invoke(
typeinfo, &
This->INetFwOpenPort_iface, dispIdMember,
1719 wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr );
1792 This->protocol = ipProtocol;
1813 This->port = portNumber;
1919 TRACE(
"(%p,%p)\n", pUnkOuter, ppObj);
1921 fp =
malloc(
sizeof(*fp) );
1932 TRACE(
"returning iface %p\n", *ppObj);
1987 INetFwOpenPorts_AddRef( iface );
2017 LPOLESTR *rgszNames,
2031 hr = ITypeInfo_GetIDsOfNames(
typeinfo, rgszNames, cNames, rgDispId );
2043 DISPPARAMS *pDispParams,
2045 EXCEPINFO *pExcepInfo,
2053 lcid,
wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
2058 hr = ITypeInfo_Invoke(
typeinfo, &
This->INetFwOpenPorts_iface, dispIdMember,
2059 wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr );
2094 FIXME(
"%p, %ld, %u\n",
This, portNumber, ipProtocol);
2107 FIXME(
"%p, %ld, %u, %p\n",
This, portNumber, ipProtocol, openPort);
2112 INetFwOpenPort_put_Protocol( *openPort, ipProtocol );
2113 INetFwOpenPort_put_Port( *openPort, portNumber );
2148 TRACE(
"(%p,%p)\n", pUnkOuter, ppObj);
2150 fp =
malloc(
sizeof(*fp) );
2158 TRACE(
"returning iface %p\n", *ppObj);
2187 TRACE(
"IProvideClassInfo not supported.\n");
2195 IUPnPNAT_AddRef( iface );
2245 hr = ITypeInfo_GetIDsOfNames(
typeinfo, rgszNames, cNames, rgDispId );
2252 WORD wFlags, DISPPARAMS *pDispParams,
VARIANT *pVarResult, EXCEPINFO *pExcepInfo,
2260 lcid,
wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
2265 hr = ITypeInfo_Invoke(
typeinfo, &
This->IUPnPNAT_iface, dispIdMember,
2266 wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr );
2320 nat =
malloc(
sizeof(*nat) );
2328 TRACE(
"returning iface %p\n", *
object);
ios_base &_STLP_CALL internal(ios_base &__s)
HRESULT get_typeinfo(enum type_id tid, ITypeInfo **ret)
#define InterlockedIncrement
#define InterlockedDecrement
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
#define stricmp(_String1, _String2)
#define MultiByteToWideChar
static const struct INetFwOpenPortsVtbl fw_ports_vtbl
static ULONG WINAPI static_port_mapping_AddRef(IStaticPortMapping *iface)
static HRESULT WINAPI upnpnat_GetTypeInfo(IUPnPNAT *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
static unsigned int get_port_mapping_count(void)
static const IEnumVARIANTVtbl port_mapping_enum_vtbl
static HRESULT WINAPI fw_port_put_Name(INetFwOpenPort *iface, BSTR name)
static HRESULT WINAPI port_mapping_enum_Next(IEnumVARIANT *iface, ULONG celt, VARIANT *var, ULONG *fetched)
static ULONG WINAPI static_ports_Release(IStaticPortMappingCollection *iface)
static HRESULT WINAPI fw_port_put_Port(INetFwOpenPort *iface, LONG portNumber)
static const struct INetFwOpenPortVtbl fw_port_vtbl
static const IStaticPortMappingVtbl static_port_mapping_vtbl
static HRESULT WINAPI static_port_mapping_GetTypeInfoCount(IStaticPortMapping *iface, UINT *pctinfo)
static HRESULT WINAPI static_port_mapping_Enable(IStaticPortMapping *iface, VARIANT_BOOL value)
#define COPY_BSTR_CHECK(name)
unsigned int mapping_count
static BOOL grab_gateway_connection(void)
static HRESULT WINAPI static_ports_Add(IStaticPortMappingCollection *iface, LONG external, BSTR protocol, LONG internal, BSTR client, VARIANT_BOOL enabled, BSTR description, IStaticPortMapping **mapping)
static HRESULT WINAPI static_ports_GetIDsOfNames(IStaticPortMappingCollection *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
static void gateway_connection_cleanup(void)
static struct static_port_mapping_collection * impl_from_IStaticPortMappingCollection(IStaticPortMappingCollection *iface)
static HRESULT WINAPI static_ports_Invoke(IStaticPortMappingCollection *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
static HRESULT WINAPI static_port_mapping_get_ExternalPort(IStaticPortMapping *iface, LONG *value)
static HRESULT WINAPI static_port_mapping_get_InternalPort(IStaticPortMapping *iface, LONG *value)
static HRESULT WINAPI fw_port_get_BuiltIn(INetFwOpenPort *iface, VARIANT_BOOL *builtIn)
static HRESULT WINAPI upnpnat_Invoke(IUPnPNAT *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
static HRESULT WINAPI upnpnat_GetTypeInfoCount(IUPnPNAT *iface, UINT *pctinfo)
static BOOL get_xml_elements(const char *desc_xml, struct xml_value_desc *values, unsigned int value_count)
static HRESULT WINAPI fw_ports_Remove(INetFwOpenPorts *iface, LONG portNumber, NET_FW_IP_PROTOCOL ipProtocol)
static HRESULT WINAPI upnpnat_get_StaticPortMappingCollection(IUPnPNAT *iface, IStaticPortMappingCollection **collection)
static void free_mappings(void)
static HRESULT WINAPI fw_port_put_IpVersion(INetFwOpenPort *iface, NET_FW_IP_VERSION ipVersion)
static fw_port * impl_from_INetFwOpenPort(INetFwOpenPort *iface)
static HRESULT WINAPI static_port_mapping_get_ExternalIPAddress(IStaticPortMapping *iface, BSTR *value)
static HRESULT WINAPI static_port_mapping_QueryInterface(IStaticPortMapping *iface, REFIID riid, void **ppvObject)
static BOOL open_gateway_connection(void)
static BSTR mapping_move_bstr(BSTR *s)
static HRESULT WINAPI fw_port_get_Port(INetFwOpenPort *iface, LONG *portNumber)
static HRESULT WINAPI fw_ports_Add(INetFwOpenPorts *iface, INetFwOpenPort *port)
static struct port_mapping_enum * impl_from_IEnumVARIANT(IEnumVARIANT *iface)
static HRESULT WINAPI fw_ports_get__NewEnum(INetFwOpenPorts *iface, IUnknown **newEnum)
static ULONG WINAPI upnpnat_Release(IUPnPNAT *iface)
static BOOL init_gateway_connection(void)
static HRESULT WINAPI fw_port_get_IpVersion(INetFwOpenPort *iface, NET_FW_IP_VERSION *ipVersion)
static ULONG WINAPI upnpnat_AddRef(IUPnPNAT *iface)
static HRESULT WINAPI fw_ports_Item(INetFwOpenPorts *iface, LONG portNumber, NET_FW_IP_PROTOCOL ipProtocol, INetFwOpenPort **openPort)
static HRESULT WINAPI fw_port_get_Name(INetFwOpenPort *iface, BSTR *name)
static BOOL get_control_url(void)
static void release_gateway_connection(void)
static HRESULT WINAPI static_port_mapping_Invoke(IStaticPortMapping *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
static HRESULT WINAPI static_port_mapping_GetTypeInfo(IStaticPortMapping *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
static HRESULT WINAPI fw_port_GetTypeInfo(INetFwOpenPort *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
static ULONG WINAPI static_ports_AddRef(IStaticPortMappingCollection *iface)
HRESULT IUPnPNAT_create(IUnknown *outer, void **object)
static HRESULT WINAPI static_ports_Remove(IStaticPortMappingCollection *iface, LONG port, BSTR protocol)
static HRESULT WINAPI port_mapping_enum_QueryInterface(IEnumVARIANT *iface, REFIID riid, void **ppvObject)
static ULONG WINAPI static_port_mapping_Release(IStaticPortMapping *iface)
HRESULT NetFwOpenPort_create(IUnknown *pUnkOuter, LPVOID *ppObj)
static HRESULT WINAPI static_port_mapping_get_Enabled(IStaticPortMapping *iface, VARIANT_BOOL *value)
static HRESULT WINAPI upnpnat_GetIDsOfNames(IUPnPNAT *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
static HRESULT WINAPI fw_ports_GetTypeInfo(INetFwOpenPorts *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
static BOOL remove_port_mapping(LONG port, BSTR protocol)
static HRESULT WINAPI static_port_mapping_GetIDsOfNames(IStaticPortMapping *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
static HRESULT WINAPI fw_ports_get_Count(INetFwOpenPorts *iface, LONG *count)
static BOOL is_valid_protocol(BSTR protocol)
static HRESULT WINAPI static_port_mapping_EditInternalPort(IStaticPortMapping *iface, LONG value)
static HRESULT WINAPI static_ports_GetTypeInfo(IStaticPortMappingCollection *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
static ULONG WINAPI port_mapping_enum_Release(IEnumVARIANT *iface)
static struct xml_value_desc port_mapping_template[]
static HRESULT WINAPI static_port_mapping_get_InternalClient(IStaticPortMapping *iface, BSTR *value)
static HRESULT WINAPI fw_port_GetIDsOfNames(INetFwOpenPort *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
static HRESULT WINAPI static_port_mapping_EditDescription(IStaticPortMapping *iface, BSTR value)
static HRESULT WINAPI fw_ports_GetTypeInfoCount(INetFwOpenPorts *iface, UINT *pctinfo)
static HRESULT WINAPI static_ports_QueryInterface(IStaticPortMappingCollection *iface, REFIID riid, void **ppvObject)
static HRESULT WINAPI upnpnat_get_NATEventManager(IUPnPNAT *iface, INATEventManager **manager)
static HRESULT WINAPI fw_ports_GetIDsOfNames(INetFwOpenPorts *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
static HRESULT static_port_mapping_create(const struct port_mapping *mapping_data, IStaticPortMapping **ret)
static BOOL parse_desc_xml(const char *desc_xml)
static ULONG WINAPI port_mapping_enum_AddRef(IEnumVARIANT *iface)
static HRESULT WINAPI fw_port_QueryInterface(INetFwOpenPort *iface, REFIID riid, void **ppvObject)
static fw_ports * impl_from_INetFwOpenPorts(INetFwOpenPorts *iface)
static HRESULT WINAPI static_port_mapping_get_Protocol(IStaticPortMapping *iface, BSTR *value)
static HRESULT WINAPI fw_port_GetTypeInfoCount(INetFwOpenPort *iface, UINT *pctinfo)
static HRESULT WINAPI upnpnat_get_DynamicPortMappingCollection(IUPnPNAT *iface, IDynamicPortMappingCollection **collection)
HRESULT NetFwOpenPorts_create(IUnknown *pUnkOuter, LPVOID *ppObj)
static HRESULT WINAPI port_mapping_enum_Clone(IEnumVARIANT *iface, IEnumVARIANT **ret)
static BOOL parse_search_response(char *response, WCHAR *locationW, unsigned int location_size)
static HRESULT WINAPI static_ports_get_Count(IStaticPortMappingCollection *iface, LONG *count)
static const IUPnPNATVtbl upnpnat_vtbl
static BOOL copy_port_mapping(struct port_mapping *dst, const struct port_mapping *src)
static ULONG WINAPI fw_ports_AddRef(INetFwOpenPorts *iface)
static ULONG WINAPI fw_port_Release(INetFwOpenPort *iface)
static HRESULT WINAPI static_ports_GetTypeInfoCount(IStaticPortMappingCollection *iface, UINT *pctinfo)
static HRESULT WINAPI fw_port_get_Scope(INetFwOpenPort *iface, NET_FW_SCOPE *scope)
static ULONG WINAPI fw_port_AddRef(INetFwOpenPort *iface)
static void free_port_mapping(struct port_mapping *mapping)
static BOOL add_port_mapping(LONG external, BSTR protocol, LONG internal, BSTR client, VARIANT_BOOL enabled, BSTR description)
static upnpnat * impl_from_IUPnPNAT(IUPnPNAT *iface)
static const IStaticPortMappingCollectionVtbl static_ports_vtbl
static HRESULT WINAPI fw_port_get_Enabled(INetFwOpenPort *iface, VARIANT_BOOL *enabled)
static BOOL request_service(const WCHAR *function, const struct xml_value_desc *request_param, unsigned int request_param_count, struct xml_value_desc *result, unsigned int result_count, DWORD *http_status, BSTR *server_error_code_str)
static HRESULT WINAPI static_port_mapping_EditInternalClient(IStaticPortMapping *iface, BSTR value)
static HRESULT WINAPI fw_port_put_Enabled(INetFwOpenPort *iface, VARIANT_BOOL enabled)
static HRESULT static_port_mapping_collection_create(IStaticPortMappingCollection **object)
static HRESULT WINAPI fw_ports_QueryInterface(INetFwOpenPorts *iface, REFIID riid, void **ppvObject)
static HRESULT create_port_mapping_enum(IUnknown **ret)
static HRESULT WINAPI fw_ports_Invoke(INetFwOpenPorts *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
static HRESULT WINAPI static_ports__NewEnum(IStaticPortMappingCollection *iface, IUnknown **ret)
static unsigned int get_port_mapping_range(unsigned int index, unsigned int count, struct port_mapping *ret)
static struct static_port_mapping * impl_from_IStaticPortMapping(IStaticPortMapping *iface)
static HRESULT WINAPI fw_port_get_RemoteAddresses(INetFwOpenPort *iface, BSTR *remoteAddrs)
static HRESULT WINAPI fw_port_put_Scope(INetFwOpenPort *iface, NET_FW_SCOPE scope)
static HRESULT WINAPI static_ports_get_Item(IStaticPortMappingCollection *iface, LONG port, BSTR protocol, IStaticPortMapping **mapping)
static void update_mapping_list(void)
static BOOL find_port_mapping(LONG port, BSTR protocol, struct port_mapping *ret)
static ULONG WINAPI fw_ports_Release(INetFwOpenPorts *iface)
static HRESULT WINAPI fw_port_Invoke(INetFwOpenPort *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
static HRESULT WINAPI port_mapping_enum_Skip(IEnumVARIANT *iface, ULONG celt)
static struct @525 upnp_gateway_connection
static HRESULT WINAPI port_mapping_enum_Reset(IEnumVARIANT *iface)
static HRESULT WINAPI fw_port_put_Protocol(INetFwOpenPort *iface, NET_FW_IP_PROTOCOL ipProtocol)
static SRWLOCK upnp_gateway_connection_lock
static HRESULT WINAPI static_port_mapping_get_Description(IStaticPortMapping *iface, BSTR *value)
static HRESULT WINAPI fw_port_get_Protocol(INetFwOpenPort *iface, NET_FW_IP_PROTOCOL *ipProtocol)
struct port_mapping * mappings
static HRESULT WINAPI upnpnat_QueryInterface(IUPnPNAT *iface, REFIID riid, void **object)
static HRESULT WINAPI fw_port_put_RemoteAddresses(INetFwOpenPort *iface, BSTR remoteAddrs)
static LONG long_from_bstr(BSTR s)
VOID WINAPI AcquireSRWLockExclusive(PSRWLOCK Lock)
VOID WINAPI ReleaseSRWLockExclusive(PSRWLOCK Lock)
_ACRTIMP int __cdecl _wtoi(const wchar_t *)
_ACRTIMP size_t __cdecl wcslen(const wchar_t *)
_ACRTIMP int __cdecl wcscmp(const wchar_t *, const wchar_t *)
_ACRTIMP int __cdecl atoi(const char *)
_ACRTIMP size_t __cdecl strlen(const char *)
_ACRTIMP char *__cdecl strtok_s(char *, const char *, char **)
_ACRTIMP char *__cdecl strtok(char *, const char *)
IStream *WINAPI SHCreateMemStream(const BYTE *data, UINT data_len)
HINTERNET WINAPI WinHttpOpenRequest(HINTERNET hconnect, const WCHAR *verb, const WCHAR *object, const WCHAR *version, const WCHAR *referrer, const WCHAR **types, DWORD flags)
HINTERNET WINAPI WinHttpOpen(LPCWSTR agent, DWORD access, LPCWSTR proxy, LPCWSTR bypass, DWORD flags)
HINTERNET WINAPI WinHttpConnect(HINTERNET hsession, const WCHAR *server, INTERNET_PORT port, DWORD reserved)
BOOL WINAPI WinHttpCloseHandle(HINTERNET handle)
BOOL WINAPI WinHttpSetTimeouts(HINTERNET handle, int resolve, int connect, int send, int receive)
BOOL WINAPI WinHttpCrackUrl(const WCHAR *url, DWORD len, DWORD flags, URL_COMPONENTSW *uc)
INT WSAAPI recvfrom(IN SOCKET s, OUT CHAR FAR *buf, IN INT len, IN INT flags, OUT LPSOCKADDR from, IN OUT INT FAR *fromlen)
INT WSAAPI sendto(IN SOCKET s, IN CONST CHAR FAR *buf, IN INT len, IN INT flags, IN CONST struct sockaddr *to, IN INT tolen)
HRESULT WINAPI CreateXmlReader(REFIID riid, void **obj, IMalloc *imalloc)
GLuint GLuint GLsizei count
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLenum GLenum GLsizei const GLuint GLboolean enabled
GLboolean GLenum GLenum GLvoid * values
GLenum const GLvoid * addr
GLenum GLenum GLenum GLenum mapping
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
@ IStaticPortMappingCollection_tid
enum NET_FW_IP_PROTOCOL_ NET_FW_IP_PROTOCOL
enum NET_FW_IP_VERSION_ NET_FW_IP_VERSION
enum NET_FW_SCOPE_ NET_FW_SCOPE
#define memcpy(s1, s2, n)
#define ERROR_FILE_NOT_FOUND
static VARIANTARG static DISPID
BSTR WINAPI SysAllocString(LPCOLESTR str)
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
const GUID IID_IProvideClassInfo
#define IsEqualGUID(rguid1, rguid2)
BOOL WINAPI WinHttpQueryHeaders(HINTERNET hrequest, DWORD level, const WCHAR *name, void *buffer, DWORD *buflen, DWORD *index)
BOOL WINAPI WinHttpReadData(HINTERNET hrequest, void *buffer, DWORD to_read, DWORD *read)
BOOL WINAPI WinHttpSendRequest(HINTERNET hrequest, const WCHAR *headers, DWORD headers_len, void *optional, DWORD optional_len, DWORD total_len, DWORD_PTR context)
BOOL WINAPI WinHttpReceiveResponse(HINTERNET hrequest, LPVOID reserved)
INT WSAAPI setsockopt(IN SOCKET s, IN INT level, IN INT optname, IN CONST CHAR FAR *optval, IN INT optlen)
INetFwOpenPort INetFwOpenPort_iface
NET_FW_IP_PROTOCOL protocol
INetFwOpenPorts INetFwOpenPorts_iface
IEnumVARIANT IEnumVARIANT_iface
IStaticPortMappingCollection IStaticPortMappingCollection_iface
IStaticPortMapping IStaticPortMapping_iface
#define CONTAINING_RECORD(address, type, field)
void WINAPI VariantInit(VARIANTARG *pVarg)
INT WINAPI WSAStartup(IN WORD wVersionRequested, OUT LPWSADATA lpWSAData)
DWORD WINAPI GetLastError(void)
WINBASEAPI _In_ DWORD _Out_ _In_ WORD wFlags
u_long WINAPI inet_addr(const char *str)
static HRESULT HRESULT_FROM_WIN32(unsigned int x)
#define WINHTTP_DEFAULT_ACCEPT_TYPES
#define WINHTTP_NO_ADDITIONAL_HEADERS
#define HTTP_STATUS_SERVER_ERROR
#define WINHTTP_QUERY_STATUS_CODE
#define WINHTTP_NO_PROXY_NAME
#define WINHTTP_QUERY_FLAG_NUMBER
#define WINHTTP_ACCESS_TYPE_NO_PROXY
#define WINHTTP_NO_REFERER
#define WINHTTP_NO_PROXY_BYPASS
int PASCAL FAR WSAGetLastError(void)
int PASCAL FAR WSACleanup(void)