Results 1 to 3 of 3

Thread: WTS API Call

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2001
    Location
    Vermont
    Posts
    2

    Unhappy WTS API Call

    To my knowledge, the API routines for Windows Terminal Server are not documented on allapi.net. I can call some of them from VB, but I can' get WTSQuerySessionInformation to work. I think it might have something to do with the enum field you have to pass it, WTS_INFO_CLASS. Maybe VB doesn't pass enum fields to C. Has anybody called this routine successfully?

    Thanks,

    Ken

  2. #2
    jim mcnamara
    Guest
    Enums in start counting from zero, they are passed ByVal as Integer. Start with the first one - it's zero, the next one in the enum is 1, next 2, etc.

    Here is the enum:
    Code:
    typedef enum _WTS_INFO_CLASS {
      WTSInitialProgram,             0
      WTSApplicationName,         1
      WTSWorkingDirectory,        2  ,etc.
      WTSOEMId,
      WTSSessionId,
      WTSUserName,
      WTSWinStationName,
      WTSDomainName,
      WTSConnectState,
      WTSClientBuildNumber,
      WTSClientName,
      WTSClientDirectory,
      WTSClientProductId,
      WTSClientHardwareId,
      WTSClientAddress,
      WTSClientDisplay,
      WTSClientProtocolType
    } 
    WTS_INFO_CLASS;
    Pick one of the values, eg.:

    Const WTSWorkingDirectory = 2

    and pass it as a constant ByVal.

  3. #3

    Thread Starter
    New Member
    Join Date
    Nov 2001
    Location
    Vermont
    Posts
    2

    Re: Api Call

    Must be something else wrong. Still get a "false" on the return status from the call, but GetLastError returns a 0. I found a chunk of sample code on a microsoft.public newsgroup which I'm going to try.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width