Package com.sun.jna.platform.win32
Interface Wtsapi32
- All Superinterfaces:
- AltCallingConvention,- Library,- StdCall,- StdCallLibrary
- 
Nested Class SummaryNested ClassesModifier and TypeInterfaceDescriptionstatic classContains the client network address of a Remote Desktop Services session.static interfaceSpecifies the connection state of a Remote Desktop Services session.static interfaceContains values that indicate the type of session information to retrieve in a call to theWTSQuerySessionInformation(com.sun.jna.platform.win32.WinNT.HANDLE, int, int, com.sun.jna.ptr.PointerByReference, com.sun.jna.ptr.IntByReference)function.static classContains extended information about a process running on a Remote Desktop Session Host (RD Session Host) server.static classContains information about a client session on a Remote Desktop Session Host (RD Session Host) server.static classContains information about a Remote Desktop Services session.Nested classes/interfaces inherited from interface com.sun.jna.LibraryLibrary.HandlerNested classes/interfaces inherited from interface com.sun.jna.win32.StdCallLibraryStdCallLibrary.StdCallCallback
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final intDefined inwinsta.hand present in this interface to properly size theWtsapi32.WTSINFOstructure.static final Wtsapi32static final intstatic final intstatic final intDefined inwinsta.hand present in this interface to properly size theWtsapi32.WTSINFOstructure.static final intDefined inwinsta.hand present in this interface to properly size theWtsapi32.WTSINFOstructure.static final intSpecifies any-session (SessionId)static final intThe session identified by lParam was connected to the console terminal or RemoteFX session.static final intThe session identified by lParam was disconnected from the console terminal or RemoteFX session.static final WinNT.HANDLESpecifies the current serverstatic final intSpecifies the current session (SessionId)static final intstatic final intstatic final intThe session identified by lParam was connected to the remote terminal.static final intThe session identified by lParam was disconnected from the remote terminal.static final intThe session identified by lParam has been locked.static final intA user has logged off the session identified by lParam.static final intA user has logged on to the session identified by lParam.static final intThe session identified by lParam has changed its remote controlled status.static final intThe session identified by lParam has been unlocked.Fields inherited from interface com.sun.jna.LibraryOPTION_ALLOW_OBJECTS, OPTION_CALLING_CONVENTION, OPTION_CLASSLOADER, OPTION_FUNCTION_MAPPER, OPTION_INVOCATION_MAPPER, OPTION_OPEN_FLAGS, OPTION_STRING_ENCODING, OPTION_STRUCTURE_ALIGNMENT, OPTION_SYMBOL_PROVIDER, OPTION_TYPE_MAPPERFields inherited from interface com.sun.jna.win32.StdCallLibraryFUNCTION_MAPPER, STDCALL_CONVENTION
- 
Method SummaryModifier and TypeMethodDescriptionbooleanWTSEnumerateProcessesEx(WinNT.HANDLE hServer, IntByReference pLevel, int SessionID, PointerByReference ppProcessInfo, IntByReference pCount) Retrieves information about the active processes on the specified Remote Desktop Session Host (RD Session Host) server or Remote Desktop Virtualization Host (RD Virtualization Host) server.booleanWTSEnumerateSessions(WinNT.HANDLE hServer, int Reserved, int Version, PointerByReference ppSessionInfo, IntByReference pCount) Retrieves a list of sessions on a Remote Desktop Session Host (RD Session Host) server.voidWTSFreeMemory(Pointer pMemory) Frees memory allocated by a Remote Desktop Services function.booleanWTSFreeMemoryEx(int WTSTypeClass, Pointer pMemory, int NumberOfEntries) Frees memory that contains WTS_PROCESS_INFO_EX or WTS_SESSION_INFO_1 structures allocated by a Remote Desktop Services function.booleanWTSQuerySessionInformation(WinNT.HANDLE hServer, int SessionId, int WTSInfoClass, PointerByReference ppBuffer, IntByReference pBytesReturned) Retrieves session information for the specified session on the specified Remote Desktop Session Host (RD Session Host) server.booleanWTSRegisterSessionNotification(WinDef.HWND hWnd, int dwFlags) Registers the specified window to receive session change notifications.booleanUnregisters the specified window so that it receives no further session change notifications.
- 
Field Details- 
INSTANCE
- 
NOTIFY_FOR_ALL_SESSIONSstatic final int NOTIFY_FOR_ALL_SESSIONS- See Also:
 
- 
NOTIFY_FOR_THIS_SESSIONstatic final int NOTIFY_FOR_THIS_SESSION- See Also:
 
