Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Question about WTS fucntions

Question about WTS fucntions

Scheduled Pinned Locked Moved C / C++ / MFC
questiondatabasesysadminhelp
6 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • 4 Offline
    4 Offline
    4apai
    wrote on last edited by
    #1

    hallo. i need your help. i want to list sessions on a remote terminal server. i use next code: HANDLE hServer = WTSOpenServer("WMWareComputer"); // hServer is set to NULL; DWORD dwError = GetLastError(); // dwError is set to 5 (Access Denied) As i undersatnd i've insufficient access rights on a remote computer. in documentation i find that i need to have QUERY_INFORMATION access rights to view this specific information. How can i change access rights? in the next case i get following results: HANDLE hServer = WTSOpenServer("RemoteComputer"); // hServer is initialized with a real value, smth like 0x04548343; DWORD dwError = GetLastError(); // dwError is set to 0 (all is ok) BOOL bRet = WTSEnumerateSessions(hServer, 0, 1, &wtsSessionInfo, &dwCount); // bRet is true. all is ok. // But dwCount is 0. but i know for sure that there're some sessions. and one more. when i execute those code on specified machines directly, they return good results. what do i do wrang? waiting for your ideas, discussions...

    4 1 Reply Last reply
    0
    • 4 4apai

      hallo. i need your help. i want to list sessions on a remote terminal server. i use next code: HANDLE hServer = WTSOpenServer("WMWareComputer"); // hServer is set to NULL; DWORD dwError = GetLastError(); // dwError is set to 5 (Access Denied) As i undersatnd i've insufficient access rights on a remote computer. in documentation i find that i need to have QUERY_INFORMATION access rights to view this specific information. How can i change access rights? in the next case i get following results: HANDLE hServer = WTSOpenServer("RemoteComputer"); // hServer is initialized with a real value, smth like 0x04548343; DWORD dwError = GetLastError(); // dwError is set to 0 (all is ok) BOOL bRet = WTSEnumerateSessions(hServer, 0, 1, &wtsSessionInfo, &dwCount); // bRet is true. all is ok. // But dwCount is 0. but i know for sure that there're some sessions. and one more. when i execute those code on specified machines directly, they return good results. what do i do wrang? waiting for your ideas, discussions...

      4 Offline
      4 Offline
      4apai
      wrote on last edited by
      #2

      its me again i found where can i set user access rights on terminal server. and set full control for everyone. but still've the same problem. what can be wrong?

      B 1 Reply Last reply
      0
      • 4 4apai

        its me again i found where can i set user access rights on terminal server. and set full control for everyone. but still've the same problem. what can be wrong?

        B Offline
        B Offline
        Blake Miller
        wrote on last edited by
        #3

        What did GetLastError() return from the WTSEnumerateSessions() and did WTSEnumerateSessions() return a non-zero value?

        4 1 Reply Last reply
        0
        • B Blake Miller

          What did GetLastError() return from the WTSEnumerateSessions() and did WTSEnumerateSessions() return a non-zero value?

          4 Offline
          4 Offline
          4apai
          wrote on last edited by
          #4

          after enumaratesessions : GetLastError return 0. and the result is true (non-zero); all is ok. looks like it must be so. but it it shioldn't.

          B 1 Reply Last reply
          0
          • 4 4apai

            after enumaratesessions : GetLastError return 0. and the result is true (non-zero); all is ok. looks like it must be so. but it it shioldn't.

            B Offline
            B Offline
            Blake Miller
            wrote on last edited by
            #5

            I am sorry I do not know more about your specific problem. I was trying to help you rule out obvious mistakes, and I only ever enumerated sessions on the local server.

            4 1 Reply Last reply
            0
            • B Blake Miller

              I am sorry I do not know more about your specific problem. I was trying to help you rule out obvious mistakes, and I only ever enumerated sessions on the local server.

              4 Offline
              4 Offline
              4apai
              wrote on last edited by
              #6

              thx anyway. thats the way people solve problems here. nobody know everything. everyone know only some specific part. 4apai There're no impossible tasks. There're tasks that required infinite period of execution time.

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups