BOOL (WINAPI *ZTSQueryUserToken)(ULONG SessionId, PHANDLE phToken) = NULL;
To me it looks like a variable being created for a struct or something but I've never seen this type of syntax so can someone break it down for me?
WINAPI convention is usually used to call Win32 API functions.
WINAPI is simply __stdcall
:
#define WINAPI __stdcall
The __stdcall
calling convention has following characteristics in general:
__stdcall
and __cdecl
).So leaving behind __stdcall
, use the "Spiral Rule" to get
+----------------------+
| +----------------+ |
| | | |
| ^ | |
BOOL (WINAPI* ZTSQueryUserToken ) ( ULONG SessionId, PHANDLE phToken)
^ ^ | |
| +--------------------+ |
+---------------------------------+
Thus, Identifier:
ZTSQueryUserToken
is a__stdcall
) function having arguments of types ULONG
and PHANDLE
BOOL
And the pointer is assigned to NULL
in your case.