diff --git a/api/api.c b/api/api.c index e7c4262..965f893 100644 --- a/api/api.c +++ b/api/api.c @@ -3,7 +3,7 @@ * Copyright (C) 2018-2020 WireGuard LLC. All Rights Reserved. */ -#include "api.h" +#include "pch.h" HINSTANCE ResourceModule; diff --git a/api/api.vcxproj b/api/api.vcxproj index b104d27..8383455 100644 --- a/api/api.vcxproj +++ b/api/api.vcxproj @@ -115,6 +115,8 @@ _WINDOWS;_USRDLL;%(PreprocessorDefinitions) + Use + pch.h ..\$(WintunPlatform)\$(Configuration);%(AdditionalIncludeDirectories) @@ -156,12 +158,16 @@ + + + Create + diff --git a/api/api.vcxproj.filters b/api/api.vcxproj.filters index b418dd1..2016316 100644 --- a/api/api.vcxproj.filters +++ b/api/api.vcxproj.filters @@ -28,6 +28,9 @@ Header Files + + Header Files + @@ -45,5 +48,8 @@ Source Files + + Source Files + \ No newline at end of file diff --git a/api/devmgmt.c b/api/devmgmt.c index b8b594d..7f6d735 100644 --- a/api/devmgmt.c +++ b/api/devmgmt.c @@ -3,12 +3,7 @@ * Copyright (C) 2018-2020 WireGuard LLC. All Rights Reserved. */ -#include "api.h" -#include -#include -#include -#include -#include +#include "pch.h" #define WINTUN_HWID L"Wintun" #define WAIT_FOR_REGISTRY_TIMEOUT 10000 /* ms */ diff --git a/api/namespace.c b/api/namespace.c index 6020469..7807847 100644 --- a/api/namespace.c +++ b/api/namespace.c @@ -3,9 +3,7 @@ * Copyright (C) 2018-2020 WireGuard LLC. All Rights Reserved. */ -#include "api.h" -#include -#include +#include "pch.h" static SECURITY_ATTRIBUTES SecurityAttributes = { .nLength = sizeof(SECURITY_ATTRIBUTES) }; static BOOL HasInitialized = FALSE; diff --git a/api/nci.c b/api/nci.c index 52b8e54..119d5e9 100644 --- a/api/nci.c +++ b/api/nci.c @@ -3,7 +3,7 @@ * Copyright (C) 2018-2020 WireGuard LLC. All Rights Reserved. */ -#include "api.h" +#include "pch.h" static HMODULE NciModule; diff --git a/api/pch.c b/api/pch.c new file mode 100644 index 0000000..6ea6d44 --- /dev/null +++ b/api/pch.c @@ -0,0 +1,6 @@ +/* SPDX-License-Identifier: GPL-2.0 + * + * Copyright (C) 2018-2020 WireGuard LLC. All Rights Reserved. + */ + +#include "pch.h" diff --git a/api/pch.h b/api/pch.h new file mode 100644 index 0000000..5767deb --- /dev/null +++ b/api/pch.h @@ -0,0 +1,17 @@ +/* SPDX-License-Identifier: GPL-2.0 + * + * Copyright (C) 2018-2020 WireGuard LLC. All Rights Reserved. + */ + +#pragma once + +#include "api.h" + +#include +#include +#include +#include +#include +#include +#include +#include diff --git a/api/registry.c b/api/registry.c index 53af8bb..d75f635 100644 --- a/api/registry.c +++ b/api/registry.c @@ -3,9 +3,7 @@ * Copyright (C) 2018-2020 WireGuard LLC. All Rights Reserved. */ -#include "api.h" -#include -#include +#include "pch.h" static WINTUN_STATUS OpenKeyWait(_In_ HKEY Key, _Inout_z_ LPWSTR Path, _In_ DWORD Access, _In_ ULONGLONG Deadline, _Out_ HKEY *KeyOut)