ReactOS 0.4.17-dev-470-gf9e3448
sec_mgr.c File Reference
#include <wine/test.h>
#include <stdarg.h>
#include <stddef.h>
#include <stdio.h>
#include "windef.h"
#include "winbase.h"
#include "ole2.h"
#include "urlmon.h"
#include "initguid.h"
Include dependency graph for sec_mgr.c:

Go to the source code of this file.

Classes

struct  secmgr_test
 
struct  zone_domain_mapping
 
struct  zone_mapping_test
 

Macros

#define COBJMACROS
 
#define CONST_VTABLE
 
#define URLZONE_CUSTOM   URLZONE_USER_MIN+1
 
#define URLZONE_CUSTOM2   URLZONE_CUSTOM+1
 
#define DEFINE_EXPECT(func)    static BOOL expect_ ## func = FALSE, called_ ## func = FALSE
 
#define SET_EXPECT(func)    expect_ ## func = TRUE
 
#define CHECK_EXPECT(func)
 
#define CHECK_EXPECT2(func)
 
#define CHECK_CALLED(func)
 
#define SET_CALLED(func)
 

Functions

 DEFINE_EXPECT (ParseUrl_SECURITY_URL_input)
 
 DEFINE_EXPECT (ParseUrl_SECURITY_URL_input2)
 
 DEFINE_EXPECT (ParseUrl_SECURITY_URL_expected)
 
 DEFINE_EXPECT (ParseUrl_SECURITY_URL_http)
 
 DEFINE_EXPECT (ParseUrl_SECURITY_DOMAIN_expected)
 
 DEFINE_EXPECT (ProcessUrlAction)
 
