Shuai Meng : vbscript: Implemented Time.

Alexandre Julliard julliard at wine.codeweavers.com
Thu Aug 28 14:52:09 CDT 2014


Module: wine
Branch: master
Commit: fdf4b1e7924b807b7a5bd56eaee24f7a62dd24f4
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=fdf4b1e7924b807b7a5bd56eaee24f7a62dd24f4

Author: Shuai Meng <mengshuaicalendr at gmail.com>
Date:   Tue Aug 26 00:08:27 2014 +0800

vbscript: Implemented Time.

---

 dlls/vbscript/global.c      | 16 ++++++++++++++--
 dlls/vbscript/tests/api.vbs |  1 +
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/dlls/vbscript/global.c b/dlls/vbscript/global.c
index c512729..311c892 100644
--- a/dlls/vbscript/global.c
+++ b/dlls/vbscript/global.c
@@ -1418,8 +1418,20 @@ static HRESULT Global_Date(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARI
 
 static HRESULT Global_Time(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
 {
-    FIXME("\n");
-    return E_NOTIMPL;
+    SYSTEMTIME lt;
+    UDATE ud;
+    DATE time;
+    HRESULT hres;
+
+    TRACE("\n");
+
+    GetLocalTime(&lt);
+    ud.st = lt;
+    ud.wDayOfYear = 0;
+    hres = VarDateFromUdateEx(&ud, 0, VAR_TIMEVALUEONLY, &time);
+    if(FAILED(hres))
+        return hres;
+    return return_date(res, time);
 }
 
 static HRESULT Global_Day(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
diff --git a/dlls/vbscript/tests/api.vbs b/dlls/vbscript/tests/api.vbs
index ab87717..d688e17 100644
--- a/dlls/vbscript/tests/api.vbs
+++ b/dlls/vbscript/tests/api.vbs
@@ -1238,5 +1238,6 @@ Call ok(Approch(Log(CByte(2)), 0.6931), "Log(CByte(2)) = " & Log(CByte(2)))
 Call ok(getVT(Log(CByte(2))) = "VT_R8", "getVT(Log(CByte(2))) = " & getVT(Log(CByte(2))))
 
 Call ok(getVT(Date) = "VT_DATE", "getVT(Date) = " & getVT(Date))
+Call ok(getVT(Time) = "VT_DATE", "getVT(Time) = " & getVT(Time))
 
 Call reportSuccess()




More information about the wine-cvs mailing list