api: make #ifdef-s more descriptive
Suggested-by: Jason A. Donenfeld <Jason@zx2c4.com> Signed-off-by: Simon Rozman <simon@rozman.si>
This commit is contained in:
parent
4b0470210d
commit
eeb42a5f12
@ -329,7 +329,7 @@ AdapterDeleteAllOurs(void)
|
|||||||
void
|
void
|
||||||
AdapterInit(void)
|
AdapterInit(void)
|
||||||
{
|
{
|
||||||
#if defined(_M_IX86) || defined(_M_ARM)
|
#ifdef MAYBE_WOW64
|
||||||
typedef BOOL(WINAPI * IsWow64Process2_t)(
|
typedef BOOL(WINAPI * IsWow64Process2_t)(
|
||||||
_In_ HANDLE hProcess, _Out_ USHORT * pProcessMachine, _Out_opt_ USHORT * pNativeMachine);
|
_In_ HANDLE hProcess, _Out_ USHORT * pProcessMachine, _Out_opt_ USHORT * pNativeMachine);
|
||||||
HANDLE Kernel32;
|
HANDLE Kernel32;
|
||||||
@ -1255,7 +1255,7 @@ CreateTemporaryDirectory(_Out_cap_c_(MAX_PATH) WCHAR *RandomTempSubDirectory)
|
|||||||
return ERROR_SUCCESS;
|
return ERROR_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(_M_IX86) || defined(_M_ARM)
|
#ifdef MAYBE_WOW64
|
||||||
|
|
||||||
typedef struct _PROCESS_STDOUT_STATE
|
typedef struct _PROCESS_STDOUT_STATE
|
||||||
{
|
{
|
||||||
@ -1546,7 +1546,7 @@ WintunCreateAdapter(
|
|||||||
_Out_ WINTUN_ADAPTER **Adapter,
|
_Out_ WINTUN_ADAPTER **Adapter,
|
||||||
_Inout_ BOOL *RebootRequired)
|
_Inout_ BOOL *RebootRequired)
|
||||||
{
|
{
|
||||||
#if defined(_M_IX86) || defined(_M_ARM)
|
#ifdef MAYBE_WOW64
|
||||||
if (NativeMachine != IMAGE_FILE_PROCESS)
|
if (NativeMachine != IMAGE_FILE_PROCESS)
|
||||||
return CreateAdapterNatively(Pool, Name, RequestedGUID, Adapter, RebootRequired);
|
return CreateAdapterNatively(Pool, Name, RequestedGUID, Adapter, RebootRequired);
|
||||||
#endif
|
#endif
|
||||||
@ -1598,7 +1598,7 @@ cleanupDirectory:
|
|||||||
return Result;
|
return Result;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(_M_IX86) || defined(_M_ARM)
|
#ifdef MAYBE_WOW64
|
||||||
|
|
||||||
static WINTUN_STATUS
|
static WINTUN_STATUS
|
||||||
DeleteAdapterNatively(_In_ const WINTUN_ADAPTER *Adapter, _Inout_ BOOL *RebootRequired)
|
DeleteAdapterNatively(_In_ const WINTUN_ADAPTER *Adapter, _Inout_ BOOL *RebootRequired)
|
||||||
@ -1639,7 +1639,7 @@ cleanupArgv:
|
|||||||
WINTUN_STATUS WINAPI
|
WINTUN_STATUS WINAPI
|
||||||
WintunDeleteAdapter(_In_ const WINTUN_ADAPTER *Adapter, _Inout_ BOOL *RebootRequired)
|
WintunDeleteAdapter(_In_ const WINTUN_ADAPTER *Adapter, _Inout_ BOOL *RebootRequired)
|
||||||
{
|
{
|
||||||
#if defined(_M_IX86) || defined(_M_ARM)
|
#ifdef MAYBE_WOW64
|
||||||
if (NativeMachine != IMAGE_FILE_PROCESS)
|
if (NativeMachine != IMAGE_FILE_PROCESS)
|
||||||
return DeleteAdapterNatively(Adapter, RebootRequired);
|
return DeleteAdapterNatively(Adapter, RebootRequired);
|
||||||
#endif
|
#endif
|
||||||
|
@ -14,6 +14,13 @@
|
|||||||
# define _L(x) __L(x)
|
# define _L(x) __L(x)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(_M_IX86) || defined(_M_ARM)
|
||||||
|
#define MAYBE_WOW64
|
||||||
|
#endif
|
||||||
|
#if defined(_M_AMD64) || defined(_M_ARM64) || defined(_DEBUG)
|
||||||
|
#define ACCEPT_WOW64
|
||||||
|
#endif
|
||||||
|
|
||||||
extern HINSTANCE ResourceModule;
|
extern HINSTANCE ResourceModule;
|
||||||
extern HANDLE ModuleHeap;
|
extern HANDLE ModuleHeap;
|
||||||
extern SECURITY_ATTRIBUTES *SecurityAttributes;
|
extern SECURITY_ATTRIBUTES *SecurityAttributes;
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
#define EXPORT comment(linker, "/EXPORT:" __FUNCTION__ "=" __FUNCDNAME__)
|
#define EXPORT comment(linker, "/EXPORT:" __FUNCTION__ "=" __FUNCDNAME__)
|
||||||
|
|
||||||
#if defined(_M_AMD64) || defined(_M_ARM64) || defined(_DEBUG)
|
#ifdef ACCEPT_WOW64
|
||||||
|
|
||||||
static DWORD
|
static DWORD
|
||||||
WriteFormatted(_In_ DWORD StdHandle, _In_z_ const WCHAR *Template, ...)
|
WriteFormatted(_In_ DWORD StdHandle, _In_z_ const WCHAR *Template, ...)
|
||||||
|
Loading…
Reference in New Issue
Block a user