mirror of
https://github.com/reactos/reactos.git
synced 2025-05-13 14:20:31 +00:00
[OLEAUT32]
* Sync with Wine 1.5.26. svn path=/trunk/; revision=58588
This commit is contained in:
parent
a85aee22bc
commit
a6c07ee5d8
14 changed files with 300 additions and 184 deletions
|
@ -19,6 +19,6 @@
|
||||||
#ifndef _CONNPT_H
|
#ifndef _CONNPT_H
|
||||||
#define _CONNPT_H
|
#define _CONNPT_H
|
||||||
|
|
||||||
HRESULT CreateConnectionPoint(IUnknown *pUnk, REFIID riid, IConnectionPoint **pCP);
|
HRESULT CreateConnectionPoint(IUnknown *pUnk, REFIID riid, IConnectionPoint **pCP) DECLSPEC_HIDDEN;
|
||||||
|
|
||||||
#endif /* _CONNPT_H */
|
#endif /* _CONNPT_H */
|
||||||
|
|
|
@ -93,14 +93,15 @@ typedef struct {
|
||||||
} u;
|
} u;
|
||||||
} bstr_t;
|
} bstr_t;
|
||||||
|
|
||||||
|
#define BUCKET_SIZE 16
|
||||||
|
#define BUCKET_BUFFER_SIZE 6
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
unsigned short head;
|
unsigned short head;
|
||||||
unsigned short cnt;
|
unsigned short cnt;
|
||||||
bstr_t *buf[6];
|
bstr_t *buf[BUCKET_BUFFER_SIZE];
|
||||||
} bstr_cache_entry_t;
|
} bstr_cache_entry_t;
|
||||||
|
|
||||||
#define BUCKET_SIZE 16
|
|
||||||
|
|
||||||
#define ARENA_INUSE_FILLER 0x55
|
#define ARENA_INUSE_FILLER 0x55
|
||||||
#define ARENA_TAIL_FILLER 0xab
|
#define ARENA_TAIL_FILLER 0xab
|
||||||
#define ARENA_FREE_FILLER 0xfeeefeee
|
#define ARENA_FREE_FILLER 0xfeeefeee
|
||||||
|
@ -141,7 +142,7 @@ static bstr_t *alloc_bstr(size_t size)
|
||||||
|
|
||||||
if(cache_entry) {
|
if(cache_entry) {
|
||||||
ret = cache_entry->buf[cache_entry->head++];
|
ret = cache_entry->buf[cache_entry->head++];
|
||||||
cache_entry->head %= sizeof(cache_entry->buf)/sizeof(*cache_entry->buf);
|
cache_entry->head %= BUCKET_BUFFER_SIZE;
|
||||||
cache_entry->cnt--;
|
cache_entry->cnt--;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -260,14 +261,26 @@ void WINAPI SysFreeString(BSTR str)
|
||||||
bstr = bstr_from_str(str);
|
bstr = bstr_from_str(str);
|
||||||
cache_entry = get_cache_entry(bstr->size+sizeof(WCHAR));
|
cache_entry = get_cache_entry(bstr->size+sizeof(WCHAR));
|
||||||
if(cache_entry) {
|
if(cache_entry) {
|
||||||
|
unsigned i;
|
||||||
|
|
||||||
EnterCriticalSection(&cs_bstr_cache);
|
EnterCriticalSection(&cs_bstr_cache);
|
||||||
|
|
||||||
|
/* According to tests, freeing a string that's already in cache doesn't corrupt anything.
|
||||||
|
* For that to work we need to search the cache. */
|
||||||
|
for(i=0; i < cache_entry->cnt; i++) {
|
||||||
|
if(cache_entry->buf[(cache_entry->head+i) % BUCKET_BUFFER_SIZE] == bstr) {
|
||||||
|
WARN_(heap)("String already is in cache!\n");
|
||||||
|
LeaveCriticalSection(&cs_bstr_cache);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(cache_entry->cnt < sizeof(cache_entry->buf)/sizeof(*cache_entry->buf)) {
|
if(cache_entry->cnt < sizeof(cache_entry->buf)/sizeof(*cache_entry->buf)) {
|
||||||
cache_entry->buf[(cache_entry->head+cache_entry->cnt)%((sizeof(cache_entry->buf)/sizeof(*cache_entry->buf)))] = bstr;
|
cache_entry->buf[(cache_entry->head+cache_entry->cnt) % BUCKET_BUFFER_SIZE] = bstr;
|
||||||
cache_entry->cnt++;
|
cache_entry->cnt++;
|
||||||
|
|
||||||
if(WARN_ON(heap)) {
|
if(WARN_ON(heap)) {
|
||||||
unsigned i, n = bstr_alloc_size(bstr->size) / sizeof(DWORD) - 1;
|
unsigned n = bstr_alloc_size(bstr->size) / sizeof(DWORD) - 1;
|
||||||
bstr->size = ARENA_FREE_FILLER;
|
bstr->size = ARENA_FREE_FILLER;
|
||||||
for(i=0; i<n; i++)
|
for(i=0; i<n; i++)
|
||||||
bstr->u.dwptr[i] = ARENA_FREE_FILLER;
|
bstr->u.dwptr[i] = ARENA_FREE_FILLER;
|
||||||
|
|
|
@ -1423,8 +1423,8 @@ static HRESULT WINAPI OLEPictureImpl_Load(IPersistStream* iface, IStream *pStm)
|
||||||
} while (!headerisdata);
|
} while (!headerisdata);
|
||||||
|
|
||||||
if (statfailed) { /* we don't know the size ... read all we get */
|
if (statfailed) { /* we don't know the size ... read all we get */
|
||||||
int sizeinc = 4096;
|
unsigned int sizeinc = 4096;
|
||||||
int origsize = sizeinc;
|
unsigned int origsize = sizeinc;
|
||||||
ULONG nread = 42;
|
ULONG nread = 42;
|
||||||
|
|
||||||
TRACE("Reading all data from stream.\n");
|
TRACE("Reading all data from stream.\n");
|
||||||
|
|
|
@ -143,7 +143,7 @@ static HRESULT WINAPI PropertyPageSite_TranslateAccelerator(
|
||||||
return E_NOTIMPL;
|
return E_NOTIMPL;
|
||||||
}
|
}
|
||||||
|
|
||||||
IPropertyPageSiteVtbl PropertyPageSiteVtbl = {
|
static IPropertyPageSiteVtbl PropertyPageSiteVtbl = {
|
||||||
PropertyPageSite_QueryInterface,
|
PropertyPageSite_QueryInterface,
|
||||||
PropertyPageSite_AddRef,
|
PropertyPageSite_AddRef,
|
||||||
PropertyPageSite_Release,
|
PropertyPageSite_Release,
|
||||||
|
@ -171,7 +171,7 @@ HRESULT WINAPI OleCreatePropertyFrameIndirect(LPOCPFIPARAMS lpParams)
|
||||||
IPropertyPage **property_page;
|
IPropertyPage **property_page;
|
||||||
PropertyPageSite *property_page_site;
|
PropertyPageSite *property_page_site;
|
||||||
HRESULT res;
|
HRESULT res;
|
||||||
int i;
|
ULONG i;
|
||||||
HMODULE hcomctl;
|
HMODULE hcomctl;
|
||||||
HRSRC property_sheet_dialog_find = NULL;
|
HRSRC property_sheet_dialog_find = NULL;
|
||||||
HGLOBAL property_sheet_dialog_load = NULL;
|
HGLOBAL property_sheet_dialog_load = NULL;
|
||||||
|
|
|
@ -619,7 +619,7 @@ HRESULT WINAPI GetRecordInfoFromTypeInfo(ITypeInfo* pTI, IRecordInfo** ppRecInfo
|
||||||
ret->name = NULL;
|
ret->name = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret->fields = HeapAlloc(GetProcessHeap(), 0, ret->n_vars*sizeof(VARDESC));
|
ret->fields = HeapAlloc(GetProcessHeap(), 0, ret->n_vars*sizeof(fieldstr));
|
||||||
for(i = 0; i<ret->n_vars; i++) {
|
for(i = 0; i<ret->n_vars; i++) {
|
||||||
VARDESC *vardesc;
|
VARDESC *vardesc;
|
||||||
hres = ITypeInfo_GetVarDesc(pTypeInfo, i, &vardesc);
|
hres = ITypeInfo_GetVarDesc(pTypeInfo, i, &vardesc);
|
||||||
|
|
|
@ -412,15 +412,15 @@ static HRESULT num_of_funcs(ITypeInfo *tinfo, unsigned int *num,
|
||||||
#include "pshpack1.h"
|
#include "pshpack1.h"
|
||||||
|
|
||||||
typedef struct _TMAsmProxy {
|
typedef struct _TMAsmProxy {
|
||||||
BYTE popleax;
|
DWORD lealeax;
|
||||||
|
BYTE pushleax;
|
||||||
BYTE pushlval;
|
BYTE pushlval;
|
||||||
DWORD nr;
|
DWORD nr;
|
||||||
BYTE pushleax;
|
|
||||||
BYTE lcall;
|
BYTE lcall;
|
||||||
DWORD xcall;
|
DWORD xcall;
|
||||||
BYTE lret;
|
BYTE lret;
|
||||||
WORD bytestopop;
|
WORD bytestopop;
|
||||||
BYTE nop;
|
WORD nop;
|
||||||
} TMAsmProxy;
|
} TMAsmProxy;
|
||||||
|
|
||||||
#include "poppack.h"
|
#include "poppack.h"
|
||||||
|
@ -1338,13 +1338,13 @@ static inline BOOL is_out_elem(const ELEMDESC *elem)
|
||||||
return (elem->u.paramdesc.wParamFlags & PARAMFLAG_FOUT || !elem->u.paramdesc.wParamFlags);
|
return (elem->u.paramdesc.wParamFlags & PARAMFLAG_FOUT || !elem->u.paramdesc.wParamFlags);
|
||||||
}
|
}
|
||||||
|
|
||||||
static DWORD
|
static DWORD WINAPI xCall(int method, void **args)
|
||||||
xCall(LPVOID retptr, int method, TMProxyImpl *tpinfo /*, args */)
|
|
||||||
{
|
{
|
||||||
DWORD *args = ((DWORD*)&tpinfo)+1, *xargs;
|
TMProxyImpl *tpinfo = args[0];
|
||||||
|
DWORD *xargs;
|
||||||
const FUNCDESC *fdesc;
|
const FUNCDESC *fdesc;
|
||||||
HRESULT hres;
|
HRESULT hres;
|
||||||
int i, relaydeb = TRACE_ON(olerelay);
|
int i;
|
||||||
marshal_state buf;
|
marshal_state buf;
|
||||||
RPCOLEMESSAGE msg;
|
RPCOLEMESSAGE msg;
|
||||||
ULONG status;
|
ULONG status;
|
||||||
|
@ -1376,7 +1376,7 @@ xCall(LPVOID retptr, int method, TMProxyImpl *tpinfo /*, args */)
|
||||||
|
|
||||||
LeaveCriticalSection(&tpinfo->crit);
|
LeaveCriticalSection(&tpinfo->crit);
|
||||||
|
|
||||||
if (relaydeb) {
|
if (TRACE_ON(olerelay)) {
|
||||||
TRACE_(olerelay)("->");
|
TRACE_(olerelay)("->");
|
||||||
if (iname)
|
if (iname)
|
||||||
TRACE_(olerelay)("%s:",relaystr(iname));
|
TRACE_(olerelay)("%s:",relaystr(iname));
|
||||||
|
@ -1401,10 +1401,10 @@ xCall(LPVOID retptr, int method, TMProxyImpl *tpinfo /*, args */)
|
||||||
if (nrofnames > sizeof(names)/sizeof(names[0]))
|
if (nrofnames > sizeof(names)/sizeof(names[0]))
|
||||||
ERR("Need more names!\n");
|
ERR("Need more names!\n");
|
||||||
|
|
||||||
xargs = args;
|
xargs = (DWORD *)(args + 1);
|
||||||
for (i=0;i<fdesc->cParams;i++) {
|
for (i=0;i<fdesc->cParams;i++) {
|
||||||
ELEMDESC *elem = fdesc->lprgelemdescParam+i;
|
ELEMDESC *elem = fdesc->lprgelemdescParam+i;
|
||||||
if (relaydeb) {
|
if (TRACE_ON(olerelay)) {
|
||||||
if (i) TRACE_(olerelay)(",");
|
if (i) TRACE_(olerelay)(",");
|
||||||
if (i+1<nrofnames && names[i+1])
|
if (i+1<nrofnames && names[i+1])
|
||||||
TRACE_(olerelay)("%s=",relaystr(names[i+1]));
|
TRACE_(olerelay)("%s=",relaystr(names[i+1]));
|
||||||
|
@ -1415,7 +1415,7 @@ xCall(LPVOID retptr, int method, TMProxyImpl *tpinfo /*, args */)
|
||||||
if (elem->tdesc.vt != VT_PTR)
|
if (elem->tdesc.vt != VT_PTR)
|
||||||
{
|
{
|
||||||
xargs+=_argsize(&elem->tdesc, tinfo);
|
xargs+=_argsize(&elem->tdesc, tinfo);
|
||||||
if (relaydeb) TRACE_(olerelay)("[out]");
|
TRACE_(olerelay)("[out]");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -1427,7 +1427,7 @@ xCall(LPVOID retptr, int method, TMProxyImpl *tpinfo /*, args */)
|
||||||
hres = serialize_param(
|
hres = serialize_param(
|
||||||
tinfo,
|
tinfo,
|
||||||
is_in_elem(elem),
|
is_in_elem(elem),
|
||||||
relaydeb,
|
TRACE_ON(olerelay),
|
||||||
FALSE,
|
FALSE,
|
||||||
&elem->tdesc,
|
&elem->tdesc,
|
||||||
xargs,
|
xargs,
|
||||||
|
@ -1440,7 +1440,7 @@ xCall(LPVOID retptr, int method, TMProxyImpl *tpinfo /*, args */)
|
||||||
}
|
}
|
||||||
xargs+=_argsize(&elem->tdesc, tinfo);
|
xargs+=_argsize(&elem->tdesc, tinfo);
|
||||||
}
|
}
|
||||||
if (relaydeb) TRACE_(olerelay)(")");
|
TRACE_(olerelay)(")");
|
||||||
|
|
||||||
memset(&msg,0,sizeof(msg));
|
memset(&msg,0,sizeof(msg));
|
||||||
msg.cbBuffer = buf.curoff;
|
msg.cbBuffer = buf.curoff;
|
||||||
|
@ -1451,14 +1451,14 @@ xCall(LPVOID retptr, int method, TMProxyImpl *tpinfo /*, args */)
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
memcpy(msg.Buffer,buf.base,buf.curoff);
|
memcpy(msg.Buffer,buf.base,buf.curoff);
|
||||||
if (relaydeb) TRACE_(olerelay)("\n");
|
TRACE_(olerelay)("\n");
|
||||||
hres = IRpcChannelBuffer_SendReceive(chanbuf,&msg,&status);
|
hres = IRpcChannelBuffer_SendReceive(chanbuf,&msg,&status);
|
||||||
if (hres) {
|
if (hres) {
|
||||||
ERR("RpcChannelBuffer SendReceive failed, %x\n",hres);
|
ERR("RpcChannelBuffer SendReceive failed, %x\n",hres);
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (relaydeb) TRACE_(olerelay)(" status = %08x (",status);
|
TRACE_(olerelay)(" status = %08x (",status);
|
||||||
if (buf.base)
|
if (buf.base)
|
||||||
buf.base = HeapReAlloc(GetProcessHeap(),0,buf.base,msg.cbBuffer);
|
buf.base = HeapReAlloc(GetProcessHeap(),0,buf.base,msg.cbBuffer);
|
||||||
else
|
else
|
||||||
|
@ -1468,25 +1468,24 @@ xCall(LPVOID retptr, int method, TMProxyImpl *tpinfo /*, args */)
|
||||||
buf.curoff = 0;
|
buf.curoff = 0;
|
||||||
|
|
||||||
/* generic deserializer using typelib description */
|
/* generic deserializer using typelib description */
|
||||||
xargs = args;
|
xargs = (DWORD *)(args + 1);
|
||||||
status = S_OK;
|
status = S_OK;
|
||||||
for (i=0;i<fdesc->cParams;i++) {
|
for (i=0;i<fdesc->cParams;i++) {
|
||||||
ELEMDESC *elem = fdesc->lprgelemdescParam+i;
|
ELEMDESC *elem = fdesc->lprgelemdescParam+i;
|
||||||
|
|
||||||
if (relaydeb) {
|
|
||||||
if (i) TRACE_(olerelay)(",");
|
if (i) TRACE_(olerelay)(",");
|
||||||
if (i+1<nrofnames && names[i+1]) TRACE_(olerelay)("%s=",relaystr(names[i+1]));
|
if (i+1<nrofnames && names[i+1]) TRACE_(olerelay)("%s=",relaystr(names[i+1]));
|
||||||
}
|
|
||||||
/* No need to marshal other data than FOUT and any VT_PTR */
|
/* No need to marshal other data than FOUT and any VT_PTR */
|
||||||
if (!is_out_elem(elem) && (elem->tdesc.vt != VT_PTR)) {
|
if (!is_out_elem(elem) && (elem->tdesc.vt != VT_PTR)) {
|
||||||
xargs += _argsize(&elem->tdesc, tinfo);
|
xargs += _argsize(&elem->tdesc, tinfo);
|
||||||
if (relaydeb) TRACE_(olerelay)("[in]");
|
TRACE_(olerelay)("[in]");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
hres = deserialize_param(
|
hres = deserialize_param(
|
||||||
tinfo,
|
tinfo,
|
||||||
is_out_elem(elem),
|
is_out_elem(elem),
|
||||||
relaydeb,
|
TRACE_ON(olerelay),
|
||||||
FALSE,
|
FALSE,
|
||||||
&(elem->tdesc),
|
&(elem->tdesc),
|
||||||
xargs,
|
xargs,
|
||||||
|
@ -1503,7 +1502,7 @@ xCall(LPVOID retptr, int method, TMProxyImpl *tpinfo /*, args */)
|
||||||
hres = xbuf_get(&buf, (LPBYTE)&remoteresult, sizeof(DWORD));
|
hres = xbuf_get(&buf, (LPBYTE)&remoteresult, sizeof(DWORD));
|
||||||
if (hres != S_OK)
|
if (hres != S_OK)
|
||||||
goto exit;
|
goto exit;
|
||||||
if (relaydeb) TRACE_(olerelay)(") = %08x\n", remoteresult);
|
TRACE_(olerelay)(") = %08x\n", remoteresult);
|
||||||
|
|
||||||
hres = remoteresult;
|
hres = remoteresult;
|
||||||
|
|
||||||
|
@ -1727,8 +1726,8 @@ static inline HRESULT get_facbuf_for_iid(REFIID riid, IPSFactoryBuffer **facbuf)
|
||||||
static HRESULT init_proxy_entry_point(TMProxyImpl *proxy, unsigned int num)
|
static HRESULT init_proxy_entry_point(TMProxyImpl *proxy, unsigned int num)
|
||||||
{
|
{
|
||||||
int j;
|
int j;
|
||||||
/* nrofargs without This */
|
/* nrofargs including This */
|
||||||
int nrofargs;
|
int nrofargs = 1;
|
||||||
ITypeInfo *tinfo2;
|
ITypeInfo *tinfo2;
|
||||||
TMAsmProxy *xasm = proxy->asmstubs + num;
|
TMAsmProxy *xasm = proxy->asmstubs + num;
|
||||||
HRESULT hres;
|
HRESULT hres;
|
||||||
|
@ -1741,7 +1740,6 @@ static HRESULT init_proxy_entry_point(TMProxyImpl *proxy, unsigned int num)
|
||||||
}
|
}
|
||||||
ITypeInfo_Release(tinfo2);
|
ITypeInfo_Release(tinfo2);
|
||||||
/* some args take more than 4 byte on the stack */
|
/* some args take more than 4 byte on the stack */
|
||||||
nrofargs = 0;
|
|
||||||
for (j=0;j<fdesc->cParams;j++)
|
for (j=0;j<fdesc->cParams;j++)
|
||||||
nrofargs += _argsize(&fdesc->lprgelemdescParam[j].tdesc, proxy->tinfo);
|
nrofargs += _argsize(&fdesc->lprgelemdescParam[j].tdesc, proxy->tinfo);
|
||||||
|
|
||||||
|
@ -1750,25 +1748,21 @@ static HRESULT init_proxy_entry_point(TMProxyImpl *proxy, unsigned int num)
|
||||||
ERR("calling convention is not stdcall????\n");
|
ERR("calling convention is not stdcall????\n");
|
||||||
return E_FAIL;
|
return E_FAIL;
|
||||||
}
|
}
|
||||||
/* popl %eax - return ptr
|
/* leal 4(%esp),%eax
|
||||||
* pushl <nr>
|
|
||||||
* pushl %eax
|
* pushl %eax
|
||||||
|
* pushl <nr>
|
||||||
* call xCall
|
* call xCall
|
||||||
* lret <nr> (+4)
|
* lret <nr>
|
||||||
*
|
|
||||||
*
|
|
||||||
* arg3 arg2 arg1 <method> <returnptr>
|
|
||||||
*/
|
*/
|
||||||
xasm->popleax = 0x58;
|
xasm->lealeax = 0x0424448d;
|
||||||
|
xasm->pushleax = 0x50;
|
||||||
xasm->pushlval = 0x68;
|
xasm->pushlval = 0x68;
|
||||||
xasm->nr = num;
|
xasm->nr = num;
|
||||||
xasm->pushleax = 0x50;
|
xasm->lcall = 0xe8;
|
||||||
xasm->lcall = 0xe8; /* relative jump */
|
xasm->xcall = (char *)xCall - (char *)&xasm->lret;
|
||||||
xasm->xcall = (DWORD)xCall;
|
|
||||||
xasm->xcall -= (DWORD)&(xasm->lret);
|
|
||||||
xasm->lret = 0xc2;
|
xasm->lret = 0xc2;
|
||||||
xasm->bytestopop = (nrofargs+2)*4; /* pop args, This, iMethod */
|
xasm->bytestopop = nrofargs * 4;
|
||||||
xasm->nop = 0x90;
|
xasm->nop = 0x9090;
|
||||||
proxy->lpvtbl[fdesc->oVft / sizeof(void *)] = xasm;
|
proxy->lpvtbl[fdesc->oVft / sizeof(void *)] = xasm;
|
||||||
#else
|
#else
|
||||||
FIXME("not implemented on non i386\n");
|
FIXME("not implemented on non i386\n");
|
||||||
|
@ -1808,8 +1802,6 @@ PSFacBuf_CreateProxy(
|
||||||
proxy = CoTaskMemAlloc(sizeof(TMProxyImpl));
|
proxy = CoTaskMemAlloc(sizeof(TMProxyImpl));
|
||||||
if (!proxy) return E_OUTOFMEMORY;
|
if (!proxy) return E_OUTOFMEMORY;
|
||||||
|
|
||||||
assert(sizeof(TMAsmProxy) == 16);
|
|
||||||
|
|
||||||
proxy->dispatch = NULL;
|
proxy->dispatch = NULL;
|
||||||
proxy->dispatch_proxy = NULL;
|
proxy->dispatch_proxy = NULL;
|
||||||
proxy->outerunknown = pUnkOuter;
|
proxy->outerunknown = pUnkOuter;
|
||||||
|
@ -1871,40 +1863,23 @@ PSFacBuf_CreateProxy(
|
||||||
proxy->lpvtbl[i] = ProxyIUnknown_Release;
|
proxy->lpvtbl[i] = ProxyIUnknown_Release;
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
if(!defer_to_dispatch)
|
if(!defer_to_dispatch) hres = init_proxy_entry_point(proxy, i);
|
||||||
{
|
|
||||||
hres = init_proxy_entry_point(proxy, i);
|
|
||||||
if(FAILED(hres)) return hres;
|
|
||||||
}
|
|
||||||
else proxy->lpvtbl[3] = ProxyIDispatch_GetTypeInfoCount;
|
else proxy->lpvtbl[3] = ProxyIDispatch_GetTypeInfoCount;
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
if(!defer_to_dispatch)
|
if(!defer_to_dispatch) hres = init_proxy_entry_point(proxy, i);
|
||||||
{
|
|
||||||
hres = init_proxy_entry_point(proxy, i);
|
|
||||||
if(FAILED(hres)) return hres;
|
|
||||||
}
|
|
||||||
else proxy->lpvtbl[4] = ProxyIDispatch_GetTypeInfo;
|
else proxy->lpvtbl[4] = ProxyIDispatch_GetTypeInfo;
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
if(!defer_to_dispatch)
|
if(!defer_to_dispatch) hres = init_proxy_entry_point(proxy, i);
|
||||||
{
|
|
||||||
hres = init_proxy_entry_point(proxy, i);
|
|
||||||
if(FAILED(hres)) return hres;
|
|
||||||
}
|
|
||||||
else proxy->lpvtbl[5] = ProxyIDispatch_GetIDsOfNames;
|
else proxy->lpvtbl[5] = ProxyIDispatch_GetIDsOfNames;
|
||||||
break;
|
break;
|
||||||
case 6:
|
case 6:
|
||||||
if(!defer_to_dispatch)
|
if(!defer_to_dispatch) hres = init_proxy_entry_point(proxy, i);
|
||||||
{
|
|
||||||
hres = init_proxy_entry_point(proxy, i);
|
|
||||||
if(FAILED(hres)) return hres;
|
|
||||||
}
|
|
||||||
else proxy->lpvtbl[6] = ProxyIDispatch_Invoke;
|
else proxy->lpvtbl[6] = ProxyIDispatch_Invoke;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
hres = init_proxy_entry_point(proxy, i);
|
hres = init_proxy_entry_point(proxy, i);
|
||||||
if(FAILED(hres)) return hres;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -986,7 +986,7 @@ typedef struct tagTLBImpLib
|
||||||
/* internal ITypeLib data */
|
/* internal ITypeLib data */
|
||||||
typedef struct tagITypeLibImpl
|
typedef struct tagITypeLibImpl
|
||||||
{
|
{
|
||||||
const ITypeLib2Vtbl *lpVtbl;
|
ITypeLib2 ITypeLib2_iface;
|
||||||
const ITypeCompVtbl *lpVtblTypeComp;
|
const ITypeCompVtbl *lpVtblTypeComp;
|
||||||
LONG ref;
|
LONG ref;
|
||||||
TLIBATTR LibAttr; /* guid,lcid,syskind,version,flags */
|
TLIBATTR LibAttr; /* guid,lcid,syskind,version,flags */
|
||||||
|
@ -2547,9 +2547,10 @@ static HRESULT TLB_PEFile_Open(LPCWSTR path, INT index, LPVOID *ppBase, DWORD *p
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
hr = E_FAIL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TRACE("No TYPELIB resource found\n");
|
||||||
|
hr = E_FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
TLB_PEFile_Release((IUnknown *)&This->lpvtbl);
|
TLB_PEFile_Release((IUnknown *)&This->lpvtbl);
|
||||||
|
@ -2918,7 +2919,7 @@ static HRESULT TLB_ReadTypeLib(LPCWSTR pszFileName, LPWSTR pszPath, UINT cchPath
|
||||||
if (!strcmpiW(entry->path, pszPath) && entry->index == index)
|
if (!strcmpiW(entry->path, pszPath) && entry->index == index)
|
||||||
{
|
{
|
||||||
TRACE("cache hit\n");
|
TRACE("cache hit\n");
|
||||||
*ppTypeLib = (ITypeLib2*)entry;
|
*ppTypeLib = &entry->ITypeLib2_iface;
|
||||||
ITypeLib2_AddRef(*ppTypeLib);
|
ITypeLib2_AddRef(*ppTypeLib);
|
||||||
LeaveCriticalSection(&cache_section);
|
LeaveCriticalSection(&cache_section);
|
||||||
return S_OK;
|
return S_OK;
|
||||||
|
@ -2952,8 +2953,6 @@ static HRESULT TLB_ReadTypeLib(LPCWSTR pszFileName, LPWSTR pszPath, UINT cchPath
|
||||||
ret = TYPE_E_CANTLOADLIBRARY;
|
ret = TYPE_E_CANTLOADLIBRARY;
|
||||||
IUnknown_Release(pFile);
|
IUnknown_Release(pFile);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
ret = TYPE_E_CANTLOADLIBRARY;
|
|
||||||
|
|
||||||
if(*ppTypeLib) {
|
if(*ppTypeLib) {
|
||||||
ITypeLibImpl *impl = (ITypeLibImpl*)*ppTypeLib;
|
ITypeLibImpl *impl = (ITypeLibImpl*)*ppTypeLib;
|
||||||
|
@ -2969,9 +2968,16 @@ static HRESULT TLB_ReadTypeLib(LPCWSTR pszFileName, LPWSTR pszPath, UINT cchPath
|
||||||
list_add_head(&tlb_cache, &impl->entry);
|
list_add_head(&tlb_cache, &impl->entry);
|
||||||
LeaveCriticalSection(&cache_section);
|
LeaveCriticalSection(&cache_section);
|
||||||
ret = S_OK;
|
ret = S_OK;
|
||||||
} else
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if(ret != E_FAIL)
|
||||||
ERR("Loading of typelib %s failed with error %d\n", debugstr_w(pszFileName), GetLastError());
|
ERR("Loading of typelib %s failed with error %d\n", debugstr_w(pszFileName), GetLastError());
|
||||||
|
|
||||||
|
ret = TYPE_E_CANTLOADLIBRARY;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2984,7 +2990,7 @@ static ITypeLibImpl* TypeLibImpl_Constructor(void)
|
||||||
pTypeLibImpl = heap_alloc_zero(sizeof(ITypeLibImpl));
|
pTypeLibImpl = heap_alloc_zero(sizeof(ITypeLibImpl));
|
||||||
if (!pTypeLibImpl) return NULL;
|
if (!pTypeLibImpl) return NULL;
|
||||||
|
|
||||||
pTypeLibImpl->lpVtbl = &tlbvt;
|
pTypeLibImpl->ITypeLib2_iface.lpVtbl = &tlbvt;
|
||||||
pTypeLibImpl->lpVtblTypeComp = &tlbtcvt;
|
pTypeLibImpl->lpVtblTypeComp = &tlbtcvt;
|
||||||
pTypeLibImpl->ref = 1;
|
pTypeLibImpl->ref = 1;
|
||||||
|
|
||||||
|
@ -3202,7 +3208,7 @@ static ITypeLib2* ITypeLib2_Constructor_MSFT(LPVOID pLib, DWORD dwTLBLength)
|
||||||
}
|
}
|
||||||
|
|
||||||
TRACE("(%p)\n", pTypeLibImpl);
|
TRACE("(%p)\n", pTypeLibImpl);
|
||||||
return (ITypeLib2*) pTypeLibImpl;
|
return &pTypeLibImpl->ITypeLib2_iface;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -4200,58 +4206,53 @@ static ITypeLib2* ITypeLib2_Constructor_SLTG(LPVOID pLib, DWORD dwTLBLength)
|
||||||
}
|
}
|
||||||
|
|
||||||
heap_free(pOtherTypeInfoBlks);
|
heap_free(pOtherTypeInfoBlks);
|
||||||
return (ITypeLib2*)pTypeLibImpl;
|
return &pTypeLibImpl->ITypeLib2_iface;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ITypeLib::QueryInterface
|
static inline ITypeLibImpl *impl_from_ITypeLib2(ITypeLib2 *iface)
|
||||||
*/
|
|
||||||
static HRESULT WINAPI ITypeLib2_fnQueryInterface(
|
|
||||||
ITypeLib2 * iface,
|
|
||||||
REFIID riid,
|
|
||||||
VOID **ppvObject)
|
|
||||||
{
|
{
|
||||||
ITypeLibImpl *This = (ITypeLibImpl *)iface;
|
return CONTAINING_RECORD(iface, ITypeLibImpl, ITypeLib2_iface);
|
||||||
|
}
|
||||||
|
|
||||||
|
static HRESULT WINAPI ITypeLib2_fnQueryInterface(ITypeLib2 *iface, REFIID riid, void **ppv)
|
||||||
|
{
|
||||||
|
ITypeLibImpl *This = impl_from_ITypeLib2(iface);
|
||||||
|
|
||||||
TRACE("(%p)->(IID: %s)\n",This,debugstr_guid(riid));
|
TRACE("(%p)->(IID: %s)\n",This,debugstr_guid(riid));
|
||||||
|
|
||||||
*ppvObject=NULL;
|
|
||||||
if(IsEqualIID(riid, &IID_IUnknown) ||
|
if(IsEqualIID(riid, &IID_IUnknown) ||
|
||||||
IsEqualIID(riid,&IID_ITypeLib)||
|
IsEqualIID(riid,&IID_ITypeLib)||
|
||||||
IsEqualIID(riid,&IID_ITypeLib2))
|
IsEqualIID(riid,&IID_ITypeLib2))
|
||||||
{
|
{
|
||||||
*ppvObject = This;
|
*ppv = &This->ITypeLib2_iface;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
if(*ppvObject)
|
|
||||||
{
|
{
|
||||||
ITypeLib2_AddRef(iface);
|
*ppv = NULL;
|
||||||
TRACE("-- Interface: (%p)->(%p)\n",ppvObject,*ppvObject);
|
|
||||||
return S_OK;
|
|
||||||
}
|
|
||||||
TRACE("-- Interface: E_NOINTERFACE\n");
|
TRACE("-- Interface: E_NOINTERFACE\n");
|
||||||
return E_NOINTERFACE;
|
return E_NOINTERFACE;
|
||||||
|
}
|
||||||
|
|
||||||
|
IUnknown_AddRef((IUnknown*)*ppv);
|
||||||
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ITypeLib::AddRef
|
|
||||||
*/
|
|
||||||
static ULONG WINAPI ITypeLib2_fnAddRef( ITypeLib2 *iface)
|
static ULONG WINAPI ITypeLib2_fnAddRef( ITypeLib2 *iface)
|
||||||
{
|
{
|
||||||
ITypeLibImpl *This = (ITypeLibImpl *)iface;
|
ITypeLibImpl *This = impl_from_ITypeLib2(iface);
|
||||||
ULONG ref = InterlockedIncrement(&This->ref);
|
ULONG ref = InterlockedIncrement(&This->ref);
|
||||||
|
|
||||||
TRACE("(%p)->ref was %u\n",This, ref - 1);
|
TRACE("(%p) ref=%u\n", This, ref);
|
||||||
|
|
||||||
return ref;
|
return ref;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ITypeLib::Release
|
|
||||||
*/
|
|
||||||
static ULONG WINAPI ITypeLib2_fnRelease( ITypeLib2 *iface)
|
static ULONG WINAPI ITypeLib2_fnRelease( ITypeLib2 *iface)
|
||||||
{
|
{
|
||||||
ITypeLibImpl *This = (ITypeLibImpl *)iface;
|
ITypeLibImpl *This = impl_from_ITypeLib2(iface);
|
||||||
ULONG ref = InterlockedDecrement(&This->ref);
|
ULONG ref = InterlockedDecrement(&This->ref);
|
||||||
|
|
||||||
TRACE("(%p)->(%u)\n",This, ref);
|
TRACE("(%p) ref=%u\n",This, ref);
|
||||||
|
|
||||||
if (!ref)
|
if (!ref)
|
||||||
{
|
{
|
||||||
|
@ -4295,7 +4296,7 @@ static ULONG WINAPI ITypeLib2_fnRelease( ITypeLib2 *iface)
|
||||||
LIST_FOR_EACH_ENTRY_SAFE(pImpLib, pImpLibNext, &This->implib_list, TLBImpLib, entry)
|
LIST_FOR_EACH_ENTRY_SAFE(pImpLib, pImpLibNext, &This->implib_list, TLBImpLib, entry)
|
||||||
{
|
{
|
||||||
if (pImpLib->pImpTypeLib)
|
if (pImpLib->pImpTypeLib)
|
||||||
ITypeLib_Release((ITypeLib *)pImpLib->pImpTypeLib);
|
ITypeLib2_Release(&pImpLib->pImpTypeLib->ITypeLib2_iface);
|
||||||
SysFreeString(pImpLib->name);
|
SysFreeString(pImpLib->name);
|
||||||
|
|
||||||
list_remove(&pImpLib->entry);
|
list_remove(&pImpLib->entry);
|
||||||
|
@ -4324,7 +4325,7 @@ static ULONG WINAPI ITypeLib2_fnRelease( ITypeLib2 *iface)
|
||||||
*/
|
*/
|
||||||
static UINT WINAPI ITypeLib2_fnGetTypeInfoCount( ITypeLib2 *iface)
|
static UINT WINAPI ITypeLib2_fnGetTypeInfoCount( ITypeLib2 *iface)
|
||||||
{
|
{
|
||||||
ITypeLibImpl *This = (ITypeLibImpl *)iface;
|
ITypeLibImpl *This = impl_from_ITypeLib2(iface);
|
||||||
TRACE("(%p)->count is %d\n",This, This->TypeInfoCount);
|
TRACE("(%p)->count is %d\n",This, This->TypeInfoCount);
|
||||||
return This->TypeInfoCount;
|
return This->TypeInfoCount;
|
||||||
}
|
}
|
||||||
|
@ -4338,7 +4339,7 @@ static HRESULT WINAPI ITypeLib2_fnGetTypeInfo(
|
||||||
UINT index,
|
UINT index,
|
||||||
ITypeInfo **ppTInfo)
|
ITypeInfo **ppTInfo)
|
||||||
{
|
{
|
||||||
ITypeLibImpl *This = (ITypeLibImpl*)iface;
|
ITypeLibImpl *This = impl_from_ITypeLib2(iface);
|
||||||
|
|
||||||
TRACE("%p %u %p\n", This, index, ppTInfo);
|
TRACE("%p %u %p\n", This, index, ppTInfo);
|
||||||
|
|
||||||
|
@ -4364,7 +4365,7 @@ static HRESULT WINAPI ITypeLib2_fnGetTypeInfoType(
|
||||||
UINT index,
|
UINT index,
|
||||||
TYPEKIND *pTKind)
|
TYPEKIND *pTKind)
|
||||||
{
|
{
|
||||||
ITypeLibImpl *This = (ITypeLibImpl *)iface;
|
ITypeLibImpl *This = impl_from_ITypeLib2(iface);
|
||||||
|
|
||||||
TRACE("(%p, %d, %p)\n", This, index, pTKind);
|
TRACE("(%p, %d, %p)\n", This, index, pTKind);
|
||||||
|
|
||||||
|
@ -4389,8 +4390,8 @@ static HRESULT WINAPI ITypeLib2_fnGetTypeInfoOfGuid(
|
||||||
REFGUID guid,
|
REFGUID guid,
|
||||||
ITypeInfo **ppTInfo)
|
ITypeInfo **ppTInfo)
|
||||||
{
|
{
|
||||||
ITypeLibImpl *This = (ITypeLibImpl *)iface;
|
ITypeLibImpl *This = impl_from_ITypeLib2(iface);
|
||||||
UINT i;
|
int i;
|
||||||
|
|
||||||
TRACE("%p %s %p\n", This, debugstr_guid(guid), ppTInfo);
|
TRACE("%p %s %p\n", This, debugstr_guid(guid), ppTInfo);
|
||||||
|
|
||||||
|
@ -4414,7 +4415,7 @@ static HRESULT WINAPI ITypeLib2_fnGetLibAttr(
|
||||||
ITypeLib2 *iface,
|
ITypeLib2 *iface,
|
||||||
LPTLIBATTR *attr)
|
LPTLIBATTR *attr)
|
||||||
{
|
{
|
||||||
ITypeLibImpl *This = (ITypeLibImpl *)iface;
|
ITypeLibImpl *This = impl_from_ITypeLib2(iface);
|
||||||
|
|
||||||
TRACE("(%p, %p)\n", This, attr);
|
TRACE("(%p, %p)\n", This, attr);
|
||||||
|
|
||||||
|
@ -4437,7 +4438,7 @@ static HRESULT WINAPI ITypeLib2_fnGetTypeComp(
|
||||||
ITypeLib2 *iface,
|
ITypeLib2 *iface,
|
||||||
ITypeComp **ppTComp)
|
ITypeComp **ppTComp)
|
||||||
{
|
{
|
||||||
ITypeLibImpl *This = (ITypeLibImpl *)iface;
|
ITypeLibImpl *This = impl_from_ITypeLib2(iface);
|
||||||
|
|
||||||
TRACE("(%p)->(%p)\n",This,ppTComp);
|
TRACE("(%p)->(%p)\n",This,ppTComp);
|
||||||
*ppTComp = (ITypeComp *)&This->lpVtblTypeComp;
|
*ppTComp = (ITypeComp *)&This->lpVtblTypeComp;
|
||||||
|
@ -4463,13 +4464,10 @@ static HRESULT WINAPI ITypeLib2_fnGetDocumentation(
|
||||||
DWORD *pdwHelpContext,
|
DWORD *pdwHelpContext,
|
||||||
BSTR *pBstrHelpFile)
|
BSTR *pBstrHelpFile)
|
||||||
{
|
{
|
||||||
ITypeLibImpl *This = (ITypeLibImpl *)iface;
|
ITypeLibImpl *This = impl_from_ITypeLib2(iface);
|
||||||
|
|
||||||
HRESULT result = E_INVALIDARG;
|
HRESULT result = E_INVALIDARG;
|
||||||
|
|
||||||
ITypeInfo *pTInfo;
|
ITypeInfo *pTInfo;
|
||||||
|
|
||||||
|
|
||||||
TRACE("(%p) index %d Name(%p) DocString(%p) HelpContext(%p) HelpFile(%p)\n",
|
TRACE("(%p) index %d Name(%p) DocString(%p) HelpContext(%p) HelpFile(%p)\n",
|
||||||
This, index,
|
This, index,
|
||||||
pBstrName, pBstrDocString,
|
pBstrName, pBstrDocString,
|
||||||
|
@ -4557,8 +4555,9 @@ static HRESULT WINAPI ITypeLib2_fnIsName(
|
||||||
ULONG lHashVal,
|
ULONG lHashVal,
|
||||||
BOOL *pfName)
|
BOOL *pfName)
|
||||||
{
|
{
|
||||||
ITypeLibImpl *This = (ITypeLibImpl *)iface;
|
ITypeLibImpl *This = impl_from_ITypeLib2(iface);
|
||||||
UINT nNameBufLen = (lstrlenW(szNameBuf)+1)*sizeof(WCHAR), tic, fdc, vrc, pc;
|
int tic;
|
||||||
|
UINT nNameBufLen = (lstrlenW(szNameBuf)+1)*sizeof(WCHAR), fdc, vrc;
|
||||||
|
|
||||||
TRACE("(%p)->(%s,%08x,%p)\n", This, debugstr_w(szNameBuf), lHashVal,
|
TRACE("(%p)->(%s,%08x,%p)\n", This, debugstr_w(szNameBuf), lHashVal,
|
||||||
pfName);
|
pfName);
|
||||||
|
@ -4569,6 +4568,8 @@ static HRESULT WINAPI ITypeLib2_fnIsName(
|
||||||
if(!memcmp(szNameBuf,pTInfo->Name, nNameBufLen)) goto ITypeLib2_fnIsName_exit;
|
if(!memcmp(szNameBuf,pTInfo->Name, nNameBufLen)) goto ITypeLib2_fnIsName_exit;
|
||||||
for(fdc = 0; fdc < pTInfo->TypeAttr.cFuncs; ++fdc) {
|
for(fdc = 0; fdc < pTInfo->TypeAttr.cFuncs; ++fdc) {
|
||||||
TLBFuncDesc *pFInfo = &pTInfo->funcdescs[fdc];
|
TLBFuncDesc *pFInfo = &pTInfo->funcdescs[fdc];
|
||||||
|
int pc;
|
||||||
|
|
||||||
if(!memcmp(szNameBuf,pFInfo->Name, nNameBufLen)) goto ITypeLib2_fnIsName_exit;
|
if(!memcmp(szNameBuf,pFInfo->Name, nNameBufLen)) goto ITypeLib2_fnIsName_exit;
|
||||||
for(pc=0; pc < pFInfo->funcdesc.cParams; pc++)
|
for(pc=0; pc < pFInfo->funcdesc.cParams; pc++)
|
||||||
if(!memcmp(szNameBuf,pFInfo->pParamDesc[pc].Name, nNameBufLen))
|
if(!memcmp(szNameBuf,pFInfo->pParamDesc[pc].Name, nNameBufLen))
|
||||||
|
@ -4603,8 +4604,9 @@ static HRESULT WINAPI ITypeLib2_fnFindName(
|
||||||
MEMBERID *memid,
|
MEMBERID *memid,
|
||||||
UINT16 *found)
|
UINT16 *found)
|
||||||
{
|
{
|
||||||
ITypeLibImpl *This = (ITypeLibImpl *)iface;
|
ITypeLibImpl *This = impl_from_ITypeLib2(iface);
|
||||||
UINT tic, count = 0;
|
int tic;
|
||||||
|
UINT count = 0;
|
||||||
UINT len;
|
UINT len;
|
||||||
|
|
||||||
TRACE("(%p)->(%s %u %p %p %p)\n", This, debugstr_w(name), hash, ppTInfo, memid, found);
|
TRACE("(%p)->(%s %u %p %p %p)\n", This, debugstr_w(name), hash, ppTInfo, memid, found);
|
||||||
|
@ -4621,7 +4623,7 @@ static HRESULT WINAPI ITypeLib2_fnFindName(
|
||||||
if(!memcmp(name, pTInfo->Name, len)) goto ITypeLib2_fnFindName_exit;
|
if(!memcmp(name, pTInfo->Name, len)) goto ITypeLib2_fnFindName_exit;
|
||||||
for(fdc = 0; fdc < pTInfo->TypeAttr.cFuncs; ++fdc) {
|
for(fdc = 0; fdc < pTInfo->TypeAttr.cFuncs; ++fdc) {
|
||||||
TLBFuncDesc *func = &pTInfo->funcdescs[fdc];
|
TLBFuncDesc *func = &pTInfo->funcdescs[fdc];
|
||||||
UINT pc;
|
int pc;
|
||||||
|
|
||||||
if(!memcmp(name, func->Name, len)) goto ITypeLib2_fnFindName_exit;
|
if(!memcmp(name, func->Name, len)) goto ITypeLib2_fnFindName_exit;
|
||||||
for(pc = 0; pc < func->funcdesc.cParams; pc++) {
|
for(pc = 0; pc < func->funcdesc.cParams; pc++) {
|
||||||
|
@ -4656,10 +4658,9 @@ static VOID WINAPI ITypeLib2_fnReleaseTLibAttr(
|
||||||
ITypeLib2 *iface,
|
ITypeLib2 *iface,
|
||||||
TLIBATTR *pTLibAttr)
|
TLIBATTR *pTLibAttr)
|
||||||
{
|
{
|
||||||
ITypeLibImpl *This = (ITypeLibImpl *)iface;
|
ITypeLibImpl *This = impl_from_ITypeLib2(iface);
|
||||||
TRACE("freeing (%p)\n",This);
|
TRACE("(%p)->(%p)\n", This, pTLibAttr);
|
||||||
heap_free(pTLibAttr);
|
heap_free(pTLibAttr);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ITypeLib2::GetCustData
|
/* ITypeLib2::GetCustData
|
||||||
|
@ -4671,10 +4672,10 @@ static HRESULT WINAPI ITypeLib2_fnGetCustData(
|
||||||
REFGUID guid,
|
REFGUID guid,
|
||||||
VARIANT *pVarVal)
|
VARIANT *pVarVal)
|
||||||
{
|
{
|
||||||
ITypeLibImpl *This = (ITypeLibImpl *)iface;
|
ITypeLibImpl *This = impl_from_ITypeLib2(iface);
|
||||||
TLBCustData *pCData;
|
TLBCustData *pCData;
|
||||||
|
|
||||||
TRACE("%p %s %p\n", This, debugstr_guid(guid), pVarVal);
|
TRACE("(%p)->(%s %p)\n", This, debugstr_guid(guid), pVarVal);
|
||||||
|
|
||||||
pCData = TLB_get_custdata_by_guid(&This->custdata_list, guid);
|
pCData = TLB_get_custdata_by_guid(&This->custdata_list, guid);
|
||||||
if(!pCData)
|
if(!pCData)
|
||||||
|
@ -4697,7 +4698,7 @@ static HRESULT WINAPI ITypeLib2_fnGetLibStatistics(
|
||||||
ULONG *pcUniqueNames,
|
ULONG *pcUniqueNames,
|
||||||
ULONG *pcchUniqueNames)
|
ULONG *pcchUniqueNames)
|
||||||
{
|
{
|
||||||
ITypeLibImpl *This = (ITypeLibImpl *)iface;
|
ITypeLibImpl *This = impl_from_ITypeLib2(iface);
|
||||||
|
|
||||||
FIXME("(%p): stub!\n", This);
|
FIXME("(%p): stub!\n", This);
|
||||||
|
|
||||||
|
@ -4721,7 +4722,7 @@ static HRESULT WINAPI ITypeLib2_fnGetDocumentation2(
|
||||||
DWORD *pdwHelpStringContext,
|
DWORD *pdwHelpStringContext,
|
||||||
BSTR *pbstrHelpStringDll)
|
BSTR *pbstrHelpStringDll)
|
||||||
{
|
{
|
||||||
ITypeLibImpl *This = (ITypeLibImpl *)iface;
|
ITypeLibImpl *This = impl_from_ITypeLib2(iface);
|
||||||
HRESULT result;
|
HRESULT result;
|
||||||
ITypeInfo *pTInfo;
|
ITypeInfo *pTInfo;
|
||||||
|
|
||||||
|
@ -4807,8 +4808,8 @@ static HRESULT WINAPI ITypeLib2_fnGetAllCustData(
|
||||||
ITypeLib2 * iface,
|
ITypeLib2 * iface,
|
||||||
CUSTDATA *pCustData)
|
CUSTDATA *pCustData)
|
||||||
{
|
{
|
||||||
ITypeLibImpl *This = (ITypeLibImpl *)iface;
|
ITypeLibImpl *This = impl_from_ITypeLib2(iface);
|
||||||
TRACE("%p %p\n", iface, pCustData);
|
TRACE("(%p)->(%p)\n", This, pCustData);
|
||||||
return TLB_copy_all_custdata(&This->custdata_list, pCustData);
|
return TLB_copy_all_custdata(&This->custdata_list, pCustData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4838,21 +4839,21 @@ static HRESULT WINAPI ITypeLibComp_fnQueryInterface(ITypeComp * iface, REFIID ri
|
||||||
{
|
{
|
||||||
ITypeLibImpl *This = impl_from_ITypeComp(iface);
|
ITypeLibImpl *This = impl_from_ITypeComp(iface);
|
||||||
|
|
||||||
return ITypeLib2_QueryInterface((ITypeLib2 *)This, riid, ppv);
|
return ITypeLib2_QueryInterface(&This->ITypeLib2_iface, riid, ppv);
|
||||||
}
|
}
|
||||||
|
|
||||||
static ULONG WINAPI ITypeLibComp_fnAddRef(ITypeComp * iface)
|
static ULONG WINAPI ITypeLibComp_fnAddRef(ITypeComp * iface)
|
||||||
{
|
{
|
||||||
ITypeLibImpl *This = impl_from_ITypeComp(iface);
|
ITypeLibImpl *This = impl_from_ITypeComp(iface);
|
||||||
|
|
||||||
return ITypeLib2_AddRef((ITypeLib2 *)This);
|
return ITypeLib2_AddRef(&This->ITypeLib2_iface);
|
||||||
}
|
}
|
||||||
|
|
||||||
static ULONG WINAPI ITypeLibComp_fnRelease(ITypeComp * iface)
|
static ULONG WINAPI ITypeLibComp_fnRelease(ITypeComp * iface)
|
||||||
{
|
{
|
||||||
ITypeLibImpl *This = impl_from_ITypeComp(iface);
|
ITypeLibImpl *This = impl_from_ITypeComp(iface);
|
||||||
|
|
||||||
return ITypeLib2_Release((ITypeLib2 *)This);
|
return ITypeLib2_Release(&This->ITypeLib2_iface);
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI ITypeLibComp_fnBind(
|
static HRESULT WINAPI ITypeLibComp_fnBind(
|
||||||
|
@ -5001,7 +5002,7 @@ static HRESULT WINAPI ITypeLibComp_fnBindType(
|
||||||
ITypeComp ** ppTComp)
|
ITypeComp ** ppTComp)
|
||||||
{
|
{
|
||||||
ITypeLibImpl *This = impl_from_ITypeComp(iface);
|
ITypeLibImpl *This = impl_from_ITypeComp(iface);
|
||||||
UINT i;
|
int i;
|
||||||
|
|
||||||
TRACE("(%s, %x, %p, %p)\n", debugstr_w(szName), lHash, ppTInfo, ppTComp);
|
TRACE("(%s, %x, %p, %p)\n", debugstr_w(szName), lHash, ppTInfo, ppTComp);
|
||||||
|
|
||||||
|
@ -5096,14 +5097,14 @@ static ULONG WINAPI ITypeInfo_fnAddRef( ITypeInfo2 *iface)
|
||||||
TRACE("(%p)->ref is %u\n",This, ref);
|
TRACE("(%p)->ref is %u\n",This, ref);
|
||||||
|
|
||||||
if (ref == 1 /* incremented from 0 */)
|
if (ref == 1 /* incremented from 0 */)
|
||||||
ITypeLib2_AddRef((ITypeLib2*)This->pTypeLib);
|
ITypeLib2_AddRef(&This->pTypeLib->ITypeLib2_iface);
|
||||||
|
|
||||||
return ref;
|
return ref;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ITypeInfoImpl_Destroy(ITypeInfoImpl *This)
|
static void ITypeInfoImpl_Destroy(ITypeInfoImpl *This)
|
||||||
{
|
{
|
||||||
UINT i, j;
|
UINT i;
|
||||||
|
|
||||||
TRACE("destroying ITypeInfo(%p)\n",This);
|
TRACE("destroying ITypeInfo(%p)\n",This);
|
||||||
|
|
||||||
|
@ -5118,6 +5119,7 @@ static void ITypeInfoImpl_Destroy(ITypeInfoImpl *This)
|
||||||
|
|
||||||
for (i = 0; i < This->TypeAttr.cFuncs; ++i)
|
for (i = 0; i < This->TypeAttr.cFuncs; ++i)
|
||||||
{
|
{
|
||||||
|
int j;
|
||||||
TLBFuncDesc *pFInfo = &This->funcdescs[i];
|
TLBFuncDesc *pFInfo = &This->funcdescs[i];
|
||||||
for(j = 0; j < pFInfo->funcdesc.cParams; j++)
|
for(j = 0; j < pFInfo->funcdesc.cParams; j++)
|
||||||
{
|
{
|
||||||
|
@ -5179,7 +5181,7 @@ static ULONG WINAPI ITypeInfo_fnRelease(ITypeInfo2 *iface)
|
||||||
if (!ref)
|
if (!ref)
|
||||||
{
|
{
|
||||||
BOOL not_attached_to_typelib = This->not_attached_to_typelib;
|
BOOL not_attached_to_typelib = This->not_attached_to_typelib;
|
||||||
ITypeLib2_Release((ITypeLib2*)This->pTypeLib);
|
ITypeLib2_Release(&This->pTypeLib->ITypeLib2_iface);
|
||||||
if (not_attached_to_typelib)
|
if (not_attached_to_typelib)
|
||||||
heap_free(This);
|
heap_free(This);
|
||||||
/* otherwise This will be freed when typelib is freed */
|
/* otherwise This will be freed when typelib is freed */
|
||||||
|
@ -6191,6 +6193,10 @@ DispCallFunc(
|
||||||
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 - 1, args + 1, &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 - 1, args + 1, &stack_offset );
|
||||||
break;
|
break;
|
||||||
|
@ -6269,6 +6275,10 @@ DispCallFunc(
|
||||||
args[0] = (DWORD_PTR)pvargResult; /* arg 0 is a pointer to the result */
|
args[0] = (DWORD_PTR)pvargResult; /* arg 0 is a pointer to the result */
|
||||||
call_method( func, argspos, args );
|
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 - 1, args + 1 );
|
||||||
break;
|
break;
|
||||||
|
@ -7053,7 +7063,7 @@ static HRESULT WINAPI ITypeInfo_fnGetRefTypeInfo(
|
||||||
} else {
|
} else {
|
||||||
if(ref_type->pImpTLInfo->pImpTypeLib) {
|
if(ref_type->pImpTLInfo->pImpTypeLib) {
|
||||||
TRACE("typeinfo in imported typelib that is already loaded\n");
|
TRACE("typeinfo in imported typelib that is already loaded\n");
|
||||||
pTLib = (ITypeLib*)ref_type->pImpTLInfo->pImpTypeLib;
|
pTLib = (ITypeLib*)&ref_type->pImpTLInfo->pImpTypeLib->ITypeLib2_iface;
|
||||||
ITypeLib_AddRef(pTLib);
|
ITypeLib_AddRef(pTLib);
|
||||||
result = S_OK;
|
result = S_OK;
|
||||||
} else {
|
} else {
|
||||||
|
@ -7838,7 +7848,7 @@ HRESULT WINAPI CreateDispTypeInfo(
|
||||||
*pptinfo = (ITypeInfo*)pTIClass;
|
*pptinfo = (ITypeInfo*)pTIClass;
|
||||||
|
|
||||||
ITypeInfo_AddRef(*pptinfo);
|
ITypeInfo_AddRef(*pptinfo);
|
||||||
ITypeLib_Release((ITypeLib *)&pTypeLibImpl->lpVtbl);
|
ITypeLib2_Release(&pTypeLibImpl->ITypeLib2_iface);
|
||||||
|
|
||||||
return S_OK;
|
return S_OK;
|
||||||
|
|
||||||
|
|
|
@ -597,16 +597,16 @@ WORD typeofarray
|
||||||
#include "poppack.h"
|
#include "poppack.h"
|
||||||
|
|
||||||
/* heap allocation helpers */
|
/* heap allocation helpers */
|
||||||
extern void* heap_alloc_zero(unsigned size);
|
extern void* heap_alloc_zero(unsigned size) DECLSPEC_HIDDEN __WINE_ALLOC_SIZE(1);
|
||||||
extern void* heap_alloc(unsigned size);
|
extern void* heap_alloc(unsigned size) DECLSPEC_HIDDEN __WINE_ALLOC_SIZE(1);
|
||||||
extern void* heap_realloc(void *ptr, unsigned size);
|
extern void* heap_realloc(void *ptr, unsigned size) DECLSPEC_HIDDEN;
|
||||||
extern void heap_free(void *ptr);
|
extern void heap_free(void *ptr) DECLSPEC_HIDDEN;
|
||||||
|
|
||||||
HRESULT ITypeInfoImpl_GetInternalFuncDesc( ITypeInfo *iface, UINT index, const FUNCDESC **ppFuncDesc );
|
HRESULT ITypeInfoImpl_GetInternalFuncDesc( ITypeInfo *iface, UINT index, const FUNCDESC **ppFuncDesc ) DECLSPEC_HIDDEN;
|
||||||
|
|
||||||
extern DWORD _invoke(FARPROC func,CALLCONV callconv, int nrargs, DWORD *args);
|
extern DWORD _invoke(FARPROC func,CALLCONV callconv, int nrargs, DWORD *args) DECLSPEC_HIDDEN;
|
||||||
|
|
||||||
HRESULT TMARSHAL_DllGetClassObject(REFCLSID rclsid, REFIID iid,LPVOID *ppv);
|
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 );
|
||||||
|
|
|
@ -2053,8 +2053,10 @@ static HRESULT WINAPI ICreateTypeInfo2_fnAddFuncDesc(
|
||||||
if(This->dual)
|
if(This->dual)
|
||||||
This->dual->typedata = This->typedata;
|
This->dual->typedata = This->typedata;
|
||||||
} else {
|
} else {
|
||||||
|
unsigned int j;
|
||||||
|
|
||||||
iter = This->typedata->next;
|
iter = This->typedata->next;
|
||||||
for(i=0; i<index; i++)
|
for (j = 0; j < index; j++)
|
||||||
iter = iter->next;
|
iter = iter->next;
|
||||||
|
|
||||||
insert->next = iter->next;
|
insert->next = iter->next;
|
||||||
|
|
|
@ -1911,7 +1911,7 @@ 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, sizeof(fmt_buff)/sizeof(WCHAR)) ||
|
||||||
!GetDateFormatW(lcid, 0, &udate.st, fmt_buff, pBuff,
|
!get_date_format(lcid, 0, &udate.st, fmt_buff, pBuff,
|
||||||
sizeof(buff)/sizeof(WCHAR)-(pBuff-buff)))
|
sizeof(buff)/sizeof(WCHAR)-(pBuff-buff)))
|
||||||
{
|
{
|
||||||
hRes = E_INVALIDARG;
|
hRes = E_INVALIDARG;
|
||||||
|
|
|
@ -48,12 +48,12 @@
|
||||||
#define VTBIT_VARIANT (1 << VT_VARIANT)
|
#define VTBIT_VARIANT (1 << VT_VARIANT)
|
||||||
#define VTBIT_15 (1 << 15) /* no variant type with this number */
|
#define VTBIT_15 (1 << 15) /* no variant type with this number */
|
||||||
|
|
||||||
extern const char * const wine_vtypes[];
|
extern const char * const wine_vtypes[] DECLSPEC_HIDDEN;
|
||||||
#define debugstr_vt(v) (((v)&VT_TYPEMASK) <= VT_CLSID ? wine_vtypes[((v)&VT_TYPEMASK)] : \
|
#define debugstr_vt(v) (((v)&VT_TYPEMASK) <= VT_CLSID ? wine_vtypes[((v)&VT_TYPEMASK)] : \
|
||||||
((v)&VT_TYPEMASK) == VT_BSTR_BLOB ? "VT_BSTR_BLOB": "Invalid")
|
((v)&VT_TYPEMASK) == VT_BSTR_BLOB ? "VT_BSTR_BLOB": "Invalid")
|
||||||
#define debugstr_VT(v) (!(v) ? "(null)" : debugstr_vt(V_TYPE((v))))
|
#define debugstr_VT(v) (!(v) ? "(null)" : debugstr_vt(V_TYPE((v))))
|
||||||
|
|
||||||
extern const char * const wine_vflags[];
|
extern const char * const wine_vflags[] DECLSPEC_HIDDEN;
|
||||||
#define debugstr_vf(v) (wine_vflags[((v)&VT_EXTRA_TYPE)>>12])
|
#define debugstr_vf(v) (wine_vflags[((v)&VT_EXTRA_TYPE)>>12])
|
||||||
#define debugstr_VF(v) (!(v) ? "(null)" : debugstr_vf(V_EXTRA_TYPE(v)))
|
#define debugstr_VF(v) (!(v) ? "(null)" : debugstr_vf(V_EXTRA_TYPE(v)))
|
||||||
|
|
||||||
|
@ -125,5 +125,7 @@ typedef struct tagVARIANT_NUMBER_CHARS
|
||||||
} VARIANT_NUMBER_CHARS;
|
} VARIANT_NUMBER_CHARS;
|
||||||
|
|
||||||
|
|
||||||
BOOL VARIANT_GetLocalisedText(LANGID, DWORD, WCHAR *);
|
BOOL VARIANT_GetLocalisedText(LANGID, DWORD, WCHAR *) DECLSPEC_HIDDEN;
|
||||||
HRESULT VARIANT_ClearInd(VARIANTARG *);
|
HRESULT VARIANT_ClearInd(VARIANTARG *) DECLSPEC_HIDDEN;
|
||||||
|
BOOL get_date_format(LCID, DWORD, const SYSTEMTIME *,
|
||||||
|
const WCHAR *, WCHAR *, int) DECLSPEC_HIDDEN;
|
||||||
|
|
|
@ -6579,6 +6579,120 @@ HRESULT WINAPI VarBstrFromCy(CY cyIn, LCID lcid, ULONG dwFlags, BSTR *pbstrOut)
|
||||||
return *pbstrOut ? S_OK : E_OUTOFMEMORY;
|
return *pbstrOut ? S_OK : E_OUTOFMEMORY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline int output_int_len(int o, int min_len, WCHAR *date, int date_len)
|
||||||
|
{
|
||||||
|
int len, tmp;
|
||||||
|
|
||||||
|
if(min_len >= date_len)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
for(len=0, tmp=o; tmp; tmp/=10) len++;
|
||||||
|
if(!len) len++;
|
||||||
|
if(len >= date_len)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
for(tmp=min_len-len; tmp>0; tmp--)
|
||||||
|
*date++ = '0';
|
||||||
|
for(tmp=len; tmp>0; tmp--, o/=10)
|
||||||
|
date[tmp-1] = '0' + o%10;
|
||||||
|
return min_len>len ? min_len : len;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* format date string, similar to GetDateFormatW function but works on bigger range of dates */
|
||||||
|
BOOL get_date_format(LCID lcid, DWORD flags, const SYSTEMTIME *st,
|
||||||
|
const WCHAR *fmt, WCHAR *date, int date_len)
|
||||||
|
{
|
||||||
|
static const LCTYPE dayname[] = {
|
||||||
|
LOCALE_SDAYNAME7, LOCALE_SDAYNAME1, LOCALE_SDAYNAME2, LOCALE_SDAYNAME3,
|
||||||
|
LOCALE_SDAYNAME4, LOCALE_SDAYNAME5, LOCALE_SDAYNAME6
|
||||||
|
};
|
||||||
|
static const LCTYPE sdayname[] = {
|
||||||
|
LOCALE_SABBREVDAYNAME7, LOCALE_SABBREVDAYNAME1, LOCALE_SABBREVDAYNAME2,
|
||||||
|
LOCALE_SABBREVDAYNAME3, LOCALE_SABBREVDAYNAME4, LOCALE_SABBREVDAYNAME5,
|
||||||
|
LOCALE_SABBREVDAYNAME6
|
||||||
|
};
|
||||||
|
static const LCTYPE monthname[] = {
|
||||||
|
LOCALE_SMONTHNAME1, LOCALE_SMONTHNAME2, LOCALE_SMONTHNAME3, LOCALE_SMONTHNAME4,
|
||||||
|
LOCALE_SMONTHNAME5, LOCALE_SMONTHNAME6, LOCALE_SMONTHNAME7, LOCALE_SMONTHNAME8,
|
||||||
|
LOCALE_SMONTHNAME9, LOCALE_SMONTHNAME10, LOCALE_SMONTHNAME11, LOCALE_SMONTHNAME12
|
||||||
|
};
|
||||||
|
static const LCTYPE smonthname[] = {
|
||||||
|
LOCALE_SABBREVMONTHNAME1, LOCALE_SABBREVMONTHNAME2, LOCALE_SABBREVMONTHNAME3,
|
||||||
|
LOCALE_SABBREVMONTHNAME4, LOCALE_SABBREVMONTHNAME5, LOCALE_SABBREVMONTHNAME6,
|
||||||
|
LOCALE_SABBREVMONTHNAME7, LOCALE_SABBREVMONTHNAME8, LOCALE_SABBREVMONTHNAME9,
|
||||||
|
LOCALE_SABBREVMONTHNAME10, LOCALE_SABBREVMONTHNAME11, LOCALE_SABBREVMONTHNAME12
|
||||||
|
};
|
||||||
|
|
||||||
|
if(flags & ~(LOCALE_NOUSEROVERRIDE|VAR_DATEVALUEONLY))
|
||||||
|
FIXME("ignoring flags %x\n", flags);
|
||||||
|
flags &= LOCALE_NOUSEROVERRIDE;
|
||||||
|
|
||||||
|
while(*fmt && date_len) {
|
||||||
|
int count = 1;
|
||||||
|
|
||||||
|
switch(*fmt) {
|
||||||
|
case 'd':
|
||||||
|
case 'M':
|
||||||
|
case 'y':
|
||||||
|
case 'g':
|
||||||
|
while(*fmt == *(fmt+count))
|
||||||
|
count++;
|
||||||
|
fmt += count-1;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch(*fmt) {
|
||||||
|
case 'd':
|
||||||
|
if(count >= 4)
|
||||||
|
count = GetLocaleInfoW(lcid, dayname[st->wDayOfWeek] | flags, date, date_len)-1;
|
||||||
|
else if(count == 3)
|
||||||
|
count = GetLocaleInfoW(lcid, sdayname[st->wDayOfWeek] | flags, date, date_len)-1;
|
||||||
|
else
|
||||||
|
count = output_int_len(st->wDay, count, date, date_len);
|
||||||
|
break;
|
||||||
|
case 'M':
|
||||||
|
if(count >= 4)
|
||||||
|
count = GetLocaleInfoW(lcid, monthname[st->wMonth-1] | flags, date, date_len)-1;
|
||||||
|
else if(count == 3)
|
||||||
|
count = GetLocaleInfoW(lcid, smonthname[st->wMonth-1] | flags, date, date_len)-1;
|
||||||
|
else
|
||||||
|
count = output_int_len(st->wMonth, count, date, date_len);
|
||||||
|
break;
|
||||||
|
case 'y':
|
||||||
|
if(count >= 3)
|
||||||
|
count = output_int_len(st->wYear, 0, date, date_len);
|
||||||
|
else
|
||||||
|
count = output_int_len(st->wYear%100, count, date, date_len);
|
||||||
|
break;
|
||||||
|
case 'g':
|
||||||
|
if(count == 2) {
|
||||||
|
FIXME("Should be using GetCalendarInfo(CAL_SERASTRING), defaulting to 'AD'\n");
|
||||||
|
|
||||||
|
*date++ = 'A';
|
||||||
|
date_len--;
|
||||||
|
if(date_len)
|
||||||
|
*date = 'D';
|
||||||
|
else
|
||||||
|
count = -1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
/* fall through */
|
||||||
|
default:
|
||||||
|
*date = *fmt;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(count < 0)
|
||||||
|
break;
|
||||||
|
fmt++;
|
||||||
|
date += count;
|
||||||
|
date_len -= count;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!date_len)
|
||||||
|
return FALSE;
|
||||||
|
*date++ = 0;
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* VarBstrFromDate [OLEAUT32.114]
|
* VarBstrFromDate [OLEAUT32.114]
|
||||||
*
|
*
|
||||||
|
@ -6599,7 +6713,7 @@ HRESULT WINAPI VarBstrFromDate(DATE dateIn, LCID lcid, ULONG dwFlags, BSTR* pbst
|
||||||
{
|
{
|
||||||
SYSTEMTIME st;
|
SYSTEMTIME st;
|
||||||
DWORD dwFormatFlags = dwFlags & LOCALE_NOUSEROVERRIDE;
|
DWORD dwFormatFlags = dwFlags & LOCALE_NOUSEROVERRIDE;
|
||||||
WCHAR date[128], *time;
|
WCHAR date[128], fmt_buff[80], *time;
|
||||||
|
|
||||||
TRACE("(%g,0x%08x,0x%08x,%p)\n", dateIn, lcid, dwFlags, pbstrOut);
|
TRACE("(%g,0x%08x,0x%08x,%p)\n", dateIn, lcid, dwFlags, pbstrOut);
|
||||||
|
|
||||||
|
@ -6622,15 +6736,15 @@ HRESULT WINAPI VarBstrFromDate(DATE dateIn, LCID lcid, ULONG dwFlags, BSTR* pbst
|
||||||
|
|
||||||
if (whole == 0.0)
|
if (whole == 0.0)
|
||||||
dwFlags |= VAR_TIMEVALUEONLY;
|
dwFlags |= VAR_TIMEVALUEONLY;
|
||||||
else if (partial < 1e-12)
|
else if (partial > -1e-12 && partial < 1e-12)
|
||||||
dwFlags |= VAR_DATEVALUEONLY;
|
dwFlags |= VAR_DATEVALUEONLY;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dwFlags & VAR_TIMEVALUEONLY)
|
if (dwFlags & VAR_TIMEVALUEONLY)
|
||||||
date[0] = '\0';
|
date[0] = '\0';
|
||||||
else
|
else
|
||||||
if (!GetDateFormatW(lcid, dwFormatFlags|DATE_SHORTDATE, &st, NULL, date,
|
if (!GetLocaleInfoW(lcid, LOCALE_SSHORTDATE, fmt_buff, sizeof(fmt_buff)/sizeof(WCHAR)) ||
|
||||||
sizeof(date)/sizeof(WCHAR)))
|
!get_date_format(lcid, dwFlags, &st, fmt_buff, date, sizeof(date)/sizeof(WCHAR)))
|
||||||
return E_INVALIDARG;
|
return E_INVALIDARG;
|
||||||
|
|
||||||
if (!(dwFlags & VAR_DATEVALUEONLY))
|
if (!(dwFlags & VAR_DATEVALUEONLY))
|
||||||
|
|
|
@ -132,7 +132,7 @@ reactos/dll/win32/odbc32 # Out of sync. Depends on port of Linux ODBC.
|
||||||
reactos/dll/win32/odbccp32 # Synced to Wine-1.5.19
|
reactos/dll/win32/odbccp32 # Synced to Wine-1.5.19
|
||||||
reactos/dll/win32/ole32 # Synced to Wine-1.5.26
|
reactos/dll/win32/ole32 # Synced to Wine-1.5.26
|
||||||
reactos/dll/win32/oleacc # Autosync
|
reactos/dll/win32/oleacc # Autosync
|
||||||
reactos/dll/win32/oleaut32 # Synced to Wine-1.5.19
|
reactos/dll/win32/oleaut32 # Synced to Wine-1.5.26
|
||||||
reactos/dll/win32/olecli32 # Synced to Wine-1.5.19
|
reactos/dll/win32/olecli32 # Synced to Wine-1.5.19
|
||||||
reactos/dll/win32/oledlg # Autosync
|
reactos/dll/win32/oledlg # Autosync
|
||||||
reactos/dll/win32/olepro32 # Autosync
|
reactos/dll/win32/olepro32 # Autosync
|
||||||
|
|
Loading…
Reference in a new issue