ReactOS 0.4.15-dev-7788-g1ad9096
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 <wine/heap.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 LPWSTR a2w (LPCSTR str)
 
static DWORD strcmp_aw (LPCSTR strA, LPCWSTR strB)
 
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 char *   uri
 
   DWORD   create_flags
 
   const char *   security_uri
 
   HRESULT   security_hres
 
   const char *   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 char *   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:29

Definition at line 59 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 46 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 53 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 40 of file sec_mgr.c.

◆ SET_CALLED

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

Definition at line 65 of file sec_mgr.c.

◆ SET_EXPECT

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

Definition at line 43 of file sec_mgr.c.

◆ URLZONE_CUSTOM

#define URLZONE_CUSTOM   URLZONE_USER_MIN+1

Definition at line 37 of file sec_mgr.c.

◆ URLZONE_CUSTOM2

#define URLZONE_CUSTOM2   URLZONE_CUSTOM+1

Definition at line 38 of file sec_mgr.c.

Function Documentation

◆ a2w()

static LPWSTR a2w ( LPCSTR  str)
inlinestatic

Definition at line 177 of file sec_mgr.c.

178{
179 LPWSTR ret = NULL;
180
181 if(str) {
183 ret = HeapAlloc(GetProcessHeap(), 0, len*sizeof(WCHAR));
185 }
186
187 return ret;
188}
#define NULL
Definition: types.h:112
#define GetProcessHeap()
Definition: compat.h:736
#define CP_ACP
Definition: compat.h:109
#define HeapAlloc
Definition: compat.h:733
#define MultiByteToWideChar
Definition: compat.h:110
unsigned long DWORD
Definition: ntddk_ex.h:95
GLenum GLsizei len
Definition: glext.h:6722
const WCHAR * str
int ret
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by strcmp_aw(), test_CoInternetIsFeatureZoneElevationEnabled(), test_InternetGetSecurityUrlEx(), test_SecurityManagerEx2(), and test_zone_domain_mappings().

◆ ClassFactory_AddRef()

static ULONG WINAPI ClassFactory_AddRef ( IClassFactory iface)
static

Definition at line 1522 of file sec_mgr.c.

1523{
1524 return 2;
1525}

◆ ClassFactory_CreateInstance()

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

Definition at line 1532 of file sec_mgr.c.

1534{
1535 ok(0, "unexpected call\n");
1536 return E_NOTIMPL;
1537}
#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 1539 of file sec_mgr.c.

1540{
1541 ok(0, "unexpected call\n");
1542 return S_OK;
1543}
#define S_OK
Definition: intsafe.h:52

◆ ClassFactory_QueryInterface()

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

Definition at line 1511 of file sec_mgr.c.

1512{
1513 if(IsEqualGUID(&IID_IInternetProtocolInfo, riid)) {
1514 *ppv = &protocol_info;
1515 return S_OK;
1516 }
1517
1518 ok(0, "unexpected call\n");
1519 return E_NOINTERFACE;
1520}
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
static IInternetProtocolInfo protocol_info
Definition: misc.c:947
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define E_NOINTERFACE
Definition: winerror.h:2364

◆ ClassFactory_Release()

static ULONG WINAPI ClassFactory_Release ( IClassFactory iface)
static

Definition at line 1527 of file sec_mgr.c.

1528{
1529 return 1;
1530}

◆ 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 1401 of file sec_mgr.c.

1402{
1403 return 2;
1404}

◆ 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 1476 of file sec_mgr.c.

1479{
1480 ok(0, "unexpected call\n");
1481 return E_NOTIMPL;
1482}

◆ InternetProtocolInfo_CompareUrl()

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

Definition at line 1484 of file sec_mgr.c.

1486{
1487 ok(0, "unexpected call\n");
1488 return E_NOTIMPL;
1489}

◆ 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 1411 of file sec_mgr.c.

