typedef question
Im looking at (Win32 C) code and I see this typedef declaration:
typedef NTSTATUS(WINAPI* NtQueryInformationProcess_t)(
IN HANDLE,
IN PROCESSINFOCLASS,
OUT PVOID,
IN ULONG,
OUT PULONG
);
So the old datatype is NTSTATUS. This person is changing it to what though?
There doesnt seem to be a new identifier/alias and I dont understand why this is done.
Posted Apr 9, 2022, 7:53 PM UTC
14
It is changed into NtQueryInformationProcess_t, the original type was a function pointer that takes in the 5 arguments and returns something of type NTSTATUS.
Thanks for you input. One more thing
So the alias is NtQueryInformationProcess_t.... but what is the original type? There is nothing inbetween the "NTSTATUS(WINAPI* NtQueryInformationProcess_t)" and typedef for the original type
The original type is NTSTATUS (WINAPI*)(
IN HANDLE,
IN PROCESSINFOCLASS,
OUT PVOID,
IN ULONG,
OUT PULONG
); or a pointer to a WINAPI function that takes five arguments and returns an NTSTATUS
typedef for function pointers works by putting the name of the alias where the name of the function pointer would normally go.