39#include "oleaut32_oaidl.h"
80 0, 0, { (
DWORD_PTR)(__FILE__
": bstr_cache") }
97#define BUCKET_BUFFER_SIZE 6
105#define ARENA_INUSE_FILLER 0x55
106#define ARENA_TAIL_FILLER 0xab
107#define ARENA_FREE_FILLER 0xfeeefeee
283 alloc_size = IMalloc_GetSize(
malloc, bstr);
284 if (alloc_size == ~0
UL)
297 WARN_(
heap)(
"String already is in cache!\n");
394 if (!bstr)
return FALSE;
397 bstr->
size = newbytelen;
533 DWORD rot_flags = ROTFLAGS_REGISTRATIONKEEPSALIVE;
546 ret = IRunningObjectTable_Register(runobtable,rot_flags,punk,
moniker,pdwRegister);
547 IRunningObjectTable_Release(runobtable);
572 ret = IRunningObjectTable_Revoke(runobtable,xregister);
574 IRunningObjectTable_Release(runobtable);
608 ret = IRunningObjectTable_GetObject(runobtable,
moniker,ppunk);
609 IRunningObjectTable_Release(runobtable);
670 FIXME(
"Version value not known yet. Please investigate it !\n");
700 TRACE(
"(%08x, %p, %p)\n", clr, hpal, pColorRef);
705 if (pColorRef ==
NULL)
706 pColorRef = &colorref;
805 ACTCTX_SECTION_KEYED_DATA
data;
823 ERR(
"need larger module buffer, %u\n", tlib->
name_len);
835 char tlguid[200], typelibkey[300], interfacekey[300], ver[100], tlfn[260];
841 sprintf( interfacekey,
"Interface\\{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}\\Typelib",
842 iid->Data1, iid->Data2, iid->Data3,
843 iid->Data4[0], iid->Data4[1], iid->Data4[2], iid->Data4[3],
844 iid->Data4[4], iid->Data4[5], iid->Data4[6], iid->Data4[7]
854 ERR(
"No %s key found.\n", interfacekey);
858 tlguidlen =
sizeof(tlguid);
861 ERR(
"Getting typelib guid failed.\n");
866 verlen =
sizeof(ver);
869 ERR(
"Could not get version value?\n");
877 sprintf(typelibkey,
"Typelib\\%s\\%s\\0\\win%u", tlguid, ver,
sizeof(
void *) == 8 ? 64 : 32);
879 snprintf(typelibkey,
sizeof(typelibkey),
"Typelib\\%s\\%s\\0\\win%u", tlguid, ver,
sizeof(
void *) == 8 ? 64 : 32);
881 tlfnlen =
sizeof(tlfn);
885 sprintf(typelibkey,
"Typelib\\%s\\%s\\0\\win32", tlguid, ver);
886 tlfnlen =
sizeof(tlfn);
890 ERR(
"Could not get typelib fn?\n");
918 ERR(
"Failed to load typelib for %s, but it should be there.\n",
debugstr_guid(iid));
962 IPSFactoryBuffer_Release(
factory);
992 ERR(
"Failed to create proxy, hr %#x.\n",
hr);
1008 IPSFactoryBuffer_Release(
factory);
1038 ERR(
"Failed to create proxy, hr %#x.\n",
hr);
1114 static const WCHAR oanocacheW[] = {
'o',
'a',
'n',
'o',
'c',
'a',
'c',
'h',
'e',0};
1119 return OLEAUTPS_DllMain( hInstDll, fdwReason,
lpvReserved );
1127 return OLEAUTPS_DllRegisterServer();
1135 return OLEAUTPS_DllUnregisterServer();
1143 FIXME(
"(%p,%p), partially implemented.\n",hinstExe,
hIcon);
1153 static const WCHAR ar_month1W[] = {0x645,0x62d,0x631,0x645,0};
1154 static const WCHAR ar_month2W[] = {0x635,0x641,0x631,0};
1155 static const WCHAR ar_month3W[] = {0x631,0x628,0x64a,0x639,
' ',0x627,0x644,0x627,0x648,0x644,0};
1156 static const WCHAR ar_month4W[] = {0x631,0x628,0x64a,0x639,
' ',0x627,0x644,0x62b,0x627,0x646,0x64a,0};
1157 static const WCHAR ar_month5W[] = {0x62c,0x645,0x627,0x62f,0x649,
' ',0x627,0x644,0x627,0x648,0x644,0x649,0};
1158 static const WCHAR ar_month6W[] = {0x62c,0x645,0x627,0x62f,0x649,
' ',0x627,0x644,0x62b,0x627,0x646,0x64a,0x629,0};
1159 static const WCHAR ar_month7W[] = {0x631,0x62c,0x628,0};
1160 static const WCHAR ar_month8W[] = {0x634,0x639,0x628,0x627,0x646,0};
1161 static const WCHAR ar_month9W[] = {0x631,0x645,0x636,0x627,0x646,0};
1162 static const WCHAR ar_month10W[] = {0x634,0x648,0x627,0x643,0};
1163 static const WCHAR ar_month11W[] = {0x630,0x648,
' ',0x627,0x644,0x642,0x639,0x62f,0x629,0};
1164 static const WCHAR ar_month12W[] = {0x630,0x648,
' ',0x627,0x644,0x62d,0x62c,0x629,0};
1166 static const WCHAR *arabic_hijri[] =
1183 static const WCHAR pl_month1W[] = {
's',
't',
'y',
'c',
'z',
'n',
'i',
'a',0};
1184 static const WCHAR pl_month2W[] = {
'l',
'u',
't',
'e',
'g',
'o',0};
1185 static const WCHAR pl_month3W[] = {
'm',
'a',
'r',
'c',
'a',0};
1186 static const WCHAR pl_month4W[] = {
'k',
'w',
'i',
'e',
't',
'n',
'i',
'a',0};
1187 static const WCHAR pl_month5W[] = {
'm',
'a',
'j',
'a',0};
1188 static const WCHAR pl_month6W[] = {
'c',
'z',
'e',
'r',
'w',
'c',
'a',0};
1189 static const WCHAR pl_month7W[] = {
'l',
'i',
'p',
'c',
'a',0};
1190 static const WCHAR pl_month8W[] = {
's',
'i',
'e',
'r',
'p',
'n',
'i',
'a',0};
1191 static const WCHAR pl_month9W[] = {
'w',
'r',
'z',
'e',0x15b,
'n',
'i',
'a',0};
1192 static const WCHAR pl_month10W[] = {
'p',
'a',0x17a,
'd',
'z',
'i',
'e',
'r',
'n',
'i',
'k',
'a',0};
1193 static const WCHAR pl_month11W[] = {
'l',
'i',
's',
't',
'o',
'p',
'a',
'd',
'a',0};
1194 static const WCHAR pl_month12W[] = {
'g',
'r',
'u',
'd',
'n',
'i',
'a',0};
1196 static const WCHAR *polish_genitive_names[] =
1213 static const WCHAR ru_month1W[] = {0x44f,0x43d,0x432,0x430,0x440,0x44f,0};
1214 static const WCHAR ru_month2W[] = {0x444,0x435,0x432,0x440,0x430,0x43b,0x44f,0};
1215 static const WCHAR ru_month3W[] = {0x43c,0x430,0x440,0x442,0x430,0};
1216 static const WCHAR ru_month4W[] = {0x430,0x43f,0x440,0x435,0x43b,0x44f,0};
1217 static const WCHAR ru_month5W[] = {0x43c,0x430,0x44f,0};
1218 static const WCHAR ru_month6W[] = {0x438,0x44e,0x43d,0x44f,0};
1219 static const WCHAR ru_month7W[] = {0x438,0x44e,0x43b,0x44f,0};
1220 static const WCHAR ru_month8W[] = {0x430,0x432,0x433,0x443,0x441,0x442,0x430,0};
1221 static const WCHAR ru_month9W[] = {0x441,0x435,0x43d,0x442,0x44f,0x431,0x440,0x44f,0};
1222 static const WCHAR ru_month10W[] = {0x43e,0x43a,0x442,0x44f,0x431,0x440,0x44f,0};
1223 static const WCHAR ru_month11W[] = {0x43d,0x43e,0x44f,0x431,0x440,0x44f,0};
1224 static const WCHAR ru_month12W[] = {0x434,0x435,0x43a,0x430,0x431,0x440,0x44f,0};
1226 static const WCHAR *russian_genitive_names[] =
#define DECLSPEC_HOTPATCH
static ITypeLib * typelib
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
const GUID IID_IClassFactory
#define RegCloseKey(hKey)
LONG WINAPI RegOpenKeyExA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey, _In_ DWORD ulOptions, _In_ REGSAM samDesired, _Out_ PHKEY phkResult)
LSTATUS WINAPI RegQueryValueA(HKEY hkey, LPCSTR name, LPSTR data, LPLONG count)
LONG WINAPI RegQueryValueExA(_In_ HKEY hkeyorg, _In_ LPCSTR name, _In_ LPDWORD reserved, _Out_opt_ LPDWORD type, _Out_opt_ LPBYTE data, _Inout_opt_ LPDWORD count)
#define DLL_PROCESS_ATTACH
#define GetEnvironmentVariableW(x, y, z)
#define GetCurrentProcess()
#define WINE_DECLARE_DEBUG_CHANNEL(x)
#define MultiByteToWideChar
BOOL WINAPI FindActCtxSectionGuid(DWORD dwFlags, const GUID *lpExtGuid, ULONG ulId, const GUID *lpSearchGuid, PACTCTX_SECTION_KEYED_DATA pInfo)
INT WINAPI StringFromGUID2(REFGUID id, LPOLESTR str, INT cmax)
HRESULT WINAPI GetRunningObjectTable(DWORD reserved, LPRUNNINGOBJECTTABLE *pprot)
HRESULT WINAPI LoadTypeLib(const OLECHAR *szFile, ITypeLib **pptLib)
GLuint GLuint GLsizei GLenum type
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLboolean GLboolean GLboolean b
GLenum GLuint GLenum GLsizei const GLchar * buf
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
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
LPVOID WINAPI CoTaskMemRealloc(LPVOID pvOld, SIZE_T size)
VOID WINAPI CoTaskMemFree(LPVOID ptr)
HRESULT WINAPI CoGetMalloc(DWORD context, IMalloc **imalloc)
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
HRESULT WINAPI CreateItemMoniker(LPCOLESTR lpszDelim, LPCOLESTR lpszItem, IMoniker **ppmk)
static IN DWORD IN LPVOID lpvReserved
#define memcpy(s1, s2, n)
#define memmove(s1, s2, n)
#define sprintf(buf, format,...)
static const CLSID CLSID_StdFont
HRESULT WINAPI CreateStubFromTypeInfo(ITypeInfo *typeinfo, REFIID iid, IUnknown *server, IRpcStubBuffer **stub_buffer)
HRESULT WINAPI CreateProxyFromTypeInfo(ITypeInfo *typeinfo, IUnknown *outer, REFIID iid, IRpcProxyBuffer **proxy_buffer, void **out)
interface IMoniker * LPMONIKER
interface IRunningObjectTable * LPRUNNINGOBJECTTABLE
static const WCHAR _delimiter[]
static HRESULT dispatch_create_proxy(IUnknown *outer, IRpcProxyBuffer **proxy, void **out)
HRESULT WINAPI OleTranslateColor(OLE_COLOR clr, HPALETTE hpal, COLORREF *pColorRef)
HRESULT WINAPI DECLSPEC_HOTPATCH RevokeActiveObject(DWORD xregister, LPVOID reserved)
HRESULT WINAPI DECLSPEC_HOTPATCH GetActiveObject(REFCLSID rcid, LPVOID preserved, LPUNKNOWN *ppunk)
HRESULT WINAPI DllRegisterServer(void)
static const IPSFactoryBufferVtbl dispatch_typelib_ps_vtbl
void _get_STDPIC_CF(LPVOID *)
static size_t bstr_alloc_size(size_t size)
static BOOL actctx_get_typelib_module(REFIID iid, WCHAR *module, DWORD len)
UINT WINAPI SysStringByteLen(BSTR str)
static bstr_cache_entry_t * get_cache_entry_from_idx(unsigned cache_idx)
void _get_STDFONT_CF(LPVOID *)
static HRESULT get_typeinfo_for_iid(REFIID iid, ITypeInfo **typeinfo)
static ULONG WINAPI dispatch_typelib_ps_AddRef(IPSFactoryBuffer *iface)
static bstr_cache_entry_t bstr_cache[0x10000/BUCKET_SIZE]
HRESULT WINAPI OLEAUTPS_DllGetClassObject(REFCLSID, REFIID, LPVOID *)
static HRESULT WINAPI dispatch_typelib_ps_CreateProxy(IPSFactoryBuffer *iface, IUnknown *outer, REFIID iid, IRpcProxyBuffer **proxy, void **out)
static bstr_t * alloc_bstr(size_t size)
static bstr_t * bstr_from_str(BSTR str)
HRESULT WINAPI GetAltMonthNames(LCID lcid, LPOLESTR **str)
BSTR WINAPI SysAllocString(LPCOLESTR str)
INT WINAPI SysReAllocString(LPBSTR old, LPCOLESTR str)
UINT WINAPI SysStringLen(BSTR str)
#define ARENA_FREE_FILLER
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
HRESULT WINAPI DllUnregisterServer(void)
HCURSOR WINAPI OleIconToCursor(HINSTANCE hinstExe, HICON hIcon)
static BOOL bstr_cache_enabled
static HRESULT reg_get_typelib_module(REFIID iid, WCHAR *module, DWORD len)
static const WCHAR * pdelimiter
static bstr_cache_entry_t * get_cache_entry_from_alloc_size(SIZE_T alloc_size)
int WINAPI SysReAllocStringLen(BSTR *old, const OLECHAR *str, unsigned int len)
static ULONG WINAPI dispatch_typelib_ps_Release(IPSFactoryBuffer *iface)
static bstr_cache_entry_t * get_cache_entry(size_t size)
static IMalloc * get_malloc(void)
static CRITICAL_SECTION cs_bstr_cache
static HRESULT dispatch_create_stub(IUnknown *server, IRpcStubBuffer **stub)
static CRITICAL_SECTION_DEBUG cs_bstr_cache_dbg
void WINAPI SetOaNoCache(void)
static HRESULT WINAPI dispatch_typelib_ps_QueryInterface(IPSFactoryBuffer *iface, REFIID iid, void **out)
#define ARENA_INUSE_FILLER
BSTR WINAPI DECLSPEC_HOTPATCH SysAllocStringByteLen(LPCSTR str, UINT len)
#define ARENA_TAIL_FILLER
HRESULT WINAPI DllCanUnloadNow(void)
static HRESULT WINAPI dispatch_typelib_ps_CreateStub(IPSFactoryBuffer *iface, REFIID iid, IUnknown *server, IRpcStubBuffer **stub)
HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID iid, LPVOID *ppv)
HRESULT WINAPI DECLSPEC_HOTPATCH RegisterActiveObject(LPUNKNOWN punk, REFCLSID rcid, DWORD dwFlags, LPDWORD pdwRegister)
BSTR WINAPI SysAllocStringLen(const OLECHAR *str, unsigned int len)
BOOL WINAPI DllMain(HINSTANCE hInstDll, DWORD fdwReason, LPVOID lpvReserved)
static IPSFactoryBuffer dispatch_typelib_ps
#define BUCKET_BUFFER_SIZE
ULONG WINAPI OaBuildVersion(void)
#define ACTIVEOBJECT_WEAK
const GUID CLSID_StdPicture
#define IsEqualGUID(rguid1, rguid2)
#define IsEqualIID(riid1, riid2)
#define IsEqualCLSID(rclsid1, rclsid2)
DWORD WINAPI GetVersion()
#define LANGIDFROMLCID(l)
LIST_ENTRY ProcessLocksList
#define FIELD_OFFSET(t, f)
#define CONTAINING_RECORD(address, type, field)
static rfbScreenInfoPtr server
UINT WINAPI GetPaletteEntries(HPALETTE hpal, UINT iStartIndex, UINT cEntries, LPPALETTEENTRY ppe)
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
#define PALETTERGB(r, g, b)
#define HKEY_CLASSES_ROOT
DWORD WINAPI GetSysColor(_In_ int)