ReactOS  0.4.14-dev-593-g1793dcc
oleaut.c File Reference
#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 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 dispatch_typelib_ps_QueryInterface (IPSFactoryBuffer *iface, REFIID iid, void **out)
 
static ULONG WINAPI dispatch_typelib_ps_AddRef (IPSFactoryBuffer *iface)
 
static ULONG WINAPI dispatch_typelib_ps_Release (IPSFactoryBuffer *iface)
 
static HRESULT dispatch_create_proxy (IUnknown *outer, IRpcProxyBuffer **proxy, void **out)
 
static HRESULT WINAPI dispatch_typelib_ps_CreateProxy (IPSFactoryBuffer *iface, IUnknown *outer, REFIID iid, IRpcProxyBuffer **proxy, void **out)
 
static HRESULT dispatch_create_stub (IUnknown *server, IRpcStubBuffer **stub)
 
static HRESULT WINAPI dispatch_typelib_ps_CreateStub (IPSFactoryBuffer *iface, REFIID iid, IUnknown *server, IRpcStubBuffer **stub)
 
void _get_STDFONT_CF (LPVOID *)
 
void _get_STDPIC_CF (LPVOID *)
 
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 dispatch_typelib_ps_vtbl
 
static IPSFactoryBuffer dispatch_typelib_ps = { &dispatch_typelib_ps_vtbl }
 

Macro Definition Documentation

◆ ARENA_FREE_FILLER

#define ARENA_FREE_FILLER   0xfeeefeee

Definition at line 107 of file oleaut.c.

◆ ARENA_INUSE_FILLER

#define ARENA_INUSE_FILLER   0x55

Definition at line 105 of file oleaut.c.

◆ ARENA_TAIL_FILLER

#define ARENA_TAIL_FILLER   0xab

Definition at line 106 of file oleaut.c.

◆ BUCKET_BUFFER_SIZE

#define BUCKET_BUFFER_SIZE   6

Definition at line 97 of file oleaut.c.

◆ BUCKET_SIZE

#define BUCKET_SIZE   16

Definition at line 96 of file oleaut.c.

◆ COBJMACROS

#define COBJMACROS

Definition at line 26 of file oleaut.c.

Function Documentation

◆ _get_STDFONT_CF()

void _get_STDFONT_CF ( LPVOID )

Definition at line 2285 of file olefont.c.

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

Referenced by DllGetClassObject().

◆ _get_STDPIC_CF()

void _get_STDPIC_CF ( LPVOID )

Definition at line 2618 of file olepicture.c.

2618 { *ppv = &STDPIC_CF; }
static IClassFactoryImpl STDPIC_CF
Definition: olepicture.c:2616
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 798 of file oleaut.c.

799 {
800  struct ifacepsredirect_data *iface;
801  struct tlibredirect_data *tlib;
802  ACTCTX_SECTION_KEYED_DATA data;
803  WCHAR *ptrW;
804 
805  data.cbSize = sizeof(data);
806  if (!FindActCtxSectionGuid(0, NULL, ACTIVATION_CONTEXT_SECTION_COM_INTERFACE_REDIRECTION,
807  iid, &data))
808  return FALSE;
809 
810  iface = (struct ifacepsredirect_data *)data.lpData;
811  if (!FindActCtxSectionGuid(0, NULL, ACTIVATION_CONTEXT_SECTION_COM_TYPE_LIBRARY_REDIRECTION,
812  &iface->tlbid, &data))
813  return FALSE;
814 
815  tlib = (struct tlibredirect_data *)data.lpData;
816  ptrW = (WCHAR *)((BYTE *)data.lpSectionBase + tlib->name_offset);
817 
818  if (tlib->name_len/sizeof(WCHAR) >= len)
819  {
820  ERR("need larger module buffer, %u\n", tlib->name_len);
821  return FALSE;
822  }
823 
824  memcpy(module, ptrW, tlib->name_len);
825  module[tlib->name_len/sizeof(WCHAR)] = 0;
826  return TRUE;
827 }
#define TRUE
Definition: types.h:120
ULONG name_len
Definition: oleaut.c:788
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:789
#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 140 of file oleaut.c.

141 {
143  bstr_t *ret;
144 
145  if(cache_entry) {
147 
148  if(!cache_entry->cnt) {
150  if(cache_entry && !cache_entry->cnt)
151  cache_entry = NULL;
152  }
153 
154  if(cache_entry) {
155  ret = cache_entry->buf[cache_entry->head++];
157  cache_entry->cnt--;
158  }
159 
161 
162  if(cache_entry) {
163  if(WARN_ON(heap)) {
164  size_t fill_size = (FIELD_OFFSET(bstr_t, u.ptr[size])+2*sizeof(WCHAR)-1) & ~(sizeof(WCHAR)-1);
165  memset(ret, ARENA_INUSE_FILLER, fill_size);
166  memset((char *)ret+fill_size, ARENA_TAIL_FILLER, bstr_alloc_size(size)-fill_size);
167  }
168  ret->size = size;
169  return ret;
170  }
171  }
172 
174  if(ret)
175  ret->size = size;
176  return ret;
177 }
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:105
static CRITICAL_SECTION cs_bstr_cache
Definition: oleaut.c:75
Definition: oleaut.c:99
static size_t bstr_alloc_size(size_t size)
Definition: oleaut.c:111
#define BUCKET_SIZE
Definition: oleaut.c:96
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:126
Definition: oleaut.c:84
smooth NULL
Definition: ftsmooth.c:416
#define ARENA_TAIL_FILLER
Definition: oleaut.c:106
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:97
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
#define memset(x, y, z)
Definition: compat.h:39
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: ifs.c:404

Referenced by SysAllocStringByteLen(), and SysAllocStringLen().

◆ bstr_alloc_size()

static size_t bstr_alloc_size ( size_t  size)
inlinestatic

Definition at line 111 of file oleaut.c.

112 {
113  return (FIELD_OFFSET(bstr_t, u.ptr[size]) + sizeof(WCHAR) + BUCKET_SIZE-1) & ~(BUCKET_SIZE-1);
114 }
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:96
Definition: oleaut.c:84
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 116 of file oleaut.c.

117 {
118  return CONTAINING_RECORD((void *)str, bstr_t, u.str);
119 }
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:84
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().

◆ dispatch_create_proxy()

static HRESULT dispatch_create_proxy ( IUnknown outer,
IRpcProxyBuffer **  proxy,
void **  out 
)
static

Definition at line 950 of file oleaut.c.

951 {
953  HRESULT hr;
954 
955  hr = OLEAUTPS_DllGetClassObject(&CLSID_PSFactoryBuffer, &IID_IPSFactoryBuffer, (void **)&factory);
956  if (FAILED(hr)) return hr;
957 
958  hr = IPSFactoryBuffer_CreateProxy(factory, outer, &IID_IDispatch, proxy, out);
959  IPSFactoryBuffer_Release(factory);
960  return hr;
961 }
int proxy
Definition: main.c:67
HRESULT hr
Definition: shlfolder.c:183
Definition: main.c:438
HRESULT WINAPI OLEAUTPS_DllGetClassObject(REFCLSID, REFIID, LPVOID *)
Definition: oleaut.c:762
LONG HRESULT
Definition: typedefs.h:77
static FILE * out
Definition: regtests2xml.c:44
const GUID IID_IDispatch
static ClassFactoryImpl factory
Definition: ole_server.c:234

Referenced by dispatch_typelib_ps_CreateProxy().

◆ dispatch_create_stub()

static HRESULT dispatch_create_stub ( IUnknown server,
IRpcStubBuffer **  stub 
)
static

Definition at line 996 of file oleaut.c.

997 {
999  HRESULT hr;
1000 
1001  hr = OLEAUTPS_DllGetClassObject(&CLSID_PSFactoryBuffer, &IID_IPSFactoryBuffer, (void **)&factory);
1002  if (FAILED(hr)) return hr;
1003 
1004  hr = IPSFactoryBuffer_CreateStub(factory, &IID_IDispatch, server, stub);
1005  IPSFactoryBuffer_Release(factory);
1006  return hr;
1007 }
static rfbScreenInfoPtr server
Definition: vnc.c:74
HRESULT hr
Definition: shlfolder.c:183
Definition: stubgen.c:11
Definition: main.c:438
HRESULT WINAPI OLEAUTPS_DllGetClassObject(REFCLSID, REFIID, LPVOID *)
Definition: oleaut.c:762
LONG HRESULT
Definition: typedefs.h:77
const GUID IID_IDispatch
static ClassFactoryImpl factory
Definition: ole_server.c:234

Referenced by dispatch_typelib_ps_CreateStub().

◆ dispatch_typelib_ps_AddRef()

static ULONG WINAPI dispatch_typelib_ps_AddRef ( IPSFactoryBuffer iface)
static

Definition at line 940 of file oleaut.c.

941 {
942  return 2;
943 }

◆ dispatch_typelib_ps_CreateProxy()

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

Definition at line 963 of file oleaut.c.

965 {
967  TYPEATTR *attr;
968  HRESULT hr;
969 
970  if (IsEqualGUID(iid, &IID_IDispatch))
971  return dispatch_create_proxy(outer, proxy, out);
972 
974  if (FAILED(hr)) return hr;
975 
976  hr = ITypeInfo_GetTypeAttr(typeinfo, &attr);
977  if (FAILED(hr))
978  {
979  ITypeInfo_Release(typeinfo);
980  return hr;
981  }
982 
983  if (attr->typekind == TKIND_INTERFACE || (attr->wTypeFlags & TYPEFLAG_FDUAL))
984  hr = CreateProxyFromTypeInfo(typeinfo, outer, iid, proxy, out);
985  else
986  hr = dispatch_create_proxy(outer, proxy, out);
987 
988  if (FAILED(hr))
989  ERR("Failed to create proxy, hr %#x.\n", hr);
990 
991  ITypeInfo_ReleaseTypeAttr(typeinfo, attr);
992  ITypeInfo_Release(typeinfo);
993  return hr;
994 }
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:1356
LONG HRESULT
Definition: typedefs.h:77
static FILE * out
Definition: regtests2xml.c:44
Definition: cookie.c:201
const GUID IID_IDispatch
__u8 attr
Definition: mkdosfs.c:359
static ITypeInfo * typeinfo[last_tid]
Definition: apps.c:109
#define ERR(fmt,...)
Definition: debug.h:109
static HRESULT get_typeinfo_for_iid(REFIID iid, ITypeInfo **typeinfo)
Definition: oleaut.c:897
static HRESULT dispatch_create_proxy(IUnknown *outer, IRpcProxyBuffer **proxy, void **out)
Definition: oleaut.c:950
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112

◆ dispatch_typelib_ps_CreateStub()

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

Definition at line 1009 of file oleaut.c.

1011 {
1013  TYPEATTR *attr;
1014  HRESULT hr;
1015 
1016  if (IsEqualGUID(iid, &IID_IDispatch))
1017  return dispatch_create_stub(server, stub);
1018 
1019  hr = get_typeinfo_for_iid(iid, &typeinfo);
1020  if (FAILED(hr)) return hr;
1021 
1022  hr = ITypeInfo_GetTypeAttr(typeinfo, &attr);
1023  if (FAILED(hr))
1024  {
1025  ITypeInfo_Release(typeinfo);
1026  return hr;
1027  }
1028 
1029  if (attr->typekind == TKIND_INTERFACE || (attr->wTypeFlags & TYPEFLAG_FDUAL))
1031  else
1033 
1034  if (FAILED(hr))
1035  ERR("Failed to create proxy, hr %#x.\n", hr);
1036 
1037  ITypeInfo_ReleaseTypeAttr(typeinfo, attr);
1038  ITypeInfo_Release(typeinfo);
1039  return hr;
1040 }
static rfbScreenInfoPtr server
Definition: vnc.c:74
HRESULT hr
Definition: shlfolder.c:183
Definition: stubgen.c:11
static HRESULT dispatch_create_stub(IUnknown *server, IRpcStubBuffer **stub)
Definition: oleaut.c:996
LONG HRESULT
Definition: typedefs.h:77
Definition: cookie.c:201
const GUID IID_IDispatch
__u8 attr
Definition: mkdosfs.c:359
static ITypeInfo * typeinfo[last_tid]
Definition: apps.c:109
#define ERR(fmt,...)
Definition: debug.h:109
static HRESULT get_typeinfo_for_iid(REFIID iid, ITypeInfo **typeinfo)
Definition: oleaut.c:897
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
HRESULT WINAPI CreateStubFromTypeInfo(ITypeInfo *typeinfo, REFIID iid, IUnknown *server, IRpcStubBuffer **stub_buffer)
Definition: ndr_typelib.c:1491

◆ dispatch_typelib_ps_QueryInterface()

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

Definition at line 927 of file oleaut.c.

928 {
929  if (IsEqualIID(iid, &IID_IPSFactoryBuffer) || IsEqualIID(iid, &IID_IUnknown))
930  {
931  *out = iface;
932  return S_OK;
933  }
934 
935  FIXME("No interface for %s.\n", debugstr_guid(iid));
936  *out = NULL;
937  return E_NOINTERFACE;
938 }
#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:95

◆ dispatch_typelib_ps_Release()

static ULONG WINAPI dispatch_typelib_ps_Release ( IPSFactoryBuffer iface)
static

Definition at line 945 of file oleaut.c.

946 {
947  return 1;
948 }

◆ DllCanUnloadNow()

HRESULT WINAPI DllCanUnloadNow ( void  )

Definition at line 1101 of file oleaut.c.

1102 {
1103  return S_FALSE;
1104 }
#define S_FALSE
Definition: winerror.h:2357

◆ DllGetClassObject()

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

Definition at line 1059 of file oleaut.c.

1060 {
1061  *ppv = NULL;
1062  if (IsEqualGUID(rclsid,&CLSID_StdFont)) {
1063  if (IsEqualGUID(iid,&IID_IClassFactory)) {
1065  IClassFactory_AddRef((IClassFactory*)*ppv);
1066  return S_OK;
1067  }
1068  }
1069  if (IsEqualGUID(rclsid,&CLSID_StdPicture)) {
1070  if (IsEqualGUID(iid,&IID_IClassFactory)) {
1072  IClassFactory_AddRef((IClassFactory*)*ppv);
1073  return S_OK;
1074  }
1075  }
1076 
1077  if (IsEqualGUID(rclsid, &CLSID_PSDispatch) || IsEqualGUID(rclsid, &CLSID_PSOAInterface))
1078  return IPSFactoryBuffer_QueryInterface(&dispatch_typelib_ps, iid, ppv);
1079 
1080  if (IsEqualCLSID(rclsid, &CLSID_PSTypeComp) ||
1081  IsEqualCLSID(rclsid, &CLSID_PSTypeInfo) ||
1082  IsEqualCLSID(rclsid, &CLSID_PSTypeLib) ||
1083  IsEqualCLSID(rclsid, &CLSID_PSDispatch) ||
1084  IsEqualCLSID(rclsid, &CLSID_PSEnumVariant))
1085  return OLEAUTPS_DllGetClassObject(&CLSID_PSFactoryBuffer, iid, ppv);
1086 
1087  return OLEAUTPS_DllGetClassObject(rclsid, iid, ppv);
1088 }
REFIID LPVOID * ppv
Definition: atlbase.h:39
void _get_STDFONT_CF(LPVOID *)
Definition: olefont.c:2285
const GUID CLSID_StdFont
smooth NULL
Definition: ftsmooth.c:416
HRESULT WINAPI OLEAUTPS_DllGetClassObject(REFCLSID, REFIID, LPVOID *)
Definition: oleaut.c:762
void _get_STDPIC_CF(LPVOID *)
Definition: olepicture.c:2618
static IPSFactoryBuffer dispatch_typelib_ps
Definition: oleaut.c:1051
#define S_OK
Definition: intsafe.h:59
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
const GUID CLSID_StdPicture
const GUID IID_IClassFactory
#define IsEqualCLSID(rclsid1, rclsid2)
Definition: guiddef.h:96

◆ DllMain()

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

Definition at line 1109 of file oleaut.c.

1110 {
1111  static const WCHAR oanocacheW[] = {'o','a','n','o','c','a','c','h','e',0};
1112 
1113  if(fdwReason == DLL_PROCESS_ATTACH)
1114  bstr_cache_enabled = !GetEnvironmentVariableW(oanocacheW, NULL, 0);
1115 
1116  return OLEAUTPS_DllMain( hInstDll, fdwReason, lpvReserved );
1117 }
#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:73
#define GetEnvironmentVariableW(x, y, z)
Definition: compat.h:420

◆ DllRegisterServer()

HRESULT WINAPI DllRegisterServer ( void  )

Definition at line 1122 of file oleaut.c.

1123 {
1124  return OLEAUTPS_DllRegisterServer();
1125 }

◆ DllUnregisterServer()

HRESULT WINAPI DllUnregisterServer ( void  )

Definition at line 1130 of file oleaut.c.

1131 {
1132  return OLEAUTPS_DllUnregisterServer();
1133 }

◆ get_cache_entry()

static bstr_cache_entry_t* get_cache_entry ( size_t  size)
inlinestatic

Definition at line 126 of file oleaut.c.

127 {
128  unsigned cache_idx = FIELD_OFFSET(bstr_t, u.ptr[size+sizeof(WCHAR)-1])/BUCKET_SIZE;
129  return get_cache_entry_from_idx(cache_idx);
130 }
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:121
#define BUCKET_SIZE
Definition: oleaut.c:96
Definition: oleaut.c:84
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 132 of file oleaut.c.

133 {
134  unsigned cache_idx;
135  if (alloc_size < BUCKET_SIZE) return NULL;
136  cache_idx = (alloc_size - BUCKET_SIZE) / BUCKET_SIZE;
137  return get_cache_entry_from_idx(cache_idx);
138 }
static bstr_cache_entry_t * get_cache_entry_from_idx(unsigned cache_idx)
Definition: oleaut.c:121
#define BUCKET_SIZE
Definition: oleaut.c:96
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 121 of file oleaut.c.

122 {
123  return bstr_cache_enabled && cache_idx < ARRAY_SIZE(bstr_cache) ? bstr_cache + cache_idx : NULL;
124 }
static bstr_cache_entry_t bstr_cache[0x10000/BUCKET_SIZE]
Definition: oleaut.c:109
smooth NULL
Definition: ftsmooth.c:416
static BOOL bstr_cache_enabled
Definition: oleaut.c:73
#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 246 of file oleaut.c.

