ReactOS 0.4.16-dev-91-g764881a
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 , 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 177 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 2696 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 
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 2803 of file ordinal.c.

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

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 131 of file ordinal.c.

133{
134 call_entry_t call;
135
136 call.id = id;
137 call.args[0] = arg0;
138 call.args[1] = arg1;
139 call.args[2] = arg2;
140 call.args[3] = arg3;
141 call.args[4] = arg4;
142
143 if (ctrace->count == ctrace->alloc)
144 {
145 ctrace->alloc *= 2;
146 ctrace->calls = HeapReAlloc(GetProcessHeap(),0, ctrace->calls, ctrace->alloc*sizeof(call_entry_t));
147 }
148
149 ctrace->calls[ctrace->count++] = call;
150}
#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:108
int id
Definition: ordinal.c:109
const void * args[5]
Definition: ordinal.c:110
call_entry_t * calls
Definition: ordinal.c:114

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 1130 of file ordinal.c.

1132{
1134 return InterlockedIncrement(&iface->refCount);
1135}
#define InterlockedIncrement
Definition: armddk.h:53
static ConPt * impl_from_IConnectionPoint(IConnectionPoint *iface)
Definition: ordinal.c:866
LONG refCount
Definition: ordinal.c:858

◆ ConPt_Advise()

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

Definition at line 1187 of file ordinal.c.

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

◆ ConPt_EnumConnections()

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

Definition at line 1221 of file ordinal.c.

1224{
1225 EnumCon *ec;
1226
1227 ec = HeapAlloc(GetProcessHeap(),0,sizeof(EnumCon));
1228 ec->IEnumConnections_iface.lpVtbl = &enum_vtbl;
1229 ec->refCount = 1;
1231 ec->idx = 0;
1232 *ppEnum = &ec->IEnumConnections_iface;
1233
1234 return S_OK;
1235}
static const IEnumConnectionsVtbl enum_vtbl
Definition: ordinal.c:1097
Definition: ordinal.c:872
IEnumConnections IEnumConnections_iface
Definition: ordinal.c:873
ConPt * pt
Definition: ordinal.c:877
UINT idx
Definition: ordinal.c:876
LONG refCount
Definition: ordinal.c:874

◆ ConPt_GetConnectionInterface()

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

Definition at line 1161 of file ordinal.c.

1164{
1165 static int i = 0;
1167 if (i==0)
1168 {
1169 i++;
1170 return E_FAIL;
1171 }
1172 else
1173 memcpy(pIID,&iface->id,sizeof(GUID));
1174 return S_OK;
1175}
#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:861

◆ ConPt_GetConnectionPointContainer()

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

Definition at line 1177 of file ordinal.c.

1180{
1182
1184 return S_OK;
1185}
Contain * container
Definition: ordinal.c:860
IConnectionPointContainer IConnectionPointContainer_iface
Definition: ordinal.c:843

◆ ConPt_QueryInterface()

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

Definition at line 1108 of file ordinal.c.

1112{
1113 *ppvObject = NULL;
1114
1116 {
1117 *ppvObject = This;
1118 }
1119
1120 if (*ppvObject)
1121 {
1122 IConnectionPoint_AddRef(This);
1123 return S_OK;
1124 }
1125
1126 trace("no interface\n");
1127 return E_NOINTERFACE;
1128}
#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 1137 of file ordinal.c.

1139{
1141 ULONG ret;
1142
1144 if (ret == 0)
1145 {
1146 if (iface->sinkCount > 0)
1147 {
1148 int i;
1149 for (i = 0; i < iface->sinkCount; i++)
1150 {
1151 if (iface->sink[i])
1152 IUnknown_Release(iface->sink[i]);
1153 }
1154 HeapFree(GetProcessHeap(),0,iface->sink);
1155 }
1157 }
1158 return ret;
1159}
#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 1205 of file ordinal.c.

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

◆ Contain_AddRef()

static ULONG WINAPI Contain_AddRef ( IConnectionPointContainer This)
static

Definition at line 1362 of file ordinal.c.

1364{
1366 return InterlockedIncrement(&iface->refCount);
1367}
static Contain * impl_from_IConnectionPointContainer(IConnectionPointContainer *iface)
Definition: ordinal.c:850
LONG refCount
Definition: ordinal.c:844

◆ Contain_EnumConnectionPoints()

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

Definition at line 1390 of file ordinal.c.

1393{
1394 EnumPt *ec;
1395
1396 ec = HeapAlloc(GetProcessHeap(),0,sizeof(EnumPt));
1398 ec->refCount = 1;
1399 ec->idx= 0;
1401 *ppEnum = &ec->IEnumConnectionPoints_iface;
1402
1403 return S_OK;
1404}
static const IEnumConnectionPointsVtbl enumpt_vtbl
Definition: ordinal.c:1329
LONG refCount
Definition: ordinal.c:888
int idx
Definition: ordinal.c:890
IEnumConnectionPoints IEnumConnectionPoints_iface
Definition: ordinal.c:887
Contain * container
Definition: ordinal.c:891

◆ Contain_FindConnectionPoint()

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

Definition at line 1406 of file ordinal.c.

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

◆ Contain_QueryInterface()

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

Definition at line 1340 of file ordinal.c.

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

◆ Contain_Release()

static ULONG WINAPI Contain_Release ( IConnectionPointContainer This)
static

Definition at line 1369 of file ordinal.c.

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

◆ Disp_AddRef()

static ULONG WINAPI Disp_AddRef ( IDispatch This)
static

Definition at line 922 of file ordinal.c.

923{
924 Disp *iface = impl_from_IDispatch(This);
925 return InterlockedIncrement(&iface->refCount);
926}
static Disp * impl_from_IDispatch(IDispatch *iface)
Definition: ordinal.c:836
Definition: ordinal.c:831
LONG refCount
Definition: ordinal.c:833

◆ Disp_GetIDsOfNames()

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

Definition at line 955 of file ordinal.c.

962{
963 return ERROR_SUCCESS;
964}
#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 946 of file ordinal.c.

951{
952 return ERROR_SUCCESS;
953}

◆ Disp_GetTypeInfoCount()

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

Definition at line 939 of file ordinal.c.

942{
943 return ERROR_SUCCESS;
944}

◆ 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 966 of file ordinal.c.

976{
977 trace("%p %x %s %x %x %p %p %p %p\n", This, dispIdMember, wine_dbgstr_guid(riid), lcid, wFlags,
978 pDispParams, pVarResult, pExcepInfo, puArgErr);
979
980 ok(dispIdMember == 0xa0 || dispIdMember == 0xa1, "Unknown dispIdMember\n");
981 ok(pDispParams != NULL, "Invoked with NULL pDispParams\n");
982 ok(wFlags == DISPATCH_METHOD, "Wrong flags %x\n",wFlags);
983 ok(lcid == 0,"Wrong lcid %x\n",lcid);
984 if (dispIdMember == 0xa0)
985 {
986 ok(pDispParams->cArgs == 0, "params.cArgs = %d\n", pDispParams->cArgs);
987 ok(pDispParams->cNamedArgs == 0, "params.cNamedArgs = %d\n", pDispParams->cArgs);
988 ok(pDispParams->rgdispidNamedArgs == NULL, "params.rgdispidNamedArgs = %p\n", pDispParams->rgdispidNamedArgs);
989 ok(pDispParams->rgvarg == NULL, "params.rgvarg = %p\n", pDispParams->rgvarg);
990 }
991 else if (dispIdMember == 0xa1)
992 {
993 ok(pDispParams->cArgs == 2, "params.cArgs = %d\n", pDispParams->cArgs);
994 ok(pDispParams->cNamedArgs == 0, "params.cNamedArgs = %d\n", pDispParams->cArgs);
995 ok(pDispParams->rgdispidNamedArgs == NULL, "params.rgdispidNamedArgs = %p\n", pDispParams->rgdispidNamedArgs);
996 ok(V_VT(pDispParams->rgvarg) == VT_BSTR, "V_VT(var) = %d\n", V_VT(pDispParams->rgvarg));
997 ok(V_I4(pDispParams->rgvarg) == 0xdeadcafe , "failed %p\n", V_BSTR(pDispParams->rgvarg));
998 ok(V_VT(pDispParams->rgvarg+1) == VT_I4, "V_VT(var) = %d\n", V_VT(pDispParams->rgvarg+1));
999 ok(V_I4(pDispParams->rgvarg+1) == 0xdeadbeef, "failed %x\n", V_I4(pDispParams->rgvarg+1));
1000 }
1001
1002 return ERROR_SUCCESS;
1003}
#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 900 of file ordinal.c.

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

