📄 ethgsec_x86.c
字号:
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// Use of this source code is subject to the terms of the Microsoft end-user
// license agreement (EULA) under which you licensed this SOFTWARE PRODUCT.
// If you did not accept the terms of the EULA, you are not authorized to use
// this source code. For a copy of the EULA, please see the LICENSE.RTF on your
// install media.
//
// -----------------------------------------------------------------------------
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//
// -----------------------------------------------------------------------------
#include <windows.h>
#include <nkintr.h>
#include <oal.h>
#include <oal_kitl.h>
static DWORD dwLastTime; // For making sure we aren't running backward
static DWORD dwBias;
extern BOOL g_fPostInit;
DWORD
OEMKitlGetSecs()
{
SYSTEMTIME st;
DWORD dwRet;
// after post-init, it's possible that someone is holding RTC CS, and we cannot safely call OEMGetRealTime while in KITL.
// Use CurMSec directly after post init.
// NOTE: if this function is called while interrupts are off, time not advance.
//
if (!g_fPostInit) {
OEMGetRealTime( &st );
dwRet = ((60UL * (60UL * (24UL * (31UL * st.wMonth + st.wDay) + st.wHour) + st.wMinute)) + st.wSecond);
dwBias = dwRet;
} else {
dwRet = (CurMSec/1000) + dwBias;
}
if (dwRet < dwLastTime) {
KITLOutputDebugString ("! Time went backwards (or wrapped): cur: %u, last %u\n",
dwRet,dwLastTime);
}
dwLastTime = dwRet;
return (dwRet);
}
UINT32 OALGetTickCount()
{
return OEMKitlGetSecs () * 1000;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -