diff --git a/src/nt.c b/src/nt.c index b9133e0..4c8293b 100644 --- a/src/nt.c +++ b/src/nt.c @@ -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 diff --git a/src/nt.h b/src/nt.h index 177b40d..fac3919 100644 --- a/src/nt.h +++ b/src/nt.h @@ -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