1414{
1415 const WCHAR *ret = NULL;
1416
1417 ok(pwzResult != NULL, "pwzResult == NULL\n");
1418 ok(pcchResult != NULL, "pcchResult == NULL\n");
1419 ok(!dwParseFlags, "Expected 0, but got 0x%08x\n", dwParseFlags);
1420
1421 switch(ParseAction) {
1422 case PARSE_SECURITY_URL:
1423 if(!strcmp_w(pwzUrl, security_urlW)) {
1424 CHECK_EXPECT(ParseUrl_SECURITY_URL_input);
1425 ok(cchResult == lstrlenW(pwzUrl)+1, "Got %d\n", cchResult);
1427 } else if(!strcmp_w(pwzUrl, security_url2W)) {
1428 CHECK_EXPECT(ParseUrl_SECURITY_URL_input2);
1429 ok(cchResult == lstrlenW(pwzUrl)+1, "Got %d\n", cchResult);
1431 } else if(!strcmp_w(pwzUrl, security_expectedW)) {
1432 CHECK_EXPECT(ParseUrl_SECURITY_URL_expected);
1433 ok(cchResult == lstrlenW(pwzUrl)+1, "Got %d\n", cchResult);
1435 } else if(!strcmp_w(pwzUrl, winetest_to_httpW)) {
1436 switch(++called_securl_http) {
1437 case 1:
1438 ok(cchResult == lstrlenW(pwzUrl)+1, "Got %d\n", cchResult);
1439 break;
1440 case 2:
1441 CHECK_EXPECT(ParseUrl_SECURITY_URL_http);
1442 ok(cchResult == lstrlenW(url9)+1, "Got %d\n", cchResult);
1443 break;
1444 default:
1445 todo_wine CHECK_EXPECT(ParseUrl_SECURITY_URL_http);
1446 }
1447 ret = url9;
1448 } else
1449 ok(0, "Unexpected call, pwzUrl=%s\n", wine_dbgstr_w(pwzUrl));
1450
1451 break;
1452 case PARSE_SECURITY_DOMAIN:
1453
1454 CHECK_EXPECT(ParseUrl_SECURITY_DOMAIN_expected);
1455
1456 ok(!strcmp_w(pwzUrl, security_expectedW), "Expected %s but got %s\n",
1458 ok(cchResult == lstrlenW(pwzUrl)+1, "Got %d\n", cchResult);
1460 break;
1461 default:
1462 ok(0, "Unexpected call, ParseAction=%d pwzUrl=%s\n", ParseAction,
1463 wine_dbgstr_w(pwzUrl));
1464 }
1465
1466 if(!ret)
1467 return E_FAIL;
1468
1469 *pcchResult = lstrlenW(ret)+1;
1470 if(*pcchResult > cchResult)
1471 return S_FALSE;
1472 memcpy(pwzResult, ret, (*pcchResult)*sizeof(WCHAR));
1473 return S_OK;
1474}
#define E_FAIL
Definition: ddrawi.h:102
#define lstrlenW
Definition: compat.h:750
#define wine_dbgstr_w
Definition: kernel32.h:34
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define todo_wine
Definition: custom.c:79
static const WCHAR security_url2W[]
Definition: sec_mgr.c:114
static const WCHAR winetest_to_httpW[]
Definition: sec_mgr.c:116
#define CHECK_EXPECT(func)
Definition: sec_mgr.c:46
static int strcmp_w(const WCHAR *str1, const WCHAR *str2)
Definition: sec_mgr.c:168
static const WCHAR security_expectedW[]
Definition: sec_mgr.c:115
static int called_securl_http
Definition: sec_mgr.c:144
static const WCHAR security_urlW[]
Definition: sec_mgr.c:113
static const WCHAR url9[]
Definition: sec_mgr.c:99
#define S_FALSE
Definition: winerror.h:2357

◆ 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 1491 of file sec_mgr.c.

1494{
1495 ok(0, "unexpected call\n");
1496 return E_NOTIMPL;
1497}

◆ InternetProtocolInfo_QueryInterface()

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

Definition at line 1394 of file sec_mgr.c.

1396{
1397 ok(0, "unexpected call\n");
1398 return E_NOINTERFACE;
1399}

◆ InternetProtocolInfo_Release()

static ULONG WINAPI InternetProtocolInfo_Release ( IInternetProtocolInfo iface)
static

Definition at line 1406 of file sec_mgr.c.

1407{
1408 return 1;
1409}

◆ is_ie_hardened()

static BOOL is_ie_hardened ( void  )
static

Definition at line 475 of file sec_mgr.c.

476{
477 HKEY zone_map;
478 DWORD ie_harden, type, size;
479
480 ie_harden = 0;
481 if(RegOpenKeyExA(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\ZoneMap",
482 0, KEY_QUERY_VALUE, &zone_map) == ERROR_SUCCESS) {
483 size = sizeof(DWORD);
484 if (RegQueryValueExA(zone_map, "IEHarden", NULL, &type, (LPBYTE) &ie_harden, &size) != ERROR_SUCCESS ||
485 type != REG_DWORD) {
486 ie_harden = 0;
487 }
488 RegCloseKey(zone_map);
489 }
490
491 return ie_harden != 0;
492}
#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:3327
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:4038
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLsizeiptr size
Definition: glext.h:5919
#define KEY_QUERY_VALUE
Definition: nt_native.h:1016
#define DWORD
Definition: nt_native.h:44
#define REG_DWORD
Definition: sdbapi.c:596
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 199 of file sec_mgr.c.

200{
201 LONG ret;
202 DWORD dwMaxSubkeyLen, dwMaxValueLen;
203 DWORD dwMaxLen, dwSize;
204 CHAR szNameBuf[MAX_PATH], *lpszName = szNameBuf;
205 HKEY hSubKey = hKey;
206
207 if(lpszSubKey)
208 {
209 ret = RegOpenKeyExA(hKey, lpszSubKey, 0, KEY_READ, &hSubKey);
210 if (ret) return ret;
211 }
212
213 /* Get highest length for keys, values */
214 ret = RegQueryInfoKeyA(hSubKey, NULL, NULL, NULL, NULL,
215 &dwMaxSubkeyLen, NULL, NULL, &dwMaxValueLen, NULL, NULL, NULL);
216 if (ret) goto cleanup;
217
218 dwMaxSubkeyLen++;
219 dwMaxValueLen++;
220 dwMaxLen = max(dwMaxSubkeyLen, dwMaxValueLen);
221 if (dwMaxLen > ARRAY_SIZE(szNameBuf))
222 {
223 /* Name too big: alloc a buffer for it */
224 if (!(lpszName = HeapAlloc( GetProcessHeap(), 0, dwMaxLen*sizeof(CHAR))))
225 {
227 goto cleanup;
228 }
229 }
230
231 /* Recursively delete all the subkeys */
232 while (TRUE)
233 {
234 dwSize = dwMaxLen;
235 if (RegEnumKeyExA(hSubKey, 0, lpszName, &dwSize, NULL,
236 NULL, NULL, NULL)) break;
237
238 ret = myRegDeleteTreeA(hSubKey, lpszName);
239 if (ret) goto cleanup;
240 }
241
242 if (lpszSubKey)
243 ret = RegDeleteKeyA(hKey, lpszSubKey);
244 else
245 while (TRUE)
246 {
247 dwSize = dwMaxLen;
248 if (RegEnumValueA(hKey, 0, lpszName, &dwSize,
249 NULL, NULL, NULL, NULL)) break;
250
251 ret = RegDeleteValueA(hKey, lpszName);
252 if (ret) goto cleanup;
253 }
254
255cleanup:
256 /* Free buffer if allocated */
257 if (lpszName != szNameBuf)
258 heap_free(lpszName);
259 if(lpszSubKey)
260 RegCloseKey(hSubKey);
261 return ret;
262}
static BOOL heap_free(void *mem)
Definition: appwiz.h:76
#define ARRAY_SIZE(A)
Definition: main.h:33
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
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:3612
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:2697
LONG WINAPI RegDeleteValueA(HKEY hKey, LPCSTR lpValueName)
Definition: reg.c:2325
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:2448
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:199
#define KEY_READ
Definition: nt_native.h:1023
long LONG
Definition: pedump.c:60
#define max(a, b)
Definition: svc.c:63
char CHAR
Definition: xmlstorage.h:175

Referenced by myRegDeleteTreeA(), and test_SetZoneAttributes().

◆ register_protocols()

static void register_protocols ( void  )
static

Definition at line 1555 of file sec_mgr.c.

1556{
1558 HRESULT hres;
1559
1560 hres = pCoInternetGetSession(0, &session, 0);
1561 ok(hres == S_OK, "CoInternetGetSession failed: %08x\n", hres);
1562 if(FAILED(hres))
1563 return;
1564
1565 hres = IInternetSession_RegisterNameSpace(session, &protocol_cf, &IID_NULL,
1566 winetestW, 0, NULL, 0);
1567 ok(hres == S_OK, "RegisterNameSpace failed: %08x\n", hres);
1568
1569 IInternetSession_Release(session);
1570}
#define FAILED(hr)
Definition: intsafe.h:51
HRESULT hres
Definition: protocol.c:465
static const WCHAR winetestW[]
Definition: sec_mgr.c:112
static IClassFactory protocol_cf
Definition: sec_mgr.c:1553
#define IID_NULL
Definition: guiddef.h:98

Referenced by START_TEST().

◆ register_zone_domains()

static BOOL register_zone_domains ( void  )
static

Definition at line 754 of file sec_mgr.c.

755{
756 HKEY domains;
757 DWORD res, i;
758
759 /* Some Windows versions don't seem to have a "Domains" key in their HKLM. */
761 ok(res == ERROR_SUCCESS || broken(res == ERROR_FILE_NOT_FOUND), "RegOpenKey failed: %d\n", res);
762 if(res == ERROR_SUCCESS) {
763 HKEY domain;
765
766 res = RegCreateKeyA(domains, "local.machine", &domain);
768 {
769 skip("need admin rights\n");
770 RegCloseKey(domains);
771 return FALSE;
772 }
773 ok(res == ERROR_SUCCESS, "RegCreateKey failed: %d\n", res);
774
775 res = RegSetValueExA(domain, "http", 0, REG_DWORD, (BYTE*)&zone, sizeof(DWORD));
776 ok(res == ERROR_SUCCESS, "RegSetValueEx failed: %d\n", res);
777
779 RegCloseKey(domains);
780 }
781
783 ok(res == ERROR_SUCCESS, "RegOpenKey failed: %d\n", res);
784
785 for(i = 0; i < ARRAY_SIZE(zone_domain_mappings); ++i) {
787 HKEY domain;
788
789 res = RegCreateKeyA(domains, test->domain, &domain);
790 ok(res == ERROR_SUCCESS, "RegCreateKey failed with %d on test %d\n", res, i);
791
792 /* Only set the value if there's no subdomain. */
793 if(!test->subdomain) {
794 res = RegSetValueExA(domain, test->scheme, 0, REG_DWORD, (BYTE*)&test->zone, sizeof(DWORD));
795 ok(res == ERROR_SUCCESS, "RegSetValueEx failed with %d on test %d\n", res, i);
796 } else {
797 HKEY subdomain;
798
799 res = RegCreateKeyA(domain, test->subdomain, &subdomain);
800 ok(res == ERROR_SUCCESS, "RegCreateKey failed with %d on test %d\n", res, i);
801
802 res = RegSetValueExA(subdomain, test->scheme, 0, REG_DWORD, (BYTE*)&test->zone, sizeof(DWORD));
803 ok(res == ERROR_SUCCESS, "RegSetValueEx failed with %d on test %d\n", res, i);
804
805 RegCloseKey(subdomain);
806 }
807
809 }
810
811 RegCloseKey(domains);
812 return TRUE;
813}
#define broken(x)
Definition: _sntprintf.h:21
#define skip(...)
Definition: atltest.h:64
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:4828
LONG WINAPI RegOpenKeyA(HKEY hKey, LPCSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:3263
#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:37
static const zone_domain_mapping zone_domain_mappings[]
Definition: sec_mgr.c:735
DWORD zone
Definition: sec_mgr.c:1754
static const char * szZoneMapDomainsKey
Definition: sec_mgr.c:118
#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 852 of file sec_mgr.c.

853{
854 char cmdline[MAX_PATH];
855 char path[MAX_PATH];
856 char **argv;
858 STARTUPINFOA si = { 0 };
859 BOOL ret;
860
862
863 si.cb = sizeof(si);
865 sprintf(cmdline, "\"%s\" %s domain_tests", argv[0], argv[1]);
866 ret = CreateProcessA(argv[0], cmdline, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi);
867 ok(ret, "Failed to spawn child process: %u\n", GetLastError());
869 CloseHandle(pi.hThread);
870 CloseHandle(pi.hProcess);
871}
#define CloseHandle
Definition: compat.h:739
DWORD WINAPI GetModuleFileNameA(HINSTANCE hModule, LPSTR lpFilename, DWORD nSize)
Definition: loader.c:539
BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessA(LPCSTR lpApplicationName, LPSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCSTR lpCurrentDirectory, LPSTARTUPINFOA lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation)
Definition: proc.c:4741
unsigned int BOOL
Definition: ntddk_ex.h:94
#define sprintf(buf, format,...)
Definition: sprintf.c:55
static refpint_t pi[]
Definition: server.c:96
#define argv
Definition: mplay32.c:18
int winetest_get_mainargs(char ***pargv)
void winetest_wait_child_process(HANDLE process)
TCHAR * cmdline
Definition: stretchblt.cpp:32
DWORD cb
Definition: winbase.h:831
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 271 of file sec_mgr.c.

272{
273 return 2;
274}

◆ SecurityManager_GetSecurityId()

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

Definition at line 302 of file sec_mgr.c.

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

◆ SecurityManager_GetSecuritySite()

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

Definition at line 288 of file sec_mgr.c.

290{
291 ok(0, "unexpected call\n");
292 return E_NOTIMPL;
293}

◆ SecurityManager_GetZoneMappings()

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

Definition at line 339 of file sec_mgr.c.

341{
342 ok(0, "unexpected call\n");
343 return E_NOTIMPL;
344}

◆ SecurityManager_MapUrlToZone()

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

Definition at line 295 of file sec_mgr.c.

297{
298 ok(0, "unexpected call\n");
299 return E_NOTIMPL;
300}

◆ 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 309 of file sec_mgr.c.

312{
313 CHECK_EXPECT(ProcessUrlAction);
314 ok(dwAction == URLACTION_FEATURE_ZONE_ELEVATION, "dwAction = %x\n", dwAction);
315 ok(cbPolicy == sizeof(DWORD), "cbPolicy = %d\n", cbPolicy);
316 ok(!pContext, "pContext != NULL\n");
317 ok(dwFlags == PUAF_NOUI, "dwFlags = %x\n", dwFlags);
318 ok(dwReserved == 0, "dwReserved = %x\n", dwReserved);
319
320 *pPolicy = ProcessUrlAction_policy;
321 return ProcessUrlAction_policy==URLPOLICY_ALLOW ? S_OK : S_FALSE;
322}
static DWORD ProcessUrlAction_policy
Definition: sec_mgr.c:145
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED _In_opt_ LPTRANSMIT_FILE_BUFFERS _In_ DWORD dwReserved
Definition: mswsock.h:95
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176

◆ 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 324 of file sec_mgr.c.

327{
328 ok(0, "unexpected call\n");
329 return E_NOTIMPL;
330}

◆ SecurityManager_QueryInterface()

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

Definition at line 264 of file sec_mgr.c.

266{
267 ok(0, "unexpected call\n");
268 return E_NOTIMPL;
269}

◆ SecurityManager_Release()

static ULONG WINAPI SecurityManager_Release ( IInternetSecurityManager This)
static

Definition at line 276 of file sec_mgr.c.

277{
278 return 1;
279}

◆ SecurityManager_SetSecuritySite()

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

Definition at line 281 of file sec_mgr.c.

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

◆ SecurityManager_SetZoneMapping()

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

Definition at line 332 of file sec_mgr.c.

334{
335 ok(0, "unexpected call\n");
336 return E_NOTIMPL;
337}

◆ START_TEST()

START_TEST ( sec_mgr  )

Definition at line 1967 of file sec_mgr.c.

1968{
1969 HMODULE hurlmon;
1970 int argc;
1971 char **argv;
1972
1973 hurlmon = GetModuleHandleA("urlmon.dll");
1974 pCoInternetCreateSecurityManager = (void*) GetProcAddress(hurlmon, "CoInternetCreateSecurityManager");
1975 pCoInternetCreateZoneManager = (void*) GetProcAddress(hurlmon, "CoInternetCreateZoneManager");
1976 pCoInternetGetSecurityUrl = (void*) GetProcAddress(hurlmon, "CoInternetGetSecurityUrl");
1977 pCoInternetGetSecurityUrlEx = (void*) GetProcAddress(hurlmon, "CoInternetGetSecurityUrlEx");
1978 pCreateUri = (void*) GetProcAddress(hurlmon, "CreateUri");
1979 pCoInternetGetSession = (void*) GetProcAddress(hurlmon, "CoInternetGetSession");
1980 pCoInternetIsFeatureEnabled = (void*) GetProcAddress(hurlmon, "CoInternetIsFeatureEnabled");
1981 pCoInternetIsFeatureEnabledForUrl = (void*) GetProcAddress(hurlmon, "CoInternetIsFeatureEnabledForUrl");
1982 pCoInternetIsFeatureZoneElevationEnabled = (void*) GetProcAddress(hurlmon, "CoInternetIsFeatureZoneElevationEnabled");
1983
1984 if (!pCoInternetCreateSecurityManager || !pCoInternetCreateZoneManager ||
1985 !pCoInternetGetSecurityUrl) {
1986 win_skip("Various CoInternet* functions not present in IE 4.0\n");
1987 return;
1988 }
1989
1991 if(argc > 2 && !strcmp(argv[2], "domain_tests")) {
1993 return;
1994 }
1995
1998
2000
2001 if(!pCoInternetGetSecurityUrlEx || !pCreateUri)
2002 win_skip("Skipping CoInternetGetSecurityUrlEx tests, IE too old\n");
2003 else {
2006 }
2007
2010 test_polices();
2020
2023}
static int argc
Definition: ServiceArgs.c:12
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
#define GetProcAddress(x, y)
Definition: compat.h:753
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:812
HRESULT WINAPI DECLSPEC_HOTPATCH OleInitialize(LPVOID reserved)
Definition: ole2.c:169
void WINAPI DECLSPEC_HOTPATCH OleUninitialize(void)
Definition: ole2.c:230
static void test_GetZoneAt(void)
Definition: sec_mgr.c:1130
static void test_GetZoneAttributes(void)
Definition: sec_mgr.c:1181
static void test_CoInternetIsFeatureZoneElevationEnabled(void)
Definition: sec_mgr.c:1888
static void test_SecurityManagerEx2(void)
Definition: sec_mgr.c:1776
static void unregister_protocols(void)
Definition: sec_mgr.c:1572
static void test_CoInternetCreateZoneManager(void)
Definition: sec_mgr.c:972
static void test_InternetSecurityMarshalling(void)
Definition: sec_mgr.c:1314
static void test_SecurityManager(void)
Definition: sec_mgr.c:362
static void test_zone_domains(void)
Definition: sec_mgr.c:953
static void test_SetZoneAttributes(void)
Definition: sec_mgr.c:1237
static void test_polices(void)
Definition: sec_mgr.c:651
static void test_GetZoneActionPolicy(void)
Definition: sec_mgr.c:1087
static void test_CreateZoneEnumerator(void)
Definition: sec_mgr.c:1017
static void register_protocols(void)
Definition: sec_mgr.c:1555
static void test_InternetGetSecurityUrlEx_Pluggable(void)
Definition: sec_mgr.c:1685
static void test_InternetGetSecurityUrlEx(void)
Definition: sec_mgr.c:1609
static void test_InternetGetSecurityUrl(void)
Definition: sec_mgr.c:1344
static void test_zone_domain_mappings(void)
Definition: sec_mgr.c:911
#define win_skip
Definition: test.h:160

◆ strcmp_aw()

static DWORD strcmp_aw ( LPCSTR  strA,
LPCWSTR  strB 
)
inlinestatic

Definition at line 190 of file sec_mgr.c.

190 {
191 LPWSTR strAW = a2w(strA);
192 DWORD ret = lstrcmpW(strAW, strB);
193 heap_free(strAW);
194 return ret;
195}
int WINAPI lstrcmpW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:170
static LPWSTR a2w(LPCSTR str)
Definition: sec_mgr.c:177
char strA[12]
Definition: clipboard.c:2028

Referenced by test_InternetGetSecurityUrlEx().

◆ strcmp_w()

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

Definition at line 168 of file sec_mgr.c.

169{
170 DWORD len1 = lstrlenW(str1);
171 DWORD len2 = lstrlenW(str2);
172
173 if(len1!=len2) return 1;
174 return memcmp(str1, str2, len1*sizeof(WCHAR));
175}
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112

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

◆ test_activex()

static void test_activex ( IInternetSecurityManager secmgr)
static

Definition at line 630 of file sec_mgr.c.

631{
632 DWORD policy, policy_size;
633 struct CONFIRMSAFETY cs;
634 BYTE *ppolicy;
636
637 policy = 0xdeadbeef;
638 hres = IInternetSecurityManager_ProcessUrlAction(secmgr, url1, URLACTION_ACTIVEX_RUN, (BYTE*)&policy,
639 sizeof(DWORD), (BYTE*)&CLSID_TestActiveX, sizeof(CLSID), 0, 0);
640 ok(hres == S_OK, "ProcessUrlAction(URLACTION_ACTIVEX_RUN) failed: %08x\n", hres);
641 ok(policy == URLPOLICY_ALLOW || policy == URLPOLICY_DISALLOW, "policy = %x\n", policy);
642
643 cs.clsid = CLSID_TestActiveX;
644 cs.pUnk = (IUnknown*)0xdeadbeef;
645 cs.dwFlags = 0;
646 hres = IInternetSecurityManager_QueryCustomPolicy(secmgr, url1, &GUID_CUSTOM_CONFIRMOBJECTSAFETY,
647 &ppolicy, &policy_size, (BYTE*)&cs, sizeof(cs), 0);
648 ok(hres == HRESULT_FROM_WIN32(ERROR_NOT_FOUND), "QueryCusromPolicy failed: %08x\n", hres);
649}
WDF_INTERRUPT_POLICY policy
#define cs
Definition: i386-dis.c:442
static const GUID CLSID_TestActiveX
Definition: sec_mgr.c:137
static const WCHAR url1[]
Definition: sec_mgr.c:87
const GUID GUID_CUSTOM_CONFIRMOBJECTSAFETY
Definition: sec_mgr.c:141
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
#define ERROR_NOT_FOUND
Definition: winerror.h:690

Referenced by test_polices().

◆ test_CoInternetCreateZoneManager()

static void test_CoInternetCreateZoneManager ( void  )
static

Definition at line 972 of file sec_mgr.c.

973{
974 IInternetZoneManager *zonemgr = NULL;
975 IUnknown *punk = NULL;
976 HRESULT hr;
977
978 trace("simple zone manager tests...\n");
979
980 hr = pCoInternetCreateZoneManager(NULL, &zonemgr, 0);
981 ok(hr == S_OK, "CoInternetCreateZoneManager result: 0x%x\n", hr);
982 if (FAILED(hr))
983 return;
984
985 hr = IInternetZoneManager_QueryInterface(zonemgr, &IID_IUnknown, (void **) &punk);
986 ok(SUCCEEDED(hr), "got 0x%x with %p (expected Success)\n", hr, punk);
987 if (punk)
988 IUnknown_Release(punk);
989
990 hr = IInternetZoneManager_QueryInterface(zonemgr, &IID_IInternetZoneManager, (void **) &punk);
991 ok(SUCCEEDED(hr), "got 0x%x with %p (expected Success)\n", hr, punk);
992 if (punk)
993 IUnknown_Release(punk);
994
995
996 hr = IInternetZoneManager_QueryInterface(zonemgr, &IID_IInternetZoneManagerEx, (void **) &punk);
997 if (SUCCEEDED(hr)) {
998 IUnknown_Release(punk);
999
1000 hr = IInternetZoneManager_QueryInterface(zonemgr, &IID_IInternetZoneManagerEx2, (void **) &punk);
1001 ok(hr == S_OK || broken(hr == E_NOINTERFACE /* some W2K3 */),
1002 "got 0x%x (expected S_OK)\n", hr);
1003 if (punk)
1004 IUnknown_Release(punk);
1005 else
1006 win_skip("InternetZoneManagerEx2 not supported\n");
1007
1008 }
1009 else
1010 win_skip("InternetZoneManagerEx not supported\n");
1011
1012 hr = IInternetZoneManager_Release(zonemgr);
1013 ok(hr == S_OK, "got 0x%x (expected S_OK)\n", hr);
1014
1015}
#define trace
Definition: atltest.h:70
const GUID IID_IUnknown
#define SUCCEEDED(hr)
Definition: intsafe.h:50
HRESULT hr
Definition: shlfolder.c:183

Referenced by START_TEST().

◆ test_CoInternetIsFeatureZoneElevationEnabled()

static void test_CoInternetIsFeatureZoneElevationEnabled ( void  )
static

Definition at line 1888 of file sec_mgr.c.

1889{
1890 struct {
1891 const char *url_from;
1892 const char *url_to;
1893 DWORD flags;
1894 HRESULT hres;
1895 DWORD policy_flags;
1896 } testcases[] = {
1897 /* 0 */ { "http://www.winehq.org", "http://www.winehq.org", 0, S_FALSE, URLPOLICY_ALLOW },
1898 /* 1 */ { "http://www.winehq.org", "http://www.winehq.org", 0, S_OK, URLPOLICY_DISALLOW },
1899 /* 2 */ { "http://www.winehq.org", "http://www.codeweavers.com", 0, S_FALSE, URLPOLICY_ALLOW },
1900 /* 3 */ { "http://www.winehq.org", "http://www.codeweavers.com", 0, S_OK, URLPOLICY_DISALLOW },
1901 /* 4 */ { "http://www.winehq.org", "http://www.winehq.org", GET_FEATURE_FROM_PROCESS, S_FALSE, -1 },
1902 /* 5 */ { "http://www.winehq.org", "http://www.winehq.org/dir", GET_FEATURE_FROM_PROCESS, S_FALSE, -1 },
1903 /* 6 */ { "http://www.winehq.org", "http://www.codeweavers.com", GET_FEATURE_FROM_PROCESS, S_FALSE, -1 },
1904 /* 7 */ { "http://www.winehq.org", "ftp://winehq.org", GET_FEATURE_FROM_PROCESS, S_FALSE, -1 },
1905 /* 8 */ { "http://www.winehq.org", "ftp://winehq.org", GET_FEATURE_FROM_PROCESS|0x100, S_FALSE, URLPOLICY_ALLOW },
1906 /* 9 */ { "http://www.winehq.org", "ftp://winehq.org", GET_FEATURE_FROM_REGISTRY, S_FALSE, URLPOLICY_ALLOW },
1907 };
1908
1909 WCHAR *url_from, *url_to;
1910 int i;
1911 HRESULT hres;
1912
1913 if(!pCoInternetIsFeatureZoneElevationEnabled || !pCoInternetIsFeatureEnabled
1914 || !pCoInternetIsFeatureEnabledForUrl) {
1915 win_skip("Skipping CoInternetIsFeatureZoneElevationEnabled tests\n");
1916 return;
1917 }
1918
1919
1920 hres = pCoInternetIsFeatureEnabled(FEATURE_ZONE_ELEVATION, GET_FEATURE_FROM_PROCESS);
1921 ok(SUCCEEDED(hres), "CoInternetIsFeatureEnabled returned %x\n", hres);
1922
1923 trace("Testing CoInternetIsFeatureZoneElevationEnabled... (%x)\n", hres);
1924
1925 for(i = 0; i < ARRAY_SIZE(testcases); i++) {
1926 if(hres==S_OK && testcases[i].flags == GET_FEATURE_FROM_PROCESS)
1927 testcases[i].policy_flags = URLPOLICY_ALLOW;
1928 }
1929
1930 /* IE10 does not seem to use passed ISecurityManager */
1931 SET_EXPECT(ProcessUrlAction);
1932 pCoInternetIsFeatureZoneElevationEnabled(url1, url1, &security_manager, 0);
1933 i = called_ProcessUrlAction;
1934 SET_CALLED(ProcessUrlAction);
1935 if(!i) {
1936 skip("CoInternetIsFeatureZoneElevationEnabled does not use passed ISecurityManager\n");
1937 return;
1938 }
1939
1940 for(i = 0; i < ARRAY_SIZE(testcases); i++) {
1941 url_from = a2w(testcases[i].url_from);
1942 url_to = a2w(testcases[i].url_to);
1943
1944 if(testcases[i].policy_flags != -1) {
1945 ProcessUrlAction_policy = testcases[i].policy_flags;
1946 SET_EXPECT(ProcessUrlAction);
1947 }
1948 hres = pCoInternetIsFeatureZoneElevationEnabled(url_from, url_to,
1949 &security_manager, testcases[i].flags);
1950 ok(hres == testcases[i].hres, "%d) CoInternetIsFeatureZoneElevationEnabled returned %x\n", i, hres);
1951 if(testcases[i].policy_flags != -1)
1952 CHECK_CALLED(ProcessUrlAction);
1953
1954 if(testcases[i].policy_flags != -1)
1955 SET_EXPECT(ProcessUrlAction);
1956 hres = pCoInternetIsFeatureEnabledForUrl(FEATURE_ZONE_ELEVATION,
1957 testcases[i].flags, url_to, &security_manager);
1958 ok(hres == testcases[i].hres, "%d) CoInternetIsFeatureEnabledForUrl returned %x\n", i, hres);
1959 if(testcases[i].policy_flags != -1)
1960 CHECK_CALLED(ProcessUrlAction);
1961
1962 heap_free(url_from);
1963 heap_free(url_to);
1964 }
1965}
GLbitfield flags
Definition: glext.h:7161
#define SET_EXPECT(func)
Definition: sec_mgr.c:43
#define CHECK_CALLED(func)
Definition: sec_mgr.c:59
#define SET_CALLED(func)
Definition: sec_mgr.c:65
static IInternetSecurityManager security_manager
Definition: sec_mgr.c:360

Referenced by START_TEST().

◆ test_CreateZoneEnumerator()

static void test_CreateZoneEnumerator ( void  )
static

Definition at line 1017 of file sec_mgr.c.

1018{
1019 IInternetZoneManager *zonemgr = NULL;
1020 HRESULT hr;
1021 DWORD dwEnum;
1022 DWORD dwEnum2;
1023 DWORD dwCount;
1024 DWORD dwCount2;
1025
1026 trace("testing zone enumerator...\n");
1027
1028 hr = pCoInternetCreateZoneManager(NULL, &zonemgr, 0);
1029 ok(hr == S_OK, "CoInternetCreateZoneManager result: 0x%x\n", hr);
1030 if (FAILED(hr))
1031 return;
1032
1033 dwEnum=0xdeadbeef;
1034 hr = IInternetZoneManager_CreateZoneEnumerator(zonemgr, &dwEnum, NULL, 0);
1035 ok((hr == E_INVALIDARG) && (dwEnum == 0xdeadbeef),
1036 "got 0x%x with 0x%x (expected E_INVALIDARG with 0xdeadbeef)\n", hr, dwEnum);
1037
1038 dwCount=0xdeadbeef;
1039 hr = IInternetZoneManager_CreateZoneEnumerator(zonemgr, NULL, &dwCount, 0);
1040 ok((hr == E_INVALIDARG) && (dwCount == 0xdeadbeef),
1041 "got 0x%x and 0x%x (expected E_INVALIDARG and 0xdeadbeef)\n", hr, dwCount);
1042
1043 dwEnum=0xdeadbeef;
1044 dwCount=0xdeadbeef;
1045 hr = IInternetZoneManager_CreateZoneEnumerator(zonemgr, &dwEnum, &dwCount, 0xffffffff);
1046 ok((hr == E_INVALIDARG) && (dwEnum == 0xdeadbeef) && (dwCount == 0xdeadbeef),
1047 "got 0x%x with 0x%x and 0x%x (expected E_INVALIDARG with 0xdeadbeef and 0xdeadbeef)\n",
1048 hr, dwEnum, dwCount);
1049
1050 dwEnum=0xdeadbeef;
1051 dwCount=0xdeadbeef;
1052 hr = IInternetZoneManager_CreateZoneEnumerator(zonemgr, &dwEnum, &dwCount, 1);
1053 ok((hr == E_INVALIDARG) && (dwEnum == 0xdeadbeef) && (dwCount == 0xdeadbeef),
1054 "got 0x%x with 0x%x and 0x%x (expected E_INVALIDARG with 0xdeadbeef and 0xdeadbeef)\n",
1055 hr, dwEnum, dwCount);
1056
1057 dwEnum=0xdeadbeef;
1058 dwCount=0xdeadbeef;
1059 /* Normal use */
1060 hr = IInternetZoneManager_CreateZoneEnumerator(zonemgr, &dwEnum, &dwCount, 0);
1061 ok(hr == S_OK, "got 0x%x (expected S_OK)\n", hr);
1062
1063 if (SUCCEEDED(hr)) {
1064 dwEnum2=0xdeadbeef;
1065 dwCount2=0xdeadbeef;
1066 hr = IInternetZoneManager_CreateZoneEnumerator(zonemgr, &dwEnum2, &dwCount2, 0);
1067 ok(hr == S_OK, "got 0x%x (expected S_OK)\n", hr);
1068 if (SUCCEEDED(hr)) {
1069 /* native urlmon has an incrementing counter for dwEnum */
1070 hr = IInternetZoneManager_DestroyZoneEnumerator(zonemgr, dwEnum2);
1071 ok(hr == S_OK, "got 0x%x (expected S_OK)\n", hr);
1072 }
1073
1074 hr = IInternetZoneManager_DestroyZoneEnumerator(zonemgr, dwEnum);
1075 ok(hr == S_OK, "got 0x%x (expected S_OK)\n", hr);
1076
1077 /* Destroy the Enumerator twice is detected and handled in native urlmon */
1078 hr = IInternetZoneManager_DestroyZoneEnumerator(zonemgr, dwEnum);
1079 ok((hr == E_INVALIDARG), "got 0x%x (expected E_INVALIDARG)\n", hr);
1080 }
1081
1082 /* ::Release succeed also, when a ::DestroyZoneEnumerator is missing */
1083 hr = IInternetZoneManager_Release(zonemgr);
1084 ok(hr == S_OK, "got 0x%x (expected S_OK)\n", hr);
1085}
#define E_INVALIDARG
Definition: ddrawi.h:101

Referenced by START_TEST().

◆ test_GetZoneActionPolicy()

static void test_GetZoneActionPolicy ( void  )
static

Definition at line 1087 of file sec_mgr.c.

1088{
1089 IInternetZoneManager *zonemgr = NULL;
1090 BYTE buf[32];
1091 HRESULT hres;
1092 DWORD action = URLACTION_CREDENTIALS_USE; /* Implemented on all IE versions */
1093
1094 trace("testing GetZoneActionPolixy...\n");
1095
1096 hres = pCoInternetCreateZoneManager(NULL, &zonemgr, 0);
1097 ok(hres == S_OK, "CoInternetCreateZoneManager failed: %08x\n", hres);
1098 if(FAILED(hres))
1099 return;
1100
1101 hres = IInternetZoneManager_GetZoneActionPolicy(zonemgr, 3, action, buf,
1102 sizeof(DWORD), URLZONEREG_DEFAULT);
1103 ok(hres == S_OK, "GetZoneActionPolicy failed: %08x\n", hres);
1104 ok(*(DWORD*)buf == URLPOLICY_CREDENTIALS_SILENT_LOGON_OK ||
1105 *(DWORD*)buf == URLPOLICY_CREDENTIALS_MUST_PROMPT_USER ||
1106 *(DWORD*)buf == URLPOLICY_CREDENTIALS_CONDITIONAL_PROMPT ||
1107 *(DWORD*)buf == URLPOLICY_CREDENTIALS_ANONYMOUS_ONLY,
1108 "unexpected policy=%d\n", *(DWORD*)buf);
1109
1110 hres = IInternetZoneManager_GetZoneActionPolicy(zonemgr, 3, action, NULL,
1111 sizeof(DWORD), URLZONEREG_DEFAULT);
1112 ok(hres == E_INVALIDARG, "GetZoneActionPolicy failed: %08x, expected E_INVALIDARG\n", hres);
1113
1114 hres = IInternetZoneManager_GetZoneActionPolicy(zonemgr, 3, action, buf,
1115 2, URLZONEREG_DEFAULT);
1116 ok(hres == E_INVALIDARG, "GetZoneActionPolicy failed: %08x, expected E_INVALIDARG\n", hres);
1117
1118 hres = IInternetZoneManager_GetZoneActionPolicy(zonemgr, 3, 0x1fff, buf,
1119 sizeof(DWORD), URLZONEREG_DEFAULT);
1121 "(0x%x) got 0x%x (expected E_FAIL)\n", action, hres);
1122
1123 hres = IInternetZoneManager_GetZoneActionPolicy(zonemgr, 13, action, buf,
1124 sizeof(DWORD), URLZONEREG_DEFAULT);
1125 ok(hres == E_INVALIDARG, "GetZoneActionPolicy failed: %08x, expected E_INVALIDARG\n", hres);
1126
1127 IInternetZoneManager_Release(zonemgr);
1128}
const WCHAR * action
Definition: action.c:7479
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 1130 of file sec_mgr.c.

1131{
1132 IInternetZoneManager *zonemgr = NULL;
1133 HRESULT hr;
1134 DWORD dwEnum;
1135 DWORD dwCount;
1136 DWORD dwZone;
1137 DWORD i;
1138
1139 trace("testing GetZoneAt...\n");
1140
1141 hr = pCoInternetCreateZoneManager(NULL, &zonemgr, 0);
1142 ok(hr == S_OK, "CoInternetCreateZoneManager result: 0x%x\n", hr);
1143 if (FAILED(hr))
1144 return;
1145
1146 hr = IInternetZoneManager_CreateZoneEnumerator(zonemgr, &dwEnum, &dwCount, 0);
1147 if (FAILED(hr))
1148 goto cleanup;
1149
1150 if (0) {
1151 /* this crashes with native urlmon */
1152 IInternetZoneManager_GetZoneAt(zonemgr, dwEnum, 0, NULL);
1153 }
1154
1155 dwZone = 0xdeadbeef;
1156 hr = IInternetZoneManager_GetZoneAt(zonemgr, 0xdeadbeef, 0, &dwZone);
1157 ok(hr == E_INVALIDARG,
1158 "got 0x%x with 0x%x (expected E_INVALIDARG)\n", hr, dwZone);
1159
1160 for (i = 0; i < dwCount; i++)
1161 {
1162 dwZone = 0xdeadbeef;
1163 hr = IInternetZoneManager_GetZoneAt(zonemgr, dwEnum, i, &dwZone);
1164 ok(hr == S_OK, "#%d: got x%x with %d (expected S_OK)\n", i, hr, dwZone);
1165 }
1166
1167 dwZone = 0xdeadbeef;
1168 /* MSDN (index .. must be .. less than or equal to) is wrong */
1169 hr = IInternetZoneManager_GetZoneAt(zonemgr, dwEnum, dwCount, &dwZone);
1170 ok(hr == E_INVALIDARG,
1171 "got 0x%x with 0x%x (expected E_INVALIDARG)\n", hr, dwZone);
1172
1173 hr = IInternetZoneManager_DestroyZoneEnumerator(zonemgr, dwEnum);
1174 ok(hr == S_OK, "got 0x%x (expected S_OK)\n", hr);
1175
1176cleanup:
1177 hr = IInternetZoneManager_Release(zonemgr);
1178 ok(hr == S_OK, "got 0x%x (expected S_OK)\n", hr);
1179}

Referenced by START_TEST().

◆ test_GetZoneAttributes()

static void test_GetZoneAttributes ( void  )
static

Definition at line 1181 of file sec_mgr.c.

1182{
1183 IInternetZoneManager *zonemgr = NULL;
1184 CHAR buffer [sizeof(ZONEATTRIBUTES) + 32];
1185 ZONEATTRIBUTES* pZA = (ZONEATTRIBUTES*) buffer;
1186 HRESULT hr;
1187 DWORD i;
1188
1189 trace("testing GetZoneAttributes...\n");
1190
1191 hr = pCoInternetCreateZoneManager(NULL, &zonemgr, 0);
1192 ok(hr == S_OK, "CoInternetCreateZoneManager result: 0x%x\n", hr);
1193 if (FAILED(hr))
1194 return;
1195
1196 /* native urlmon has Zone "0" up to Zone "4" since IE4 */
1197 for (i = 0; i < 5; i++) {
1198 memset(buffer, -1, sizeof(buffer));
1199 hr = IInternetZoneManager_GetZoneAttributes(zonemgr, i, pZA);
1200 ok(hr == S_OK, "#%d: got 0x%x (expected S_OK)\n", i, hr);
1201 }
1202
1203 /* IE8 no longer set cbSize */
1204 memset(buffer, -1, sizeof(buffer));
1205 pZA->cbSize = 0;
1206 hr = IInternetZoneManager_GetZoneAttributes(zonemgr, 0, pZA);
1207 ok(hr == S_OK, "got 0x%x (expected S_OK)\n", hr);
1208 ok((pZA->cbSize == 0) || (pZA->cbSize == sizeof(ZONEATTRIBUTES)),
1209 "got cbSize = %d (expected 0)\n", pZA->cbSize);
1210
1211 memset(buffer, -1, sizeof(buffer));
1212 pZA->cbSize = 64;
1213 hr = IInternetZoneManager_GetZoneAttributes(zonemgr, 0, pZA);
1214 ok(hr == S_OK, "got 0x%x (expected S_OK)\n", hr);
1215 ok((pZA->cbSize == 64) || (pZA->cbSize == sizeof(ZONEATTRIBUTES)),
1216 "got cbSize = %d (expected 64)\n", pZA->cbSize);
1217
1218 memset(buffer, -1, sizeof(buffer));
1219 hr = IInternetZoneManager_GetZoneAttributes(zonemgr, 0, pZA);
1220 ok(hr == S_OK, "got 0x%x (expected S_OK)\n", hr);
1221 ok((pZA->cbSize == 0xffffffff) || (pZA->cbSize == sizeof(ZONEATTRIBUTES)),
1222 "got cbSize = 0x%x (expected 0xffffffff)\n", pZA->cbSize);
1223
1224 /* IE8 up to IE10 don't fail on invalid zones */
1225 memset(buffer, -1, sizeof(buffer));
1226 hr = IInternetZoneManager_GetZoneAttributes(zonemgr, 0xdeadbeef, pZA);
1227 ok(hr == S_OK || hr == E_FAIL || hr == E_POINTER,
1228 "got 0x%x (expected S_OK or E_FAIL)\n", hr);
1229
1230 hr = IInternetZoneManager_GetZoneAttributes(zonemgr, 0, NULL);
1231 ok(hr == E_INVALIDARG, "got 0x%x (expected E_INVALIDARG)\n", hr);
1232
1233 hr = IInternetZoneManager_Release(zonemgr);
1234 ok(hr == S_OK, "got 0x%x (expected S_OK)\n", hr);
1235}
GLuint buffer
Definition: glext.h:5915
#define memset(x, y, z)
Definition: compat.h:39
#define E_POINTER
Definition: winerror.h:2365

Referenced by START_TEST().

◆ test_InternetGetSecurityUrl()

static void test_InternetGetSecurityUrl ( void  )
static

Definition at line 1344 of file sec_mgr.c.

1345{
1346 const WCHAR url5_out[] = {'h','t','t','p',':','w','w','w','.','z','o','n','e','3',
1347 '.','w','i','n','e','t','e','s','t',0};
1348 const WCHAR url7_out[] = {'f','t','p',':','z','o','n','e','3','.','w','i','n','e','t','e','s','t',0};
1349
1350 const WCHAR *in[] = {url2, url3, url4, url5, url7, url8, url9, url10};
1351 const WCHAR *out_default[] = {url2, url3, url4, url5_out, url7_out, url8, url5_out, url10};
1352 const WCHAR *out_securl[] = {url2, url3, url4, url5, url7, url8, url9, url10};
1353
1354 WCHAR *sec;
1355 DWORD i;
1356 HRESULT hres;
1357
1358 trace("testing CoInternetGetSecurityUrl...\n");
1359
1360 for(i = 0; i < ARRAY_SIZE(in); i++) {
1361 hres = pCoInternetGetSecurityUrl(in[i], &sec, PSU_DEFAULT, 0);
1362 ok(hres == S_OK, "(%d) CoInternetGetSecurityUrl returned: %08x\n", i, hres);
1363 if(hres == S_OK) {
1364 ok(!strcmp_w(sec, out_default[i]), "(%d) Got %s, expected %s\n",
1365 i, wine_dbgstr_w(sec), wine_dbgstr_w(out_default[i]));
1366 CoTaskMemFree(sec);
1367 }
1368
1369 hres = pCoInternetGetSecurityUrl(in[i], &sec, PSU_SECURITY_URL_ONLY, 0);
1370 ok(hres == S_OK, "(%d) CoInternetGetSecurityUrl returned: %08x\n", i, hres);
1371 if(hres == S_OK) {
1372 ok(!strcmp_w(sec, out_securl[i]), "(%d) Got %s, expected %s\n",
1373 i, wine_dbgstr_w(sec), wine_dbgstr_w(out_securl[i]));
1374 CoTaskMemFree(sec);
1375 }
1376 }
1377
1378 SET_EXPECT(ParseUrl_SECURITY_URL_input2);
1379 SET_EXPECT(ParseUrl_SECURITY_URL_expected);
1380 SET_EXPECT(ParseUrl_SECURITY_DOMAIN_expected);
1381
1382 hres = pCoInternetGetSecurityUrl(security_url2W, &sec, PSU_DEFAULT, 0);
1383 ok(hres == S_OK, "CoInternetGetSecurityUrl returned 0x%08x, expected S_OK\n", hres);
1384
1385 CHECK_CALLED(ParseUrl_SECURITY_URL_input2);
1386 CHECK_CALLED(ParseUrl_SECURITY_URL_expected);
1387 CHECK_CALLED(ParseUrl_SECURITY_DOMAIN_expected);
1388
1389 ok(!lstrcmpW(security_expectedW, sec), "Expected %s but got %s\n",
1391 CoTaskMemFree(sec);
1392}
GLuint in
Definition: glext.h:9616
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:442
static const WCHAR url5[]
Definition: sec_mgr.c:93
static const WCHAR url4[]
Definition: sec_mgr.c:91
static const WCHAR url8[]
Definition: sec_mgr.c:98
static const WCHAR url2[]
Definition: sec_mgr.c:89
static const WCHAR url3[]
Definition: sec_mgr.c:90
static const WCHAR url10[]
Definition: sec_mgr.c:101
static const WCHAR url7[]
Definition: sec_mgr.c:96

Referenced by START_TEST().

◆ test_InternetGetSecurityUrlEx()

static void test_InternetGetSecurityUrlEx ( void  )
static

Definition at line 1609 of file sec_mgr.c.

1610{
1611 HRESULT hr;
1612 DWORD i;
1613 IUri *uri = NULL, *result = NULL;
1614
1615 trace("testing CoInternetGetSecurityUrlEx...\n");
1616
1617 hr = pCoInternetGetSecurityUrlEx(NULL, NULL, PSU_DEFAULT, 0);
1618 ok(hr == E_INVALIDARG, "CoInternetGetSecurityUrlEx returned 0x%08x, expected E_INVALIDARG\n", hr);
1619
1620 result = (void*) 0xdeadbeef;
1621 hr = pCoInternetGetSecurityUrlEx(NULL, &result, PSU_DEFAULT, 0);
1622 ok(hr == E_INVALIDARG, "CoInternetGetSecurityUrlEx returned 0x%08x, expected E_INVALIDARG\n", hr);
1623 ok(result == (void*) 0xdeadbeef, "'result' was %p\n", result);
1624
1625 for(i = 0; i < ARRAY_SIZE(sec_url_ex_tests); ++i) {
1626 LPWSTR uriW = a2w(sec_url_ex_tests[i].uri);
1627 uri = NULL;
1628
1629 hr = pCreateUri(uriW, sec_url_ex_tests[i].create_flags, 0, &uri);
1630 ok(hr == S_OK, "CreateUri returned 0x%08x on test %d\n", hr, i);
1631 if(hr == S_OK) {
1632 result = NULL;
1633
1634 hr = pCoInternetGetSecurityUrlEx(uri, &result, PSU_DEFAULT, 0);
1637 "CoInternetGetSecurityUrlEx returned 0x%08x, expected 0x%08x on test %d\n",
1639 }
1640 if(SUCCEEDED(hr)) {
1641 BSTR received;
1642
1643 hr = IUri_GetDisplayUri(result, &received);
1644 ok(hr == S_OK, "GetDisplayUri returned 0x%08x on test %d\n", hr, i);
1645 if(hr == S_OK) {
1648 "Expected %s but got %s on test %d\n", sec_url_ex_tests[i].default_uri,
1650 }
1651 }
1653 }
1654 if(result) IUri_Release(result);
1655
1656 result = NULL;
1657 hr = pCoInternetGetSecurityUrlEx(uri, &result, PSU_SECURITY_URL_ONLY, 0);
1660 "CoInternetGetSecurityUrlEx returned 0x%08x, expected 0x%08x on test %d\n",
1662 }
1663 if(SUCCEEDED(hr)) {
1664 BSTR received;
1665
1666 hr = IUri_GetDisplayUri(result, &received);
1667 ok(hr == S_OK, "GetDisplayUri returned 0x%08x on test %d\n", hr, i);
1668 if(hr == S_OK) {
1671 "Expected %s but got %s on test %d\n", sec_url_ex_tests[i].default_uri,
1673 }
1674 }
1676 }
1677 if(result) IUri_Release(result);
1678 }
1679
1680 if(uri) IUri_Release(uri);
1681 heap_free(uriW);
1682 }
1683}
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: custom.c:76
const char * default_uri
Definition: sec_mgr.c:1592
const char * uri
Definition: sec_mgr.c:1588
static DWORD strcmp_aw(LPCSTR strA, LPCWSTR strB)
Definition: sec_mgr.c:190
DWORD create_flags
Definition: sec_mgr.c:1589
static const struct @1711 sec_url_ex_tests[]
BOOL todo
Definition: sec_mgr.c:1594
HRESULT default_hres
Definition: sec_mgr.c:1593
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 1685 of file sec_mgr.c.

1686{
1687 HRESULT hr;
1688 IUri *uri = NULL, *result;
1689
1690 trace("testing CoInternetGetSecurityUrlEx for pluggable protocols...\n");
1691
1692 hr = pCreateUri(security_urlW, 0, 0, &uri);
1693 ok(hr == S_OK, "CreateUri returned 0x%08x\n", hr);
1694 if(hr == S_OK) {
1695 SET_EXPECT(ParseUrl_SECURITY_URL_input);
1696 SET_EXPECT(ParseUrl_SECURITY_URL_expected);
1697 SET_EXPECT(ParseUrl_SECURITY_DOMAIN_expected);
1698
1699 hr = pCoInternetGetSecurityUrlEx(uri, &result, PSU_DEFAULT, 0);
1700 ok(hr == S_OK, "CoInternetGetSecurityUrlEx returned 0x%08x, expected S_OK\n", hr);
1701
1702 CHECK_CALLED(ParseUrl_SECURITY_URL_input);
1703 CHECK_CALLED(ParseUrl_SECURITY_URL_expected);
1704 CHECK_CALLED(ParseUrl_SECURITY_DOMAIN_expected);
1705
1706 if(hr == S_OK) {
1707 BSTR received = NULL;
1708
1709 hr = IUri_GetAbsoluteUri(result, &received);
1710 ok(hr == S_OK, "GetAbsoluteUri returned 0x%08x\n", hr);
1711 if(hr == S_OK) {
1712 ok(!strcmp_w(security_expectedW, received), "Expected %s but got %s\n",
1714 }
1716 }
1717 if(result) IUri_Release(result);
1718
1719 result = NULL;
1720
1721 SET_EXPECT(ParseUrl_SECURITY_URL_input);
1722 SET_EXPECT(ParseUrl_SECURITY_URL_expected);
1723
1724 hr = pCoInternetGetSecurityUrlEx(uri, &result, PSU_SECURITY_URL_ONLY, 0);
1725 ok(hr == S_OK, "CoInternetGetSecurityUrlEx returned 0x%08x, expected S_OK\n", hr);
1726
1727 CHECK_CALLED(ParseUrl_SECURITY_URL_input);
1728 CHECK_CALLED(ParseUrl_SECURITY_URL_expected);
1729
1730 if(hr == S_OK) {
1731 BSTR received = NULL;
1732
1733 hr = IUri_GetAbsoluteUri(result, &received);
1734 ok(hr == S_OK, "GetAbsoluteUri returned 0x%08x\n", hr);
1735 if(hr == S_OK) {
1736 ok(!strcmp_w(security_expectedW, received), "Expected %s but got %s\n",
1738 }
1740 }
1741 if(result) IUri_Release(result);
1742 }
1743 if(uri) IUri_Release(uri);
1744}

Referenced by START_TEST().

◆ test_InternetSecurityMarshalling()

static void test_InternetSecurityMarshalling ( void  )
static

Definition at line 1314 of file sec_mgr.c.

1315{
1317 IUnknown *unk;
1318 IStream *stream;
1319 HRESULT hres;
1320
1321 trace("testing marshalling...\n");
1322
1323 hres = pCoInternetCreateSecurityManager(NULL, &secmgr, 0);
1324 ok(hres == S_OK, "CoInternetCreateSecurityManager failed: %08x\n", hres);
1325 if(FAILED(hres))
1326 return;
1327
1328 hres = IInternetSecurityManager_QueryInterface(secmgr, &IID_IUnknown, (void**)&unk);
1329 ok(hres == S_OK, "QueryInterface returned: %08x\n", hres);
1330
1332 ok(hres == S_OK, "CreateStreamOnHGlobal returned: %08x\n", hres);
1333
1334 hres = CoMarshalInterface(stream, &IID_IInternetSecurityManager, unk, MSHCTX_INPROC, NULL, MSHLFLAGS_NORMAL);
1335 /* Not supported in W98 */
1337 "CoMarshalInterface returned: %08x\n", hres);
1338
1339 IStream_Release(stream);
1340 IUnknown_Release(unk);
1341 IInternetSecurityManager_Release(secmgr);
1342}
HRESULT WINAPI CreateStreamOnHGlobal(HGLOBAL hGlobal, BOOL fDeleteOnRelease, LPSTREAM *ppstm)
HRESULT WINAPI CoMarshalInterface(IStream *pStream, REFIID riid, IUnknown *pUnk, DWORD dwDestContext, void *pvDestContext, DWORD mshlFlags)
Definition: marshal.c:1876
Definition: parse.h:23
#define REGDB_E_IIDNOTREG
Definition: winerror.h:2697

Referenced by START_TEST().

◆ test_polices()

static void test_polices ( void  )
static

Definition at line 651 of file sec_mgr.c.

652{
653 IInternetZoneManager *zonemgr = NULL;
656
657 trace("testing polices...\n");
658
659 hres = pCoInternetCreateSecurityManager(NULL, &secmgr, 0);
660 ok(hres == S_OK, "CoInternetCreateSecurityManager failed: %08x\n", hres);
661 hres = pCoInternetCreateZoneManager(NULL, &zonemgr, 0);
662 ok(hres == S_OK, "CoInternetCreateZoneManager failed: %08x\n", hres);
663
664 test_url_action(secmgr, zonemgr, URLACTION_SCRIPT_RUN);
665 test_url_action(secmgr, zonemgr, URLACTION_ACTIVEX_RUN);
666 test_url_action(secmgr, zonemgr, URLACTION_ACTIVEX_OVERRIDE_OBJECT_SAFETY);
667 test_url_action(secmgr, zonemgr, URLACTION_CHANNEL_SOFTDIST_PERMISSIONS);
668 test_url_action(secmgr, zonemgr, 0xdeadbeef);
669
670 test_special_url_action(secmgr, zonemgr, URLACTION_SCRIPT_OVERRIDE_SAFETY);
671 test_special_url_action(secmgr, zonemgr, URLACTION_ACTIVEX_OVERRIDE_SCRIPT_SAFETY);
672
673 test_activex(secmgr);
674
675 IInternetSecurityManager_Release(secmgr);
676 IInternetZoneManager_Release(zonemgr);
677}
static void test_special_url_action(IInternetSecurityManager *secmgr, IInternetZoneManager *zonemgr, DWORD action)
Definition: sec_mgr.c:607
static void test_activex(IInternetSecurityManager *secmgr)
Definition: sec_mgr.c:630
static void test_url_action(IInternetSecurityManager *secmgr, IInternetZoneManager *zonemgr, DWORD action)
Definition: sec_mgr.c:494

Referenced by START_TEST().

◆ test_SecurityManager()

static void test_SecurityManager ( void  )
static

Definition at line 362 of file sec_mgr.c.

363{
364 int i;
366 BYTE buf[512];
369
370 if(!pCoInternetCreateSecurityManager) {
371 return;
372 }
373
374 trace("Testing security manager...\n");
375
376 hres = pCoInternetCreateSecurityManager(NULL, &secmgr, 0);
377 ok(hres == S_OK, "CoInternetCreateSecurityManager failed: %08x\n", hres);
378 if(FAILED(hres))
379 return;
380
381 for(i = 0; i < ARRAY_SIZE(secmgr_tests); i++) {
382 zone = 100;
383 hres = IInternetSecurityManager_MapUrlToZone(secmgr, secmgr_tests[i].url,
384 &zone, 0);
385 ok(hres == secmgr_tests[i].zone_hres /* IE <=6 */
386 || (FAILED(secmgr_tests[i].zone_hres) && hres == E_INVALIDARG), /* IE7 */
387 "[%d] MapUrlToZone failed: %08x, expected %08x\n",
388 i, hres, secmgr_tests[i].zone_hres);
389 if(SUCCEEDED(hres))
390 ok(zone == secmgr_tests[i].zone, "[%d] zone=%d, expected %d\n", i, zone,
392 else
393 ok(zone == secmgr_tests[i].zone || zone == -1, "[%d] zone=%d\n", i, zone);
394
395 size = sizeof(buf);
396 memset(buf, 0xf0, sizeof(buf));
397 hres = IInternetSecurityManager_GetSecurityId(secmgr, secmgr_tests[i].url,
398 buf, &size, 0);
400 "[%d] GetSecurityId failed: %08x, expected %08x\n",
402 if(secmgr_tests[i].secid) {
403 ok(size == secmgr_tests[i].secid_size, "[%d] size=%d, expected %d\n",
405 ok(!memcmp(buf, secmgr_tests[i].secid, size), "[%d] wrong secid\n", i);
406 }
407 }
408
409 zone = 100;
410 hres = IInternetSecurityManager_MapUrlToZone(secmgr, url10, &zone, 0);
411 ok(hres == S_OK, "MapUrlToZone failed: %08x, expected S_OK\n", hres);
412 ok(zone == 3, "zone=%d, expected 3\n", zone);
413
414 /* win2k3 translates %20 into a space */
415 size = sizeof(buf);
416 memset(buf, 0xf0, sizeof(buf));
417 hres = IInternetSecurityManager_GetSecurityId(secmgr, url10, buf, &size, 0);
418 ok(hres == S_OK, "GetSecurityId failed: %08x, expected S_OK\n", hres);
419 ok(size == sizeof(secid10) ||
420 size == sizeof(secid10_2), /* win2k3 */
421 "size=%d\n", size);
422 ok(!memcmp(buf, secid10, sizeof(secid10)) ||
423 !memcmp(buf, secid10_2, sizeof(secid10_2)), /* win2k3 */
424 "wrong secid\n");
425
426 zone = 100;
427 hres = IInternetSecurityManager_MapUrlToZone(secmgr, url13, &zone, 0);
428 ok(hres == S_OK, "MapUrlToZone failed: %08x\n", hres);
429 ok(zone == URLZONE_INVALID || broken(zone == URLZONE_INTERNET), "zone=%d\n", zone);
430
431 size = sizeof(buf);
432 memset(buf, 0xf0, sizeof(buf));
433 hres = IInternetSecurityManager_GetSecurityId(secmgr, url13, buf, &size, 0);
434 ok(hres == E_INVALIDARG || broken(hres == S_OK), "GetSecurityId failed: %08x\n", hres);
435
436 zone = 100;
437 hres = IInternetSecurityManager_MapUrlToZone(secmgr, url14, &zone, 0);
438 ok(hres == S_OK, "MapUrlToZone failed: %08x, expected S_OK\n", hres);
439 ok(zone == URLZONE_INTERNET, "zone=%d\n", zone);
440
441 size = sizeof(buf);
442 memset(buf, 0xf0, sizeof(buf));
443 hres = IInternetSecurityManager_GetSecurityId(secmgr, url14, buf, &size, 0);
444 ok(hres == S_OK, "GetSecurityId failed: %08x, expected S_OK\n", hres);
445 ok(size == sizeof(secid14), "size=%d\n", size);
446 ok(!memcmp(buf, secid14, size), "wrong secid\n");
447
448 zone = 100;
449 hres = IInternetSecurityManager_MapUrlToZone(secmgr, NULL, &zone, 0);
450 ok(hres == E_INVALIDARG, "MapUrlToZone failed: %08x, expected E_INVALIDARG\n", hres);
451 ok(zone == 100 || zone == -1, "zone=%d\n", zone);
452
453 size = sizeof(buf);
454 hres = IInternetSecurityManager_GetSecurityId(secmgr, NULL, buf, &size, 0);
456 "GetSecurityId failed: %08x, expected E_INVALIDARG\n", hres);
457 hres = IInternetSecurityManager_GetSecurityId(secmgr, secmgr_tests[1].url,
458 NULL, &size, 0);
460 "GetSecurityId failed: %08x, expected E_INVALIDARG\n", hres);
461 hres = IInternetSecurityManager_GetSecurityId(secmgr, secmgr_tests[1].url,
462 buf, NULL, 0);
464 "GetSecurityId failed: %08x, expected E_INVALIDARG\n", hres);
465
466 hres = IInternetSecurityManager_ProcessUrlAction(secmgr, NULL, URLACTION_SCRIPT_RUN, (BYTE*)&policy,
467 sizeof(WCHAR), NULL, 0, 0, 0);
468 ok(hres == E_INVALIDARG, "ProcessUrlAction failed: %08x, expected E_INVALIDARG\n", hres);
469
470 IInternetSecurityManager_Release(secmgr);
471}
static const WCHAR url[]
Definition: encode.c:1432
HRESULT secid_hres
Definition: sec_mgr.c:1758
static const WCHAR url14[]
Definition: sec_mgr.c:106
static const BYTE secid10_2[]
Definition: sec_mgr.c:132
static struct secmgr_test secmgr_tests[]
static const BYTE secid14[]
Definition: sec_mgr.c:130
static const WCHAR url13[]
Definition: sec_mgr.c:105
const BYTE * secid
Definition: sec_mgr.c:1756
DWORD secid_size
Definition: sec_mgr.c:1757
static const BYTE secid10[]
Definition: sec_mgr.c:128

Referenced by START_TEST().

◆ test_SecurityManagerEx2()

static void test_SecurityManagerEx2 ( void  )
static

Definition at line 1776 of file sec_mgr.c.

1777{
1778 HRESULT hres;
1779 DWORD i, zone;
1780 BYTE buf[512];
1781 DWORD buf_size = sizeof(buf);
1782 IInternetSecurityManager *sec_mgr;
1784 IUri *uri = NULL;
1785
1786 static const WCHAR domainW[] = {'c','o','m','.','u','k',0};
1787
1788 if(!pCreateUri) {
1789 win_skip("Skipping SecurityManagerEx2, IE is too old\n");
1790 return;
1791 }
1792
1793 trace("Testing SecurityManagerEx2...\n");
1794
1795 hres = pCoInternetCreateSecurityManager(NULL, &sec_mgr, 0);
1796 ok(hres == S_OK, "CoInternetCreateSecurityManager failed: %08x\n", hres);
1797
1798 hres = IInternetSecurityManager_QueryInterface(sec_mgr, &IID_IInternetSecurityManagerEx2, (void**)&sec_mgr2);
1799 ok(hres == S_OK, "QueryInterface(IID_IInternetSecurityManagerEx2) failed: %08x\n", hres);
1800
1801 zone = 0xdeadbeef;
1802
1803 hres = IInternetSecurityManagerEx2_MapUrlToZoneEx2(sec_mgr2, NULL, &zone, 0, NULL, NULL);
1804 ok(hres == E_INVALIDARG, "MapUrlToZoneEx2 returned %08x, expected E_INVALIDARG\n", hres);
1805 ok(zone == URLZONE_INVALID, "zone was %d\n", zone);
1806
1807 hres = IInternetSecurityManagerEx2_GetSecurityIdEx2(sec_mgr2, NULL, buf, &buf_size, 0);
1808 ok(hres == E_INVALIDARG, "GetSecurityIdEx2 returned %08x, expected E_INVALIDARG\n", hres);
1809 ok(buf_size == sizeof(buf), "buf_size was %d\n", buf_size);
1810
1811 hres = pCreateUri(url5, 0, 0, &uri);
1812 ok(hres == S_OK, "CreateUri failed: %08x\n", hres);
1813
1814 hres = IInternetSecurityManagerEx2_MapUrlToZoneEx2(sec_mgr2, uri, NULL, 0, NULL, NULL);
1815 ok(hres == E_INVALIDARG, "MapToUrlZoneEx2 returned %08x, expected E_INVALIDARG\n", hres);
1816
1817 buf_size = sizeof(buf);
1818 hres = IInternetSecurityManagerEx2_GetSecurityIdEx2(sec_mgr2, uri, NULL, &buf_size, 0);
1819 ok(hres == E_INVALIDARG || broken(hres == S_OK), "GetSecurityIdEx2 failed: %08x\n", hres);
1820 ok(buf_size == sizeof(buf), "bug_size was %d\n", buf_size);
1821
1822 hres = IInternetSecurityManagerEx2_GetSecurityIdEx2(sec_mgr2, uri, buf, NULL, 0);
1823 ok(hres == E_INVALIDARG, "GetSecurityIdEx2 returned %08x, expected E_INVALIDARG\n", hres);
1824
1825 IUri_Release(uri);
1826
1827 for(i = 0; i < ARRAY_SIZE(sec_mgr_ex2_tests); ++i) {
1828 LPWSTR uriW = a2w(sec_mgr_ex2_tests[i].uri);
1829
1830 uri = NULL;
1831 zone = URLZONE_INVALID;
1832
1833 hres = pCreateUri(uriW, sec_mgr_ex2_tests[i].create_flags, 0, &uri);
1834 ok(hres == S_OK, "CreateUri returned %08x for '%s'\n", hres, sec_mgr_ex2_tests[i].uri);
1835
1836 hres = IInternetSecurityManagerEx2_MapUrlToZoneEx2(sec_mgr2, uri, &zone, 0, NULL, NULL);
1838 ok(hres == sec_mgr_ex2_tests[i].map_hres, "MapUrlToZoneEx2 returned %08x, expected %08x for '%s'\n",
1840 ok(zone == sec_mgr_ex2_tests[i].zone, "Expected zone %d, but got %d for '%s'\n", sec_mgr_ex2_tests[i].zone,
1842 }
1843
1844 buf_size = sizeof(buf);
1845 memset(buf, 0xf0, buf_size);
1846
1847 hres = IInternetSecurityManagerEx2_GetSecurityIdEx2(sec_mgr2, uri, buf, &buf_size, 0);
1849 ok(hres == sec_mgr_ex2_tests[i].secid_hres, "GetSecurityIdEx2 returned %08x, expected %08x on test '%s'\n",
1852 ok(buf_size == sec_mgr_ex2_tests[i].secid_size, "Got wrong security id size=%d, expected %d on test '%s'\n",
1854 ok(!memcmp(buf, sec_mgr_ex2_tests[i].secid, sec_mgr_ex2_tests[i].secid_size), "Got wrong security id on test '%s'\n",
1856 }
1857 }
1858
1859 heap_free(uriW);
1860 IUri_Release(uri);
1861 }
1862
1863 hres = pCreateUri(url15, 0, 0, &uri);
1864 ok(hres == S_OK, "CreateUri failed: %08x\n", hres);
1865
1866 buf_size = sizeof(buf);
1867 memset(buf, 0xf0, buf_size);
1868
1869 hres = IInternetSecurityManagerEx2_GetSecurityIdEx2(sec_mgr2, uri, buf, &buf_size, (DWORD_PTR)domainW);
1870 ok(hres == S_OK, "GetSecurityIdEx2 failed: %08x\n", hres);
1871 todo_wine ok(buf_size == sizeof(secid13), "buf_size was %d\n", buf_size);
1872 todo_wine ok(!memcmp(buf, secid13, sizeof(secid13)), "Got wrong secid\n");
1873
1874 buf_size = sizeof(buf);
1875 memset(buf, 0xf0, buf_size);
1876
1877 hres = IInternetSecurityManagerEx2_GetSecurityIdEx2(sec_mgr2, uri, buf, &buf_size, 0);
1878 ok(hres == S_OK, "GetSecurityIdEx2 failed: %08x\n", hres);
1879 ok(buf_size == sizeof(secid13_2), "buf_size was %d\n", buf_size);
1880 ok(!memcmp(buf, secid13_2, sizeof(secid13_2)), "Got wrong secid\n");
1881
1882 IUri_Release(uri);
1883
1884 IInternetSecurityManagerEx2_Release(sec_mgr2);
1885 IInternetSecurityManager_Release(sec_mgr);
1886}
static const WCHAR url15[]
Definition: sec_mgr.c:107
BOOL secid_todo
Definition: sec_mgr.c:1759
HRESULT map_hres
Definition: sec_mgr.c:1753
BOOL map_todo
Definition: sec_mgr.c:1755
static const BYTE secid13[]
Definition: sec_mgr.c:134
static const BYTE secid13_2[]
Definition: sec_mgr.c:135
static const struct @1712 sec_mgr_ex2_tests[]
uint32_t DWORD_PTR
Definition: typedefs.h:65

Referenced by START_TEST().

◆ test_SetZoneAttributes()

static void test_SetZoneAttributes ( void  )
static

Definition at line 1237 of file sec_mgr.c.

1238{
1239 IInternetZoneManager *zonemgr = NULL;
1240 CHAR buffer [sizeof(ZONEATTRIBUTES) + 16];
1241 ZONEATTRIBUTES* pZA = (ZONEATTRIBUTES*) buffer;
1242 CHAR regpath[MAX_PATH];
1243 HKEY hkey;
1244 HRESULT hr;
1245 DWORD res;
1246
1247 trace("testing SetZoneAttributes...\n");
1248 hr = pCoInternetCreateZoneManager(NULL, &zonemgr, 0);
1249 ok(hr == S_OK, "CoInternetCreateZoneManager result: 0x%x\n", hr);
1250 if (FAILED(hr))
1251 return;
1252
1253 memset(buffer, -1, sizeof(buffer));
1254 hr = IInternetZoneManager_GetZoneAttributes(zonemgr, URLZONE_LOCAL_MACHINE, pZA);
1255 ok(hr == S_OK, "got 0x%x (expected S_OK)\n", hr);
1256
1257 sprintf(regpath, "%s\\Zones\\%d", szInternetSettingsKey, URLZONE_CUSTOM);
1258 res = RegCreateKeyA(HKEY_CURRENT_USER, regpath, &hkey);
1259 RegCloseKey(hkey);
1260
1261 ok(res == ERROR_SUCCESS, "got %d (expected ERROR_SUCCESS)\n", res);
1262 if (res != ERROR_SUCCESS)
1263 goto cleanup;
1264
1265 pZA->cbSize = sizeof(ZONEATTRIBUTES);
1266 hr = IInternetZoneManager_SetZoneAttributes(zonemgr, URLZONE_CUSTOM, NULL);
1267 ok(hr == E_INVALIDARG, "got 0x%x (expected E_INVALIDARG)\n", hr);
1268
1269 /* normal use */
1270 hr = IInternetZoneManager_SetZoneAttributes(zonemgr, URLZONE_CUSTOM, pZA);
1271 if (hr == E_FAIL) {
1272 win_skip("SetZoneAttributes not supported: IE too old\n");
1273 goto cleanup;
1274 }
1275 ok(hr == S_OK, "got 0x%x (expected S_OK)\n", hr);
1276
1277 /* native urlmon ignores cbSize */
1278 pZA->cbSize = sizeof(ZONEATTRIBUTES) + sizeof(DWORD);
1279 hr = IInternetZoneManager_SetZoneAttributes(zonemgr, URLZONE_CUSTOM, pZA);
1280 ok(hr == S_OK, "got 0x%x for sizeof(ZONEATTRIBUTES) + sizeof(DWORD) (expected S_OK)\n", hr);
1281
1282 pZA->cbSize = sizeof(ZONEATTRIBUTES) - sizeof(DWORD);
1283 hr = IInternetZoneManager_SetZoneAttributes(zonemgr, URLZONE_CUSTOM, pZA);
1284 ok(hr == S_OK, "got 0x%x for sizeof(ZONEATTRIBUTES) - sizeof(DWORD) (expected S_OK)\n", hr);
1285
1286 pZA->cbSize = 0;
1287 hr = IInternetZoneManager_SetZoneAttributes(zonemgr, URLZONE_CUSTOM, pZA);
1288 ok(hr == S_OK, "got 0x%x for size 0 (expected S_OK)\n", hr);
1289
1290 /* The key for the zone must be present, when calling SetZoneAttributes */
1292 /* E_FAIL is returned from IE6 here, which is reasonable.
1293 All newer IE return S_OK without saving the zone attributes to the registry.
1294 This is a Windows bug, but we have to accept that as standard */
1295 hr = IInternetZoneManager_SetZoneAttributes(zonemgr, URLZONE_CUSTOM, pZA);
1296 ok((hr == S_OK) || broken(hr == E_FAIL), "got 0x%x (expected S_OK)\n", hr);
1297
1298 /* SetZoneAttributes did not create the directory */
1299 res = RegOpenKeyA(HKEY_CURRENT_USER, regpath, &hkey);
1300 ok((res == ERROR_FILE_NOT_FOUND) && (hkey == NULL),
1301 "got %u with %p (expected ERROR_FILE_NOT_FOUND with NULL)\n", res, hkey);
1302
1303 if (hkey) RegCloseKey(hkey);
1304
1305cleanup:
1306 /* delete zone settings in the registry */
1308
1309 hr = IInternetZoneManager_Release(zonemgr);
1310 ok(hr == S_OK, "got 0x%x (expected S_OK)\n", hr);
1311}
static const char * szInternetSettingsKey
Definition: sec_mgr.c:119

Referenced by START_TEST().

◆ test_special_url_action()

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

Definition at line 607 of file sec_mgr.c.

608{
611
612 policy = 0xdeadbeef;
613 hres = IInternetZoneManager_GetZoneActionPolicy(zonemgr, 3, action, (BYTE*)&policy,
614 sizeof(DWORD), URLZONEREG_DEFAULT);
615 ok(hres == S_OK, "GetZoneActionPolicy failed: %08x\n", hres);
616 ok(policy == URLPOLICY_DISALLOW, "(%x) policy=%x, expected URLPOLICY_DISALLOW\n", action, policy);
617
618 policy = 0xdeadbeef;
619 hres = IInternetSecurityManager_ProcessUrlAction(secmgr, url1, action, (BYTE*)&policy,
620 sizeof(WCHAR), NULL, 0, 0, 0);
621 ok(hres == S_FALSE, "ProcessUrlAction(%x) failed: %08x, expected S_FALSE\n", action, hres);
622
623 policy = 0xdeadbeef;
624 hres = IInternetSecurityManager_ProcessUrlAction(secmgr, url1, action, (BYTE*)&policy,
625 sizeof(DWORD), NULL, 0, 0, 0);
626 ok(hres == S_FALSE, "ProcessUrlAction(%x) failed: %08x, expected S_FALSE\n", action, hres);
627 ok(policy == URLPOLICY_DISALLOW, "policy = %x\n", policy);
628}

Referenced by test_polices().

◆ test_url_action()

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

Definition at line 494 of file sec_mgr.c.

495{
496 DWORD res, size, policy, reg_policy;
497 char buf[10];
498 HKEY hkey;
500
501 /* FIXME: HKEY_CURRENT_USER is most of the time the default but this can be changed on a system.
502 * The test should be changed to cope with that, if need be.
503 */
505 "Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\Zones\\3", &hkey);
506 ok(res == ERROR_SUCCESS, "Could not open zone key\n");
507 if(res != ERROR_SUCCESS)
508 return;
509
510 wsprintfA(buf, "%X", action);
511 size = sizeof(DWORD);
512 res = RegQueryValueExA(hkey, buf, NULL, NULL, (BYTE*)&reg_policy, &size);
513 RegCloseKey(hkey);
514
515 /* Try settings from HKEY_LOCAL_MACHINE. */
516 if(res != ERROR_SUCCESS || size != sizeof(DWORD)) {
518 "Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\Zones\\3", &hkey);
519 ok(res == ERROR_SUCCESS, "Could not open zone key\n");
520
521 size = sizeof(DWORD);
522 res = RegQueryValueExA(hkey, buf, NULL, NULL, (BYTE*)&reg_policy, &size);
523 RegCloseKey(hkey);
524 }
525
526 if(res != ERROR_SUCCESS || size != sizeof(DWORD)) {
527 policy = 0xdeadbeef;
528 hres = IInternetSecurityManager_ProcessUrlAction(secmgr, url9, action, (BYTE*)&policy,
529 sizeof(WCHAR), NULL, 0, 0, 0);
531 "(0x%x) got 0x%x (expected E_FAIL)\n", action, hres);
532 ok(policy == 0xdeadbeef, "(%x) policy=%x\n", action, policy);
533
534 policy = 0xdeadbeef;
535 hres = IInternetZoneManager_GetZoneActionPolicy(zonemgr, 3, action, (BYTE*)&policy,
536 sizeof(DWORD), URLZONEREG_DEFAULT);
538 "(0x%x) got 0x%x (expected E_FAIL)\n", action, hres);
539 ok(policy == 0xdeadbeef, "(%x) policy=%x\n", action, policy);
540 return;
541 }
542
543 policy = 0xdeadbeef;
544 hres = IInternetZoneManager_GetZoneActionPolicy(zonemgr, 3, action, (BYTE*)&policy,
545 sizeof(DWORD), URLZONEREG_DEFAULT);
546 ok(hres == S_OK, "GetZoneActionPolicy failed: %08x\n", hres);
547 ok(policy == reg_policy, "(%x) policy=%x, expected %x\n", action, policy, reg_policy);
548
549 if(policy != URLPOLICY_QUERY) {
551 BOOL expect_parse_call = !called_securl_http;
552
553 policy = 0xdeadbeef;
554 hres = IInternetSecurityManager_ProcessUrlAction(secmgr, url9, action, (BYTE*)&policy,
555 sizeof(WCHAR), NULL, 0, 0, 0);
556 if(reg_policy == URLPOLICY_DISALLOW)
557 ok(hres == S_FALSE, "ProcessUrlAction(%x) failed: %08x, expected S_FALSE\n", action, hres);
558 else
559 ok(hres == S_OK, "ProcessUrlAction(%x) failed: %08x\n", action, hres);
560 ok(policy == 0xdeadbeef, "(%x) policy=%x\n", action, policy);
561
562 policy = 0xdeadbeef;
563 hres = IInternetSecurityManager_ProcessUrlAction(secmgr, url9, action, (BYTE*)&policy,
564 2, NULL, 0, 0, 0);
565 if(reg_policy == URLPOLICY_DISALLOW)
566 ok(hres == S_FALSE, "ProcessUrlAction(%x) failed: %08x, expected S_FALSE\n", action, hres);
567 else
568 ok(hres == S_OK, "ProcessUrlAction(%x) failed: %08x\n", action, hres);
569 ok(policy == 0xdeadbeef, "(%x) policy=%x\n", action, policy);
570
571 policy = 0xdeadbeef;
572 hres = IInternetSecurityManager_ProcessUrlAction(secmgr, url9, action, (BYTE*)&policy,
573 sizeof(DWORD), NULL, 0, 0, 0);
574 if(reg_policy == URLPOLICY_DISALLOW)
575 ok(hres == S_FALSE, "ProcessUrlAction(%x) failed: %08x, expected S_FALSE\n", action, hres);
576 else
577 ok(hres == S_OK, "ProcessUrlAction(%x) failed: %08x\n", action, hres);
578 ok(policy == reg_policy, "(%x) policy=%x\n", action, policy);
579
580 policy = 0xdeadbeef;
581 hres = IInternetSecurityManager_ProcessUrlAction(secmgr, url9, action, (BYTE*)&policy,
582 sizeof(WCHAR), (BYTE*)0xdeadbeef, 16, 0, 0);
583 if(reg_policy == URLPOLICY_DISALLOW)
584 ok(hres == S_FALSE, "ProcessUrlAction(%x) failed: %08x, expected S_FALSE\n", action, hres);
585 else
586 ok(hres == S_OK, "ProcessUrlAction(%x) failed: %08x\n", action, hres);
587 ok(policy == 0xdeadbeef, "(%x) policy=%x\n", action, policy);
588
589 policy = 0xdeadbeef;
590 if(expect_parse_call)
591 SET_EXPECT(ParseUrl_SECURITY_URL_http);
592 hres = IInternetSecurityManager_ProcessUrlAction(secmgr, winetest_to_httpW, action, (BYTE*)&policy,
593 sizeof(DWORD), NULL, 0, 0, 0);
594 if(expect_parse_call)
595 CHECK_CALLED(ParseUrl_SECURITY_URL_http);
596 if(reg_policy == URLPOLICY_DISALLOW)
597 ok(hres == S_FALSE, "ProcessUrlAction(%x) failed: %08x, expected S_FALSE\n", action, hres);
598 else
599 ok(hres == S_OK, "ProcessUrlAction(%x) failed: %08x\n", action, hres);
600 ok(policy == reg_policy, "(%x) policy=%x\n", action, policy);
601 }else {
602 skip("IE running in Enhanced Security Configuration\n");
603 }
604 }
605}
static BOOL is_ie_hardened(void)
Definition: sec_mgr.c:475
int winetest_interactive
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 683 of file sec_mgr.c.

