nt: put parentheses around parameter list in X macro

This commit is contained in:
Bert Belder 2017-09-04 05:07:25 +02:00
parent 8520557b03
commit 6a92d5e905
2 changed files with 21 additions and 22 deletions

View File

@ -3,8 +3,8 @@
#include "nt.h"
#include "win.h"
#define X(return_type, declarators, name, ...) \
return_type(declarators* name)(__VA_ARGS__) = NULL;
#define X(return_type, declarators, name, parameters) \
return_type(declarators* name) parameters = NULL;
NTDLL_IMPORT_LIST(X)
#undef X
@ -15,10 +15,9 @@ int nt_initialize() {
if (ntdll == NULL)
return -1;
#define X(return_type, declarators, name, ...) \
name = \
(return_type(declarators*)(__VA_ARGS__)) GetProcAddress(ntdll, #name); \
if (name == NULL) \
#define X(return_type, declarators, name, parameters) \
name = (return_type(declarators*) parameters) GetProcAddress(ntdll, #name); \
if (name == NULL) \
return -1;
NTDLL_IMPORT_LIST(X)
#undef X

View File

@ -18,23 +18,23 @@ typedef VOID(NTAPI* PIO_APC_ROUTINE)(PVOID ApcContext,
PIO_STATUS_BLOCK IoStatusBlock,
ULONG Reserved);
#define NTDLL_IMPORT_LIST(X) \
X(NTSTATUS, \
NTAPI, \
NtDeviceIoControlFile, \
HANDLE FileHandle, \
HANDLE Event, \
PIO_APC_ROUTINE ApcRoutine, \
PVOID ApcContext, \
PIO_STATUS_BLOCK IoStatusBlock, \
ULONG IoControlCode, \
PVOID InputBuffer, \
ULONG InputBufferLength, \
PVOID OutputBuffer, \
ULONG OutputBufferLength)
#define NTDLL_IMPORT_LIST(X) \
X(NTSTATUS, \
NTAPI, \
NtDeviceIoControlFile, \
(HANDLE FileHandle, \
HANDLE Event, \
PIO_APC_ROUTINE ApcRoutine, \
PVOID ApcContext, \
PIO_STATUS_BLOCK IoStatusBlock, \
ULONG IoControlCode, \
PVOID InputBuffer, \
ULONG InputBufferLength, \
PVOID OutputBuffer, \
ULONG OutputBufferLength)) \
#define X(return_type, declarators, name, ...) \
extern return_type(declarators* name)(__VA_ARGS__);
#define X(return_type, declarators, name, parameters) \
extern return_type(declarators* name) parameters;
NTDLL_IMPORT_LIST(X)
#undef X