2020-07-03 12:26:06 +02:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0
|
|
|
|
*
|
|
|
|
* Copyright (C) 2018-2020 WireGuard LLC. All Rights Reserved.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "api.h"
|
|
|
|
|
|
|
|
HINSTANCE ResourceModule;
|
|
|
|
|
|
|
|
BOOL APIENTRY
|
|
|
|
DllMain(_In_ HINSTANCE hinstDLL, _In_ DWORD fdwReason, _In_ LPVOID lpvReserved)
|
|
|
|
{
|
|
|
|
UNREFERENCED_PARAMETER(lpvReserved);
|
|
|
|
|
|
|
|
switch (fdwReason)
|
|
|
|
{
|
|
|
|
case DLL_PROCESS_ATTACH:
|
|
|
|
ResourceModule = hinstDLL;
|
2020-07-03 16:49:47 +02:00
|
|
|
NamespaceInit();
|
2020-07-07 15:32:06 +02:00
|
|
|
NciInit();
|
2020-07-03 16:49:47 +02:00
|
|
|
break;
|
|
|
|
|
2020-07-03 12:26:06 +02:00
|
|
|
case DLL_PROCESS_DETACH:
|
2020-07-07 15:32:06 +02:00
|
|
|
NciCleanup();
|
2020-07-03 16:49:47 +02:00
|
|
|
NamespaceCleanup();
|
2020-07-03 12:26:06 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
return TRUE;
|
|
|
|
}
|