ReactOS 0.4.15-dev-5667-ged97270
ordinal.c File Reference
#include <stdio.h>
#include "wine/test.h"
#include "winbase.h"
#include "winerror.h"
#include "winuser.h"
#include "ole2.h"
#include "oaidl.h"
#include "ocidl.h"
#include "mlang.h"
#include "shlwapi.h"
#include "docobj.h"
#include "shobjidl.h"
#include "shlobj.h"
Include dependency graph for ordinal.c:

Go to the source code of this file.

Classes

struct  SHELL_USER_SID
 
struct  SHELL_USER_PERMISSION
 
struct  call_entry_t
 
struct  call_trace_t
 
struct  shared_struct
 
struct  _disp
 
struct  _contain
 
struct  _cntptn
 
struct  _enum
 
struct  _enumpt
 
struct  _propbag
 
struct  IOleCommandTargetImpl
 
struct  IServiceProviderImpl
 
struct  IProfferServiceImpl< T >
 

Macros

#define COBJMACROS
 
#define CONST_VTABLE
 
#define ok_trace(a, b)   ok_trace_(a, b, __LINE__)
 
#define MY_INHERITANCE   0xBE /* invalid value to proof behavior */
 
#define UNICODE_LTR_MARK   0x200e
 
#define UNICODE_RTL_MARK   0x200f
 
#define verify_inifile(f, e)   r_verify_inifile(__LINE__, f, e)
 
#define MAKEFUNC(f, ord)   (p##f = (void*)GetProcAddress(hShlwapi, (LPSTR)(ord)))
 

Typedefs

typedef struct SHELL_USER_SID SHELL_USER_SID
 
typedef struct SHELL_USER_SIDPSHELL_USER_SID
 
typedef struct SHELL_USER_PERMISSION SHELL_USER_PERMISSION
 
typedef struct SHELL_USER_PERMISSIONPSHELL_USER_PERMISSION
 
typedef struct _disp Disp
 
typedef struct _contain Contain
 
typedef struct _cntptn ConPt
 
typedef struct _enum EnumCon
 
typedef struct _enumpt EnumPt
 
typedef struct _propbag PropBag
 

Enumerations

enum  _shellkey_flags {
  SHKEY_Root_HKCU = 0x1 , SHKEY_Root_HKLM = 0x2 , SHKEY_Key_Explorer = 0x00 , SHKEY_Key_Shell = 0x10 ,
  SHKEY_Key_ShellNoRoam = 0x20 , SHKEY_Key_Classes = 0x30 , SHKEY_Subkey_Default = 0x0000 , SHKEY_Subkey_ResourceName = 0x1000 ,
  SHKEY_Subkey_Handlers = 0x2000 , SHKEY_Subkey_Associations = 0x3000 , SHKEY_Subkey_Volatile = 0x4000 , SHKEY_Subkey_MUICache = 0x5000 ,
  SHKEY_Subkey_FileExts = 0x6000
}
 

Functions

static int (WINAPI *pSHSearchMapInt)(const int *
 
static HRESULT (WINAPI *pGetAcceptLanguagesA)(LPSTR
 
static HANDLE (WINAPI *pSHAllocShared)(LPCVOID
 
static LPVOID (WINAPI *pSHLockShared)(HANDLE
 
static BOOL (WINAPI *pSHUnlockShared)(LPVOID)
 
static HRESULT (WINAPIV *pSHPackDispParams)(DISPPARAMS *
 
static LONG (WINAPI *pSHSetWindowBits)(HWND
 
static INT (WINAPI *pSHFormatDateTimeA)(const FILETIME UNALIGNED *
 
static DWORD (WINAPI *pSHGetObjectCompatFlags)(IUnknown *
 
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HWND (WINAPI *pSHCreateWorkerWindowA)(LONG
 
static HKEY (WINAPI *pSHGetShellKey)(DWORD
 
static SECURITY_DESCRIPTOR *WINAPIpGetShellSecurityDescriptor (const SHELL_USER_PERMISSION **, int)
 
static int strcmp_wa (LPCWSTR strw, const char *stra)
 
static void init_call_trace (call_trace_t *ctrace)
 
static void free_call_trace (const call_trace_t *ctrace)
 
static void add_call (call_trace_t *ctrace, int id, const void *arg0, const void *arg1, const void *arg2, const void *arg3, const void *arg4)
 
static void ok_trace_ (call_trace_t *texpected, call_trace_t *tgot, int line)
 
static void test_GetAcceptLanguagesA (void)
 
static void test_SHSearchMapInt (void)
 
static void test_alloc_shared (int argc, char **argv)
 
static void test_alloc_shared_remote (DWORD procid, HANDLE hmem)
 
static void test_fdsa (void)
 
static void test_GetShellSecurityDescriptor (void)
 
static void test_SHPackDispParams (void)
 
static Dispimpl_from_IDispatch (IDispatch *iface)
 
static Containimpl_from_IConnectionPointContainer (IConnectionPointContainer *iface)
 
static ConPtimpl_from_IConnectionPoint (IConnectionPoint *iface)
 
static EnumConimpl_from_IEnumConnections (IEnumConnections *iface)
 
static EnumPtimpl_from_IEnumConnectionPoints (IEnumConnectionPoints *iface)
 
static HRESULT WINAPI Disp_QueryInterface (IDispatch *This, REFIID riid, void **ppvObject)
 
static ULONG WINAPI Disp_AddRef (IDispatch *This)
 
static ULONG WINAPI Disp_Release (IDispatch *This)
 
static HRESULT WINAPI Disp_GetTypeInfoCount (IDispatch *This, UINT *pctinfo)
 
static HRESULT WINAPI Disp_GetTypeInfo (IDispatch *This, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
 
static HRESULT WINAPI Disp_GetIDsOfNames (IDispatch *This, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
 
static HRESULT WINAPI Disp_Invoke (IDispatch *This, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
 
static HRESULT WINAPI Enum_QueryInterface (IEnumConnections *This, REFIID riid, void **ppvObject)
 
static ULONG WINAPI Enum_AddRef (IEnumConnections *This)
 
static ULONG WINAPI Enum_Release (IEnumConnections *This)
 
static HRESULT WINAPI Enum_Next (IEnumConnections *This, ULONG cConnections, LPCONNECTDATA rgcd, ULONG *pcFetched)
 
static HRESULT WINAPI Enum_Skip (IEnumConnections *This, ULONG cConnections)
 
static HRESULT WINAPI Enum_Reset (IEnumConnections *This)
 
static HRESULT WINAPI Enum_Clone (IEnumConnections *This, IEnumConnections **ppEnum)
 
static HRESULT WINAPI ConPt_QueryInterface (IConnectionPoint *This, REFIID riid, void **ppvObject)
 
static ULONG WINAPI ConPt_AddRef (IConnectionPoint *This)
 
static ULONG WINAPI ConPt_Release (IConnectionPoint *This)
 
static HRESULT WINAPI ConPt_GetConnectionInterface (IConnectionPoint *This, IID *pIID)
 
static HRESULT WINAPI ConPt_GetConnectionPointContainer (IConnectionPoint *This, IConnectionPointContainer **ppCPC)
 
static HRESULT WINAPI ConPt_Advise (IConnectionPoint *This, IUnknown *pUnkSink, DWORD *pdwCookie)
 
static HRESULT WINAPI ConPt_Unadvise (IConnectionPoint *This, DWORD dwCookie)
 
static HRESULT WINAPI ConPt_EnumConnections (IConnectionPoint *This, IEnumConnections **ppEnum)
 
static HRESULT WINAPI EnumPt_QueryInterface (IEnumConnectionPoints *This, REFIID riid, void **ppvObject)
 
static ULONG WINAPI EnumPt_AddRef (IEnumConnectionPoints *This)
 
static ULONG WINAPI EnumPt_Release (IEnumConnectionPoints *This)
 
static HRESULT WINAPI EnumPt_Next (IEnumConnectionPoints *This, ULONG cConnections, IConnectionPoint **rgcd, ULONG *pcFetched)
 
static HRESULT WINAPI EnumPt_Skip (IEnumConnectionPoints *This, ULONG cConnections)
 
static HRESULT WINAPI EnumPt_Reset (IEnumConnectionPoints *This)
 
static HRESULT WINAPI EnumPt_Clone (IEnumConnectionPoints *This, IEnumConnectionPoints **ppEnumPt)
 
static HRESULT WINAPI Contain_QueryInterface (IConnectionPointContainer *This, REFIID riid, void **ppvObject)
 
static ULONG WINAPI Contain_AddRef (IConnectionPointContainer *This)
 
static ULONG WINAPI Contain_Release (IConnectionPointContainer *This)
 
static HRESULT WINAPI Contain_EnumConnectionPoints (IConnectionPointContainer *This, IEnumConnectionPoints **ppEnum)
 
static HRESULT WINAPI Contain_FindConnectionPoint (IConnectionPointContainer *This, REFIID riid, IConnectionPoint **ppCP)
 
static void test_IConnectionPoint (void)
 
static PropBagimpl_from_IPropertyBag (IPropertyBag *iface)
 
static HRESULT WINAPI Prop_QueryInterface (IPropertyBag *This, REFIID riid, void **ppvObject)
 
static ULONG WINAPI Prop_AddRef (IPropertyBag *This)
 
static ULONG WINAPI Prop_Release (IPropertyBag *This)
 
static HRESULT WINAPI Prop_Read (IPropertyBag *This, LPCOLESTR pszPropName, VARIANT *pVar, IErrorLog *pErrorLog)
 
static HRESULT WINAPI Prop_Write (IPropertyBag *This, LPCOLESTR pszPropName, VARIANT *pVar)
 
static void test_SHPropertyBag_ReadLONG (void)
 
static void test_SHSetWindowBits (void)
 
static void test_SHFormatDateTimeA (void)
 
static void test_SHFormatDateTimeW (void)
 
static void test_SHGetObjectCompatFlags (void)
 
static IOleCommandTargetImplimpl_from_IOleCommandTarget (IOleCommandTarget *iface)
 
static IOleCommandTargetIOleCommandTargetImpl_Construct (void)
 
static HRESULT WINAPI IOleCommandTargetImpl_QueryInterface (IOleCommandTarget *iface, REFIID riid, void **ppvObj)
 
static ULONG WINAPI IOleCommandTargetImpl_AddRef (IOleCommandTarget *iface)
 
static ULONG WINAPI IOleCommandTargetImpl_Release (IOleCommandTarget *iface)
 
static HRESULT WINAPI IOleCommandTargetImpl_QueryStatus (IOleCommandTarget *iface, const GUID *group, ULONG cCmds, OLECMD prgCmds[], OLECMDTEXT *pCmdText)
 
static HRESULT WINAPI IOleCommandTargetImpl_Exec (IOleCommandTarget *iface, const GUID *CmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
 
static IServiceProviderImplimpl_from_IServiceProvider (IServiceProvider *iface)
 
static IProfferServiceImplimpl_from_IProfferService (IProfferService *iface)
 
static IServiceProviderIServiceProviderImpl_Construct (void)
 
static IProfferServiceIProfferServiceImpl_Construct (void)
 
static HRESULT WINAPI IServiceProviderImpl_QueryInterface (IServiceProvider *iface, REFIID riid, void **ppvObj)
 
static ULONG WINAPI IServiceProviderImpl_AddRef (IServiceProvider *iface)
 
static ULONG WINAPI IServiceProviderImpl_Release (IServiceProvider *iface)
 
static HRESULT WINAPI IServiceProviderImpl_QueryService (IServiceProvider *iface, REFGUID service, REFIID riid, void **ppv)
 
static void test_IUnknown_QueryServiceExec (void)
 
static HRESULT WINAPI IProfferServiceImpl_QueryInterface (IProfferService *iface, REFIID riid, void **ppvObj)
 
static ULONG WINAPI IProfferServiceImpl_AddRef (IProfferService *iface)
 
static ULONG WINAPI IProfferServiceImpl_Release (IProfferService *iface)
 
static HRESULT WINAPI IProfferServiceImpl_ProfferService (IProfferService *iface, REFGUID service, IServiceProvider *pService, DWORD *pCookie)
 
static HRESULT WINAPI IProfferServiceImpl_RevokeService (IProfferService *iface, DWORD cookie)
 
static void test_IUnknown_ProfferService (void)
 
static void test_SHCreateWorkerWindowA (void)
 
static HRESULT WINAPI SF_QueryInterface (IShellFolder *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI SF_AddRef (IShellFolder *iface)
 
static ULONG WINAPI SF_Release (IShellFolder *iface)
 
static HRESULT WINAPI SF_ParseDisplayName (IShellFolder *iface, HWND owner, LPBC reserved, LPOLESTR displayName, ULONG *eaten, LPITEMIDLIST *idl, ULONG *attr)
 
static HRESULT WINAPI SF_EnumObjects (IShellFolder *iface, HWND owner, SHCONTF flags, IEnumIDList **enm)
 
static HRESULT WINAPI SF_BindToObject (IShellFolder *iface, LPCITEMIDLIST idl, LPBC reserved, REFIID riid, void **obj)
 
static HRESULT WINAPI SF_BindToStorage (IShellFolder *iface, LPCITEMIDLIST idl, LPBC reserved, REFIID riid, void **obj)
 
static HRESULT WINAPI SF_CompareIDs (IShellFolder *iface, LPARAM lparam, LPCITEMIDLIST idl1, LPCITEMIDLIST idl2)
 
static HRESULT WINAPI SF_CreateViewObject (IShellFolder *iface, HWND owner, REFIID riid, void **out)
 
static HRESULT WINAPI SF_GetAttributesOf (IShellFolder *iface, UINT cidl, LPCITEMIDLIST *idl, SFGAOF *inOut)
 
static HRESULT WINAPI SF_GetUIObjectOf (IShellFolder *iface, HWND owner, UINT cidl, LPCITEMIDLIST *idls, REFIID riid, UINT *inOut, void **out)
 
static HRESULT WINAPI SF_GetDisplayNameOf (IShellFolder *iface, LPCITEMIDLIST idl, SHGDNF flags, STRRET *name)
 
static HRESULT WINAPI SF_SetNameOf (IShellFolder *iface, HWND hwnd, LPCITEMIDLIST idl, LPCOLESTR name, SHGDNF flags, LPITEMIDLIST *idlOut)
 
static void test_SHIShellFolder_EnumObjects (void)
 
static BOOL write_inifile (LPCWSTR filename)
 
static void r_verify_inifile (unsigned l, LPCWSTR filename, LPCSTR exp)
 
static void test_SHGetIniString (void)
 
static void test_SHSetIniString (void)
 
static void test_SHGetShellKey (void)
 
static void init_pointers (void)
 
static void test_SHSetParentHwnd (void)
 
static HRESULT WINAPI testpersist_QI (IPersist *iface, REFIID riid, void **obj)
 
static HRESULT WINAPI testpersist_QI2 (IPersist *iface, REFIID riid, void **obj)
 
static ULONG WINAPI testpersist_AddRef (IPersist *iface)
 
static ULONG WINAPI testpersist_Release (IPersist *iface)
 
static HRESULT WINAPI testpersist_GetClassID (IPersist *iface, CLSID *clsid)
 
static void test_IUnknown_GetClassID (void)
 
static void test_DllGetVersion (void)
 
 START_TEST (ordinal)
 

Variables

static HMODULE hShlwapi
 
static const int int
 
static LPDWORD
 
static DWORD
 
static VARIANTARG UINT
 
static VARIANTARG static DISPID
 
static REFIID
 
static BOOL
 
static IUnknown IConnectionPoint **static LPCWSTR
 
static IUnknown IConnectionPoint **static LPLONG
 
static INT
 
static DWORD LPSTR
 
static DWORD LPWSTR
 
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static REFGUID
 
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HWND
 
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
 
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static LONG_PTR
 
static SHCONTF
 
static const CHAR ie_international []
 
static const CHAR acceptlanguage []
 
static call_trace_t trace_got
 
static const IDispatchVtbl disp_vtbl
 
static const IEnumConnectionsVtbl enum_vtbl
 
static const IConnectionPointVtbl point_vtbl
 
static const IEnumConnectionPointsVtbl enumpt_vtbl
 
static const IConnectionPointContainerVtbl contain_vtbl
 
static const IPropertyBagVtbl prop_vtbl
 
static const IOleCommandTargetVtbl IOleCommandTargetImpl_Vtbl
 
static const IServiceProviderVtbl IServiceProviderImpl_Vtbl
 
static const IProfferServiceVtbl IProfferServiceImpl_Vtbl
 
static IShellFolderVtbl ShellFolderVtbl
 
static IShellFolder ShellFolder = { &ShellFolderVtbl }
 
static IPersistVtbl testpersistvtbl
 
static IPersistVtbl testpersist2vtbl
 
static IPersist testpersist = { &testpersistvtbl }
 
static IPersist testpersist2 = { &testpersist2vtbl }
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 22 of file ordinal.c.

◆ CONST_VTABLE

#define CONST_VTABLE

Definition at line 23 of file ordinal.c.

◆ MAKEFUNC

#define MAKEFUNC (   f,
  ord 
)    (p##f = (void*)GetProcAddress(hShlwapi, (LPSTR)(ord)))

◆ MY_INHERITANCE

#define MY_INHERITANCE   0xBE /* invalid value to proof behavior */

◆ ok_trace

#define ok_trace (   a,
  b 
)    ok_trace_(a, b, __LINE__)

Definition at line 174 of file ordinal.c.

◆ UNICODE_LTR_MARK

#define UNICODE_LTR_MARK   0x200e

◆ UNICODE_RTL_MARK

#define UNICODE_RTL_MARK   0x200f

◆ verify_inifile

#define verify_inifile (   f,
  e 
)    r_verify_inifile(__LINE__, f, e)

Definition at line 2693 of file ordinal.c.

Typedef Documentation

◆ ConPt

typedef struct _cntptn ConPt

◆ Contain

◆ Disp

typedef struct _disp Disp

◆ EnumCon

typedef struct _enum EnumCon

◆ EnumPt

◆ PropBag

◆ PSHELL_USER_PERMISSION

◆ PSHELL_USER_SID

◆ SHELL_USER_PERMISSION

◆ SHELL_USER_SID

Enumeration Type Documentation

◆ _shellkey_flags

Enumerator
SHKEY_Root_HKCU 
SHKEY_Root_HKLM 
SHKEY_Key_Explorer 
SHKEY_Key_Shell 
SHKEY_Key_ShellNoRoam 
SHKEY_Key_Classes 
SHKEY_Subkey_Default 
SHKEY_Subkey_ResourceName 
SHKEY_Subkey_Handlers 
SHKEY_Subkey_Associations 
SHKEY_Subkey_Volatile 
SHKEY_Subkey_MUICache 
SHKEY_Subkey_FileExts 

Definition at line 2799 of file ordinal.c.

2799 {
2800 SHKEY_Root_HKCU = 0x1,
2801 SHKEY_Root_HKLM = 0x2,
2802 SHKEY_Key_Explorer = 0x00,
2803 SHKEY_Key_Shell = 0x10,
2804 SHKEY_Key_ShellNoRoam = 0x20,
2805 SHKEY_Key_Classes = 0x30,
2806 SHKEY_Subkey_Default = 0x0000,
2808 SHKEY_Subkey_Handlers = 0x2000,
2810 SHKEY_Subkey_Volatile = 0x4000,
2811 SHKEY_Subkey_MUICache = 0x5000,
2812 SHKEY_Subkey_FileExts = 0x6000
2813};
@ SHKEY_Subkey_Handlers
Definition: ordinal.c:2808
@ SHKEY_Root_HKLM
Definition: ordinal.c:2801
@ SHKEY_Key_ShellNoRoam
Definition: ordinal.c:2804
@ SHKEY_Subkey_Volatile
Definition: ordinal.c:2810
@ SHKEY_Subkey_Associations
Definition: ordinal.c:2809
@ SHKEY_Key_Classes
Definition: ordinal.c:2805
@ SHKEY_Subkey_MUICache
Definition: ordinal.c:2811
@ SHKEY_Key_Explorer
Definition: ordinal.c:2802
@ SHKEY_Root_HKCU
Definition: ordinal.c:2800
@ SHKEY_Subkey_FileExts
Definition: ordinal.c:2812
@ SHKEY_Key_Shell
Definition: ordinal.c:2803
@ SHKEY_Subkey_Default
Definition: ordinal.c:2806
@ SHKEY_Subkey_ResourceName
Definition: ordinal.c:2807

Function Documentation

◆ add_call()

static void add_call ( call_trace_t ctrace,
int  id,
const void arg0,
const void arg1,
const void arg2,
const void arg3,
const void arg4 
)
static

Definition at line 128 of file ordinal.c.

130{
131 call_entry_t call;
132
133 call.id = id;
134 call.args[0] = arg0;
135 call.args[1] = arg1;
136 call.args[2] = arg2;
137 call.args[3] = arg3;
138 call.args[4] = arg4;
139
140 if (ctrace->count == ctrace->alloc)
141 {
142 ctrace->alloc *= 2;
143 ctrace->calls = HeapReAlloc(GetProcessHeap(),0, ctrace->calls, ctrace->alloc*sizeof(call_entry_t));
144 }
145
146 ctrace->calls[ctrace->count++] = call;
147}
#define GetProcessHeap()
Definition: compat.h:736
#define HeapReAlloc
Definition: compat.h:734
GLuint GLuint GLuint GLuint arg1
Definition: glext.h:9513
GLuint GLuint GLuint GLuint GLuint GLuint GLuint GLuint GLuint GLuint arg3
Definition: glext.h:9515
GLuint GLuint GLuint GLuint GLuint GLuint GLuint arg2
Definition: glext.h:9514
GLuint id
Definition: glext.h:5910
Definition: ordinal.c:105
int id
Definition: ordinal.c:106
const void * args[5]
Definition: ordinal.c:107
call_entry_t * calls
Definition: ordinal.c:111

Referenced by IOleCommandTargetImpl_Exec(), IProfferServiceImpl_ProfferService(), IProfferServiceImpl_QueryInterface(), IProfferServiceImpl_RevokeService(), IServiceProviderImpl_QueryInterface(), IServiceProviderImpl_QueryService(), test_IUnknown_ProfferService(), and test_IUnknown_QueryServiceExec().

◆ BOOL()

static BOOL ( WINAPI pSHUnlockShared)
static

◆ ConPt_AddRef()

static ULONG WINAPI ConPt_AddRef ( IConnectionPoint This)
static

Definition at line 1127 of file ordinal.c.

1129{
1131 return InterlockedIncrement(&iface->refCount);
1132}
#define InterlockedIncrement
Definition: armddk.h:53
static ConPt * impl_from_IConnectionPoint(IConnectionPoint *iface)
Definition: ordinal.c:863
LONG refCount
Definition: ordinal.c:855

◆ ConPt_Advise()

static HRESULT WINAPI ConPt_Advise ( IConnectionPoint This,
IUnknown pUnkSink,
DWORD pdwCookie 
)
static

Definition at line 1184 of file ordinal.c.

1188{
1190
1191 if (iface->sinkCount == 0)
1192 iface->sink = HeapAlloc(GetProcessHeap(),0,sizeof(IUnknown*));
1193 else
1194 iface->sink = HeapReAlloc(GetProcessHeap(),0,iface->sink,sizeof(IUnknown*)*(iface->sinkCount+1));
1195 iface->sink[iface->sinkCount] = pUnkSink;
1196 IUnknown_AddRef(pUnkSink);
1197 iface->sinkCount++;
1198 *pdwCookie = iface->sinkCount;
1199 return S_OK;
1200}
#define HeapAlloc
Definition: compat.h:733
#define S_OK
Definition: intsafe.h:52
IUnknown ** sink
Definition: ordinal.c:860
UINT sinkCount
Definition: ordinal.c:859

◆ ConPt_EnumConnections()

static HRESULT WINAPI ConPt_EnumConnections ( IConnectionPoint This,
IEnumConnections **  ppEnum 
)
static

Definition at line 1218 of file ordinal.c.

1221{
1222 EnumCon *ec;
1223
1224 ec = HeapAlloc(GetProcessHeap(),0,sizeof(EnumCon));
1225 ec->IEnumConnections_iface.lpVtbl = &enum_vtbl;
1226 ec->refCount = 1;
1228 ec->idx = 0;
1229 *ppEnum = &ec->IEnumConnections_iface;
1230
1231 return S_OK;
1232}
static const IEnumConnectionsVtbl enum_vtbl
Definition: ordinal.c:1094
Definition: ordinal.c:869
IEnumConnections IEnumConnections_iface
Definition: ordinal.c:870
ConPt * pt
Definition: ordinal.c:874
UINT idx
Definition: ordinal.c:873
LONG refCount
Definition: ordinal.c:871

◆ ConPt_GetConnectionInterface()

static HRESULT WINAPI ConPt_GetConnectionInterface ( IConnectionPoint This,
IID pIID 
)
static

Definition at line 1158 of file ordinal.c.

1161{
1162 static int i = 0;
1164 if (i==0)
1165 {
1166 i++;
1167 return E_FAIL;
1168 }
1169 else
1170 memcpy(pIID,&iface->id,sizeof(GUID));
1171 return S_OK;
1172}
#define E_FAIL
Definition: ddrawi.h:102
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GUID id
Definition: ordinal.c:858

◆ ConPt_GetConnectionPointContainer()

static HRESULT WINAPI ConPt_GetConnectionPointContainer ( IConnectionPoint This,
IConnectionPointContainer **  ppCPC 
)
static

Definition at line 1174 of file ordinal.c.

1177{
1179
1181 return S_OK;
1182}
Contain * container
Definition: ordinal.c:857
IConnectionPointContainer IConnectionPointContainer_iface
Definition: ordinal.c:840

◆ ConPt_QueryInterface()

static HRESULT WINAPI ConPt_QueryInterface ( IConnectionPoint This,
REFIID  riid,
void **  ppvObject 
)
static

Definition at line 1105 of file ordinal.c.

1109{
1110 *ppvObject = NULL;
1111
1113 {
1114 *ppvObject = This;
1115 }
1116
1117 if (*ppvObject)
1118 {
1119 IConnectionPoint_AddRef(This);
1120 return S_OK;
1121 }
1122
1123 trace("no interface\n");
1124 return E_NOINTERFACE;
1125}
#define trace
Definition: atltest.h:70
const GUID IID_IUnknown
#define NULL
Definition: types.h:112
REFIID riid
Definition: atlbase.h:39
const GUID IID_IConnectionPoint
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
_In_ void _In_ PCCERT_CONTEXT _In_opt_ LPFILETIME _In_ DWORD _In_ DWORD _Outptr_opt_ void ** ppvObject
Definition: wincrypt.h:6082
#define E_NOINTERFACE
Definition: winerror.h:2364

◆ ConPt_Release()

static ULONG WINAPI ConPt_Release ( IConnectionPoint This)
static

Definition at line 1134 of file ordinal.c.

1136{
1138 ULONG ret;
1139
1141 if (ret == 0)
1142 {
1143 if (iface->sinkCount > 0)
1144 {
1145 int i;
1146 for (i = 0; i < iface->sinkCount; i++)
1147 {
1148 if (iface->sink[i])
1149 IUnknown_Release(iface->sink[i]);
1150 }
1151 HeapFree(GetProcessHeap(),0,iface->sink);
1152 }
1154 }
1155 return ret;
1156}
#define InterlockedDecrement
Definition: armddk.h:52
#define HeapFree(x, y, z)
Definition: compat.h:735
uint32_t ULONG
Definition: typedefs.h:59
int ret

◆ ConPt_Unadvise()

static HRESULT WINAPI ConPt_Unadvise ( IConnectionPoint This,
DWORD  dwCookie 
)
static

Definition at line 1202 of file ordinal.c.

1205{
1207
1208 if (dwCookie > iface->sinkCount)
1209 return E_FAIL;
1210 else
1211 {
1212 IUnknown_Release(iface->sink[dwCookie-1]);
1213 iface->sink[dwCookie-1] = NULL;
1214 }
1215 return S_OK;
1216}

◆ Contain_AddRef()

static ULONG WINAPI Contain_AddRef ( IConnectionPointContainer This)
static

Definition at line 1359 of file ordinal.c.

1361{
1363 return InterlockedIncrement(&iface->refCount);
1364}
static Contain * impl_from_IConnectionPointContainer(IConnectionPointContainer *iface)
Definition: ordinal.c:847
LONG refCount
Definition: ordinal.c:841

◆ Contain_EnumConnectionPoints()

static HRESULT WINAPI Contain_EnumConnectionPoints ( IConnectionPointContainer This,
IEnumConnectionPoints **  ppEnum 
)
static

Definition at line 1387 of file ordinal.c.

1390{
1391 EnumPt *ec;
1392
1393 ec = HeapAlloc(GetProcessHeap(),0,sizeof(EnumPt));
1395 ec->refCount = 1;
1396 ec->idx= 0;
1398 *ppEnum = &ec->IEnumConnectionPoints_iface;
1399
1400 return S_OK;
1401}
static const IEnumConnectionPointsVtbl enumpt_vtbl
Definition: ordinal.c:1326
LONG refCount
Definition: ordinal.c:885
int idx
Definition: ordinal.c:887
IEnumConnectionPoints IEnumConnectionPoints_iface
Definition: ordinal.c:884
Contain * container
Definition: ordinal.c:888

◆ Contain_FindConnectionPoint()

static HRESULT WINAPI Contain_FindConnectionPoint ( IConnectionPointContainer This,
REFIID  riid,
IConnectionPoint **  ppCP 
)
static

Definition at line 1403 of file ordinal.c.

1407{
1409 ConPt *pt;
1410
1411 if (!IsEqualIID(riid, &IID_NULL) || iface->ptCount ==0)
1412 {
1413 pt = HeapAlloc(GetProcessHeap(),0,sizeof(ConPt));
1414 pt->IConnectionPoint_iface.lpVtbl = &point_vtbl;
1415 pt->refCount = 1;
1416 pt->sinkCount = 0;
1417 pt->sink = NULL;
1418 pt->container = iface;
1419 pt->id = IID_IDispatch;
1420
1421 if (iface->ptCount == 0)
1422 iface->pt =HeapAlloc(GetProcessHeap(),0,sizeof(IUnknown*));
1423 else
1424 iface->pt = HeapReAlloc(GetProcessHeap(),0,iface->pt,sizeof(IUnknown*)*(iface->ptCount+1));
1425 iface->pt[iface->ptCount] = &pt->IConnectionPoint_iface;
1426 iface->ptCount++;
1427
1428 *ppCP = &pt->IConnectionPoint_iface;
1429 }
1430 else
1431 {
1432 *ppCP = iface->pt[0];
1433 IUnknown_AddRef((IUnknown*)*ppCP);
1434 }
1435
1436 return S_OK;
1437}
#define pt(x, y)
Definition: drawing.c:79
static const IConnectionPointVtbl point_vtbl
Definition: ordinal.c:1234
const GUID IID_IDispatch
#define IID_NULL
Definition: guiddef.h:98
UINT ptCount
Definition: ordinal.c:843
IConnectionPoint ** pt
Definition: ordinal.c:844

◆ Contain_QueryInterface()

static HRESULT WINAPI Contain_QueryInterface ( IConnectionPointContainer This,
REFIID  riid,
void **  ppvObject 
)
static

Definition at line 1337 of file ordinal.c.

1341{
1342 *ppvObject = NULL;
1343
1345 {
1346 *ppvObject = This;
1347 }
1348
1349 if (*ppvObject)
1350 {
1351 IConnectionPointContainer_AddRef(This);
1352 return S_OK;
1353 }
1354
1355 trace("no interface\n");
1356 return E_NOINTERFACE;
1357}
const GUID IID_IConnectionPointContainer

◆ Contain_Release()

static ULONG WINAPI Contain_Release ( IConnectionPointContainer This)
static

Definition at line 1366 of file ordinal.c.

1368{
1370 ULONG ret;
1371
1373 if (ret == 0)
1374 {
1375 if (iface->ptCount > 0)
1376 {
1377 int i;
1378 for (i = 0; i < iface->ptCount; i++)
1379 IConnectionPoint_Release(iface->pt[i]);
1380 HeapFree(GetProcessHeap(),0,iface->pt);
1381 }
1383 }
1384 return ret;
1385}

◆ Disp_AddRef()

static ULONG WINAPI Disp_AddRef ( IDispatch This)
static

Definition at line 919 of file ordinal.c.

920{
921 Disp *iface = impl_from_IDispatch(This);
922 return InterlockedIncrement(&iface->refCount);
923}
static Disp * impl_from_IDispatch(IDispatch *iface)
Definition: ordinal.c:833
Definition: ordinal.c:828
LONG refCount
Definition: ordinal.c:830

◆ Disp_GetIDsOfNames()

static HRESULT WINAPI Disp_GetIDsOfNames ( IDispatch This,
REFIID  riid,
LPOLESTR rgszNames,
UINT  cNames,
LCID  lcid,
DISPID rgDispId 
)
static

Definition at line 952 of file ordinal.c.

959{
960 return ERROR_SUCCESS;
961}
#define ERROR_SUCCESS
Definition: deptool.c:10

◆ Disp_GetTypeInfo()

static HRESULT WINAPI Disp_GetTypeInfo ( IDispatch This,
UINT  iTInfo,
LCID  lcid,
ITypeInfo **  ppTInfo 
)
static

Definition at line 943 of file ordinal.c.

948{
949 return ERROR_SUCCESS;
950}

◆ Disp_GetTypeInfoCount()

static HRESULT WINAPI Disp_GetTypeInfoCount ( IDispatch This,
UINT pctinfo 
)
static

Definition at line 936 of file ordinal.c.

939{
940 return ERROR_SUCCESS;
941}

◆ Disp_Invoke()

static HRESULT WINAPI Disp_Invoke ( IDispatch This,
DISPID  dispIdMember,
REFIID  riid,
LCID  lcid,
WORD  wFlags,
DISPPARAMS *  pDispParams,
VARIANT pVarResult,
EXCEPINFO *  pExcepInfo,
UINT puArgErr 
)
static

Definition at line 963 of file ordinal.c.

973{
974 trace("%p %x %s %x %x %p %p %p %p\n", This, dispIdMember, wine_dbgstr_guid(riid), lcid, wFlags,
975 pDispParams, pVarResult, pExcepInfo, puArgErr);
976
977 ok(dispIdMember == 0xa0 || dispIdMember == 0xa1, "Unknown dispIdMember\n");
978 ok(pDispParams != NULL, "Invoked with NULL pDispParams\n");
979 ok(wFlags == DISPATCH_METHOD, "Wrong flags %x\n",wFlags);
980 ok(lcid == 0,"Wrong lcid %x\n",lcid);
981 if (dispIdMember == 0xa0)
982 {
983 ok(pDispParams->cArgs == 0, "params.cArgs = %d\n", pDispParams->cArgs);
984 ok(pDispParams->cNamedArgs == 0, "params.cNamedArgs = %d\n", pDispParams->cArgs);
985 ok(pDispParams->rgdispidNamedArgs == NULL, "params.rgdispidNamedArgs = %p\n", pDispParams->rgdispidNamedArgs);
986 ok(pDispParams->rgvarg == NULL, "params.rgvarg = %p\n", pDispParams->rgvarg);
987 }
988 else if (dispIdMember == 0xa1)
989 {
990 ok(pDispParams->cArgs == 2, "params.cArgs = %d\n", pDispParams->cArgs);
991 ok(pDispParams->cNamedArgs == 0, "params.cNamedArgs = %d\n", pDispParams->cArgs);
992 ok(pDispParams->rgdispidNamedArgs == NULL, "params.rgdispidNamedArgs = %p\n", pDispParams->rgdispidNamedArgs);
993 ok(V_VT(pDispParams->rgvarg) == VT_BSTR, "V_VT(var) = %d\n", V_VT(pDispParams->rgvarg));
994 ok(V_I4(pDispParams->rgvarg) == 0xdeadcafe , "failed %p\n", V_BSTR(pDispParams->rgvarg));
995 ok(V_VT(pDispParams->rgvarg+1) == VT_I4, "V_VT(var) = %d\n", V_VT(pDispParams->rgvarg+1));
996 ok(V_I4(pDispParams->rgvarg+1) == 0xdeadbeef, "failed %x\n", V_I4(pDispParams->rgvarg+1));
997 }
998
999 return ERROR_SUCCESS;
1000}
#define ok(value,...)
Definition: atltest.h:57
@ VT_BSTR
Definition: compat.h:2303
@ VT_I4
Definition: compat.h:2298
#define DISPATCH_METHOD
Definition: oleauto.h:1006
#define V_VT(A)
Definition: oleauto.h:211
#define V_BSTR(A)
Definition: oleauto.h:226
#define V_I4(A)
Definition: oleauto.h:247
static __inline const char * wine_dbgstr_guid(const GUID *id)
Definition: debug.h:197
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:531

◆ Disp_QueryInterface()

static HRESULT WINAPI Disp_QueryInterface ( IDispatch This,
REFIID  riid,
void **  ppvObject 
)
static

Definition at line 897 of file ordinal.c.

901{
902 *ppvObject = NULL;
903
905 {
906 *ppvObject = This;
907 }
908
909 if (*ppvObject)
910 {
911 IDispatch_AddRef(This);
912 return S_OK;
913 }
914
915 trace("no interface\n");
916 return E_NOINTERFACE;
917}

◆ Disp_Release()

static ULONG WINAPI Disp_Release ( IDispatch This)
static

Definition at line 925 of file ordinal.c.

926{
927 Disp *iface = impl_from_IDispatch(This);
928 ULONG ret;
929
931 if (ret == 0)
933 return ret;
934}

◆ DWORD()

static DWORD ( WINAPI pSHGetObjectCompatFlags)
static

◆ Enum_AddRef()

static ULONG WINAPI Enum_AddRef ( IEnumConnections This)
static

Definition at line 1035 of file ordinal.c.

1036{
1038 return InterlockedIncrement(&iface->refCount);
1039}
static EnumCon * impl_from_IEnumConnections(IEnumConnections *iface)
Definition: ordinal.c:877

◆ Enum_Clone()

static HRESULT WINAPI Enum_Clone ( IEnumConnections This,
IEnumConnections **  ppEnum 
)
static

Definition at line 1087 of file ordinal.c.

1090{
1091 return E_FAIL;
1092}

◆ Enum_Next()

static HRESULT WINAPI Enum_Next ( IEnumConnections This,
ULONG  cConnections,
LPCONNECTDATA  rgcd,
ULONG pcFetched 
)
static

Definition at line 1052 of file ordinal.c.

1057{
1059
1060 if (cConnections > 0 && iface->idx < iface->pt->sinkCount)
1061 {
1062 rgcd->pUnk = iface->pt->sink[iface->idx];
1063 IUnknown_AddRef(iface->pt->sink[iface->idx]);
1064 rgcd->dwCookie=0xff;
1065 if (pcFetched)
1066 *pcFetched = 1;
1067 iface->idx++;
1068 return S_OK;
1069 }
1070
1071 return E_FAIL;
1072}

◆ Enum_QueryInterface()

static HRESULT WINAPI Enum_QueryInterface ( IEnumConnections This,
REFIID  riid,
void **  ppvObject 
)
static

Definition at line 1013 of file ordinal.c.

1017{
1018 *ppvObject = NULL;
1019
1021 {
1022 *ppvObject = This;
1023 }
1024
1025 if (*ppvObject)
1026 {
1027 IEnumConnections_AddRef(This);
1028 return S_OK;
1029 }
1030
1031 trace("no interface\n");
1032 return E_NOINTERFACE;
1033}
const GUID IID_IEnumConnections

◆ Enum_Release()

static ULONG WINAPI Enum_Release ( IEnumConnections This)
static

Definition at line 1041 of file ordinal.c.

1042{
1044 ULONG ret;
1045
1047 if (ret == 0)
1049 return ret;
1050}

◆ Enum_Reset()

static HRESULT WINAPI Enum_Reset ( IEnumConnections This)
static

Definition at line 1081 of file ordinal.c.

1083{
1084 return E_FAIL;
1085}

◆ Enum_Skip()

static HRESULT WINAPI Enum_Skip ( IEnumConnections This,
ULONG  cConnections 
)
static

Definition at line 1074 of file ordinal.c.

1077{
1078 return E_FAIL;
1079}

◆ EnumPt_AddRef()

static ULONG WINAPI EnumPt_AddRef ( IEnumConnectionPoints This)
static

Definition at line 1268 of file ordinal.c.

1269{
1271 return InterlockedIncrement(&iface->refCount);
1272}
static EnumPt * impl_from_IEnumConnectionPoints(IEnumConnectionPoints *iface)
Definition: ordinal.c:891

◆ EnumPt_Clone()

static HRESULT WINAPI EnumPt_Clone ( IEnumConnectionPoints This,
IEnumConnectionPoints **  ppEnumPt 
)
static

Definition at line 1319 of file ordinal.c.

1322{
1323 return E_FAIL;
1324}

◆ EnumPt_Next()

static HRESULT WINAPI EnumPt_Next ( IEnumConnectionPoints This,
ULONG  cConnections,
IConnectionPoint **  rgcd,
ULONG pcFetched 
)
static

Definition at line 1285 of file ordinal.c.

1290{
1292
1293 if (cConnections > 0 && iface->idx < iface->container->ptCount)
1294 {
1295 *rgcd = iface->container->pt[iface->idx];
1296 IConnectionPoint_AddRef(iface->container->pt[iface->idx]);
1297 if (pcFetched)
1298 *pcFetched = 1;
1299 iface->idx++;
1300 return S_OK;
1301 }
1302
1303 return E_FAIL;
1304}

◆ EnumPt_QueryInterface()

static HRESULT WINAPI EnumPt_QueryInterface ( IEnumConnectionPoints This,
REFIID  riid,
void **  ppvObject 
)
static

Definition at line 1246 of file ordinal.c.

1250{
1251 *ppvObject = NULL;
1252
1254 {
1255 *ppvObject = This;
1256 }
1257
1258 if (*ppvObject)
1259 {
1260 IEnumConnectionPoints_AddRef(This);
1261 return S_OK;
1262 }
1263
1264 trace("no interface\n");
1265 return E_NOINTERFACE;
1266}
const GUID IID_IEnumConnectionPoints

◆ EnumPt_Release()

static ULONG WINAPI EnumPt_Release ( IEnumConnectionPoints This)
static

Definition at line 1274 of file ordinal.c.

1275{
1277 ULONG ret;
1278
1280 if (ret == 0)
1282 return ret;
1283}

◆ EnumPt_Reset()

static HRESULT WINAPI EnumPt_Reset ( IEnumConnectionPoints This)
static

Definition at line 1313 of file ordinal.c.

1315{
1316 return E_FAIL;
1317}

◆ EnumPt_Skip()

static HRESULT WINAPI EnumPt_Skip ( IEnumConnectionPoints This,
ULONG  cConnections 
)
static

Definition at line 1306 of file ordinal.c.

1309{
1310 return E_FAIL;
1311}

◆ free_call_trace()

static void free_call_trace ( const call_trace_t ctrace)
static

Definition at line 123 of file ordinal.c.

124{
125 HeapFree(GetProcessHeap(), 0, ctrace->calls);
126}

Referenced by test_IUnknown_ProfferService(), and test_IUnknown_QueryServiceExec().

◆ HANDLE()

static HANDLE ( WINAPI pSHAllocShared)
static

◆ HKEY()

static HKEY ( WINAPI pSHGetShellKey)
static

◆ HRESULT() [1/2]

static HRESULT ( WINAPI pGetAcceptLanguagesA)
static

◆ HRESULT() [2/2]

static HRESULT ( WINAPIV pSHPackDispParams)
static

◆ HWND()

static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HWND ( WINAPI pSHCreateWorkerWindowA)
static

◆ impl_from_IConnectionPoint()

static ConPt * impl_from_IConnectionPoint ( IConnectionPoint iface)
inlinestatic

Definition at line 863 of file ordinal.c.

864{
865 return CONTAINING_RECORD(iface, ConPt, IConnectionPoint_iface);
866}
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260

Referenced by ConPt_AddRef(), ConPt_Advise(), ConPt_EnumConnections(), ConPt_GetConnectionInterface(), ConPt_GetConnectionPointContainer(), ConPt_Release(), and ConPt_Unadvise().

◆ impl_from_IConnectionPointContainer()

static Contain * impl_from_IConnectionPointContainer ( IConnectionPointContainer iface)
inlinestatic

Definition at line 847 of file ordinal.c.

848{
849 return CONTAINING_RECORD(iface, Contain, IConnectionPointContainer_iface);
850}

Referenced by Contain_AddRef(), Contain_EnumConnectionPoints(), Contain_FindConnectionPoint(), and Contain_Release().

◆ impl_from_IDispatch()

static Disp * impl_from_IDispatch ( IDispatch iface)
inlinestatic

Definition at line 833 of file ordinal.c.

834{
835 return CONTAINING_RECORD(iface, Disp, IDispatch_iface);
836}

Referenced by Disp_AddRef(), and Disp_Release().

◆ impl_from_IEnumConnectionPoints()

static EnumPt * impl_from_IEnumConnectionPoints ( IEnumConnectionPoints iface)
inlinestatic

Definition at line 891 of file ordinal.c.

892{
893 return CONTAINING_RECORD(iface, EnumPt, IEnumConnectionPoints_iface);
894}

Referenced by EnumPt_AddRef(), EnumPt_Next(), and EnumPt_Release().

◆ impl_from_IEnumConnections()

static EnumCon * impl_from_IEnumConnections ( IEnumConnections iface)
inlinestatic

Definition at line 877 of file ordinal.c.

878{
879 return CONTAINING_RECORD(iface, EnumCon, IEnumConnections_iface);
880}

Referenced by Enum_AddRef(), Enum_Next(), and Enum_Release().

◆ impl_from_IOleCommandTarget()

static IOleCommandTargetImpl * impl_from_IOleCommandTarget ( IOleCommandTarget iface)
inlinestatic

Definition at line 2096 of file ordinal.c.

2097{
2098 return CONTAINING_RECORD(iface, IOleCommandTargetImpl, IOleCommandTarget_iface);
2099}

Referenced by IOleCommandTargetImpl_AddRef(), IOleCommandTargetImpl_QueryInterface(), and IOleCommandTargetImpl_Release().

◆ impl_from_IProfferService()

static IProfferServiceImpl * impl_from_IProfferService ( IProfferService iface)
inlinestatic

Definition at line 2194 of file ordinal.c.

2195{
2196 return CONTAINING_RECORD(iface, IProfferServiceImpl, IProfferService_iface);
2197}

Referenced by IProfferServiceImpl_AddRef(), IProfferServiceImpl_QueryInterface(), and IProfferServiceImpl_Release().

◆ impl_from_IPropertyBag()

static PropBag * impl_from_IPropertyBag ( IPropertyBag iface)
inlinestatic

Definition at line 1504 of file ordinal.c.

1505{
1506 return CONTAINING_RECORD(iface, PropBag, IPropertyBag_iface);
1507}

Referenced by Prop_AddRef(), and Prop_Release().

◆ impl_from_IServiceProvider()

static IServiceProviderImpl * impl_from_IServiceProvider ( IServiceProvider iface)
inlinestatic

Definition at line 2184 of file ordinal.c.

2185{
2186 return CONTAINING_RECORD(iface, IServiceProviderImpl, IServiceProvider_iface);
2187}

Referenced by IServiceProviderImpl_AddRef(), IServiceProviderImpl_QueryInterface(), and IServiceProviderImpl_Release().

◆ init_call_trace()

static void init_call_trace ( call_trace_t ctrace)
static

Definition at line 116 of file ordinal.c.

117{
118 ctrace->alloc = 10;
119 ctrace->count = 0;
120 ctrace->calls = HeapAlloc(GetProcessHeap(), 0, sizeof(call_entry_t) * ctrace->alloc);
121}

Referenced by test_IUnknown_ProfferService(), and test_IUnknown_QueryServiceExec().

◆ init_pointers()

static void init_pointers ( void  )
static

Definition at line 2905 of file ordinal.c.

2906{
2907#define MAKEFUNC(f, ord) (p##f = (void*)GetProcAddress(hShlwapi, (LPSTR)(ord)))
2912 MAKEFUNC(SHMapHandle, 11);
2932 MAKEFUNC(SHGetShellKey, 491);
2935 MAKEFUNC(SKGetValueW, 516);
2936 MAKEFUNC(SKSetValueW, 517);
2938 MAKEFUNC(SKAllocValueW, 519);
2939#undef MAKEFUNC
2940
2941 pDllGetVersion = (void*)GetProcAddress(hShlwapi, "DllGetVersion");
2942}
#define GetProcAddress(x, y)
Definition: compat.h:753
HANDLE WINAPI SHAllocShared(LPCVOID lpvData, DWORD dwSize, DWORD dwProcId)
Definition: ordinal.c:162
HRESULT WINAPI IUnknown_QueryServiceExec(IUnknown *lpUnknown, REFIID service, const GUID *group, DWORD cmdId, DWORD cmdOpt, VARIANT *pIn, VARIANT *pOut)
Definition: ordinal.c:1546
BOOL WINAPI SHSetIniStringW(LPCWSTR appName, LPCWSTR keyName, LPCWSTR str, LPCWSTR filename)
Definition: ordinal.c:3333
LONG WINAPI SHSetWindowBits(HWND hwnd, INT offset, UINT mask, UINT flags)
Definition: ordinal.c:1123
HRESULT WINAPI GetAcceptLanguagesA(LPSTR langbuf, LPDWORD buflen)
Definition: ordinal.c:570
HWND WINAPI SHCreateWorkerWindowA(WNDPROC wndProc, HWND hWndParent, DWORD dwExStyle, DWORD dwStyle, HMENU hMenu, LONG_PTR wnd_extra)
Definition: ordinal.c:2630
HANDLE WINAPI SHMapHandle(HANDLE hShared, DWORD dwSrcProcId, DWORD dwDstProcId, DWORD dwAccess, DWORD dwOptions)
Definition: ordinal.c:91
HRESULT WINAPI IConnectionPoint_InvokeWithCancel(IConnectionPoint *iCP, DISPID dispId, DISPPARAMS *dispParams, DWORD unknown1, DWORD unknown2)
Definition: ordinal.c:3094
DWORD WINAPI SHGetIniStringW(LPCWSTR appName, LPCWSTR keyName, LPWSTR out, DWORD outLen, LPCWSTR filename)
Definition: ordinal.c:3288
HRESULT WINAPI IUnknown_ProfferService(IUnknown *lpUnknown, REFGUID service, IServiceProvider *pService, DWORD *pCookie)
Definition: ordinal.c:1585
HRESULT WINAPI ConnectToConnectionPoint(IUnknown *lpUnkSink, REFIID riid, BOOL fConnect, IUnknown *lpUnknown, LPDWORD lpCookie, IConnectionPoint **lppCP)
Definition: ordinal.c:1186
DWORD WINAPI SHGetObjectCompatFlags(IUnknown *pUnk, const CLSID *clsid)
Definition: ordinal.c:5401
INT WINAPI SHFormatDateTimeW(const FILETIME UNALIGNED *fileTime, DWORD *flags, LPWSTR buf, UINT size)
Definition: ordinal.c:5113
HRESULT WINAPI SKAllocValueW(DWORD flags, LPCWSTR subkey, LPCWSTR value, DWORD *type, LPVOID *data, DWORD *count)
Definition: ordinal.c:4675
HRESULT WINAPI IUnknown_GetClassID(IUnknown *lpUnknown, CLSID *clsid)
Definition: ordinal.c:1450
PVOID WINAPI SHLockShared(HANDLE hShared, DWORD dwProcId)
Definition: ordinal.c:252
INT WINAPI SHFormatDateTimeA(const FILETIME UNALIGNED *fileTime, DWORD *flags, LPSTR buf, UINT size)
Definition: ordinal.c:5178
HRESULT WINAPI SHIShellFolder_EnumObjects(LPSHELLFOLDER lpFolder, HWND hwnd, SHCONTF flags, IEnumIDList **ppenum)
Definition: ordinal.c:3767
HRESULT WINAPI SKGetValueW(DWORD flags, LPCWSTR subkey, LPCWSTR value, DWORD *type, void *data, DWORD *count)
Definition: ordinal.c:4732
HRESULT WINAPIV SHPackDispParams(DISPPARAMS *params, VARIANTARG *args, UINT cnt,...)
Definition: ordinal.c:3037
BOOL WINAPI SHFreeShared(HANDLE hShared, DWORD dwProcId)
Definition: ordinal.c:308
HRESULT WINAPI IConnectionPoint_SimpleInvoke(IConnectionPoint *iCP, DISPID dispId, DISPPARAMS *dispParams)
Definition: ordinal.c:3118
HKEY WINAPI SHGetShellKey(DWORD flags, LPCWSTR sub_key, BOOL create)
Definition: ordinal.c:4472
HRESULT WINAPI SKSetValueW(DWORD flags, LPCWSTR subkey, LPCWSTR value, DWORD type, void *data, DWORD count)
Definition: ordinal.c:4754
PSECURITY_DESCRIPTOR WINAPI GetShellSecurityDescriptor(const PSHELL_USER_PERMISSION *apUserPerm, int cUserPerm)
Definition: ordinal.c:4928
int WINAPI SHSearchMapInt(const int *lpKeys, const int *lpValues, int iLen, int iKey)
Definition: ordinal.c:2154
BOOL WINAPI SHUnlockShared(LPVOID lpView)
Definition: ordinal.c:288
HRESULT WINAPI SHPropertyBag_ReadLONG(IPropertyBag *ppb, LPCWSTR pszPropName, LPLONG pValue)
Definition: ordinal.c:5278
HRESULT WINAPI SKDeleteValueW(DWORD flags, LPCWSTR subkey, LPCWSTR value)
Definition: ordinal.c:4712
static HMODULE hShlwapi
Definition: ordinal.c:38
#define MAKEFUNC(f, ord)
HWND WINAPI SHSetParentHwnd(HWND hWnd, HWND hWndParent)
Definition: ordinal.c:1151
BOOL WINAPI GUIDFromStringA(LPCSTR str, LPGUID guid)
Definition: shellord.c:1901

Referenced by START_TEST().

◆ INT()

static INT ( WINAPI pSHFormatDateTimeA) const
static

◆ int()

static int ( WINAPI pSHSearchMapInt) const
static

◆ IOleCommandTargetImpl_AddRef()

static ULONG WINAPI IOleCommandTargetImpl_AddRef ( IOleCommandTarget iface)
static

Definition at line 2133 of file ordinal.c.

2134{
2136 return InterlockedIncrement(&This->ref);
2137}
static IOleCommandTargetImpl * impl_from_IOleCommandTarget(IOleCommandTarget *iface)
Definition: ordinal.c:2096

◆ IOleCommandTargetImpl_Construct()

static IOleCommandTarget * IOleCommandTargetImpl_Construct ( void  )
static

Definition at line 2103 of file ordinal.c.

2104{
2106
2107 obj = HeapAlloc(GetProcessHeap(), 0, sizeof(*obj));
2108 obj->IOleCommandTarget_iface.lpVtbl = &IOleCommandTargetImpl_Vtbl;
2109 obj->ref = 1;
2110
2111 return &obj->IOleCommandTarget_iface;
2112}
static const IOleCommandTargetVtbl IOleCommandTargetImpl_Vtbl
Definition: ordinal.c:2101

Referenced by IServiceProviderImpl_QueryService().

◆ IOleCommandTargetImpl_Exec()

static HRESULT WINAPI IOleCommandTargetImpl_Exec ( IOleCommandTarget iface,
const GUID CmdGroup,
DWORD  nCmdID,
DWORD  nCmdexecopt,
VARIANT pvaIn,
VARIANT pvaOut 
)
static

Definition at line 2158 of file ordinal.c.

2165{
2166 add_call(&trace_got, 3, CmdGroup, (void*)(DWORD_PTR)nCmdID, (void*)(DWORD_PTR)nCmdexecopt, pvaIn, pvaOut);
2167 return S_OK;
2168}
static call_trace_t trace_got
Definition: ordinal.c:177
static void add_call(call_trace_t *ctrace, int id, const void *arg0, const void *arg1, const void *arg2, const void *arg3, const void *arg4)
Definition: ordinal.c:128
uint32_t DWORD_PTR
Definition: typedefs.h:65

◆ IOleCommandTargetImpl_QueryInterface()

static HRESULT WINAPI IOleCommandTargetImpl_QueryInterface ( IOleCommandTarget iface,
REFIID  riid,
void **  ppvObj 
)
static

Definition at line 2114 of file ordinal.c.

2115{
2117
2118 if (IsEqualIID(riid, &IID_IUnknown) ||
2119 IsEqualIID(riid, &IID_IOleCommandTarget))
2120 {
2121 *ppvObj = This;
2122 }
2123
2124 if(*ppvObj)
2125 {
2126 IOleCommandTarget_AddRef(iface);
2127 return S_OK;
2128 }
2129
2130 return E_NOINTERFACE;
2131}

◆ IOleCommandTargetImpl_QueryStatus()

static HRESULT WINAPI IOleCommandTargetImpl_QueryStatus ( IOleCommandTarget iface,
const GUID group,
ULONG  cCmds,
OLECMD  prgCmds[],
OLECMDTEXT *  pCmdText 
)
static

Definition at line 2152 of file ordinal.c.

2154{
2155 return E_NOTIMPL;
2156}
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ IOleCommandTargetImpl_Release()

static ULONG WINAPI IOleCommandTargetImpl_Release ( IOleCommandTarget iface)
static

Definition at line 2139 of file ordinal.c.

2140{
2143
2144 if (!ref)
2145 {
2147 return 0;
2148 }
2149 return ref;
2150}
Definition: send.c:48

◆ IProfferServiceImpl_AddRef()

static ULONG WINAPI IProfferServiceImpl_AddRef ( IProfferService iface)
static

Definition at line 2358 of file ordinal.c.

2359{
2361 return InterlockedIncrement(&This->ref);
2362}
static IProfferServiceImpl * impl_from_IProfferService(IProfferService *iface)
Definition: ordinal.c:2194

◆ IProfferServiceImpl_Construct()

static IProfferService * IProfferServiceImpl_Construct ( void  )
static

Definition at line 2214 of file ordinal.c.

2215{
2217
2218 obj = HeapAlloc(GetProcessHeap(), 0, sizeof(*obj));
2219 obj->IProfferService_iface.lpVtbl = &IProfferServiceImpl_Vtbl;
2220 obj->ref = 1;
2221
2222 return &obj->IProfferService_iface;
2223}
static const IProfferServiceVtbl IProfferServiceImpl_Vtbl
Definition: ordinal.c:2201

Referenced by IServiceProviderImpl_QueryService(), and test_IUnknown_ProfferService().

◆ IProfferServiceImpl_ProfferService()

static HRESULT WINAPI IProfferServiceImpl_ProfferService ( IProfferService iface,
REFGUID  service,
IServiceProvider pService,
DWORD pCookie 
)
static

Definition at line 2377 of file ordinal.c.

2379{
2380 *pCookie = 0xdeadbeef;
2381 add_call(&trace_got, 3, service, pService, pCookie, 0, 0);
2382 return S_OK;
2383}

◆ IProfferServiceImpl_QueryInterface()

static HRESULT WINAPI IProfferServiceImpl_QueryInterface ( IProfferService iface,
REFIID  riid,
void **  ppvObj 
)
static

Definition at line 2333 of file ordinal.c.

2334{
2336
2337 if (IsEqualIID(riid, &IID_IUnknown) ||
2338 IsEqualIID(riid, &IID_IProfferService))
2339 {
2340 *ppvObj = This;
2341 }
2342 else if (IsEqualIID(riid, &IID_IServiceProvider))
2343 {
2345 add_call(&trace_got, 1, iface, &IID_IServiceProvider, 0, 0, 0);
2346 return S_OK;
2347 }
2348
2349 if(*ppvObj)
2350 {
2351 IProfferService_AddRef(iface);
2352 return S_OK;
2353 }
2354
2355 return E_NOINTERFACE;
2356}
static IServiceProvider * IServiceProviderImpl_Construct(void)
Definition: ordinal.c:2203

◆ IProfferServiceImpl_Release()

static ULONG WINAPI IProfferServiceImpl_Release ( IProfferService iface)
static

Definition at line 2364 of file ordinal.c.

2365{
2368
2369 if (!ref)
2370 {
2372 return 0;
2373 }
2374 return ref;
2375}

◆ IProfferServiceImpl_RevokeService()

static HRESULT WINAPI IProfferServiceImpl_RevokeService ( IProfferService iface,
DWORD  cookie 
)
static

Definition at line 2385 of file ordinal.c.

2386{
2387 add_call(&trace_got, 4, (void*)(DWORD_PTR)cookie, 0, 0, 0, 0);
2388 return S_OK;
2389}
Definition: cookie.c:34

◆ IServiceProviderImpl_AddRef()

static ULONG WINAPI IServiceProviderImpl_AddRef ( IServiceProvider iface)
static

Definition at line 2247 of file ordinal.c.

2248{
2250 return InterlockedIncrement(&This->ref);
2251}
static IServiceProviderImpl * impl_from_IServiceProvider(IServiceProvider *iface)
Definition: ordinal.c:2184

◆ IServiceProviderImpl_Construct()

static IServiceProvider * IServiceProviderImpl_Construct ( void  )
static

Definition at line 2203 of file ordinal.c.

2204{
2206
2207 obj = HeapAlloc(GetProcessHeap(), 0, sizeof(*obj));
2208 obj->IServiceProvider_iface.lpVtbl = &IServiceProviderImpl_Vtbl;
2209 obj->ref = 1;
2210
2211 return &obj->IServiceProvider_iface;
2212}
static const IServiceProviderVtbl IServiceProviderImpl_Vtbl
Definition: ordinal.c:2200

Referenced by IProfferServiceImpl_QueryInterface(), test_IUnknown_ProfferService(), and test_IUnknown_QueryServiceExec().

◆ IServiceProviderImpl_QueryInterface()

static HRESULT WINAPI IServiceProviderImpl_QueryInterface ( IServiceProvider iface,
REFIID  riid,
void **  ppvObj 
)
static

Definition at line 2225 of file ordinal.c.

2226{
2228
2229 if (IsEqualIID(riid, &IID_IUnknown) ||
2230 IsEqualIID(riid, &IID_IServiceProvider))
2231 {
2232 *ppvObj = This;
2233 }
2234
2235 if(*ppvObj)
2236 {
2237 IServiceProvider_AddRef(iface);
2238 /* native uses redefined IID_IServiceProvider symbol, so we can't compare pointers */
2239 if (IsEqualIID(riid, &IID_IServiceProvider))
2240 add_call(&trace_got, 1, iface, &IID_IServiceProvider, 0, 0, 0);
2241 return S_OK;
2242 }
2243
2244 return E_NOINTERFACE;
2245}

◆ IServiceProviderImpl_QueryService()

static HRESULT WINAPI IServiceProviderImpl_QueryService ( IServiceProvider iface,
REFGUID  service,
REFIID  riid,
void **  ppv 
)
static

Definition at line 2266 of file ordinal.c.

2268{
2269 /* native uses redefined pointer for IID_IOleCommandTarget, not one from uuid.lib */
2270 if (IsEqualIID(riid, &IID_IOleCommandTarget))
2271 {
2272 add_call(&trace_got, 2, iface, service, &IID_IOleCommandTarget, 0, 0);
2274 }
2275 if (IsEqualIID(riid, &IID_IProfferService))
2276 {
2277 if (IsEqualIID(service, &IID_IProfferService))
2278 add_call(&trace_got, 2, &IID_IProfferService, &IID_IProfferService, 0, 0, 0);
2280 }
2281 return S_OK;
2282}
REFIID LPVOID * ppv
Definition: atlbase.h:39
static IProfferService * IProfferServiceImpl_Construct(void)
Definition: ordinal.c:2214
static IOleCommandTarget * IOleCommandTargetImpl_Construct(void)
Definition: ordinal.c:2103

◆ IServiceProviderImpl_Release()

static ULONG WINAPI IServiceProviderImpl_Release ( IServiceProvider iface)
static

Definition at line 2253 of file ordinal.c.

2254{
2257
2258 if (!ref)
2259 {
2261 return 0;
2262 }
2263 return ref;
2264}

◆ LONG()

static LONG ( WINAPI pSHSetWindowBits)
static

◆ LPVOID()

static LPVOID ( WINAPI pSHLockShared)
static

◆ ok_trace_()

static void ok_trace_ ( call_trace_t texpected,
call_trace_t tgot,
int  line 
)
static

Definition at line 149 of file ordinal.c.

150{
151 if (texpected->count == tgot->count)
152 {
153 INT i;
154 /* compare */
155 for (i = 0; i < texpected->count; i++)
156 {
157 call_entry_t *expected = &texpected->calls[i];
158 call_entry_t *got = &tgot->calls[i];
159 INT j;
160
161 ok_(__FILE__, line)(expected->id == got->id, "got different ids %d: %d, %d\n", i+1, expected->id, got->id);
162
163 for (j = 0; j < 5; j++)
164 {
165 ok_(__FILE__, line)(expected->args[j] == got->args[j], "got different args[%d] for %d: %p, %p\n", j, i+1,
166 expected->args[j], got->args[j]);
167 }
168 }
169 }
170 else
171 ok_(__FILE__, line)(0, "traces length mismatch\n");
172}
#define ok_(x1, x2)
Definition: atltest.h:61
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 GLint GLint j
Definition: glfuncs.h:250
BOOL expected
Definition: store.c:2063
Definition: parser.c:49
int32_t INT
Definition: typedefs.h:58

◆ pGetShellSecurityDescriptor()

static SECURITY_DESCRIPTOR *WINAPI * pGetShellSecurityDescriptor ( const SHELL_USER_PERMISSION **  ,
int   
)
static

◆ Prop_AddRef()

static ULONG WINAPI Prop_AddRef ( IPropertyBag This)
static

Definition at line 1532 of file ordinal.c.

1534{
1536 return InterlockedIncrement(&iface->refCount);
1537}
static PropBag * impl_from_IPropertyBag(IPropertyBag *iface)
Definition: ordinal.c:1504
LONG refCount
Definition: ordinal.c:1500

◆ Prop_QueryInterface()

static HRESULT WINAPI Prop_QueryInterface ( IPropertyBag This,
REFIID  riid,
void **  ppvObject 
)
static

Definition at line 1510 of file ordinal.c.

1514{
1515 *ppvObject = NULL;
1516
1518 {
1519 *ppvObject = This;
1520 }
1521
1522 if (*ppvObject)
1523 {
1524 IPropertyBag_AddRef(This);
1525 return S_OK;
1526 }
1527
1528 trace("no interface\n");
1529 return E_NOINTERFACE;
1530}
const GUID IID_IPropertyBag

◆ Prop_Read()

static HRESULT WINAPI Prop_Read ( IPropertyBag This,
LPCOLESTR  pszPropName,
VARIANT pVar,
IErrorLog pErrorLog 
)
static

Definition at line 1551 of file ordinal.c.

1556{
1557 V_VT(pVar) = VT_BLOB|VT_BYREF;
1558 V_BYREF(pVar) = (LPVOID)0xdeadcafe;
1559 return S_OK;
1560}
@ VT_BLOB
Definition: compat.h:2330
@ VT_BYREF
Definition: compat.h:2342
#define LPVOID
Definition: nt_native.h:45
#define V_BYREF(A)
Definition: oleauto.h:228

◆ Prop_Release()

static ULONG WINAPI Prop_Release ( IPropertyBag This)
static

Definition at line 1539 of file ordinal.c.

1541{
1543 ULONG ret;
1544
1546 if (ret == 0)
1548 return ret;
1549}

◆ Prop_Write()

static HRESULT WINAPI Prop_Write ( IPropertyBag This,
LPCOLESTR  pszPropName,
VARIANT pVar 
)
static

Definition at line 1562 of file ordinal.c.

1566{
1567 return S_OK;
1568}

◆ r_verify_inifile()

static void r_verify_inifile ( unsigned  l,
LPCWSTR  filename,
LPCSTR  exp 
)
static

Definition at line 2694 of file ordinal.c.

2695{
2696 HANDLE file;
2697 CHAR buf[1024];
2698 DWORD read;
2699
2701
2703 return;
2704
2705 ReadFile(file, buf, sizeof(buf) * sizeof(CHAR), &read, NULL);
2706 buf[read] = '\0';
2707
2709
2710 ok_(__FILE__,l)(!strcmp(buf, exp), "Expected:\n%s\nGot:\n%s\n", exp,
2711 buf);
2712}
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
#define read
Definition: acwin.h:96
r l[0]
Definition: byte_order.h:167
#define CloseHandle
Definition: compat.h:739
#define OPEN_EXISTING
Definition: compat.h:775
#define ReadFile(a, b, c, d, e)
Definition: compat.h:742
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define GENERIC_READ
Definition: compat.h:135
#define CreateFileW
Definition: compat.h:741
unsigned long DWORD
Definition: ntddk_ex.h:95
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
const char * filename
Definition: ioapi.h:137
DWORD exp
Definition: msg.c:16058
Definition: fci.c:127
char CHAR
Definition: xmlstorage.h:175

◆ SF_AddRef()

static ULONG WINAPI SF_AddRef ( IShellFolder iface)
static

Definition at line 2525 of file ordinal.c.

2526{
2527 return 2;
2528}

◆ SF_BindToObject()

static HRESULT WINAPI SF_BindToObject ( IShellFolder iface,
LPCITEMIDLIST  idl,
LPBC  reserved,
REFIID  riid,
void **  obj 
)
static

Definition at line 2550 of file ordinal.c.

2552{
2553 ok(0, "Didn't expect BindToObject\n");
2554 return E_NOTIMPL;
2555}

◆ SF_BindToStorage()

static HRESULT WINAPI SF_BindToStorage ( IShellFolder iface,
LPCITEMIDLIST  idl,
LPBC  reserved,
REFIID  riid,
void **  obj 
)
static

Definition at line 2557 of file ordinal.c.

2559{
2560 ok(0, "Didn't expect BindToStorage\n");
2561 return E_NOTIMPL;
2562}

◆ SF_CompareIDs()

static HRESULT WINAPI SF_CompareIDs ( IShellFolder iface,
LPARAM  lparam,
LPCITEMIDLIST  idl1,
LPCITEMIDLIST  idl2 
)
static

Definition at line 2564 of file ordinal.c.

2566{
2567 ok(0, "Didn't expect CompareIDs\n");
2568 return E_NOTIMPL;
2569}

◆ SF_CreateViewObject()

static HRESULT WINAPI SF_CreateViewObject ( IShellFolder iface,
HWND  owner,
REFIID  riid,
void **  out 
)
static

Definition at line 2571 of file ordinal.c.

2573{
2574 ok(0, "Didn't expect CreateViewObject\n");
2575 return E_NOTIMPL;
2576}

◆ SF_EnumObjects()

static HRESULT WINAPI SF_EnumObjects ( IShellFolder iface,
HWND  owner,
SHCONTF  flags,
IEnumIDList **  enm 
)
static

Definition at line 2543 of file ordinal.c.

2545{
2546 *enm = (IEnumIDList*)0xcafebabe;
2547 return S_OK;
2548}

◆ SF_GetAttributesOf()

static HRESULT WINAPI SF_GetAttributesOf ( IShellFolder iface,
UINT  cidl,
LPCITEMIDLIST idl,
SFGAOF inOut 
)
static

Definition at line 2578 of file ordinal.c.

2584{
2585 ok(0, "Didn't expect GetAttributesOf\n");
2586 return E_NOTIMPL;
2587}

◆ SF_GetDisplayNameOf()

static HRESULT WINAPI SF_GetDisplayNameOf ( IShellFolder iface,
LPCITEMIDLIST  idl,
SHGDNF  flags,
STRRET name 
)
static

Definition at line 2601 of file ordinal.c.

2603{
2604 ok(0, "Didn't expect GetDisplayNameOf\n");
2605 return E_NOTIMPL;
2606}

◆ SF_GetUIObjectOf()

static HRESULT WINAPI SF_GetUIObjectOf ( IShellFolder iface,
HWND  owner,
UINT  cidl,
LPCITEMIDLIST idls,
REFIID  riid,
UINT inOut,
void **  out 
)
static

Definition at line 2589 of file ordinal.c.

2596{
2597 ok(0, "Didn't expect GetUIObjectOf\n");
2598 return E_NOTIMPL;
2599}

◆ SF_ParseDisplayName()

static HRESULT WINAPI SF_ParseDisplayName ( IShellFolder iface,
HWND  owner,
LPBC  reserved,
LPOLESTR  displayName,
ULONG eaten,
LPITEMIDLIST idl,
ULONG attr 
)
static

Definition at line 2535 of file ordinal.c.

2538{
2539 ok(0, "Didn't expect ParseDisplayName\n");
2540 return E_NOTIMPL;
2541}

◆ SF_QueryInterface()

static HRESULT WINAPI SF_QueryInterface ( IShellFolder iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 2516 of file ordinal.c.

2518{
2519 /* SHIShellFolder_EnumObjects doesn't QI the object for IShellFolder */
2520 ok(!IsEqualGUID(&IID_IShellFolder, riid),
2521 "Unexpected QI for IShellFolder\n");
2522 return E_NOINTERFACE;
2523}
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147

◆ SF_Release()

static ULONG WINAPI SF_Release ( IShellFolder iface)
static

Definition at line 2530 of file ordinal.c.

2531{
2532 return 1;
2533}

◆ SF_SetNameOf()

static HRESULT WINAPI SF_SetNameOf ( IShellFolder iface,
HWND  hwnd,
LPCITEMIDLIST  idl,
LPCOLESTR  name,
SHGDNF  flags,
LPITEMIDLIST idlOut 
)
static

Definition at line 2608 of file ordinal.c.

2611{
2612 ok(0, "Didn't expect SetNameOf\n");
2613 return E_NOTIMPL;
2614}

◆ START_TEST()

START_TEST ( ordinal  )

Definition at line 3117 of file ordinal.c.

3118{
3119 char **argv;
3120 int argc;
3121
3122 hShlwapi = GetModuleHandleA("shlwapi.dll");
3123
3124 init_pointers();
3125
3127 if (argc >= 4)
3128 {
3129 DWORD procid;
3130 HANDLE hmem;
3131 sscanf(argv[2], "%d", &procid);
3132 sscanf(argv[3], "%p", &hmem);
3134 return;
3135 }
3136
3140 test_fdsa();
3159}
static int argc
Definition: ServiceArgs.c:12
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:812
_Check_return_ _CRTIMP int __cdecl sscanf(_In_z_ const char *_Src, _In_z_ _Scanf_format_string_ const char *_Format,...)
static void test_IUnknown_ProfferService(void)
Definition: ordinal.c:2400
static void test_alloc_shared_remote(DWORD procid, HANDLE hmem)
Definition: ordinal.c:529
static void test_IConnectionPoint(void)
Definition: ordinal.c:1448
static void test_SHCreateWorkerWindowA(void)
Definition: ordinal.c:2464
static void test_alloc_shared(int argc, char **argv)
Definition: ordinal.c:458
static void test_SHSetIniString(void)
Definition: ordinal.c:2765
static void test_SHSetParentHwnd(void)
Definition: ordinal.c:2944
static void test_IUnknown_QueryServiceExec(void)
Definition: ordinal.c:2292
static void test_GetShellSecurityDescriptor(void)
Definition: ordinal.c:686
static void test_GetAcceptLanguagesA(void)
Definition: ordinal.c:179
static void test_SHSearchMapInt(void)
Definition: ordinal.c:411
static void test_DllGetVersion(void)
Definition: ordinal.c:3109
static void test_SHFormatDateTimeW(void)
Definition: ordinal.c:1826
static void test_SHIShellFolder_EnumObjects(void)
Definition: ordinal.c:2634
static void test_SHGetIniString(void)
Definition: ordinal.c:2714
static void test_SHGetShellKey(void)
Definition: ordinal.c:2815
static void test_SHGetObjectCompatFlags(void)
Definition: ordinal.c:2015
static void test_fdsa(void)
Definition: ordinal.c:586
static void test_SHPackDispParams(void)
Definition: ordinal.c:783
static void test_SHPropertyBag_ReadLONG(void)
Definition: ordinal.c:1580
static void test_IUnknown_GetClassID(void)
Definition: ordinal.c:3077
static void test_SHSetWindowBits(void)
Definition: ordinal.c:1606
static void init_pointers(void)
Definition: ordinal.c:2905
static void test_SHFormatDateTimeA(void)
Definition: ordinal.c:1674
#define argv
Definition: mplay32.c:18
int winetest_get_mainargs(char ***pargv)
static const WCHAR procid[]
Definition: wbemdisp.c:289

◆ strcmp_wa()

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

Definition at line 98 of file ordinal.c.

99{
100 CHAR buf[512];
101 WideCharToMultiByte(CP_ACP, 0, strw, -1, buf, sizeof(buf), NULL, NULL);
102 return lstrcmpA(stra, buf);
103}
#define CP_ACP
Definition: compat.h:109
#define WideCharToMultiByte
Definition: compat.h:111
int WINAPI lstrcmpA(LPCSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:18
static const char * strw(LPCWSTR x)
Definition: actctx.c:49

Referenced by test_SHGetIniString().

◆ test_alloc_shared()

static void test_alloc_shared ( int  argc,
char **  argv 
)
static

Definition at line 458 of file ordinal.c.

459{
460 char cmdline[MAX_PATH];
462 STARTUPINFOA si = { 0 };
464 HANDLE hmem, hmem2 = 0;
465 struct shared_struct val, *p;
466 BOOL ret;
467
469 hmem=pSHAllocShared(NULL,10,procid);
470 ok(hmem!=NULL,"SHAllocShared(NULL...) failed: %u\n", GetLastError());
471 ret = pSHFreeShared(hmem, procid);
472 ok( ret, "SHFreeShared failed: %u\n", GetLastError());
473
474 val.value = 0x12345678;
475 val.handle = 0;
476 hmem = pSHAllocShared(&val, sizeof(val), procid);
477 ok(hmem!=NULL,"SHAllocShared(NULL...) failed: %u\n", GetLastError());
478
479 p=pSHLockShared(hmem,procid);
480 ok(p!=NULL,"SHLockShared failed: %u\n", GetLastError());
481 if (p!=NULL)
482 ok(p->value == 0x12345678, "Wrong value in shared memory: %d instead of %d\n", p->value, 0x12345678);
483 ret = pSHUnlockShared(p);
484 ok( ret, "SHUnlockShared failed: %u\n", GetLastError());
485
486 sprintf(cmdline, "%s %s %d %p", argv[0], argv[1], procid, hmem);
487 ret = CreateProcessA(NULL, cmdline, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi);
488 ok(ret, "could not create child process error: %u\n", GetLastError());
489 if (ret)
490 {
492 CloseHandle(pi.hThread);
493 CloseHandle(pi.hProcess);
494
495 p = pSHLockShared(hmem, procid);
496 ok(p != NULL,"SHLockShared failed: %u\n", GetLastError());
497 if (p != NULL && p->value != 0x12345678)
498 {
499 ok(p->value == 0x12345679, "Wrong value in shared memory: %d instead of %d\n", p->value, 0x12345679);
500 hmem2 = p->handle;
501 ok(hmem2 != NULL, "Expected handle in shared memory\n");
502 }
503 ret = pSHUnlockShared(p);
504 ok(ret, "SHUnlockShared failed: %u\n", GetLastError());
505 }
506
507 ret = pSHFreeShared(hmem, procid);
508 ok( ret, "SHFreeShared failed: %u\n", GetLastError());
509
510 if (hmem2)
511 {
512 p = pSHLockShared(hmem2, procid);
513 ok(p != NULL,"SHLockShared failed: %u\n", GetLastError());
514 if (p != NULL)
515 ok(p->value == 0xDEADBEEF, "Wrong value in shared memory: %d instead of %d\n", p->value, 0xDEADBEEF);
516 ret = pSHUnlockShared(p);
517 ok(ret, "SHUnlockShared failed: %u\n", GetLastError());
518
519 ret = pSHFreeShared(hmem2, procid);
520 ok(ret, "SHFreeShared failed: %u\n", GetLastError());
521 }
522
523 SetLastError(0xdeadbeef);
524 ret = pSHFreeShared(NULL, procid);
525 ok(ret, "SHFreeShared failed: %u\n", GetLastError());
526 ok(GetLastError() == 0xdeadbeef, "last error should not have changed, got %u\n", GetLastError());
527}
#define FALSE
Definition: types.h:117
#define SetLastError(x)
Definition: compat.h:752
#define MAX_PATH
Definition: compat.h:34
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
unsigned int BOOL
Definition: ntddk_ex.h:94
GLuint GLfloat * val
Definition: glext.h:7180
GLfloat GLfloat p
Definition: glext.h:8902
#define sprintf(buf, format,...)
Definition: sprintf.c:55
static refpint_t pi[]
Definition: server.c:96
void winetest_wait_child_process(HANDLE process)
TCHAR * cmdline
Definition: stretchblt.cpp:32
char * value
Definition: compiler.c:67
DWORD WINAPI GetLastError(void)
Definition: except.c:1040
DWORD WINAPI GetCurrentProcessId(void)
Definition: proc.c:1158

Referenced by START_TEST().

◆ test_alloc_shared_remote()

static void test_alloc_shared_remote ( DWORD  procid,
HANDLE  hmem 
)
static

Definition at line 529 of file ordinal.c.

530{
531 struct shared_struct val, *p;
532 HANDLE hmem2;
533 BOOL ret;
534
535 /* test directly accessing shared memory of a remote process */
536 p = pSHLockShared(hmem, procid);
537 ok(p != NULL || broken(p == NULL) /* Windows 7/8 */, "SHLockShared failed: %u\n", GetLastError());
538 if (p == NULL)
539 {
540 win_skip("Subprocess failed to modify shared memory, skipping test\n");
541 return;
542 }
543
544 ok(p->value == 0x12345678, "Wrong value in shared memory: %d instead of %d\n", p->value, 0x12345678);
545 p->value++;
546
547 val.value = 0xDEADBEEF;
548 val.handle = 0;
549 p->handle = pSHAllocShared(&val, sizeof(val), procid);
550 ok(p->handle != NULL, "SHAllocShared failed: %u\n", GetLastError());
551
552 ret = pSHUnlockShared(p);
553 ok(ret, "SHUnlockShared failed: %u\n", GetLastError());
554
555 /* test SHMapHandle */
556 SetLastError(0xdeadbeef);
557 hmem2 = pSHMapHandle(NULL, procid, GetCurrentProcessId(), 0, 0);
558 ok(hmem2 == NULL, "expected NULL, got new handle\n");
559 ok(GetLastError() == 0xdeadbeef, "last error should not have changed, got %u\n", GetLastError());
560
561 hmem2 = pSHMapHandle(hmem, procid, GetCurrentProcessId(), 0, 0);
562
563 /* It seems like Windows Vista/2008 uses a different internal implementation
564 * for shared memory, and calling SHMapHandle fails. */
565 ok(hmem2 != NULL || broken(hmem2 == NULL),
566 "SHMapHandle failed: %u\n", GetLastError());
567 if (hmem2 == NULL)
568 {
569 win_skip("Subprocess failed to map shared memory, skipping test\n");
570 return;
571 }
572
573 p = pSHLockShared(hmem2, GetCurrentProcessId());
574 ok(p != NULL, "SHLockShared failed: %u\n", GetLastError());
575
576 if (p != NULL)
577 ok(p->value == 0x12345679, "Wrong value in shared memory: %d instead of %d\n", p->value, 0x12345679);
578
579 ret = pSHUnlockShared(p);
580 ok(ret, "SHUnlockShared failed: %u\n", GetLastError());
581
582 ret = pSHFreeShared(hmem2, GetCurrentProcessId());
583 ok(ret, "SHFreeShared failed: %u\n", GetLastError());
584}
#define broken(x)
Definition: _sntprintf.h:21
#define win_skip
Definition: test.h:160

Referenced by START_TEST().

◆ test_DllGetVersion()

static void test_DllGetVersion ( void  )
static

Definition at line 3109 of file ordinal.c.

3110{
3111 HRESULT hr;
3112
3113 hr = pDllGetVersion(NULL);
3114 ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
3115}
#define E_INVALIDARG
Definition: ddrawi.h:101
HRESULT hr
Definition: shlfolder.c:183

Referenced by START_TEST().

◆ test_fdsa()

static void test_fdsa ( void  )
static

Definition at line 586 of file ordinal.c.

587{
588 typedef struct
589 {
590 DWORD num_items; /* Number of elements inserted */
591 void *mem; /* Ptr to array */
592 DWORD blocks_alloced; /* Number of elements allocated */
593 BYTE inc; /* Number of elements to grow by when we need to expand */
594 BYTE block_size; /* Size in bytes of an element */
595 BYTE flags; /* Flags */
596 } FDSA_info;
597
598 BOOL (WINAPI *pFDSA_Initialize)(DWORD block_size, DWORD inc, FDSA_info *info, void *mem,
599 DWORD init_blocks);
600 BOOL (WINAPI *pFDSA_Destroy)(FDSA_info *info);
601 DWORD (WINAPI *pFDSA_InsertItem)(FDSA_info *info, DWORD where, const void *block);
602 BOOL (WINAPI *pFDSA_DeleteItem)(FDSA_info *info, DWORD where);
603
605 int block_size = 10, init_blocks = 4, inc = 2;
606 DWORD ret;
607 char *mem;
608
609 pFDSA_Initialize = (void *)GetProcAddress(hShlwapi, (LPSTR)208);
610 pFDSA_Destroy = (void *)GetProcAddress(hShlwapi, (LPSTR)209);
611 pFDSA_InsertItem = (void *)GetProcAddress(hShlwapi, (LPSTR)210);
612 pFDSA_DeleteItem = (void *)GetProcAddress(hShlwapi, (LPSTR)211);
613
614 mem = HeapAlloc(GetProcessHeap(), 0, block_size * init_blocks);
615 memset(&info, 0, sizeof(info));
616
617 ok(pFDSA_Initialize(block_size, inc, &info, mem, init_blocks), "FDSA_Initialize rets FALSE\n");
618 ok(info.num_items == 0, "num_items = %d\n", info.num_items);
619 ok(info.mem == mem, "mem = %p\n", info.mem);
620 ok(info.blocks_alloced == init_blocks, "blocks_alloced = %d\n", info.blocks_alloced);
621 ok(info.inc == inc, "inc = %d\n", info.inc);
622 ok(info.block_size == block_size, "block_size = %d\n", info.block_size);
623 ok(info.flags == 0, "flags = %d\n", info.flags);
624
625 ret = pFDSA_InsertItem(&info, 1234, "1234567890");
626 ok(ret == 0, "ret = %d\n", ret);
627 ok(info.num_items == 1, "num_items = %d\n", info.num_items);
628 ok(info.mem == mem, "mem = %p\n", info.mem);
629 ok(info.blocks_alloced == init_blocks, "blocks_alloced = %d\n", info.blocks_alloced);
630 ok(info.inc == inc, "inc = %d\n", info.inc);
631 ok(info.block_size == block_size, "block_size = %d\n", info.block_size);
632 ok(info.flags == 0, "flags = %d\n", info.flags);
633
634 ret = pFDSA_InsertItem(&info, 1234, "abcdefghij");
635 ok(ret == 1, "ret = %d\n", ret);
636
637 ret = pFDSA_InsertItem(&info, 1, "klmnopqrst");
638 ok(ret == 1, "ret = %d\n", ret);
639
640 ret = pFDSA_InsertItem(&info, 0, "uvwxyzABCD");
641 ok(ret == 0, "ret = %d\n", ret);
642 ok(info.mem == mem, "mem = %p\n", info.mem);
643 ok(info.flags == 0, "flags = %d\n", info.flags);
644
645 /* This next InsertItem will cause shlwapi to allocate its own mem buffer */
646 ret = pFDSA_InsertItem(&info, 0, "EFGHIJKLMN");
647 ok(ret == 0, "ret = %d\n", ret);
648 ok(info.mem != mem, "mem = %p\n", info.mem);
649 ok(info.blocks_alloced == init_blocks + inc, "blocks_alloced = %d\n", info.blocks_alloced);
650 ok(info.flags == 0x1, "flags = %d\n", info.flags);
651
652 ok(!memcmp(info.mem, "EFGHIJKLMNuvwxyzABCD1234567890klmnopqrstabcdefghij", 50), "mem %s\n", (char*)info.mem);
653
654 ok(pFDSA_DeleteItem(&info, 2), "rets FALSE\n");
655 ok(info.mem != mem, "mem = %p\n", info.mem);
656 ok(info.blocks_alloced == init_blocks + inc, "blocks_alloced = %d\n", info.blocks_alloced);
657 ok(info.flags == 0x1, "flags = %d\n", info.flags);
658
659 ok(!memcmp(info.mem, "EFGHIJKLMNuvwxyzABCDklmnopqrstabcdefghij", 40), "mem %s\n", (char*)info.mem);
660
661 ok(pFDSA_DeleteItem(&info, 3), "rets FALSE\n");
662 ok(info.mem != mem, "mem = %p\n", info.mem);
663 ok(info.blocks_alloced == init_blocks + inc, "blocks_alloced = %d\n", info.blocks_alloced);
664 ok(info.flags == 0x1, "flags = %d\n", info.flags);
665
666 ok(!memcmp(info.mem, "EFGHIJKLMNuvwxyzABCDklmnopqrst", 30), "mem %s\n", (char*)info.mem);
667
668 ok(!pFDSA_DeleteItem(&info, 4), "does not ret FALSE\n");
669
670 /* As shlwapi has allocated memory internally, Destroy will ret FALSE */
671 ok(!pFDSA_Destroy(&info), "FDSA_Destroy does not ret FALSE\n");
672
673
674 /* When Initialize is called with inc = 0, set it to 1 */
675 ok(pFDSA_Initialize(block_size, 0, &info, mem, init_blocks), "FDSA_Initialize rets FALSE\n");
676 ok(info.inc == 1, "inc = %d\n", info.inc);
677
678 /* This time, because shlwapi hasn't had to allocate memory
679 internally, Destroy rets non-zero */
680 ok(pFDSA_Destroy(&info), "FDSA_Destroy rets FALSE\n");
681
682
684}
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
GLbitfield flags
Definition: glext.h:7161
static DWORD block_size(DWORD block)
Definition: jsutils.c:66
static BOOL
Definition: ordinal.c:51
#define DWORD
Definition: nt_native.h:44
#define memset(x, y, z)
Definition: compat.h:39
Definition: mem.c:156
#define WINAPI
Definition: msvc.h:6
static unsigned int block
Definition: xmlmemory.c:101
char * LPSTR
Definition: xmlstorage.h:182
unsigned char BYTE
Definition: xxhash.c:193

Referenced by START_TEST().

◆ test_GetAcceptLanguagesA()

static void test_GetAcceptLanguagesA ( void  )
static

Definition at line 179 of file ordinal.c.

180{
181 static LPCSTR table[] = {"de,en-gb;q=0.7,en;q=0.3",
182 "de,en;q=0.3,en-gb;q=0.7", /* sorting is ignored */
183 "winetest", /* content is ignored */
184 "de-de,de;q=0.5",
185 "de",
186 NULL};
187
188 DWORD exactsize;
189 char original[512];
190 char language[32];
191 char buffer[64];
192 HKEY hroot = NULL;
193 LONG res_query = ERROR_SUCCESS;
194 LONG lres;
195 HRESULT hr;
196 DWORD maxlen = sizeof(buffer) - 2;
197 DWORD len;
198 LCID lcid;
200 INT i = 0;
201
202 lcid = GetUserDefaultLCID();
203
204 /* Get the original Value */
206 if (lres) {
207 skip("RegOpenKey(%s) failed: %d\n", ie_international, lres);
208 return;
209 }
210 len = sizeof(original);
211 original[0] = 0;
212 res_query = RegQueryValueExA(hroot, acceptlanguage, 0, NULL, (PBYTE)original, &len);
213
215
216 /* Some windows versions use "lang-COUNTRY" as default */
217 memset(language, 0, sizeof(language));
218 len = GetLocaleInfoA(lcid, LOCALE_SISO639LANGNAME, language, sizeof(language));
219
220 if (len) {
221 lstrcatA(language, "-");
222 memset(buffer, 0, sizeof(buffer));
224 lstrcatA(language, buffer);
225 }
226 else
227 {
228 /* LOCALE_SNAME has additional parts in some languages. Try only as last chance */
229 memset(language, 0, sizeof(language));
230 len = GetLocaleInfoA(lcid, LOCALE_SNAME, language, sizeof(language));
231 }
232
233 /* get the default value */
234 len = maxlen;
235 memset(buffer, '#', maxlen);
236 buffer[maxlen] = 0;
237 hr = pGetAcceptLanguagesA( buffer, &len);
238
239 if (hr != S_OK) {
240 win_skip("GetAcceptLanguagesA failed with 0x%x\n", hr);
241 goto restore_original;
242 }
243
244 if (lstrcmpA(buffer, language)) {
245 /* some windows versions use "lang" or "lang-country" as default */
246 language[0] = 0;
247 hr = LcidToRfc1766A(lcid, language, sizeof(language));
248 ok(hr == S_OK, "LcidToRfc1766A returned 0x%x and %s\n", hr, language);
249 }
250
251 ok(!lstrcmpA(buffer, language),
252 "have '%s' (searching for '%s')\n", language, buffer);
253
254 if (lstrcmpA(buffer, language)) {
255 win_skip("no more ideas, how to build the default language '%s'\n", buffer);
256 goto restore_original;
257 }
258
259 trace("detected default: %s\n", language);
260 while ((entry = table[i])) {
261
262 exactsize = lstrlenA(entry);
263
264 lres = RegSetValueExA(hroot, acceptlanguage, 0, REG_SZ, (const BYTE *) entry, exactsize + 1);
265 ok(!lres, "got %d for RegSetValueExA: %s\n", lres, entry);
266
267 /* len includes space for the terminating 0 before vista/w2k8 */
268 len = exactsize + 2;
269 memset(buffer, '#', maxlen);
270 buffer[maxlen] = 0;
271 hr = pGetAcceptLanguagesA( buffer, &len);
272 ok(((hr == E_INVALIDARG) && (len == 0)) ||
273 (SUCCEEDED(hr) &&
274 ((len == exactsize) || (len == exactsize+1)) &&
276 "+2_#%d: got 0x%x with %d and %s\n", i, hr, len, buffer);
277
278 len = exactsize + 1;
279 memset(buffer, '#', maxlen);
280 buffer[maxlen] = 0;
281 hr = pGetAcceptLanguagesA( buffer, &len);
282 ok(((hr == E_INVALIDARG) && (len == 0)) ||
283 (SUCCEEDED(hr) &&
284 ((len == exactsize) || (len == exactsize+1)) &&
286 "+1_#%d: got 0x%x with %d and %s\n", i, hr, len, buffer);
287
288 len = exactsize;
289 memset(buffer, '#', maxlen);
290 buffer[maxlen] = 0;
291 hr = pGetAcceptLanguagesA( buffer, &len);
292
293 /* There is no space for the string in the registry.
294 When the buffer is large enough, the default language is returned
295
296 When the buffer is too small for that fallback, win7_32 and w2k8_64
297 fail with E_NOT_SUFFICIENT_BUFFER, win8 fails with HRESULT_FROM_WIN32(ERROR_MORE_DATA),
298 other versions succeed and return a partial result while older os succeed
299 and overflow the buffer */
300
301 ok(((hr == E_INVALIDARG) && (len == 0)) ||
302 (((hr == S_OK) && !lstrcmpA(buffer, language) && (len == lstrlenA(language))) ||
303 ((hr == S_OK) && !memcmp(buffer, language, len)) ||
304 ((hr == E_NOT_SUFFICIENT_BUFFER) && !len) ||
305 ((hr == __HRESULT_FROM_WIN32(ERROR_MORE_DATA)) && len == exactsize)),
306 "==_#%d: got 0x%x with %d and %s\n", i, hr, len, buffer);
307
308 if (exactsize > 1) {
309 len = exactsize - 1;
310 memset(buffer, '#', maxlen);
311 buffer[maxlen] = 0;
312 hr = pGetAcceptLanguagesA( buffer, &len);
313 ok(((hr == E_INVALIDARG) && (len == 0)) ||
314 (((hr == S_OK) && !lstrcmpA(buffer, language) && (len == lstrlenA(language))) ||
315 ((hr == S_OK) && !memcmp(buffer, language, len)) ||
316 ((hr == E_NOT_SUFFICIENT_BUFFER) && !len) ||
317 ((hr == __HRESULT_FROM_WIN32(ERROR_MORE_DATA)) && len == exactsize - 1)),
318 "-1_#%d: got 0x%x with %d and %s\n", i, hr, len, buffer);
319 }
320
321 len = 1;
322 memset(buffer, '#', maxlen);
323 buffer[maxlen] = 0;
324 hr = pGetAcceptLanguagesA( buffer, &len);
325 ok(((hr == E_INVALIDARG) && (len == 0)) ||
326 (((hr == S_OK) && !lstrcmpA(buffer, language) && (len == lstrlenA(language))) ||
327 ((hr == S_OK) && !memcmp(buffer, language, len)) ||
328 ((hr == E_NOT_SUFFICIENT_BUFFER) && !len) ||
330 "=1_#%d: got 0x%x with %d and %s\n", i, hr, len, buffer);
331
332 len = maxlen;
333 hr = pGetAcceptLanguagesA( NULL, &len);
334
335 /* w2k3 and below: E_FAIL and untouched len,
336 since w2k8: S_OK and needed size (excluding 0), win8 S_OK and size including 0. */
337 ok( ((hr == S_OK) && ((len == exactsize) || (len == exactsize + 1))) ||
338 ((hr == E_FAIL) && (len == maxlen)),
339 "NULL,max #%d: got 0x%x with %d and %s\n", i, hr, len, buffer);
340
341 i++;
342 }
343
344 /* without a value in the registry, a default language is returned */
346
347 len = maxlen;
348 memset(buffer, '#', maxlen);
349 buffer[maxlen] = 0;
350 hr = pGetAcceptLanguagesA( buffer, &len);
351 ok( ((hr == S_OK) && (len == lstrlenA(language))),
352 "max: got 0x%x with %d and %s (expected S_OK with %d and '%s'\n",
353 hr, len, buffer, lstrlenA(language), language);
354
355 len = 2;
356 memset(buffer, '#', maxlen);
357 buffer[maxlen] = 0;
358 hr = pGetAcceptLanguagesA( buffer, &len);
359 ok( (((hr == S_OK) || (hr == E_INVALIDARG)) && !memcmp(buffer, language, len)) ||
360 ((hr == E_NOT_SUFFICIENT_BUFFER) && !len) ||
362 "=2: got 0x%x with %d and %s\n", hr, len, buffer);
363
364 len = 1;
365 memset(buffer, '#', maxlen);
366 buffer[maxlen] = 0;
367 hr = pGetAcceptLanguagesA( buffer, &len);
368 /* When the buffer is too small, win7_32 and w2k8_64 and above fail with
369 E_NOT_SUFFICIENT_BUFFER, win8 ERROR_CANNOT_COPY,
370 other versions succeed and return a partial 0 terminated result while other versions
371 fail with E_INVALIDARG and return a partial unterminated result */
372 ok( (((hr == S_OK) || (hr == E_INVALIDARG)) && !memcmp(buffer, language, len)) ||
373 ((hr == E_NOT_SUFFICIENT_BUFFER) && !len) ||
375 "=1: got 0x%x with %d and %s\n", hr, len, buffer);
376
377 len = 0;
378 memset(buffer, '#', maxlen);
379 buffer[maxlen] = 0;
380 hr = pGetAcceptLanguagesA( buffer, &len);
381 /* w2k3 and below: E_FAIL, since w2k8: E_INVALIDARG, win8 ERROR_CANNOT_COPY */
383 "got 0x%x\n", hr);
384
385 memset(buffer, '#', maxlen);
386 buffer[maxlen] = 0;
387 hr = pGetAcceptLanguagesA( buffer, NULL);
388 /* w2k3 and below: E_FAIL, since w2k8: E_INVALIDARG */
389 ok((hr == E_FAIL) || (hr == E_INVALIDARG),
390 "got 0x%x (expected E_FAIL or E_INVALIDARG)\n", hr);
391
392
393 hr = pGetAcceptLanguagesA( NULL, NULL);
394 /* w2k3 and below: E_FAIL, since w2k8: E_INVALIDARG */
395 ok((hr == E_FAIL) || (hr == E_INVALIDARG),
396 "got 0x%x (expected E_FAIL or E_INVALIDARG)\n", hr);
397
398restore_original:
399 if (!res_query) {
400 len = lstrlenA(original);
401 lres = RegSetValueExA(hroot, acceptlanguage, 0, REG_SZ, (const BYTE *) original, len ? len + 1: 0);
402 ok(!lres, "RegSetValueEx(%s) failed: %d\n", original, lres);
403 }
404 else
405 {
407 }
408 RegCloseKey(hroot);
409}
#define skip(...)
Definition: atltest.h:64
#define RegCloseKey(hKey)
Definition: registry.h:47
#define ERROR_MORE_DATA
Definition: dderror.h:13
LONG WINAPI RegSetValueExA(HKEY hKey, LPCSTR lpValueName, DWORD Reserved, DWORD dwType, CONST BYTE *lpData, DWORD cbData)
Definition: reg.c:4817
LONG WINAPI RegOpenKeyA(HKEY hKey, LPCSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:3257
LONG WINAPI RegDeleteValueA(HKEY hKey, LPCSTR lpValueName)
Definition: reg.c:2319
LONG WINAPI RegQueryValueExA(_In_ HKEY hkeyorg, _In_ LPCSTR name, _In_ LPDWORD reserved, _Out_opt_ LPDWORD type, _Out_opt_ LPBYTE data, _Inout_opt_ LPDWORD count)
Definition: reg.c:4027
GLuint buffer
Definition: glext.h:5915
GLenum GLsizei len
Definition: glext.h:6722
#define SUCCEEDED(hr)
Definition: intsafe.h:50
uint32_t entry
Definition: isohybrid.c:63
INT WINAPI GetLocaleInfoA(LCID lcid, LCTYPE lctype, LPSTR buffer, INT len)
Definition: lang.c:1022
LCID WINAPI GetUserDefaultLCID(void)
Definition: lang.c:772
#define REG_SZ
Definition: layer.c:22
LPSTR WINAPI lstrcatA(LPSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:123
int WINAPI lstrlenA(LPCSTR lpString)
Definition: lstring.c:145
static const CHAR ie_international[]
Definition: ordinal.c:90
static const CHAR acceptlanguage[]
Definition: ordinal.c:95
BYTE * PBYTE
Definition: pedump.c:66
long LONG
Definition: pedump.c:60
DWORD LCID
Definition: nls.h:13
static LCIDTORFC1766A LcidToRfc1766A
Definition: win_iconv.c:708
#define E_NOT_SUFFICIENT_BUFFER
Definition: winerror.h:2345
#define __HRESULT_FROM_WIN32(x)
Definition: winerror.h:85
#define ERROR_CANNOT_COPY
Definition: winerror.h:294
#define LOCALE_SNAME
Definition: winnls.h:130
#define LOCALE_SISO639LANGNAME
Definition: winnls.h:126
#define LOCALE_SISO3166CTRYNAME
Definition: winnls.h:127
#define HKEY_CURRENT_USER
Definition: winreg.h:11
const char * LPCSTR
Definition: xmlstorage.h:183

Referenced by START_TEST().

◆ test_GetShellSecurityDescriptor()

static void test_GetShellSecurityDescriptor ( void  )
static

Definition at line 686 of file ordinal.c.

687{
688 static const SHELL_USER_PERMISSION supCurrentUserFull = {
689 { {SECURITY_NULL_SID_AUTHORITY}, 0, 0 },
691 GENERIC_ALL, 0, 0 };
692#define MY_INHERITANCE 0xBE /* invalid value to proof behavior */
693 static const SHELL_USER_PERMISSION supEveryoneDenied = {
697 const SHELL_USER_PERMISSION* rgsup[2] = {
698 &supCurrentUserFull, &supEveryoneDenied,
699 };
701
702 if(!pGetShellSecurityDescriptor) /* vista and later */
703 {
704 win_skip("GetShellSecurityDescriptor not available\n");
705 return;
706 }
707
709 ok(psd==NULL, "GetShellSecurityDescriptor should fail\n");
710 psd = pGetShellSecurityDescriptor(rgsup, 0);
711 ok(psd==NULL, "GetShellSecurityDescriptor should fail, got %p\n", psd);
712
713 SetLastError(0xdeadbeef);
714 psd = pGetShellSecurityDescriptor(rgsup, 2);
715 ok(psd!=NULL, "GetShellSecurityDescriptor failed\n");
716 if (psd!=NULL)
717 {
718 BOOL bHasDacl = FALSE, bDefaulted, ret;
719 PACL pAcl;
720 DWORD dwRev;
722
723 ok(IsValidSecurityDescriptor(psd), "returned value is not valid SD\n");
724
725 ret = GetSecurityDescriptorControl(psd, &control, &dwRev);
726 ok(ret, "GetSecurityDescriptorControl failed with error %u\n", GetLastError());
727 ok(0 == (control & SE_SELF_RELATIVE), "SD should be absolute\n");
728
729 ret = GetSecurityDescriptorDacl(psd, &bHasDacl, &pAcl, &bDefaulted);
730 ok(ret, "GetSecurityDescriptorDacl failed with error %u\n", GetLastError());
731
732 ok(bHasDacl, "SD has no DACL\n");
733 if (bHasDacl)
734 {
735 ok(!bDefaulted, "DACL should not be defaulted\n");
736
737 ok(pAcl != NULL, "NULL DACL!\n");
738 if (pAcl != NULL)
739 {
740 ACL_SIZE_INFORMATION asiSize;
741
742 ok(IsValidAcl(pAcl), "DACL is not valid\n");
743
744 ret = GetAclInformation(pAcl, &asiSize, sizeof(asiSize), AclSizeInformation);
745 ok(ret, "GetAclInformation failed with error %u\n", GetLastError());
746
747 ok(asiSize.AceCount == 3, "Incorrect number of ACEs: %d entries\n", asiSize.AceCount);
748 if (asiSize.AceCount == 3)
749 {
750 ACCESS_ALLOWED_ACE *paaa; /* will use for DENIED too */
751
752 ret = GetAce(pAcl, 0, (LPVOID*)&paaa);
753 ok(ret, "GetAce failed with error %u\n", GetLastError());
755 "Invalid ACE type %d\n", paaa->Header.AceType);
756 ok(paaa->Header.AceFlags == 0, "Invalid ACE flags %x\n", paaa->Header.AceFlags);
757 ok(paaa->Mask == GENERIC_ALL, "Invalid ACE mask %x\n", paaa->Mask);
758
759 ret = GetAce(pAcl, 1, (LPVOID*)&paaa);
760 ok(ret, "GetAce failed with error %u\n", GetLastError());
762 "Invalid ACE type %d\n", paaa->Header.AceType);
763 /* first one of two ACEs generated from inheritable entry - without inheritance */
764 ok(paaa->Header.AceFlags == 0, "Invalid ACE flags %x\n", paaa->Header.AceFlags);
765 ok(paaa->Mask == GENERIC_WRITE, "Invalid ACE mask %x\n", paaa->Mask);
766
767 ret = GetAce(pAcl, 2, (LPVOID*)&paaa);
768 ok(ret, "GetAce failed with error %u\n", GetLastError());
770 "Invalid ACE type %d\n", paaa->Header.AceType);
771 /* second ACE - with inheritance */
773 "Invalid ACE flags %x\n", paaa->Header.AceFlags);
774 ok(paaa->Mask == GENERIC_READ, "Invalid ACE mask %x\n", paaa->Mask);
775 }
776 }
777 }
778
779 LocalFree(psd);
780 }
781}
#define TRUE
Definition: types.h:120
BOOL WINAPI GetAclInformation(PACL pAcl, LPVOID pAclInformation, DWORD nAclInformationLength, ACL_INFORMATION_CLASS dwAclInformationClass)
Definition: security.c:1196
BOOL WINAPI GetAce(PACL pAcl, DWORD dwAceIndex, LPVOID *pAce)
Definition: security.c:1188
BOOL WINAPI IsValidAcl(PACL pAcl)
Definition: security.c:1211
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1577
WORD SECURITY_DESCRIPTOR_CONTROL
Definition: lsa.idl:37
#define MY_INHERITANCE
static SECURITY_DESCRIPTOR *WINAPI * pGetShellSecurityDescriptor(const SHELL_USER_PERMISSION **, int)
#define GENERIC_ALL
Definition: nt_native.h:92
#define GENERIC_WRITE
Definition: nt_native.h:90
BOOL WINAPI IsValidSecurityDescriptor(PSECURITY_DESCRIPTOR pSecurityDescriptor)
Definition: sec.c:176
BOOL WINAPI GetSecurityDescriptorControl(PSECURITY_DESCRIPTOR pSecurityDescriptor, PSECURITY_DESCRIPTOR_CONTROL pControl, LPDWORD lpdwRevision)
Definition: sec.c:21
BOOL WINAPI GetSecurityDescriptorDacl(PSECURITY_DESCRIPTOR pSecurityDescriptor, LPBOOL lpbDaclPresent, PACL *pDacl, LPBOOL lpbDaclDefaulted)
Definition: sec.c:45
ACE_HEADER Header
Definition: ms-dtyp.idl:216
ACCESS_MASK Mask
Definition: ms-dtyp.idl:217
UCHAR AceFlags
Definition: ms-dtyp.idl:211
UCHAR AceType
Definition: ms-dtyp.idl:210
@ AclSizeInformation
Definition: winnt_old.h:1139
#define SECURITY_WORLD_SID_AUTHORITY
Definition: setypes.h:527
#define SECURITY_WORLD_RID
Definition: setypes.h:541
#define ACCESS_ALLOWED_ACE_TYPE
Definition: setypes.h:717
#define SE_SELF_RELATIVE
Definition: setypes.h:830
#define ACCESS_DENIED_ACE_TYPE
Definition: setypes.h:718
#define SECURITY_NULL_SID_AUTHORITY
Definition: setypes.h:524

Referenced by START_TEST().

◆ test_IConnectionPoint()

static void test_IConnectionPoint ( void  )
static

Definition at line 1448 of file ordinal.c.

1449{
1450 HRESULT rc;
1451 ULONG ref;
1454 Disp *dispatch;
1455 DWORD cookie = 0xffffffff;
1457 VARIANT vars[10];
1458
1460 container->IConnectionPointContainer_iface.lpVtbl = &contain_vtbl;
1461 container->refCount = 1;
1462 container->ptCount = 0;
1463 container->pt = NULL;
1464
1465 dispatch = HeapAlloc(GetProcessHeap(),0,sizeof(Disp));
1466 dispatch->IDispatch_iface.lpVtbl = &disp_vtbl;
1467 dispatch->refCount = 1;
1468
1469 rc = pConnectToConnectionPoint((IUnknown*)dispatch, &IID_NULL, TRUE, (IUnknown*)container, &cookie, &point);
1470 ok(rc == S_OK, "pConnectToConnectionPoint failed with %x\n",rc);
1471 ok(point != NULL, "returned ConnectionPoint is NULL\n");
1472 ok(cookie != 0xffffffff, "invalid cookie returned\n");
1473
1474 rc = pIConnectionPoint_SimpleInvoke(point,0xa0,NULL);
1475 ok(rc == S_OK, "pConnectToConnectionPoint failed with %x\n",rc);
1476
1477 memset(&params, 0xc0, sizeof(params));
1478 memset(vars, 0xc0, sizeof(vars));
1479 rc = pSHPackDispParams(&params, vars, 2, VT_I4, 0xdeadbeef, VT_BSTR, 0xdeadcafe);
1480 ok(rc == S_OK, "SHPackDispParams failed: %08x\n", rc);
1481
1482 rc = pIConnectionPoint_SimpleInvoke(point,0xa1,&params);
1483 ok(rc == S_OK, "pConnectToConnectionPoint failed with %x\n",rc);
1484
1485 rc = pConnectToConnectionPoint(NULL, &IID_NULL, FALSE, (IUnknown*)container, &cookie, NULL);
1486 ok(rc == S_OK, "pConnectToConnectionPoint failed with %x\n",rc);
1487
1488/* MSDN says this should be required but it crashs on XP
1489 IUnknown_Release(point);
1490*/
1491 ref = IUnknown_Release((IUnknown*)container);
1492 ok(ref == 0, "leftover IConnectionPointContainer reference %i\n",ref);
1493 ref = IUnknown_Release((IUnknown*)dispatch);
1494 ok(ref == 0, "leftover IDispatch reference %i\n",ref);
1495}
void dispatch(HANDLE hStopEvent)
Definition: dispatch.c:70
POINTL point
Definition: edittest.c:50
GLenum const GLfloat * params
Definition: glext.h:5645
static const IConnectionPointContainerVtbl contain_vtbl
Definition: ordinal.c:1439
static const IDispatchVtbl disp_vtbl
Definition: ordinal.c:1002
struct stdole::DISPPARAMS DISPPARAMS

Referenced by START_TEST().

◆ test_IUnknown_GetClassID()

static void test_IUnknown_GetClassID ( void  )
static

Definition at line 3077 of file ordinal.c.

3078{
3079 CLSID clsid, clsid2, clsid3;
3080 HRESULT hr;
3081
3082 if (0) /* crashes on native systems */
3083 hr = pIUnknown_GetClassID(NULL, NULL);
3084
3085 memset(&clsid, 0xcc, sizeof(clsid));
3086 memset(&clsid3, 0xcc, sizeof(clsid3));
3087 hr = pIUnknown_GetClassID(NULL, &clsid);
3088 ok(hr == E_FAIL, "got 0x%08x\n", hr);
3089 ok(IsEqualCLSID(&clsid, &CLSID_NULL) || broken(IsEqualCLSID(&clsid, &clsid3)) /* win2k, winxp, win2k3 */,
3090 "got wrong clsid %s\n", wine_dbgstr_guid(&clsid));
3091
3092 memset(&clsid, 0xcc, sizeof(clsid));
3093 memset(&clsid2, 0xab, sizeof(clsid2));
3094 hr = pIUnknown_GetClassID((IUnknown*)&testpersist, &clsid);
3095 ok(hr == 0x8fff2222, "got 0x%08x\n", hr);
3096 ok(IsEqualCLSID(&clsid, &clsid2) || broken(IsEqualCLSID(&clsid, &clsid3)) /* win2k3 */,
3097 "got wrong clsid %s\n", wine_dbgstr_guid(&clsid));
3098
3099 /* IPersistFolder is also supported */
3100 memset(&clsid, 0xcc, sizeof(clsid));
3101 memset(&clsid2, 0xab, sizeof(clsid2));
3102 memset(&clsid3, 0xcc, sizeof(clsid3));
3103 hr = pIUnknown_GetClassID((IUnknown*)&testpersist2, &clsid);
3104 ok(hr == 0x8fff2222, "got 0x%08x\n", hr);
3105 ok(IsEqualCLSID(&clsid, &clsid2) || broken(IsEqualCLSID(&clsid, &clsid3)) /* win2k3 */,
3106 "got wrong clsid %s\n", wine_dbgstr_guid(&clsid));
3107}
static IPersist testpersist2
Definition: ordinal.c:3075
static IPersist testpersist
Definition: ordinal.c:3074
REFCLSID clsid
Definition: msctf.c:82
#define CLSID_NULL
Definition: guiddef.h:99
#define IsEqualCLSID(rclsid1, rclsid2)
Definition: guiddef.h:96

Referenced by START_TEST().

◆ test_IUnknown_ProfferService()

static void test_IUnknown_ProfferService ( void  )
static

Definition at line 2400 of file ordinal.c.

2401{
2402 IServiceProvider *provider;
2403 IProfferService *proff;
2404 static const GUID dummy_serviceid = { 0xdeadbeef };
2405 call_trace_t trace_expected;
2406 HRESULT hr;
2407 DWORD cookie;
2408
2409 provider = IServiceProviderImpl_Construct();
2411
2412 /* null source pointer */
2413 hr = pIUnknown_ProfferService(NULL, &dummy_serviceid, 0, 0);
2414 ok(hr == E_FAIL ||
2415 hr == E_NOTIMPL, /* win 8 */
2416 "got 0x%08x\n", hr);
2417
2418 /* expected trace:
2419 IUnknown_ProfferService( ptr1, serviceid, arg1, arg2);
2420 -> IUnknown_QueryInterface( ptr1, &IID_IServiceProvider, &provider );
2421 -> IServiceProvider_QueryService( provider, &IID_IProfferService, &IID_IProfferService, &proffer );
2422
2423 if (service pointer not null):
2424 -> IProfferService_ProfferService( proffer, serviceid, arg1, arg2 );
2425 else
2426 -> IProfferService_RevokeService( proffer, *arg2 );
2427 */
2428 init_call_trace(&trace_expected);
2429
2430 add_call(&trace_expected, 1, proff, &IID_IServiceProvider, 0, 0, 0);
2431 add_call(&trace_expected, 2, &IID_IProfferService, &IID_IProfferService, 0, 0, 0);
2432 add_call(&trace_expected, 3, &dummy_serviceid, provider, &cookie, 0, 0);
2433
2435 cookie = 0;
2436 hr = pIUnknown_ProfferService((IUnknown*)proff, &dummy_serviceid, provider, &cookie);
2437 ok(hr == S_OK, "got 0x%08x\n", hr);
2438 ok(cookie == 0xdeadbeef, "got %x\n", cookie);
2439
2440 ok_trace(&trace_expected, &trace_got);
2442 free_call_trace(&trace_expected);
2443
2444 /* same with ::Revoke path */
2445 init_call_trace(&trace_expected);
2446
2447 add_call(&trace_expected, 1, proff, &IID_IServiceProvider, 0, 0, 0);
2448 add_call(&trace_expected, 2, &IID_IProfferService, &IID_IProfferService, 0, 0, 0);
2449 add_call(&trace_expected, 4, (void*)(DWORD_PTR)cookie, 0, 0, 0, 0);
2450
2452 ok(cookie != 0, "got %x\n", cookie);
2453 hr = pIUnknown_ProfferService((IUnknown*)proff, &dummy_serviceid, 0, &cookie);
2454 ok(hr == S_OK, "got 0x%08x\n", hr);
2455 ok(cookie == 0, "got %x\n", cookie);
2456 ok_trace(&trace_expected, &trace_got);
2458 free_call_trace(&trace_expected);
2459
2460 IServiceProvider_Release(provider);
2461 IProfferService_Release(proff);
2462}
#define ok_trace(a, b)
Definition: ordinal.c:174
static void free_call_trace(const call_trace_t *ctrace)
Definition: ordinal.c:123
static void init_call_trace(call_trace_t *ctrace)
Definition: ordinal.c:116

Referenced by START_TEST().

◆ test_IUnknown_QueryServiceExec()

static void test_IUnknown_QueryServiceExec ( void  )
static

Definition at line 2292 of file ordinal.c.

2293{
2294 IServiceProvider *provider;
2295 static const GUID dummy_serviceid = { 0xdeadbeef };
2296 static const GUID dummy_groupid = { 0xbeefbeef };
2297 call_trace_t trace_expected;
2298 HRESULT hr;
2299
2300 provider = IServiceProviderImpl_Construct();
2301
2302 /* null source pointer */
2303 hr = pIUnknown_QueryServiceExec(NULL, &dummy_serviceid, &dummy_groupid, 0, 0, 0, 0);
2304 ok(hr == E_FAIL ||
2305 hr == E_NOTIMPL, /* win 8 */
2306 "got 0x%08x\n", hr);
2307
2308 /* expected trace:
2309 IUnknown_QueryServiceExec( ptr1, serviceid, groupid, arg1, arg2, arg3, arg4);
2310 -> IUnknown_QueryInterface( ptr1, &IID_IServiceProvider, &prov );
2311 -> IServiceProvider_QueryService( prov, serviceid, &IID_IOleCommandTarget, &obj );
2312 -> IOleCommandTarget_Exec( obj, groupid, arg1, arg2, arg3, arg4 );
2313 */
2314 init_call_trace(&trace_expected);
2315
2316 add_call(&trace_expected, 1, provider, &IID_IServiceProvider, 0, 0, 0);
2317 add_call(&trace_expected, 2, provider, &dummy_serviceid, &IID_IOleCommandTarget, 0, 0);
2318 add_call(&trace_expected, 3, &dummy_groupid, (void*)0x1, (void*)0x2, (void*)0x3, (void*)0x4);
2319
2321 hr = pIUnknown_QueryServiceExec((IUnknown*)provider, &dummy_serviceid, &dummy_groupid, 0x1, 0x2, (void*)0x3, (void*)0x4);
2322 ok(hr == S_OK, "got 0x%08x\n", hr);
2323
2324 ok_trace(&trace_expected, &trace_got);
2325
2326 free_call_trace(&trace_expected);
2328
2329 IServiceProvider_Release(provider);
2330}

Referenced by START_TEST().

◆ test_SHCreateWorkerWindowA()

static void test_SHCreateWorkerWindowA ( void  )
static

Definition at line 2464 of file ordinal.c.

2465{
2466 WNDCLASSA cliA;
2467 char classA[20];
2468 HWND hwnd;
2469 LONG_PTR ret;
2470 BOOL res;
2471
2472 hwnd = pSHCreateWorkerWindowA(0, NULL, 0, 0, 0, 0);
2473 ok(hwnd != 0, "expected window\n");
2474
2475 GetClassNameA(hwnd, classA, 20);
2476 ok(lstrcmpA(classA, "WorkerA") == 0, "expected WorkerA class, got %s\n", classA);
2477
2479 ok(ret == 0, "got %ld\n", ret);
2480
2481 /* class info */
2482 memset(&cliA, 0, sizeof(cliA));
2483 res = GetClassInfoA(GetModuleHandleA("shlwapi.dll"), "WorkerA", &cliA);
2484 ok(res, "failed to get class info\n");
2485 ok(cliA.style == 0, "got 0x%08x\n", cliA.style);
2486 ok(cliA.cbClsExtra == 0, "got %d\n", cliA.cbClsExtra);
2487 ok(cliA.cbWndExtra == sizeof(LONG_PTR), "got %d\n", cliA.cbWndExtra);
2488 ok(cliA.lpszMenuName == 0, "got %s\n", cliA.lpszMenuName);
2489
2491
2492 /* set extra bytes */
2493 hwnd = pSHCreateWorkerWindowA(0, NULL, 0, 0, 0, 0xdeadbeef);
2494 ok(hwnd != 0, "expected window\n");
2495
2496 GetClassNameA(hwnd, classA, 20);
2497 ok(lstrcmpA(classA, "WorkerA") == 0, "expected WorkerA class, got %s\n", classA);
2498
2500 ok(ret == 0xdeadbeef, "got %ld\n", ret);
2501
2502 /* test exstyle */
2504 ok(ret == WS_EX_WINDOWEDGE ||
2505 ret == (WS_EX_WINDOWEDGE|WS_EX_LAYOUTRTL) /* systems with RTL locale */, "0x%08lx\n", ret);
2506
2508
2509 hwnd = pSHCreateWorkerWindowA(0, NULL, WS_EX_TOOLWINDOW, 0, 0, 0);
2512 ret == (WS_EX_WINDOWEDGE|WS_EX_TOOLWINDOW|WS_EX_LAYOUTRTL) /* systems with RTL locale */, "0x%08lx\n", ret);
2514}
GLuint res
Definition: glext.h:9613
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
int cbWndExtra
Definition: winuser.h:3156
UINT style
Definition: winuser.h:3153
LPCSTR lpszMenuName
Definition: winuser.h:3161
int cbClsExtra
Definition: winuser.h:3155
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
#define WS_EX_LAYOUTRTL
Definition: winuser.h:390
LONG WINAPI GetWindowLongA(_In_ HWND, _In_ int)
int WINAPI GetClassNameA(_In_ HWND hWnd, _Out_writes_to_(nMaxCount, return) LPSTR lpClassName, _In_ int nMaxCount)
#define WS_EX_TOOLWINDOW
Definition: winuser.h:404
#define GetWindowLongPtrA
Definition: winuser.h:4818
#define WS_EX_WINDOWEDGE
Definition: winuser.h:407
BOOL WINAPI GetClassInfoA(_In_opt_ HINSTANCE, _In_ LPCSTR, _Out_ LPWNDCLASSA)
BOOL WINAPI DestroyWindow(_In_ HWND)
#define GWL_EXSTYLE
Definition: winuser.h:845

Referenced by START_TEST().

◆ test_SHFormatDateTimeA()

static void test_SHFormatDateTimeA ( void  )
static

Definition at line 1674 of file ordinal.c.

1675{
1677 CHAR buff[100], buff2[100], buff3[100];
1678 SYSTEMTIME st;
1679 DWORD flags;
1680 INT ret;
1681
1682if (0)
1683{
1684 /* crashes on native */
1685 pSHFormatDateTimeA(NULL, NULL, NULL, 0);
1686}
1687
1688 GetLocalTime(&st);
1690 /* SHFormatDateTime expects input as utc */
1692
1693 /* no way to get required buffer length here */
1694 SetLastError(0xdeadbeef);
1695 ret = pSHFormatDateTimeA(&filetime, NULL, NULL, 0);
1696 ok(ret == 0, "got %d\n", ret);
1697 ok(GetLastError() == 0xdeadbeef || broken(GetLastError() == ERROR_SUCCESS /* Win7 */),
1698 "expected 0xdeadbeef, got %d\n", GetLastError());
1699
1700 SetLastError(0xdeadbeef);
1701 buff[0] = 'a'; buff[1] = 0;
1702 ret = pSHFormatDateTimeA(&filetime, NULL, buff, 0);
1703 ok(ret == 0, "got %d\n", ret);
1704 ok(GetLastError() == 0xdeadbeef, "expected 0xdeadbeef, got %d\n", GetLastError());
1705 ok(buff[0] == 'a', "expected same string, got %s\n", buff);
1706
1707 /* flags needs to have FDTF_NOAUTOREADINGORDER for these tests to succeed on Vista+ */
1708
1709 /* all combinations documented as invalid succeeded */
1711 SetLastError(0xdeadbeef);
1712 ret = pSHFormatDateTimeA(&filetime, &flags, buff, sizeof(buff));
1713 ok(ret == lstrlenA(buff)+1, "got %d\n", ret);
1714 ok(GetLastError() == 0xdeadbeef, "expected 0xdeadbeef, got %d\n", GetLastError());
1715
1717 SetLastError(0xdeadbeef);
1718 ret = pSHFormatDateTimeA(&filetime, &flags, buff, sizeof(buff));
1719 ok(ret == lstrlenA(buff)+1, "got %d\n", ret);
1720 ok(GetLastError() == 0xdeadbeef, "expected 0xdeadbeef, got %d\n", GetLastError());
1721
1723 SetLastError(0xdeadbeef);
1724 ret = pSHFormatDateTimeA(&filetime, &flags, buff, sizeof(buff));
1725 ok(ret == lstrlenA(buff)+1, "got %d\n", ret);
1726 ok(GetLastError() == 0xdeadbeef,
1727 "expected 0xdeadbeef, got %d\n", GetLastError());
1728
1729 /* now check returned strings */
1731 ret = pSHFormatDateTimeA(&filetime, &flags, buff, sizeof(buff));
1732 ok(ret == lstrlenA(buff)+1, "got %d\n", ret);
1733 ret = GetTimeFormatA(LOCALE_USER_DEFAULT, TIME_NOSECONDS, &st, NULL, buff2, sizeof(buff2));
1734 ok(ret == lstrlenA(buff2)+1, "got %d\n", ret);
1735 ok(lstrcmpA(buff, buff2) == 0, "expected (%s), got (%s)\n", buff2, buff);
1736
1738 ret = pSHFormatDateTimeA(&filetime, &flags, buff, sizeof(buff));
1739 ok(ret == lstrlenA(buff)+1, "got %d\n", ret);
1740 ret = GetTimeFormatA(LOCALE_USER_DEFAULT, 0, &st, NULL, buff2, sizeof(buff2));
1741 ok(ret == lstrlenA(buff2)+1, "got %d\n", ret);
1742 ok(lstrcmpA(buff, buff2) == 0, "expected (%s), got (%s)\n", buff2, buff);
1743
1744 /* both time flags */
1746 ret = pSHFormatDateTimeA(&filetime, &flags, buff, sizeof(buff));
1747 ok(ret == lstrlenA(buff)+1, "got %d\n", ret);
1748 ret = GetTimeFormatA(LOCALE_USER_DEFAULT, 0, &st, NULL, buff2, sizeof(buff2));
1749 ok(ret == lstrlenA(buff2)+1, "got %d\n", ret);
1750 ok(lstrcmpA(buff, buff2) == 0, "expected (%s), got (%s)\n", buff2, buff);
1751
1753 ret = pSHFormatDateTimeA(&filetime, &flags, buff, sizeof(buff));
1754 ok(ret == lstrlenA(buff)+1, "got %d\n", ret);
1755 ret = GetDateFormatA(LOCALE_USER_DEFAULT, DATE_SHORTDATE, &st, NULL, buff2, sizeof(buff2));
1756 ok(ret == lstrlenA(buff2)+1, "got %d\n", ret);
1757 ok(lstrcmpA(buff, buff2) == 0, "expected (%s), got (%s)\n", buff2, buff);
1758
1760 ret = pSHFormatDateTimeA(&filetime, &flags, buff, sizeof(buff));
1761 ok(ret == lstrlenA(buff)+1, "got %d\n", ret);
1762 ret = GetDateFormatA(LOCALE_USER_DEFAULT, DATE_LONGDATE, &st, NULL, buff2, sizeof(buff2));
1763 ok(ret == lstrlenA(buff2)+1, "got %d\n", ret);
1764 ok(lstrcmpA(buff, buff2) == 0, "expected (%s), got (%s)\n", buff2, buff);
1765
1766 /* both date flags */
1768 ret = pSHFormatDateTimeA(&filetime, &flags, buff, sizeof(buff));
1769 ok(ret == lstrlenA(buff)+1, "got %d\n", ret);
1770 ret = GetDateFormatA(LOCALE_USER_DEFAULT, DATE_LONGDATE, &st, NULL, buff2, sizeof(buff2));
1771 ok(ret == lstrlenA(buff2)+1, "got %d\n", ret);
1772 ok(lstrcmpA(buff, buff2) == 0, "expected (%s), got (%s)\n", buff2, buff);
1773
1774 /* various combinations of date/time flags */
1776 ret = pSHFormatDateTimeA(&filetime, &flags, buff, sizeof(buff));
1777 ok(ret == lstrlenA(buff)+1, "got %d, length %d\n", ret, lstrlenA(buff)+1);
1778 ret = GetTimeFormatA(LOCALE_USER_DEFAULT, TIME_NOSECONDS, &st, NULL, buff3, sizeof(buff3));
1779 ok(ret == lstrlenA(buff3)+1, "got %d\n", ret);
1780 ok(lstrcmpA(buff3, buff + lstrlenA(buff) - lstrlenA(buff3)) == 0,
1781 "expected (%s), got (%s) for time part\n",
1782 buff3, buff + lstrlenA(buff) - lstrlenA(buff3));
1783 ret = GetDateFormatA(LOCALE_USER_DEFAULT, DATE_LONGDATE, &st, NULL, buff2, sizeof(buff2));
1784 ok(ret == lstrlenA(buff2)+1, "got %d\n", ret);
1785 buff[lstrlenA(buff2)] = '\0';
1786 ok(lstrcmpA(buff2, buff) == 0, "expected (%s) got (%s) for date part\n",
1787 buff2, buff);
1788
1790 ret = pSHFormatDateTimeA(&filetime, &flags, buff, sizeof(buff));
1791 ok(ret == lstrlenA(buff)+1, "got %d\n", ret);
1792 ret = GetTimeFormatA(LOCALE_USER_DEFAULT, 0, &st, NULL, buff3, sizeof(buff3));
1793 ok(ret == lstrlenA(buff3)+1, "got %d\n", ret);
1794 ok(lstrcmpA(buff3, buff + lstrlenA(buff) - lstrlenA(buff3)) == 0,
1795 "expected (%s), got (%s) for time part\n",
1796 buff3, buff + lstrlenA(buff) - lstrlenA(buff3));
1797 ret = GetDateFormatA(LOCALE_USER_DEFAULT, DATE_LONGDATE, &st, NULL, buff2, sizeof(buff2));
1798 ok(ret == lstrlenA(buff2)+1, "got %d\n", ret);
1799 buff[lstrlenA(buff2)] = '\0';
1800 ok(lstrcmpA(buff2, buff) == 0, "expected (%s) got (%s) for date part\n",
1801 buff2, buff);
1802
1804 ret = pSHFormatDateTimeA(&filetime, &flags, buff, sizeof(buff));
1805 ok(ret == lstrlenA(buff)+1, "got %d\n", ret);
1806 ret = GetDateFormatA(LOCALE_USER_DEFAULT, DATE_SHORTDATE, &st, NULL, buff2, sizeof(buff2));
1807 ok(ret == lstrlenA(buff2)+1, "got %d\n", ret);
1808 strcat(buff2, " ");
1809 ret = GetTimeFormatA(LOCALE_USER_DEFAULT, TIME_NOSECONDS, &st, NULL, buff3, sizeof(buff3));
1810 ok(ret == lstrlenA(buff3)+1, "got %d\n", ret);
1811 strcat(buff2, buff3);
1812 ok(lstrcmpA(buff, buff2) == 0, "expected (%s), got (%s)\n", buff2, buff);
1813
1815 ret = pSHFormatDateTimeA(&filetime, &flags, buff, sizeof(buff));
1816 ok(ret == lstrlenA(buff)+1, "got %d\n", ret);
1817 ret = GetDateFormatA(LOCALE_USER_DEFAULT, DATE_SHORTDATE, &st, NULL, buff2, sizeof(buff2));
1818 ok(ret == lstrlenA(buff2)+1, "got %d\n", ret);
1819 strcat(buff2, " ");
1820 ret = GetTimeFormatA(LOCALE_USER_DEFAULT, 0, &st, NULL, buff3, sizeof(buff3));
1821 ok(ret == lstrlenA(buff3)+1, "got %d\n", ret);
1822 strcat(buff2, buff3);
1823 ok(lstrcmpA(buff, buff2) == 0, "expected (%s), got (%s)\n", buff2, buff);
1824}
char * strcat(char *DstString, const char *SrcString)
Definition: utclib.c:568
#define UNALIGNED
Definition: crtdefs.h:144
BOOL WINAPI SystemTimeToFileTime(IN CONST SYSTEMTIME *lpSystemTime, OUT LPFILETIME lpFileTime)
Definition: time.c:158
BOOL WINAPI LocalFileTimeToFileTime(IN CONST FILETIME *lpLocalFileTime, OUT LPFILETIME lpFileTime)
Definition: time.c:253
VOID WINAPI GetLocalTime(OUT LPSYSTEMTIME lpSystemTime)
Definition: time.c:286
static unsigned char buff[32768]
Definition: fatten.c:17
INT WINAPI GetTimeFormatA(LCID lcid, DWORD dwFlags, const SYSTEMTIME *lpTime, LPCSTR lpFormat, LPSTR lpTimeStr, INT cchOut)
Definition: lcformat.c:1030
INT WINAPI GetDateFormatA(LCID lcid, DWORD dwFlags, const SYSTEMTIME *lpTime, LPCSTR lpFormat, LPSTR lpDateStr, INT cchOut)
Definition: lcformat.c:922
#define LOCALE_USER_DEFAULT
#define FDTF_SHORTTIME
Definition: shlwapi.h:2061
#define FDTF_NOAUTOREADINGORDER
Definition: shlwapi.h:2069
#define FDTF_LONGDATE
Definition: shlwapi.h:2064
#define FDTF_RTLDATE
Definition: shlwapi.h:2068
#define FDTF_LTRDATE
Definition: shlwapi.h:2067
#define FDTF_LONGTIME
Definition: shlwapi.h:2065
#define FDTF_SHORTDATE
Definition: shlwapi.h:2062
#define TIME_NOSECONDS
Definition: winnls.h:278
#define DATE_LONGDATE
Definition: winnls.h:197
#define DATE_SHORTDATE
Definition: winnls.h:196

Referenced by START_TEST().

◆ test_SHFormatDateTimeW()

static void test_SHFormatDateTimeW ( void  )
static

Definition at line 1826 of file ordinal.c.

1827{
1829 WCHAR buff[100], buff2[100], buff3[100], *p1, *p2;
1830 SYSTEMTIME st;
1831 DWORD flags;
1832 INT ret;
1833 static const WCHAR spaceW[] = {' ',0};
1834#define UNICODE_LTR_MARK 0x200e
1835#define UNICODE_RTL_MARK 0x200f
1836
1837if (0)
1838{
1839 /* crashes on native */
1840 pSHFormatDateTimeW(NULL, NULL, NULL, 0);
1841}
1842
1843 GetLocalTime(&st);
1845 /* SHFormatDateTime expects input as utc */
1847
1848 /* no way to get required buffer length here */
1849 SetLastError(0xdeadbeef);
1850 ret = pSHFormatDateTimeW(&filetime, NULL, NULL, 0);
1851 ok(ret == 0, "expected 0, got %d\n", ret);
1852 ok(GetLastError() == 0xdeadbeef, "expected 0xdeadbeef, got %d\n", GetLastError());
1853
1854 SetLastError(0xdeadbeef);
1855 buff[0] = 'a'; buff[1] = 0;
1856 ret = pSHFormatDateTimeW(&filetime, NULL, buff, 0);
1857 ok(ret == 0, "expected 0, got %d\n", ret);
1858 ok(GetLastError() == 0xdeadbeef, "expected 0xdeadbeef, got %d\n", GetLastError());
1859 ok(buff[0] == 'a', "expected same string\n");
1860
1861 /* all combinations documented as invalid succeeded */
1863 SetLastError(0xdeadbeef);
1864 ret = pSHFormatDateTimeW(&filetime, &flags, buff, ARRAY_SIZE(buff));
1865 ok(ret == lstrlenW(buff)+1 || ret == lstrlenW(buff),
1866 "expected %d or %d, got %d\n", lstrlenW(buff)+1, lstrlenW(buff), ret);
1867 ok(GetLastError() == 0xdeadbeef, "expected 0xdeadbeef, got %d\n", GetLastError());
1868
1870 SetLastError(0xdeadbeef);
1871 ret = pSHFormatDateTimeW(&filetime, &flags, buff, ARRAY_SIZE(buff));
1872 ok(ret == lstrlenW(buff)+1 || ret == lstrlenW(buff),
1873 "expected %d or %d, got %d\n", lstrlenW(buff)+1, lstrlenW(buff), ret);
1874 ok(GetLastError() == 0xdeadbeef, "expected 0xdeadbeef, got %d\n", GetLastError());
1875
1877 SetLastError(0xdeadbeef);
1878 buff[0] = 0; /* NT4 doesn't clear the buffer on failure */
1879 ret = pSHFormatDateTimeW(&filetime, &flags, buff, ARRAY_SIZE(buff));
1880 ok(ret == lstrlenW(buff)+1 || ret == lstrlenW(buff),
1881 "expected %d or %d, got %d\n", lstrlenW(buff)+1, lstrlenW(buff), ret);
1882 ok(GetLastError() == 0xdeadbeef,
1883 "expected 0xdeadbeef, got %d\n", GetLastError());
1884
1885 /* now check returned strings */
1887 ret = pSHFormatDateTimeW(&filetime, &flags, buff, ARRAY_SIZE(buff));
1888 ok(ret == lstrlenW(buff)+1 || ret == lstrlenW(buff),
1889 "expected %d or %d, got %d\n", lstrlenW(buff)+1, lstrlenW(buff), ret);
1890 SetLastError(0xdeadbeef);
1892 ok(ret == lstrlenW(buff2)+1, "expected %d, got %d\n", lstrlenW(buff2)+1, ret);
1893 ok(lstrcmpW(buff, buff2) == 0, "expected equal strings\n");
1894
1896 ret = pSHFormatDateTimeW(&filetime, &flags, buff, ARRAY_SIZE(buff));
1897 ok(ret == lstrlenW(buff)+1 || ret == lstrlenW(buff),
1898 "expected %d or %d, got %d\n", lstrlenW(buff)+1, lstrlenW(buff), ret);
1899 ret = GetTimeFormatW(LOCALE_USER_DEFAULT, 0, &st, NULL, buff2, ARRAY_SIZE(buff2));
1900 ok(ret == lstrlenW(buff2)+1, "expected %d, got %d\n", lstrlenW(buff2)+1, ret);
1901 ok(lstrcmpW(buff, buff2) == 0, "expected equal strings\n");
1902
1903 /* both time flags */
1905 ret = pSHFormatDateTimeW(&filetime, &flags, buff, ARRAY_SIZE(buff));
1906 ok(ret == lstrlenW(buff)+1 || ret == lstrlenW(buff),
1907 "expected %d or %d, got %d\n", lstrlenW(buff)+1, lstrlenW(buff), ret);
1908 ret = GetTimeFormatW(LOCALE_USER_DEFAULT, 0, &st, NULL, buff2, ARRAY_SIZE(buff2));
1909 ok(ret == lstrlenW(buff2)+1, "expected %d, got %d\n", lstrlenW(buff2)+1, ret);
1910 ok(lstrcmpW(buff, buff2) == 0, "expected equal string\n");
1911
1913 ret = pSHFormatDateTimeW(&filetime, &flags, buff, ARRAY_SIZE(buff));
1914 ok(ret == lstrlenW(buff)+1 || ret == lstrlenW(buff),
1915 "expected %d or %d, got %d\n", lstrlenW(buff)+1, lstrlenW(buff), ret);
1917 ok(ret == lstrlenW(buff2)+1, "expected %d, got %d\n", lstrlenW(buff2)+1, ret);
1918 ok(lstrcmpW(buff, buff2) == 0, "expected equal strings\n");
1919
1921 ret = pSHFormatDateTimeW(&filetime, &flags, buff, ARRAY_SIZE(buff));
1922 ok(ret == lstrlenW(buff)+1 || ret == lstrlenW(buff),
1923 "expected %d or %d, got %d\n", lstrlenW(buff)+1, lstrlenW(buff), ret);
1925 ok(ret == lstrlenW(buff2)+1, "expected %d, got %d\n", lstrlenW(buff2)+1, ret);
1926 ok(lstrcmpW(buff, buff2) == 0, "expected equal strings\n");
1927
1928 /* both date flags */
1930 ret = pSHFormatDateTimeW(&filetime, &flags, buff, ARRAY_SIZE(buff));
1931 ok(ret == lstrlenW(buff)+1 || ret == lstrlenW(buff),
1932 "expected %d or %d, got %d\n", lstrlenW(buff)+1, lstrlenW(buff), ret);
1934 ok(ret == lstrlenW(buff2)+1, "expected %d, got %d\n", lstrlenW(buff2)+1, ret);
1935 ok(lstrcmpW(buff, buff2) == 0, "expected equal strings\n");
1936
1937 /* various combinations of date/time flags */
1939 ret = pSHFormatDateTimeW(&filetime, &flags, buff, ARRAY_SIZE(buff));
1940 ok(ret == lstrlenW(buff)+1 || ret == lstrlenW(buff),
1941 "expected %d or %d, got %d\n", lstrlenW(buff)+1, lstrlenW(buff), ret);
1943 ok(ret == lstrlenW(buff3)+1, "expected %d, got %d\n", lstrlenW(buff3)+1, ret);
1944 ok(lstrcmpW(buff3, buff + lstrlenW(buff) - lstrlenW(buff3)) == 0,
1945 "expected (%s), got (%s) for time part\n",
1946 wine_dbgstr_w(buff3), wine_dbgstr_w(buff + lstrlenW(buff) - lstrlenW(buff3)));
1948 ok(ret == lstrlenW(buff2)+1, "expected %d, got %d\n", lstrlenW(buff2)+1, ret);
1949 p1 = buff;
1950 p2 = buff2;
1951 while (*p2 != '\0')
1952 {
1953 while (*p1 == UNICODE_LTR_MARK || *p1 == UNICODE_RTL_MARK)
1954 p1++;
1955 while (*p2 == UNICODE_LTR_MARK || *p2 == UNICODE_RTL_MARK)
1956 p2++;
1957 p1++;
1958 p2++;
1959 }
1960 *p1 = '\0';
1961 ok(lstrcmpW(buff2, buff) == 0, "expected (%s) got (%s) for date part\n",
1963
1965 ret = pSHFormatDateTimeW(&filetime, &flags, buff, ARRAY_SIZE(buff));
1966 ok(ret == lstrlenW(buff)+1 || ret == lstrlenW(buff),
1967 "expected %d or %d, got %d\n", lstrlenW(buff)+1, lstrlenW(buff), ret);
1968 ret = GetTimeFormatW(LOCALE_USER_DEFAULT, 0, &st, NULL, buff3, ARRAY_SIZE(buff3));
1969 ok(ret == lstrlenW(buff3)+1, "expected %d, got %d\n", lstrlenW(buff3)+1, ret);
1970 ok(lstrcmpW(buff3, buff + lstrlenW(buff) - lstrlenW(buff3)) == 0,
1971 "expected (%s), got (%s) for time part\n",
1972 wine_dbgstr_w(buff3), wine_dbgstr_w(buff + lstrlenW(buff) - lstrlenW(buff3)));
1974 ok(ret == lstrlenW(buff2)+1, "expected %d, got %d\n", lstrlenW(buff2)+1, ret);
1975 p1 = buff;
1976 p2 = buff2;
1977 while (*p2 != '\0')
1978 {
1979 while (*p1 == UNICODE_LTR_MARK || *p1 == UNICODE_RTL_MARK)
1980 p1++;
1981 while (*p2 == UNICODE_LTR_MARK || *p2 == UNICODE_RTL_MARK)
1982 p2++;
1983 p1++;
1984 p2++;
1985 }
1986 *p1 = '\0';
1987 ok(lstrcmpW(buff2, buff) == 0, "expected (%s) got (%s) for date part\n",
1989
1991 ret = pSHFormatDateTimeW(&filetime, &flags, buff, ARRAY_SIZE(buff));
1992 ok(ret == lstrlenW(buff)+1 || ret == lstrlenW(buff),
1993 "expected %d or %d, got %d\n", lstrlenW(buff)+1, lstrlenW(buff), ret);
1995 ok(ret == lstrlenW(buff2)+1, "expected %d, got %d\n", lstrlenW(buff2)+1, ret);
1996 lstrcatW(buff2, spaceW);
1998 ok(ret == lstrlenW(buff3)+1, "expected %d, got %d\n", lstrlenW(buff3)+1, ret);
1999 lstrcatW(buff2, buff3);
2000 ok(lstrcmpW(buff, buff2) == 0, &q