- 
WTS_CONSOLE_CONNECTstatic final int WTS_CONSOLE_CONNECTThe session identified by lParam was connected to the console terminal or RemoteFX session.- See Also:
 
- 
WTS_CONSOLE_DISCONNECTstatic final int WTS_CONSOLE_DISCONNECTThe session identified by lParam was disconnected from the console terminal or RemoteFX session.- See Also:
 
- 
WTS_REMOTE_CONNECTstatic final int WTS_REMOTE_CONNECTThe session identified by lParam was connected to the remote terminal.- See Also:
 
- 
WTS_REMOTE_DISCONNECTstatic final int WTS_REMOTE_DISCONNECTThe session identified by lParam was disconnected from the remote terminal.- See Also:
 
- 
WTS_SESSION_LOGONstatic final int WTS_SESSION_LOGONA user has logged on to the session identified by lParam.- See Also:
 
- 
WTS_SESSION_LOGOFFstatic final int WTS_SESSION_LOGOFFA user has logged off the session identified by lParam.- See Also:
 
- 
WTS_SESSION_LOCKstatic final int WTS_SESSION_LOCKThe session identified by lParam has been locked.- See Also:
 
- 
WTS_SESSION_UNLOCKstatic final int WTS_SESSION_UNLOCKThe session identified by lParam has been unlocked.- See Also:
 
- 
WTS_SESSION_REMOTE_CONTROLstatic final int WTS_SESSION_REMOTE_CONTROLThe session identified by lParam has changed its remote controlled status. To determine the status, call GetSystemMetrics and check the SM_REMOTECONTROL metric.- See Also:
 
- 
WTS_CURRENT_SERVER_HANDLESpecifies the current server
- 
WTS_CURRENT_SESSIONstatic final int WTS_CURRENT_SESSIONSpecifies the current session (SessionId)- See Also:
 
- 
WTS_ANY_SESSIONstatic final int WTS_ANY_SESSIONSpecifies any-session (SessionId)- See Also:
 
- 
WTS_PROCESS_INFO_LEVEL_0static final int WTS_PROCESS_INFO_LEVEL_0- See Also:
 
- 
WTS_PROCESS_INFO_LEVEL_1static final int WTS_PROCESS_INFO_LEVEL_1- See Also:
 
- 
DOMAIN_LENGTHstatic final int DOMAIN_LENGTHDefined inwinsta.hand present in this interface to properly size theWtsapi32.WTSINFOstructure.- See Also:
 
- 
USERNAME_LENGTHstatic final int USERNAME_LENGTHDefined inwinsta.hand present in this interface to properly size theWtsapi32.WTSINFOstructure.- See Also:
 
- 
WINSTATIONNAME_LENGTHstatic final int WINSTATIONNAME_LENGTHDefined inwinsta.hand present in this interface to properly size theWtsapi32.WTSINFOstructure.- See Also:
 
 
- 
- 
Method Details- 
WTSEnumerateSessionsboolean WTSEnumerateSessions(WinNT.HANDLE hServer, int Reserved, int Version, PointerByReference ppSessionInfo, IntByReference pCount) Retrieves a list of sessions on a Remote Desktop Session Host (RD Session Host) server.- Parameters:
- hServer- A handle to the RD Session Host server.- You can use the - WTSOpenServeror- WTSOpenServerExfunctions to retrieve a handle to a specific server, or- WTS_CURRENT_SERVER_HANDLEto use the RD Session Host server that hosts your application.
- Reserved- This parameter is reserved. It must be zero.
- Version- The version of the enumeration request. This parameter must be 1.
- ppSessionInfo- A pointer to an array of- Wtsapi32.WTS_SESSION_INFOstructures that represent the retrieved sessions. To free the returned buffer, call the- WTSFreeMemory(com.sun.jna.Pointer)function.
- pCount- A pointer to the number of- WTS_SESSION_INFOstructures returned in the- ppSessionInfoparameter.
- Returns:
- Returns falseif this function fails. If this function succeeds, returnstrue.To get extended error information, call Kernel32.GetLastError().
 
