Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
49799912
Commit
49799912
authored
Apr 29, 2016
by
Hans Leidekker
Committed by
Alexandre Julliard
May 01, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
webservices: Implement WsFileTimeToDateTime.
Signed-off-by:
Hans Leidekker
<
hans@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
2bcff80c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
66 additions
and
1 deletion
+66
-1
reader.c
dlls/webservices/reader.c
+20
-0
reader.c
dlls/webservices/tests/reader.c
+45
-0
webservices.spec
dlls/webservices/webservices.spec
+1
-1
No files found.
dlls/webservices/reader.c
View file @
49799912
...
...
@@ -2044,6 +2044,26 @@ HRESULT WINAPI WsDateTimeToFileTime( const WS_DATETIME *dt, FILETIME *ft, WS_ERR
return
S_OK
;
}
/**************************************************************************
* WsFileTimeToDateTime [webservices.@]
*/
HRESULT
WINAPI
WsFileTimeToDateTime
(
const
FILETIME
*
ft
,
WS_DATETIME
*
dt
,
WS_ERROR
*
error
)
{
unsigned
__int64
ticks
;
TRACE
(
"%p %p %p
\n
"
,
ft
,
dt
,
error
);
if
(
error
)
FIXME
(
"ignoring error parameter
\n
"
);
if
(
!
dt
||
!
ft
)
return
E_INVALIDARG
;
ticks
=
((
unsigned
__int64
)
ft
->
dwHighDateTime
<<
32
)
|
ft
->
dwLowDateTime
;
if
(
ticks
>
MAX_UINT64
-
TICKS_1601_01_01
)
return
WS_E_NUMERIC_OVERFLOW
;
if
(
ticks
+
TICKS_1601_01_01
>
TICKS_MAX
)
return
WS_E_INVALID_FORMAT
;
dt
->
ticks
=
ticks
+
TICKS_1601_01_01
;
dt
->
format
=
WS_DATETIME_FORMAT_UTC
;
return
S_OK
;
}
static
HRESULT
read_get_node_text
(
struct
reader
*
reader
,
WS_XML_UTF8_TEXT
**
ret
)
{
WS_XML_TEXT_NODE
*
text
;
...
...
dlls/webservices/tests/reader.c
View file @
49799912
...
...
@@ -3056,6 +3056,50 @@ static void test_WsDateTimeToFileTime(void)
}
}
static
void
test_WsFileTimeToDateTime
(
void
)
{
WS_DATETIME
dt
;
FILETIME
ft
;
HRESULT
hr
;
hr
=
WsFileTimeToDateTime
(
NULL
,
NULL
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"got %08x
\n
"
,
hr
);
ft
.
dwLowDateTime
=
ft
.
dwHighDateTime
=
0
;
hr
=
WsFileTimeToDateTime
(
&
ft
,
NULL
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"got %08x
\n
"
,
hr
);
hr
=
WsFileTimeToDateTime
(
NULL
,
&
dt
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"got %08x
\n
"
,
hr
);
dt
.
ticks
=
0xdeadbeef
;
dt
.
format
=
0xdeadbeef
;
hr
=
WsFileTimeToDateTime
(
&
ft
,
&
dt
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
dt
.
ticks
==
0x701ce1722770000
,
"got %x%08x
\n
"
,
(
ULONG
)(
dt
.
ticks
>>
32
),
(
ULONG
)
dt
.
ticks
);
ok
(
dt
.
format
==
WS_DATETIME_FORMAT_UTC
,
"got %u
\n
"
,
dt
.
format
);
ft
.
dwLowDateTime
=
0xd1c03fff
;
ft
.
dwHighDateTime
=
0x24c85a5e
;
hr
=
WsFileTimeToDateTime
(
&
ft
,
&
dt
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
dt
.
ticks
==
0x2bca2875f4373fff
,
"got %x%08x
\n
"
,
(
ULONG
)(
dt
.
ticks
>>
32
),
(
ULONG
)
dt
.
ticks
);
ok
(
dt
.
format
==
WS_DATETIME_FORMAT_UTC
,
"got %u
\n
"
,
dt
.
format
);
ft
.
dwLowDateTime
++
;
hr
=
WsFileTimeToDateTime
(
&
ft
,
&
dt
,
NULL
);
ok
(
hr
==
WS_E_INVALID_FORMAT
,
"got %08x
\n
"
,
hr
);
ft
.
dwLowDateTime
=
0xdd88ffff
;
ft
.
dwHighDateTime
=
0xf8fe31e8
;
hr
=
WsFileTimeToDateTime
(
&
ft
,
&
dt
,
NULL
);
ok
(
hr
==
WS_E_INVALID_FORMAT
,
"got %08x
\n
"
,
hr
);
ft
.
dwLowDateTime
++
;
hr
=
WsFileTimeToDateTime
(
&
ft
,
&
dt
,
NULL
);
ok
(
hr
==
WS_E_NUMERIC_OVERFLOW
,
"got %08x
\n
"
,
hr
);
}
START_TEST
(
reader
)
{
test_WsCreateError
();
...
...
@@ -3083,4 +3127,5 @@ START_TEST(reader)
test_WsResetHeap
();
test_datetime
();
test_WsDateTimeToFileTime
();
test_WsFileTimeToDateTime
();
}
dlls/webservices/webservices.spec
View file @
49799912
...
...
@@ -42,7 +42,7 @@
@ stub WsEncodeUrl
@ stub WsEndReaderCanonicalization
@ stub WsEndWriterCanonicalization
@ st
ub WsFileTimeToDateTime
@ st
dcall WsFileTimeToDateTime(ptr ptr ptr)
@ stub WsFillBody
@ stdcall WsFillReader(ptr long ptr ptr)
@ stdcall WsFindAttribute(ptr ptr ptr long ptr ptr)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment