diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2020-11-01 05:54:56 +0100 |
---|---|---|
committer | Simon Rozman <simon@rozman.si> | 2020-11-02 09:17:47 +0100 |
commit | b5836e9fb9b78c6b9034a735034610c7a97276a1 (patch) | |
tree | a83175eb34477ffd938203fd5db05078af8b91ec /api/entry.c | |
parent | api: avoid call to CM_Get_DevNode_Status (diff) | |
download | wintun-b5836e9fb9b78c6b9034a735034610c7a97276a1.tar.xz wintun-b5836e9fb9b78c6b9034a735034610c7a97276a1.zip |
api: make version function uniform
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'api/entry.c')
-rw-r--r-- | api/entry.c | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/api/entry.c b/api/entry.c index 2232c18..3dd42bb 100644 --- a/api/entry.c +++ b/api/entry.c @@ -22,39 +22,6 @@ HINSTANCE ResourceModule; HANDLE ModuleHeap; SECURITY_ATTRIBUTES SecurityAttributes = { .nLength = sizeof(SECURITY_ATTRIBUTES) }; -WINTUN_STATUS WINAPI -WintunGetVersion( - _Out_ DWORD *DriverVersionMaj, - _Out_ DWORD *DriverVersionMin, - _Out_ DWORD *NdisVersionMaj, - _Out_ DWORD *NdisVersionMin) -{ - HKEY Key; - DWORD Result = - RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"SYSTEM\\CurrentControlSet\\Services\\Wintun", 0, KEY_QUERY_VALUE, &Key); - if (Result != ERROR_SUCCESS) - return LOG_ERROR(L"Failed to open registry key", Result); - if (RegistryQueryDWORD(Key, L"DriverMajorVersion", DriverVersionMaj, FALSE) != ERROR_SUCCESS || - RegistryQueryDWORD(Key, L"DriverMinorVersion", DriverVersionMin, FALSE) != ERROR_SUCCESS) - { - /* TODO: Drop the fallback to WINTUN_VERSION_MAJ & WINTUN_VERSION_MIN when Windows 7 support is discontinued. */ - *DriverVersionMaj = WINTUN_VERSION_MAJ; - *DriverVersionMin = WINTUN_VERSION_MIN; - } - Result = RegistryQueryDWORD(Key, L"NdisMajorVersion", NdisVersionMaj, TRUE); - if (Result != ERROR_SUCCESS) - { - LOG(WINTUN_LOG_ERR, L"Failed to query NdisMajorVersion value"); - goto cleanupKey; - } - Result = RegistryQueryDWORD(Key, L"NdisMinorVersion", NdisVersionMin, TRUE); - if (Result != ERROR_SUCCESS) - LOG(WINTUN_LOG_ERR, L"Failed to query NdisMinorVersion value"); -cleanupKey: - RegCloseKey(Key); - return Result; -} - static FARPROC WINAPI DelayedLoadLibraryHook(unsigned dliNotify, PDelayLoadInfo pdli) { if (dliNotify != dliNotePreLoadLibrary) |