diff options
Diffstat (limited to 'api/adapter.c')
-rw-r--r-- | api/adapter.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/api/adapter.c b/api/adapter.c index ba4467c..ec14d99 100644 --- a/api/adapter.c +++ b/api/adapter.c @@ -1452,8 +1452,13 @@ static _Return_type_success_(return != NULL) WINTUN_ADAPTER *CreateAdapter( if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, RegPath, 0, KEY_QUERY_VALUE, &Key) == ERROR_SUCCESS) { RegCloseKey(Key); - SetLastError(LOG_ERROR(ERROR_ALREADY_EXISTS, L"Requested GUID is already in use: %s", RequestedGUIDStr)); - return NULL; + NET_LUID Luid; + if (ConvertInterfaceGuidToLuid(RequestedGUID, &Luid) == NO_ERROR) + { + SetLastError( + LOG_ERROR(ERROR_ALREADY_EXISTS, L"Requested GUID is already in use: %s", RequestedGUIDStr)); + return NULL; + } } LOG(WINTUN_LOG_WARN, L"Requested GUID %s has leftover residue", RequestedGUIDStr); HANDLE OriginalToken; |