This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Wtsapi32.WTSQuerySessionInformationA to get WTSClientProtocolType
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Jul 07, 2014
02:56 PM
Wtsapi32.WTSQuerySessionInformationA to get WTSClientProtocolType
I've been trying with mixed luck to get the session type. Ironically I had this working at one point but it now fails to prove the correct answer.
#define WTS_CURRENT_SESSION -1
#define WTSClientProtocolType 16
#define WTS_CURRENT_SERVER_HANDLE 0
LONG nReturnBytes;
POINTER pointerToPointer;
SHORT nProtocol;
NUMBER nSuccess;
........
prototype stdcall Wtsapi32.WTSQuerySessionInformationA(NUMBER, NUMBER, NUMBER, POINTER, POINTER);
nSuccess = WTSQuerySessionInformationA(WTS_CURRENT_SERVER_HANDLE, WTS_CURRENT_SESSION, WTSClientProtocolType, &pointerToPointer, &nReturnBytes);
nProtocol = *pointerToPointer;
The return value is always non-0 (aka success) but Unfortunately nProtocol is not 0,1, or 2.
What am I doing wrong?
Thank you,
Dave
#define WTS_CURRENT_SESSION -1
#define WTSClientProtocolType 16
#define WTS_CURRENT_SERVER_HANDLE 0
LONG nReturnBytes;
POINTER pointerToPointer;
SHORT nProtocol;
NUMBER nSuccess;
........
prototype stdcall Wtsapi32.WTSQuerySessionInformationA(NUMBER, NUMBER, NUMBER, POINTER, POINTER);
nSuccess = WTSQuerySessionInformationA(WTS_CURRENT_SERVER_HANDLE, WTS_CURRENT_SESSION, WTSClientProtocolType, &pointerToPointer, &nReturnBytes);
nProtocol = *pointerToPointer;
The return value is always non-0 (aka success) but Unfortunately nProtocol is not 0,1, or 2.
What am I doing wrong?
Thank you,
Dave
(1) Reply
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Jul 21, 2014
09:48 AM
I've changed my code again and it works fine
prototype stdcall wtsapi32.WTSQuerySessionInformationA(NUMBER, NUMBER, NUMBER, BYREF POINTER, BYREF LONG);
LONG nReturnBytes;
POINTER pointerToPointer;
nSuccess = wtsapi32.WTSQuerySessionInformationA(WTS_CURRENT_SERVER_HANDLE, WTS_CURRENT_SESSION, WTSClientProtocolType, pointerToPointer, nReturnBytes);
UNTIL the script calls
nResult = SdWelcome( szTitle, szMsg );
After which the values come back corrupted. Why would calls to this installshield function cause the DLL to go from working to failing?
Thanks.
prototype stdcall wtsapi32.WTSQuerySessionInformationA(NUMBER, NUMBER, NUMBER, BYREF POINTER, BYREF LONG);
LONG nReturnBytes;
POINTER pointerToPointer;
nSuccess = wtsapi32.WTSQuerySessionInformationA(WTS_CURRENT_SERVER_HANDLE, WTS_CURRENT_SESSION, WTSClientProtocolType, pointerToPointer, nReturnBytes);
UNTIL the script calls
nResult = SdWelcome( szTitle, szMsg );
After which the values come back corrupted. Why would calls to this installshield function cause the DLL to go from working to failing?
Thanks.
![](/skins/images/8CE4FAD0DE6F3A6F9D0567434D2D2DAE/responsive_peak/images/icon_anonymous_message.png)