Implemented DosDateTimeToVariant() and SysAllocStringByteLen() functions.
diff --git a/ole/ole2disp.c b/ole/ole2disp.c
index af69ca2..455d03c 100644
--- a/ole/ole2disp.c
+++ b/ole/ole2disp.c
@@ -326,6 +326,58 @@
return S_OK;
}
+/******************************************************************************
+ * SysAllocStringByteLen [OLEAUT32.150]
+ *
+ */
+BSTR WINAPI SysAllocStringByteLen(char *in, int len)
+{
+ DWORD* newBuffer;
+ char* stringBuffer;
+ /*
+ * Allocate a new buffer to hold the string.
+ * dont't forget to keep an empty spot at the begining of the
+ * buffer for the character count and an extra character at the
+ * end for the NULL.
+ */
+ newBuffer = (DWORD*)HeapAlloc(GetProcessHeap(),
+ 0,
+ len + sizeof(WCHAR) + sizeof(DWORD));
+
+ /*
+ * If the memory allocation failed, return a null pointer.
+ */
+ if (newBuffer==0)
+ return 0;
+
+ /*
+ * Copy the length of the string in the placeholder.
+ */
+ *newBuffer = len;
+
+ /*
+ * Skip the byte count.
+ */
+ newBuffer++;
+
+ /*
+ * Copy the information in the buffer.
+ * Since it is valid to pass a NULL pointer here, we'll initialize the
+ * buffer to nul if it is the case.
+ */
+ if (in != 0)
+ memcpy(newBuffer, in, len);
+
+ /*
+ * Make sure that there is a nul character at the end of the
+ * string.
+ */
+ stringBuffer = (char *)newBuffer;
+ stringBuffer[len] = 0;
+ stringBuffer[len+1] = 0;
+
+ return (LPWSTR)stringBuffer;
+}
diff --git a/ole/variant.c b/ole/variant.c
index 3c3e429..8dd46b8 100644
--- a/ole/variant.c
+++ b/ole/variant.c
@@ -4237,3 +4237,28 @@
return S_OK;
}
+
+
+/**********************************************************************
+ * DosDateTimeToVariantTime [OLEAUT32.14]
+ * Convert dos representation of time to the date and time representation
+ * stored in a variant.
+ */
+INT WINAPI DosDateTimeToVariantTime(USHORT wDosDate, USHORT wDosTime,
+ DATE *pvtime)
+{
+ struct tm t;
+
+ TRACE( ole, "( 0x%x, 0x%x, 0x%p ), stub\n", wDosDate, wDosTime, pvtime );
+
+ t.tm_sec = (wDosTime & 0x001f) * 2;
+ t.tm_min = (wDosTime & 0x07e0) >> 5;
+ t.tm_hour = (wDosTime & 0xf800) >> 11;
+
+ t.tm_mday = (wDosDate & 0x001f);
+ t.tm_mon = (wDosDate & 0x01e0) >> 5;
+ t.tm_year = ((wDosDate & 0xfe00) >> 9) + 1980;
+
+ return TmToDATE( &t, pvtime );
+}
+
diff --git a/relay32/oleaut32.spec b/relay32/oleaut32.spec
index a125ff0..f756cc4 100644
--- a/relay32/oleaut32.spec
+++ b/relay32/oleaut32.spec
@@ -14,7 +14,7 @@
11 stdcall VariantCopyInd(ptr ptr) VariantCopyInd
12 stdcall VariantChangeType(ptr ptr) VariantChangeType
13 stub VariantTimeToDosDateTime
-14 stub DosDateTimeToVariantTime
+14 stdcall DosDateTimeToVariantTime(long ptr) DosDateTimeToVariantTime
15 stdcall SafeArrayCreate(long long ptr) SafeArrayCreate
16 stdcall SafeArrayDestroy(ptr) SafeArrayDestroy
17 stdcall SafeArrayGetDim(ptr) SafeArrayGetDim
@@ -129,7 +129,7 @@
147 stdcall VariantChangeTypeEx(ptr ptr) VariantChangeTypeEx
148 stub SafeArrayPtrOfIndex
149 stdcall SysStringByteLen(ptr) SysStringByteLen
-150 stub SysAllocStringByteLen
+150 stdcall SysAllocStringByteLen(ptr long) SysAllocStringByteLen
160 stub CreateTypeLib
161 stdcall LoadTypeLib (ptr ptr) LoadTypeLib
162 stdcall LoadRegTypeLib (ptr long long long ptr) LoadRegTypeLib