Author: cwittich Date: Sun Sep 14 00:15:39 2008 New Revision: 36210
URL: http://svn.reactos.org/svn/reactos?rev=36210&view=rev Log: sync oleaut32 to wine 1.1.4
Added: trunk/reactos/dll/win32/oleaut32/oleaut32_Zh.rc (with props) trunk/reactos/dll/win32/oleaut32/oleaut32_ocidl.idl (with props) Modified: trunk/reactos/dll/win32/oleaut32/hash.c trunk/reactos/dll/win32/oleaut32/oleaut.c trunk/reactos/dll/win32/oleaut32/oleaut32.rbuild trunk/reactos/dll/win32/oleaut32/oleaut32.rc trunk/reactos/dll/win32/oleaut32/olepicture.c trunk/reactos/dll/win32/oleaut32/safearray.c trunk/reactos/dll/win32/oleaut32/typelib.c trunk/reactos/dll/win32/oleaut32/typelib.spec trunk/reactos/dll/win32/oleaut32/typelib2.c trunk/reactos/dll/win32/oleaut32/usrmarshal.c trunk/reactos/dll/win32/oleaut32/varformat.c trunk/reactos/dll/win32/oleaut32/variant.c trunk/reactos/dll/win32/oleaut32/vartype.c trunk/reactos/dll/win32/oleaut32/version.rc
Modified: trunk/reactos/dll/win32/oleaut32/hash.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oleaut32/hash.c?r... ============================================================================== --- trunk/reactos/dll/win32/oleaut32/hash.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/oleaut32/hash.c [iso-8859-1] Sun Sep 14 00:15:39 2008 @@ -486,6 +486,7 @@
/*********************************************************************** * LHashValOfNameSysA (OLEAUT32.166) + * LHashValOfNameSys (TYPELIB.4) * * Produce a string hash value. *
Modified: trunk/reactos/dll/win32/oleaut32/oleaut.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oleaut32/oleaut.c... ============================================================================== --- trunk/reactos/dll/win32/oleaut32/oleaut.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/oleaut32/oleaut.c [iso-8859-1] Sun Sep 14 00:15:39 2008 @@ -807,8 +807,7 @@ return S_OK; /*FALLTHROUGH*/ } - FIXME("\n\tCLSID:\t%s,\n\tIID:\t%s\n",debugstr_guid(rclsid),debugstr_guid(iid)); - return CLASS_E_CLASSNOTAVAILABLE; + return OLEAUTPS_DllGetClassObject(rclsid, iid, ppv); }
/***********************************************************************
Modified: trunk/reactos/dll/win32/oleaut32/oleaut32.rbuild URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oleaut32/oleaut32... ============================================================================== --- trunk/reactos/dll/win32/oleaut32/oleaut32.rbuild [iso-8859-1] (original) +++ trunk/reactos/dll/win32/oleaut32/oleaut32.rbuild [iso-8859-1] Sun Sep 14 00:15:39 2008 @@ -31,7 +31,7 @@ <file>oleaut32_oaidl.idl</file> <include base="oleaut32" root="intermediate">.</include> <file>oleaut32.spec</file> - <library>oleaut32_oleaut32_oaidl_proxy</library> + <library>oleaut32_proxy</library> <library>wine</library> <library>ole32</library> <library>rpcrt4</library> @@ -45,7 +45,8 @@ <library>uuid</library> <library>pseh</library> </module> -<module name="oleaut32_oleaut32_oaidl_proxy" type="rpcproxy" allowwarnings="true"> +<module name="oleaut32_proxy" type="rpcproxy" allowwarnings="true"> <file>oleaut32_oaidl.idl</file> + <file>oleaut32_ocidl.idl</file> </module> </group>
Modified: trunk/reactos/dll/win32/oleaut32/oleaut32.rc URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oleaut32/oleaut32... ============================================================================== --- trunk/reactos/dll/win32/oleaut32/oleaut32.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/oleaut32/oleaut32.rc [iso-8859-1] Sun Sep 14 00:15:39 2008 @@ -47,6 +47,7 @@ #include "oleaut32_Sv.rc" #include "oleaut32_Th.rc" #include "oleaut32_Tr.rc" +#include "oleaut32_Zh.rc" #include "oleaut32_Uk.rc"
/*
Added: trunk/reactos/dll/win32/oleaut32/oleaut32_Zh.rc URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oleaut32/oleaut32... ============================================================================== --- trunk/reactos/dll/win32/oleaut32/oleaut32_Zh.rc (added) +++ trunk/reactos/dll/win32/oleaut32/oleaut32_Zh.rc [iso-8859-1] Sun Sep 14 00:15:39 2008 @@ -1,0 +1,48 @@ +/* + * oleaut32 (Simplified and Traditional Chinese Resources) + * + * Copyright 2008 Hongbo Ni <hongbo.at.njstar.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +/* Chinese text is encoded in UTF-8 */ +#pragma code_page(65001) + +LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED + +STRINGTABLE DISCARDABLE +{ + IDS_TRUE "ç" + IDS_FALSE "å" + IDS_YES "æ¯" + IDS_NO "å¦" + IDS_ON "å¼" + IDS_OFF "å ³" +} + +LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_TRADITIONAL + +STRINGTABLE DISCARDABLE +{ + IDS_TRUE "ç" + IDS_FALSE "å" + IDS_YES "æ¯" + IDS_NO "å¦" + IDS_ON "é" + IDS_OFF "é" +} + +#pragma code_page(default)
Propchange: trunk/reactos/dll/win32/oleaut32/oleaut32_Zh.rc ------------------------------------------------------------------------------ svn:eol-style = native
Added: trunk/reactos/dll/win32/oleaut32/oleaut32_ocidl.idl URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oleaut32/oleaut32... ============================================================================== --- trunk/reactos/dll/win32/oleaut32/oleaut32_ocidl.idl (added) +++ trunk/reactos/dll/win32/oleaut32/oleaut32_ocidl.idl [iso-8859-1] Sun Sep 14 00:15:39 2008 @@ -1,0 +1,20 @@ +/* + * Copyright 2007 Google (Dan Hipschman) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +cpp_quote("#include <winuser.h>") +#include "ocidl.idl"
Propchange: trunk/reactos/dll/win32/oleaut32/oleaut32_ocidl.idl ------------------------------------------------------------------------------ svn:eol-style = native
Modified: trunk/reactos/dll/win32/oleaut32/olepicture.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oleaut32/olepictu... ============================================================================== --- trunk/reactos/dll/win32/oleaut32/olepicture.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/oleaut32/olepicture.c [iso-8859-1] Sun Sep 14 00:15:39 2008 @@ -1365,6 +1365,8 @@ DIB_RGB_COLORS ); DeleteDC(hdcref); + if (This->desc.u.bmp.hbitmap == 0) + return E_FAIL; This->desc.picType = PICTYPE_BITMAP; OLEPictureImpl_SetBitmap(This); return S_OK; @@ -1845,7 +1847,7 @@ TRACE("Reading all data from stream.\n"); xbuf = HeapAlloc (GetProcessHeap(), HEAP_ZERO_MEMORY, origsize); if (headerisdata) - memcpy (xbuf, &header, 8); + memcpy (xbuf, header, 8); while (1) { while (xread < origsize) { hr = IStream_Read(pStm,xbuf+xread,origsize-xread,&nread); @@ -1869,9 +1871,11 @@ } else { This->datalen = toread+(headerisdata?8:0); xbuf = This->data = HeapAlloc (GetProcessHeap(), HEAP_ZERO_MEMORY, This->datalen); + if (!xbuf) + return E_OUTOFMEMORY;
if (headerisdata) - memcpy (xbuf, &header, 8); + memcpy (xbuf, header, 8);
while (xread < This->datalen) { ULONG nread; @@ -1927,7 +1931,7 @@ FIXME("Unknown magic %04x, %d read bytes:\n",magic,xread); hr=E_FAIL; for (i=0;i<xread+8;i++) { - if (i<8) MESSAGE("%02x ",((unsigned char*)&header)[i]); + if (i<8) MESSAGE("%02x ",((unsigned char*)header)[i]); else MESSAGE("%02x ",xbuf[i-8]); if (i % 10 == 9) MESSAGE("\n"); } @@ -2644,8 +2648,15 @@ *ppvObj = NULL; return hr; } - IPersistStream_Load(ps,lpstream); + hr = IPersistStream_Load(ps,lpstream); IPersistStream_Release(ps); + if (FAILED(hr)) + { + ERR("IPersistStream_Load failed\n"); + IPicture_Release(newpic); + *ppvObj = NULL; + return hr; + } hr = IPicture_QueryInterface(newpic,riid,ppvObj); if (hr) FIXME("Failed to get interface %s from IPicture.\n",debugstr_guid(riid));
Modified: trunk/reactos/dll/win32/oleaut32/safearray.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oleaut32/safearra... ============================================================================== --- trunk/reactos/dll/win32/oleaut32/safearray.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/oleaut32/safearray.c [iso-8859-1] Sun Sep 14 00:15:39 2008 @@ -1500,6 +1500,8 @@
if (psa->fFeatures & FADF_RECORD) *pvt = VT_RECORD; + else if ((psa->fFeatures & (FADF_HAVEIID|FADF_DISPATCH)) == (FADF_HAVEIID|FADF_DISPATCH)) + *pvt = VT_DISPATCH; else if (psa->fFeatures & FADF_HAVEIID) *pvt = VT_UNKNOWN; else if (psa->fFeatures & FADF_HAVEVARTYPE)
Modified: trunk/reactos/dll/win32/oleaut32/typelib.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oleaut32/typelib.... ============================================================================== --- trunk/reactos/dll/win32/oleaut32/typelib.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/oleaut32/typelib.c [iso-8859-1] Sun Sep 14 00:15:39 2008 @@ -1357,6 +1357,8 @@ { DebugBreak(); } + +static void * TLB_Alloc(unsigned size) __WINE_ALLOC_SIZE(1); static void * TLB_Alloc(unsigned size) { void * ret; @@ -1434,6 +1436,18 @@ pCustDataNext = pCustData->next; TLB_Free(pCustData); } +} + +static BSTR TLB_MultiByteToBSTR(const char *ptr) +{ + DWORD len; + BSTR ret; + + len = MultiByteToWideChar(CP_ACP, 0, ptr, -1, NULL, 0); + ret = SysAllocStringLen(NULL, len - 1); + if (!ret) return ret; + MultiByteToWideChar(CP_ACP, 0, ptr, -1, ret, len); + return ret; }
/********************************************************************** @@ -2699,7 +2713,6 @@ while(offset < tlbSegDir.pImpFiles.offset +tlbSegDir.pImpFiles.length) { char *name; - DWORD len;
*ppImpLib = TLB_Alloc(sizeof(TLBImpLib)); (*ppImpLib)->offset = offset - tlbSegDir.pImpFiles.offset; @@ -2713,10 +2726,7 @@ size >>= 2; name = TLB_Alloc(size+1); MSFT_Read(name, size, &cx, DO_NOT_SEEK); - len = MultiByteToWideChar(CP_ACP, 0, name, -1, NULL, 0 ); - (*ppImpLib)->name = TLB_Alloc(len * sizeof(WCHAR)); - MultiByteToWideChar(CP_ACP, 0, name, -1, (*ppImpLib)->name, len ); - TLB_Free(name); + (*ppImpLib)->name = TLB_MultiByteToBSTR(name);
MSFT_ReadGuid(&(*ppImpLib)->guid, oGuid, &cx); offset = (offset + sizeof(INT) + sizeof(DWORD) + sizeof(LCID) + sizeof(UINT16) + size + 3) & ~3; @@ -2749,20 +2759,6 @@ return (ITypeLib2*) pTypeLibImpl; }
- -static BSTR TLB_MultiByteToBSTR(const char *ptr) -{ - DWORD len; - WCHAR *nameW; - BSTR ret; - - len = MultiByteToWideChar(CP_ACP, 0, ptr, -1, NULL, 0); - nameW = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); - MultiByteToWideChar(CP_ACP, 0, ptr, -1, nameW, len); - ret = SysAllocString(nameW); - HeapFree(GetProcessHeap(), 0, nameW); - return ret; -}
static BOOL TLB_GUIDFromString(const char *str, GUID *guid) { @@ -2790,16 +2786,14 @@ { WORD bytelen; DWORD len; - WCHAR *nameW;
*pBstr = NULL; bytelen = *(const WORD*)ptr; if(bytelen == 0xffff) return 2; len = MultiByteToWideChar(CP_ACP, 0, ptr + 2, bytelen, NULL, 0); - nameW = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); - len = MultiByteToWideChar(CP_ACP, 0, ptr + 2, bytelen, nameW, len); - *pBstr = SysAllocStringLen(nameW, len); - HeapFree(GetProcessHeap(), 0, nameW); + *pBstr = SysAllocStringLen(NULL, len - 1); + if (*pBstr) + len = MultiByteToWideChar(CP_ACP, 0, ptr + 2, bytelen, *pBstr, len); return bytelen + 2; }
@@ -2882,7 +2876,7 @@ return S_OK; }
- ERR("Unable to find reference\n"); + ERR_(typelib)("Unable to find reference\n"); *typelib_ref = -1; return E_FAIL; } @@ -2989,7 +2983,7 @@ FIXME("Ref magic = %x\n", pRef->magic); return NULL; } - name = ( (char*)(&pRef->names) + pRef->number); + name = ( (char*)pRef->names + pRef->number);
table = HeapAlloc(GetProcessHeap(), 0, sizeof(*table) + ((pRef->number >> 3) - 1) * sizeof(table->refs[0])); table->num = pRef->number >> 3; @@ -3007,7 +3001,7 @@
name += SLTG_ReadStringA(name, &refname); if(sscanf(refname, "*\R%x*#%x", &lib_offs, &type_num) != 2) - FIXME("Can't sscanf ref\n"); + FIXME_(typelib)("Can't sscanf ref\n"); if(lib_offs != 0xffff) { TLBImpLib **import = &pTL->pImpLibs;
@@ -3029,7 +3023,7 @@ &(*import)->wVersionMajor, &(*import)->wVersionMinor, &(*import)->lcid, fname) != 4) { - FIXME("can't sscanf ref %s\n", + FIXME_(typelib)("can't sscanf ref %s\n", pNameTable + lib_offs + 40); } len = strlen(fname); @@ -3057,7 +3051,7 @@ typelib_ref += 4; } if((BYTE)*name != SLTG_REF_MAGIC) - FIXME("End of ref block magic = %x\n", *name); + FIXME_(typelib)("End of ref block magic = %x\n", *name); dump_TLBRefType(pTL); return table; } @@ -3086,7 +3080,7 @@ if(info->next == 0xffff) break; if(OneOnly) - FIXME("Interface inheriting more than one interface\n"); + FIXME_(typelib)("Interface inheriting more than one interface\n"); info = (SLTG_ImplInfo*)(pBlk + info->next); } info++; /* see comment at top of function */ @@ -3134,6 +3128,12 @@
SLTG_DoElem(pType, pBlk, &(*ppVarDesc)->vardesc.elemdescVar, ref_lookup); + + if (TRACE_ON(typelib)) { + char buf[300]; + dump_TypeDesc(&(*ppVarDesc)->vardesc.elemdescVar.tdesc, buf); + TRACE_(typelib)("elemdescVar: %s\n", buf); + }
if (pItem->flags & 0x40) { TRACE_(typelib)("VAR_DISPATCH\n"); @@ -3155,9 +3155,15 @@ case VT_BSTR: { WORD len = *(WORD *)(pBlk + pItem->byte_offs); - INT alloc_len = MultiByteToWideChar(CP_ACP, 0, pBlk + pItem->byte_offs + 2, len, NULL, 0); - BSTR str = SysAllocStringLen(NULL, alloc_len); - MultiByteToWideChar(CP_ACP, 0, pBlk + pItem->byte_offs + 2, len, str, alloc_len); + BSTR str; + TRACE_(typelib)("len = %u\n", len); + if (len == 0xffff) { + str = NULL; + } else { + INT alloc_len = MultiByteToWideChar(CP_ACP, 0, pBlk + pItem->byte_offs + 2, len, NULL, 0); + str = SysAllocStringLen(NULL, alloc_len); + MultiByteToWideChar(CP_ACP, 0, pBlk + pItem->byte_offs + 2, len, str, alloc_len); + } V_VT((*ppVarDesc)->vardesc.u.lpvarValue) = VT_BSTR; V_BSTR((*ppVarDesc)->vardesc.u.lpvarValue) = str; break; @@ -3170,7 +3176,7 @@ *(INT*)(pBlk + pItem->byte_offs); break; default: - FIXME("VAR_CONST unimplemented for type %d\n", (*ppVarDesc)->vardesc.elemdescVar.tdesc.vt); + FIXME_(typelib)("VAR_CONST unimplemented for type %d\n", (*ppVarDesc)->vardesc.elemdescVar.tdesc.vt); } } } @@ -3185,12 +3191,6 @@
if (pItem->flags & 0x80) (*ppVarDesc)->vardesc.wVarFlags |= VARFLAG_FREADONLY; - - if (TRACE_ON(typelib)) { - char buf[300]; - dump_TypeDesc(&(*ppVarDesc)->vardesc.elemdescVar.tdesc, buf); - TRACE_(typelib)("elemdescVar: %s\n", buf); - }
bstrPrevName = (*ppVarDesc)->Name; ppVarDesc = &((*ppVarDesc)->next); @@ -3302,6 +3302,9 @@ if(paramName) { (*ppFuncDesc)->pParamDesc[param].Name = TLB_MultiByteToBSTR(paramName); + } else { + (*ppFuncDesc)->pParamDesc[param].Name = + SysAllocString((*ppFuncDesc)->Name); } }
@@ -3439,6 +3442,8 @@ if (pTITail->funcs_off != 0xffff) SLTG_DoFuncs(pBlk, pBlk + pTITail->funcs_off, pTI, pTITail->cFuncs, pNameTable, ref_lookup); HeapFree(GetProcessHeap(), 0, ref_lookup); + if (TRACE_ON(typelib)) + dump_TypeInfo(pTI); }
/* Because SLTG_OtherTypeInfo is such a painful struct, we make a more @@ -3491,7 +3496,7 @@ TRACE_(typelib)("\tmagic=0x%08x, file blocks = %d\n", pHeader->SLTG_magic, pHeader->nrOfFileBlks ); if (pHeader->SLTG_magic != SLTG_SIGNATURE) { - FIXME("Header type magic 0x%08x not supported.\n", + FIXME_(typelib)("Header type magic 0x%08x not supported.\n", pHeader->SLTG_magic); return NULL; } @@ -3508,12 +3513,12 @@ /* Let's see if we're still in sync */ if(memcmp(pMagic->CompObj_magic, SLTG_COMPOBJ_MAGIC, sizeof(SLTG_COMPOBJ_MAGIC))) { - FIXME("CompObj magic = %s\n", pMagic->CompObj_magic); + FIXME_(typelib)("CompObj magic = %s\n", pMagic->CompObj_magic); return NULL; } if(memcmp(pMagic->dir_magic, SLTG_DIR_MAGIC, sizeof(SLTG_DIR_MAGIC))) { - FIXME("dir magic = %s\n", pMagic->dir_magic); + FIXME_(typelib)("dir magic = %s\n", pMagic->dir_magic); return NULL; }
@@ -3607,7 +3612,7 @@ pNameTable += 0x20; break; default: - FIXME("pNameTable jump = %x\n", *(WORD*)pNameTable); + FIXME_(typelib)("pNameTable jump = %x\n", *(WORD*)pNameTable); break; }
@@ -3615,7 +3620,7 @@
pNameTable += 2;
- TRACE("Library name is %s\n", pNameTable + pLibBlk->name); + TRACE_(typelib)("Library name is %s\n", pNameTable + pLibBlk->name);
pTypeLibImpl->Name = TLB_MultiByteToBSTR(pNameTable + pLibBlk->name);
@@ -3637,16 +3642,17 @@
if(strcmp(pBlkEntry[order].index_string + (char*)pMagic, pOtherTypeInfoBlks[i].index_name)) { - FIXME("Index strings don't match\n"); + FIXME_(typelib)("Index strings don't match\n"); return NULL; }
pTIHeader = pBlk; if(pTIHeader->magic != SLTG_TIHEADER_MAGIC) { - FIXME("TypeInfoHeader magic = %04x\n", pTIHeader->magic); + FIXME_(typelib)("TypeInfoHeader magic = %04x\n", pTIHeader->magic); return NULL; } - TRACE("pTIHeader->res06 = %x, pTIHeader->res0e = %x, pTIHeader->res16 = %x, pTIHeader->res1e = %x\n", + TRACE_(typelib)("pTIHeader->res06 = %x, pTIHeader->res0e = %x, " + "pTIHeader->res16 = %x, pTIHeader->res1e = %x\n", pTIHeader->res06, pTIHeader->res0e, pTIHeader->res16, pTIHeader->res1e);
*ppTypeInfoImpl = (ITypeInfoImpl*)ITypeInfo_Constructor(); @@ -3664,11 +3670,11 @@ (pTIHeader->typeflags1 >> 3) | (pTIHeader->typeflags2 << 5);
if((pTIHeader->typeflags1 & 7) != 2) - FIXME("typeflags1 = %02x\n", pTIHeader->typeflags1); + FIXME_(typelib)("typeflags1 = %02x\n", pTIHeader->typeflags1); if(pTIHeader->typeflags3 != 2) - FIXME("typeflags3 = %02x\n", pTIHeader->typeflags3); - - TRACE("TypeInfo %s of kind %s guid %s typeflags %04x\n", + FIXME_(typelib)("typeflags3 = %02x\n", pTIHeader->typeflags3); + + TRACE_(typelib)("TypeInfo %s of kind %s guid %s typeflags %04x\n", debugstr_w((*ppTypeInfoImpl)->Name), typekind_desc[pTIHeader->typekind], debugstr_guid(&(*ppTypeInfoImpl)->TypeAttr.guid), @@ -3867,7 +3873,7 @@ { if (pImpLib->pImpTypeLib) ITypeLib_Release((ITypeLib *)pImpLib->pImpTypeLib); - TLB_Free(pImpLib->name); + SysFreeString(pImpLib->name);
pImpLibNext = pImpLib->next; TLB_Free(pImpLib);
Modified: trunk/reactos/dll/win32/oleaut32/typelib.spec URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oleaut32/typelib.... ============================================================================== --- trunk/reactos/dll/win32/oleaut32/typelib.spec [iso-8859-1] (original) +++ trunk/reactos/dll/win32/oleaut32/typelib.spec [iso-8859-1] Sun Sep 14 00:15:39 2008 @@ -1,6 +1,6 @@ 2 stub CREATETYPELIB 3 pascal LoadTypeLib(ptr ptr) LoadTypeLib16 -4 stub LHASHVALOFNAMESYS +4 pascal LHashValOfNameSys(word long str) LHashValOfNameSysA 5 stub _IID_ICREATETYPEINFO 6 stub _IID_ICREATETYPELIB 7 stub _IID_ITYPECOMP
Modified: trunk/reactos/dll/win32/oleaut32/typelib2.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oleaut32/typelib2... ============================================================================== --- trunk/reactos/dll/win32/oleaut32/typelib2.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/oleaut32/typelib2.c [iso-8859-1] Sun Sep 14 00:15:39 2008 @@ -152,6 +152,7 @@ WCHAR *filename;
MSFT_Header typelib_header; + INT helpStringDll; MSFT_pSeg typelib_segdir[MSFT_SEG_MAX]; char *typelib_segment_data[MSFT_SEG_MAX]; int typelib_segment_block_length[MSFT_SEG_MAX]; @@ -231,6 +232,7 @@ This->typelib_header.res48 = 0x80; This->typelib_header.dispatchpos = -1; This->typelib_header.nimpinfos = 0; + This->helpStringDll = -1; }
/**************************************************************************** @@ -726,7 +728,7 @@ importfile->guid = guidoffset; importfile->lcid = This->typelib_header.lcid2; importfile->version = major_version | (minor_version << 16); - memcpy(&importfile->filename, encoded_string, length); + memcpy(importfile->filename, encoded_string, length);
return offset; } @@ -3331,8 +3333,10 @@ ctl2_finalize_typeinfos(This, filepos);
if (!ctl2_write_chunk(hFile, &This->typelib_header, sizeof(This->typelib_header))) return retval; + if (This->typelib_header.varflags & HELPDLLFLAG) + if (!ctl2_write_chunk(hFile, &This->helpStringDll, sizeof(This->helpStringDll))) return retval; if (!ctl2_write_chunk(hFile, This->typelib_typeinfo_offsets, This->typelib_header.nrtypeinfos * 4)) return retval; - if (!ctl2_write_chunk(hFile, &This->typelib_segdir, sizeof(This->typelib_segdir))) return retval; + if (!ctl2_write_chunk(hFile, This->typelib_segdir, sizeof(This->typelib_segdir))) return retval; if (!ctl2_write_segment(This, hFile, MSFT_SEG_TYPEINFO )) return retval; if (!ctl2_write_segment(This, hFile, MSFT_SEG_GUIDHASH )) return retval; if (!ctl2_write_segment(This, hFile, MSFT_SEG_GUID )) return retval; @@ -3401,35 +3405,56 @@ * * Sets a context number for the library help string. * - * RETURNS - * + * PARAMS + * iface [I] The type library to set the help string context for. + * dwContext [I] The help string context. + * + * RETURNS * Success: S_OK * Failure: E_OUTOFMEMORY or E_INVALIDARG. */ -static HRESULT WINAPI ICreateTypeLib2_fnSetHelpStringContext( - ICreateTypeLib2 * iface, /* [I] The type library to set the help string context for. */ - ULONG dwHelpStringContext) /* [I] The help string context. */ -{ - FIXME("(%p,%d), stub!\n", iface, dwHelpStringContext); - return E_OUTOFMEMORY; +static +HRESULT WINAPI ICreateTypeLib2_fnSetHelpStringContext(ICreateTypeLib2 * iface, + ULONG dwContext) +{ + ICreateTypeLib2Impl *This = (ICreateTypeLib2Impl *)iface; + + TRACE("(%p,%d)\n", iface, dwContext); + + This->typelib_header.helpstringcontext = dwContext; + return S_OK; }
/****************************************************************************** * ICreateTypeLib2_SetHelpStringDll {OLEAUT32} * - * Sets the DLL used to look up localized help strings. - * - * RETURNS - * + * Set the DLL used to look up localized help strings. + * + * PARAMS + * iface [I] The type library to set the help DLL for. + * szDllName [I] The name of the help DLL. + * + * RETURNS * Success: S_OK * Failure: E_OUTOFMEMORY or E_INVALIDARG. */ -static HRESULT WINAPI ICreateTypeLib2_fnSetHelpStringDll( - ICreateTypeLib2 * iface, /* [I] The type library to set the help DLL for. */ - LPOLESTR szFileName) /* [I] The name of the help DLL. */ -{ - FIXME("(%p,%s), stub!\n", iface, debugstr_w(szFileName)); - return E_OUTOFMEMORY; +static +HRESULT WINAPI ICreateTypeLib2_fnSetHelpStringDll(ICreateTypeLib2 * iface, + LPOLESTR szDllName) +{ + ICreateTypeLib2Impl *This = (ICreateTypeLib2Impl *)iface; + int offset; + + TRACE("(%p,%s)\n", iface, debugstr_w(szDllName)); + if (!szDllName) + return E_INVALIDARG; + + offset = ctl2_alloc_string(This, szDllName); + if (offset == -1) + return E_OUTOFMEMORY; + This->typelib_header.varflags |= HELPDLLFLAG; + This->helpStringDll = offset; + return S_OK; }
/*================== ITypeLib2 Implementation ===================================*/
Modified: trunk/reactos/dll/win32/oleaut32/usrmarshal.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oleaut32/usrmarsh... ============================================================================== --- trunk/reactos/dll/win32/oleaut32/usrmarshal.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/oleaut32/usrmarshal.c [iso-8859-1] Sun Sep 14 00:15:39 2008 @@ -36,6 +36,7 @@ #include "oleauto.h" #include "rpcproxy.h" #include "typelib.h" +#include "ocidl.h" #include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(ole); @@ -50,9 +51,11 @@ CSTDSTUBBUFFERRELEASE(&PSFactoryBuffer)
extern const ExtendedProxyFileInfo oleaut32_oaidl_ProxyFileInfo; +extern const ExtendedProxyFileInfo oleaut32_ocidl_ProxyFileInfo;
static const ProxyFileInfo *OLEAUT32_ProxyFileList[] = { &oleaut32_oaidl_ProxyFileInfo, + &oleaut32_ocidl_ProxyFileInfo, NULL };
@@ -1128,6 +1131,32 @@ SafeArrayDestroy(*ppsa); }
+ +ULONG WINAPI HFONT_UserSize(ULONG *pFlags, ULONG Start, HFONT *phfont) +{ + FIXME(":stub\n"); + return 0; +} + +unsigned char * WINAPI HFONT_UserMarshal(ULONG *pFlags, unsigned char *Buffer, HFONT *phfont) +{ + FIXME(":stub\n"); + return NULL; +} + +unsigned char * WINAPI HFONT_UserUnmarshal(ULONG *pFlags, unsigned char *Buffer, HFONT *phfont) +{ + FIXME(":stub\n"); + return NULL; +} + +void WINAPI HFONT_UserFree(ULONG *pFlags, HFONT *phfont) +{ + FIXME(":stub\n"); + return; +} + + /* IDispatch */ /* exactly how Invoke is marshalled is not very clear to me yet, * but the way I've done it seems to work for me */ @@ -2029,3 +2058,158 @@ FIXME("not implemented\n"); return E_FAIL; } + +/* call_as/local stubs for ocidl.idl */ + +HRESULT CALLBACK IClassFactory2_CreateInstanceLic_Proxy( + IClassFactory2* This, + IUnknown *pUnkOuter, + IUnknown *pUnkReserved, + REFIID riid, + BSTR bstrKey, + PVOID *ppvObj) +{ + FIXME("not implemented\n"); + return E_NOTIMPL; +} + +HRESULT __RPC_STUB IClassFactory2_CreateInstanceLic_Stub( + IClassFactory2* This, + REFIID riid, + BSTR bstrKey, + IUnknown **ppvObj) +{ + FIXME("not implemented\n"); + return E_NOTIMPL; +} + +HRESULT CALLBACK IEnumConnections_Next_Proxy( + IEnumConnections* This, + ULONG cConnections, + LPCONNECTDATA rgcd, + ULONG *pcFetched) +{ + FIXME("not implemented\n"); + return E_NOTIMPL; +} + +HRESULT __RPC_STUB IEnumConnections_Next_Stub( + IEnumConnections* This, + ULONG cConnections, + LPCONNECTDATA rgcd, + ULONG *pcFetched) +{ + FIXME("not implemented\n"); + return E_NOTIMPL; +} + +HRESULT CALLBACK IEnumConnectionPoints_Next_Proxy( + IEnumConnectionPoints* This, + ULONG cConnections, + LPCONNECTIONPOINT *ppCP, + ULONG *pcFetched) +{ + FIXME("not implemented\n"); + return E_NOTIMPL; +} + +HRESULT __RPC_STUB IEnumConnectionPoints_Next_Stub( + IEnumConnectionPoints* This, + ULONG cConnections, + LPCONNECTIONPOINT *ppCP, + ULONG *pcFetched) +{ + FIXME("not implemented\n"); + return E_NOTIMPL; +} + +HRESULT CALLBACK IPersistMemory_Load_Proxy( + IPersistMemory* This, + LPVOID pMem, + ULONG cbSize) +{ + FIXME("not implemented\n"); + return E_NOTIMPL; +} + +HRESULT __RPC_STUB IPersistMemory_Load_Stub( + IPersistMemory* This, + BYTE *pMem, + ULONG cbSize) +{ + FIXME("not implemented\n"); + return E_NOTIMPL; +} + +HRESULT CALLBACK IPersistMemory_Save_Proxy( + IPersistMemory* This, + LPVOID pMem, + BOOL fClearDirty, + ULONG cbSize) +{ + FIXME("not implemented\n"); + return E_NOTIMPL; +} + +HRESULT __RPC_STUB IPersistMemory_Save_Stub( + IPersistMemory* This, + BYTE *pMem, + BOOL fClearDirty, + ULONG cbSize) +{ + FIXME("not implemented\n"); + return E_NOTIMPL; +} + +void CALLBACK IAdviseSinkEx_OnViewStatusChange_Proxy( + IAdviseSinkEx* This, + DWORD dwViewStatus) +{ + FIXME("not implemented\n"); +} + +HRESULT __RPC_STUB IAdviseSinkEx_OnViewStatusChange_Stub( + IAdviseSinkEx* This, + DWORD dwViewStatus) +{ + FIXME("not implemented\n"); + return E_NOTIMPL; +} + +HRESULT CALLBACK IEnumOleUndoUnits_Next_Proxy( + IEnumOleUndoUnits* This, + ULONG cElt, + IOleUndoUnit **rgElt, + ULONG *pcEltFetched) +{ + FIXME("not implemented\n"); + return E_NOTIMPL; +} + +HRESULT __RPC_STUB IEnumOleUndoUnits_Next_Stub( + IEnumOleUndoUnits* This, + ULONG cElt, + IOleUndoUnit **rgElt, + ULONG *pcEltFetched) +{ + FIXME("not implemented\n"); + return E_NOTIMPL; +} + +HRESULT CALLBACK IQuickActivate_QuickActivate_Proxy( + IQuickActivate* This, + QACONTAINER *pQaContainer, + QACONTROL *pQaControl) +{ + FIXME("not implemented\n"); + return E_NOTIMPL; +} + +HRESULT __RPC_STUB IQuickActivate_QuickActivate_Stub( + IQuickActivate* This, + QACONTAINER *pQaContainer, + QACONTROL *pQaControl) +{ + FIXME("not implemented\n"); + return E_NOTIMPL; +}
Modified: trunk/reactos/dll/win32/oleaut32/varformat.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oleaut32/varforma... ============================================================================== --- trunk/reactos/dll/win32/oleaut32/varformat.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/oleaut32/varformat.c [iso-8859-1] Sun Sep 14 00:15:39 2008 @@ -1,6 +1,7 @@ /* * Variant formatting functions * + * Copyright 2008 Damjan Jovanovic * Copyright 2003 Jon Griffiths * * This library is free software; you can redistribute it and/or @@ -1181,6 +1182,7 @@ /* Number formatting state flags */ #define NUM_WROTE_DEC 0x01 /* Written the decimal separator */ #define NUM_WRITE_ON 0x02 /* Started to write the number */ +#define NUM_WROTE_SIGN 0x04 /* Written the negative sign */
/* Format a variant using a number format */ static HRESULT VARIANT_FormatNumber(LPVARIANT pVarIn, LPOLESTR lpszFormat, @@ -1191,6 +1193,7 @@ NUMPARSE np; int have_int, need_int = 0, have_frac, need_frac, exponent = 0, pad = 0; WCHAR buff[256], *pBuff = buff; + WCHAR thousandSeparator[32]; VARIANT vString, vBool; DWORD dwState = 0; FMT_HEADER *header = (FMT_HEADER*)rgbTok; @@ -1313,6 +1316,16 @@ have_int, need_int, have_frac, need_frac, pad, exponent); }
+ if (numHeader->flags & FMT_FLAG_THOUSANDS) + { + if (!GetLocaleInfoW(lcid, LOCALE_STHOUSAND, thousandSeparator, + sizeof(thousandSeparator)/sizeof(WCHAR))) + { + thousandSeparator[0] = ','; + thousandSeparator[1] = 0; + } + } + pToken = (const BYTE*)numHeader + sizeof(FMT_NUMBER_HEADER); prgbDig = rgbDig;
@@ -1320,6 +1333,7 @@ { WCHAR defaultChar = '?'; DWORD boolFlag, localeValue = 0; + BOOL shouldAdvance = TRUE;
if (pToken - rgbTok > header->size) { @@ -1377,6 +1391,16 @@ break;
case FMT_NUM_DECIMAL: + if ((np.dwOutFlags & NUMPRS_NEG) && !(dwState & NUM_WROTE_SIGN)) + { + /* last chance for a negative sign in the .# case */ + TRACE("write negative sign\n"); + localeValue = LOCALE_SNEGATIVESIGN; + defaultChar = '-'; + dwState |= NUM_WROTE_SIGN; + shouldAdvance = FALSE; + break; + } TRACE("write decimal separator\n"); localeValue = LOCALE_SDECIMAL; defaultChar = '.'; @@ -1450,8 +1474,21 @@ } else { - int count, count_max; - + int count, count_max, position; + + if ((np.dwOutFlags & NUMPRS_NEG) && !(dwState & NUM_WROTE_SIGN)) + { + TRACE("write negative sign\n"); + localeValue = LOCALE_SNEGATIVESIGN; + defaultChar = '-'; + dwState |= NUM_WROTE_SIGN; + shouldAdvance = FALSE; + break; + } + + position = have_int + pad; + if (dwState & NUM_WRITE_ON) + position = max(position, need_int); need_int -= pToken[1]; count_max = have_int + pad - need_int; if (count_max < 0) @@ -1461,25 +1498,55 @@ count = pToken[1] - count_max; TRACE("write %d leading zeros\n", count); while (count-- > 0) + { *pBuff++ = '0'; + if ((numHeader->flags & FMT_FLAG_THOUSANDS) && + position > 1 && (--position % 3) == 0) + { + int k; + TRACE("write thousand separator\n"); + for (k = 0; thousandSeparator[k]; k++) + *pBuff++ = thousandSeparator[k]; + } + } } if (*pToken == FMT_NUM_COPY_ZERO || have_int > 1 || (have_int > 0 && *prgbDig > 0)) { - dwState |= NUM_WRITE_ON; count = min(count_max, have_int); count_max -= count; have_int -= count; TRACE("write %d whole number digits\n", count); while (count--) + { + dwState |= NUM_WRITE_ON; *pBuff++ = '0' + *prgbDig++; + if ((numHeader->flags & FMT_FLAG_THOUSANDS) && + position > 1 && (--position % 3) == 0) + { + int k; + TRACE("write thousand separator\n"); + for (k = 0; thousandSeparator[k]; k++) + *pBuff++ = thousandSeparator[k]; + } + } } count = min(count_max, pad); count_max -= count; pad -= count; TRACE("write %d whole trailing 0's\n", count); while (count--) + { *pBuff++ = '0'; + if ((numHeader->flags & FMT_FLAG_THOUSANDS) && + position > 1 && (--position % 3) == 0) + { + int k; + TRACE("write thousand separator\n"); + for (k = 0; thousandSeparator[k]; k++) + *pBuff++ = thousandSeparator[k]; + } + } } pToken++; break; @@ -1504,7 +1571,8 @@ *pBuff++ = defaultChar; } } - pToken++; + if (shouldAdvance) + pToken++; }
VARIANT_FormatNumber_Exit:
Modified: trunk/reactos/dll/win32/oleaut32/variant.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oleaut32/variant.... ============================================================================== --- trunk/reactos/dll/win32/oleaut32/variant.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/oleaut32/variant.c [iso-8859-1] Sun Sep 14 00:15:39 2008 @@ -1191,7 +1191,7 @@ ud.st.wSecond = DOS_SECOND(wDosTime); ud.st.wDayOfWeek = ud.st.wMilliseconds = 0;
- return !VarDateFromUdate(&ud, 0, pDateOut); + return VarDateFromUdate(&ud, 0, pDateOut) == S_OK; }
/********************************************************************** @@ -1255,7 +1255,7 @@ return FALSE;
ud.st = *lpSt; - return !VarDateFromUdate(&ud, 0, pDateOut); + return VarDateFromUdate(&ud, 0, pDateOut) == S_OK; }
/***********************************************************************
Modified: trunk/reactos/dll/win32/oleaut32/vartype.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oleaut32/vartype.... ============================================================================== --- trunk/reactos/dll/win32/oleaut32/vartype.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/oleaut32/vartype.c [iso-8859-1] Sun Sep 14 00:15:39 2008 @@ -5179,7 +5179,7 @@ to multiply quotient by 10 (without overflowing), while adjusting the scale, until scale is 0. If this cannot be done, it is a real overflow. */ - while (!r_overflow && quotientscale < 0) { + while (r_overflow == S_OK && quotientscale < 0) { memset(remainderplusquotient, 0, sizeof(remainderplusquotient)); memcpy(remainderplusquotient, quotient->bitsnum, sizeof(quotient->bitsnum)); VARIANT_int_mulbychar(remainderplusquotient, sizeof(remainderplusquotient)/sizeof(DWORD), 10); @@ -5189,7 +5189,7 @@ memcpy(quotient->bitsnum, remainderplusquotient, sizeof(quotient->bitsnum)); } else r_overflow = DISP_E_OVERFLOW; } - if (!r_overflow) { + if (r_overflow == S_OK) { if (quotientscale <= 255) quotient->scale = quotientscale; else VARIANT_DI_clear(quotient); } @@ -6516,7 +6516,7 @@ VARIANT_int_add(decVal.bitsnum, 3, &one, 1); } decVal.bitsnum[2] = 0; - VARIANT_DI_tostringW(&decVal, buff, sizeof(buff)); + VARIANT_DI_tostringW(&decVal, buff, sizeof(buff)/sizeof(buff[0]));
if (dwFlags & LOCALE_USE_NLS) {
Modified: trunk/reactos/dll/win32/oleaut32/version.rc URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oleaut32/version.... ============================================================================== --- trunk/reactos/dll/win32/oleaut32/version.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/oleaut32/version.rc [iso-8859-1] Sun Sep 14 00:15:39 2008 @@ -19,5 +19,7 @@ #define WINE_OLESELFREGISTER #define WINE_FILEDESCRIPTION_STR "Wine OLE dll" #define WINE_FILENAME_STR "oleaut32.dll" +#define WINE_FILEVERSION 6, 0, 6001, 18000 /* version from Vista SP1 */ +#define WINE_FILEVERSION_STR "6.0.6001.18000"
#include "wine/wine_common_ver.rc"