diff --git a/api/adapter.c b/api/adapter.c index e229249..a51d437 100644 --- a/api/adapter.c +++ b/api/adapter.c @@ -21,7 +21,6 @@ # error Unsupported architecture #endif -static _locale_t Locale; static USHORT NativeMachine = IMAGE_FILE_PROCESS; WINTUN_STATUS @@ -330,8 +329,6 @@ AdapterDeleteAllOurs(void) void AdapterInit(void) { - Locale = _wcreate_locale(LC_ALL, L""); - #if defined(_M_IX86) || defined(_M_ARM) typedef BOOL(WINAPI * IsWow64Process2_t)( _In_ HANDLE hProcess, _Out_ USHORT * pProcessMachine, _Out_opt_ USHORT * pNativeMachine); @@ -349,12 +346,6 @@ AdapterInit(void) #endif } -void -AdapterCleanup(void) -{ - _free_locale(Locale); -} - static BOOL CheckReboot(_In_ HDEVINFO DevInfo, _In_ SP_DEVINFO_DATA *DevInfoData) { @@ -481,14 +472,14 @@ IsPoolMember( } WCHAR PoolDeviceTypeName[MAX_POOL_DEVICE_TYPE]; GetPoolDeviceTypeName(Pool, PoolDeviceTypeName); - if (!_wcsicmp_l(FriendlyName, PoolDeviceTypeName, Locale) || !_wcsicmp_l(DeviceDesc, PoolDeviceTypeName, Locale)) + if (!_wcsicmp(FriendlyName, PoolDeviceTypeName) || !_wcsicmp(DeviceDesc, PoolDeviceTypeName)) { *IsMember = TRUE; goto cleanupFriendlyName; } RemoveNumberedSuffix(FriendlyName, FriendlyName); RemoveNumberedSuffix(DeviceDesc, DeviceDesc); - if (!_wcsicmp_l(FriendlyName, PoolDeviceTypeName, Locale) || !_wcsicmp_l(DeviceDesc, PoolDeviceTypeName, Locale)) + if (!_wcsicmp(FriendlyName, PoolDeviceTypeName) || !_wcsicmp(DeviceDesc, PoolDeviceTypeName)) { *IsMember = TRUE; goto cleanupFriendlyName; @@ -630,10 +621,10 @@ WintunGetAdapter( if (NciGetConnectionName(&CfgInstanceID, Name2, sizeof(Name2), NULL) != ERROR_SUCCESS) continue; Name2[_countof(Name2) - 1] = 0; - if (_wcsicmp_l(Name, Name2, Locale)) + if (_wcsicmp(Name, Name2)) { RemoveNumberedSuffix(Name2, Name2); - if (_wcsicmp_l(Name, Name2, Locale)) + if (_wcsicmp(Name, Name2)) continue; } diff --git a/api/adapter.h b/api/adapter.h index 04a9983..7ac67ad 100644 --- a/api/adapter.h +++ b/api/adapter.h @@ -75,9 +75,6 @@ AdapterDeleteAllOurs(void); void AdapterInit(void); -void -AdapterCleanup(void); - /** * Wintun adapter descriptor. */ diff --git a/api/api.c b/api/api.c index 983596e..66daabc 100644 --- a/api/api.c +++ b/api/api.c @@ -65,7 +65,6 @@ DllMain(_In_ HINSTANCE hinstDLL, _In_ DWORD fdwReason, _In_ LPVOID lpvReserved) case DLL_PROCESS_DETACH: NciCleanup(); NamespaceCleanup(); - AdapterCleanup(); #ifndef _DEBUG LocalFree(SecurityAttributesSystem.lpSecurityDescriptor); #endif