ReactOS  0.4.14-dev-50-g13bb5e2
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 _WIN32_IE   0x0700
 
#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

◆ _WIN32_IE

#define _WIN32_IE   0x0700

Definition at line 28 of file sec_mgr.c.

◆ CHECK_CALLED

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

Definition at line 65 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)
GLenum func
Definition: glext.h:6028
#define TRUE
Definition: types.h:120
#define expect_(expected, got, precision)
Definition: font.c:29

Definition at line 52 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)
GLenum func
Definition: glext.h:6028
#define TRUE
Definition: types.h:120
#define expect_(expected, got, precision)
Definition: font.c:29

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

◆ SET_CALLED

#define SET_CALLED (   func)
Value:
do { \
expect_ ## func = called_ ## func = FALSE; \
}while(0)
GLenum func
Definition: glext.h:6028

Definition at line 71 of file sec_mgr.c.

◆ SET_EXPECT

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

Definition at line 49 of file sec_mgr.c.

◆ URLZONE_CUSTOM

#define URLZONE_CUSTOM   URLZONE_USER_MIN+1

Definition at line 43 of file sec_mgr.c.

◆ URLZONE_CUSTOM2

#define URLZONE_CUSTOM2   URLZONE_CUSTOM+1

Definition at line 44 of file sec_mgr.c.

Function Documentation

◆ a2w()

static LPWSTR a2w ( LPCSTR  str)
inlinestatic

Definition at line 183 of file sec_mgr.c.

184 {
185  LPWSTR ret = NULL;
186 
187  if(str) {
188  DWORD len = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0);
189  ret = HeapAlloc(GetProcessHeap(), 0, len*sizeof(WCHAR));
190  MultiByteToWideChar(CP_ACP, 0, str, -1, ret, len);
191  }
192 
193  return ret;
194 }
#define CP_ACP
Definition: compat.h:99
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
GLenum GLsizei len
Definition: glext.h:6722
#define MultiByteToWideChar
Definition: compat.h:100
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 1528 of file sec_mgr.c.

1529 {
1530  return 2;
1531 }

◆ ClassFactory_CreateInstance()

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

Definition at line 1538 of file sec_mgr.c.

1540 {
1541  ok(0, "unexpected call\n");
1542  return E_NOTIMPL;
1543 }
#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 1545 of file sec_mgr.c.

1546 {
1547  ok(0, "unexpected call\n");
1548  return S_OK;
1549 }
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57

◆ ClassFactory_QueryInterface()

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

Definition at line 1517 of file sec_mgr.c.

