Hi,
Part 6 of oleaut32 updates; a 'pause and tidy up' patch.
Cheers,
Jon
License: X11
Changelog:
Jon Griffiths <jon_p_griffiths@yahoo.com>
+dlls/oleaut32/r8.c dlls/oleaut32/oleaut32.spec
Add VarR8Pow()
+dlls/oleaut32/variant.c include/oleauto.h
Add/correct some prototypes
Get rid of now redundant round() function
+dlls/oleaut32/oleaut.c
Documentation
__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com
--- wine-diff/dlls/oleaut32/oleaut32.spec 2003-10-06 19:28:11.000000000 +0100
+++ wine-develop/dlls/oleaut32/oleaut32.spec 2003-10-06 19:32:34.000000000 +0100
@@ -307,7 +307,7 @@
312 stdcall VarCyCmpR8(long long double)
313 stdcall VarBstrCat(wstr wstr ptr)
314 stdcall VarBstrCmp(wstr wstr long long)
-315 stub VarR8Pow # stdcall (double double ptr)
+315 stdcall VarR8Pow(double double ptr)
316 stdcall VarR4CmpR8(long double)
317 stub VarR8Round # stdcall (double long ptr)
318 stdcall VarCat(ptr ptr ptr)
diff -u --minimal wine-diff/dlls/oleaut32/r8.c wine-develop/dlls/oleaut32/r8.c
--- wine-diff/dlls/oleaut32/r8.c 2003-10-06 18:15:44.000000000 +0100
+++ wine-develop/dlls/oleaut32/r8.c 2003-10-06 19:38:19.000000000 +0100
@@ -289,7 +289,7 @@
* Convert a VT_I8 to a VT_R8.
*
* PARAMS
- * ullIn [I] Source
+ * ullIn [I] Source
* pDblOut [O] Destination
*
* RETURNS
@@ -306,7 +306,7 @@
* Convert a VT_UI8 to a VT_R8.
*
* PARAMS
- * ullIn [I] Source
+ * ullIn [I] Source
* pDblOut [O] Destination
*
* RETURNS
@@ -316,3 +316,22 @@
{
return _VarR8FromUI8(ullIn, pDblOut);
}
+
+/************************************************************************
+ * VarR8Pow (OLEAUT32.315)
+ *
+ * Raise a VT_R8 to a power.
+ *
+ * PARAMS
+ * dblLeft [I] Source
+ * dblPow [I] Power to raise dblLeft by
+ * pDblOut [O] Destination
+ *
+ * RETURNS
+ * S_OK. pDblOut contains dblLeft to the power of dblRight.
+ */
+HRESULT WINAPI VarR8Pow(double dblLeft, double dblPow, double *pDblOut)
+{
+ *pDblOut = pow(dblLeft, dblPow);
+ return S_OK;
+}
diff -u --minimal wine-diff/dlls/oleaut32/variant.c wine-develop/dlls/oleaut32/variant.c
--- wine-diff/dlls/oleaut32/variant.c 2003-10-06 19:28:11.000000000 +0100
+++ wine-develop/dlls/oleaut32/variant.c 2003-10-06 19:54:01.000000000 +0100
@@ -663,71 +663,6 @@
}
/******************************************************************************
- * round [INTERNAL]
- *
- * Round the double value to the nearest integer value.
- */
-static double round( double d )
-{
- double decimals = 0.0, integerValue = 0.0, roundedValue = 0.0;
- BOOL bEvenNumber = FALSE;
- int nSign = 0;
-
- /* Save the sign of the number
- */
- nSign = (d >= 0.0) ? 1 : -1;
- d = fabs( d );
-
- /* Remove the decimals.
- */
- integerValue = floor( d );
-
- /* Set the Even flag. This is used to round the number when
- * the decimals are exactly 1/2. If the integer part is
- * odd the number is rounded up. If the integer part
- * is even the number is rounded down. Using this method
- * numbers are rounded up|down half the time.
- */
- bEvenNumber = (((short)fmod(integerValue, 2)) == 0) ? TRUE : FALSE;
-
- /* Remove the integral part of the number.
- */
- decimals = d - integerValue;
-
- /* Note: Ceil returns the smallest integer that is greater that x.
- * and floor returns the largest integer that is less than or equal to x.
- */
- if( decimals > 0.5 )
- {
- /* If the decimal part is greater than 1/2
- */
- roundedValue = ceil( d );
- }
- else if( decimals < 0.5 )
- {
- /* If the decimal part is smaller than 1/2
- */
- roundedValue = floor( d );
- }
- else
- {
- /* the decimals are exactly 1/2 so round according to
- * the bEvenNumber flag.
- */
- if( bEvenNumber )
- {
- roundedValue = floor( d );
- }
- else
- {
- roundedValue = ceil( d );
- }
- }
-
- return roundedValue * nSign;
-}
-
-/******************************************************************************
* Coerce [INTERNAL]
*
* This function dispatches execution to the proper conversion API
@@ -3822,7 +3757,7 @@
* NORM_IGNORESTRINGWIDTH, NORM_IGNOREKANATYPE, NORM_IGNOREKASHIDA
*
*/
-HRESULT WINAPI VarBstrCmp(BSTR left, BSTR right, LCID lcid, DWORD flags)
+HRESULT WINAPI VarBstrCmp(BSTR left, BSTR right, LCID lcid, ULONG flags)
{
INT r;
--- wine-diff/include/oleauto.h 2003-09-11 17:11:34.000000000 +0100
+++ wine-develop/include/oleauto.h 2003-10-06 19:47:09.000000000 +0100
@@ -535,6 +535,11 @@
#define VARCMP_GT 2
#define VARCMP_NULL 3
+HRESULT WINAPI VarR4CmpR8(float,double);
+
+HRESULT WINAPI VarR8Pow(double,double,double*);
+HRESULT WINAPI VarR8Round(double,int,double*);
+
HRESULT WINAPI VarDecAbs(const DECIMAL*,DECIMAL*);
HRESULT WINAPI VarDecAdd(const DECIMAL*,const DECIMAL*,DECIMAL*);
HRESULT WINAPI VarDecCmp(const DECIMAL*,const DECIMAL*);
@@ -584,6 +589,8 @@
HRESULT WINAPI VarCmp(LPVARIANT,LPVARIANT,LCID,ULONG);
+HRESULT WINAPI VarBstrCmp(BSTR,BSTR,LCID,ULONG);
+HRESULT WINAPI VarBstrCat(BSTR,BSTR,BSTR*);
typedef struct tagPARAMDATA {
--- wine-diff/dlls/oleaut32/oleaut.c 2003-09-24 21:21:29.000000000 +0100
+++ wine-develop/dlls/oleaut32/oleaut.c 2003-10-06 20:24:08.000000000 +0100
@@ -522,20 +522,31 @@
/***********************************************************************
* OaBuildVersion [OLEAUT32.170]
*
- * known OLEAUT32.DLL versions:
- * OLE 2.1 NT 1993-95 10 3023
- * OLE 2.1 10 3027
- * Win32s 1.1e 20 4049
- * OLE 2.20 W95/NT 1993-96 20 4112
- * OLE 2.20 W95/NT 1993-96 20 4118
- * OLE 2.20 W95/NT 1993-96 20 4122
- * OLE 2.30 W95/NT 1993-98 30 4265
- * OLE 2.40 NT?? 1993-98 40 4267
- * OLE 2.40 W98 SE orig. file 1993-98 40 4275
- * OLE 2.40 W2K orig. file 1993-XX 40 4514
+ * Get the Ole Automation build version.
*
- * I just decided to use version 2.20 for Win3.1, 2.30 for Win95 & NT 3.51,
- * and 2.40 for all newer OSs. The build number is maximum, i.e. 0xffff.
+ * PARAMS
+ * None
+ *
+ * RETURNS
+ * The build version.
+ *
+ * NOTES
+ * Known oleaut32.dll versions:
+ *| OLE Ver. Comments Date Build Ver.
+ *| -------- ------------------------- ---- ---------
+ *| OLE 2.1 NT 1993-95 10 3023
+ *| OLE 2.1 10 3027
+ *| Win32s Ver 1.1e 20 4049
+ *| OLE 2.20 W95/NT 1993-96 20 4112
+ *| OLE 2.20 W95/NT 1993-96 20 4118
+ *| OLE 2.20 W95/NT 1993-96 20 4122
+ *| OLE 2.30 W95/NT 1993-98 30 4265
+ *| OLE 2.40 NT?? 1993-98 40 4267
+ *| OLE 2.40 W98 SE orig. file 1993-98 40 4275
+ *| OLE 2.40 W2K orig. file 1993-XX 40 4514
+ *
+ * Currently the versions returned are 2.20 for Win3.1, 2.30 for Win95 & NT 3.51,
+ * and 2.40 for all later versions. The build number is maximum, i.e. 0xffff.
*/
UINT WINAPI OaBuildVersion()
{
@@ -564,10 +575,19 @@
/******************************************************************************
* OleTranslateColor [OLEAUT32.421]
*
- * Converts an OLE_COLOR to a COLORREF.
- * See the documentation for conversion rules.
- * pColorRef can be NULL. In that case the user only wants to test the
- * conversion.
+ * Convert an OLE_COLOR to a COLORREF.
+ *
+ * PARAMS
+ * clr [I] Color to convert
+ * hpal [I] Handle to a palette for the conversion
+ * pColorRef [O] Destination for converted color, or NULL to test if the conversion is ok
+ *
+ * RETURNS
+ * Success: S_OK. The conversion is ok, and pColorRef contains the converted color if non-NULL.
+ * Failure: E_INVALIDARG, if any argument is invalid.
+ *
+ * FIXME
+ * Document the conversion rules.
*/
HRESULT WINAPI OleTranslateColor(
OLE_COLOR clr,
@@ -681,8 +701,16 @@
/***********************************************************************
* DllCanUnloadNow (OLEAUT32.410)
+ *
+ * Determine if this dll can be unloaded from the callers address space.
+ *
+ * PARAMS
+ * None.
+ *
+ * RETURNS
+ * Always returns S_FALSE. This dll cannot be unloaded.
*/
-HRESULT WINAPI OLEAUT32_DllCanUnloadNow() {
- FIXME("(), stub!\n");
+HRESULT WINAPI OLEAUT32_DllCanUnloadNow()
+{
return S_FALSE;
}