ReactOS  0.4.14-dev-41-g31d7680
misc.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 misc.c:

Go to the source code of this file.

Classes

struct  parse_test
 
struct  RefUnk
 

Macros

#define COBJMACROS
 
#define CONST_VTABLE
 
#define NONAMELESSUNION
 
#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)
 

Functions

 DEFINE_GUID (CLSID_AboutProtocol, 0x3050F406, 0x98B5, 0x11CF, 0xBB, 0x82, 0x00, 0xAA, 0x00, 0xBD, 0xCE, 0x0B)
 
 DEFINE_EXPECT (ParseUrl)
 
 DEFINE_EXPECT (QI_IInternetProtocolInfo)
 
 DEFINE_EXPECT (CreateInstance)
 
 DEFINE_EXPECT (unk_Release)
 
static HRESULT (WINAPI *pCoInternetCompareUrl)(LPCWSTR
 
static int strcmp_wa (const WCHAR *strw, const char *stra)
 
static WCHARa2w (const char *str)
 
static WCHARa2co (const char *str)
 
static void test_CreateFormatEnum (void)
 
static void test_RegisterFormatEnumerator (void)
 
static void test_CoInternetParseUrl (void)
 
static void test_CoInternetCompareUrl (void)
 
static void test_CoInternetQueryInfo (void)
 
static void test_FindMimeFromData (void)
 
static void register_protocols (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 ProtocolCF_CreateInstance (IClassFactory *iface, IUnknown *pOuter, REFIID riid, void **ppv)
 
static HRESULT WINAPI ClassFactory_LockServer (IClassFactory *iface, BOOL dolock)
 
static void test_NameSpace (void)
 
static void test_MimeFilter (void)
 
static ULONG WINAPI unk_Release (IUnknown *iface)
 
static void test_ReleaseBindInfo (void)
 
static void test_CopyStgMedium (void)
 
static void test_CopyBindInfo (void)
 
static void test_UrlMkGetSessionOption (void)
 
static void test_user_agent (void)
 
static void test_MkParseDisplayNameEx (void)
 
static void test_IsValidURL (void)
 
static void test_internet_feature_defaults (void)
 
static void test_internet_features_registry (void)
 
static void test_CoInternetIsFeatureEnabled (void)
 
static void test_CoInternetSetFeatureEnabled (void)
 
static void test_internet_features (void)
 
static HRESULT WINAPI BindStatusCallback_QueryInterface (IBindStatusCallbackEx *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI BindStatusCallback_AddRef (IBindStatusCallbackEx *iface)
 
static ULONG WINAPI BindStatusCallback_Release (IBindStatusCallbackEx *iface)
 
static HRESULT WINAPI BindStatusCallback_OnStartBinding (IBindStatusCallbackEx *iface, DWORD dwReserved, IBinding *pib)
 
static HRESULT WINAPI BindStatusCallback_GetPriority (IBindStatusCallbackEx *iface, LONG *pnPriority)
 
static HRESULT WINAPI BindStatusCallback_OnLowResource (IBindStatusCallbackEx *iface, DWORD reserved)
 
static HRESULT WINAPI BindStatusCallback_OnProgress (IBindStatusCallbackEx *iface, ULONG ulProgress, ULONG ulProgressMax, ULONG ulStatusCode, LPCWSTR szStatusText)
 
static HRESULT WINAPI BindStatusCallback_OnStopBinding (IBindStatusCallbackEx *iface, HRESULT hresult, LPCWSTR szError)
 
static HRESULT WINAPI BindStatusCallback_GetBindInfo (IBindStatusCallbackEx *iface, DWORD *grfBINDF, BINDINFO *pbindinfo)
 
static HRESULT WINAPI BindStatusCallback_OnDataAvailable (IBindStatusCallbackEx *iface, DWORD grfBSCF, DWORD dwSize, FORMATETC *pformatetc, STGMEDIUM *pstgmed)
 
static HRESULT WINAPI BindStatusCallback_OnObjectAvailable (IBindStatusCallbackEx *iface, REFIID riid, IUnknown *punk)
 
static HRESULT WINAPI BindStatusCallbackEx_GetBindInfoEx (IBindStatusCallbackEx *iface, DWORD *grfBINDF, BINDINFO *pbindinfo, DWORD *grfBINDF2, DWORD *pdwReserved)
 
static RefUnkimpl_from_IUnknown (IUnknown *iface)
 
static HRESULT WINAPI RefUnk_QueryInterface (IUnknown *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI RefUnk_AddRef (IUnknown *iface)
 
static ULONG WINAPI RefUnk_Release (IUnknown *iface)
 
static DWORD WINAPI bsc_thread (void *arg)
 
static void test_bsc_marshaling (void)
 
 START_TEST (misc)
 

Variables

static LPCWSTR
 
static DWORD
 
static LPWSTR PSUACTION
 
static PARSEACTION
 
static LPWSTR
 
static QUERYOPTION
 
static LPVOID
 
static LPSTR
 
static BOOL
 
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 url4e []
 
static const WCHAR path3 [] = {'c',':','\\','I','n','d','e','x','.','h','t','m',0}
 
static const WCHAR path4 [] = {'s','o','m','e',' ','f','i','l','e','.','j','p','g',0}
 
static const WCHAR wszRes [] = {'r','e','s',0}
 
static const WCHAR wszFile [] = {'f','i','l','e',0}
 
static const WCHAR wszHttp [] = {'h','t','t','p',0}
 
static const WCHAR wszAbout [] = {'a','b','o','u','t',0}
 
static const WCHAR wszEmpty [] = {0}
 
static const WCHAR wszGoogle [] = {'g','o','o','g','l','e','.','*','.','c','o','m',0}
 
static const WCHAR wszWineHQ [] = {'w','w','w','.','w','i','n','e','h','q','.','o','r','g',0}
 
static const WCHAR wszHttpWineHQ []
 
static const WCHAR wszHttpGoogle []
 
static const struct parse_test parse_tests []
 
struct {
   LPCWSTR   url
 
   DWORD   uses_net
 
query_info_tests []
 
struct {
   const char *   url
 
   const char *   mime
 
   HRESULT   hres
 
   BOOL   broken_failure
 
   const char *   broken_mime
 
mime_tests []
 
static BYTE data1 [] = "test data\n"
 
static BYTE data2 [] = {31,'t','e','s',0xfa,'t',' ','d','a','t','a','\n',0}
 
static BYTE data3 [] = {0,0,0}
 
static BYTE data4 [] = {'t','e','s',0xfa,'t',' ','d','a','t','a','\n',0,0}
 
static BYTE data5 [] = {0xa,0xa,0xa,'x',32,'x',0}
 
static BYTE data6 [] = {0xfa,0xfa,0xfa,0xfa,'\n','\r','\t','x','x','x',1}
 
static BYTE data7 [] = "<html>blahblah"
 
static BYTE data8 [] = {'t','e','s',0xfa,'t',' ','<','h','t','m','l','>','d','a','t','a','\n',0,0}
 
static BYTE data9 [] = {'t','e',0,'s',0xfa,'t',' ','<','h','t','m','l','>','d','a','t','a','\n',0,0}
 
static BYTE data10 [] = "<HtmL>blahblah"
 
static BYTE data11 [] = "blah<HTML>blahblah"
 
static BYTE data12 [] = "blah<HTMLblahblah"
 
static BYTE data13 [] = "blahHTML>blahblah"
 
static BYTE data14 [] = "blah<HTMblahblah"
 
static BYTE data15 [] = {0xff,0xd8}
 
static BYTE data16 [] = {0xff,0xd8,'h'}
 
static BYTE data17 [] = {0,0xff,0xd8}
 
static BYTE data18 [] = {0xff,0xd8,'<','h','t','m','l','>'}
 
static BYTE data19 [] = {'G','I','F','8','7','a'}
 
static BYTE data20 [] = {'G','I','F','8','9','a'}
 
static BYTE data21 [] = {'G','I','F','8','7'}
 
static BYTE data22 [] = {'G','i','F','8','7','a'}
 
static BYTE data23 [] = {'G','i','F','8','8','a'}
 
static BYTE data24 [] = {'g','i','f','8','7','a'}
 
static BYTE data25 [] = {'G','i','F','8','7','A'}
 
static BYTE data26 [] = {'G','i','F','8','7','a','<','h','t','m','l','>'}
 
static BYTE data27 [] = {0x30,'G','i','F','8','7','A'}
 
static BYTE data28 [] = {0x42,0x4d,0x6e,0x42,0x1c,0x00,0x00,0x00,0x00,0x00,0x36,0x00,0x00,0x00}
 
static BYTE data29 [] = {0x42,0x4d,'x','x','x','x',0x00,0x00,0x00,0x00,'x','x','x','x'}
 
static BYTE data30 [] = {0x42,0x4d,'x','x','x','x',0x00,0x01,0x00,0x00,'x','x','x','x'}
 
static BYTE data31 [] = {0x42,0x4d,'x','x','x','x',0x00,0x00,0x00,0x00,'<','h','t','m','l','>'}
 
static BYTE data32 [] = {0x42,0x4d,'x','x','x','x',0x00,0x00,0x00,0x00,'x','x','x'}
 
static BYTE data33 [] = {0x00,0x42,0x4d,'x','x','x','x',0x00,0x00,0x00,0x00,'x','x','x'}
 
static BYTE data34 [] = {0x89,'P','N','G',0x0d,0x0a,0x1a,0x0a,'x'}
 
static BYTE data35 [] = {0x89,'P','N','G',0x0d,0x0a,0x1a,0x0a,'x','x','x','x',0}
 
static BYTE data36 [] = {0x89,'P','N','G',0x0d,0x0a,0x1a,'x','x'}
 
static BYTE data37 [] = {0x89,'P','N','G',0x0d,0x0a,0x1a,0x0a,'<','h','t','m','l','>'}
 
static BYTE data38 [] = {0x00,0x89,'P','N','G',0x0d,0x0a,0x1a,0x0a,'x'}
 
static BYTE data39 [] = {0x4d,0x4d,0x00,0x2a,0xff}
 
static BYTE data40 [] = {0x4d,0x4d,0x00,0x2a,'<','h','t','m','l','>',0}
 
static BYTE data41 [] = {0x4d,0x4d,0xff}
 
static BYTE data42 [] = {0x4d,0x4d}
 
static BYTE data43 [] = {0x00,0x4d,0x4d,0x00}
 
static BYTE data44 [] = {'R','I','F','F',0xff,0xff,0xff,0xff,'A','V','I',0x20,0xff}
 
static BYTE data45 [] = {'R','I','F','f',0xff,0xff,0xff,0xff,'A','V','I',0x20,0xff}
 
static BYTE data46 [] = {'R','I','F','F',0xff,0xff,0xff,0xff,'A','V','I',0x20}
 
static BYTE data47 [] = {'R','I','F','F',0xff,0xff,0xff,0xff,'A','V','I',0x21,0xff}
 
static BYTE data48 [] = {'R','I','F','F',0xff,0xff,0xff,0xff,'A','V','I',0x20,'<','h','t','m','l','>'}
 
static BYTE data49 [] = {'R','I','F','F',0x0f,0x0f,0xf0,0xf0,'A','V','I',0x20,0xf0,0x00}
 
static BYTE data50 [] = {0x00,0x00,0x01,0xb3,0xff}
 
static BYTE data51 [] = {0x00,0x00,0x01,0xba,0xff}
 
static BYTE data52 [] = {0x00,0x00,0x01,0xb8,0xff}
 
static BYTE data53 [] = {0x00,0x00,0x01,0xba}
 
static BYTE data54 [] = {0x00,0x00,0x01,0xba,'<','h','t','m','l','>'}
 
static BYTE data55 [] = {0x1f,0x8b,'x'}
 
static BYTE data56 [] = {0x1f}
 
static BYTE data57 [] = {0x1f,0x8b,'<','h','t','m','l','>','t','e','s','t',0}
 
static BYTE data58 [] = {0x1f,0x8b}
 
static BYTE data59 [] = {0x50,0x4b,'x'}
 
static BYTE data60 [] = {0x50,0x4b}
 
static BYTE data61 [] = {0x50,0x4b,'<','h','t','m','l','>',0}
 
static BYTE data62 [] = {0xca,0xfe,0xba,0xbe,'x'}
 
static BYTE data63 [] = {0xca,0xfe,0xba,0xbe}
 
static BYTE data64 [] = {0xca,0xfe,0xba,0xbe,'<','h','t','m','l','>',0}
 
static BYTE data65 [] = {0x25,0x50,0x44,0x46,'x'}
 
static BYTE data66 [] = {0x25,0x50,0x44,0x46}
 
static BYTE data67 [] = {0x25,0x50,0x44,0x46,'x','<','h','t','m','l','>'}
 
static BYTE data68 [] = {'M','Z','x'}
 
static BYTE data69 [] = {'M','Z'}
 
static BYTE data70 [] = {'M','Z','<','h','t','m','l','>',0xff}
 
static BYTE data71 [] = {'{','\\','r','t','f',0}
 
static BYTE data72 [] = {'{','\\','r','t','f'}
 
static BYTE data73 [] = {' ','{','\\','r','t','f',' '}
 
static BYTE data74 [] = {'{','\\','r','t','f','<','h','t','m','l','>',' '}
 
static BYTE data75 [] = {'R','I','F','F',0xff,0xff,0xff,0xff,'W','A','V','E',0xff}
 
static BYTE data76 [] = {'R','I','F','F',0xff,0xff,0xff,0xff,'W','A','V','E'}
 
static BYTE data77 [] = {'R','I','F','F',0xff,0xff,0xff,0xff,'W','A','V',0xff,0xff}
 
static BYTE data78 [] = {'R','I','F','F',0xff,0xff,0xff,0xff,'<','h','t','m','l','>',0xff}
 
static BYTE data79 [] = {'%','!',0xff}
 
static BYTE data80 [] = {'%','!'}
 
static BYTE data81 [] = {'%','!','P','S','<','h','t','m','l','>'}
 
static BYTE data82 [] = {'.','s','n','d',0}
 
static BYTE data83 [] = {'.','s','n','d'}
 
static BYTE data84 [] = {'.','s','n','d',0,'<','h','t','m','l','>',1,1}
 
static BYTE data85 [] = {'.','S','N','D',0}
 
static BYTE data86 [] = {0x49,0x49,0x2a,0xff}
 
static BYTE data87 [] = {' ','<','h','e','a','d'}
 
static BYTE data88 [] = {' ','<','h','e','a','d','>'}
 
static BYTE data89 [] = {'\t','\r','<','h','e','a','d','>'}
 
static BYTE data90 [] = {'<','H','e','A','d',' '}
 
static BYTE data91 [] = {'<','?','x','m','l',' ',0}
 
static BYTE data92 [] = {'a','b','c','<','?','x','m','l',' ',' '}
 
static BYTE data93 [] = {'<','?','x','m','l',' ',' ','<','h','t','m','l','>'}
 
static BYTE data94 [] = {'<','h','t','m','l','>','<','?','x','m','l',' ',' '}
 
static BYTE data95 [] = {'{','\\','r','t','f','<','?','x','m','l',' ',' '}
 
static BYTE data96 [] = {'<','?','x','m','l',' '}
 
static BYTE data97 [] = "<body"
 
static BYTE data98 [] = "blah<BoDyblahblah"
 
struct {
   BYTE *   data
 
   DWORD   size
 
   const char *   mime
 
   const char *   mime_pjpeg
 
   const char *   broken_mime
 
   const char *   url
 
   const char *   proposed_mime
 
mime_tests2 []
 
static const IInternetProtocolInfoVtbl InternetProtocolInfoVtbl
 
static IInternetProtocolInfo protocol_info = { &InternetProtocolInfoVtbl }
 
static HRESULT qiret
 
static IClassFactoryexpect_cf
 
static const IClassFactoryVtbl ClassFactoryVtbl
 
static const IClassFactoryVtbl ProtocolCFVtbl
 
static IClassFactory test_protocol_cf = { &ProtocolCFVtbl }
 
static IClassFactory test_protocol_cf2 = { &ProtocolCFVtbl }
 
static IClassFactory test_cf = { &ClassFactoryVtbl }
 
static const IUnknownVtbl unk_vtbl
 
struct {
   INTERNETFEATURELIST   feature
 
   DWORD   get_flags
 
   HRESULT   expected
 
   BOOL   todo
 
default_feature_tests []
 
static const charszFeatureControlKey = "Software\\Microsoft\\Internet Explorer\\Main\\FeatureControl"
 
struct {
   INTERNETFEATURELIST   feature
 
   DWORD   set_flags
 
   BOOL   enable
 
   HRESULT   set_expected
 
   BOOL   set_todo
 
   DWORD   get_flags
 
   HRESULT   get_expected
 
   BOOL   get_todo
 
internet_feature_tests []
 
static BINDINFO rem_bindinfo = { sizeof(rem_bindinfo) }
 
static BINDINFO in_bindinfo
 
static DWORD rem_bindf
 
static STGMEDIUM in_stgmed
 
static STGMEDIUM rem_stgmed
 
static const IBindStatusCallbackExVtbl BindStatusCallbackExVtbl
 
static IBindStatusCallbackEx BindStatusCallback = { &BindStatusCallbackExVtbl }
 
static const IUnknownVtbl RefUnkVtbl
 
static RefUnk unk_in = {{&RefUnkVtbl}}
 
static RefUnk unk_out = {{&RefUnkVtbl}}
 
static HANDLE thread_ready
 

Macro Definition Documentation

◆ 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 57 of file misc.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 44 of file misc.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 51 of file misc.c.

◆ COBJMACROS

#define COBJMACROS

Definition at line 19 of file misc.c.

◆ CONST_VTABLE

#define CONST_VTABLE

Definition at line 20 of file misc.c.

◆ DEFINE_EXPECT

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

Definition at line 38 of file misc.c.

◆ NONAMELESSUNION

#define NONAMELESSUNION

Definition at line 21 of file misc.c.

◆ SET_EXPECT

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

Definition at line 41 of file misc.c.

Function Documentation

◆ a2co()

static WCHAR* a2co ( const char str)
static

Definition at line 107 of file misc.c.

108 {
109  WCHAR *ret;
110  int len;
111 
112  if(!str)
113  return NULL;
114 
115  len = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0);
116  ret = CoTaskMemAlloc(len*sizeof(WCHAR));
117  MultiByteToWideChar(CP_ACP, 0, str, -1, ret, len);
118 
119  return ret;
120 }
#define CP_ACP
Definition: compat.h:99
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
__wchar_t WCHAR
Definition: xmlstorage.h:180
int ret
GLenum GLsizei len
Definition: glext.h:6722
#define MultiByteToWideChar
Definition: compat.h:100
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: ifs.c:406

Referenced by test_bsc_marshaling().

◆ a2w()

static WCHAR* a2w ( const char str)
static

Definition at line 92 of file misc.c.

93 {
94  WCHAR *ret;
95  int len;
96 
97  if(!str)
98  return NULL;
99 
100  len = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0);
101  ret = HeapAlloc(GetProcessHeap(), 0, len*sizeof(WCHAR));
102  MultiByteToWideChar(CP_ACP, 0, str, -1, ret, len);
103 
104  return ret;
105 }
#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
int ret
GLenum GLsizei len
Definition: glext.h:6722
#define MultiByteToWideChar
Definition: compat.h:100

Referenced by test_FindMimeFromData().

◆ BindStatusCallback_AddRef()

static ULONG WINAPI BindStatusCallback_AddRef ( IBindStatusCallbackEx iface)
static

Definition at line 1946 of file misc.c.

1947 {
1948  return 2;
1949 }

◆ BindStatusCallback_GetBindInfo()

static HRESULT WINAPI BindStatusCallback_GetBindInfo ( IBindStatusCallbackEx iface,
DWORD grfBINDF,
BINDINFO *  pbindinfo 
)
static

Definition at line 1988 of file misc.c.

1989 {
1990  in_bindinfo = *pbindinfo;
1991  *grfBINDF = rem_bindf;
1992  *pbindinfo = rem_bindinfo;
1993  return S_OK;
1994 }
static BINDINFO in_bindinfo
Definition: misc.c:1930
static DWORD rem_bindf
Definition: misc.c:1931
static BINDINFO rem_bindinfo
Definition: misc.c:1930
#define S_OK
Definition: intsafe.h:59

◆ BindStatusCallback_GetPriority()

static HRESULT WINAPI BindStatusCallback_GetPriority ( IBindStatusCallbackEx iface,
LONG pnPriority 
)
static

Definition at line 1963 of file misc.c.

1964 {
1965  ok(0, "unexpected call\n");
1966  return E_NOTIMPL;
1967 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ BindStatusCallback_OnDataAvailable()

static HRESULT WINAPI BindStatusCallback_OnDataAvailable ( IBindStatusCallbackEx iface,
DWORD  grfBSCF,
DWORD  dwSize,
FORMATETC *  pformatetc,
STGMEDIUM *  pstgmed 
)
static

Definition at line 1998 of file misc.c.

2000 {
2001  in_stgmed = *pstgmed;
2002  *pstgmed = rem_stgmed;
2003  return S_OK;
2004 }
static STGMEDIUM in_stgmed
Definition: misc.c:1996
#define S_OK
Definition: intsafe.h:59
static STGMEDIUM rem_stgmed
Definition: misc.c:1996

◆ BindStatusCallback_OnLowResource()

static HRESULT WINAPI BindStatusCallback_OnLowResource ( IBindStatusCallbackEx iface,
DWORD  reserved 
)
static

Definition at line 1969 of file misc.c.

1970 {
1971  ok(0, "unexpected call\n");
1972  return E_NOTIMPL;
1973 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ BindStatusCallback_OnObjectAvailable()

static HRESULT WINAPI BindStatusCallback_OnObjectAvailable ( IBindStatusCallbackEx iface,
REFIID  riid,
IUnknown punk 
)
static

Definition at line 2006 of file misc.c.

2007 {
2008  ok(0, "unexpected call\n");
2009  return S_OK;
2010 }
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57

◆ BindStatusCallback_OnProgress()

static HRESULT WINAPI BindStatusCallback_OnProgress ( IBindStatusCallbackEx iface,
ULONG  ulProgress,
ULONG  ulProgressMax,
ULONG  ulStatusCode,
LPCWSTR  szStatusText 
)
static

Definition at line 1975 of file misc.c.

1977 {
1978  ok(0, "unexpected call\n");
1979  return S_OK;
1980 }
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57

◆ BindStatusCallback_OnStartBinding()

static HRESULT WINAPI BindStatusCallback_OnStartBinding ( IBindStatusCallbackEx iface,
DWORD  dwReserved,
IBinding pib 
)
static

Definition at line 1956 of file misc.c.

1958 {
1959  ok(0, "unexpected call\n");
1960  return S_OK;
1961 }
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57

◆ BindStatusCallback_OnStopBinding()

static HRESULT WINAPI BindStatusCallback_OnStopBinding ( IBindStatusCallbackEx iface,
HRESULT  hresult,
LPCWSTR  szError 
)
static

Definition at line 1982 of file misc.c.

1983 {
1984  ok(0, "unexpected call\n");
1985  return S_OK;
1986 }
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57

◆ BindStatusCallback_QueryInterface()

static HRESULT WINAPI BindStatusCallback_QueryInterface ( IBindStatusCallbackEx iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 1933 of file misc.c.

1934 {
1935  if(IsEqualGUID(&IID_IBindStatusCallbackEx, riid)
1936  || IsEqualGUID(&IID_IBindStatusCallback, riid)
1937  || IsEqualGUID(&IID_IUnknown, riid)) {
1938  *ppv = iface;
1939  return S_OK;
1940  }
1941 
1942  *ppv = NULL;
1943  return E_NOINTERFACE;
1944 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
smooth NULL
Definition: ftsmooth.c:416
const GUID IID_IUnknown
#define S_OK
Definition: intsafe.h:59
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021

◆ BindStatusCallback_Release()

static ULONG WINAPI BindStatusCallback_Release ( IBindStatusCallbackEx iface)
static

Definition at line 1951 of file misc.c.

1952 {
1953  return 1;
1954 }

◆ BindStatusCallbackEx_GetBindInfoEx()

static HRESULT WINAPI BindStatusCallbackEx_GetBindInfoEx ( IBindStatusCallbackEx iface,
DWORD grfBINDF,
BINDINFO *  pbindinfo,
DWORD grfBINDF2,
DWORD pdwReserved 
)
static

Definition at line 2012 of file misc.c.

2014 {
2015  in_bindinfo = *pbindinfo;
2016  *grfBINDF = rem_bindf;
2017  *pbindinfo = rem_bindinfo;
2018  *grfBINDF2 = 11;
2019  *pdwReserved = 12;
2020  return S_OK;
2021 }
static BINDINFO in_bindinfo
Definition: misc.c:1930
static DWORD rem_bindf
Definition: misc.c:1931
static BINDINFO rem_bindinfo
Definition: misc.c:1930
_Reserved_ DWORD * pdwReserved
Definition: wincrypt.h:4254
#define S_OK
Definition: intsafe.h:59

◆ bsc_thread()

static DWORD WINAPI bsc_thread ( void arg)
static

Definition at line 2084 of file misc.c.

2085 {
2086  IStream *stream = arg;
2088  MSG msg;
2089  HRESULT hres;
2090 
2091  CoInitialize(NULL);
2092 
2093  hres = CoMarshalInterface(stream, &IID_IBindStatusCallback, (IUnknown*)&BindStatusCallback,
2094  MSHCTX_INPROC, NULL, MSHLFLAGS_NORMAL);
2095  ok(hres == S_OK, "CoMarshalInterface failed: %08x\n", hres);
2096 
2097  zero.QuadPart = 0;
2098  hres = IStream_Seek(stream, zero, STREAM_SEEK_SET, NULL);
2099  ok(hres == S_OK, "Seek failed: 0x%08x\n", hres);
2100 
2102 
2103  while(GetMessageW(&msg, NULL, 0, 0)) {
2106  }
2107 
2108  CoUninitialize();
2109  return 0;
2110 }
BOOL WINAPI TranslateMessage(_In_ const MSG *)
static HANDLE thread_ready
Definition: misc.c:2082
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
Definition: synch.c:733
void * arg
Definition: msvc.h:12
LRESULT WINAPI DispatchMessageW(_In_ const MSG *)
smooth NULL
Definition: ftsmooth.c:416
LONG HRESULT
Definition: typedefs.h:77
HRESULT hres
Definition: misc.c:479
static double zero
Definition: j0_y0.c:96
Definition: parse.h:22
#define S_OK
Definition: intsafe.h:59
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
Definition: compobj.c:1991
#define ok(value,...)
Definition: atltest.h:57
BOOL WINAPI GetMessageW(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT)
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
Definition: compobj.c:1897
#define msg(x)
Definition: auth_time.c:54
HRESULT WINAPI CoMarshalInterface(IStream *pStream, REFIID riid, IUnknown *pUnk, DWORD dwDestContext, void *pvDestContext, DWORD mshlFlags)
Definition: marshal.c:1877

Referenced by test_bsc_marshaling().

◆ ClassFactory_AddRef()

static ULONG WINAPI ClassFactory_AddRef ( IClassFactory iface)
static

Definition at line 945 of file misc.c.

946 {
947  return 2;
948 }

◆ ClassFactory_CreateInstance()

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

Definition at line 955 of file misc.c.

957 {
958  ok(0, "unexpected call\n");
959  return E_NOTIMPL;
960 }
#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 976 of file misc.c.

977 {
978  ok(0, "unexpected call\n");
979  return S_OK;
980 }
#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 932 of file misc.c.

933 {
934  if(IsEqualGUID(&IID_IInternetProtocolInfo, riid)) {
935  CHECK_EXPECT2(QI_IInternetProtocolInfo);
936  ok(iface == expect_cf, "unexpected iface\n");
937  *ppv = &protocol_info;
938  return qiret;
939  }
940 
941  ok(0, "unexpected call\n");
942  return E_NOINTERFACE;
943 }
#define E_NOINTERFACE
Definition: winerror.h:2364
static IInternetProtocolInfo protocol_info
Definition: misc.c:927
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define CHECK_EXPECT2(func)
Definition: misc.c:51
static HRESULT qiret
Definition: misc.c:929
#define ok(value,...)
Definition: atltest.h:57
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021
static IClassFactory * expect_cf
Definition: misc.c:930

◆ ClassFactory_Release()

static ULONG WINAPI ClassFactory_Release ( IClassFactory iface)
static

Definition at line 950 of file misc.c.

951 {
952  return 1;
953 }

◆ DEFINE_EXPECT() [1/4]

DEFINE_EXPECT ( ParseUrl  )

◆ DEFINE_EXPECT() [2/4]

DEFINE_EXPECT ( QI_IInternetProtocolInfo  )

◆ DEFINE_EXPECT() [3/4]

DEFINE_EXPECT ( CreateInstance  )

◆ DEFINE_EXPECT() [4/4]

DEFINE_EXPECT ( unk_Release  )

◆ DEFINE_GUID()

DEFINE_GUID ( CLSID_AboutProtocol  ,
0x3050F406  ,
0x98B5  ,
0x11CF  ,
0xBB  ,
0x82  ,
0x00  ,
0xAA  ,
0x00  ,
0xBD  ,
0xCE  ,
0x0B   
)

◆ HRESULT()

static HRESULT ( WINAPI pCoInternetCompareUrl)
static

◆ impl_from_IUnknown()

static RefUnk* impl_from_IUnknown ( IUnknown iface)
inlinestatic

Definition at line 2045 of file misc.c.

2046 {
2047  return CONTAINING_RECORD(iface, RefUnk, IUnknown_iface);
2048 }
Definition: misc.c:2040
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560

Referenced by RefUnk_AddRef(), and RefUnk_Release().

◆ InternetProtocolInfo_AddRef()

static ULONG WINAPI InternetProtocolInfo_AddRef ( IInternetProtocolInfo iface)
static

Definition at line 864 of file misc.c.

865 {
866  return 2;
867 }

◆ 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 894 of file misc.c.

897 {
898  ok(0, "unexpected call\n");
899  return E_NOTIMPL;
900 }
#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 902 of file misc.c.

904 {
905  ok(0, "unexpected call\n");
906  return E_NOTIMPL;
907 }
#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 874 of file misc.c.

877 {
878  CHECK_EXPECT2(ParseUrl);
879 
880  if(ParseAction == PARSE_SECURITY_URL) {
881  if(pcchResult)
882  *pcchResult = ARRAY_SIZE(url1);
883 
884  if(cchResult < ARRAY_SIZE(url1))
885  return S_FALSE;
886 
887  memcpy(pwzResult, url1, sizeof(url1));
888  return S_OK;
889  }
890 
891  return E_NOTIMPL;
892 }
#define CHECK_EXPECT2(func)
Definition: misc.c:51
#define S_FALSE
Definition: winerror.h:2357
static const WCHAR url1[]
Definition: misc.c:298
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define S_OK
Definition: intsafe.h:59
#define ARRAY_SIZE(a)
Definition: main.h:24
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ 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 909 of file misc.c.

912 {
913  ok(0, "unexpected call\n");
914  return E_NOTIMPL;
915 }
#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 857 of file misc.c.

859 {
860  ok(0, "unexpected call\n");
861  return E_NOINTERFACE;
862 }
#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 869 of file misc.c.

870 {
871  return 1;
872 }

◆ ProtocolCF_CreateInstance()

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

Definition at line 962 of file misc.c.

964 {
965  CHECK_EXPECT(CreateInstance);
966 
967  ok(iface == expect_cf, "unexpected iface\n");
968  ok(pOuter == NULL, "pOuter = %p\n", pOuter);
969  ok(IsEqualGUID(&IID_IInternetProtocolInfo, riid), "unexpected riid\n");
970  ok(ppv != NULL, "ppv == NULL\n");
971 
972  *ppv = &protocol_info;
973  return S_OK;
974 }
static IInternetProtocolInfo protocol_info
Definition: misc.c:927
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
smooth NULL
Definition: ftsmooth.c:416
#define CHECK_EXPECT(func)
Definition: misc.c:44
#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
static IClassFactory * expect_cf
Definition: misc.c:930

◆ RefUnk_AddRef()

static ULONG WINAPI RefUnk_AddRef ( IUnknown iface)
static

Definition at line 2062 of file misc.c.

2063 {
2064  RefUnk *This = impl_from_IUnknown(iface);
2065  return InterlockedIncrement(&This->ref);
2066 }
Definition: misc.c:2040
static RefUnk * impl_from_IUnknown(IUnknown *iface)
Definition: misc.c:2045
#define InterlockedIncrement
Definition: armddk.h:53

◆ RefUnk_QueryInterface()

static HRESULT WINAPI RefUnk_QueryInterface ( IUnknown iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 2050 of file misc.c.

2051 {
2052  if(!IsEqualGUID(&IID_IUnknown, riid)) {
2053  *ppv = NULL;
2054  return E_NOINTERFACE;
2055  }
2056 
2057  IUnknown_AddRef(iface);
2058  *ppv = iface;
2059  return S_OK;
2060 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
smooth NULL
Definition: ftsmooth.c:416
const GUID IID_IUnknown
#define S_OK
Definition: intsafe.h:59
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021

◆ RefUnk_Release()

static ULONG WINAPI RefUnk_Release ( IUnknown iface)
static

Definition at line 2068 of file misc.c.

2069 {
2070  RefUnk *This = impl_from_IUnknown(iface);
2071  return InterlockedDecrement(&This->ref);
2072 }
Definition: misc.c:2040
#define InterlockedDecrement
Definition: armddk.h:52
static RefUnk * impl_from_IUnknown(IUnknown *iface)
Definition: misc.c:2045

◆ register_protocols()

static void register_protocols ( void  )
static

Definition at line 831 of file misc.c.

832 {
833  IInternetSession *session;
835  HRESULT hres;
836 
837  static const WCHAR wszAbout[] = {'a','b','o','u','t',0};
838 
839  hres = pCoInternetGetSession(0, &session, 0);
840  ok(hres == S_OK, "CoInternetGetSession failed: %08x\n", hres);
841  if(FAILED(hres))
842  return;
843 
844  hres = CoGetClassObject(&CLSID_AboutProtocol, CLSCTX_INPROC_SERVER, NULL,
845  &IID_IClassFactory, (void**)&factory);
846  ok(hres == S_OK, "Could not get AboutProtocol factory: %08x\n", hres);
847  if(FAILED(hres))
848  return;
849 
850  IInternetSession_RegisterNameSpace(session, factory, &CLSID_AboutProtocol,
851  wszAbout, 0, NULL, 0);
852  IClassFactory_Release(factory);
853 
854  IInternetSession_Release(session);
855 }
CLSID CLSID_AboutProtocol
Definition: main.c:440
smooth NULL
Definition: ftsmooth.c:416
HRESULT WINAPI DECLSPEC_HOTPATCH CoGetClassObject(REFCLSID rclsid, DWORD dwClsContext, COSERVERINFO *pServerInfo, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3012
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
HRESULT hres
Definition: misc.c:479
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
static ClassFactoryImpl factory
Definition: ole_server.c:234
const GUID IID_IClassFactory
static const WCHAR wszAbout[]
Definition: misc.c:324

Referenced by START_TEST().

◆ START_TEST()

START_TEST ( misc  )

Definition at line 2637 of file misc.c.

2638 {
2639  HMODULE hurlmon;
2640  int argc;
2641  char **argv;
2642 
2644 
2645  hurlmon = GetModuleHandleA("urlmon.dll");
2646  pCoInternetCompareUrl = (void *) GetProcAddress(hurlmon, "CoInternetCompareUrl");
2647  pCoInternetGetSecurityUrl = (void*) GetProcAddress(hurlmon, "CoInternetGetSecurityUrl");
2648  pCoInternetGetSession = (void*) GetProcAddress(hurlmon, "CoInternetGetSession");
2649  pCoInternetParseUrl = (void*) GetProcAddress(hurlmon, "CoInternetParseUrl");
2650  pCoInternetQueryInfo = (void*) GetProcAddress(hurlmon, "CoInternetQueryInfo");
2651  pCopyStgMedium = (void*) GetProcAddress(hurlmon, "CopyStgMedium");
2652  pCopyBindInfo = (void*) GetProcAddress(hurlmon, "CopyBindInfo");
2653  pFindMimeFromData = (void*) GetProcAddress(hurlmon, "FindMimeFromData");
2654  pObtainUserAgentString = (void*) GetProcAddress(hurlmon, "ObtainUserAgentString");
2655  pReleaseBindInfo = (void*) GetProcAddress(hurlmon, "ReleaseBindInfo");
2656  pUrlMkGetSessionOption = (void*) GetProcAddress(hurlmon, "UrlMkGetSessionOption");
2657  pCompareSecurityIds = (void*) GetProcAddress(hurlmon, "CompareSecurityIds");
2658  pCoInternetIsFeatureEnabled = (void*) GetProcAddress(hurlmon, "CoInternetIsFeatureEnabled");
2659  pCoInternetSetFeatureEnabled = (void*) GetProcAddress(hurlmon, "CoInternetSetFeatureEnabled");
2660  pIEInstallScope = (void*) GetProcAddress(hurlmon, "IEInstallScope");
2661 
2662  if (!pCoInternetCompareUrl || !pCoInternetGetSecurityUrl ||
2663  !pCoInternetGetSession || !pCoInternetParseUrl || !pCompareSecurityIds) {
2664  win_skip("Various needed functions not present, too old IE\n");
2665  return;
2666  }
2667 
2669 
2670  if(argc <= 2 || strcmp(argv[2], "internet_features")) {
2672 
2679  test_NameSpace();
2680  test_MimeFilter();
2685  test_user_agent();
2687  test_IsValidURL();
2689  }
2690 
2692 
2693  OleUninitialize();
2694 }
static void test_FindMimeFromData(void)
Definition: misc.c:714
static int argc
Definition: ServiceArgs.c:12
static void test_CoInternetCompareUrl(void)
Definition: misc.c:420
static void test_MkParseDisplayNameEx(void)
Definition: misc.c:1579
static void test_CoInternetParseUrl(void)
Definition: misc.c:357
#define argv
Definition: mplay32.c:18
static void test_NameSpace(void)
Definition: misc.c:1002
static void register_protocols(void)
Definition: misc.c:831
static void test_user_agent(void)
Definition: misc.c:1449
static void test_CopyStgMedium(void)
Definition: misc.c:1220
smooth NULL
Definition: ftsmooth.c:416
static void test_CopyBindInfo(void)
Definition: misc.c:1298
int winetest_get_mainargs(char ***pargv)
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_MimeFilter(void)
Definition: misc.c:1151
static void test_UrlMkGetSessionOption(void)
Definition: misc.c:1409
static void test_IsValidURL(void)
Definition: misc.c:1669
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
static void test_CreateFormatEnum(void)
Definition: misc.c:122
#define GetProcAddress(x, y)
Definition: compat.h:410
static void test_RegisterFormatEnumerator(void)
Definition: misc.c:225
static void test_internet_features(void)
Definition: misc.c:1890
void WINAPI DECLSPEC_HOTPATCH OleUninitialize(void)
Definition: ole2.c:233
#define win_skip
Definition: test.h:141
static void test_ReleaseBindInfo(void)
Definition: misc.c:1190
static void test_CoInternetQueryInfo(void)
Definition: misc.c:448
static void test_bsc_marshaling(void)
Definition: misc.c:2112

◆ strcmp_wa()

static int strcmp_wa ( const WCHAR strw,
const char stra 
)
static

Definition at line 85 of file misc.c.

86 {
87  WCHAR buf[512];
88  MultiByteToWideChar(CP_ACP, 0, stra, -1, buf, ARRAY_SIZE(buf));
89  return lstrcmpW(strw, buf);
90 }
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define CP_ACP
Definition: compat.h:99
int WINAPI lstrcmpW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:170
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define ARRAY_SIZE(a)
Definition: main.h:24
#define MultiByteToWideChar
Definition: compat.h:100
static const char * strw(LPCWSTR x)
Definition: actctx.c:49

Referenced by test_bsc_marshaling(), and test_FindMimeFromData().

◆ test_bsc_marshaling()

static void test_bsc_marshaling ( void  )
static

Definition at line 2112 of file misc.c.

2113 {
2114  FORMATETC formatetc = {0, NULL, 1, -1, TYMED_ISTREAM};
2115  IBindStatusCallbackEx *callbackex;
2117  BINDINFO bindinfo;
2118  IStream *stream, *binding_stream;
2119  HANDLE thread;
2120  WCHAR *extra_info_out;
2121  WCHAR *verb_out;
2123  STGMEDIUM stgmed;
2124  void *buf;
2125  DWORD bindf;
2126  HRESULT hres;
2127 
2129  ok(hres == S_OK, "CreateStreamOnHGlobal returned: %08x\n", hres);
2130 
2134 
2135  hres = CoUnmarshalInterface(stream, &IID_IBindStatusCallback, (void**)&bsc);
2136  ok(hres == S_OK, "CoUnmarshalInterface failed: %08x\n", hres);
2137 
2138  hres = CreateStreamOnHGlobal(NULL, TRUE, &binding_stream);
2139  ok(hres == S_OK, "CreateStreamOnHGlobal returned: %08x\n", hres);
2140  hres = IStream_Write(binding_stream, "xxx", 3, NULL);
2141  ok(hres == S_OK, "Write failed: %08x\n", hres);
2142 
2143  rem_bindf = BINDF_ASYNCHRONOUS | BINDF_ASYNCSTORAGE | BINDF_PULLDATA;
2144  bindf = 0xdeadbeef;
2145 
2146  memset(&bindinfo, 0, sizeof(bindinfo));
2147  bindinfo.cbSize = sizeof(bindinfo);
2148  bindinfo.grfBindInfoF = 12;
2149  bindinfo.dwBindVerb = 13;
2150  bindinfo.cbstgmedData = 19;
2151  bindinfo.dwOptions = 14;
2152  bindinfo.dwOptionsFlags = 15;
2153  bindinfo.dwCodePage = 16;
2154  bindinfo.securityAttributes.nLength = 30;
2155  bindinfo.securityAttributes.lpSecurityDescriptor = (void*)0xdead0001;
2156  bindinfo.securityAttributes.bInheritHandle = 31;
2157  bindinfo.iid.Data1 = 17;
2158  bindinfo.pUnk = (IUnknown*)0xdeadbeef;
2159  bindinfo.dwReserved = 18;
2160  bindinfo.stgmedData.pUnkForRelease = &unk_in.IUnknown_iface;
2161  unk_in.ref = 1;
2162 
2163  memset(&rem_bindinfo, 0, sizeof(bindinfo));
2164  rem_bindinfo.cbSize = sizeof(rem_bindinfo);
2165  rem_bindinfo.szExtraInfo = extra_info_out = a2co("extra info out");
2166  rem_bindinfo.grfBindInfoF = 22;
2167  rem_bindinfo.dwBindVerb = 23;
2168  rem_bindinfo.szCustomVerb = verb_out = a2co("custom verb out");
2169  rem_bindinfo.cbstgmedData = 29;
2170  rem_bindinfo.dwOptions = 24;
2171  rem_bindinfo.dwOptionsFlags = 25;
2172  rem_bindinfo.dwCodePage = 16;
2173  rem_bindinfo.securityAttributes.nLength = 40;
2174  rem_bindinfo.securityAttributes.lpSecurityDescriptor = (void*)0xdead0002;
2175  rem_bindinfo.securityAttributes.bInheritHandle = 41;
2176  rem_bindinfo.iid.Data1 = 27;
2177  rem_bindinfo.pUnk = (IUnknown*)0xdeadbeef;
2178  rem_bindinfo.dwReserved = 18;
2179  rem_bindinfo.stgmedData.pUnkForRelease = &unk_out.IUnknown_iface;
2180  unk_out.ref = 1;
2181 
2182  hres = IBindStatusCallback_GetBindInfo(bsc, &bindf, &bindinfo);
2183  ok(hres == S_OK, "GetBindInfo failed: %08x\n", hres);
2184  ok(bindf == rem_bindf, "bindf = %x, expected %x\n", bindf, rem_bindf);
2185 
2186  ok(in_bindinfo.cbSize == sizeof(in_bindinfo), "cbSize = %u\n", in_bindinfo.cbSize);
2187  ok(!in_bindinfo.szExtraInfo, "szExtraInfo = %s\n", wine_dbgstr_w(in_bindinfo.szExtraInfo));
2188  ok(in_bindinfo.grfBindInfoF == 12, "cbSize = %u\n", in_bindinfo.grfBindInfoF);
2189  ok(in_bindinfo.dwBindVerb == 13, "dwBindVerb = %u\n", in_bindinfo.dwBindVerb);
2190  ok(!in_bindinfo.szCustomVerb, "szCustomVerb = %s\n", wine_dbgstr_w(in_bindinfo.szCustomVerb));
2191  ok(in_bindinfo.cbstgmedData == 19, "cbstgmedData = %u\n", in_bindinfo.cbstgmedData);
2192  ok(!in_bindinfo.dwOptions, "dwOptions = %u\n", in_bindinfo.dwOptions);
2193  ok(!in_bindinfo.dwOptionsFlags, "dwOptionsFlags = %u\n", in_bindinfo.dwOptionsFlags);
2194  ok(!in_bindinfo.dwCodePage, "dwCodePage = %u\n", in_bindinfo.dwCodePage);
2195  ok(!in_bindinfo.iid.Data1, "iid.Data1 = %u\n", in_bindinfo.iid.Data1);
2196  ok(!in_bindinfo.pUnk, "pUnk = %p\n", in_bindinfo.pUnk);
2197  ok(!in_bindinfo.dwReserved, "dwReserved = %u\n", in_bindinfo.dwReserved);
2198  ok(!in_bindinfo.securityAttributes.nLength, "securityAttributes.nLength = %u\n",
2199  in_bindinfo.securityAttributes.nLength);
2200  ok(!in_bindinfo.securityAttributes.lpSecurityDescriptor,
2201  "securityAttributes.lpSecurityDescriptor = %p\n",
2202  in_bindinfo.securityAttributes.lpSecurityDescriptor);
2203  ok(!in_bindinfo.securityAttributes.bInheritHandle, "securityAttributes.bInheritHandle = %u\n",
2204  in_bindinfo.securityAttributes.bInheritHandle);
2205  ok(!in_bindinfo.stgmedData.pUnkForRelease, "pUnkForRelease = %p\n",
2206  in_bindinfo.stgmedData.pUnkForRelease);
2207 
2208  ok(bindinfo.cbSize == sizeof(rem_bindinfo), "cbSize = %u\n", rem_bindinfo.cbSize);
2209  ok(!strcmp_wa(bindinfo.szExtraInfo, "extra info out"),
2210  "szExtraInfo = %s\n", wine_dbgstr_w(bindinfo.szExtraInfo));
2211  ok(bindinfo.grfBindInfoF == 22, "grfBindInfoF = %u\n", rem_bindinfo.grfBindInfoF);
2212  ok(bindinfo.dwBindVerb == 23, "dwBindVerb = %u\n", bindinfo.dwBindVerb);
2213  ok(bindinfo.szCustomVerb != verb_out, "szCustomVerb == inbuf\n");
2214  ok(!strcmp_wa(bindinfo.szCustomVerb, "custom verb out"), "szCustomVerb = %s\n",
2215  wine_dbgstr_w(bindinfo.szCustomVerb));
2216  ok(bindinfo.cbstgmedData == 29, "cbstgmedData = %u\n", bindinfo.cbstgmedData);
2217  ok(bindinfo.dwOptions == 24, "dwOptions = %u\n", bindinfo.dwOptions);
2218  ok(bindinfo.dwOptionsFlags == 25, "dwOptionsFlags = %u\n", bindinfo.dwOptionsFlags);
2219  ok(bindinfo.dwCodePage, "dwCodePage = %u\n", bindinfo.dwCodePage);
2220  ok(!bindinfo.iid.Data1, "iid.Data1 = %u\n", bindinfo.iid.Data1);
2221  ok(!bindinfo.pUnk, "pUnk = %p\n", bindinfo.pUnk);
2222  ok(bindinfo.dwReserved == 18, "dwReserved = %u\n", bindinfo.dwReserved);
2223  ok(bindinfo.securityAttributes.nLength == 30, "securityAttributes.nLength = %u\n",
2224  bindinfo.securityAttributes.nLength);
2225  ok(bindinfo.securityAttributes.lpSecurityDescriptor == (void*)0xdead0001,
2226  "securityAttributes.lpSecurityDescriptor = %p\n",
2227  bindinfo.securityAttributes.lpSecurityDescriptor);
2228  ok(bindinfo.securityAttributes.bInheritHandle == 31, "securityAttributes.bInheritHandle = %u\n",
2229  bindinfo.securityAttributes.bInheritHandle);
2230  ok(bindinfo.stgmedData.pUnkForRelease == &unk_in.IUnknown_iface, "pUnkForRelease = %p\n",
2231  bindinfo.stgmedData.pUnkForRelease);
2232  ok(unk_out.ref == 1, "unk_out.ref = %u\n", unk_out.ref);
2233 
2234  bindinfo.stgmedData.pUnkForRelease = NULL;
2235  ReleaseBindInfo(&bindinfo);
2236 
2237  zero.QuadPart = 0;
2238  hres = IStream_Seek(binding_stream, zero, STREAM_SEEK_SET, NULL);
2239  ok(hres == S_OK, "Seek failed: 0x%08x\n", hres);
2240 
2241  /* Return IStream stgmed from GetBindInfo, it's not marshaled back */
2242  rem_bindf = BINDF_ASYNCHRONOUS | BINDF_ASYNCSTORAGE | BINDF_PULLDATA;
2243  bindf = 0xdeadbeef;
2244 
2245  memset(&bindinfo, 0, sizeof(bindinfo));
2246  bindinfo.cbSize = sizeof(bindinfo);
2247 
2248  memset(&rem_bindinfo, 0, sizeof(rem_bindinfo));
2249  rem_bindinfo.cbSize = sizeof(rem_bindinfo);
2250 
2251  rem_bindinfo.stgmedData.tymed = TYMED_ISTREAM;
2252  rem_bindinfo.stgmedData.u.pstm = binding_stream;
2253  rem_bindinfo.cbstgmedData = 3;
2254  IStream_AddRef(binding_stream);
2255 
2256  hres = IBindStatusCallback_GetBindInfo(bsc, &bindf, &bindinfo);
2257  ok(hres == S_OK, "GetBindInfo failed: %08x\n", hres);
2258  ok(bindf == rem_bindf, "bindf = %x, expected %x\n", bindf, rem_bindf);
2259 
2260  ok(in_bindinfo.cbSize == sizeof(in_bindinfo), "cbSize = %u\n", in_bindinfo.cbSize);
2261  ok(!in_bindinfo.pUnk, "pUnk = %p\n", in_bindinfo.pUnk);
2262  ok(in_bindinfo.stgmedData.tymed == TYMED_NULL, "tymed = %u\n",
2263  in_bindinfo.stgmedData.tymed);
2264 
2265  ok(bindinfo.cbSize == sizeof(bindinfo), "cbSize = %u\n", bindinfo.cbSize);
2266  ok(!bindinfo.pUnk, "pUnk = %p\n", bindinfo.pUnk);
2267  ok(bindinfo.stgmedData.tymed == TYMED_NULL, "tymed = %u\n",
2268  bindinfo.stgmedData.tymed);
2269  ok(!bindinfo.stgmedData.u.pstm, "stm = %p\n",
2270  bindinfo.stgmedData.u.pstm);
2271  ok(!bindinfo.stgmedData.pUnkForRelease, "pUnkForRelease = %p\n",
2272  bindinfo.stgmedData.pUnkForRelease);
2273  ok(bindinfo.cbstgmedData == 3, "cbstgmedData = %u\n", bindinfo.cbstgmedData);
2274 
2275  ReleaseBindInfo(&bindinfo);
2276 
2277  /* Same, but with pUnkForRelease, it's not marshaled back */
2278  rem_bindf = BINDF_ASYNCHRONOUS | BINDF_ASYNCSTORAGE | BINDF_PULLDATA;
2279  bindf = 0xdeadbeef;
2280 
2281  memset(&bindinfo, 0, sizeof(bindinfo));
2282  bindinfo.cbSize = sizeof(bindinfo);
2283 
2284  memset(&rem_bindinfo, 0, sizeof(rem_bindinfo));
2285  rem_bindinfo.cbSize = sizeof(rem_bindinfo);
2286 
2287  rem_bindinfo.stgmedData.tymed = TYMED_ISTREAM;
2288  rem_bindinfo.stgmedData.u.pstm = binding_stream;
2289  rem_bindinfo.stgmedData.pUnkForRelease = &unk_out.IUnknown_iface;
2290  unk_out.ref = 1;
2291  rem_bindinfo.cbstgmedData = 3;
2292  IStream_AddRef(binding_stream);
2293 
2294  hres = IBindStatusCallback_GetBindInfo(bsc, &bindf, &bindinfo);
2295  ok(hres == S_OK, "GetBindInfo failed: %08x\n", hres);
2296  ok(bindf == rem_bindf, "bindf = %x, expected %x\n", bindf, rem_bindf);
2297 
2298  ok(in_bindinfo.cbSize == sizeof(in_bindinfo), "cbSize = %u\n", in_bindinfo.cbSize);
2299  ok(!in_bindinfo.pUnk, "pUnk = %p\n", in_bindinfo.pUnk);
2300  ok(in_bindinfo.stgmedData.tymed == TYMED_NULL, "tymed = %u\n",
2301  in_bindinfo.stgmedData.tymed);
2302 
2303  ok(bindinfo.cbSize == sizeof(bindinfo), "cbSize = %u\n", bindinfo.cbSize);
2304  ok(!bindinfo.pUnk, "pUnk = %p\n", bindinfo.pUnk);
2305  ok(bindinfo.stgmedData.tymed == TYMED_NULL, "tymed = %u\n",
2306  bindinfo.stgmedData.tymed);
2307  ok(!bindinfo.stgmedData.u.pstm, "stm = %p\n",
2308  bindinfo.stgmedData.u.pstm);
2309  ok(!bindinfo.stgmedData.pUnkForRelease, "pUnkForRelease = %p\n",
2310  bindinfo.stgmedData.pUnkForRelease);
2311  ok(bindinfo.cbstgmedData == 3, "cbstgmedData = %u\n", bindinfo.cbstgmedData);
2312 
2313  ReleaseBindInfo(&bindinfo);
2314 
2315  /* Return HGLOBAL stgmed from GetBindInfo, it's not marshaled back */
2316  rem_bindf = BINDF_ASYNCHRONOUS | BINDF_ASYNCSTORAGE | BINDF_PULLDATA;
2317  bindf = 0xdeadbeef;
2318 
2319  memset(&bindinfo, 0, sizeof(bindinfo));
2320  bindinfo.cbSize = sizeof(bindinfo);
2321 
2322  memset(&rem_bindinfo, 0, sizeof(rem_bindinfo));
2323  rem_bindinfo.cbSize = sizeof(rem_bindinfo);
2324 
2325  rem_bindinfo.stgmedData.tymed = TYMED_HGLOBAL;
2326 
2327  buf = GlobalAlloc(0, 5);
2328  strcpy(buf, "test");
2329  rem_bindinfo.stgmedData.u.hGlobal = buf;
2330  rem_bindinfo.cbstgmedData = 5;
2331 
2332  hres = IBindStatusCallback_GetBindInfo(bsc, &bindf, &bindinfo);
2333  ok(hres == S_OK, "GetBindInfo failed: %08x\n", hres);
2334  ok(bindf == rem_bindf, "bindf = %x, expected %x\n", bindf, rem_bindf);
2335 
2336  ok(in_bindinfo.cbSize == sizeof(in_bindinfo), "cbSize = %u\n", in_bindinfo.cbSize);
2337  ok(!in_bindinfo.pUnk, "pUnk = %p\n", in_bindinfo.pUnk);
2338  ok(in_bindinfo.stgmedData.tymed == TYMED_NULL, "tymed = %u\n",
2339  in_bindinfo.stgmedData.tymed);
2340 
2341  ok(bindinfo.cbSize == sizeof(bindinfo), "cbSize = %u\n", bindinfo.cbSize);
2342  ok(!bindinfo.pUnk, "pUnk = %p\n", bindinfo.pUnk);
2343  ok(bindinfo.stgmedData.tymed == TYMED_NULL, "tymed = %u\n",
2344  bindinfo.stgmedData.tymed);
2345  ok(!bindinfo.stgmedData.u.pstm, "stm = %p\n",
2346  bindinfo.stgmedData.u.pstm);
2347  ok(!bindinfo.stgmedData.pUnkForRelease, "pUnkForRelease = %p\n",
2348  bindinfo.stgmedData.pUnkForRelease);
2349  ok(bindinfo.cbstgmedData == 5, "cbstgmedData = %u\n", bindinfo.cbstgmedData);
2350 
2351  ReleaseBindInfo(&bindinfo);
2352 
2353  /* Same with GetBindInfoEx */
2354  hres = IBindStatusCallback_QueryInterface(bsc, &IID_IBindStatusCallbackEx, (void**)&callbackex);
2355  if(SUCCEEDED(hres)) {
2356  DWORD bindf2, reserved;
2357 
2358  rem_bindf = BINDF_ASYNCHRONOUS | BINDF_ASYNCSTORAGE | BINDF_PULLDATA;
2359  bindf = bindf2 = reserved = 0xdeadbeef;
2360 
2361  memset(&bindinfo, 0, sizeof(bindinfo));
2362  bindinfo.cbSize = sizeof(bindinfo);
2363  bindinfo.grfBindInfoF = 12;
2364  bindinfo.dwBindVerb = 13;
2365  bindinfo.cbstgmedData = 19;
2366  bindinfo.dwOptions = 14;
2367  bindinfo.dwOptionsFlags = 15;
2368  bindinfo.dwCodePage = 16;
2369  bindinfo.securityAttributes.nLength = 30;
2370  bindinfo.securityAttributes.lpSecurityDescriptor = (void*)0xdead0001;
2371  bindinfo.securityAttributes.bInheritHandle = 31;
2372  bindinfo.iid.Data1 = 17;
2373  bindinfo.pUnk = (IUnknown*)0xdeadbeef;
2374  bindinfo.dwReserved = 18;
2375  bindinfo.stgmedData.pUnkForRelease = &unk_in.IUnknown_iface;
2376  unk_in.ref = 1;
2377 
2378  memset(&rem_bindinfo, 0, sizeof(bindinfo));
2379  rem_bindinfo.cbSize = sizeof(rem_bindinfo);
2380  rem_bindinfo.szExtraInfo = extra_info_out = a2co("extra info out");
2381  rem_bindinfo.grfBindInfoF = 22;
2382  rem_bindinfo.dwBindVerb = 23;
2383  rem_bindinfo.szCustomVerb = verb_out = a2co("custom verb out");
2384  rem_bindinfo.cbstgmedData = 29;
2385  rem_bindinfo.dwOptions = 24;
2386  rem_bindinfo.dwOptionsFlags = 25;
2387  rem_bindinfo.dwCodePage = 16;
2388  rem_bindinfo.securityAttributes.nLength = 40;
2389  rem_bindinfo.securityAttributes.lpSecurityDescriptor = (void*)0xdead0002;
2390  rem_bindinfo.securityAttributes.bInheritHandle = 41;
2391  rem_bindinfo.iid.Data1 = 27;
2392  rem_bindinfo.pUnk = (IUnknown*)0xdeadbeef;
2393  rem_bindinfo.dwReserved = 18;
2394  rem_bindinfo.stgmedData.pUnkForRelease = &unk_out.IUnknown_iface;
2395  unk_out.ref = 1;
2396 
2397  hres = IBindStatusCallbackEx_GetBindInfoEx(callbackex, &bindf, &bindinfo, &bindf2, &reserved);
2398  ok(hres == S_OK, "GetBindInfo failed: %08x\n", hres);
2399  ok(bindf == rem_bindf, "bindf = %x, expected %x\n", bindf, rem_bindf);
2400  ok(bindf2 == 11, "bindf2 = %x\n", bindf);
2401  ok(reserved == 12, "reserved = %x\n", reserved);
2402 
2403  ok(in_bindinfo.cbSize == sizeof(in_bindinfo), "cbSize = %u\n", in_bindinfo.cbSize);
2404  ok(!in_bindinfo.szExtraInfo, "szExtraInfo = %s\n", wine_dbgstr_w(in_bindinfo.szExtraInfo));
2405  ok(in_bindinfo.grfBindInfoF == 12, "cbSize = %u\n", in_bindinfo.grfBindInfoF);
2406  ok(in_bindinfo.dwBindVerb == 13, "dwBindVerb = %u\n", in_bindinfo.dwBindVerb);
2407  ok(!in_bindinfo.szCustomVerb, "szCustomVerb = %s\n", wine_dbgstr_w(in_bindinfo.szCustomVerb));
2408  ok(in_bindinfo.cbstgmedData == 19, "cbstgmedData = %u\n", in_bindinfo.cbstgmedData);
2409  ok(!in_bindinfo.dwOptions, "dwOptions = %u\n", in_bindinfo.dwOptions);
2410  ok(!in_bindinfo.dwOptionsFlags, "dwOptionsFlags = %u\n", in_bindinfo.dwOptionsFlags);
2411  ok(!in_bindinfo.dwCodePage, "dwCodePage = %u\n", in_bindinfo.dwCodePage);
2412  ok(!in_bindinfo.iid.Data1, "iid.Data1 = %u\n", in_bindinfo.iid.Data1);
2413  ok(!in_bindinfo.pUnk, "pUnk = %p\n", in_bindinfo.pUnk);
2414  ok(!in_bindinfo.dwReserved, "dwReserved = %u\n", in_bindinfo.dwReserved);
2415  ok(!in_bindinfo.securityAttributes.nLength, "securityAttributes.nLength = %u\n",
2416  in_bindinfo.securityAttributes.nLength);
2417  ok(!in_bindinfo.securityAttributes.lpSecurityDescriptor,
2418  "securityAttributes.lpSecurityDescriptor = %p\n",
2419  in_bindinfo.securityAttributes.lpSecurityDescriptor);
2420  ok(!in_bindinfo.securityAttributes.bInheritHandle, "securityAttributes.bInheritHandle = %u\n",
2421  in_bindinfo.securityAttributes.bInheritHandle);
2422  ok(!in_bindinfo.stgmedData.pUnkForRelease, "pUnkForRelease = %p\n",
2423  in_bindinfo.stgmedData.pUnkForRelease);
2424 
2425  ok(bindinfo.cbSize == sizeof(rem_bindinfo), "cbSize = %u\n", rem_bindinfo.cbSize);
2426  ok(!strcmp_wa(bindinfo.szExtraInfo, "extra info out"),
2427  "szExtraInfo = %s\n", wine_dbgstr_w(bindinfo.szExtraInfo));
2428  ok(bindinfo.grfBindInfoF == 22, "grfBindInfoF = %u\n", rem_bindinfo.grfBindInfoF);
2429  ok(bindinfo.dwBindVerb == 23, "dwBindVerb = %u\n", bindinfo.dwBindVerb);
2430  ok(bindinfo.szCustomVerb != verb_out, "szCustomVerb == inbuf\n");
2431  ok(!strcmp_wa(bindinfo.szCustomVerb, "custom verb out"), "szCustomVerb = %s\n",
2432  wine_dbgstr_w(bindinfo.szCustomVerb));
2433  ok(bindinfo.cbstgmedData == 29, "cbstgmedData = %u\n", bindinfo.cbstgmedData);
2434  ok(bindinfo.dwOptions == 24, "dwOptions = %u\n", bindinfo.dwOptions);
2435  ok(bindinfo.dwOptionsFlags == 25, "dwOptionsFlags = %u\n", bindinfo.dwOptionsFlags);
2436  ok(bindinfo.dwCodePage, "dwCodePage = %u\n", bindinfo.dwCodePage);
2437  ok(!bindinfo.iid.Data1, "iid.Data1 = %u\n", bindinfo.iid.Data1);
2438  ok(!bindinfo.pUnk, "pUnk = %p\n", bindinfo.pUnk);
2439  ok(bindinfo.dwReserved == 18, "dwReserved = %u\n", bindinfo.dwReserved);
2440  ok(bindinfo.securityAttributes.nLength == 30, "securityAttributes.nLength = %u\n",
2441  bindinfo.securityAttributes.nLength);
2442  ok(bindinfo.securityAttributes.lpSecurityDescriptor == (void*)0xdead0001,
2443  "securityAttributes.lpSecurityDescriptor = %p\n",
2444  bindinfo.securityAttributes.lpSecurityDescriptor);
2445  ok(bindinfo.securityAttributes.bInheritHandle == 31, "securityAttributes.bInheritHandle = %u\n",
2446  bindinfo.securityAttributes.bInheritHandle);
2447  ok(bindinfo.stgmedData.pUnkForRelease == &unk_in.IUnknown_iface, "pUnkForRelease = %p\n",
2448  bindinfo.stgmedData.pUnkForRelease);
2449  ok(unk_out.ref == 1, "unk_out.ref = %u\n", unk_out.ref);
2450 
2451  bindinfo.stgmedData.pUnkForRelease = NULL;
2452  ReleaseBindInfo(&bindinfo);
2453 
2454  zero.QuadPart = 0;
2455  hres = IStream_Seek(binding_stream, zero, STREAM_SEEK_SET, NULL);
2456  ok(hres == S_OK, "Seek failed: 0x%08x\n", hres);
2457 
2458  /* Return IStream stgmed from GetBindInfoEx, it's not marshaled back */
2459  rem_bindf = BINDF_ASYNCHRONOUS | BINDF_ASYNCSTORAGE | BINDF_PULLDATA;
2460  bindf = bindf2 = reserved = 0xdeadbeef;
2461 
2462  memset(&bindinfo, 0, sizeof(bindinfo));
2463  bindinfo.cbSize = sizeof(bindinfo);
2464 
2465  memset(&rem_bindinfo, 0, sizeof(rem_bindinfo));
2466  rem_bindinfo.cbSize = sizeof(rem_bindinfo);
2467 
2468  rem_bindinfo.stgmedData.tymed = TYMED_ISTREAM;
2469  rem_bindinfo.stgmedData.u.pstm = binding_stream;
2470  rem_bindinfo.cbstgmedData = 3;
2471  IStream_AddRef(binding_stream);
2472 
2473  hres = IBindStatusCallbackEx_GetBindInfoEx(callbackex, &bindf, &bindinfo, &bindf2, &reserved);
2474  ok(hres == S_OK, "GetBindInfoEx failed: %08x\n", hres);
2475  ok(bindf == rem_bindf, "bindf = %x, expected %x\n", bindf, rem_bindf);
2476 
2477  ok(in_bindinfo.cbSize == sizeof(in_bindinfo), "cbSize = %u\n", in_bindinfo.cbSize);
2478  ok(!in_bindinfo.pUnk, "pUnk = %p\n", in_bindinfo.pUnk);
2479  ok(in_bindinfo.stgmedData.tymed == TYMED_NULL, "tymed = %u\n",
2480  in_bindinfo.stgmedData.tymed);
2481 
2482  ok(bindinfo.cbSize == sizeof(bindinfo), "cbSize = %u\n", bindinfo.cbSize);
2483  ok(!bindinfo.pUnk, "pUnk = %p\n", bindinfo.pUnk);
2484  ok(bindinfo.stgmedData.tymed == TYMED_NULL, "tymed = %u\n",
2485  bindinfo.stgmedData.tymed);
2486  ok(!bindinfo.stgmedData.u.pstm, "stm = %p\n",
2487  bindinfo.stgmedData.u.pstm);
2488  ok(!bindinfo.stgmedData.pUnkForRelease, "pUnkForRelease = %p\n",
2489  bindinfo.stgmedData.pUnkForRelease);
2490  ok(bindinfo.cbstgmedData == 3, "cbstgmedData = %u\n", bindinfo.cbstgmedData);
2491 
2492  ReleaseBindInfo(&bindinfo);
2493 
2494  /* Same, but with pUnkForRelease, it's not marshaled back */
2495  rem_bindf = BINDF_ASYNCHRONOUS | BINDF_ASYNCSTORAGE | BINDF_PULLDATA;
2496  bindf = bindf2 = reserved = 0xdeadbeef;
2497 
2498  memset(&bindinfo, 0, sizeof(bindinfo));
2499  bindinfo.cbSize = sizeof(bindinfo);
2500 
2501  memset(&rem_bindinfo, 0, sizeof(rem_bindinfo));
2502  rem_bindinfo.cbSize = sizeof(rem_bindinfo);
2503 
2504  rem_bindinfo.stgmedData.tymed = TYMED_ISTREAM;
2505  rem_bindinfo.stgmedData.u.pstm = binding_stream;
2506  rem_bindinfo.stgmedData.pUnkForRelease = &unk_out.IUnknown_iface;
2507  unk_out.ref = 1;
2508  rem_bindinfo.cbstgmedData = 3;
2509  IStream_AddRef(binding_stream);
2510 
2511  hres = IBindStatusCallbackEx_GetBindInfoEx(callbackex, &bindf, &bindinfo, &bindf2, &reserved);
2512  ok(hres == S_OK, "GetBindInfoEx failed: %08x\n", hres);
2513  ok(bindf == rem_bindf, "bindf = %x, expected %x\n", bindf, rem_bindf);
2514 
2515  ok(in_bindinfo.cbSize == sizeof(in_bindinfo), "cbSize = %u\n", in_bindinfo.cbSize);
2516  ok(!in_bindinfo.pUnk, "pUnk = %p\n", in_bindinfo.pUnk);
2517  ok(in_bindinfo.stgmedData.tymed == TYMED_NULL, "tymed = %u\n",
2518  in_bindinfo.stgmedData.tymed);
2519 
2520  ok(bindinfo.cbSize == sizeof(bindinfo), "cbSize = %u\n", bindinfo.cbSize);
2521  ok(!bindinfo.pUnk, "pUnk = %p\n", bindinfo.pUnk);
2522  ok(bindinfo.stgmedData.tymed == TYMED_NULL, "tymed = %u\n",
2523  bindinfo.stgmedData.tymed);
2524  ok(!bindinfo.stgmedData.u.pstm, "stm = %p\n",
2525  bindinfo.stgmedData.u.pstm);
2526  ok(!bindinfo.stgmedData.pUnkForRelease, "pUnkForRelease = %p\n",
2527  bindinfo.stgmedData.pUnkForRelease);
2528  ok(bindinfo.cbstgmedData == 3, "cbstgmedData = %u\n", bindinfo.cbstgmedData);
2529 
2530  ReleaseBindInfo(&bindinfo);
2531 
2532  /* Return HGLOBAL stgmed from GetBindInfoEx, it's not marshaled back */
2533  rem_bindf = BINDF_ASYNCHRONOUS | BINDF_ASYNCSTORAGE | BINDF_PULLDATA;
2534  bindf = bindf2 = reserved = 0xdeadbeef;
2535 
2536  memset(&bindinfo, 0, sizeof(bindinfo));
2537  bindinfo.cbSize = sizeof(bindinfo);
2538 
2539  memset(&rem_bindinfo, 0, sizeof(rem_bindinfo));
2540  rem_bindinfo.cbSize = sizeof(rem_bindinfo);
2541 
2542  rem_bindinfo.stgmedData.tymed = TYMED_HGLOBAL;
2543 
2544  buf = GlobalAlloc(0, 5);
2545  strcpy(buf, "test");
2546  rem_bindinfo.stgmedData.u.hGlobal = buf;
2547  rem_bindinfo.cbstgmedData = 5;
2548 
2549  hres = IBindStatusCallbackEx_GetBindInfoEx(callbackex, &bindf, &bindinfo, &bindf2, &reserved);
2550  ok(hres == S_OK, "GetBindInfoEx failed: %08x\n", hres);
2551  ok(bindf == rem_bindf, "bindf = %x, expected %x\n", bindf, rem_bindf);
2552 
2553  ok(in_bindinfo.cbSize == sizeof(in_bindinfo), "cbSize = %u\n", in_bindinfo.cbSize);
2554  ok(!in_bindinfo.pUnk, "pUnk = %p\n", in_bindinfo.pUnk);
2555  ok(in_bindinfo.stgmedData.tymed == TYMED_NULL, "tymed = %u\n",
2556  in_bindinfo.stgmedData.tymed);
2557 
2558  ok(bindinfo.cbSize == sizeof(bindinfo), "cbSize = %u\n", bindinfo.cbSize);
2559  ok(!bindinfo.pUnk, "pUnk = %p\n", bindinfo.pUnk);
2560  ok(bindinfo.stgmedData.tymed == TYMED_NULL, "tymed = %u\n",
2561  bindinfo.stgmedData.tymed);
2562  ok(!bindinfo.stgmedData.u.pstm, "stm = %p\n",
2563  bindinfo.stgmedData.u.pstm);
2564  ok(!bindinfo.stgmedData.pUnkForRelease, "pUnkForRelease = %p\n",
2565  bindinfo.stgmedData.pUnkForRelease);
2566  ok(bindinfo.cbstgmedData == 5, "cbstgmedData = %u\n", bindinfo.cbstgmedData);
2567 
2568  ReleaseBindInfo(&bindinfo);
2569 
2570  IBindStatusCallbackEx_Release(callbackex);
2571  }else {
2572  win_skip("IBindStatusCallbackEx not supported\n");
2573  }
2574 
2575  /* Test marshaling stgmed from OnDataAvailable */
2576  memset(&in_stgmed, 0xcc, sizeof(in_stgmed));
2577  stgmed.tymed = TYMED_ISTREAM;
2578  stgmed.u.pstm = binding_stream;
2579  stgmed.pUnkForRelease = NULL;
2580 
2581  hres = IBindStatusCallback_OnDataAvailable(bsc, 1, 10, &formatetc, &stgmed);
2582  ok(hres == S_OK, "OnDataAvailable failed: %08x\n", hres);
2583 
2584  ok(in_stgmed.tymed == TYMED_ISTREAM, "tymed = %u\n", in_stgmed.tymed);
2585  ok(in_stgmed.u.pstm != NULL, "pstm = NULL\n");
2586  ok(!in_stgmed.pUnkForRelease, "pUnkForRelease = %p\n", in_stgmed.pUnkForRelease);
2587 
2588  /* OnDataAvailable with both IStream and pUnkForRelease */
2589  memset(&in_stgmed, 0xcc, sizeof(in_stgmed));
2590  stgmed.tymed = TYMED_ISTREAM;
2591  stgmed.u.pstm = binding_stream;
2592  stgmed.pUnkForRelease = &unk_in.IUnknown_iface;
2593  unk_in.ref = 1;
2594 
2595  hres = IBindStatusCallback_OnDataAvailable(bsc, 1, 10, &formatetc, &stgmed);
2596  ok(hres == S_OK, "OnDataAvailable failed: %08x\n", hres);
2597 
2598  ok(in_stgmed.tymed == TYMED_ISTREAM, "tymed = %u\n", in_stgmed.tymed);
2599  ok(in_stgmed.u.pstm != NULL, "pstm = NULL\n");
2600  ok(in_stgmed.pUnkForRelease != NULL, "pUnkForRelease = %p\n", in_stgmed.pUnkForRelease);
2601  ok(unk_in.ref > 1, "ref = %u\n", unk_in.ref);
2602 
2603  /* OnDataAvailable with TYMED_ISTREAM, but NULL stream */
2604  memset(&in_stgmed, 0xcc, sizeof(in_stgmed));
2605  stgmed.tymed = TYMED_ISTREAM;
2606  stgmed.u.pstm = binding_stream;
2607  stgmed.pUnkForRelease = NULL;
2608 
2609  hres = IBindStatusCallback_OnDataAvailable(bsc, 1, 10, &formatetc, &stgmed);
2610  ok(hres == S_OK, "OnDataAvailable failed: %08x\n", hres);
2611 
2612  ok(in_stgmed.tymed == TYMED_ISTREAM, "tymed = %u\n", in_stgmed.tymed);
2613  ok(in_stgmed.u.pstm != NULL, "pstm = NULL\n");
2614  ok(!in_stgmed.pUnkForRelease, "pUnkForRelease = %p\n", in_stgmed.pUnkForRelease);
2615 
2616  /* OnDataAvailable with TYMED_NULL and pUnkForRelease */
2617  memset(&in_stgmed, 0xcc, sizeof(in_stgmed));
2618  stgmed.tymed = TYMED_NULL;
2619  stgmed.u.pstm = binding_stream;
2620  stgmed.pUnkForRelease = &unk_in.IUnknown_iface;
2621  unk_in.ref = 1;
2622 
2623  hres = IBindStatusCallback_OnDataAvailable(bsc, 1, 10, &formatetc, &stgmed);
2624  ok(hres == S_OK, "OnDataAvailable failed: %08x\n", hres);
2625 
2626  ok(in_stgmed.tymed == TYMED_NULL, "tymed = %u\n", in_stgmed.tymed);
2627  ok(!in_stgmed.u.pstm, "pstm != NULL\n");
2628  ok(in_stgmed.pUnkForRelease != NULL, "pUnkForRelease = %p\n", in_stgmed.pUnkForRelease);
2629  ok(unk_in.ref == 1, "ref = %u\n", unk_in.ref);
2630 
2631  IStream_Release(binding_stream);
2632  IBindStatusCallback_Release(bsc);
2633 
2634  TerminateThread(thread, 0);
2635 }
HRESULT WINAPI CoUnmarshalInterface(IStream *pStream, REFIID riid, LPVOID *ppv)
Definition: marshal.c:1982
#define TRUE
Definition: types.h:120
HGLOBAL NTAPI GlobalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:368
BOOL WINAPI TerminateThread(IN HANDLE hThread, IN DWORD dwExitCode)
Definition: thread.c:586
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
static DWORD WINAPI bsc_thread(void *arg)
Definition: misc.c:2084
char * wine_dbgstr_w(const wchar_t *wstr)
Definition: atltest.h:87
void WINAPI ReleaseBindInfo(BINDINFO *pbindinfo)
Definition: urlmon_main.c:572
static HANDLE thread_ready
Definition: misc.c:2082
HRESULT WINAPI CreateStreamOnHGlobal(HGLOBAL hGlobal, BOOL fDeleteOnRelease, LPSTREAM *ppstm)
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventW(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCWSTR lpName OPTIONAL)
Definition: synch.c:651
static BINDINFO in_bindinfo
Definition: misc.c:1930
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
IUnknown IUnknown_iface
Definition: misc.c:2041
r reserved
Definition: btrfs.c:2893
static IBindStatusCallbackEx bsc
Definition: url.c:2149
static STGMEDIUM in_stgmed
Definition: misc.c:1996
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
Definition: thread.c:136
smooth NULL
Definition: ftsmooth.c:416
static RefUnk unk_in
Definition: misc.c:2080
static WCHAR * a2co(const char *str)
Definition: misc.c:107
static DWORD rem_bindf
Definition: misc.c:1931
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
HRESULT hres
Definition: misc.c:479
unsigned long DWORD
Definition: ntddk_ex.h:95
static BINDINFO rem_bindinfo
Definition: misc.c:1930
static HANDLE thread
Definition: service.c:33
static double zero
Definition: j0_y0.c:96
Definition: parse.h:22
GLuint GLuint stream
Definition: glext.h:7522
static RefUnk unk_out
Definition: misc.c:2080
static int strcmp_wa(const WCHAR *strw, const char *stra)
Definition: misc.c:85
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
#define INFINITE
Definition: serial.h:102
#define memset(x, y, z)
Definition: compat.h:39
#define win_skip
Definition: test.h:141
LONG ref
Definition: misc.c:2042
#define SUCCEEDED(hr)
Definition: intsafe.h:57
static DWORD bindf
Definition: protocol.c:70

Referenced by START_TEST().

◆ test_CoInternetCompareUrl()

static void test_CoInternetCompareUrl ( void  )
static

Definition at line 420 of file misc.c.

421 {
422  HRESULT hres;
423 
424  hres = pCoInternetCompareUrl(url1, url1, 0);
425  ok(hres == S_OK, "CoInternetCompareUrl failed: %08x\n", hres);
426 
427  hres = pCoInternetCompareUrl(url1, url3, 0);
428  ok(hres == S_FALSE, "CoInternetCompareUrl failed: %08x\n", hres);
429 
430  hres = pCoInternetCompareUrl(url3, url1, 0);
431  ok(hres == S_FALSE, "CoInternetCompareUrl failed: %08x\n", hres);
432 }
#define S_FALSE
Definition: winerror.h:2357
static const WCHAR url1[]
Definition: misc.c:298
LONG HRESULT
Definition: typedefs.h:77
HRESULT hres
Definition: misc.c:479
static const WCHAR url3[]
Definition: misc.c:301
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57

Referenced by START_TEST().

◆ test_CoInternetIsFeatureEnabled()

static void test_CoInternetIsFeatureEnabled ( void  )
static

Definition at line 1846 of file misc.c.

1846  {
1847  HRESULT hres;
1848 
1849  hres = pCoInternetIsFeatureEnabled(FEATURE_ENTRY_COUNT, GET_FEATURE_FROM_PROCESS);
1850  ok(hres == E_FAIL, "CoInternetIsFeatureEnabled returned %08x, expected E_FAIL\n", hres);
1851 }
#define E_FAIL
Definition: ddrawi.h:102
LONG HRESULT
Definition: typedefs.h:77
HRESULT hres
Definition: misc.c:479
#define ok(value,...)
Definition: atltest.h:57

Referenced by test_internet_features().

◆ test_CoInternetParseUrl()

static void test_CoInternetParseUrl ( void  )
static

Definition at line 357 of file misc.c.

358 {
359  HRESULT hres;
360  DWORD size;
361  int i;
362 
363  static WCHAR buf[4096];
364 
365  memset(buf, 0xf0, sizeof(buf));
366  hres = pCoInternetParseUrl(parse_tests[0].url, PARSE_SCHEMA, 0, buf,
367  3, &size, 0);
368  ok(hres == E_POINTER, "schema failed: %08x, expected E_POINTER\n", hres);
369 
370  for(i = 0; i < ARRAY_SIZE(parse_tests); i++) {
371  memset(buf, 0xf0, sizeof(buf));
372  hres = pCoInternetParseUrl(parse_tests[i].url, PARSE_SECURITY_URL, 0, buf,
373  ARRAY_SIZE(buf), &size, 0);
374  ok(hres == parse_tests[i].secur_hres, "[%d] security url failed: %08x, expected %08x\n",
375  i, hres, parse_tests[i].secur_hres);
376 
377  memset(buf, 0xf0, sizeof(buf));
378  hres = pCoInternetParseUrl(parse_tests[i].url, PARSE_ENCODE, 0, buf,
379  ARRAY_SIZE(buf), &size, 0);
380  ok(hres == S_OK, "[%d] encoding failed: %08x\n", i, hres);
381  ok(size == lstrlenW(parse_tests[i].encoded_url), "[%d] wrong size\n", i);
382  ok(!lstrcmpW(parse_tests[i].encoded_url, buf), "[%d] wrong encoded url\n", i);
383 
384  memset(buf, 0xf0, sizeof(buf));
385  hres = pCoInternetParseUrl(parse_tests[i].url, PARSE_PATH_FROM_URL, 0, buf,
386  ARRAY_SIZE(buf), &size, 0);
387  ok(hres == parse_tests[i].path_hres, "[%d] path failed: %08x, expected %08x\n",
388  i, hres, parse_tests[i].path_hres);
389  if(parse_tests[i].path) {
390  ok(size == lstrlenW(parse_tests[i].path), "[%d] wrong size\n", i);
391  ok(!lstrcmpW(parse_tests[i].path, buf), "[%d] wrong path\n", i);
392  }
393 
394  memset(buf, 0xf0, sizeof(buf));
395  hres = pCoInternetParseUrl(parse_tests[i].url, PARSE_SCHEMA, 0, buf,
396  ARRAY_SIZE(buf), &size, 0);
397  ok(hres == S_OK, "[%d] schema failed: %08x\n", i, hres);
398  ok(size == lstrlenW(parse_tests[i].schema), "[%d] wrong size\n", i);
399  ok(!lstrcmpW(parse_tests[i].schema, buf), "[%d] wrong schema\n", i);
400 
401  if(memcmp(parse_tests[i].url, wszRes, 3*sizeof(WCHAR))
402  && memcmp(parse_tests[i].url, wszAbout, 5*sizeof(WCHAR))) {
403  memset(buf, 0xf0, sizeof(buf));
404  hres = pCoInternetParseUrl(parse_tests[i].url, PARSE_DOMAIN, 0, buf,
405  ARRAY_SIZE(buf), &size, 0);
406  ok(hres == parse_tests[i].domain_hres, "[%d] domain failed: %08x\n", i, hres);
407  if(parse_tests[i].domain)
408  ok(!lstrcmpW(parse_tests[i].domain, buf), "[%d] wrong domain, received %s\n", i, wine_dbgstr_w(buf));
409  }
410 
411  memset(buf, 0xf0, sizeof(buf));
412  hres = pCoInternetParseUrl(parse_tests[i].url, PARSE_ROOTDOCUMENT, 0, buf,
413  ARRAY_SIZE(buf), &size, 0);
414  ok(hres == parse_tests[i].rootdocument_hres, "[%d] rootdocument failed: %08x\n", i, hres);
415  if(parse_tests[i].rootdocument)
416  ok(!lstrcmpW(parse_tests[i].rootdocument, buf), "[%d] wrong rootdocument, received %s\n", i, wine_dbgstr_w(buf));
417  }
418 }
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
char * wine_dbgstr_w(const wchar_t *wstr)
Definition: atltest.h:87
int WINAPI lstrcmpW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:170
static const struct parse_test parse_tests[]
Definition: misc.c:347
#define lstrlenW
Definition: compat.h:407
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
GLsizeiptr size
Definition: glext.h:5919
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
unsigned long DWORD
Definition: ntddk_ex.h:95
HRESULT hres
Definition: misc.c:479
#define S_OK
Definition: intsafe.h:59
#define ARRAY_SIZE(a)
Definition: main.h:24
#define ok(value,...)
Definition: atltest.h:57
Definition: services.c:325
const WCHAR * schema
static const WCHAR wszRes[]
Definition: misc.c:321
DWORD size
Definition: misc.c:596
#define E_POINTER
Definition: winerror.h:2365
#define memset(x, y, z)
Definition: compat.h:39
static const WCHAR wszAbout[]
Definition: misc.c:324
LPCWSTR url
Definition: misc.c:435

Referenced by START_TEST().

◆ test_CoInternetQueryInfo()

static void test_CoInternetQueryInfo ( void  )
static

Definition at line 448 of file misc.c.

449 {
450  BYTE buf[100];
451  DWORD cb, i;
452  HRESULT hres;
453 
454  for(i = 0; i < ARRAY_SIZE(query_info_tests); i++) {
455  cb = 0xdeadbeef;
456  memset(buf, '?', sizeof(buf));
457  hres = pCoInternetQueryInfo(query_info_tests[0].url, QUERY_USES_NETWORK, 0, buf, sizeof(buf), &cb, 0);
458  ok(hres == S_OK, "[%d] CoInternetQueryInfo failed: %08x\n", i, hres);
459  ok(cb == sizeof(DWORD), "[%d] cb = %d\n", i, cb);
460  ok(*(DWORD*)buf == query_info_tests[i].uses_net, "[%d] ret %x, expected %x\n",
462 
463  hres = pCoInternetQueryInfo(query_info_tests[0].url, QUERY_USES_NETWORK, 0, buf, 3, &cb, 0);
464  ok(hres == E_FAIL, "[%d] CoInternetQueryInfo failed: %08x, expected E_FAIL\n", i, hres);
465  hres = pCoInternetQueryInfo(query_info_tests[0].url, QUERY_USES_NETWORK, 0, NULL, sizeof(buf), &cb, 0);
466  ok(hres == E_FAIL, "[%d] CoInternetQueryInfo failed: %08x, expected E_FAIL\n", i, hres);
467 
468  memset(buf, '?', sizeof(buf));
469  hres = pCoInternetQueryInfo(query_info_tests[0].url, QUERY_USES_NETWORK, 0, buf, sizeof(buf), NULL, 0);
470  ok(hres == S_OK, "[%d] CoInternetQueryInfo failed: %08x\n", i, hres);
471  ok(*(DWORD*)buf == query_info_tests[i].uses_net, "[%d] ret %x, expected %x\n",
473  }
474 }
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
DWORD uses_net
Definition: misc.c:436
#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
smooth NULL
Definition: ftsmooth.c:416
LONG HRESULT
Definition: typedefs.h:77
HRESULT hres
Definition: misc.c:479
unsigned long DWORD
Definition: ntddk_ex.h:95
static DWORD cb
Definition: integrity.c:41
unsigned char BYTE
Definition: mem.h:68
#define S_OK
Definition: intsafe.h:59
#define ARRAY_SIZE(a)
Definition: main.h:24
#define ok(value,...)
Definition: atltest.h:57
#define memset(x, y, z)
Definition: compat.h:39
static const struct @1644 query_info_tests[]
LPCWSTR url
Definition: misc.c:435

Referenced by START_TEST().

◆ test_CoInternetSetFeatureEnabled()

static void test_CoInternetSetFeatureEnabled ( void  )
static

Definition at line 1868 of file misc.c.

1868  {
1869  HRESULT hres;
1870  DWORD i;
1871 
1872  hres = pCoInternetSetFeatureEnabled(FEATURE_ENTRY_COUNT,SET_FEATURE_ON_PROCESS,TRUE);
1873  ok(hres == E_FAIL, "CoInternetSetFeatureEnabled returned %08x, expected E_FAIL\n", hres);
1874 
1875  for(i = 0; i < ARRAY_SIZE(internet_feature_tests); ++i) {
1876  hres = pCoInternetSetFeatureEnabled(internet_feature_tests[i].feature, internet_feature_tests[i].set_flags,
1879  ok(hres == internet_feature_tests[i].set_expected, "CoInternetSetFeatureEnabled returned %08x, expected %08x on test %d\n",
1881 
1882  hres = pCoInternetIsFeatureEnabled(internet_feature_tests[i].feature, internet_feature_tests[i].set_flags);
1884  ok(hres == internet_feature_tests[i].get_expected, "CoInternetIsFeatureEnabled returned %08x, expected %08x on test %d\n",
1886 
1887  }
1888 }
INTERNETFEATURELIST feature
Definition: misc.c:1689
#define TRUE
Definition: types.h:120
BOOL set_todo
Definition: misc.c:1858
HRESULT set_expected
Definition: misc.c:1857
HRESULT get_expected
Definition: misc.c:1860
#define E_FAIL
Definition: ddrawi.h:102
BOOL get_todo
Definition: misc.c:1861
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 todo_wine_if(is_todo)
Definition: test.h:155
LONG HRESULT
Definition: typedefs.h:77
unsigned long DWORD
Definition: ntddk_ex.h:95
HRESULT hres
Definition: misc.c:479
GLboolean enable
Definition: glext.h:11120
#define ARRAY_SIZE(a)
Definition: main.h:24
#define ok(value,...)
Definition: atltest.h:57
static const struct @1648 internet_feature_tests[]
DWORD set_flags
Definition: misc.c:1855

Referenced by test_internet_features().

◆ test_CopyBindInfo()

static void test_CopyBindInfo ( void  )
static

Definition at line 1298 of file misc.c.

1299 {
1300  BINDINFO src[2], dest[2];
1301  SECURITY_DESCRIPTOR sec_desc;
1302  HRESULT hres;
1303  int i;
1304 
1305  hres = pCopyBindInfo(NULL, NULL);
1306  ok(hres == E_POINTER, "CopyBindInfo returned %08x, expected E_POINTER\n", hres);
1307 
1308  memset(src, 0, sizeof(BINDINFO[2]));
1309  memset(dest, 0xde, sizeof(BINDINFO[2]));
1310  hres = pCopyBindInfo(src, dest);
1311  ok(hres == E_INVALIDARG, "CopyBindInfo returned: %08x, expected E_INVALIDARG\n", hres);
1312 
1313  memset(src, 0, sizeof(BINDINFO[2]));
1314  memset(dest, 0xde, sizeof(BINDINFO[2]));
1315  src[0].cbSize = sizeof(BINDINFO);
1316  dest[0].cbSize = 0;
1317  hres = pCopyBindInfo(src, dest);
1318  ok(hres == E_INVALIDARG, "CopyBindInfo returned: %08x, expected E_INVALIDARG\n", hres);
1319 
1320  memset(src, 0, sizeof(BINDINFO[2]));
1321  memset(dest, 0xde, sizeof(BINDINFO[2]));
1322  src[0].cbSize = 1;
1323  dest[0].cbSize = sizeof(BINDINFO)+sizeof(DWORD);
1324  hres = pCopyBindInfo(src, dest);
1325  ok(hres == S_OK, "CopyBindInfo failed: %08x\n", hres);
1326  ok(dest[0].cbSize == sizeof(BINDINFO)+sizeof(DWORD), "incorrect cbSize: %d\n", dest[0].cbSize);
1327  for(i=1; i<dest[0].cbSize/sizeof(int); i++)
1328  ok(((int*)dest)[i] == 0, "unset values should be set to 0, got %d on %d\n", ((int*)dest)[i], i);
1329 
1330  memset(src, 0, sizeof(BINDINFO[2]));
1331  memset(dest, 0xde, sizeof(BINDINFO[2]));
1332  src[0].cbSize = sizeof(BINDINFO)+2*sizeof(DWORD);
1333  dest[0].cbSize = sizeof(BINDINFO)+sizeof(DWORD);
1334  hres = pCopyBindInfo(src, dest);
1335  ok(hres == S_OK, "CopyBindInfo failed: %08x\n", hres);
1336  ok(dest[1].cbSize == src[1].cbSize, "additional data should be copied\n");
1337  ok(dest[1].szExtraInfo != src[1].szExtraInfo,
1338  "data not fitting in destination buffer should not be copied\n");
1339 
1340  memset(src, 0xf0, sizeof(BINDINFO[2]));
1341  memset(dest, 0xde, sizeof(BINDINFO[2]));
1342  src[0].cbSize = sizeof(BINDINFO);
1343  src[0].szExtraInfo = CoTaskMemAlloc(sizeof(WCHAR));
1344  src[0].szExtraInfo[0] = 0;
1345  src[0].szCustomVerb = NULL;
1346  src[0].pUnk = NULL;
1347  src[0].stgmedData.tymed = TYMED_NULL;
1348  src[0].stgmedData.pUnkForRelease = NULL;
1349  dest[0].cbSize = sizeof(BINDINFO);
1350  hres = pCopyBindInfo(src, dest);
1351  ok(hres == S_OK, "CopyBindInfo failed: %08x\n", hres);
1352 
1353  ok(dest[0].cbSize == sizeof(BINDINFO), "incorrect cbSize: %d\n", dest[0].cbSize);
1354  ok(dest[0].szExtraInfo && !dest[0].szExtraInfo[0] && dest[0].szExtraInfo!=src[0].szExtraInfo,
1355  "incorrect szExtraInfo: (%p!=%p) %d\n", dest[0].szExtraInfo,
1356  src[0].szExtraInfo, dest[0].szExtraInfo[0]);
1357  ok(!memcmp(&dest[0].stgmedData, &src[0].stgmedData, sizeof(STGMEDIUM)),
1358  "incorrect stgmedData value\n");
1359  ok(src[0].grfBindInfoF == dest[0].grfBindInfoF, "grfBindInfoF = %x, expected %x\n",
1360  dest[0].grfBindInfoF, src[0].grfBindInfoF);
1361  ok(src[0].dwBindVerb == dest[0].dwBindVerb, "dwBindVerb = %x, expected %x\n",
1362  dest[0].dwBindVerb, src[0].dwBindVerb);
1363  ok(!dest[0].szCustomVerb, "szCustmoVerb != NULL\n");
1364  ok(src[0].cbstgmedData == dest[0].cbstgmedData, "cbstgmedData = %x, expected %x\n",
1365  dest[0].cbstgmedData, src[0].cbstgmedData);
1366  ok(src[0].dwOptions == dest[0].dwOptions, "dwOptions = %x, expected %x\n",
1367  dest[0].dwOptions, src[0].dwOptions);
1368  ok(src[0].dwOptionsFlags == dest[0].dwOptionsFlags, "dwOptionsFlags = %x, expected %x\n",
1369  dest[0].dwOptionsFlags, src[0].dwOptionsFlags);
1370  ok(src[0].dwCodePage == dest[0].dwCodePage, "dwCodePage = %x, expected %x\n",
1371  dest[0].dwCodePage, src[0].dwCodePage);
1372  ok(!dest[0].securityAttributes.nLength,
1373  "unexpected securityAttributes.nLength value: %d\n",
1374  dest[0].securityAttributes.nLength);
1375  ok(!dest[0].securityAttributes.lpSecurityDescriptor,
1376  "unexpected securityAttributes.lpSecurityDescriptor value: %p\n",
1377  dest[0].securityAttributes.lpSecurityDescriptor);
1378  ok(!dest[0].securityAttributes.bInheritHandle,
1379  "unexpected securityAttributes.bInheritHandle value: %d\n",
1380  dest[0].securityAttributes.bInheritHandle);
1381  ok(!memcmp(&dest[0].iid, &src[0].iid, sizeof(IID)),
1382  "incorrect iid value\n");
1383  ok(!dest[0].pUnk, "pUnk != NULL\n");
1384  ok(src[0].dwReserved == dest[0].dwReserved, "dwReserved = %x, expected %x\n",
1385  dest[0].dwReserved, src[0].dwReserved);
1386 
1387  CoTaskMemFree(src[0].szExtraInfo);
1388  CoTaskMemFree(dest[0].szExtraInfo);
1389 
1390  src[0].szExtraInfo = NULL;
1391  src[0].securityAttributes.nLength = sizeof(SECURITY_ATTRIBUTES);
1393  "InitializeSecurityDescriptor failed\n");
1394  src[0].securityAttributes.lpSecurityDescriptor = (void*)&sec_desc;
1395  src[0].securityAttributes.bInheritHandle = TRUE;
1396  hres = pCopyBindInfo(src, dest);
1397  ok(hres == S_OK, "CopyBindInfo failed: %08x\n", hres);
1398  ok(!dest[0].securityAttributes.nLength,
1399  "unexpected securityAttributes.nLength value: %d\n",
1400  dest[0].securityAttributes.nLength);
1401  ok(!dest[0].securityAttributes.lpSecurityDescriptor,
1402  "unexpected securityAttributes.lpSecurityDescriptor value: %p\n",
1403  dest[0].securityAttributes.lpSecurityDescriptor);
1404  ok(!dest[0].securityAttributes.bInheritHandle,
1405  "unexpected securityAttributes.bInheritHandle value: %d\n",
1406  dest[0].securityAttributes.bInheritHandle);
1407 }
DWORD dwOptions
Definition: solitaire.cpp:23
#define TRUE
Definition: types.h:120
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:422
BOOL WINAPI InitializeSecurityDescriptor(PSECURITY_DESCRIPTOR pSecurityDescriptor, DWORD dwRevision)
Definition: security.c:808
static int
Definition: misc.c:55
#define SECURITY_DESCRIPTOR_REVISION
Definition: setypes.h:58
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
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED _In_opt_ LPTRANSMIT_FILE_BUFFERS _In_ DWORD dwReserved
Definition: mswsock.h:90
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
unsigned long DWORD
Definition: ntddk_ex.h:95
HRESULT hres
Definition: misc.c:479
GLenum src
Definition: glext.h:6340
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
static char * dest
Definition: rtl.c:135
#define E_POINTER
Definition: winerror.h:2365
#define memset(x, y, z)
Definition: compat.h:39
static void *static void *static LPDIRECTPLAY IUnknown * pUnk
Definition: dplayx.c:30
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: ifs.c:406
struct _SECURITY_ATTRIBUTES SECURITY_ATTRIBUTES

Referenced by START_TEST().

◆ test_CopyStgMedium()

static void test_CopyStgMedium ( void  )
static

Definition at line 1220 of file misc.c.

1221 {
1222  STGMEDIUM src, dst;
1223  HGLOBAL empty, hg;
1224  char *ptr1, *ptr2;
1225  HRESULT hres;
1226  int size;
1227 
1228  static WCHAR fileW[] = {'f','i','l','e',0};
1229 
1230  memset(&src, 0xf0, sizeof(src));
1231  memset(&dst, 0xe0, sizeof(dst));
1232  memset(&empty, 0xf0, sizeof(empty));
1233  src.tymed = TYMED_NULL;
1234  src.pUnkForRelease = NULL;
1235  hres = pCopyStgMedium(&src, &dst);
1236  ok(hres == S_OK, "CopyStgMedium failed: %08x\n", hres);
1237  ok(dst.tymed == TYMED_NULL, "tymed=%d\n", dst.tymed);
1238  ok(dst.u.hGlobal == empty, "u=%p\n", dst.u.hGlobal);
1239  ok(!dst.pUnkForRelease, "pUnkForRelease=%p, expected NULL\n", dst.pUnkForRelease);
1240 
1241  memset(&dst, 0xe0, sizeof(dst));
1242  src.tymed = TYMED_ISTREAM;
1243  src.u.pstm = NULL;
1244  src.pUnkForRelease = NULL;
1245  hres = pCopyStgMedium(&src, &dst);
1246  ok(hres == S_OK, "CopyStgMedium failed: %08x\n", hres);
1247  ok(dst.tymed == TYMED_ISTREAM, "tymed=%d\n", dst.tymed);
1248  ok(!dst.u.pstm, "pstm=%p\n", dst.u.pstm);
1249  ok(!dst.pUnkForRelease, "pUnkForRelease=%p, expected NULL\n", dst.pUnkForRelease);
1250 
1251  memset(&dst, 0xe0, sizeof(dst));
1252  src.tymed = TYMED_FILE;
1253  src.u.lpszFileName = fileW;
1254  src.pUnkForRelease = NULL;
1255  hres = pCopyStgMedium(&src, &dst);
1256  ok(hres == S_OK, "CopyStgMedium failed: %08x\n", hres);
1257  ok(dst.tymed == TYMED_FILE, "tymed=%d\n", dst.tymed);
1258  ok(dst.u.lpszFileName && dst.u.lpszFileName != fileW, "lpszFileName=%p\n", dst.u.lpszFileName);
1259  ok(!lstrcmpW(dst.u.lpszFileName, fileW), "wrong file name\n");
1260  ok(!dst.pUnkForRelease, "pUnkForRelease=%p, expected NULL\n", dst.pUnkForRelease);
1262 
1263  /* TYMED_HGLOBAL */
1264  hg = GlobalAlloc(GMEM_MOVEABLE, 10);
1265  ptr1 = GlobalLock(hg);
1266  memset(ptr1, 0xfa, 10);
1267  memset(&dst, 0xe0, sizeof(dst));
1268  src.tymed = TYMED_HGLOBAL;
1269  src.u.hGlobal = hg;
1270  hres = pCopyStgMedium(&src, &dst);
1271  ok(hres == S_OK, "CopyStgMedium failed: %08x\n", hres);
1272  ok(dst.tymed == TYMED_HGLOBAL, "tymed=%d\n", dst.tymed);
1273  ok(dst.u.hGlobal != hg, "got %p, %p\n", dst.u.hGlobal, hg);
1274  size = GlobalSize(dst.u.hGlobal);
1275  ok(size == 10, "got size %d\n", size);
1276  /* compare contents */
1277  ptr2 = GlobalLock(dst.u.hGlobal);
1278  ok(!memcmp(ptr1, ptr2, 10), "got wrong data\n");
1279  GlobalUnlock(ptr2);
1280  GlobalUnlock(ptr1);
1281  ok(GlobalFlags(dst.u.hGlobal) == 0, "got 0x%08x\n", GlobalFlags(dst.u.hGlobal));
1282  GlobalFree(hg);
1284 
1285  memset(&dst, 0xe0, sizeof(dst));
1286  src.tymed = TYMED_HGLOBAL;
1287  src.u.hGlobal = NULL;
1288  hres = pCopyStgMedium(&src, &dst);
1289  ok(hres == S_OK, "CopyStgMedium failed: %08x\n", hres);
1290  ok(dst.u.hGlobal == NULL, "got %p\n", dst.u.hGlobal);
1291 
1292  hres = pCopyStgMedium(&src, NULL);
1293  ok(hres == E_POINTER, "CopyStgMedium failed: %08x, expected E_POINTER\n", hres);
1294  hres = pCopyStgMedium(NULL, &dst);
1295  ok(hres == E_POINTER, "CopyStgMedium failed: %08x, expected E_POINTER\n", hres);
1296 }
HGLOBAL NTAPI GlobalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:368
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
void WINAPI ReleaseStgMedium(STGMEDIUM *pmedium)
Definition: ole2.c:2036
static const WCHAR empty[]
Definition: main.c:49
int WINAPI lstrcmpW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:170
UINT NTAPI GlobalFlags(HGLOBAL hMem)
Definition: heapmem.c:520
SIZE_T NTAPI GlobalSize(HGLOBAL hMem)
Definition: heapmem.c:1090
smooth NULL
Definition: ftsmooth.c:416
GLsizeiptr size
Definition: glext.h:5919
_In_ FONTOBJ _In_ ULONG _In_ HGLYPH hg
Definition: winddi.h:3869
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
HRESULT hres
Definition: misc.c:479
HGLOBAL NTAPI GlobalFree(HGLOBAL hMem)
Definition: heapmem.c:611
LPVOID NTAPI GlobalLock(HGLOBAL hMem)
Definition: heapmem.c:755
GLenum src
Definition: glext.h:6340
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
GLenum GLenum dst
Definition: glext.h:6340
BOOL NTAPI GlobalUnlock(HGLOBAL hMem)
Definition: heapmem.c:1190
DWORD size
Definition: misc.c:596
#define E_POINTER
Definition: winerror.h:2365
#define memset(x, y, z)
Definition: compat.h:39
static const WCHAR fileW[]
Definition: url.c:111
#define GMEM_MOVEABLE
Definition: winbase.h:291

Referenced by START_TEST().

◆ test_CreateFormatEnum()

static void test_CreateFormatEnum ( void  )
static

Definition at line 122 of file misc.c.

123 {
124  IEnumFORMATETC *fenum = NULL, *fenum2 = NULL;
125  FORMATETC fetc[5];
126  ULONG ul;
127  HRESULT hres;
128 
129  static DVTARGETDEVICE dev = {sizeof(dev),0,0,0,0,{0}};
130  static FORMATETC formatetc[] = {
131  {0,&dev,0,0,0},
132  {0,&dev,0,1,0},
133  {0,NULL,0,2,0},
134  {0,NULL,0,3,0},
135  {0,NULL,0,4,0}
136  };
137 
138  hres = CreateFormatEnumerator(0, formatetc, &fenum);
139  ok(hres == E_FAIL, "CreateFormatEnumerator failed: %08x, expected E_FAIL\n", hres);
140  hres = CreateFormatEnumerator(0, formatetc, NULL);
141  ok(hres == E_INVALIDARG, "CreateFormatEnumerator failed: %08x, expected E_INVALIDARG\n", hres);
142  hres = CreateFormatEnumerator(5, formatetc, NULL);
143  ok(hres == E_INVALIDARG, "CreateFormatEnumerator failed: %08x, expected E_INVALIDARG\n", hres);
144 
145 
146  hres = CreateFormatEnumerator(5, formatetc, &fenum);
147  ok(hres == S_OK, "CreateFormatEnumerator failed: %08x\n", hres);
148  if(FAILED(hres))
149  return;
150 
151  hres = IEnumFORMATETC_Next(fenum, 2, NULL, &ul);
152  ok(hres == E_INVALIDARG, "Next failed: %08x, expected E_INVALIDARG\n", hres);
153  ul = 100;
154  hres = IEnumFORMATETC_Next(fenum, 0, fetc, &ul);
155  ok(hres == S_OK, "Next failed: %08x\n", hres);
156  ok(ul == 0, "ul=%d, expected 0\n", ul);
157 
158  hres = IEnumFORMATETC_Next(fenum, 2, fetc, &ul);
159  ok(hres == S_OK, "Next failed: %08x\n", hres);
160  ok(fetc[0].lindex == 0, "fetc[0].lindex=%d, expected 0\n", fetc[0].lindex);
161  ok(fetc[1].lindex == 1, "fetc[1].lindex=%d, expected 1\n", fetc[1].lindex);
162  ok(fetc[0].ptd == &dev, "fetc[0].ptd=%p, expected %p\n", fetc[0].ptd, &dev);
163  ok(ul == 2, "ul=%d, expected 2\n", ul);
164 
165  hres = IEnumFORMATETC_Skip(fenum, 1);
166  ok(hres == S_OK, "Skip failed: %08x\n", hres);
167 
168  hres = IEnumFORMATETC_Next(fenum, 4, fetc, &ul);
169  ok(hres == S_FALSE, "Next failed: %08x, expected S_FALSE\n", hres);
170  ok(fetc[0].lindex == 3, "fetc[0].lindex=%d, expected 3\n", fetc[0].lindex);
171  ok(fetc[1].lindex == 4, "fetc[1].lindex=%d, expected 4\n", fetc[1].lindex);
172  ok(fetc[0].ptd == NULL, "fetc[0].ptd=%p, expected NULL\n", fetc[0].ptd);
173  ok(ul == 2, "ul=%d, expected 2\n", ul);
174 
175  hres = IEnumFORMATETC_Next(fenum, 4, fetc, &ul);
176  ok(hres == S_FALSE, "Next failed: %08x, expected S_FALSE\n", hres);
177  ok(ul == 0, "ul=%d, expected 0\n", ul);
178  ul = 100;
179  hres = IEnumFORMATETC_Next(fenum, 0, fetc, &ul);
180  ok(hres == S_OK, "Next failed: %08x\n", hres);
181  ok(ul == 0, "ul=%d, expected 0\n", ul);
182 
183  hres = IEnumFORMATETC_Skip(fenum, 3);
184  ok(hres == S_FALSE, "Skip failed: %08x, expected S_FALSE\n", hres);
185 
186  hres = IEnumFORMATETC_Reset(fenum);
187  ok(hres == S_OK, "Reset failed: %08x\n", hres);
188 
189  hres = IEnumFORMATETC_Next(fenum, 5, fetc, NULL);
190  ok(hres == S_OK, "Next failed: %08x\n", hres);
191  ok(fetc[0].lindex == 0, "fetc[0].lindex=%d, expected 0\n", fetc[0].lindex);
192 
193  hres = IEnumFORMATETC_Reset(fenum);
194  ok(hres == S_OK, "Reset failed: %08x\n", hres);
195 
196  hres = IEnumFORMATETC_Skip(fenum, 2);
197  ok(hres == S_OK, "Skip failed: %08x\n", hres);
198 
199  hres = IEnumFORMATETC_Clone(fenum, NULL);
200  ok(hres == E_INVALIDARG, "Clone failed: %08x, expected E_INVALIDARG\n", hres);
201 
202  hres = IEnumFORMATETC_Clone(fenum, &fenum2);
203  ok(hres == S_OK, "Clone failed: %08x\n", hres);
204 
205  if(SUCCEEDED(hres)) {
206  ok(fenum != fenum2, "fenum == fenum2\n");
207 
208  hres = IEnumFORMATETC_Next(fenum2, 2, fetc, &ul);
209  ok(hres == S_OK, "Next failed: %08x\n", hres);
210  ok(fetc[0].lindex == 2, "fetc[0].lindex=%d, expected 2\n", fetc[0].lindex);
211 
212  IEnumFORMATETC_Release(fenum2);
213  }
214 
215  hres = IEnumFORMATETC_Next(fenum, 2, fetc, &ul);
216  ok(hres == S_OK, "Next failed: %08x\n", hres);
217  ok(fetc[0].lindex == 2, "fetc[0].lindex=%d, expected 2\n", fetc[0].lindex);
218 
219  hres = IEnumFORMATETC_Skip(fenum, 1);
220  ok(hres == S_OK, "Skip failed: %08x\n", hres);
221 
222  IEnumFORMATETC_Release(fenum);
223 }
#define E_FAIL
Definition: ddrawi.h:102
static int dev
Definition: mkdosfs.c:536
#define S_FALSE
Definition: winerror.h:2357
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
LONG HRESULT
Definition: typedefs.h:77
HRESULT hres
Definition: misc.c:479
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
HRESULT WINAPI CreateFormatEnumerator(UINT cfmtetc, FORMATETC *rgfmtetc, IEnumFORMATETC **ppenumfmtetc)
Definition: format.c:177
unsigned int ULONG
Definition: retypes.h:1
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by START_TEST().

◆ test_FindMimeFromData()

static void test_FindMimeFromData ( void  )
static

Definition at line 714 of file misc.c.

715 {
717  HRESULT hres;
718  BYTE b;
719  int i;
720 
721  static const WCHAR app_octet_streamW[] =
722  {'a','p','p','l','i','c','a','t','i','o','n','/','o','c','t','e','t','-','s','t','r','e','a','m',0};
723  static const WCHAR image_pjpegW[] = {'i','m','a','g','e','/','p','j','p','e','g',0};
724  static const WCHAR text_htmlW[] = {'t','e','x','t','/','h','t','m','l',0};
725  static const WCHAR text_plainW[] = {'t','e','x','t','/','p','l','a','i','n',0};
726 
727  for(i = 0; i < ARRAY_SIZE(mime_tests); i++) {
728  mime = (LPWSTR)0xf0f0f0f0;
729  url = a2w(mime_tests[i].url);
730  hres = pFindMimeFromData(NULL, url, NULL, 0, NULL, 0, &mime, 0);
731  if(mime_tests[i].mime) {
732  ok(hres == S_OK || broken(mime_tests[i].broken_failure), "[%d] FindMimeFromData failed: %08x\n", i, hres);
733  if(hres == S_OK) {
736  "[%d] wrong mime: %s\n", i, wine_dbgstr_w(mime));
738  }
739  }else {
740  ok(hres == E_FAIL || hres == mime_tests[i].hres,
741  "[%d] FindMimeFromData failed: %08x, expected %08x\n",
742  i, hres, mime_tests[i].hres);
743  ok(mime == (LPWSTR)0xf0f0f0f0, "[%d] mime != 0xf0f0f0f0\n", i);
744  }
745 
746  mime = (LPWSTR)0xf0f0f0f0;
747  hres = pFindMimeFromData(NULL, url, NULL, 0, text_plainW, 0, &mime, 0);
748  ok(hres == S_OK, "[%d] FindMimeFromData failed: %08x\n", i, hres);
749  ok(!strcmp_wa(mime, "text/plain"), "[%d] wrong mime: %s\n", i, wine_dbgstr_w(mime));
751 
752  mime = (LPWSTR)0xf0f0f0f0;
753  hres = pFindMimeFromData(NULL, url, NULL, 0, app_octet_streamW, 0, &mime, 0);
754  ok(hres == S_OK, "[%d] FindMimeFromData failed: %08x\n", i, hres);
755  ok(!strcmp_wa(mime, "application/octet-stream"), "[%d] wrong mime: %s\n", i, wine_dbgstr_w(mime));
757  heap_free(url);
758  }
759 
760  for(i = 0; i < ARRAY_SIZE(mime_tests2); i++) {
761  url = a2w(mime_tests2[i].url);
763  hres = pFindMimeFromData(NULL, url, mime_tests2[i].data, mime_tests2[i].size,
764  proposed_mime, 0, &mime, 0);
765  ok(hres == S_OK, "[%d] FindMimeFromData failed: %08x\n", i, hres);
768  "[%d] wrong mime: %s\n", i, wine_dbgstr_w(mime));
770  heap_free(url);
772  if(!b || url || proposed_mime)
773  continue;
774 
775  hres = pFindMimeFromData(NULL, NULL, mime_tests2[i].data, mime_tests2[i].size,
776  app_octet_streamW, 0, &mime, 0);
777  ok(hres == S_OK, "[%d] FindMimeFromData failed: %08x\n", i, hres);
780  "[%d] wrong mime: %s\n", i, wine_dbgstr_w(mime));
782 
783  hres = pFindMimeFromData(NULL, NULL, mime_tests2[i].data, mime_tests2[i].size,
784  text_plainW, 0, &mime, 0);
785  ok(hres == S_OK, "[%d] FindMimeFromData failed: %08x\n", i, hres);
788  "[%d] wrong mime: %s\n", i, wine_dbgstr_w(mime));
790 
791  hres = pFindMimeFromData(NULL, NULL, mime_tests2[i].data, mime_tests2[i].size,
792  text_htmlW, 0, &mime, 0);
793  ok(hres == S_OK, "[%d] FindMimeFromData failed: %08x\n", i, hres);
794  if(!strcmp("application/octet-stream", mime_tests2[i].mime)
795  || !strcmp("text/plain", mime_tests2[i].mime) || i==92)
796  ok(!strcmp_wa(mime, "text/html"), "[%d] wrong mime: %s\n", i, wine_dbgstr_w(mime));
797  else
798  ok(!strcmp_wa(mime, mime_tests2[i].mime), "[%d] wrong mime: %s\n", i, wine_dbgstr_w(mime));
800 
801  hres = pFindMimeFromData(NULL, NULL, mime_tests2[i].data, mime_tests2[i].size,
802  image_pjpegW, 0, &mime, 0);
803  ok(hres == S_OK, "[%d] FindMimeFromData failed: %08x\n", i, hres);
806  "[%d] wrong mime, got %s\n", i, wine_dbgstr_w(mime));
808  }
809 
810  hres = pFindMimeFromData(NULL, NULL, NULL, 0, NULL, 0, &mime, 0);
811  ok(hres == E_INVALIDARG, "FindMimeFromData failed: %08x, expected E_INVALIDARG\n", hres);
812 
813  hres = pFindMimeFromData(NULL, NULL, NULL, 0, text_plainW, 0, &mime, 0);
814  ok(hres == E_INVALIDARG, "FindMimeFromData failed: %08x, expected E_INVALIDARG\n", hres);
815 
816  hres = pFindMimeFromData(NULL, NULL, data1, 0, NULL, 0, &mime, 0);
817  ok(hres == E_FAIL, "FindMimeFromData failed: %08x, expected E_FAIL\n", hres);
818 
819  hres = pFindMimeFromData(NULL, url1, data1, 0, NULL, 0, &mime, 0);
820  ok(hres == E_FAIL, "FindMimeFromData failed: %08x, expected E_FAIL\n", hres);
821 
822  hres = pFindMimeFromData(NULL, NULL, data1, 0, text_plainW, 0, &mime, 0);
823  ok(hres == S_OK, "FindMimeFromData failed: %08x\n", hres);
824  ok(!strcmp_wa(mime, "text/plain"), "wrong mime: %s\n", wine_dbgstr_w(mime));
826 
827  hres = pFindMimeFromData(NULL, NULL, data1, 0, text_plainW, 0, NULL, 0);
828  ok(hres == E_INVALIDARG, "FindMimeFromData failed: %08x, expected E_INVALIDARG\n", hres);
829 }
static const WCHAR image_pjpegW[]
Definition: mimefilter.c:491
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:422
const char * broken_mime
Definition: misc.c:481
char * wine_dbgstr_w(const wchar_t *wstr)
Definition: atltest.h:87
const char * mime_pjpeg
Definition: misc.c:598
Definition: tftpd.h:125
#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
static const struct @1645 mime_tests[]
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
static WCHAR * a2w(const char *str)
Definition: misc.c:92
static const WCHAR url1[]
Definition: misc.c:298
#define b
Definition: ke_i.h:79
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
GLsizeiptr size
Definition: glext.h:5919
static const WCHAR text_htmlW[]
Definition: navigate.c:29
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
HRESULT hres
Definition: misc.c:479
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
const char * proposed_mime
Definition: misc.c:601
unsigned char BYTE
Definition: mem.h:68
const char * mime
Definition: misc.c:478
#define broken(x)
Definition: _sntprintf.h:21
static int strcmp_wa(const WCHAR *strw, const char *stra)
Definition: misc.c:85
BOOL broken_failure
Definition: misc.c:480
#define S_OK
Definition: intsafe.h:59
#define ARRAY_SIZE(a)
Definition: main.h:24
#define ok(value,...)
Definition: atltest.h:57
static LPWSTR
Definition: misc.c:35
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
static const struct @1646 mime_tests2[]
static const WCHAR text_plainW[]
Definition: mimefilter.c:507
WCHAR * LPWSTR
Definition: xmlstorage.h:184
static BOOL heap_free(void *mem)
Definition: appwiz.h:75
LPCWSTR url
Definition: misc.c:435

Referenced by START_TEST().

◆ test_internet_feature_defaults()

static void test_internet_feature_defaults ( void  )
static

Definition at line 1724 of file misc.c.

1724  {
1725  HRESULT hres;
1726  DWORD i;
1727 
1728  for(i = 0; i < ARRAY_SIZE(default_feature_tests); ++i) {
1729  hres = pCoInternetIsFeatureEnabled(default_feature_tests[i].feature, default_feature_tests[i].get_flags);
1731  ok(hres == default_feature_tests[i].expected, "CoInternetIsFeatureEnabled returned %08x, expected %08x on test %d\n",
1733  }
1734 }
INTERNETFEATURELIST feature
Definition: misc.c:1689
static const struct @1647 default_feature_tests[]
BOOL todo
Definition: misc.c:1692
HRESULT expected
Definition: misc.c:1691
DWORD get_flags
Definition: misc.c:1690
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 todo_wine_if(is_todo)
Definition: test.h:155
LONG HRESULT
Definition: typedefs.h:77
unsigned long DWORD
Definition: ntddk_ex.h:95
HRESULT hres
Definition: misc.c:479
#define ARRAY_SIZE(a)
Definition: main.h:24
#define ok(value,...)
Definition: atltest.h:57

Referenced by test_internet_features_registry().

◆ test_internet_features()

static void test_internet_features ( void  )
static

Definition at line 1890 of file misc.c.

1890  {
1891  HKEY key;
1892  DWORD res;
1893 
1894  if(!pCoInternetIsFeatureEnabled || !pCoInternetSetFeatureEnabled) {
1895  win_skip("Skipping internet feature tests, IE is too old\n");
1896  return;
1897  }
1898 
1899  /* IE10 takes FeatureControl key into account only if it's available upon process start. */
1901  if(res != ERROR_SUCCESS) {
1903  STARTUPINFOA si = { 0 };
1904  char cmdline[MAX_PATH];
1905  char **argv;
1906  BOOL ret;
1907 
1909  ok(res == ERROR_SUCCESS, "RegCreateKey failed: %d\n", res);
1910 
1911  trace("Running features tests in a separated process.\n");
1912 
1914  sprintf(cmdline, "\"%s\" %s internet_features", argv[0], argv[1]);
1915  ret = CreateProcessA(argv[0], cmdline, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi);
1916  ok(ret, "Could not create process: %u\n", GetLastError());
1917  winetest_wait_child_process( pi.hProcess );
1918  CloseHandle(pi.hThread);
1919  CloseHandle(pi.hProcess);
1920 
1922  return;
1923  }
1924 
1928 }
LONG WINAPI RegOpenKeyA(HKEY hKey, LPCSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:3257
#define CloseHandle
Definition: compat.h:398
#define ERROR_SUCCESS
Definition: deptool.c:10
static const char * szFeatureControlKey
Definition: misc.c:1744
#define HKEY_CURRENT_USER
Definition: winreg.h:11
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
TCHAR * cmdline
Definition: stretchblt.cpp:32
#define argv
Definition: mplay32.c:18
static void test_internet_features_registry(void)
Definition: misc.c:1746
#define sprintf(buf, format,...)
Definition: sprintf.c:55
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
LONG WINAPI RegCreateKeyA(HKEY hKey, LPCSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:1177
#define trace
Definition: atltest.h:70
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
unsigned long DWORD
Definition: ntddk_ex.h:95
int winetest_get_mainargs(char ***pargv)
static DWORD pi
Definition: protocol.c:150
int ret
HKEY key
Definition: reg.c:42
void winetest_wait_child_process(HANDLE process)
LONG WINAPI RegDeleteKeyA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey)
Definition: reg.c:1222
#define ok(value,...)
Definition: atltest.h:57
static void test_CoInternetIsFeatureEnabled(void)
Definition: misc.c:1846
static void test_CoInternetSetFeatureEnabled(void)
Definition: misc.c:1868
GLuint res
Definition: glext.h:9613
#define win_skip
Definition: test.h:141
Definition: path.c:42

Referenced by START_TEST().

◆ test_internet_features_registry()

static void test_internet_features_registry ( void  )
static

Definition at line 1746 of file misc.c.

1746  {
1747  HRESULT hres;
1748  DWORD res;
1749  char module[MAX_PATH];
1750  char *name;
1752  HKEY feature;
1753  DWORD value;
1754  BOOL skip_zone;
1755  BOOL delete_feature_key = TRUE;
1756 
1757  static const char* szFeatureBehaviorsKey = "FEATURE_BEHAVIORS";
1758  static const char* szFeatureZoneElevationKey = "FEATURE_ZONE_ELEVATION";
1759 
1760  if(!pIEInstallScope) {
1761  win_skip("Skipping internet feature registry tests, IE is too old...\n");
1762  return;
1763  }
1764 
1765  res = GetModuleFileNameA(NULL, module, sizeof(module));
1766  ok(res, "GetModuleFileName failed: %d\n", GetLastError());
1767 
1768  name = strrchr(module, '\\')+1;
1769 
1770  /* Some Windows machines don't have a FeatureControl key in HKCU. */
1772  ok(res == ERROR_SUCCESS, "RegCreateKey failed: %d\n", res);
1773 
1774  res = RegOpenKeyA(feature_control, szFeatureBehaviorsKey, &feature);
1775  if(res == ERROR_SUCCESS) {
1776  /* FEATURE_BEHAVIORS already existed, so don't delete it when we're done. */
1777  delete_feature_key = FALSE;
1778  }else {
1779  res = RegCreateKeyA(feature_control, szFeatureBehaviorsKey, &feature);
1780  ok(res == ERROR_SUCCESS, "RegCreateKey failed: %d\n", res);
1781  }
1782 
1783  value = 0;
1784  res = RegSetValueExA(feature, name, 0, REG_DWORD, (BYTE*)&value, sizeof(DWORD));
1785  ok(res == ERROR_SUCCESS, "RegSetValueEx failed: %d\n", res);
1786 
1787  hres = pCoInternetIsFeatureEnabled(FEATURE_BEHAVIORS, GET_FEATURE_FROM_PROCESS);
1788  ok(hres == S_FALSE, "CoInternetIsFeatureEnabled returned %08x, expected S_FALSE\n", hres);
1789 
1790  if(delete_feature_key) {
1792  RegDeleteKeyA(feature_control, szFeatureBehaviorsKey);
1793  } else {
1796  }
1797 
1798  /* IE's feature control cached the value it got from the registry earlier. */
1799  hres = pCoInternetIsFeatureEnabled(FEATURE_BEHAVIORS, GET_FEATURE_FROM_PROCESS);
1800  ok(hres == S_FALSE, "CoInternetIsFeatureEnabled returned %08x, expected S_FALSE\n", hres);
1801 
1802  /* Restore this feature back to its default value. */
1803  hres = pCoInternetSetFeatureEnabled(FEATURE_BEHAVIORS, SET_FEATURE_ON_PROCESS, TRUE);
1804  ok(hres == S_OK, "CoInternetSetFeatureEnabled failed: %08x\n", hres);
1805 
1807 
1809  ok(res == ERROR_SUCCESS, "RegOpenKey failed: %d\n", res);
1810 
1811  res = RegOpenKeyA(feature_control, szFeatureZoneElevationKey, &feature);
1812  ok(res == ERROR_SUCCESS, "RegOpenKey failed: %d\n", res);
1813 
1814  value = 1;
1815  res = RegSetValueExA(feature, "*", 0, REG_DWORD, (BYTE*)&value, sizeof(DWORD));
1816  if (res == ERROR_ACCESS_DENIED)
1817  {
1818  skip("Not allowed to modify zone elevation\n");
1819  skip_zone = TRUE;
1820  }
1821  else
1822  {
1823  skip_zone = FALSE;
1824  ok(res == ERROR_SUCCESS, "RegSetValueEx failed: %d\n", res);
1825 
1826  hres = pCoInternetIsFeatureEnabled(FEATURE_ZONE_ELEVATION, GET_FEATURE_FROM_PROCESS);
1827  ok(hres == S_OK, "CoInternetIsFeatureEnabled returned %08x, expected S_OK\n", hres);
1828  }
1829  RegDeleteValueA(feature, "*");
1832 
1833  /* Value is still cached from last time. */
1834  if (!skip_zone)
1835  {
1836  hres = pCoInternetIsFeatureEnabled(FEATURE_ZONE_ELEVATION, GET_FEATURE_FROM_PROCESS);
1837  ok(hres == S_OK, "CoInternetIsFeatureEnabled returned %08x, expected S_OK\n", hres);
1838 
1839  hres = pCoInternetSetFeatureEnabled(FEATURE_ZONE_ELEVATION, SET_FEATURE_ON_PROCESS, FALSE);
1840  ok(hres == S_OK, "CoInternetSetFeatureEnabled failed: %08x\n", hres);
1841  }
1842 
1844 }
INTERNETFEATURELIST feature
Definition: misc.c:1689
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
static const char * szFeatureControlKey
Definition: misc.c:1744
#define HKEY_CURRENT_USER
Definition: winreg.h:11
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
_Check_return_ _CRTIMP _CONST_RETURN char *__cdecl strrchr(_In_z_ const char *_Str, _In_ int _Ch)
DWORD WINAPI GetModuleFileNameA(HINSTANCE hModule, LPSTR lpFilename, DWORD nSize)
Definition: loader.c:548
static void test_internet_feature_defaults(void)
Definition: misc.c:1724
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
#define ERROR_ACCESS_DENIED
Definition: compat.h:87
unsigned int BOOL
Definition: ntddk_ex.h:94
#define S_FALSE
Definition: winerror.h:2357
smooth NULL
Definition: ftsmooth.c:416
LONG WINAPI RegCreateKeyA(HKEY hKey, LPCSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:1177
LONG HRESULT
Definition: typedefs.h:77
#define MAX_PATH
Definition: compat.h:26
unsigned long DWORD
Definition: ntddk_ex.h:95
HRESULT hres
Definition: misc.c:479
struct feature_control feature_control
unsigned char BYTE
Definition: mem.h:68
GLsizei const GLfloat * value
Definition: glext.h:6069
LONG WINAPI RegDeleteKeyA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey)
Definition: reg.c:1222
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
LONG WINAPI RegDeleteValueA(HKEY hKey, LPCSTR lpValueName)
Definition: reg.c:2319
#define skip(...)
Definition: atltest.h:64
Definition: name.c:36
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
#define win_skip
Definition: test.h:141
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
GLuint const GLchar * name
Definition: glext.h:6031

Referenced by test_internet_features().

◆ test_IsValidURL()

static void test_IsValidURL ( void  )
static

Definition at line 1669 of file misc.c.

1670 {
1671  HRESULT hr;
1672  IBindCtx *bctx = NULL;
1673 
1674  hr = IsValidURL(NULL, 0, 0);
1675  ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %08x\n", hr);
1676 
1678  ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
1679 
1680  CreateBindCtx(0, &bctx);
1681 
1682  hr = IsValidURL(bctx, wszHttpWineHQ, 0);
1683  ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
1684 
1685  IBindCtx_Release(bctx);
1686 }
HRESULT hr
Definition: shlfolder.c:183
static const WCHAR wszHttpWineHQ[]
Definition: misc.c:329
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
HRESULT WINAPI IsValidURL(LPBC pBC, LPCWSTR szURL, DWORD dwReserved)
Definition: urlmon_main.c:525
HRESULT WINAPI CreateBindCtx(DWORD reserved, LPBC *ppbc)
Definition: bindctx.c:556
LONG HRESULT
Definition: typedefs.h:77
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57

Referenced by START_TEST().

◆ test_MimeFilter()

static void test_MimeFilter ( void  )
static

Definition at line 1151 of file misc.c.

1152 {
1153  IInternetSession *session;
1154  HRESULT hres;
1155 
1156  static const WCHAR mimeW[] = {'t','e','s','t','/','m','i','m','e',0};
1157 
1158  hres = pCoInternetGetSession(0, &session, 0);
1159  ok(hres == S_OK, "CoInternetGetSession failed: %08x\n", hres);
1160  if(FAILED(hres))
1161  return;
1162 
1163  hres = IInternetSession_RegisterMimeFilter(session, &test_cf, &IID_NULL, mimeW);
1164  ok(hres == S_OK, "RegisterMimeFilter failed: %08x\n", hres);
1165 
1166  hres = IInternetSession_UnregisterMimeFilter(session, &test_cf, mimeW);
1167  ok(hres == S_OK, "UnregisterMimeFilter failed: %08x\n", hres);
1168 
1169  hres = IInternetSession_UnregisterMimeFilter(session, &test_cf, mimeW);
1170  ok(hres == S_OK, "UnregisterMimeFilter failed: %08x\n", hres);
1171 
1172  hres = IInternetSession_UnregisterMimeFilter(session, (void*)0xdeadbeef, mimeW);
1173  ok(hres == S_OK, "UnregisterMimeFilter failed: %08x\n", hres);
1174 
1175  IInternetSession_Release(session);
1176 }
static IClassFactory test_cf
Definition: misc.c:1000
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
HRESULT hres
Definition: misc.c:479
#define IID_NULL
Definition: guiddef.h:98
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57

Referenced by START_TEST().

◆ test_MkParseDisplayNameEx()

static void test_MkParseDisplayNameEx ( void  )
static

Definition at line 1579 of file misc.c.

1580 {
1581  IMoniker *mon = NULL;
1582  LPWSTR name;
1583  DWORD issys;
1584  ULONG eaten = 0;
1585  IBindCtx *bctx;
1586  HRESULT hres;
1587 
1588  static const WCHAR clsid_nameW[] = {'c','l','s','i','d',':',
1589  '2','0','D','0','4','F','E','0','-','3','A','E','A','-','1','0','6','9','-','A','2','D','8',
1590  '-','0','8','0','0','2','B','3','0','3','0','9','D',':',0};
1591 
1592  const struct
1593  {
1594  LPBC *ppbc;
1595  LPCWSTR szDisplayName;
1596  ULONG *pchEaten;
1597  LPMONIKER *ppmk;
1598  } invalid_parameters[] =
1599  {
1600  {NULL, NULL, NULL, NULL},
1601  {NULL, NULL, NULL, &mon},
1602  {NULL, NULL, &eaten, NULL},
1603  {NULL, NULL, &eaten, &mon},
1604  {NULL, wszEmpty, NULL, NULL},
1605  {NULL, wszEmpty, NULL, &mon},
1606  {NULL, wszEmpty, &eaten, NULL},
1607  {NULL, wszEmpty, &eaten, &mon},
1608  {&bctx, NULL, NULL, NULL},
1609  {&bctx, NULL, NULL, &mon},
1610  {&bctx, NULL, &eaten, NULL},
1611  {&bctx, NULL, &eaten, &mon},
1612  {&bctx, wszEmpty, NULL, NULL},
1613  {&bctx, wszEmpty, NULL, &mon},
1614  {&bctx, wszEmpty, &eaten, NULL},
1615  {&bctx, wszEmpty, &eaten, &mon},
1616  };
1617 
1618  int i;
1619 
1620  CreateBindCtx(0, &bctx);
1621 
1622  for (i = 0; i < ARRAY_SIZE(invalid_parameters); i++)
1623  {
1624  eaten = 0xdeadbeef;
1625  mon = (IMoniker *)0xdeadbeef;
1626  hres = MkParseDisplayNameEx(invalid_parameters[i].ppbc ? *invalid_parameters[i].ppbc : NULL,
1627  invalid_parameters[i].szDisplayName,
1628  invalid_parameters[i].pchEaten,
1629  invalid_parameters[i].ppmk);
1630  ok(hres == E_INVALIDARG,
1631  "[%d] Expected MkParseDisplayNameEx to return E_INVALIDARG, got %08x\n", i, hres);
1632  ok(eaten == 0xdeadbeef, "[%d] Expected eaten to be 0xdeadbeef, got %u\n", i, eaten);
1633  ok(mon == (IMoniker *)0xdeadbeef, "[%d] Expected mon to be 0xdeadbeef, got %p\n", i, mon);
1634  }
1635 
1636  hres = MkParseDisplayNameEx(bctx, url9, &eaten, &mon);
1637  ok(hres == S_OK, "MkParseDisplayNameEx failed: %08x\n", hres);
1638  ok(eaten == ARRAY_SIZE(url9)-1, "eaten=%d\n", eaten);
1639  ok(mon != NULL, "mon == NULL\n");
1640 
1641  hres = IMoniker_GetDisplayName(mon, NULL, 0, &name);
1642  ok(hres == S_OK, "GetDisplayName failed: %08x\n", hres);
1643  ok(!lstrcmpW(name, url9), "wrong display name %s\n", wine_dbgstr_w(name));
1645 
1646  hres = IMoniker_IsSystemMoniker(mon, &issys);
1647  ok(hres == S_OK, "IsSystemMoniker failed: %08x\n", hres);
1648  ok(issys == MKSYS_URLMONIKER, "issys=%x\n", issys);
1649 
1650  IMoniker_Release(mon);
1651 
1652  hres = MkParseDisplayNameEx(bctx, clsid_nameW, &eaten, &mon);
1653  ok(hres == S_OK, "MkParseDisplayNameEx failed: %08x\n", hres);
1654  ok(eaten == ARRAY_SIZE(clsid_nameW)-1, "eaten=%d\n", eaten);
1655  ok(mon != NULL, "mon == NULL\n");
1656 
1657  hres = IMoniker_IsSystemMoniker(mon, &issys);
1658  ok(hres == S_OK, "IsSystemMoniker failed: %08x\n", hres);
1659  ok(issys == MKSYS_CLASSMONIKER, "issys=%x\n", issys);
1660 
1661  IMoniker_Release(mon);
1662 
1663  hres = MkParseDisplayNameEx(bctx, url8, &eaten, &mon);
1664  ok(FAILED(hres), "MkParseDisplayNameEx succeeded: %08x\n", hres);
1665 
1666  IBindCtx_Release(bctx);
1667 }
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:422
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
interface IBindCtx * LPBC
Definition: objfwd.h:18
char * wine_dbgstr_w(const wchar_t *wstr)
Definition: atltest.h:87
int WINAPI lstrcmpW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:170
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 wszEmpty[]
Definition: misc.c:325
static const WCHAR url8[]
Definition: misc.c:309
HRESULT WINAPI MkParseDisplayNameEx(IBindCtx *pbc, LPCWSTR szDisplayName, ULONG *pchEaten, LPMONIKER *ppmk)
Definition: umon.c:795
HRESULT WINAPI CreateBindCtx(DWORD reserved, LPBC *ppbc)
Definition: bindctx.c:556
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
HRESULT hres
Definition: misc.c:479
unsigned long DWORD
Definition: ntddk_ex.h:95
interface IMoniker * LPMONIKER
Definition: objfwd.h:9
#define S_OK
Definition: intsafe.h:59
#define ARRAY_SIZE(a)
Definition: main.h:24
#define ok(value,...)
Definition: atltest.h:57
Definition: name.c:36
unsigned int ULONG
Definition: retypes.h:1
WCHAR * LPWSTR
Definition: xmlstorage.h:184
static const WCHAR url9[]
Definition: misc.c:310
GLuint const GLchar * name
Definition: glext.h:6031

Referenced by START_TEST().

◆ test_NameSpace()

static void test_NameSpace ( void  )
static

Definition at line 1002 of file misc.c.

1003 {
1004  IInternetSession *session;
1005  WCHAR buf[200];
1006  LPWSTR sec_url;
1007  DWORD size;
1008  HRESULT hres;
1009 
1010  static const WCHAR wszTest[] = {'t',