static HRESULT (WINAPI *pCoInternetCreateSecurityManager)(IServiceProvider *
 
static int strcmp_w (const WCHAR *str1, const WCHAR *str2)
 
static LONG myRegDeleteTreeA (HKEY hKey, LPCSTR lpszSubKey)
 
static HRESULT WINAPI SecurityManager_QueryInterface (IInternetSecurityManager *This, REFIID riid, void **ppvObject)
 
static ULONG WINAPI SecurityManager_AddRef (IInternetSecurityManager *This)
 
static ULONG WINAPI SecurityManager_Release (IInternetSecurityManager *This)
 
static HRESULT WINAPI SecurityManager_SetSecuritySite (IInternetSecurityManager *This, IInternetSecurityMgrSite *pSite)
 
static HRESULT WINAPI SecurityManager_GetSecuritySite (IInternetSecurityManager *This, IInternetSecurityMgrSite **ppSite)
 
static HRESULT WINAPI SecurityManager_MapUrlToZone (IInternetSecurityManager *This, LPCWSTR pwszUrl, DWORD *pdwZone, DWORD dwFlags)
 
static HRESULT WINAPI SecurityManager_GetSecurityId (IInternetSecurityManager *This, LPCWSTR pwszUrl, BYTE *pbSecurityId, DWORD *pcbSecurityId, DWORD_PTR dwReserved)
 
static HRESULT WINAPI SecurityManager_ProcessUrlAction (IInternetSecurityManager *This, LPCWSTR pwszUrl, DWORD dwAction, BYTE *pPolicy, DWORD cbPolicy, BYTE *pContext, DWORD cbContext, DWORD dwFlags, DWORD dwReserved)
 
static HRESULT WINAPI SecurityManager_QueryCustomPolicy (IInternetSecurityManager *This, LPCWSTR pwszUrl, REFGUID guidKey, BYTE **ppPolicy, DWORD *pcbPolicy, BYTE *pContext, DWORD cbContext, DWORD dwReserved)
 
static HRESULT WINAPI SecurityManager_SetZoneMapping (IInternetSecurityManager *This, DWORD dwZone, LPCWSTR lpszPattern, DWORD dwFlags)
 
static HRESULT WINAPI SecurityManager_GetZoneMappings (IInternetSecurityManager *This, DWORD dwZone, IEnumString **ppenumString, DWORD dwFlags)
 
static void test_SecurityManager (void)
 
static BOOL is_ie_hardened (void)
 
static void test_url_action (IInternetSecurityManager *secmgr, IInternetZoneManager *zonemgr, DWORD action)
 
static void test_special_url_action (IInternetSecurityManager *secmgr, IInternetZoneManager *zonemgr, DWORD action)
 
static void test_activex (IInternetSecurityManager *secmgr)
 
static void test_polices (void)
 
static void test_zone_domain_cache (void)
 
static BOOL register_zone_domains (void)
 
static void unregister_zone_domains (void)
 
static void run_child_process (void)
 
static void test_zone_domain_mappings (void)
 
static void test_zone_domains (void)
 
static void test_CoInternetCreateZoneManager (void)
 
static void test_CreateZoneEnumerator (void)
 
static void test_GetZoneActionPolicy (void)
 
static void test_GetZoneAt (void)
 
static void test_GetZoneAttributes (void)
 
static void test_SetZoneAttributes (void)
 
static void test_InternetSecurityMarshalling (void)
 
static void test_InternetGetSecurityUrl (void)
 
static HRESULT WINAPI InternetProtocolInfo_QueryInterface (IInternetProtocolInfo *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI InternetProtocolInfo_AddRef (IInternetProtocolInfo *iface)
 
static ULONG WINAPI InternetProtocolInfo_Release (IInternetProtocolInfo *iface)
 
static HRESULT WINAPI InternetProtocolInfo_ParseUrl (IInternetProtocolInfo *iface, LPCWSTR pwzUrl, PARSEACTION ParseAction, DWORD dwParseFlags, LPWSTR pwzResult, DWORD cchResult, DWORD *pcchResult, DWORD dwReserved)
 
static HRESULT WINAPI InternetProtocolInfo_CombineUrl (IInternetProtocolInfo *iface, LPCWSTR pwzBaseUrl, LPCWSTR pwzRelativeUrl, DWORD dwCombineFlags, LPWSTR pwzResult, DWORD cchResult, DWORD *pcchResult, DWORD dwReserved)
 
static HRESULT WINAPI InternetProtocolInfo_CompareUrl (IInternetProtocolInfo *iface, LPCWSTR pwzUrl1, LPCWSTR pwzUrl2, DWORD dwCompareFlags)
 
static HRESULT WINAPI InternetProtocolInfo_QueryInfo (IInternetProtocolInfo *iface, LPCWSTR pwzUrl, QUERYOPTION OueryOption, DWORD dwQueryFlags, LPVOID pBuffer, DWORD cbBuffer, DWORD *pcbBuf, DWORD dwReserved)
 
static HRESULT WINAPI ClassFactory_QueryInterface (IClassFactory *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI ClassFactory_AddRef (IClassFactory *iface)
 
static ULONG WINAPI ClassFactory_Release (IClassFactory *iface)
 
static HRESULT WINAPI ClassFactory_CreateInstance (IClassFactory *iface, IUnknown *pOuter, REFIID riid, void **ppv)
 
static HRESULT WINAPI ClassFactory_LockServer (IClassFactory *iface, BOOL dolock)
 
static void register_protocols (void)
 
static void unregister_protocols (void)
 
static void test_InternetGetSecurityUrlEx (void)
 
static void test_InternetGetSecurityUrlEx_Pluggable (void)
 
static void test_SecurityManagerEx2 (void)
 
static void test_CoInternetIsFeatureZoneElevationEnabled (void)
 
 START_TEST (sec_mgr)
 

Variables

static IInternetSecurityManager DWORD
 
static LPWSTR PSUACTION
 
static IUri DWORD_PTR
 
static LPCWSTR
 
static const WCHAR url1 []
 
static const WCHAR url2 [] = {'i','n','d','e','x','.','h','t','m',0}
 
static const WCHAR url3 [] = {'f','i','l','e',':','/','/','c',':','\\','I','n','d','e','x','.','h','t','m',0}
 
static const WCHAR url4 []
 
static const WCHAR url5 []
 
static const WCHAR url6 [] = {'a','b','o','u','t',':','b','l','a','n','k',0}
 
static const WCHAR url7 []
 
static const WCHAR url8 [] = {'t','e','s','t',':','1','2','3','a','b','c',0}
 
static const WCHAR url9 []
 
static const WCHAR url10 []
 
static const WCHAR url11 [] = {'f','i','l','e',':','/','/','c',':','/','I','n','d','e','x','.','h','t','m',0}
 
static const WCHAR url12 [] = {'f','i','l','e',':','/','/','/','c',':','/','I','n','d','e','x','.','h','t','m',0}
 
static const WCHAR url13 [] = {'h','t','t','p',':','g','o','o','g','l','e','.','c','o','m',0}
 
static const WCHAR url14 [] = {'z','i','p',':','t','e','s','t','i','n','g','.','c','o','m','/','t','e','s','t','i','n','g',0}
 
static const WCHAR url15 [] = {'h','t','t','p',':','/','/','g','o','o','g','l','e','.','c','o','m','.','u','k',0}
 
static const WCHAR url16 [] = {'f','i','l','e',':','/','/','/','c',':',0}
 
static const WCHAR url17 [] = {'f','i','l','e',':','/','/','/','c',':','c','\\',0}
 
static const WCHAR url18 [] = {'c',':','\\','t','e','s','t','.','h','t','m',0}
 
static const WCHAR winetestW [] = {'w','i','n','e','t','e','s','t',0}
 
static const WCHAR security_urlW [] = {'w','i','n','e','t','e','s','t',':','t','e','s','t','i','n','g',0}
 
static const WCHAR security_url2W [] = {'w','i','n','e','t','e','s','t',':','t','e','s','t','i','n','g','2',0}
 
static const WCHAR security_expectedW [] = {'w','i','n','e','t','e','s','t',':','z','i','p',0}
 
static const WCHAR winetest_to_httpW [] = {'w','i','n','e','t','e','s','t',':','h',0}
 
static const charszZoneMapDomainsKey = "Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\ZoneMap\\Domains"
 
static const charszInternetSettingsKey = "Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings"
 
static const BYTE secid1 [] = {'f','i','l','e',':',0,0,0,0}
 
static const BYTE secid2 [] = {'*',':','i','n','d','e','x','.','h','t','m',3,0,0,0}
 
static const BYTE secid5 []
 
static const BYTE secid6 [] = {'a','b','o','u','t',':','b','l','a','n','k',3,0,0,0}
 
static const BYTE secid7 []
 
static const BYTE secid10 []
 
static const BYTE secid14 []
 
static const BYTE secid10_2 []
 
static const BYTE secid13 [] = {'h','t','t','p',':','c','o','m','.','u','k',3,0,0,0}
 
static const BYTE secid13_2 [] = {'h','t','t','p',':','g','o','o','g','l','e','.','c','o','m','.','u','k',3,0,0,0}
 
static const GUID CLSID_TestActiveX
 
const GUID GUID_CUSTOM_CONFIRMOBJECTSAFETY
 
static int called_securl_http
 
static DWORD ProcessUrlAction_policy
 
static struct secmgr_test secmgr_tests []
 
static const IInternetSecurityManagerVtbl SecurityManagerVtbl
 
static IInternetSecurityManager security_manager = { &SecurityManagerVtbl }
 
static const zone_domain_mapping zone_domain_mappings []
 
static const zone_mapping_test zone_mapping_tests []
 
static const IInternetProtocolInfoVtbl InternetProtocolInfoVtbl
 
static IInternetProtocolInfo protocol_info = { &InternetProtocolInfoVtbl }
 
static const IClassFactoryVtbl ClassFactoryVtbl
 
static IClassFactory protocol_cf = { &ClassFactoryVtbl }
 
struct {
   const WCHAR *   uri
 
   DWORD   create_flags
 
   const char *   security_uri
 
   HRESULT   security_hres
 
   const WCHAR *   default_uri
 
   HRESULT   default_hres
 
   BOOL   todo
 
sec_url_ex_tests []
 
static const BYTE secidex2_1 [] = {'z','i','p',':','/','/','t','e','s','t','i','n','g','.','c','o','m','/',3,0,0,0}
 
static const BYTE secidex2_2 [] = {'z','i','p',':','t','e','s','t','i','n','g','.','c','o','m',3,0,0,0}
 
static const BYTE secidex2_3 [] = {'*',':','t','e','s','t','i','n','g','.','c','o','m',3,0,0,0}
 
struct {
   const WCHAR *   uri
 
   DWORD   create_flags
 
   HRESULT   map_hres
 
   DWORD   zone
 
   BOOL   map_todo
 
   const BYTE *   secid
 
   DWORD   secid_size
 
   HRESULT   secid_hres
 
   BOOL   secid_todo
 
sec_mgr_ex2_tests []
 

Macro Definition Documentation

◆ CHECK_CALLED

#define CHECK_CALLED (   func)
Value:
do { \
ok(called_ ## func, "expected " #func "\n"); \
expect_ ## func = called_ ## func = FALSE; \
}while(0)
#define FALSE
Definition: types.h:117
GLenum func
Definition: glext.h:6028
#define expect_(expected, got, precision)
Definition: font.c:34

Definition at line 58 of file sec_mgr.c.

◆ CHECK_EXPECT

#define CHECK_EXPECT (   func)
Value:
do { \
ok(expect_ ##func, "unexpected call " #func "\n"); \
expect_ ## func = FALSE; \
called_ ## func = TRUE; \
}while(0)
#define TRUE
Definition: types.h:120

Definition at line 45 of file sec_mgr.c.

◆ CHECK_EXPECT2

#define CHECK_EXPECT2 (   func)
Value:
do { \
ok(expect_ ##func, "unexpected call " #func "\n"); \
called_ ## func = TRUE; \
}while(0)

Definition at line 52 of file sec_mgr.c.

◆ COBJMACROS

#define COBJMACROS

Definition at line 21 of file sec_mgr.c.

◆ CONST_VTABLE

#define CONST_VTABLE

Definition at line 22 of file sec_mgr.c.

◆ DEFINE_EXPECT

#define DEFINE_EXPECT (   func)     static BOOL expect_ ## func = FALSE, called_ ## func = FALSE

Definition at line 39 of file sec_mgr.c.

◆ SET_CALLED

#define SET_CALLED (   func)
Value:
do { \
expect_ ## func = called_ ## func = FALSE; \
}while(0)

Definition at line 64 of file sec_mgr.c.

◆ SET_EXPECT

#define SET_EXPECT (   func)     expect_ ## func = TRUE

Definition at line 42 of file sec_mgr.c.

◆ URLZONE_CUSTOM

#define URLZONE_CUSTOM   URLZONE_USER_MIN+1

Definition at line 36 of file sec_mgr.c.

◆ URLZONE_CUSTOM2

#define URLZONE_CUSTOM2   URLZONE_CUSTOM+1

Definition at line 37 of file sec_mgr.c.

Function Documentation

◆ ClassFactory_AddRef()

static ULONG WINAPI ClassFactory_AddRef ( IClassFactory iface)
static

Definition at line 1498 of file sec_mgr.c.

1499{
1500 return 2;
1501}

◆ ClassFactory_CreateInstance()

static HRESULT WINAPI ClassFactory_CreateInstance ( IClassFactory iface,
IUnknown pOuter,
REFIID  riid,
void **  ppv 
)
static

Definition at line 1508 of file sec_mgr.c.

1510{
1511 ok(0, "unexpected call\n");
1512 return E_NOTIMPL;
1513}
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ ClassFactory_LockServer()

static HRESULT WINAPI ClassFactory_LockServer ( IClassFactory iface,
BOOL  dolock 
)
static

Definition at line 1515 of file sec_mgr.c.

1516{
1517 ok(0, "unexpected call\n");
1518 return S_OK;
1519}
#define S_OK
Definition: intsafe.h:52

◆ ClassFactory_QueryInterface()

static HRESULT WINAPI ClassFactory_QueryInterface ( IClassFactory iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 1487 of file sec_mgr.c.

1488{
1489 if(IsEqualGUID(&IID_IInternetProtocolInfo, riid)) {
1490 *ppv = &protocol_info;
1491 return S_OK;
1492 }
1493
1494 ok(0, "unexpected call\n");
1495 return E_NOINTERFACE;
1496}
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
static IInternetProtocolInfo protocol_info
Definition: misc.c:929
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define E_NOINTERFACE
Definition: winerror.h:3479

◆ ClassFactory_Release()

static ULONG WINAPI ClassFactory_Release ( IClassFactory iface)
static

Definition at line 1503 of file sec_mgr.c.

1504{
1505 return 1;
1506}

◆ DEFINE_EXPECT() [1/6]

DEFINE_EXPECT ( ParseUrl_SECURITY_DOMAIN_expected  )

◆ DEFINE_EXPECT() [2/6]

DEFINE_EXPECT ( ParseUrl_SECURITY_URL_expected  )

◆ DEFINE_EXPECT() [3/6]

DEFINE_EXPECT ( ParseUrl_SECURITY_URL_http  )

◆ DEFINE_EXPECT() [4/6]

DEFINE_EXPECT ( ParseUrl_SECURITY_URL_input  )

◆ DEFINE_EXPECT() [5/6]

DEFINE_EXPECT ( ParseUrl_SECURITY_URL_input2  )

◆ DEFINE_EXPECT() [6/6]

DEFINE_EXPECT ( ProcessUrlAction  )

◆ HRESULT()

static HRESULT ( WINAPI pCoInternetCreateSecurityManager)
static

◆ InternetProtocolInfo_AddRef()

static ULONG WINAPI InternetProtocolInfo_AddRef ( IInternetProtocolInfo iface)
static

Definition at line 1377 of file sec_mgr.c.

1378{
1379 return 2;
1380}

◆ InternetProtocolInfo_CombineUrl()

static HRESULT WINAPI InternetProtocolInfo_CombineUrl ( IInternetProtocolInfo iface,
LPCWSTR  pwzBaseUrl,
LPCWSTR  pwzRelativeUrl,
DWORD  dwCombineFlags,
LPWSTR  pwzResult,
DWORD  cchResult,
DWORD pcchResult,
DWORD  dwReserved 
)
static

Definition at line 1452 of file sec_mgr.c.

1455{
1456 ok(0, "unexpected call\n");
1457 return E_NOTIMPL;
1458}

◆ InternetProtocolInfo_CompareUrl()

static HRESULT WINAPI InternetProtocolInfo_CompareUrl ( IInternetProtocolInfo iface,
LPCWSTR  pwzUrl1,
LPCWSTR  pwzUrl2,
DWORD  dwCompareFlags 
)
static

Definition at line 1460 of file sec_mgr.c.

1462{
1463 ok(0, "unexpected call\n");
1464 return E_NOTIMPL;
1465}

◆ InternetProtocolInfo_ParseUrl()

static HRESULT WINAPI InternetProtocolInfo_ParseUrl ( IInternetProtocolInfo iface,
LPCWSTR  pwzUrl,
PARSEACTION  ParseAction,
DWORD  dwParseFlags,
LPWSTR  pwzResult,
DWORD  cchResult,
DWORD pcchResult,
DWORD  dwReserved 
)
static

Definition at line 1387 of file sec_mgr.c.

1390{
1391 const WCHAR *ret = NULL;
1392
1393 ok(pwzResult != NULL, "pwzResult == NULL\n");
1394 ok(pcchResult != NULL, "pcchResult == NULL\n");
1395 ok(!dwParseFlags, "Expected 0, but got 0x%08lx\n", dwParseFlags);
1396
1397 switch(ParseAction) {
1398 case PARSE_SECURITY_URL:
1399 if(!strcmp_w(pwzUrl, security_urlW)) {
1400 CHECK_EXPECT(ParseUrl_SECURITY_URL_input);
1401 ok(cchResult == lstrlenW(pwzUrl)+1, "Got %ld\n", cchResult);
1403 } else if(!strcmp_w(pwzUrl, security_url2W)) {
1404 CHECK_EXPECT(ParseUrl_SECURITY_URL_input2);
1405 ok(cchResult == lstrlenW(pwzUrl)+1, "Got %ld\n", cchResult);
1407 } else if(!strcmp_w(pwzUrl, security_expectedW)) {
1408 CHECK_EXPECT(ParseUrl_SECURITY_URL_expected);
1409 ok(cchResult == lstrlenW(pwzUrl)+1, "Got %ld\n", cchResult);
1411 } else if(!strcmp_w(pwzUrl, winetest_to_httpW)) {
1412 switch(++called_securl_http) {
1413 case 1:
1414 ok(cchResult == lstrlenW(pwzUrl)+1, "Got %ld\n", cchResult);
1415 break;
1416 case 2:
1417 CHECK_EXPECT(ParseUrl_SECURITY_URL_http);
1418 ok(cchResult == lstrlenW(url9)+1, "Got %ld\n", cchResult);
1419 break;
1420 default:
1421 todo_wine CHECK_EXPECT(ParseUrl_SECURITY_URL_http);
1422 }
1423 ret = url9;
1424 } else
1425 ok(0, "Unexpected call, pwzUrl=%s\n", wine_dbgstr_w(pwzUrl));
1426
1427 break;
1428 case PARSE_SECURITY_DOMAIN:
1429
1430 CHECK_EXPECT(ParseUrl_SECURITY_DOMAIN_expected);
1431
1432 ok(!strcmp_w(pwzUrl, security_expectedW), "Expected %s but got %s\n",
1434 ok(cchResult == lstrlenW(pwzUrl)+1, "Got %ld\n", cchResult);
1436 break;
1437 default:
1438 ok(0, "Unexpected call, ParseAction=%d pwzUrl=%s\n", ParseAction,
1439 wine_dbgstr_w(pwzUrl));
1440 }
1441
1442 if(!ret)
1443 return E_FAIL;
1444
1445 *pcchResult = lstrlenW(ret)+1;
1446 if(*pcchResult > cchResult)
1447 return S_FALSE;
1448 memcpy(pwzResult, ret, (*pcchResult)*sizeof(WCHAR));
1449 return S_OK;
1450}
#define E_FAIL
Definition: ddrawi.h:102
#define NULL
Definition: types.h:112
#define lstrlenW
Definition: compat.h:750
return ret
Definition: mutex.c:146
#define wine_dbgstr_w
Definition: kernel32.h:34
#define todo_wine
Definition: minitest.h:80
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
static const WCHAR security_url2W[]
Definition: sec_mgr.c:113
static const WCHAR winetest_to_httpW[]
Definition: sec_mgr.c:115
#define CHECK_EXPECT(func)
Definition: sec_mgr.c:45
static int strcmp_w(const WCHAR *str1, const WCHAR *str2)
Definition: sec_mgr.c:167
static const WCHAR security_expectedW[]
Definition: sec_mgr.c:114
static int called_securl_http
Definition: sec_mgr.c:143
static const WCHAR security_urlW[]
Definition: sec_mgr.c:112
static const WCHAR url9[]
Definition: sec_mgr.c:98
short WCHAR
Definition: pedump.c:58
#define S_FALSE
Definition: winerror.h:3451

◆ InternetProtocolInfo_QueryInfo()

static HRESULT WINAPI InternetProtocolInfo_QueryInfo ( IInternetProtocolInfo iface,
LPCWSTR  pwzUrl,
QUERYOPTION  OueryOption,
DWORD  dwQueryFlags,
LPVOID  pBuffer,
DWORD  cbBuffer,
DWORD pcbBuf,
DWORD  dwReserved 
)
static

Definition at line 1467 of file sec_mgr.c.

1470{
1471 ok(0, "unexpected call\n");
1472 return E_NOTIMPL;
1473}

◆ InternetProtocolInfo_QueryInterface()

static HRESULT WINAPI InternetProtocolInfo_QueryInterface ( IInternetProtocolInfo iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 1370 of file sec_mgr.c.

1372{
1373 ok(0, "unexpected call\n");
1374 return E_NOINTERFACE;
1375}

◆ InternetProtocolInfo_Release()

static ULONG WINAPI InternetProtocolInfo_Release ( IInternetProtocolInfo iface)
static

Definition at line 1382 of file sec_mgr.c.

1383{
1384 return 1;
1385}

◆ is_ie_hardened()

static BOOL is_ie_hardened ( void  )
static

Definition at line 454 of file sec_mgr.c.

455{
456 HKEY zone_map;
457 DWORD ie_harden, type, size;
458
459 ie_harden = 0;
460 if(RegOpenKeyExA(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\ZoneMap",
461 0, KEY_QUERY_VALUE, &zone_map) == ERROR_SUCCESS) {
462 size = sizeof(DWORD);
463 if (RegQueryValueExA(zone_map, "IEHarden", NULL, &type, (LPBYTE) &ie_harden, &size) != ERROR_SUCCESS ||
464 type != REG_DWORD) {
465 ie_harden = 0;
466 }
467 RegCloseKey(zone_map);
468 }
469
470 return ie_harden != 0;
471}
#define RegCloseKey(hKey)
Definition: registry.h:49
#define ERROR_SUCCESS
Definition: deptool.c:10
LONG WINAPI RegOpenKeyExA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey, _In_ DWORD ulOptions, _In_ REGSAM samDesired, _Out_ PHKEY phkResult)
Definition: reg.c:3298
LONG WINAPI RegQueryValueExA(_In_ HKEY hkeyorg, _In_ LPCSTR name, _In_ LPDWORD reserved, _Out_opt_ LPDWORD type, _Out_opt_ LPBYTE data, _Inout_opt_ LPDWORD count)
Definition: reg.c:4009
unsigned long DWORD
Definition: ntddk_ex.h:95
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLsizeiptr size
Definition: glext.h:5919
#define KEY_QUERY_VALUE
Definition: nt_native.h:1019
#define DWORD
Definition: nt_native.h:44
#define REG_DWORD
Definition: sdbapi.c:615
unsigned char * LPBYTE
Definition: typedefs.h:53
#define HKEY_CURRENT_USER
Definition: winreg.h:11

Referenced by test_url_action(), and test_zone_domains().

◆ myRegDeleteTreeA()

static LONG myRegDeleteTreeA ( HKEY  hKey,
LPCSTR  lpszSubKey 
)
static

Definition at line 178 of file sec_mgr.c.

179{
180 LONG ret;
181 DWORD dwMaxSubkeyLen, dwMaxValueLen;
182 DWORD dwMaxLen, dwSize;
183 CHAR szNameBuf[MAX_PATH], *lpszName = szNameBuf;
184 HKEY hSubKey = hKey;
185
186 if(lpszSubKey)
187 {
188 ret = RegOpenKeyExA(hKey, lpszSubKey, 0, KEY_READ, &hSubKey);
189 if (ret) return ret;
190 }
191
192 /* Get highest length for keys, values */
193 ret = RegQueryInfoKeyA(hSubKey, NULL, NULL, NULL, NULL,
194 &dwMaxSubkeyLen, NULL, NULL, &dwMaxValueLen, NULL, NULL, NULL);
195 if (ret) goto cleanup;
196
197 dwMaxSubkeyLen++;
198 dwMaxValueLen++;
199 dwMaxLen = max(dwMaxSubkeyLen, dwMaxValueLen);
200 if (dwMaxLen > ARRAY_SIZE(szNameBuf))
201 {
202 /* Name too big: alloc a buffer for it */
203 if (!(lpszName = malloc(dwMaxLen)))
204 {
206 goto cleanup;
207 }
208 }
209
210 /* Recursively delete all the subkeys */
211 while (TRUE)
212 {
213 dwSize = dwMaxLen;
214 if (RegEnumKeyExA(hSubKey, 0, lpszName, &dwSize, NULL,
215 NULL, NULL, NULL)) break;
216
217 ret = myRegDeleteTreeA(hSubKey, lpszName);
218 if (ret) goto cleanup;
219 }
220
221 if (lpszSubKey)
222 ret = RegDeleteKeyA(hKey, lpszSubKey);
223 else
224 while (TRUE)
225 {
226 dwSize = dwMaxLen;
227 if (RegEnumValueA(hKey, 0, lpszName, &dwSize,
228 NULL, NULL, NULL, NULL)) break;
229
230 ret = RegDeleteValueA(hKey, lpszName);
231 if (ret) goto cleanup;
232 }
233
234cleanup:
235 /* Free buffer if allocated */
236 if (lpszName != szNameBuf)
237 free(lpszName);
238 if(lpszSubKey)
239 RegCloseKey(hSubKey);
240 return ret;
241}
#define ARRAY_SIZE(A)
Definition: main.h:20
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
#define free
Definition: debug_ros.c:5
#define malloc
Definition: debug_ros.c:4
LONG WINAPI RegQueryInfoKeyA(HKEY hKey, LPSTR lpClass, LPDWORD lpcClass, LPDWORD lpReserved, LPDWORD lpcSubKeys, LPDWORD lpcMaxSubKeyLen, LPDWORD lpcMaxClassLen, LPDWORD lpcValues, LPDWORD lpcMaxValueNameLen, LPDWORD lpcMaxValueLen, LPDWORD lpcbSecurityDescriptor, PFILETIME lpftLastWriteTime)
Definition: reg.c:3583
LONG WINAPI RegEnumValueA(_In_ HKEY hKey, _In_ DWORD dwIndex, _Out_ LPSTR lpName, _Inout_ LPDWORD lpcbName, _Reserved_ LPDWORD lpdwReserved, _Out_opt_ LPDWORD lpdwType, _Out_opt_ LPBYTE lpData, _Inout_opt_ LPDWORD lpcbData)
Definition: reg.c:2668
LONG WINAPI RegDeleteValueA(HKEY hKey, LPCSTR lpValueName)
Definition: reg.c:2287
LONG WINAPI RegEnumKeyExA(_In_ HKEY hKey, _In_ DWORD dwIndex, _Out_ LPSTR lpName, _Inout_ LPDWORD lpcbName, _Reserved_ LPDWORD lpReserved, _Out_opt_ LPSTR lpClass, _Inout_opt_ LPDWORD lpcbClass, _Out_opt_ PFILETIME lpftLastWriteTime)
Definition: reg.c:2419
LONG WINAPI RegDeleteKeyA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey)
Definition: reg.c:1224
#define MAX_PATH
Definition: compat.h:34
static void cleanup(void)
Definition: main.c:1335
FxAutoRegKey hKey
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:56
static LONG myRegDeleteTreeA(HKEY hKey, LPCSTR lpszSubKey)
Definition: sec_mgr.c:178
#define KEY_READ
Definition: nt_native.h:1026
long LONG
Definition: pedump.c:60
char CHAR
Definition: pedump.c:57
#define max(a, b)
Definition: svc.c:63

Referenced by myRegDeleteTreeA(), and test_SetZoneAttributes().

◆ register_protocols()

static void register_protocols ( void  )
static

Definition at line 1531 of file sec_mgr.c.

1532{
1534 HRESULT hres;
1535
1536 hres = pCoInternetGetSession(0, &session, 0);
1537 ok(hres == S_OK, "CoInternetGetSession failed: %08lx\n", hres);
1538 if(FAILED(hres))
1539 return;
1540
1541 hres = IInternetSession_RegisterNameSpace(session, &protocol_cf, &IID_NULL,
1542 winetestW, 0, NULL, 0);
1543 ok(hres == S_OK, "RegisterNameSpace failed: %08lx\n", hres);
1544
1545 IInternetSession_Release(session);
1546}
#define FAILED(hr)
Definition: intsafe.h:51
HRESULT hres
Definition: protocol.c:465
static const WCHAR winetestW[]
Definition: sec_mgr.c:111
static IClassFactory protocol_cf
Definition: sec_mgr.c:1529
#define IID_NULL
Definition: guiddef.h:98

Referenced by START_TEST().

◆ register_zone_domains()

static BOOL register_zone_domains ( void  )
static

Definition at line 733 of file sec_mgr.c.

734{
735 HKEY domains;
736 DWORD res, i;
737
738 /* Some Windows versions don't seem to have a "Domains" key in their HKLM. */
740 ok(res == ERROR_SUCCESS || broken(res == ERROR_FILE_NOT_FOUND), "RegOpenKey failed: %ld\n", res);
741 if(res == ERROR_SUCCESS) {
742 HKEY domain;
744
745 res = RegCreateKeyA(domains, "local.machine", &domain);
747 {
748 skip("need admin rights\n");
749 RegCloseKey(domains);
750 return FALSE;
751 }
752 ok(res == ERROR_SUCCESS, "RegCreateKey failed: %ld\n", res);
753
754 res = RegSetValueExA(domain, "http", 0, REG_DWORD, (BYTE*)&zone, sizeof(DWORD));
755 ok(res == ERROR_SUCCESS, "RegSetValueEx failed: %ld\n", res);
756
758 RegCloseKey(domains);
759 }
760
762 ok(res == ERROR_SUCCESS, "RegOpenKey failed: %ld\n", res);
763
764 for(i = 0; i < ARRAY_SIZE(zone_domain_mappings); ++i) {
766 HKEY domain;
767
768 res = RegCreateKeyA(domains, test->domain, &domain);
769 ok(res == ERROR_SUCCESS, "RegCreateKey failed with %ld on test %ld\n", res, i);
770
771 /* Only set the value if there's no subdomain. */
772 if(!test->subdomain) {
773 res = RegSetValueExA(domain, test->scheme, 0, REG_DWORD, (BYTE*)&test->zone, sizeof(DWORD));
774 ok(res == ERROR_SUCCESS, "RegSetValueEx failed with %ld on test %ld\n", res, i);
775 } else {
776 HKEY subdomain;
777
778 res = RegCreateKeyA(domain, test->subdomain, &subdomain);
779 ok(res == ERROR_SUCCESS, "RegCreateKey failed with %ld on test %ld\n", res, i);
780
781 res = RegSetValueExA(subdomain, test->scheme, 0, REG_DWORD, (BYTE*)&test->zone, sizeof(DWORD));
782 ok(res == ERROR_SUCCESS, "RegSetValueEx failed with %ld on test %ld\n", res, i);
783
784 RegCloseKey(subdomain);
785 }
786
788 }
789
790 RegCloseKey(domains);
791 return TRUE;
792}
#define skip(...)
Definition: atltest.h:64
#define broken(x)
Definition: atltest.h:178
LONG WINAPI RegCreateKeyA(HKEY hKey, LPCSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:1179
LONG WINAPI RegSetValueExA(HKEY hKey, LPCSTR lpValueName, DWORD Reserved, DWORD dwType, CONST BYTE *lpData, DWORD cbData)
Definition: reg.c:4799
LONG WINAPI RegOpenKeyA(HKEY hKey, LPCSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:3234
#define ERROR_ACCESS_DENIED
Definition: compat.h:97
GLuint res
Definition: glext.h:9613
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
Definition: glfuncs.h:248
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
#define URLZONE_CUSTOM
Definition: sec_mgr.c:36
static const zone_domain_mapping zone_domain_mappings[]
Definition: sec_mgr.c:714
DWORD zone
Definition: sec_mgr.c:1728
static const char * szZoneMapDomainsKey
Definition: sec_mgr.c:117
#define test
Definition: rosglue.h:37
Definition: cookie.c:42
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
unsigned char BYTE
Definition: xxhash.c:193

Referenced by test_zone_domains().

◆ run_child_process()

static void run_child_process ( void  )
static

Definition at line 831 of file sec_mgr.c.

832{
833 char cmdline[MAX_PATH];
834 char path[MAX_PATH];
835 char **argv;
837 STARTUPINFOA si = { 0 };
838 BOOL ret;
839
841
842 si.cb = sizeof(si);
844 sprintf(cmdline, "\"%s\" %s domain_tests", argv[0], argv[1]);
846 ok(ret, "Failed to spawn child process: %lu\n", GetLastError());
850}
#define CloseHandle
Definition: compat.h:739
DWORD WINAPI GetModuleFileNameA(HINSTANCE hModule, LPSTR lpFilename, DWORD nSize)
Definition: loader.c:539
BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessA(const char *app_name, char *cmd_line, SECURITY_ATTRIBUTES *process_attr, SECURITY_ATTRIBUTES *thread_attr, BOOL inherit, DWORD flags, void *env, const char *cur_dir, STARTUPINFOA *startup_info, PROCESS_INFORMATION *info)
Definition: process.c:686
unsigned int BOOL
Definition: ntddk_ex.h:94
#define sprintf
Definition: sprintf.c:45
static PROCESS_INFORMATION pi
Definition: debugger.c:2303
static SYSTEM_INFO si
Definition: virtual.c:39
#define argv
Definition: mplay32.c:18
int winetest_get_mainargs(char ***pargv)
#define wait_child_process
Definition: test.h:159
TCHAR * cmdline
Definition: stretchblt.cpp:32
DWORD WINAPI GetLastError(void)
Definition: except.c:1042

Referenced by test_zone_domains().

◆ SecurityManager_AddRef()

static ULONG WINAPI SecurityManager_AddRef ( IInternetSecurityManager This)
static

Definition at line 250 of file sec_mgr.c.

251{
252 return 2;
253}

◆ SecurityManager_GetSecurityId()

static HRESULT WINAPI SecurityManager_GetSecurityId ( IInternetSecurityManager This,
LPCWSTR  pwszUrl,
BYTE pbSecurityId,
DWORD pcbSecurityId,
DWORD_PTR  dwReserved 
)
static

Definition at line 281 of file sec_mgr.c.

283{
284 ok(0, "unexpected call\n");
285 return E_NOTIMPL;
286}

◆ SecurityManager_GetSecuritySite()

static HRESULT WINAPI SecurityManager_GetSecuritySite ( IInternetSecurityManager This,
IInternetSecurityMgrSite **  ppSite 
)
static

Definition at line 267 of file sec_mgr.c.

269{
270 ok(0, "unexpected call\n");
271 return E_NOTIMPL;
272}

◆ SecurityManager_GetZoneMappings()

static HRESULT WINAPI SecurityManager_GetZoneMappings ( IInternetSecurityManager This,
DWORD  dwZone,
IEnumString **  ppenumString,
DWORD  dwFlags 
)
static

Definition at line 318 of file sec_mgr.c.

320{
321 ok(0, "unexpected call\n");
322 return E_NOTIMPL;
323}

◆ SecurityManager_MapUrlToZone()

static HRESULT WINAPI SecurityManager_MapUrlToZone ( IInternetSecurityManager This,
LPCWSTR  pwszUrl,
DWORD pdwZone,
DWORD  dwFlags 
)
static

Definition at line 274 of file sec_mgr.c.

276{
277 ok(0, "unexpected call\n");
278 return E_NOTIMPL;
279}

◆ SecurityManager_ProcessUrlAction()

static HRESULT WINAPI SecurityManager_ProcessUrlAction ( IInternetSecurityManager This,
LPCWSTR  pwszUrl,
DWORD  dwAction,
BYTE pPolicy,
DWORD  cbPolicy,
BYTE pContext,
DWORD  cbContext,
DWORD  dwFlags,
DWORD  dwReserved 
)
static

Definition at line 288 of file sec_mgr.c.

291{
292 CHECK_EXPECT(ProcessUrlAction);
293 ok(dwAction == URLACTION_FEATURE_ZONE_ELEVATION, "dwAction = %lx\n", dwAction);
294 ok(cbPolicy == sizeof(DWORD), "cbPolicy = %ld\n", cbPolicy);
295 ok(!pContext, "pContext != NULL\n");
296 ok(dwFlags == PUAF_NOUI, "dwFlags = %lx\n", dwFlags);
297 ok(dwReserved == 0, "dwReserved = %lx\n", dwReserved);
298
299 *pPolicy = ProcessUrlAction_policy;
300 return ProcessUrlAction_policy==URLPOLICY_ALLOW ? S_OK : S_FALSE;
301}
static DWORD ProcessUrlAction_policy
Definition: sec_mgr.c:144
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED _In_opt_ LPTRANSMIT_FILE_BUFFERS _In_ DWORD dwReserved
Definition: mswsock.h:95
_In_ LPWSTR _In_ DWORD _In_ DWORD _In_ DWORD dwFlags
Definition: netsh.h:141

◆ SecurityManager_QueryCustomPolicy()

static HRESULT WINAPI SecurityManager_QueryCustomPolicy ( IInternetSecurityManager This,
LPCWSTR  pwszUrl,
REFGUID  guidKey,
BYTE **  ppPolicy,
DWORD pcbPolicy,
BYTE pContext,
DWORD  cbContext,
DWORD  dwReserved 
)
static

Definition at line 303 of file sec_mgr.c.

306{
307 ok(0, "unexpected call\n");
308 return E_NOTIMPL;
309}

◆ SecurityManager_QueryInterface()

static HRESULT WINAPI SecurityManager_QueryInterface ( IInternetSecurityManager This,
REFIID  riid,
void **  ppvObject 
)
static

Definition at line 243 of file sec_mgr.c.

245{
246 ok(0, "unexpected call\n");
247 return E_NOTIMPL;
248}

◆ SecurityManager_Release()

static ULONG WINAPI SecurityManager_Release ( IInternetSecurityManager This)
static

Definition at line 255 of file sec_mgr.c.

256{
257 return 1;
258}

◆ SecurityManager_SetSecuritySite()

static HRESULT WINAPI SecurityManager_SetSecuritySite ( IInternetSecurityManager This,
IInternetSecurityMgrSite pSite 
)
static

Definition at line 260 of file sec_mgr.c.

262{
263 ok(0, "unexpected call\n");
264 return E_NOTIMPL;
265}

◆ SecurityManager_SetZoneMapping()

static HRESULT WINAPI SecurityManager_SetZoneMapping ( IInternetSecurityManager This,
DWORD  dwZone,
LPCWSTR  lpszPattern,
DWORD  dwFlags 
)
static

Definition at line 311 of file sec_mgr.c.

313{
314 ok(0, "unexpected call\n");
315 return E_NOTIMPL;
316}

◆ START_TEST()

START_TEST ( sec_mgr  )

Definition at line 1931 of file sec_mgr.c.

1932{
1933 HMODULE hurlmon;
1934 int argc;
1935 char **argv;
1936
1937 hurlmon = GetModuleHandleA("urlmon.dll");
1938 pCoInternetCreateSecurityManager = (void*) GetProcAddress(hurlmon, "CoInternetCreateSecurityManager");
1939 pCoInternetCreateZoneManager = (void*) GetProcAddress(hurlmon, "CoInternetCreateZoneManager");
1940 pCoInternetGetSecurityUrl = (void*) GetProcAddress(hurlmon, "CoInternetGetSecurityUrl");
1941 pCoInternetGetSecurityUrlEx = (void*) GetProcAddress(hurlmon, "CoInternetGetSecurityUrlEx");
1942 pCreateUri = (void*) GetProcAddress(hurlmon, "CreateUri");
1943 pCoInternetGetSession = (void*) GetProcAddress(hurlmon, "CoInternetGetSession");
1944 pCoInternetIsFeatureEnabled = (void*) GetProcAddress(hurlmon, "CoInternetIsFeatureEnabled");
1945 pCoInternetIsFeatureEnabledForUrl = (void*) GetProcAddress(hurlmon, "CoInternetIsFeatureEnabledForUrl");
1946 pCoInternetIsFeatureZoneElevationEnabled = (void*) GetProcAddress(hurlmon, "CoInternetIsFeatureZoneElevationEnabled");
1947
1948 if (!pCoInternetCreateSecurityManager || !pCoInternetCreateZoneManager ||
1949 !pCoInternetGetSecurityUrl) {
1950 win_skip("Various CoInternet* functions not present in IE 4.0\n");
1951 return;
1952 }
1953
1955 if(argc > 2 && !strcmp(argv[2], "domain_tests")) {
1957 return;
1958 }
1959
1962
1964
1965 if(!pCoInternetGetSecurityUrlEx || !pCreateUri)
1966 win_skip("Skipping CoInternetGetSecurityUrlEx tests, IE too old\n");
1967 else {
1970 }
1971
1974 test_polices();
1984
1987}
#define GetProcAddress(x, y)
Definition: compat.h:753
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:812
MonoAssembly int argc
Definition: metahost.c:107
_ACRTIMP int __cdecl strcmp(const char *, const char *)
Definition: string.c:3324
HRESULT WINAPI DECLSPEC_HOTPATCH OleInitialize(LPVOID reserved)
Definition: ole2.c:162
void WINAPI DECLSPEC_HOTPATCH OleUninitialize(void)
Definition: ole2.c:218
#define win_skip
Definition: minitest.h:67
static void test_GetZoneAt(void)
Definition: sec_mgr.c:1106
static void test_GetZoneAttributes(void)
Definition: sec_mgr.c:1157
static void test_CoInternetIsFeatureZoneElevationEnabled(void)
Definition: sec_mgr.c:1859
static void test_SecurityManagerEx2(void)
Definition: sec_mgr.c:1750
static void unregister_protocols(void)
Definition: sec_mgr.c:1548
static void test_CoInternetCreateZoneManager(void)
Definition: sec_mgr.c:948
static void test_InternetSecurityMarshalling(void)
Definition: sec_mgr.c:1290
static void test_SecurityManager(void)
Definition: sec_mgr.c:341
static void test_zone_domains(void)
Definition: sec_mgr.c:929
static void test_SetZoneAttributes(void)
Definition: sec_mgr.c:1213
static void test_polices(void)
Definition: sec_mgr.c:630
static void test_GetZoneActionPolicy(void)
Definition: sec_mgr.c:1063
static void test_CreateZoneEnumerator(void)
Definition: sec_mgr.c:993
static void register_protocols(void)
Definition: sec_mgr.c:1531
static void test_InternetGetSecurityUrlEx_Pluggable(void)
Definition: sec_mgr.c:1659
static void test_InternetGetSecurityUrlEx(void)
Definition: sec_mgr.c:1585
static void test_InternetGetSecurityUrl(void)
Definition: sec_mgr.c:1320
static void test_zone_domain_mappings(void)
Definition: sec_mgr.c:890

◆ strcmp_w()

static int strcmp_w ( const WCHAR str1,
const WCHAR str2 
)
static

Definition at line 167 of file sec_mgr.c.

168{
169 DWORD len1 = lstrlenW(str1);
170 DWORD len2 = lstrlenW(str2);
171
172 if(len1!=len2) return 1;
173 return memcmp(str1, str2, len1*sizeof(WCHAR));
174}
_ACRTIMP int __cdecl memcmp(const void *, const void *, size_t)
Definition: string.c:2807
XML_HIDDEN void xmlParserErrors const char const xmlChar const xmlChar * str2
Definition: parser.h:35
XML_HIDDEN void xmlParserErrors const char const xmlChar * str1
Definition: parser.h:35

Referenced by InternetProtocolInfo_ParseUrl(), test_InternetGetSecurityUrl(), and test_InternetGetSecurityUrlEx_Pluggable().

◆ test_activex()

static void test_activex ( IInternetSecurityManager secmgr)
static

Definition at line 609 of file sec_mgr.c.

610{
611 DWORD policy, policy_size;
612 struct CONFIRMSAFETY cs;
613 BYTE *ppolicy;
615
616 policy = 0xdeadbeef;
617 hres = IInternetSecurityManager_ProcessUrlAction(secmgr, url1, URLACTION_ACTIVEX_RUN, (BYTE*)&policy,
618 sizeof(DWORD), (BYTE*)&CLSID_TestActiveX, sizeof(CLSID), 0, 0);
619 ok(hres == S_OK, "ProcessUrlAction(URLACTION_ACTIVEX_RUN) failed: %08lx\n", hres);
620 ok(policy == URLPOLICY_ALLOW || policy == URLPOLICY_DISALLOW, "policy = %lx\n", policy);
621
622 cs.clsid = CLSID_TestActiveX;
623 cs.pUnk = (IUnknown*)0xdeadbeef;
624 cs.dwFlags = 0;
625 hres = IInternetSecurityManager_QueryCustomPolicy(secmgr, url1, &GUID_CUSTOM_CONFIRMOBJECTSAFETY,
626 &ppolicy, &policy_size, (BYTE*)&cs, sizeof(cs), 0);
627 ok(hres == HRESULT_FROM_WIN32(ERROR_NOT_FOUND), "QueryCusromPolicy failed: %08lx\n", hres);
628}
WINBASEAPI _Check_return_ _Out_ AppPolicyProcessTerminationMethod * policy
Definition: appmodel.h:78
#define cs
Definition: i386-dis.c:442
static const GUID CLSID_TestActiveX
Definition: sec_mgr.c:136
static const WCHAR url1[]
Definition: sec_mgr.c:86
const GUID GUID_CUSTOM_CONFIRMOBJECTSAFETY
Definition: sec_mgr.c:140
static HRESULT HRESULT_FROM_WIN32(unsigned int x)
Definition: winerror.h:210
#define ERROR_NOT_FOUND
Definition: winerror.h:1014

Referenced by test_polices().

◆ test_CoInternetCreateZoneManager()

static void test_CoInternetCreateZoneManager ( void  )
static

Definition at line 948 of file sec_mgr.c.

949{
950 IInternetZoneManager *zonemgr = NULL;
951 IUnknown *punk = NULL;
952 HRESULT hr;
953
954 trace("simple zone manager tests...\n");
955
956 hr = pCoInternetCreateZoneManager(NULL, &zonemgr, 0);
957 ok(hr == S_OK, "CoInternetCreateZoneManager result: 0x%lx\n", hr);
958 if (FAILED(hr))
959 return;
960
961 hr = IInternetZoneManager_QueryInterface(zonemgr, &IID_IUnknown, (void **) &punk);
962 ok(SUCCEEDED(hr), "got 0x%lx with %p (expected Success)\n", hr, punk);
963 if (punk)
964 IUnknown_Release(punk);
965
966 hr = IInternetZoneManager_QueryInterface(zonemgr, &IID_IInternetZoneManager, (void **) &punk);
967 ok(SUCCEEDED(hr), "got 0x%lx with %p (expected Success)\n", hr, punk);
968 if (punk)
969 IUnknown_Release(punk);
970
971
972 hr = IInternetZoneManager_QueryInterface(zonemgr, &IID_IInternetZoneManagerEx, (void **) &punk);
973 if (SUCCEEDED(hr)) {
974 IUnknown_Release(punk);
975
976 hr = IInternetZoneManager_QueryInterface(zonemgr, &IID_IInternetZoneManagerEx2, (void **) &punk);
977 ok(hr == S_OK || broken(hr == E_NOINTERFACE /* some W2K3 */),
978 "got 0x%lx (expected S_OK)\n", hr);
979 if (punk)
980 IUnknown_Release(punk);
981 else
982 win_skip("InternetZoneManagerEx2 not supported\n");
983
984 }
985 else
986 win_skip("InternetZoneManagerEx not supported\n");
987
988 hr = IInternetZoneManager_Release(zonemgr);
989 ok(hr == S_OK, "got 0x%lx (expected S_OK)\n", hr);
990
991}
#define trace
Definition: atltest.h:70
const GUID IID_IUnknown
HRESULT hr
Definition: delayimp.cpp:582
#define SUCCEEDED(hr)
Definition: intsafe.h:50
_In_opt_ IUnknown * punk
Definition: shlwapi.h:158

Referenced by START_TEST().

◆ test_CoInternetIsFeatureZoneElevationEnabled()

static void test_CoInternetIsFeatureZoneElevationEnabled ( void  )
static

Definition at line 1859 of file sec_mgr.c.

1860{
1861 struct {
1862 const WCHAR *url_from;
1863 const WCHAR *url_to;
1864 DWORD flags;
1865 HRESULT hres;
1866 DWORD policy_flags;
1867 } testcases[] = {
1868 /* 0 */ { L"http://www.winehq.org", L"http://www.winehq.org", 0, S_FALSE, URLPOLICY_ALLOW },
1869 /* 1 */ { L"http://www.winehq.org", L"http://www.winehq.org", 0, S_OK, URLPOLICY_DISALLOW },
1870 /* 2 */ { L"http://www.winehq.org", L"http://www.codeweavers.com", 0, S_FALSE, URLPOLICY_ALLOW },
1871 /* 3 */ { L"http://www.winehq.org", L"http://www.codeweavers.com", 0, S_OK, URLPOLICY_DISALLOW },
1872 /* 4 */ { L"http://www.winehq.org", L"http://www.winehq.org", GET_FEATURE_FROM_PROCESS, S_FALSE, -1 },
1873 /* 5 */ { L"http://www.winehq.org", L"http://www.winehq.org/dir", GET_FEATURE_FROM_PROCESS, S_FALSE, -1 },
1874 /* 6 */ { L"http://www.winehq.org", L"http://www.codeweavers.com", GET_FEATURE_FROM_PROCESS, S_FALSE, -1 },
1875 /* 7 */ { L"http://www.winehq.org", L"ftp://winehq.org", GET_FEATURE_FROM_PROCESS, S_FALSE, -1 },
1876 /* 8 */ { L"http://www.winehq.org", L"ftp://winehq.org", GET_FEATURE_FROM_PROCESS|0x100, S_FALSE, URLPOLICY_ALLOW },
1877 /* 9 */ { L"http://www.winehq.org", L"ftp://winehq.org", GET_FEATURE_FROM_REGISTRY, S_FALSE, URLPOLICY_ALLOW },
1878 };
1879
1880 int i;
1881 HRESULT hres;
1882
1883 if(!pCoInternetIsFeatureZoneElevationEnabled || !pCoInternetIsFeatureEnabled
1884 || !pCoInternetIsFeatureEnabledForUrl) {
1885 win_skip("Skipping CoInternetIsFeatureZoneElevationEnabled tests\n");
1886 return;
1887 }
1888
1889
1890 hres = pCoInternetIsFeatureEnabled(FEATURE_ZONE_ELEVATION, GET_FEATURE_FROM_PROCESS);
1891 ok(SUCCEEDED(hres), "CoInternetIsFeatureEnabled returned %lx\n", hres);
1892
1893 trace("Testing CoInternetIsFeatureZoneElevationEnabled... (%lx)\n", hres);
1894
1895 for(i = 0; i < ARRAY_SIZE(testcases); i++) {
1896 if(hres==S_OK && testcases[i].flags == GET_FEATURE_FROM_PROCESS)
1897 testcases[i].policy_flags = URLPOLICY_ALLOW;
1898 }
1899
1900 /* IE10 does not seem to use passed ISecurityManager */
1901 SET_EXPECT(ProcessUrlAction);
1902 pCoInternetIsFeatureZoneElevationEnabled(url1, url1, &security_manager, 0);
1903 i = called_ProcessUrlAction;
1904 SET_CALLED(ProcessUrlAction);
1905 if(!i) {
1906 skip("CoInternetIsFeatureZoneElevationEnabled does not use passed ISecurityManager\n");
1907 return;
1908 }
1909
1910 for(i = 0; i < ARRAY_SIZE(testcases); i++) {
1911 if(testcases[i].policy_flags != -1) {
1912 ProcessUrlAction_policy = testcases[i].policy_flags;
1913 SET_EXPECT(ProcessUrlAction);
1914 }
1915 hres = pCoInternetIsFeatureZoneElevationEnabled(testcases[i].url_from, testcases[i].url_to,
1916 &security_manager, testcases[i].flags);
1917 ok(hres == testcases[i].hres, "%d) CoInternetIsFeatureZoneElevationEnabled returned %lx\n", i, hres);
1918 if(testcases[i].policy_flags != -1)
1919 CHECK_CALLED(ProcessUrlAction);
1920
1921 if(testcases[i].policy_flags != -1)
1922 SET_EXPECT(ProcessUrlAction);
1923 hres = pCoInternetIsFeatureEnabledForUrl(FEATURE_ZONE_ELEVATION,
1924 testcases[i].flags, testcases[i].url_to, &security_manager);
1925 ok(hres == testcases[i].hres, "%d) CoInternetIsFeatureEnabledForUrl returned %lx\n", i, hres);
1926 if(testcases[i].policy_flags != -1)
1927 CHECK_CALLED(ProcessUrlAction);
1928 }
1929}
#define L(x)
Definition: resources.c:13
GLbitfield flags
Definition: glext.h:7161
#define SET_EXPECT(func)
Definition: sec_mgr.c:42
#define CHECK_CALLED(func)
Definition: sec_mgr.c:58
#define SET_CALLED(func)
Definition: sec_mgr.c:64
static IInternetSecurityManager security_manager
Definition: sec_mgr.c:339

Referenced by START_TEST().

◆ test_CreateZoneEnumerator()

static void test_CreateZoneEnumerator ( void  )
static

Definition at line 993 of file sec_mgr.c.

994{
995 IInternetZoneManager *zonemgr = NULL;
996 HRESULT hr;
997 DWORD dwEnum;
998 DWORD dwEnum2;
999 DWORD dwCount;
1000 DWORD dwCount2;
1001
1002 trace("testing zone enumerator...\n");
1003
1004 hr = pCoInternetCreateZoneManager(NULL, &zonemgr, 0);
1005 ok(hr == S_OK, "CoInternetCreateZoneManager result: 0x%lx\n", hr);
1006 if (FAILED(hr))
1007 return;
1008
1009 dwEnum=0xdeadbeef;
1010 hr = IInternetZoneManager_CreateZoneEnumerator(zonemgr, &dwEnum, NULL, 0);
1011 ok((hr == E_INVALIDARG) && (dwEnum == 0xdeadbeef),
1012 "got 0x%lx with 0x%lx (expected E_INVALIDARG with 0xdeadbeef)\n", hr, dwEnum);
1013
1014 dwCount=0xdeadbeef;
1015 hr = IInternetZoneManager_CreateZoneEnumerator(zonemgr, NULL, &dwCount, 0);
1016 ok((hr == E_INVALIDARG) && (dwCount == 0xdeadbeef),
1017 "got 0x%lx and 0x%lx (expected E_INVALIDARG and 0xdeadbeef)\n", hr, dwCount);
1018
1019 dwEnum=0xdeadbeef;
1020 dwCount=0xdeadbeef;
1021 hr = IInternetZoneManager_CreateZoneEnumerator(zonemgr, &dwEnum, &dwCount, 0xffffffff);
1022 ok((hr == E_INVALIDARG) && (dwEnum == 0xdeadbeef) && (dwCount == 0xdeadbeef),
1023 "got 0x%lx with 0x%lx and 0x%lx (expected E_INVALIDARG with 0xdeadbeef and 0xdeadbeef)\n",
1024 hr, dwEnum, dwCount);
1025
1026 dwEnum=0xdeadbeef;
1027 dwCount=0xdeadbeef;
1028 hr = IInternetZoneManager_CreateZoneEnumerator(zonemgr, &dwEnum, &dwCount, 1);
1029 ok((hr == E_INVALIDARG) && (dwEnum == 0xdeadbeef) && (dwCount == 0xdeadbeef),
1030 "got 0x%lx with 0x%lx and 0x%lx (expected E_INVALIDARG with 0xdeadbeef and 0xdeadbeef)\n",
1031 hr, dwEnum, dwCount);
1032
1033 dwEnum=0xdeadbeef;
1034 dwCount=0xdeadbeef;
1035 /* Normal use */
1036 hr = IInternetZoneManager_CreateZoneEnumerator(zonemgr, &dwEnum, &dwCount, 0);
1037 ok(hr == S_OK, "got 0x%lx (expected S_OK)\n", hr);
1038
1039 if (SUCCEEDED(hr)) {
1040 dwEnum2=0xdeadbeef;
1041 dwCount2=0xdeadbeef;
1042 hr = IInternetZoneManager_CreateZoneEnumerator(zonemgr, &dwEnum2, &dwCount2, 0);
1043 ok(hr == S_OK, "got 0x%lx (expected S_OK)\n", hr);
1044 if (SUCCEEDED(hr)) {
1045 /* native urlmon has an incrementing counter for dwEnum */
1046 hr = IInternetZoneManager_DestroyZoneEnumerator(zonemgr, dwEnum2);
1047 ok(hr == S_OK, "got 0x%lx (expected S_OK)\n", hr);
1048 }
1049
1050 hr = IInternetZoneManager_DestroyZoneEnumerator(zonemgr, dwEnum);
1051 ok(hr == S_OK, "got 0x%lx (expected S_OK)\n", hr);
1052
1053 /* Destroy the Enumerator twice is detected and handled in native urlmon */
1054 hr = IInternetZoneManager_DestroyZoneEnumerator(zonemgr, dwEnum);
1055 ok((hr == E_INVALIDARG), "got 0x%lx (expected E_INVALIDARG)\n", hr);
1056 }
1057
1058 /* ::Release succeed also, when a ::DestroyZoneEnumerator is missing */
1059 hr = IInternetZoneManager_Release(zonemgr);
1060 ok(hr == S_OK, "got 0x%lx (expected S_OK)\n", hr);
1061}
#define E_INVALIDARG
Definition: ddrawi.h:101

Referenced by START_TEST().

◆ test_GetZoneActionPolicy()

static void test_GetZoneActionPolicy ( void  )
static

Definition at line 1063 of file sec_mgr.c.

1064{
1065 IInternetZoneManager *zonemgr = NULL;
1066 BYTE buf[32];
1067 HRESULT hres;
1068 DWORD action = URLACTION_CREDENTIALS_USE; /* Implemented on all IE versions */
1069
1070 trace("testing GetZoneActionPolixy...\n");
1071
1072 hres = pCoInternetCreateZoneManager(NULL, &zonemgr, 0);
1073 ok(hres == S_OK, "CoInternetCreateZoneManager failed: %08lx\n", hres);
1074 if(FAILED(hres))
1075 return;
1076
1077 hres = IInternetZoneManager_GetZoneActionPolicy(zonemgr, 3, action, buf,
1078 sizeof(DWORD), URLZONEREG_DEFAULT);
1079 ok(hres == S_OK, "GetZoneActionPolicy failed: %08lx\n", hres);
1080 ok(*(DWORD*)buf == URLPOLICY_CREDENTIALS_SILENT_LOGON_OK ||
1081 *(DWORD*)buf == URLPOLICY_CREDENTIALS_MUST_PROMPT_USER ||
1082 *(DWORD*)buf == URLPOLICY_CREDENTIALS_CONDITIONAL_PROMPT ||
1083 *(DWORD*)buf == URLPOLICY_CREDENTIALS_ANONYMOUS_ONLY,
1084 "unexpected policy=%ld\n", *(DWORD*)buf);
1085
1086 hres = IInternetZoneManager_GetZoneActionPolicy(zonemgr, 3, action, NULL,
1087 sizeof(DWORD), URLZONEREG_DEFAULT);
1088 ok(hres == E_INVALIDARG, "GetZoneActionPolicy failed: %08lx, expected E_INVALIDARG\n", hres);
1089
1090 hres = IInternetZoneManager_GetZoneActionPolicy(zonemgr, 3, action, buf,
1091 2, URLZONEREG_DEFAULT);
1092 ok(hres == E_INVALIDARG, "GetZoneActionPolicy failed: %08lx, expected E_INVALIDARG\n", hres);
1093
1094 hres = IInternetZoneManager_GetZoneActionPolicy(zonemgr, 3, 0x1fff, buf,
1095 sizeof(DWORD), URLZONEREG_DEFAULT);
1097 "(0x%lx) got 0x%lx (expected E_FAIL)\n", action, hres);
1098
1099 hres = IInternetZoneManager_GetZoneActionPolicy(zonemgr, 13, action, buf,
1100 sizeof(DWORD), URLZONEREG_DEFAULT);
1101 ok(hres == E_INVALIDARG, "GetZoneActionPolicy failed: %08lx, expected E_INVALIDARG\n", hres);
1102
1103 IInternetZoneManager_Release(zonemgr);
1104}
action
Definition: namespace.c:707
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751

Referenced by START_TEST().

◆ test_GetZoneAt()

static void test_GetZoneAt ( void  )
static

Definition at line 1106 of file sec_mgr.c.

1107{
1108 IInternetZoneManager *zonemgr = NULL;
1109 HRESULT hr;
1110 DWORD dwEnum;
1111 DWORD dwCount;
1112 DWORD dwZone;
1113 DWORD i;
1114
1115 trace("testing GetZoneAt...\n");
1116
1117 hr = pCoInternetCreateZoneManager(NULL, &zonemgr, 0);
1118 ok(hr == S_OK, "CoInternetCreateZoneManager result: 0x%lx\n", hr);
1119 if (FAILED(hr))
1120 return;
1121
1122 hr = IInternetZoneManager_CreateZoneEnumerator(zonemgr, &dwEnum, &dwCount, 0);
1123 if (FAILED(hr))
1124 goto cleanup;
1125
1126 if (0) {
1127 /* this crashes with native urlmon */
1128 IInternetZoneManager_GetZoneAt(zonemgr, dwEnum, 0, NULL);
1129 }
1130
1131 dwZone = 0xdeadbeef;
1132 hr = IInternetZoneManager_GetZoneAt(zonemgr, 0xdeadbeef, 0, &dwZone);
1133 ok(hr == E_INVALIDARG,
1134 "got 0x%lx with 0x%lx (expected E_INVALIDARG)\n", hr, dwZone);
1135
1136 for (i = 0; i < dwCount; i++)
1137 {
1138 dwZone = 0xdeadbeef;
1139 hr = IInternetZoneManager_GetZoneAt(zonemgr, dwEnum, i, &dwZone);
1140 ok(hr == S_OK, "#%ld: got x%lx with %ld (expected S_OK)\n", i, hr, dwZone);
1141 }
1142
1143 dwZone = 0xdeadbeef;
1144 /* MSDN (index .. must be .. less than or equal to) is wrong */
1145 hr = IInternetZoneManager_GetZoneAt(zonemgr, dwEnum, dwCount, &dwZone);
1146 ok(hr == E_INVALIDARG,
1147 "got 0x%lx with 0x%lx (expected E_INVALIDARG)\n", hr, dwZone);
1148
1149 hr = IInternetZoneManager_DestroyZoneEnumerator(zonemgr, dwEnum);
1150 ok(hr == S_OK, "got 0x%lx (expected S_OK)\n", hr);
1151
1152cleanup:
1153 hr = IInternetZoneManager_Release(zonemgr);
1154 ok(hr == S_OK, "got 0x%lx (expected S_OK)\n", hr);
1155}

Referenced by START_TEST().

◆ test_GetZoneAttributes()

static void test_GetZoneAttributes ( void  )
static

Definition at line 1157 of file sec_mgr.c.

1158{
1159 IInternetZoneManager *zonemgr = NULL;
1160 CHAR buffer [sizeof(ZONEATTRIBUTES) + 32];
1161 ZONEATTRIBUTES* pZA = (ZONEATTRIBUTES*) buffer;
1162 HRESULT hr;
1163 DWORD i;
1164
1165 trace("testing GetZoneAttributes...\n");
1166
1167 hr = pCoInternetCreateZoneManager(NULL, &zonemgr, 0);
1168 ok(hr == S_OK, "CoInternetCreateZoneManager result: 0x%lx\n", hr);
1169 if (FAILED(hr))
1170 return;
1171
1172 /* native urlmon has Zone "0" up to Zone "4" since IE4 */
1173 for (i = 0; i < 5; i++) {
1174 memset(buffer, -1, sizeof(buffer));
1175 hr = IInternetZoneManager_GetZoneAttributes(zonemgr, i, pZA);
1176 ok(hr == S_OK, "#%ld: got 0x%lx (expected S_OK)\n", i, hr);
1177 }
1178
1179 /* IE8 no longer set cbSize */
1180 memset(buffer, -1, sizeof(buffer));
1181 pZA->cbSize = 0;
1182 hr = IInternetZoneManager_GetZoneAttributes(zonemgr, 0, pZA);
1183 ok(hr == S_OK, "got 0x%lx (expected S_OK)\n", hr);
1184 ok((pZA->cbSize == 0) || (pZA->cbSize == sizeof(ZONEATTRIBUTES)),
1185 "got cbSize = %ld (expected 0)\n", pZA->cbSize);
1186
1187 memset(buffer, -1, sizeof(buffer));
1188 pZA->cbSize = 64;
1189 hr = IInternetZoneManager_GetZoneAttributes(zonemgr, 0, pZA);
1190 ok(hr == S_OK, "got 0x%lx (expected S_OK)\n", hr);
1191 ok((pZA->cbSize == 64) || (pZA->cbSize == sizeof(ZONEATTRIBUTES)),
1192 "got cbSize = %ld (expected 64)\n", pZA->cbSize);
1193
1194 memset(buffer, -1, sizeof(buffer));
1195 hr = IInternetZoneManager_GetZoneAttributes(zonemgr, 0, pZA);
1196 ok(hr == S_OK, "got 0x%lx (expected S_OK)\n", hr);
1197 ok((pZA->cbSize == 0xffffffff) || (pZA->cbSize == sizeof(ZONEATTRIBUTES)),
1198 "got cbSize = 0x%lx (expected 0xffffffff)\n", pZA->cbSize);
1199
1200 /* IE8 up to IE10 don't fail on invalid zones */
1201 memset(buffer, -1, sizeof(buffer));
1202 hr = IInternetZoneManager_GetZoneAttributes(zonemgr, 0xdeadbeef, pZA);
1203 ok(hr == S_OK || hr == E_FAIL || hr == E_POINTER,
1204 "got 0x%lx (expected S_OK or E_FAIL)\n", hr);
1205
1206 hr = IInternetZoneManager_GetZoneAttributes(zonemgr, 0, NULL);
1207 ok(hr == E_INVALIDARG, "got 0x%lx (expected E_INVALIDARG)\n", hr);
1208
1209 hr = IInternetZoneManager_Release(zonemgr);
1210 ok(hr == S_OK, "got 0x%lx (expected S_OK)\n", hr);
1211}
GLuint buffer
Definition: glext.h:5915
#define memset(x, y, z)
Definition: compat.h:39
#define E_POINTER
Definition: winerror.h:3480

Referenced by START_TEST().

◆ test_InternetGetSecurityUrl()

static void test_InternetGetSecurityUrl ( void  )
static

Definition at line 1320 of file sec_mgr.c.

1321{
1322 const WCHAR url5_out[] = {'h','t','t','p',':','w','w','w','.','z','o','n','e','3',
1323 '.','w','i','n','e','t','e','s','t',0};
1324 const WCHAR url7_out[] = {'f','t','p',':','z','o','n','e','3','.','w','i','n','e','t','e','s','t',0};
1325
1326 const WCHAR *in[] = {url2, url3, url4, url5, url7, url8, url9, url10};
1327 const WCHAR *out_default[] = {url2, url3, url4, url5_out, url7_out, url8, url5_out, url10};
1328 const WCHAR *out_securl[] = {url2, url3, url4, url5, url7, url8, url9, url10};
1329
1330 WCHAR *sec;
1331 DWORD i;
1332 HRESULT hres;
1333
1334 trace("testing CoInternetGetSecurityUrl...\n");
1335
1336 for(i = 0; i < ARRAY_SIZE(in); i++) {
1337 hres = pCoInternetGetSecurityUrl(in[i], &sec, PSU_DEFAULT, 0);
1338 ok(hres == S_OK, "(%ld) CoInternetGetSecurityUrl returned: %08lx\n", i, hres);
1339 if(hres == S_OK) {
1340 ok(!strcmp_w(sec, out_default[i]), "(%ld) Got %s, expected %s\n",
1341 i, wine_dbgstr_w(sec), wine_dbgstr_w(out_default[i]));
1342 CoTaskMemFree(sec);
1343 }
1344
1345 hres = pCoInternetGetSecurityUrl(in[i], &sec, PSU_SECURITY_URL_ONLY, 0);
1346 ok(hres == S_OK, "(%ld) CoInternetGetSecurityUrl returned: %08lx\n", i, hres);
1347 if(hres == S_OK) {
1348 ok(!strcmp_w(sec, out_securl[i]), "(%ld) Got %s, expected %s\n",
1349 i, wine_dbgstr_w(sec), wine_dbgstr_w(out_securl[i]));
1350 CoTaskMemFree(sec);
1351 }
1352 }
1353
1354 SET_EXPECT(ParseUrl_SECURITY_URL_input2);
1355 SET_EXPECT(ParseUrl_SECURITY_URL_expected);
1356 SET_EXPECT(ParseUrl_SECURITY_DOMAIN_expected);
1357
1358 hres = pCoInternetGetSecurityUrl(security_url2W, &sec, PSU_DEFAULT, 0);
1359 ok(hres == S_OK, "CoInternetGetSecurityUrl returned 0x%08lx, expected S_OK\n", hres);
1360
1361 CHECK_CALLED(ParseUrl_SECURITY_URL_input2);
1362 CHECK_CALLED(ParseUrl_SECURITY_URL_expected);
1363 CHECK_CALLED(ParseUrl_SECURITY_DOMAIN_expected);
1364
1365 ok(!lstrcmpW(security_expectedW, sec), "Expected %s but got %s\n",
1367 CoTaskMemFree(sec);
1368}
void WINAPI CoTaskMemFree(void *ptr)
Definition: malloc.c:389
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
Definition: locale.c:4152
GLuint in
Definition: glext.h:9616
static const WCHAR url5[]
Definition: sec_mgr.c:92
static const WCHAR url4[]
Definition: sec_mgr.c:90
static const WCHAR url8[]
Definition: sec_mgr.c:97
static const WCHAR url2[]
Definition: sec_mgr.c:88
static const WCHAR url3[]
Definition: sec_mgr.c:89
static const WCHAR url10[]
Definition: sec_mgr.c:100
static const WCHAR url7[]
Definition: sec_mgr.c:95

Referenced by START_TEST().

◆ test_InternetGetSecurityUrlEx()

static void test_InternetGetSecurityUrlEx ( void  )
static

Definition at line 1585 of file sec_mgr.c.

1586{
1587 HRESULT hr;
1588 DWORD i;
1589 IUri *uri = NULL, *result = NULL;
1590
1591 trace("testing CoInternetGetSecurityUrlEx...\n");
1592
1593 hr = pCoInternetGetSecurityUrlEx(NULL, NULL, PSU_DEFAULT, 0);
1594 ok(hr == E_INVALIDARG, "CoInternetGetSecurityUrlEx returned 0x%08lx, expected E_INVALIDARG\n", hr);
1595
1596 result = (void*) 0xdeadbeef;
1597 hr = pCoInternetGetSecurityUrlEx(NULL, &result, PSU_DEFAULT, 0);
1598 ok(hr == E_INVALIDARG, "CoInternetGetSecurityUrlEx returned 0x%08lx, expected E_INVALIDARG\n", hr);
1599 ok(result == (void*) 0xdeadbeef, "'result' was %p\n", result);
1600
1601 for(i = 0; i < ARRAY_SIZE(sec_url_ex_tests); ++i) {
1602 uri = NULL;
1603
1604 hr = pCreateUri(sec_url_ex_tests[i].uri, sec_url_ex_tests[i].create_flags, 0, &uri);
1605 ok(hr == S_OK, "CreateUri returned 0x%08lx on test %ld\n", hr, i);
1606 if(hr == S_OK) {
1607 result = NULL;
1608
1609 hr = pCoInternetGetSecurityUrlEx(uri, &result, PSU_DEFAULT, 0);
1612 "CoInternetGetSecurityUrlEx returned 0x%08lx, expected 0x%08lx on test %ld\n",
1614 }
1615 if(SUCCEEDED(hr)) {
1616 BSTR received;
1617
1618 hr = IUri_GetDisplayUri(result, &received);
1619 ok(hr == S_OK, "GetDisplayUri returned 0x%08lx on test %ld\n", hr, i);
1620 if(hr == S_OK) {
1623 "Expected %s but got %s on test %ld\n",
1625 }
1626 }
1628 }
1629 if(result) IUri_Release(result);
1630
1631 result = NULL;
1632 hr = pCoInternetGetSecurityUrlEx(uri, &result, PSU_SECURITY_URL_ONLY, 0);
1635 "CoInternetGetSecurityUrlEx returned 0x%08lx, expected 0x%08lx on test %ld\n",
1637 }
1638 if(SUCCEEDED(hr)) {
1639 BSTR received;
1640
1641 hr = IUri_GetDisplayUri(result, &received);
1642 ok(hr == S_OK, "GetDisplayUri returned 0x%08lx on test %ld\n", hr, i);
1643 if(hr == S_OK) {
1646 "Expected %s but got %s on test %ld\n",
1648 }
1649 }
1651 }
1652 if(result) IUri_Release(result);
1653 }
1654
1655 if(uri) IUri_Release(uri);
1656 }
1657}
OLECHAR * BSTR
Definition: compat.h:2293
r received
Definition: btrfs.c:3005
GLuint64EXT * result
Definition: glext.h:11304
#define todo_wine_if(is_todo)
Definition: minitest.h:81
const WCHAR * uri
Definition: sec_mgr.c:1564
static const struct @1883 sec_url_ex_tests[]
const WCHAR * default_uri
Definition: sec_mgr.c:1568
DWORD create_flags
Definition: sec_mgr.c:1565
BOOL todo
Definition: sec_mgr.c:1570
HRESULT default_hres
Definition: sec_mgr.c:1569
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:271

Referenced by START_TEST().

◆ test_InternetGetSecurityUrlEx_Pluggable()

static void test_InternetGetSecurityUrlEx_Pluggable ( void  )
static

Definition at line 1659 of file sec_mgr.c.

1660{
1661 HRESULT hr;
1662 IUri *uri = NULL, *result;
1663
1664 trace("testing CoInternetGetSecurityUrlEx for pluggable protocols...\n");
1665
1666 hr = pCreateUri(security_urlW, 0, 0, &uri);
1667 ok(hr == S_OK, "CreateUri returned 0x%08lx\n", hr);
1668 if(hr == S_OK) {
1669 SET_EXPECT(ParseUrl_SECURITY_URL_input);
1670 SET_EXPECT(ParseUrl_SECURITY_URL_expected);
1671 SET_EXPECT(ParseUrl_SECURITY_DOMAIN_expected);
1672
1673 hr = pCoInternetGetSecurityUrlEx(uri, &result, PSU_DEFAULT, 0);
1674 ok(hr == S_OK, "CoInternetGetSecurityUrlEx returned 0x%08lx, expected S_OK\n", hr);
1675
1676 CHECK_CALLED(ParseUrl_SECURITY_URL_input);
1677 CHECK_CALLED(ParseUrl_SECURITY_URL_expected);
1678 CHECK_CALLED(ParseUrl_SECURITY_DOMAIN_expected);
1679
1680 if(hr == S_OK) {
1681 BSTR received = NULL;
1682
1683 hr = IUri_GetAbsoluteUri(result, &received);
1684 ok(hr == S_OK, "GetAbsoluteUri returned 0x%08lx\n", hr);
1685 if(hr == S_OK) {
1686 ok(!strcmp_w(security_expectedW, received), "Expected %s but got %s\n",
1688 }
1690 }
1691 if(result) IUri_Release(result);
1692
1693 result = NULL;
1694
1695 SET_EXPECT(ParseUrl_SECURITY_URL_input);
1696 SET_EXPECT(ParseUrl_SECURITY_URL_expected);
1697
1698 hr = pCoInternetGetSecurityUrlEx(uri, &result, PSU_SECURITY_URL_ONLY, 0);
1699 ok(hr == S_OK, "CoInternetGetSecurityUrlEx returned 0x%08lx, expected S_OK\n", hr);
1700
1701 CHECK_CALLED(ParseUrl_SECURITY_URL_input);
1702 CHECK_CALLED(ParseUrl_SECURITY_URL_expected);
1703
1704 if(hr == S_OK) {
1705 BSTR received = NULL;
1706
1707 hr = IUri_GetAbsoluteUri(result, &received);
1708 ok(hr == S_OK, "GetAbsoluteUri returned 0x%08lx\n", hr);
1709 if(hr == S_OK) {
1710 ok(!strcmp_w(security_expectedW, received), "Expected %s but got %s\n",
1712 }
1714 }
1715 if(result) IUri_Release(result);
1716 }
1717 if(uri) IUri_Release(uri);
1718}

Referenced by START_TEST().

◆ test_InternetSecurityMarshalling()

static void test_InternetSecurityMarshalling ( void  )
static

Definition at line 1290 of file sec_mgr.c.

1291{
1293 IUnknown *unk;
1294 IStream *stream;
1295 HRESULT hres;
1296
1297 trace("testing marshalling...\n");
1298
1299 hres = pCoInternetCreateSecurityManager(NULL, &secmgr, 0);
1300 ok(hres == S_OK, "CoInternetCreateSecurityManager failed: %08lx\n", hres);
1301 if(FAILED(hres))
1302 return;
1303
1304 hres = IInternetSecurityManager_QueryInterface(secmgr, &IID_IUnknown, (void**)&unk);
1305 ok(hres == S_OK, "QueryInterface returned: %08lx\n", hres);
1306
1308 ok(hres == S_OK, "CreateStreamOnHGlobal returned: %08lx\n", hres);
1309
1310 hres = CoMarshalInterface(stream, &IID_IInternetSecurityManager, unk, MSHCTX_INPROC, NULL, MSHLFLAGS_NORMAL);
1311 /* Not supported in W98 */
1313 "CoMarshalInterface returned: %08lx\n", hres);
1314
1315 IStream_Release(stream);
1316 IUnknown_Release(unk);
1317 IInternetSecurityManager_Release(secmgr);
1318}
HRESULT WINAPI CreateStreamOnHGlobal(HGLOBAL hGlobal, BOOL delete_on_release, IStream **stream)
HRESULT WINAPI CoMarshalInterface(IStream *stream, REFIID riid, IUnknown *unk, DWORD dest_context, void *pvDestContext, DWORD mshlFlags)
Definition: marshal.c:483
Definition: parse.h:23
#define REGDB_E_IIDNOTREG
Definition: winerror.h:3802

Referenced by START_TEST().

◆ test_polices()

static void test_polices ( void  )
static

Definition at line 630 of file sec_mgr.c.

631{
632 IInternetZoneManager *zonemgr = NULL;
635
636 trace("testing polices...\n");
637
638 hres = pCoInternetCreateSecurityManager(NULL, &secmgr, 0);
639 ok(hres == S_OK, "CoInternetCreateSecurityManager failed: %08lx\n", hres);
640 hres = pCoInternetCreateZoneManager(NULL, &zonemgr, 0);
641 ok(hres == S_OK, "CoInternetCreateZoneManager failed: %08lx\n", hres);
642
643 test_url_action(secmgr, zonemgr, URLACTION_SCRIPT_RUN);
644 test_url_action(secmgr, zonemgr, URLACTION_ACTIVEX_RUN);
645 test_url_action(secmgr, zonemgr, URLACTION_ACTIVEX_OVERRIDE_OBJECT_SAFETY);
646 test_url_action(secmgr, zonemgr, URLACTION_CHANNEL_SOFTDIST_PERMISSIONS);
647 test_url_action(secmgr, zonemgr, 0xdeadbeef);
648
649 test_special_url_action(secmgr, zonemgr, URLACTION_SCRIPT_OVERRIDE_SAFETY);
650 test_special_url_action(secmgr, zonemgr, URLACTION_ACTIVEX_OVERRIDE_SCRIPT_SAFETY);
651
652 test_activex(secmgr);
653
654 IInternetSecurityManager_Release(secmgr);
655 IInternetZoneManager_Release(zonemgr);
656}
static void test_special_url_action(IInternetSecurityManager *secmgr, IInternetZoneManager *zonemgr, DWORD action)
Definition: sec_mgr.c:586
static void test_activex(IInternetSecurityManager *secmgr)
Definition: sec_mgr.c:609
static void test_url_action(IInternetSecurityManager *secmgr, IInternetZoneManager *zonemgr, DWORD action)
Definition: sec_mgr.c:473

Referenced by START_TEST().

◆ test_SecurityManager()

static void test_SecurityManager ( void  )
static

Definition at line 341 of file sec_mgr.c.

342{
343 int i;
345 BYTE buf[512];
348
349 if(!pCoInternetCreateSecurityManager) {
350 return;
351 }
352
353 trace("Testing security manager...\n");
354
355 hres = pCoInternetCreateSecurityManager(NULL, &secmgr, 0);
356 ok(hres == S_OK, "CoInternetCreateSecurityManager failed: %08lx\n", hres);
357 if(FAILED(hres))
358 return;
359
360 for(i = 0; i < ARRAY_SIZE(secmgr_tests); i++) {
361 zone = 100;
362 hres = IInternetSecurityManager_MapUrlToZone(secmgr, secmgr_tests[i].url,
363 &zone, 0);
364 ok(hres == secmgr_tests[i].zone_hres /* IE <=6 */
365 || (FAILED(secmgr_tests[i].zone_hres) && hres == E_INVALIDARG), /* IE7 */
366 "[%d] MapUrlToZone failed: %08lx, expected %08lx\n",
367 i, hres, secmgr_tests[i].zone_hres);
368 if(SUCCEEDED(hres))
369 ok(zone == secmgr_tests[i].zone, "[%d] zone=%ld, expected %ld\n", i, zone,
371 else
372 ok(zone == secmgr_tests[i].zone || zone == -1, "[%d] zone=%ld\n", i, zone);
373
374 size = sizeof(buf);
375 memset(buf, 0xf0, sizeof(buf));
376 hres = IInternetSecurityManager_GetSecurityId(secmgr, secmgr_tests[i].url,
377 buf, &size, 0);
379 "[%d] GetSecurityId failed: %08lx, expected %08lx\n",
381 if(secmgr_tests[i].secid) {
382 ok(size == secmgr_tests[i].secid_size, "[%d] size=%ld, expected %ld\n",
384 ok(!memcmp(buf, secmgr_tests[i].secid, size), "[%d] wrong secid\n", i);
385 }
386 }
387
388 zone = 100;
389 hres = IInternetSecurityManager_MapUrlToZone(secmgr, url10, &zone, 0);
390 ok(hres == S_OK, "MapUrlToZone failed: %08lx, expected S_OK\n", hres);
391 ok(zone == 3, "zone=%ld, expected 3\n", zone);
392
393 /* win2k3 translates %20 into a space */
394 size = sizeof(buf);
395 memset(buf, 0xf0, sizeof(buf));
396 hres = IInternetSecurityManager_GetSecurityId(secmgr, url10, buf, &size, 0);
397 ok(hres == S_OK, "GetSecurityId failed: %08lx, expected S_OK\n", hres);
398 ok(size == sizeof(secid10) ||
399 size == sizeof(secid10_2), /* win2k3 */
400 "size=%ld\n", size);
401 ok(!memcmp(buf, secid10, sizeof(secid10)) ||
402 !memcmp(buf, secid10_2, sizeof(secid10_2)), /* win2k3 */
403 "wrong secid\n");
404
405 zone = 100;
406 hres = IInternetSecurityManager_MapUrlToZone(secmgr, url13, &zone, 0);
407 ok(hres == S_OK, "MapUrlToZone failed: %08lx\n", hres);
408 ok(zone == URLZONE_INVALID || broken(zone == URLZONE_INTERNET), "zone=%ld\n", zone);
409
410 size = sizeof(buf);
411 memset(buf, 0xf0, sizeof(buf));
412 hres = IInternetSecurityManager_GetSecurityId(secmgr, url13, buf, &size, 0);
413 ok(hres == E_INVALIDARG || broken(hres == S_OK), "GetSecurityId failed: %08lx\n", hres);
414
415 zone = 100;
416 hres = IInternetSecurityManager_MapUrlToZone(secmgr, url14, &zone, 0);
417 ok(hres == S_OK, "MapUrlToZone failed: %08lx, expected S_OK\n", hres);
418 ok(zone == URLZONE_INTERNET, "zone=%ld\n", zone);
419
420 size = sizeof(buf);
421 memset(buf, 0xf0, sizeof(buf));
422 hres = IInternetSecurityManager_GetSecurityId(secmgr, url14, buf, &size, 0);
423 ok(hres == S_OK, "GetSecurityId failed: %08lx, expected S_OK\n", hres);
424 ok(size == sizeof(secid14), "size=%ld\n", size);
425 ok(!memcmp(buf, secid14, size), "wrong secid\n");
426
427 zone = 100;
428 hres = IInternetSecurityManager_MapUrlToZone(secmgr, NULL, &zone, 0);
429 ok(hres == E_INVALIDARG, "MapUrlToZone failed: %08lx, expected E_INVALIDARG\n", hres);
430 ok(zone == 100 || zone == -1, "zone=%ld\n", zone);
431
432 size = sizeof(buf);
433 hres = IInternetSecurityManager_GetSecurityId(secmgr, NULL, buf, &size, 0);
435 "GetSecurityId failed: %08lx, expected E_INVALIDARG\n", hres);
436 hres = IInternetSecurityManager_GetSecurityId(secmgr, secmgr_tests[1].url,
437 NULL, &size, 0);
439 "GetSecurityId failed: %08lx, expected E_INVALIDARG\n", hres);
440 hres = IInternetSecurityManager_GetSecurityId(secmgr, secmgr_tests[1].url,
441 buf, NULL, 0);
443 "GetSecurityId failed: %08lx, expected E_INVALIDARG\n", hres);
444
445 hres = IInternetSecurityManager_ProcessUrlAction(secmgr, NULL, URLACTION_SCRIPT_RUN, (BYTE*)&policy,
446 sizeof(WCHAR), NULL, 0, 0, 0);
447 ok(hres == E_INVALIDARG, "ProcessUrlAction failed: %08lx, expected E_INVALIDARG\n", hres);
448
449 IInternetSecurityManager_Release(secmgr);
450}
static const WCHAR url[]
Definition: encode.c:1384
HRESULT secid_hres
Definition: sec_mgr.c:1732
static const WCHAR url14[]
Definition: sec_mgr.c:105
static const BYTE secid10_2[]
Definition: sec_mgr.c:131
static struct secmgr_test secmgr_tests[]
static const BYTE secid14[]
Definition: sec_mgr.c:129
static const WCHAR url13[]
Definition: sec_mgr.c:104
const BYTE * secid
Definition: sec_mgr.c:1730
DWORD secid_size
Definition: sec_mgr.c:1731
static const BYTE secid10[]
Definition: sec_mgr.c:127

Referenced by START_TEST().

◆ test_SecurityManagerEx2()

static void test_SecurityManagerEx2 ( void  )
static

Definition at line 1750 of file sec_mgr.c.

1751{
1752 HRESULT hres;
1753 DWORD i, zone;
1754 BYTE buf[512];
1755 DWORD buf_size = sizeof(buf);
1756 IInternetSecurityManager *sec_mgr;
1758 IUri *uri = NULL;
1759
1760 static const WCHAR domainW[] = {'c','o','m','.','u','k',0};
1761
1762 if(!pCreateUri) {
1763 win_skip("Skipping SecurityManagerEx2, IE is too old\n");
1764 return;
1765 }
1766
1767 trace("Testing SecurityManagerEx2...\n");
1768
1769 hres = pCoInternetCreateSecurityManager(NULL, &sec_mgr, 0);
1770 ok(hres == S_OK, "CoInternetCreateSecurityManager failed: %08lx\n", hres);
1771
1772 hres = IInternetSecurityManager_QueryInterface(sec_mgr, &IID_IInternetSecurityManagerEx2, (void**)&sec_mgr2);
1773 ok(hres == S_OK, "QueryInterface(IID_IInternetSecurityManagerEx2) failed: %08lx\n", hres);
1774
1775 zone = 0xdeadbeef;
1776
1777 hres = IInternetSecurityManagerEx2_MapUrlToZoneEx2(sec_mgr2, NULL, &zone, 0, NULL, NULL);
1778 ok(hres == E_INVALIDARG, "MapUrlToZoneEx2 returned %08lx, expected E_INVALIDARG\n", hres);
1779 ok(zone == URLZONE_INVALID, "zone was %ld\n", zone);
1780
1781 hres = IInternetSecurityManagerEx2_GetSecurityIdEx2(sec_mgr2, NULL, buf, &buf_size, 0);
1782 ok(hres == E_INVALIDARG, "GetSecurityIdEx2 returned %08lx, expected E_INVALIDARG\n", hres);
1783 ok(buf_size == sizeof(buf), "buf_size was %ld\n", buf_size);
1784
1785 hres = pCreateUri(url5, 0, 0, &uri);
1786 ok(hres == S_OK, "CreateUri failed: %08lx\n", hres);
1787
1788 hres = IInternetSecurityManagerEx2_MapUrlToZoneEx2(sec_mgr2, uri, NULL, 0, NULL, NULL);
1789 ok(hres == E_INVALIDARG, "MapToUrlZoneEx2 returned %08lx, expected E_INVALIDARG\n", hres);
1790
1791 buf_size = sizeof(buf);
1792 hres = IInternetSecurityManagerEx2_GetSecurityIdEx2(sec_mgr2, uri, NULL, &buf_size, 0);
1793 ok(hres == E_INVALIDARG || broken(hres == S_OK), "GetSecurityIdEx2 failed: %08lx\n", hres);
1794 ok(buf_size == sizeof(buf), "bug_size was %ld\n", buf_size);
1795
1796 hres = IInternetSecurityManagerEx2_GetSecurityIdEx2(sec_mgr2, uri, buf, NULL, 0);
1797 ok(hres == E_INVALIDARG, "GetSecurityIdEx2 returned %08lx, expected E_INVALIDARG\n", hres);
1798
1799 IUri_Release(uri);
1800
1801 for(i = 0; i < ARRAY_SIZE(sec_mgr_ex2_tests); ++i) {
1802 uri = NULL;
1803 zone = URLZONE_INVALID;
1804
1806 ok(hres == S_OK, "CreateUri returned %08lx for '%s'\n", hres, wine_dbgstr_w(sec_mgr_ex2_tests[i].uri));
1807
1808 hres = IInternetSecurityManagerEx2_MapUrlToZoneEx2(sec_mgr2, uri, &zone, 0, NULL, NULL);
1810 ok(hres == sec_mgr_ex2_tests[i].map_hres, "MapUrlToZoneEx2 returned %08lx, expected %08lx for '%s'\n",
1812 ok(zone == sec_mgr_ex2_tests[i].zone, "Expected zone %ld, but got %ld for '%s'\n", sec_mgr_ex2_tests[i].zone,
1814 }
1815
1816 buf_size = sizeof(buf);
1817 memset(buf, 0xf0, buf_size);
1818
1819 hres = IInternetSecurityManagerEx2_GetSecurityIdEx2(sec_mgr2, uri, buf, &buf_size, 0);
1821 ok(hres == sec_mgr_ex2_tests[i].secid_hres, "GetSecurityIdEx2 returned %08lx, expected %08lx on test '%s'\n",
1824 ok(buf_size == sec_mgr_ex2_tests[i].secid_size, "Got wrong security id size=%ld, expected %ld on test '%s'\n",
1826 ok(!memcmp(buf, sec_mgr_ex2_tests[i].secid, sec_mgr_ex2_tests[i].secid_size), "Got wrong security id on test '%s'\n",
1828 }
1829 }
1830
1831 IUri_Release(uri);
1832 }
1833
1834 hres = pCreateUri(url15, 0, 0, &uri);
1835 ok(hres == S_OK, "CreateUri failed: %08lx\n", hres);
1836
1837 buf_size = sizeof(buf);
1838 memset(buf, 0xf0, buf_size);
1839
1840 hres = IInternetSecurityManagerEx2_GetSecurityIdEx2(sec_mgr2, uri, buf, &buf_size, (DWORD_PTR)domainW);
1841 ok(hres == S_OK, "GetSecurityIdEx2 failed: %08lx\n", hres);
1842 todo_wine ok(buf_size == sizeof(secid13), "buf_size was %ld\n", buf_size);
1843 todo_wine ok(!memcmp(buf, secid13, sizeof(secid13)), "Got wrong secid\n");
1844
1845 buf_size = sizeof(buf);
1846 memset(buf, 0xf0, buf_size);
1847
1848 hres = IInternetSecurityManagerEx2_GetSecurityIdEx2(sec_mgr2, uri, buf, &buf_size, 0);
1849 ok(hres == S_OK, "GetSecurityIdEx2 failed: %08lx\n", hres);
1850 ok(buf_size == sizeof(secid13_2), "buf_size was %ld\n", buf_size);
1851 ok(!memcmp(buf, secid13_2, sizeof(secid13_2)), "Got wrong secid\n");
1852
1853 IUri_Release(uri);
1854
1855 IInternetSecurityManagerEx2_Release(sec_mgr2);
1856 IInternetSecurityManager_Release(sec_mgr);
1857}
static const WCHAR url15[]
Definition: sec_mgr.c:106
BOOL secid_todo
Definition: sec_mgr.c:1733
HRESULT map_hres
Definition: sec_mgr.c:1727
BOOL map_todo
Definition: sec_mgr.c:1729
static const struct @1884 sec_mgr_ex2_tests[]
static const BYTE secid13[]
Definition: sec_mgr.c:133
static const BYTE secid13_2[]
Definition: sec_mgr.c:134
uint32_t DWORD_PTR
Definition: typedefs.h:65

Referenced by START_TEST().

◆ test_SetZoneAttributes()

static void test_SetZoneAttributes ( void  )
static

Definition at line 1213 of file sec_mgr.c.

1214{
1215 IInternetZoneManager *zonemgr = NULL;
1216 CHAR buffer [sizeof(ZONEATTRIBUTES) + 16];
1217 ZONEATTRIBUTES* pZA = (ZONEATTRIBUTES*) buffer;
1218 CHAR regpath[MAX_PATH];
1219 HKEY hkey;
1220 HRESULT hr;
1221 DWORD res;
1222
1223 trace("testing SetZoneAttributes...\n");
1224 hr = pCoInternetCreateZoneManager(NULL, &zonemgr, 0);
1225 ok(hr == S_OK, "CoInternetCreateZoneManager result: 0x%lx\n", hr);
1226 if (FAILED(hr))
1227 return;
1228
1229 memset(buffer, -1, sizeof(buffer));
1230 hr = IInternetZoneManager_GetZoneAttributes(zonemgr, URLZONE_LOCAL_MACHINE, pZA);
1231 ok(hr == S_OK, "got 0x%lx (expected S_OK)\n", hr);
1232
1233 sprintf(regpath, "%s\\Zones\\%d", szInternetSettingsKey, URLZONE_CUSTOM);
1234 res = RegCreateKeyA(HKEY_CURRENT_USER, regpath, &hkey);
1235 RegCloseKey(hkey);
1236
1237 ok(res == ERROR_SUCCESS, "got %ld (expected ERROR_SUCCESS)\n", res);
1238 if (res != ERROR_SUCCESS)
1239 goto cleanup;
1240
1241 pZA->cbSize = sizeof(ZONEATTRIBUTES);
1242 hr = IInternetZoneManager_SetZoneAttributes(zonemgr, URLZONE_CUSTOM, NULL);
1243 ok(hr == E_INVALIDARG, "got 0x%lx (expected E_INVALIDARG)\n", hr);
1244
1245 /* normal use */
1246 hr = IInternetZoneManager_SetZoneAttributes(zonemgr, URLZONE_CUSTOM, pZA);
1247 if (hr == E_FAIL) {
1248 win_skip("SetZoneAttributes not supported: IE too old\n");
1249 goto cleanup;
1250 }
1251 ok(hr == S_OK, "got 0x%lx (expected S_OK)\n", hr);
1252
1253 /* native urlmon ignores cbSize */
1254 pZA->cbSize = sizeof(ZONEATTRIBUTES) + sizeof(DWORD);
1255 hr = IInternetZoneManager_SetZoneAttributes(zonemgr, URLZONE_CUSTOM, pZA);
1256 ok(hr == S_OK, "got 0x%lx for sizeof(ZONEATTRIBUTES) + sizeof(DWORD) (expected S_OK)\n", hr);
1257
1258 pZA->cbSize = sizeof(ZONEATTRIBUTES) - sizeof(DWORD);
1259 hr = IInternetZoneManager_SetZoneAttributes(zonemgr, URLZONE_CUSTOM, pZA);
1260 ok(hr == S_OK, "got 0x%lx for sizeof(ZONEATTRIBUTES) - sizeof(DWORD) (expected S_OK)\n", hr);
1261
1262 pZA->cbSize = 0;
1263 hr = IInternetZoneManager_SetZoneAttributes(zonemgr, URLZONE_CUSTOM, pZA);
1264 ok(hr == S_OK, "got 0x%lx for size 0 (expected S_OK)\n", hr);
1265
1266 /* The key for the zone must be present, when calling SetZoneAttributes */
1268 /* E_FAIL is returned from IE6 here, which is reasonable.
1269 All newer IE return S_OK without saving the zone attributes to the registry.
1270 This is a Windows bug, but we have to accept that as standard */
1271 hr = IInternetZoneManager_SetZoneAttributes(zonemgr, URLZONE_CUSTOM, pZA);
1272 ok((hr == S_OK) || broken(hr == E_FAIL), "got 0x%lx (expected S_OK)\n", hr);
1273
1274 /* SetZoneAttributes did not create the directory */
1275 res = RegOpenKeyA(HKEY_CURRENT_USER, regpath, &hkey);
1276 ok((res == ERROR_FILE_NOT_FOUND) && (hkey == NULL),
1277 "got %lu with %p (expected ERROR_FILE_NOT_FOUND with NULL)\n", res, hkey);
1278
1279 if (hkey) RegCloseKey(hkey);
1280
1281cleanup:
1282 /* delete zone settings in the registry */
1284
1285 hr = IInternetZoneManager_Release(zonemgr);
1286 ok(hr == S_OK, "got 0x%lx (expected S_OK)\n", hr);
1287}
static const char * szInternetSettingsKey
Definition: sec_mgr.c:118

Referenced by START_TEST().

◆ test_special_url_action()

static void test_special_url_action ( IInternetSecurityManager secmgr,
IInternetZoneManager zonemgr,
DWORD  action 
)
static

Definition at line 586 of file sec_mgr.c.

587{
590
591 policy = 0xdeadbeef;
592 hres = IInternetZoneManager_GetZoneActionPolicy(zonemgr, 3, action, (BYTE*)&policy,
593 sizeof(DWORD), URLZONEREG_DEFAULT);
594 ok(hres == S_OK, "GetZoneActionPolicy failed: %08lx\n", hres);
595 ok(policy == URLPOLICY_DISALLOW, "(%lx) policy=%lx, expected URLPOLICY_DISALLOW\n", action, policy);
596
597 policy = 0xdeadbeef;
598 hres = IInternetSecurityManager_ProcessUrlAction(secmgr, url1, action, (BYTE*)&policy,
599 sizeof(WCHAR), NULL, 0, 0, 0);
600 ok(hres == S_FALSE, "ProcessUrlAction(%lx) failed: %08lx, expected S_FALSE\n", action, hres);
601
602 policy = 0xdeadbeef;
603 hres = IInternetSecurityManager_ProcessUrlAction(secmgr, url1, action, (BYTE*)&policy,
604 sizeof(DWORD), NULL, 0, 0, 0);
605 ok(hres == S_FALSE, "ProcessUrlAction(%lx) failed: %08lx, expected S_FALSE\n", action, hres);
606 ok(policy == URLPOLICY_DISALLOW, "policy = %lx\n", policy);
607}

Referenced by test_polices().

◆ test_url_action()

static void test_url_action ( IInternetSecurityManager secmgr,
IInternetZoneManager zonemgr,
DWORD  action 
)
static

Definition at line 473 of file sec_mgr.c.

474{
475 DWORD res, size, policy, reg_policy;
476 char buf[10];
477 HKEY hkey;
479
480 /* FIXME: HKEY_CURRENT_USER is most of the time the default but this can be changed on a system.
481 * The test should be changed to cope with that, if need be.
482 */
484 "Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\Zones\\3", &hkey);
485 ok(res == ERROR_SUCCESS, "Could not open zone key\n");
486 if(res != ERROR_SUCCESS)
487 return;
488
489 wsprintfA(buf, "%X", action);
490 size = sizeof(DWORD);
491 res = RegQueryValueExA(hkey, buf, NULL, NULL, (BYTE*)&reg_policy, &size);
492 RegCloseKey(hkey);
493
494 /* Try settings from HKEY_LOCAL_MACHINE. */
495 if(res != ERROR_SUCCESS || size != sizeof(DWORD)) {
497 "Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\Zones\\3", &hkey);
498 ok(res == ERROR_SUCCESS, "Could not open zone key\n");
499
500 size = sizeof(DWORD);
501 res = RegQueryValueExA(hkey, buf, NULL, NULL, (BYTE*)&reg_policy, &size);
502 RegCloseKey(hkey);
503 }
504
505 if(res != ERROR_SUCCESS || size != sizeof(DWORD)) {
506 policy = 0xdeadbeef;
507 hres = IInternetSecurityManager_ProcessUrlAction(secmgr, url9, action, (BYTE*)&policy,
508 sizeof(WCHAR), NULL, 0, 0, 0);
510 "(0x%lx) got 0x%lx (expected E_FAIL)\n", action, hres);
511 ok(policy == 0xdeadbeef, "(%lx) policy=%lx\n", action, policy);
512
513 policy = 0xdeadbeef;
514 hres = IInternetZoneManager_GetZoneActionPolicy(zonemgr, 3, action, (BYTE*)&policy,
515 sizeof(DWORD), URLZONEREG_DEFAULT);
517 "(0x%lx) got 0x%lx (expected E_FAIL)\n", action, hres);
518 ok(policy == 0xdeadbeef, "(%lx) policy=%lx\n", action, policy);
519 return;
520 }
521
522 policy = 0xdeadbeef;
523 hres = IInternetZoneManager_GetZoneActionPolicy(zonemgr, 3, action, (BYTE*)&policy,
524 sizeof(DWORD), URLZONEREG_DEFAULT);
525 ok(hres == S_OK, "GetZoneActionPolicy failed: %08lx\n", hres);
526 ok(policy == reg_policy, "(%lx) policy=%lx, expected %lx\n", action, policy, reg_policy);
527
528 if(policy != URLPOLICY_QUERY) {
530 BOOL expect_parse_call = !called_securl_http;
531
532 policy = 0xdeadbeef;
533 hres = IInternetSecurityManager_ProcessUrlAction(secmgr, url9, action, (BYTE*)&policy,
534 sizeof(WCHAR), NULL, 0, 0, 0);
535 if(reg_policy == URLPOLICY_DISALLOW)
536 ok(hres == S_FALSE, "ProcessUrlAction(%lx) failed: %08lx, expected S_FALSE\n", action, hres);
537 else
538 ok(hres == S_OK, "ProcessUrlAction(%lx) failed: %08lx\n", action, hres);
539 ok(policy == 0xdeadbeef, "(%lx) policy=%lx\n", action, policy);
540
541 policy = 0xdeadbeef;
542 hres = IInternetSecurityManager_ProcessUrlAction(secmgr, url9, action, (BYTE*)&policy,
543 2, NULL, 0, 0, 0);
544 if(reg_policy == URLPOLICY_DISALLOW)
545 ok(hres == S_FALSE, "ProcessUrlAction(%lx) failed: %08lx, expected S_FALSE\n", action, hres);
546 else
547 ok(hres == S_OK, "ProcessUrlAction(%lx) failed: %08lx\n", action, hres);
548 ok(policy == 0xdeadbeef, "(%lx) policy=%lx\n", action, policy);
549
550 policy = 0xdeadbeef;
551 hres = IInternetSecurityManager_ProcessUrlAction(secmgr, url9, action, (BYTE*)&policy,
552 sizeof(DWORD), NULL, 0, 0, 0);
553 if(reg_policy == URLPOLICY_DISALLOW)
554 ok(hres == S_FALSE, "ProcessUrlAction(%lx) failed: %08lx, expected S_FALSE\n", action, hres);
555 else
556 ok(hres == S_OK, "ProcessUrlAction(%lx) failed: %08lx\n", action, hres);
557 ok(policy == reg_policy, "(%lx) policy=%lx\n", action, policy);
558
559 policy = 0xdeadbeef;
560 hres = IInternetSecurityManager_ProcessUrlAction(secmgr, url9, action, (BYTE*)&policy,
561 sizeof(WCHAR), (BYTE*)0xdeadbeef, 16, 0, 0);
562 if(reg_policy == URLPOLICY_DISALLOW)
563 ok(hres == S_FALSE, "ProcessUrlAction(%lx) failed: %08lx, expected S_FALSE\n", action, hres);
564 else
565 ok(hres == S_OK, "ProcessUrlAction(%lx) failed: %08lx\n", action, hres);
566 ok(policy == 0xdeadbeef, "(%lx) policy=%lx\n", action, policy);
567
568 policy = 0xdeadbeef;
569 if(expect_parse_call)
570 SET_EXPECT(ParseUrl_SECURITY_URL_http);
571 hres = IInternetSecurityManager_ProcessUrlAction(secmgr, winetest_to_httpW, action, (BYTE*)&policy,
572 sizeof(DWORD), NULL, 0, 0, 0);
573 if(expect_parse_call)
574 CHECK_CALLED(ParseUrl_SECURITY_URL_http);
575 if(reg_policy == URLPOLICY_DISALLOW)
576 ok(hres == S_FALSE, "ProcessUrlAction(%lx) failed: %08lx, expected S_FALSE\n", action, hres);
577 else
578 ok(hres == S_OK, "ProcessUrlAction(%lx) failed: %08lx\n", action, hres);
579 ok(policy == reg_policy, "(%lx) policy=%lx\n", action, policy);
580 }else {
581 skip("IE running in Enhanced Security Configuration\n");
582 }
583 }
584}
int winetest_interactive
static BOOL is_ie_hardened(void)
Definition: sec_mgr.c:454
int WINAPIV wsprintfA(_Out_ LPSTR, _In_ _Printf_format_string_ LPCSTR,...)

Referenced by test_polices().

◆ test_zone_domain_cache()

static void test_zone_domain_cache ( void  )
static

Definition at line 662 of file sec_mgr.c.

663{
665 DWORD res, zone;
667 HKEY domains, domain;
668
669 static const WCHAR testing_domain_urlW[] = {'h','t','t','p',':','/','/','t','e','s','t','i','n','g','.',
670 'd','o','m','a','i','n','/',0};
671
673 ok(res == ERROR_SUCCESS, "RegOpenKey failed: %ld\n", res);
674 if(res != ERROR_SUCCESS)
675 return;
676
677 res = RegCreateKeyA(domains, "testing.domain", &domain);
678 ok(res == ERROR_SUCCESS, "RegCreateKey failed: %ld\n", res);
679 if(res != ERROR_SUCCESS) {
680 RegCloseKey(domains);
681 return;
682 }
683
685 res = RegSetValueExA(domain, "http", 0, REG_DWORD, (BYTE*)&zone, sizeof(DWORD));
686 ok(res == ERROR_SUCCESS, "RegSetValueEx failed: %ld\n", res);
687
689
690 hres = pCoInternetCreateSecurityManager(NULL, &secmgr, 0);
691 ok(hres == S_OK, "CoInternetCreateSecurityManager failed: %08lx\n", hres);
692
693 zone = URLZONE_INVALID;
694 hres = IInternetSecurityManager_MapUrlToZone(secmgr, testing_domain_urlW, &zone, 0);
695 ok(hres == S_OK, "MapUrlToZone failed: %08lx\n", hres);
696 todo_wine ok(zone == URLZONE_INTERNET, "Got %ld, expected URLZONE_INTERNET\n", zone);
697
698 /* FIXME: Play nice with ZoneMaps that existed before the test is run. */
699 res = RegDeleteKeyA(domains, "testing.domain");
700 ok(res == ERROR_SUCCESS, "RegDeleteKey failed: %ld\n", res);
701
702 RegCloseKey(domains);
703 IInternetSecurityManager_Release(secmgr);
704}

Referenced by test_zone_domains().

◆ test_zone_domain_mappings()

static void test_zone_domain_mappings ( void  )
static

Definition at line 890 of file sec_mgr.c.

891{
893 DWORD i, res;
895 HKEY domains;
896 DWORD zone = URLZONE_INVALID;
897
898 trace("testing zone domain mappings...\n");
899
900 hres = pCoInternetCreateSecurityManager(NULL, &secmgr, 0);
901 ok(hres == S_OK, "CoInternetCreateSecurityManager failed: %08lx\n", hres);
902
904 if(res == ERROR_SUCCESS) {
905 static const WCHAR local_machineW[] = {'h','t','t','p',':','/','/','t','e','s','t','.','l','o','c','a','l',
906 '.','m','a','c','h','i','n','e','/',0};
907
908 hres = IInternetSecurityManager_MapUrlToZone(secmgr, local_machineW, &zone, 0);
909 ok(hres == S_OK, "MapUrlToZone failed: %08lx\n", hres);
910 ok(zone == URLZONE_CUSTOM, "Expected URLZONE_CUSTOM, but got %ld\n", zone);
911
912 RegCloseKey(domains);
913 }
914
915 for(i = 0; i < ARRAY_SIZE(zone_mapping_tests); ++i) {
917 zone = URLZONE_INVALID;
918
919 hres = IInternetSecurityManager_MapUrlToZone(secmgr, test->url, &zone, 0);
920 ok(hres == S_OK, "MapUrlToZone failed: %08lx\n", hres);
921 todo_wine_if (test->todo)
922 ok(zone == test->zone || broken(test->broken_zone == zone),
923 "Expected %ld, but got %ld on test %ld\n", test->zone, zone, i);
924 }
925
926 IInternetSecurityManager_Release(secmgr);
927}
BOOLEAN Expected
GLdouble n
Definition: glext.h:7729
static const zone_mapping_test zone_mapping_tests[]
Definition: sec_mgr.c:859

Referenced by START_TEST().

◆ test_zone_domains()

static void test_zone_domains ( void  )
static

Definition at line 929 of file sec_mgr.c.

930{
931 if(is_ie_hardened()) {
932 skip("IE running in Enhanced Security Configuration\n");
933 return;
934 } else if(!pCreateUri) {
935 win_skip("Skipping zone domain tests, IE too old\n");
936 return;
937 }
938
939 trace("testing zone domains...\n");
940
942
943 if (!register_zone_domains()) return;
946}
static void test_zone_domain_cache(void)
Definition: sec_mgr.c:662
static BOOL register_zone_domains(void)
Definition: sec_mgr.c:733
static void run_child_process(void)
Definition: sec_mgr.c:831
static void unregister_zone_domains(void)
Definition: sec_mgr.c:794

Referenced by START_TEST().

◆ unregister_protocols()

static void unregister_protocols ( void  )
static

Definition at line 1548 of file sec_mgr.c.

1548 {
1550 HRESULT hr;
1551
1552 hr = pCoInternetGetSession(0, &session, 0);
1553 ok(hr == S_OK, "CoInternetGetSession failed: 0x%08lx\n", hr);
1554 if(FAILED(hr))
1555 return;
1556
1557 hr = IInternetSession_UnregisterNameSpace(session, &protocol_cf, winetestW);
1558 ok(hr == S_OK, "UnregisterNameSpace failed: 0x%08lx\n", hr);
1559
1560 IInternetSession_Release(session);
1561}

Referenced by START_TEST().

◆ unregister_zone_domains()

static void unregister_zone_domains ( void  )
static

Definition at line 794 of file sec_mgr.c.

795{
796 HKEY domains;
797 DWORD res, i;
798
800 ok(res == ERROR_SUCCESS || broken(res == ERROR_FILE_NOT_FOUND), "RegOpenKey failed: %ld\n", res);
801 if(res == ERROR_SUCCESS) {
802 RegDeleteKeyA(domains, "local.machine");
803 RegCloseKey(domains);
804 }
805
807 ok(res == ERROR_SUCCESS, "RegOpenKey failed: %ld\n", res);
808
809 for(i = 0; i < ARRAY_SIZE(zone_domain_mappings); ++i) {
811
812 /* FIXME: Uses the "cludge" approach to remove the test data from the registry!
813 * Although, if domain names are... unique, this shouldn't cause any harm
814 * to keys (if any) that existed before the tests.
815 */
816 if(test->subdomain) {
817 HKEY domain;
818
819 res = RegOpenKeyA(domains, test->domain, &domain);
820 if(res == ERROR_SUCCESS) {
821 RegDeleteKeyA(domain, test->subdomain);
823 }
824 }
825 RegDeleteKeyA(domains, test->domain);
826 }
827
828 RegCloseKey(domains);
829}

Referenced by test_zone_domains().

Variable Documentation

◆ called_securl_http

int called_securl_http
static

Definition at line 143 of file sec_mgr.c.

Referenced by InternetProtocolInfo_ParseUrl(), and test_url_action().

◆ ClassFactoryVtbl

const IClassFactoryVtbl ClassFactoryVtbl
static
Initial value:
= {
}
static HRESULT WINAPI ClassFactory_LockServer(IClassFactory *iface, BOOL dolock)
Definition: sec_mgr.c:1515
static HRESULT WINAPI ClassFactory_CreateInstance(IClassFactory *iface, IUnknown *pOuter, REFIID riid, void **ppv)
Definition: sec_mgr.c:1508
static ULONG WINAPI ClassFactory_Release(IClassFactory *iface)
Definition: sec_mgr.c:1503
static HRESULT WINAPI ClassFactory_QueryInterface(IClassFactory *iface, REFIID riid, void **ppv)
Definition: sec_mgr.c:1487
static ULONG WINAPI ClassFactory_AddRef(IClassFactory *iface)
Definition: sec_mgr.c:1498

Definition at line 1521 of file sec_mgr.c.

◆ CLSID_TestActiveX

const GUID CLSID_TestActiveX
static
Initial value:
=
{0x178fc163,0xf585,0x4e24,{0x9c,0x13,0x4b,0xb7,0xfa,0xf8,0x06,0x46}}

Definition at line 136 of file sec_mgr.c.

Referenced by test_activex().

◆ create_flags

◆ default_hres

HRESULT default_hres

Definition at line 1569 of file sec_mgr.c.

Referenced by test_InternetGetSecurityUrlEx().

◆ default_uri

const WCHAR* default_uri

Definition at line 1568 of file sec_mgr.c.

Referenced by test_InternetGetSecurityUrlEx().

◆ DWORD

◆ DWORD_PTR

Definition at line 79 of file sec_mgr.c.

◆ GUID_CUSTOM_CONFIRMOBJECTSAFETY

const GUID GUID_CUSTOM_CONFIRMOBJECTSAFETY
Initial value:
=
{0x10200490,0xfa38,0x11d0,{0xac,0x0e,0x00,0xa0,0xc9,0xf,0xff,0xc0}}

Definition at line 140 of file sec_mgr.c.

Referenced by test_activex().

◆ InternetProtocolInfoVtbl

const IInternetProtocolInfoVtbl InternetProtocolInfoVtbl
static
Initial value:
= {
}
static HRESULT WINAPI InternetProtocolInfo_QueryInfo(IInternetProtocolInfo *iface, LPCWSTR pwzUrl, QUERYOPTION OueryOption, DWORD dwQueryFlags, LPVOID pBuffer, DWORD cbBuffer, DWORD *pcbBuf, DWORD dwReserved)
Definition: sec_mgr.c:1467
static HRESULT WINAPI InternetProtocolInfo_CompareUrl(IInternetProtocolInfo *iface, LPCWSTR pwzUrl1, LPCWSTR pwzUrl2, DWORD dwCompareFlags)
Definition: sec_mgr.c:1460
static HRESULT WINAPI InternetProtocolInfo_CombineUrl(IInternetProtocolInfo *iface, LPCWSTR pwzBaseUrl, LPCWSTR pwzRelativeUrl, DWORD dwCombineFlags, LPWSTR pwzResult, DWORD cchResult, DWORD *pcchResult, DWORD dwReserved)
Definition: sec_mgr.c:1452
static ULONG WINAPI InternetProtocolInfo_AddRef(IInternetProtocolInfo *iface)
Definition: sec_mgr.c:1377
static ULONG WINAPI InternetProtocolInfo_Release(IInternetProtocolInfo *iface)
Definition: sec_mgr.c:1382
static HRESULT WINAPI InternetProtocolInfo_QueryInterface(IInternetProtocolInfo *iface, REFIID riid, void **ppv)
Definition: sec_mgr.c:1370
static HRESULT WINAPI InternetProtocolInfo_ParseUrl(IInternetProtocolInfo *iface, LPCWSTR pwzUrl, PARSEACTION ParseAction, DWORD dwParseFlags, LPWSTR pwzResult, DWORD cchResult, DWORD *pcchResult, DWORD dwReserved)
Definition: sec_mgr.c:1387

Definition at line 1475 of file sec_mgr.c.

◆ LPCWSTR

Definition at line 83 of file sec_mgr.c.

◆ map_hres

HRESULT map_hres

Definition at line 1727 of file sec_mgr.c.

Referenced by test_SecurityManagerEx2().

◆ map_todo

BOOL map_todo

Definition at line 1729 of file sec_mgr.c.

Referenced by test_SecurityManagerEx2().

◆ ProcessUrlAction_policy

DWORD ProcessUrlAction_policy
static

◆ protocol_cf

IClassFactory protocol_cf = { &ClassFactoryVtbl }
static

Definition at line 1529 of file sec_mgr.c.

Referenced by register_protocols(), and unregister_protocols().

◆ protocol_info

IInternetProtocolInfo protocol_info = { &InternetProtocolInfoVtbl }
static

Definition at line 1485 of file sec_mgr.c.

◆ PSUACTION

IUri PSUACTION

Definition at line 78 of file sec_mgr.c.

◆ 

const struct { ... } sec_mgr_ex2_tests[]
Initial value:
= {
{L"res://mshtml.dll/blank.htm", 0, S_OK, URLZONE_LOCAL_MACHINE, FALSE, secid1, sizeof(secid1), S_OK},
{L"index.htm", Uri_CREATE_ALLOW_RELATIVE, 0, URLZONE_INTERNET, FALSE, secid2, sizeof(secid2), S_OK},
{L"file://c:\\Index.html", 0, 0, URLZONE_LOCAL_MACHINE, FALSE, secid1, sizeof(secid1), S_OK},
{L"http://www.zone3.winetest/", 0, 0, URLZONE_INTERNET, FALSE, secid5, sizeof(secid5), S_OK},
{L"about:blank", 0, 0, URLZONE_INTERNET, FALSE, secid6, sizeof(secid6), S_OK},
{L"ftp://zone3.winetest/file.test", 0, 0, URLZONE_INTERNET, FALSE, secid7, sizeof(secid7), S_OK},
{L"/file/testing/test.test", Uri_CREATE_ALLOW_RELATIVE, 0, URLZONE_INTERNET, FALSE, NULL, 0, E_INVALIDARG},
{L"zip://testing.com/", 0, 0, URLZONE_INTERNET, FALSE, secidex2_1, sizeof(secidex2_1), S_OK},
{L"zip:testing.com", 0, 0, URLZONE_INTERNET, FALSE, secidex2_2, sizeof(secidex2_2), S_OK},
{L"http:google.com", 0, S_OK, URLZONE_INVALID, FALSE, NULL, 0, E_INVALIDARG},
{L"http:/google.com", 0, S_OK, URLZONE_INVALID, FALSE, NULL, 0, E_INVALIDARG},
{L"*:/testing", 0, S_OK, URLZONE_INTERNET, FALSE, NULL, 0, E_INVALIDARG},
{L"*://testing.com", 0, S_OK, URLZONE_INTERNET, FALSE, secidex2_3, sizeof(secidex2_3), S_OK}
}
static const BYTE secid5[]
Definition: sec_mgr.c:122
static const BYTE secid7[]
Definition: sec_mgr.c:125
static const BYTE secidex2_1[]
Definition: sec_mgr.c:1720
static const BYTE secidex2_2[]
Definition: sec_mgr.c:1721
static const BYTE secid2[]
Definition: sec_mgr.c:121
static const BYTE secidex2_3[]
Definition: sec_mgr.c:1722
static const BYTE secid1[]
Definition: sec_mgr.c:120
static const BYTE secid6[]
Definition: sec_mgr.c:124

Referenced by test_SecurityManagerEx2().

◆ 

const struct { ... } sec_url_ex_tests[]
Initial value:
= {
{L"index.htm", Uri_CREATE_ALLOW_RELATIVE, "*:index.html", S_OK, L"*:index.htm", S_OK},
{L"file://c:\\Index.htm", Uri_CREATE_FILE_USE_DOS_PATH, "file:///c:/Index.htm", S_OK, L"file:///c:/Index.htm", S_OK},
{L"file:some%20file%2ejpg", 0, NULL, E_INVALIDARG, NULL, E_INVALIDARG},
{L"file:some file.jpg", 0, NULL, E_INVALIDARG, NULL, E_INVALIDARG},
{L"http://www.zone3.winetest/", 0, "http://www.zone3.winetest/", S_OK, L"http://www.zone3.winetest/", S_OK},
{L"about:blank", 0, "about:blank", S_OK, L"about:blank", S_OK},
{L"ftp://zone3.winetest/file.test", 0, "ftp://zone3.winetest/file.test", S_OK, L"ftp://zone3.winetest/file.test", S_OK},
{L"test:123abc", 0, "test:123abc", S_OK, L"test:123abc", S_OK},
{L"http:google.com/test.file", 0, "http:google.com/test.file", S_OK, L"http:google.com/test.file", S_OK},
{L"ftp://test@ftp.winehq.org/", 0, "ftp://ftp.winehq.org/", S_OK, L"ftp://ftp.winehq.org/", S_OK},
{L"test://google@ftp.winehq.org/", 0, "test://google@ftp.winehq.org/", S_OK, L"test://google@ftp.winehq.org/", S_OK}
}

Referenced by test_InternetGetSecurityUrlEx().

◆ secid

◆ secid1

const BYTE secid1[] = {'f','i','l','e',':',0,0,0,0}
static

Definition at line 120 of file sec_mgr.c.

Referenced by CompareSecurityIds().

◆ secid10

const BYTE secid10[]
static
Initial value:
=
{'f','i','l','e',':','s','o','m','e','%','2','0','f','i','l','e','.','j','p','g',3,0,0,0}

Definition at line 127 of file sec_mgr.c.

Referenced by test_SecurityManager().

◆ secid10_2

const BYTE secid10_2[]
static
Initial value:
=
{'f','i','l','e',':','s','o','m','e',' ','f','i','l','e','.','j','p','g',3,0,0,0}

Definition at line 131 of file sec_mgr.c.

Referenced by test_SecurityManager().

◆ secid13

const BYTE secid13[] = {'h','t','t','p',':','c','o','m','.','u','k',3,0,0,0}
static

Definition at line 133 of file sec_mgr.c.

Referenced by test_SecurityManagerEx2().

◆ secid13_2

const BYTE secid13_2[] = {'h','t','t','p',':','g','o','o','g','l','e','.','c','o','m','.','u','k',3,0,0,0}
static

Definition at line 134 of file sec_mgr.c.

Referenced by test_SecurityManagerEx2().

◆ secid14

const BYTE secid14[]
static
Initial value:
=
{'z','i','p',':','t','e','s','t','i','n','g','.','c','o','m','/','t','e','s','t','i','n','g',3,0,0,0}

Definition at line 129 of file sec_mgr.c.

Referenced by test_SecurityManager().

◆ secid2

const BYTE secid2[] = {'*',':','i','n','d','e','x','.','h','t','m',3,0,0,0}
static

Definition at line 121 of file sec_mgr.c.

Referenced by CompareSecurityIds().

◆ secid5

const BYTE secid5[]
static
Initial value:
= {'h','t','t','p',':','w','w','w','.','z','o','n','e','3',
'.','w','i','n','e','t','e','s','t',3,0,0,0}

Definition at line 122 of file sec_mgr.c.

◆ secid6

const BYTE secid6[] = {'a','b','o','u','t',':','b','l','a','n','k',3,0,0,0}
static

Definition at line 124 of file sec_mgr.c.

◆ secid7

const BYTE secid7[]
static
Initial value:
= {'f','t','p',':','z','o','n','e','3',
'.','w','i','n','e','t','e','s','t',3,0,0,0}

Definition at line 125 of file sec_mgr.c.

◆ secid_hres

HRESULT secid_hres

Definition at line 1732 of file sec_mgr.c.

Referenced by test_SecurityManager(), and test_SecurityManagerEx2().

◆ secid_size

DWORD secid_size

Definition at line 1731 of file sec_mgr.c.

Referenced by test_SecurityManager(), and test_SecurityManagerEx2().

◆ secid_todo

BOOL secid_todo

Definition at line 1733 of file sec_mgr.c.

Referenced by test_SecurityManagerEx2().

◆ secidex2_1

const BYTE secidex2_1[] = {'z','i','p',':','/','/','t','e','s','t','i','n','g','.','c','o','m','/',3,0,0,0}
static

Definition at line 1720 of file sec_mgr.c.

◆ secidex2_2

const BYTE secidex2_2[] = {'z','i','p',':','t','e','s','t','i','n','g','.','c','o','m',3,0,0,0}
static

Definition at line 1721 of file sec_mgr.c.

◆ secidex2_3

const BYTE secidex2_3[] = {'*',':','t','e','s','t','i','n','g','.','c','o','m',3,0,0,0}
static

Definition at line 1722 of file sec_mgr.c.

◆ secmgr_tests

struct secmgr_test secmgr_tests[]
static
Initial value:
= {
{url1, 0, S_OK, sizeof(secid1), secid1, S_OK},
{url2, 100, 0x80041001, 0, NULL, E_INVALIDARG},
{url3, 0, S_OK, sizeof(secid1), secid1, S_OK},
{url5, 3, S_OK, sizeof(secid5), secid5, S_OK},
{url6, 3, S_OK, sizeof(secid6), secid6, S_OK},
{url7, 3, S_OK, sizeof(secid7), secid7, S_OK},
{url11,0, S_OK, sizeof(secid1), secid1, S_OK},
{url12,0, S_OK, sizeof(secid1), secid1, S_OK},
{url16,0, S_OK, sizeof(secid1), secid1, S_OK},
{url17,0, S_OK, sizeof(secid1), secid1, S_OK},
{url18,0, S_OK, sizeof(secid1), secid1, S_OK}
}
static const WCHAR url6[]
Definition: sec_mgr.c:94
static const WCHAR url11[]
Definition: sec_mgr.c:102
static const WCHAR url16[]
Definition: sec_mgr.c:107
static const WCHAR url17[]
Definition: sec_mgr.c:108
static const WCHAR url12[]
Definition: sec_mgr.c:103
static const WCHAR url18[]
Definition: sec_mgr.c:109

Referenced by test_SecurityManager().

◆ security_expectedW

const WCHAR security_expectedW[] = {'w','i','n','e','t','e','s','t',':','z','i','p',0}
static

◆ security_hres

HRESULT security_hres

Definition at line 1567 of file sec_mgr.c.

◆ security_manager

IInternetSecurityManager security_manager = { &SecurityManagerVtbl }
static

Definition at line 339 of file sec_mgr.c.

Referenced by test_CoInternetIsFeatureZoneElevationEnabled().

◆ security_uri

const char* security_uri

Definition at line 1566 of file sec_mgr.c.

◆ security_url2W

const WCHAR security_url2W[] = {'w','i','n','e','t','e','s','t',':','t','e','s','t','i','n','g','2',0}
static

Definition at line 113 of file sec_mgr.c.

Referenced by InternetProtocolInfo_ParseUrl(), and test_InternetGetSecurityUrl().

◆ security_urlW

const WCHAR security_urlW[] = {'w','i','n','e','t','e','s','t',':','t','e','s','t','i','n','g',0}
static

◆ SecurityManagerVtbl

const IInternetSecurityManagerVtbl SecurityManagerVtbl
static
Initial value:
= {
}
static HRESULT WINAPI SecurityManager_GetSecurityId(IInternetSecurityManager *This, LPCWSTR pwszUrl, BYTE *pbSecurityId, DWORD *pcbSecurityId, DWORD_PTR dwReserved)
Definition: sec_mgr.c:281
static HRESULT WINAPI SecurityManager_GetSecuritySite(IInternetSecurityManager *This, IInternetSecurityMgrSite **ppSite)
Definition: sec_mgr.c:267
static HRESULT WINAPI SecurityManager_SetZoneMapping(IInternetSecurityManager *This, DWORD dwZone, LPCWSTR lpszPattern, DWORD dwFlags)
Definition: sec_mgr.c:311
static ULONG WINAPI SecurityManager_Release(IInternetSecurityManager *This)
Definition: sec_mgr.c:255
static HRESULT WINAPI SecurityManager_MapUrlToZone(IInternetSecurityManager *This, LPCWSTR pwszUrl, DWORD *pdwZone, DWORD dwFlags)
Definition: sec_mgr.c:274
static HRESULT WINAPI SecurityManager_ProcessUrlAction(IInternetSecurityManager *This, LPCWSTR pwszUrl, DWORD dwAction, BYTE *pPolicy, DWORD cbPolicy, BYTE *pContext, DWORD cbContext, DWORD dwFlags, DWORD dwReserved)
Definition: sec_mgr.c:288
static HRESULT WINAPI SecurityManager_SetSecuritySite(IInternetSecurityManager *This, IInternetSecurityMgrSite *pSite)
Definition: sec_mgr.c:260
static HRESULT WINAPI SecurityManager_QueryCustomPolicy(IInternetSecurityManager *This, LPCWSTR pwszUrl, REFGUID guidKey, BYTE **ppPolicy, DWORD *pcbPolicy, BYTE *pContext, DWORD cbContext, DWORD dwReserved)
Definition: sec_mgr.c:303
static HRESULT WINAPI SecurityManager_QueryInterface(IInternetSecurityManager *This, REFIID riid, void **ppvObject)
Definition: sec_mgr.c:243
static HRESULT WINAPI SecurityManager_GetZoneMappings(IInternetSecurityManager *This, DWORD dwZone, IEnumString **ppenumString, DWORD dwFlags)
Definition: sec_mgr.c:318
static ULONG WINAPI SecurityManager_AddRef(IInternetSecurityManager *This)
Definition: sec_mgr.c:250

Definition at line 325 of file sec_mgr.c.

◆ szInternetSettingsKey

const char* szInternetSettingsKey = "Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings"
static

Definition at line 118 of file sec_mgr.c.

Referenced by test_SetZoneAttributes().

◆ szZoneMapDomainsKey

const char* szZoneMapDomainsKey = "Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\ZoneMap\\Domains"
static

◆ todo

BOOL todo

Definition at line 1570 of file sec_mgr.c.

Referenced by test_InternetGetSecurityUrlEx().

◆ uri

const WCHAR* uri

Definition at line 1564 of file sec_mgr.c.

Referenced by _test_display_uri(), bind_script_to_text(), bind_to_object(), bind_to_storage(), Binding_Create(), BindProtocol_Start(), build_uri(), cache_add_entry(), cache_free_uri(), cache_remove_entry(), canonicalize_authority(), canonicalize_fragment(), canonicalize_hierpart(), canonicalize_host(), canonicalize_implicit_ipv4address(), canonicalize_ipv4address(), canonicalize_ipv6address(), canonicalize_password(), canonicalize_path_opaque(), canonicalize_port(), canonicalize_query(), canonicalize_reg_name(), canonicalize_scheme(), canonicalize_uri(), canonicalize_userinfo(), canonicalize_username(), check_codebase(), CoInternetParseIUri(), compute_canonicalized_length(), contentHandler_endElement(), contentHandler_startElement(), contentHandler_startPrefixMapping(), create_doc_uri(), create_moniker(), create_moniker_from_url(), create_nschannel(), create_redirect_nschannel(), create_relative_uri(), create_uri(), CreateIUriBuilder(), CreateURLMonikerEx(), CreateURLMonikerEx2(), custom_uri_AddRef(), custom_uri_GetAbsoluteUri(), custom_uri_GetAuthority(), custom_uri_GetDisplayUri(), custom_uri_GetDomain(), custom_uri_GetExtension(), custom_uri_GetFragment(), custom_uri_GetHost(), custom_uri_GetHostType(), custom_uri_GetPassword(), custom_uri_GetPath(), custom_uri_GetPathAndQuery(), custom_uri_GetPort(), custom_uri_GetProperties(), custom_uri_GetPropertyBSTR(), custom_uri_GetPropertyDWORD(), custom_uri_GetPropertyLength(), custom_uri_GetQuery(), custom_uri_GetRawUri(), custom_uri_GetScheme(), custom_uri_GetSchemeName(), custom_uri_GetUserInfo(), custom_uri_GetUserName(), custom_uri_GetZone(), custom_uri_HasProperty(), custom_uri_IsEqual(), custom_uri_Release(), declare_prefix(), dom_pi_get_qualified_item(), dom_pi_remove_qualified_item(), domdoc_load(), domelem_get_qualified_item(), domelem_remove_qualified_item(), download_to_cache(), file_protocol_start(), FileProtocol_Start(), find_element_uri(), FtpProtocol_open_request(), FtpProtocol_Start(), generate_raw_uri(), generate_security_id(), generate_uri(), get_base_uri(), get_declared_prefix_uri(), get_protocol_handler(), get_refcnt(), get_security_id_for_uri(), get_security_id_for_url(), get_uri_from_prefix(), get_uri_nofrag(), get_uri_obj(), get_window_from_load_group(), get_zone_from_domains(), GetIUriPriv(), GopherProtocol_open_request(), GopherProtocol_Start(), handle_extern_mime_navigation(), HTMLFormElement_submit(), HTMLLocation_get_hash(), HTMLLocation_get_hostname(), HTMLLocation_get_port(), HTMLLocation_get_protocol(), HTMLLocation_get_search(), HTMLPrivateWindow_SuperNavigate(), HTMLWindow2_open(), http_protocol_start(), HttpProtocol_open_request(), HttpProtocol_Start(), httprequest_open(), is_urlmon_protocol(), isaxattributes_getName(), ivbsaxattributes_getIndexFromName(), ivbsaxattributes_getTypeFromName(), ivbsaxattributes_getURI(), ivbsaxattributes_getValueFromName(), JSGlobal_decodeURI(), JSGlobal_decodeURIComponent(), JSGlobal_encodeURI(), JSGlobal_encodeURIComponent(), libxmlEndElementNS(), libxmlStartElementNS(), load_nsuri(), load_uri(), map_security_uri_to_zone(), map_uri_to_zone(), MkProtocol_Start(), MXAttributes_addAttribute(), MXAttributes_setAttribute(), MXAttributes_setURI(), namespacemanager_getPrefix(), namespacemanager_getURI(), navigate_fragment(), navigate_href_new_window(), navigate_new_window(), navigate_uri(), navigate_url(), new_channel_from_uri(), nsAsyncVerifyRedirectCallback_OnRedirectVerifyCallback(), nsURI_CloneIgnoreRef(), nsURI_GetPrePath(), nsURI_SetSpec(), on_start_uri_open(), parse_anchor(), parse_canonicalize(), parse_document(), parse_domain(), parse_extern_script(), parse_friendly(), parse_path_from_url(), parse_rootdocument(), parse_schema(), parse_site(), parse_url_from_path(), PersistHistory_LoadHistory(), pre_process_uri(), protocol_start(), reader_get_attribute_ns_uri(), reader_push_ns(), SAXAttributes_getIndexFromName(), SAXAttributes_getName(), SAXAttributes_getURI(), SAXAttributes_getValueFromName(), SAXContentHandler_startPrefixMapping(), schema_cache_add(), schema_cache_get(), schema_cache_get_namespaceURI(), schema_cache_remove(), set_current_mon(), set_current_uri(), set_moniker(), start_binding(), submit_form(), super_navigate(), test_binding(), test_CoInternetParseIUri(), test_CoInternetParseIUri_InvalidArgs(), test_CoInternetParseIUri_Pluggable(), test_CreateIUriBuilder(), test_CreateUri_InvalidArgs(), test_CreateUri_InvalidFlags(), test_CreateUri_InvalidUri(), test_CreateUriWithFragment(), test_CreateUriWithFragment_InvalidArgs(), test_CreateUriWithFragment_InvalidFlags(), test_CreateURLMoniker(), test_file_protocol_url(), test_InternetGetSecurityUrlEx(), test_InternetGetSecurityUrlEx_Pluggable(), test_IPersistStream(), test_IUri_GetDwordProperties(), test_IUri_GetProperties(), test_IUri_GetPropertyBSTR(), test_IUri_GetPropertyDWORD(), test_IUri_GetPropertyLength(), test_IUri_GetStrProperties(), test_IUri_HasProperty(), test_IUriBuilder(), test_IUriBuilder_CreateInvalidArgs(), test_IUriBuilder_CreateUri(), test_IUriBuilder_CreateUriSimple(), test_IUriBuilder_CreateUriWithFlags(), test_IUriBuilder_GetFragment(), test_IUriBuilder_GetHost(), test_IUriBuilder_GetPassword(), test_IUriBuilder_GetPath(), test_IUriBuilder_GetPort(), test_IUriBuilder_GetQuery(), test_IUriBuilder_GetSchemeName(), test_IUriBuilder_GetUserName(), test_IUriBuilder_HasBeenModified(), test_IUriBuilder_IUriProperty(), test_IUriBuilder_Misc(), test_IUriBuilder_RemoveProperties(), test_IUriBuilderFactory(), test_namespaceuri(), test_NavigateWithBindCtx(), test_SecurityManagerEx2(), test_StdURLMoniker(), test_UninitializedUri(), test_WriteAttributeString(), test_WriteElementString(), test_WriteStartElement(), translate_uri(), translate_url(), UriBuilder_GetIUri(), UriBuilder_SetIUri(), vbnamespacemanager_getURI(), vbnamespacemanager_getURIFromNode(), VBSAXAttributes_getIndexFromName(), VBSAXAttributes_getTypeFromName(), VBSAXAttributes_getURI(), VBSAXAttributes_getValueFromName(), VBSAXContentHandler_startPrefixMapping(), verify_uri(), WebBrowserPriv2IE8_NavigateWithBindCtx2(), WebBrowserPriv2IE9_NavigateWithBindCtx2(), WebBrowserPriv_NavigateWithBindCtx(), write_attribute_string(), write_element_string(), write_start_element(), writer_find_ns(), writer_find_ns_current(), writer_push_ns(), xmlAttrHashInsert(), xmlCanonicPath(), xmlCleanURI(), xmlCreateEntityParserCtxtInternal(), xmlFreeURI(), xmlParse3986Authority(), xmlParse3986Fragment(), xmlParse3986HierPart(), xmlParse3986Host(), xmlParse3986PathAbEmpty(), xmlParse3986PathAbsolute(), xmlParse3986PathNoScheme(), xmlParse3986PathRootless(), xmlParse3986Port(), xmlParse3986Query(), xmlParse3986RelativeRef(), xmlParse3986Scheme(), xmlParse3986URI(), xmlParse3986URIReference(), xmlParse3986Userinfo(), xmlParseEntityDecl(), xmlParserNsPush(), xmlParseStartTag2(), xmlParseURI(), xmlParseURIRaw(), xmlParseURIReference(), xmlPathToURI(), xmlPrintURI(), xmlreader_GetNamespaceUri(), xmlreader_MoveToAttributeByName(), xmlSaveUri(), xmlSAX2StartElementNs(), xmlURIEscape(), xmlwriter_WriteAttributeString(), xmlwriter_WriteElementString(), xmlwriter_WriteStartElement(), xslprocessor_addObject(), xslprocessor_addParameter(), xslprocessor_get_startModeURI(), xslprocessor_setStartMode(), xslt_doc_default_loader(), xslt_doc_get_uri(), xsltCheckRead(), xsltCheckWrite(), and xsltDocumentFunction().

◆ url1

const WCHAR url1[]
static
Initial value:
= {'r','e','s',':','/','/','m','s','h','t','m','l','.','d','l','l',
'/','b','l','a','n','k','.','h','t','m',0}

Definition at line 86 of file sec_mgr.c.

Referenced by test_activex(), test_CoInternetIsFeatureZoneElevationEnabled(), and test_special_url_action().

◆ url10

const WCHAR url10[]
static
Initial value:
= {'f','i','l','e',':','/','/','s','o','m','e','%','2','0','f','i','l','e',
'.','j','p','g',0}

Definition at line 100 of file sec_mgr.c.

Referenced by test_InternetGetSecurityUrl(), and test_SecurityManager().

◆ url11

const WCHAR url11[] = {'f','i','l','e',':','/','/','c',':','/','I','n','d','e','x','.','h','t','m',0}
static

Definition at line 102 of file sec_mgr.c.

◆ url12

const WCHAR url12[] = {'f','i','l','e',':','/','/','/','c',':','/','I','n','d','e','x','.','h','t','m',0}
static

Definition at line 103 of file sec_mgr.c.

◆ url13

const WCHAR url13[] = {'h','t','t','p',':','g','o','o','g','l','e','.','c','o','m',0}
static

Definition at line 104 of file sec_mgr.c.

Referenced by test_SecurityManager().

◆ url14

const WCHAR url14[] = {'z','i','p',':','t','e','s','t','i','n','g','.','c','o','m','/','t','e','s','t','i','n','g',0}
static

Definition at line 105 of file sec_mgr.c.

Referenced by test_SecurityManager().

◆ url15

const WCHAR url15[] = {'h','t','t','p',':','/','/','g','o','o','g','l','e','.','c','o','m','.','u','k',0}
static

Definition at line 106 of file sec_mgr.c.

Referenced by test_SecurityManagerEx2().

◆ url16

const WCHAR url16[] = {'f','i','l','e',':','/','/','/','c',':',0}
static

Definition at line 107 of file sec_mgr.c.

◆ url17

const WCHAR url17[] = {'f','i','l','e',':','/','/','/','c',':','c','\\',0}
static

Definition at line 108 of file sec_mgr.c.

◆ url18

const WCHAR url18[] = {'c',':','\\','t','e','s','t','.','h','t','m',0}
static

Definition at line 109 of file sec_mgr.c.

◆ url2

const WCHAR url2[] = {'i','n','d','e','x','.','h','t','m',0}
static

Definition at line 88 of file sec_mgr.c.

Referenced by test_InternetGetSecurityUrl().

◆ url3

const WCHAR url3[] = {'f','i','l','e',':','/','/','c',':','\\','I','n','d','e','x','.','h','t','m',0}
static

Definition at line 89 of file sec_mgr.c.

Referenced by test_InternetGetSecurityUrl().

◆ url4

const WCHAR url4[]
static
Initial value:
= {'f','i','l','e',':','s','o','m','e','%','2','0','f','i','l','e',
'%','2','e','j','p','g',0}

Definition at line 90 of file sec_mgr.c.

Referenced by test_InternetGetSecurityUrl().

◆ url5

const WCHAR url5[]
static
Initial value:
= {'h','t','t','p',':','/','/','w','w','w','.','z','o','n','e','3',
'.','w','i','n','e','t','e','s','t',0}

Definition at line 92 of file sec_mgr.c.

Referenced by test_InternetGetSecurityUrl(), and test_SecurityManagerEx2().

◆ url6

const WCHAR url6[] = {'a','b','o','u','t',':','b','l','a','n','k',0}
static

Definition at line 94 of file sec_mgr.c.

◆ url7

const WCHAR url7[]
static
Initial value:
= {'f','t','p',':','/','/','z','o','n','e','3',
'.','w','i','n','e','t','e','s','t','/','f','i','l','e','.','t','e','s','t',0}

Definition at line 95 of file sec_mgr.c.

Referenced by test_InternetGetSecurityUrl().

◆ url8

const WCHAR url8[] = {'t','e','s','t',':','1','2','3','a','b','c',0}
static

Definition at line 97 of file sec_mgr.c.

Referenced by test_InternetGetSecurityUrl().

◆ url9

const WCHAR url9[]
static
Initial value:
= {'h','t','t','p',':','/','/','w','w','w','.','z','o','n','e','3',
'.','w','i','n','e','t','e','s','t', '/','s','i','t','e','/','a','b','o','u','t',0}

Definition at line 98 of file sec_mgr.c.

Referenced by InternetProtocolInfo_ParseUrl(), test_InternetGetSecurityUrl(), and test_url_action().

◆ winetest_to_httpW

const WCHAR winetest_to_httpW[] = {'w','i','n','e','t','e','s','t',':','h',0}
static

Definition at line 115 of file sec_mgr.c.

Referenced by InternetProtocolInfo_ParseUrl(), and test_url_action().

◆ winetestW

const WCHAR winetestW[] = {'w','i','n','e','t','e','s','t',0}
static

Definition at line 111 of file sec_mgr.c.

Referenced by register_protocols(), and unregister_protocols().

◆ zone

◆ zone_domain_mappings

const zone_domain_mapping zone_domain_mappings[]
static
Initial value:
= {
{"yabadaba.do",NULL,"http",URLZONE_CUSTOM},
{"super.cool","testing.*","ftp",URLZONE_CUSTOM2},
{"super.cool","*.testing","ftp",URLZONE_CUSTOM2},
{"tests.test",NULL,"*",URLZONE_CUSTOM},
{"tests.test",NULL,"zip",URLZONE_CUSTOM},
{"www.testing.com",NULL,"http",URLZONE_CUSTOM},
{"www.testing.com","testing","http",URLZONE_CUSTOM2},
{"org",NULL,"http",URLZONE_CUSTOM},
{"org","testing","http",URLZONE_CUSTOM2},
{"wine.testing",NULL,"*",URLZONE_CUSTOM2}
}
#define URLZONE_CUSTOM2
Definition: sec_mgr.c:37

Definition at line 714 of file sec_mgr.c.

Referenced by register_zone_domains(), and unregister_zone_domains().

◆ zone_mapping_tests

const zone_mapping_test zone_mapping_tests[]
static
Initial value:
= {
{L"http://yabadaba.do/", URLZONE_CUSTOM},
{L"http://google.yabadaba.do/", URLZONE_CUSTOM},
{L"zip://yabadaba.do/", URLZONE_INTERNET},
{L"ftp://testing.google.super.cool/", URLZONE_INTERNET},
{L"ftp://testing.*.super.cool/", URLZONE_CUSTOM2},
{L"ftp://google.testing.super.cool/", URLZONE_CUSTOM2},
{L"http://tests.test/", URLZONE_CUSTOM},
{L"http://www.tests.test/", URLZONE_CUSTOM},
{L"ftp://tests.test/", URLZONE_CUSTOM},
{L"ftp://www.tests.test/", URLZONE_CUSTOM},
{L"test://www.tests.test/", URLZONE_INTERNET},
{L"test://tests.test/", URLZONE_INTERNET},
{L"zip://www.tests.test/", URLZONE_INTERNET},
{L"zip://tests.test/", URLZONE_INTERNET},
{L"http://google.www.testing.com/", URLZONE_INTERNET},
{L"http://www.testing.com/", URLZONE_CUSTOM, FALSE, URLZONE_INTERNET},
{L"http://testing.www.testing.com/", URLZONE_CUSTOM2, FALSE, URLZONE_INTERNET},
{L"http://google.org/", URLZONE_INTERNET, FALSE, URLZONE_CUSTOM},
{L"http://org/", URLZONE_CUSTOM},
{L"http://testing.org/", URLZONE_CUSTOM2},
{L"*:wine.testing/test", URLZONE_CUSTOM2},
{L"http://wine.testing/testing", URLZONE_CUSTOM2}
}

Definition at line 859 of file sec_mgr.c.

Referenced by test_zone_domain_mappings().