◆ Disp_Release()

static ULONG WINAPI Disp_Release ( IDispatch This)
static

Definition at line 928 of file ordinal.c.

929{
930 Disp *iface = impl_from_IDispatch(This);
931 ULONG ret;
932
934 if (ret == 0)
936 return ret;
937}

◆ DWORD()

static DWORD ( WINAPI pSHGetObjectCompatFlags)
static

◆ Enum_AddRef()

static ULONG WINAPI Enum_AddRef ( IEnumConnections This)
static

Definition at line 1038 of file ordinal.c.

1039{
1041 return InterlockedIncrement(&iface->refCount);
1042}
static EnumCon * impl_from_IEnumConnections(IEnumConnections *iface)
Definition: ordinal.c:880

◆ Enum_Clone()

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

Definition at line 1090 of file ordinal.c.

1093{
1094 return E_FAIL;
1095}

◆ Enum_Next()

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

Definition at line 1055 of file ordinal.c.

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

◆ Enum_QueryInterface()

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

Definition at line 1016 of file ordinal.c.

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

◆ Enum_Release()

static ULONG WINAPI Enum_Release ( IEnumConnections This)
static

Definition at line 1044 of file ordinal.c.

1045{
1047 ULONG ret;
1048
1050 if (ret == 0)
1052 return ret;
1053}

◆ Enum_Reset()

static HRESULT WINAPI Enum_Reset ( IEnumConnections This)
static

Definition at line 1084 of file ordinal.c.

1086{
1087 return E_FAIL;
1088}

◆ Enum_Skip()

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

Definition at line 1077 of file ordinal.c.

1080{
1081 return E_FAIL;
1082}

◆ EnumPt_AddRef()

static ULONG WINAPI EnumPt_AddRef ( IEnumConnectionPoints This)
static

Definition at line 1271 of file ordinal.c.

1272{
1274 return InterlockedIncrement(&iface->refCount);
1275}
static EnumPt * impl_from_IEnumConnectionPoints(IEnumConnectionPoints *iface)
Definition: ordinal.c:894

◆ EnumPt_Clone()

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

Definition at line 1322 of file ordinal.c.

1325{
1326 return E_FAIL;
1327}

◆ EnumPt_Next()

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

Definition at line 1288 of file ordinal.c.

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

◆ EnumPt_QueryInterface()

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

Definition at line 1249 of file ordinal.c.

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

◆ EnumPt_Release()

static ULONG WINAPI EnumPt_Release ( IEnumConnectionPoints This)
static

Definition at line 1277 of file ordinal.c.

1278{
1280 ULONG ret;
1281
1283 if (ret == 0)
1285 return ret;
1286}

◆ EnumPt_Reset()

static HRESULT WINAPI EnumPt_Reset ( IEnumConnectionPoints This)
static

Definition at line 1316 of file ordinal.c.

1318{
1319 return E_FAIL;
1320}

◆ EnumPt_Skip()

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

Definition at line 1309 of file ordinal.c.

1312{
1313 return E_FAIL;
1314}

◆ free_call_trace()

static void free_call_trace ( const call_trace_t ctrace)
static

Definition at line 126 of file ordinal.c.

127{
128 HeapFree(GetProcessHeap(), 0, ctrace->calls);
129}

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 866 of file ordinal.c.

867{
868 return CONTAINING_RECORD(iface, ConPt, IConnectionPoint_iface);
869}
#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 850 of file ordinal.c.

851{
852 return CONTAINING_RECORD(iface, Contain, IConnectionPointContainer_iface);
853}

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 836 of file ordinal.c.

837{
838 return CONTAINING_RECORD(iface, Disp, IDispatch_iface);
839}

Referenced by Disp_AddRef(), and Disp_Release().

◆ impl_from_IEnumConnectionPoints()

static EnumPt * impl_from_IEnumConnectionPoints ( IEnumConnectionPoints iface)
inlinestatic

Definition at line 894 of file ordinal.c.

895{
896 return CONTAINING_RECORD(iface, EnumPt, IEnumConnectionPoints_iface);
897}

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

◆ impl_from_IEnumConnections()

static EnumCon * impl_from_IEnumConnections ( IEnumConnections iface)
inlinestatic

Definition at line 880 of file ordinal.c.

881{
882 return CONTAINING_RECORD(iface, EnumCon, IEnumConnections_iface);
883}

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

◆ impl_from_IOleCommandTarget()

static IOleCommandTargetImpl * impl_from_IOleCommandTarget ( IOleCommandTarget iface)
inlinestatic

Definition at line 2099 of file ordinal.c.

2100{
2101 return CONTAINING_RECORD(iface, IOleCommandTargetImpl, IOleCommandTarget_iface);
2102}

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

◆ impl_from_IProfferService()

static IProfferServiceImpl * impl_from_IProfferService ( IProfferService iface)
inlinestatic

Definition at line 2197 of file ordinal.c.

2198{
2199 return CONTAINING_RECORD(iface, IProfferServiceImpl, IProfferService_iface);
2200}

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

◆ impl_from_IPropertyBag()

static PropBag * impl_from_IPropertyBag ( IPropertyBag iface)
inlinestatic

Definition at line 1507 of file ordinal.c.

1508{
1509 return CONTAINING_RECORD(iface, PropBag, IPropertyBag_iface);
1510}

Referenced by Prop_AddRef(), and Prop_Release().

◆ impl_from_IServiceProvider()

static IServiceProviderImpl * impl_from_IServiceProvider ( IServiceProvider iface)
inlinestatic

Definition at line 2187 of file ordinal.c.

2188{
2189 return CONTAINING_RECORD(iface, IServiceProviderImpl, IServiceProvider_iface);
2190}

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 119 of file ordinal.c.

120{
121 ctrace->alloc = 10;
122 ctrace->count = 0;
123 ctrace->calls = HeapAlloc(GetProcessHeap(), 0, sizeof(call_entry_t) * ctrace->alloc);
124}

Referenced by test_IUnknown_ProfferService(), and test_IUnknown_QueryServiceExec().

◆ init_pointers()

static void init_pointers ( void  )
static

Definition at line 2910 of file ordinal.c.

2911{
2912#define MAKEFUNC(f, ord) (p##f = (void*)GetProcAddress(hShlwapi, (LPSTR)(ord)))
2917 MAKEFUNC(SHMapHandle, 11);
2937 MAKEFUNC(SHGetShellKey, 491);
2940 MAKEFUNC(SKGetValueW, 516);
2941 MAKEFUNC(SKSetValueW, 517);
2943 MAKEFUNC(SKAllocValueW, 519);
2944#undef MAKEFUNC
2945
2946 pDllGetVersion = (void*)GetProcAddress(hShlwapi, "DllGetVersion");
2947}
#define GetProcAddress(x, y)
Definition: compat.h:753
HANDLE WINAPI SHAllocShared(LPCVOID lpvData, DWORD dwSize, DWORD dwProcId)
Definition: ordinal.c:169
HRESULT WINAPI IUnknown_QueryServiceExec(IUnknown *lpUnknown, REFIID service, const GUID *group, DWORD cmdId, DWORD cmdOpt, VARIANT *pIn, VARIANT *pOut)
Definition: ordinal.c:1553
BOOL WINAPI SHSetIniStringW(LPCWSTR appName, LPCWSTR keyName, LPCWSTR str, LPCWSTR filename)
Definition: ordinal.c:3426
LONG WINAPI SHSetWindowBits(HWND hwnd, INT offset, UINT mask, UINT flags)
Definition: ordinal.c:1130
HRESULT WINAPI GetAcceptLanguagesA(LPSTR langbuf, LPDWORD buflen)
Definition: ordinal.c:577
HWND WINAPI SHCreateWorkerWindowA(WNDPROC wndProc, HWND hWndParent, DWORD dwExStyle, DWORD dwStyle, HMENU hMenu, LONG_PTR wnd_extra)
Definition: ordinal.c:2679
HANDLE WINAPI SHMapHandle(HANDLE hShared, DWORD dwSrcProcId, DWORD dwDstProcId, DWORD dwAccess, DWORD dwOptions)
Definition: ordinal.c:98
HRESULT WINAPI IConnectionPoint_InvokeWithCancel(IConnectionPoint *iCP, DISPID dispId, DISPPARAMS *dispParams, DWORD unknown1, DWORD unknown2)
Definition: ordinal.c:3184
DWORD WINAPI SHGetIniStringW(LPCWSTR appName, LPCWSTR keyName, LPWSTR out, DWORD outLen, LPCWSTR filename)
Definition: ordinal.c:3379
HRESULT WINAPI IUnknown_ProfferService(IUnknown *lpUnknown, REFGUID service, IServiceProvider *pService, DWORD *pCookie)
Definition: ordinal.c:1592
HRESULT WINAPI ConnectToConnectionPoint(IUnknown *lpUnkSink, REFIID riid, BOOL fConnect, IUnknown *lpUnknown, LPDWORD lpCookie, IConnectionPoint **lppCP)
Definition: ordinal.c:1193
DWORD WINAPI SHGetObjectCompatFlags(IUnknown *pUnk, const CLSID *clsid)
Definition: ordinal.c:6294
INT WINAPI SHFormatDateTimeW(const FILETIME UNALIGNED *fileTime, DWORD *flags, LPWSTR buf, UINT size)
Definition: ordinal.c:5248
HRESULT WINAPI SKAllocValueW(DWORD flags, LPCWSTR subkey, LPCWSTR value, DWORD *type, LPVOID *data, DWORD *count)
Definition: ordinal.c:4806
HRESULT WINAPI IUnknown_GetClassID(IUnknown *lpUnknown, CLSID *clsid)
Definition: ordinal.c:1457
PVOID WINAPI SHLockShared(HANDLE hShared, DWORD dwProcId)
Definition: ordinal.c:259
INT WINAPI SHFormatDateTimeA(const FILETIME UNALIGNED *fileTime, DWORD *flags, LPSTR buf, UINT size)
Definition: ordinal.c:5313
HRESULT WINAPI SHIShellFolder_EnumObjects(LPSHELLFOLDER lpFolder, HWND hwnd, SHCONTF flags, IEnumIDList **ppenum)
Definition: ordinal.c:3869
HRESULT WINAPI SKGetValueW(DWORD flags, LPCWSTR subkey, LPCWSTR value, DWORD *type, void *data, DWORD *count)
Definition: ordinal.c:4863
HRESULT WINAPIV SHPackDispParams(DISPPARAMS *params, VARIANTARG *args, UINT cnt,...)
Definition: ordinal.c:3127
BOOL WINAPI SHFreeShared(HANDLE hShared, DWORD dwProcId)
Definition: ordinal.c:315
HRESULT WINAPI IConnectionPoint_SimpleInvoke(IConnectionPoint *iCP, DISPID dispId, DISPPARAMS *dispParams)
Definition: ordinal.c:3208
HKEY WINAPI SHGetShellKey(DWORD flags, LPCWSTR sub_key, BOOL create)
Definition: ordinal.c:4601
HRESULT WINAPI SKSetValueW(DWORD flags, LPCWSTR subkey, LPCWSTR value, DWORD type, void *data, DWORD count)
Definition: ordinal.c:4885
PSECURITY_DESCRIPTOR WINAPI GetShellSecurityDescriptor(const PSHELL_USER_PERMISSION *apUserPerm, int cUserPerm)
Definition: ordinal.c:5059
int WINAPI SHSearchMapInt(const int *lpKeys, const int *lpValues, int iLen, int iKey)
Definition: ordinal.c:2161
BOOL WINAPI SHUnlockShared(LPVOID lpView)
Definition: ordinal.c:295
HRESULT WINAPI SHPropertyBag_ReadLONG(IPropertyBag *ppb, LPCWSTR pszPropName, LPLONG pValue)
Definition: ordinal.c:5601
HRESULT WINAPI SKDeleteValueW(DWORD flags, LPCWSTR subkey, LPCWSTR value)
Definition: ordinal.c:4843
static HMODULE hShlwapi
Definition: ordinal.c:41
#define MAKEFUNC(f, ord)
HWND WINAPI SHSetParentHwnd(HWND hWnd, HWND hWndParent)
Definition: ordinal.c:1158
BOOL WINAPI GUIDFromStringA(LPCSTR str, LPGUID guid)
Definition: shellord.c:2090

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 2136 of file ordinal.c.

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

◆ IOleCommandTargetImpl_Construct()

static IOleCommandTarget * IOleCommandTargetImpl_Construct ( void  )
static

Definition at line 2106 of file ordinal.c.

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

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 2161 of file ordinal.c.

2168{
2169 add_call(&trace_got, 3, CmdGroup, (void*)(DWORD_PTR)nCmdID, (void*)(DWORD_PTR)nCmdexecopt, pvaIn, pvaOut);
2170 return S_OK;
2171}
static call_trace_t trace_got
Definition: ordinal.c:180
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:131
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 2117 of file ordinal.c.

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

◆ IOleCommandTargetImpl_QueryStatus()

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

Definition at line 2155 of file ordinal.c.

2157{
2158 return E_NOTIMPL;
2159}
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ IOleCommandTargetImpl_Release()

static ULONG WINAPI IOleCommandTargetImpl_Release ( IOleCommandTarget iface)
static

Definition at line 2142 of file ordinal.c.

2143{
2146
2147 if (!ref)
2148 {
2150 return 0;
2151 }
2152 return ref;
2153}
Definition: send.c:48

◆ IProfferServiceImpl_AddRef()

static ULONG WINAPI IProfferServiceImpl_AddRef ( IProfferService iface)
static

Definition at line 2361 of file ordinal.c.

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

◆ IProfferServiceImpl_Construct()

static IProfferService * IProfferServiceImpl_Construct ( void  )
static

Definition at line 2217 of file ordinal.c.

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

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 2380 of file ordinal.c.

2382{
2383 *pCookie = 0xdeadbeef;
2384 add_call(&trace_got, 3, service, pService, pCookie, 0, 0);
2385 return S_OK;
2386}

◆ IProfferServiceImpl_QueryInterface()

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

Definition at line 2336 of file ordinal.c.

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

◆ IProfferServiceImpl_Release()

static ULONG WINAPI IProfferServiceImpl_Release ( IProfferService iface)
static

Definition at line 2367 of file ordinal.c.

2368{
2371
2372 if (!ref)
2373 {
2375 return 0;
2376 }
2377 return ref;
2378}

◆ IProfferServiceImpl_RevokeService()

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

Definition at line 2388 of file ordinal.c.

2389{
2390 add_call(&trace_got, 4, (void*)(DWORD_PTR)cookie, 0, 0, 0, 0);
2391 return S_OK;
2392}
Definition: cookie.c:34

◆ IServiceProviderImpl_AddRef()

static ULONG WINAPI IServiceProviderImpl_AddRef ( IServiceProvider iface)
static

Definition at line 2250 of file ordinal.c.

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

◆ IServiceProviderImpl_Construct()

static IServiceProvider * IServiceProviderImpl_Construct ( void  )
static

Definition at line 2206 of file ordinal.c.

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

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 2228 of file ordinal.c.

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

◆ IServiceProviderImpl_QueryService()

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

Definition at line 2269 of file ordinal.c.

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

◆ IServiceProviderImpl_Release()

static ULONG WINAPI IServiceProviderImpl_Release ( IServiceProvider iface)
static

Definition at line 2256 of file ordinal.c.

2257{
2260
2261 if (!ref)
2262 {
2264 return 0;
2265 }
2266 return ref;
2267}

◆ 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 152 of file ordinal.c.

153{
154 if (texpected->count == tgot->count)
155 {
156 INT i;
157 /* compare */
158 for (i = 0; i < texpected->count; i++)
159 {
160 call_entry_t *expected = &texpected->calls[i];
161 call_entry_t *got = &tgot->calls[i];
162 INT j;
163
164 ok_(__FILE__, line)(expected->id == got->id, "got different ids %d: %d, %d\n", i+1, expected->id, got->id);
165
166 for (j = 0; j < 5; j++)
167 {
168 ok_(__FILE__, line)(expected->args[j] == got->args[j], "got different args[%d] for %d: %p, %p\n", j, i+1,
169 expected->args[j], got->args[j]);
170 }
171 }
172 }
173 else
174 ok_(__FILE__, line)(0, "traces length mismatch\n");
175}
#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 1535 of file ordinal.c.

