2021-06-10 22:02:00 +03:00
|
|
|
// Copyright (c) Microsoft Corporation
|
|
|
|
// SPDX-License-Identifier: MIT
|
2021-02-06 22:39:57 +03:00
|
|
|
|
|
|
|
// dllmain.cpp : Defines the entry point for the DLL application.
|
|
|
|
#include "pch.h"
|
2022-01-31 19:32:28 +03:00
|
|
|
#include "api_internal.h"
|
2021-02-06 22:39:57 +03:00
|
|
|
|
2022-07-01 02:53:03 +03:00
|
|
|
bool use_ebpf_store = true;
|
|
|
|
|
2021-05-05 18:39:38 +03:00
|
|
|
BOOL APIENTRY
|
|
|
|
DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
|
|
|
|
{
|
|
|
|
UNREFERENCED_PARAMETER(hModule);
|
|
|
|
UNREFERENCED_PARAMETER(lpReserved);
|
|
|
|
switch (ul_reason_for_call) {
|
|
|
|
case DLL_PROCESS_ATTACH:
|
2022-01-31 19:32:28 +03:00
|
|
|
if (ebpf_api_initiate() != 0) {
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
break;
|
2021-05-05 18:39:38 +03:00
|
|
|
case DLL_THREAD_ATTACH:
|
2022-01-31 19:32:28 +03:00
|
|
|
break;
|
2021-05-05 18:39:38 +03:00
|
|
|
case DLL_THREAD_DETACH:
|
2022-01-31 19:32:28 +03:00
|
|
|
break;
|
2021-05-05 18:39:38 +03:00
|
|
|
case DLL_PROCESS_DETACH:
|
2022-01-31 19:32:28 +03:00
|
|
|
ebpf_api_terminate();
|
2021-05-05 18:39:38 +03:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
return TRUE;
|
2021-02-06 22:39:57 +03:00
|
|
|
}
|