mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 14:03:14 +00:00
[OLEAUT32] Sync with Wine Staging 4.0. CORE-15682
This commit is contained in:
parent
22c8b4bf12
commit
5db885cae7
15 changed files with 585 additions and 2895 deletions
|
@ -25,7 +25,6 @@ list(APPEND SOURCE
|
||||||
olepropframe.c
|
olepropframe.c
|
||||||
recinfo.c
|
recinfo.c
|
||||||
safearray.c
|
safearray.c
|
||||||
tmarshal.c
|
|
||||||
typelib.c
|
typelib.c
|
||||||
usrmarshal.c
|
usrmarshal.c
|
||||||
varformat.c
|
varformat.c
|
||||||
|
|
|
@ -49,6 +49,11 @@ cm1:
|
||||||
pop esi
|
pop esi
|
||||||
pop ebp
|
pop ebp
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
PUBLIC _call_double_method
|
||||||
|
_call_double_method:
|
||||||
|
jmp _call_method
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
END
|
END
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
|
|
||||||
|
@ -122,9 +123,7 @@ static inline bstr_t *bstr_from_str(BSTR str)
|
||||||
|
|
||||||
static inline bstr_cache_entry_t *get_cache_entry_from_idx(unsigned cache_idx)
|
static inline bstr_cache_entry_t *get_cache_entry_from_idx(unsigned cache_idx)
|
||||||
{
|
{
|
||||||
return bstr_cache_enabled && cache_idx < sizeof(bstr_cache)/sizeof(*bstr_cache)
|
return bstr_cache_enabled && cache_idx < ARRAY_SIZE(bstr_cache) ? bstr_cache + cache_idx : NULL;
|
||||||
? bstr_cache + cache_idx
|
|
||||||
: NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline bstr_cache_entry_t *get_cache_entry(size_t size)
|
static inline bstr_cache_entry_t *get_cache_entry(size_t size)
|
||||||
|
@ -272,7 +271,7 @@ static inline IMalloc *get_malloc(void)
|
||||||
* See BSTR.
|
* See BSTR.
|
||||||
* str may be NULL, in which case this function does nothing.
|
* str may be NULL, in which case this function does nothing.
|
||||||
*/
|
*/
|
||||||
void WINAPI SysFreeString(BSTR str)
|
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
|
||||||
{
|
{
|
||||||
bstr_cache_entry_t *cache_entry;
|
bstr_cache_entry_t *cache_entry;
|
||||||
bstr_t *bstr;
|
bstr_t *bstr;
|
||||||
|
@ -304,7 +303,7 @@ void WINAPI SysFreeString(BSTR str)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(cache_entry->cnt < sizeof(cache_entry->buf)/sizeof(*cache_entry->buf)) {
|
if(cache_entry->cnt < ARRAY_SIZE(cache_entry->buf)) {
|
||||||
cache_entry->buf[(cache_entry->head+cache_entry->cnt) % BUCKET_BUFFER_SIZE] = bstr;
|
cache_entry->buf[(cache_entry->head+cache_entry->cnt) % BUCKET_BUFFER_SIZE] = bstr;
|
||||||
cache_entry->cnt++;
|
cache_entry->cnt++;
|
||||||
|
|
||||||
|
@ -429,7 +428,7 @@ int WINAPI SysReAllocStringLen(BSTR* old, const OLECHAR* str, unsigned int len)
|
||||||
* without checking for a terminating NUL.
|
* without checking for a terminating NUL.
|
||||||
* See BSTR.
|
* See BSTR.
|
||||||
*/
|
*/
|
||||||
BSTR WINAPI SysAllocStringByteLen(LPCSTR str, UINT len)
|
BSTR WINAPI DECLSPEC_HOTPATCH SysAllocStringByteLen(LPCSTR str, UINT len)
|
||||||
{
|
{
|
||||||
bstr_t *bstr;
|
bstr_t *bstr;
|
||||||
|
|
||||||
|
@ -768,6 +767,230 @@ extern BOOL WINAPI OLEAUTPS_DllMain(HINSTANCE, DWORD, LPVOID) DECLSPEC_HIDDEN;
|
||||||
extern HRESULT WINAPI OLEAUTPS_DllRegisterServer(void) DECLSPEC_HIDDEN;
|
extern HRESULT WINAPI OLEAUTPS_DllRegisterServer(void) DECLSPEC_HIDDEN;
|
||||||
extern HRESULT WINAPI OLEAUTPS_DllUnregisterServer(void) DECLSPEC_HIDDEN;
|
extern HRESULT WINAPI OLEAUTPS_DllUnregisterServer(void) DECLSPEC_HIDDEN;
|
||||||
|
|
||||||
|
extern HRESULT WINAPI CreateProxyFromTypeInfo(ITypeInfo *typeinfo,
|
||||||
|
IUnknown *outer, REFIID iid, IRpcProxyBuffer **proxy, void **obj);
|
||||||
|
extern HRESULT WINAPI CreateStubFromTypeInfo(ITypeInfo *typeinfo, REFIID iid,
|
||||||
|
IUnknown *server, IRpcStubBuffer **stub);
|
||||||
|
|
||||||
|
struct ifacepsredirect_data
|
||||||
|
{
|
||||||
|
ULONG size;
|
||||||
|
DWORD mask;
|
||||||
|
GUID iid;
|
||||||
|
ULONG nummethods;
|
||||||
|
GUID tlbid;
|
||||||
|
GUID base;
|
||||||
|
ULONG name_len;
|
||||||
|
ULONG name_offset;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct tlibredirect_data
|
||||||
|
{
|
||||||
|
ULONG size;
|
||||||
|
DWORD res;
|
||||||
|
ULONG name_len;
|
||||||
|
ULONG name_offset;
|
||||||
|
LANGID langid;
|
||||||
|
WORD flags;
|
||||||
|
ULONG help_len;
|
||||||
|
ULONG help_offset;
|
||||||
|
WORD major_version;
|
||||||
|
WORD minor_version;
|
||||||
|
};
|
||||||
|
|
||||||
|
static BOOL actctx_get_typelib_module(REFIID iid, WCHAR *module, DWORD len)
|
||||||
|
{
|
||||||
|
struct ifacepsredirect_data *iface;
|
||||||
|
struct tlibredirect_data *tlib;
|
||||||
|
ACTCTX_SECTION_KEYED_DATA data;
|
||||||
|
WCHAR *ptrW;
|
||||||
|
|
||||||
|
data.cbSize = sizeof(data);
|
||||||
|
if (!FindActCtxSectionGuid(0, NULL, ACTIVATION_CONTEXT_SECTION_COM_INTERFACE_REDIRECTION,
|
||||||
|
iid, &data))
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
iface = (struct ifacepsredirect_data *)data.lpData;
|
||||||
|
if (!FindActCtxSectionGuid(0, NULL, ACTIVATION_CONTEXT_SECTION_COM_TYPE_LIBRARY_REDIRECTION,
|
||||||
|
&iface->tlbid, &data))
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
tlib = (struct tlibredirect_data *)data.lpData;
|
||||||
|
ptrW = (WCHAR *)((BYTE *)data.lpSectionBase + tlib->name_offset);
|
||||||
|
|
||||||
|
if (tlib->name_len/sizeof(WCHAR) >= len)
|
||||||
|
{
|
||||||
|
ERR("need larger module buffer, %u\n", tlib->name_len);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
memcpy(module, ptrW, tlib->name_len);
|
||||||
|
module[tlib->name_len/sizeof(WCHAR)] = 0;
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
static HRESULT reg_get_typelib_module(REFIID iid, WCHAR *module, DWORD len)
|
||||||
|
{
|
||||||
|
REGSAM opposite = (sizeof(void*) == 8) ? KEY_WOW64_32KEY : KEY_WOW64_64KEY;
|
||||||
|
char tlguid[200], typelibkey[300], interfacekey[300], ver[100], tlfn[260];
|
||||||
|
DWORD tlguidlen, verlen, type;
|
||||||
|
LONG tlfnlen, err;
|
||||||
|
BOOL is_wow64;
|
||||||
|
HKEY ikey;
|
||||||
|
|
||||||
|
sprintf( interfacekey, "Interface\\{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}\\Typelib",
|
||||||
|
iid->Data1, iid->Data2, iid->Data3,
|
||||||
|
iid->Data4[0], iid->Data4[1], iid->Data4[2], iid->Data4[3],
|
||||||
|
iid->Data4[4], iid->Data4[5], iid->Data4[6], iid->Data4[7]
|
||||||
|
);
|
||||||
|
|
||||||
|
err = RegOpenKeyExA(HKEY_CLASSES_ROOT,interfacekey,0,KEY_READ,&ikey);
|
||||||
|
if (err && (opposite == KEY_WOW64_32KEY || (IsWow64Process(GetCurrentProcess(), &is_wow64)
|
||||||
|
&& is_wow64)))
|
||||||
|
err = RegOpenKeyExA(HKEY_CLASSES_ROOT,interfacekey,0,KEY_READ|opposite,&ikey);
|
||||||
|
|
||||||
|
if (err)
|
||||||
|
{
|
||||||
|
ERR("No %s key found.\n", interfacekey);
|
||||||
|
return E_FAIL;
|
||||||
|
}
|
||||||
|
|
||||||
|
tlguidlen = sizeof(tlguid);
|
||||||
|
if (RegQueryValueExA(ikey, NULL, NULL, &type, (BYTE *)tlguid, &tlguidlen))
|
||||||
|
{
|
||||||
|
ERR("Getting typelib guid failed.\n");
|
||||||
|
RegCloseKey(ikey);
|
||||||
|
return E_FAIL;
|
||||||
|
}
|
||||||
|
|
||||||
|
verlen = sizeof(ver);
|
||||||
|
if (RegQueryValueExA(ikey, "Version", NULL, &type, (BYTE *)ver, &verlen))
|
||||||
|
{
|
||||||
|
ERR("Could not get version value?\n");
|
||||||
|
RegCloseKey(ikey);
|
||||||
|
return E_FAIL;
|
||||||
|
}
|
||||||
|
|
||||||
|
RegCloseKey(ikey);
|
||||||
|
|
||||||
|
sprintf(typelibkey, "Typelib\\%s\\%s\\0\\win%u", tlguid, ver, sizeof(void *) == 8 ? 64 : 32);
|
||||||
|
tlfnlen = sizeof(tlfn);
|
||||||
|
if (RegQueryValueA(HKEY_CLASSES_ROOT, typelibkey, tlfn, &tlfnlen))
|
||||||
|
{
|
||||||
|
#ifdef _WIN64
|
||||||
|
sprintf(typelibkey, "Typelib\\%s\\%s\\0\\win32", tlguid, ver);
|
||||||
|
tlfnlen = sizeof(tlfn);
|
||||||
|
if (RegQueryValueA(HKEY_CLASSES_ROOT, typelibkey, tlfn, &tlfnlen))
|
||||||
|
{
|
||||||
|
#endif
|
||||||
|
ERR("Could not get typelib fn?\n");
|
||||||
|
return E_FAIL;
|
||||||
|
#ifdef _WIN64
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
MultiByteToWideChar(CP_ACP, 0, tlfn, -1, module, len);
|
||||||
|
return S_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
static HRESULT get_typeinfo_for_iid(REFIID iid, ITypeInfo **typeinfo)
|
||||||
|
{
|
||||||
|
WCHAR module[MAX_PATH];
|
||||||
|
ITypeLib *typelib;
|
||||||
|
HRESULT hr;
|
||||||
|
|
||||||
|
*typeinfo = NULL;
|
||||||
|
|
||||||
|
module[0] = 0;
|
||||||
|
if (!actctx_get_typelib_module(iid, module, ARRAY_SIZE(module)))
|
||||||
|
{
|
||||||
|
hr = reg_get_typelib_module(iid, module, ARRAY_SIZE(module));
|
||||||
|
if (FAILED(hr))
|
||||||
|
return hr;
|
||||||
|
}
|
||||||
|
|
||||||
|
hr = LoadTypeLib(module, &typelib);
|
||||||
|
if (hr != S_OK) {
|
||||||
|
ERR("Failed to load typelib for %s, but it should be there.\n", debugstr_guid(iid));
|
||||||
|
return hr;
|
||||||
|
}
|
||||||
|
|
||||||
|
hr = ITypeLib_GetTypeInfoOfGuid(typelib, iid, typeinfo);
|
||||||
|
ITypeLib_Release(typelib);
|
||||||
|
if (hr != S_OK)
|
||||||
|
ERR("typelib does not contain info for %s\n", debugstr_guid(iid));
|
||||||
|
|
||||||
|
return hr;
|
||||||
|
}
|
||||||
|
|
||||||
|
static HRESULT WINAPI typelib_ps_QueryInterface(IPSFactoryBuffer *iface, REFIID iid, void **out)
|
||||||
|
{
|
||||||
|
if (IsEqualIID(iid, &IID_IPSFactoryBuffer) || IsEqualIID(iid, &IID_IUnknown))
|
||||||
|
{
|
||||||
|
*out = iface;
|
||||||
|
return S_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
FIXME("No interface for %s.\n", debugstr_guid(iid));
|
||||||
|
*out = NULL;
|
||||||
|
return E_NOINTERFACE;
|
||||||
|
}
|
||||||
|
|
||||||
|
static ULONG WINAPI typelib_ps_AddRef(IPSFactoryBuffer *iface)
|
||||||
|
{
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
static ULONG WINAPI typelib_ps_Release(IPSFactoryBuffer *iface)
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
static HRESULT WINAPI typelib_ps_CreateProxy(IPSFactoryBuffer *iface,
|
||||||
|
IUnknown *outer, REFIID iid, IRpcProxyBuffer **proxy, void **out)
|
||||||
|
{
|
||||||
|
ITypeInfo *typeinfo;
|
||||||
|
HRESULT hr;
|
||||||
|
|
||||||
|
hr = get_typeinfo_for_iid(iid, &typeinfo);
|
||||||
|
if (FAILED(hr)) return hr;
|
||||||
|
|
||||||
|
hr = CreateProxyFromTypeInfo(typeinfo, outer, iid, proxy, out);
|
||||||
|
if (FAILED(hr))
|
||||||
|
ERR("Failed to create proxy, hr %#x.\n", hr);
|
||||||
|
|
||||||
|
ITypeInfo_Release(typeinfo);
|
||||||
|
return hr;
|
||||||
|
}
|
||||||
|
|
||||||
|
static HRESULT WINAPI typelib_ps_CreateStub(IPSFactoryBuffer *iface, REFIID iid,
|
||||||
|
IUnknown *server, IRpcStubBuffer **stub)
|
||||||
|
{
|
||||||
|
ITypeInfo *typeinfo;
|
||||||
|
HRESULT hr;
|
||||||
|
|
||||||
|
hr = get_typeinfo_for_iid(iid, &typeinfo);
|
||||||
|
if (FAILED(hr)) return hr;
|
||||||
|
|
||||||
|
hr = CreateStubFromTypeInfo(typeinfo, iid, server, stub);
|
||||||
|
if (FAILED(hr))
|
||||||
|
ERR("Failed to create stub, hr %#x.\n", hr);
|
||||||
|
|
||||||
|
ITypeInfo_Release(typeinfo);
|
||||||
|
return hr;
|
||||||
|
}
|
||||||
|
|
||||||
|
static const IPSFactoryBufferVtbl typelib_ps_vtbl =
|
||||||
|
{
|
||||||
|
typelib_ps_QueryInterface,
|
||||||
|
typelib_ps_AddRef,
|
||||||
|
typelib_ps_Release,
|
||||||
|
typelib_ps_CreateProxy,
|
||||||
|
typelib_ps_CreateStub,
|
||||||
|
};
|
||||||
|
|
||||||
|
static IPSFactoryBuffer typelib_ps = { &typelib_ps_vtbl };
|
||||||
|
|
||||||
extern void _get_STDFONT_CF(LPVOID *);
|
extern void _get_STDFONT_CF(LPVOID *);
|
||||||
extern void _get_STDPIC_CF(LPVOID *);
|
extern void _get_STDPIC_CF(LPVOID *);
|
||||||
|
|
||||||
|
@ -793,40 +1016,42 @@ static ULONG WINAPI PSDispatchFacBuf_Release(IPSFactoryBuffer *iface)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI PSDispatchFacBuf_CreateProxy(IPSFactoryBuffer *iface, IUnknown *pUnkOuter, REFIID riid, IRpcProxyBuffer **ppProxy, void **ppv)
|
static HRESULT WINAPI PSDispatchFacBuf_CreateProxy(IPSFactoryBuffer *iface,
|
||||||
|
IUnknown *outer, REFIID iid, IRpcProxyBuffer **proxy, void **obj)
|
||||||
{
|
{
|
||||||
IPSFactoryBuffer *pPSFB;
|
IPSFactoryBuffer *factory;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
|
||||||
if (IsEqualIID(riid, &IID_IDispatch))
|
if (IsEqualIID(iid, &IID_IDispatch))
|
||||||
hr = OLEAUTPS_DllGetClassObject(&CLSID_PSFactoryBuffer, &IID_IPSFactoryBuffer, (void **)&pPSFB);
|
{
|
||||||
else
|
hr = OLEAUTPS_DllGetClassObject(&CLSID_PSFactoryBuffer, &IID_IPSFactoryBuffer, (void **)&factory);
|
||||||
hr = TMARSHAL_DllGetClassObject(&CLSID_PSOAInterface, &IID_IPSFactoryBuffer, (void **)&pPSFB);
|
|
||||||
|
|
||||||
if (FAILED(hr)) return hr;
|
if (FAILED(hr)) return hr;
|
||||||
|
|
||||||
hr = IPSFactoryBuffer_CreateProxy(pPSFB, pUnkOuter, riid, ppProxy, ppv);
|
hr = IPSFactoryBuffer_CreateProxy(factory, outer, iid, proxy, obj);
|
||||||
|
IPSFactoryBuffer_Release(factory);
|
||||||
IPSFactoryBuffer_Release(pPSFB);
|
|
||||||
return hr;
|
return hr;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return IPSFactoryBuffer_CreateProxy(&typelib_ps, outer, iid, proxy, obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI PSDispatchFacBuf_CreateStub(IPSFactoryBuffer *iface, REFIID riid, IUnknown *pUnkOuter, IRpcStubBuffer **ppStub)
|
static HRESULT WINAPI PSDispatchFacBuf_CreateStub(IPSFactoryBuffer *iface,
|
||||||
|
REFIID iid, IUnknown *server, IRpcStubBuffer **stub)
|
||||||
{
|
{
|
||||||
IPSFactoryBuffer *pPSFB;
|
IPSFactoryBuffer *factory;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
|
||||||
if (IsEqualIID(riid, &IID_IDispatch))
|
if (IsEqualIID(iid, &IID_IDispatch))
|
||||||
hr = OLEAUTPS_DllGetClassObject(&CLSID_PSFactoryBuffer, &IID_IPSFactoryBuffer, (void **)&pPSFB);
|
{
|
||||||
else
|
hr = OLEAUTPS_DllGetClassObject(&CLSID_PSFactoryBuffer, &IID_IPSFactoryBuffer, (void **)&factory);
|
||||||
hr = TMARSHAL_DllGetClassObject(&CLSID_PSOAInterface, &IID_IPSFactoryBuffer, (void **)&pPSFB);
|
|
||||||
|
|
||||||
if (FAILED(hr)) return hr;
|
if (FAILED(hr)) return hr;
|
||||||
|
|
||||||
hr = IPSFactoryBuffer_CreateStub(pPSFB, riid, pUnkOuter, ppStub);
|
hr = IPSFactoryBuffer_CreateStub(factory, iid, server, stub);
|
||||||
|
IPSFactoryBuffer_Release(factory);
|
||||||
IPSFactoryBuffer_Release(pPSFB);
|
|
||||||
return hr;
|
return hr;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return IPSFactoryBuffer_CreateStub(&typelib_ps, iid, server, stub);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const IPSFactoryBufferVtbl PSDispatchFacBuf_Vtbl =
|
static const IPSFactoryBufferVtbl PSDispatchFacBuf_Vtbl =
|
||||||
|
@ -866,11 +1091,10 @@ HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID iid, LPVOID *ppv)
|
||||||
IPSFactoryBuffer_AddRef((IPSFactoryBuffer *)*ppv);
|
IPSFactoryBuffer_AddRef((IPSFactoryBuffer *)*ppv);
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
if (IsEqualGUID(rclsid,&CLSID_PSOAInterface)) {
|
|
||||||
if (S_OK==TMARSHAL_DllGetClassObject(rclsid,iid,ppv))
|
if (IsEqualGUID(rclsid, &CLSID_PSOAInterface))
|
||||||
return S_OK;
|
return IPSFactoryBuffer_QueryInterface(&typelib_ps, iid, ppv);
|
||||||
/*FALLTHROUGH*/
|
|
||||||
}
|
|
||||||
if (IsEqualCLSID(rclsid, &CLSID_PSTypeComp) ||
|
if (IsEqualCLSID(rclsid, &CLSID_PSTypeComp) ||
|
||||||
IsEqualCLSID(rclsid, &CLSID_PSTypeInfo) ||
|
IsEqualCLSID(rclsid, &CLSID_PSTypeInfo) ||
|
||||||
IsEqualCLSID(rclsid, &CLSID_PSTypeLib) ||
|
IsEqualCLSID(rclsid, &CLSID_PSTypeLib) ||
|
||||||
|
|
|
@ -591,7 +591,7 @@ static void realize_font(OLEFontImpl *This)
|
||||||
if(This->gdiFont)
|
if(This->gdiFont)
|
||||||
{
|
{
|
||||||
old_font = SelectObject(hdc, This->gdiFont);
|
old_font = SelectObject(hdc, This->gdiFont);
|
||||||
GetTextFaceW(hdc, sizeof(text_face) / sizeof(text_face[0]), text_face);
|
GetTextFaceW(hdc, ARRAY_SIZE(text_face), text_face);
|
||||||
SelectObject(hdc, old_font);
|
SelectObject(hdc, old_font);
|
||||||
dec_int_ref(This->gdiFont);
|
dec_int_ref(This->gdiFont);
|
||||||
This->gdiFont = 0;
|
This->gdiFont = 0;
|
||||||
|
@ -645,7 +645,7 @@ static void realize_font(OLEFontImpl *This)
|
||||||
/* Fixup the name and charset properties so that they match the
|
/* Fixup the name and charset properties so that they match the
|
||||||
selected font */
|
selected font */
|
||||||
old_font = SelectObject(get_dc(), This->gdiFont);
|
old_font = SelectObject(get_dc(), This->gdiFont);
|
||||||
GetTextFaceW(hdc, sizeof(text_face) / sizeof(text_face[0]), text_face);
|
GetTextFaceW(hdc, ARRAY_SIZE(text_face), text_face);
|
||||||
if(lstrcmpiW(text_face, This->description.lpstrName))
|
if(lstrcmpiW(text_face, This->description.lpstrName))
|
||||||
{
|
{
|
||||||
HeapFree(GetProcessHeap(), 0, This->description.lpstrName);
|
HeapFree(GetProcessHeap(), 0, This->description.lpstrName);
|
||||||
|
|
|
@ -287,9 +287,10 @@ static void OLEPictureImpl_SetEMF(OLEPictureImpl *This)
|
||||||
* The caller of this method must release the object when it's
|
* The caller of this method must release the object when it's
|
||||||
* done with it.
|
* done with it.
|
||||||
*/
|
*/
|
||||||
static OLEPictureImpl* OLEPictureImpl_Construct(LPPICTDESC pictDesc, BOOL fOwn)
|
static HRESULT OLEPictureImpl_Construct(LPPICTDESC pictDesc, BOOL fOwn, OLEPictureImpl **pict)
|
||||||
{
|
{
|
||||||
OLEPictureImpl* newObject = 0;
|
OLEPictureImpl *newObject;
|
||||||
|
HRESULT hr;
|
||||||
|
|
||||||
if (pictDesc)
|
if (pictDesc)
|
||||||
TRACE("(%p) type = %d\n", pictDesc, pictDesc->picType);
|
TRACE("(%p) type = %d\n", pictDesc, pictDesc->picType);
|
||||||
|
@ -298,9 +299,8 @@ static OLEPictureImpl* OLEPictureImpl_Construct(LPPICTDESC pictDesc, BOOL fOwn)
|
||||||
* Allocate space for the object.
|
* Allocate space for the object.
|
||||||
*/
|
*/
|
||||||
newObject = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(OLEPictureImpl));
|
newObject = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(OLEPictureImpl));
|
||||||
|
if (!newObject)
|
||||||
if (newObject==0)
|
return E_OUTOFMEMORY;
|
||||||
return newObject;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Initialize the virtual function table.
|
* Initialize the virtual function table.
|
||||||
|
@ -311,12 +311,12 @@ static OLEPictureImpl* OLEPictureImpl_Construct(LPPICTDESC pictDesc, BOOL fOwn)
|
||||||
newObject->IConnectionPointContainer_iface.lpVtbl = &OLEPictureImpl_IConnectionPointContainer_VTable;
|
newObject->IConnectionPointContainer_iface.lpVtbl = &OLEPictureImpl_IConnectionPointContainer_VTable;
|
||||||
|
|
||||||
newObject->pCP = NULL;
|
newObject->pCP = NULL;
|
||||||
CreateConnectionPoint((IUnknown*)&newObject->IPicture_iface, &IID_IPropertyNotifySink,
|
hr = CreateConnectionPoint((IUnknown*)&newObject->IPicture_iface, &IID_IPropertyNotifySink,
|
||||||
&newObject->pCP);
|
&newObject->pCP);
|
||||||
if (!newObject->pCP)
|
if (hr != S_OK)
|
||||||
{
|
{
|
||||||
HeapFree(GetProcessHeap(), 0, newObject);
|
HeapFree(GetProcessHeap(), 0, newObject);
|
||||||
return NULL;
|
return hr;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -365,16 +365,17 @@ static OLEPictureImpl* OLEPictureImpl_Construct(LPPICTDESC pictDesc, BOOL fOwn)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
FIXME("Unsupported type %d\n", pictDesc->picType);
|
WARN("Unsupported type %d\n", pictDesc->picType);
|
||||||
newObject->himetricWidth = newObject->himetricHeight = 0;
|
IPicture_Release(&newObject->IPicture_iface);
|
||||||
break;
|
return E_UNEXPECTED;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
newObject->desc.picType = PICTYPE_UNINITIALIZED;
|
newObject->desc.picType = PICTYPE_UNINITIALIZED;
|
||||||
}
|
}
|
||||||
|
|
||||||
TRACE("returning %p\n", newObject);
|
TRACE("returning %p\n", newObject);
|
||||||
return newObject;
|
*pict = newObject;
|
||||||
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
|
@ -566,36 +567,18 @@ static HRESULT WINAPI OLEPictureImpl_get_hPal(IPicture *iface,
|
||||||
OLE_HANDLE *phandle)
|
OLE_HANDLE *phandle)
|
||||||
{
|
{
|
||||||
OLEPictureImpl *This = impl_from_IPicture(iface);
|
OLEPictureImpl *This = impl_from_IPicture(iface);
|
||||||
HRESULT hres;
|
|
||||||
TRACE("(%p)->(%p)\n", This, phandle);
|
TRACE("(%p)->(%p)\n", This, phandle);
|
||||||
|
|
||||||
if (!phandle)
|
if (!phandle) return E_POINTER;
|
||||||
return E_POINTER;
|
|
||||||
|
|
||||||
switch (This->desc.picType) {
|
if (This->desc.picType == PICTYPE_BITMAP)
|
||||||
case (UINT)PICTYPE_UNINITIALIZED:
|
{
|
||||||
case PICTYPE_NONE:
|
|
||||||
*phandle = 0;
|
|
||||||
hres = S_FALSE;
|
|
||||||
break;
|
|
||||||
case PICTYPE_BITMAP:
|
|
||||||
*phandle = HandleToUlong(This->desc.u.bmp.hpal);
|
*phandle = HandleToUlong(This->desc.u.bmp.hpal);
|
||||||
hres = S_OK;
|
return S_OK;
|
||||||
break;
|
|
||||||
case PICTYPE_METAFILE:
|
|
||||||
hres = E_FAIL;
|
|
||||||
break;
|
|
||||||
case PICTYPE_ICON:
|
|
||||||
case PICTYPE_ENHMETAFILE:
|
|
||||||
default:
|
|
||||||
FIXME("unimplemented for type %d. Returning 0 palette.\n",
|
|
||||||
This->desc.picType);
|
|
||||||
*phandle = 0;
|
|
||||||
hres = S_OK;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TRACE("returning 0x%08x, palette handle %08x\n", hres, *phandle);
|
return E_FAIL;
|
||||||
return hres;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
|
@ -638,6 +621,48 @@ static HRESULT WINAPI OLEPictureImpl_get_Height(IPicture *iface,
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void render_masked_bitmap(OLEPictureImpl *This, HDC hdc,
|
||||||
|
LONG x, LONG y, LONG cx, LONG cy, OLE_XPOS_HIMETRIC xSrc, OLE_YPOS_HIMETRIC ySrc,
|
||||||
|
OLE_XSIZE_HIMETRIC cxSrc, OLE_YSIZE_HIMETRIC cySrc, HBITMAP hbmMask, HBITMAP hbmXor)
|
||||||
|
{
|
||||||
|
HDC hdcBmp;
|
||||||
|
|
||||||
|
/* Set a mapping mode that maps bitmap pixels into HIMETRIC units.
|
||||||
|
* NB y-axis gets flipped
|
||||||
|
*/
|
||||||
|
|
||||||
|
hdcBmp = CreateCompatibleDC(0);
|
||||||
|
SetMapMode(hdcBmp, MM_ANISOTROPIC);
|
||||||
|
SetWindowOrgEx(hdcBmp, 0, 0, NULL);
|
||||||
|
SetWindowExtEx(hdcBmp, This->himetricWidth, This->himetricHeight, NULL);
|
||||||
|
SetViewportOrgEx(hdcBmp, 0, This->origHeight, NULL);
|
||||||
|
SetViewportExtEx(hdcBmp, This->origWidth, -This->origHeight, NULL);
|
||||||
|
|
||||||
|
if (hbmMask)
|
||||||
|
{
|
||||||
|
SetBkColor(hdc, RGB(255, 255, 255));
|
||||||
|
SetTextColor(hdc, RGB(0, 0, 0));
|
||||||
|
|
||||||
|
SelectObject(hdcBmp, hbmMask);
|
||||||
|
StretchBlt(hdc, x, y, cx, cy, hdcBmp, xSrc, ySrc, cxSrc, cySrc, SRCAND);
|
||||||
|
|
||||||
|
if (hbmXor)
|
||||||
|
{
|
||||||
|
SelectObject(hdcBmp, hbmXor);
|
||||||
|
StretchBlt(hdc, x, y, cx, cy, hdcBmp, xSrc, ySrc, cxSrc, cySrc, SRCPAINT);
|
||||||
|
}
|
||||||
|
else StretchBlt(hdc, x, y, cx, cy, hdcBmp, xSrc, ySrc - This->himetricHeight,
|
||||||
|
cxSrc, cySrc, SRCPAINT);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SelectObject(hdcBmp, hbmXor);
|
||||||
|
StretchBlt(hdc, x, y, cx, cy, hdcBmp, xSrc, ySrc, cxSrc, cySrc, SRCCOPY);
|
||||||
|
}
|
||||||
|
|
||||||
|
DeleteDC(hdcBmp);
|
||||||
|
}
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* OLEPictureImpl_Render
|
* OLEPictureImpl_Render
|
||||||
*/
|
*/
|
||||||
|
@ -672,51 +697,36 @@ static HRESULT WINAPI OLEPictureImpl_Render(IPicture *iface, HDC hdc,
|
||||||
return S_OK;
|
return S_OK;
|
||||||
case PICTYPE_BITMAP:
|
case PICTYPE_BITMAP:
|
||||||
{
|
{
|
||||||
HBITMAP hbmpOld;
|
HBITMAP hbmMask, hbmXor;
|
||||||
HDC hdcBmp;
|
|
||||||
|
|
||||||
/* Set a mapping mode that maps bitmap pixels into HIMETRIC units.
|
if (This->hbmMask)
|
||||||
NB y-axis gets flipped */
|
{
|
||||||
|
hbmMask = This->hbmMask;
|
||||||
hdcBmp = CreateCompatibleDC(0);
|
hbmXor = This->hbmXor;
|
||||||
SetMapMode(hdcBmp, MM_ANISOTROPIC);
|
}
|
||||||
SetWindowOrgEx(hdcBmp, 0, 0, NULL);
|
else
|
||||||
SetWindowExtEx(hdcBmp, This->himetricWidth, This->himetricHeight, NULL);
|
{
|
||||||
SetViewportOrgEx(hdcBmp, 0, This->origHeight, NULL);
|
hbmMask = 0;
|
||||||
SetViewportExtEx(hdcBmp, This->origWidth, -This->origHeight, NULL);
|
hbmXor = This->desc.u.bmp.hbitmap;
|
||||||
|
|
||||||
if (This->hbmMask) {
|
|
||||||
HDC hdcMask = CreateCompatibleDC(0);
|
|
||||||
HBITMAP hOldbm = SelectObject(hdcMask, This->hbmMask);
|
|
||||||
|
|
||||||
hbmpOld = SelectObject(hdcBmp, This->hbmXor);
|
|
||||||
|
|
||||||
SetMapMode(hdcMask, MM_ANISOTROPIC);
|
|
||||||
SetWindowOrgEx(hdcMask, 0, 0, NULL);
|
|
||||||
SetWindowExtEx(hdcMask, This->himetricWidth, This->himetricHeight, NULL);
|
|
||||||
SetViewportOrgEx(hdcMask, 0, This->origHeight, NULL);
|
|
||||||
SetViewportExtEx(hdcMask, This->origWidth, -This->origHeight, NULL);
|
|
||||||
|
|
||||||
SetBkColor(hdc, RGB(255, 255, 255));
|
|
||||||
SetTextColor(hdc, RGB(0, 0, 0));
|
|
||||||
StretchBlt(hdc, x, y, cx, cy, hdcMask, xSrc, ySrc, cxSrc, cySrc, SRCAND);
|
|
||||||
StretchBlt(hdc, x, y, cx, cy, hdcBmp, xSrc, ySrc, cxSrc, cySrc, SRCPAINT);
|
|
||||||
|
|
||||||
SelectObject(hdcMask, hOldbm);
|
|
||||||
DeleteDC(hdcMask);
|
|
||||||
} else {
|
|
||||||
hbmpOld = SelectObject(hdcBmp, This->desc.u.bmp.hbitmap);
|
|
||||||
StretchBlt(hdc, x, y, cx, cy, hdcBmp, xSrc, ySrc, cxSrc, cySrc, SRCCOPY);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SelectObject(hdcBmp, hbmpOld);
|
render_masked_bitmap(This, hdc, x, y, cx, cy, xSrc, ySrc, cxSrc, cySrc, hbmMask, hbmXor);
|
||||||
DeleteDC(hdcBmp);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case PICTYPE_ICON:
|
case PICTYPE_ICON:
|
||||||
FIXME("Not quite correct implementation of rendering icons...\n");
|
{
|
||||||
DrawIconEx(hdc, x, y, This->desc.u.icon.hicon, cx, cy, 0, NULL, DI_NORMAL);
|
ICONINFO info;
|
||||||
|
|
||||||
|
if (!GetIconInfo(This->desc.u.icon.hicon, &info))
|
||||||
|
return E_FAIL;
|
||||||
|
|
||||||
|
render_masked_bitmap(This, hdc, x, y, cx, cy, xSrc, ySrc, cxSrc, cySrc, info.hbmMask, info.hbmColor);
|
||||||
|
|
||||||
|
DeleteObject(info.hbmMask);
|
||||||
|
if (info.hbmColor) DeleteObject(info.hbmColor);
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case PICTYPE_METAFILE:
|
case PICTYPE_METAFILE:
|
||||||
{
|
{
|
||||||
|
@ -768,9 +778,17 @@ static HRESULT WINAPI OLEPictureImpl_set_hPal(IPicture *iface,
|
||||||
OLE_HANDLE hpal)
|
OLE_HANDLE hpal)
|
||||||
{
|
{
|
||||||
OLEPictureImpl *This = impl_from_IPicture(iface);
|
OLEPictureImpl *This = impl_from_IPicture(iface);
|
||||||
FIXME("(%p)->(%08x): stub\n", This, hpal);
|
|
||||||
|
TRACE("(%p)->(%08x)\n", This, hpal);
|
||||||
|
|
||||||
|
if (This->desc.picType == PICTYPE_BITMAP)
|
||||||
|
{
|
||||||
|
This->desc.u.bmp.hpal = ULongToHandle(hpal);
|
||||||
OLEPicture_SendNotify(This,DISPID_PICT_HPAL);
|
OLEPicture_SendNotify(This,DISPID_PICT_HPAL);
|
||||||
return E_NOTIMPL;
|
return S_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
return E_FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
|
@ -2310,10 +2328,8 @@ HRESULT WINAPI OleCreatePictureIndirect(LPPICTDESC lpPictDesc, REFIID riid,
|
||||||
|
|
||||||
*ppvObj = NULL;
|
*ppvObj = NULL;
|
||||||
|
|
||||||
newPict = OLEPictureImpl_Construct(lpPictDesc, Own);
|
hr = OLEPictureImpl_Construct(lpPictDesc, Own, &newPict);
|
||||||
|
if (hr != S_OK) return hr;
|
||||||
if (newPict == NULL)
|
|
||||||
return E_OUTOFMEMORY;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Make sure it supports the interface required by the caller.
|
* Make sure it supports the interface required by the caller.
|
||||||
|
@ -2509,7 +2525,7 @@ HRESULT WINAPI OleLoadPicturePath( LPOLESTR szURLorPath, LPUNKNOWN punkCaller,
|
||||||
if (strncmpW(szURLorPath, file, 5) == 0) {
|
if (strncmpW(szURLorPath, file, 5) == 0) {
|
||||||
DWORD size;
|
DWORD size;
|
||||||
hRes = CoInternetParseUrl(szURLorPath, PARSE_PATH_FROM_URL, 0, path_buf,
|
hRes = CoInternetParseUrl(szURLorPath, PARSE_PATH_FROM_URL, 0, path_buf,
|
||||||
sizeof(path_buf)/sizeof(WCHAR), &size, 0);
|
ARRAY_SIZE(path_buf), &size, 0);
|
||||||
if (FAILED(hRes))
|
if (FAILED(hRes))
|
||||||
return hRes;
|
return hRes;
|
||||||
|
|
||||||
|
|
|
@ -289,7 +289,7 @@ static HRESULT SAFEARRAY_DestroyData(SAFEARRAY *psa, ULONG ulStartCell)
|
||||||
ULONG ulCellCount = SAFEARRAY_GetCellCount(psa);
|
ULONG ulCellCount = SAFEARRAY_GetCellCount(psa);
|
||||||
|
|
||||||
if (ulStartCell > ulCellCount) {
|
if (ulStartCell > ulCellCount) {
|
||||||
FIXME("unexpted ulcellcount %d, start %d\n",ulCellCount,ulStartCell);
|
FIXME("unexpected ulCellCount %d, start %d\n",ulCellCount,ulStartCell);
|
||||||
return E_UNEXPECTED;
|
return E_UNEXPECTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -328,7 +328,7 @@ static HRESULT query_typelib_path( REFGUID guid, WORD wMaj, WORD wMin,
|
||||||
return TYPE_E_LIBNOTREGISTERED;
|
return TYPE_E_LIBNOTREGISTERED;
|
||||||
|
|
||||||
nameW = (WCHAR*)((BYTE*)data.lpSectionBase + tlib->name_offset);
|
nameW = (WCHAR*)((BYTE*)data.lpSectionBase + tlib->name_offset);
|
||||||
len = SearchPathW( NULL, nameW, NULL, sizeof(Path)/sizeof(WCHAR), Path, NULL );
|
len = SearchPathW( NULL, nameW, NULL, ARRAY_SIZE( Path ), Path, NULL );
|
||||||
if (!len) return TYPE_E_LIBNOTREGISTERED;
|
if (!len) return TYPE_E_LIBNOTREGISTERED;
|
||||||
|
|
||||||
TRACE_(typelib)("got path from context %s\n", debugstr_w(Path));
|
TRACE_(typelib)("got path from context %s\n", debugstr_w(Path));
|
||||||
|
@ -979,11 +979,11 @@ enddeleteloop:
|
||||||
|
|
||||||
/* check if there is anything besides the FLAGS/HELPDIR keys.
|
/* check if there is anything besides the FLAGS/HELPDIR keys.
|
||||||
If there is, we don't delete them */
|
If there is, we don't delete them */
|
||||||
tmpLength = sizeof(subKeyName)/sizeof(WCHAR);
|
tmpLength = ARRAY_SIZE(subKeyName);
|
||||||
deleteOtherStuff = TRUE;
|
deleteOtherStuff = TRUE;
|
||||||
i = 0;
|
i = 0;
|
||||||
while(RegEnumKeyExW(key, i++, subKeyName, &tmpLength, NULL, NULL, NULL, NULL) == ERROR_SUCCESS) {
|
while(RegEnumKeyExW(key, i++, subKeyName, &tmpLength, NULL, NULL, NULL, NULL) == ERROR_SUCCESS) {
|
||||||
tmpLength = sizeof(subKeyName)/sizeof(WCHAR);
|
tmpLength = ARRAY_SIZE(subKeyName);
|
||||||
|
|
||||||
/* if its not FLAGS or HELPDIR, then we must keep the rest of the key */
|
/* if its not FLAGS or HELPDIR, then we must keep the rest of the key */
|
||||||
if (!strcmpW(subKeyName, FLAGSW)) continue;
|
if (!strcmpW(subKeyName, FLAGSW)) continue;
|
||||||
|
@ -2685,7 +2685,7 @@ static ITypeInfoImpl * MSFT_DoTypeInfo(
|
||||||
ptiRet->typeattr.wMajorVerNum = LOWORD(tiBase.version);
|
ptiRet->typeattr.wMajorVerNum = LOWORD(tiBase.version);
|
||||||
ptiRet->typeattr.wMinorVerNum = HIWORD(tiBase.version);
|
ptiRet->typeattr.wMinorVerNum = HIWORD(tiBase.version);
|
||||||
ptiRet->typeattr.cImplTypes = tiBase.cImplTypes;
|
ptiRet->typeattr.cImplTypes = tiBase.cImplTypes;
|
||||||
ptiRet->typeattr.cbSizeVft = tiBase.cbSizeVft; /* FIXME: this is only the non inherited part */
|
ptiRet->typeattr.cbSizeVft = tiBase.cbSizeVft;
|
||||||
if (ptiRet->typeattr.typekind == TKIND_ALIAS) {
|
if (ptiRet->typeattr.typekind == TKIND_ALIAS) {
|
||||||
TYPEDESC tmp;
|
TYPEDESC tmp;
|
||||||
MSFT_GetTdesc(pcx, tiBase.datatype1, &tmp);
|
MSFT_GetTdesc(pcx, tiBase.datatype1, &tmp);
|
||||||
|
@ -6405,6 +6405,7 @@ static HRESULT WINAPI ITypeInfo_fnGetIDsOfNames( ITypeInfo2 *iface,
|
||||||
#ifdef __i386__
|
#ifdef __i386__
|
||||||
|
|
||||||
extern LONGLONG call_method( void *func, int nb_args, const DWORD *args, int *stack_offset );
|
extern LONGLONG call_method( void *func, int nb_args, const DWORD *args, int *stack_offset );
|
||||||
|
extern double call_double_method( void *func, int nb_args, const DWORD *args, int *stack_offset );
|
||||||
__ASM_GLOBAL_FUNC( call_method,
|
__ASM_GLOBAL_FUNC( call_method,
|
||||||
"pushl %ebp\n\t"
|
"pushl %ebp\n\t"
|
||||||
__ASM_CFI(".cfi_adjust_cfa_offset 4\n\t")
|
__ASM_CFI(".cfi_adjust_cfa_offset 4\n\t")
|
||||||
|
@ -6439,45 +6440,13 @@ __ASM_GLOBAL_FUNC( call_method,
|
||||||
__ASM_CFI(".cfi_def_cfa %esp,4\n\t")
|
__ASM_CFI(".cfi_def_cfa %esp,4\n\t")
|
||||||
__ASM_CFI(".cfi_same_value %ebp\n\t")
|
__ASM_CFI(".cfi_same_value %ebp\n\t")
|
||||||
"ret" )
|
"ret" )
|
||||||
|
__ASM_GLOBAL_FUNC( call_double_method,
|
||||||
/* same function but returning floating point */
|
"jmp " __ASM_NAME("call_method") )
|
||||||
static double (* const call_double_method)(void*,int,const DWORD*,int*) = (void *)call_method;
|
|
||||||
|
|
||||||
/* ITypeInfo::Invoke
|
|
||||||
*
|
|
||||||
* Invokes a method, or accesses a property of an object, that implements the
|
|
||||||
* interface described by the type description.
|
|
||||||
*/
|
|
||||||
DWORD _invoke(FARPROC func, CALLCONV callconv, int nrargs, DWORD_PTR *args)
|
|
||||||
{
|
|
||||||
DWORD res;
|
|
||||||
int stack_offset;
|
|
||||||
|
|
||||||
if (TRACE_ON(ole)) {
|
|
||||||
int i;
|
|
||||||
TRACE("Calling %p(",func);
|
|
||||||
for (i=0;i<min(nrargs,30);i++) TRACE("%08lx,",args[i]);
|
|
||||||
if (nrargs > 30) TRACE("...");
|
|
||||||
TRACE(")\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (callconv) {
|
|
||||||
case CC_STDCALL:
|
|
||||||
case CC_CDECL:
|
|
||||||
res = call_method(func, nrargs, (DWORD *)args, &stack_offset);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
FIXME("unsupported calling convention %d\n",callconv);
|
|
||||||
res = -1;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
TRACE("returns %08x\n",res);
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
|
|
||||||
#elif defined(__x86_64__)
|
#elif defined(__x86_64__)
|
||||||
|
|
||||||
extern DWORD_PTR CDECL call_method( void *func, int nb_args, const DWORD_PTR *args );
|
extern DWORD_PTR CDECL call_method( void *func, int nb_args, const DWORD_PTR *args );
|
||||||
|
extern double CDECL call_double_method( void *func, int nb_args, const DWORD_PTR *args );
|
||||||
__ASM_GLOBAL_FUNC( call_method,
|
__ASM_GLOBAL_FUNC( call_method,
|
||||||
"pushq %rbp\n\t"
|
"pushq %rbp\n\t"
|
||||||
__ASM_CFI(".cfi_adjust_cfa_offset 8\n\t")
|
__ASM_CFI(".cfi_adjust_cfa_offset 8\n\t")
|
||||||
|
@ -6517,41 +6486,14 @@ __ASM_GLOBAL_FUNC( call_method,
|
||||||
__ASM_CFI(".cfi_adjust_cfa_offset -8\n\t")
|
__ASM_CFI(".cfi_adjust_cfa_offset -8\n\t")
|
||||||
__ASM_CFI(".cfi_same_value %rbp\n\t")
|
__ASM_CFI(".cfi_same_value %rbp\n\t")
|
||||||
"ret")
|
"ret")
|
||||||
|
__ASM_GLOBAL_FUNC( call_double_method,
|
||||||
/* same function but returning floating point */
|
"jmp " __ASM_NAME("call_method") )
|
||||||
static double (CDECL * const call_double_method)(void*,int,const DWORD_PTR*) = (void *)call_method;
|
|
||||||
|
|
||||||
DWORD _invoke(FARPROC func, CALLCONV callconv, int nrargs, DWORD_PTR *args)
|
|
||||||
{
|
|
||||||
DWORD res;
|
|
||||||
|
|
||||||
if (TRACE_ON(ole))
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
TRACE("Calling %p(", func);
|
|
||||||
for (i=0; i<min(nrargs, 30); i++) TRACE("%016lx,", args[i]);
|
|
||||||
if (nrargs > 30) TRACE("...");
|
|
||||||
TRACE(")\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (callconv) {
|
|
||||||
case CC_STDCALL:
|
|
||||||
case CC_CDECL:
|
|
||||||
res = call_method(func, nrargs, args);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
FIXME("unsupported calling convention %d\n", callconv);
|
|
||||||
res = -1;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
TRACE("returns %08x\n", res);
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
|
|
||||||
#elif defined(__arm__)
|
#elif defined(__arm__)
|
||||||
|
|
||||||
extern LONGLONG CDECL call_method( void *func, int nb_stk_args, const DWORD *stk_args, const DWORD *reg_args );
|
extern LONGLONG CDECL call_method( void *func, int nb_stk_args, const DWORD *stk_args, const DWORD *reg_args );
|
||||||
|
extern float CDECL call_float_method( void *func, int nb_stk_args, const DWORD *stk_args, const DWORD *reg_args );
|
||||||
|
extern double CDECL call_double_method( void *func, int nb_stk_args, const DWORD *stk_args, const DWORD *reg_args );
|
||||||
__ASM_GLOBAL_FUNC( call_method,
|
__ASM_GLOBAL_FUNC( call_method,
|
||||||
/* r0 = *func
|
/* r0 = *func
|
||||||
* r1 = nb_stk_args
|
* r1 = nb_stk_args
|
||||||
|
@ -6582,12 +6524,12 @@ __ASM_GLOBAL_FUNC( call_method,
|
||||||
"mov sp, fp\n\t" /* Clean the stack using fp */
|
"mov sp, fp\n\t" /* Clean the stack using fp */
|
||||||
"pop {fp, pc}\n\t" /* Restore fp and return */
|
"pop {fp, pc}\n\t" /* Restore fp and return */
|
||||||
)
|
)
|
||||||
|
__ASM_GLOBAL_FUNC( call_float_method,
|
||||||
|
"b " __ASM_NAME("call_method") )
|
||||||
|
__ASM_GLOBAL_FUNC( call_double_method,
|
||||||
|
"b " __ASM_NAME("call_method") )
|
||||||
|
|
||||||
/* same function but returning single/double floating point */
|
#endif /* __arm__ */
|
||||||
static float (CDECL * const call_float_method)(void *, int, const DWORD *, const DWORD *) = (void *)call_method;
|
|
||||||
static double (CDECL * const call_double_method)(void *, int, const DWORD *, const DWORD *) = (void *)call_method;
|
|
||||||
|
|
||||||
#endif /* __x86_64__ */
|
|
||||||
|
|
||||||
static HRESULT userdefined_to_variantvt(ITypeInfo *tinfo, const TYPEDESC *tdesc, VARTYPE *vt)
|
static HRESULT userdefined_to_variantvt(ITypeInfo *tinfo, const TYPEDESC *tdesc, VARTYPE *vt)
|
||||||
{
|
{
|
||||||
|
@ -6728,6 +6670,7 @@ static HRESULT get_iface_guid(ITypeInfo *tinfo, HREFTYPE href, GUID *guid)
|
||||||
ITypeInfo *tinfo2;
|
ITypeInfo *tinfo2;
|
||||||
TYPEATTR *tattr;
|
TYPEATTR *tattr;
|
||||||
HRESULT hres;
|
HRESULT hres;
|
||||||
|
int flags, i;
|
||||||
|
|
||||||
hres = ITypeInfo_GetRefTypeInfo(tinfo, href, &tinfo2);
|
hres = ITypeInfo_GetRefTypeInfo(tinfo, href, &tinfo2);
|
||||||
if(FAILED(hres))
|
if(FAILED(hres))
|
||||||
|
@ -6749,21 +6692,22 @@ static HRESULT get_iface_guid(ITypeInfo *tinfo, HREFTYPE href, GUID *guid)
|
||||||
*guid = tattr->guid;
|
*guid = tattr->guid;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TKIND_COCLASS: {
|
case TKIND_COCLASS:
|
||||||
unsigned int i;
|
for (i = 0; i < tattr->cImplTypes; i++)
|
||||||
int type_flags;
|
{
|
||||||
|
ITypeInfo_GetImplTypeFlags(tinfo2, i, &flags);
|
||||||
for(i = 0; i < tattr->cImplTypes; i++)
|
if (flags & IMPLTYPEFLAG_FDEFAULT)
|
||||||
if(SUCCEEDED(ITypeInfo_GetImplTypeFlags(tinfo2, i, &type_flags)) &&
|
|
||||||
type_flags == (IMPLTYPEFLAG_FSOURCE|IMPLTYPEFLAG_FDEFAULT)) break;
|
|
||||||
|
|
||||||
if(i < tattr->cImplTypes) {
|
|
||||||
hres = ITypeInfo_GetRefTypeOfImplType(tinfo2, i, &href);
|
|
||||||
if(SUCCEEDED(hres)) hres = get_iface_guid(tinfo2, href, guid);
|
|
||||||
} else hres = E_UNEXPECTED;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (i == tattr->cImplTypes)
|
||||||
|
i = 0;
|
||||||
|
|
||||||
|
hres = ITypeInfo_GetRefTypeOfImplType(tinfo2, i, &href);
|
||||||
|
if (SUCCEEDED(hres))
|
||||||
|
hres = get_iface_guid(tinfo2, href, guid);
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
ERR("Unexpected typekind %d\n", tattr->typekind);
|
ERR("Unexpected typekind %d\n", tattr->typekind);
|
||||||
hres = E_UNEXPECTED;
|
hres = E_UNEXPECTED;
|
||||||
|
@ -6818,7 +6762,7 @@ DispCallFunc(
|
||||||
VARTYPE* prgvt, VARIANTARG** prgpvarg, VARIANT* pvargResult)
|
VARTYPE* prgvt, VARIANTARG** prgpvarg, VARIANT* pvargResult)
|
||||||
{
|
{
|
||||||
#ifdef __i386__
|
#ifdef __i386__
|
||||||
int argspos, stack_offset;
|
int argspos = 0, stack_offset;
|
||||||
void *func;
|
void *func;
|
||||||
UINT i;
|
UINT i;
|
||||||
DWORD *args;
|
DWORD *args;
|
||||||
|
@ -6836,8 +6780,6 @@ DispCallFunc(
|
||||||
/* maximum size for an argument is sizeof(VARIANT) */
|
/* maximum size for an argument is sizeof(VARIANT) */
|
||||||
args = heap_alloc(sizeof(VARIANT) * cActuals + sizeof(DWORD) * 2 );
|
args = heap_alloc(sizeof(VARIANT) * cActuals + sizeof(DWORD) * 2 );
|
||||||
|
|
||||||
/* start at 1 in case we need to pass a pointer to the return value as arg 0 */
|
|
||||||
argspos = 1;
|
|
||||||
if (pvInstance)
|
if (pvInstance)
|
||||||
{
|
{
|
||||||
const FARPROC *vtable = *(FARPROC **)pvInstance;
|
const FARPROC *vtable = *(FARPROC **)pvInstance;
|
||||||
|
@ -6846,6 +6788,20 @@ DispCallFunc(
|
||||||
}
|
}
|
||||||
else func = (void *)oVft;
|
else func = (void *)oVft;
|
||||||
|
|
||||||
|
switch (vtReturn)
|
||||||
|
{
|
||||||
|
case VT_DECIMAL:
|
||||||
|
case VT_VARIANT:
|
||||||
|
args[argspos++] = (DWORD)pvargResult; /* arg 0 is a pointer to the result */
|
||||||
|
break;
|
||||||
|
case VT_HRESULT:
|
||||||
|
WARN("invalid return type %u\n", vtReturn);
|
||||||
|
heap_free( args );
|
||||||
|
return E_INVALIDARG;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
for (i = 0; i < cActuals; i++)
|
for (i = 0; i < cActuals; i++)
|
||||||
{
|
{
|
||||||
VARIANT *arg = prgpvarg[i];
|
VARIANT *arg = prgpvarg[i];
|
||||||
|
@ -6880,40 +6836,24 @@ DispCallFunc(
|
||||||
switch (vtReturn)
|
switch (vtReturn)
|
||||||
{
|
{
|
||||||
case VT_EMPTY:
|
case VT_EMPTY:
|
||||||
call_method( func, argspos - 1, args + 1, &stack_offset );
|
case VT_DECIMAL:
|
||||||
|
case VT_VARIANT:
|
||||||
|
call_method( func, argspos, args, &stack_offset );
|
||||||
break;
|
break;
|
||||||
case VT_R4:
|
case VT_R4:
|
||||||
V_R4(pvargResult) = call_double_method( func, argspos - 1, args + 1, &stack_offset );
|
V_R4(pvargResult) = call_double_method( func, argspos, args, &stack_offset );
|
||||||
break;
|
break;
|
||||||
case VT_R8:
|
case VT_R8:
|
||||||
case VT_DATE:
|
case VT_DATE:
|
||||||
V_R8(pvargResult) = call_double_method( func, argspos - 1, args + 1, &stack_offset );
|
V_R8(pvargResult) = call_double_method( func, argspos, args, &stack_offset );
|
||||||
break;
|
|
||||||
case VT_DECIMAL:
|
|
||||||
case VT_VARIANT:
|
|
||||||
if (pvInstance)
|
|
||||||
{
|
|
||||||
args[0] = (DWORD)pvInstance; /* arg 0 is a pointer to the instance */
|
|
||||||
args[1] = (DWORD)pvargResult; /* arg 1 is a pointer to the result */
|
|
||||||
call_method( func, argspos, args, &stack_offset );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
args[0] = (DWORD)pvargResult; /* arg 0 is a pointer to the result */
|
|
||||||
call_method( func, argspos, args, &stack_offset );
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case VT_I8:
|
case VT_I8:
|
||||||
case VT_UI8:
|
case VT_UI8:
|
||||||
case VT_CY:
|
case VT_CY:
|
||||||
V_UI8(pvargResult) = call_method( func, argspos - 1, args + 1, &stack_offset );
|
V_UI8(pvargResult) = call_method( func, argspos, args, &stack_offset );
|
||||||
break;
|
break;
|
||||||
case VT_HRESULT:
|
|
||||||
WARN("invalid return type %u\n", vtReturn);
|
|
||||||
heap_free( args );
|
|
||||||
return E_INVALIDARG;
|
|
||||||
default:
|
default:
|
||||||
V_UI4(pvargResult) = call_method( func, argspos - 1, args + 1, &stack_offset );
|
V_UI4(pvargResult) = call_method( func, argspos, args, &stack_offset );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
heap_free( args );
|
heap_free( args );
|
||||||
|
@ -6927,7 +6867,7 @@ DispCallFunc(
|
||||||
return S_OK;
|
return S_OK;
|
||||||
|
|
||||||
#elif defined(__x86_64__)
|
#elif defined(__x86_64__)
|
||||||
int argspos;
|
int argspos = 0;
|
||||||
UINT i;
|
UINT i;
|
||||||
DWORD_PTR *args;
|
DWORD_PTR *args;
|
||||||
void *func;
|
void *func;
|
||||||
|
@ -6945,8 +6885,6 @@ DispCallFunc(
|
||||||
/* maximum size for an argument is sizeof(DWORD_PTR) */
|
/* maximum size for an argument is sizeof(DWORD_PTR) */
|
||||||
args = heap_alloc( sizeof(DWORD_PTR) * (cActuals + 2) );
|
args = heap_alloc( sizeof(DWORD_PTR) * (cActuals + 2) );
|
||||||
|
|
||||||
/* start at 1 in case we need to pass a pointer to the return value as arg 0 */
|
|
||||||
argspos = 1;
|
|
||||||
if (pvInstance)
|
if (pvInstance)
|
||||||
{
|
{
|
||||||
const FARPROC *vtable = *(FARPROC **)pvInstance;
|
const FARPROC *vtable = *(FARPROC **)pvInstance;
|
||||||
|
@ -6955,6 +6893,20 @@ DispCallFunc(
|
||||||
}
|
}
|
||||||
else func = (void *)oVft;
|
else func = (void *)oVft;
|
||||||
|
|
||||||
|
switch (vtReturn)
|
||||||
|
{
|
||||||
|
case VT_DECIMAL:
|
||||||
|
case VT_VARIANT:
|
||||||
|
args[argspos++] = (DWORD_PTR)pvargResult; /* arg 0 is a pointer to the result */
|
||||||
|
break;
|
||||||
|
case VT_HRESULT:
|
||||||
|
WARN("invalid return type %u\n", vtReturn);
|
||||||
|
heap_free( args );
|
||||||
|
return E_INVALIDARG;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
for (i = 0; i < cActuals; i++)
|
for (i = 0; i < cActuals; i++)
|
||||||
{
|
{
|
||||||
VARIANT *arg = prgpvarg[i];
|
VARIANT *arg = prgpvarg[i];
|
||||||
|
@ -6978,32 +6930,18 @@ DispCallFunc(
|
||||||
switch (vtReturn)
|
switch (vtReturn)
|
||||||
{
|
{
|
||||||
case VT_R4:
|
case VT_R4:
|
||||||
V_R4(pvargResult) = call_double_method( func, argspos - 1, args + 1 );
|
V_R4(pvargResult) = call_double_method( func, argspos, args );
|
||||||
break;
|
break;
|
||||||
case VT_R8:
|
case VT_R8:
|
||||||
case VT_DATE:
|
case VT_DATE:
|
||||||
V_R8(pvargResult) = call_double_method( func, argspos - 1, args + 1 );
|
V_R8(pvargResult) = call_double_method( func, argspos, args );
|
||||||
break;
|
break;
|
||||||
case VT_DECIMAL:
|
case VT_DECIMAL:
|
||||||
case VT_VARIANT:
|
case VT_VARIANT:
|
||||||
if (pvInstance)
|
|
||||||
{
|
|
||||||
args[0] = (DWORD_PTR)pvInstance; /* arg 0 is a pointer to the instance */
|
|
||||||
args[1] = (DWORD_PTR)pvargResult; /* arg 1 is a pointer to the result */
|
|
||||||
call_method( func, argspos, args );
|
call_method( func, argspos, args );
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
args[0] = (DWORD_PTR)pvargResult; /* arg 0 is a pointer to the result */
|
|
||||||
call_method( func, argspos, args );
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case VT_HRESULT:
|
|
||||||
WARN("invalid return type %u\n", vtReturn);
|
|
||||||
heap_free( args );
|
|
||||||
return E_INVALIDARG;
|
|
||||||
default:
|
default:
|
||||||
V_UI8(pvargResult) = call_method( func, argspos - 1, args + 1 );
|
V_UI8(pvargResult) = call_method( func, argspos, args );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
heap_free( args );
|
heap_free( args );
|
||||||
|
@ -7043,6 +6981,14 @@ DispCallFunc(
|
||||||
argspos = 0;
|
argspos = 0;
|
||||||
rcount = 0;
|
rcount = 0;
|
||||||
|
|
||||||
|
if (pvInstance)
|
||||||
|
{
|
||||||
|
const FARPROC *vtable = *(FARPROC **)pvInstance;
|
||||||
|
func = vtable[oVft/sizeof(void *)];
|
||||||
|
regs.r[rcount++] = (DWORD)pvInstance; /* the This pointer is always the first parameter */
|
||||||
|
}
|
||||||
|
else func = (void *)oVft;
|
||||||
|
|
||||||
/* Determine if we need to pass a pointer for the return value as arg 0. If so, do that */
|
/* Determine if we need to pass a pointer for the return value as arg 0. If so, do that */
|
||||||
/* first as it will need to be in the 'r' registers: */
|
/* first as it will need to be in the 'r' registers: */
|
||||||
switch (vtReturn)
|
switch (vtReturn)
|
||||||
|
@ -7058,14 +7004,6 @@ DispCallFunc(
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pvInstance)
|
|
||||||
{
|
|
||||||
const FARPROC *vtable = *(FARPROC **)pvInstance;
|
|
||||||
func = vtable[oVft/sizeof(void *)];
|
|
||||||
regs.r[rcount++] = (DWORD)pvInstance; /* the This pointer is always the first parameter */
|
|
||||||
}
|
|
||||||
else func = (void *)oVft;
|
|
||||||
|
|
||||||
/* maximum size for an argument is sizeof(VARIANT). Also allow for return pointer and stack alignment. */
|
/* maximum size for an argument is sizeof(VARIANT). Also allow for return pointer and stack alignment. */
|
||||||
args = heap_alloc( sizeof(VARIANT) * cActuals + sizeof(DWORD) * 4 );
|
args = heap_alloc( sizeof(VARIANT) * cActuals + sizeof(DWORD) * 4 );
|
||||||
|
|
||||||
|
@ -7912,7 +7850,7 @@ static BOOL CALLBACK search_res_tlb(HMODULE hModule, LPCWSTR lpszType, LPWSTR lp
|
||||||
if (!(len = GetModuleFileNameW(hModule, szPath, MAX_PATH)))
|
if (!(len = GetModuleFileNameW(hModule, szPath, MAX_PATH)))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
if (snprintfW(szPath + len, sizeof(szPath)/sizeof(WCHAR) - len, formatW, LOWORD(lpszName)) < 0)
|
if (snprintfW(szPath + len, ARRAY_SIZE(szPath) - len, formatW, LOWORD(lpszName)) < 0)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
ret = LoadTypeLibEx(szPath, REGKIND_NONE, &pTLib);
|
ret = LoadTypeLibEx(szPath, REGKIND_NONE, &pTLib);
|
||||||
|
|
|
@ -142,11 +142,11 @@ typedef struct tagMSFT_TypeInfoBase {
|
||||||
INT helpcontext; /* */
|
INT helpcontext; /* */
|
||||||
INT oCustData; /* offset in customer data table */
|
INT oCustData; /* offset in customer data table */
|
||||||
#ifdef WORDS_BIGENDIAN
|
#ifdef WORDS_BIGENDIAN
|
||||||
INT16 cbSizeVft; /* virtual table size, not including inherits */
|
INT16 cbSizeVft; /* virtual table size, including inherits */
|
||||||
INT16 cImplTypes; /* nr of implemented interfaces */
|
INT16 cImplTypes; /* nr of implemented interfaces */
|
||||||
#else
|
#else
|
||||||
INT16 cImplTypes; /* nr of implemented interfaces */
|
INT16 cImplTypes; /* nr of implemented interfaces */
|
||||||
INT16 cbSizeVft; /* virtual table size, not including inherits */
|
INT16 cbSizeVft; /* virtual table size, including inherits */
|
||||||
#endif
|
#endif
|
||||||
/*050*/ INT size; /* size in bytes, at least for structures */
|
/*050*/ INT size; /* size in bytes, at least for structures */
|
||||||
/* FIXME: name of this field */
|
/* FIXME: name of this field */
|
||||||
|
@ -155,10 +155,8 @@ typedef struct tagMSFT_TypeInfoBase {
|
||||||
/* if coclass: offset in reftable */
|
/* if coclass: offset in reftable */
|
||||||
/* if interface: reference to inherited if */
|
/* if interface: reference to inherited if */
|
||||||
/* if module: offset to dllname in name table */
|
/* if module: offset to dllname in name table */
|
||||||
INT datatype2; /* if 0x8000, entry above is valid */
|
INT datatype2; /* for interfaces: hiword is num of inherited funcs */
|
||||||
/* actually dunno */
|
/* loword is num of inherited interfaces */
|
||||||
/* else it is zero? */
|
|
||||||
/* if interface: inheritance level | no of inherited funcs */
|
|
||||||
INT res18; /* always? 0 */
|
INT res18; /* always? 0 */
|
||||||
/*060*/ INT res19; /* always? -1 */
|
/*060*/ INT res19; /* always? -1 */
|
||||||
} MSFT_TypeInfoBase;
|
} MSFT_TypeInfoBase;
|
||||||
|
@ -281,9 +279,10 @@ typedef struct {
|
||||||
to the typeinfo itself or to a member of
|
to the typeinfo itself or to a member of
|
||||||
the typeinfo */
|
the typeinfo */
|
||||||
INT next_hash; /* offset to next name in the hash bucket */
|
INT next_hash; /* offset to next name in the hash bucket */
|
||||||
INT namelen; /* only lower 8 bits are valid,
|
INT namelen; /* only lower 8 bits are valid */
|
||||||
lower-middle 8 bits are unknown (flags?),
|
/* 0x1000 if name is only used once as a variable name */
|
||||||
upper 16 bits are hash code */
|
/* 0x2000 if name is a variable in an enumeration */
|
||||||
|
/* 0x3800 if name is typeinfo name */
|
||||||
} MSFT_NameIntro;
|
} MSFT_NameIntro;
|
||||||
/* the custom data table directory has entries like this */
|
/* the custom data table directory has entries like this */
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
@ -596,12 +595,6 @@ WORD typeofarray
|
||||||
|
|
||||||
#include "poppack.h"
|
#include "poppack.h"
|
||||||
|
|
||||||
HRESULT ITypeInfoImpl_GetInternalFuncDesc( ITypeInfo *iface, UINT index, const FUNCDESC **ppFuncDesc ) DECLSPEC_HIDDEN;
|
|
||||||
|
|
||||||
extern DWORD _invoke(FARPROC func, CALLCONV callconv, int nrargs, DWORD_PTR *args) DECLSPEC_HIDDEN;
|
|
||||||
|
|
||||||
HRESULT TMARSHAL_DllGetClassObject(REFCLSID rclsid, REFIID iid,LPVOID *ppv) DECLSPEC_HIDDEN;
|
|
||||||
|
|
||||||
/* The OLE Automation ProxyStub Interface Class (aka Typelib Marshaler) */
|
/* The OLE Automation ProxyStub Interface Class (aka Typelib Marshaler) */
|
||||||
DEFINE_OLEGUID( CLSID_PSDispatch, 0x00020420, 0x0000, 0x0000 );
|
DEFINE_OLEGUID( CLSID_PSDispatch, 0x00020420, 0x0000, 0x0000 );
|
||||||
DEFINE_OLEGUID( CLSID_PSEnumVariant, 0x00020421, 0x0000, 0x0000 );
|
DEFINE_OLEGUID( CLSID_PSEnumVariant, 0x00020421, 0x0000, 0x0000 );
|
||||||
|
|
|
@ -227,6 +227,9 @@ unsigned int get_type_size(ULONG *pFlags, VARTYPE vt)
|
||||||
case VT_INT:
|
case VT_INT:
|
||||||
case VT_UINT:
|
case VT_UINT:
|
||||||
return sizeof(INT);
|
return sizeof(INT);
|
||||||
|
case VT_I8:
|
||||||
|
case VT_UI8:
|
||||||
|
return sizeof(LONGLONG);
|
||||||
case VT_R4:
|
case VT_R4:
|
||||||
return sizeof(FLOAT);
|
return sizeof(FLOAT);
|
||||||
case VT_R8:
|
case VT_R8:
|
||||||
|
@ -644,6 +647,7 @@ void WINAPI VARIANT_UserFree(ULONG *pFlags, VARIANT *pvar)
|
||||||
break;
|
break;
|
||||||
case VT_UNKNOWN | VT_BYREF:
|
case VT_UNKNOWN | VT_BYREF:
|
||||||
case VT_DISPATCH | VT_BYREF:
|
case VT_DISPATCH | VT_BYREF:
|
||||||
|
if (*V_UNKNOWNREF(pvar))
|
||||||
IUnknown_Release(*V_UNKNOWNREF(pvar));
|
IUnknown_Release(*V_UNKNOWNREF(pvar));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -449,8 +449,7 @@ static inline const BYTE *VARIANT_GetNamedFormat(LPCWSTR lpszFormat)
|
||||||
LPCNAMED_FORMAT fmt;
|
LPCNAMED_FORMAT fmt;
|
||||||
|
|
||||||
key.name = lpszFormat;
|
key.name = lpszFormat;
|
||||||
fmt = bsearch(&key, VARIANT_NamedFormats,
|
fmt = bsearch(&key, VARIANT_NamedFormats, ARRAY_SIZE(VARIANT_NamedFormats),
|
||||||
sizeof(VARIANT_NamedFormats)/sizeof(NAMED_FORMAT),
|
|
||||||
sizeof(NAMED_FORMAT), FormatCompareFn);
|
sizeof(NAMED_FORMAT), FormatCompareFn);
|
||||||
return fmt ? fmt->format : NULL;
|
return fmt ? fmt->format : NULL;
|
||||||
}
|
}
|
||||||
|
@ -764,7 +763,7 @@ HRESULT WINAPI VarTokenizeFormatString(LPOLESTR lpszFormat, LPBYTE rgbTok,
|
||||||
TRACE("time sep\n");
|
TRACE("time sep\n");
|
||||||
}
|
}
|
||||||
else if ((*pFormat == 'a' || *pFormat == 'A') &&
|
else if ((*pFormat == 'a' || *pFormat == 'A') &&
|
||||||
!strncmpiW(pFormat, szAMPM, sizeof(szAMPM)/sizeof(WCHAR)))
|
!strncmpiW(pFormat, szAMPM, ARRAY_SIZE(szAMPM)))
|
||||||
{
|
{
|
||||||
/* Date formats: System AM/PM designation
|
/* Date formats: System AM/PM designation
|
||||||
* Other formats: Literal
|
* Other formats: Literal
|
||||||
|
@ -772,8 +771,8 @@ HRESULT WINAPI VarTokenizeFormatString(LPOLESTR lpszFormat, LPBYTE rgbTok,
|
||||||
*/
|
*/
|
||||||
header->type = FMT_TYPE_DATE;
|
header->type = FMT_TYPE_DATE;
|
||||||
NEED_SPACE(sizeof(BYTE));
|
NEED_SPACE(sizeof(BYTE));
|
||||||
pFormat += sizeof(szAMPM)/sizeof(WCHAR);
|
pFormat += ARRAY_SIZE(szAMPM);
|
||||||
if (!strncmpW(pFormat, szampm, sizeof(szampm)/sizeof(WCHAR)))
|
if (!strncmpW(pFormat, szampm, ARRAY_SIZE(szampm)))
|
||||||
*pOut++ = FMT_DATE_AMPM_SYS2;
|
*pOut++ = FMT_DATE_AMPM_SYS2;
|
||||||
else
|
else
|
||||||
*pOut++ = FMT_DATE_AMPM_SYS1;
|
*pOut++ = FMT_DATE_AMPM_SYS1;
|
||||||
|
@ -811,8 +810,7 @@ HRESULT WINAPI VarTokenizeFormatString(LPOLESTR lpszFormat, LPBYTE rgbTok,
|
||||||
*pLastHours = *pLastHours + 2;
|
*pLastHours = *pLastHours + 2;
|
||||||
TRACE("A/P\n");
|
TRACE("A/P\n");
|
||||||
}
|
}
|
||||||
else if (*pFormat == 'a' &&
|
else if (*pFormat == 'a' && !strncmpW(pFormat, szamSlashpm, ARRAY_SIZE(szamSlashpm)))
|
||||||
!strncmpW(pFormat, szamSlashpm, sizeof(szamSlashpm)/sizeof(WCHAR)))
|
|
||||||
{
|
{
|
||||||
/* Date formats: lowercase AM or PM designation
|
/* Date formats: lowercase AM or PM designation
|
||||||
* Other formats: Literal
|
* Other formats: Literal
|
||||||
|
@ -820,14 +818,13 @@ HRESULT WINAPI VarTokenizeFormatString(LPOLESTR lpszFormat, LPBYTE rgbTok,
|
||||||
*/
|
*/
|
||||||
header->type = FMT_TYPE_DATE;
|
header->type = FMT_TYPE_DATE;
|
||||||
NEED_SPACE(sizeof(BYTE));
|
NEED_SPACE(sizeof(BYTE));
|
||||||
pFormat += sizeof(szamSlashpm)/sizeof(WCHAR);
|
pFormat += ARRAY_SIZE(szamSlashpm);
|
||||||
*pOut++ = FMT_DATE_AMPM_LOWER;
|
*pOut++ = FMT_DATE_AMPM_LOWER;
|
||||||
if (pLastHours)
|
if (pLastHours)
|
||||||
*pLastHours = *pLastHours + 2;
|
*pLastHours = *pLastHours + 2;
|
||||||
TRACE("AM/PM\n");
|
TRACE("AM/PM\n");
|
||||||
}
|
}
|
||||||
else if (*pFormat == 'A' &&
|
else if (*pFormat == 'A' && !strncmpW(pFormat, szAMSlashPM, ARRAY_SIZE(szAMSlashPM)))
|
||||||
!strncmpW(pFormat, szAMSlashPM, sizeof(szAMSlashPM)/sizeof(WCHAR)))
|
|
||||||
{
|
{
|
||||||
/* Date formats: Uppercase AM or PM designation
|
/* Date formats: Uppercase AM or PM designation
|
||||||
* Other formats: Literal
|
* Other formats: Literal
|
||||||
|
@ -835,7 +832,7 @@ HRESULT WINAPI VarTokenizeFormatString(LPOLESTR lpszFormat, LPBYTE rgbTok,
|
||||||
*/
|
*/
|
||||||
header->type = FMT_TYPE_DATE;
|
header->type = FMT_TYPE_DATE;
|
||||||
NEED_SPACE(sizeof(BYTE));
|
NEED_SPACE(sizeof(BYTE));
|
||||||
pFormat += sizeof(szAMSlashPM)/sizeof(WCHAR);
|
pFormat += ARRAY_SIZE(szAMSlashPM);
|
||||||
*pOut++ = FMT_DATE_AMPM_UPPER;
|
*pOut++ = FMT_DATE_AMPM_UPPER;
|
||||||
TRACE("AM/PM\n");
|
TRACE("AM/PM\n");
|
||||||
}
|
}
|
||||||
|
@ -847,7 +844,7 @@ HRESULT WINAPI VarTokenizeFormatString(LPOLESTR lpszFormat, LPBYTE rgbTok,
|
||||||
*/
|
*/
|
||||||
header->type = FMT_TYPE_DATE;
|
header->type = FMT_TYPE_DATE;
|
||||||
NEED_SPACE(sizeof(BYTE));
|
NEED_SPACE(sizeof(BYTE));
|
||||||
pFormat += sizeof(szAMSlashPM)/sizeof(WCHAR);
|
pFormat += ARRAY_SIZE(szAMSlashPM);
|
||||||
*pOut++ = FMT_DATE_GENERAL;
|
*pOut++ = FMT_DATE_GENERAL;
|
||||||
TRACE("gen date\n");
|
TRACE("gen date\n");
|
||||||
}
|
}
|
||||||
|
@ -989,14 +986,14 @@ HRESULT WINAPI VarTokenizeFormatString(LPOLESTR lpszFormat, LPBYTE rgbTok,
|
||||||
fmt_state &= ~FMT_STATE_OPEN_COPY;
|
fmt_state &= ~FMT_STATE_OPEN_COPY;
|
||||||
}
|
}
|
||||||
else if ((*pFormat == 't' || *pFormat == 'T') &&
|
else if ((*pFormat == 't' || *pFormat == 'T') &&
|
||||||
!strncmpiW(pFormat, szTTTTT, sizeof(szTTTTT)/sizeof(WCHAR)))
|
!strncmpiW(pFormat, szTTTTT, ARRAY_SIZE(szTTTTT)))
|
||||||
{
|
{
|
||||||
/* Date formats: System time specifier
|
/* Date formats: System time specifier
|
||||||
* Other formats: Literal
|
* Other formats: Literal
|
||||||
* Types the format if found
|
* Types the format if found
|
||||||
*/
|
*/
|
||||||
header->type = FMT_TYPE_DATE;
|
header->type = FMT_TYPE_DATE;
|
||||||
pFormat += sizeof(szTTTTT)/sizeof(WCHAR);
|
pFormat += ARRAY_SIZE(szTTTTT);
|
||||||
NEED_SPACE(sizeof(BYTE));
|
NEED_SPACE(sizeof(BYTE));
|
||||||
*pOut++ = FMT_DATE_TIME_SYS;
|
*pOut++ = FMT_DATE_TIME_SYS;
|
||||||
fmt_state &= ~FMT_STATE_OPEN_COPY;
|
fmt_state &= ~FMT_STATE_OPEN_COPY;
|
||||||
|
@ -1316,8 +1313,7 @@ static HRESULT VARIANT_FormatNumber(LPVARIANT pVarIn, LPOLESTR lpszFormat,
|
||||||
|
|
||||||
if (numHeader->flags & FMT_FLAG_THOUSANDS)
|
if (numHeader->flags & FMT_FLAG_THOUSANDS)
|
||||||
{
|
{
|
||||||
if (!GetLocaleInfoW(lcid, LOCALE_STHOUSAND, thousandSeparator,
|
if (!GetLocaleInfoW(lcid, LOCALE_STHOUSAND, thousandSeparator, ARRAY_SIZE(thousandSeparator)))
|
||||||
sizeof(thousandSeparator)/sizeof(WCHAR)))
|
|
||||||
{
|
{
|
||||||
thousandSeparator[0] = ',';
|
thousandSeparator[0] = ',';
|
||||||
thousandSeparator[1] = 0;
|
thousandSeparator[1] = 0;
|
||||||
|
@ -1555,8 +1551,7 @@ VARIANT_FormatNumber_Bool:
|
||||||
}
|
}
|
||||||
if (localeValue)
|
if (localeValue)
|
||||||
{
|
{
|
||||||
if (GetLocaleInfoW(lcid, localeValue, pBuff,
|
if (GetLocaleInfoW(lcid, localeValue, pBuff, ARRAY_SIZE(buff)-(pBuff-buff)))
|
||||||
sizeof(buff)/sizeof(WCHAR)-(pBuff-buff)))
|
|
||||||
{
|
{
|
||||||
TRACE("added %s\n", debugstr_w(pBuff));
|
TRACE("added %s\n", debugstr_w(pBuff));
|
||||||
while (*pBuff)
|
while (*pBuff)
|
||||||
|
@ -1875,8 +1870,7 @@ static HRESULT VARIANT_FormatDate(LPVARIANT pVarIn, LPOLESTR lpszFormat,
|
||||||
if (localeValue)
|
if (localeValue)
|
||||||
{
|
{
|
||||||
*pBuff = '\0';
|
*pBuff = '\0';
|
||||||
if (GetLocaleInfoW(lcid, localeValue, pBuff,
|
if (GetLocaleInfoW(lcid, localeValue, pBuff, ARRAY_SIZE(buff)-(pBuff-buff)))
|
||||||
sizeof(buff)/sizeof(WCHAR)-(pBuff-buff)))
|
|
||||||
{
|
{
|
||||||
TRACE("added %s\n", debugstr_w(pBuff));
|
TRACE("added %s\n", debugstr_w(pBuff));
|
||||||
while (*pBuff)
|
while (*pBuff)
|
||||||
|
@ -1892,9 +1886,8 @@ static HRESULT VARIANT_FormatDate(LPVARIANT pVarIn, LPOLESTR lpszFormat,
|
||||||
{
|
{
|
||||||
WCHAR fmt_buff[80];
|
WCHAR fmt_buff[80];
|
||||||
|
|
||||||
if (!GetLocaleInfoW(lcid, dwFmt, fmt_buff, sizeof(fmt_buff)/sizeof(WCHAR)) ||
|
if (!GetLocaleInfoW(lcid, dwFmt, fmt_buff, ARRAY_SIZE(fmt_buff)) ||
|
||||||
!get_date_format(lcid, 0, &udate.st, fmt_buff, pBuff,
|
!get_date_format(lcid, 0, &udate.st, fmt_buff, pBuff, ARRAY_SIZE(buff)-(pBuff-buff)))
|
||||||
sizeof(buff)/sizeof(WCHAR)-(pBuff-buff)))
|
|
||||||
{
|
{
|
||||||
hRes = E_INVALIDARG;
|
hRes = E_INVALIDARG;
|
||||||
goto VARIANT_FormatDate_Exit;
|
goto VARIANT_FormatDate_Exit;
|
||||||
|
@ -2293,8 +2286,7 @@ HRESULT WINAPI VarFormatNumber(LPVARIANT pVarIn, INT nDigits, INT nLeading, INT
|
||||||
{
|
{
|
||||||
WCHAR grouping[16];
|
WCHAR grouping[16];
|
||||||
grouping[2] = '\0';
|
grouping[2] = '\0';
|
||||||
GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SDECIMAL, grouping,
|
GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SDECIMAL, grouping, ARRAY_SIZE(grouping));
|
||||||
sizeof(grouping)/sizeof(WCHAR));
|
|
||||||
numfmt.Grouping = grouping[2] == '2' ? 32 : grouping[0] - '0';
|
numfmt.Grouping = grouping[2] == '2' ? 32 : grouping[0] - '0';
|
||||||
}
|
}
|
||||||
else if (nGrouping == -1)
|
else if (nGrouping == -1)
|
||||||
|
@ -2310,14 +2302,11 @@ HRESULT WINAPI VarFormatNumber(LPVARIANT pVarIn, INT nDigits, INT nLeading, INT
|
||||||
numfmt.NegativeOrder = 1; /* 1 = "-xxx" */
|
numfmt.NegativeOrder = 1; /* 1 = "-xxx" */
|
||||||
|
|
||||||
numfmt.lpDecimalSep = decimal;
|
numfmt.lpDecimalSep = decimal;
|
||||||
GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SDECIMAL, decimal,
|
GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SDECIMAL, decimal, ARRAY_SIZE(decimal));
|
||||||
sizeof(decimal)/sizeof(WCHAR));
|
|
||||||
numfmt.lpThousandSep = thousands;
|
numfmt.lpThousandSep = thousands;
|
||||||
GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_STHOUSAND, thousands,
|
GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_STHOUSAND, thousands, ARRAY_SIZE(thousands));
|
||||||
sizeof(thousands)/sizeof(WCHAR));
|
|
||||||
|
|
||||||
if (GetNumberFormatW(LOCALE_USER_DEFAULT, 0, V_BSTR(&vStr), &numfmt,
|
if (GetNumberFormatW(LOCALE_USER_DEFAULT, 0, V_BSTR(&vStr), &numfmt, buff, ARRAY_SIZE(buff)))
|
||||||
buff, sizeof(buff)/sizeof(WCHAR)))
|
|
||||||
{
|
{
|
||||||
*pbstrOut = SysAllocString(buff);
|
*pbstrOut = SysAllocString(buff);
|
||||||
if (!*pbstrOut)
|
if (!*pbstrOut)
|
||||||
|
@ -2473,8 +2462,7 @@ HRESULT WINAPI VarFormatCurrency(LPVARIANT pVarIn, INT nDigits, INT nLeading,
|
||||||
{
|
{
|
||||||
WCHAR grouping[16];
|
WCHAR grouping[16];
|
||||||
grouping[2] = '\0';
|
grouping[2] = '\0';
|
||||||
GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SDECIMAL, grouping,
|
GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SDECIMAL, grouping, ARRAY_SIZE(grouping));
|
||||||
sizeof(grouping)/sizeof(WCHAR));
|
|
||||||
numfmt.Grouping = grouping[2] == '2' ? 32 : grouping[0] - '0';
|
numfmt.Grouping = grouping[2] == '2' ? 32 : grouping[0] - '0';
|
||||||
}
|
}
|
||||||
else if (nGrouping == -1)
|
else if (nGrouping == -1)
|
||||||
|
@ -2492,18 +2480,14 @@ HRESULT WINAPI VarFormatCurrency(LPVARIANT pVarIn, INT nDigits, INT nLeading,
|
||||||
GETLOCALENUMBER(LOCALE_ICURRENCY, PositiveOrder);
|
GETLOCALENUMBER(LOCALE_ICURRENCY, PositiveOrder);
|
||||||
|
|
||||||
numfmt.lpDecimalSep = decimal;
|
numfmt.lpDecimalSep = decimal;
|
||||||
GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SDECIMAL, decimal,
|
GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SDECIMAL, decimal, ARRAY_SIZE(decimal));
|
||||||
sizeof(decimal)/sizeof(WCHAR));
|
|
||||||
numfmt.lpThousandSep = thousands;
|
numfmt.lpThousandSep = thousands;
|
||||||
GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SDECIMAL, thousands,
|
GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SDECIMAL, thousands, ARRAY_SIZE(thousands));
|
||||||
sizeof(thousands)/sizeof(WCHAR));
|
|
||||||
numfmt.lpCurrencySymbol = currency;
|
numfmt.lpCurrencySymbol = currency;
|
||||||
GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SDECIMAL, currency,
|
GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SDECIMAL, currency, ARRAY_SIZE(currency));
|
||||||
sizeof(currency)/sizeof(WCHAR));
|
|
||||||
|
|
||||||
/* use NLS as per VarFormatNumber() */
|
/* use NLS as per VarFormatNumber() */
|
||||||
if (GetCurrencyFormatW(LOCALE_USER_DEFAULT, 0, V_BSTR(&vStr), &numfmt,
|
if (GetCurrencyFormatW(LOCALE_USER_DEFAULT, 0, V_BSTR(&vStr), &numfmt, buff, ARRAY_SIZE(buff)))
|
||||||
buff, sizeof(buff)/sizeof(WCHAR)))
|
|
||||||
{
|
{
|
||||||
*pbstrOut = SysAllocString(buff);
|
*pbstrOut = SysAllocString(buff);
|
||||||
if (!*pbstrOut)
|
if (!*pbstrOut)
|
||||||
|
|
|
@ -648,7 +648,7 @@ HRESULT VARIANT_ClearInd(VARIANTARG *pVarg)
|
||||||
* Success: S_OK. Any previous value in pVarg is freed and its type is set to VT_EMPTY.
|
* Success: S_OK. Any previous value in pVarg is freed and its type is set to VT_EMPTY.
|
||||||
* Failure: DISP_E_BADVARTYPE, if the variant is not a valid variant type.
|
* Failure: DISP_E_BADVARTYPE, if the variant is not a valid variant type.
|
||||||
*/
|
*/
|
||||||
HRESULT WINAPI VariantClear(VARIANTARG* pVarg)
|
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG* pVarg)
|
||||||
{
|
{
|
||||||
HRESULT hres;
|
HRESULT hres;
|
||||||
|
|
||||||
|
@ -962,7 +962,7 @@ VariantCopyInd_Return:
|
||||||
* The LCID used for the conversion is LOCALE_USER_DEFAULT.
|
* The LCID used for the conversion is LOCALE_USER_DEFAULT.
|
||||||
* See VariantChangeTypeEx.
|
* See VariantChangeTypeEx.
|
||||||
*/
|
*/
|
||||||
HRESULT WINAPI VariantChangeType(VARIANTARG* pvargDest, VARIANTARG* pvargSrc,
|
HRESULT WINAPI DECLSPEC_HOTPATCH VariantChangeType(VARIANTARG* pvargDest, VARIANTARG* pvargSrc,
|
||||||
USHORT wFlags, VARTYPE vt)
|
USHORT wFlags, VARTYPE vt)
|
||||||
{
|
{
|
||||||
return VariantChangeTypeEx( pvargDest, pvargSrc, LOCALE_USER_DEFAULT, wFlags, vt );
|
return VariantChangeTypeEx( pvargDest, pvargSrc, LOCALE_USER_DEFAULT, wFlags, vt );
|
||||||
|
@ -1549,7 +1549,7 @@ static void VARIANT_GetLocalisedNumberChars(VARIANT_NUMBER_CHARS *lpChars, LCID
|
||||||
|
|
||||||
/* Local currency symbols are often 2 characters */
|
/* Local currency symbols are often 2 characters */
|
||||||
lpChars->cCurrencyLocal2 = '\0';
|
lpChars->cCurrencyLocal2 = '\0';
|
||||||
switch(GetLocaleInfoW(lcid, lctype|LOCALE_SCURRENCY, buff, sizeof(buff)/sizeof(WCHAR)))
|
switch(GetLocaleInfoW(lcid, lctype|LOCALE_SCURRENCY, buff, ARRAY_SIZE(buff)))
|
||||||
{
|
{
|
||||||
case 3: lpChars->cCurrencyLocal2 = buff[1]; /* Fall through */
|
case 3: lpChars->cCurrencyLocal2 = buff[1]; /* Fall through */
|
||||||
case 2: lpChars->cCurrencyLocal = buff[0];
|
case 2: lpChars->cCurrencyLocal = buff[0];
|
||||||
|
@ -1610,7 +1610,7 @@ HRESULT WINAPI VarParseNumFromStr(OLECHAR *lpszStr, LCID lcid, ULONG dwFlags,
|
||||||
VARIANT_NUMBER_CHARS chars;
|
VARIANT_NUMBER_CHARS chars;
|
||||||
BYTE rgbTmp[1024];
|
BYTE rgbTmp[1024];
|
||||||
DWORD dwState = B_EXPONENT_START|B_INEXACT_ZEROS;
|
DWORD dwState = B_EXPONENT_START|B_INEXACT_ZEROS;
|
||||||
int iMaxDigits = sizeof(rgbTmp) / sizeof(BYTE);
|
int iMaxDigits = ARRAY_SIZE(rgbTmp);
|
||||||
int cchUsed = 0;
|
int cchUsed = 0;
|
||||||
|
|
||||||
TRACE("(%s,%d,0x%08x,%p,%p)\n", debugstr_w(lpszStr), lcid, dwFlags, pNumprs, rgbDig);
|
TRACE("(%s,%d,0x%08x,%p,%p)\n", debugstr_w(lpszStr), lcid, dwFlags, pNumprs, rgbDig);
|
||||||
|
@ -5134,7 +5134,21 @@ HRESULT WINAPI VarRound(LPVARIANT pVarIn, int deci, LPVARIANT pVarOut)
|
||||||
}
|
}
|
||||||
V_VT(pVarOut) = V_VT(pVarIn);
|
V_VT(pVarOut) = V_VT(pVarIn);
|
||||||
break;
|
break;
|
||||||
|
case VT_DECIMAL:
|
||||||
|
{
|
||||||
|
double dbl;
|
||||||
|
|
||||||
|
VarR8FromDec(&V_DECIMAL(pVarIn), &dbl);
|
||||||
|
|
||||||
|
if (dbl>0.0f)
|
||||||
|
dbl = floor(dbl*pow(10,deci)+0.5);
|
||||||
|
else
|
||||||
|
dbl = ceil(dbl*pow(10,deci)-0.5);
|
||||||
|
|
||||||
|
V_VT(pVarOut)=VT_DECIMAL;
|
||||||
|
VarDecFromR8(dbl, &V_DECIMAL(pVarOut));
|
||||||
|
break;
|
||||||
|
}
|
||||||
/* cases we don't know yet */
|
/* cases we don't know yet */
|
||||||
default:
|
default:
|
||||||
FIXME("unimplemented part, V_VT(pVarIn) == 0x%X, deci == %d\n",
|
FIXME("unimplemented part, V_VT(pVarIn) == 0x%X, deci == %d\n",
|
||||||
|
|
|
@ -95,7 +95,7 @@ static HRESULT VARIANT_NumberFromBstr(OLECHAR* pStrIn, LCID lcid, ULONG ulFlags,
|
||||||
BYTE rgb[1024];
|
BYTE rgb[1024];
|
||||||
|
|
||||||
/* Use VarParseNumFromStr/VarNumFromParseNum as MSDN indicates */
|
/* Use VarParseNumFromStr/VarNumFromParseNum as MSDN indicates */
|
||||||
np.cDig = sizeof(rgb) / sizeof(BYTE);
|
np.cDig = ARRAY_SIZE(rgb);
|
||||||
np.dwInFlags = NUMPRS_STD;
|
np.dwInFlags = NUMPRS_STD;
|
||||||
|
|
||||||
hRet = VarParseNumFromStr(pStrIn, lcid, ulFlags, &np, rgb);
|
hRet = VarParseNumFromStr(pStrIn, lcid, ulFlags, &np, rgb);
|
||||||
|
@ -3781,7 +3781,7 @@ HRESULT WINAPI VarCyFromUI8(ULONG64 ullIn, CY* pCyOut)
|
||||||
* Success: S_OK.
|
* Success: S_OK.
|
||||||
* Failure: DISP_E_OVERFLOW, if the value will not fit in the destination
|
* Failure: DISP_E_OVERFLOW, if the value will not fit in the destination
|
||||||
*/
|
*/
|
||||||
HRESULT WINAPI VarCyAdd(const CY cyLeft, const CY cyRight, CY* pCyOut)
|
HRESULT WINAPI VarCyAdd(CY cyLeft, CY cyRight, CY* pCyOut)
|
||||||
{
|
{
|
||||||
double l,r;
|
double l,r;
|
||||||
_VarR8FromCy(cyLeft, &l);
|
_VarR8FromCy(cyLeft, &l);
|
||||||
|
@ -3804,7 +3804,7 @@ HRESULT WINAPI VarCyAdd(const CY cyLeft, const CY cyRight, CY* pCyOut)
|
||||||
* Success: S_OK.
|
* Success: S_OK.
|
||||||
* Failure: DISP_E_OVERFLOW, if the value will not fit in the destination
|
* Failure: DISP_E_OVERFLOW, if the value will not fit in the destination
|
||||||
*/
|
*/
|
||||||
HRESULT WINAPI VarCyMul(const CY cyLeft, CY cyRight, CY* pCyOut)
|
HRESULT WINAPI VarCyMul(CY cyLeft, CY cyRight, CY* pCyOut)
|
||||||
{
|
{
|
||||||
double l,r;
|
double l,r;
|
||||||
_VarR8FromCy(cyLeft, &l);
|
_VarR8FromCy(cyLeft, &l);
|
||||||
|
@ -3827,7 +3827,7 @@ HRESULT WINAPI VarCyMul(const CY cyLeft, CY cyRight, CY* pCyOut)
|
||||||
* Success: S_OK.
|
* Success: S_OK.
|
||||||
* Failure: DISP_E_OVERFLOW, if the value will not fit in the destination
|
* Failure: DISP_E_OVERFLOW, if the value will not fit in the destination
|
||||||
*/
|
*/
|
||||||
HRESULT WINAPI VarCyMulI4(const CY cyLeft, LONG lRight, CY* pCyOut)
|
HRESULT WINAPI VarCyMulI4(CY cyLeft, LONG lRight, CY* pCyOut)
|
||||||
{
|
{
|
||||||
double d;
|
double d;
|
||||||
|
|
||||||
|
@ -3850,7 +3850,7 @@ HRESULT WINAPI VarCyMulI4(const CY cyLeft, LONG lRight, CY* pCyOut)
|
||||||
* Success: S_OK.
|
* Success: S_OK.
|
||||||
* Failure: DISP_E_OVERFLOW, if the value will not fit in the destination
|
* Failure: DISP_E_OVERFLOW, if the value will not fit in the destination
|
||||||
*/
|
*/
|
||||||
HRESULT WINAPI VarCySub(const CY cyLeft, const CY cyRight, CY* pCyOut)
|
HRESULT WINAPI VarCySub(CY cyLeft, CY cyRight, CY* pCyOut)
|
||||||
{
|
{
|
||||||
double l,r;
|
double l,r;
|
||||||
_VarR8FromCy(cyLeft, &l);
|
_VarR8FromCy(cyLeft, &l);
|
||||||
|
@ -3872,7 +3872,7 @@ HRESULT WINAPI VarCySub(const CY cyLeft, const CY cyRight, CY* pCyOut)
|
||||||
* Success: S_OK. pCyOut contains the absolute value.
|
* Success: S_OK. pCyOut contains the absolute value.
|
||||||
* Failure: DISP_E_OVERFLOW, if the value will not fit in the destination
|
* Failure: DISP_E_OVERFLOW, if the value will not fit in the destination
|
||||||
*/
|
*/
|
||||||
HRESULT WINAPI VarCyAbs(const CY cyIn, CY* pCyOut)
|
HRESULT WINAPI VarCyAbs(CY cyIn, CY* pCyOut)
|
||||||
{
|
{
|
||||||
if (cyIn.s.Hi == (int)0x80000000 && !cyIn.s.Lo)
|
if (cyIn.s.Hi == (int)0x80000000 && !cyIn.s.Lo)
|
||||||
return DISP_E_OVERFLOW;
|
return DISP_E_OVERFLOW;
|
||||||
|
@ -3898,7 +3898,7 @@ HRESULT WINAPI VarCyAbs(const CY cyIn, CY* pCyOut)
|
||||||
* - The difference between this function and VarCyInt() is that VarCyInt() rounds
|
* - The difference between this function and VarCyInt() is that VarCyInt() rounds
|
||||||
* negative numbers away from 0, while this function rounds them towards zero.
|
* negative numbers away from 0, while this function rounds them towards zero.
|
||||||
*/
|
*/
|
||||||
HRESULT WINAPI VarCyFix(const CY cyIn, CY* pCyOut)
|
HRESULT WINAPI VarCyFix(CY cyIn, CY* pCyOut)
|
||||||
{
|
{
|
||||||
pCyOut->int64 = cyIn.int64 / CY_MULTIPLIER;
|
pCyOut->int64 = cyIn.int64 / CY_MULTIPLIER;
|
||||||
pCyOut->int64 *= CY_MULTIPLIER;
|
pCyOut->int64 *= CY_MULTIPLIER;
|
||||||
|
@ -3922,7 +3922,7 @@ HRESULT WINAPI VarCyFix(const CY cyIn, CY* pCyOut)
|
||||||
* - The difference between this function and VarCyFix() is that VarCyFix() rounds
|
* - The difference between this function and VarCyFix() is that VarCyFix() rounds
|
||||||
* negative numbers towards 0, while this function rounds them away from zero.
|
* negative numbers towards 0, while this function rounds them away from zero.
|
||||||
*/
|
*/
|
||||||
HRESULT WINAPI VarCyInt(const CY cyIn, CY* pCyOut)
|
HRESULT WINAPI VarCyInt(CY cyIn, CY* pCyOut)
|
||||||
{
|
{
|
||||||
pCyOut->int64 = cyIn.int64 / CY_MULTIPLIER;
|
pCyOut->int64 = cyIn.int64 / CY_MULTIPLIER;
|
||||||
pCyOut->int64 *= CY_MULTIPLIER;
|
pCyOut->int64 *= CY_MULTIPLIER;
|
||||||
|
@ -3947,7 +3947,7 @@ HRESULT WINAPI VarCyInt(const CY cyIn, CY* pCyOut)
|
||||||
* Success: S_OK.
|
* Success: S_OK.
|
||||||
* Failure: DISP_E_OVERFLOW, if the value will not fit in the destination
|
* Failure: DISP_E_OVERFLOW, if the value will not fit in the destination
|
||||||
*/
|
*/
|
||||||
HRESULT WINAPI VarCyNeg(const CY cyIn, CY* pCyOut)
|
HRESULT WINAPI VarCyNeg(CY cyIn, CY* pCyOut)
|
||||||
{
|
{
|
||||||
if (cyIn.s.Hi == (int)0x80000000 && !cyIn.s.Lo)
|
if (cyIn.s.Hi == (int)0x80000000 && !cyIn.s.Lo)
|
||||||
return DISP_E_OVERFLOW;
|
return DISP_E_OVERFLOW;
|
||||||
|
@ -3970,7 +3970,7 @@ HRESULT WINAPI VarCyNeg(const CY cyIn, CY* pCyOut)
|
||||||
* Success: S_OK.
|
* Success: S_OK.
|
||||||
* Failure: E_INVALIDARG, if cDecimals is less than 0.
|
* Failure: E_INVALIDARG, if cDecimals is less than 0.
|
||||||
*/
|
*/
|
||||||
HRESULT WINAPI VarCyRound(const CY cyIn, int cDecimals, CY* pCyOut)
|
HRESULT WINAPI VarCyRound(CY cyIn, int cDecimals, CY* pCyOut)
|
||||||
{
|
{
|
||||||
if (cDecimals < 0)
|
if (cDecimals < 0)
|
||||||
return E_INVALIDARG;
|
return E_INVALIDARG;
|
||||||
|
@ -4008,7 +4008,7 @@ HRESULT WINAPI VarCyRound(const CY cyIn, int cDecimals, CY* pCyOut)
|
||||||
* compare is less, equal or greater than source respectively.
|
* compare is less, equal or greater than source respectively.
|
||||||
* Failure: DISP_E_OVERFLOW, if overflow occurs during the comparison
|
* Failure: DISP_E_OVERFLOW, if overflow occurs during the comparison
|
||||||
*/
|
*/
|
||||||
HRESULT WINAPI VarCyCmp(const CY cyLeft, const CY cyRight)
|
HRESULT WINAPI VarCyCmp(CY cyLeft, CY cyRight)
|
||||||
{
|
{
|
||||||
HRESULT hRet;
|
HRESULT hRet;
|
||||||
CY result;
|
CY result;
|
||||||
|
@ -4042,7 +4042,7 @@ HRESULT WINAPI VarCyCmp(const CY cyLeft, const CY cyRight)
|
||||||
* less than, equal to or greater than cyLeft respectively.
|
* less than, equal to or greater than cyLeft respectively.
|
||||||
* Failure: DISP_E_OVERFLOW, if overflow occurs during the comparison
|
* Failure: DISP_E_OVERFLOW, if overflow occurs during the comparison
|
||||||
*/
|
*/
|
||||||
HRESULT WINAPI VarCyCmpR8(const CY cyLeft, double dblRight)
|
HRESULT WINAPI VarCyCmpR8(CY cyLeft, double dblRight)
|
||||||
{
|
{
|
||||||
HRESULT hRet;
|
HRESULT hRet;
|
||||||
CY cyRight;
|
CY cyRight;
|
||||||
|
@ -4069,7 +4069,7 @@ HRESULT WINAPI VarCyCmpR8(const CY cyLeft, double dblRight)
|
||||||
* Success: S_OK.
|
* Success: S_OK.
|
||||||
* Failure: DISP_E_OVERFLOW, if the value will not fit in the destination
|
* Failure: DISP_E_OVERFLOW, if the value will not fit in the destination
|
||||||
*/
|
*/
|
||||||
HRESULT WINAPI VarCyMulI8(const CY cyLeft, LONG64 llRight, CY* pCyOut)
|
HRESULT WINAPI VarCyMulI8(CY cyLeft, LONG64 llRight, CY* pCyOut)
|
||||||
{
|
{
|
||||||
double d;
|
double d;
|
||||||
|
|
||||||
|
@ -4496,15 +4496,15 @@ static HRESULT VARIANT_DecScale(const DECIMAL** ppDecLeft,
|
||||||
|
|
||||||
di.scale -= i;
|
di.scale -= i;
|
||||||
remainder = 0;
|
remainder = 0;
|
||||||
while (i-- > 0 && !VARIANT_int_iszero(di.bitsnum, sizeof(di.bitsnum)/sizeof(DWORD)))
|
while (i-- > 0 && !VARIANT_int_iszero(di.bitsnum, ARRAY_SIZE(di.bitsnum)))
|
||||||
{
|
{
|
||||||
remainder = VARIANT_int_divbychar(di.bitsnum, sizeof(di.bitsnum)/sizeof(DWORD), 10);
|
remainder = VARIANT_int_divbychar(di.bitsnum, ARRAY_SIZE(di.bitsnum), 10);
|
||||||
if (remainder > 0) WARN("losing significant digits (remainder %u)...\n", remainder);
|
if (remainder > 0) WARN("losing significant digits (remainder %u)...\n", remainder);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* round up the result - native oleaut32 does this */
|
/* round up the result - native oleaut32 does this */
|
||||||
if (remainder >= 5) {
|
if (remainder >= 5) {
|
||||||
for (remainder = 1, i = 0; i < sizeof(di.bitsnum)/sizeof(DWORD) && remainder; i++) {
|
for (remainder = 1, i = 0; i < ARRAY_SIZE(di.bitsnum) && remainder; i++) {
|
||||||
ULONGLONG digit = di.bitsnum[i] + 1;
|
ULONGLONG digit = di.bitsnum[i] + 1;
|
||||||
remainder = (digit > 0xFFFFFFFF) ? 1 : 0;
|
remainder = (digit > 0xFFFFFFFF) ? 1 : 0;
|
||||||
di.bitsnum[i] = digit & 0xFFFFFFFF;
|
di.bitsnum[i] = digit & 0xFFFFFFFF;
|
||||||
|
@ -4743,7 +4743,7 @@ static int VARIANT_DI_mul(const VARIANT_DI * a, const VARIANT_DI * b, VARIANT_DI
|
||||||
memset(running, 0, sizeof(running));
|
memset(running, 0, sizeof(running));
|
||||||
|
|
||||||
/* count number of leading zero-bytes in operand A */
|
/* count number of leading zero-bytes in operand A */
|
||||||
for (mulstart = sizeof(a->bitsnum)/sizeof(DWORD) - 1; mulstart >= 0 && !a->bitsnum[mulstart]; mulstart--);
|
for (mulstart = ARRAY_SIZE(a->bitsnum) - 1; mulstart >= 0 && !a->bitsnum[mulstart]; mulstart--);
|
||||||
if (mulstart < 0) {
|
if (mulstart < 0) {
|
||||||
/* result is 0, because operand A is 0 */
|
/* result is 0, because operand A is 0 */
|
||||||
result->scale = 0;
|
result->scale = 0;
|
||||||
|
@ -4757,7 +4757,7 @@ static int VARIANT_DI_mul(const VARIANT_DI * a, const VARIANT_DI * b, VARIANT_DI
|
||||||
ULONG iOverflowMul;
|
ULONG iOverflowMul;
|
||||||
int iB;
|
int iB;
|
||||||
|
|
||||||
for (iOverflowMul = 0, iB = 0; iB < sizeof(b->bitsnum)/sizeof(DWORD); iB++) {
|
for (iOverflowMul = 0, iB = 0; iB < ARRAY_SIZE(b->bitsnum); iB++) {
|
||||||
ULONG iRV;
|
ULONG iRV;
|
||||||
int iR;
|
int iR;
|
||||||
|
|
||||||
|
@ -4789,11 +4789,10 @@ static int VARIANT_DI_mul(const VARIANT_DI * a, const VARIANT_DI * b, VARIANT_DI
|
||||||
This operation *will* lose significant digits of the result because
|
This operation *will* lose significant digits of the result because
|
||||||
all the factors of 10 were consumed by the previous operation.
|
all the factors of 10 were consumed by the previous operation.
|
||||||
*/
|
*/
|
||||||
while (result->scale > 0 && !VARIANT_int_iszero(
|
while (result->scale > 0 && !VARIANT_int_iszero(running + ARRAY_SIZE(result->bitsnum),
|
||||||
running + sizeof(result->bitsnum) / sizeof(DWORD),
|
ARRAY_SIZE(running) - ARRAY_SIZE(result->bitsnum))) {
|
||||||
(sizeof(running) - sizeof(result->bitsnum)) / sizeof(DWORD))) {
|
|
||||||
|
|
||||||
remainder = VARIANT_int_divbychar(running, sizeof(running) / sizeof(DWORD), 10);
|
remainder = VARIANT_int_divbychar(running, ARRAY_SIZE(running), 10);
|
||||||
if (remainder > 0) WARN("losing significant digits (remainder %u)...\n", remainder);
|
if (remainder > 0) WARN("losing significant digits (remainder %u)...\n", remainder);
|
||||||
result->scale--;
|
result->scale--;
|
||||||
}
|
}
|
||||||
|
@ -4801,7 +4800,7 @@ static int VARIANT_DI_mul(const VARIANT_DI * a, const VARIANT_DI * b, VARIANT_DI
|
||||||
/* round up the result - native oleaut32 does this */
|
/* round up the result - native oleaut32 does this */
|
||||||
if (remainder >= 5) {
|
if (remainder >= 5) {
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
for (remainder = 1, i = 0; i < sizeof(running)/sizeof(DWORD) && remainder; i++) {
|
for (remainder = 1, i = 0; i < ARRAY_SIZE(running) && remainder; i++) {
|
||||||
ULONGLONG digit = running[i] + 1;
|
ULONGLONG digit = running[i] + 1;
|
||||||
remainder = (digit > 0xFFFFFFFF) ? 1 : 0;
|
remainder = (digit > 0xFFFFFFFF) ? 1 : 0;
|
||||||
running[i] = digit & 0xFFFFFFFF;
|
running[i] = digit & 0xFFFFFFFF;
|
||||||
|
@ -4811,9 +4810,8 @@ static int VARIANT_DI_mul(const VARIANT_DI * a, const VARIANT_DI * b, VARIANT_DI
|
||||||
/* Signal overflow if scale == 0 and 256-bit result still overflows,
|
/* Signal overflow if scale == 0 and 256-bit result still overflows,
|
||||||
and copy result bits into result structure
|
and copy result bits into result structure
|
||||||
*/
|
*/
|
||||||
r_overflow = !VARIANT_int_iszero(
|
r_overflow = !VARIANT_int_iszero(running + ARRAY_SIZE(result->bitsnum),
|
||||||
running + sizeof(result->bitsnum)/sizeof(DWORD),
|
ARRAY_SIZE(running) - ARRAY_SIZE(result->bitsnum));
|
||||||
(sizeof(running) - sizeof(result->bitsnum))/sizeof(DWORD));
|
|
||||||
memcpy(result->bitsnum, running, sizeof(result->bitsnum));
|
memcpy(result->bitsnum, running, sizeof(result->bitsnum));
|
||||||
}
|
}
|
||||||
return r_overflow;
|
return r_overflow;
|
||||||
|
@ -4831,7 +4829,7 @@ static BOOL VARIANT_DI_tostringW(const VARIANT_DI * a, WCHAR * s, unsigned int n
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
|
||||||
/* place negative sign */
|
/* place negative sign */
|
||||||
if (!VARIANT_int_iszero(a->bitsnum, sizeof(a->bitsnum) / sizeof(DWORD)) && a->sign) {
|
if (!VARIANT_int_iszero(a->bitsnum, ARRAY_SIZE(a->bitsnum)) && a->sign) {
|
||||||
if (n > 0) {
|
if (n > 0) {
|
||||||
*s++ = '-';
|
*s++ = '-';
|
||||||
n--;
|
n--;
|
||||||
|
@ -4849,8 +4847,8 @@ static BOOL VARIANT_DI_tostringW(const VARIANT_DI * a, WCHAR * s, unsigned int n
|
||||||
|
|
||||||
i = 0;
|
i = 0;
|
||||||
memcpy(quotient, a->bitsnum, sizeof(a->bitsnum));
|
memcpy(quotient, a->bitsnum, sizeof(a->bitsnum));
|
||||||
while (!overflow && !VARIANT_int_iszero(quotient, sizeof(quotient) / sizeof(DWORD))) {
|
while (!overflow && !VARIANT_int_iszero(quotient, ARRAY_SIZE(quotient))) {
|
||||||
remainder = VARIANT_int_divbychar(quotient, sizeof(quotient) / sizeof(DWORD), 10);
|
remainder = VARIANT_int_divbychar(quotient, ARRAY_SIZE(quotient), 10);
|
||||||
if (i + 2 > n) {
|
if (i + 2 > n) {
|
||||||
overflow = TRUE;
|
overflow = TRUE;
|
||||||
} else {
|
} else {
|
||||||
|
@ -4859,7 +4857,7 @@ static BOOL VARIANT_DI_tostringW(const VARIANT_DI * a, WCHAR * s, unsigned int n
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!overflow && !VARIANT_int_iszero(a->bitsnum, sizeof(a->bitsnum) / sizeof(DWORD))) {
|
if (!overflow && !VARIANT_int_iszero(a->bitsnum, ARRAY_SIZE(a->bitsnum))) {
|
||||||
|
|
||||||
/* reverse order of digits */
|
/* reverse order of digits */
|
||||||
WCHAR * x = s; WCHAR * y = s + i - 1;
|
WCHAR * x = s; WCHAR * y = s + i - 1;
|
||||||
|
@ -5175,10 +5173,10 @@ static HRESULT VARIANT_DI_div(const VARIANT_DI * dividend, const VARIANT_DI * di
|
||||||
{
|
{
|
||||||
HRESULT r_overflow = S_OK;
|
HRESULT r_overflow = S_OK;
|
||||||
|
|
||||||
if (VARIANT_int_iszero(divisor->bitsnum, sizeof(divisor->bitsnum)/sizeof(DWORD))) {
|
if (VARIANT_int_iszero(divisor->bitsnum, ARRAY_SIZE(divisor->bitsnum))) {
|
||||||
/* division by 0 */
|
/* division by 0 */
|
||||||
r_overflow = DISP_E_DIVBYZERO;
|
r_overflow = DISP_E_DIVBYZERO;
|
||||||
} else if (VARIANT_int_iszero(dividend->bitsnum, sizeof(dividend->bitsnum)/sizeof(DWORD))) {
|
} else if (VARIANT_int_iszero(dividend->bitsnum, ARRAY_SIZE(dividend->bitsnum))) {
|
||||||
VARIANT_DI_clear(quotient);
|
VARIANT_DI_clear(quotient);
|
||||||
} else {
|
} else {
|
||||||
int quotientscale, remainderscale, tempquotientscale;
|
int quotientscale, remainderscale, tempquotientscale;
|
||||||
|
@ -5208,17 +5206,14 @@ static HRESULT VARIANT_DI_div(const VARIANT_DI * dividend, const VARIANT_DI * di
|
||||||
memset(remainderplusquotient, 0, sizeof(remainderplusquotient));
|
memset(remainderplusquotient, 0, sizeof(remainderplusquotient));
|
||||||
memcpy(remainderplusquotient, dividend->bitsnum, sizeof(dividend->bitsnum));
|
memcpy(remainderplusquotient, dividend->bitsnum, sizeof(dividend->bitsnum));
|
||||||
do {
|
do {
|
||||||
VARIANT_int_div(
|
VARIANT_int_div(remainderplusquotient, 4, divisor->bitsnum, ARRAY_SIZE(divisor->bitsnum));
|
||||||
remainderplusquotient, 4,
|
underflow = VARIANT_int_addlossy( quotient->bitsnum, "ientscale,
|
||||||
divisor->bitsnum, sizeof(divisor->bitsnum)/sizeof(DWORD));
|
ARRAY_SIZE(quotient->bitsnum), remainderplusquotient, &tempquotientscale, 4);
|
||||||
underflow = VARIANT_int_addlossy(
|
|
||||||
quotient->bitsnum, "ientscale, sizeof(quotient->bitsnum) / sizeof(DWORD),
|
|
||||||
remainderplusquotient, &tempquotientscale, 4);
|
|
||||||
if (round_remainder) {
|
if (round_remainder) {
|
||||||
if(remainderplusquotient[4] >= 5){
|
if(remainderplusquotient[4] >= 5){
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
unsigned char remainder = 1;
|
unsigned char remainder = 1;
|
||||||
for (i = 0; i < sizeof(quotient->bitsnum) / sizeof(DWORD) && remainder; i++) {
|
for (i = 0; i < ARRAY_SIZE(quotient->bitsnum) && remainder; i++) {
|
||||||
ULONGLONG digit = quotient->bitsnum[i] + 1;
|
ULONGLONG digit = quotient->bitsnum[i] + 1;
|
||||||
remainder = (digit > 0xFFFFFFFF) ? 1 : 0;
|
remainder = (digit > 0xFFFFFFFF) ? 1 : 0;
|
||||||
quotient->bitsnum[i] = digit & 0xFFFFFFFF;
|
quotient->bitsnum[i] = digit & 0xFFFFFFFF;
|
||||||
|
@ -5239,9 +5234,9 @@ static HRESULT VARIANT_DI_div(const VARIANT_DI * dividend, const VARIANT_DI * di
|
||||||
while (r_overflow == S_OK && quotientscale < 0) {
|
while (r_overflow == S_OK && quotientscale < 0) {
|
||||||
memset(remainderplusquotient, 0, sizeof(remainderplusquotient));
|
memset(remainderplusquotient, 0, sizeof(remainderplusquotient));
|
||||||
memcpy(remainderplusquotient, quotient->bitsnum, sizeof(quotient->bitsnum));
|
memcpy(remainderplusquotient, quotient->bitsnum, sizeof(quotient->bitsnum));
|
||||||
VARIANT_int_mulbychar(remainderplusquotient, sizeof(remainderplusquotient)/sizeof(DWORD), 10);
|
VARIANT_int_mulbychar(remainderplusquotient, ARRAY_SIZE(remainderplusquotient), 10);
|
||||||
if (VARIANT_int_iszero(remainderplusquotient + sizeof(quotient->bitsnum)/sizeof(DWORD),
|
if (VARIANT_int_iszero(remainderplusquotient + ARRAY_SIZE(quotient->bitsnum),
|
||||||
(sizeof(remainderplusquotient) - sizeof(quotient->bitsnum))/sizeof(DWORD))) {
|
ARRAY_SIZE(remainderplusquotient) - ARRAY_SIZE(quotient->bitsnum))) {
|
||||||
quotientscale++;
|
quotientscale++;
|
||||||
memcpy(quotient->bitsnum, remainderplusquotient, sizeof(quotient->bitsnum));
|
memcpy(quotient->bitsnum, remainderplusquotient, sizeof(quotient->bitsnum));
|
||||||
} else r_overflow = DISP_E_OVERFLOW;
|
} else r_overflow = DISP_E_OVERFLOW;
|
||||||
|
@ -5562,9 +5557,9 @@ static HRESULT VARIANT_do_division(const DECIMAL *pDecLeft, const DECIMAL *pDecR
|
||||||
WARN("result scale is %u, scaling (with loss of significant digits)...\n",
|
WARN("result scale is %u, scaling (with loss of significant digits)...\n",
|
||||||
di_result.scale);
|
di_result.scale);
|
||||||
while (di_result.scale > DEC_MAX_SCALE &&
|
while (di_result.scale > DEC_MAX_SCALE &&
|
||||||
!VARIANT_int_iszero(di_result.bitsnum, sizeof(di_result.bitsnum) / sizeof(DWORD)))
|
!VARIANT_int_iszero(di_result.bitsnum, ARRAY_SIZE(di_result.bitsnum)))
|
||||||
{
|
{
|
||||||
remainder = VARIANT_int_divbychar(di_result.bitsnum, sizeof(di_result.bitsnum) / sizeof(DWORD), 10);
|
remainder = VARIANT_int_divbychar(di_result.bitsnum, ARRAY_SIZE(di_result.bitsnum), 10);
|
||||||
di_result.scale--;
|
di_result.scale--;
|
||||||
}
|
}
|
||||||
if (di_result.scale > DEC_MAX_SCALE)
|
if (di_result.scale > DEC_MAX_SCALE)
|
||||||
|
@ -5576,7 +5571,7 @@ static HRESULT VARIANT_do_division(const DECIMAL *pDecLeft, const DECIMAL *pDecR
|
||||||
else if (remainder >= 5) /* round up result - native oleaut32 does this */
|
else if (remainder >= 5) /* round up result - native oleaut32 does this */
|
||||||
{
|
{
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
for (remainder = 1, i = 0; i < sizeof(di_result.bitsnum) / sizeof(DWORD) && remainder; i++) {
|
for (remainder = 1, i = 0; i < ARRAY_SIZE(di_result.bitsnum) && remainder; i++) {
|
||||||
ULONGLONG digit = di_result.bitsnum[i] + 1;
|
ULONGLONG digit = di_result.bitsnum[i] + 1;
|
||||||
remainder = (digit > 0xFFFFFFFF) ? 1 : 0;
|
remainder = (digit > 0xFFFFFFFF) ? 1 : 0;
|
||||||
di_result.bitsnum[i] = digit & 0xFFFFFFFF;
|
di_result.bitsnum[i] = digit & 0xFFFFFFFF;
|
||||||
|
@ -5648,9 +5643,9 @@ HRESULT WINAPI VarDecMul(const DECIMAL* pDecLeft, const DECIMAL* pDecRight, DECI
|
||||||
WARN("result scale is %u, scaling (with loss of significant digits)...\n",
|
WARN("result scale is %u, scaling (with loss of significant digits)...\n",
|
||||||
di_result.scale);
|
di_result.scale);
|
||||||
while (di_result.scale > DEC_MAX_SCALE &&
|
while (di_result.scale > DEC_MAX_SCALE &&
|
||||||
!VARIANT_int_iszero(di_result.bitsnum, sizeof(di_result.bitsnum)/sizeof(DWORD)))
|
!VARIANT_int_iszero(di_result.bitsnum, ARRAY_SIZE(di_result.bitsnum)))
|
||||||
{
|
{
|
||||||
VARIANT_int_divbychar(di_result.bitsnum, sizeof(di_result.bitsnum)/sizeof(DWORD), 10);
|
VARIANT_int_divbychar(di_result.bitsnum, ARRAY_SIZE(di_result.bitsnum), 10);
|
||||||
di_result.scale--;
|
di_result.scale--;
|
||||||
}
|
}
|
||||||
if (di_result.scale > DEC_MAX_SCALE)
|
if (di_result.scale > DEC_MAX_SCALE)
|
||||||
|
@ -6357,9 +6352,8 @@ static BSTR VARIANT_MakeBstr(LCID lcid, DWORD dwFlags, WCHAR *szOut)
|
||||||
{
|
{
|
||||||
/* Format the number for the locale */
|
/* Format the number for the locale */
|
||||||
szConverted[0] = '\0';
|
szConverted[0] = '\0';
|
||||||
GetNumberFormatW(lcid,
|
GetNumberFormatW(lcid, dwFlags & LOCALE_NOUSEROVERRIDE,
|
||||||
dwFlags & LOCALE_NOUSEROVERRIDE,
|
szOut, NULL, szConverted, ARRAY_SIZE(szConverted));
|
||||||
szOut, NULL, szConverted, sizeof(szConverted)/sizeof(WCHAR));
|
|
||||||
szOut = szConverted;
|
szOut = szConverted;
|
||||||
}
|
}
|
||||||
return SysAllocStringByteLen((LPCSTR)szOut, strlenW(szOut) * sizeof(WCHAR));
|
return SysAllocStringByteLen((LPCSTR)szOut, strlenW(szOut) * sizeof(WCHAR));
|
||||||
|
@ -6368,7 +6362,7 @@ static BSTR VARIANT_MakeBstr(LCID lcid, DWORD dwFlags, WCHAR *szOut)
|
||||||
/* Create a (possibly localised) BSTR from a UI8 and sign */
|
/* Create a (possibly localised) BSTR from a UI8 and sign */
|
||||||
static HRESULT VARIANT_BstrFromUInt(ULONG64 ulVal, LCID lcid, DWORD dwFlags, BSTR *pbstrOut)
|
static HRESULT VARIANT_BstrFromUInt(ULONG64 ulVal, LCID lcid, DWORD dwFlags, BSTR *pbstrOut)
|
||||||
{
|
{
|
||||||
WCHAR szBuff[64], *szOut = szBuff + sizeof(szBuff)/sizeof(WCHAR) - 1;
|
WCHAR szBuff[64], *szOut = szBuff + ARRAY_SIZE(szBuff) - 1;
|
||||||
|
|
||||||
if (!pbstrOut)
|
if (!pbstrOut)
|
||||||
return E_INVALIDARG;
|
return E_INVALIDARG;
|
||||||
|
@ -6453,7 +6447,7 @@ HRESULT WINAPI VarBstrFromI4(LONG lIn, LCID lcid, ULONG dwFlags, BSTR* pbstrOut)
|
||||||
|
|
||||||
if (lIn < 0)
|
if (lIn < 0)
|
||||||
{
|
{
|
||||||
ul64 = (ULONG)-lIn;
|
ul64 = -(LONG64)lIn;
|
||||||
dwFlags |= VAR_NEGATIVE;
|
dwFlags |= VAR_NEGATIVE;
|
||||||
}
|
}
|
||||||
return VARIANT_BstrFromUInt(ul64, lcid, dwFlags, pbstrOut);
|
return VARIANT_BstrFromUInt(ul64, lcid, dwFlags, pbstrOut);
|
||||||
|
@ -6472,7 +6466,7 @@ static BSTR VARIANT_BstrReplaceDecimal(const WCHAR * buff, LCID lcid, ULONG dwFl
|
||||||
appropriate NUMBERFMTW structure to do the job via GetNumberFormatW().
|
appropriate NUMBERFMTW structure to do the job via GetNumberFormatW().
|
||||||
*/
|
*/
|
||||||
GetLocaleInfoW(lcid, LOCALE_SDECIMAL | (dwFlags & LOCALE_NOUSEROVERRIDE),
|
GetLocaleInfoW(lcid, LOCALE_SDECIMAL | (dwFlags & LOCALE_NOUSEROVERRIDE),
|
||||||
lpDecimalSep, sizeof(lpDecimalSep) / sizeof(WCHAR));
|
lpDecimalSep, ARRAY_SIZE(lpDecimalSep));
|
||||||
if (lpDecimalSep[0] == '.' && lpDecimalSep[1] == '\0')
|
if (lpDecimalSep[0] == '.' && lpDecimalSep[1] == '\0')
|
||||||
{
|
{
|
||||||
/* locale is compatible with English - return original string */
|
/* locale is compatible with English - return original string */
|
||||||
|
@ -6497,7 +6491,7 @@ static BSTR VARIANT_BstrReplaceDecimal(const WCHAR * buff, LCID lcid, ULONG dwFl
|
||||||
if (p) minFormat.NumDigits = strlenW(p + 1);
|
if (p) minFormat.NumDigits = strlenW(p + 1);
|
||||||
|
|
||||||
numbuff[0] = '\0';
|
numbuff[0] = '\0';
|
||||||
if (!GetNumberFormatW(lcid, 0, buff, &minFormat, numbuff, sizeof(numbuff) / sizeof(WCHAR)))
|
if (!GetNumberFormatW(lcid, 0, buff, &minFormat, numbuff, ARRAY_SIZE(numbuff)))
|
||||||
{
|
{
|
||||||
WARN("GetNumberFormatW() failed, returning raw number string instead\n");
|
WARN("GetNumberFormatW() failed, returning raw number string instead\n");
|
||||||
bstrOut = SysAllocString(buff);
|
bstrOut = SysAllocString(buff);
|
||||||
|
@ -6528,7 +6522,7 @@ static HRESULT VARIANT_BstrFromReal(DOUBLE dblIn, LCID lcid, ULONG dwFlags,
|
||||||
*/
|
*/
|
||||||
if (buff[0] == '-')
|
if (buff[0] == '-')
|
||||||
{
|
{
|
||||||
const WCHAR szAccept[] = {'0', '.', '\0'};
|
static const WCHAR szAccept[] = {'0', '.', '\0'};
|
||||||
if (strlenW(buff + 1) == strspnW(buff + 1, szAccept))
|
if (strlenW(buff + 1) == strspnW(buff + 1, szAccept))
|
||||||
{ buff[0] = '0'; buff[1] = '\0'; }
|
{ buff[0] = '0'; buff[1] = '\0'; }
|
||||||
}
|
}
|
||||||
|
@ -6541,7 +6535,7 @@ static HRESULT VARIANT_BstrFromReal(DOUBLE dblIn, LCID lcid, ULONG dwFlags,
|
||||||
/* Format the number for the locale */
|
/* Format the number for the locale */
|
||||||
numbuff[0] = '\0';
|
numbuff[0] = '\0';
|
||||||
GetNumberFormatW(lcid, dwFlags & LOCALE_NOUSEROVERRIDE,
|
GetNumberFormatW(lcid, dwFlags & LOCALE_NOUSEROVERRIDE,
|
||||||
buff, NULL, numbuff, sizeof(numbuff) / sizeof(WCHAR));
|
buff, NULL, numbuff, ARRAY_SIZE(numbuff));
|
||||||
TRACE("created NLS string %s\n", debugstr_w(numbuff));
|
TRACE("created NLS string %s\n", debugstr_w(numbuff));
|
||||||
*pbstrOut = SysAllocString(numbuff);
|
*pbstrOut = SysAllocString(numbuff);
|
||||||
}
|
}
|
||||||
|
@ -6632,7 +6626,7 @@ HRESULT WINAPI VarBstrFromCy(CY cyIn, LCID lcid, ULONG dwFlags, BSTR *pbstrOut)
|
||||||
VARIANT_int_add(decVal.bitsnum, 3, &one, 1);
|
VARIANT_int_add(decVal.bitsnum, 3, &one, 1);
|
||||||
}
|
}
|
||||||
decVal.bitsnum[2] = 0;
|
decVal.bitsnum[2] = 0;
|
||||||
VARIANT_DI_tostringW(&decVal, buff, sizeof(buff)/sizeof(buff[0]));
|
VARIANT_DI_tostringW(&decVal, buff, ARRAY_SIZE(buff));
|
||||||
|
|
||||||
if (dwFlags & LOCALE_USE_NLS)
|
if (dwFlags & LOCALE_USE_NLS)
|
||||||
{
|
{
|
||||||
|
@ -6641,7 +6635,7 @@ HRESULT WINAPI VarBstrFromCy(CY cyIn, LCID lcid, ULONG dwFlags, BSTR *pbstrOut)
|
||||||
/* Format the currency for the locale */
|
/* Format the currency for the locale */
|
||||||
cybuff[0] = '\0';
|
cybuff[0] = '\0';
|
||||||
GetCurrencyFormatW(lcid, dwFlags & LOCALE_NOUSEROVERRIDE,
|
GetCurrencyFormatW(lcid, dwFlags & LOCALE_NOUSEROVERRIDE,
|
||||||
buff, NULL, cybuff, sizeof(cybuff) / sizeof(WCHAR));
|
buff, NULL, cybuff, ARRAY_SIZE(cybuff));
|
||||||
*pbstrOut = SysAllocString(cybuff);
|
*pbstrOut = SysAllocString(cybuff);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -6814,8 +6808,8 @@ HRESULT WINAPI VarBstrFromDate(DATE dateIn, LCID lcid, ULONG dwFlags, BSTR* pbst
|
||||||
if (dwFlags & VAR_TIMEVALUEONLY)
|
if (dwFlags & VAR_TIMEVALUEONLY)
|
||||||
date[0] = '\0';
|
date[0] = '\0';
|
||||||
else
|
else
|
||||||
if (!GetLocaleInfoW(lcid, LOCALE_SSHORTDATE, fmt_buff, sizeof(fmt_buff)/sizeof(WCHAR)) ||
|
if (!GetLocaleInfoW(lcid, LOCALE_SSHORTDATE, fmt_buff, ARRAY_SIZE(fmt_buff)) ||
|
||||||
!get_date_format(lcid, dwFlags, &st, fmt_buff, date, sizeof(date)/sizeof(WCHAR)))
|
!get_date_format(lcid, dwFlags, &st, fmt_buff, date, ARRAY_SIZE(date)))
|
||||||
return E_INVALIDARG;
|
return E_INVALIDARG;
|
||||||
|
|
||||||
if (!(dwFlags & VAR_DATEVALUEONLY))
|
if (!(dwFlags & VAR_DATEVALUEONLY))
|
||||||
|
@ -6823,8 +6817,7 @@ HRESULT WINAPI VarBstrFromDate(DATE dateIn, LCID lcid, ULONG dwFlags, BSTR* pbst
|
||||||
time = date + strlenW(date);
|
time = date + strlenW(date);
|
||||||
if (time != date)
|
if (time != date)
|
||||||
*time++ = ' ';
|
*time++ = ' ';
|
||||||
if (!GetTimeFormatW(lcid, dwFormatFlags, &st, NULL, time,
|
if (!GetTimeFormatW(lcid, dwFormatFlags, &st, NULL, time, ARRAY_SIZE(date)-(time-date)))
|
||||||
sizeof(date)/sizeof(WCHAR)-(time-date)))
|
|
||||||
return E_INVALIDARG;
|
return E_INVALIDARG;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7012,7 +7005,7 @@ HRESULT WINAPI VarBstrFromDec(DECIMAL* pDecIn, LCID lcid, ULONG dwFlags, BSTR* p
|
||||||
/* Format the number for the locale */
|
/* Format the number for the locale */
|
||||||
numbuff[0] = '\0';
|
numbuff[0] = '\0';
|
||||||
GetNumberFormatW(lcid, dwFlags & LOCALE_NOUSEROVERRIDE,
|
GetNumberFormatW(lcid, dwFlags & LOCALE_NOUSEROVERRIDE,
|
||||||
buff, NULL, numbuff, sizeof(numbuff) / sizeof(WCHAR));
|
buff, NULL, numbuff, ARRAY_SIZE(numbuff));
|
||||||
TRACE("created NLS string %s\n", debugstr_w(numbuff));
|
TRACE("created NLS string %s\n", debugstr_w(numbuff));
|
||||||
*pbstrOut = SysAllocString(numbuff);
|
*pbstrOut = SysAllocString(numbuff);
|
||||||
}
|
}
|
||||||
|
@ -7625,7 +7618,7 @@ HRESULT WINAPI VarDateFromStr(OLECHAR* strIn, LCID lcid, ULONG dwFlags, DATE* pd
|
||||||
1,2,3,4,5,6,7,8,9,10,11,12,13
|
1,2,3,4,5,6,7,8,9,10,11,12,13
|
||||||
};
|
};
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
BSTR tokens[sizeof(ParseDateTokens)/sizeof(ParseDateTokens[0])];
|
BSTR tokens[ARRAY_SIZE(ParseDateTokens)];
|
||||||
DATEPARSE dp;
|
DATEPARSE dp;
|
||||||
DWORD dwDateSeps = 0, iDate = 0;
|
DWORD dwDateSeps = 0, iDate = 0;
|
||||||
HRESULT hRet = S_OK;
|
HRESULT hRet = S_OK;
|
||||||
|
@ -7648,7 +7641,7 @@ HRESULT WINAPI VarDateFromStr(OLECHAR* strIn, LCID lcid, ULONG dwFlags, DATE* pd
|
||||||
TRACE("iDate is %d\n", iDate);
|
TRACE("iDate is %d\n", iDate);
|
||||||
|
|
||||||
/* Get the month/day/am/pm tokens for this locale */
|
/* Get the month/day/am/pm tokens for this locale */
|
||||||
for (i = 0; i < sizeof(tokens)/sizeof(tokens[0]); i++)
|
for (i = 0; i < ARRAY_SIZE(tokens); i++)
|
||||||
{
|
{
|
||||||
WCHAR buff[128];
|
WCHAR buff[128];
|
||||||
LCTYPE lctype = ParseDateTokens[i] | (dwFlags & LOCALE_NOUSEROVERRIDE);
|
LCTYPE lctype = ParseDateTokens[i] | (dwFlags & LOCALE_NOUSEROVERRIDE);
|
||||||
|
@ -7657,7 +7650,7 @@ HRESULT WINAPI VarDateFromStr(OLECHAR* strIn, LCID lcid, ULONG dwFlags, DATE* pd
|
||||||
* GetAltMonthNames(). We should really cache these strings too.
|
* GetAltMonthNames(). We should really cache these strings too.
|
||||||
*/
|
*/
|
||||||
buff[0] = '\0';
|
buff[0] = '\0';
|
||||||
GetLocaleInfoW(lcid, lctype, buff, sizeof(buff)/sizeof(WCHAR));
|
GetLocaleInfoW(lcid, lctype, buff, ARRAY_SIZE(buff));
|
||||||
tokens[i] = SysAllocString(buff);
|
tokens[i] = SysAllocString(buff);
|
||||||
TRACE("token %d is %s\n", i, debugstr_w(tokens[i]));
|
TRACE("token %d is %s\n", i, debugstr_w(tokens[i]));
|
||||||
}
|
}
|
||||||
|
@ -7680,7 +7673,7 @@ HRESULT WINAPI VarDateFromStr(OLECHAR* strIn, LCID lcid, ULONG dwFlags, DATE* pd
|
||||||
{
|
{
|
||||||
BOOL bFound = FALSE;
|
BOOL bFound = FALSE;
|
||||||
|
|
||||||
for (i = 0; i < sizeof(tokens)/sizeof(tokens[0]); i++)
|
for (i = 0; i < ARRAY_SIZE(tokens); i++)
|
||||||
{
|
{
|
||||||
DWORD dwLen = strlenW(tokens[i]);
|
DWORD dwLen = strlenW(tokens[i]);
|
||||||
if (dwLen && !strncmpiW(strIn, tokens[i], dwLen))
|
if (dwLen && !strncmpiW(strIn, tokens[i], dwLen))
|
||||||
|
@ -7940,7 +7933,7 @@ HRESULT WINAPI VarDateFromStr(OLECHAR* strIn, LCID lcid, ULONG dwFlags, DATE* pd
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < sizeof(tokens)/sizeof(tokens[0]); i++)
|
for (i = 0; i < ARRAY_SIZE(tokens); i++)
|
||||||
SysFreeString(tokens[i]);
|
SysFreeString(tokens[i]);
|
||||||
return hRet;
|
return hRet;
|
||||||
}
|
}
|
||||||
|
|
|
@ -141,7 +141,7 @@ reactos/dll/win32/odbc32 # Synced to WineStaging-4.0. Depends on po
|
||||||
reactos/dll/win32/odbccp32 # Synced to WineStaging-4.0
|
reactos/dll/win32/odbccp32 # Synced to WineStaging-4.0
|
||||||
reactos/dll/win32/ole32 # Synced to WineStaging-4.0
|
reactos/dll/win32/ole32 # Synced to WineStaging-4.0
|
||||||
reactos/dll/win32/oleacc # Synced to WineStaging-4.0
|
reactos/dll/win32/oleacc # Synced to WineStaging-4.0
|
||||||
reactos/dll/win32/oleaut32 # Synced to WineStaging-3.3
|
reactos/dll/win32/oleaut32 # Synced to WineStaging-4.0
|
||||||
reactos/dll/win32/olecli32 # Synced to WineStaging-3.3
|
reactos/dll/win32/olecli32 # Synced to WineStaging-3.3
|
||||||
reactos/dll/win32/oledlg # Synced to WineStaging-3.3
|
reactos/dll/win32/oledlg # Synced to WineStaging-3.3
|
||||||
reactos/dll/win32/olepro32 # Synced to WineStaging-3.3
|
reactos/dll/win32/olepro32 # Synced to WineStaging-3.3
|
||||||
|
|
|
@ -676,18 +676,18 @@ HRESULT WINAPI VarDecNeg(_In_ const DECIMAL*, _Out_ DECIMAL*);
|
||||||
HRESULT WINAPI VarDecRound(_In_ const DECIMAL*, int, _Out_ DECIMAL*);
|
HRESULT WINAPI VarDecRound(_In_ const DECIMAL*, int, _Out_ DECIMAL*);
|
||||||
HRESULT WINAPI VarDecSub(_In_ const DECIMAL*, _In_ const DECIMAL*, _Out_ DECIMAL*);
|
HRESULT WINAPI VarDecSub(_In_ const DECIMAL*, _In_ const DECIMAL*, _Out_ DECIMAL*);
|
||||||
|
|
||||||
HRESULT WINAPI VarCyAbs(_In_ const CY, _Out_ CY*);
|
HRESULT WINAPI VarCyAbs(_In_ CY, _Out_ CY*);
|
||||||
HRESULT WINAPI VarCyAdd(_In_ const CY, _In_ const CY, _Out_ CY*);
|
HRESULT WINAPI VarCyAdd(_In_ CY, _In_ CY, _Out_ CY*);
|
||||||
HRESULT WINAPI VarCyCmp(_In_ const CY, _In_ const CY);
|
HRESULT WINAPI VarCyCmp(_In_ CY, _In_ CY);
|
||||||
HRESULT WINAPI VarCyCmpR8(_In_ const CY, _In_ DOUBLE);
|
HRESULT WINAPI VarCyCmpR8(_In_ CY, _In_ DOUBLE);
|
||||||
HRESULT WINAPI VarCyFix(_In_ const CY, _Out_ CY*);
|
HRESULT WINAPI VarCyFix(_In_ CY, _Out_ CY*);
|
||||||
HRESULT WINAPI VarCyInt(_In_ const CY, _Out_ CY*);
|
HRESULT WINAPI VarCyInt(_In_ CY, _Out_ CY*);
|
||||||
HRESULT WINAPI VarCyMul(_In_ const CY, _In_ CY, _Out_ CY*);
|
HRESULT WINAPI VarCyMul(_In_ CY, _In_ CY, _Out_ CY*);
|
||||||
HRESULT WINAPI VarCyMulI4(_In_ const CY, _In_ LONG, _Out_ CY*);
|
HRESULT WINAPI VarCyMulI4(_In_ CY, _In_ LONG, _Out_ CY*);
|
||||||
HRESULT WINAPI VarCyMulI8(_In_ const CY, _In_ LONG64, _Out_ CY*);
|
HRESULT WINAPI VarCyMulI8(_In_ CY, _In_ LONG64, _Out_ CY*);
|
||||||
HRESULT WINAPI VarCyNeg(_In_ const CY, _Out_ CY*);
|
HRESULT WINAPI VarCyNeg(_In_ CY, _Out_ CY*);
|
||||||
HRESULT WINAPI VarCyRound(_In_ const CY, _In_ INT, _Out_ CY*);
|
HRESULT WINAPI VarCyRound(_In_ CY, _In_ INT, _Out_ CY*);
|
||||||
HRESULT WINAPI VarCySub(_In_ const CY, _In_ const CY, _Out_ CY*);
|
HRESULT WINAPI VarCySub(_In_ CY, _In_ CY, _Out_ CY*);
|
||||||
|
|
||||||
HRESULT WINAPI VarAdd(_In_ LPVARIANT, _In_ LPVARIANT, _Out_ LPVARIANT);
|
HRESULT WINAPI VarAdd(_In_ LPVARIANT, _In_ LPVARIANT, _Out_ LPVARIANT);
|
||||||
HRESULT WINAPI VarAnd(_In_ LPVARIANT, _In_ LPVARIANT, _Out_ LPVARIANT);
|
HRESULT WINAPI VarAnd(_In_ LPVARIANT, _In_ LPVARIANT, _Out_ LPVARIANT);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue