ReactOS  0.4.13-dev-455-g28ed234
oleaut.c File Reference
#include "config.h"
#include <stdarg.h>
#include <stdio.h>
#include <string.h>
#include <limits.h>
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "winerror.h"
#include "ole2.h"
#include "olectl.h"
#include "oleauto.h"
#include "initguid.h"
#include "typelib.h"
#include "oleaut32_oaidl.h"
#include "wine/debug.h"
#include "wine/unicode.h"
Include dependency graph for oleaut.c:

Go to the source code of this file.

Classes

struct  bstr_t
 
struct  bstr_cache_entry_t
 
struct  tlibredirect_data
 

Macros

#define COBJMACROS
 
#define BUCKET_SIZE   16
 
#define BUCKET_BUFFER_SIZE   6
 
#define ARENA_INUSE_FILLER   0x55
 
#define ARENA_TAIL_FILLER   0xab
 
#define ARENA_FREE_FILLER   0xfeeefeee
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (ole)
 
 WINE_DECLARE_DEBUG_CHANNEL (heap)
 
static size_t bstr_alloc_size (size_t size)
 
static bstr_tbstr_from_str (BSTR str)
 
static bstr_cache_entry_tget_cache_entry_from_idx (unsigned cache_idx)
 
static bstr_cache_entry_tget_cache_entry (size_t size)
 
static bstr_cache_entry_tget_cache_entry_from_alloc_size (SIZE_T alloc_size)
 
static bstr_talloc_bstr (size_t size)
 
UINT WINAPI SysStringLen (BSTR str)
 
UINT WINAPI SysStringByteLen (BSTR str)
 
BSTR WINAPI SysAllocString (LPCOLESTR str)
 
static IMallocget_malloc (void)
 
void WINAPI DECLSPEC_HOTPATCH SysFreeString (BSTR str)
 
BSTR WINAPI SysAllocStringLen (const OLECHAR *str, unsigned int len)
 
int WINAPI SysReAllocStringLen (BSTR *old, const OLECHAR *str, unsigned int len)
 
BSTR WINAPI DECLSPEC_HOTPATCH SysAllocStringByteLen (LPCSTR str, UINT len)
 
INT WINAPI SysReAllocString (LPBSTR old, LPCOLESTR str)
 
void WINAPI SetOaNoCache (void)
 
HRESULT WINAPI DECLSPEC_HOTPATCH RegisterActiveObject (LPUNKNOWN punk, REFCLSID rcid, DWORD dwFlags, LPDWORD pdwRegister)
 
HRESULT WINAPI DECLSPEC_HOTPATCH RevokeActiveObject (DWORD xregister, LPVOID reserved)
 
HRESULT WINAPI DECLSPEC_HOTPATCH GetActiveObject (REFCLSID rcid, LPVOID preserved, LPUNKNOWN *ppunk)
 
ULONG WINAPI OaBuildVersion (void)
 
HRESULT WINAPI OleTranslateColor (OLE_COLOR clr, HPALETTE hpal, COLORREF *pColorRef)
 
HRESULT WINAPI OLEAUTPS_DllGetClassObject (REFCLSID, REFIID, LPVOID *)
 
static BOOL actctx_get_typelib_module (REFIID iid, WCHAR *module, DWORD len)
 
static HRESULT reg_get_typelib_module (REFIID iid, WCHAR *module, DWORD len)
 
static HRESULT get_typeinfo_for_iid (REFIID iid, ITypeInfo **typeinfo)
 
static HRESULT WINAPI typelib_ps_QueryInterface (IPSFactoryBuffer *iface, REFIID iid, void **out)
 
static ULONG WINAPI typelib_ps_AddRef (IPSFactoryBuffer *iface)
 
static ULONG WINAPI typelib_ps_Release (IPSFactoryBuffer *iface)
 
static HRESULT WINAPI typelib_ps_CreateProxy (IPSFactoryBuffer *iface, IUnknown *outer, REFIID iid, IRpcProxyBuffer **proxy, void **out)
 
static HRESULT WINAPI typelib_ps_CreateStub (IPSFactoryBuffer *iface, REFIID iid, IUnknown *server, IRpcStubBuffer **stub)
 
void _get_STDFONT_CF (LPVOID *)
 
void _get_STDPIC_CF (LPVOID *)
 
static HRESULT WINAPI PSDispatchFacBuf_QueryInterface (IPSFactoryBuffer *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI PSDispatchFacBuf_AddRef (IPSFactoryBuffer *iface)
 
static ULONG WINAPI PSDispatchFacBuf_Release (IPSFactoryBuffer *iface)
 
static HRESULT WINAPI PSDispatchFacBuf_CreateProxy (IPSFactoryBuffer *iface, IUnknown *outer, REFIID iid, IRpcProxyBuffer **proxy, void **obj)
 
static HRESULT WINAPI PSDispatchFacBuf_CreateStub (IPSFactoryBuffer *iface, REFIID iid, IUnknown *server, IRpcStubBuffer **stub)
 
HRESULT WINAPI DllGetClassObject (REFCLSID rclsid, REFIID iid, LPVOID *ppv)
 
HRESULT WINAPI DllCanUnloadNow (void)
 
BOOL WINAPI DllMain (HINSTANCE hInstDll, DWORD fdwReason, LPVOID lpvReserved)
 
HRESULT WINAPI DllRegisterServer (void)
 
HRESULT WINAPI DllUnregisterServer (void)
 
HCURSOR WINAPI OleIconToCursor (HINSTANCE hinstExe, HICON hIcon)
 
HRESULT WINAPI GetAltMonthNames (LCID lcid, LPOLESTR **str)
 

Variables

static BOOL bstr_cache_enabled
 
static CRITICAL_SECTION cs_bstr_cache = { &cs_bstr_cache_dbg, -1, 0, 0, 0, 0 }
 
static CRITICAL_SECTION_DEBUG cs_bstr_cache_dbg
 
static bstr_cache_entry_t bstr_cache [0x10000/BUCKET_SIZE]
 
static const WCHAR _delimiter [] = {'!',0}
 
static const WCHARpdelimiter = &_delimiter[0]
 
static const IPSFactoryBufferVtbl typelib_ps_vtbl
 
static IPSFactoryBuffer typelib_ps = { &typelib_ps_vtbl }
 
static const IPSFactoryBufferVtbl PSDispatchFacBuf_Vtbl
 
static const IPSFactoryBufferVtbl * pPSDispatchFacBuf = &PSDispatchFacBuf_Vtbl
 

Macro Definition Documentation

◆ ARENA_FREE_FILLER

#define ARENA_FREE_FILLER   0xfeeefeee

Definition at line 110 of file oleaut.c.

◆ ARENA_INUSE_FILLER

#define ARENA_INUSE_FILLER   0x55

Definition at line 108 of file oleaut.c.

◆ ARENA_TAIL_FILLER

#define ARENA_TAIL_FILLER   0xab

Definition at line 109 of file oleaut.c.

◆ BUCKET_BUFFER_SIZE

#define BUCKET_BUFFER_SIZE   6

Definition at line 100 of file oleaut.c.

◆ BUCKET_SIZE

#define BUCKET_SIZE   16

Definition at line 99 of file oleaut.c.

◆ COBJMACROS

#define COBJMACROS

Definition at line 28 of file oleaut.c.

Function Documentation

◆ _get_STDFONT_CF()

void _get_STDFONT_CF ( LPVOID )

Definition at line 2286 of file olefont.c.

2286 { *ppv = &STDFONT_CF; }
REFIID LPVOID * ppv
Definition: atlbase.h:39
static IClassFactoryImpl STDFONT_CF
Definition: olefont.c:2284

Referenced by DllGetClassObject().

◆ _get_STDPIC_CF()

void _get_STDPIC_CF ( LPVOID )

Definition at line 2626 of file olepicture.c.

2626 { *ppv = &STDPIC_CF; }
static IClassFactoryImpl STDPIC_CF
Definition: olepicture.c:2624
REFIID LPVOID * ppv
Definition: atlbase.h:39

Referenced by DllGetClassObject().

◆ actctx_get_typelib_module()

static BOOL actctx_get_typelib_module ( REFIID  iid,
WCHAR module,
DWORD  len 
)
static

Definition at line 801 of file oleaut.c.

802 {
803  struct ifacepsredirect_data *iface;
804  struct tlibredirect_data *tlib;
805  ACTCTX_SECTION_KEYED_DATA data;
806  WCHAR *ptrW;
807 
808  data.cbSize = sizeof(data);
809  if (!FindActCtxSectionGuid(0, NULL, ACTIVATION_CONTEXT_SECTION_COM_INTERFACE_REDIRECTION,
810  iid, &data))
811  return FALSE;
812 
813  iface = (struct ifacepsredirect_data *)data.lpData;
814  if (!FindActCtxSectionGuid(0, NULL, ACTIVATION_CONTEXT_SECTION_COM_TYPE_LIBRARY_REDIRECTION,
815  &iface->tlbid, &data))
816  return FALSE;
817 
818  tlib = (struct tlibredirect_data *)data.lpData;
819  ptrW = (WCHAR *)((BYTE *)data.lpSectionBase + tlib->name_offset);
820 
821  if (tlib->name_len/sizeof(WCHAR) >= len)
822  {
823  ERR("need larger module buffer, %u\n", tlib->name_len);
824  return FALSE;
825  }
826 
827  memcpy(module, ptrW, tlib->name_len);
828  module[tlib->name_len/sizeof(WCHAR)] = 0;
829  return TRUE;
830 }
#define TRUE
Definition: types.h:120
ULONG name_len
Definition: oleaut.c:791
smooth NULL
Definition: ftsmooth.c:416
if(!(yy_init))
Definition: macro.lex.yy.c:714
__wchar_t WCHAR
Definition: xmlstorage.h:180
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
ULONG name_offset
Definition: oleaut.c:792
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum GLsizei len
Definition: glext.h:6722
unsigned char BYTE
Definition: mem.h:68
#define ERR(fmt,...)
Definition: debug.h:109
BOOL WINAPI FindActCtxSectionGuid(DWORD dwFlags, const GUID *lpExtGuid, ULONG ulId, const GUID *lpSearchGuid, PACTCTX_SECTION_KEYED_DATA pInfo)
Definition: actctx.c:183

Referenced by get_typeinfo_for_iid().

◆ alloc_bstr()

static bstr_t* alloc_bstr ( size_t  size)
static

Definition at line 143 of file oleaut.c.

144 {
146  bstr_t *ret;
147 
148  if(cache_entry) {
150 
151  if(!cache_entry->cnt) {
153  if(cache_entry && !cache_entry->cnt)
154  cache_entry = NULL;
155  }
156 
157  if(cache_entry) {
158  ret = cache_entry->buf[cache_entry->head++];
160  cache_entry->cnt--;
161  }
162 
164 
165  if(cache_entry) {
166  if(WARN_ON(heap)) {
167  size_t fill_size = (FIELD_OFFSET(bstr_t, u.ptr[size])+2*sizeof(WCHAR)-1) & ~(sizeof(WCHAR)-1);
168  memset(ret, ARENA_INUSE_FILLER, fill_size);
169  memset((char *)ret+fill_size, ARENA_TAIL_FILLER, bstr_alloc_size(size)-fill_size);
170  }
171  ret->size = size;
172  return ret;
173  }
174  }
175 
177  if(ret)
178  ret->size = size;
179  return ret;
180 }
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 * u
Definition: glfuncs.h:240
#define ARENA_INUSE_FILLER
Definition: oleaut.c:108
static CRITICAL_SECTION cs_bstr_cache
Definition: oleaut.c:78
Definition: oleaut.c:102
static size_t bstr_alloc_size(size_t size)
Definition: oleaut.c:114
#define BUCKET_SIZE
Definition: oleaut.c:99
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
Definition: svc_auth_des.c:77
#define WARN_ON(c)
Definition: module.h:255
static bstr_cache_entry_t * get_cache_entry(size_t size)
Definition: oleaut.c:129
Definition: oleaut.c:87
smooth NULL
Definition: ftsmooth.c:416
#define ARENA_TAIL_FILLER
Definition: oleaut.c:109
GLsizeiptr size
Definition: glext.h:5919
__wchar_t WCHAR
Definition: xmlstorage.h:180
int ret
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:254
#define BUCKET_BUFFER_SIZE
Definition: oleaut.c:100
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
#define memset(x, y, z)
Definition: compat.h:39
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: ifs.c:406

Referenced by SysAllocStringByteLen(), and SysAllocStringLen().

◆ bstr_alloc_size()

static size_t bstr_alloc_size ( size_t  size)
inlinestatic

Definition at line 114 of file oleaut.c.

115 {
116  return (FIELD_OFFSET(bstr_t, u.ptr[size]) + sizeof(WCHAR) + BUCKET_SIZE-1) & ~(BUCKET_SIZE-1);
117 }
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 * u
Definition: glfuncs.h:240
#define BUCKET_SIZE
Definition: oleaut.c:99
Definition: oleaut.c:87
GLsizeiptr size
Definition: glext.h:5919
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:254

Referenced by alloc_bstr(), and SysReAllocStringLen().

◆ bstr_from_str()

static bstr_t* bstr_from_str ( BSTR  str)
inlinestatic

Definition at line 119 of file oleaut.c.

120 {
121  return CONTAINING_RECORD((void *)str, bstr_t, u.str);
122 }
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 * u
Definition: glfuncs.h:240
Definition: oleaut.c:87
const WCHAR * str
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560

Referenced by SysFreeString(), SysReAllocStringLen(), SysStringByteLen(), and SysStringLen().

◆ DllCanUnloadNow()

HRESULT WINAPI DllCanUnloadNow ( void  )

Definition at line 1119 of file oleaut.c.

1120 {
1121  return S_FALSE;
1122 }
#define S_FALSE
Definition: winerror.h:2357

◆ DllGetClassObject()

HRESULT WINAPI DllGetClassObject ( REFCLSID  rclsid,
REFIID  iid,
LPVOID ppv 
)

Definition at line 1072 of file oleaut.c.

1073 {
1074  *ppv = NULL;
1075  if (IsEqualGUID(rclsid,&CLSID_StdFont)) {
1076  if (IsEqualGUID(iid,&IID_IClassFactory)) {
1078  IClassFactory_AddRef((IClassFactory*)*ppv);
1079  return S_OK;
1080  }
1081  }
1082  if (IsEqualGUID(rclsid,&CLSID_StdPicture)) {
1083  if (IsEqualGUID(iid,&IID_IClassFactory)) {
1085  IClassFactory_AddRef((IClassFactory*)*ppv);
1086  return S_OK;
1087  }
1088  }
1089  if (IsEqualCLSID(rclsid, &CLSID_PSDispatch) && IsEqualIID(iid, &IID_IPSFactoryBuffer)) {
1090  *ppv = &pPSDispatchFacBuf;
1091  IPSFactoryBuffer_AddRef((IPSFactoryBuffer *)*ppv);
1092  return S_OK;
1093  }
1094 
1095  if (IsEqualGUID(rclsid, &CLSID_PSOAInterface))
1096  return IPSFactoryBuffer_QueryInterface(&typelib_ps, iid, ppv);
1097 
1098  if (IsEqualCLSID(rclsid, &CLSID_PSTypeComp) ||
1099  IsEqualCLSID(rclsid, &CLSID_PSTypeInfo) ||
1100  IsEqualCLSID(rclsid, &CLSID_PSTypeLib) ||
1101  IsEqualCLSID(rclsid, &CLSID_PSDispatch) ||
1102  IsEqualCLSID(rclsid, &CLSID_PSEnumVariant))
1103  return OLEAUTPS_DllGetClassObject(&CLSID_PSFactoryBuffer, iid, ppv);
1104 
1105  return OLEAUTPS_DllGetClassObject(rclsid, iid, ppv);
1106 }
REFIID LPVOID * ppv
Definition: atlbase.h:39
void _get_STDFONT_CF(LPVOID *)
Definition: olefont.c:2286
const GUID CLSID_StdFont
static IPSFactoryBuffer typelib_ps
Definition: oleaut.c:992
smooth NULL
Definition: ftsmooth.c:416
HRESULT WINAPI OLEAUTPS_DllGetClassObject(REFCLSID, REFIID, LPVOID *)
Definition: oleaut.c:765
void _get_STDPIC_CF(LPVOID *)
Definition: olepicture.c:2626
static const IPSFactoryBufferVtbl * pPSDispatchFacBuf
Definition: oleaut.c:1067
#define S_OK
Definition: intsafe.h:59
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021
const GUID CLSID_StdPicture
const GUID IID_IClassFactory
#define IsEqualCLSID(rclsid1, rclsid2)
Definition: guiddef.h:91
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:90

◆ DllMain()

BOOL WINAPI DllMain ( HINSTANCE  hInstDll,
DWORD  fdwReason,
LPVOID  lpvReserved 
)

Definition at line 1127 of file oleaut.c.

1128 {
1129  static const WCHAR oanocacheW[] = {'o','a','n','o','c','a','c','h','e',0};
1130 
1131  if(fdwReason == DLL_PROCESS_ATTACH)
1132  bstr_cache_enabled = !GetEnvironmentVariableW(oanocacheW, NULL, 0);
1133 
1134  return OLEAUTPS_DllMain( hInstDll, fdwReason, lpvReserved );
1135 }
#define DLL_PROCESS_ATTACH
Definition: compat.h:120
static IN DWORD IN LPVOID lpvReserved
smooth NULL
Definition: ftsmooth.c:416
__wchar_t WCHAR
Definition: xmlstorage.h:180
static BOOL bstr_cache_enabled
Definition: oleaut.c:76
#define GetEnvironmentVariableW(x, y, z)
Definition: compat.h:412

◆ DllRegisterServer()

HRESULT WINAPI DllRegisterServer ( void  )

Definition at line 1140 of file oleaut.c.

1141 {
1142  return OLEAUTPS_DllRegisterServer();
1143 }

◆ DllUnregisterServer()

HRESULT WINAPI DllUnregisterServer ( void  )

Definition at line 1148 of file oleaut.c.

1149 {
1150  return OLEAUTPS_DllUnregisterServer();
1151 }

◆ get_cache_entry()

static bstr_cache_entry_t* get_cache_entry ( size_t  size)
inlinestatic

Definition at line 129 of file oleaut.c.

130 {
131  unsigned cache_idx = FIELD_OFFSET(bstr_t, u.ptr[size+sizeof(WCHAR)-1])/BUCKET_SIZE;
132  return get_cache_entry_from_idx(cache_idx);
133 }
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 * u
Definition: glfuncs.h:240
static bstr_cache_entry_t * get_cache_entry_from_idx(unsigned cache_idx)
Definition: oleaut.c:124
#define BUCKET_SIZE
Definition: oleaut.c:99
Definition: oleaut.c:87
GLsizeiptr size
Definition: glext.h:5919
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:254

Referenced by alloc_bstr().

◆ get_cache_entry_from_alloc_size()

static bstr_cache_entry_t* get_cache_entry_from_alloc_size ( SIZE_T  alloc_size)
inlinestatic

Definition at line 135 of file oleaut.c.

136 {
137  unsigned cache_idx;
138  if (alloc_size < BUCKET_SIZE) return NULL;
139  cache_idx = (alloc_size - BUCKET_SIZE) / BUCKET_SIZE;
140  return get_cache_entry_from_idx(cache_idx);
141 }
static bstr_cache_entry_t * get_cache_entry_from_idx(unsigned cache_idx)
Definition: oleaut.c:124
#define BUCKET_SIZE
Definition: oleaut.c:99
smooth NULL
Definition: ftsmooth.c:416

Referenced by SysFreeString().

◆ get_cache_entry_from_idx()

static bstr_cache_entry_t* get_cache_entry_from_idx ( unsigned  cache_idx)
inlinestatic

Definition at line 124 of file oleaut.c.

125 {
126  return bstr_cache_enabled && cache_idx < ARRAY_SIZE(bstr_cache) ? bstr_cache + cache_idx : NULL;
127 }
static bstr_cache_entry_t bstr_cache[0x10000/BUCKET_SIZE]
Definition: oleaut.c:112
smooth NULL
Definition: ftsmooth.c:416
static BOOL bstr_cache_enabled
Definition: oleaut.c:76
#define ARRAY_SIZE(a)
Definition: main.h:24

Referenced by get_cache_entry(), and get_cache_entry_from_alloc_size().

◆ get_malloc()

static IMalloc* get_malloc ( void  )
inlinestatic

Definition at line 249 of file oleaut.c.

250 {
251  static IMalloc *malloc;
252 
253  if (!malloc)
254  CoGetMalloc(1, &malloc);
255 
256  return malloc;
257 }
HRESULT WINAPI CoGetMalloc(DWORD context, IMalloc **imalloc)
Definition: ifs.c:383
#define malloc
Definition: debug_ros.c:4

Referenced by SysFreeString().

◆ get_typeinfo_for_iid()

static HRESULT get_typeinfo_for_iid ( REFIID  iid,
ITypeInfo **  typeinfo 
)
static

Definition at line 896 of file oleaut.c.

897 {
899  ITypeLib *typelib;
900  HRESULT hr;
901 
902  *typeinfo = NULL;
903 
904  module[0] = 0;
906  {
908  if (FAILED(hr))
909  return hr;
910  }
911 
913  if (hr != S_OK) {
914  ERR("Failed to load typelib for %s, but it should be there.\n", debugstr_guid(iid));
915  return hr;
916  }
917 
918  hr = ITypeLib_GetTypeInfoOfGuid(typelib, iid, typeinfo);
919  ITypeLib_Release(typelib);
920  if (hr != S_OK)
921  ERR("typelib does not contain info for %s\n", debugstr_guid(iid));
922 
923  return hr;
924 }
HRESULT hr
Definition: shlfolder.c:183
static ITypeLib * typelib
Definition: apps.c:105
HRESULT WINAPI LoadTypeLib(const OLECHAR *szFile, ITypeLib **pptLib)
Definition: typelib.c:461
static BOOL actctx_get_typelib_module(REFIID iid, WCHAR *module, DWORD len)
Definition: oleaut.c:801
static HRESULT reg_get_typelib_module(REFIID iid, WCHAR *module, DWORD len)
Definition: oleaut.c:832
smooth NULL
Definition: ftsmooth.c:416
#define debugstr_guid
Definition: kernel32.h:35
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
#define MAX_PATH
Definition: compat.h:26
#define ERR(fmt,...)
Definition: debug.h:109
#define S_OK
Definition: intsafe.h:59
#define ARRAY_SIZE(a)
Definition: main.h:24

Referenced by typelib_ps_CreateProxy(), and typelib_ps_CreateStub().

◆ GetActiveObject()

HRESULT WINAPI DECLSPEC_HOTPATCH GetActiveObject ( REFCLSID  rcid,
LPVOID  preserved,
LPUNKNOWN ppunk 
)

Definition at line 595 of file oleaut.c.

596 {
597  WCHAR guidbuf[80];
598  HRESULT ret;
599  LPRUNNINGOBJECTTABLE runobtable;
601 
602  StringFromGUID2(rcid,guidbuf,39);
604  if (FAILED(ret))
605  return ret;
606  ret = GetRunningObjectTable(0,&runobtable);
607  if (FAILED(ret)) {
608  IMoniker_Release(moniker);
609  return ret;
610  }
611  ret = IRunningObjectTable_GetObject(runobtable,moniker,ppunk);
612  IRunningObjectTable_Release(runobtable);
613  IMoniker_Release(moniker);
614  return ret;
615 }
interface IRunningObjectTable * LPRUNNINGOBJECTTABLE
Definition: objfwd.h:17
HRESULT WINAPI CreateItemMoniker(LPCOLESTR lpszDelim, LPCOLESTR lpszItem, IMoniker **ppmk)
Definition: itemmoniker.c:936
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
INT WINAPI StringFromGUID2(REFGUID id, LPOLESTR str, INT cmax)
Definition: compobj.c:2343
int ret
interface IMoniker * LPMONIKER
Definition: objfwd.h:9
static const WCHAR * pdelimiter
Definition: oleaut.c:512
HRESULT WINAPI GetRunningObjectTable(DWORD reserved, LPRUNNINGOBJECTTABLE *pprot)
Definition: moniker.c:1039
Definition: main.c:41

Referenced by ITypeInfo_fnCreateInstance().

◆ GetAltMonthNames()

HRESULT WINAPI GetAltMonthNames ( LCID  lcid,
LPOLESTR **  str 
)

Definition at line 1166 of file oleaut.c.

1167 {
1168  static const WCHAR ar_month1W[] = {0x645,0x62d,0x631,0x645,0};
1169  static const WCHAR ar_month2W[] = {0x635,0x641,0x631,0};
1170  static const WCHAR ar_month3W[] = {0x631,0x628,0x64a,0x639,' ',0x627,0x644,0x627,0x648,0x644,0};
1171  static const WCHAR ar_month4W[] = {0x631,0x628,0x64a,0x639,' ',0x627,0x644,0x62b,0x627,0x646,0x64a,0};
1172  static const WCHAR ar_month5W[] = {0x62c,0x645,0x627,0x62f,0x649,' ',0x627,0x644,0x627,0x648,0x644,0x649,0};
1173  static const WCHAR ar_month6W[] = {0x62c,0x645,0x627,0x62f,0x649,' ',0x627,0x644,0x62b,0x627,0x646,0x64a,0x629,0};
1174  static const WCHAR ar_month7W[] = {0x631,0x62c,0x628,0};
1175  static const WCHAR ar_month8W[] = {0x634,0x639,0x628,0x627,0x646,0};
1176  static const WCHAR ar_month9W[] = {0x631,0x645,0x636,0x627,0x646,0};
1177  static const WCHAR ar_month10W[] = {0x634,0x648,0x627,0x643,0};
1178  static const WCHAR ar_month11W[] = {0x630,0x648,' ',0x627,0x644,0x642,0x639,0x62f,0x629,0};
1179  static const WCHAR ar_month12W[] = {0x630,0x648,' ',0x627,0x644,0x62d,0x62c,0x629,0};
1180 
1181  static const WCHAR *arabic_hijri[] =
1182  {
1183  ar_month1W,
1184  ar_month2W,
1185  ar_month3W,
1186  ar_month4W,
1187  ar_month5W,
1188  ar_month6W,
1189  ar_month7W,
1190  ar_month8W,
1191  ar_month9W,
1192  ar_month10W,
1193  ar_month11W,
1194  ar_month12W,
1195  NULL
1196  };
1197 
1198  static const WCHAR pl_month1W[] = {'s','t','y','c','z','n','i','a',0};
1199  static const WCHAR pl_month2W[] = {'l','u','t','e','g','o',0};
1200  static const WCHAR pl_month3W[] = {'m','a','r','c','a',0};
1201  static const WCHAR pl_month4W[] = {'k','w','i','e','t','n','i','a',0};
1202  static const WCHAR pl_month5W[] = {'m','a','j','a',0};
1203  static const WCHAR pl_month6W[] = {'c','z','e','r','w','c','a',0};
1204  static const WCHAR pl_month7W[] = {'l','i','p','c','a',0};
1205  static const WCHAR pl_month8W[] = {'s','i','e','r','p','n','i','a',0};
1206  static const WCHAR pl_month9W[] = {'w','r','z','e',0x15b,'n','i','a',0};
1207  static const WCHAR pl_month10W[] = {'p','a',0x17a,'d','z','i','e','r','n','i','k','a',0};
1208  static const WCHAR pl_month11W[] = {'l','i','s','t','o','p','a','d','a',0};
1209  static const WCHAR pl_month12W[] = {'g','r','u','d','n','i','a',0};
1210 
1211  static const WCHAR *polish_genitive_names[] =
1212  {
1213  pl_month1W,
1214  pl_month2W,
1215  pl_month3W,
1216  pl_month4W,
1217  pl_month5W,
1218  pl_month6W,
1219  pl_month7W,
1220  pl_month8W,
1221  pl_month9W,
1222  pl_month10W,
1223  pl_month11W,
1224  pl_month12W,
1225  NULL
1226  };
1227 
1228  static const WCHAR ru_month1W[] = {0x44f,0x43d,0x432,0x430,0x440,0x44f,0};
1229  static const WCHAR ru_month2W[] = {0x444,0x435,0x432,0x440,0x430,0x43b,0x44f,0};
1230  static const WCHAR ru_month3W[] = {0x43c,0x430,0x440,0x442,0x430,0};
1231  static const WCHAR ru_month4W[] = {0x430,0x43f,0x440,0x435,0x43b,0x44f,0};
1232  static const WCHAR ru_month5W[] = {0x43c,0x430,0x44f,0};
1233  static const WCHAR ru_month6W[] = {0x438,0x44e,0x43d,0x44f,0};
1234  static const WCHAR ru_month7W[] = {0x438,0x44e,0x43b,0x44f,0};
1235  static const WCHAR ru_month8W[] = {0x430,0x432,0x433,0x443,0x441,0x442,0x430,0};
1236  static const WCHAR ru_month9W[] = {0x441,0x435,0x43d,0x442,0x44f,0x431,0x440,0x44f,0};
1237  static const WCHAR ru_month10W[] = {0x43e,0x43a,0x442,0x44f,0x431,0x440,0x44f,0};
1238  static const WCHAR ru_month11W[] = {0x43d,0x43e,0x44f,0x431,0x440,0x44f,0};
1239  static const WCHAR ru_month12W[] = {0x434,0x435,0x43a,0x430,0x431,0x440,0x44f,0};
1240 
1241  static const WCHAR *russian_genitive_names[] =
1242  {
1243  ru_month1W,
1244  ru_month2W,
1245  ru_month3W,
1246  ru_month4W,
1247  ru_month5W,
1248  ru_month6W,
1249  ru_month7W,
1250  ru_month8W,
1251  ru_month9W,
1252  ru_month10W,
1253  ru_month11W,
1254  ru_month12W,
1255  NULL
1256  };
1257 
1258  TRACE("%#x, %p\n", lcid, str);
1259 
1261  *str = (LPOLESTR *)arabic_hijri;
1262  else if (PRIMARYLANGID(LANGIDFROMLCID(lcid)) == LANG_POLISH)
1263  *str = (LPOLESTR *)polish_genitive_names;
1264  else if (PRIMARYLANGID(LANGIDFROMLCID(lcid)) == LANG_RUSSIAN)
1265  *str = (LPOLESTR *)russian_genitive_names;
1266  else
1267  *str = NULL;
1268 
1269  return S_OK;
1270 }
#define LANG_ARABIC
Definition: nls.h:29
static LPOLESTR
Definition: stg_prop.c:27
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define LANG_RUSSIAN
Definition: nls.h:113
#define LANGIDFROMLCID(l)
Definition: nls.h:18
#define S_OK
Definition: intsafe.h:59
#define LANG_POLISH
Definition: nls.h:107
#define PRIMARYLANGID(l)
Definition: nls.h:16

Referenced by test_GetAltMonthNames().

◆ OaBuildVersion()

ULONG WINAPI OaBuildVersion ( void  )

Definition at line 647 of file oleaut.c.

648 {
649  switch(GetVersion() & 0x8000ffff) /* mask off build number */
650  {
651  case 0x80000a03: /* WIN31 */
652  return MAKELONG(0xffff, 20);
653  case 0x00003303: /* NT351 */
654  return MAKELONG(0xffff, 30);
655  case 0x80000004: /* WIN95; I'd like to use the "standard" w95 minor
656  version here (30), but as we still use w95
657  as default winver (which is good IMHO), I better
658  play safe and use the latest value for w95 for now.
659  Change this as soon as default winver gets changed
660  to something more recent */
661  case 0x80000a04: /* WIN98 */
662  case 0x00000004: /* NT40 */
663  case 0x00000005: /* W2K */
664  return MAKELONG(0xffff, 40);
665  case 0x00000105: /* WinXP */
666  case 0x00000006: /* Vista */
667  case 0x00000106: /* Win7 */
668  return MAKELONG(0xffff, 50);
669  default:
670  FIXME("Version value not known yet. Please investigate it !\n");
671  return MAKELONG(0xffff, 40); /* for now return the same value as for w2k */
672  }
673 }
DWORD WINAPI GetVersion(VOID)
Definition: version.c:22
#define FIXME(fmt,...)
Definition: debug.h:110
#define MAKELONG(a, b)
Definition: typedefs.h:248

◆ OLEAUTPS_DllGetClassObject()

HRESULT WINAPI OLEAUTPS_DllGetClassObject ( REFCLSID  ,
REFIID  ,
LPVOID  
)

Definition at line 765 of file oleaut.c.

776 {
777  ULONG size;
778  DWORD mask;
779  GUID iid;
780  ULONG nummethods;
781  GUID tlbid;
782  GUID base;
783  ULONG name_len;
785 };
GLenum GLint GLuint mask
Definition: glext.h:6028
GLuint base
Definition: 3dtext.c:35
ULONG name_len
Definition: oleaut.c:791
GLsizeiptr size
Definition: glext.h:5919
unsigned long DWORD
Definition: ntddk_ex.h:95
ULONG name_offset
Definition: oleaut.c:792
unsigned int ULONG
Definition: retypes.h:1

Referenced by DllGetClassObject(), PSDispatchFacBuf_CreateProxy(), and PSDispatchFacBuf_CreateStub().

◆ OleIconToCursor()

HCURSOR WINAPI OleIconToCursor ( HINSTANCE  hinstExe,
HICON  hIcon 
)

Definition at line 1156 of file oleaut.c.

1157 {
1158  FIXME("(%p,%p), partially implemented.\n",hinstExe,hIcon);
1159  /* FIXME: make an extended conversation from HICON to HCURSOR */
1160  return CopyCursor(hIcon);
1161 }
#define CopyCursor(c)
Definition: winuser.h:4104
#define FIXME(fmt,...)
Definition: debug.h:110
HICON hIcon
Definition: msconfig.c:44

◆ OleTranslateColor()

HRESULT WINAPI OleTranslateColor ( OLE_COLOR  clr,
HPALETTE  hpal,
COLORREF pColorRef 
)

Definition at line 692 of file oleaut.c.

696 {
697  COLORREF colorref;
698  BYTE b = HIBYTE(HIWORD(clr));
699 
700  TRACE("(%08x, %p, %p)\n", clr, hpal, pColorRef);
701 
702  /*
703  * In case pColorRef is NULL, provide our own to simplify the code.
704  */
705  if (pColorRef == NULL)
706  pColorRef = &colorref;
707 
708  switch (b)
709  {
710  case 0x00:
711  {
712  if (hpal != 0)
713  *pColorRef = PALETTERGB(GetRValue(clr),
714  GetGValue(clr),
715  GetBValue(clr));
716  else
717  *pColorRef = clr;
718 
719  break;
720  }
721 
722  case 0x01:
723  {
724  if (hpal != 0)
725  {
726  PALETTEENTRY pe;
727  /*
728  * Validate the palette index.
729  */
730  if (GetPaletteEntries(hpal, LOWORD(clr), 1, &pe) == 0)
731  return E_INVALIDARG;
732  }
733 
734  *pColorRef = clr;
735 
736  break;
737  }
738 
739  case 0x02:
740  *pColorRef = clr;
741  break;
742 
743  case 0x80:
744  {
745  int index = LOBYTE(LOWORD(clr));
746 
747  /*
748  * Validate GetSysColor index.
749  */
750  if ((index < COLOR_SCROLLBAR) || (index > COLOR_MENUBAR))
751  return E_INVALIDARG;
752 
753  *pColorRef = GetSysColor(index);
754 
755  break;
756  }
757 
758  default:
759  return E_INVALIDARG;
760  }
761 
762  return S_OK;
763 }
UINT WINAPI GetPaletteEntries(HPALETTE hpal, UINT iStartIndex, UINT cEntries, LPPALETTEENTRY ppe)
Definition: palette.c:64
#define LOBYTE(W)
Definition: jmemdos.c:487
#define GetRValue(rgb)
Definition: wingdi.h:2913
#define HIBYTE(W)
Definition: jmemdos.c:486
DWORD WINAPI GetSysColor(_In_ int)
#define GetGValue(rgb)
Definition: wingdi.h:2914
#define COLOR_SCROLLBAR
Definition: winuser.h:902
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
GLuint index
Definition: glext.h:6031
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
#define TRACE(s)
Definition: solgame.cpp:4
DWORD COLORREF
Definition: windef.h:285
unsigned char BYTE
Definition: mem.h:68
#define S_OK
Definition: intsafe.h:59
#define PALETTERGB(r, g, b)
Definition: wingdi.h:2920
#define HIWORD(l)
Definition: typedefs.h:246
#define GetBValue(rgb)
Definition: wingdi.h:2915
#define LOWORD(l)
Definition: pedump.c:82

◆ PSDispatchFacBuf_AddRef()

static ULONG WINAPI PSDispatchFacBuf_AddRef ( IPSFactoryBuffer iface)
static

Definition at line 1009 of file oleaut.c.

1010 {
1011  return 2;
1012 }

◆ PSDispatchFacBuf_CreateProxy()

static HRESULT WINAPI PSDispatchFacBuf_CreateProxy ( IPSFactoryBuffer iface,
IUnknown outer,
REFIID  iid,
IRpcProxyBuffer **  proxy,
void **  obj 
)
static

Definition at line 1019 of file oleaut.c.

1021 {
1023  HRESULT hr;
1024 
1025  if (IsEqualIID(iid, &IID_IDispatch))
1026  {
1027  hr = OLEAUTPS_DllGetClassObject(&CLSID_PSFactoryBuffer, &IID_IPSFactoryBuffer, (void **)&factory);
1028  if (FAILED(hr)) return hr;
1029 
1030  hr = IPSFactoryBuffer_CreateProxy(factory, outer, iid, proxy, obj);
1031  IPSFactoryBuffer_Release(factory);
1032  return hr;
1033  }
1034  else
1035  return IPSFactoryBuffer_CreateProxy(&typelib_ps, outer, iid, proxy, obj);
1036 }
int proxy
Definition: main.c:67
HRESULT hr
Definition: shlfolder.c:183
Definition: main.c:440
static IPSFactoryBuffer typelib_ps
Definition: oleaut.c:992
HRESULT WINAPI OLEAUTPS_DllGetClassObject(REFCLSID, REFIID, LPVOID *)
Definition: oleaut.c:765
LONG HRESULT
Definition: typedefs.h:77
const GUID IID_IDispatch
static ClassFactoryImpl factory
Definition: ole_server.c:234
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:90

◆ PSDispatchFacBuf_CreateStub()

static HRESULT WINAPI PSDispatchFacBuf_CreateStub ( IPSFactoryBuffer iface,
REFIID  iid,
IUnknown server,
IRpcStubBuffer **  stub 
)
static

Definition at line 1038 of file oleaut.c.

1040 {
1042  HRESULT hr;
1043 
1044  if (IsEqualIID(iid, &IID_IDispatch))
1045  {
1046  hr = OLEAUTPS_DllGetClassObject(&CLSID_PSFactoryBuffer, &IID_IPSFactoryBuffer, (void **)&factory);
1047  if (FAILED(hr)) return hr;
1048 
1049  hr = IPSFactoryBuffer_CreateStub(factory, iid, server, stub);
1050  IPSFactoryBuffer_Release(factory);
1051  return hr;
1052  }
1053  else
1054  return IPSFactoryBuffer_CreateStub(&typelib_ps, iid, server, stub);
1055 }
static rfbScreenInfoPtr server
Definition: vnc.c:74
HRESULT hr
Definition: shlfolder.c:183
Definition: stubgen.c:11
Definition: main.c:440
static IPSFactoryBuffer typelib_ps
Definition: oleaut.c:992
HRESULT WINAPI OLEAUTPS_DllGetClassObject(REFCLSID, REFIID, LPVOID *)
Definition: oleaut.c:765
LONG HRESULT
Definition: typedefs.h:77
const GUID IID_IDispatch
static ClassFactoryImpl factory
Definition: ole_server.c:234
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:90

◆ PSDispatchFacBuf_QueryInterface()

static HRESULT WINAPI PSDispatchFacBuf_QueryInterface ( IPSFactoryBuffer iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 997 of file oleaut.c.

998 {
999  if (IsEqualIID(riid, &IID_IUnknown) ||
1000  IsEqualIID(riid, &IID_IPSFactoryBuffer))
1001  {
1002  IPSFactoryBuffer_AddRef(iface);
1003  *ppv = iface;
1004  return S_OK;
1005  }
1006  return E_NOINTERFACE;
1007 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
const GUID IID_IUnknown
#define S_OK
Definition: intsafe.h:59
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:90

◆ PSDispatchFacBuf_Release()

static ULONG WINAPI PSDispatchFacBuf_Release ( IPSFactoryBuffer iface)
static

Definition at line 1014 of file oleaut.c.

1015 {
1016  return 1;
1017 }

◆ reg_get_typelib_module()

static HRESULT reg_get_typelib_module ( REFIID  iid,
WCHAR module,
DWORD  len 
)
static

Definition at line 832 of file oleaut.c.

833 {
834  REGSAM opposite = (sizeof(void*) == 8) ? KEY_WOW64_32KEY : KEY_WOW64_64KEY;
835  char tlguid[200], typelibkey[300], interfacekey[300], ver[100], tlfn[260];
836  DWORD tlguidlen, verlen, type;
837  LONG tlfnlen, err;
838  BOOL is_wow64;
839  HKEY ikey;
840 
841  sprintf( interfacekey, "Interface\\{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}\\Typelib",
842  iid->Data1, iid->Data2, iid->Data3,
843  iid->Data4[0], iid->Data4[1], iid->Data4[2], iid->Data4[3],
844  iid->Data4[4], iid->Data4[5], iid->Data4[6], iid->Data4[7]
845  );
846 
847  err = RegOpenKeyExA(HKEY_CLASSES_ROOT,interfacekey,0,KEY_READ,&ikey);
848  if (err && (opposite == KEY_WOW64_32KEY || (IsWow64Process(GetCurrentProcess(), &is_wow64)
849  && is_wow64)))
850  err = RegOpenKeyExA(HKEY_CLASSES_ROOT,interfacekey,0,KEY_READ|opposite,&ikey);
851 
852  if (err)
853  {
854  ERR("No %s key found.\n", interfacekey);
855  return E_FAIL;
856  }
857 
858  tlguidlen = sizeof(tlguid);
859  if (RegQueryValueExA(ikey, NULL, NULL, &type, (BYTE *)tlguid, &tlguidlen))
860  {
861  ERR("Getting typelib guid failed.\n");
862  RegCloseKey(ikey);
863  return E_FAIL;
864  }
865 
866  verlen = sizeof(ver);
867  if (RegQueryValueExA(ikey, "Version", NULL, &type, (BYTE *)ver, &verlen))
868  {
869  ERR("Could not get version value?\n");
870  RegCloseKey(ikey);
871  return E_FAIL;
872  }
873 
874  RegCloseKey(ikey);
875 
876  sprintf(typelibkey, "Typelib\\%s\\%s\\0\\win%u", tlguid, ver, sizeof(void *) == 8 ? 64 : 32);
877  tlfnlen = sizeof(tlfn);
878  if (RegQueryValueA(HKEY_CLASSES_ROOT, typelibkey, tlfn, &tlfnlen))
879  {
880 #ifdef _WIN64
881  sprintf(typelibkey, "Typelib\\%s\\%s\\0\\win32", tlguid, ver);
882  tlfnlen = sizeof(tlfn);
883  if (RegQueryValueA(HKEY_CLASSES_ROOT, typelibkey, tlfn, &tlfnlen))
884  {
885 #endif
886  ERR("Could not get typelib fn?\n");
887  return E_FAIL;
888 #ifdef _WIN64
889  }
890 #endif
891  }
892  MultiByteToWideChar(CP_ACP, 0, tlfn, -1, module, len);
893  return S_OK;
894 }
LONG WINAPI RegQueryValueExA(_In_ HKEY hkeyorg, _In_ LPCSTR name, _In_ LPDWORD reserved, _Out_opt_ LPDWORD type, _Out_opt_ LPBYTE data, _Inout_opt_ LPDWORD count)
Definition: reg.c:4023
LSTATUS WINAPI RegQueryValueA(HKEY hkey, LPCSTR name, LPSTR data, LPLONG count)
Definition: reg.c:4225
#define KEY_READ
Definition: nt_native.h:1023
#define CP_ACP
Definition: compat.h:99
LONG WINAPI RegOpenKeyExA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey, _In_ DWORD ulOptions, _In_ REGSAM samDesired, _Out_ PHKEY phkResult)
Definition: reg.c:3331
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define E_FAIL
Definition: ddrawi.h:102
#define sprintf(buf, format,...)
Definition: sprintf.c:55
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
unsigned int BOOL
Definition: ntddk_ex.h:94
long LONG
Definition: pedump.c:60
smooth NULL
Definition: ftsmooth.c:416
BOOL WINAPI IsWow64Process(IN HANDLE hProcess, OUT PBOOL Wow64Process)
Definition: proc.c:2004
#define KEY_WOW64_64KEY
Definition: cmtypes.h:46
HANDLE WINAPI GetCurrentProcess(VOID)
Definition: proc.c:1168
static BOOL is_wow64
Definition: loader.c:55
unsigned long DWORD
Definition: ntddk_ex.h:95
GLenum GLsizei len
Definition: glext.h:6722
unsigned char BYTE
Definition: mem.h:68
#define err(...)
#define ERR(fmt,...)
Definition: debug.h:109
#define S_OK
Definition: intsafe.h:59
ACCESS_MASK REGSAM
Definition: winreg.h:69
#define MultiByteToWideChar
Definition: compat.h:100
#define KEY_WOW64_32KEY
Definition: cmtypes.h:45
#define HKEY_CLASSES_ROOT
Definition: winreg.h:10

Referenced by get_typeinfo_for_iid().

◆ RegisterActiveObject()

HRESULT WINAPI DECLSPEC_HOTPATCH RegisterActiveObject ( LPUNKNOWN  punk,
REFCLSID  rcid,
DWORD  dwFlags,
LPDWORD  pdwRegister 
)

Definition at line 529 of file oleaut.c.

531  {
532  WCHAR guidbuf[80];
533  HRESULT ret;
534  LPRUNNINGOBJECTTABLE runobtable;
536  DWORD rot_flags = ROTFLAGS_REGISTRATIONKEEPSALIVE; /* default registration is strong */
537 
538  StringFromGUID2(rcid,guidbuf,39);
540  if (FAILED(ret))
541  return ret;
542  ret = GetRunningObjectTable(0,&runobtable);
543  if (FAILED(ret)) {
544  IMoniker_Release(moniker);
545  return ret;
546  }
548  rot_flags = 0;
549  ret = IRunningObjectTable_Register(runobtable,rot_flags,punk,moniker,pdwRegister);
550  IRunningObjectTable_Release(runobtable);
551  IMoniker_Release(moniker);
552  return ret;
553 }
#define ACTIVEOBJECT_WEAK
Definition: oleauto.h:182
interface IRunningObjectTable * LPRUNNINGOBJECTTABLE
Definition: objfwd.h:17
HRESULT WINAPI CreateItemMoniker(LPCOLESTR lpszDelim, LPCOLESTR lpszItem, IMoniker **ppmk)
Definition: itemmoniker.c:936
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
INT WINAPI StringFromGUID2(REFGUID id, LPOLESTR str, INT cmax)
Definition: compobj.c:2343
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
interface IMoniker * LPMONIKER
Definition: objfwd.h:9
static const WCHAR * pdelimiter
Definition: oleaut.c:512
HRESULT WINAPI GetRunningObjectTable(DWORD reserved, LPRUNNINGOBJECTTABLE *pprot)
Definition: moniker.c:1039
Definition: main.c:41

◆ RevokeActiveObject()

HRESULT WINAPI DECLSPEC_HOTPATCH RevokeActiveObject ( DWORD  xregister,
LPVOID  reserved 
)

Definition at line 568 of file oleaut.c.

569 {
570  LPRUNNINGOBJECTTABLE runobtable;
571  HRESULT ret;
572 
573  ret = GetRunningObjectTable(0,&runobtable);
574  if (FAILED(ret)) return ret;
575  ret = IRunningObjectTable_Revoke(runobtable,xregister);
576  if (SUCCEEDED(ret)) ret = S_OK;
577  IRunningObjectTable_Release(runobtable);
578  return ret;
579 }
interface IRunningObjectTable * LPRUNNINGOBJECTTABLE
Definition: objfwd.h:17
LONG HRESULT
Definition: typedefs.h:77
int ret
#define S_OK
Definition: intsafe.h:59
HRESULT WINAPI GetRunningObjectTable(DWORD reserved, LPRUNNINGOBJECTTABLE *pprot)
Definition: moniker.c:1039
#define SUCCEEDED(hr)
Definition: intsafe.h:57

◆ SetOaNoCache()

void WINAPI SetOaNoCache ( void  )

Definition at line 505 of file oleaut.c.

506 {
507  TRACE("\n");
509 }
#define TRACE(s)
Definition: solgame.cpp:4
static BOOL bstr_cache_enabled
Definition: oleaut.c:76

◆ SysAllocString()

BSTR WINAPI SysAllocString ( LPCOLESTR  str)

Definition at line 241 of file oleaut.c.

242 {
243  if (!str) return 0;
244 
245  /* Delegate this to the SysAllocStringLen32 method. */
246  return SysAllocStringLen(str, lstrlenW(str));
247 }
BSTR WINAPI SysAllocStringLen(const OLECHAR *str, unsigned int len)
Definition: oleaut.c:342
#define lstrlenW
Definition: compat.h:407
const WCHAR * str

Referenced by _SHStrDupAToBSTR(), add_bstr_property(), CTrayBandSite::AddBand(), alloc_bstr_arg(), alloc_ns_context(), Arguments2_Item(), async_doc_navigate(), AtlAxCreateControlLicEx(), AtlLoadTypeLib(), ATL::AtlLoadTypeLib(), AutomationObject_Invoke(), build_classname(), build_namespace(), build_servername(), ATL::CComBSTR::CComBSTR(), ATL::CComVariant::CComVariant(), class_object_Next(), Client_get_accKeyboardShortcut(), combine_uri(), compiler_alloc_bstr(), create_callback(), create_command(), create_filecoll(), create_folder(), create_foldercoll(), create_list(), create_textfont(), CreateUri(), Database_OpenView(), declare_prefix(), delete_command(), determine_patch_sequence(), disp_get_id(), Dispatch_Invoke(), DispatchEx_GetMemberName(), dispex_value(), dns_resolve(), DocObjectService_FireBeforeNavigate2(), drive_get_FileSystem(), drive_get_VolumeName(), elem_string_attr_getter(), enum_key(), enum_values(), exec_composesettings(), exec_fontname(), exec_query(), file_get_Name(), file_get_Path(), filesys_BuildPath(), filesys_GetAbsolutePathName(), filesys_GetExtensionName(), filesys_GetFileVersion(), fill_processor_information(), SEALED_::FireChannelReceivedData(), FM2_WriteFriendlyName(), fnIMultiLanguage3_GetRfc1766FromLcid(), folder_get_Name(), folder_get_Path(), FontEventsDisp_Invoke(), function_invoke(), fw_app_get_ProcessImageFileName(), fw_app_put_ProcessImageFileName(), fw_port_put_Name(), get_attribute_value(), get_document_charset(), get_elem_attr_value_by_dispid(), get_full_path(), get_location_url(), get_method_name(), CFolderItemVerb::get_Name(), get_node_text(), get_properties(), get_propval(), get_readystate_string(), get_registered_task(), get_textfont_prop_for_pos(), CFolder::get_Title(), get_value_bstr(), Global_LTrim(), handle_navigation_error(), Host_get_FullName(), Host_get_Name(), Host_get_ScriptFullName(), Host_get_ScriptName(), Host_get_Version(), HTMLBodyElement_get_scroll(), HTMLCurrentStyle2_get_filter(), HTMLDocument_get_designMode(), HTMLDocument_get_title(), HTMLDocument_get_URL(), HTMLDocument_toString(), HTMLDOMAttribute_get_nodeName(), HTMLDOMNode_get_nodeValue(), HTMLElement2_get_readyState(), HTMLElement_get_outerHTML(), HTMLElement_get_tagName(), HTMLElement_get_title(), HTMLElement_populate_props(), HTMLElement_put_title(), HTMLEventObj_get_type(), HTMLFrameBase_get_scrolling(), HTMLImgElement_get_src(), HTMLLocation_get_port(), HTMLObjectElement_get_height(), HTMLObjectElement_get_width(), HTMLPrivateWindow_GetAddressBarUrl(), HTMLSelectionObject_get_type(), HTMLStyle_get_backgroundPositionY(), HTMLStyle_get_cssText(), HTMLStyle_get_filter(), HTMLTextAreaElement_get_type(), HTMLTxtRange_get_htmlText(), HTMLTxtRange_get_text(), HTMLWindow2_toString(), ICreateTypeInfo2_fnAddRefTypeInfo(), ie_navigate(), IErrorInfoImpl_GetDescription(), IErrorInfoImpl_GetHelpFile(), IErrorInfoImpl_GetSource(), iewnd_OnNotify(), InitPropertyBag_IPropertyBag_Read(), Installer_InstallProduct(), Installer_OpenDatabase(), Installer_OpenPackage(), Installer_ProductInfo(), Installer_ProductState(), Installer_RegistryValue(), Installer_RegistryValueW(), Installer_RelatedProducts(), Installer_SummaryInformation(), InstallerImpl_ProductInfo(), InstallerImpl_RegistryValue(), InstallerImpl_Version(), interp_string(), IPropertyBag_Read_Stub(), IRecordInfoImpl_GetFieldNames(), IRecordInfoImpl_GetName(), IRecordInfoImpl_RecordCopy(), ITypeInfo2_fnGetDocumentation2(), ITypeInfo_fnGetDllEntry(), ITypeInfo_fnGetDocumentation(), ITypeInfo_fnGetNames(), ITypeInfo_fnGetRefTypeInfo(), ITypeLib2_fnGetDocumentation(), ITypeLib2_fnGetDocumentation2(), load_manifest(), MakeVariantString(), Marshal_UnmarshalInterface(), Match2_get_Value(), mcr_GetActionInfo(), MediaDet_get_Filename(), MSI_ApplicablePatchXML(), MSI_GetProperty(), MSI_GetSourcePath(), MSI_GetTargetPath(), MsiDoActionW(), MsiEnumComponentCostsW(), MsiEvaluateConditionW(), MsiGetComponentStateW(), MsiGetFeatureCostW(), MsiGetFeatureStateW(), MsiSequenceW(), MsiSetComponentStateW(), MsiSetFeatureStateW(), MsiSetPropertyW(), MsiSetTargetPathW(), MXAttributes_addAttribute(), MXAttributes_setLocalName(), MXAttributes_setQName(), MXAttributes_setURI(), MXAttributes_setValue(), MXWriter_create(), mxwriter_get_encoding(), mxwriter_put_version(), navigate_url(), NonOleAutomation_BstrRet(), notif_complete(), nsPromptService_Alert(), nsstr_to_truncated_bstr(), nsstyle_to_bstr(), nsuri_to_url(), OLEFont_SendNotify(), OLEFontImpl_get_Name(), OmNavigator_get_appCodeName(), OmNavigator_get_appMinorVersion(), OmNavigator_get_appName(), OmNavigator_get_cpuClass(), OmNavigator_get_platform(), OmNavigator_toString(), on_before_navigate2(), parse_assembly(), parse_files(), parseError_get_reason(), parseError_get_srcText(), PB_Read(), PersistStream_Load(), PropertyBag_Read(), PropSysAllocString(), query_prop(), query_typelib_path(), record_get_value(), record_invoke(), Record_StringDataPut(), RegExp2_get_Pattern(), register_dsound_devices(), register_legacy_filters(), register_midiout_devices(), register_vfw_codecs(), register_wavein_devices(), register_waveout_devices(), RegisterDefaultAcceptHeaders(), RegisterTypeLib(), RegistryPropertyBag_IPropertyBag_Read(), return_bstr(), return_nscolor(), return_nsstr(), return_string(), run_bom_tests(), run_script(), services_InstancesOf(), Session_DoAction(), Session_EvaluateCondition(), Session_FeatureCurrentState(), Session_FeatureRequestStateGet(), Session_FeatureRequestStatePut(), session_invoke(), Session_PropertyGet(), Session_PropertyPut(), set_current_mon(), set_element_name(), set_event_handler(), set_firewall(), set_status_text(), set_textfont_prop(), START_TEST(), status_code_GetErrorCodeText(), status_code_GetFacilityCodeText(), StrRetToBSTR(), summaryinfo_invoke(), SysReAllocString(), test_Add(), test_attr_collection(), test_bstr_cache(), test_ChangeType_keep_dst(), test_child_col_disp(), test_codec(), test_copy(), test_copyassignment(), test_CopyFolder(), test_create(), test_CreateDispTypeInfo(), test_createfolder(), test_CreateTextFile(), test_CreateTypeLib(), test_directshow_filter(), test_dispatch(), test_DispCallFunc(), test_domdoc(), test_domnode(), test_domobj_dispex(), test_DriveExists(), test_dynamic_properties(), test_exec_fontname(), test_FileCollection(), test_FolderCollection(), test_font_events_disp(), test_get_text(), test_GetAbsolutePathName(), test_getAttributeNode(), test_GetBaseName(), test_GetDrive(), test_GetDriveName(), test_getElementsByTagName(), test_GetExtensionName(), test_GetFile(), test_GetFileName(), test_GetFileVersion(), test_GetFolder(), test_GetNames(), test_GetParentFolderName(), test_hash_value(), test_IClientSecurity(), test_Installer_RegistryValue(), test_interfaces(), test_items(), test_ITextDocument_Open(), test_IWbemLocator(), test_IWinHttpRequest(), test_IWinHttpRequest_Invoke(), test_IXMLDOMDocument2(), test_locator(), test_marshal_BSTR(), test_marshal_bstr(), test_marshal_LPSAFEARRAY(), test_marshal_VARIANT(), test_marshal_variant(), test_mediadet(), test_merging_text(), test_mxwriter_properties(), test_namespace(), test_notification_query_async(), test_obj_dispex(), test_OleLoadPicturePath(), test_ParseDisplayName(), test_ParseName(), test_persiststreaminit(), test_popup(), test_PropVariantCompare(), test_PropVariantToStringWithDefault(), test_query_async(), test_Read(), test_ReadAll(), test_realization(), test_recinfo(), test_registry(), test_removeNamedItem(), test_SafeArrayGetPutElement_BSTR(), test_saxreader(), test_schema_refs(), test_script_run(), test_select(), test_service(), test_SetText(), test_ShellExecute(), test_StdRegProv(), test_SummaryInfo(), test_SysAllocString(), test_SystemSecurity(), test_textstream(), test_typelibmarshal(), test_VarAdd(), test_VarAnd(), test_VarBstrCat(), test_VarBstrCmp(), test_VarCat(), test_VarCmp(), test_VarDiv(), test_VarFormat(), test_VarFormatFromTokens(), test_VarFormatNumber(), test_varianttoproperty(), test_VarIdiv(), test_VarImp(), test_VarMod(), test_VarMul(), test_VarOr(), test_VarPow(), test_VarSub(), test_VarXor(), test_Verbs(), test_Win32_Bios(), test_Win32_ComputerSystem(), test_Win32_ComputerSystemProduct(), test_Win32_IP4RouteTable(), test_Win32_OperatingSystem(), test_Win32_PhysicalMemory(), test_Win32_PnPEntity(), test_Win32_Printer(), test_Win32_Process(), test_Win32_Processor(), test_Win32_Service(), test_Win32_SystemEnclosure(), test_Win32_VideoController(), test_WriteLine(), test_wshshell(), test_xmlelem(), test_xmlelem_collection(), test_xmlTypes(), TextFont_GetName(), textfont_reset_to_default(), TLB_append_str(), to_safearray(), to_string(), update_title(), Uri_GetPropertyBSTR(), VarBstrFromBool(), VarBstrFromCy(), VarBstrFromDate(), VarBstrFromDec(), VarDateFromStr(), VarFormatCurrency(), VarFormatNumber(), VarFormatPercent(), VARIANT_BstrFromReal(), VARIANT_BstrReplaceDecimal(), VARIANT_FormatDate(), VARIANT_FormatNumber(), VARIANT_FormatString(), variant_from_registry_value(), WebBrowser_get_Name(), Widget_bstr(), Widget_DoSomething(), Widget_get_Name(), Widget_Map(), WshCollection_Item(), WshShell3_RegRead(), WshShortcut_Create(), WshShortcut_get_Arguments(), WshShortcut_get_IconLocation(), WshShortcut_get_WorkingDirectory(), xslprocessor_addParameter(), xslprocessor_get_output(), and xslprocessor_set_parvalue().

◆ SysAllocStringByteLen()

BSTR WINAPI DECLSPEC_HOTPATCH SysAllocStringByteLen ( LPCSTR  str,
UINT  len 
)

Definition at line 431 of file oleaut.c.

432 {
433  bstr_t *bstr;
434 
435  /* Detect integer overflow. */
436  if (len >= (UINT_MAX-sizeof(WCHAR)-sizeof(DWORD)))
437  return NULL;
438 
439  bstr = alloc_bstr(len);
440  if(!bstr)
441  return NULL;
442 
443  if(str) {
444  memcpy(bstr->u.ptr, str, len);
445  bstr->u.ptr[len] = 0;
446  }else {
447  memset(bstr->u.ptr, 0, len+1);
448  }
449  bstr->u.str[(len+sizeof(WCHAR)-1)/sizeof(WCHAR)] = 0;
450 
451  return bstr->u.str;
452 }
static bstr_t * alloc_bstr(size_t size)
Definition: oleaut.c:143
Definition: oleaut.c:87
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
__wchar_t WCHAR
Definition: xmlstorage.h:180
union bstr_t::@494 u
unsigned long DWORD
Definition: ntddk_ex.h:95
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum GLsizei len
Definition: glext.h:6722
#define UINT_MAX
Definition: limits.h:41
char ptr[1]
Definition: oleaut.c:93
WCHAR str[1]
Definition: oleaut.c:94
#define memset(x, y, z)
Definition: compat.h:39

Referenced by BstrFromVector(), Compartment_SetValue(), SEALED_::FireChannelReceivedData(), fnTextSrv_TxGetText(), MSFT_ReadAllNames(), MSFT_ReadAllStrings(), SAFEARRAY_CopyData(), SafeArrayGetElement(), SafeArrayPutElement(), test_BstrCopy(), test_copyassignment(), test_domdoc(), test_marshal_BSTR(), test_SysAllocStringByteLen(), test_VarBstrCat(), test_VarBstrCmp(), TLB_AllocAndInitFuncDesc(), TLB_AllocAndInitVarDesc(), VarBstrCat(), variant_from_registry_value(), VARIANT_MakeBstr(), VariantCopy(), and VariantCopyInd().

◆ SysAllocStringLen()

BSTR WINAPI SysAllocStringLen ( const OLECHAR str,
unsigned int  len 
)

Definition at line 342 of file oleaut.c.

343 {
344  bstr_t *bstr;
345  DWORD size;
346 
347  /* Detect integer overflow. */
348  if (len >= ((UINT_MAX-sizeof(WCHAR)-sizeof(DWORD))/sizeof(WCHAR)))
349  return NULL;
350 
351  TRACE("%s\n", debugstr_wn(str, len));
352 
353  size = len*sizeof(WCHAR);
354  bstr = alloc_bstr(size);
355  if(!bstr)
356  return NULL;
357 
358  if(str) {
359  memcpy(bstr->u.str, str, size);
360  bstr->u.str[len] = 0;
361  }else {
362  memset(bstr->u.str, 0, size+sizeof(WCHAR));
363  }
364 
365  return bstr->u.str;
366 }
static bstr_t * alloc_bstr(size_t size)
Definition: oleaut.c:143
Definition: oleaut.c:87
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
GLsizeiptr size
Definition: glext.h:5919
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum GLsizei len
Definition: glext.h:6722
#define debugstr_wn
Definition: kernel32.h:33
#define UINT_MAX
Definition: limits.h:41
#define memset(x, y, z)
Definition: compat.h:39

Referenced by a2bstr(), alloc_str_from_narrow(), CHString::AllocSysString(), ATL::ChTraitsCRT< _CharType >::AllocSysString(), ATL::ChTraitsCRT< char >::AllocSysString(), bstr_from_str(), build_path(), build_proplist(), build_query_string(), build_relpath(), build_resource_string(), ATL::CComBSTR::CComBSTR(), Client_get_accName(), combine_uri(), compiler_alloc_bstr_len(), contentHandler_characters(), contentHandler_endElement(), contentHandler_endPrefixMapping(), contentHandler_ignorableWhitespace(), contentHandler_processingInstruction(), contentHandler_skippedEntity(), contentHandler_startElement(), contentHandler_startPrefixMapping(), _com_util::ConvertStringToBSTR(), ConvertUTF8StringToBSTR(), ATL::CComBSTR::Copy(), create_drive(), create_ie_window(), decode_string(), DEVENUM_IPropertyBag_Read(), disp_delete_name(), Dispatch_Invoke(), drive_get_DriveLetter(), filesys_BuildPath(), filesys_GetBaseName(), filesys_GetDriveName(), filesys_GetFileName(), filesys_GetParentFolderName(), filesys_GetTempName(), function_value(), generate_uri(), get_body_text(), get_language_string(), get_location_url(), get_object_text(), get_owner(), get_script_from_file(), get_script_str(), get_stringvalue(), get_token(), get_value_bstr(), Global_Chr(), Global_Left(), Global_Mid(), Global_Right(), Global_RTrim(), Global_Space(), Global_Trim(), Host_get_Path(), html_window_navigate(), HTMLDocument_get_cookie(), HTMLDOMAttribute2_get_value(), HTMLFrameBase_get_marginHeight(), HTMLFrameBase_get_marginWidth(), HTMLLocation_get_host(), HTMLLocation_get_href(), HTMLLocation_get_pathname(), HTMLLocation_get_port(), HTMLLocation_get_protocol(), HTMLStyle_get_backgroundPositionX(), HTMLStyle_put_borderStyle(), hyperlink_dlgproc(), ie_dialog_open_proc(), include_pac_utils(), InitVariantFromGUIDAsString(), invoke_builtin(), CFolderItemVerbs::Item(), ITextRange_fnGetText(), ITextSelection_fnGetText(), jsval_to_variant(), load_res(), ATL::CComBSTR::LoadString(), mlang_getcsetinfo(), mqr_GetMetadataByName(), mrp_FormatRecord(), MSFT_ReadValue(), mxwriter_get_output(), nscolor_to_str(), nsIOService_NewURI(), nsstr_to_truncated_bstr(), nsstyle_to_bstr(), Object_hasOwnProperty(), OmNavigator_get_appVersion(), OmNavigator_get_userAgent(), open_dde_url(), parse_path(), pre_process_uri(), prompt_dlgproc(), PropertyStorage_ReadProperty(), query_prop(), read_file_to_bstr(), register_legacy_filters(), return_bstrn(), return_nscstr(), run_from_res(), set_element_name(), set_firewall(), SEALED_::SetProperty(), SLTG_DoVars(), SLTG_ReadString(), SubMatches_get_Item(), SWbemProperty_create(), SysAllocString(), SysReAllocStringLen(), test_bstr_cache(), test_domdoc(), test_marshal_bstr(), test_NetFwAuthorizedApplication(), test_ParseName(), test_safearray(), test_SetText(), test_SysAllocStringLen(), test_SysReAllocString(), test_SysReAllocStringLen(), test_TransformWithLoadingLocalFile(), test_VarBstrCat(), test_VarBstrCmp(), test_VarCat(), test_VarWeekdayName(), test_Win32_Process(), test_xmlTypes(), TextFont_GetName(), textstream_read(), TLB_MultiByteToBSTR(), Uri_GetPropertyBSTR(), variant_change_type(), VARIANT_Coerce(), variant_from_registry_value(), VarMonthName(), VarWeekdayName(), winhttp_request_get_ResponseText(), winhttp_request_get_StatusText(), winhttp_request_GetAllResponseHeaders(), winhttp_request_GetResponseHeader(), WshEnvironment_get_Item(), WshShell3_ExpandEnvironmentStrings(), WshShell3_get_CurrentDirectory(), and WshShortcut_put_IconLocation().

◆ SysFreeString()

void WINAPI DECLSPEC_HOTPATCH SysFreeString ( BSTR  str)

Definition at line 274 of file oleaut.c.

275 {
277  bstr_t *bstr;
279  SIZE_T alloc_size;
280 
281  if(!str)
282  return;
283 
284  bstr = bstr_from_str(str);
285 
286  alloc_size = IMalloc_GetSize(malloc, bstr);
287  if (alloc_size == ~0UL)
288  return;
289 
291  if(cache_entry) {
292  unsigned i;
293 
295 
296  /* According to tests, freeing a string that's already in cache doesn't corrupt anything.
297  * For that to work we need to search the cache. */
298  for(i=0; i < cache_entry->cnt; i++) {
299  if(cache_entry->buf[(cache_entry->head+i) % BUCKET_BUFFER_SIZE] == bstr) {
300  WARN_(heap)("String already is in cache!\n");
302  return;
303  }
304  }
305 
306  if(cache_entry->cnt < ARRAY_SIZE(cache_entry->buf)) {
307  cache_entry->buf[(cache_entry->head+cache_entry->cnt) % BUCKET_BUFFER_SIZE] = bstr;
308  cache_entry->cnt++;
309 
310  if(WARN_ON(heap)) {
311  unsigned n = (alloc_size-FIELD_OFFSET(bstr_t, u.ptr))/sizeof(DWORD);
312  for(i=0; i<n; i++)
313  bstr->u.dwptr[i] = ARENA_FREE_FILLER;
314  }
315 
317  return;
318  }
319 
321  }
322 
323  CoTaskMemFree(bstr);
324 }
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 * u
Definition: glfuncs.h:240
static bstr_cache_entry_t * get_cache_entry_from_alloc_size(SIZE_T alloc_size)
Definition: oleaut.c:135
static CRITICAL_SECTION cs_bstr_cache
Definition: oleaut.c:78
static bstr_t * bstr_from_str(BSTR str)
Definition: oleaut.c:119
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:422
static IMalloc * get_malloc(void)
Definition: oleaut.c:249
#define ARENA_FREE_FILLER
Definition: oleaut.c:110
GLdouble n
Definition: glext.h:7729
Definition: oleaut.c:102
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
Definition: svc_auth_des.c:77
#define WARN_ON(c)
Definition: module.h:255
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
Definition: oleaut.c:87
const WCHAR * str
union bstr_t::@494 u
unsigned long DWORD
Definition: ntddk_ex.h:95
ULONG_PTR SIZE_T
Definition: typedefs.h:78
DWORD dwptr[1]
Definition: oleaut.c:95
#define ARRAY_SIZE(a)
Definition: main.h:24
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:254
#define BUCKET_BUFFER_SIZE
Definition: oleaut.c:100
#define malloc
Definition: debug_ros.c:4
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
#define WARN_(ch,...)
Definition: debug.h:157
#define UL
Definition: tui.h:70

Referenced by _BSTR_CY(), _BSTR_DATE(), _BSTR_DEC(), _doc_attach_event(), _doc_detach_event(), _doc_get_elems_by_name(), _elem_attach_event(), _elem_detach_event(), _elem_fire_event(), _get_disp_id(), _get_elem_attr_node(), _get_elem_id(), _insert_adjacent_elem(), _link_put_href(), _link_put_rel(), _link_put_rev(), _link_put_type(), _parse_htmlscript_a(), _parse_script_a(), _set_body_scroll(), _set_button_name(), _set_dispex_value(), _set_elem_dir(), _set_elem_language(), _set_meta_charset(), _set_object_name(), _set_style_filter(), _set_stylesheet_csstext(), _set_text_data(), _set_text_decoration(), _set_window_name(), _set_window_status(), _test_anchor_get_target(), _test_anchor_hash(), _test_anchor_hostname(), _test_anchor_href(), _test_anchor_name(), _test_anchor_put_href(), _test_anchor_put_name(), _test_anchor_put_rel(), _test_anchor_put_search(), _test_anchor_put_target(), _test_anchor_rel(), _test_anchor_search(), _test_attr_node_name(), _test_attr_value(), _test_body_scroll(), _test_button_name(), _test_comment_attrs(), _test_comment_text(), _test_create_elem(), _test_create_text(), _test_current_style_filter(), _test_current_url(), _test_display_uri(), _test_doc_set_title(), _test_doc_title(), _test_elem_attr(), _test_elem_class(), _test_elem_dir(), _test_elem_getelembytag(), _test_elem_id(), _test_elem_innerhtml(), _test_elem_innertext(), _test_elem_language(), _test_elem_outerhtml(), _test_elem_put_id(), _test_elem_set_class(), _test_elem_set_innerhtml(), _test_elem_set_innertext(), _test_elem_set_outerhtml(), _test_elem_set_title(), _test_elem_tag(), _test_elem_title(), _test_form_action(), _test_form_encoding(), _test_form_method(), _test_form_name(), _test_form_put_action(), _test_form_put_encoding(), _test_form_put_method(), _test_form_put_name(), _test_framebase_name(), _test_framebase_put_name(), _test_framebase_src(), _test_GetCurMoniker(), _test_img_align(), _test_img_alt(), _test_img_name(), _test_img_set_alt(), _test_img_set_src(), _test_img_src(), _test_input_defaultValue(), _test_input_name(), _test_input_put_defaultValue(), _test_input_put_value(), _test_input_set_name(), _test_input_set_src(), _test_input_src(), _test_input_type(), _test_input_value(), _test_link_media(), _test_meta_charset(), _test_meta_content(), _test_meta_httpequiv(), _test_meta_name(), _test_node_name(), _test_object_name(), _test_option_put_text(), _test_option_put_value(), _test_option_text(), _test_option_value(), _test_range_paste_html(), _test_range_put_text(), _test_range_set_end_point(), _test_range_text(), _test_readyState(), _test_script_text(), _test_select_name(), _test_select_set_name(), _test_select_set_value(), _test_select_type(), _test_select_value(), _test_style_csstext(), _test_style_filter(), _test_style_media(), _test_style_put_media(), _test_style_put_type(), _test_style_remove_attribute(), _test_style_set_csstext(), _test_style_type(), _test_stylesheet_csstext(), _test_text_data(), _test_text_decoration(), _test_textarea_defaultvalue(), _test_textarea_put_defaultvalue(), _test_textarea_put_value(), _test_textarea_type(), _test_textarea_value(), _test_window_name(), _test_window_status(), _text_append_data(), ACTION_CallDllFunction(), CTrayBandSite::AddBand(), AtlAxCreateControlLicEx(), AtlRegisterTypeLib(), ATL::CComBSTR::Attach(), AutomationObject_Invoke(), before_async_open(), Binding_Release(), BindProtocol_Release(), BindProtocol_StartEx(), BindStatusCallback_Release(), BSTR_UserFree(), BSTR_UserUnmarshal(), build_path(), build_proplist(), build_relpath(), ATL::CComBSTR::CComBSTR(), check_codebase(), check_jscript(), class_object_Next(), class_object_NextMethod(), CoInternetGetSecurityUrlEx(), combine_uri(), _com_util::ConvertStringToBSTR(), ConvertUTF8StringToBSTR(), create_command(), create_doc_from_url(), create_ie_window(), declare_prefix(), decode_string(), delete_command(), destroy_uri_obj(), determine_patch_sequence(), disp_delete_name(), disp_get_id(), dispevent_Invoke(), doc_navigate_task_destr(), DocObjectService_FireBeforeNavigate2(), DocObjectService_FireDocumentComplete(), DocObjectService_FireNavigateComplete2(), DoSync(), double_to_string(), drive_Release(), enum_key(), enum_values(), EventDispatch_Invoke(), anonymous_namespace{mstscax.cpp}::CoClass::ExcepInfoToString(), exec_composesettings(), exec_hyperlink(), exec_query(), filecoll_enumvariant_Next(), filecoll_Release(), FileProtocol_StartEx(), fill_processor_information(), find_element_by_id(), SEALED_::FireChannelReceivedData(), flush_sequence(), FM2_WriteFriendlyName(), folder_Release(), foldercoll_enumvariant_Next(), foldercoll_Release(), free_assembly(), free_bstr_array(), free_bstrs(), free_ns_context(), anonymous_namespace{mstscax.cpp}::CoClass::FreeExcepInfo(), FtpProtocol_open_request(), fw_app_put_ProcessImageFileName(), fw_app_Release(), fw_port_put_Name(), fw_port_Release(), generate_security_id(), get_attribute_value(), get_body_text(), get_doc_elem_by_id(), get_document_charset(), get_elem_by_id(), get_element_by_id(), get_frame_by_name(), get_language_string(), get_object_text(), get_properties(), get_protocol_handler(), get_registered_task(), get_stringvalue(), get_uri_string(), get_zone_from_domains(), Global_InStrRev(), Global_InvokeEx(), Global_LCase(), Global_Left(), Global_Len(), Global_LTrim(), Global_MsgBox(), Global_Right(), Global_RTrim(), Global_StrComp(), Global_Trim(), Global_UCase(), GopherProtocol_open_request(), handle_extern_mime_navigation(), handle_navigation_error(), Host_Echo(), html_window_navigate(), HTMLBodyElement_get_scroll(), HTMLDOMAttribute_get_specified(), HTMLElement_populate_props(), HTMLEvents_Invoke(), HTMLLocation_get_hash(), HTMLLocation_get_hostname(), HTMLLocation_get_protocol(), HTMLLocation_get_search(), HTMLStyle_put_borderStyle(), HTMLWindow2_open(), HttpProtocol_open_request(), IDispatch_Invoke_Proxy(), ie_dialog_open_proc(), ie_navigate(), iewnd_OnNotify(), iframe_onreadystatechange(), init(), init_members(), init_warning_dialog(), install_file(), interp_forin(), invoke_procedure(), IRecordInfoImpl_RecordClear(), IRecordInfoImpl_Release(), is_elem_id(), ITypeComp_fnBind(), ITypeInfo_fnAddressOfMember(), ITypeInfo_fnGetRefTypeInfo(), ITypeInfo_fnReleaseFuncDesc(), ITypeLib2_fnGetDocumentation(), ITypeLib2_fnRelease(), load_manifest(), load_uri(), LoadRegTypeLib(), ATL::CComBSTR::LoadString(), locator_ConnectServer(), map_security_uri_to_zone(), MkProtocol_StartEx(), mlang_getcsetinfo(), mqr_GetMetadataByName(), MSI_ApplicablePatchXML(), MSI_GetProperty(), MSI_GetSourcePath(), MSI_GetTargetPath(), MsiActiveScriptSite_OnScriptError(), MsiDoActionW(), MsiEnumComponentCostsW(), MsiEvaluateConditionW(), MsiFormatRecordW(), MsiGetComponentStateW(), MsiGetFeatureCostW(), MsiGetFeatureStateW(), MsiSequenceW(), MsiSetComponentStateW(), MsiSetFeatureStateW(), MsiSetPropertyW(), MsiSetTargetPathW(), MXAttributes_clear(), MXAttributes_Release(), MXAttributes_setLocalName(), MXAttributes_setQName(), MXAttributes_setURI(), MXAttributes_setValue(), MXWriter_create(), mxwriter_put_version(), mxwriter_Release(), navigate_fragment(), navigate_javascript_proc(), navigate_uri(), navigate_url(), node_to_string(), notif_complete(), nsChannel_AsyncOpen(), nsIOService_NewURI(), nsPromptService_Alert(), nsstyle_to_bstr(), nsURI_GetHostPort(), nsURI_GetPrePath(), nsURI_GetUserPass(), nsURI_Resolve(), nsURI_SchemeIs(), nsURL_GetDirectory(), nsURL_GetFileBaseName(), nsURL_GetFileName(), nsURL_GetQuery(), nsURL_GetRef(), Object_hasOwnProperty(), object_Release(), on_before_navigate2(), ATL::CComBSTR::operator=(), parse_anchor(), parse_assembly(), parse_domain(), parse_files(), parse_friendly(), parse_htmlscript(), parse_htmlscript_a(), parse_path(), parse_procedure(), parse_procedure_a(), parse_schema(), parse_script(), parse_script_ae(), parse_script_af(), parse_script_ar(), parse_script_expr(), parse_script_with_error_a(), parse_site(), parse_url_from_path(), parseError_Release(), PersistHistory_SaveHistory(), PersistPropertyBag_Load(), PersistStream_Load(), property_Release(), PropertyBag_Read(), PropertyNotifySink_OnChanged(), PropSysFreeString(), ProtocolSinkHandler_ReportData(), put_inner_html(), query_prop(), RegisterDefaultAcceptHeaders(), RegisterTypeLib(), RegistryPropertyBag_IPropertyBag_Read(), release_bytecode(), release_typelib(), release_vbscode(), SEALED_::ReplaceProperty(), return_bstr(), run_benchmark(), run_bom_tests(), run_encoded_tests(), run_from_file(), run_from_res(), run_script(), runtimestyle_test(), SAFEARRAY_CopyData(), SAFEARRAY_DestroyData(), SafeArrayPutElement(), SecManagerImpl_MapUrlToZoneEx2(), services_InstancesOf(), set_current_uri(), set_element_name(), set_firewall(), set_textfont_prop(), SEALED_::SetProperty(), SLTG_ReadName(), SLTG_ReadString(), START_TEST(), stringify_object(), strstr_wa(), submit_form(), super_navigate(), SysReAllocString(), test_Add(), test_async_xhr(), test_async_xhr_abort(), test_attr_collection(), test_attr_collection_disp(), test_automagic(), test_body_style(), test_bstr_cache(), test_BuildPath(), test_ChangeType_keep_dst(), test_child_col_disp(), test_CoInternetCombineIUri(), test_CoInternetCombineIUri_Pluggable(), test_CoInternetCombineUrlEx(), test_CoInternetCombineUrlEx_Pluggable(), test_collection_content(), test_contenteditable(), test_cookies(), test_CopyFolder(), test_create(), test_create_attribute(), test_create_elems(), test_CreateDispTypeInfo(), test_createfolder(), test_createNode(), test_CreateTextFile(), test_CreateTypeLib(), test_CreateUriWithFragment(), test_current_style(), test_default_arg_conv(), test_default_client_accessible_object(), test_default_selection(), test_defaults(), test_disp(), test_DispCallFunc(), test_doc_elem(), test_doc_load_from_path(), test_dom_implementation(), test_domdoc(), test_domnode(), test_domobj_dispex(), test_doscroll(), test_DriveCollection(), test_DriveExists(), test_dump_typelib(), test_dynamic_properties(), test_editing_mode(), test_elem_col_item(), test_elem_dispex(), test_elems(), test_exec_script(), test_FileCollection(), test_FolderCollection(), test_font_events_disp(), test_form_target(), test_FormattingXML(), test_framebase(), test_func(), test_gc(), test_get_attributes(), test_get_childNodes(), test_get_doctype(), test_get_firstChild(), test_get_lastChild(), test_get_namespaces(), test_get_nodeTypeString(), test_get_prefix(), test_get_set_attr(), test_get_tagName(), test_get_text(), test_get_xml(), test_GetAbsolutePathName(), test_getAttributeNode(), test_GetBaseName(), test_GetDrive(), test_GetDriveName(), test_getElementsByTagName(), test_GetExtensionName(), test_GetFile(), test_GetFileName(), test_GetFileVersion(), test_GetFolder(), test_GetNames(), test_GetParentFolderName(), test_GetRfc1766FromLcid(), test_GetSpecialFolder(), test_GetText(), test_global_id(), test_global_vars_ref(), test_hash(), test_header(), test_host(), test_hostname(), test_href(), test_IActiveScriptError(), test_IClientSecurity(), test_iframe_connections(), test_iframe_elem(), test_imgload(), test_insertBefore(), test_interfaces(), test_InternetGetSecurityUrlEx(), test_InternetGetSecurityUrlEx_Pluggable(), test_invokeex(), test_IPersistStream(), test_items(), test_ITextFont(), test_IUri_GetPropertyBSTR(), test_IUri_GetStrProperties(), test_IUriBuilder_CreateUri(), test_IUriBuilder_CreateUriSimple(), test_IUriBuilder_CreateUriWithFlags(), test_IUriBuilder_GetFragment(), test_IUriBuilder_GetHost(), test_IUriBuilder_GetPassword(), test_IUriBuilder_GetPath(), test_IUriBuilder_GetQuery(), test_IUriBuilder_GetSchemeName(), test_IUriBuilder_GetUserName(), test_IUriBuilder_RemoveProperties(), test_IWbemLocator(), test_IWinHttpRequest(), test_IWinHttpRequest_Invoke(), test_label_elem(), test_Load(), test_load(), test_LoadRegTypeLib(), test_location(), test_locator(), test_marshal_BSTR(), test_marshal_bstr(), test_marshal_LPSAFEARRAY(), test_marshal_VARIANT(), test_mediadet(), test_merging_text(), test_mxwriter_default_properties(), test_mxwriter_encoding(), test_mxwriter_properties(), test_namedmap_newenum(), test_namespace(), test_namespaces_as_attributes(), test_namespaces_basic(), test_namespaces_change(), test_navigator(), test_NetFwAuthorizedApplication(), test_newline_normalization(), test_nextdispid(), test_notification_query_async(), test_obj_dispex(), test_object_elem(), test_onreadystatechange(), test_open_window(), test_parse_context(), test_ParseDisplayName(), test_ParseName(), test_pathname(), test_persiststreaminit(), test_popup(), test_port(), test_preserve_charref(), test_PropVariantCompare(), test_PropVariantToStringWithDefault(), test_protocol(), test_put_data(), test_put_hash(), test_put_href(), test_put_nodeTypedValue(), test_query_async(), test_QueryPathOfRegTypeLib(), test_Read(), test_ReadAll(), test_realization(), test_registry(), test_removeNamedItem(), test_retval(), test_rfc1766(), test_SafeArrayGetPutElement_BSTR(), test_save(), test_saxreader(), test_schema_refs(), test_script_dispatch(), test_script_run(), test_search(), test_select(), test_selection(), test_SerialNumber(), test_server_xhr(), test_service(), test_setAttributeNode(), test_SetDocString(), test_SetText(), test_ShellExecute(), test_start(), test_StdRegProv(), test_StrRetToBSTR(), test_style2(), test_style3(), test_style6(), test_stylesheet(), test_sync_xhr(), test_SysAllocString(), test_SysAllocStringByteLen(), test_SysAllocStringLen(), test_SysReAllocString(), test_SysReAllocStringLen(), test_SystemSecurity(), test_table_elem(), test_td_elem(), test_testTransforms(), test_textfont_global_defaults(), test_textstream(), test_tr_elem(), test_TransformWithLoadingLocalFile(), test_TxGetText(), test_TxSetText(), test_type_info(), test_typelib(), test_typelibmarshal(), test_VarAdd(), test_VarAnd(), test_VarBstrCat(), test_VarBstrCmp(), test_VarBstrFromI4(), test_VarBstrFromR4(), test_VarCmp(), test_VarDiv(), test_VarFormat(), test_VarFormatFromTokens(), test_VarFormatNumber(), test_varianttoproperty(), test_VarIdiv(), test_VarImp(), test_VarMod(), test_VarMul(), test_VarOr(), test_VarPow(), test_VarSub(), test_VarWeekdayName(), test_VarXor(), test_Verbs(), test_Win32_Bios(), test_Win32_ComputerSystem(), test_Win32_ComputerSystemProduct(), test_Win32_IP4RouteTable(), test_Win32_OperatingSystem(), test_Win32_PhysicalMemory(), test_Win32_PnPEntity(), test_Win32_Printer(), test_Win32_Process(), test_Win32_Processor(), test_Win32_Service(), test_Win32_SystemEnclosure(), test_Win32_VideoController(), test_window(), test_WriteLine(), test_wshshell(), test_XDR_datatypes(), test_XDR_schemas(), test_xmldoc(), test_xmlelem(), test_xmlelem_collection(), test_XMLHTTP(), test_xmlns_attribute(), test_xmlTypes(), test_XPath(), test_xsltemplate(), test_xsltext(), TextFont_Release(), textfont_reset_to_default(), textrange_set_font(), TLB_AllocAndInitFuncDesc(), TLB_AllocAndInitVarDesc(), TLB_FreeVarDesc(), to_array(), to_safearray(), translate_uri(), translate_url(), UnRegisterTypeLib(), update_title(), URLMoniker_Load(), URLMoniker_Release(), var2str(), VarCat(), VarDateFromStr(), VarFormatCurrency(), VarFormatNumber(), VarFormatPercent(), VARIANT_ClearInd(), VARIANT_FormatDate(), VARIANT_FormatNumber(), VariantClear(), VarMonthName(), VarWeekdayName(), VBSAXContentHandler_startElement(), WebBrowserPriv2IE8_NavigateWithBindCtx2(), WebBrowserPriv2IE9_NavigateWithBindCtx2(), winhttp_request_get_StatusText(), winhttp_request_GetAllResponseHeaders(), winhttp_request_GetResponseHeader(), WinMGMTS_ParseDisplayName(), WshShell3_ExpandEnvironmentStrings(), WshShell3_get_CurrentDirectory(), WshShortcut_put_IconLocation(), WshShortcut_Release(), xslprocessor_addParameter(), xslprocessor_par_free(), xslprocessor_Release(), xslprocessor_transform(), ATL::CComBSTR::~CComBSTR(), and SEALED_::~RdpClient().

◆ SysReAllocString()

INT WINAPI SysReAllocString ( LPBSTR  old,
LPCOLESTR  str 
)

Definition at line 470 of file oleaut.c.

471 {
472  /*
473  * Sanity check
474  */
475  if (old==NULL)
476  return 0;
477 
478  /*
479  * Make sure we free the old string.
480  */
481  SysFreeString(*old);
482 
483  /*
484  * Allocate the new string
485  */
486  *old = SysAllocString(str);
487 
488  return 1;
489 }
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:241
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:274

Referenced by mxwriter_put_encoding(), and test_SysReAllocString().

◆ SysReAllocStringLen()

int WINAPI SysReAllocStringLen ( BSTR old,
const OLECHAR str,
unsigned int  len 
)

Definition at line 386 of file oleaut.c.

387 {
388  /* Detect integer overflow. */
389  if (len >= ((UINT_MAX-sizeof(WCHAR)-sizeof(DWORD))/sizeof(WCHAR)))
390  return FALSE;
391 
392  if (*old!=NULL) {
393  DWORD newbytelen = len*sizeof(WCHAR);
394  bstr_t *old_bstr = bstr_from_str(*old);
395  bstr_t *bstr = CoTaskMemRealloc(old_bstr, bstr_alloc_size(newbytelen));
396 
397  if (!bstr) return FALSE;
398 
399  *old = bstr->u.str;
400  bstr->size = newbytelen;
401  /* The old string data is still there when str is NULL */
402  if (str && old_bstr->u.str != str) memmove(bstr->u.str, str, newbytelen);
403  bstr->u.str[len] = 0;
404  } else {
405  *old = SysAllocStringLen(str, len);
406  }
407 
408  return TRUE;
409 }
#define memmove(s1, s2, n)
Definition: mkisofs.h:881
#define TRUE
Definition: types.h:120
static bstr_t * bstr_from_str(BSTR str)
Definition: oleaut.c:119
BSTR WINAPI SysAllocStringLen(const OLECHAR *str, unsigned int len)
Definition: oleaut.c:342
static size_t bstr_alloc_size(size_t size)
Definition: oleaut.c:114
Definition: oleaut.c:87
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
__wchar_t WCHAR
Definition: xmlstorage.h:180
union bstr_t::@494 u
unsigned long DWORD
Definition: ntddk_ex.h:95
GLenum GLsizei len
Definition: glext.h:6722
#define UINT_MAX
Definition: limits.h:41
LPVOID WINAPI CoTaskMemRealloc(LPVOID pvOld, SIZE_T size)
Definition: ifs.c:440
WCHAR str[1]
Definition: oleaut.c:94
DWORD size
Definition: oleaut.c:91

Referenced by BSTR_UserUnmarshal(), ATL::CWindow::GetWindowText(), and test_SysReAllocStringLen().

◆ SysStringByteLen()

◆ SysStringLen()

UINT WINAPI SysStringLen ( BSTR  str)

Definition at line 199 of file oleaut.c.

200 {
201  return str ? bstr_from_str(str)->size/sizeof(WCHAR) : 0;
202 }
static bstr_t * bstr_from_str(BSTR str)
Definition: oleaut.c:119
const WCHAR * str
__wchar_t WCHAR
Definition: xmlstorage.h:180
DWORD size
Definition: oleaut.c:91

Referenced by anonymous_namespace{activex.cpp}::BstrToLpsz(), build_path(), build_relpath(), _com_util::ConvertBSTRToString(), ATL::CComBSTR::Copy(), dump_instr_arg(), anonymous_namespace{mstscax.cpp}::CoClass::ExcepInfoToString(), filesys_BuildPath(), filesys_CopyFile(), filesys_CopyFolder(), filesys_DeleteFile(), filesys_DeleteFolder(), filesys_DriveExists(), filesys_GetDrive(), filesys_GetExtensionName(), filesys_GetParentFolderName(), function_value(), get_body_text(), get_full_path(), get_protocol_handler(), get_uri_path(), get_zone_from_domains(), Global_InStr(), Global_InStrRev(), Global_Left(), Global_Len(), Global_Mid(), Global_Right(), Global_RTrim(), Global_StrReverse(), Global_Trim(), Host_Echo(), HTMLDocument3_getElementsByName(), HTMLLocation_get_protocol(), HTMLWindow2_alert(), SEALED_::IMsTscAx::CreateVirtualChannels(), InternetBindInfo_GetBindString(), interp_forin(), ATL::CComBSTR::Length(), MkProtocol_StartEx(), MsiFormatRecordW(), namespacemanager_getDeclaredPrefix(), namespacemanager_getPrefix(), namespacemanager_getURI(), navigate_fragment(), nsstyle_to_bstr(), nsURI_GetPrePath(), persist_stream_save(), PersistHistory_SaveHistory(), PersistStream_GetSizeMax(), PropVariantToGUID(), RegExp2_Execute(), RegExp2_put_Pattern(), RegExp2_Test(), SAXAttributes_getIndexFromName(), SAXAttributes_getIndexFromQName(), SAXAttributes_getLocalName(), SAXAttributes_getName(), SAXAttributes_getQName(), SAXAttributes_getType(), SAXAttributes_getURI(), SAXAttributes_getValue(), SEALED_::SetProperty(), stringify_object(), SWbemProperty_create(), test_bstr_cache(), test_create(), test_domdoc(), test_DriveCollection(), test_InitPropVariantFromGUIDAsString(), test_IUri_GetPropertyBSTR(), test_marshal_BSTR(), test_marshal_bstr(), test_mxwriter_flush(), test_Read(), test_ReadAll(), test_registry(), test_SafeArrayGetPutElement_BSTR(), test_saxstr(), test_SysReAllocStringLen(), test_SysStringLen(), test_TxSetText(), test_typelib(), test_VarBstrCat(), test_VarCat(), textstream_writestr(), TLB_SanitizeBSTR(), Uri_GetPropertyLength(), URLMoniker_GetDisplayName(), URLMoniker_GetSizeMax(), URLMoniker_Save(), VarBstrCat(), VarBstrCmp(), variant_to_jsval(), VariantToGUID(), anonymous_namespace{mstscax.cpp}::VariantToString(), VBSAXAttributes_getIndexFromName(), VBSAXAttributes_getIndexFromQName(), VBSAXAttributes_getTypeFromName(), VBSAXAttributes_getTypeFromQName(), VBSAXAttributes_getValueFromName(), VBSAXAttributes_getValueFromQName(), VBSAXContentHandler_endElement(), VBSAXContentHandler_startElement(), Widget_bstr(), and WMSFT_encode_variant().

◆ typelib_ps_AddRef()

static ULONG WINAPI typelib_ps_AddRef ( IPSFactoryBuffer iface)
static

Definition at line 939 of file oleaut.c.

940 {
941  return 2;
942 }

◆ typelib_ps_CreateProxy()

static HRESULT WINAPI typelib_ps_CreateProxy ( IPSFactoryBuffer iface,
IUnknown outer,
REFIID  iid,
IRpcProxyBuffer **  proxy,
void **  out 
)
static

Definition at line 949 of file oleaut.c.

951 {
953  HRESULT hr;
954 
956  if (FAILED(hr)) return hr;
957 
958  hr = CreateProxyFromTypeInfo(typeinfo, outer, iid, proxy, out);
959  if (FAILED(hr))
960  ERR("Failed to create proxy, hr %#x.\n", hr);
961 
962  ITypeInfo_Release(typeinfo);
963  return hr;
964 }
int proxy
Definition: main.c:67
HRESULT hr
Definition: shlfolder.c:183
HRESULT WINAPI CreateProxyFromTypeInfo(ITypeInfo *typeinfo, IUnknown *outer, REFIID iid, IRpcProxyBuffer **proxy_buffer, void **out)
Definition: ndr_typelib.c:1010
LONG HRESULT
Definition: typedefs.h:77
static FILE * out
Definition: regtests2xml.c:44
static ITypeInfo * typeinfo[last_tid]
Definition: apps.c:106
#define ERR(fmt,...)
Definition: debug.h:109
static HRESULT get_typeinfo_for_iid(REFIID iid, ITypeInfo **typeinfo)
Definition: oleaut.c:896

◆ typelib_ps_CreateStub()

static HRESULT WINAPI typelib_ps_CreateStub ( IPSFactoryBuffer iface,
REFIID  iid,
IUnknown server,
IRpcStubBuffer **  stub 
)
static

Definition at line 966 of file oleaut.c.

968 {
970  HRESULT hr;
971 
973  if (FAILED(hr)) return hr;
974 
976  if (FAILED(hr))
977  ERR("Failed to create stub, hr %#x.\n", hr);
978 
979  ITypeInfo_Release(typeinfo);
980  return hr;
981 }
static rfbScreenInfoPtr server
Definition: vnc.c:74
HRESULT hr
Definition: shlfolder.c:183
Definition: stubgen.c:11
LONG HRESULT
Definition: typedefs.h:77
static ITypeInfo * typeinfo[last_tid]
Definition: apps.c:106
#define ERR(fmt,...)
Definition: debug.h:109
static HRESULT get_typeinfo_for_iid(REFIID iid, ITypeInfo **typeinfo)
Definition: oleaut.c:896
HRESULT WINAPI CreateStubFromTypeInfo(ITypeInfo *typeinfo, REFIID iid, IUnknown *server, IRpcStubBuffer **stub_buffer)
Definition: ndr_typelib.c:1145

◆ typelib_ps_QueryInterface()

static HRESULT WINAPI typelib_ps_QueryInterface ( IPSFactoryBuffer iface,
REFIID  iid,
void **  out 
)
static

Definition at line 926 of file oleaut.c.

927 {
928  if (IsEqualIID(iid, &IID_IPSFactoryBuffer) || IsEqualIID(iid, &IID_IUnknown))
929  {
930  *out = iface;
931  return S_OK;
932  }
933 
934  FIXME("No interface for %s.\n", debugstr_guid(iid));
935  *out = NULL;
936  return E_NOINTERFACE;
937 }
#define E_NOINTERFACE
Definition: winerror.h:2364
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:416
#define debugstr_guid
Definition: kernel32.h:35
const GUID IID_IUnknown
static FILE * out
Definition: regtests2xml.c:44
#define S_OK
Definition: intsafe.h:59
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:90

◆ typelib_ps_Release()

static ULONG WINAPI typelib_ps_Release ( IPSFactoryBuffer iface)
static

Definition at line 944 of file oleaut.c.

945 {
946  return 1;
947 }

◆ WINE_DECLARE_DEBUG_CHANNEL()

WINE_DECLARE_DEBUG_CHANNEL ( heap  )

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( ole  )

Variable Documentation

◆ _delimiter

const WCHAR _delimiter[] = {'!',0}
static

Definition at line 511 of file oleaut.c.

◆ bstr_cache

bstr_cache_entry_t bstr_cache[0x10000/BUCKET_SIZE]
static

Definition at line 112 of file oleaut.c.

Referenced by get_cache_entry_from_idx().

◆ bstr_cache_enabled

BOOL bstr_cache_enabled
static

Definition at line 76 of file oleaut.c.

Referenced by DllMain(), get_cache_entry_from_idx(), and SetOaNoCache().

◆ cs_bstr_cache

static CRITICAL_SECTION cs_bstr_cache = { &cs_bstr_cache_dbg, -1, 0, 0, 0, 0 }
static

Definition at line 78 of file oleaut.c.

Referenced by alloc_bstr(), and SysFreeString().

◆ cs_bstr_cache_dbg

CRITICAL_SECTION_DEBUG cs_bstr_cache_dbg
static
Initial value:
=
{
0, 0, &cs_bstr_cache,
0, 0, { (DWORD_PTR)(__FILE__ ": bstr_cache") }
}
static CRITICAL_SECTION cs_bstr_cache
Definition: oleaut.c:78
#define DWORD_PTR
Definition: treelist.c:76
static CRITICAL_SECTION_DEBUG cs_bstr_cache_dbg
Definition: oleaut.c:79
LIST_ENTRY ProcessLocksList
Definition: winbase.h:848

Definition at line 79 of file oleaut.c.

◆ pdelimiter

const WCHAR* pdelimiter = &_delimiter[0]
static

Definition at line 512 of file oleaut.c.

Referenced by GetActiveObject(), and RegisterActiveObject().

◆ pPSDispatchFacBuf

const IPSFactoryBufferVtbl* pPSDispatchFacBuf = &PSDispatchFacBuf_Vtbl
static

Definition at line 1067 of file oleaut.c.

Referenced by DllGetClassObject().

◆ PSDispatchFacBuf_Vtbl

const IPSFactoryBufferVtbl PSDispatchFacBuf_Vtbl
static
Initial value:
=
{
}
static ULONG WINAPI PSDispatchFacBuf_Release(IPSFactoryBuffer *iface)
Definition: oleaut.c:1014
static ULONG WINAPI PSDispatchFacBuf_AddRef(IPSFactoryBuffer *iface)
Definition: oleaut.c:1009
static HRESULT WINAPI PSDispatchFacBuf_QueryInterface(IPSFactoryBuffer *iface, REFIID riid, void **ppv)
Definition: oleaut.c:997
static HRESULT WINAPI PSDispatchFacBuf_CreateProxy(IPSFactoryBuffer *iface, IUnknown *outer, REFIID iid, IRpcProxyBuffer **proxy, void **obj)
Definition: oleaut.c:1019
static HRESULT WINAPI PSDispatchFacBuf_CreateStub(IPSFactoryBuffer *iface, REFIID iid, IUnknown *server, IRpcStubBuffer **stub)
Definition: oleaut.c:1038

Definition at line 1057 of file oleaut.c.

◆ typelib_ps

IPSFactoryBuffer typelib_ps = { &typelib_ps_vtbl }
static

◆ typelib_ps_vtbl

const IPSFactoryBufferVtbl typelib_ps_vtbl
static
Initial value:
=
{
}
static HRESULT WINAPI typelib_ps_CreateProxy(IPSFactoryBuffer *iface, IUnknown *outer, REFIID iid, IRpcProxyBuffer **proxy, void **out)
Definition: oleaut.c:949
static HRESULT WINAPI typelib_ps_QueryInterface(IPSFactoryBuffer *iface, REFIID iid, void **out)
Definition: oleaut.c:926
static ULONG WINAPI typelib_ps_AddRef(IPSFactoryBuffer *iface)
Definition: oleaut.c:939
static ULONG WINAPI typelib_ps_Release(IPSFactoryBuffer *iface)
Definition: oleaut.c:944
static HRESULT WINAPI typelib_ps_CreateStub(IPSFactoryBuffer *iface, REFIID iid, IUnknown *server, IRpcStubBuffer **stub)
Definition: oleaut.c:966

Definition at line 983 of file oleaut.c.