- Timestamp:
- Feb 15, 2002, 4:07:41 PM (24 years ago)
- Location:
- trunk/src/oleaut32
- Files:
-
- 5 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/oleaut32/makefile
r7397 r7916 1 # $Id: makefile,v 1.3 1 2001-11-19 12:33:37sandervl Exp $1 # $Id: makefile,v 1.32 2002-02-15 15:07:36 sandervl Exp $ 2 2 3 3 # … … 7 7 # 8 8 9 10 !if "$(DEBUG)" == "1" 11 DEFFILE = oleaut32dbg.def 12 ORGDEFFILE = oleaut32.def 13 !endif 9 14 10 15 # … … 34 39 #$(OBJDIR)\iPictureEmf.obj \ 35 40 $(OBJDIR)\typelib.obj \ 41 $(OBJDIR)\tmarshal.obj \ 36 42 #$(OBJDIR)\itypelib.obj \ 37 43 #$(OBJDIR)\itypecomp.obj \ … … 41 47 $(OBJDIR)\connpt.obj \ 42 48 $(OBJDIR)\dispatch.obj \ 49 $(OBJDIR)\propertyframe.obj \ 43 50 $(OBJDIR)\stubs.obj \ 51 !if "$(DEBUG)" == "1" 52 $(OBJDIR)\dbgwrap.obj \ 53 !endif 44 54 $(OBJDIR)\oleaut32rsrc.obj 45 55 … … 53 63 $(ODIN32_LIB)/user32.lib \ 54 64 $(ODIN32_LIB)/ole32.lib \ 65 $(ODIN32_LIB)/comctl32.lib \ 55 66 $(ODIN32_LIB)/gdi32.lib \ 56 67 $(ODIN32_LIB)/guidlib.lib \ -
trunk/src/oleaut32/oleaut.c
r6944 r7916 21 21 #include "wine/obj_oleaut.h" 22 22 #include "wine/obj_olefont.h" 23 24 #include "tmarshal.h" 25 23 26 #include "debugtools.h" 24 27 … … 40 43 41 44 StringFromGUID2(rcid,guidbuf,39); 42 #ifdef __WIN32OS2__43 dprintf(("RegisterActiveObject %x %ls (%x) %x %x", punk, guidbuf, rcid, dwFlags, pdwRegister));44 #endif45 45 ret = CreateItemMoniker(pdelimiter,guidbuf,&moniker); 46 46 if (FAILED(ret)) … … 65 65 HRESULT ret; 66 66 67 #ifdef __WIN32OS2__68 dprintf(("RevokeActiveObject %x %x", xregister, reserved));69 #endif70 71 67 ret = GetRunningObjectTable(0,&runobtable); 72 68 if (FAILED(ret)) return ret; … … 88 84 89 85 StringFromGUID2(rcid,guidbuf,39); 90 #ifdef __WIN32OS2__91 dprintf(("GetActiveObject %ls (%x) %x %x", guidbuf, rcid, preserved, ppunk));92 #endif93 86 ret = CreateItemMoniker(pdelimiter,guidbuf,&moniker); 94 87 if (FAILED(ret)) … … 105 98 } 106 99 100 107 101 /*********************************************************************** 108 102 * OaBuildVersion [OLEAUT32.170] … … 111 105 * OLE 2.1 NT 1993-95 10 3023 112 106 * OLE 2.1 10 3027 107 * Win32s 1.1e 20 4049 113 108 * OLE 2.20 W95/NT 1993-96 20 4112 114 109 * OLE 2.20 W95/NT 1993-96 20 4118 … … 117 112 * OLE 2.40 NT?? 1993-98 40 4267 118 113 * OLE 2.40 W98 SE orig. file 1993-98 40 4275 114 * OLE 2.40 W2K orig. file 1993-XX 40 4514 115 * 116 * I just decided to use version 2.20 for Win3.1, 2.30 for Win95 & NT 3.51, 117 * and 2.40 for all newer OSs. The build number is maximum, i.e. 0xffff. 119 118 */ 120 119 UINT WINAPI OaBuildVersion() 121 120 { 122 #ifdef __WIN32OS2__123 dprintf(("OaBuildVersion %x", GetVersion() & 0x8000ffff));124 #else125 FIXME("Please report to a.mohr@mailto.de if you get version error messages !\n");126 #endif127 121 switch(GetVersion() & 0x8000ffff) /* mask off build number */ 128 122 { 129 123 case 0x80000a03: /* WIN31 */ 130 return MAKELONG(4049, 20); /* from Win32s 1.1e */ 131 case 0x80000004: /* WIN95 */ 132 return MAKELONG(4265, 30); 124 return MAKELONG(0xffff, 20); 125 case 0x00003303: /* NT351 */ 126 return MAKELONG(0xffff, 30); 127 case 0x80000004: /* WIN95; I'd like to use the "standard" w95 minor 128 version here (30), but as we still use w95 129 as default winver (which is good IMHO), I better 130 play safe and use the latest value for w95 for now. 131 Change this as soon as default winver gets changed 132 to something more recent */ 133 133 case 0x80000a04: /* WIN98 */ 134 return MAKELONG(4275, 40); /* value of W98 SE; orig. W98 AFAIK has 4265, 30 just as W95 */135 case 0x00003303: /* NT351 */136 return MAKELONG(4265, 30); /* value borrowed from Win95 */137 134 case 0x00000004: /* NT40 */ 138 #ifdef __WIN32OS2__ 139 return 0x2810b5; //returned by NT4, SP6 140 #else 141 return MAKELONG(4122, 20); /* ouch ! Quite old, I guess */ 142 #endif 135 case 0x00000005: /* W2K */ 136 return MAKELONG(0xffff, 40); 143 137 default: 144 138 ERR("Version value not known yet. Please investigate it !\n"); … … 148 142 149 143 /*********************************************************************** 150 * DllRegisterServer 144 * DllRegisterServer (OLEAUT32.320) 151 145 */ 152 146 HRESULT WINAPI OLEAUT32_DllRegisterServer() { … … 156 150 157 151 /*********************************************************************** 158 * DllUnregisterServer 152 * DllUnregisterServer (OLEAUT32.321) 159 153 */ 160 154 HRESULT WINAPI OLEAUT32_DllUnregisterServer() { … … 162 156 return S_OK; 163 157 } 164 165 158 166 159 extern void _get_STDFONT_CF(LPVOID); … … 179 172 } 180 173 } 174 if (IsEqualGUID(rclsid,&CLSID_PSOAInterface)) { 175 if (S_OK==TypeLibFac_DllGetClassObject(rclsid,iid,ppv)) 176 return S_OK; 177 /*FALLTHROUGH*/ 178 } 181 179 FIXME("\n\tCLSID:\t%s,\n\tIID:\t%s\n",debugstr_guid(rclsid),debugstr_guid(iid)); 182 180 return CLASS_E_CLASSNOTAVAILABLE; -
trunk/src/oleaut32/oleaut32.def
r6944 r7916 1 ;/* $Id: oleaut32.def,v 1. 8 2001-10-03 19:21:59sandervl Exp $ */1 ;/* $Id: oleaut32.def,v 1.9 2002-02-15 15:07:37 sandervl Exp $ */ 2 2 LIBRARY OLAUTOS2 INITINSTANCE 3 3 DESCRIPTION 'Odin32 System DLL - OleAut32' … … 300 300 ;427 stub GetRecordInfoFromTypeInfo ; stdcall (ptr ptr) 301 301 ;428 stub OleLoadPictureFileEx 302 ;429 stub SafeArrayAllocDescriptorEx 302 303 SafeArrayAllocDescriptorEx = _SafeArrayAllocDescriptorEx@12 @429 304 303 305 ;430 stub SafeArrayCreateEx 304 306 ;431 stub SafeArrayCreateVectorEx … … 312 314 VarBstrCat = _VarBstrCat@12 @439 313 315 VarBstrCmp = _VarBstrCmp@16 @440 314 ;441 stub VarCat ; stdcall (ptr ptr ptr) 316 VarCat = _VarCat@12 @441 317 315 318 ;442 stub VarCmp ; stdcall (ptr ptr long long) 316 319 ;443 stub VarCyAbs -
trunk/src/oleaut32/olefont.c
r6711 r7916 26 26 #include "olectl.h" 27 27 #include "debugtools.h" 28 #include "heap.h"29 28 #include "connpt.h" /* for CreateConnectionPoint */ 30 29 … … 292 291 *ppvObj = 0; 293 292 293 if (lpFontDesc == 0) 294 return NO_ERROR; /* MSDN Oct 2001 */ 295 294 296 /* 295 297 * Try to construct a new instance of the class. … … 1341 1343 BYTE bAttributes; 1342 1344 BYTE bStringSize; 1345 INT len; 1343 1346 1344 1347 _ICOM_THIS_From_IPersistStream(OLEFontImpl, iface); … … 1399 1402 return E_FAIL; 1400 1403 1401 memset(readBuffer, 0, 0x100);1402 1404 IStream_Read(pLoadStream, readBuffer, bStringSize, &cbRead); 1403 1405 … … 1408 1410 HeapFree(GetProcessHeap(), 0, this->description.lpstrName); 1409 1411 1410 this->description.lpstrName = HEAP_strdupAtoW(GetProcessHeap(), 1411 HEAP_ZERO_MEMORY, 1412 readBuffer); 1412 len = MultiByteToWideChar( CP_ACP, 0, readBuffer, bStringSize, NULL, 0 ); 1413 this->description.lpstrName = HeapAlloc( GetProcessHeap(), 0, (len+1) * sizeof(WCHAR) ); 1414 MultiByteToWideChar( CP_ACP, 0, readBuffer, bStringSize, this->description.lpstrName, len ); 1415 this->description.lpstrName[len] = 0; 1413 1416 1414 1417 return S_OK; … … 1488 1491 */ 1489 1492 if (this->description.lpstrName!=0) 1490 bStringSize = lstrlenW(this->description.lpstrName); 1493 bStringSize = WideCharToMultiByte( CP_ACP, 0, this->description.lpstrName, 1494 strlenW(this->description.lpstrName), NULL, 0, NULL, NULL ); 1491 1495 else 1492 1496 bStringSize = 0; … … 1499 1503 if (bStringSize!=0) 1500 1504 { 1501 writeBuffer = HEAP_strdupWtoA(GetProcessHeap(), 1502 HEAP_ZERO_MEMORY, 1503 this->description.lpstrName); 1504 1505 if (writeBuffer==0) 1506 return E_OUTOFMEMORY; 1505 if (!(writeBuffer = HeapAlloc( GetProcessHeap(), 0, bStringSize ))) return E_OUTOFMEMORY; 1506 WideCharToMultiByte( CP_ACP, 0, this->description.lpstrName, 1507 strlenW(this->description.lpstrName), 1508 writeBuffer, bStringSize, NULL, NULL ); 1507 1509 1508 1510 IStream_Write(pOutStream, writeBuffer, bStringSize, &cbWritten); 1509 1510 1511 HeapFree(GetProcessHeap(), 0, writeBuffer); 1511 1512 … … 1660 1661 LPCLASSFACTORY iface,LPUNKNOWN pOuter,REFIID riid,LPVOID *ppobj 1661 1662 ) { 1662 ICOM_THIS(IClassFactoryImpl,iface); 1663 1664 if (IsEqualGUID(riid,&IID_IFont)) { 1665 FONTDESC fd; 1666 1667 WCHAR fname[] = { 'S','y','s','t','e','m',0 }; 1668 1669 fd.cbSizeofstruct = sizeof(fd); 1670 fd.lpstrName = fname; 1671 fd.cySize.s.Lo = 80000; 1672 fd.cySize.s.Hi = 0; 1673 fd.sWeight = 0; 1674 fd.sCharset = 0; 1675 fd.fItalic = 0; 1676 fd.fUnderline = 0; 1677 fd.fStrikethrough = 0; 1678 return OleCreateFontIndirect(&fd,riid,ppobj); 1679 } 1680 1681 FIXME("(%p)->(%p,%s,%p)\n",This,pOuter,debugstr_guid(riid),ppobj); 1682 return E_NOINTERFACE; 1663 FONTDESC fd; 1664 1665 WCHAR fname[] = { 'S','y','s','t','e','m',0 }; 1666 1667 fd.cbSizeofstruct = sizeof(fd); 1668 fd.lpstrName = fname; 1669 fd.cySize.s.Lo = 80000; 1670 fd.cySize.s.Hi = 0; 1671 fd.sWeight = 0; 1672 fd.sCharset = 0; 1673 fd.fItalic = 0; 1674 fd.fUnderline = 0; 1675 fd.fStrikethrough = 0; 1676 return OleCreateFontIndirect(&fd,riid,ppobj); 1677 1683 1678 } 1684 1679 -
trunk/src/oleaut32/safearray.c
r6944 r7916 21 21 #define SYSDUPSTRING(str) SysAllocStringLen((str), SysStringLen(str)) 22 22 23 /* Local y used methods */23 /* Locally used methods */ 24 24 static INT 25 25 endOfDim(LONG *coor, SAFEARRAYBOUND *mat, LONG dim, LONG realDim); … … 102 102 }; 103 103 104 static const int LAST_VARTYPE = sizeof(VARTYPE_SIZE)/sizeof( ULONG);104 static const int LAST_VARTYPE = sizeof(VARTYPE_SIZE)/sizeof(VARTYPE_SIZE[0]); 105 105 106 106 … … 128 128 129 129 return(S_OK); 130 } 131 132 /************************************************************************* 133 * SafeArrayAllocDescriptorEx (OLEAUT32.429) 134 * Allocate the appropriate amount of memory for the SafeArray descriptor 135 * 136 * This is a minimal implementation just to get things moving. 137 * 138 * The MSDN documentation on this doesn't tell us much. 139 */ 140 HRESULT WINAPI SafeArrayAllocDescriptorEx( 141 VARTYPE vt, 142 UINT cDims, 143 SAFEARRAY **ppsaOut) 144 { 145 if ( (vt >= LAST_VARTYPE) || 146 ( VARTYPE_SIZE[vt] == VARTYPE_NOT_SUPPORTED ) ) 147 return E_UNEXPECTED; 148 149 return SafeArrayAllocDescriptor (cDims, ppsaOut); 130 150 } 131 151 … … 357 377 } 358 378 else if( psa->fFeatures == FADF_VARIANT) { 359 HRESULT hr = VariantCopy(pv, elementStorageAddress); 379 HRESULT hr; 380 VariantInit(pv); 381 hr = VariantCopy(pv, elementStorageAddress); 360 382 if (FAILED(hr)) { 361 383 SafeArrayUnlock(psa); … … 514 536 if(! validCoordinate(rgIndices, psa)) 515 537 return DISP_E_BADINDEX; 538 539 /* Although it is dangerous to do this without having a lock, it is not 540 * illegal. Microsoft do warn of the danger. 541 */ 516 542 517 543 /* Figure out the number of items to skip */ … … 786 812 lDelta *= psa->rgsabound[cDims].cElements; 787 813 814 TRACE("elements=%ld, Lbound=%ld (delta=%ld)\n", psaboundNew->cElements, psaboundNew->lLbound, lDelta); 815 788 816 if (lDelta == 0) { ;/* same size, maybe a change of lLbound, just set it */ 789 817 … … 883 911 releasing to the system the unused memory */ 884 912 885 if((pvNewBlock = HeapReAlloc(GetProcessHeap(), 0, psa->pvData,913 if((pvNewBlock = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, psa->pvData, 886 914 (ulWholeArraySize + lDelta) * psa->cbElements)) == NULL) 887 915 return FALSE; /* TODO If we get here it means: … … 896 924 the descriptor in SafeArrayCreateVector function. */ 897 925 898 if((pvNewBlock = HeapAlloc(GetProcessHeap(), 0,926 if((pvNewBlock = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, 899 927 ulWholeArraySize * psa->cbElements)) == NULL) 900 928 return FALSE; … … 993 1021 HRESULT hRes; 994 1022 1023 if (!psa->cDims) return FALSE; 995 1024 for(; iter<psa->cDims; iter++) { 1025 TRACE("coor[%d]=%ld\n", iter, coor[iter]); 996 1026 if((hRes = SafeArrayGetLBound(psa, (iter+1), &lLBound)) != S_OK) 997 1027 return FALSE; … … 999 1029 return FALSE; 1000 1030 1001 if(lLBound ==lUBound)1031 if(lLBound > lUBound) 1002 1032 return FALSE; 1003 1004 if((coor[iter] >= lLBound) && (coor[iter] <= lUBound)) 1005 return TRUE; 1006 else 1033 1034 if((coor[iter] < lLBound) || (coor[iter] > lUBound)) 1007 1035 return FALSE; 1008 1036 } 1009 return FALSE;1037 return TRUE; 1010 1038 } 1011 1039 -
trunk/src/oleaut32/stubs.cpp
r6944 r7916 1 /* $Id: stubs.cpp,v 1.1 2 2001-10-03 19:21:59sandervl Exp $ */1 /* $Id: stubs.cpp,v 1.13 2002-02-15 15:07:40 sandervl Exp $ */ 2 2 /* 3 3 * Win32 COM/OLE stubs for OS/2 … … 680 680 return S_OK; 681 681 } 682 683 //***************************************************************************** 684 //***************************************************************************** 685 686 typedef struct tagOCPFIPARAMS 687 { 688 ULONG cbStructSize; 689 HWND hWndOwner; 690 int x; 691 int y; 692 LPCOLESTR lpszCaption; 693 ULONG cObjects; 694 LPUNKNOWN * lplpUnk; 695 ULONG cPages; 696 CLSID * lpPages; 697 LCID lcid; 698 DISPID dispidInitialProperty; 699 700 } OCPFIPARAMS, * LPOCPFIPARAMS; 701 702 HRESULT WIN32API OleCreatePropertyFrameIndirect(LPOCPFIPARAMS lpParams) 703 { 704 dprintf(("OLEAUT32: OleCreatePropertyFrameIndirect - stub")); 705 return S_OK; 706 } 707 708 //***************************************************************************** 709 //***************************************************************************** 710 HRESULT WIN32API OleCreatePropertyFrame(HWND hwndOwner, UINT x, UINT y, 711 LPCOLESTR lpszCaption, ULONG cObjects, LPUNKNOWN * ppUnk, ULONG cPages, 712 LPCLSID pPageClsID, LCID lcid, DWORD dwReserved, LPVOID pvReserved) 713 { 714 dprintf(("OLEAUT32: OleCreatePropertyFrame - stub")); 715 return S_OK; 716 } 717 682 //***************************************************************************** 683 //***************************************************************************** -
trunk/src/oleaut32/typelib.h
r6711 r7916 128 128 INT16 cbSizeVft; /* virtual table size, not including inherits */ 129 129 /*050*/ INT size; /* size in bytes, at least for structures */ 130 /* fixme: name of this field */130 /* FIXME: name of this field */ 131 131 INT datatype1; /* position in type description table */ 132 132 /* or in base intefaces */ … … 543 543 */ 544 544 545 extern DWORD _invoke(LPVOID func,CALLCONV callconv, int nrargs, DWORD *args); 546 545 547 #include "poppack.h" 546 548 -
trunk/src/oleaut32/variant.c
r7351 r7916 1024 1024 switch( vtFrom ) 1025 1025 { 1026 case( VT_EMPTY ): 1027 V_UNION(pd,lVal) = 0; 1028 res = S_OK; 1029 break; 1026 1030 case( VT_I1 ): 1027 1031 res = VarI4FromI1( V_UNION(ps,cVal), &V_UNION(pd,lVal) ); … … 1402 1406 switch( vtFrom ) 1403 1407 { 1408 case( VT_EMPTY ): 1409 res = S_OK; 1410 V_UNION(pd,boolVal) = VARIANT_FALSE; 1411 break; 1404 1412 case( VT_I1 ): 1405 1413 res = VarBoolFromI1( V_UNION(ps,cVal), &V_UNION(pd,boolVal) ); … … 1956 1964 * Variant. 1957 1965 */ 1958 memcpy( &pvargDest->n1.n2 , V_UNION(pvargSrc,byref), SizeOfVariantData( pvargSrc ) );1966 memcpy( &pvargDest->n1.n2.n3, V_UNION(pvargSrc,byref), SizeOfVariantData( pvargSrc ) ); 1959 1967 break; 1960 1968 } … … 4274 4282 struct tm t; 4275 4283 4276 TRACE("( 0x%x, 0x%x, 0x%p ), stub\n", wDosDate, wDosTime, pvtime );4284 TRACE("( 0x%x, 0x%x, %p ), stub\n", wDosDate, wDosTime, pvtime ); 4277 4285 4278 4286 t.tm_sec = (wDosTime & 0x001f) * 2; … … 4362 4370 INT WINAPI VariantTimeToDosDateTime(DATE pvtime, USHORT *wDosDate, USHORT *wDosTime) 4363 4371 { 4364 struct tm t; 4365 4366 #ifdef __WIN32OS2__ 4372 struct tm t; 4367 4373 *wDosTime = 0; 4368 4374 *wDosDate = 0; 4369 #else 4370 // PH 2001-11-15: this is definately gonna crash! 4371 wDosTime = 0; 4372 wDosDate = 0; 4373 #endif 4374 4375 TRACE("( 0x%x, 0x%x, 0x%p ), stub\n", *wDosDate, *wDosTime, &pvtime ); 4375 4376 TRACE("( 0x%x, 0x%x, %p ), stub\n", *wDosDate, *wDosTime, &pvtime ); 4376 4377 4377 4378 if (DateToTm(pvtime, 0, &t) < 0) return 0; … … 4667 4668 } 4668 4669 4670 /********************************************************************** 4671 * VarCat [OLEAUT32.441] 4672 */ 4673 HRESULT WINAPI VarCat(LPVARIANT left, LPVARIANT right, LPVARIANT out) 4674 { 4675 /* Should we VariantClear out? */ 4676 /* Can we handle array, vector, by ref etc. */ 4677 if ((V_VT(left)&VT_TYPEMASK) == VT_NULL && 4678 (V_VT(right)&VT_TYPEMASK) == VT_NULL) 4679 { 4680 V_VT(out) = VT_NULL; 4681 return S_OK; 4682 } 4683 else if (V_VT(left) == VT_BSTR && V_VT(right) == VT_BSTR) 4684 { 4685 V_VT(out) = VT_BSTR; 4686 VarBstrCat (V_BSTR(left), V_BSTR(right), &V_BSTR(out)); 4687 return S_OK; 4688 } 4689 else 4690 FIXME ("types not supported\n"); 4691 return S_OK; 4692 }
Note:
See TracChangeset
for help on using the changeset viewer.