Your best bet is always to take one of the demo projects as the starting point for your own hook project, and then just change the hook dll source code. E.g. try the HookProcessCreation demo, and simply replace the CreateProcess etc API hooks with an WTSQuerySessionInformationA hook. It shouldn't be very hard to do. Just be very careful to make sure that both the hook callback function and the "next" function variable definition have the exactly correct list of parameters, calling convention and return type.