247 {
248  static IMalloc *malloc;
249 
250  if (!malloc)
251  CoGetMalloc(1, &malloc);
252 
253  return malloc;
254 }
HRESULT WINAPI CoGetMalloc(DWORD context, IMalloc **imalloc)
Definition: ifs.c:381
#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 897 of file oleaut.c.

898 {
900  ITypeLib *typelib;
901  HRESULT hr;
902 
903  *typeinfo = NULL;
904 
905  module[0] = 0;
907  {
909  if (FAILED(hr))
910  return hr;
911  }
912 
914  if (hr != S_OK) {
915  ERR("Failed to load typelib for %s, but it should be there.\n", debugstr_guid(iid));
916  return hr;
917  }
918 
919  hr = ITypeLib_GetTypeInfoOfGuid(typelib, iid, typeinfo);
920  ITypeLib_Release(typelib);
921  if (hr != S_OK)
922  ERR("typelib does not contain info for %s\n", debugstr_guid(iid));
923 
924  return hr;
925 }
HRESULT hr
Definition: shlfolder.c:183
static ITypeLib * typelib
Definition: apps.c:108
HRESULT WINAPI LoadTypeLib(const OLECHAR *szFile, ITypeLib **pptLib)
Definition: typelib.c:458
static BOOL actctx_get_typelib_module(REFIID iid, WCHAR *module, DWORD len)
Definition: oleaut.c:798
static HRESULT reg_get_typelib_module(REFIID iid, WCHAR *module, DWORD len)
Definition: oleaut.c:829
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 dispatch_typelib_ps_CreateProxy(), and dispatch_typelib_ps_CreateStub().

◆ GetActiveObject()

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

Definition at line 592 of file oleaut.c.

593 {
594  WCHAR guidbuf[80];
595  HRESULT ret;
596  LPRUNNINGOBJECTTABLE runobtable;
598 
599  StringFromGUID2(rcid,guidbuf,39);
601  if (FAILED(ret))
602  return ret;
603  ret = GetRunningObjectTable(0,&runobtable);
604  if (FAILED(ret)) {
605  IMoniker_Release(moniker);
606  return ret;
607  }
608  ret = IRunningObjectTable_GetObject(runobtable,moniker,ppunk);
609  IRunningObjectTable_Release(runobtable);
610  IMoniker_Release(moniker);
611  return ret;
612 }
interface IRunningObjectTable * LPRUNNINGOBJECTTABLE
Definition: objfwd.h:17
HRESULT WINAPI CreateItemMoniker(LPCOLESTR lpszDelim, LPCOLESTR lpszItem, IMoniker **ppmk)
Definition: itemmoniker.c:935
__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:2434
int ret
interface IMoniker * LPMONIKER
Definition: objfwd.h:9
static const WCHAR * pdelimiter
Definition: oleaut.c:509
HRESULT WINAPI GetRunningObjectTable(DWORD reserved, LPRUNNINGOBJECTTABLE *pprot)
Definition: moniker.c:1035
Definition: main.c:39

Referenced by ITypeInfo_fnCreateInstance().

◆ GetAltMonthNames()

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

Definition at line 1148 of file oleaut.c.

1149 {
1150  static const WCHAR ar_month1W[] = {0x645,0x62d,0x631,0x645,0};
1151  static const WCHAR ar_month2W[] = {0x635,0x641,0x631,0};
1152  static const WCHAR ar_month3W[] = {0x631,0x628,0x64a,0x639,' ',0x627,0x644,0x627,0x648,0x644,0};
1153  static const WCHAR ar_month4W[] = {0x631,0x628,0x64a,0x639,' ',0x627,0x644,0x62b,0x627,0x646,0x64a,0};
1154  static const WCHAR ar_month5W[] = {0x62c,0x645,0x627,0x62f,0x649,' ',0x627,0x644,0x627,0x648,0x644,0x649,0};
1155  static const WCHAR ar_month6W[] = {0x62c,0x645,0x627,0x62f,0x649,' ',0x627,0x644,0x62b,0x627,0x646,0x64a,0x629,0};
1156  static const WCHAR ar_month7W[] = {0x631,0x62c,0x628,0};
1157  static const WCHAR ar_month8W[] = {0x634,0x639,0x628,0x627,0x646,0};
1158  static const WCHAR ar_month9W[] = {0x631,0x645,0x636,0x627,0x646,0};
1159  static const WCHAR ar_month10W[] = {0x634,0x648,0x627,0x643,0};
1160  static const WCHAR ar_month11W[] = {0x630,0x648,' ',0x627,0x644,0x642,0x639,0x62f,0x629,0};
1161  static const WCHAR ar_month12W[] = {0x630,0x648,' ',0x627,0x644,0x62d,0x62c,0x629,0};
1162 
1163  static const WCHAR *arabic_hijri[] =
1164  {
1165  ar_month1W,
1166  ar_month2W,
1167  ar_month3W,
1168  ar_month4W,
1169  ar_month5W,
1170  ar_month6W,
1171  ar_month7W,
1172  ar_month8W,
1173  ar_month9W,
1174  ar_month10W,
1175  ar_month11W,
1176  ar_month12W,
1177  NULL
1178  };
1179 
1180  static const WCHAR pl_month1W[] = {'s','t','y','c','z','n','i','a',0};
1181  static const WCHAR pl_month2W[] = {'l','u','t','e','g','o',0};
1182  static const WCHAR pl_month3W[] = {'m','a','r','c','a',0};
1183  static const WCHAR pl_month4W[] = {'k','w','i','e','t','n','i','a',0};
1184  static const WCHAR pl_month5W[] = {'m','a','j','a',0};
1185  static const WCHAR pl_month6W[] = {'c','z','e','r','w','c','a',0};
1186  static const WCHAR pl_month7W[] = {'l','i','p','c','a',0};
1187  static const WCHAR pl_month8W[] = {'s','i','e','r','p','n','i','a',0};
1188  static const WCHAR pl_month9W[] = {'w','r','z','e',0x15b,'n','i','a',0};
1189  static const WCHAR pl_month10W[] = {'p','a',0x17a,'d','z','i','e','r','n','i','k','a',0};
1190  static const WCHAR pl_month11W[] = {'l','i','s','t','o','p','a','d','a',0};
1191  static const WCHAR pl_month12W[] = {'g','r','u','d','n','i','a',0};
1192 
1193  static const WCHAR *polish_genitive_names[] =
1194  {
1195  pl_month1W,
1196  pl_month2W,
1197  pl_month3W,
1198  pl_month4W,
1199  pl_month5W,
1200  pl_month6W,
1201  pl_month7W,
1202  pl_month8W,
1203  pl_month9W,
1204  pl_month10W,
1205  pl_month11W,
1206  pl_month12W,
1207  NULL
1208  };
1209 
1210  static const WCHAR ru_month1W[] = {0x44f,0x43d,0x432,0x430,0x440,0x44f,0};
1211  static const WCHAR ru_month2W[] = {0x444,0x435,0x432,0x440,0x430,0x43b,0x44f,0};
1212  static const WCHAR ru_month3W[] = {0x43c,0x430,0x440,0x442,0x430,0};
1213  static const WCHAR ru_month4W[] = {0x430,0x43f,0x440,0x435,0x43b,0x44f,0};
1214  static const WCHAR ru_month5W[] = {0x43c,0x430,0x44f,0};
1215  static const WCHAR ru_month6W[] = {0x438,0x44e,0x43d,0x44f,0};
1216  static const WCHAR ru_month7W[] = {0x438,0x44e,0x43b,0x44f,0};
1217  static const WCHAR ru_month8W[] = {0x430,0x432,0x433,0x443,0x441,0x442,0x430,0};
1218  static const WCHAR ru_month9W[] = {0x441,0x435,0x43d,0x442,0x44f,0x431,0x440,0x44f,0};
1219  static const WCHAR ru_month10W[] = {0x43e,0x43a,0x442,0x44f,0x431,0x440,0x44f,0};
1220  static const WCHAR ru_month11W[] = {0x43d,0x43e,0x44f,0x431,0x440,0x44f,0};
1221  static const WCHAR ru_month12W[] = {0x434,0x435,0x43a,0x430,0x431,0x440,0x44f,0};
1222 
1223  static const WCHAR *russian_genitive_names[] =
1224  {
1225  ru_month1W,
1226  ru_month2W,
1227  ru_month3W,
1228  ru_month4W,
1229  ru_month5W,
1230  ru_month6W,
1231  ru_month7W,
1232  ru_month8W,
1233  ru_month9W,
1234  ru_month10W,
1235  ru_month11W,
1236  ru_month12W,
1237  NULL
1238  };
1239 
1240  TRACE("%#x, %p\n", lcid, str);
1241 
1243  *str = (LPOLESTR *)arabic_hijri;
1244  else if (PRIMARYLANGID(LANGIDFROMLCID(lcid)) == LANG_POLISH)
1245  *str = (LPOLESTR *)polish_genitive_names;
1246  else if (PRIMARYLANGID(LANGIDFROMLCID(lcid)) == LANG_RUSSIAN)
1247  *str = (LPOLESTR *)russian_genitive_names;
1248  else
1249  *str = NULL;
1250 
1251  return S_OK;
1252 }
#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 644 of file oleaut.c.