1537{
1539 return InterlockedIncrement(&iface->refCount);
1540}
static PropBag * impl_from_IPropertyBag(IPropertyBag *iface)
Definition: ordinal.c:1507
LONG refCount
Definition: ordinal.c:1503

◆ Prop_QueryInterface()

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

Definition at line 1513 of file ordinal.c.

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

◆ Prop_Read()

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

Definition at line 1554 of file ordinal.c.

1559{
1560 V_VT(pVar) = VT_BLOB|VT_BYREF;
1561 V_BYREF(pVar) = (LPVOID)0xdeadcafe;
1562 return S_OK;
1563}
@ 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 1542 of file ordinal.c.

1544{
1546 ULONG ret;
1547
1549 if (ret == 0)
1551 return ret;
1552}

◆ Prop_Write()

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

Definition at line 1565 of file ordinal.c.

1569{
1570 return S_OK;
1571}

◆ r_verify_inifile()

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

Definition at line 2697 of file ordinal.c.

2698{
2699 HANDLE file;
2700 CHAR buf[1024];
2701 DWORD read;
2702
2704
2706 return;
2707
2708 ReadFile(file, buf, sizeof(buf) * sizeof(CHAR), &read, NULL);
2709 buf[read] = '\0';
2710
2712
2713 ok_(__FILE__,l)(!strcmp(buf, exp), "Expected:\n%s\nGot:\n%s\n", exp,
2714 buf);
2715}
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:168
#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 2528 of file ordinal.c.

2529{
2530 return 2;
2531}

◆ SF_BindToObject()

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

Definition at line 2553 of file ordinal.c.

2555{
2556 ok(0, "Didn't expect BindToObject\n");
2557 return E_NOTIMPL;
2558}

◆ SF_BindToStorage()

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

Definition at line 2560 of file ordinal.c.

2562{
2563 ok(0, "Didn't expect BindToStorage\n");
2564 return E_NOTIMPL;
2565}

◆ SF_CompareIDs()

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

Definition at line 2567 of file ordinal.c.

2569{
2570 ok(0, "Didn't expect CompareIDs\n");
2571 return E_NOTIMPL;
2572}

◆ SF_CreateViewObject()

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

Definition at line 2574 of file ordinal.c.

2576{
2577 ok(0, "Didn't expect CreateViewObject\n");
2578 return E_NOTIMPL;
2579}

◆ SF_EnumObjects()

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

Definition at line 2546 of file ordinal.c.

2548{
2549 *enm = (IEnumIDList*)0xcafebabe;
2550 return S_OK;
2551}

◆ SF_GetAttributesOf()

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

Definition at line 2581 of file ordinal.c.

2587{
2588 ok(0, "Didn't expect GetAttributesOf\n");
2589 return E_NOTIMPL;
2590}

◆ SF_GetDisplayNameOf()

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

Definition at line 2604 of file ordinal.c.

2606{
2607 ok(0, "Didn't expect GetDisplayNameOf\n");
2608 return E_NOTIMPL;
2609}

◆ 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 2592 of file ordinal.c.

2599{
2600 ok(0, "Didn't expect GetUIObjectOf\n");
2601 return E_NOTIMPL;
2602}

◆ 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 2538 of file ordinal.c.

2541{
2542 ok(0, "Didn't expect ParseDisplayName\n");
2543 return E_NOTIMPL;
2544}

◆ SF_QueryInterface()

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

Definition at line 2519 of file ordinal.c.

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

◆ SF_Release()

static ULONG WINAPI SF_Release ( IShellFolder iface)
static

Definition at line 2533 of file ordinal.c.

2534{
2535 return 1;
2536}

◆ SF_SetNameOf()

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

Definition at line 2611 of file ordinal.c.

2614{
2615 ok(0, "Didn't expect SetNameOf\n");
2616 return E_NOTIMPL;
2617}

◆ START_TEST()

START_TEST ( ordinal  )

Definition at line 3122 of file ordinal.c.

3123{
3124 char **argv;
3125 int argc;
3126
3127 hShlwapi = GetModuleHandleA("shlwapi.dll");
3128
3129 init_pointers();
3130
3132 if (argc >= 4)
3133 {
3134 DWORD procid;
3135 HANDLE hmem;
3136 sscanf(argv[2], "%d", &procid);
3137 sscanf(argv[3], "%p", &hmem);
3139 return;
3140 }
3141
3145 test_fdsa();
3164}
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:2403
static void test_alloc_shared_remote(DWORD procid, HANDLE hmem)
Definition: ordinal.c:532
static void test_IConnectionPoint(void)
Definition: ordinal.c:1451
static void test_SHCreateWorkerWindowA(void)
Definition: ordinal.c:2467
static void test_alloc_shared(int argc, char **argv)
Definition: ordinal.c:461
static void test_SHSetIniString(void)
Definition: ordinal.c:2768
static void test_SHSetParentHwnd(void)
Definition: ordinal.c:2949
static void test_IUnknown_QueryServiceExec(void)
Definition: ordinal.c:2295
static void test_GetShellSecurityDescriptor(void)
Definition: ordinal.c:689
static void test_GetAcceptLanguagesA(void)
Definition: ordinal.c:182
static void test_SHSearchMapInt(void)
Definition: ordinal.c:414
static void test_DllGetVersion(void)
Definition: ordinal.c:3114
static void test_SHFormatDateTimeW(void)
Definition: ordinal.c:1829
static void test_SHIShellFolder_EnumObjects(void)
Definition: ordinal.c:2637
static void test_SHGetIniString(void)
Definition: ordinal.c:2717
static void test_SHGetShellKey(void)
Definition: ordinal.c:2820
static void test_SHGetObjectCompatFlags(void)
Definition: ordinal.c:2018
static void test_fdsa(void)
Definition: ordinal.c:589
static void test_SHPackDispParams(void)
Definition: ordinal.c:786
static void test_SHPropertyBag_ReadLONG(void)
Definition: ordinal.c:1583
static void test_IUnknown_GetClassID(void)
Definition: ordinal.c:3082
static void test_SHSetWindowBits(void)
Definition: ordinal.c:1609
static void init_pointers(void)
Definition: ordinal.c:2910
static void test_SHFormatDateTimeA(void)
Definition: ordinal.c:1677
#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 101 of file ordinal.c.

102{
103 CHAR buf[512];
104 WideCharToMultiByte(CP_ACP, 0, strw, -1, buf, sizeof(buf), NULL, NULL);
105 return lstrcmpA(stra, buf);
106}
#define CP_ACP
Definition: compat.h:109
#define WideCharToMultiByte
Definition: compat.h:111
int WINAPI lstrcmpA(LPCSTR str1, LPCSTR str2)
Definition: locale.c:4194
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 461 of file ordinal.c.