684{
686 DWORD res, zone;
688 HKEY domains, domain;
689
690 static const WCHAR testing_domain_urlW[] = {'h','t','t','p',':','/','/','t','e','s','t','i','n','g','.',
691 'd','o','m','a','i','n','/',0};
692
694 ok(res == ERROR_SUCCESS, "RegOpenKey failed: %d\n", res);
695 if(res != ERROR_SUCCESS)
696 return;
697
698 res = RegCreateKeyA(domains, "testing.domain", &domain);
699 ok(res == ERROR_SUCCESS, "RegCreateKey failed: %d\n", res);
700 if(res != ERROR_SUCCESS) {
701 RegCloseKey(domains);
702 return;
703 }
704
706 res = RegSetValueExA(domain, "http", 0, REG_DWORD, (BYTE*)&zone, sizeof(DWORD));
707 ok(res == ERROR_SUCCESS, "RegSetValueEx failed: %d\n", res);
708
710
711 hres = pCoInternetCreateSecurityManager(NULL, &secmgr, 0);
712 ok(hres == S_OK, "CoInternetCreateSecurityManager failed: %08x\n", hres);
713
714 zone = URLZONE_INVALID;
715 hres = IInternetSecurityManager_MapUrlToZone(secmgr, testing_domain_urlW, &zone, 0);
716 ok(hres == S_OK, "MapUrlToZone failed: %08x\n", hres);
717 todo_wine ok(zone == URLZONE_INTERNET, "Got %d, expected URLZONE_INTERNET\n", zone);
718
719 /* FIXME: Play nice with ZoneMaps that existed before the test is run. */
720 res = RegDeleteKeyA(domains, "testing.domain");
721 ok(res == ERROR_SUCCESS, "RegDeleteKey failed: %d\n", res);
722
723 RegCloseKey(domains);
724 IInternetSecurityManager_Release(secmgr);
725}

