winsiderss / phnt

Native API header files for the System Informer project.

Home Page:https://github.com/winsiderss/systeminformer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

error C2061: syntax error: identifier 'QUEUE_USER_APC_FLAGS'

mrexodia opened this issue · comments

The latest version doesn't work when you do:

#include <phnt_windows.h>
#include <phnt.h>

Because of:

NTSYSCALLAPI
NTSTATUS
NTAPI
ZwQueueApcThreadEx2(
    _In_ HANDLE ThreadHandle,
    _In_opt_ HANDLE ReserveHandle, // NtAllocateReserveObject
    _In_ QUEUE_USER_APC_FLAGS ApcFlags, // <== errors here
    _In_ PPS_APC_ROUTINE ApcRoutine,
    _In_opt_ PVOID ApcArgument1,
    _In_opt_ PVOID ApcArgument2,
    _In_opt_ PVOID ApcArgument3
    );

This API should probably be guarded by a Windows 11 check?

I see. Looks like you're using an older SDK (10.0.19041 or below) that doesn't include QUEUE_USER_APC_FLAGS. I'll update the fallback definition in phnt shortly. Until then, you can use a workaround:

#define PHNT_VERSION PHNT_WIN11
#include <phnt_windows.h>
#include <phnt.h>

Yeah I would expect the headers to work with the SDK version for the PHNT_VERSION you use. For now I switched to an older version and that seems to work!

Seems to be fixed by 0fc01f1, thanks!