462{
463 char cmdline[MAX_PATH];
465 STARTUPINFOA si = { 0 };
467 HANDLE hmem, hmem2 = 0;
468 struct shared_struct val, *p;
469 BOOL ret;
470
472 hmem=pSHAllocShared(NULL,10,procid);
473 ok(hmem!=NULL,"SHAllocShared(NULL...) failed: %u\n", GetLastError());
474 ret = pSHFreeShared(hmem, procid);
475 ok( ret, "SHFreeShared failed: %u\n", GetLastError());
476
477 val.value = 0x12345678;
478 val.handle = 0;
479 hmem = pSHAllocShared(&val, sizeof(val), procid);
480 ok(hmem!=NULL,"SHAllocShared(NULL...) failed: %u\n", GetLastError());
481
482 p=pSHLockShared(hmem,procid);
483 ok(p!=NULL,"SHLockShared failed: %u\n", GetLastError());
484 if (p!=NULL)
485 ok(p->value == 0x12345678, "Wrong value in shared memory: %d instead of %d\n", p->value, 0x12345678);
486 ret = pSHUnlockShared(p);
487 ok( ret, "SHUnlockShared failed: %u\n", GetLastError());
488
489 sprintf(cmdline, "%s %s %d %p", argv[0], argv[1], procid, hmem);
490 ret = CreateProcessA(NULL, cmdline, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi);
491 ok(ret, "could not create child process error: %u\n", GetLastError());
492 if (ret)
493 {
495 CloseHandle(pi.hThread);
496 CloseHandle(pi.hProcess);
497
498 p = pSHLockShared(hmem, procid);
499 ok(p != NULL,"SHLockShared failed: %u\n", GetLastError());
500 if (p != NULL && p->value != 0x12345678)
501 {
502 ok(p->value == 0x12345679, "Wrong value in shared memory: %d instead of %d\n", p->value, 0x12345679);
503 hmem2 = p->handle;
504 ok(hmem2 != NULL, "Expected handle in shared memory\n");
505 }
506 ret = pSHUnlockShared(p);
507 ok(ret, "SHUnlockShared failed: %u\n", GetLastError());
508 }
509
510 ret = pSHFreeShared(hmem, procid);
511 ok( ret, "SHFreeShared failed: %u\n", GetLastError());
512
513 if (hmem2)
514 {
515 p = pSHLockShared(hmem2, procid);
516 ok(p != NULL,"SHLockShared failed: %u\n", GetLastError());
517 if (p != NULL)
518 ok(p->value == 0xDEADBEEF, "Wrong value in shared memory: %d instead of %d\n", p->value, 0xDEADBEEF);
519 ret = pSHUnlockShared(p);
520 ok(ret, "SHUnlockShared failed: %u\n", GetLastError());
521
522 ret = pSHFreeShared(hmem2, procid);
523 ok(ret, "SHFreeShared failed: %u\n", GetLastError());
524 }
525
526 SetLastError(0xdeadbeef);
527 ret = pSHFreeShared(NULL, procid);
528 ok(ret, "SHFreeShared failed: %u\n", GetLastError());
529 ok(GetLastError() == 0xdeadbeef, "last error should not have changed, got %u\n", GetLastError());
530}
#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:4747
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:1042
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 532 of file ordinal.c.

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

Referenced by START_TEST().

◆ test_DllGetVersion()

static void test_DllGetVersion ( void  )
static

Definition at line 3114 of file ordinal.c.

3115{
3116 HRESULT hr;
3117
3118 hr = pDllGetVersion(NULL);
3119 ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
3120}
#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 589 of file ordinal.c.

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

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

690{
691 static const SHELL_USER_PERMISSION supCurrentUserFull = {
692 { {SECURITY_NULL_SID_AUTHORITY}, 0, 0 },
694 GENERIC_ALL, 0, 0 };
695#define MY_INHERITANCE 0xBE /* invalid value to proof behavior */
696 static const SHELL_USER_PERMISSION supEveryoneDenied = {
700 const SHELL_USER_PERMISSION* rgsup[2] = {
701 &supCurrentUserFull, &supEveryoneDenied,
702 };
704
705 if(!pGetShellSecurityDescriptor) /* vista and later */
706 {
707 win_skip("GetShellSecurityDescriptor not available\n");
708 return;
709 }
710
712 ok(psd==NULL, "GetShellSecurityDescriptor should fail\n");
713 psd = pGetShellSecurityDescriptor(rgsup, 0);
714 ok(psd==NULL, "GetShellSecurityDescriptor should fail, got %p\n", psd);
715
716 SetLastError(0xdeadbeef);
717 psd = pGetShellSecurityDescriptor(rgsup, 2);
718 ok(psd!=NULL, "GetShellSecurityDescriptor failed\n");
719 if (psd!=NULL)
720 {
721 BOOL bHasDacl = FALSE, bDefaulted, ret;
722 PACL pAcl;
723 DWORD dwRev;
725
726 ok(IsValidSecurityDescriptor(psd), "returned value is not valid SD\n");
727
729 ok(ret, "GetSecurityDescriptorControl failed with error %u\n", GetLastError());
730 ok(0 == (control & SE_SELF_RELATIVE), "SD should be absolute\n");
731
732 ret = GetSecurityDescriptorDacl(psd, &bHasDacl, &pAcl, &bDefaulted);
733 ok(ret, "GetSecurityDescriptorDacl failed with error %u\n", GetLastError());
734
735 ok(bHasDacl, "SD has no DACL\n");
736 if (bHasDacl)
737 {
738 ok(!bDefaulted, "DACL should not be defaulted\n");
739
740 ok(pAcl != NULL, "NULL DACL!\n");
741 if (pAcl != NULL)
742 {
743 ACL_SIZE_INFORMATION asiSize;
744
745 ok(IsValidAcl(pAcl), "DACL is not valid\n");
746
747 ret = GetAclInformation(pAcl, &asiSize, sizeof(asiSize), AclSizeInformation);
748 ok(ret, "GetAclInformation failed with error %u\n", GetLastError());
749
750 ok(asiSize.AceCount == 3, "Incorrect number of ACEs: %d entries\n", asiSize.AceCount);
751 if (asiSize.AceCount == 3)
752 {
753 ACCESS_ALLOWED_ACE *paaa; /* will use for DENIED too */
754
755 ret = GetAce(pAcl, 0, (LPVOID*)&paaa);
756 ok(ret, "GetAce failed with error %u\n", GetLastError());
758 "Invalid ACE type %d\n", paaa->Header.AceType);
759 ok(paaa->Header.AceFlags == 0, "Invalid ACE flags %x\n", paaa->Header.AceFlags);
760 ok(paaa->Mask == GENERIC_ALL, "Invalid ACE mask %x\n", paaa->Mask);
761
762 ret = GetAce(pAcl, 1, (LPVOID*)&paaa);
763 ok(ret, "GetAce failed with error %u\n", GetLastError());
765 "Invalid ACE type %d\n", paaa->Header.AceType);
766 /* first one of two ACEs generated from inheritable entry - without inheritance */
767 ok(paaa->Header.AceFlags == 0, "Invalid ACE flags %x\n", paaa->Header.AceFlags);
768 ok(paaa->Mask == GENERIC_WRITE, "Invalid ACE mask %x\n", paaa->Mask);
769
770 ret = GetAce(pAcl, 2, (LPVOID*)&paaa);
771 ok(ret, "GetAce failed with error %u\n", GetLastError());
773 "Invalid ACE type %d\n", paaa->Header.AceType);
774 /* second ACE - with inheritance */
776 "Invalid ACE flags %x\n", paaa->Header.AceFlags);
777 ok(paaa->Mask == GENERIC_READ, "Invalid ACE mask %x\n", paaa->Mask);
778 }
779 }
780 }
781
782 LocalFree(psd);
783 }
784}
#define TRUE
Definition: types.h:120
BOOL WINAPI GetAclInformation(PACL pAcl, LPVOID pAclInformation, DWORD nAclInformationLength, ACL_INFORMATION_CLASS dwAclInformationClass)
Definition: security.c:1194
BOOL WINAPI GetAce(PACL pAcl, DWORD dwAceIndex, LPVOID *pAce)
Definition: security.c:1186
BOOL WINAPI IsValidAcl(PACL pAcl)
Definition: security.c:1209
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1594
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
Definition: dialog.c:52
@ AclSizeInformation
Definition: winnt_old.h:1117
#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:834
#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 1451 of file ordinal.c.

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

Referenced by START_TEST().

◆ test_IUnknown_GetClassID()

static void test_IUnknown_GetClassID ( void  )
static

Definition at line 3082 of file ordinal.c.

3083{
3084 CLSID clsid, clsid2, clsid3;
3085 HRESULT hr;
3086
3087 if (0) /* crashes on native systems */
3088 hr = pIUnknown_GetClassID(NULL, NULL);
3089
3090 memset(&clsid, 0xcc, sizeof(clsid));
3091 memset(&clsid3, 0xcc, sizeof(clsid3));
3092 hr = pIUnknown_GetClassID(NULL, &clsid);
3093 ok(hr == E_FAIL, "got 0x%08x\n", hr);
3094 ok(IsEqualCLSID(&clsid, &CLSID_NULL) || broken(IsEqualCLSID(&clsid, &clsid3)) /* win2k, winxp, win2k3 */,
3095 "got wrong clsid %s\n", wine_dbgstr_guid(&clsid));
3096
3097 memset(&clsid, 0xcc, sizeof(clsid));
3098 memset(&clsid2, 0xab, sizeof(clsid2));
3099 hr = pIUnknown_GetClassID((IUnknown*)&testpersist, &clsid);
3100 ok(hr == 0x8fff2222, "got 0x%08x\n", hr);
3101 ok(IsEqualCLSID(&clsid, &clsid2) || broken(IsEqualCLSID(&clsid, &clsid3)) /* win2k3 */,
3102 "got wrong clsid %s\n", wine_dbgstr_guid(&clsid));
3103
3104 /* IPersistFolder is also supported */
3105 memset(&clsid, 0xcc, sizeof(clsid));
3106 memset(&clsid2, 0xab, sizeof(clsid2));
3107 memset(&clsid3, 0xcc, sizeof(clsid3));
3108 hr = pIUnknown_GetClassID((IUnknown*)&testpersist2, &clsid);
3109 ok(hr == 0x8fff2222, "got 0x%08x\n", hr);
3110 ok(IsEqualCLSID(&clsid, &clsid2) || broken(IsEqualCLSID(&clsid, &clsid3)) /* win2k3 */,
3111 "got wrong clsid %s\n", wine_dbgstr_guid(&clsid));
3112}
static IPersist testpersist2
Definition: ordinal.c:3080
static IPersist testpersist
Definition: ordinal.c:3079
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 2403 of file ordinal.c.

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