Referenced by test_zone_domains().

◆ test_zone_domain_mappings()

static void test_zone_domain_mappings ( void  )
static

Definition at line 911 of file sec_mgr.c.

912{
914 DWORD i, res;
916 HKEY domains;
917 DWORD zone = URLZONE_INVALID;
918
919 trace("testing zone domain mappings...\n");
920
921 hres = pCoInternetCreateSecurityManager(NULL, &secmgr, 0);
922 ok(hres == S_OK, "CoInternetCreateSecurityManager failed: %08x\n", hres);
923
925 if(res == ERROR_SUCCESS) {
926 static const WCHAR local_machineW[] = {'h','t','t','p',':','/','/','t','e','s','t','.','l','o','c','a','l',
927 '.','m','a','c','h','i','n','e','/',0};
928
929 hres = IInternetSecurityManager_MapUrlToZone(secmgr, local_machineW, &zone, 0);
930 ok(hres == S_OK, "MapUrlToZone failed: %08x\n", hres);
931 ok(zone == URLZONE_CUSTOM, "Expected URLZONE_CUSTOM, but got %d\n", zone);
932
933 RegCloseKey(domains);
934 }
935
936 for(i = 0; i < ARRAY_SIZE(zone_mapping_tests); ++i) {
938 LPWSTR urlW = a2w(test->url);
939 zone = URLZONE_INVALID;
940
941 hres = IInternetSecurityManager_MapUrlToZone(secmgr, urlW, &zone, 0);
942 ok(hres == S_OK, "MapUrlToZone failed: %08x\n", hres);
943 todo_wine_if (test->todo)
944 ok(zone == test->zone || broken(test->broken_zone == zone),
945 "Expected %d, but got %d on test %d\n", test->zone, zone, i);
946
947 heap_free(urlW);
948 }
949
950 IInternetSecurityManager_Release(secmgr);
951}
BOOLEAN Expected
GLdouble n
Definition: glext.h:7729
#define d
Definition: ke_i.h:81
static const zone_mapping_test zone_mapping_tests[]
Definition: sec_mgr.c:880

Referenced by START_TEST().

◆ test_zone_domains()

static void test_zone_domains ( void  )
static

Definition at line 953 of file sec_mgr.c.

954{
955 if(is_ie_hardened()) {
956 skip("IE running in Enhanced Security Configuration\n");
957 return;
958 } else if(!pCreateUri) {
959 win_skip("Skipping zone domain tests, IE too old\n");
960 return;
961 }
962
963 trace("testing zone domains...\n");
964
966
967 if (!register_zone_domains()) return;
970}
static void test_zone_domain_cache(void)
Definition: sec_mgr.c:683
static BOOL register_zone_domains(void)
Definition: sec_mgr.c:754
static void run_child_process(void)
Definition: sec_mgr.c:852
static void unregister_zone_domains(void)
Definition: sec_mgr.c:815

Referenced by START_TEST().

◆ unregister_protocols()

static void unregister_protocols ( void  )
static

Definition at line 1572 of file sec_mgr.c.

1572 {
1574 HRESULT hr;
1575
1576 hr = pCoInternetGetSession(0, &session, 0);
1577 ok(hr == S_OK, "CoInternetGetSession failed: 0x%08x\n", hr);
1578 if(FAILED(hr))
1579 return;
1580
1581 hr = IInternetSession_UnregisterNameSpace(session, &protocol_cf, winetestW);
1582 ok(hr == S_OK, "UnregisterNameSpace failed: 0x%08x\n", hr);
1583
1584 IInternetSession_Release(session);
1585}

