|
Terminal Server API-call from windev |
Iniciado por Barry Debbaut, jun., 04 2003 4:49 PM - 1 resposta |
| |
| | | |
|
| |
Publicado em junho, 04 2003 - 4:49 PM |
Using wtsapi32.dll, i would like to retrieve the 'WTSClientHardwareId' from a user who's running an application inside of a terminal server session.
I wrote the following code:
WTS_CURRENT_SERVER_HANDLE is long int = 0 WTS_CURRENT_SESSION is long int = -1 WTSClientHardWareId is long int = 13 // (WTSClientHardWareId=) ppBuffer is string ASCIIZ sur 256
pBytesReturned is long int = Dimension(&ppBuffer) Appeldll32("wtsapi32.dll","WTSQuerySessionInformationA", WTS_CURRENT_SERVER_HANDLE,WTS_CURRENT_SESSION,WTSClientHardWareId,&ppBuffer,&pBytesReturned))
Info("'"+ppBuffer+"'")
// Clear memory: AppelDLL32("wtsapi32.dll","WTSFreeMemory",&ppBuffer)
I'm getting a (numeric) result, but however, every time i run the function i'm getting a different result. (what i want is a unique identifier (like a nic-macadress) from the client). Does anyone has experience with this?
Thanks in advance,
Barry |
| |
| |
| | | |
|
| | |
| |
Publicado em junho, 04 2003 - 6:56 PM |
"Barry Debbaut" <b_d@zeelandnet.nl> wrote:
Using wtsapi32.dll, i would like to retrieve the 'WTSClientHardwareId' from a user who's running an application inside of a terminal server session.
I wrote the following code:
WTS_CURRENT_SERVER_HANDLE is long int = 0 WTS_CURRENT_SESSION is long int = -1 WTSClientHardWareId is long int = 13 // (WTSClientHardWareId=) ppBuffer is string ASCIIZ sur 256
pBytesReturned is long int = Dimension(&ppBuffer) Appeldll32("wtsapi32.dll","WTSQuerySessionInformationA", WTS_CURRENT_SERVER_HANDLE,WTS_CURRENT_SESSION,WTSClientHardWareId,&ppBuffer,&pBytesReturned))
Info("'"+ppBuffer+"'")
// Clear memory: AppelDLL32("wtsapi32.dll","WTSFreeMemory",&ppBuffer)
I'm getting a (numeric) result, but however, every time i run the function i'm getting a different result. (what i want is a unique identifier (like a nic-macadress) from the client). Does anyone has experience with this?
Thanks in advance,
Barry
Barry,
we use WTSQuerySessionInformation with WTSClientName for this. But be careful, with some combinations (TS, Citrix, RDP4 and/or RPP5) you will get the name of the workstation or the IP adress.
HTH
Raimund |
| |
| |
| | | |
|
| | | | |
| | |
|