Referenced by START_TEST().

◆ test_IUnknown_QueryServiceExec()

static void test_IUnknown_QueryServiceExec ( void  )
static

Definition at line 2295 of file ordinal.c.

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

Referenced by START_TEST().

◆ test_SHCreateWorkerWindowA()

static void test_SHCreateWorkerWindowA ( void  )
static

Definition at line 2467 of file ordinal.c.

2468{
2469 WNDCLASSA cliA;
2470 char classA[20];
2471 HWND hwnd;
2472 LONG_PTR ret;
2473 BOOL res;
2474
2475 hwnd = pSHCreateWorkerWindowA(0, NULL, 0, 0, 0, 0);
2476 ok(hwnd != 0, "expected window\n");
2477
2478 GetClassNameA(hwnd, classA, 20);
2479 ok(lstrcmpA(classA, "WorkerA") == 0, "expected WorkerA class, got %s\n", classA);
2480
2482 ok(ret == 0, "got %ld\n", ret);
2483
2484 /* class info */
2485 memset(&cliA, 0, sizeof(cliA));
2486 res = GetClassInfoA(GetModuleHandleA("shlwapi.dll"), "WorkerA", &cliA);
2487 ok(res, "failed to get class info\n");
2488 ok(cliA.style == 0, "got 0x%08x\n", cliA.style);
2489 ok(cliA.cbClsExtra == 0, "got %d\n", cliA.cbClsExtra);
2490 ok(cliA.cbWndExtra == sizeof(LONG_PTR), "got %d\n", cliA.cbWndExtra);
2491 ok(cliA.lpszMenuName == 0, "got %s\n", cliA.lpszMenuName);
2492
2494
2495 /* set extra bytes */
2496 hwnd = pSHCreateWorkerWindowA(0, NULL, 0, 0, 0, 0xdeadbeef);
2497 ok(hwnd != 0, "expected window\n");
2498
2499 GetClassNameA(hwnd, classA, 20);
2500 ok(lstrcmpA(classA, "WorkerA") == 0, "expected WorkerA class, got %s\n", classA);
2501
2503 ok(ret == 0xdeadbeef, "got %ld\n", ret);
2504
2505 /* test exstyle */
2507 ok(ret == WS_EX_WINDOWEDGE ||
2508 ret == (WS_EX_WINDOWEDGE|WS_EX_LAYOUTRTL) /* systems with RTL locale */, "0x%08lx\n", ret);
2509
2511
2512 hwnd = pSHCreateWorkerWindowA(0, NULL, WS_EX_TOOLWINDOW, 0, 0, 0);
2515 ret == (WS_EX_WINDOWEDGE|WS_EX_TOOLWINDOW|WS_EX_LAYOUTRTL) /* systems with RTL locale */, "0x%08lx\n", ret);
2517}
GLuint res
Definition: glext.h:9613
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
int cbWndExtra
Definition: winuser.h:3169
UINT style
Definition: winuser.h:3166
LPCSTR lpszMenuName
Definition: winuser.h:3174
int cbClsExtra
Definition: winuser.h:3168
_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:4831
#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:854

Referenced by START_TEST().

◆ test_SHFormatDateTimeA()

static void test_SHFormatDateTimeA ( void  )
static

Definition at line 1677 of file ordinal.c.

