PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 2024 → Terminal Server API-call from windev
Terminal Server API-call from windev
Débuté par Barry Debbaut, 04 juin 2003 16:49 - 1 réponse
Posté le 04 juin 2003 - 16:49
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
Posté le 04 juin 2003 - 18:56
"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