645 {
646  switch(GetVersion() & 0x8000ffff) /* mask off build number */
647  {
648  case 0x80000a03: /* WIN31 */
649  return MAKELONG(0xffff, 20);
650  case 0x00003303: /* NT351 */
651  return MAKELONG(0xffff, 30);
652  case 0x80000004: /* WIN95; I'd like to use the "standard" w95 minor
653  version here (30), but as we still use w95
654  as default winver (which is good IMHO), I better
655  play safe and use the latest value for w95 for now.
656  Change this as soon as default winver gets changed
657  to something more recent */
658  case 0x80000a04: /* WIN98 */
659  case 0x00000004: /* NT40 */
660  case 0x00000005: /* W2K */
661  return MAKELONG(0xffff, 40);
662  case 0x00000105: /* WinXP */
663  case 0x00000006: /* Vista */
664  case 0x00000106: /* Win7 */
665  return MAKELONG(0xffff, 50);
666  default:
667  FIXME("Version value not known yet. Please investigate it !\n");
668  return MAKELONG(0xffff, 40); /* for now return the same value as for w2k */
669  }
670 }
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 762 of file oleaut.c.

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

Referenced by dispatch_create_proxy(), dispatch_create_stub(), and DllGetClassObject().

◆ OleIconToCursor()

HCURSOR WINAPI OleIconToCursor ( HINSTANCE  hinstExe,
HICON  hIcon 
)

Definition at line 1138 of file oleaut.c.

1139 {
1140  FIXME("(%p,%p), partially implemented.\n",hinstExe,hIcon);
1141  /* FIXME: make an extended conversation from HICON to HCURSOR */
1142  return CopyCursor(hIcon);
1143 }
#define CopyCursor(c)
Definition: winuser.h:4210
#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 689 of file oleaut.c.

693 {
694  COLORREF colorref;
695  BYTE b = HIBYTE(HIWORD(clr));
696 
697  TRACE("(%08x, %p, %p)\n", clr, hpal, pColorRef);
698 
699  /*
700  * In case pColorRef is NULL, provide our own to simplify the code.
701  */
702  if (pColorRef == NULL)
703  pColorRef = &colorref;
704 
705  switch (b)
706  {
707  case 0x00:
708  {
709  if (hpal != 0)
710  *pColorRef = PALETTERGB(GetRValue(clr),
711  GetGValue(clr),
712  GetBValue(clr));
713  else
714  *pColorRef = clr;
715 
716  break;
717  }
718 
719  case 0x01:
720  {
721  if (hpal != 0)
722  {
723  PALETTEENTRY pe;
724  /*
725  * Validate the palette index.
726  */
727  if (GetPaletteEntries(hpal, LOWORD(clr), 1, &pe) == 0)
728  return E_INVALIDARG;
729  }
730 
731  *pColorRef = clr;
732 
733  break;
734  }
735 
736  case 0x02:
737  *pColorRef = clr;
738  break;
739 
740  case 0x80:
741  {
742  int index = LOBYTE(LOWORD(clr));
743 
744  /*
745  * Validate GetSysColor index.
746  */
747  if ((index < COLOR_SCROLLBAR) || (index > COLOR_MENUBAR))
748  return E_INVALIDARG;
749 
750  *pColorRef = GetSysColor(index);
751 
752  break;
753  }
754 
755  default:
756  return E_INVALIDARG;
757  }
758 
759  return S_OK;
760 }
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:2934
#define HIBYTE(W)
Definition: jmemdos.c:486
DWORD WINAPI GetSysColor(_In_ int)
#define GetGValue(rgb)
Definition: wingdi.h:2935
#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:300
unsigned char BYTE
Definition: mem.h:68
#define S_OK
Definition: intsafe.h:59
#define PALETTERGB(r, g, b)
Definition: wingdi.h:2941
#define HIWORD(l)
Definition: typedefs.h:246
#define GetBValue(rgb)
Definition: wingdi.h:2936
#define LOWORD(l)
Definition: pedump.c:82

◆ reg_get_typelib_module()

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

Definition at line 829 of file oleaut.c.

830 {
831  REGSAM opposite = (sizeof(void*) == 8) ? KEY_WOW64_32KEY : KEY_WOW64_64KEY;
832  char tlguid[200], typelibkey[300], interfacekey[300], ver[100], tlfn[260];
833  DWORD tlguidlen, verlen, type;
834  LONG tlfnlen, err;
835  BOOL is_wow64;
836  HKEY ikey;
837 
838  sprintf( interfacekey, "Interface\\{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}\\Typelib",
839  iid->Data1, iid->Data2, iid->Data3,
840  iid->Data4[0], iid->Data4[1], iid->Data4[2], iid->Data4[3],
841  iid->Data4[4], iid->Data4[5], iid->Data4[6], iid->Data4[7]
842  );
843 
844  err = RegOpenKeyExA(HKEY_CLASSES_ROOT,interfacekey,0,KEY_READ,&ikey);
845  if (err && (opposite == KEY_WOW64_32KEY || (IsWow64Process(GetCurrentProcess(), &is_wow64)
846  && is_wow64)))
847  err = RegOpenKeyExA(HKEY_CLASSES_ROOT,interfacekey,0,KEY_READ|opposite,&ikey);
848 
849  if (err)
850  {
851  ERR("No %s key found.\n", interfacekey);
852  return E_FAIL;
853  }
854 
855  tlguidlen = sizeof(tlguid);
856  if (RegQueryValueExA(ikey, NULL, NULL, &type, (BYTE *)tlguid, &tlguidlen))
857  {
858  ERR("Getting typelib guid failed.\n");
859  RegCloseKey(ikey);
860  return E_FAIL;
861  }
862 
863  verlen = sizeof(ver);
864  if (RegQueryValueExA(ikey, "Version", NULL, &type, (BYTE *)ver, &verlen))
865  {
866  ERR("Could not get version value?\n");
867  RegCloseKey(ikey);
868  return E_FAIL;
869  }
870 
871  RegCloseKey(ikey);
872 
873 #ifndef __REACTOS__
874  sprintf(typelibkey, "Typelib\\%s\\%s\\0\\win%u", tlguid, ver, sizeof(void *) == 8 ? 64 : 32);
875 #else
876  snprintf(typelibkey, sizeof(typelibkey), "Typelib\\%s\\%s\\0\\win%u", tlguid, ver, sizeof(void *) == 8 ? 64 : 32);
877 #endif /* __REACTOS__ */
878  tlfnlen = sizeof(tlfn);
879  if (RegQueryValueA(HKEY_CLASSES_ROOT, typelibkey, tlfn, &tlfnlen))
880  {
881 #ifdef _WIN64
882  sprintf(typelibkey, "Typelib\\%s\\%s\\0\\win32", tlguid, ver);
883  tlfnlen = sizeof(tlfn);
884  if (RegQueryValueA(HKEY_CLASSES_ROOT, typelibkey, tlfn, &tlfnlen))
885  {
886 #endif
887  ERR("Could not get typelib fn?\n");
888  return E_FAIL;
889 #ifdef _WIN64
890  }
891 #endif
892  }
893  MultiByteToWideChar(CP_ACP, 0, tlfn, -1, module, len);
894  return S_OK;
895 }
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
#define snprintf
Definition: wintirpc.h:48
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:1974
#define KEY_WOW64_64KEY
Definition: cmtypes.h:46
HANDLE WINAPI GetCurrentProcess(VOID)
Definition: proc.c:1138
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 526 of file oleaut.c.

528  {
529  WCHAR guidbuf[80];
530  HRESULT ret;
531  LPRUNNINGOBJECTTABLE runobtable;
533  DWORD rot_flags = ROTFLAGS_REGISTRATIONKEEPSALIVE; /* default registration is strong */
534 
535  StringFromGUID2(rcid,guidbuf,39);
537  if (FAILED(ret))
538  return ret;
539  ret = GetRunningObjectTable(0,&runobtable);
540  if (FAILED(ret)) {
541  IMoniker_Release(moniker);
542  return ret;
543  }
545  rot_flags = 0;
546  ret = IRunningObjectTable_Register(runobtable,rot_flags,punk,moniker,pdwRegister);
547  IRunningObjectTable_Release(runobtable);
548  IMoniker_Release(moniker);
549  return ret;
550 }
#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:935
__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:2434
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:509
HRESULT WINAPI GetRunningObjectTable(DWORD reserved, LPRUNNINGOBJECTTABLE *pprot)
Definition: moniker.c:1035
Definition: main.c:39

◆ RevokeActiveObject()

HRESULT WINAPI DECLSPEC_HOTPATCH RevokeActiveObject ( DWORD  xregister,
LPVOID  reserved 
)

Definition at line 565 of file oleaut.c.

566 {
567  LPRUNNINGOBJECTTABLE runobtable;
568  HRESULT ret;
569 
570  ret = GetRunningObjectTable(0,&runobtable);
571  if (FAILED(ret)) return ret;
572  ret = IRunningObjectTable_Revoke(runobtable,xregister);
573  if (SUCCEEDED(ret)) ret = S_OK;
574  IRunningObjectTable_Release(runobtable);
575  return ret;
576 }
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:1035
#define SUCCEEDED(hr)
Definition: intsafe.h:57

◆ SetOaNoCache()

void WINAPI SetOaNoCache ( void  )

Definition at line 502 of file oleaut.c.

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

◆ SysAllocString()

BSTR WINAPI SysAllocString ( LPCOLESTR  str)

