summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--EmulatorPkg/Win/Host/WinThunk.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/EmulatorPkg/Win/Host/WinThunk.c b/EmulatorPkg/Win/Host/WinThunk.c
index 0abe4727e0..e1b158c2da 100644
--- a/EmulatorPkg/Win/Host/WinThunk.c
+++ b/EmulatorPkg/Win/Host/WinThunk.c
@@ -5,7 +5,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
Module Name:
- WinNtThunk.c
+ WinThunk.c
Abstract:
@@ -29,6 +29,8 @@ STATIC DWORD mOldStdInMode;
STATIC DWORD mOldStdOutMode;
#endif
+STATIC UINT64 mPerformanceFrequency = 0;
+
UINTN
SecWriteStdErr (
IN UINT8 *Buffer,
@@ -451,8 +453,13 @@ SecQueryPerformanceFrequency (
VOID
)
{
- // Hard code to nanoseconds
- return 1000000000ULL;
+ if (mPerformanceFrequency) {
+ return mPerformanceFrequency;
+ }
+
+ QueryPerformanceFrequency ((LARGE_INTEGER *)&mPerformanceFrequency);
+
+ return mPerformanceFrequency;
}
UINT64
@@ -460,7 +467,11 @@ SecQueryPerformanceCounter (
VOID
)
{
- return 0;
+ UINT64 PerformanceCount;
+
+ QueryPerformanceCounter ((LARGE_INTEGER *)&PerformanceCount);
+
+ return PerformanceCount;
}
VOID