wintun/api/nci.c
Simon Rozman 0a986ce9fc api: add pre-compiled header support
...for super-fast compilation.

Signed-off-by: Simon Rozman <simon@rozman.si>
2020-10-30 16:50:58 +01:00

35 lines
823 B
C

/* SPDX-License-Identifier: GPL-2.0
*
* Copyright (C) 2018-2020 WireGuard LLC. All Rights Reserved.
*/
#include "pch.h"
static HMODULE NciModule;
DWORD(WINAPI *NciSetConnectionName)(_In_ LPCGUID Guid, _In_z_ LPCWSTR NewName);
DWORD(WINAPI *NciGetConnectionName)
(_In_ LPCGUID Guid,
_Out_z_bytecap_(InDestNameBytes) LPWSTR Name,
_In_ DWORD InDestNameBytes,
_Out_opt_ DWORD *OutDestNameBytes);
void
NciInit()
{
NciModule = LoadLibraryW(L"nci.dll");
if (!NciModule)
return;
NciSetConnectionName = (DWORD(WINAPI *)(LPCGUID, LPCWSTR))GetProcAddress(NciModule, "NciSetConnectionName");
NciGetConnectionName =
(DWORD(WINAPI *)(LPCGUID, LPWSTR, DWORD, DWORD *))GetProcAddress(NciModule, "NciGetConnectionName");
}
void
NciCleanup()
{
if (NciModule)
FreeLibrary(NciModule);
}