Accessing API calls in .Net

CarlEOgden

Member
Joined
Feb 17, 2004
Messages
8
Hi,

Can anyone help me in converting this VB code to .NET ?

I need to access the Terminal Services API and havent worked out how to do the following:-

Public Declare Function WTSOpenServerA Lib "wtsapi32.dll" ( _
ByVal pServerName As String) As Long

Public Declare Function WTSCloseServer Lib "wtsapi32.dll" ( _
ByVal hServer As Long) As Long

Public Declare Function WTSEnumerateSessions _
Lib "wtsapi32.dll" Alias "WTSEnumerateSessionsA" ( _
ByVal hServer As Long, ByVal Reserved As Long, _
ByVal Version As Long, ByRef ppSessionInfo As Long, _
ByRef pCount As Long _
) As Long

Public Declare Function WTSQuerySessionInformation Lib "wtsapi32.dll" _
Alias "WTSQuerySessionInformationA" (ByVal hServer As Long, _
ByVal SessionID As Long, ByVal WTS_INFO_CLASS As WTSInfoClass, _
ByRef QSbuffer As Long, ByRef pCount As Long) As Long

Public Declare Sub WTSFreeMemory Lib "wtsapi32.dll" ( _
ByVal pMemory As Long)

Public Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" ( _
Destination As Any, Source As Any, ByVal Length As Long)

Public Declare Function lstrlenA Lib "kernel32" ( _
ByVal lpString As String) As Long

Public Declare Function lstrcpy Lib "kernel32" Alias "lstrcpyA" ( _
ByVal lpString1 As String, ByVal lpString2 As Long) As Long


Thanks for any help given.

Cheers,
Carl.
 
Back
Top