2006-09-24 23:10:38 +02:00
|
|
|
/*
|
|
|
|
* Copyright 2006 Jacek Caban for CodeWeavers
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdarg.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
#define COBJMACROS
|
|
|
|
|
|
|
|
#include "windef.h"
|
|
|
|
#include "winbase.h"
|
|
|
|
#include "winuser.h"
|
|
|
|
#include "ole2.h"
|
|
|
|
|
|
|
|
#include "wine/debug.h"
|
|
|
|
|
|
|
|
#include "mshtml_private.h"
|
|
|
|
|
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
|
|
|
|
|
|
|
|
#define WM_PROCESSTASK 0x8008
|
2008-04-21 18:21:19 +02:00
|
|
|
#define TIMER_ID 0x3000
|
|
|
|
|
|
|
|
typedef struct {
|
2012-10-17 12:19:34 +02:00
|
|
|
HTMLInnerWindow *window;
|
2008-04-21 18:21:19 +02:00
|
|
|
DWORD id;
|
|
|
|
DWORD time;
|
2008-06-27 21:11:38 +02:00
|
|
|
DWORD interval;
|
2021-04-22 01:49:02 +02:00
|
|
|
enum timer_type type;
|
2008-04-21 18:21:19 +02:00
|
|
|
IDispatch *disp;
|
|
|
|
|
|
|
|
struct list entry;
|
|
|
|
} task_timer_t;
|
2006-09-24 23:10:38 +02:00
|
|
|
|
2011-08-03 12:34:34 +02:00
|
|
|
static void default_task_destr(task_t *task)
|
|
|
|
{
|
|
|
|
heap_free(task);
|
|
|
|
}
|
|
|
|
|
2012-10-19 11:56:59 +02:00
|
|
|
HRESULT push_task(task_t *task, task_proc_t proc, task_proc_t destr, LONG magic)
|
2006-09-24 23:12:06 +02:00
|
|
|
{
|
2012-10-19 11:56:59 +02:00
|
|
|
thread_data_t *thread_data;
|
|
|
|
|
|
|
|
thread_data = get_thread_data(TRUE);
|
|
|
|
if(!thread_data) {
|
|
|
|
if(destr)
|
|
|
|
destr(task);
|
|
|
|
else
|
|
|
|
heap_free(task);
|
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
}
|
2006-09-24 23:12:06 +02:00
|
|
|
|
2009-10-26 23:05:10 +01:00
|
|
|
task->target_magic = magic;
|
|
|
|
task->proc = proc;
|
2011-08-03 12:34:34 +02:00
|
|
|
task->destr = destr ? destr : default_task_destr;
|
2009-10-26 23:05:10 +01:00
|
|
|
|
2014-12-24 13:09:59 +01:00
|
|
|
list_add_tail(&thread_data->task_list, &task->entry);
|
2006-09-24 23:12:06 +02:00
|
|
|
|
|
|
|
PostMessageW(thread_data->thread_hwnd, WM_PROCESSTASK, 0, 0);
|
2012-10-19 11:56:59 +02:00
|
|
|
return S_OK;
|
2006-09-24 23:12:06 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static task_t *pop_task(void)
|
|
|
|
{
|
2012-10-19 11:56:59 +02:00
|
|
|
thread_data_t *thread_data;
|
|
|
|
task_t *task;
|
2006-09-24 23:12:06 +02:00
|
|
|
|
2012-10-19 11:56:59 +02:00
|
|
|
thread_data = get_thread_data(FALSE);
|
|
|
|
if(!thread_data)
|
|
|
|
return NULL;
|
|
|
|
|
2014-12-24 13:09:59 +01:00
|
|
|
if(list_empty(&thread_data->task_list))
|
2006-09-24 23:12:06 +02:00
|
|
|
return NULL;
|
|
|
|
|
2014-12-24 13:09:59 +01:00
|
|
|
task = LIST_ENTRY(thread_data->task_list.next, task_t, entry);
|
|
|
|
list_remove(&task->entry);
|
2006-09-24 23:12:06 +02:00
|
|
|
return task;
|
|
|
|
}
|
|
|
|
|
2008-04-21 18:21:19 +02:00
|
|
|
static void release_task_timer(HWND thread_hwnd, task_timer_t *timer)
|
|
|
|
{
|
|
|
|
list_remove(&timer->entry);
|
|
|
|
|
|
|
|
IDispatch_Release(timer->disp);
|
|
|
|
|
|
|
|
heap_free(timer);
|
|
|
|
}
|
|
|
|
|
2009-10-26 23:05:10 +01:00
|
|
|
void remove_target_tasks(LONG target)
|
2006-09-24 23:12:06 +02:00
|
|
|
{
|
|
|
|
thread_data_t *thread_data = get_thread_data(FALSE);
|
2008-04-21 18:21:19 +02:00
|
|
|
struct list *liter, *ltmp;
|
|
|
|
task_timer_t *timer;
|
2014-12-24 13:09:59 +01:00
|
|
|
task_t *task;
|
2006-09-24 23:12:06 +02:00
|
|
|
|
2009-09-02 04:16:19 +02:00
|
|
|
if(!thread_data)
|
|
|
|
return;
|
|
|
|
|
2008-04-21 18:21:19 +02:00
|
|
|
LIST_FOR_EACH_SAFE(liter, ltmp, &thread_data->timer_list) {
|
|
|
|
timer = LIST_ENTRY(liter, task_timer_t, entry);
|
2012-10-17 12:19:34 +02:00
|
|
|
if(timer->window->task_magic == target)
|
2008-04-21 18:21:19 +02:00
|
|
|
release_task_timer(thread_data->thread_hwnd, timer);
|
|
|
|
}
|
|
|
|
|
|
|
|
if(!list_empty(&thread_data->timer_list)) {
|
2013-04-29 14:41:05 +02:00
|
|
|
DWORD tc = GetTickCount();
|
|
|
|
|
2008-04-21 18:21:19 +02:00
|
|
|
timer = LIST_ENTRY(list_head(&thread_data->timer_list), task_timer_t, entry);
|
2013-04-29 14:41:05 +02:00
|
|
|
SetTimer(thread_data->thread_hwnd, TIMER_ID, max( (int)(timer->time - tc), 0 ), NULL);
|
2008-04-21 18:21:19 +02:00
|
|
|
}
|
|
|
|
|
2014-12-24 13:09:59 +01:00
|
|
|
LIST_FOR_EACH_SAFE(liter, ltmp, &thread_data->task_list) {
|
|
|
|
task = LIST_ENTRY(liter, task_t, entry);
|
|
|
|
if(task->target_magic == target) {
|
|
|
|
list_remove(&task->entry);
|
|
|
|
task->destr(task);
|
2006-09-24 23:12:06 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-10-26 23:05:10 +01:00
|
|
|
LONG get_task_target_magic(void)
|
|
|
|
{
|
|
|
|
static LONG magic = 0x10000000;
|
|
|
|
return InterlockedIncrement(&magic);
|
|
|
|
}
|
|
|
|
|
2008-06-27 21:11:38 +02:00
|
|
|
static BOOL queue_timer(thread_data_t *thread_data, task_timer_t *timer)
|
|
|
|
{
|
|
|
|
task_timer_t *iter;
|
|
|
|
|
2008-07-11 23:44:38 +02:00
|
|
|
list_remove(&timer->entry);
|
|
|
|
|
2008-06-27 21:11:38 +02:00
|
|
|
if(list_empty(&thread_data->timer_list)
|
|
|
|
|| LIST_ENTRY(list_head(&thread_data->timer_list), task_timer_t, entry)->time > timer->time) {
|
|
|
|
|
|
|
|
list_add_head(&thread_data->timer_list, &timer->entry);
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
LIST_FOR_EACH_ENTRY(iter, &thread_data->timer_list, task_timer_t, entry) {
|
|
|
|
if(iter->time > timer->time) {
|
|
|
|
list_add_tail(&iter->entry, &timer->entry);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
list_add_tail(&thread_data->timer_list, &timer->entry);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2021-04-22 01:49:02 +02:00
|
|
|
HRESULT set_task_timer(HTMLInnerWindow *window, LONG msec, enum timer_type timer_type, IDispatch *disp, LONG *id)
|
2008-04-21 18:21:19 +02:00
|
|
|
{
|
2012-10-19 11:56:59 +02:00
|
|
|
thread_data_t *thread_data;
|
2008-04-21 18:21:19 +02:00
|
|
|
task_timer_t *timer;
|
|
|
|
DWORD tc = GetTickCount();
|
|
|
|
|
|
|
|
static DWORD id_cnt = 0x20000000;
|
|
|
|
|
2012-10-19 11:56:59 +02:00
|
|
|
thread_data = get_thread_data(TRUE);
|
|
|
|
if(!thread_data)
|
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
|
2008-04-21 18:21:19 +02:00
|
|
|
timer = heap_alloc(sizeof(task_timer_t));
|
2012-10-19 11:56:59 +02:00
|
|
|
if(!timer)
|
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
|
2016-05-02 15:39:28 +02:00
|
|
|
if(msec < 1)
|
|
|
|
msec = 1;
|
|
|
|
|
2008-04-21 18:21:19 +02:00
|
|
|
timer->id = id_cnt++;
|
2012-10-17 12:19:34 +02:00
|
|
|
timer->window = window;
|
2008-04-21 18:21:19 +02:00
|
|
|
timer->time = tc + msec;
|
2021-04-22 01:49:02 +02:00
|
|
|
timer->interval = timer_type == TIMER_INTERVAL ? msec : 0;
|
|
|
|
timer->type = timer_type;
|
2008-07-11 23:44:38 +02:00
|
|
|
list_init(&timer->entry);
|
2008-04-21 18:21:19 +02:00
|
|
|
|
|
|
|
IDispatch_AddRef(disp);
|
|
|
|
timer->disp = disp;
|
|
|
|
|
2008-06-27 21:11:38 +02:00
|
|
|
if(queue_timer(thread_data, timer))
|
2008-04-21 18:21:19 +02:00
|
|
|
SetTimer(thread_data->thread_hwnd, TIMER_ID, msec, NULL);
|
|
|
|
|
2012-10-19 11:56:59 +02:00
|
|
|
*id = timer->id;
|
|
|
|
return S_OK;
|
2008-04-21 18:21:19 +02:00
|
|
|
}
|
|
|
|
|
2016-05-02 15:39:34 +02:00
|
|
|
HRESULT clear_task_timer(HTMLInnerWindow *window, DWORD id)
|
2008-06-27 21:14:40 +02:00
|
|
|
{
|
|
|
|
thread_data_t *thread_data = get_thread_data(FALSE);
|
|
|
|
task_timer_t *iter;
|
|
|
|
|
|
|
|
if(!thread_data)
|
|
|
|
return S_OK;
|
|
|
|
|
|
|
|
LIST_FOR_EACH_ENTRY(iter, &thread_data->timer_list, task_timer_t, entry) {
|
2016-05-02 15:39:34 +02:00
|
|
|
if(iter->id == id && iter->window == window) {
|
2008-06-27 21:14:40 +02:00
|
|
|
release_task_timer(thread_data->thread_hwnd, iter);
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
WARN("timet not found\n");
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2021-04-22 01:52:53 +02:00
|
|
|
static const char *debugstr_timer_type(enum timer_type type)
|
|
|
|
{
|
|
|
|
switch(type) {
|
|
|
|
case TIMER_TIMEOUT: return "timeout";
|
|
|
|
case TIMER_INTERVAL: return "interval";
|
|
|
|
case TIMER_ANIMATION_FRAME: return "animation-frame";
|
|
|
|
DEFAULT_UNREACHABLE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void call_timer_disp(IDispatch *disp, enum timer_type timer_type)
|
2008-10-09 22:33:50 +02:00
|
|
|
{
|
|
|
|
DISPPARAMS dp = {NULL, NULL, 0, 0};
|
2021-04-22 01:52:53 +02:00
|
|
|
VARIANT timestamp;
|
2008-10-09 22:33:50 +02:00
|
|
|
EXCEPINFO ei;
|
|
|
|
VARIANT res;
|
|
|
|
HRESULT hres;
|
|
|
|
|
|
|
|
V_VT(&res) = VT_EMPTY;
|
|
|
|
memset(&ei, 0, sizeof(ei));
|
2009-09-08 22:27:03 +02:00
|
|
|
|
2021-04-22 01:52:53 +02:00
|
|
|
if(timer_type == TIMER_ANIMATION_FRAME) {
|
|
|
|
dp.cArgs = 1;
|
|
|
|
dp.rgvarg = ×tamp;
|
|
|
|
V_VT(×tamp) = VT_R8;
|
|
|
|
V_R8(×tamp) = get_time_stamp();
|
|
|
|
}
|
|
|
|
|
|
|
|
TRACE("%p %s >>>\n", disp, debugstr_timer_type(timer_type));
|
2008-10-09 22:33:50 +02:00
|
|
|
hres = IDispatch_Invoke(disp, DISPID_VALUE, &IID_NULL, 0, DISPATCH_METHOD, &dp, &res, &ei, NULL);
|
2009-09-08 22:27:03 +02:00
|
|
|
if(hres == S_OK)
|
2021-04-22 01:52:53 +02:00
|
|
|
TRACE("%p %s <<<\n", disp, debugstr_timer_type(timer_type));
|
2009-09-08 22:27:03 +02:00
|
|
|
else
|
2022-02-15 07:29:41 +01:00
|
|
|
WARN("%p %s <<< %08lx\n", disp, debugstr_timer_type(timer_type), hres);
|
2009-09-08 22:27:03 +02:00
|
|
|
|
2008-10-09 22:33:50 +02:00
|
|
|
VariantClear(&res);
|
|
|
|
}
|
|
|
|
|
2008-04-21 18:21:19 +02:00
|
|
|
static LRESULT process_timer(void)
|
|
|
|
{
|
2012-10-19 11:56:59 +02:00
|
|
|
thread_data_t *thread_data;
|
2021-04-22 01:52:53 +02:00
|
|
|
enum timer_type timer_type;
|
2008-07-11 23:44:38 +02:00
|
|
|
IDispatch *disp;
|
2008-06-19 23:09:58 +02:00
|
|
|
DWORD tc;
|
2013-04-26 15:47:36 +02:00
|
|
|
task_timer_t *timer=NULL, *last_timer;
|
2008-04-21 18:21:19 +02:00
|
|
|
|
2008-06-19 23:09:58 +02:00
|
|
|
TRACE("\n");
|
|
|
|
|
2012-10-19 11:56:59 +02:00
|
|
|
thread_data = get_thread_data(FALSE);
|
|
|
|
assert(thread_data != NULL);
|
|
|
|
|
2013-04-26 15:47:36 +02:00
|
|
|
if(list_empty(&thread_data->timer_list)) {
|
|
|
|
KillTimer(thread_data->thread_hwnd, TIMER_ID);
|
|
|
|
return 0;
|
|
|
|
}
|
2008-06-19 23:09:58 +02:00
|
|
|
|
2013-04-26 15:47:36 +02:00
|
|
|
last_timer = LIST_ENTRY(list_tail(&thread_data->timer_list), task_timer_t, entry);
|
|
|
|
do {
|
2008-06-19 23:09:58 +02:00
|
|
|
tc = GetTickCount();
|
2013-04-26 15:47:36 +02:00
|
|
|
if(timer == last_timer) {
|
|
|
|
timer = LIST_ENTRY(list_head(&thread_data->timer_list), task_timer_t, entry);
|
|
|
|
SetTimer(thread_data->thread_hwnd, TIMER_ID, timer->time>tc ? timer->time-tc : 0, NULL);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
timer = LIST_ENTRY(list_head(&thread_data->timer_list), task_timer_t, entry);
|
|
|
|
|
2008-04-21 18:21:19 +02:00
|
|
|
if(timer->time > tc) {
|
|
|
|
SetTimer(thread_data->thread_hwnd, TIMER_ID, timer->time-tc, NULL);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2008-07-11 23:44:38 +02:00
|
|
|
disp = timer->disp;
|
|
|
|
IDispatch_AddRef(disp);
|
2021-04-22 01:52:53 +02:00
|
|
|
timer_type = timer->type;
|
2008-06-19 23:09:58 +02:00
|
|
|
|
2008-06-27 21:11:38 +02:00
|
|
|
if(timer->interval) {
|
|
|
|
timer->time += timer->interval;
|
|
|
|
queue_timer(thread_data, timer);
|
|
|
|
}else {
|
|
|
|
release_task_timer(thread_data->thread_hwnd, timer);
|
|
|
|
}
|
2008-07-11 23:44:38 +02:00
|
|
|
|
2021-04-22 01:52:53 +02:00
|
|
|
call_timer_disp(disp, timer_type);
|
2008-07-11 23:44:38 +02:00
|
|
|
|
|
|
|
IDispatch_Release(disp);
|
2013-04-26 15:47:36 +02:00
|
|
|
}while(!list_empty(&thread_data->timer_list));
|
2008-04-21 18:21:19 +02:00
|
|
|
|
|
|
|
KillTimer(thread_data->thread_hwnd, TIMER_ID);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2006-09-24 23:10:38 +02:00
|
|
|
static LRESULT WINAPI hidden_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
|
|
|
{
|
2006-09-24 23:12:06 +02:00
|
|
|
switch(msg) {
|
|
|
|
case WM_PROCESSTASK:
|
|
|
|
while(1) {
|
|
|
|
task_t *task = pop_task();
|
|
|
|
if(!task)
|
|
|
|
break;
|
|
|
|
|
2009-10-26 23:05:10 +01:00
|
|
|
task->proc(task);
|
2011-08-03 12:34:34 +02:00
|
|
|
task->destr(task);
|
2006-09-24 23:12:06 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
2008-04-21 18:21:19 +02:00
|
|
|
case WM_TIMER:
|
|
|
|
return process_timer();
|
2006-09-24 23:12:06 +02:00
|
|
|
}
|
|
|
|
|
2006-09-24 23:10:38 +02:00
|
|
|
if(msg > WM_USER)
|
2022-02-15 07:29:41 +01:00
|
|
|
FIXME("(%p %d %Ix %Ix)\n", hwnd, msg, wParam, lParam);
|
2006-09-24 23:10:38 +02:00
|
|
|
|
|
|
|
return DefWindowProcW(hwnd, msg, wParam, lParam);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HWND create_thread_hwnd(void)
|
|
|
|
{
|
|
|
|
static ATOM hidden_wnd_class = 0;
|
|
|
|
|
|
|
|
if(!hidden_wnd_class) {
|
|
|
|
WNDCLASSEXW wndclass = {
|
|
|
|
sizeof(WNDCLASSEXW), 0,
|
|
|
|
hidden_proc,
|
|
|
|
0, 0, hInst, NULL, NULL, NULL, NULL,
|
2020-11-24 23:29:19 +01:00
|
|
|
L"Internet Explorer_Hidden",
|
2006-09-24 23:10:38 +02:00
|
|
|
NULL
|
|
|
|
};
|
|
|
|
|
|
|
|
hidden_wnd_class = RegisterClassExW(&wndclass);
|
|
|
|
}
|
|
|
|
|
2020-11-24 23:29:19 +01:00
|
|
|
return CreateWindowExW(0, L"Internet Explorer_Hidden", NULL, WS_POPUP,
|
2006-09-24 23:10:38 +02:00
|
|
|
0, 0, 0, 0, NULL, NULL, hInst, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
HWND get_thread_hwnd(void)
|
|
|
|
{
|
2012-10-19 11:56:59 +02:00
|
|
|
thread_data_t *thread_data;
|
|
|
|
|
|
|
|
thread_data = get_thread_data(TRUE);
|
|
|
|
if(!thread_data)
|
|
|
|
return NULL;
|
2006-09-24 23:10:38 +02:00
|
|
|
|
|
|
|
if(!thread_data->thread_hwnd)
|
|
|
|
thread_data->thread_hwnd = create_thread_hwnd();
|
|
|
|
|
|
|
|
return thread_data->thread_hwnd;
|
|
|
|
}
|
|
|
|
|
|
|
|
thread_data_t *get_thread_data(BOOL create)
|
|
|
|
{
|
|
|
|
thread_data_t *thread_data;
|
|
|
|
|
2009-05-24 23:17:03 +02:00
|
|
|
if(mshtml_tls == TLS_OUT_OF_INDEXES) {
|
|
|
|
DWORD tls;
|
|
|
|
|
|
|
|
if(!create)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
tls = TlsAlloc();
|
|
|
|
if(tls == TLS_OUT_OF_INDEXES)
|
2006-09-24 23:10:38 +02:00
|
|
|
return NULL;
|
2009-05-24 23:17:03 +02:00
|
|
|
|
|
|
|
tls = InterlockedCompareExchange((LONG*)&mshtml_tls, tls, TLS_OUT_OF_INDEXES);
|
|
|
|
if(tls != mshtml_tls)
|
|
|
|
TlsFree(tls);
|
2006-09-24 23:10:38 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
thread_data = TlsGetValue(mshtml_tls);
|
|
|
|
if(!thread_data && create) {
|
2007-12-05 21:52:31 +01:00
|
|
|
thread_data = heap_alloc_zero(sizeof(thread_data_t));
|
2012-10-19 11:56:59 +02:00
|
|
|
if(!thread_data)
|
|
|
|
return NULL;
|
|
|
|
|
2006-09-24 23:10:38 +02:00
|
|
|
TlsSetValue(mshtml_tls, thread_data);
|
2014-12-24 13:09:59 +01:00
|
|
|
list_init(&thread_data->task_list);
|
2008-04-21 18:21:19 +02:00
|
|
|
list_init(&thread_data->timer_list);
|
2006-09-24 23:10:38 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
return thread_data;
|
|
|
|
}
|
2021-04-22 01:49:11 +02:00
|
|
|
|
|
|
|
ULONGLONG get_time_stamp(void)
|
|
|
|
{
|
|
|
|
FILETIME time;
|
|
|
|
|
|
|
|
/* 1601 to 1970 is 369 years plus 89 leap days */
|
|
|
|
const ULONGLONG time_epoch = (ULONGLONG)(369 * 365 + 89) * 86400 * 1000;
|
|
|
|
|
|
|
|
GetSystemTimeAsFileTime(&time);
|
|
|
|
return (((ULONGLONG)time.dwHighDateTime << 32) + time.dwLowDateTime) / 10000 - time_epoch;
|
|
|
|
}
|