Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
2bcff80c
Commit
2bcff80c
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 WsDateTimeToFileTime.
Signed-off-by:
Hans Leidekker
<
hans@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
3268ceb5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
70 additions
and
1 deletion
+70
-1
reader.c
dlls/webservices/reader.c
+21
-0
reader.c
dlls/webservices/tests/reader.c
+48
-0
webservices.spec
dlls/webservices/webservices.spec
+1
-1
No files found.
dlls/webservices/reader.c
View file @
2bcff80c
...
...
@@ -2023,6 +2023,27 @@ static HRESULT str_to_datetime( const unsigned char *bytes, ULONG len, WS_DATETI
return
S_OK
;
}
#define TICKS_1601_01_01 504911232000000000
/**************************************************************************
* WsDateTimeToFileTime [webservices.@]
*/
HRESULT
WINAPI
WsDateTimeToFileTime
(
const
WS_DATETIME
*
dt
,
FILETIME
*
ft
,
WS_ERROR
*
error
)
{
unsigned
__int64
ticks
;
TRACE
(
"%p %p %p
\n
"
,
dt
,
ft
,
error
);
if
(
error
)
FIXME
(
"ignoring error parameter
\n
"
);
if
(
!
dt
||
!
ft
)
return
E_INVALIDARG
;
if
(
dt
->
ticks
<
TICKS_1601_01_01
)
return
WS_E_INVALID_FORMAT
;
ticks
=
dt
->
ticks
-
TICKS_1601_01_01
;
ft
->
dwHighDateTime
=
ticks
>>
32
;
ft
->
dwLowDateTime
=
(
DWORD
)
ticks
;
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 @
2bcff80c
...
...
@@ -3009,6 +3009,53 @@ static void test_datetime(void)
WsFreeHeap
(
heap
);
}
static
void
test_WsDateTimeToFileTime
(
void
)
{
static
const
struct
{
WS_DATETIME
dt
;
HRESULT
hr
;
FILETIME
ft
;
}
tests
[]
=
{
{
{
0
,
WS_DATETIME_FORMAT_UTC
},
WS_E_INVALID_FORMAT
,
{
0
,
0
}
},
{
{
0x701ce172276ffff
,
WS_DATETIME_FORMAT_UTC
},
WS_E_INVALID_FORMAT
,
{
0
,
0
}
},
{
{
0x701ce1722770000
,
WS_DATETIME_FORMAT_UTC
},
S_OK
,
{
0
,
0
}
},
{
{
0x2bca2875f4373fff
,
WS_DATETIME_FORMAT_UTC
},
S_OK
,
{
0xd1c03fff
,
0x24c85a5e
}
},
{
{
0x2bca2875f4374000
,
WS_DATETIME_FORMAT_UTC
},
S_OK
,
{
0xd1c04000
,
0x24c85a5e
}
},
{
{
0x2bca2875f4374000
,
WS_DATETIME_FORMAT_LOCAL
},
S_OK
,
{
0xd1c04000
,
0x24c85a5e
}
},
{
{
~
0
,
WS_DATETIME_FORMAT_UTC
},
S_OK
,
{
0xdd88ffff
,
0xf8fe31e8
}
},
};
WS_DATETIME
dt
;
FILETIME
ft
;
HRESULT
hr
;
ULONG
i
;
hr
=
WsDateTimeToFileTime
(
NULL
,
NULL
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"got %08x
\n
"
,
hr
);
dt
.
ticks
=
0x701ce172277000
;
dt
.
format
=
WS_DATETIME_FORMAT_UTC
;
hr
=
WsDateTimeToFileTime
(
&
dt
,
NULL
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"got %08x
\n
"
,
hr
);
hr
=
WsDateTimeToFileTime
(
NULL
,
&
ft
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"got %08x
\n
"
,
hr
);
for
(
i
=
0
;
i
<
sizeof
(
tests
)
/
sizeof
(
tests
[
0
]);
i
++
)
{
memset
(
&
ft
,
0
,
sizeof
(
ft
)
);
hr
=
WsDateTimeToFileTime
(
&
tests
[
i
].
dt
,
&
ft
,
NULL
);
ok
(
hr
==
tests
[
i
].
hr
,
"%u: got %08x
\n
"
,
i
,
hr
);
if
(
hr
==
S_OK
)
{
ok
(
ft
.
dwLowDateTime
==
tests
[
i
].
ft
.
dwLowDateTime
,
"%u: got %08x
\n
"
,
i
,
ft
.
dwLowDateTime
);
ok
(
ft
.
dwHighDateTime
==
tests
[
i
].
ft
.
dwHighDateTime
,
"%u: got %08x
\n
"
,
i
,
ft
.
dwHighDateTime
);
}
}
}
START_TEST
(
reader
)
{
test_WsCreateError
();
...
...
@@ -3035,4 +3082,5 @@ START_TEST(reader)
test_repeating_element
();
test_WsResetHeap
();
test_datetime
();
test_WsDateTimeToFileTime
();
}
dlls/webservices/webservices.spec
View file @
2bcff80c
...
...
@@ -37,7 +37,7 @@
@ stdcall WsCreateWriter(ptr long ptr ptr)
@ stdcall WsCreateXmlBuffer(ptr ptr long ptr ptr)
@ stub WsCreateXmlSecurityToken
@ st
ub WsDateTimeToFileTime
@ st
dcall WsDateTimeToFileTime(ptr ptr ptr)
@ stub WsDecodeUrl
@ stub WsEncodeUrl
@ stub WsEndReaderCanonicalization
...
...
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