Referenced by START_TEST().

◆ unregister_zone_domains()

static void unregister_zone_domains ( void  )
static

Definition at line 815 of file sec_mgr.c.

816{
817 HKEY domains;
818 DWORD res, i;
819
821 ok(res == ERROR_SUCCESS || broken(res == ERROR_FILE_NOT_FOUND), "RegOpenKey failed: %d\n", res);
822 if(res == ERROR_SUCCESS) {
823 RegDeleteKeyA(domains, "local.machine");
824 RegCloseKey(domains);
825 }
826
828 ok(res == ERROR_SUCCESS, "RegOpenKey failed: %d\n", res);
829
830 for(i = 0; i < ARRAY_SIZE(zone_domain_mappings); ++i) {
832
833 /* FIXME: Uses the "cludge" approach to remove the test data from the registry!
834 * Although, if domain names are... unique, this shouldn't cause any harm
835 * to keys (if any) that existed before the tests.
836 */
837 if(test->subdomain) {
838 HKEY domain;
839
840 res = RegOpenKeyA(domains, test->domain, &domain);
841 if(res == ERROR_SUCCESS) {
842 RegDeleteKeyA(domain, test->subdomain);
844 }
845 }
846 RegDeleteKeyA(domains, test->domain);
847 }
848
849 RegCloseKey(domains);
850}

Referenced by test_zone_domains().

Variable Documentation

◆ called_securl_http

int called_securl_http
static

Definition at line 144 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:1539
static HRESULT WINAPI ClassFactory_CreateInstance(IClassFactory *iface, IUnknown *pOuter, REFIID riid, void **ppv)
Definition: sec_mgr.c:1532
static ULONG WINAPI ClassFactory_Release(IClassFactory *iface)
Definition: sec_mgr.c:1527
static HRESULT WINAPI ClassFactory_QueryInterface(IClassFactory *iface, REFIID riid, void **ppv)
Definition: sec_mgr.c:1511
static ULONG WINAPI ClassFactory_AddRef(IClassFactory *iface)
Definition: sec_mgr.c:1522

Definition at line 1545 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 137 of file sec_mgr.c.

Referenced by test_activex().

◆ create_flags

◆ default_hres

HRESULT default_hres

Definition at line 1593 of file sec_mgr.c.

Referenced by test_InternetGetSecurityUrlEx().

◆ default_uri

const char* default_uri

Definition at line 1592 of file sec_mgr.c.

Referenced by test_InternetGetSecurityUrlEx().

◆ DWORD

◆ DWORD_PTR

Definition at line 80 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 141 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:1491
static HRESULT WINAPI InternetProtocolInfo_CompareUrl(IInternetProtocolInfo *iface, LPCWSTR pwzUrl1, LPCWSTR pwzUrl2, DWORD dwCompareFlags)
Definition: sec_mgr.c:1484
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:1476
static ULONG WINAPI InternetProtocolInfo_AddRef(IInternetProtocolInfo *iface)
Definition: sec_mgr.c:1401
static ULONG WINAPI InternetProtocolInfo_Release(IInternetProtocolInfo *iface)
Definition: sec_mgr.c:1406
static HRESULT WINAPI InternetProtocolInfo_QueryInterface(IInternetProtocolInfo *iface, REFIID riid, void **ppv)
Definition: sec_mgr.c:1394
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:1411

Definition at line 1499 of file sec_mgr.c.

◆ LPCWSTR

Definition at line 84 of file sec_mgr.c.

◆ map_hres

HRESULT map_hres

Definition at line 1753 of file sec_mgr.c.

Referenced by compile_error(), Err_Raise(), exec_script(), and test_SecurityManagerEx2().

◆ map_todo

BOOL map_todo

Definition at line 1755 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 1553 of file sec_mgr.c.

Referenced by register_protocols(), and unregister_protocols().

◆ protocol_info

IInternetProtocolInfo protocol_info = { &InternetProtocolInfoVtbl }
static

Definition at line 1509 of file sec_mgr.c.

◆ PSUACTION

IUri PSUACTION

Definition at line 79 of file sec_mgr.c.

◆ 

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

Referenced by test_SecurityManagerEx2().

◆ 

const struct { ... } sec_url_ex_tests[]
Initial value:
= {
{"index.htm",Uri_CREATE_ALLOW_RELATIVE,"*:index.html",S_OK,"*:index.htm",S_OK},
{"file://c:\\Index.htm",Uri_CREATE_FILE_USE_DOS_PATH,"file:///c:/Index.htm",S_OK,"file:///c:/Index.htm",S_OK},
{"file:some%20file%2ejpg",0,NULL,E_INVALIDARG,NULL,E_INVALIDARG},
{"file:some file.jpg",0,NULL,E_INVALIDARG,NULL,E_INVALIDARG},
{"http://www.zone3.winetest/",0,"http://www.zone3.winetest/",S_OK,"http://www.zone3.winetest/",S_OK},
{"about:blank",0,"about:blank",S_OK,"about:blank",S_OK},
{"ftp://zone3.winetest/file.test",0,"ftp://zone3.winetest/file.test",S_OK,"ftp://zone3.winetest/file.test",S_OK},
{"test:123abc",0,"test:123abc",S_OK,"test:123abc",S_OK},
{"http:google.com/test.file",0,"http:google.com/test.file",S_OK,"http:google.com/test.file",S_OK},
{"ftp://test@ftp.winehq.org/",0,"ftp://ftp.winehq.org/",S_OK,"ftp://ftp.winehq.org/",S_OK},
{"test://google@ftp.winehq.org/",0,"test://google@ftp.winehq.org/",S_OK,"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 121 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 128 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 132 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 134 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 135 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 130 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 122 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 123 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 125 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 126 of file sec_mgr.c.

◆ secid_hres

HRESULT secid_hres

Definition at line 1758 of file sec_mgr.c.

Referenced by test_SecurityManager(), and test_SecurityManagerEx2().

◆ secid_size

DWORD secid_size

Definition at line 1757 of file sec_mgr.c.

Referenced by test_SecurityManager(), and test_SecurityManagerEx2().

◆ secid_todo

BOOL secid_todo

Definition at line 1759 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 1746 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 1747 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 1748 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:95
static const WCHAR url11[]
Definition: sec_mgr.c:103
static const WCHAR url16[]
Definition: sec_mgr.c:108
static const WCHAR url17[]
Definition: sec_mgr.c:109
static const WCHAR url12[]
Definition: sec_mgr.c:104
static const WCHAR url18[]
Definition: sec_mgr.c:110

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 1591 of file sec_mgr.c.

◆ security_manager

IInternetSecurityManager security_manager = { &SecurityManagerVtbl }
static

Definition at line 360 of file sec_mgr.c.

Referenced by test_CoInternetIsFeatureZoneElevationEnabled().

◆ security_uri

const char* security_uri

Definition at line 1590 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 114 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:302
static HRESULT WINAPI SecurityManager_GetSecuritySite(IInternetSecurityManager *This, IInternetSecurityMgrSite **ppSite)
Definition: sec_mgr.c:288
static HRESULT WINAPI SecurityManager_SetZoneMapping(IInternetSecurityManager *This, DWORD dwZone, LPCWSTR lpszPattern, DWORD dwFlags)
Definition: sec_mgr.c:332
static ULONG WINAPI SecurityManager_Release(IInternetSecurityManager *This)
Definition: sec_mgr.c:276
static HRESULT WINAPI SecurityManager_MapUrlToZone(IInternetSecurityManager *This, LPCWSTR pwszUrl, DWORD *pdwZone, DWORD dwFlags)
Definition: sec_mgr.c:295
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:309
static HRESULT WINAPI SecurityManager_SetSecuritySite(IInternetSecurityManager *This, IInternetSecurityMgrSite *pSite)
Definition: sec_mgr.c:281
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:324
static HRESULT WINAPI SecurityManager_QueryInterface(IInternetSecurityManager *This, REFIID riid, void **ppvObject)
Definition: sec_mgr.c:264
static HRESULT WINAPI SecurityManager_GetZoneMappings(IInternetSecurityManager *This, DWORD dwZone, IEnumString **ppenumString, DWORD dwFlags)
Definition: sec_mgr.c:339
static ULONG WINAPI SecurityManager_AddRef(IInternetSecurityManager *This)
Definition: sec_mgr.c:271

Definition at line 346 of file sec_mgr.c.

◆ szInternetSettingsKey

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

Definition at line 119 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 1594 of file sec_mgr.c.

Referenced by test_InternetGetSecurityUrlEx().

◆ uri

const char* uri

Definition at line 1588 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(), 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(), download_to_cache(), file_protocol_start(), FileProtocol_Start(), FtpProtocol_open_request(), FtpProtocol_Start(), generate_raw_uri(), generate_security_id(), generate_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(), is_urlmon_protocol(), JSGlobal_decodeURI(), JSGlobal_decodeURIComponent(), JSGlobal_encodeURI(), JSGlobal_encodeURIComponent(), 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(), 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(), 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(), xmlCanonicPath(), xmlCleanURI(), xmlCreateEntityParserCtxtInternal(), xmlFreeURI(), xmlParse3986Authority(), xmlParse3986Fragment(), xmlParse3986HierPart(), xmlParse3986Host(), xmlParse3986PathAbEmpty(), xmlParse3986PathAbsolute(), xmlParse3986PathNoScheme(), xmlParse3986PathRootless(), xmlParse3986Port(), xmlParse3986Query(), xmlParse3986RelativeRef(), xmlParse3986Scheme(), xmlParse3986URI(), xmlParse3986URIReference(), xmlParse3986Userinfo(), xmlParseEntityDecl(), 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(), xsltCheckRead(), xsltCheckWrite(), and xsltDocumentFunctionLoadDocument().

◆ 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 87 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 101 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 103 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 104 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 105 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 106 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 107 of file sec_mgr.c.

Referenced by test_SecurityManagerEx2().

◆ url16

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

Definition at line 108 of file sec_mgr.c.

◆ url17

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

Definition at line 109 of file sec_mgr.c.

◆ url18

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

Definition at line 110 of file sec_mgr.c.

◆ url2

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

Definition at line 89 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 90 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 91 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 93 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 95 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 96 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 98 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 99 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 116 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 112 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:38

Definition at line 735 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:
= {
{"http://yabadaba.do/",URLZONE_CUSTOM},
{"http://google.yabadaba.do/",URLZONE_CUSTOM},
{"zip://yabadaba.do/",URLZONE_INTERNET},
{"ftp://testing.google.super.cool/",URLZONE_INTERNET},
{"ftp://testing.*.super.cool/",URLZONE_CUSTOM2},
{"ftp://google.testing.super.cool/",URLZONE_CUSTOM2},
{"http://tests.test/",URLZONE_CUSTOM},
{"http://www.tests.test/",URLZONE_CUSTOM},
{"ftp://tests.test/",URLZONE_CUSTOM},
{"ftp://www.tests.test/",URLZONE_CUSTOM},
{"test://www.tests.test/",URLZONE_INTERNET},
{"test://tests.test/",URLZONE_INTERNET},
{"zip://www.tests.test/",URLZONE_INTERNET},
{"zip://tests.test/",URLZONE_INTERNET},
{"http://google.www.testing.com/",URLZONE_INTERNET},
{"http://www.testing.com/",URLZONE_CUSTOM,FALSE,URLZONE_INTERNET},
{"http://testing.www.testing.com/",URLZONE_CUSTOM2,FALSE,URLZONE_INTERNET},
{"http://google.org/",URLZONE_INTERNET,FALSE,URLZONE_CUSTOM},
{"http://org/",URLZONE_CUSTOM},
{"http://testing.org/",URLZONE_CUSTOM2},
{"*:wine.testing/test",URLZONE_CUSTOM2},
{"http://wine.testing/testing",URLZONE_CUSTOM2}
}

Definition at line 880 of file sec_mgr.c.

Referenced by test_zone_domain_mappings().