Definition at line 238 of file oleaut.c.

239 {
240  if (!str) return 0;
241 
242  /* Delegate this to the SysAllocStringLen32 method. */
243  return SysAllocStringLen(str, lstrlenW(str));
244 }
BSTR WINAPI SysAllocStringLen(const OLECHAR *str, unsigned int len)
Definition: oleaut.c:339
#define lstrlenW
Definition: compat.h:415
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_namespace(), build_relpath(), 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(), DEVENUM_IPropertyBag_Read(), 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_system_propval(), get_textfont_prop_for_pos(), CFolder::get_Title(), get_value_bstr(), get_vbscript_string(), Global_InvokeEx(), 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_codec(), register_dsound_devices(), register_vfw_codecs(), 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_callbacks(), 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_dmo(), 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_array(), test_marshal_BSTR(), test_marshal_bstr(), test_marshal_LPSAFEARRAY(), test_marshal_struct(), test_marshal_VARIANT(), test_marshal_variant(), test_mediadet(), test_merging_text(), test_mxwriter_properties(), test_namespace(), test_NetFwAuthorizedApplication(), test_notification_query_async(), test_obj_dispex(), test_OleLoadPicturePath(), test_ParseDisplayName(), test_ParseName(), test_persiststreaminit(), test_popup(), test_PropVariantCompare(), test_PropVariantToString(), test_PropVariantToStringWithDefault(), test_query_async(), test_query_semisync(), 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_Baseboard(), test_Win32_Bios(), test_Win32_ComputerSystem(), test_Win32_ComputerSystemProduct(), test_Win32_DisplayControllerConfiguration(), test_Win32_IP4RouteTable(), test_Win32_OperatingSystem(), test_Win32_PhysicalMemory(), test_Win32_PnPEntity(), test_Win32_Printer(), test_Win32_Process(), test_Win32_Processor(), test_Win32_QuickFixEngineering(), test_Win32_Service(), test_Win32_SystemEnclosure(), test_Win32_VideoController(), test_Win32_WinSAT(), 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(), VBScriptError_GetExceptionInfo(), WebBrowser_get_Name(), Widget_bstr(), Widget_DoSomething(), Widget_get_Name(), Widget_Map(), Widget_variant_array(), 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 428 of file oleaut.c.

429 {
430  bstr_t *bstr;
431 
432  /* Detect integer overflow. */
433  if (len >= (UINT_MAX-sizeof(WCHAR)-sizeof(DWORD)))
434  return NULL;
435 
436  bstr = alloc_bstr(len);
437  if(!bstr)
438  return NULL;
439 
440  if(str) {
441  memcpy(bstr->u.ptr, str, len);
442  bstr->u.ptr[len] = 0;
443  }else {
444  memset(bstr->u.ptr, 0, len+1);
445  }
446  bstr->u.str[(len+sizeof(WCHAR)-1)/sizeof(WCHAR)] = 0;
447 
448  return bstr->u.str;
449 }
static bstr_t * alloc_bstr(size_t size)
Definition: oleaut.c:140
Definition: oleaut.c:84
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
union bstr_t::@512 u
__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 UINT_MAX
Definition: limits.h:41
char ptr[1]
Definition: oleaut.c:90
WCHAR str[1]
Definition: oleaut.c:91
#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 339 of file oleaut.c.

340 {
341  bstr_t *bstr;
342  DWORD size;
343 
344  /* Detect integer overflow. */
345  if (len >= ((UINT_MAX-sizeof(WCHAR)-sizeof(DWORD))/sizeof(WCHAR)))
346  return NULL;
347 
348  TRACE("%s\n", debugstr_wn(str, len));
349 
350  size = len*sizeof(WCHAR);
351  bstr = alloc_bstr(size);
352  if(!bstr)
353  return NULL;
354 
355  if(str) {
356  memcpy(bstr->u.str, str, size);
357  bstr->u.str[len] = 0;
358  }else {
359  memset(bstr->u.str, 0, size+sizeof(WCHAR));
360  }
361 
362  return bstr->u.str;
363 }
static bstr_t * alloc_bstr(size_t size)
Definition: oleaut.c:140
Definition: oleaut.c:84
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(), Builtin_Invoke(), 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(), 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(), 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_mxwriter_characters(), 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 271 of file oleaut.c.

272 {
274  bstr_t *bstr;
276  SIZE_T alloc_size;
277 
278  if(!str)
279  return;
280 
281  bstr = bstr_from_str(str);
282 
283  alloc_size = IMalloc_GetSize(malloc, bstr);
284  if (alloc_size == ~0UL)
285  return;
286 
288  if(cache_entry) {
289  unsigned i;
290 
292 
293  /* According to tests, freeing a string that's already in cache doesn't corrupt anything.
294  * For that to work we need to search the cache. */
295  for(i=0; i < cache_entry->cnt; i++) {
296  if(cache_entry->buf[(cache_entry->head+i) % BUCKET_BUFFER_SIZE] == bstr) {
297  WARN_(heap)("String already is in cache!\n");
299  return;
300  }
301  }
302 
303  if(cache_entry->cnt < ARRAY_SIZE(cache_entry->buf)) {
304  cache_entry->buf[(cache_entry->head+cache_entry->cnt) % BUCKET_BUFFER_SIZE] = bstr;
305  cache_entry->cnt++;
306 
307  if(WARN_ON(heap)) {
308  unsigned n = (alloc_size-FIELD_OFFSET(bstr_t, u.ptr))/sizeof(DWORD);
309  for(i=0; i<n; i++)
310  bstr->u.dwptr[i] = ARENA_FREE_FILLER;
311  }
312 
314  return;
315  }
316 
318  }
319 
320  CoTaskMemFree(bstr);
321 }
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:132
static CRITICAL_SECTION cs_bstr_cache
Definition: oleaut.c:75
static bstr_t * bstr_from_str(BSTR str)
Definition: oleaut.c:116
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:420
static IMalloc * get_malloc(void)
Definition: oleaut.c:246
#define ARENA_FREE_FILLER
Definition: oleaut.c:107
GLdouble n
Definition: glext.h:7729
Definition: oleaut.c:99
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:84
const WCHAR * str
union bstr_t::@512 u
unsigned long DWORD
Definition: ntddk_ex.h:95
ULONG_PTR SIZE_T
Definition: typedefs.h:78
DWORD dwptr[1]
Definition: oleaut.c:92
#define ARRAY_SIZE(a)
Definition: main.h:24
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:254
#define BUCKET_BUFFER_SIZE
Definition: oleaut.c:97
#define malloc
Definition: debug_ros.c:4
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
#define WARN_(ch,...)
Definition: debug.h:157
#define UL
Definition: tui.h:83

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_canonical_path(), build_path(), build_proplist(), build_relpath(), ATL::CComBSTR::CComBSTR(), check_codebase(), check_jscript(), class_object_Next(), class_object_NextMethod(), clear_ei(), 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(), Err_Raise(), err_string_prop(), 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_ei(), 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_antecedent_table(), 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_Asc(), 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_callbacks(), 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_eval(), 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_isexpression(), 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_characters(), 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_PropVariantToString(), test_PropVariantToStringWithDefault(), test_protocol(), test_put_data(), test_put_hash(), test_put_href(), test_put_nodeTypedValue(), test_query_async(), test_query_semisync(), 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_Baseboard(), test_Win32_Bios(), test_Win32_ComputerSystem(), test_Win32_ComputerSystemProduct(), test_Win32_DisplayControllerConfiguration(), test_Win32_IP4RouteTable(), test_Win32_OperatingSystem(), test_Win32_PhysicalMemory(), test_Win32_PnPEntity(), test_Win32_Printer(), test_Win32_Process(), test_Win32_Processor(), test_Win32_QuickFixEngineering(), test_Win32_Service(), test_Win32_SystemEnclosure(), test_Win32_VideoController(), test_Win32_WinSAT(), 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 467 of file oleaut.c.

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

