aboutsummaryrefslogtreecommitdiffstats
path: root/api
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
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')
-rw-r--r--api/adapter.c10
-rw-r--r--api/wintun.h2
2 files changed, 6 insertions, 6 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 (;;)
diff --git a/api/wintun.h b/api/wintun.h
index 09d53b2..d6b8444 100644
--- a/api/wintun.h
+++ b/api/wintun.h
@@ -190,7 +190,7 @@ typedef WINTUN_STATUS(
*
* @return The version number on success, or 0 if failure or Wintun not loaded.
*/
-typedef DWORDLONG(WINAPI *WINTUN_GET_VERSION_FUNC)(void);
+typedef DWORD(WINAPI *WINTUN_GET_VERSION_FUNC)(void);
typedef enum _WINTUN_LOGGER_LEVEL
{