Question about WTS fucntions
-
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...
-
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...
-
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?
What did GetLastError() return from the WTSEnumerateSessions() and did WTSEnumerateSessions() return a non-zero value?
-
What did GetLastError() return from the WTSEnumerateSessions() and did WTSEnumerateSessions() return a non-zero value?
-
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.
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.
-
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.