oleaut32 additions

Medland, Bill Bill.Medland at accpac.com
Thu Jan 24 10:31:31 CST 2002


-------------- next part --------------
Bill Medland (medbi01 at accpac.com)
A couple of additions to oleaut32.

Index: wine/dlls/oleaut32/oleaut32.spec
===================================================================
RCS file: /home/wine/wine/dlls/oleaut32/oleaut32.spec,v
retrieving revision 1.33
diff -u -r1.33 oleaut32.spec
--- wine/dlls/oleaut32/oleaut32.spec	2001/10/23 19:59:24	1.33
+++ wine/dlls/oleaut32/oleaut32.spec	2002/01/24 14:48:38
@@ -101,6 +101,7 @@
 94 stdcall VarDateFromStr(wstr long long ptr) VarDateFromStr
 95 stub VarDateFromDisp
 96 stdcall VarDateFromBool(long ptr) VarDateFromBool
+#97 stub VarFormatDateTime # (ptr long long ptr)
 98 stdcall VarCyFromUI1(long ptr) VarCyFromUI1
 99 stdcall VarCyFromI2(long ptr) VarCyFromI2
 100 stdcall VarCyFromI4(long ptr) VarCyFromI4
@@ -308,7 +309,7 @@
 426 stub GetRecordInfoFromGuids # stdcall (ptr long long long ptr ptr)
 427 stub GetRecordInfoFromTypeInfo # stdcall (ptr ptr)
 428 stub OleLoadPictureFileEx
-429 stub SafeArrayAllocDescriptorEx
+429 stdcall SafeArrayAllocDescriptorEx(long long ptr) SafeArrayAllocDescriptorEx
 430 stub SafeArrayCreateEx
 431 stub SafeArrayCreateVectorEx
 432 stub SafeArrayGetIID
@@ -320,7 +321,7 @@
 438 stub VarAnd # stdcall (ptr ptr ptr)
 439 stdcall VarBstrCat(ptr ptr ptr) VarBstrCat
 440 stdcall VarBstrCmp(ptr ptr long long) VarBstrCmp
-441 stub VarCat # stdcall (ptr ptr ptr)
+441 stdcall VarCat(ptr ptr ptr) VarCat
 442 stub VarCmp # stdcall (ptr ptr long long)
 443 stub VarCyAbs
 444 stub VarCyAdd
Index: wine/dlls/oleaut32/variant.c
===================================================================
RCS file: /home/wine/wine/dlls/oleaut32/variant.c,v
retrieving revision 1.30
diff -u -r1.30 variant.c
--- wine/dlls/oleaut32/variant.c	2002/01/02 21:44:30	1.30
+++ wine/dlls/oleaut32/variant.c	2002/01/24 14:48:54
@@ -4650,3 +4650,26 @@
     return 1;
 }
 
+/**********************************************************************
+ *              VarCat [OLEAUT32.441]
+ */
+HRESULT WINAPI VarCat(LPVARIANT left, LPVARIANT right, LPVARIANT out)
+{
+    /* Should we VariantClear out? */
+    /* Can we handle array, vector, by ref etc. */
+    if ((V_VT(left)&VT_TYPEMASK) == VT_NULL &&
+        (V_VT(right)&VT_TYPEMASK) == VT_NULL)
+    {
+        V_VT(out) = VT_NULL;
+        return S_OK;
+    }
+    else if (V_VT(left) == VT_BSTR && V_VT(right) == VT_BSTR)
+    {
+        V_VT(out) = VT_BSTR;
+        VarBstrCat (V_BSTR(left), V_BSTR(right), &V_BSTR(out));
+        return S_OK;
+    }
+    else
+        FIXME ("types not supported\n");
+    return S_OK;
+}
Index: wine/dlls/oleaut32/safearray.c
===================================================================
RCS file: /home/wine/wine/dlls/oleaut32/safearray.c,v
retrieving revision 1.13
diff -u -r1.13 safearray.c
--- wine/dlls/oleaut32/safearray.c	2002/01/02 21:44:49	1.13
+++ wine/dlls/oleaut32/safearray.c	2002/01/24 14:49:04
@@ -20,7 +20,7 @@
 
 #define SYSDUPSTRING(str) SysAllocStringLen((str), SysStringLen(str))
 
-/* Localy used methods */
+/* Locally used methods */
 static INT  
 endOfDim(LONG *coor, SAFEARRAYBOUND *mat, LONG dim, LONG realDim);
 
@@ -101,7 +101,7 @@
 VARTYPE_NOT_SUPPORTED 	/* VT_BYREF    [V]          void* for local use	*/
 };
 
-static const int LAST_VARTYPE = sizeof(VARTYPE_SIZE)/sizeof(ULONG);
+static const int LAST_VARTYPE = sizeof(VARTYPE_SIZE)/sizeof(VARTYPE_SIZE[0]);
 
 
 /*************************************************************************
@@ -130,6 +130,26 @@
 }
 
 /*************************************************************************
+ *		SafeArrayAllocDescriptorEx (OLEAUT32.429)
+ * Allocate the appropriate amount of memory for the SafeArray descriptor
+ *
+ * This is a minimal implementation just to get things moving.
+ *
+ * The MSDN documentation on this doesn't tell us much.
+ */
+HRESULT WINAPI SafeArrayAllocDescriptorEx( 
+  VARTYPE vt,
+  UINT    cDims, 
+  SAFEARRAY **ppsaOut) 
+{
+  if ( (vt >= LAST_VARTYPE) ||
+       ( VARTYPE_SIZE[vt] == VARTYPE_NOT_SUPPORTED ) )
+    return E_UNEXPECTED;
+
+  return SafeArrayAllocDescriptor (cDims, ppsaOut);
+}
+
+/*************************************************************************
  *		SafeArrayAllocData (OLEAUT32.37)
  * Allocate the appropriate amount of data for the SafeArray data
  */
@@ -515,6 +535,10 @@
 
   if(! validCoordinate(rgIndices, psa)) 
     return DISP_E_BADINDEX;
+
+  /* Although it is dangerous to do this without having a lock, it is not
+   * illegal.  Microsoft do warn of the danger.
+   */
 
   /* Figure out the number of items to skip */
   stepCountInSAData = calcDisplacement(rgIndices, psa->rgsabound, psa->cDims);


More information about the wine-patches mailing list