aboutsummaryrefslogtreecommitdiffstats
path: root/api/api.c
diff options
context:
space:
mode:
Diffstat (limited to 'api/api.c')
-rw-r--r--api/api.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/api/api.c b/api/api.c
index e48e94d..7735a24 100644
--- a/api/api.c
+++ b/api/api.c
@@ -6,8 +6,9 @@
#include "pch.h"
HINSTANCE ResourceModule;
+HANDLE ModuleHeap;
static SECURITY_ATTRIBUTES SecurityAttributesSystem = { .nLength = sizeof(SECURITY_ATTRIBUTES) };
-SECURITY_ATTRIBUTES *SecurityAttributes = NULL;
+SECURITY_ATTRIBUTES *SecurityAttributes;
WINTUN_STATUS WINAPI
WintunGetVersion(
@@ -56,6 +57,7 @@ DllMain(_In_ HINSTANCE hinstDLL, _In_ DWORD fdwReason, _In_ LPVOID lpvReserved)
{
case DLL_PROCESS_ATTACH:
ResourceModule = hinstDLL;
+ ModuleHeap = HeapCreate(0, 0, 0);
#ifndef _DEBUG
ConvertStringSecurityDescriptorToSecurityDescriptorW(
L"O:SYD:P(A;;GA;;;SY)", SDDL_REVISION_1, &SecurityAttributesSystem.lpSecurityDescriptor, NULL);
@@ -73,6 +75,7 @@ DllMain(_In_ HINSTANCE hinstDLL, _In_ DWORD fdwReason, _In_ LPVOID lpvReserved)
#ifndef _DEBUG
LocalFree(SecurityAttributesSystem.lpSecurityDescriptor);
#endif
+ HeapDestroy(ModuleHeap);
break;
}
return TRUE;