38 hr = INetFwPolicy2_QueryInterface(policy2, &IID_INetFwRules, (
void**)&rules);
41 hr = INetFwPolicy2_get_Rules(policy2, &rules);
44 hr = INetFwPolicy2_get_Rules(policy2, &rules2);
46 ok(rules == rules2,
"Different pointers\n");
48 hr = INetFwPolicy2_get_ServiceRestriction(policy2, &restriction);
54 hr = INetFwServiceRestriction_get_Rules(restriction, &rules3);
56 ok(rules != rules3,
"same pointers\n");
59 INetFwRules_Release(rules3);
60 INetFwServiceRestriction_Release(restriction);
63 hr = INetFwRules_get__NewEnum(rules,
NULL);
66 INetFwRules_Release(rules);
67 INetFwRules_Release(rules2);
78 &IID_INetFwMgr, (
void**)&manager);
79 ok(
hr ==
S_OK,
"NetFwMgr create failed: %08x\n",
hr);
81 hr = INetFwMgr_QueryInterface(manager, &IID_INetFwPolicy, (
void**)&
policy);
84 hr = INetFwMgr_QueryInterface(manager, &IID_INetFwPolicy2, (
void**)&policy2);
87 hr = INetFwMgr_get_LocalPolicy(manager, &
policy);
90 hr = INetFwPolicy_QueryInterface(
policy, &IID_INetFwPolicy2, (
void**)&policy2);
93 INetFwPolicy_Release(
policy);
96 &IID_INetFwPolicy2, (
void**)&policy2);
101 INetFwPolicy2_Release(policy2);
104 win_skip(
"NetFwPolicy2 object is not supported: %08x\n",
hr);
106 INetFwMgr_Release(manager);
121 hr =
CoCreateInstance(&CLSID_NetFwAuthorizedApplication,
NULL, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER,
122 &IID_INetFwAuthorizedApplication, (
void**)&app);
128 hr = INetFwAuthorizedApplication_get_ProcessImageFileName(app,
NULL);
131 hr = INetFwAuthorizedApplication_get_ProcessImageFileName(app, &bstr);
135 hr = INetFwAuthorizedApplication_put_ProcessImageFileName(app,
NULL);
138 hr = INetFwAuthorizedApplication_put_ProcessImageFileName(app,
empty);
142 hr = INetFwAuthorizedApplication_put_ProcessImageFileName(app, bstr);
150 sz =
sizeof(netpath);
154 info->lpUniversalName = netpath +
sizeof(*info)/
sizeof(
WCHAR);
158 hr = INetFwAuthorizedApplication_get_ProcessImageFileName(app, &bstr);
160 ok(!
lstrcmpW(bstr,
info->lpUniversalName),
"expected %s, got %s\n",
164 INetFwAuthorizedApplication_Release(app);
176 hr =
CoCreateInstance(&CLSID_UPnPNAT,
NULL, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER, &IID_IUPnPNAT, (
void**)&nat);
182 hr = IUPnPNAT_get_StaticPortMappingCollection(nat, &static_ports);
184 if(
hr ==
S_OK && static_ports)
185 IStaticPortMappingCollection_Release(static_ports);
187 hr = IUPnPNAT_get_DynamicPortMappingCollection(nat, &dync_ports);
189 if(
hr ==
S_OK && dync_ports)
190 IDynamicPortMappingCollection_Release(dync_ports);
192 hr = IUPnPNAT_get_NATEventManager(nat, &manager);
195 INATEventManager_Release(manager);
197 IUPnPNAT_Release(nat);
208 &IID_INetFwMgr, (
void**)&manager);
211 win_skip(
"NetFwMgr object is not supported: %08x\n",
hr);
216 INetFwMgr_Release(manager);
WINBASEAPI _Check_return_ _Out_ AppPolicyProcessTerminationMethod * policy
#define ERROR_NOT_ENOUGH_MEMORY
static const WCHAR empty[]
DWORD WINAPI GetModuleFileNameW(HINSTANCE hModule, LPWSTR lpFilename, DWORD nSize)
DWORD WINAPI GetLongPathNameW(IN LPCWSTR lpszShortPath, OUT LPWSTR lpszLongPath, IN DWORD cchBuffer)
DWORD WINAPI GetFullPathNameW(IN LPCWSTR lpFileName, IN DWORD nBufferLength, OUT LPWSTR lpBuffer, OUT LPWSTR *lpFilePart)
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
static void test_IUPnPNAT(void)
static void test_policy2_rules(INetFwPolicy2 *policy2)
static void test_NetFwAuthorizedApplication(void)
static void test_interfaces(void)
BSTR WINAPI SysAllocString(LPCOLESTR str)
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
const GUID IID_IProvideClassInfo
DWORD WINAPI GetLastError(void)
#define ERROR_PATH_NOT_FOUND
#define HRESULT_FROM_WIN32(x)
#define UNIVERSAL_NAME_INFO_LEVEL
DWORD WINAPI WNetGetUniversalNameW(LPCWSTR lpLocalPath, DWORD dwInfoLevel, LPVOID lpBuffer, LPDWORD lpBufferSize)