Referenced by mxwriter_put_encoding(), and test_SysReAllocString().

◆ SysReAllocStringLen()

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

Definition at line 383 of file oleaut.c.

384 {
385  /* Detect integer overflow. */
386  if (len >= ((UINT_MAX-sizeof(WCHAR)-sizeof(DWORD))/sizeof(WCHAR)))
387  return FALSE;
388 
389  if (*old!=NULL) {
390  DWORD newbytelen = len*sizeof(WCHAR);
391  bstr_t *old_bstr = bstr_from_str(*old);
392  bstr_t *bstr = CoTaskMemRealloc(old_bstr, bstr_alloc_size(newbytelen));
393 
394  if (!bstr) return FALSE;
395 
396  *old = bstr->u.str;
397  bstr->size = newbytelen;
398  /* The old string data is still there when str is NULL */
399  if (str && old_bstr->u.str != str) memmove(bstr->u.str, str, newbytelen);
400  bstr->u.str[len] = 0;
401  } else {
402  *old = SysAllocStringLen(str, len);
403  }
404 
405  return TRUE;
406 }
#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:116
BSTR WINAPI SysAllocStringLen(const OLECHAR *str, unsigned int len)
Definition: oleaut.c:339
static size_t bstr_alloc_size(size_t size)
Definition: oleaut.c:111
Definition: oleaut.c:84
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
union bstr_t::@512 u
__wchar_t WCHAR
Definition: xmlstorage.h:180
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:438
WCHAR str[1]
Definition: oleaut.c:91
DWORD size
Definition: oleaut.c:88

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

◆ SysStringByteLen()

◆ SysStringLen()

UINT WINAPI SysStringLen ( BSTR  str)

Definition at line 196 of file oleaut.c.

197 {
198  return str ? bstr_from_str(str)->size/sizeof(WCHAR) : 0;
199 }
static bstr_t * bstr_from_str(BSTR str)
Definition: oleaut.c:116
const WCHAR * str
__wchar_t WCHAR
Definition: xmlstorage.h:180
DWORD size
Definition: oleaut.c:88

Referenced by anonymous_namespace{activex.cpp}::BstrToLpsz(), build_canonical_path(), build_path(), build_relpath(), check_bstr_length(), _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_Asc(), 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_characters(), 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_characters(), VBSAXContentHandler_endElement(), VBSAXContentHandler_startElement(), Widget_bstr(), and WMSFT_encode_variant().

◆ 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 508 of file oleaut.c.

◆ bstr_cache

bstr_cache_entry_t bstr_cache[0x10000/BUCKET_SIZE]
static

Definition at line 109 of file oleaut.c.

Referenced by get_cache_entry_from_idx().

◆ bstr_cache_enabled

BOOL bstr_cache_enabled
static

Definition at line 73 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 75 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:75
#define DWORD_PTR
Definition: treelist.c:76
static CRITICAL_SECTION_DEBUG cs_bstr_cache_dbg
Definition: oleaut.c:76
LIST_ENTRY ProcessLocksList
Definition: winbase.h:855

Definition at line 76 of file oleaut.c.

◆ dispatch_typelib_ps

IPSFactoryBuffer dispatch_typelib_ps = { &dispatch_typelib_ps_vtbl }
static

Definition at line 1051 of file oleaut.c.

Referenced by DllGetClassObject().

◆ dispatch_typelib_ps_vtbl

const IPSFactoryBufferVtbl dispatch_typelib_ps_vtbl
static
Initial value:
=
{
}
static HRESULT WINAPI dispatch_typelib_ps_CreateProxy(IPSFactoryBuffer *iface, IUnknown *outer, REFIID iid, IRpcProxyBuffer **proxy, void **out)
Definition: oleaut.c:963
static HRESULT WINAPI dispatch_typelib_ps_QueryInterface(IPSFactoryBuffer *iface, REFIID iid, void **out)
Definition: oleaut.c:927
static ULONG WINAPI dispatch_typelib_ps_AddRef(IPSFactoryBuffer *iface)
Definition: oleaut.c:940
static HRESULT WINAPI dispatch_typelib_ps_CreateStub(IPSFactoryBuffer *iface, REFIID iid, IUnknown *server, IRpcStubBuffer **stub)
Definition: oleaut.c:1009
static ULONG WINAPI dispatch_typelib_ps_Release(IPSFactoryBuffer *iface)
Definition: oleaut.c:945

Definition at line 1042 of file oleaut.c.

◆ pdelimiter

const WCHAR* pdelimiter = &_delimiter[0]
static

Definition at line 509 of file oleaut.c.

Referenced by GetActiveObject(), and RegisterActiveObject().