- 
WTSQuerySessionInformationboolean WTSQuerySessionInformation(WinNT.HANDLE hServer, int SessionId, int WTSInfoClass, PointerByReference ppBuffer, IntByReference pBytesReturned) Retrieves session information for the specified session on the specified Remote Desktop Session Host (RD Session Host) server. It can be used to query session information on local and remote RD Session Host servers.- Parameters:
- hServer- A handle to an RD Session Host server. Specify a handle opened by the- WTSOpenServerfunction, or specify- WTS_CURRENT_SERVER_HANDLEto indicate the RD Session Host server on which your application is running.
- SessionId- A Remote Desktop Services session identifier. To indicate the session in which the calling application is running (or the current session) specify- WTS_CURRENT_SESSION. Only specify- WTS_CURRENT_SESSIONwhen obtaining session information on the local server. If- WTS_CURRENT_SESSIONis specified when querying session information on a remote server, the returned session information will be inconsistent. Do not use the returned data.- You can use the - WTSEnumerateSessionsExfunction to retrieve the identifiers of all sessions on a specified RD Session Host server.- To query information for another user's session, you must have Query Information permission. 
- WTSInfoClass- A value of the- Wtsapi32.WTS_INFO_CLASSenumeration that indicates the type of session information to retrieve in a call to the- WTSQuerySessionInformationfunction.
- ppBuffer- A pointer to a variable that receives a pointer to the requested information. The format and contents of the data depend on the information class specified in the- WTSInfoClassparameter. To free the returned buffer, call the- WTSFreeMemory(com.sun.jna.Pointer)function.
- pBytesReturned- A pointer to a variable that receives the size, in bytes, of the data returned in ppBuffer.
- Returns:
- If the function succeeds, returns true.If the function fails, returns false. To get extended error information, callKernel32.GetLastError().
 
- 
WTSFreeMemoryFrees memory allocated by a Remote Desktop Services function.- Parameters:
- pMemory- Pointer to the memory to free.
 
- 
WTSRegisterSessionNotificationRegisters the specified window to receive session change notifications.- Parameters:
- hWnd- [in] Handle of the window to receive session change notifications.
- dwFlags- [in] Specifies which session notifications are to be received. This parameter can be one of the following values.
- Returns:
- If the function succeeds, the return value is TRUE. Otherwise, it is FALSE. To get extended error information, call GetLastError.
 
- 
WTSUnRegisterSessionNotificationUnregisters the specified window so that it receives no further session change notifications.- Parameters:
- hWnd- [in] Handle of the window to be unregistered from receiving session notifications.
- Returns:
- If the function succeeds, the return value is TRUE. Otherwise, it is FALSE. To get extended error information, call GetLastError.
 
- 
WTSEnumerateProcessesExboolean WTSEnumerateProcessesEx(WinNT.HANDLE hServer, IntByReference pLevel, int SessionID, PointerByReference ppProcessInfo, IntByReference pCount) Retrieves information about the active processes on the specified Remote Desktop Session Host (RD Session Host) server or Remote Desktop Virtualization Host (RD Virtualization Host) server.- Parameters:
- hServer- A handle to an RD Session Host server. Specify a handle opened by the WTSOpenServer function, or specify WTS_CURRENT_SERVER_HANDLE to indicate the server on which your application is running.
- pLevel- A pointer to a DWORD variable that, on input, specifies the type of information to return. To return an array of WTS_PROCESS_INFO structures, specify zero. To return an array of WTS_PROCESS_INFO_EX structures, specify one. If you do not specify a valid value for this parameter, on output, WTSEnumerateProcessesEx sets this parameter to one and returns an error. Otherwise, on output, WTSEnumerateProcessesEx does not change the value of this parameter.
- SessionID- The session for which to enumerate processes. To enumerate processes for all sessions on the server, specify WTS_ANY_SESSION.
- ppProcessInfo- A pointer to a variable that receives a pointer to an array of WTS_PROCESS_INFO or WTS_PROCESS_INFO_EX structures. The type of structure is determined by the value passed to the pLevel parameter. Each structure in the array contains information about an active process. When you have finished using the array, free it by calling the WTSFreeMemoryEx function. You should also set the pointer to NULL.
- pCount- A pointer to a variable that receives the number of structures returned in the buffer referenced by the ppProcessInfo parameter.
- Returns:
- If the function succeeds, the return value is a nonzero value. If the function fails, the return value is zero. To get extended error information, call the GetLastError function.
 
- 
WTSFreeMemoryExFrees memory that contains WTS_PROCESS_INFO_EX or WTS_SESSION_INFO_1 structures allocated by a Remote Desktop Services function.- Parameters:
- WTSTypeClass- A value of the WTS_TYPE_CLASS enumeration type that specifies the type of structures contained in the buffer referenced by the pMemory parameter.
- pMemory- A pointer to the buffer to free.
- NumberOfEntries- The number of elements in the buffer referenced by the pMemory parameter.
- Returns:
- If the function succeeds, the return value is a nonzero value. If the function fails, the return value is zero. To get extended error information, call the GetLastError function.
 
 
-