|Hey, @Randor, that works *great* !!!!!!!!!!! Thank you so much!!
I do have *one* minor issue with it, though...
Is this intended to be a 64-bit-only operation??
I use MinGW, not Visual C++, for all of my app development, and at this point, I still use a 32-bit compiler... However, I cannot build this with 32-bit MinGW:
> g++ -Wall -O2 login_lsa.cpp -o login_lsa.exe -lsecur32
login_lsa.cpp: In function 'INT main()':
login_lsa.cpp:14: error: 'LsaEnumerateLogonSessions' was not declared in this scope
login_lsa.cpp:17: error: 'PSECURITY_LOGON_SESSION_DATA' was not declared in this scope
login_lsa.cpp:17: error: expected ';' before 'pData'
login_lsa.cpp:19: error: 'pData' was not declared in this scope
login_lsa.cpp:19: error: 'LsaGetLogonSessionData' was not declared in this scope
I searched through *all* .h and .hpp files in c:\mingw, and these functions were not declared anywhere...
Mind ye, it *does* build and run just fine with 64-bit MinGW.
(in case anyone is not familiar with MinGW, it stands for Minimal Gnu for Windows, and is a port of the GNU toolchain to Windows, using Windows libraries for most services.)
My MinGW 32-bit toolchain *does* have netsecapi.h and secur32.lib (in its format), but these LSA functions appear to not be included...
I also tried current TDM build of MinGW, which is gcc 10.3.0, but it does not contain these functions either...