1678{
1680 CHAR buff[100], buff2[100], buff3[100];
1681 SYSTEMTIME st;
1682 DWORD flags;
1683 INT ret;
1684
1685if (0)
1686{
1687 /* crashes on native */
1688 pSHFormatDateTimeA(NULL, NULL, NULL, 0);
1689}
1690
1691 GetLocalTime(&st);
1693 /* SHFormatDateTime expects input as utc */
1695
1696 /* no way to get required buffer length here */
1697 SetLastError(0xdeadbeef);
1698 ret = pSHFormatDateTimeA(&filetime, NULL, NULL, 0);
1699 ok(ret == 0, "got %d\n", ret);
1700 ok(GetLastError() == 0xdeadbeef || broken(GetLastError() == ERROR_SUCCESS /* Win7 */),
1701 "expected 0xdeadbeef, got %d\n", GetLastError());
1702
1703 SetLastError(0xdeadbeef);
1704 buff[0] = 'a'; buff[1] = 0;
1705 ret = pSHFormatDateTimeA(&filetime, NULL, buff, 0);
1706 ok(ret == 0, "got %d\n", ret);
1707 ok(GetLastError() == 0xdeadbeef, "expected 0xdeadbeef, got %d\n", GetLastError());
1708 ok(buff[0] == 'a', "expected same string, got %s\n", buff);
1709
1710 /* flags needs to have FDTF_NOAUTOREADINGORDER for these tests to succeed on Vista+ */
1711
1712 /* all combinations documented as invalid succeeded */
1714 SetLastError(0xdeadbeef);
1715 ret = pSHFormatDateTimeA(&filetime, &flags, buff, sizeof(buff));
1716 ok(ret == lstrlenA(buff)+1, "got %d\n", ret);
1717 ok(GetLastError() == 0xdeadbeef, "expected 0xdeadbeef, got %d\n", GetLastError());
1718
1720 SetLastError(0xdeadbeef);
1721 ret = pSHFormatDateTimeA(&filetime, &flags, buff, sizeof(buff));
1722 ok(ret == lstrlenA(buff)+1, "got %d\n", ret);
1723 ok(GetLastError() == 0xdeadbeef, "expected 0xdeadbeef, got %d\n", GetLastError());
1724
1726 SetLastError(0xdeadbeef);
1727 ret = pSHFormatDateTimeA(&filetime, &flags, buff, sizeof(buff));
1728 ok(ret == lstrlenA(buff)+1, "got %d\n", ret);
1729 ok(GetLastError() == 0xdeadbeef,
1730 "expected 0xdeadbeef, got %d\n", GetLastError());
1731
1732 /* now check returned strings */
1734 ret = pSHFormatDateTimeA(&filetime, &flags, buff, sizeof(buff));
1735 ok(ret == lstrlenA(buff)+1, "got %d\n", ret);
1736 ret = GetTimeFormatA(LOCALE_USER_DEFAULT, TIME_NOSECONDS, &st, NULL, buff2, sizeof(buff2));
1737 ok(ret == lstrlenA(buff2)+1, "got %d\n", ret);
1738 ok(lstrcmpA(buff, buff2) == 0, "expected (%s), got (%s)\n", buff2, buff);
1739
1741 ret = pSHFormatDateTimeA(&filetime, &flags, buff, sizeof(buff));
1742 ok(ret == lstrlenA(buff)+1, "got %d\n", ret);
1743 ret = GetTimeFormatA(LOCALE_USER_DEFAULT, 0, &st, NULL, buff2, sizeof(buff2));
1744 ok(ret == lstrlenA(buff2)+1, "got %d\n", ret);
1745 ok(lstrcmpA(buff, buff2) == 0, "expected (%s), got (%s)\n", buff2, buff);
1746
1747 /* both time flags */
1749 ret = pSHFormatDateTimeA(&filetime, &flags, buff, sizeof(buff));
1750 ok(ret == lstrlenA(buff)+1, "got %d\n", ret);
1751 ret = GetTimeFormatA(LOCALE_USER_DEFAULT, 0, &st, NULL, buff2, sizeof(buff2));
1752 ok(ret == lstrlenA(buff2)+1, "got %d\n", ret);
1753 ok(lstrcmpA(buff, buff2) == 0, "expected (%s), got (%s)\n", buff2, buff);
1754
1756 ret = pSHFormatDateTimeA(&filetime, &flags, buff, sizeof(buff));
1757 ok(ret == lstrlenA(buff)+1, "got %d\n", ret);
1758 ret = GetDateFormatA(LOCALE_USER_DEFAULT, DATE_SHORTDATE, &st, NULL, buff2, sizeof(buff2));
1759 ok(ret == lstrlenA(buff2)+1, "got %d\n", ret);
1760 ok(lstrcmpA(buff, buff2) == 0, "expected (%s), got (%s)\n", buff2, buff);
1761
1763 ret = pSHFormatDateTimeA(&filetime, &flags, buff, sizeof(buff));
1764 ok(ret == lstrlenA(buff)+1, "got %d\n", ret);
1765 ret = GetDateFormatA(LOCALE_USER_DEFAULT, DATE_LONGDATE, &st, NULL, buff2, sizeof(buff2));
1766 ok(ret == lstrlenA(buff2)+1, "got %d\n", ret);
1767 ok(lstrcmpA(buff, buff2) == 0, "expected (%s), got (%s)\n", buff2, buff);
1768
1769 /* both date flags */
1771 ret = pSHFormatDateTimeA(&filetime, &flags, buff, sizeof(buff));
1772 ok(ret == lstrlenA(buff)+1, "got %d\n", ret);
1773 ret = GetDateFormatA(LOCALE_USER_DEFAULT, DATE_LONGDATE, &st, NULL, buff2, sizeof(buff2));
1774 ok(ret == lstrlenA(buff2)+1, "got %d\n", ret);
1775 ok(lstrcmpA(buff, buff2) == 0, "expected (%s), got (%s)\n", buff2, buff);
1776
1777 /* various combinations of date/time flags */
1779 ret = pSHFormatDateTimeA(&filetime, &flags, buff, sizeof(buff));
1780 ok(ret == lstrlenA(buff)+1, "got %d, length %d\n", ret, lstrlenA(buff)+1);
1781 ret = GetTimeFormatA(LOCALE_USER_DEFAULT, TIME_NOSECONDS, &st, NULL, buff3, sizeof(buff3));
1782 ok(ret == lstrlenA(buff3)+1, "got %d\n", ret);
1783 ok(lstrcmpA(buff3, buff + lstrlenA(buff) - lstrlenA(buff3)) == 0,
1784 "expected (%s), got (%s) for time part\n",
1785 buff3, buff + lstrlenA(buff) - lstrlenA(buff3));
1786 ret = GetDateFormatA(LOCALE_USER_DEFAULT, DATE_LONGDATE, &st, NULL, buff2, sizeof(buff2));
1787 ok(ret == lstrlenA(buff2)+1, "got %d\n", ret);
1788 buff[lstrlenA(buff2)] = '\0';
1789 ok(lstrcmpA(buff2, buff) == 0, "expected (%s) got (%s) for date part\n",
1790 buff2, buff);
1791
1793 ret = pSHFormatDateTimeA(&filetime, &flags, buff, sizeof(buff));
1794 ok(ret == lstrlenA(buff)+1, "got %d\n", ret);
1795 ret = GetTimeFormatA(LOCALE_USER_DEFAULT, 0, &st, NULL, buff3, sizeof(buff3));
1796 ok(ret == lstrlenA(buff3)+1, "got %d\n", ret);
1797 ok(lstrcmpA(buff3, buff + lstrlenA(buff) - lstrlenA(buff3)) == 0,
1798 "expected (%s), got (%s) for time part\n",
1799 buff3, buff + lstrlenA(buff) - lstrlenA(buff3));
1800 ret = GetDateFormatA(LOCALE_USER_DEFAULT, DATE_LONGDATE, &st, NULL, buff2, sizeof(buff2));
1801 ok(ret == lstrlenA(buff2)+1, "got %d\n", ret);
1802 buff[lstrlenA(buff2)] = '\0';
1803 ok(lstrcmpA(buff2, buff) == 0, "expected (%s) got (%s) for date part\n",
1804 buff2, buff);
1805
1807 ret = pSHFormatDateTimeA(&filetime, &flags, buff, sizeof(buff));
1808 ok(ret == lstrlenA(buff)+1, "got %d\n", ret);
1809 ret = GetDateFormatA(LOCALE_USER_DEFAULT, DATE_SHORTDATE, &st, NULL, buff2, sizeof(buff2));
1810 ok(ret == lstrlenA(buff2)+1, "got %d\n", ret);
1811 strcat(buff2, " ");
1812 ret = GetTimeFormatA(LOCALE_USER_DEFAULT, TIME_NOSECONDS, &st, NULL, buff3, sizeof(buff3));
1813 ok(ret == lstrlenA(buff3)+1, "got %d\n", ret);
1814 strcat(buff2, buff3);
1815 ok(lstrcmpA(buff, buff2) == 0, "expected (%s), got (%s)\n", buff2, buff);
1816
1818 ret = pSHFormatDateTimeA(&filetime, &flags, buff, sizeof(buff));
1819 ok(ret == lstrlenA(buff)+1, "got %d\n", ret);
1820 ret = GetDateFormatA(LOCALE_USER_DEFAULT, DATE_SHORTDATE, &st, NULL, buff2, sizeof(buff2));
1821 ok(ret == lstrlenA(buff2)+1, "got %d\n", ret);
1822 strcat(buff2, " ");
1823 ret = GetTimeFormatA(LOCALE_USER_DEFAULT, 0, &st, NULL, buff3, sizeof(buff3));
1824 ok(ret == lstrlenA(buff3)+1, "got %d\n", ret);
1825 strcat(buff2, buff3);
1826 ok(lstrcmpA(buff, buff2) == 0, "expected (%s), got (%s)\n", buff2, buff);
1827}
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:1044
INT WINAPI GetDateFormatA(LCID lcid, DWORD dwFlags, const SYSTEMTIME *lpTime, LPCSTR lpFormat, LPSTR lpDateStr, INT cchOut)
Definition: lcformat.c:936
#define LOCALE_USER_DEFAULT
#define FDTF_SHORTTIME
Definition: shlwapi.h:2063
#define FDTF_NOAUTOREADINGORDER
Definition: shlwapi.h:2071
#define FDTF_LONGDATE
Definition: shlwapi.h:2066
#define FDTF_RTLDATE
Definition: shlwapi.h:2070
#define FDTF_LTRDATE
Definition: shlwapi.h:2069
#define FDTF_LONGTIME
Definition: shlwapi.h:2067
#define FDTF_SHORTDATE
Definition: shlwapi.h:2064
#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 1829 of file ordinal.c.