1518 {
1519  if(IsEqualGUID(&IID_IInternetProtocolInfo, riid)) {
1520  *ppv = &protocol_info;
1521  return S_OK;
1522  }
1523 
1524  ok(0, "unexpected call\n");
1525  return E_NOINTERFACE;
1526 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
static IInternetProtocolInfo protocol_info
Definition: sec_mgr.c:1515
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021

◆ ClassFactory_Release()

static ULONG WINAPI ClassFactory_Release ( IClassFactory iface)
static

Definition at line 1533 of file sec_mgr.c.

1534 {
1535  return 1;
1536 }

◆ DEFINE_EXPECT() [1/6]

DEFINE_EXPECT ( ParseUrl_SECURITY_URL_input  )

◆ DEFINE_EXPECT() [2/6]

DEFINE_EXPECT ( ParseUrl_SECURITY_URL_input2  )

◆ DEFINE_EXPECT() [3/6]

DEFINE_EXPECT ( ParseUrl_SECURITY_URL_expected  )

◆ DEFINE_EXPECT() [4/6]

DEFINE_EXPECT ( ParseUrl_SECURITY_URL_http  )

◆ DEFINE_EXPECT() [5/6]

DEFINE_EXPECT ( ParseUrl_SECURITY_DOMAIN_expected  )

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

1408 {
1409  return 2;
1410 }

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

1485 {
1486  ok(0, "unexpected call\n");
1487  return E_NOTIMPL;
1488 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ InternetProtocolInfo_CompareUrl()

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

Definition at line 1490 of file sec_mgr.c.

1492 {
1493  ok(0, "unexpected call\n");
1494  return E_NOTIMPL;
1495 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

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

1420 {
1421  const WCHAR *ret = NULL;
1422 
1423  ok(pwzResult != NULL, "pwzResult == NULL\n");
1424  ok(pcchResult != NULL, "pcchResult == NULL\n");
1425  ok(!dwParseFlags, "Expected 0, but got 0x%08x\n", dwParseFlags);
1426 
1427  switch(ParseAction) {
1428  case PARSE_SECURITY_URL:
1429  if(!strcmp_w(pwzUrl, security_urlW)) {
1430  CHECK_EXPECT(ParseUrl_SECURITY_URL_input);
1431  ok(cchResult == lstrlenW(pwzUrl)+1, "Got %d\n", cchResult);
1433  } else if(!strcmp_w(pwzUrl, security_url2W)) {
1434  CHECK_EXPECT(ParseUrl_SECURITY_URL_input2);
1435  ok(cchResult == lstrlenW(pwzUrl)+1, "Got %d\n", cchResult);
1437  } else if(!strcmp_w(pwzUrl, security_expectedW)) {
1438  CHECK_EXPECT(ParseUrl_SECURITY_URL_expected);
1439  ok(cchResult == lstrlenW(pwzUrl)+1, "Got %d\n", cchResult);
1441  } else if(!strcmp_w(pwzUrl, winetest_to_httpW)) {
1442  switch(++called_securl_http) {
1443  case 1:
1444  ok(cchResult == lstrlenW(pwzUrl)+1, "Got %d\n", cchResult);
1445  break;
1446  case 2:
1447  CHECK_EXPECT(ParseUrl_SECURITY_URL_http);
1448  ok(cchResult == lstrlenW(url9)+1, "Got %d\n", cchResult);
1449  break;
1450  default:
1451  todo_wine CHECK_EXPECT(ParseUrl_SECURITY_URL_http);
1452  }
1453  ret = url9;
1454  } else
1455  ok(0, "Unexpected call, pwzUrl=%s\n", wine_dbgstr_w(pwzUrl));
1456 
1457  break;
1458  case PARSE_SECURITY_DOMAIN:
1459 
1460  CHECK_EXPECT(ParseUrl_SECURITY_DOMAIN_expected);
1461 
1462  ok(!strcmp_w(pwzUrl, security_expectedW), "Expected %s but got %s\n",
1464  ok(cchResult == lstrlenW(pwzUrl)+1, "Got %d\n", cchResult);
1466  break;
1467  default:
1468  ok(0, "Unexpected call, ParseAction=%d pwzUrl=%s\n", ParseAction,
1469  wine_dbgstr_w(pwzUrl));
1470  }
1471 
1472  if(!ret)
1473  return E_FAIL;
1474 
1475  *pcchResult = lstrlenW(ret)+1;
1476  if(*pcchResult > cchResult)
1477  return S_FALSE;
1478  memcpy(pwzResult, ret, (*pcchResult)*sizeof(WCHAR));
1479  return S_OK;
1480 }
static int strcmp_w(const WCHAR *str1, const WCHAR *str2)
Definition: sec_mgr.c:174
char * wine_dbgstr_w(const wchar_t *wstr)
Definition: atltest.h:87
#define lstrlenW
Definition: compat.h:407
#define E_FAIL
Definition: ddrawi.h:102
#define CHECK_EXPECT(func)
Definition: sec_mgr.c:52
#define S_FALSE
Definition: winerror.h:2357
smooth NULL
Definition: ftsmooth.c:416
static const WCHAR winetest_to_httpW[]
Definition: sec_mgr.c:122
static int called_securl_http
Definition: sec_mgr.c:150
static const WCHAR security_expectedW[]
Definition: sec_mgr.c:121
__wchar_t WCHAR
Definition: xmlstorage.h:180
int ret
#define todo_wine
Definition: test.h:154
static const WCHAR url9[]
Definition: sec_mgr.c:105
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
static const WCHAR security_urlW[]
Definition: sec_mgr.c:119
static const WCHAR security_url2W[]
Definition: sec_mgr.c:120

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

1500 {
1501  ok(0, "unexpected call\n");
1502  return E_NOTIMPL;
1503 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ InternetProtocolInfo_QueryInterface()

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

Definition at line 1400 of file sec_mgr.c.

1402 {
1403  ok(0, "unexpected call\n");
1404  return E_NOINTERFACE;
1405 }
#define E_NOINTERFACE
Definition: winerror.h:2364
#define ok(value,...)
Definition: atltest.h:57

◆ InternetProtocolInfo_Release()

static ULONG WINAPI InternetProtocolInfo_Release ( IInternetProtocolInfo iface)
static

Definition at line 1412 of file sec_mgr.c.

1413 {
1414  return 1;
1415 }

◆ is_ie_hardened()

static BOOL is_ie_hardened ( void  )
static

Definition at line 481 of file sec_mgr.c.

482 {
483  HKEY zone_map;
484  DWORD ie_harden, type, size;
485 
486  ie_harden = 0;
487  if(RegOpenKeyExA(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\ZoneMap",
488  0, KEY_QUERY_VALUE, &zone_map) == ERROR_SUCCESS) {
489  size = sizeof(DWORD);
490  if (RegQueryValueExA(zone_map, "IEHarden", NULL, &type, (LPBYTE) &ie_harden, &size) != ERROR_SUCCESS ||
491  type != REG_DWORD) {
492  ie_harden = 0;
493  }
494  RegCloseKey(zone_map);
495  }
496 
497  return ie_harden != 0;
498 }
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:4023
#define ERROR_SUCCESS
Definition: deptool.c:10
#define HKEY_CURRENT_USER
Definition: winreg.h:11
LONG WINAPI RegOpenKeyExA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey, _In_ DWORD ulOptions, _In_ REGSAM samDesired, _Out_ PHKEY phkResult)
Definition: reg.c:3331
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
unsigned char * LPBYTE
Definition: typedefs.h:52
smooth NULL
Definition: ftsmooth.c:416
GLsizeiptr size
Definition: glext.h:5919
unsigned long DWORD
Definition: ntddk_ex.h:95
#define KEY_QUERY_VALUE
Definition: nt_native.h:1016
static IInternetSecurityManager DWORD
Definition: sec_mgr.c:83
#define REG_DWORD
Definition: sdbapi.c:596

Referenced by test_url_action(), and test_zone_domains().

◆ myRegDeleteTreeA()

static LONG myRegDeleteTreeA ( HKEY  hKey,
LPCSTR  lpszSubKey 
)
static

Definition at line 205 of file sec_mgr.c.

206 {
207  LONG ret;
208  DWORD dwMaxSubkeyLen, dwMaxValueLen;
209  DWORD dwMaxLen, dwSize;
210  CHAR szNameBuf[MAX_PATH], *lpszName = szNameBuf;
211  HKEY hSubKey = hKey;
212 
213  if(lpszSubKey)
214  {
215  ret = RegOpenKeyExA(hKey, lpszSubKey, 0, KEY_READ, &hSubKey);
216  if (ret) return ret;
217  }
218 
219  /* Get highest length for keys, values */
220  ret = RegQueryInfoKeyA(hSubKey, NULL, NULL, NULL, NULL,
221  &dwMaxSubkeyLen, NULL, NULL, &dwMaxValueLen, NULL, NULL, NULL);
222  if (ret) goto cleanup;
223 
224  dwMaxSubkeyLen++;
225  dwMaxValueLen++;
226  dwMaxLen = max(dwMaxSubkeyLen, dwMaxValueLen);
227  if (dwMaxLen > ARRAY_SIZE(szNameBuf))
228  {
229  /* Name too big: alloc a buffer for it */
230  if (!(lpszName = HeapAlloc( GetProcessHeap(), 0, dwMaxLen*sizeof(CHAR))))
231  {
233  goto cleanup;
234  }
235  }
236 
237  /* Recursively delete all the subkeys */
238  while (TRUE)
239  {
240  dwSize = dwMaxLen;
241  if (RegEnumKeyExA(hSubKey, 0, lpszName, &dwSize, NULL,
242  NULL, NULL, NULL)) break;
243 
244  ret = myRegDeleteTreeA(hSubKey, lpszName);
245  if (ret) goto cleanup;
246  }
247 
248  if (lpszSubKey)
249  ret = RegDeleteKeyA(hKey, lpszSubKey);
250  else
251  while (TRUE)
252  {
253  dwSize = dwMaxLen;
254  if (RegEnumValueA(hKey, 0, lpszName, &dwSize,
255  NULL, NULL, NULL, NULL)) break;
256 
257  ret = RegDeleteValueA(hKey, lpszName);
258  if (ret) goto cleanup;
259  }
260 
261 cleanup:
262  /* Free buffer if allocated */
263  if (lpszName != szNameBuf)
264  heap_free(lpszName);
265  if(lpszSubKey)
266  RegCloseKey(hSubKey);
267  return ret;
268 }
#define max(a, b)
Definition: svc.c:63
#define TRUE
Definition: types.h:120
#define KEY_READ
Definition: nt_native.h:1023
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:3607
char CHAR
Definition: xmlstorage.h:175
LONG WINAPI RegOpenKeyExA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey, _In_ DWORD ulOptions, _In_ REGSAM samDesired, _Out_ PHKEY phkResult)
Definition: reg.c:3331
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
long LONG
Definition: pedump.c:60
smooth NULL
Definition: ftsmooth.c:416
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:2691
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define MAX_PATH
Definition: compat.h:26
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
LONG WINAPI RegDeleteKeyA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey)
Definition: reg.c:1222
#define ARRAY_SIZE(a)
Definition: main.h:24
LONG WINAPI RegDeleteValueA(HKEY hKey, LPCSTR lpValueName)
Definition: reg.c:2319
char * cleanup(char *str)
Definition: wpickclick.c:99
static LONG myRegDeleteTreeA(HKEY hKey, LPCSTR lpszSubKey)
Definition: sec_mgr.c:205
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:54
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:2442
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by test_SetZoneAttributes().

◆ register_protocols()

static void register_protocols ( void  )
static

Definition at line 1561 of file sec_mgr.c.

1562 {
1563  IInternetSession *session;
1564  HRESULT hres;
1565 
1566  hres = pCoInternetGetSession(0, &session, 0);
1567  ok(hres == S_OK, "CoInternetGetSession failed: %08x\n", hres);
1568  if(FAILED(hres))
1569  return;
1570 
1571  hres = IInternetSession_RegisterNameSpace(session, &protocol_cf, &IID_NULL,
1572  winetestW, 0, NULL, 0);
1573  ok(hres == S_OK, "RegisterNameSpace failed: %08x\n", hres);
1574 
1575  IInternetSession_Release(session);
1576 }
smooth NULL
Definition: ftsmooth.c:416
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
#define IID_NULL
Definition: guiddef.h:98
static const WCHAR winetestW[]
Definition: sec_mgr.c:118
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
static IClassFactory protocol_cf
Definition: sec_mgr.c:1559

Referenced by START_TEST().

◆ register_zone_domains()

static BOOL register_zone_domains ( void  )
static

Definition at line 760 of file sec_mgr.c.

761 {
762  HKEY domains;
763  DWORD res, i;
764 
765  /* Some Windows versions don't seem to have a "Domains" key in their HKLM. */
767  ok(res == ERROR_SUCCESS || broken(res == ERROR_FILE_NOT_FOUND), "RegOpenKey failed: %d\n", res);
768  if(res == ERROR_SUCCESS) {
769  HKEY domain;
771 
772  res = RegCreateKeyA(domains, "local.machine", &domain);
773  if (res == ERROR_ACCESS_DENIED)
774  {
775  skip("need admin rights\n");
776  RegCloseKey(domains);
777  return FALSE;
778  }
779  ok(res == ERROR_SUCCESS, "RegCreateKey failed: %d\n", res);
780 
781  res = RegSetValueExA(domain, "http", 0, REG_DWORD, (BYTE*)&zone, sizeof(DWORD));
782  ok(res == ERROR_SUCCESS, "RegSetValueEx failed: %d\n", res);
783 
784  RegCloseKey(domain);
785  RegCloseKey(domains);
786  }
787 
789  ok(res == ERROR_SUCCESS, "RegOpenKey failed: %d\n", res);
790 
791  for(i = 0; i < ARRAY_SIZE(zone_domain_mappings); ++i) {
793  HKEY domain;
794 
795  res = RegCreateKeyA(domains, test->domain, &domain);
796  ok(res == ERROR_SUCCESS, "RegCreateKey failed with %d on test %d\n", res, i);
797 
798  /* Only set the value if there's no subdomain. */
799  if(!test->subdomain) {
800  res = RegSetValueExA(domain, test->scheme, 0, REG_DWORD, (BYTE*)&test->zone, sizeof(DWORD));
801  ok(res == ERROR_SUCCESS, "RegSetValueEx failed with %d on test %d\n", res, i);
802  } else {
803  HKEY subdomain;
804 
805  res = RegCreateKeyA(domain, test->subdomain, &subdomain);
806  ok(res == ERROR_SUCCESS, "RegCreateKey failed with %d on test %d\n", res, i);
807 
808  res = RegSetValueExA(subdomain, test->scheme, 0, REG_DWORD, (BYTE*)&test->zone, sizeof(DWORD));
809  ok(res == ERROR_SUCCESS, "RegSetValueEx failed with %d on test %d\n", res, i);
810 
811  RegCloseKey(subdomain);
812  }
813 
814  RegCloseKey(domain);
815  }
816 
817  RegCloseKey(domains);
818  return TRUE;
819 }
LONG WINAPI RegOpenKeyA(HKEY hKey, LPCSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:3257
#define TRUE
Definition: types.h:120
#define ERROR_SUCCESS
Definition: deptool.c:10
#define HKEY_CURRENT_USER
Definition: winreg.h:11
#define test
Definition: rosglue.h:37
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 URLZONE_CUSTOM
Definition: sec_mgr.c:43
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
#define ERROR_ACCESS_DENIED
Definition: compat.h:87
static const zone_domain_mapping zone_domain_mappings[]
Definition: sec_mgr.c:741
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
LONG WINAPI RegCreateKeyA(HKEY hKey, LPCSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:1177
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned char BYTE
Definition: mem.h:68
#define broken(x)
Definition: _sntprintf.h:21
DWORD zone
Definition: sec_mgr.c:1760
#define ARRAY_SIZE(a)
Definition: main.h:24
#define ok(value,...)
Definition: atltest.h:57
#define skip(...)
Definition: atltest.h:64
GLuint res
Definition: glext.h:9613
LONG WINAPI RegSetValueExA(HKEY hKey, LPCSTR lpValueName, DWORD Reserved, DWORD dwType, CONST BYTE *lpData, DWORD cbData)
Definition: reg.c:4812
#define REG_DWORD
Definition: sdbapi.c:596
static const char * szZoneMapDomainsKey
Definition: sec_mgr.c:124
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12

Referenced by test_zone_domains().

◆ run_child_process()

static void run_child_process ( void  )
static

Definition at line 858 of file sec_mgr.c.

859 {
860  char cmdline[MAX_PATH];
861  char path[MAX_PATH];
862  char **argv;
864  STARTUPINFOA si = { 0 };
865  BOOL ret;
866 
868 
869  si.cb = sizeof(si);
871  sprintf(cmdline, "\"%s\" %s domain_tests", argv[0], argv[1]);
872  ret = CreateProcessA(argv[0], cmdline, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi);
873  ok(ret, "Failed to spawn child process: %u\n", GetLastError());
875  CloseHandle(pi.hThread);
876  CloseHandle(pi.hProcess);
877 }
#define CloseHandle
Definition: compat.h:398
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
TCHAR * cmdline
Definition: stretchblt.cpp:32
#define argv
Definition: mplay32.c:18
DWORD WINAPI GetModuleFileNameA(HINSTANCE hModule, LPSTR lpFilename, DWORD nSize)
Definition: loader.c:548
#define sprintf(buf, format,...)
Definition: sprintf.c:55
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
DWORD cb
Definition: winbase.h:796
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:4742
#define MAX_PATH
Definition: compat.h:26
int winetest_get_mainargs(char ***pargv)
static DWORD pi
Definition: protocol.c:150
int ret
void winetest_wait_child_process(HANDLE process)
#define ok(value,...)
Definition: atltest.h:57
Definition: services.c:325

Referenced by test_zone_domains().

◆ SecurityManager_AddRef()

static ULONG WINAPI SecurityManager_AddRef ( IInternetSecurityManager This)
static

Definition at line 277 of file sec_mgr.c.

278 {
279  return 2;
280 }

◆ SecurityManager_GetSecurityId()

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

Definition at line 308 of file sec_mgr.c.

310 {
311  ok(0, "unexpected call\n");
312  return E_NOTIMPL;
313 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ SecurityManager_GetSecuritySite()

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

Definition at line 294 of file sec_mgr.c.

296 {
297  ok(0, "unexpected call\n");
298  return E_NOTIMPL;
299 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ SecurityManager_GetZoneMappings()

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

Definition at line 345 of file sec_mgr.c.

347 {
348  ok(0, "unexpected call\n");
349  return E_NOTIMPL;
350 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ SecurityManager_MapUrlToZone()

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

Definition at line 301 of file sec_mgr.c.

303 {
304  ok(0, "unexpected call\n");
305  return E_NOTIMPL;
306 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

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

318 {
319  CHECK_EXPECT(ProcessUrlAction);
320  ok(dwAction == URLACTION_FEATURE_ZONE_ELEVATION, "dwAction = %x\n", dwAction);
321  ok(cbPolicy == sizeof(DWORD), "cbPolicy = %d\n", cbPolicy);
322  ok(!pContext, "pContext != NULL\n");
323  ok(dwFlags == PUAF_NOUI, "dwFlags = %x\n", dwFlags);
324  ok(dwReserved == 0, "dwReserved = %x\n", dwReserved);
325 
326  *pPolicy = ProcessUrlAction_policy;
327  return ProcessUrlAction_policy==URLPOLICY_ALLOW ? S_OK : S_FALSE;
328 }
#define CHECK_EXPECT(func)
Definition: sec_mgr.c:52
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED _In_opt_ LPTRANSMIT_FILE_BUFFERS _In_ DWORD dwReserved
Definition: mswsock.h:90
static DWORD ProcessUrlAction_policy
Definition: sec_mgr.c:151
#define S_FALSE
Definition: winerror.h:2357
unsigned long DWORD
Definition: ntddk_ex.h:95
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57

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

333 {
334  ok(0, "unexpected call\n");
335  return E_NOTIMPL;
336 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ SecurityManager_QueryInterface()

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

Definition at line 270 of file sec_mgr.c.

272 {
273  ok(0, "unexpected call\n");
274  return E_NOTIMPL;
275 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ SecurityManager_Release()

static ULONG WINAPI SecurityManager_Release ( IInternetSecurityManager This)
static

Definition at line 282 of file sec_mgr.c.

283 {
284  return 1;
285 }

◆ SecurityManager_SetSecuritySite()

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

Definition at line 287 of file sec_mgr.c.

289 {
290  ok(0, "unexpected call\n");
291  return E_NOTIMPL;
292 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ SecurityManager_SetZoneMapping()

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

Definition at line 338 of file sec_mgr.c.

340 {
341  ok(0, "unexpected call\n");
342  return E_NOTIMPL;
343 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ START_TEST()

START_TEST ( sec_mgr  )

Definition at line 1973 of file sec_mgr.c.

1974 {
1975  HMODULE hurlmon;
1976  int argc;
1977  char **argv;
1978 
1979  hurlmon = GetModuleHandleA("urlmon.dll");
1980  pCoInternetCreateSecurityManager = (void*) GetProcAddress(hurlmon, "CoInternetCreateSecurityManager");
1981  pCoInternetCreateZoneManager = (void*) GetProcAddress(hurlmon, "CoInternetCreateZoneManager");
1982  pCoInternetGetSecurityUrl = (void*) GetProcAddress(hurlmon, "CoInternetGetSecurityUrl");
1983  pCoInternetGetSecurityUrlEx = (void*) GetProcAddress(hurlmon, "CoInternetGetSecurityUrlEx");
1984  pCreateUri = (void*) GetProcAddress(hurlmon, "CreateUri");
1985  pCoInternetGetSession = (void*) GetProcAddress(hurlmon, "CoInternetGetSession");
1986  pCoInternetIsFeatureEnabled = (void*) GetProcAddress(hurlmon, "CoInternetIsFeatureEnabled");
1987  pCoInternetIsFeatureEnabledForUrl = (void*) GetProcAddress(hurlmon, "CoInternetIsFeatureEnabledForUrl");
1988  pCoInternetIsFeatureZoneElevationEnabled = (void*) GetProcAddress(hurlmon, "CoInternetIsFeatureZoneElevationEnabled");
1989 
1990  if (!pCoInternetCreateSecurityManager || !pCoInternetCreateZoneManager ||
1991  !pCoInternetGetSecurityUrl) {
1992  win_skip("Various CoInternet* functions not present in IE 4.0\n");
1993  return;
1994  }
1995 
1997  if(argc > 2 && !strcmp(argv[2], "domain_tests")) {
1999  return;
2000  }
2001 
2004 
2006 
2007  if(!pCoInternetGetSecurityUrlEx || !pCreateUri)
2008  win_skip("Skipping CoInternetGetSecurityUrlEx tests, IE too old\n");
2009  else {
2012  }
2013 
2016  test_polices();
2021  test_GetZoneAt();
2026 
2028  OleUninitialize();
2029 }
static void test_CoInternetIsFeatureZoneElevationEnabled(void)
Definition: sec_mgr.c:1894
static void test_GetZoneAt(void)
Definition: sec_mgr.c:1136
static int argc
Definition: ServiceArgs.c:12
static void test_SetZoneAttributes(void)
Definition: sec_mgr.c:1243
static void test_zone_domains(void)
Definition: sec_mgr.c:959
#define argv
Definition: mplay32.c:18
static void test_GetZoneAttributes(void)
Definition: sec_mgr.c:1187
smooth NULL
Definition: ftsmooth.c:416
static void test_SecurityManagerEx2(void)
Definition: sec_mgr.c:1782
static void test_CreateZoneEnumerator(void)
Definition: sec_mgr.c:1023
static void test_zone_domain_mappings(void)
Definition: sec_mgr.c:917
int winetest_get_mainargs(char ***pargv)
static void unregister_protocols(void)
Definition: sec_mgr.c:1578
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:821
HRESULT WINAPI DECLSPEC_HOTPATCH OleInitialize(LPVOID reserved)
Definition: ole2.c:172
static void test_GetZoneActionPolicy(void)
Definition: sec_mgr.c:1093
static void test_InternetSecurityMarshalling(void)
Definition: sec_mgr.c:1320
static void register_protocols(void)
Definition: sec_mgr.c:1561
static void test_SecurityManager(void)
Definition: sec_mgr.c:368
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
#define GetProcAddress(x, y)
Definition: compat.h:410
static void test_CoInternetCreateZoneManager(void)
Definition: sec_mgr.c:978
static void test_InternetGetSecurityUrlEx(void)
Definition: sec_mgr.c:1615
void WINAPI DECLSPEC_HOTPATCH OleUninitialize(void)
Definition: ole2.c:233
#define win_skip
Definition: test.h:141
static void test_polices(void)
Definition: sec_mgr.c:657
static void test_InternetGetSecurityUrl(void)
Definition: sec_mgr.c:1350
static void test_InternetGetSecurityUrlEx_Pluggable(void)
Definition: sec_mgr.c:1691

◆ strcmp_aw()

static DWORD strcmp_aw ( LPCSTR  strA,
LPCWSTR  strB 
)
inlinestatic

Definition at line 196 of file sec_mgr.c.

196  {
197  LPWSTR strAW = a2w(strA);
198  DWORD ret = lstrcmpW(strAW, strB);
199  heap_free(strAW);
200  return ret;
201 }
char strA[12]
Definition: clipboard.c:2028
int WINAPI lstrcmpW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:170
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
static LPWSTR a2w(LPCSTR str)
Definition: sec_mgr.c:183
WCHAR * LPWSTR
Definition: xmlstorage.h:184
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by test_InternetGetSecurityUrlEx().

◆ strcmp_w()

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

Definition at line 174 of file sec_mgr.c.

175 {
176  DWORD len1 = lstrlenW(str1);
177  DWORD len2 = lstrlenW(str2);
178 
179  if(len1!=len2) return 1;
180  return memcmp(str1, str2, len1*sizeof(WCHAR));
181 }
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
#define lstrlenW
Definition: compat.h:407
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95

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

◆ test_activex()

static void test_activex ( IInternetSecurityManager secmgr)
static

Definition at line 636 of file sec_mgr.c.

637 {
638  DWORD policy, policy_size;
639  struct CONFIRMSAFETY cs;
640  BYTE *ppolicy;
641  HRESULT hres;
642 
643  policy = 0xdeadbeef;
644  hres = IInternetSecurityManager_ProcessUrlAction(secmgr, url1, URLACTION_ACTIVEX_RUN, (BYTE*)&policy,
645  sizeof(DWORD), (BYTE*)&CLSID_TestActiveX, sizeof(CLSID), 0, 0);
646  ok(hres == S_OK, "ProcessUrlAction(URLACTION_ACTIVEX_RUN) failed: %08x\n", hres);
647  ok(policy == URLPOLICY_ALLOW || policy == URLPOLICY_DISALLOW, "policy = %x\n", policy);
648 
649  cs.clsid = CLSID_TestActiveX;
650  cs.pUnk = (IUnknown*)0xdeadbeef;
651  cs.dwFlags = 0;
652  hres = IInternetSecurityManager_QueryCustomPolicy(secmgr, url1, &GUID_CUSTOM_CONFIRMOBJECTSAFETY,
653  &ppolicy, &policy_size, (BYTE*)&cs, sizeof(cs), 0);
654  ok(hres == HRESULT_FROM_WIN32(ERROR_NOT_FOUND), "QueryCusromPolicy failed: %08x\n", hres);
655 }
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
uint32_t cs
Definition: isohybrid.c:75
static const GUID CLSID_TestActiveX
Definition: sec_mgr.c:143
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned char BYTE
Definition: mem.h:68
#define S_OK
Definition: intsafe.h:59
static const WCHAR url1[]
Definition: sec_mgr.c:93
#define ok(value,...)
Definition: atltest.h:57
#define ERROR_NOT_FOUND
Definition: winerror.h:690
const GUID GUID_CUSTOM_CONFIRMOBJECTSAFETY
Definition: sec_mgr.c:147

Referenced by test_polices().

◆ test_CoInternetCreateZoneManager()

static void test_CoInternetCreateZoneManager ( void  )
static

Definition at line 978 of file sec_mgr.c.

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

Referenced by START_TEST().

◆ test_CoInternetIsFeatureZoneElevationEnabled()

static void test_CoInternetIsFeatureZoneElevationEnabled ( void  )
static

Definition at line 1894 of file sec_mgr.c.

1895 {
1896  struct {
1897  const char *url_from;
1898  const char *url_to;
1899  DWORD flags;
1900  HRESULT hres;
1901  DWORD policy_flags;
1902  } testcases[] = {
1903  /* 0 */ { "http://www.winehq.org", "http://www.winehq.org", 0, S_FALSE, URLPOLICY_ALLOW },
1904  /* 1 */ { "http://www.winehq.org", "http://www.winehq.org", 0, S_OK, URLPOLICY_DISALLOW },
1905  /* 2 */ { "http://www.winehq.org", "http://www.codeweavers.com", 0, S_FALSE, URLPOLICY_ALLOW },
1906  /* 3 */ { "http://www.winehq.org", "http://www.codeweavers.com", 0, S_OK, URLPOLICY_DISALLOW },
1907  /* 4 */ { "http://www.winehq.org", "http://www.winehq.org", GET_FEATURE_FROM_PROCESS, S_FALSE, -1 },
1908  /* 5 */ { "http://www.winehq.org", "http://www.winehq.org/dir", GET_FEATURE_FROM_PROCESS, S_FALSE, -1 },
1909  /* 6 */ { "http://www.winehq.org", "http://www.codeweavers.com", GET_FEATURE_FROM_PROCESS, S_FALSE, -1 },
1910  /* 7 */ { "http://www.winehq.org", "ftp://winehq.org", GET_FEATURE_FROM_PROCESS, S_FALSE, -1 },
1911  /* 8 */ { "http://www.winehq.org", "ftp://winehq.org", GET_FEATURE_FROM_PROCESS|0x100, S_FALSE, URLPOLICY_ALLOW },
1912  /* 9 */ { "http://www.winehq.org", "ftp://winehq.org", GET_FEATURE_FROM_REGISTRY, S_FALSE, URLPOLICY_ALLOW },
1913  };
1914 
1915  WCHAR *url_from, *url_to;
1916  int i;
1917  HRESULT hres;
1918 
1919  if(!pCoInternetIsFeatureZoneElevationEnabled || !pCoInternetIsFeatureEnabled
1920  || !pCoInternetIsFeatureEnabledForUrl) {
1921  win_skip("Skipping CoInternetIsFeatureZoneElevationEnabled tests\n");
1922  return;
1923  }
1924 
1925 
1926  hres = pCoInternetIsFeatureEnabled(FEATURE_ZONE_ELEVATION, GET_FEATURE_FROM_PROCESS);
1927  ok(SUCCEEDED(hres), "CoInternetIsFeatureEnabled returned %x\n", hres);
1928 
1929  trace("Testing CoInternetIsFeatureZoneElevationEnabled... (%x)\n", hres);
1930 
1931  for(i = 0; i < ARRAY_SIZE(testcases); i++) {
1932  if(hres==S_OK && testcases[i].flags == GET_FEATURE_FROM_PROCESS)
1933  testcases[i].policy_flags = URLPOLICY_ALLOW;
1934  }
1935 
1936  /* IE10 does not seem to use passed ISecurityManager */
1937  SET_EXPECT(ProcessUrlAction);
1938  pCoInternetIsFeatureZoneElevationEnabled(url1, url1, &security_manager, 0);
1939  i = called_ProcessUrlAction;
1940  SET_CALLED(ProcessUrlAction);
1941  if(!i) {
1942  skip("CoInternetIsFeatureZoneElevationEnabled does not use passed ISecurityManager\n");
1943  return;
1944  }
1945 
1946  for(i = 0; i < ARRAY_SIZE(testcases); i++) {
1947  url_from = a2w(testcases[i].url_from);
1948  url_to = a2w(testcases[i].url_to);
1949 
1950  if(testcases[i].policy_flags != -1) {
1951  ProcessUrlAction_policy = testcases[i].policy_flags;
1952  SET_EXPECT(ProcessUrlAction);
1953  }
1954  hres = pCoInternetIsFeatureZoneElevationEnabled(url_from, url_to,
1955  &security_manager, testcases[i].flags);
1956  ok(hres == testcases[i].hres, "%d) CoInternetIsFeatureZoneElevationEnabled returned %x\n", i, hres);
1957  if(testcases[i].policy_flags != -1)
1958  CHECK_CALLED(ProcessUrlAction);
1959 
1960  if(testcases[i].policy_flags != -1)
1961  SET_EXPECT(ProcessUrlAction);
1962  hres = pCoInternetIsFeatureEnabledForUrl(FEATURE_ZONE_ELEVATION,
1963  testcases[i].flags, url_to, &security_manager);
1964  ok(hres == testcases[i].hres, "%d) CoInternetIsFeatureEnabledForUrl returned %x\n", i, hres);
1965  if(testcases[i].policy_flags != -1)
1966  CHECK_CALLED(ProcessUrlAction);
1967 
1968  heap_free(url_from);
1969  heap_free(url_to);
1970  }
1971 }
#define CHECK_CALLED(func)
Definition: sec_mgr.c:65
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
static DWORD ProcessUrlAction_policy
Definition: sec_mgr.c:151
#define S_FALSE
Definition: winerror.h:2357
#define SET_EXPECT(func)
Definition: sec_mgr.c:49
HRESULT hres
Definition: protocol.c:465
#define trace
Definition: atltest.h:70
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
unsigned long DWORD
Definition: ntddk_ex.h:95
GLbitfield flags
Definition: glext.h:7161
static LPWSTR a2w(LPCSTR str)
Definition: sec_mgr.c:183
#define S_OK
Definition: intsafe.h:59
static const WCHAR url1[]
Definition: sec_mgr.c:93
#define ARRAY_SIZE(a)
Definition: main.h:24
#define ok(value,...)
Definition: atltest.h:57
#define skip(...)
Definition: atltest.h:64
#define SET_CALLED(func)
Definition: sec_mgr.c:71
static IInternetSecurityManager security_manager
Definition: sec_mgr.c:366
#define win_skip
Definition: test.h:141
#define SUCCEEDED(hr)
Definition: intsafe.h:57
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by START_TEST().

◆ test_CreateZoneEnumerator()

static void test_CreateZoneEnumerator ( void  )
static

Definition at line 1023 of file sec_mgr.c.

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

Referenced by START_TEST().

◆ test_GetZoneActionPolicy()

static void test_GetZoneActionPolicy ( void  )
static

Definition at line 1093 of file sec_mgr.c.

1094 {
1095  IInternetZoneManager *zonemgr = NULL;
1096  BYTE buf[32];
1097  HRESULT hres;
1098  DWORD action = URLACTION_CREDENTIALS_USE; /* Implemented on all IE versions */
1099 
1100  trace("testing GetZoneActionPolixy...\n");
1101 
1102  hres = pCoInternetCreateZoneManager(NULL, &zonemgr, 0);
1103  ok(hres == S_OK, "CoInternetCreateZoneManager failed: %08x\n", hres);
1104  if(FAILED(hres))
1105  return;
1106 
1107  hres = IInternetZoneManager_GetZoneActionPolicy(zonemgr, 3, action, buf,
1108  sizeof(DWORD), URLZONEREG_DEFAULT);
1109  ok(hres == S_OK, "GetZoneActionPolicy failed: %08x\n", hres);
1110  ok(*(DWORD*)buf == URLPOLICY_CREDENTIALS_SILENT_LOGON_OK ||
1111  *(DWORD*)buf == URLPOLICY_CREDENTIALS_MUST_PROMPT_USER ||
1112  *(DWORD*)buf == URLPOLICY_CREDENTIALS_CONDITIONAL_PROMPT ||
1113  *(DWORD*)buf == URLPOLICY_CREDENTIALS_ANONYMOUS_ONLY,
1114  "unexpected policy=%d\n", *(DWORD*)buf);
1115 
1116  hres = IInternetZoneManager_GetZoneActionPolicy(zonemgr, 3, action, NULL,
1117  sizeof(DWORD), URLZONEREG_DEFAULT);
1118  ok(hres == E_INVALIDARG, "GetZoneActionPolicy failed: %08x, expected E_INVALIDARG\n", hres);
1119 
1120  hres = IInternetZoneManager_GetZoneActionPolicy(zonemgr, 3, action, buf,
1121  2, URLZONEREG_DEFAULT);
1122  ok(hres == E_INVALIDARG, "GetZoneActionPolicy failed: %08x, expected E_INVALIDARG\n", hres);
1123 
1124  hres = IInternetZoneManager_GetZoneActionPolicy(zonemgr, 3, 0x1fff, buf,
1125  sizeof(DWORD), URLZONEREG_DEFAULT);
1127  "(0x%x) got 0x%x (expected E_FAIL)\n", action, hres);
1128 
1129  hres = IInternetZoneManager_GetZoneActionPolicy(zonemgr, 13, action, buf,
1130  sizeof(DWORD), URLZONEREG_DEFAULT);
1131  ok(hres == E_INVALIDARG, "GetZoneActionPolicy failed: %08x, expected E_INVALIDARG\n", hres);
1132 
1133  IInternetZoneManager_Release(zonemgr);
1134 }
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define E_FAIL
Definition: ddrawi.h:102
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
HRESULT hres
Definition: protocol.c:465
#define trace
Definition: atltest.h:70
LONG HRESULT
Definition: typedefs.h:77
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned char BYTE
Definition: mem.h:68
#define broken(x)
Definition: _sntprintf.h:21
#define S_OK
Definition: intsafe.h:59
const WCHAR * action
Definition: action.c:7783
#define ok(value,...)
Definition: atltest.h:57
#define ERROR_NOT_FOUND
Definition: winerror.h:690

Referenced by START_TEST().

◆ test_GetZoneAt()

static void test_GetZoneAt ( void  )
static

Definition at line 1136 of file sec_mgr.c.

1137 {
1138  IInternetZoneManager *zonemgr = NULL;
1139  HRESULT hr;
1140  DWORD dwEnum;
1141  DWORD dwCount;
1142  DWORD dwZone;
1143  DWORD i;
1144 
1145  trace("testing GetZoneAt...\n");
1146 
1147  hr = pCoInternetCreateZoneManager(NULL, &zonemgr, 0);
1148  ok(hr == S_OK, "CoInternetCreateZoneManager result: 0x%x\n", hr);
1149  if (FAILED(hr))
1150  return;
1151 
1152  hr = IInternetZoneManager_CreateZoneEnumerator(zonemgr, &dwEnum, &dwCount, 0);
1153  if (FAILED(hr))
1154  goto cleanup;
1155 
1156  if (0) {
1157  /* this crashes with native urlmon */
1158  IInternetZoneManager_GetZoneAt(zonemgr, dwEnum, 0, NULL);
1159  }
1160 
1161  dwZone = 0xdeadbeef;
1162  hr = IInternetZoneManager_GetZoneAt(zonemgr, 0xdeadbeef, 0, &dwZone);
1163  ok(hr == E_INVALIDARG,
1164  "got 0x%x with 0x%x (expected E_INVALIDARG)\n", hr, dwZone);
1165 
1166  for (i = 0; i < dwCount; i++)
1167  {
1168  dwZone = 0xdeadbeef;
1169  hr = IInternetZoneManager_GetZoneAt(zonemgr, dwEnum, i, &dwZone);
1170  ok(hr == S_OK, "#%d: got x%x with %d (expected S_OK)\n", i, hr, dwZone);
1171  }
1172 
1173  dwZone = 0xdeadbeef;
1174  /* MSDN (index .. must be .. less than or equal to) is wrong */
1175  hr = IInternetZoneManager_GetZoneAt(zonemgr, dwEnum, dwCount, &dwZone);
1176  ok(hr == E_INVALIDARG,
1177  "got 0x%x with 0x%x (expected E_INVALIDARG)\n", hr, dwZone);
1178 
1179  hr = IInternetZoneManager_DestroyZoneEnumerator(zonemgr, dwEnum);
1180  ok(hr == S_OK, "got 0x%x (expected S_OK)\n", hr);
1181 
1182 cleanup:
1183  hr = IInternetZoneManager_Release(zonemgr);
1184  ok(hr == S_OK, "got 0x%x (expected S_OK)\n", hr);
1185 }
HRESULT hr
Definition: shlfolder.c:183
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 E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
#define trace
Definition: atltest.h:70
LONG HRESULT
Definition: typedefs.h:77
unsigned long DWORD
Definition: ntddk_ex.h:95
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
char * cleanup(char *str)
Definition: wpickclick.c:99

Referenced by START_TEST().

◆ test_GetZoneAttributes()

static void test_GetZoneAttributes ( void  )
static

Definition at line 1187 of file sec_mgr.c.

1188 {
1189  IInternetZoneManager *zonemgr = NULL;
1190  CHAR buffer [sizeof(ZONEATTRIBUTES) + 32];
1191  ZONEATTRIBUTES* pZA = (ZONEATTRIBUTES*) buffer;
1192  HRESULT hr;
1193  DWORD i;
1194 
1195  trace("testing GetZoneAttributes...\n");
1196 
1197  hr = pCoInternetCreateZoneManager(NULL, &zonemgr, 0);
1198  ok(hr == S_OK, "CoInternetCreateZoneManager result: 0x%x\n", hr);
1199  if (FAILED(hr))
1200  return;
1201 
1202  /* native urlmon has Zone "0" up to Zone "4" since IE4 */
1203  for (i = 0; i < 5; i++) {
1204  memset(buffer, -1, sizeof(buffer));
1205  hr = IInternetZoneManager_GetZoneAttributes(zonemgr, i, pZA);
1206  ok(hr == S_OK, "#%d: got 0x%x (expected S_OK)\n", i, hr);
1207  }
1208 
1209  /* IE8 no longer set cbSize */
1210  memset(buffer, -1, sizeof(buffer));
1211  pZA->cbSize = 0;
1212  hr = IInternetZoneManager_GetZoneAttributes(zonemgr, 0, pZA);
1213  ok(hr == S_OK, "got 0x%x (expected S_OK)\n", hr);
1214  ok((pZA->cbSize == 0) || (pZA->cbSize == sizeof(ZONEATTRIBUTES)),
1215  "got cbSize = %d (expected 0)\n", pZA->cbSize);
1216 
1217  memset(buffer, -1, sizeof(buffer));
1218  pZA->cbSize = 64;
1219  hr = IInternetZoneManager_GetZoneAttributes(zonemgr, 0, pZA);
1220  ok(hr == S_OK, "got 0x%x (expected S_OK)\n", hr);
1221  ok((pZA->cbSize == 64) || (pZA->cbSize == sizeof(ZONEATTRIBUTES)),
1222  "got cbSize = %d (expected 64)\n", pZA->cbSize);
1223 
1224  memset(buffer, -1, sizeof(buffer));
1225  hr = IInternetZoneManager_GetZoneAttributes(zonemgr, 0, pZA);
1226  ok(hr == S_OK, "got 0x%x (expected S_OK)\n", hr);
1227  ok((pZA->cbSize == 0xffffffff) || (pZA->cbSize == sizeof(ZONEATTRIBUTES)),
1228  "got cbSize = 0x%x (expected 0xffffffff)\n", pZA->cbSize);
1229 
1230  /* IE8 up to IE10 don't fail on invalid zones */
1231  memset(buffer, -1, sizeof(buffer));
1232  hr = IInternetZoneManager_GetZoneAttributes(zonemgr, 0xdeadbeef, pZA);
1233  ok(hr == S_OK || hr == E_FAIL || hr == E_POINTER,
1234  "got 0x%x (expected S_OK or E_FAIL)\n", hr);
1235 
1236  hr = IInternetZoneManager_GetZoneAttributes(zonemgr, 0, NULL);
1237  ok(hr == E_INVALIDARG, "got 0x%x (expected E_INVALIDARG)\n", hr);
1238 
1239  hr = IInternetZoneManager_Release(zonemgr);
1240  ok(hr == S_OK, "got 0x%x (expected S_OK)\n", hr);
1241 }
HRESULT hr
Definition: shlfolder.c:183
char CHAR
Definition: xmlstorage.h:175
GLuint buffer
Definition: glext.h:5915
#define E_FAIL
Definition: ddrawi.h:102
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 E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
#define trace
Definition: atltest.h:70
LONG HRESULT
Definition: typedefs.h:77
unsigned long DWORD
Definition: ntddk_ex.h:95
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
#define E_POINTER
Definition: winerror.h:2365
#define memset(x, y, z)
Definition: compat.h:39

Referenced by START_TEST().

◆ test_InternetGetSecurityUrl()

static void test_InternetGetSecurityUrl ( void  )
static

Definition at line 1350 of file sec_mgr.c.

1351 {
1352  const WCHAR url5_out[] = {'h','t','t','p',':','w','w','w','.','z','o','n','e','3',
1353  '.','w','i','n','e','t','e','s','t',0};
1354  const WCHAR url7_out[] = {'f','t','p',':','z','o','n','e','3','.','w','i','n','e','t','e','s','t',0};
1355 
1356  const WCHAR *in[] = {url2, url3, url4, url5, url7, url8, url9, url10};
1357  const WCHAR *out_default[] = {url2, url3, url4, url5_out, url7_out, url8, url5_out, url10};
1358  const WCHAR *out_securl[] = {url2, url3, url4, url5, url7, url8, url9, url10};
1359 
1360  WCHAR *sec;
1361  DWORD i;
1362  HRESULT hres;
1363 
1364  trace("testing CoInternetGetSecurityUrl...\n");
1365 
1366  for(i = 0; i < ARRAY_SIZE(in); i++) {
1367  hres = pCoInternetGetSecurityUrl(in[i], &sec, PSU_DEFAULT, 0);
1368  ok(hres == S_OK, "(%d) CoInternetGetSecurityUrl returned: %08x\n", i, hres);
1369  if(hres == S_OK) {
1370  ok(!strcmp_w(sec, out_default[i]), "(%d) Got %s, expected %s\n",
1371  i, wine_dbgstr_w(sec), wine_dbgstr_w(out_default[i]));
1372  CoTaskMemFree(sec);
1373  }
1374 
1375  hres = pCoInternetGetSecurityUrl(in[i], &sec, PSU_SECURITY_URL_ONLY, 0);
1376  ok(hres == S_OK, "(%d) CoInternetGetSecurityUrl returned: %08x\n", i, hres);
1377  if(hres == S_OK) {
1378  ok(!strcmp_w(sec, out_securl[i]), "(%d) Got %s, expected %s\n",
1379  i, wine_dbgstr_w(sec), wine_dbgstr_w(out_securl[i]));
1380  CoTaskMemFree(sec);
1381  }
1382  }
1383 
1384  SET_EXPECT(ParseUrl_SECURITY_URL_input2);
1385  SET_EXPECT(ParseUrl_SECURITY_URL_expected);
1386  SET_EXPECT(ParseUrl_SECURITY_DOMAIN_expected);
1387 
1388  hres = pCoInternetGetSecurityUrl(security_url2W, &sec, PSU_DEFAULT, 0);
1389  ok(hres == S_OK, "CoInternetGetSecurityUrl returned 0x%08x, expected S_OK\n", hres);
1390 
1391  CHECK_CALLED(ParseUrl_SECURITY_URL_input2);
1392  CHECK_CALLED(ParseUrl_SECURITY_URL_expected);
1393  CHECK_CALLED(ParseUrl_SECURITY_DOMAIN_expected);
1394 
1395  ok(!lstrcmpW(security_expectedW, sec), "Expected %s but got %s\n",
1397  CoTaskMemFree(sec);
1398 }
static const WCHAR url10[]
Definition: sec_mgr.c:107
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:422
static int strcmp_w(const WCHAR *str1, const WCHAR *str2)
Definition: sec_mgr.c:174
char * wine_dbgstr_w(const wchar_t *wstr)
Definition: atltest.h:87
int WINAPI lstrcmpW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:170
#define CHECK_CALLED(func)
Definition: sec_mgr.c:65
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
static const WCHAR url5[]
Definition: sec_mgr.c:99
static const WCHAR security_expectedW[]
Definition: sec_mgr.c:121
#define SET_EXPECT(func)
Definition: sec_mgr.c:49
HRESULT hres
Definition: protocol.c:465
#define trace
Definition: atltest.h:70
static const WCHAR url8[]
Definition: sec_mgr.c:104
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
unsigned long DWORD
Definition: ntddk_ex.h:95
static const WCHAR url2[]
Definition: sec_mgr.c:95
static const WCHAR url9[]
Definition: sec_mgr.c:105
static const WCHAR url3[]
Definition: sec_mgr.c:96
#define S_OK
Definition: intsafe.h:59
GLuint in
Definition: glext.h:9616
#define ARRAY_SIZE(a)
Definition: main.h:24
#define ok(value,...)
Definition: atltest.h:57
static const WCHAR url4[]
Definition: sec_mgr.c:97
static const WCHAR url7[]
Definition: sec_mgr.c:102
static const WCHAR security_url2W[]
Definition: sec_mgr.c:120

Referenced by START_TEST().

◆ test_InternetGetSecurityUrlEx()

static void test_InternetGetSecurityUrlEx ( void  )
static

Definition at line 1615 of file sec_mgr.c.

1616 {
1617  HRESULT hr;
1618  DWORD i;
1619  IUri *uri = NULL, *result = NULL;
1620 
1621  trace("testing CoInternetGetSecurityUrlEx...\n");
1622 
1623  hr = pCoInternetGetSecurityUrlEx(NULL, NULL, PSU_DEFAULT, 0);
1624  ok(hr == E_INVALIDARG, "CoInternetGetSecurityUrlEx returned 0x%08x, expected E_INVALIDARG\n", hr);
1625 
1626  result = (void*) 0xdeadbeef;
1627  hr = pCoInternetGetSecurityUrlEx(NULL, &result, PSU_DEFAULT, 0);
1628  ok(hr == E_INVALIDARG, "CoInternetGetSecurityUrlEx returned 0x%08x, expected E_INVALIDARG\n", hr);
1629  ok(result == (void*) 0xdeadbeef, "'result' was %p\n", result);
1630 
1631  for(i = 0; i < ARRAY_SIZE(sec_url_ex_tests); ++i) {
1632  LPWSTR uriW = a2w(sec_url_ex_tests[i].uri);
1633  uri = NULL;
1634 
1635  hr = pCreateUri(uriW, sec_url_ex_tests[i].create_flags, 0, &uri);
1636  ok(hr == S_OK, "CreateUri returned 0x%08x on test %d\n", hr, i);
1637  if(hr == S_OK) {
1638  result = NULL;
1639 
1640  hr = pCoInternetGetSecurityUrlEx(uri, &result, PSU_DEFAULT, 0);
1643  "CoInternetGetSecurityUrlEx returned 0x%08x, expected 0x%08x on test %d\n",
1645  }
1646  if(SUCCEEDED(hr)) {
1647  BSTR received;
1648 
1649  hr = IUri_GetDisplayUri(result, &received);
1650  ok(hr == S_OK, "GetDisplayUri returned 0x%08x on test %d\n", hr, i);
1651  if(hr == S_OK) {
1654  "Expected %s but got %s on test %d\n", sec_url_ex_tests[i].default_uri,
1656  }
1657  }
1659  }
1660  if(result) IUri_Release(result);
1661 
1662  result = NULL;
1663  hr = pCoInternetGetSecurityUrlEx(uri, &result, PSU_SECURITY_URL_ONLY, 0);
1666  "CoInternetGetSecurityUrlEx returned 0x%08x, expected 0x%08x on test %d\n",
1668  }
1669  if(SUCCEEDED(hr)) {
1670  BSTR received;
1671 
1672  hr = IUri_GetDisplayUri(result, &received);
1673  ok(hr == S_OK, "GetDisplayUri returned 0x%08x on test %d\n", hr, i);
1674  if(hr == S_OK) {
1677  "Expected %s but got %s on test %d\n", sec_url_ex_tests[i].default_uri,
1679  }
1680  }
1682  }
1683  if(result) IUri_Release(result);
1684  }
1685 
1686  if(uri) IUri_Release(uri);
1687  heap_free(uriW);
1688  }
1689 }
HRESULT default_hres
Definition: sec_mgr.c:1599
HRESULT hr
Definition: shlfolder.c:183
const char * uri
Definition: sec_mgr.c:1594
char * wine_dbgstr_w(const wchar_t *wstr)
Definition: atltest.h:87
r received
Definition: btrfs.c:2892
static DWORD strcmp_aw(LPCSTR strA, LPCWSTR strB)
Definition: sec_mgr.c:196
OLECHAR * BSTR
Definition: compat.h:1934
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 E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
#define todo_wine_if(is_todo)
Definition: test.h:155
#define trace
Definition: atltest.h:70
LONG HRESULT
Definition: typedefs.h:77
unsigned long DWORD
Definition: ntddk_ex.h:95
BOOL todo
Definition: sec_mgr.c:1600
static LPWSTR a2w(LPCSTR str)
Definition: sec_mgr.c:183
#define S_OK
Definition: intsafe.h:59
const char * default_uri
Definition: sec_mgr.c:1598
#define ARRAY_SIZE(a)
Definition: main.h:24
#define ok(value,...)
Definition: atltest.h:57
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:274
DWORD create_flags
Definition: sec_mgr.c:1595
WCHAR * LPWSTR
Definition: xmlstorage.h:184
GLuint64EXT * result
Definition: glext.h:11304
#define SUCCEEDED(hr)
Definition: intsafe.h:57
static const struct @1651 sec_url_ex_tests[]
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by START_TEST().

◆ test_InternetGetSecurityUrlEx_Pluggable()

static void test_InternetGetSecurityUrlEx_Pluggable ( void  )
static

Definition at line 1691 of file sec_mgr.c.

1692 {
1693  HRESULT hr;
1694  IUri *uri = NULL, *result;
1695 
1696  trace("testing CoInternetGetSecurityUrlEx for pluggable protocols...\n");
1697 
1698  hr = pCreateUri(security_urlW, 0, 0, &uri);
1699  ok(hr == S_OK, "CreateUri returned 0x%08x\n", hr);
1700  if(hr == S_OK) {
1701  SET_EXPECT(ParseUrl_SECURITY_URL_input);
1702  SET_EXPECT(ParseUrl_SECURITY_URL_expected);
1703  SET_EXPECT(ParseUrl_SECURITY_DOMAIN_expected);
1704 
1705  hr = pCoInternetGetSecurityUrlEx(uri, &result, PSU_DEFAULT, 0);
1706  ok(hr == S_OK, "CoInternetGetSecurityUrlEx returned 0x%08x, expected S_OK\n", hr);
1707 
1708  CHECK_CALLED(ParseUrl_SECURITY_URL_input);
1709  CHECK_CALLED(ParseUrl_SECURITY_URL_expected);
1710  CHECK_CALLED(ParseUrl_SECURITY_DOMAIN_expected);
1711 
1712  if(hr == S_OK) {
1713  BSTR received = NULL;
1714 
1715  hr = IUri_GetAbsoluteUri(result, &received);
1716  ok(hr == S_OK, "GetAbsoluteUri returned 0x%08x\n", hr);
1717  if(hr == S_OK) {
1718  ok(!strcmp_w(security_expectedW, received), "Expected %s but got %s\n",
1720  }
1722  }
1723  if(result) IUri_Release(result);
1724 
1725  result = NULL;
1726 
1727  SET_EXPECT(ParseUrl_SECURITY_URL_input);
1728  SET_EXPECT(ParseUrl_SECURITY_URL_expected);
1729 
1730  hr = pCoInternetGetSecurityUrlEx(uri, &result, PSU_SECURITY_URL_ONLY, 0);
1731  ok(hr == S_OK, "CoInternetGetSecurityUrlEx returned 0x%08x, expected S_OK\n", hr);
1732 
1733  CHECK_CALLED(ParseUrl_SECURITY_URL_input);
1734  CHECK_CALLED(ParseUrl_SECURITY_URL_expected);
1735 
1736  if(hr == S_OK) {
1737  BSTR received = NULL;
1738 
1739  hr = IUri_GetAbsoluteUri(result, &received);
1740  ok(hr == S_OK, "GetAbsoluteUri returned 0x%08x\n", hr);
1741  if(hr == S_OK) {
1742  ok(!strcmp_w(security_expectedW, received), "Expected %s but got %s\n",
1744  }
1746  }
1747  if(result) IUri_Release(result);
1748  }
1749  if(uri) IUri_Release(uri);
1750 }
HRESULT hr
Definition: shlfolder.c:183
static int strcmp_w(const WCHAR *str1, const WCHAR *str2)
Definition: sec_mgr.c:174
const char * uri
Definition: sec_mgr.c:1594
char * wine_dbgstr_w(const wchar_t *wstr)
Definition: atltest.h:87
#define CHECK_CALLED(func)
Definition: sec_mgr.c:65
r received
Definition: btrfs.c:2892
OLECHAR * BSTR
Definition: compat.h:1934
smooth NULL
Definition: ftsmooth.c:416
static const WCHAR security_expectedW[]
Definition: sec_mgr.c:121
#define SET_EXPECT(func)
Definition: sec_mgr.c:49
#define trace
Definition: atltest.h:70
LONG HRESULT
Definition: typedefs.h:77
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:274
static const WCHAR security_urlW[]
Definition: sec_mgr.c:119
GLuint64EXT * result
Definition: glext.h:11304

Referenced by START_TEST().

◆ test_InternetSecurityMarshalling()

static void test_InternetSecurityMarshalling ( void  )
static

Definition at line 1320 of file sec_mgr.c.

1321 {
1322  IInternetSecurityManager *secmgr = NULL;
1323  IUnknown *unk;
1324  IStream *stream;
1325  HRESULT hres;
1326 
1327  trace("testing marshalling...\n");
1328 
1329  hres = pCoInternetCreateSecurityManager(NULL, &secmgr, 0);
1330  ok(hres == S_OK, "CoInternetCreateSecurityManager failed: %08x\n", hres);
1331  if(FAILED(hres))
1332  return;
1333 
1334  hres = IInternetSecurityManager_QueryInterface(secmgr, &IID_IUnknown, (void**)&unk);
1335  ok(hres == S_OK, "QueryInterface returned: %08x\n", hres);
1336 
1338  ok(hres == S_OK, "CreateStreamOnHGlobal returned: %08x\n", hres);
1339 
1340  hres = CoMarshalInterface(stream, &IID_IInternetSecurityManager, unk, MSHCTX_INPROC, NULL, MSHLFLAGS_NORMAL);
1341  /* Not supported in W98 */
1343  "CoMarshalInterface returned: %08x\n", hres);
1344 
1345  IStream_Release(stream);
1346  IUnknown_Release(unk);
1347  IInternetSecurityManager_Release(secmgr);
1348 }
#define TRUE
Definition: types.h:120
#define REGDB_E_IIDNOTREG
Definition: winerror.h:2697
HRESULT WINAPI CreateStreamOnHGlobal(HGLOBAL hGlobal, BOOL fDeleteOnRelease, LPSTREAM *ppstm)
smooth NULL
Definition: ftsmooth.c:416
HRESULT hres
Definition: protocol.c:465
#define trace
Definition: atltest.h:70
LONG HRESULT
Definition: typedefs.h:77
const GUID IID_IUnknown
Definition: parse.h:22
GLuint GLuint stream
Definition: glext.h:7522
#define broken(x)
Definition: _sntprintf.h:21
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
HRESULT WINAPI CoMarshalInterface(IStream *pStream, REFIID riid, IUnknown *pUnk, DWORD dwDestContext, void *pvDestContext, DWORD mshlFlags)
Definition: marshal.c:1877

Referenced by START_TEST().

◆ test_polices()

static void test_polices ( void  )
static

Definition at line 657 of file sec_mgr.c.

658 {
659  IInternetZoneManager *zonemgr = NULL;
660  IInternetSecurityManager *secmgr = NULL;
661  HRESULT hres;
662 
663  trace("testing polices...\n");
664 
665  hres = pCoInternetCreateSecurityManager(NULL, &secmgr, 0);
666  ok(hres == S_OK, "CoInternetCreateSecurityManager failed: %08x\n", hres);
667  hres = pCoInternetCreateZoneManager(NULL, &zonemgr, 0);
668  ok(hres == S_OK, "CoInternetCreateZoneManager failed: %08x\n", hres);
669 
670  test_url_action(secmgr, zonemgr, URLACTION_SCRIPT_RUN);
671  test_url_action(secmgr, zonemgr, URLACTION_ACTIVEX_RUN);
672  test_url_action(secmgr, zonemgr, URLACTION_ACTIVEX_OVERRIDE_OBJECT_SAFETY);
673  test_url_action(secmgr, zonemgr, URLACTION_CHANNEL_SOFTDIST_PERMISSIONS);
674  test_url_action(secmgr, zonemgr, 0xdeadbeef);
675 
676  test_special_url_action(secmgr, zonemgr, URLACTION_SCRIPT_OVERRIDE_SAFETY);
677  test_special_url_action(secmgr, zonemgr, URLACTION_ACTIVEX_OVERRIDE_SCRIPT_SAFETY);
678 
679  test_activex(secmgr);
680 
681  IInternetSecurityManager_Release(secmgr);
682  IInternetZoneManager_Release(zonemgr);
683 }
static void test_url_action(IInternetSecurityManager *secmgr, IInternetZoneManager *zonemgr, DWORD action)
Definition: sec_mgr.c:500
static void test_special_url_action(IInternetSecurityManager *secmgr, IInternetZoneManager *zonemgr, DWORD action)
Definition: sec_mgr.c:613
smooth NULL
Definition: ftsmooth.c:416
HRESULT hres
Definition: protocol.c:465
#define trace
Definition: atltest.h:70
LONG HRESULT
Definition: typedefs.h:77
static void test_activex(IInternetSecurityManager *secmgr)
Definition: sec_mgr.c:636
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57

Referenced by START_TEST().

◆ test_SecurityManager()

static void test_SecurityManager ( void  )
static

Definition at line 368 of file sec_mgr.c.

369 {
370  int i;
371  IInternetSecurityManager *secmgr = NULL;
372  BYTE buf[512];
373  DWORD zone, size, policy;
374  HRESULT hres;
375 
376  if(!pCoInternetCreateSecurityManager) {
377  return;
378  }
379 
380  trace("Testing security manager...\n");
381 
382  hres = pCoInternetCreateSecurityManager(NULL, &secmgr, 0);
383  ok(hres == S_OK, "CoInternetCreateSecurityManager failed: %08x\n", hres);
384  if(FAILED(hres))
385  return;
386 
387  for(i = 0; i < ARRAY_SIZE(secmgr_tests); i++) {
388  zone = 100;
389  hres = IInternetSecurityManager_MapUrlToZone(secmgr, secmgr_tests[i].url,
390  &zone, 0);
391  ok(hres == secmgr_tests[i].zone_hres /* IE <=6 */
392  || (FAILED(secmgr_tests[i].zone_hres) && hres == E_INVALIDARG), /* IE7 */
393  "[%d] MapUrlToZone failed: %08x, expected %08x\n",
394  i, hres, secmgr_tests[i].zone_hres);
395  if(SUCCEEDED(hres))
396  ok(zone == secmgr_tests[i].zone, "[%d] zone=%d, expected %d\n", i, zone,
397  secmgr_tests[i].zone);
398  else
399  ok(zone == secmgr_tests[i].zone || zone == -1, "[%d] zone=%d\n", i, zone);
400 
401  size = sizeof(buf);
402  memset(buf, 0xf0, sizeof(buf));
403  hres = IInternetSecurityManager_GetSecurityId(secmgr, secmgr_tests[i].url,
404  buf, &size, 0);
406  "[%d] GetSecurityId failed: %08x, expected %08x\n",
408  if(secmgr_tests[i].secid) {
409  ok(size == secmgr_tests[i].secid_size, "[%d] size=%d, expected %d\n",
411  ok(!memcmp(buf, secmgr_tests[i].secid, size), "[%d] wrong secid\n", i);
412  }
413  }
414 
415  zone = 100;
416  hres = IInternetSecurityManager_MapUrlToZone(secmgr, url10, &zone, 0);
417  ok(hres == S_OK, "MapUrlToZone failed: %08x, expected S_OK\n", hres);
418  ok(zone == 3, "zone=%d, expected 3\n", zone);
419 
420  /* win2k3 translates %20 into a space */
421  size = sizeof(buf);
422  memset(buf, 0xf0, sizeof(buf));
423  hres = IInternetSecurityManager_GetSecurityId(secmgr, url10, buf, &size, 0);
424  ok(hres == S_OK, "GetSecurityId failed: %08x, expected S_OK\n", hres);
425  ok(size == sizeof(secid10) ||
426  size == sizeof(secid10_2), /* win2k3 */
427  "size=%d\n", size);
428  ok(!memcmp(buf, secid10, sizeof(secid10)) ||
429  !memcmp(buf, secid10_2, sizeof(secid10_2)), /* win2k3 */
430  "wrong secid\n");
431 
432  zone = 100;
433  hres = IInternetSecurityManager_MapUrlToZone(secmgr, url13, &zone, 0);
434  ok(hres == S_OK, "MapUrlToZone failed: %08x\n", hres);
435  ok(zone == URLZONE_INVALID || broken(zone == URLZONE_INTERNET), "zone=%d\n", zone);
436 
437  size = sizeof(buf);
438  memset(buf, 0xf0, sizeof(buf));
439  hres = IInternetSecurityManager_GetSecurityId(secmgr, url13, buf, &size, 0);
440  ok(hres == E_INVALIDARG || broken(hres == S_OK), "GetSecurityId failed: %08x\n", hres);
441 
442  zone = 100;
443  hres = IInternetSecurityManager_MapUrlToZone(secmgr, url14, &zone, 0);
444  ok(hres == S_OK, "MapUrlToZone failed: %08x, expected S_OK\n", hres);
445  ok(zone == URLZONE_INTERNET, "zone=%d\n", zone);
446 
447  size = sizeof(buf);
448  memset(buf, 0xf0, sizeof(buf));
449  hres = IInternetSecurityManager_GetSecurityId(secmgr, url14, buf, &size, 0);
450  ok(hres == S_OK, "GetSecurityId failed: %08x, expected S_OK\n", hres);
451  ok(size == sizeof(secid14), "size=%d\n", size);
452  ok(!memcmp(buf, secid14, size), "wrong secid\n");
453 
454  zone = 100;
455  hres = IInternetSecurityManager_MapUrlToZone(secmgr, NULL, &zone, 0);
456  ok(hres == E_INVALIDARG, "MapUrlToZone failed: %08x, expected E_INVALIDARG\n", hres);
457  ok(zone == 100 || zone == -1, "zone=%d\n", zone);
458 
459  size = sizeof(buf);
460  hres = IInternetSecurityManager_GetSecurityId(secmgr, NULL, buf, &size, 0);
461  ok(hres == E_INVALIDARG,
462  "GetSecurityId failed: %08x, expected E_INVALIDARG\n", hres);
463  hres = IInternetSecurityManager_GetSecurityId(secmgr, secmgr_tests[1].url,
464  NULL, &size, 0);
465  ok(hres == E_INVALIDARG,
466  "GetSecurityId failed: %08x, expected E_INVALIDARG\n", hres);
467  hres = IInternetSecurityManager_GetSecurityId(secmgr, secmgr_tests[1].url,
468  buf, NULL, 0);
469  ok(hres == E_INVALIDARG,
470  "GetSecurityId failed: %08x, expected E_INVALIDARG\n", hres);
471 
472  hres = IInternetSecurityManager_ProcessUrlAction(secmgr, NULL, URLACTION_SCRIPT_RUN, (BYTE*)&policy,
473  sizeof(WCHAR), NULL, 0, 0, 0);
474  ok(hres == E_INVALIDARG, "ProcessUrlAction failed: %08x, expected E_INVALIDARG\n", hres);
475 
476  IInternetSecurityManager_Release(secmgr);
477 }
static const WCHAR url10[]
Definition: sec_mgr.c:107
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
static const BYTE secid10_2[]
Definition: sec_mgr.c:138
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
const BYTE * secid
Definition: sec_mgr.c:1762
DWORD secid_size
Definition: sec_mgr.c:1763
static struct secmgr_test secmgr_tests[]
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 E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
GLsizeiptr size
Definition: glext.h:5919
HRESULT hres
Definition: protocol.c:465
#define trace
Definition: atltest.h:70
static const WCHAR url13[]
Definition: sec_mgr.c:111
static const BYTE secid10[]
Definition: sec_mgr.c:134
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
static const WCHAR url[]
Definition: encode.c:1432
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned char BYTE
Definition: mem.h:68
#define broken(x)
Definition: _sntprintf.h:21
static const BYTE secid14[]
Definition: sec_mgr.c:136
DWORD zone
Definition: sec_mgr.c:1760
#define S_OK
Definition: intsafe.h:59
#define ARRAY_SIZE(a)
Definition: main.h:24
#define ok(value,...)
Definition: atltest.h:57
static const WCHAR url14[]
Definition: sec_mgr.c:112
#define memset(x, y, z)
Definition: compat.h:39
HRESULT secid_hres
Definition: sec_mgr.c:1764
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by START_TEST().

◆ test_SecurityManagerEx2()

static void test_SecurityManagerEx2 ( void  )
static

Definition at line 1782 of file sec_mgr.c.

1783 {
1784  HRESULT hres;
1785  DWORD i, zone;
1786  BYTE buf[512];
1787  DWORD buf_size = sizeof(buf);
1788  IInternetSecurityManager *sec_mgr;
1789  IInternetSecurityManagerEx2 *sec_mgr2;
1790  IUri *uri = NULL;
1791 
1792  static const WCHAR domainW[] = {'c','o','m','.','u','k',0};
1793 
1794  if(!pCreateUri) {
1795  win_skip("Skipping SecurityManagerEx2, IE is too old\n");
1796  return;
1797  }
1798 
1799  trace("Testing SecurityManagerEx2...\n");
1800 
1801  hres = pCoInternetCreateSecurityManager(NULL, &sec_mgr, 0);
1802  ok(hres == S_OK, "CoInternetCreateSecurityManager failed: %08x\n", hres);
1803 
1804  hres = IInternetSecurityManager_QueryInterface(sec_mgr, &IID_IInternetSecurityManagerEx2, (void**)&sec_mgr2);
1805  ok(hres == S_OK, "QueryInterface(IID_IInternetSecurityManagerEx2) failed: %08x\n", hres);
1806 
1807  zone = 0xdeadbeef;
1808 
1809  hres = IInternetSecurityManagerEx2_MapUrlToZoneEx2(sec_mgr2, NULL, &zone, 0, NULL, NULL);
1810  ok(hres == E_INVALIDARG, "MapUrlToZoneEx2 returned %08x, expected E_INVALIDARG\n", hres);
1811  ok(zone == URLZONE_INVALID, "zone was %d\n", zone);
1812 
1813  hres = IInternetSecurityManagerEx2_GetSecurityIdEx2(sec_mgr2, NULL, buf, &buf_size, 0);
1814  ok(hres == E_INVALIDARG, "GetSecurityIdEx2 returned %08x, expected E_INVALIDARG\n", hres);
1815  ok(buf_size == sizeof(buf), "buf_size was %d\n", buf_size);
1816 
1817  hres = pCreateUri(url5, 0, 0, &uri);
1818  ok(hres == S_OK, "CreateUri failed: %08x\n", hres);
1819 
1820  hres = IInternetSecurityManagerEx2_MapUrlToZoneEx2(sec_mgr2, uri, NULL, 0, NULL, NULL);
1821  ok(hres == E_INVALIDARG, "MapToUrlZoneEx2 returned %08x, expected E_INVALIDARG\n", hres);
1822 
1823  buf_size = sizeof(buf);
1824  hres = IInternetSecurityManagerEx2_GetSecurityIdEx2(sec_mgr2, uri, NULL, &buf_size, 0);
1825  ok(hres == E_INVALIDARG || broken(hres == S_OK), "GetSecurityIdEx2 failed: %08x\n", hres);
1826  ok(buf_size == sizeof(buf), "bug_size was %d\n", buf_size);
1827 
1828  hres = IInternetSecurityManagerEx2_GetSecurityIdEx2(sec_mgr2, uri, buf, NULL, 0);
1829  ok(hres == E_INVALIDARG, "GetSecurityIdEx2 returned %08x, expected E_INVALIDARG\n", hres);
1830 
1831  IUri_Release(uri);
1832 
1833  for(i = 0; i < ARRAY_SIZE(sec_mgr_ex2_tests); ++i) {
1834  LPWSTR uriW = a2w(sec_mgr_ex2_tests[i].uri);
1835 
1836  uri = NULL;
1837  zone = URLZONE_INVALID;
1838 
1839  hres = pCreateUri(uriW, sec_mgr_ex2_tests[i].create_flags, 0, &uri);
1840  ok(hres == S_OK, "CreateUri returned %08x for '%s'\n", hres, sec_mgr_ex2_tests[i].uri);
1841 
1842  hres = IInternetSecurityManagerEx2_MapUrlToZoneEx2(sec_mgr2, uri, &zone, 0, NULL, NULL);
1844  ok(hres == sec_mgr_ex2_tests[i].map_hres, "MapUrlToZoneEx2 returned %08x, expected %08x for '%s'\n",
1846  ok(zone == sec_mgr_ex2_tests[i].zone, "Expected zone %d, but got %d for '%s'\n", sec_mgr_ex2_tests[i].zone,
1848  }
1849 
1850  buf_size = sizeof(buf);
1851  memset(buf, 0xf0, buf_size);
1852 
1853  hres = IInternetSecurityManagerEx2_GetSecurityIdEx2(sec_mgr2, uri, buf, &buf_size, 0);
1855  ok(hres == sec_mgr_ex2_tests[i].secid_hres, "GetSecurityIdEx2 returned %08x, expected %08x on test '%s'\n",
1857  if(sec_mgr_ex2_tests[i].secid) {
1858  ok(buf_size == sec_mgr_ex2_tests[i].secid_size, "Got wrong security id size=%d, expected %d on test '%s'\n",
1860  ok(!memcmp(buf, sec_mgr_ex2_tests[i].secid, sec_mgr_ex2_tests[i].secid_size), "Got wrong security id on test '%s'\n",
1862  }
1863  }
1864 
1865  heap_free(uriW);
1866  IUri_Release(uri);
1867  }
1868 
1869  hres = pCreateUri(url15, 0, 0, &uri);
1870  ok(hres == S_OK, "CreateUri failed: %08x\n", hres);
1871 
1872  buf_size = sizeof(buf);
1873  memset(buf, 0xf0, buf_size);
1874 
1875  hres = IInternetSecurityManagerEx2_GetSecurityIdEx2(sec_mgr2, uri, buf, &buf_size, (DWORD_PTR)domainW);
1876  ok(hres == S_OK, "GetSecurityIdEx2 failed: %08x\n", hres);
1877  todo_wine ok(buf_size == sizeof(secid13), "buf_size was %d\n", buf_size);
1878  todo_wine ok(!memcmp(buf, secid13, sizeof(secid13)), "Got wrong secid\n");
1879 
1880  buf_size = sizeof(buf);
1881  memset(buf, 0xf0, buf_size);
1882 
1883  hres = IInternetSecurityManagerEx2_GetSecurityIdEx2(sec_mgr2, uri, buf, &buf_size, 0);
1884  ok(hres == S_OK, "GetSecurityIdEx2 failed: %08x\n", hres);
1885  ok(buf_size == sizeof(secid13_2), "buf_size was %d\n", buf_size);
1886  ok(!memcmp(buf, secid13_2, sizeof(secid13_2)), "Got wrong secid\n");
1887 
1888  IUri_Release(uri);
1889 
1890  IInternetSecurityManagerEx2_Release(sec_mgr2);
1891  IInternetSecurityManager_Release(sec_mgr);
1892 }
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
HRESULT map_hres
Definition: sec_mgr.c:1759
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
const char * uri
Definition: sec_mgr.c:1594
const BYTE * secid
Definition: sec_mgr.c:1762
BOOL secid_todo
Definition: sec_mgr.c:1765
BOOL map_todo
Definition: sec_mgr.c:1761
DWORD secid_size
Definition: sec_mgr.c:1763
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 E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
static const WCHAR url5[]
Definition: sec_mgr.c:99
#define todo_wine_if(is_todo)
Definition: test.h:155
HRESULT hres
Definition: protocol.c:465
#define trace
Definition: atltest.h:70
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
unsigned long DWORD
Definition: ntddk_ex.h:95
static const BYTE secid13[]
Definition: sec_mgr.c:140
static LPWSTR a2w(LPCSTR str)
Definition: sec_mgr.c:183
#define todo_wine
Definition: test.h:154
unsigned char BYTE
Definition: mem.h:68
uint32_t DWORD_PTR
Definition: typedefs.h:63
static const WCHAR url15[]
Definition: sec_mgr.c:113
#define broken(x)
Definition: _sntprintf.h:21
DWORD zone
Definition: sec_mgr.c:1760
#define S_OK
Definition: intsafe.h:59
#define ARRAY_SIZE(a)
Definition: main.h:24
#define ok(value,...)
Definition: atltest.h:57
DWORD create_flags
Definition: sec_mgr.c:1595
static const struct @1652 sec_mgr_ex2_tests[]
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define memset(x, y, z)
Definition: compat.h:39
#define win_skip
Definition: test.h:141
HRESULT secid_hres
Definition: sec_mgr.c:1764
static BOOL heap_free(void *mem)
Definition: appwiz.h:75
static const BYTE secid13_2[]
Definition: sec_mgr.c:141

Referenced by START_TEST().

◆ test_SetZoneAttributes()

static void test_SetZoneAttributes ( void  )
static

Definition at line 1243 of file sec_mgr.c.

1244 {
1245  IInternetZoneManager *zonemgr = NULL;
1246  CHAR buffer [sizeof(ZONEATTRIBUTES) + 16];
1247  ZONEATTRIBUTES* pZA = (ZONEATTRIBUTES*) buffer;
1248  CHAR regpath[MAX_PATH];
1249  HKEY hkey;
1250  HRESULT hr;
1251  DWORD res;
1252 
1253  trace("testing SetZoneAttributes...\n");
1254  hr = pCoInternetCreateZoneManager(NULL, &zonemgr, 0);
1255  ok(hr == S_OK, "CoInternetCreateZoneManager result: 0x%x\n", hr);
1256  if (FAILED(hr))
1257  return;
1258 
1259  memset(buffer, -1, sizeof(buffer));
1260  hr = IInternetZoneManager_GetZoneAttributes(zonemgr, URLZONE_LOCAL_MACHINE, pZA);
1261  ok(hr == S_OK, "got 0x%x (expected S_OK)\n", hr);
1262 
1263  sprintf(regpath, "%s\\Zones\\%d", szInternetSettingsKey, URLZONE_CUSTOM);
1264  res = RegCreateKeyA(HKEY_CURRENT_USER, regpath, &hkey);
1265  RegCloseKey(hkey);
1266 
1267  ok(res == ERROR_SUCCESS, "got %d (expected ERROR_SUCCESS)\n", res);
1268  if (res != ERROR_SUCCESS)
1269  goto cleanup;
1270 
1271  pZA->cbSize = sizeof(ZONEATTRIBUTES);
1272  hr = IInternetZoneManager_SetZoneAttributes(zonemgr, URLZONE_CUSTOM, NULL);
1273  ok(hr == E_INVALIDARG, "got 0x%x (expected E_INVALIDARG)\n", hr);
1274 
1275  /* normal use */
1276  hr = IInternetZoneManager_SetZoneAttributes(zonemgr, URLZONE_CUSTOM, pZA);
1277  if (hr == E_FAIL) {
1278  win_skip("SetZoneAttributes not supported: IE too old\n");
1279  goto cleanup;
1280  }
1281  ok(hr == S_OK, "got 0x%x (expected S_OK)\n", hr);
1282 
1283  /* native urlmon ignores cbSize */
1284  pZA->cbSize = sizeof(ZONEATTRIBUTES) + sizeof(DWORD);
1285  hr = IInternetZoneManager_SetZoneAttributes(zonemgr, URLZONE_CUSTOM, pZA);
1286  ok(hr == S_OK, "got 0x%x for sizeof(ZONEATTRIBUTES) + sizeof(DWORD) (expected S_OK)\n", hr);
1287 
1288  pZA->cbSize = sizeof(ZONEATTRIBUTES) - sizeof(DWORD);
1289  hr = IInternetZoneManager_SetZoneAttributes(zonemgr, URLZONE_CUSTOM, pZA);
1290  ok(hr == S_OK, "got 0x%x for sizeof(ZONEATTRIBUTES) - sizeof(DWORD) (expected S_OK)\n", hr);
1291 
1292  pZA->cbSize = 0;
1293  hr = IInternetZoneManager_SetZoneAttributes(zonemgr, URLZONE_CUSTOM, pZA);
1294  ok(hr == S_OK, "got 0x%x for size 0 (expected S_OK)\n", hr);
1295 
1296  /* The key for the zone must be present, when calling SetZoneAttributes */
1298  /* E_FAIL is returned from IE6 here, which is reasonable.
1299  All newer IE return S_OK without saving the zone attributes to the registry.
1300  This is a Windows bug, but we have to accept that as standard */
1301  hr = IInternetZoneManager_SetZoneAttributes(zonemgr, URLZONE_CUSTOM, pZA);
1302  ok((hr == S_OK) || broken(hr == E_FAIL), "got 0x%x (expected S_OK)\n", hr);
1303 
1304  /* SetZoneAttributes did not create the directory */
1305  res = RegOpenKeyA(HKEY_CURRENT_USER, regpath, &hkey);
1306  ok((res == ERROR_FILE_NOT_FOUND) && (hkey == NULL),
1307  "got %u with %p (expected ERROR_FILE_NOT_FOUND with NULL)\n", res, hkey);
1308 
1309  if (hkey) RegCloseKey(hkey);
1310 
1311 cleanup:
1312  /* delete zone settings in the registry */
1314 
1315  hr = IInternetZoneManager_Release(zonemgr);
1316  ok(hr == S_OK, "got 0x%x (expected S_OK)\n", hr);
1317 }
LONG WINAPI RegOpenKeyA(HKEY hKey, LPCSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:3257
#define ERROR_SUCCESS
Definition: deptool.c:10
HRESULT hr
Definition: shlfolder.c:183
#define HKEY_CURRENT_USER
Definition: winreg.h:11
char CHAR
Definition: xmlstorage.h:175
GLuint buffer
Definition: glext.h:5915
#define E_FAIL
Definition: ddrawi.h:102
static const char * szInternetSettingsKey
Definition: sec_mgr.c:125
#define sprintf(buf, format,...)
Definition: sprintf.c:55
#define URLZONE_CUSTOM
Definition: sec_mgr.c:43
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
LONG WINAPI RegCreateKeyA(HKEY hKey, LPCSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:1177
#define trace
Definition: atltest.h:70
LONG HRESULT
Definition: typedefs.h:77
#define MAX_PATH
Definition: compat.h:26
unsigned long DWORD
Definition: ntddk_ex.h:95
#define broken(x)
Definition: _sntprintf.h:21
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
GLuint res
Definition: glext.h:9613
char * cleanup(char *str)
Definition: wpickclick.c:99
static LONG myRegDeleteTreeA(HKEY hKey, LPCSTR lpszSubKey)
Definition: sec_mgr.c:205
#define memset(x, y, z)
Definition: compat.h:39
#define win_skip
Definition: test.h:141

Referenced by START_TEST().

◆ test_special_url_action()

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

Definition at line 613 of file sec_mgr.c.

614 {
615  DWORD policy;
616  HRESULT hres;
617 
618  policy = 0xdeadbeef;
619  hres = IInternetZoneManager_GetZoneActionPolicy(zonemgr, 3, action, (BYTE*)&policy,
620  sizeof(DWORD), URLZONEREG_DEFAULT);
621  ok(hres == S_OK, "GetZoneActionPolicy failed: %08x\n", hres);
622  ok(policy == URLPOLICY_DISALLOW, "(%x) policy=%x, expected URLPOLICY_DISALLOW\n", action, policy);
623 
624  policy = 0xdeadbeef;
625  hres = IInternetSecurityManager_ProcessUrlAction(secmgr, url1, action, (BYTE*)&policy,
626  sizeof(WCHAR), NULL, 0, 0, 0);
627  ok(hres == S_FALSE, "ProcessUrlAction(%x) failed: %08x, expected S_FALSE\n", action, hres);
628 
629  policy = 0xdeadbeef;
630  hres = IInternetSecurityManager_ProcessUrlAction(secmgr, url1, action, (BYTE*)&policy,
631  sizeof(DWORD), NULL, 0, 0, 0);
632  ok(hres == S_FALSE, "ProcessUrlAction(%x) failed: %08x, expected S_FALSE\n", action, hres);
633  ok(policy == URLPOLICY_DISALLOW, "policy = %x\n", policy);
634 }
#define S_FALSE
Definition: winerror.h:2357
smooth NULL
Definition: ftsmooth.c:416
HRESULT hres
Definition: protocol.c:465
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned char BYTE
Definition: mem.h:68
#define S_OK
Definition: intsafe.h:59
const WCHAR * action
Definition: action.c:7783
static const WCHAR url1[]
Definition: sec_mgr.c:93
#define ok(value,...)
Definition: atltest.h:57

Referenced by test_polices().

◆ test_url_action()

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

Definition at line 500 of file sec_mgr.c.

501 {
502  DWORD res, size, policy, reg_policy;
503  char buf[10];
504  HKEY hkey;
505  HRESULT hres;
506 
507  /* FIXME: HKEY_CURRENT_USER is most of the time the default but this can be changed on a system.
508  * The test should be changed to cope with that, if need be.
509  */
511  "Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\Zones\\3", &hkey);
512  ok(res == ERROR_SUCCESS, "Could not open zone key\n");
513  if(res != ERROR_SUCCESS)
514  return;
515 
516  wsprintfA(buf, "%X", action);
517  size = sizeof(DWORD);
518  res = RegQueryValueExA(hkey, buf, NULL, NULL, (BYTE*)&reg_policy, &size);
519  RegCloseKey(hkey);
520 
521  /* Try settings from HKEY_LOCAL_MACHINE. */
522  if(res != ERROR_SUCCESS || size != sizeof(DWORD)) {
524  "Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\Zones\\3", &hkey);
525  ok(res == ERROR_SUCCESS, "Could not open zone key\n");
526 
527  size = sizeof(DWORD);
528  res = RegQueryValueExA(hkey, buf, NULL, NULL, (BYTE*)&reg_policy, &size);
529  RegCloseKey(hkey);
530  }
531 
532  if(res != ERROR_SUCCESS || size != sizeof(DWORD)) {
533  policy = 0xdeadbeef;
534  hres = IInternetSecurityManager_ProcessUrlAction(secmgr, url9, action, (BYTE*)&policy,
535  sizeof(WCHAR), NULL, 0, 0, 0);
537  "(0x%x) got 0x%x (expected E_FAIL)\n", action, hres);
538  ok(policy == 0xdeadbeef, "(%x) policy=%x\n", action, policy);
539 
540  policy = 0xdeadbeef;
541  hres = IInternetZoneManager_GetZoneActionPolicy(zonemgr, 3, action, (BYTE*)&policy,
542  sizeof(DWORD), URLZONEREG_DEFAULT);
544  "(0x%x) got 0x%x (expected E_FAIL)\n", action, hres);
545  ok(policy == 0xdeadbeef, "(%x) policy=%x\n", action, policy);
546  return;
547  }
548 
549  policy = 0xdeadbeef;
550  hres = IInternetZoneManager_GetZoneActionPolicy(zonemgr, 3, action, (BYTE*)&policy,
551  sizeof(DWORD), URLZONEREG_DEFAULT);
552  ok(hres == S_OK, "GetZoneActionPolicy failed: %08x\n", hres);
553  ok(policy == reg_policy, "(%x) policy=%x, expected %x\n", action, policy, reg_policy);
554 
555  if(policy != URLPOLICY_QUERY) {
557  BOOL expect_parse_call = !called_securl_http;
558 
559  policy = 0xdeadbeef;
560  hres = IInternetSecurityManager_ProcessUrlAction(secmgr, url9, action, (BYTE*)&policy,
561  sizeof(WCHAR), NULL, 0, 0, 0);
562  if(reg_policy == URLPOLICY_DISALLOW)
563  ok(hres == S_FALSE, "ProcessUrlAction(%x) failed: %08x, expected S_FALSE\n", action, hres);
564  else
565  ok(hres == S_OK, "ProcessUrlAction(%x) failed: %08x\n", action, hres);
566  ok(policy == 0xdeadbeef, "(%x) policy=%x\n", action, policy);
567 
568  policy = 0xdeadbeef;
569  hres = IInternetSecurityManager_ProcessUrlAction(secmgr, url9, action, (BYTE*)&policy,
570  2, NULL, 0, 0, 0);
571  if(reg_policy == URLPOLICY_DISALLOW)
572  ok(hres == S_FALSE, "ProcessUrlAction(%x) failed: %08x, expected S_FALSE\n", action, hres);
573  else
574  ok(hres == S_OK, "ProcessUrlAction(%x) failed: %08x\n", action, hres);
575  ok(policy == 0xdeadbeef, "(%x) policy=%x\n", action, policy);
576 
577  policy = 0xdeadbeef;
578  hres = IInternetSecurityManager_ProcessUrlAction(secmgr, url9, action, (BYTE*)&policy,
579  sizeof(DWORD), NULL, 0, 0, 0);
580  if(reg_policy == URLPOLICY_DISALLOW)
581  ok(hres == S_FALSE, "ProcessUrlAction(%x) failed: %08x, expected S_FALSE\n", action, hres);
582  else
583  ok(hres == S_OK, "ProcessUrlAction(%x) failed: %08x\n", action, hres);
584  ok(policy == reg_policy, "(%x) policy=%x\n", action, policy);
585 
586  policy = 0xdeadbeef;
587  hres = IInternetSecurityManager_ProcessUrlAction(secmgr, url9, action, (BYTE*)&policy,
588  sizeof(WCHAR), (BYTE*)0xdeadbeef, 16, 0, 0);
589  if(reg_policy == URLPOLICY_DISALLOW)
590  ok(hres == S_FALSE, "ProcessUrlAction(%x) failed: %08x, expected S_FALSE\n", action, hres);
591  else
592  ok(hres == S_OK, "ProcessUrlAction(%x) failed: %08x\n", action, hres);
593  ok(policy == 0xdeadbeef, "(%x) policy=%x\n", action, policy);
594 
595  policy = 0xdeadbeef;
596  if(expect_parse_call)
597  SET_EXPECT(ParseUrl_SECURITY_URL_http);
598  hres = IInternetSecurityManager_ProcessUrlAction(secmgr, winetest_to_httpW, action, (BYTE*)&policy,
599  sizeof(DWORD), NULL, 0, 0, 0);
600  if(expect_parse_call)
601  CHECK_CALLED(ParseUrl_SECURITY_URL_http);
602  if(reg_policy == URLPOLICY_DISALLOW)
603  ok(hres == S_FALSE, "ProcessUrlAction(%x) failed: %08x, expected S_FALSE\n", action, hres);
604  else
605  ok(hres == S_OK, "ProcessUrlAction(%x) failed: %08x\n", action, hres);
606  ok(policy == reg_policy, "(%x) policy=%x\n", action, policy);
607  }else {
608  skip("IE running in Enhanced Security Configuration\n");
609  }
610  }
611 }
LONG WINAPI RegOpenKeyA(HKEY hKey, LPCSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:3257
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:4023
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
#define ERROR_SUCCESS
Definition: deptool.c:10
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define HKEY_CURRENT_USER
Definition: winreg.h:11
#define CHECK_CALLED(func)
Definition: sec_mgr.c:65
int winetest_interactive
#define E_FAIL
Definition: ddrawi.h:102
static BOOL is_ie_hardened(void)
Definition: sec_mgr.c:481
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
unsigned int BOOL
Definition: ntddk_ex.h:94
#define S_FALSE
Definition: winerror.h:2357
smooth NULL
Definition: ftsmooth.c:416
static const WCHAR winetest_to_httpW[]
Definition: sec_mgr.c:122
static int called_securl_http
Definition: sec_mgr.c:150
#define SET_EXPECT(func)
Definition: sec_mgr.c:49
GLsizeiptr size
Definition: glext.h:5919
HRESULT hres
Definition: protocol.c:465
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
unsigned long DWORD
Definition: ntddk_ex.h:95
static const WCHAR url9[]
Definition: sec_mgr.c:105
unsigned char BYTE
Definition: mem.h:68
#define broken(x)
Definition: _sntprintf.h:21
#define S_OK
Definition: intsafe.h:59
const WCHAR * action
Definition: action.c:7783
int WINAPIV wsprintfA(_Out_ LPSTR, _In_ _Printf_format_string_ LPCSTR,...)
#define ok(value,...)
Definition: atltest.h:57
#define ERROR_NOT_FOUND
Definition: winerror.h:690
#define skip(...)
Definition: atltest.h:64
static IInternetSecurityManager DWORD
Definition: sec_mgr.c:83
GLuint res
Definition: glext.h:9613
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12

Referenced by test_polices().

◆ test_zone_domain_cache()

static void test_zone_domain_cache ( void  )
static

Definition at line 689 of file sec_mgr.c.

690 {
691  HRESULT hres;
692  DWORD res, zone;
693  IInternetSecurityManager *secmgr = NULL;
694  HKEY domains, domain;
695 
696  static const WCHAR testing_domain_urlW[] = {'h','t','t','p',':','/','/','t','e','s','t','i','n','g','.',
697  'd','o','m','a','i','n','/',0};
698 
700  ok(res == ERROR_SUCCESS, "RegOpenKey failed: %d\n", res);
701  if(res != ERROR_SUCCESS)
702  return;
703 
704  res = RegCreateKeyA(domains, "testing.domain", &domain);
705  ok(res == ERROR_SUCCESS, "RegCreateKey failed: %d\n", res);
706  if(res != ERROR_SUCCESS) {
707  RegCloseKey(domains);
708  return;
709  }
710 
712  res = RegSetValueExA(domain, "http", 0, REG_DWORD, (BYTE*)&zone, sizeof(DWORD));
713  ok(res == ERROR_SUCCESS, "RegSetValueEx failed: %d\n", res);
714 
715  RegCloseKey(domain);
716 
717  hres = pCoInternetCreateSecurityManager(NULL, &secmgr, 0);
718  ok(hres == S_OK, "CoInternetCreateSecurityManager failed: %08x\n", hres);
719 
720  zone = URLZONE_INVALID;
721  hres = IInternetSecurityManager_MapUrlToZone(secmgr, testing_domain_urlW, &zone, 0);
722  ok(hres == S_OK, "MapUrlToZone failed: %08x\n", hres);
723  todo_wine ok(zone == URLZONE_INTERNET, "Got %d, expected URLZONE_INTERNET\n", zone);
724 
725  /* FIXME: Play nice with ZoneMaps that existed before the test is run. */
726  res = RegDeleteKeyA(domains, "testing.domain");
727  ok(res == ERROR_SUCCESS, "RegDeleteKey failed: %d\n", res);
728 
729  RegCloseKey(domains);
730  IInternetSecurityManager_Release(secmgr);
731 }
LONG WINAPI RegOpenKeyA(HKEY hKey, LPCSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:3257
#define ERROR_SUCCESS
Definition: deptool.c:10
#define HKEY_CURRENT_USER
Definition: winreg.h:11
#define URLZONE_CUSTOM
Definition: sec_mgr.c:43
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
smooth NULL
Definition: ftsmooth.c:416
LONG WINAPI RegCreateKeyA(HKEY hKey, LPCSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:1177
HRESULT hres
Definition: protocol.c:465
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
unsigned long DWORD
Definition: ntddk_ex.h:95
#define todo_wine
Definition: test.h:154
unsigned char BYTE
Definition: mem.h:68
LONG WINAPI RegDeleteKeyA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey)
Definition: reg.c:1222
DWORD zone
Definition: sec_mgr.c:1760
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
GLuint res
Definition: glext.h:9613
LONG WINAPI RegSetValueExA(HKEY hKey, LPCSTR lpValueName, DWORD Reserved, DWORD dwType, CONST BYTE *lpData, DWORD cbData)
Definition: reg.c:4812
#define REG_DWORD
Definition: sdbapi.c:596
static const char * szZoneMapDomainsKey
Definition: sec_mgr.c:124

Referenced by test_zone_domains().

◆ test_zone_domain_mappings()

static void test_zone_domain_mappings ( void  )
static

Definition at line 917 of file sec_mgr.c.

918 {
919  HRESULT hres;
920  DWORD i, res;
921  IInternetSecurityManager *secmgr = NULL;
922  HKEY domains;
923  DWORD zone = URLZONE_INVALID;
924 
925  trace("testing zone domain mappings...\n");
926 
927  hres = pCoInternetCreateSecurityManager(NULL, &secmgr, 0);
928  ok(hres == S_OK, "CoInternetCreateSecurityManager failed: %08x\n", hres);
929 
931  if(res == ERROR_SUCCESS) {
932  static const WCHAR local_machineW[] = {'h','t','t','p',':','/','/','t','e','s','t','.','l','o','c','a','l',
933  '.','m','a','c','h','i','n','e','/',0};
934 
935  hres = IInternetSecurityManager_MapUrlToZone(secmgr, local_machineW, &zone, 0);
936  ok(hres == S_OK, "MapUrlToZone failed: %08x\n", hres);
937  ok(zone == URLZONE_CUSTOM, "Expected URLZONE_CUSTOM, but got %d\n", zone);
938 
939  RegCloseKey(domains);
940  }
941 
942  for(i = 0; i < ARRAY_SIZE(zone_mapping_tests); ++i) {
944  LPWSTR urlW = a2w(test->url);
945  zone = URLZONE_INVALID;
946 
947  hres = IInternetSecurityManager_MapUrlToZone(secmgr, urlW, &zone, 0);
948  ok(hres == S_OK, "MapUrlToZone failed: %08x\n", hres);
949  todo_wine_if (test->todo)
950  ok(zone == test->zone || broken(test->broken_zone == zone),
951  "Expected %d, but got %d on test %d\n", test->zone, zone, i);
952 
953  heap_free(urlW);
954  }
955 
956  IInternetSecurityManager_Release(secmgr);
957 }
LONG WINAPI RegOpenKeyA(HKEY hKey, LPCSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:3257
#define ERROR_SUCCESS
Definition: deptool.c:10
GLdouble n
Definition: glext.h:7729
#define test
Definition: rosglue.h:37
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 URLZONE_CUSTOM
Definition: sec_mgr.c:43
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
smooth NULL
Definition: ftsmooth.c:416
static const zone_mapping_test zone_mapping_tests[]
Definition: sec_mgr.c:886
#define todo_wine_if(is_todo)
Definition: test.h:155
HRESULT hres
Definition: protocol.c:465
#define trace
Definition: atltest.h:70
#define d
Definition: ke_i.h:81
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
unsigned long DWORD
Definition: ntddk_ex.h:95
static LPWSTR a2w(LPCSTR str)
Definition: sec_mgr.c:183
#define broken(x)
Definition: _sntprintf.h:21
DWORD zone
Definition: sec_mgr.c:1760
#define S_OK
Definition: intsafe.h:59
#define ARRAY_SIZE(a)
Definition: main.h:24
#define ok(value,...)
Definition: atltest.h:57
GLuint res
Definition: glext.h:9613
WCHAR * LPWSTR
Definition: xmlstorage.h:184
BOOLEAN Expected
static const char * szZoneMapDomainsKey
Definition: sec_mgr.c:124
static BOOL heap_free(void *mem)
Definition: appwiz.h:75
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12

Referenced by START_TEST().

◆ test_zone_domains()

static void test_zone_domains ( void  )
static

Definition at line 959 of file sec_mgr.c.

960 {
961  if(is_ie_hardened()) {
962  skip("IE running in Enhanced Security Configuration\n");
963  return;
964  } else if(!pCreateUri) {
965  win_skip("Skipping zone domain tests, IE too old\n");
966  return;
967  }
968 
969  trace("testing zone domains...\n");
970 
972 
973  if (!register_zone_domains()) return;
976 }
static BOOL is_ie_hardened(void)
Definition: sec_mgr.c:481
static void run_child_process(void)
Definition: sec_mgr.c:858
static void unregister_zone_domains(void)
Definition: sec_mgr.c:821
static void test_zone_domain_cache(void)
Definition: sec_mgr.c:689
static BOOL register_zone_domains(void)
Definition: sec_mgr.c:760
#define trace
Definition: atltest.h:70
#define skip(...)
Definition: atltest.h:64
#define win_skip
Definition: test.h:141

Referenced by START_TEST().

◆ unregister_protocols()

static void unregister_protocols ( void  )
static

Definition at line 1578 of file sec_mgr.c.

1578  {
1579  IInternetSession *session;
1580  HRESULT hr;
1581 
1582  hr = pCoInternetGetSession(0, &session, 0);
1583  ok(hr == S_OK, "CoInternetGetSession failed: 0x%08x\n", hr);
1584  if(FAILED(hr))
1585  return;
1586 
1587  hr = IInternetSession_UnregisterNameSpace(session, &protocol_cf, winetestW);
1588  ok(hr == S_OK, "UnregisterNameSpace failed: 0x%08x\n", hr);
1589 
1590  IInternetSession_Release(session);
1591 }
HRESULT hr
Definition: shlfolder.c:183
LONG HRESULT
Definition: typedefs.h:77
static const WCHAR winetestW[]
Definition: sec_mgr.c:118
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
static IClassFactory protocol_cf
Definition: sec_mgr.c:1559

Referenced by START_TEST().

◆ unregister_zone_domains()

static void unregister_zone_domains ( void  )
static

Definition at line 821 of file sec_mgr.c.

822 {
823  HKEY domains;
824  DWORD res, i;
825 
827  ok(res == ERROR_SUCCESS || broken(res == ERROR_FILE_NOT_FOUND), "RegOpenKey failed: %d\n", res);
828  if(res == ERROR_SUCCESS) {
829  RegDeleteKeyA(domains, "local.machine");
830  RegCloseKey(domains);
831  }
832 
834  ok(res == ERROR_SUCCESS, "RegOpenKey failed: %d\n", res);
835 
836  for(i = 0; i < ARRAY_SIZE(zone_domain_mappings); ++i) {
838 
839  /* FIXME: Uses the "cludge" approach to remove the test data from the registry!
840  * Although, if domain names are... unique, this shouldn't cause any harm
841  * to keys (if any) that existed before the tests.
842  */
843  if(test->subdomain) {
844  HKEY domain;
845 
846  res = RegOpenKeyA(domains, test->domain, &domain);
847  if(res == ERROR_SUCCESS) {
848  RegDeleteKeyA(domain, test->subdomain);
849  RegCloseKey(domain);
850  }
851  }
852  RegDeleteKeyA(domains, test->domain);
853  }
854 
855  RegCloseKey(domains);
856 }
LONG WINAPI RegOpenKeyA(HKEY hKey, LPCSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:3257
#define ERROR_SUCCESS
Definition: deptool.c:10
#define HKEY_CURRENT_USER
Definition: winreg.h:11
#define test
Definition: rosglue.h:37
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
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
static const zone_domain_mapping zone_domain_mappings[]
Definition: sec_mgr.c:741
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
unsigned long DWORD
Definition: ntddk_ex.h:95
#define broken(x)
Definition: _sntprintf.h:21
LONG WINAPI RegDeleteKeyA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey)
Definition: reg.c:1222
#define ARRAY_SIZE(a)
Definition: main.h:24
#define ok(value,...)
Definition: atltest.h:57
GLuint res
Definition: glext.h:9613
static const char * szZoneMapDomainsKey
Definition: sec_mgr.c:124
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12

Referenced by test_zone_domains().

Variable Documentation

◆ called_securl_http

int called_securl_http
static

Definition at line 150 of file sec_mgr.c.

Referenced by InternetProtocolInfo_ParseUrl(), and test_url_action().

◆ ClassFactoryVtbl

const IClassFactoryVtbl ClassFactoryVtbl
static
Initial value:
= {
}
static HRESULT WINAPI ClassFactory_QueryInterface(IClassFactory *iface, REFIID riid, void **ppv)
Definition: sec_mgr.c:1517
static HRESULT WINAPI ClassFactory_CreateInstance(IClassFactory *iface, IUnknown *pOuter, REFIID riid, void **ppv)
Definition: sec_mgr.c:1538
static ULONG WINAPI ClassFactory_AddRef(IClassFactory *iface)
Definition: sec_mgr.c:1528
static ULONG WINAPI ClassFactory_Release(IClassFactory *iface)
Definition: sec_mgr.c:1533
static HRESULT WINAPI ClassFactory_LockServer(IClassFactory *iface, BOOL dolock)
Definition: sec_mgr.c:1545

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

Referenced by test_activex().

◆ create_flags

◆ default_hres

HRESULT default_hres

Definition at line 1599 of file sec_mgr.c.

Referenced by test_InternetGetSecurityUrlEx().

◆ default_uri

const char* default_uri

Definition at line 1598 of file sec_mgr.c.

Referenced by test_InternetGetSecurityUrlEx().

◆ DWORD

◆ DWORD_PTR

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

Referenced by test_activex().

◆ InternetProtocolInfoVtbl

const IInternetProtocolInfoVtbl InternetProtocolInfoVtbl
static
Initial value:
= {
}
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:1482
static ULONG WINAPI InternetProtocolInfo_Release(IInternetProtocolInfo *iface)
Definition: sec_mgr.c:1412
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:1497
static ULONG WINAPI InternetProtocolInfo_AddRef(IInternetProtocolInfo *iface)
Definition: sec_mgr.c:1407
static HRESULT WINAPI InternetProtocolInfo_QueryInterface(IInternetProtocolInfo *iface, REFIID riid, void **ppv)
Definition: sec_mgr.c:1400
static HRESULT WINAPI InternetProtocolInfo_CompareUrl(IInternetProtocolInfo *iface, LPCWSTR pwzUrl1, LPCWSTR pwzUrl2, DWORD dwCompareFlags)
Definition: sec_mgr.c:1490
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:1417

Definition at line 1505 of file sec_mgr.c.

◆ LPCWSTR

Definition at line 90 of file sec_mgr.c.

◆ map_hres

HRESULT map_hres

Definition at line 1759 of file sec_mgr.c.

Referenced by exec_script(), and test_SecurityManagerEx2().

◆ map_todo

BOOL map_todo

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

Referenced by register_protocols(), and unregister_protocols().

◆ protocol_info

IInternetProtocolInfo protocol_info = { &InternetProtocolInfoVtbl }
static

Definition at line 1515 of file sec_mgr.c.

Referenced by ClassFactory_QueryInterface(), and parse_security_url().

◆ PSUACTION

IUri PSUACTION

Definition at line 85 of file sec_mgr.c.

◆ sec_mgr_ex2_tests

const { ... } 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 secid6[]
Definition: sec_mgr.c:131
static const BYTE secid1[]
Definition: sec_mgr.c:127
static const BYTE secid2[]
Definition: sec_mgr.c:128
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
static const BYTE secidex2_3[]
Definition: sec_mgr.c:1754
static const BYTE secidex2_2[]
Definition: sec_mgr.c:1753
static const BYTE secid7[]
Definition: sec_mgr.c:132
#define S_OK
Definition: intsafe.h:59
static const BYTE secidex2_1[]
Definition: sec_mgr.c:1752
static const BYTE secid5[]
Definition: sec_mgr.c:129

Referenced by test_SecurityManagerEx2().

◆ sec_url_ex_tests

const { ... } 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}
}
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
#define S_OK
Definition: intsafe.h:59

Referenced by test_InternetGetSecurityUrlEx().

◆ secid

◆ secid1

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

Definition at line 127 of file sec_mgr.c.

Referenced by CompareSecurityIds().

◆ secid10

const BYTE secid10[]
static
Initial value:
=
{'f','i','l','e',