aboutsummaryrefslogtreecommitdiffstats
path: root/api/adapter.c
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2020-11-03 11:00:53 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2020-11-03 11:01:20 +0100
commit64f39cd95d16342f3adb092cdf060e8e989b213a (patch)
tree2986602c1765526b9dccc0f6897a41d3976dd167 /api/adapter.c
parentexample: remove extra argument from print (diff)
downloadwintun-64f39cd95d16342f3adb092cdf060e8e989b213a.tar.xz
wintun-64f39cd95d16342f3adb092cdf060e8e989b213a.zip
api: only return top two version nibbles
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'api/adapter.c')
-rw-r--r--api/adapter.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/api/adapter.c b/api/adapter.c
index 2b56dca..560f5f3 100644
--- a/api/adapter.c
+++ b/api/adapter.c
@@ -1070,10 +1070,10 @@ VersionOfInf(_Out_ FILETIME *DriverDate, _Out_ DWORDLONG *DriverVersion)
return ERROR_FILE_NOT_FOUND;
}
-static DWORDLONG
+static DWORD
VersionOfFile(_In_z_ const WCHAR *Filename)
{
- DWORDLONG Version = 0;
+ DWORD Version = 0;
DWORD Zero;
DWORD Len = GetFileVersionInfoSizeW(Filename, &Zero);
if (!Len)
@@ -1096,7 +1096,7 @@ VersionOfFile(_In_z_ const WCHAR *Filename)
LOG_LAST_ERROR(L"Failed to get version info root");
goto out;
}
- Version = (DWORDLONG)FixedInfo->dwFileVersionLS | ((DWORDLONG)FixedInfo->dwFileVersionMS << 32);
+ Version = FixedInfo->dwFileVersionMS;
out:
HeapFree(ModuleHeap, 0, VersionInfo);
return Version;
@@ -1125,10 +1125,10 @@ CreateTemporaryDirectory(_Out_cap_c_(MAX_PATH) WCHAR *RandomTempSubDirectory)
return ERROR_SUCCESS;
}
-DWORDLONG
+DWORD
WintunGetVersion(void)
{
- DWORDLONG Version = 0;
+ DWORD Version = 0;
PRTL_PROCESS_MODULES Modules;
ULONG BufferSize = 128 * 1024;
for (;;)