1830{
1832 WCHAR buff[100], buff2[100], buff3[100], *p1, *p2;
1833 SYSTEMTIME st;
1834 DWORD flags;
1835 INT ret;
1836 static const WCHAR spaceW[] = {' ',0};
1837#define UNICODE_LTR_MARK 0x200e
1838#define UNICODE_RTL_MARK 0x200f
1839
1840if (0)
1841{
1842 /* crashes on native */
1843 pSHFormatDateTimeW(NULL, NULL, NULL, 0);
1844}
1845
1846 GetLocalTime(&st);
1848 /* SHFormatDateTime expects input as utc */
1850
1851 /* no way to get required buffer length here */
1852 SetLastError(0xdeadbeef);
1853 ret = pSHFormatDateTimeW(&filetime, NULL, NULL, 0);
1854 ok(ret == 0, "expected 0, got %d\n", ret);
1855 ok(GetLastError() == 0xdeadbeef, "expected 0xdeadbeef, got %d\n", GetLastError());
1856
1857 SetLastError(0xdeadbeef);
1858 buff[0] = 'a'; buff[1] = 0;
1859 ret = pSHFormatDateTimeW(&filetime, NULL, buff, 0);
1860 ok(ret == 0, "expected 0, got %d\n", ret);
1861 ok(GetLastError() == 0xdeadbeef, "expected 0xdeadbeef, got %d\n", GetLastError());
1862 ok(buff[0] == 'a', "expected same string\n");
1863
1864 /* all combinations documented as invalid succeeded */
1866 SetLastError(0xdeadbeef);
1867 ret = pSHFormatDateTimeW(&filetime, &flags, buff, ARRAY_SIZE(buff));
1868 ok(ret == lstrlenW(buff)+1 || ret == lstrlenW(buff),
1869 "expected %d or %d, got %d\n", lstrlenW(buff)+1, lstrlenW(buff), ret);
1870 ok(GetLastError() == 0xdeadbeef, "expected 0xdeadbeef, got %d\n", GetLastError());
1871
1873 SetLastError(0xdeadbeef);
1874 ret = pSHFormatDateTimeW(&filetime, &flags, buff, ARRAY_SIZE(buff));
1875 ok(ret == lstrlenW(buff)+1 || ret == lstrlenW(buff),
1876 "expected %d or %d, got %d\n", lstrlenW(buff)+1, lstrlenW(buff), ret);
1877 ok(GetLastError() == 0xdeadbeef, "expected 0xdeadbeef, got %d\n", GetLastError());
1878
1880 SetLastError(0xdeadbeef);
1881 buff[0] = 0; /* NT4 doesn't clear the buffer on failure */
1882 ret = pSHFormatDateTimeW(&filetime, &flags, buff, ARRAY_SIZE(buff));
1883 ok(ret == lstrlenW(buff)+1 || ret == lstrlenW(buff),
1884 "expected %d or %d, got %d\n", lstrlenW(buff)+1, lstrlenW(buff), ret);
1885 ok(GetLastError() == 0xdeadbeef,
1886 "expected 0xdeadbeef, got %d\n", GetLastError());
1887
1888 /* now check returned strings */
1890 ret = pSHFormatDateTimeW(&filetime, &flags, buff, ARRAY_SIZE(buff));
1891 ok(ret == lstrlenW(buff)+1 || ret == lstrlenW(buff),
1892 "expected %d or %d, got %d\n", lstrlenW(buff)+1, lstrlenW(buff), ret);
1893 SetLastError(0xdeadbeef);
1895 ok(ret == lstrlenW(buff2)+1, "expected %d, got %d\n", lstrlenW(buff2)+1, ret);
1896 ok(lstrcmpW(buff, buff2) == 0, "expected equal strings\n");
1897
1899 ret = pSHFormatDateTimeW(&filetime, &flags, buff, ARRAY_SIZE(buff));
1900 ok(ret == lstrlenW(buff)+1 || ret == lstrlenW(buff),
1901 "expected %d or %d, got %d\n", lstrlenW(buff)+1, lstrlenW(buff), ret);
1902 ret = GetTimeFormatW(LOCALE_USER_DEFAULT, 0, &st, NULL, buff2, ARRAY_SIZE(buff2));
1903 ok(ret == lstrlenW(buff2)+1, "expected %d, got %d\n", lstrlenW(buff2)+1, ret);
1904 ok(lstrcmpW(buff, buff2) == 0, "expected equal strings\n");
1905
1906 /* both time flags */
1908 ret = pSHFormatDateTimeW(&filetime, &flags, buff, ARRAY_SIZE(buff));
1909 ok(ret == lstrlenW(buff)+1 || ret == lstrlenW(buff),
1910 "expected %d or %d, got %d\n", lstrlenW(buff)+1, lstrlenW(buff), ret);
1911 ret = GetTimeFormatW(LOCALE_USER_DEFAULT, 0, &st, NULL, buff2, ARRAY_SIZE(buff2));
1912 ok(ret == lstrlenW(buff2)+1, "expected %d, got %d\n", lstrlenW(buff2)+1, ret);
1913 ok(lstrcmpW(buff, buff2) == 0, "expected equal string\n");
1914
1916 ret = pSHFormatDateTimeW(&filetime, &flags, buff, ARRAY_SIZE(buff));
1917 ok(ret == lstrlenW(buff)+1 || ret == lstrlenW(buff),
1918 "expected %d or %d, got %d\n", lstrlenW(buff)+1, lstrlenW(buff), ret);
1920 ok(ret == lstrlenW(buff2)+1, "expected %d, got %d\n", lstrlenW(buff2)+1, ret);
1921 ok(lstrcmpW(buff, buff2) == 0, "expected equal strings\n");
1922
1924 ret = pSHFormatDateTimeW(&filetime, &flags, buff, ARRAY_SIZE(buff));
1925 ok(ret == lstrlenW(buff)+1 || ret == lstrlenW(buff),
1926 "expected %d or %d, got %d\n", lstrlenW(buff)+1, lstrlenW(buff), ret);
1928 ok(ret == lstrlenW(buff2)+1, "expected %d, got %d\n", lstrlenW(buff2)+1, ret);
1929 ok(lstrcmpW(buff, buff2) == 0, "expected equal strings\n");
1930
1931 /* both date flags */
1933 ret = pSHFormatDateTimeW(&filetime, &flags, buff, ARRAY_SIZE(buff));
1934 ok(ret == lstrlenW(buff)+1 || ret == lstrlenW(buff),
1935 "expected %d or %d, got %d\n", lstrlenW(buff)+1, lstrlenW(buff), ret);
1937 ok(ret == lstrlenW(buff2)+1, "expected %d, got %d\n", lstrlenW(buff2)+1, ret);
1938 ok(lstrcmpW(buff, buff2) == 0, "expected equal strings\n");
1939
1940 /* various combinations of date/time flags */
1942 ret = pSHFormatDateTimeW(&filetime, &flags, buff, ARRAY_SIZE(buff));
1943 ok(ret == lstrlenW(buff)+1 || ret == lstrlenW(buff),
1944 "expected %d or %d, got %d\n", lstrlenW(buff)+1, lstrlenW(buff), ret);
1946 ok(ret == lstrlenW(buff3)+1, "expected %d, got %d\n", lstrlenW(buff3)+1, ret);
1947 ok(lstrcmpW(buff3, buff + lstrlenW(buff) - lstrlenW(buff3)) == 0,
1948 "expected (%s), got (%s) for time part\n",
1949 wine_dbgstr_w(buff3), wine_dbgstr_w(buff + lstrlenW(buff) - lstrlenW(buff3)));
1951 ok(ret == lstrlenW(buff2)+1, "expected %d, got %d\n", lstrlenW(buff2)+1, ret);
1952 p1 = buff;
1953 p2 = buff2;
1954 while (*p2 != '\0')
1955 {
1956 while (*p1 == UNICODE_LTR_MARK || *p1 == UNICODE_RTL_MARK)
1957 p1++;
1958 while (*p2 == UNICODE_LTR_MARK || *p2 == UNICODE_RTL_MARK)
1959 p2++;
1960 p1++;
1961 p2++;
1962 }
1963 *p1 = '\0';
1964 ok(lstrcmpW(buff2, buff) == 0, "expected (%s) got (%s) for date part\n",
1966
1968 ret = pSHFormatDateTimeW(&filetime, &flags, buff, ARRAY_SIZE(buff));
1969 ok(ret == lstrlenW(buff)+1 || ret == lstrlenW(buff),
1970 "expected %d or %d, got %d\n", lstrlenW(buff)+1, lstrlenW(buff), ret);
1971 ret = GetTimeFormatW(LOCALE_USER_DEFAULT, 0, &st, NULL, buff3, ARRAY_SIZE(buff3));
1972 ok(ret == lstrlenW(buff3)+1, "expected %d, got %d\n", lstrlenW(buff3)+1, ret);
1973 ok(lstrcmpW(buff3, buff + lstrlenW(buff) - lstrlenW(buff3)) == 0,
1974 "expected (%s), got (%s) for time part\n",
1975 wine_dbgstr_w(buff3), wine_dbgstr_w(buff + lstrlenW(buff) - lstrlenW(buff3)));
1977 ok(ret == lstrlenW(buff2)+1, "expected %d, got %d\n", lstrlenW(buff2)+1, ret);
1978 p1 = buff;
1979 p2 = buff2;
1980 while (*p2 != '\0')
1981 {
1982 while (*p1 == UNICODE_LTR_MARK || *p1 == UNICODE_RTL_MARK)
1983 p1++;
1984 while (*p2 == UNICODE_LTR_MARK || *p2 == UNICODE_RTL_MARK)
1985 p2++;
1986 p1++;
1987 p2++;
1988 }
1989 *p1 = '\0';
1990 ok(lstrcmpW(buff2,