aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--api/adapter.c10
-rw-r--r--api/wintun.h2
-rw-r--r--example/example.c6
3 files changed, 8 insertions, 10 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
{
diff --git a/example/example.c b/example/example.c
index a52740f..814cd57 100644
--- a/example/example.c
+++ b/example/example.c
@@ -314,11 +314,9 @@ main(void)
goto cleanupQuit;
}
- DWORDLONG Version = WintunGetVersion();
+ DWORD Version = WintunGetVersion();
Log(WINTUN_LOG_INFO,
- L"Wintun v%d.%d.%d.%d loaded",
- (Version >> 48) & 0xff,
- (Version >> 32) & 0xff,
+ L"Wintun v%u.%u loaded",
(Version >> 16) & 0xff,
(Version >> 0) & 0xff);