diff --git a/channels/rdpdr/client/rdpdr_main.c b/channels/rdpdr/client/rdpdr_main.c index 3130affd4..323dc8a1a 100644 --- a/channels/rdpdr/client/rdpdr_main.c +++ b/channels/rdpdr/client/rdpdr_main.c @@ -850,7 +850,7 @@ static void rdpdr_virtual_channel_event_data_received(rdpdrPlugin* rdpdr, } } -static VOID rdpdr_virtual_channel_open_event(DWORD openHandle, UINT event, +static VOID VCAPITYPE rdpdr_virtual_channel_open_event(DWORD openHandle, UINT event, LPVOID pData, UINT32 dataLength, UINT32 totalLength, UINT32 dataFlags) { rdpdrPlugin* rdpdr; @@ -959,7 +959,7 @@ static void rdpdr_virtual_channel_event_terminated(rdpdrPlugin* rdpdr) rdpdr_remove_init_handle_data(rdpdr->InitHandle); } -static void rdpdr_virtual_channel_init_event(void* pInitHandle, UINT32 event, void* pData, UINT32 dataLength) +static VOID VCAPITYPE rdpdr_virtual_channel_init_event(LPVOID pInitHandle, UINT event, LPVOID pData, UINT dataLength) { rdpdrPlugin* rdpdr; diff --git a/channels/rdpsnd/client/rdpsnd_main.c b/channels/rdpsnd/client/rdpsnd_main.c index 63a5463fe..3d4cc1900 100644 --- a/channels/rdpsnd/client/rdpsnd_main.c +++ b/channels/rdpsnd/client/rdpsnd_main.c @@ -921,7 +921,7 @@ static void rdpsnd_virtual_channel_event_data_received(rdpsndPlugin* plugin, } } -static VOID rdpsnd_virtual_channel_open_event(DWORD openHandle, UINT event, +static VOID VCAPITYPE rdpsnd_virtual_channel_open_event(DWORD openHandle, UINT event, LPVOID pData, UINT32 dataLength, UINT32 totalLength, UINT32 dataFlags) { rdpsndPlugin* plugin; @@ -1035,7 +1035,7 @@ static void rdpsnd_virtual_channel_event_terminated(rdpsndPlugin* rdpsnd) rdpsnd_remove_init_handle_data(rdpsnd->InitHandle); } -static void rdpsnd_virtual_channel_init_event(void* pInitHandle, UINT32 event, void* pData, UINT32 dataLength) +static VOID VCAPITYPE rdpsnd_virtual_channel_init_event(LPVOID pInitHandle, UINT event, LPVOID pData, UINT dataLength) { rdpsndPlugin* plugin; diff --git a/libfreerdp/core/client.c b/libfreerdp/core/client.c index 8f493ca72..c5dd47c29 100644 --- a/libfreerdp/core/client.c +++ b/libfreerdp/core/client.c @@ -500,7 +500,7 @@ void freerdp_channels_close(rdpChannels* channels, freerdp* instance) MessagePipe_PostQuit(channels->MsgPipe, 0); } -UINT FreeRDP_VirtualChannelInit(LPVOID* ppInitHandle, PCHANNEL_DEF pChannel, +UINT VCAPITYPE FreeRDP_VirtualChannelInit(LPVOID* ppInitHandle, PCHANNEL_DEF pChannel, INT channelCount, ULONG versionRequested, PCHANNEL_INIT_EVENT_FN pChannelInitEventProc) { int index; @@ -591,7 +591,7 @@ UINT FreeRDP_VirtualChannelInit(LPVOID* ppInitHandle, PCHANNEL_DEF pChannel, return CHANNEL_RC_OK; } -UINT FreeRDP_VirtualChannelOpen(LPVOID pInitHandle, LPDWORD pOpenHandle, +UINT VCAPITYPE FreeRDP_VirtualChannelOpen(LPVOID pInitHandle, LPDWORD pOpenHandle, PCHAR pChannelName, PCHANNEL_OPEN_EVENT_FN pChannelOpenEventProc) { void* pInterface; @@ -628,7 +628,7 @@ UINT FreeRDP_VirtualChannelOpen(LPVOID pInitHandle, LPDWORD pOpenHandle, return CHANNEL_RC_OK; } -UINT FreeRDP_VirtualChannelClose(DWORD openHandle) +UINT VCAPITYPE FreeRDP_VirtualChannelClose(DWORD openHandle) { CHANNEL_OPEN_DATA* pChannelOpenData; @@ -645,7 +645,7 @@ UINT FreeRDP_VirtualChannelClose(DWORD openHandle) return CHANNEL_RC_OK; } -UINT FreeRDP_VirtualChannelWrite(DWORD openHandle, LPVOID pData, ULONG dataLength, LPVOID pUserData) +UINT VCAPITYPE FreeRDP_VirtualChannelWrite(DWORD openHandle, LPVOID pData, ULONG dataLength, LPVOID pUserData) { rdpChannels* channels; CHANNEL_OPEN_DATA* pChannelOpenData; diff --git a/libfreerdp/core/server.c b/libfreerdp/core/server.c index 97a11cf92..7758510a1 100644 --- a/libfreerdp/core/server.c +++ b/libfreerdp/core/server.c @@ -486,47 +486,47 @@ BOOL WTSVirtualChannelManagerIsChannelJoined(HANDLE hServer, const char* name) return joined; } -BOOL FreeRDP_WTSStartRemoteControlSessionW(LPWSTR pTargetServerName, ULONG TargetLogonId, BYTE HotkeyVk, USHORT HotkeyModifiers) +BOOL WINAPI FreeRDP_WTSStartRemoteControlSessionW(LPWSTR pTargetServerName, ULONG TargetLogonId, BYTE HotkeyVk, USHORT HotkeyModifiers) { return FALSE; } -BOOL FreeRDP_WTSStartRemoteControlSessionA(LPSTR pTargetServerName, ULONG TargetLogonId, BYTE HotkeyVk, USHORT HotkeyModifiers) +BOOL WINAPI FreeRDP_WTSStartRemoteControlSessionA(LPSTR pTargetServerName, ULONG TargetLogonId, BYTE HotkeyVk, USHORT HotkeyModifiers) { return FALSE; } -BOOL FreeRDP_WTSStopRemoteControlSession(ULONG LogonId) +BOOL WINAPI FreeRDP_WTSStopRemoteControlSession(ULONG LogonId) { return FALSE; } -BOOL FreeRDP_WTSConnectSessionW(ULONG LogonId, ULONG TargetLogonId, PWSTR pPassword, BOOL bWait) +BOOL WINAPI FreeRDP_WTSConnectSessionW(ULONG LogonId, ULONG TargetLogonId, PWSTR pPassword, BOOL bWait) { return FALSE; } -BOOL FreeRDP_WTSConnectSessionA(ULONG LogonId, ULONG TargetLogonId, PSTR pPassword, BOOL bWait) +BOOL WINAPI FreeRDP_WTSConnectSessionA(ULONG LogonId, ULONG TargetLogonId, PSTR pPassword, BOOL bWait) { return FALSE; } -BOOL FreeRDP_WTSEnumerateServersW(LPWSTR pDomainName, DWORD Reserved, DWORD Version, PWTS_SERVER_INFOW* ppServerInfo, DWORD* pCount) +BOOL WINAPI FreeRDP_WTSEnumerateServersW(LPWSTR pDomainName, DWORD Reserved, DWORD Version, PWTS_SERVER_INFOW* ppServerInfo, DWORD* pCount) { return FALSE; } -BOOL FreeRDP_WTSEnumerateServersA(LPSTR pDomainName, DWORD Reserved, DWORD Version, PWTS_SERVER_INFOA* ppServerInfo, DWORD* pCount) +BOOL WINAPI FreeRDP_WTSEnumerateServersA(LPSTR pDomainName, DWORD Reserved, DWORD Version, PWTS_SERVER_INFOA* ppServerInfo, DWORD* pCount) { return FALSE; } -HANDLE FreeRDP_WTSOpenServerW(LPWSTR pServerName) +HANDLE WINAPI FreeRDP_WTSOpenServerW(LPWSTR pServerName) { return INVALID_HANDLE_VALUE; } -HANDLE FreeRDP_WTSOpenServerA(LPSTR pServerName) +HANDLE WINAPI FreeRDP_WTSOpenServerA(LPSTR pServerName) { rdpContext* context; freerdp_peer* client; @@ -570,17 +570,17 @@ HANDLE FreeRDP_WTSOpenServerA(LPSTR pServerName) return hServer; } -HANDLE FreeRDP_WTSOpenServerExW(LPWSTR pServerName) +HANDLE WINAPI FreeRDP_WTSOpenServerExW(LPWSTR pServerName) { return INVALID_HANDLE_VALUE; } -HANDLE FreeRDP_WTSOpenServerExA(LPSTR pServerName) +HANDLE WINAPI FreeRDP_WTSOpenServerExA(LPSTR pServerName) { return FreeRDP_WTSOpenServerA(pServerName); } -VOID FreeRDP_WTSCloseServer(HANDLE hServer) +VOID WINAPI FreeRDP_WTSCloseServer(HANDLE hServer) { int index; int count; @@ -619,47 +619,47 @@ VOID FreeRDP_WTSCloseServer(HANDLE hServer) } } -BOOL FreeRDP_WTSEnumerateSessionsW(HANDLE hServer, DWORD Reserved, DWORD Version, PWTS_SESSION_INFOW* ppSessionInfo, DWORD* pCount) +BOOL WINAPI FreeRDP_WTSEnumerateSessionsW(HANDLE hServer, DWORD Reserved, DWORD Version, PWTS_SESSION_INFOW* ppSessionInfo, DWORD* pCount) { return FALSE; } -BOOL FreeRDP_WTSEnumerateSessionsA(HANDLE hServer, DWORD Reserved, DWORD Version, PWTS_SESSION_INFOA* ppSessionInfo, DWORD* pCount) +BOOL WINAPI FreeRDP_WTSEnumerateSessionsA(HANDLE hServer, DWORD Reserved, DWORD Version, PWTS_SESSION_INFOA* ppSessionInfo, DWORD* pCount) { return FALSE; } -BOOL FreeRDP_WTSEnumerateSessionsExW(HANDLE hServer, DWORD* pLevel, DWORD Filter, PWTS_SESSION_INFO_1W* ppSessionInfo, DWORD* pCount) +BOOL WINAPI FreeRDP_WTSEnumerateSessionsExW(HANDLE hServer, DWORD* pLevel, DWORD Filter, PWTS_SESSION_INFO_1W* ppSessionInfo, DWORD* pCount) { return FALSE; } -BOOL FreeRDP_WTSEnumerateSessionsExA(HANDLE hServer, DWORD* pLevel, DWORD Filter, PWTS_SESSION_INFO_1A* ppSessionInfo, DWORD* pCount) +BOOL WINAPI FreeRDP_WTSEnumerateSessionsExA(HANDLE hServer, DWORD* pLevel, DWORD Filter, PWTS_SESSION_INFO_1A* ppSessionInfo, DWORD* pCount) { return FALSE; } -BOOL FreeRDP_WTSEnumerateProcessesW(HANDLE hServer, DWORD Reserved, DWORD Version, PWTS_PROCESS_INFOW* ppProcessInfo, DWORD* pCount) +BOOL WINAPI FreeRDP_WTSEnumerateProcessesW(HANDLE hServer, DWORD Reserved, DWORD Version, PWTS_PROCESS_INFOW* ppProcessInfo, DWORD* pCount) { return FALSE; } -BOOL FreeRDP_WTSEnumerateProcessesA(HANDLE hServer, DWORD Reserved, DWORD Version, PWTS_PROCESS_INFOA* ppProcessInfo, DWORD* pCount) +BOOL WINAPI FreeRDP_WTSEnumerateProcessesA(HANDLE hServer, DWORD Reserved, DWORD Version, PWTS_PROCESS_INFOA* ppProcessInfo, DWORD* pCount) { return FALSE; } -BOOL FreeRDP_WTSTerminateProcess(HANDLE hServer, DWORD ProcessId, DWORD ExitCode) +BOOL WINAPI FreeRDP_WTSTerminateProcess(HANDLE hServer, DWORD ProcessId, DWORD ExitCode) { return FALSE; } -BOOL FreeRDP_WTSQuerySessionInformationW(HANDLE hServer, DWORD SessionId, WTS_INFO_CLASS WTSInfoClass, LPWSTR* ppBuffer, DWORD* pBytesReturned) +BOOL WINAPI FreeRDP_WTSQuerySessionInformationW(HANDLE hServer, DWORD SessionId, WTS_INFO_CLASS WTSInfoClass, LPWSTR* ppBuffer, DWORD* pBytesReturned) { return FALSE; } -BOOL FreeRDP_WTSQuerySessionInformationA(HANDLE hServer, DWORD SessionId, WTS_INFO_CLASS WTSInfoClass, LPSTR* ppBuffer, DWORD* pBytesReturned) +BOOL WINAPI FreeRDP_WTSQuerySessionInformationA(HANDLE hServer, DWORD SessionId, WTS_INFO_CLASS WTSInfoClass, LPSTR* ppBuffer, DWORD* pBytesReturned) { DWORD BytesReturned; WTSVirtualChannelManager* vcm; @@ -687,59 +687,59 @@ BOOL FreeRDP_WTSQuerySessionInformationA(HANDLE hServer, DWORD SessionId, WTS_IN return FALSE; } -BOOL FreeRDP_WTSQueryUserConfigW(LPWSTR pServerName, LPWSTR pUserName, WTS_CONFIG_CLASS WTSConfigClass, LPWSTR* ppBuffer, DWORD* pBytesReturned) +BOOL WINAPI FreeRDP_WTSQueryUserConfigW(LPWSTR pServerName, LPWSTR pUserName, WTS_CONFIG_CLASS WTSConfigClass, LPWSTR* ppBuffer, DWORD* pBytesReturned) { return FALSE; } -BOOL FreeRDP_WTSQueryUserConfigA(LPSTR pServerName, LPSTR pUserName, WTS_CONFIG_CLASS WTSConfigClass, LPSTR* ppBuffer, DWORD* pBytesReturned) +BOOL WINAPI FreeRDP_WTSQueryUserConfigA(LPSTR pServerName, LPSTR pUserName, WTS_CONFIG_CLASS WTSConfigClass, LPSTR* ppBuffer, DWORD* pBytesReturned) { return FALSE; } -BOOL FreeRDP_WTSSetUserConfigW(LPWSTR pServerName, LPWSTR pUserName, WTS_CONFIG_CLASS WTSConfigClass, LPWSTR pBuffer, DWORD DataLength) +BOOL WINAPI FreeRDP_WTSSetUserConfigW(LPWSTR pServerName, LPWSTR pUserName, WTS_CONFIG_CLASS WTSConfigClass, LPWSTR pBuffer, DWORD DataLength) { return FALSE; } -BOOL FreeRDP_WTSSetUserConfigA(LPSTR pServerName, LPSTR pUserName, WTS_CONFIG_CLASS WTSConfigClass, LPSTR pBuffer, DWORD DataLength) +BOOL WINAPI FreeRDP_WTSSetUserConfigA(LPSTR pServerName, LPSTR pUserName, WTS_CONFIG_CLASS WTSConfigClass, LPSTR pBuffer, DWORD DataLength) { return FALSE; } -BOOL FreeRDP_WTSSendMessageW(HANDLE hServer, DWORD SessionId, LPWSTR pTitle, DWORD TitleLength, +BOOL WINAPI FreeRDP_WTSSendMessageW(HANDLE hServer, DWORD SessionId, LPWSTR pTitle, DWORD TitleLength, LPWSTR pMessage, DWORD MessageLength, DWORD Style, DWORD Timeout, DWORD* pResponse, BOOL bWait) { return FALSE; } -BOOL FreeRDP_WTSSendMessageA(HANDLE hServer, DWORD SessionId, LPSTR pTitle, DWORD TitleLength, +BOOL WINAPI FreeRDP_WTSSendMessageA(HANDLE hServer, DWORD SessionId, LPSTR pTitle, DWORD TitleLength, LPSTR pMessage, DWORD MessageLength, DWORD Style, DWORD Timeout, DWORD* pResponse, BOOL bWait) { return FALSE; } -BOOL FreeRDP_WTSDisconnectSession(HANDLE hServer, DWORD SessionId, BOOL bWait) +BOOL WINAPI FreeRDP_WTSDisconnectSession(HANDLE hServer, DWORD SessionId, BOOL bWait) { return FALSE; } -BOOL FreeRDP_WTSLogoffSession(HANDLE hServer, DWORD SessionId, BOOL bWait) +BOOL WINAPI FreeRDP_WTSLogoffSession(HANDLE hServer, DWORD SessionId, BOOL bWait) { return FALSE; } -BOOL FreeRDP_WTSShutdownSystem(HANDLE hServer, DWORD ShutdownFlag) +BOOL WINAPI FreeRDP_WTSShutdownSystem(HANDLE hServer, DWORD ShutdownFlag) { return FALSE; } -BOOL FreeRDP_WTSWaitSystemEvent(HANDLE hServer, DWORD EventMask, DWORD* pEventFlags) +BOOL WINAPI FreeRDP_WTSWaitSystemEvent(HANDLE hServer, DWORD EventMask, DWORD* pEventFlags) { return FALSE; } -HANDLE FreeRDP_WTSVirtualChannelOpen(HANDLE hServer, DWORD SessionId, LPSTR pVirtualName) +HANDLE WINAPI FreeRDP_WTSVirtualChannelOpen(HANDLE hServer, DWORD SessionId, LPSTR pVirtualName) { int index; int length; @@ -803,7 +803,7 @@ HANDLE FreeRDP_WTSVirtualChannelOpen(HANDLE hServer, DWORD SessionId, LPSTR pVir return hChannelHandle; } -HANDLE FreeRDP_WTSVirtualChannelOpenEx(DWORD SessionId, LPSTR pVirtualName, DWORD flags) +HANDLE WINAPI FreeRDP_WTSVirtualChannelOpenEx(DWORD SessionId, LPSTR pVirtualName, DWORD flags) { int index; wStream* s; @@ -869,7 +869,7 @@ HANDLE FreeRDP_WTSVirtualChannelOpenEx(DWORD SessionId, LPSTR pVirtualName, DWOR return NULL; } -BOOL FreeRDP_WTSVirtualChannelClose(HANDLE hChannelHandle) +BOOL WINAPI FreeRDP_WTSVirtualChannelClose(HANDLE hChannelHandle) { wStream* s; rdpMcs* mcs; @@ -914,7 +914,7 @@ BOOL FreeRDP_WTSVirtualChannelClose(HANDLE hChannelHandle) return TRUE; } -BOOL FreeRDP_WTSVirtualChannelRead(HANDLE hChannelHandle, ULONG TimeOut, PCHAR Buffer, ULONG BufferSize, PULONG pBytesRead) +BOOL WINAPI FreeRDP_WTSVirtualChannelRead(HANDLE hChannelHandle, ULONG TimeOut, PCHAR Buffer, ULONG BufferSize, PULONG pBytesRead) { BYTE* buffer; UINT32 length; @@ -943,7 +943,7 @@ BOOL FreeRDP_WTSVirtualChannelRead(HANDLE hChannelHandle, ULONG TimeOut, PCHAR B return TRUE; } -BOOL FreeRDP_WTSVirtualChannelWrite(HANDLE hChannelHandle, PCHAR Buffer, ULONG Length, PULONG pBytesWritten) +BOOL WINAPI FreeRDP_WTSVirtualChannelWrite(HANDLE hChannelHandle, PCHAR Buffer, ULONG Length, PULONG pBytesWritten) { wStream* s; int cbLen; @@ -1015,17 +1015,17 @@ BOOL FreeRDP_WTSVirtualChannelWrite(HANDLE hChannelHandle, PCHAR Buffer, ULONG L return TRUE; } -BOOL FreeRDP_WTSVirtualChannelPurgeInput(HANDLE hChannelHandle) +BOOL WINAPI FreeRDP_WTSVirtualChannelPurgeInput(HANDLE hChannelHandle) { return TRUE; } -BOOL FreeRDP_WTSVirtualChannelPurgeOutput(HANDLE hChannelHandle) +BOOL WINAPI FreeRDP_WTSVirtualChannelPurgeOutput(HANDLE hChannelHandle) { return TRUE; } -BOOL FreeRDP_WTSVirtualChannelQuery(HANDLE hChannelHandle, WTS_VIRTUAL_CLASS WtsVirtualClass, PVOID* ppBuffer, DWORD* pBytesReturned) +BOOL WINAPI FreeRDP_WTSVirtualChannelQuery(HANDLE hChannelHandle, WTS_VIRTUAL_CLASS WtsVirtualClass, PVOID* ppBuffer, DWORD* pBytesReturned) { void* pfd; BOOL bval; @@ -1101,132 +1101,132 @@ BOOL FreeRDP_WTSVirtualChannelQuery(HANDLE hChannelHandle, WTS_VIRTUAL_CLASS Wts return status; } -VOID FreeRDP_WTSFreeMemory(PVOID pMemory) +VOID WINAPI FreeRDP_WTSFreeMemory(PVOID pMemory) { free(pMemory); } -BOOL FreeRDP_WTSFreeMemoryExW(WTS_TYPE_CLASS WTSTypeClass, PVOID pMemory, ULONG NumberOfEntries) +BOOL WINAPI FreeRDP_WTSFreeMemoryExW(WTS_TYPE_CLASS WTSTypeClass, PVOID pMemory, ULONG NumberOfEntries) { return FALSE; } -BOOL FreeRDP_WTSFreeMemoryExA(WTS_TYPE_CLASS WTSTypeClass, PVOID pMemory, ULONG NumberOfEntries) +BOOL WINAPI FreeRDP_WTSFreeMemoryExA(WTS_TYPE_CLASS WTSTypeClass, PVOID pMemory, ULONG NumberOfEntries) { return FALSE; } -BOOL FreeRDP_WTSRegisterSessionNotification(HWND hWnd, DWORD dwFlags) +BOOL WINAPI FreeRDP_WTSRegisterSessionNotification(HWND hWnd, DWORD dwFlags) { return FALSE; } -BOOL FreeRDP_WTSUnRegisterSessionNotification(HWND hWnd) +BOOL WINAPI FreeRDP_WTSUnRegisterSessionNotification(HWND hWnd) { return FALSE; } -BOOL FreeRDP_WTSRegisterSessionNotificationEx(HANDLE hServer, HWND hWnd, DWORD dwFlags) +BOOL WINAPI FreeRDP_WTSRegisterSessionNotificationEx(HANDLE hServer, HWND hWnd, DWORD dwFlags) { return FALSE; } -BOOL FreeRDP_WTSUnRegisterSessionNotificationEx(HANDLE hServer, HWND hWnd) +BOOL WINAPI FreeRDP_WTSUnRegisterSessionNotificationEx(HANDLE hServer, HWND hWnd) { return FALSE; } -BOOL FreeRDP_WTSQueryUserToken(ULONG SessionId, PHANDLE phToken) +BOOL WINAPI FreeRDP_WTSQueryUserToken(ULONG SessionId, PHANDLE phToken) { return FALSE; } -BOOL FreeRDP_WTSEnumerateProcessesExW(HANDLE hServer, DWORD* pLevel, DWORD SessionId, LPWSTR* ppProcessInfo, DWORD* pCount) +BOOL WINAPI FreeRDP_WTSEnumerateProcessesExW(HANDLE hServer, DWORD* pLevel, DWORD SessionId, LPWSTR* ppProcessInfo, DWORD* pCount) { return FALSE; } -BOOL FreeRDP_WTSEnumerateProcessesExA(HANDLE hServer, DWORD* pLevel, DWORD SessionId, LPSTR* ppProcessInfo, DWORD* pCount) +BOOL WINAPI FreeRDP_WTSEnumerateProcessesExA(HANDLE hServer, DWORD* pLevel, DWORD SessionId, LPSTR* ppProcessInfo, DWORD* pCount) { return FALSE; } -BOOL FreeRDP_WTSEnumerateListenersW(HANDLE hServer, PVOID pReserved, DWORD Reserved, PWTSLISTENERNAMEW pListeners, DWORD* pCount) +BOOL WINAPI FreeRDP_WTSEnumerateListenersW(HANDLE hServer, PVOID pReserved, DWORD Reserved, PWTSLISTENERNAMEW pListeners, DWORD* pCount) { return FALSE; } -BOOL FreeRDP_WTSEnumerateListenersA(HANDLE hServer, PVOID pReserved, DWORD Reserved, PWTSLISTENERNAMEA pListeners, DWORD* pCount) +BOOL WINAPI FreeRDP_WTSEnumerateListenersA(HANDLE hServer, PVOID pReserved, DWORD Reserved, PWTSLISTENERNAMEA pListeners, DWORD* pCount) { return FALSE; } -BOOL FreeRDP_WTSQueryListenerConfigW(HANDLE hServer, PVOID pReserved, DWORD Reserved, LPWSTR pListenerName, PWTSLISTENERCONFIGW pBuffer) +BOOL WINAPI FreeRDP_WTSQueryListenerConfigW(HANDLE hServer, PVOID pReserved, DWORD Reserved, LPWSTR pListenerName, PWTSLISTENERCONFIGW pBuffer) { return FALSE; } -BOOL FreeRDP_WTSQueryListenerConfigA(HANDLE hServer, PVOID pReserved, DWORD Reserved, LPSTR pListenerName, PWTSLISTENERCONFIGA pBuffer) +BOOL WINAPI FreeRDP_WTSQueryListenerConfigA(HANDLE hServer, PVOID pReserved, DWORD Reserved, LPSTR pListenerName, PWTSLISTENERCONFIGA pBuffer) { return FALSE; } -BOOL FreeRDP_WTSCreateListenerW(HANDLE hServer, PVOID pReserved, DWORD Reserved, +BOOL WINAPI FreeRDP_WTSCreateListenerW(HANDLE hServer, PVOID pReserved, DWORD Reserved, LPWSTR pListenerName, PWTSLISTENERCONFIGW pBuffer, DWORD flag) { return FALSE; } -BOOL FreeRDP_WTSCreateListenerA(HANDLE hServer, PVOID pReserved, DWORD Reserved, +BOOL WINAPI FreeRDP_WTSCreateListenerA(HANDLE hServer, PVOID pReserved, DWORD Reserved, LPSTR pListenerName, PWTSLISTENERCONFIGA pBuffer, DWORD flag) { return FALSE; } -BOOL FreeRDP_WTSSetListenerSecurityW(HANDLE hServer, PVOID pReserved, DWORD Reserved, +BOOL WINAPI FreeRDP_WTSSetListenerSecurityW(HANDLE hServer, PVOID pReserved, DWORD Reserved, LPWSTR pListenerName, SECURITY_INFORMATION SecurityInformation, PSECURITY_DESCRIPTOR pSecurityDescriptor) { return FALSE; } -BOOL FreeRDP_WTSSetListenerSecurityA(HANDLE hServer, PVOID pReserved, DWORD Reserved, +BOOL WINAPI FreeRDP_WTSSetListenerSecurityA(HANDLE hServer, PVOID pReserved, DWORD Reserved, LPSTR pListenerName, SECURITY_INFORMATION SecurityInformation, PSECURITY_DESCRIPTOR pSecurityDescriptor) { return FALSE; } -BOOL FreeRDP_WTSGetListenerSecurityW(HANDLE hServer, PVOID pReserved, DWORD Reserved, +BOOL WINAPI FreeRDP_WTSGetListenerSecurityW(HANDLE hServer, PVOID pReserved, DWORD Reserved, LPWSTR pListenerName, SECURITY_INFORMATION SecurityInformation, PSECURITY_DESCRIPTOR pSecurityDescriptor, DWORD nLength, LPDWORD lpnLengthNeeded) { return FALSE; } -BOOL FreeRDP_WTSGetListenerSecurityA(HANDLE hServer, PVOID pReserved, DWORD Reserved, +BOOL WINAPI FreeRDP_WTSGetListenerSecurityA(HANDLE hServer, PVOID pReserved, DWORD Reserved, LPSTR pListenerName, SECURITY_INFORMATION SecurityInformation, PSECURITY_DESCRIPTOR pSecurityDescriptor, DWORD nLength, LPDWORD lpnLengthNeeded) { return FALSE; } -BOOL FreeRDP_WTSEnableChildSessions(BOOL bEnable) +BOOL CDECL FreeRDP_WTSEnableChildSessions(BOOL bEnable) { return FALSE; } -BOOL FreeRDP_WTSIsChildSessionsEnabled(PBOOL pbEnabled) +BOOL CDECL FreeRDP_WTSIsChildSessionsEnabled(PBOOL pbEnabled) { return FALSE; } -BOOL FreeRDP_WTSGetChildSessionId(PULONG pSessionId) +BOOL CDECL FreeRDP_WTSGetChildSessionId(PULONG pSessionId) { return FALSE; } -DWORD FreeRDP_WTSGetActiveConsoleSessionId(void) +DWORD WINAPI FreeRDP_WTSGetActiveConsoleSessionId(void) { return 0xFFFFFFFF; } diff --git a/libfreerdp/core/server.h b/libfreerdp/core/server.h index 39e94b01e..1e0e2ccd5 100644 --- a/libfreerdp/core/server.h +++ b/libfreerdp/core/server.h @@ -93,80 +93,82 @@ struct WTSVirtualChannelManager wArrayList* dynamicVirtualChannels; }; -BOOL FreeRDP_WTSStartRemoteControlSessionW(LPWSTR pTargetServerName, ULONG TargetLogonId, BYTE HotkeyVk, USHORT HotkeyModifiers); -BOOL FreeRDP_WTSStartRemoteControlSessionA(LPSTR pTargetServerName, ULONG TargetLogonId, BYTE HotkeyVk, USHORT HotkeyModifiers); -BOOL FreeRDP_WTSStopRemoteControlSession(ULONG LogonId); -BOOL FreeRDP_WTSConnectSessionW(ULONG LogonId, ULONG TargetLogonId, PWSTR pPassword, BOOL bWait); -BOOL FreeRDP_WTSConnectSessionA(ULONG LogonId, ULONG TargetLogonId, PSTR pPassword, BOOL bWait); -BOOL FreeRDP_WTSEnumerateServersW(LPWSTR pDomainName, DWORD Reserved, DWORD Version, PWTS_SERVER_INFOW* ppServerInfo, DWORD* pCount); -BOOL FreeRDP_WTSEnumerateServersA(LPSTR pDomainName, DWORD Reserved, DWORD Version, PWTS_SERVER_INFOA* ppServerInfo, DWORD* pCount); -HANDLE FreeRDP_WTSOpenServerW(LPWSTR pServerName); -HANDLE FreeRDP_WTSOpenServerA(LPSTR pServerName); -HANDLE FreeRDP_WTSOpenServerExW(LPWSTR pServerName); -HANDLE FreeRDP_WTSOpenServerExA(LPSTR pServerName); -VOID FreeRDP_WTSCloseServer(HANDLE hServer); -BOOL FreeRDP_WTSEnumerateSessionsW(HANDLE hServer, DWORD Reserved, DWORD Version, PWTS_SESSION_INFOW* ppSessionInfo, DWORD* pCount); -BOOL FreeRDP_WTSEnumerateSessionsA(HANDLE hServer, DWORD Reserved, DWORD Version, PWTS_SESSION_INFOA* ppSessionInfo, DWORD* pCount); -BOOL FreeRDP_WTSEnumerateSessionsExW(HANDLE hServer, DWORD* pLevel, DWORD Filter, PWTS_SESSION_INFO_1W* ppSessionInfo, DWORD* pCount); -BOOL FreeRDP_WTSEnumerateSessionsExA(HANDLE hServer, DWORD* pLevel, DWORD Filter, PWTS_SESSION_INFO_1A* ppSessionInfo, DWORD* pCount); -BOOL FreeRDP_WTSEnumerateProcessesW(HANDLE hServer, DWORD Reserved, DWORD Version, PWTS_PROCESS_INFOW* ppProcessInfo, DWORD* pCount); -BOOL FreeRDP_WTSEnumerateProcessesA(HANDLE hServer, DWORD Reserved, DWORD Version, PWTS_PROCESS_INFOA* ppProcessInfo, DWORD* pCount); -BOOL FreeRDP_WTSTerminateProcess(HANDLE hServer, DWORD ProcessId, DWORD ExitCode); -BOOL FreeRDP_WTSQuerySessionInformationW(HANDLE hServer, DWORD SessionId, WTS_INFO_CLASS WTSInfoClass, LPWSTR* ppBuffer, DWORD* pBytesReturned); -BOOL FreeRDP_WTSQuerySessionInformationA(HANDLE hServer, DWORD SessionId, WTS_INFO_CLASS WTSInfoClass, LPSTR* ppBuffer, DWORD* pBytesReturned); -BOOL FreeRDP_WTSQueryUserConfigW(LPWSTR pServerName, LPWSTR pUserName, WTS_CONFIG_CLASS WTSConfigClass, LPWSTR* ppBuffer, DWORD* pBytesReturned); -BOOL FreeRDP_WTSQueryUserConfigA(LPSTR pServerName, LPSTR pUserName, WTS_CONFIG_CLASS WTSConfigClass, LPSTR* ppBuffer, DWORD* pBytesReturned); -BOOL FreeRDP_WTSSetUserConfigW(LPWSTR pServerName, LPWSTR pUserName, WTS_CONFIG_CLASS WTSConfigClass, LPWSTR pBuffer, DWORD DataLength); -BOOL FreeRDP_WTSSetUserConfigA(LPSTR pServerName, LPSTR pUserName, WTS_CONFIG_CLASS WTSConfigClass, LPSTR pBuffer, DWORD DataLength); -BOOL FreeRDP_WTSSendMessageW(HANDLE hServer, DWORD SessionId, LPWSTR pTitle, DWORD TitleLength, +BOOL WINAPI FreeRDP_WTSStartRemoteControlSessionW(LPWSTR pTargetServerName, ULONG TargetLogonId, BYTE HotkeyVk, USHORT HotkeyModifiers); +BOOL WINAPI FreeRDP_WTSStartRemoteControlSessionA(LPSTR pTargetServerName, ULONG TargetLogonId, BYTE HotkeyVk, USHORT HotkeyModifiers); +BOOL WINAPI FreeRDP_WTSStopRemoteControlSession(ULONG LogonId); +BOOL WINAPI FreeRDP_WTSConnectSessionW(ULONG LogonId, ULONG TargetLogonId, PWSTR pPassword, BOOL bWait); +BOOL WINAPI FreeRDP_WTSConnectSessionA(ULONG LogonId, ULONG TargetLogonId, PSTR pPassword, BOOL bWait); +BOOL WINAPI FreeRDP_WTSEnumerateServersW(LPWSTR pDomainName, DWORD Reserved, DWORD Version, PWTS_SERVER_INFOW* ppServerInfo, DWORD* pCount); +BOOL WINAPI FreeRDP_WTSEnumerateServersA(LPSTR pDomainName, DWORD Reserved, DWORD Version, PWTS_SERVER_INFOA* ppServerInfo, DWORD* pCount); +HANDLE WINAPI FreeRDP_WTSOpenServerW(LPWSTR pServerName); +HANDLE WINAPI FreeRDP_WTSOpenServerA(LPSTR pServerName); +HANDLE WINAPI FreeRDP_WTSOpenServerExW(LPWSTR pServerName); +HANDLE WINAPI FreeRDP_WTSOpenServerExA(LPSTR pServerName); +VOID WINAPI FreeRDP_WTSCloseServer(HANDLE hServer); +BOOL WINAPI FreeRDP_WTSEnumerateSessionsW(HANDLE hServer, DWORD Reserved, DWORD Version, PWTS_SESSION_INFOW* ppSessionInfo, DWORD* pCount); +BOOL WINAPI FreeRDP_WTSEnumerateSessionsA(HANDLE hServer, DWORD Reserved, DWORD Version, PWTS_SESSION_INFOA* ppSessionInfo, DWORD* pCount); +BOOL WINAPI FreeRDP_WTSEnumerateSessionsExW(HANDLE hServer, DWORD* pLevel, DWORD Filter, PWTS_SESSION_INFO_1W* ppSessionInfo, DWORD* pCount); +BOOL WINAPI FreeRDP_WTSEnumerateSessionsExA(HANDLE hServer, DWORD* pLevel, DWORD Filter, PWTS_SESSION_INFO_1A* ppSessionInfo, DWORD* pCount); +BOOL WINAPI FreeRDP_WTSEnumerateProcessesW(HANDLE hServer, DWORD Reserved, DWORD Version, PWTS_PROCESS_INFOW* ppProcessInfo, DWORD* pCount); +BOOL WINAPI FreeRDP_WTSEnumerateProcessesA(HANDLE hServer, DWORD Reserved, DWORD Version, PWTS_PROCESS_INFOA* ppProcessInfo, DWORD* pCount); +BOOL WINAPI FreeRDP_WTSTerminateProcess(HANDLE hServer, DWORD ProcessId, DWORD ExitCode); +BOOL WINAPI FreeRDP_WTSQuerySessionInformationW(HANDLE hServer, DWORD SessionId, WTS_INFO_CLASS WTSInfoClass, LPWSTR* ppBuffer, DWORD* pBytesReturned); +BOOL WINAPI FreeRDP_WTSQuerySessionInformationA(HANDLE hServer, DWORD SessionId, WTS_INFO_CLASS WTSInfoClass, LPSTR* ppBuffer, DWORD* pBytesReturned); +BOOL WINAPI FreeRDP_WTSQueryUserConfigW(LPWSTR pServerName, LPWSTR pUserName, WTS_CONFIG_CLASS WTSConfigClass, LPWSTR* ppBuffer, DWORD* pBytesReturned); +BOOL WINAPI FreeRDP_WTSQueryUserConfigA(LPSTR pServerName, LPSTR pUserName, WTS_CONFIG_CLASS WTSConfigClass, LPSTR* ppBuffer, DWORD* pBytesReturned); +BOOL WINAPI FreeRDP_WTSSetUserConfigW(LPWSTR pServerName, LPWSTR pUserName, WTS_CONFIG_CLASS WTSConfigClass, LPWSTR pBuffer, DWORD DataLength); +BOOL WINAPI FreeRDP_WTSSetUserConfigA(LPSTR pServerName, LPSTR pUserName, WTS_CONFIG_CLASS WTSConfigClass, LPSTR pBuffer, DWORD DataLength); +BOOL WINAPI FreeRDP_WTSSendMessageW(HANDLE hServer, DWORD SessionId, LPWSTR pTitle, DWORD TitleLength, LPWSTR pMessage, DWORD MessageLength, DWORD Style, DWORD Timeout, DWORD* pResponse, BOOL bWait); -BOOL FreeRDP_WTSSendMessageA(HANDLE hServer, DWORD SessionId, LPSTR pTitle, DWORD TitleLength, +BOOL WINAPI FreeRDP_WTSSendMessageA(HANDLE hServer, DWORD SessionId, LPSTR pTitle, DWORD TitleLength, LPSTR pMessage, DWORD MessageLength, DWORD Style, DWORD Timeout, DWORD* pResponse, BOOL bWait); -BOOL FreeRDP_WTSDisconnectSession(HANDLE hServer, DWORD SessionId, BOOL bWait); -BOOL FreeRDP_WTSLogoffSession(HANDLE hServer, DWORD SessionId, BOOL bWait); -BOOL FreeRDP_WTSShutdownSystem(HANDLE hServer, DWORD ShutdownFlag); -BOOL FreeRDP_WTSWaitSystemEvent(HANDLE hServer, DWORD EventMask, DWORD* pEventFlags); -HANDLE FreeRDP_WTSVirtualChannelOpen(HANDLE hServer, DWORD SessionId, LPSTR pVirtualName); -HANDLE FreeRDP_WTSVirtualChannelOpenEx(DWORD SessionId, LPSTR pVirtualName, DWORD flags); -BOOL FreeRDP_WTSVirtualChannelClose(HANDLE hChannelHandle); -BOOL FreeRDP_WTSVirtualChannelRead(HANDLE hChannelHandle, ULONG TimeOut, PCHAR Buffer, ULONG BufferSize, PULONG pBytesRead); -BOOL FreeRDP_WTSVirtualChannelWrite(HANDLE hChannelHandle, PCHAR Buffer, ULONG Length, PULONG pBytesWritten); -BOOL FreeRDP_WTSVirtualChannelPurgeInput(HANDLE hChannelHandle); -BOOL FreeRDP_WTSVirtualChannelPurgeOutput(HANDLE hChannelHandle); -BOOL FreeRDP_WTSVirtualChannelQuery(HANDLE hChannelHandle, WTS_VIRTUAL_CLASS WtsVirtualClass, PVOID* ppBuffer, DWORD* pBytesReturned); -VOID FreeRDP_WTSFreeMemory(PVOID pMemory); -BOOL FreeRDP_WTSFreeMemoryExW(WTS_TYPE_CLASS WTSTypeClass, PVOID pMemory, ULONG NumberOfEntries); -BOOL FreeRDP_WTSFreeMemoryExA(WTS_TYPE_CLASS WTSTypeClass, PVOID pMemory, ULONG NumberOfEntries); -BOOL FreeRDP_WTSRegisterSessionNotification(HWND hWnd, DWORD dwFlags); -BOOL FreeRDP_WTSUnRegisterSessionNotification(HWND hWnd); -BOOL FreeRDP_WTSRegisterSessionNotificationEx(HANDLE hServer, HWND hWnd, DWORD dwFlags); -BOOL FreeRDP_WTSUnRegisterSessionNotificationEx(HANDLE hServer, HWND hWnd); -BOOL FreeRDP_WTSQueryUserToken(ULONG SessionId, PHANDLE phToken); -BOOL FreeRDP_WTSEnumerateProcessesExW(HANDLE hServer, DWORD* pLevel, DWORD SessionId, LPWSTR* ppProcessInfo, DWORD* pCount); -BOOL FreeRDP_WTSEnumerateProcessesExA(HANDLE hServer, DWORD* pLevel, DWORD SessionId, LPSTR* ppProcessInfo, DWORD* pCount); -BOOL FreeRDP_WTSEnumerateListenersW(HANDLE hServer, PVOID pReserved, DWORD Reserved, PWTSLISTENERNAMEW pListeners, DWORD* pCount); -BOOL FreeRDP_WTSEnumerateListenersA(HANDLE hServer, PVOID pReserved, DWORD Reserved, PWTSLISTENERNAMEA pListeners, DWORD* pCount); -BOOL FreeRDP_WTSQueryListenerConfigW(HANDLE hServer, PVOID pReserved, DWORD Reserved, LPWSTR pListenerName, PWTSLISTENERCONFIGW pBuffer); -BOOL FreeRDP_WTSQueryListenerConfigA(HANDLE hServer, PVOID pReserved, DWORD Reserved, LPSTR pListenerName, PWTSLISTENERCONFIGA pBuffer); -BOOL FreeRDP_WTSCreateListenerW(HANDLE hServer, PVOID pReserved, DWORD Reserved, +BOOL WINAPI FreeRDP_WTSDisconnectSession(HANDLE hServer, DWORD SessionId, BOOL bWait); +BOOL WINAPI FreeRDP_WTSLogoffSession(HANDLE hServer, DWORD SessionId, BOOL bWait); +BOOL WINAPI FreeRDP_WTSShutdownSystem(HANDLE hServer, DWORD ShutdownFlag); +BOOL WINAPI FreeRDP_WTSWaitSystemEvent(HANDLE hServer, DWORD EventMask, DWORD* pEventFlags); +HANDLE WINAPI FreeRDP_WTSVirtualChannelOpen(HANDLE hServer, DWORD SessionId, LPSTR pVirtualName); +HANDLE WINAPI FreeRDP_WTSVirtualChannelOpenEx(DWORD SessionId, LPSTR pVirtualName, DWORD flags); +BOOL WINAPI FreeRDP_WTSVirtualChannelClose(HANDLE hChannelHandle); +BOOL WINAPI FreeRDP_WTSVirtualChannelRead(HANDLE hChannelHandle, ULONG TimeOut, PCHAR Buffer, ULONG BufferSize, PULONG pBytesRead); +BOOL WINAPI FreeRDP_WTSVirtualChannelWrite(HANDLE hChannelHandle, PCHAR Buffer, ULONG Length, PULONG pBytesWritten); +BOOL WINAPI FreeRDP_WTSVirtualChannelPurgeInput(HANDLE hChannelHandle); +BOOL WINAPI FreeRDP_WTSVirtualChannelPurgeOutput(HANDLE hChannelHandle); +BOOL WINAPI FreeRDP_WTSVirtualChannelQuery(HANDLE hChannelHandle, WTS_VIRTUAL_CLASS WtsVirtualClass, PVOID* ppBuffer, DWORD* pBytesReturned); +VOID WINAPI FreeRDP_WTSFreeMemory(PVOID pMemory); +BOOL WINAPI FreeRDP_WTSFreeMemoryExW(WTS_TYPE_CLASS WTSTypeClass, PVOID pMemory, ULONG NumberOfEntries); +BOOL WINAPI FreeRDP_WTSFreeMemoryExA(WTS_TYPE_CLASS WTSTypeClass, PVOID pMemory, ULONG NumberOfEntries); +BOOL WINAPI FreeRDP_WTSRegisterSessionNotification(HWND hWnd, DWORD dwFlags); +BOOL WINAPI FreeRDP_WTSUnRegisterSessionNotification(HWND hWnd); +BOOL WINAPI FreeRDP_WTSRegisterSessionNotificationEx(HANDLE hServer, HWND hWnd, DWORD dwFlags); +BOOL WINAPI FreeRDP_WTSUnRegisterSessionNotificationEx(HANDLE hServer, HWND hWnd); +BOOL WINAPI FreeRDP_WTSQueryUserToken(ULONG SessionId, PHANDLE phToken); +BOOL WINAPI FreeRDP_WTSEnumerateProcessesExW(HANDLE hServer, DWORD* pLevel, DWORD SessionId, LPWSTR* ppProcessInfo, DWORD* pCount); +BOOL WINAPI FreeRDP_WTSEnumerateProcessesExA(HANDLE hServer, DWORD* pLevel, DWORD SessionId, LPSTR* ppProcessInfo, DWORD* pCount); +BOOL WINAPI FreeRDP_WTSEnumerateListenersW(HANDLE hServer, PVOID pReserved, DWORD Reserved, PWTSLISTENERNAMEW pListeners, DWORD* pCount); +BOOL WINAPI FreeRDP_WTSEnumerateListenersA(HANDLE hServer, PVOID pReserved, DWORD Reserved, PWTSLISTENERNAMEA pListeners, DWORD* pCount); +BOOL WINAPI FreeRDP_WTSQueryListenerConfigW(HANDLE hServer, PVOID pReserved, DWORD Reserved, LPWSTR pListenerName, PWTSLISTENERCONFIGW pBuffer); +BOOL WINAPI FreeRDP_WTSQueryListenerConfigA(HANDLE hServer, PVOID pReserved, DWORD Reserved, LPSTR pListenerName, PWTSLISTENERCONFIGA pBuffer); +BOOL WINAPI FreeRDP_WTSCreateListenerW(HANDLE hServer, PVOID pReserved, DWORD Reserved, LPWSTR pListenerName, PWTSLISTENERCONFIGW pBuffer, DWORD flag); -BOOL FreeRDP_WTSCreateListenerA(HANDLE hServer, PVOID pReserved, DWORD Reserved, +BOOL WINAPI FreeRDP_WTSCreateListenerA(HANDLE hServer, PVOID pReserved, DWORD Reserved, LPSTR pListenerName, PWTSLISTENERCONFIGA pBuffer, DWORD flag); -BOOL FreeRDP_WTSSetListenerSecurityW(HANDLE hServer, PVOID pReserved, DWORD Reserved, +BOOL WINAPI FreeRDP_WTSSetListenerSecurityW(HANDLE hServer, PVOID pReserved, DWORD Reserved, LPWSTR pListenerName, SECURITY_INFORMATION SecurityInformation, PSECURITY_DESCRIPTOR pSecurityDescriptor); -BOOL FreeRDP_WTSSetListenerSecurityA(HANDLE hServer, PVOID pReserved, DWORD Reserved, +BOOL WINAPI FreeRDP_WTSSetListenerSecurityA(HANDLE hServer, PVOID pReserved, DWORD Reserved, LPSTR pListenerName, SECURITY_INFORMATION SecurityInformation, PSECURITY_DESCRIPTOR pSecurityDescriptor); -BOOL FreeRDP_WTSGetListenerSecurityW(HANDLE hServer, PVOID pReserved, DWORD Reserved, +BOOL WINAPI FreeRDP_WTSGetListenerSecurityW(HANDLE hServer, PVOID pReserved, DWORD Reserved, LPWSTR pListenerName, SECURITY_INFORMATION SecurityInformation, PSECURITY_DESCRIPTOR pSecurityDescriptor, DWORD nLength, LPDWORD lpnLengthNeeded); -BOOL FreeRDP_WTSGetListenerSecurityA(HANDLE hServer, PVOID pReserved, DWORD Reserved, +BOOL WINAPI FreeRDP_WTSGetListenerSecurityA(HANDLE hServer, PVOID pReserved, DWORD Reserved, LPSTR pListenerName, SECURITY_INFORMATION SecurityInformation, PSECURITY_DESCRIPTOR pSecurityDescriptor, DWORD nLength, LPDWORD lpnLengthNeeded); -BOOL FreeRDP_WTSEnableChildSessions(BOOL bEnable); -BOOL FreeRDP_WTSIsChildSessionsEnabled(PBOOL pbEnabled); -BOOL FreeRDP_WTSGetChildSessionId(PULONG pSessionId); -DWORD FreeRDP_WTSGetActiveConsoleSessionId(void); + +BOOL CDECL FreeRDP_WTSEnableChildSessions(BOOL bEnable); +BOOL CDECL FreeRDP_WTSIsChildSessionsEnabled(PBOOL pbEnabled); +BOOL CDECL FreeRDP_WTSGetChildSessionId(PULONG pSessionId); + +DWORD WINAPI FreeRDP_WTSGetActiveConsoleSessionId(void); #endif /* FREERDP_CORE_SERVER_H */ diff --git a/libfreerdp/utils/svc_plugin.c b/libfreerdp/utils/svc_plugin.c index 720b79145..b6411025f 100644 --- a/libfreerdp/utils/svc_plugin.c +++ b/libfreerdp/utils/svc_plugin.c @@ -132,7 +132,7 @@ static void svc_plugin_process_event(rdpSvcPlugin* plugin, wMessage* event_in) MessageQueue_Post(plugin->MsgPipe->In, NULL, 1, (void*) event_in, NULL); } -static VOID svc_plugin_open_event(DWORD openHandle, UINT event, LPVOID pData, UINT32 dataLength, +static VOID VCAPITYPE svc_plugin_open_event(DWORD openHandle, UINT event, LPVOID pData, UINT32 dataLength, UINT32 totalLength, UINT32 dataFlags) { rdpSvcPlugin* plugin; @@ -249,7 +249,7 @@ static void svc_plugin_process_terminated(rdpSvcPlugin* plugin) svc_plugin_remove_init_handle_data(plugin->InitHandle); } -static void svc_plugin_init_event(void* pInitHandle, UINT32 event, void* pData, UINT32 dataLength) +static VOID VCAPITYPE svc_plugin_init_event(LPVOID pInitHandle, UINT event, LPVOID pData, UINT dataLength) { rdpSvcPlugin* plugin; diff --git a/winpr/include/winpr/wtsapi.h b/winpr/include/winpr/wtsapi.h index 2a4fa68a7..6deed0489 100644 --- a/winpr/include/winpr/wtsapi.h +++ b/winpr/include/winpr/wtsapi.h @@ -27,17 +27,18 @@ #ifdef _WIN32 -#include +#define CurrentTime _CurrentTime /* Workaround for X11 "CurrentTime" header conflict */ -/** - * Workaround for X11 "CurrentTime" header conflict - */ -#define CurrentTime _CurrentTime +#endif + +#ifdef _WIN32 + +#include #else /** - * Virtual Channel Protocol (Common) + * Virtual Channel Protocol (pchannel.h) */ #define CHANNEL_CHUNK_LENGTH 1600 @@ -50,11 +51,6 @@ #define CHANNEL_FLAG_MIDDLE 0 #define CHANNEL_FLAG_FAIL 0x100 -#define CHANNEL_FLAG_SHOW_PROTOCOL 0x10 -#define CHANNEL_FLAG_SUSPEND 0x20 -#define CHANNEL_FLAG_RESUME 0x40 -#define CHANNEL_FLAG_SHADOW_PERSISTENT 0x80 - #define CHANNEL_OPTION_INITIALIZED 0x80000000 #define CHANNEL_OPTION_ENCRYPT_RDP 0x40000000 @@ -85,8 +81,29 @@ typedef struct tagCHANNEL_PDU_HEADER UINT32 flags; } CHANNEL_PDU_HEADER, *PCHANNEL_PDU_HEADER; +#endif + /** - * Virtual Channel Client API + * These channel flags are defined in some versions of pchannel.h only + */ + +#ifndef CHANNEL_FLAG_SHOW_PROTOCOL +#define CHANNEL_FLAG_SHOW_PROTOCOL 0x10 +#endif +#ifndef CHANNEL_FLAG_SUSPEND +#define CHANNEL_FLAG_SUSPEND 0x20 +#endif +#ifndef CHANNEL_FLAG_RESUME +#define CHANNEL_FLAG_RESUME 0x40 +#endif +#ifndef CHANNEL_FLAG_SHADOW_PERSISTENT +#define CHANNEL_FLAG_SHADOW_PERSISTENT 0x80 +#endif + +#if !defined(_WIN32) || !defined(H_CCHANNEL) + +/** + * Virtual Channel Client API (cchannel.h) */ #ifdef _WIN32 @@ -220,8 +237,12 @@ typedef VIRTUALCHANNELENTRYEX *PVIRTUALCHANNELENTRYEX; typedef HRESULT (VCAPITYPE *PFNVCAPIGETINSTANCE)(REFIID refiid, PULONG pNumObjs, PVOID* ppObjArray); +#endif + +#if !defined(_WIN32) || !defined(_INC_WTSAPI) + /** - * Windows Terminal Services API (WtsApi) + * Windows Terminal Services API (wtsapi32.h) */ #define WTS_CURRENT_SERVER ((HANDLE)NULL) @@ -934,124 +955,128 @@ typedef struct _WTSLISTENERCONFIGA extern "C" { #endif -WINPR_API BOOL WTSStopRemoteControlSession(ULONG LogonId); +WINPR_API BOOL WINAPI WTSStopRemoteControlSession(ULONG LogonId); -WINPR_API BOOL WTSStartRemoteControlSessionW(LPWSTR pTargetServerName, ULONG TargetLogonId, BYTE HotkeyVk, USHORT HotkeyModifiers); -WINPR_API BOOL WTSStartRemoteControlSessionA(LPSTR pTargetServerName, ULONG TargetLogonId, BYTE HotkeyVk, USHORT HotkeyModifiers); +WINPR_API BOOL WINAPI WTSStartRemoteControlSessionW(LPWSTR pTargetServerName, ULONG TargetLogonId, BYTE HotkeyVk, USHORT HotkeyModifiers); +WINPR_API BOOL WINAPI WTSStartRemoteControlSessionA(LPSTR pTargetServerName, ULONG TargetLogonId, BYTE HotkeyVk, USHORT HotkeyModifiers); -WINPR_API BOOL WTSConnectSessionW(ULONG LogonId, ULONG TargetLogonId, PWSTR pPassword, BOOL bWait); -WINPR_API BOOL WTSConnectSessionA(ULONG LogonId, ULONG TargetLogonId, PSTR pPassword, BOOL bWait); +WINPR_API BOOL WINAPI WTSConnectSessionW(ULONG LogonId, ULONG TargetLogonId, PWSTR pPassword, BOOL bWait); +WINPR_API BOOL WINAPI WTSConnectSessionA(ULONG LogonId, ULONG TargetLogonId, PSTR pPassword, BOOL bWait); -WINPR_API BOOL WTSEnumerateServersW(LPWSTR pDomainName, DWORD Reserved, DWORD Version, PWTS_SERVER_INFOW* ppServerInfo, DWORD* pCount); -WINPR_API BOOL WTSEnumerateServersA(LPSTR pDomainName, DWORD Reserved, DWORD Version, PWTS_SERVER_INFOA* ppServerInfo, DWORD* pCount); +WINPR_API BOOL WINAPI WTSEnumerateServersW(LPWSTR pDomainName, DWORD Reserved, DWORD Version, PWTS_SERVER_INFOW* ppServerInfo, DWORD* pCount); +WINPR_API BOOL WINAPI WTSEnumerateServersA(LPSTR pDomainName, DWORD Reserved, DWORD Version, PWTS_SERVER_INFOA* ppServerInfo, DWORD* pCount); -WINPR_API HANDLE WTSOpenServerW(LPWSTR pServerName); -WINPR_API HANDLE WTSOpenServerA(LPSTR pServerName); +WINPR_API HANDLE WINAPI WTSOpenServerW(LPWSTR pServerName); +WINPR_API HANDLE WINAPI WTSOpenServerA(LPSTR pServerName); -WINPR_API HANDLE WTSOpenServerExW(LPWSTR pServerName); -WINPR_API HANDLE WTSOpenServerExA(LPSTR pServerName); +WINPR_API HANDLE WINAPI WTSOpenServerExW(LPWSTR pServerName); +WINPR_API HANDLE WINAPI WTSOpenServerExA(LPSTR pServerName); -WINPR_API VOID WTSCloseServer(HANDLE hServer); +WINPR_API VOID WINAPI WTSCloseServer(HANDLE hServer); -WINPR_API BOOL WTSEnumerateSessionsW(HANDLE hServer, DWORD Reserved, DWORD Version, PWTS_SESSION_INFOW* ppSessionInfo, DWORD* pCount); -WINPR_API BOOL WTSEnumerateSessionsA(HANDLE hServer, DWORD Reserved, DWORD Version, PWTS_SESSION_INFOA* ppSessionInfo, DWORD* pCount); +WINPR_API BOOL WINAPI WTSEnumerateSessionsW(HANDLE hServer, DWORD Reserved, DWORD Version, PWTS_SESSION_INFOW* ppSessionInfo, DWORD* pCount); +WINPR_API BOOL WINAPI WTSEnumerateSessionsA(HANDLE hServer, DWORD Reserved, DWORD Version, PWTS_SESSION_INFOA* ppSessionInfo, DWORD* pCount); -WINPR_API BOOL WTSEnumerateSessionsExW(HANDLE hServer, DWORD* pLevel, DWORD Filter, PWTS_SESSION_INFO_1W* ppSessionInfo, DWORD* pCount); -WINPR_API BOOL WTSEnumerateSessionsExA(HANDLE hServer, DWORD* pLevel, DWORD Filter, PWTS_SESSION_INFO_1A* ppSessionInfo, DWORD* pCount); +WINPR_API BOOL WINAPI WTSEnumerateSessionsExW(HANDLE hServer, DWORD* pLevel, DWORD Filter, PWTS_SESSION_INFO_1W* ppSessionInfo, DWORD* pCount); +WINPR_API BOOL WINAPI WTSEnumerateSessionsExA(HANDLE hServer, DWORD* pLevel, DWORD Filter, PWTS_SESSION_INFO_1A* ppSessionInfo, DWORD* pCount); -WINPR_API BOOL WTSEnumerateProcessesW(HANDLE hServer, DWORD Reserved, DWORD Version, PWTS_PROCESS_INFOW* ppProcessInfo, DWORD* pCount); -WINPR_API BOOL WTSEnumerateProcessesA(HANDLE hServer, DWORD Reserved, DWORD Version, PWTS_PROCESS_INFOA* ppProcessInfo, DWORD* pCount); +WINPR_API BOOL WINAPI WTSEnumerateProcessesW(HANDLE hServer, DWORD Reserved, DWORD Version, PWTS_PROCESS_INFOW* ppProcessInfo, DWORD* pCount); +WINPR_API BOOL WINAPI WTSEnumerateProcessesA(HANDLE hServer, DWORD Reserved, DWORD Version, PWTS_PROCESS_INFOA* ppProcessInfo, DWORD* pCount); -WINPR_API BOOL WTSTerminateProcess(HANDLE hServer, DWORD ProcessId, DWORD ExitCode); +WINPR_API BOOL WINAPI WTSTerminateProcess(HANDLE hServer, DWORD ProcessId, DWORD ExitCode); -WINPR_API BOOL WTSQuerySessionInformationW(HANDLE hServer, DWORD SessionId, WTS_INFO_CLASS WTSInfoClass, LPWSTR* ppBuffer, DWORD* pBytesReturned); -WINPR_API BOOL WTSQuerySessionInformationA(HANDLE hServer, DWORD SessionId, WTS_INFO_CLASS WTSInfoClass, LPSTR* ppBuffer, DWORD* pBytesReturned); +WINPR_API BOOL WINAPI WTSQuerySessionInformationW(HANDLE hServer, DWORD SessionId, WTS_INFO_CLASS WTSInfoClass, LPWSTR* ppBuffer, DWORD* pBytesReturned); +WINPR_API BOOL WINAPI WTSQuerySessionInformationA(HANDLE hServer, DWORD SessionId, WTS_INFO_CLASS WTSInfoClass, LPSTR* ppBuffer, DWORD* pBytesReturned); -WINPR_API BOOL WTSQueryUserConfigW(LPWSTR pServerName, LPWSTR pUserName, WTS_CONFIG_CLASS WTSConfigClass, LPWSTR* ppBuffer, DWORD* pBytesReturned); -WINPR_API BOOL WTSQueryUserConfigA(LPSTR pServerName, LPSTR pUserName, WTS_CONFIG_CLASS WTSConfigClass, LPSTR* ppBuffer, DWORD* pBytesReturned); +WINPR_API BOOL WINAPI WTSQueryUserConfigW(LPWSTR pServerName, LPWSTR pUserName, WTS_CONFIG_CLASS WTSConfigClass, LPWSTR* ppBuffer, DWORD* pBytesReturned); +WINPR_API BOOL WINAPI WTSQueryUserConfigA(LPSTR pServerName, LPSTR pUserName, WTS_CONFIG_CLASS WTSConfigClass, LPSTR* ppBuffer, DWORD* pBytesReturned); -WINPR_API BOOL WTSSetUserConfigW(LPWSTR pServerName, LPWSTR pUserName, WTS_CONFIG_CLASS WTSConfigClass, LPWSTR pBuffer, DWORD DataLength); -WINPR_API BOOL WTSSetUserConfigA(LPSTR pServerName, LPSTR pUserName, WTS_CONFIG_CLASS WTSConfigClass, LPSTR pBuffer, DWORD DataLength); +WINPR_API BOOL WINAPI WTSSetUserConfigW(LPWSTR pServerName, LPWSTR pUserName, WTS_CONFIG_CLASS WTSConfigClass, LPWSTR pBuffer, DWORD DataLength); +WINPR_API BOOL WINAPI WTSSetUserConfigA(LPSTR pServerName, LPSTR pUserName, WTS_CONFIG_CLASS WTSConfigClass, LPSTR pBuffer, DWORD DataLength); -WINPR_API BOOL WTSSendMessageW(HANDLE hServer, DWORD SessionId, LPWSTR pTitle, DWORD TitleLength, +WINPR_API BOOL WINAPI WTSSendMessageW(HANDLE hServer, DWORD SessionId, LPWSTR pTitle, DWORD TitleLength, LPWSTR pMessage, DWORD MessageLength, DWORD Style, DWORD Timeout, DWORD* pResponse, BOOL bWait); -WINPR_API BOOL WTSSendMessageA(HANDLE hServer, DWORD SessionId, LPSTR pTitle, DWORD TitleLength, +WINPR_API BOOL WINAPI WTSSendMessageA(HANDLE hServer, DWORD SessionId, LPSTR pTitle, DWORD TitleLength, LPSTR pMessage, DWORD MessageLength, DWORD Style, DWORD Timeout, DWORD* pResponse, BOOL bWait); -WINPR_API BOOL WTSDisconnectSession(HANDLE hServer, DWORD SessionId, BOOL bWait); +WINPR_API BOOL WINAPI WTSDisconnectSession(HANDLE hServer, DWORD SessionId, BOOL bWait); -WINPR_API BOOL WTSLogoffSession(HANDLE hServer, DWORD SessionId, BOOL bWait); +WINPR_API BOOL WINAPI WTSLogoffSession(HANDLE hServer, DWORD SessionId, BOOL bWait); -WINPR_API BOOL WTSShutdownSystem(HANDLE hServer, DWORD ShutdownFlag); +WINPR_API BOOL WINAPI WTSShutdownSystem(HANDLE hServer, DWORD ShutdownFlag); -WINPR_API BOOL WTSWaitSystemEvent(HANDLE hServer, DWORD EventMask, DWORD* pEventFlags); +WINPR_API BOOL WINAPI WTSWaitSystemEvent(HANDLE hServer, DWORD EventMask, DWORD* pEventFlags); -WINPR_API HANDLE WTSVirtualChannelOpen(HANDLE hServer, DWORD SessionId, LPSTR pVirtualName); +WINPR_API HANDLE WINAPI WTSVirtualChannelOpen(HANDLE hServer, DWORD SessionId, LPSTR pVirtualName); -WINPR_API HANDLE WTSVirtualChannelOpenEx(DWORD SessionId, LPSTR pVirtualName, DWORD flags); +WINPR_API HANDLE WINAPI WTSVirtualChannelOpenEx(DWORD SessionId, LPSTR pVirtualName, DWORD flags); -WINPR_API BOOL WTSVirtualChannelClose(HANDLE hChannelHandle); +WINPR_API BOOL WINAPI WTSVirtualChannelClose(HANDLE hChannelHandle); -WINPR_API BOOL WTSVirtualChannelRead(HANDLE hChannelHandle, ULONG TimeOut, PCHAR Buffer, ULONG BufferSize, PULONG pBytesRead); +WINPR_API BOOL WINAPI WTSVirtualChannelRead(HANDLE hChannelHandle, ULONG TimeOut, PCHAR Buffer, ULONG BufferSize, PULONG pBytesRead); -WINPR_API BOOL WTSVirtualChannelWrite(HANDLE hChannelHandle, PCHAR Buffer, ULONG Length, PULONG pBytesWritten); +WINPR_API BOOL WINAPI WTSVirtualChannelWrite(HANDLE hChannelHandle, PCHAR Buffer, ULONG Length, PULONG pBytesWritten); -WINPR_API BOOL WTSVirtualChannelPurgeInput(HANDLE hChannelHandle); +WINPR_API BOOL WINAPI WTSVirtualChannelPurgeInput(HANDLE hChannelHandle); -WINPR_API BOOL WTSVirtualChannelPurgeOutput(HANDLE hChannelHandle); +WINPR_API BOOL WINAPI WTSVirtualChannelPurgeOutput(HANDLE hChannelHandle); -WINPR_API BOOL WTSVirtualChannelQuery(HANDLE hChannelHandle, WTS_VIRTUAL_CLASS WtsVirtualClass, PVOID* ppBuffer, DWORD* pBytesReturned); +WINPR_API BOOL WINAPI WTSVirtualChannelQuery(HANDLE hChannelHandle, WTS_VIRTUAL_CLASS WtsVirtualClass, PVOID* ppBuffer, DWORD* pBytesReturned); -WINPR_API VOID WTSFreeMemory(PVOID pMemory); +WINPR_API VOID WINAPI WTSFreeMemory(PVOID pMemory); -WINPR_API BOOL WTSRegisterSessionNotification(HWND hWnd, DWORD dwFlags); +WINPR_API BOOL WINAPI WTSRegisterSessionNotification(HWND hWnd, DWORD dwFlags); -WINPR_API BOOL WTSUnRegisterSessionNotification(HWND hWnd); +WINPR_API BOOL WINAPI WTSUnRegisterSessionNotification(HWND hWnd); -WINPR_API BOOL WTSRegisterSessionNotificationEx(HANDLE hServer, HWND hWnd, DWORD dwFlags); +WINPR_API BOOL WINAPI WTSRegisterSessionNotificationEx(HANDLE hServer, HWND hWnd, DWORD dwFlags); -WINPR_API BOOL WTSUnRegisterSessionNotificationEx(HANDLE hServer, HWND hWnd); +WINPR_API BOOL WINAPI WTSUnRegisterSessionNotificationEx(HANDLE hServer, HWND hWnd); -WINPR_API BOOL WTSQueryUserToken(ULONG SessionId, PHANDLE phToken); +WINPR_API BOOL WINAPI WTSQueryUserToken(ULONG SessionId, PHANDLE phToken); -WINPR_API BOOL WTSFreeMemoryExW(WTS_TYPE_CLASS WTSTypeClass, PVOID pMemory, ULONG NumberOfEntries); -WINPR_API BOOL WTSFreeMemoryExA(WTS_TYPE_CLASS WTSTypeClass, PVOID pMemory, ULONG NumberOfEntries); +WINPR_API BOOL WINAPI WTSFreeMemoryExW(WTS_TYPE_CLASS WTSTypeClass, PVOID pMemory, ULONG NumberOfEntries); +WINPR_API BOOL WINAPI WTSFreeMemoryExA(WTS_TYPE_CLASS WTSTypeClass, PVOID pMemory, ULONG NumberOfEntries); -WINPR_API BOOL WTSEnumerateProcessesExW(HANDLE hServer, DWORD* pLevel, DWORD SessionId, LPWSTR* ppProcessInfo, DWORD* pCount); -WINPR_API BOOL WTSEnumerateProcessesExA(HANDLE hServer, DWORD* pLevel, DWORD SessionId, LPSTR* ppProcessInfo, DWORD* pCount); +WINPR_API BOOL WINAPI WTSEnumerateProcessesExW(HANDLE hServer, DWORD* pLevel, DWORD SessionId, LPWSTR* ppProcessInfo, DWORD* pCount); +WINPR_API BOOL WINAPI WTSEnumerateProcessesExA(HANDLE hServer, DWORD* pLevel, DWORD SessionId, LPSTR* ppProcessInfo, DWORD* pCount); -WINPR_API BOOL WTSEnumerateListenersW(HANDLE hServer, PVOID pReserved, DWORD Reserved, PWTSLISTENERNAMEW pListeners, DWORD* pCount); -WINPR_API BOOL WTSEnumerateListenersA(HANDLE hServer, PVOID pReserved, DWORD Reserved, PWTSLISTENERNAMEA pListeners, DWORD* pCount); +WINPR_API BOOL WINAPI WTSEnumerateListenersW(HANDLE hServer, PVOID pReserved, DWORD Reserved, PWTSLISTENERNAMEW pListeners, DWORD* pCount); +WINPR_API BOOL WINAPI WTSEnumerateListenersA(HANDLE hServer, PVOID pReserved, DWORD Reserved, PWTSLISTENERNAMEA pListeners, DWORD* pCount); -WINPR_API BOOL WTSQueryListenerConfigW(HANDLE hServer, PVOID pReserved, DWORD Reserved, LPWSTR pListenerName, PWTSLISTENERCONFIGW pBuffer); -WINPR_API BOOL WTSQueryListenerConfigA(HANDLE hServer, PVOID pReserved, DWORD Reserved, LPSTR pListenerName, PWTSLISTENERCONFIGA pBuffer); +WINPR_API BOOL WINAPI WTSQueryListenerConfigW(HANDLE hServer, PVOID pReserved, DWORD Reserved, LPWSTR pListenerName, PWTSLISTENERCONFIGW pBuffer); +WINPR_API BOOL WINAPI WTSQueryListenerConfigA(HANDLE hServer, PVOID pReserved, DWORD Reserved, LPSTR pListenerName, PWTSLISTENERCONFIGA pBuffer); -WINPR_API BOOL WTSCreateListenerW(HANDLE hServer, PVOID pReserved, DWORD Reserved, +WINPR_API BOOL WINAPI WTSCreateListenerW(HANDLE hServer, PVOID pReserved, DWORD Reserved, LPWSTR pListenerName, PWTSLISTENERCONFIGW pBuffer, DWORD flag); -WINPR_API BOOL WTSCreateListenerA(HANDLE hServer, PVOID pReserved, DWORD Reserved, +WINPR_API BOOL WINAPI WTSCreateListenerA(HANDLE hServer, PVOID pReserved, DWORD Reserved, LPSTR pListenerName, PWTSLISTENERCONFIGA pBuffer, DWORD flag); -WINPR_API BOOL WTSSetListenerSecurityW(HANDLE hServer, PVOID pReserved, DWORD Reserved, +WINPR_API BOOL WINAPI WTSSetListenerSecurityW(HANDLE hServer, PVOID pReserved, DWORD Reserved, LPWSTR pListenerName, SECURITY_INFORMATION SecurityInformation, PSECURITY_DESCRIPTOR pSecurityDescriptor); -WINPR_API BOOL WTSSetListenerSecurityA(HANDLE hServer, PVOID pReserved, DWORD Reserved, +WINPR_API BOOL WINAPI WTSSetListenerSecurityA(HANDLE hServer, PVOID pReserved, DWORD Reserved, LPSTR pListenerName, SECURITY_INFORMATION SecurityInformation, PSECURITY_DESCRIPTOR pSecurityDescriptor); -WINPR_API BOOL WTSGetListenerSecurityW(HANDLE hServer, PVOID pReserved, DWORD Reserved, +WINPR_API BOOL WINAPI WTSGetListenerSecurityW(HANDLE hServer, PVOID pReserved, DWORD Reserved, LPWSTR pListenerName, SECURITY_INFORMATION SecurityInformation, PSECURITY_DESCRIPTOR pSecurityDescriptor, DWORD nLength, LPDWORD lpnLengthNeeded); -WINPR_API BOOL WTSGetListenerSecurityA(HANDLE hServer, PVOID pReserved, DWORD Reserved, +WINPR_API BOOL WINAPI WTSGetListenerSecurityA(HANDLE hServer, PVOID pReserved, DWORD Reserved, LPSTR pListenerName, SECURITY_INFORMATION SecurityInformation, PSECURITY_DESCRIPTOR pSecurityDescriptor, DWORD nLength, LPDWORD lpnLengthNeeded); -WINPR_API BOOL WTSEnableChildSessions(BOOL bEnable); +/** + * WTSEnableChildSessions, WTSIsChildSessionsEnabled and WTSGetChildSessionId + * are not explicitly declared as WINAPI like other WTSAPI functions. + * Since they are declared as extern "C", we explicitly declare them as CDECL. + */ -WINPR_API BOOL WTSIsChildSessionsEnabled(PBOOL pbEnabled); +WINPR_API BOOL CDECL WTSEnableChildSessions(BOOL bEnable); -WINPR_API BOOL WTSGetChildSessionId(PULONG pSessionId); +WINPR_API BOOL CDECL WTSIsChildSessionsEnabled(PBOOL pbEnabled); -WINPR_API DWORD WTSGetActiveConsoleSessionId(void); +WINPR_API BOOL CDECL WTSGetChildSessionId(PULONG pSessionId); #ifdef __cplusplus } @@ -1101,148 +1126,157 @@ WINPR_API DWORD WTSGetActiveConsoleSessionId(void); #endif -#define WTSAPI CALLBACK +#ifndef _WIN32 -typedef BOOL (WTSAPI * WTS_STOP_REMOTE_CONTROL_SESSION_FN)(ULONG LogonId); +/** + * WTSGetActiveConsoleSessionId is declared in WinBase.h + * and exported by kernel32.dll, so we have to treat it separately. + */ -typedef BOOL (WTSAPI * WTS_START_REMOTE_CONTROL_SESSION_FN_W)(LPWSTR pTargetServerName, +WINPR_API DWORD WINAPI WTSGetActiveConsoleSessionId(void); + +#endif + +typedef BOOL (WINAPI * WTS_STOP_REMOTE_CONTROL_SESSION_FN)(ULONG LogonId); + +typedef BOOL (WINAPI * WTS_START_REMOTE_CONTROL_SESSION_FN_W)(LPWSTR pTargetServerName, ULONG TargetLogonId, BYTE HotkeyVk, USHORT HotkeyModifiers); -typedef BOOL (WTSAPI * WTS_START_REMOTE_CONTROL_SESSION_FN_A)(LPSTR pTargetServerName, +typedef BOOL (WINAPI * WTS_START_REMOTE_CONTROL_SESSION_FN_A)(LPSTR pTargetServerName, ULONG TargetLogonId, BYTE HotkeyVk, USHORT HotkeyModifiers); -typedef BOOL (WTSAPI * WTS_CONNECT_SESSION_FN_W)(ULONG LogonId, ULONG TargetLogonId, PWSTR pPassword, BOOL bWait); -typedef BOOL (WTSAPI * WTS_CONNECT_SESSION_FN_A)(ULONG LogonId, ULONG TargetLogonId, PSTR pPassword, BOOL bWait); +typedef BOOL (WINAPI * WTS_CONNECT_SESSION_FN_W)(ULONG LogonId, ULONG TargetLogonId, PWSTR pPassword, BOOL bWait); +typedef BOOL (WINAPI * WTS_CONNECT_SESSION_FN_A)(ULONG LogonId, ULONG TargetLogonId, PSTR pPassword, BOOL bWait); -typedef BOOL (WTSAPI * WTS_ENUMERATE_SERVERS_FN_W)(LPWSTR pDomainName, +typedef BOOL (WINAPI * WTS_ENUMERATE_SERVERS_FN_W)(LPWSTR pDomainName, DWORD Reserved, DWORD Version, PWTS_SERVER_INFOW* ppServerInfo, DWORD* pCount); -typedef BOOL (WTSAPI * WTS_ENUMERATE_SERVERS_FN_A)(LPSTR pDomainName, +typedef BOOL (WINAPI * WTS_ENUMERATE_SERVERS_FN_A)(LPSTR pDomainName, DWORD Reserved, DWORD Version, PWTS_SERVER_INFOA* ppServerInfo, DWORD* pCount); -typedef HANDLE (WTSAPI * WTS_OPEN_SERVER_FN_W)(LPWSTR pServerName); -typedef HANDLE (WTSAPI * WTS_OPEN_SERVER_FN_A)(LPSTR pServerName); +typedef HANDLE (WINAPI * WTS_OPEN_SERVER_FN_W)(LPWSTR pServerName); +typedef HANDLE (WINAPI * WTS_OPEN_SERVER_FN_A)(LPSTR pServerName); -typedef HANDLE (WTSAPI * WTS_OPEN_SERVER_EX_FN_W)(LPWSTR pServerName); -typedef HANDLE (WTSAPI * WTS_OPEN_SERVER_EX_FN_A)(LPSTR pServerName); +typedef HANDLE (WINAPI * WTS_OPEN_SERVER_EX_FN_W)(LPWSTR pServerName); +typedef HANDLE (WINAPI * WTS_OPEN_SERVER_EX_FN_A)(LPSTR pServerName); -typedef VOID (WTSAPI * WTS_CLOSE_SERVER_FN)(HANDLE hServer); +typedef VOID (WINAPI * WTS_CLOSE_SERVER_FN)(HANDLE hServer); -typedef BOOL (WTSAPI * WTS_ENUMERATE_SESSIONS_FN_W)(HANDLE hServer, +typedef BOOL (WINAPI * WTS_ENUMERATE_SESSIONS_FN_W)(HANDLE hServer, DWORD Reserved, DWORD Version, PWTS_SESSION_INFOW* ppSessionInfo, DWORD* pCount); -typedef BOOL (WTSAPI * WTS_ENUMERATE_SESSIONS_FN_A)(HANDLE hServer, +typedef BOOL (WINAPI * WTS_ENUMERATE_SESSIONS_FN_A)(HANDLE hServer, DWORD Reserved, DWORD Version, PWTS_SESSION_INFOA* ppSessionInfo, DWORD* pCount); -typedef BOOL (WTSAPI * WTS_ENUMERATE_SESSIONS_EX_FN_W)(HANDLE hServer, +typedef BOOL (WINAPI * WTS_ENUMERATE_SESSIONS_EX_FN_W)(HANDLE hServer, DWORD* pLevel, DWORD Filter, PWTS_SESSION_INFO_1W* ppSessionInfo, DWORD* pCount); -typedef BOOL (WTSAPI * WTS_ENUMERATE_SESSIONS_EX_FN_A)(HANDLE hServer, +typedef BOOL (WINAPI * WTS_ENUMERATE_SESSIONS_EX_FN_A)(HANDLE hServer, DWORD* pLevel, DWORD Filter, PWTS_SESSION_INFO_1A* ppSessionInfo, DWORD* pCount); -typedef BOOL (WTSAPI * WTS_ENUMERATE_PROCESSES_FN_W)(HANDLE hServer, +typedef BOOL (WINAPI * WTS_ENUMERATE_PROCESSES_FN_W)(HANDLE hServer, DWORD Reserved, DWORD Version, PWTS_PROCESS_INFOW* ppProcessInfo, DWORD* pCount); -typedef BOOL (WTSAPI * WTS_ENUMERATE_PROCESSES_FN_A)(HANDLE hServer, +typedef BOOL (WINAPI * WTS_ENUMERATE_PROCESSES_FN_A)(HANDLE hServer, DWORD Reserved, DWORD Version, PWTS_PROCESS_INFOA* ppProcessInfo, DWORD* pCount); -typedef BOOL (WTSAPI * WTS_TERMINATE_PROCESS_FN)(HANDLE hServer, DWORD ProcessId, DWORD ExitCode); +typedef BOOL (WINAPI * WTS_TERMINATE_PROCESS_FN)(HANDLE hServer, DWORD ProcessId, DWORD ExitCode); -typedef BOOL (WTSAPI * WTS_QUERY_SESSION_INFORMATION_FN_W)(HANDLE hServer, +typedef BOOL (WINAPI * WTS_QUERY_SESSION_INFORMATION_FN_W)(HANDLE hServer, DWORD SessionId, WTS_INFO_CLASS WTSInfoClass, LPWSTR* ppBuffer, DWORD* pBytesReturned); -typedef BOOL (WTSAPI * WTS_QUERY_SESSION_INFORMATION_FN_A)(HANDLE hServer, +typedef BOOL (WINAPI * WTS_QUERY_SESSION_INFORMATION_FN_A)(HANDLE hServer, DWORD SessionId, WTS_INFO_CLASS WTSInfoClass, LPSTR* ppBuffer, DWORD* pBytesReturned); -typedef BOOL (WTSAPI * WTS_QUERY_USER_CONFIG_FN_W)(LPWSTR pServerName, +typedef BOOL (WINAPI * WTS_QUERY_USER_CONFIG_FN_W)(LPWSTR pServerName, LPWSTR pUserName, WTS_CONFIG_CLASS WTSConfigClass, LPWSTR* ppBuffer, DWORD* pBytesReturned); -typedef BOOL (WTSAPI * WTS_QUERY_USER_CONFIG_FN_A)(LPSTR pServerName, +typedef BOOL (WINAPI * WTS_QUERY_USER_CONFIG_FN_A)(LPSTR pServerName, LPSTR pUserName, WTS_CONFIG_CLASS WTSConfigClass, LPSTR* ppBuffer, DWORD* pBytesReturned); -typedef BOOL (WTSAPI * WTS_SET_USER_CONFIG_FN_W)(LPWSTR pServerName, +typedef BOOL (WINAPI * WTS_SET_USER_CONFIG_FN_W)(LPWSTR pServerName, LPWSTR pUserName, WTS_CONFIG_CLASS WTSConfigClass, LPWSTR pBuffer, DWORD DataLength); -typedef BOOL (WTSAPI * WTS_SET_USER_CONFIG_FN_A)(LPSTR pServerName, +typedef BOOL (WINAPI * WTS_SET_USER_CONFIG_FN_A)(LPSTR pServerName, LPSTR pUserName, WTS_CONFIG_CLASS WTSConfigClass, LPSTR pBuffer, DWORD DataLength); -typedef BOOL (WTSAPI * WTS_SEND_MESSAGE_FN_W)(HANDLE hServer, DWORD SessionId, LPWSTR pTitle, DWORD TitleLength, +typedef BOOL (WINAPI * WTS_SEND_MESSAGE_FN_W)(HANDLE hServer, DWORD SessionId, LPWSTR pTitle, DWORD TitleLength, LPWSTR pMessage, DWORD MessageLength, DWORD Style, DWORD Timeout, DWORD* pResponse, BOOL bWait); -typedef BOOL (WTSAPI * WTS_SEND_MESSAGE_FN_A)(HANDLE hServer, DWORD SessionId, LPSTR pTitle, DWORD TitleLength, +typedef BOOL (WINAPI * WTS_SEND_MESSAGE_FN_A)(HANDLE hServer, DWORD SessionId, LPSTR pTitle, DWORD TitleLength, LPSTR pMessage, DWORD MessageLength, DWORD Style, DWORD Timeout, DWORD* pResponse, BOOL bWait); -typedef BOOL (WTSAPI * WTS_DISCONNECT_SESSION_FN)(HANDLE hServer, DWORD SessionId, BOOL bWait); +typedef BOOL (WINAPI * WTS_DISCONNECT_SESSION_FN)(HANDLE hServer, DWORD SessionId, BOOL bWait); -typedef BOOL (WTSAPI * WTS_LOGOFF_SESSION_FN)(HANDLE hServer, DWORD SessionId, BOOL bWait); +typedef BOOL (WINAPI * WTS_LOGOFF_SESSION_FN)(HANDLE hServer, DWORD SessionId, BOOL bWait); -typedef BOOL (WTSAPI * WTS_SHUTDOWN_SYSTEM_FN)(HANDLE hServer, DWORD ShutdownFlag); +typedef BOOL (WINAPI * WTS_SHUTDOWN_SYSTEM_FN)(HANDLE hServer, DWORD ShutdownFlag); -typedef BOOL (WTSAPI * WTS_WAIT_SYSTEM_EVENT_FN)(HANDLE hServer, DWORD EventMask, DWORD* pEventFlags); +typedef BOOL (WINAPI * WTS_WAIT_SYSTEM_EVENT_FN)(HANDLE hServer, DWORD EventMask, DWORD* pEventFlags); -typedef HANDLE (WTSAPI * WTS_VIRTUAL_CHANNEL_OPEN_FN)(HANDLE hServer, DWORD SessionId, LPSTR pVirtualName); +typedef HANDLE (WINAPI * WTS_VIRTUAL_CHANNEL_OPEN_FN)(HANDLE hServer, DWORD SessionId, LPSTR pVirtualName); -typedef HANDLE (WTSAPI * WTS_VIRTUAL_CHANNEL_OPEN_EX_FN)(DWORD SessionId, LPSTR pVirtualName, DWORD flags); +typedef HANDLE (WINAPI * WTS_VIRTUAL_CHANNEL_OPEN_EX_FN)(DWORD SessionId, LPSTR pVirtualName, DWORD flags); -typedef BOOL (WTSAPI * WTS_VIRTUAL_CHANNEL_CLOSE_FN)(HANDLE hChannelHandle); +typedef BOOL (WINAPI * WTS_VIRTUAL_CHANNEL_CLOSE_FN)(HANDLE hChannelHandle); -typedef BOOL (WTSAPI * WTS_VIRTUAL_CHANNEL_READ_FN)(HANDLE hChannelHandle, ULONG TimeOut, PCHAR Buffer, ULONG BufferSize, PULONG pBytesRead); +typedef BOOL (WINAPI * WTS_VIRTUAL_CHANNEL_READ_FN)(HANDLE hChannelHandle, ULONG TimeOut, PCHAR Buffer, ULONG BufferSize, PULONG pBytesRead); -typedef BOOL (WTSAPI * WTS_VIRTUAL_CHANNEL_WRITE_FN)(HANDLE hChannelHandle, PCHAR Buffer, ULONG Length, PULONG pBytesWritten); +typedef BOOL (WINAPI * WTS_VIRTUAL_CHANNEL_WRITE_FN)(HANDLE hChannelHandle, PCHAR Buffer, ULONG Length, PULONG pBytesWritten); -typedef BOOL (WTSAPI * WTS_VIRTUAL_CHANNEL_PURGE_INPUT_FN)(HANDLE hChannelHandle); +typedef BOOL (WINAPI * WTS_VIRTUAL_CHANNEL_PURGE_INPUT_FN)(HANDLE hChannelHandle); -typedef BOOL (WTSAPI * WTS_VIRTUAL_CHANNEL_PURGE_OUTPUT_FN)(HANDLE hChannelHandle); +typedef BOOL (WINAPI * WTS_VIRTUAL_CHANNEL_PURGE_OUTPUT_FN)(HANDLE hChannelHandle); -typedef BOOL (WTSAPI * WTS_VIRTUAL_CHANNEL_QUERY_FN)(HANDLE hChannelHandle, WTS_VIRTUAL_CLASS WtsVirtualClass, PVOID* ppBuffer, DWORD* pBytesReturned); +typedef BOOL (WINAPI * WTS_VIRTUAL_CHANNEL_QUERY_FN)(HANDLE hChannelHandle, WTS_VIRTUAL_CLASS WtsVirtualClass, PVOID* ppBuffer, DWORD* pBytesReturned); -typedef VOID (WTSAPI * WTS_FREE_MEMORY_FN)(PVOID pMemory); +typedef VOID (WINAPI * WTS_FREE_MEMORY_FN)(PVOID pMemory); -typedef BOOL (WTSAPI * WTS_REGISTER_SESSION_NOTIFICATION_FN)(HWND hWnd, DWORD dwFlags); +typedef BOOL (WINAPI * WTS_REGISTER_SESSION_NOTIFICATION_FN)(HWND hWnd, DWORD dwFlags); -typedef BOOL (WTSAPI * WTS_UNREGISTER_SESSION_NOTIFICATION_FN)(HWND hWnd); +typedef BOOL (WINAPI * WTS_UNREGISTER_SESSION_NOTIFICATION_FN)(HWND hWnd); -typedef BOOL (WTSAPI * WTS_REGISTER_SESSION_NOTIFICATION_EX_FN)(HANDLE hServer, HWND hWnd, DWORD dwFlags); +typedef BOOL (WINAPI * WTS_REGISTER_SESSION_NOTIFICATION_EX_FN)(HANDLE hServer, HWND hWnd, DWORD dwFlags); -typedef BOOL (WTSAPI * WTS_UNREGISTER_SESSION_NOTIFICATION_EX_FN)(HANDLE hServer, HWND hWnd); +typedef BOOL (WINAPI * WTS_UNREGISTER_SESSION_NOTIFICATION_EX_FN)(HANDLE hServer, HWND hWnd); -typedef BOOL (WTSAPI * WTS_QUERY_USER_TOKEN_FN)(ULONG SessionId, PHANDLE phToken); +typedef BOOL (WINAPI * WTS_QUERY_USER_TOKEN_FN)(ULONG SessionId, PHANDLE phToken); -typedef BOOL (WTSAPI * WTS_FREE_MEMORY_EX_FN_W)(WTS_TYPE_CLASS WTSTypeClass, PVOID pMemory, ULONG NumberOfEntries); -typedef BOOL (WTSAPI * WTS_FREE_MEMORY_EX_FN_A)(WTS_TYPE_CLASS WTSTypeClass, PVOID pMemory, ULONG NumberOfEntries); +typedef BOOL (WINAPI * WTS_FREE_MEMORY_EX_FN_W)(WTS_TYPE_CLASS WTSTypeClass, PVOID pMemory, ULONG NumberOfEntries); +typedef BOOL (WINAPI * WTS_FREE_MEMORY_EX_FN_A)(WTS_TYPE_CLASS WTSTypeClass, PVOID pMemory, ULONG NumberOfEntries); -typedef BOOL (WTSAPI * WTS_ENUMERATE_PROCESSES_EX_FN_W)(HANDLE hServer, +typedef BOOL (WINAPI * WTS_ENUMERATE_PROCESSES_EX_FN_W)(HANDLE hServer, DWORD* pLevel, DWORD SessionId, LPWSTR* ppProcessInfo, DWORD* pCount); -typedef BOOL (WTSAPI * WTS_ENUMERATE_PROCESSES_EX_FN_A)(HANDLE hServer, +typedef BOOL (WINAPI * WTS_ENUMERATE_PROCESSES_EX_FN_A)(HANDLE hServer, DWORD* pLevel, DWORD SessionId, LPSTR* ppProcessInfo, DWORD* pCount); -typedef BOOL (WTSAPI * WTS_ENUMERATE_LISTENERS_FN_W)(HANDLE hServer, +typedef BOOL (WINAPI * WTS_ENUMERATE_LISTENERS_FN_W)(HANDLE hServer, PVOID pReserved, DWORD Reserved, PWTSLISTENERNAMEW pListeners, DWORD* pCount); -typedef BOOL (WTSAPI * WTS_ENUMERATE_LISTENERS_FN_A)(HANDLE hServer, +typedef BOOL (WINAPI * WTS_ENUMERATE_LISTENERS_FN_A)(HANDLE hServer, PVOID pReserved, DWORD Reserved, PWTSLISTENERNAMEA pListeners, DWORD* pCount); -typedef BOOL (WTSAPI * WTS_QUERY_LISTENER_CONFIG_FN_W)(HANDLE hServer, +typedef BOOL (WINAPI * WTS_QUERY_LISTENER_CONFIG_FN_W)(HANDLE hServer, PVOID pReserved, DWORD Reserved, LPWSTR pListenerName, PWTSLISTENERCONFIGW pBuffer); -typedef BOOL (WTSAPI * WTS_QUERY_LISTENER_CONFIG_FN_A)(HANDLE hServer, +typedef BOOL (WINAPI * WTS_QUERY_LISTENER_CONFIG_FN_A)(HANDLE hServer, PVOID pReserved, DWORD Reserved, LPSTR pListenerName, PWTSLISTENERCONFIGA pBuffer); -typedef BOOL (WTSAPI * WTS_CREATE_LISTENER_FN_W)(HANDLE hServer, PVOID pReserved, DWORD Reserved, +typedef BOOL (WINAPI * WTS_CREATE_LISTENER_FN_W)(HANDLE hServer, PVOID pReserved, DWORD Reserved, LPWSTR pListenerName, PWTSLISTENERCONFIGW pBuffer, DWORD flag); -typedef BOOL (WTSAPI * WTS_CREATE_LISTENER_FN_A)(HANDLE hServer, PVOID pReserved, DWORD Reserved, +typedef BOOL (WINAPI * WTS_CREATE_LISTENER_FN_A)(HANDLE hServer, PVOID pReserved, DWORD Reserved, LPSTR pListenerName, PWTSLISTENERCONFIGA pBuffer, DWORD flag); -typedef BOOL (WTSAPI * WTS_SET_LISTENER_SECURITY_FN_W)(HANDLE hServer, PVOID pReserved, DWORD Reserved, +typedef BOOL (WINAPI * WTS_SET_LISTENER_SECURITY_FN_W)(HANDLE hServer, PVOID pReserved, DWORD Reserved, LPWSTR pListenerName, SECURITY_INFORMATION SecurityInformation, PSECURITY_DESCRIPTOR pSecurityDescriptor); -typedef BOOL (WTSAPI * WTS_SET_LISTENER_SECURITY_FN_A)(HANDLE hServer, PVOID pReserved, DWORD Reserved, +typedef BOOL (WINAPI * WTS_SET_LISTENER_SECURITY_FN_A)(HANDLE hServer, PVOID pReserved, DWORD Reserved, LPSTR pListenerName, SECURITY_INFORMATION SecurityInformation, PSECURITY_DESCRIPTOR pSecurityDescriptor); -typedef BOOL (WTSAPI * WTS_GET_LISTENER_SECURITY_FN_W)(HANDLE hServer, PVOID pReserved, DWORD Reserved, +typedef BOOL (WINAPI * WTS_GET_LISTENER_SECURITY_FN_W)(HANDLE hServer, PVOID pReserved, DWORD Reserved, LPWSTR pListenerName, SECURITY_INFORMATION SecurityInformation, PSECURITY_DESCRIPTOR pSecurityDescriptor, DWORD nLength, LPDWORD lpnLengthNeeded); -typedef BOOL (WTSAPI * WTS_GET_LISTENER_SECURITY_FN_A)(HANDLE hServer, PVOID pReserved, DWORD Reserved, +typedef BOOL (WINAPI * WTS_GET_LISTENER_SECURITY_FN_A)(HANDLE hServer, PVOID pReserved, DWORD Reserved, LPSTR pListenerName, SECURITY_INFORMATION SecurityInformation, PSECURITY_DESCRIPTOR pSecurityDescriptor, DWORD nLength, LPDWORD lpnLengthNeeded); -typedef BOOL (WTSAPI * WTS_ENABLE_CHILD_SESSIONS_FN)(BOOL bEnable); +typedef BOOL (CDECL * WTS_ENABLE_CHILD_SESSIONS_FN)(BOOL bEnable); -typedef BOOL (WTSAPI * WTS_IS_CHILD_SESSIONS_ENABLED_FN)(PBOOL pbEnabled); +typedef BOOL (CDECL * WTS_IS_CHILD_SESSIONS_ENABLED_FN)(PBOOL pbEnabled); -typedef BOOL (WTSAPI * WTS_GET_CHILD_SESSION_ID_FN)(PULONG pSessionId); +typedef BOOL (CDECL * WTS_GET_CHILD_SESSION_ID_FN)(PULONG pSessionId); -typedef DWORD (WTSAPI * WTS_GET_ACTIVE_CONSOLE_SESSION_ID_FN)(void); +typedef DWORD (WINAPI * WTS_GET_ACTIVE_CONSOLE_SESSION_ID_FN)(void); struct _WtsApiFunctionTable { diff --git a/winpr/libwinpr/wtsapi/CMakeLists.txt b/winpr/libwinpr/wtsapi/CMakeLists.txt index fa3e42285..f9cf532bc 100644 --- a/winpr/libwinpr/wtsapi/CMakeLists.txt +++ b/winpr/libwinpr/wtsapi/CMakeLists.txt @@ -21,10 +21,6 @@ set(MODULE_PREFIX "WINPR_WTSAPI") set(${MODULE_PREFIX}_SRCS wtsapi.c) -if(MSVC AND (NOT MONOLITHIC_BUILD)) - set(${MODULE_PREFIX}_SRCS ${${MODULE_PREFIX}_SRCS} module.def) -endif() - add_complex_library(MODULE ${MODULE_NAME} TYPE "OBJECT" MONOLITHIC ${MONOLITHIC_BUILD} SOURCES ${${MODULE_PREFIX}_SRCS}) diff --git a/winpr/libwinpr/wtsapi/module.def b/winpr/libwinpr/wtsapi/module.def deleted file mode 100644 index b5adf3c6e..000000000 --- a/winpr/libwinpr/wtsapi/module.def +++ /dev/null @@ -1,2 +0,0 @@ -LIBRARY "libwinpr-wtsapi" -EXPORTS diff --git a/winpr/libwinpr/wtsapi/wtsapi.c b/winpr/libwinpr/wtsapi/wtsapi.c index 1d4bc6596..adfbaf1e5 100644 --- a/winpr/libwinpr/wtsapi/wtsapi.c +++ b/winpr/libwinpr/wtsapi/wtsapi.c @@ -33,9 +33,7 @@ static PWtsApiFunctionTable g_WtsApi = NULL; -#ifndef _WIN32 - -BOOL WTSStartRemoteControlSessionW(LPWSTR pTargetServerName, ULONG TargetLogonId, BYTE HotkeyVk, USHORT HotkeyModifiers) +BOOL WINAPI WTSStartRemoteControlSessionW(LPWSTR pTargetServerName, ULONG TargetLogonId, BYTE HotkeyVk, USHORT HotkeyModifiers) { if (!g_WtsApi || !g_WtsApi->StartRemoteControlSessionW) return FALSE; @@ -43,7 +41,7 @@ BOOL WTSStartRemoteControlSessionW(LPWSTR pTargetServerName, ULONG TargetLogonId return g_WtsApi->StartRemoteControlSessionW(pTargetServerName, TargetLogonId, HotkeyVk, HotkeyModifiers); } -BOOL WTSStartRemoteControlSessionA(LPSTR pTargetServerName, ULONG TargetLogonId, BYTE HotkeyVk, USHORT HotkeyModifiers) +BOOL WINAPI WTSStartRemoteControlSessionA(LPSTR pTargetServerName, ULONG TargetLogonId, BYTE HotkeyVk, USHORT HotkeyModifiers) { if (!g_WtsApi || !g_WtsApi->StartRemoteControlSessionA) return FALSE; @@ -51,7 +49,7 @@ BOOL WTSStartRemoteControlSessionA(LPSTR pTargetServerName, ULONG TargetLogonId, return g_WtsApi->StartRemoteControlSessionA(pTargetServerName, TargetLogonId, HotkeyVk, HotkeyModifiers); } -BOOL WTSStopRemoteControlSession(ULONG LogonId) +BOOL WINAPI WTSStopRemoteControlSession(ULONG LogonId) { if (!g_WtsApi || !g_WtsApi->StopRemoteControlSession) return FALSE; @@ -59,7 +57,7 @@ BOOL WTSStopRemoteControlSession(ULONG LogonId) return g_WtsApi->StopRemoteControlSession(LogonId); } -BOOL WTSConnectSessionW(ULONG LogonId, ULONG TargetLogonId, PWSTR pPassword, BOOL bWait) +BOOL WINAPI WTSConnectSessionW(ULONG LogonId, ULONG TargetLogonId, PWSTR pPassword, BOOL bWait) { if (!g_WtsApi || !g_WtsApi->ConnectSessionW) return FALSE; @@ -67,7 +65,7 @@ BOOL WTSConnectSessionW(ULONG LogonId, ULONG TargetLogonId, PWSTR pPassword, BOO return g_WtsApi->ConnectSessionW(LogonId, TargetLogonId, pPassword, bWait); } -BOOL WTSConnectSessionA(ULONG LogonId, ULONG TargetLogonId, PSTR pPassword, BOOL bWait) +BOOL WINAPI WTSConnectSessionA(ULONG LogonId, ULONG TargetLogonId, PSTR pPassword, BOOL bWait) { if (!g_WtsApi || !g_WtsApi->ConnectSessionA) return FALSE; @@ -75,7 +73,7 @@ BOOL WTSConnectSessionA(ULONG LogonId, ULONG TargetLogonId, PSTR pPassword, BOOL return g_WtsApi->ConnectSessionA(LogonId, TargetLogonId, pPassword, bWait); } -BOOL WTSEnumerateServersW(LPWSTR pDomainName, DWORD Reserved, DWORD Version, PWTS_SERVER_INFOW* ppServerInfo, DWORD* pCount) +BOOL WINAPI WTSEnumerateServersW(LPWSTR pDomainName, DWORD Reserved, DWORD Version, PWTS_SERVER_INFOW* ppServerInfo, DWORD* pCount) { if (!g_WtsApi || !g_WtsApi->EnumerateServersW) return FALSE; @@ -83,7 +81,7 @@ BOOL WTSEnumerateServersW(LPWSTR pDomainName, DWORD Reserved, DWORD Version, PWT return g_WtsApi->EnumerateServersW(pDomainName, Reserved, Version, ppServerInfo, pCount); } -BOOL WTSEnumerateServersA(LPSTR pDomainName, DWORD Reserved, DWORD Version, PWTS_SERVER_INFOA* ppServerInfo, DWORD* pCount) +BOOL WINAPI WTSEnumerateServersA(LPSTR pDomainName, DWORD Reserved, DWORD Version, PWTS_SERVER_INFOA* ppServerInfo, DWORD* pCount) { if (!g_WtsApi || !g_WtsApi->EnumerateServersA) return FALSE; @@ -91,7 +89,7 @@ BOOL WTSEnumerateServersA(LPSTR pDomainName, DWORD Reserved, DWORD Version, PWTS return g_WtsApi->EnumerateServersA(pDomainName, Reserved, Version, ppServerInfo, pCount); } -HANDLE WTSOpenServerW(LPWSTR pServerName) +HANDLE WINAPI WTSOpenServerW(LPWSTR pServerName) { if (!g_WtsApi || !g_WtsApi->OpenServerW) return FALSE; @@ -99,7 +97,7 @@ HANDLE WTSOpenServerW(LPWSTR pServerName) return g_WtsApi->OpenServerW(pServerName); } -HANDLE WTSOpenServerA(LPSTR pServerName) +HANDLE WINAPI WTSOpenServerA(LPSTR pServerName) { if (!g_WtsApi || !g_WtsApi->OpenServerA) return FALSE; @@ -107,7 +105,7 @@ HANDLE WTSOpenServerA(LPSTR pServerName) return g_WtsApi->OpenServerA(pServerName); } -HANDLE WTSOpenServerExW(LPWSTR pServerName) +HANDLE WINAPI WTSOpenServerExW(LPWSTR pServerName) { if (!g_WtsApi || !g_WtsApi->OpenServerExW) return FALSE; @@ -115,7 +113,7 @@ HANDLE WTSOpenServerExW(LPWSTR pServerName) return g_WtsApi->OpenServerExW(pServerName); } -HANDLE WTSOpenServerExA(LPSTR pServerName) +HANDLE WINAPI WTSOpenServerExA(LPSTR pServerName) { if (!g_WtsApi || !g_WtsApi->OpenServerExA) return FALSE; @@ -123,7 +121,7 @@ HANDLE WTSOpenServerExA(LPSTR pServerName) return g_WtsApi->OpenServerExA(pServerName); } -VOID WTSCloseServer(HANDLE hServer) +VOID WINAPI WTSCloseServer(HANDLE hServer) { if (!g_WtsApi || !g_WtsApi->CloseServer) return; @@ -131,7 +129,7 @@ VOID WTSCloseServer(HANDLE hServer) g_WtsApi->CloseServer(hServer); } -BOOL WTSEnumerateSessionsW(HANDLE hServer, DWORD Reserved, DWORD Version, PWTS_SESSION_INFOW* ppSessionInfo, DWORD* pCount) +BOOL WINAPI WTSEnumerateSessionsW(HANDLE hServer, DWORD Reserved, DWORD Version, PWTS_SESSION_INFOW* ppSessionInfo, DWORD* pCount) { if (!g_WtsApi || !g_WtsApi->EnumerateSessionsW) return FALSE; @@ -139,7 +137,7 @@ BOOL WTSEnumerateSessionsW(HANDLE hServer, DWORD Reserved, DWORD Version, PWTS_S return g_WtsApi->EnumerateSessionsW(hServer, Reserved, Version, ppSessionInfo, pCount); } -BOOL WTSEnumerateSessionsA(HANDLE hServer, DWORD Reserved, DWORD Version, PWTS_SESSION_INFOA* ppSessionInfo, DWORD* pCount) +BOOL WINAPI WTSEnumerateSessionsA(HANDLE hServer, DWORD Reserved, DWORD Version, PWTS_SESSION_INFOA* ppSessionInfo, DWORD* pCount) { if (!g_WtsApi || !g_WtsApi->EnumerateSessionsA) return FALSE; @@ -147,7 +145,7 @@ BOOL WTSEnumerateSessionsA(HANDLE hServer, DWORD Reserved, DWORD Version, PWTS_S return g_WtsApi->EnumerateSessionsA(hServer, Reserved, Version, ppSessionInfo, pCount); } -BOOL WTSEnumerateSessionsExW(HANDLE hServer, DWORD* pLevel, DWORD Filter, PWTS_SESSION_INFO_1W* ppSessionInfo, DWORD* pCount) +BOOL WINAPI WTSEnumerateSessionsExW(HANDLE hServer, DWORD* pLevel, DWORD Filter, PWTS_SESSION_INFO_1W* ppSessionInfo, DWORD* pCount) { if (!g_WtsApi || !g_WtsApi->EnumerateSessionsExW) return FALSE; @@ -155,7 +153,7 @@ BOOL WTSEnumerateSessionsExW(HANDLE hServer, DWORD* pLevel, DWORD Filter, PWTS_S return g_WtsApi->EnumerateSessionsExW(hServer, pLevel, Filter, ppSessionInfo, pCount); } -BOOL WTSEnumerateSessionsExA(HANDLE hServer, DWORD* pLevel, DWORD Filter, PWTS_SESSION_INFO_1A* ppSessionInfo, DWORD* pCount) +BOOL WINAPI WTSEnumerateSessionsExA(HANDLE hServer, DWORD* pLevel, DWORD Filter, PWTS_SESSION_INFO_1A* ppSessionInfo, DWORD* pCount) { if (!g_WtsApi || !g_WtsApi->EnumerateSessionsExA) return FALSE; @@ -163,7 +161,7 @@ BOOL WTSEnumerateSessionsExA(HANDLE hServer, DWORD* pLevel, DWORD Filter, PWTS_S return g_WtsApi->EnumerateSessionsExA(hServer, pLevel, Filter, ppSessionInfo, pCount); } -BOOL WTSEnumerateProcessesW(HANDLE hServer, DWORD Reserved, DWORD Version, PWTS_PROCESS_INFOW* ppProcessInfo, DWORD* pCount) +BOOL WINAPI WTSEnumerateProcessesW(HANDLE hServer, DWORD Reserved, DWORD Version, PWTS_PROCESS_INFOW* ppProcessInfo, DWORD* pCount) { if (!g_WtsApi || !g_WtsApi->EnumerateProcessesW) return FALSE; @@ -171,7 +169,7 @@ BOOL WTSEnumerateProcessesW(HANDLE hServer, DWORD Reserved, DWORD Version, PWTS_ return g_WtsApi->EnumerateProcessesW(hServer, Reserved, Version, ppProcessInfo, pCount); } -BOOL WTSEnumerateProcessesA(HANDLE hServer, DWORD Reserved, DWORD Version, PWTS_PROCESS_INFOA* ppProcessInfo, DWORD* pCount) +BOOL WINAPI WTSEnumerateProcessesA(HANDLE hServer, DWORD Reserved, DWORD Version, PWTS_PROCESS_INFOA* ppProcessInfo, DWORD* pCount) { if (!g_WtsApi || !g_WtsApi->EnumerateProcessesA) return FALSE; @@ -179,7 +177,7 @@ BOOL WTSEnumerateProcessesA(HANDLE hServer, DWORD Reserved, DWORD Version, PWTS_ return g_WtsApi->EnumerateProcessesA(hServer, Reserved, Version, ppProcessInfo, pCount); } -BOOL WTSTerminateProcess(HANDLE hServer, DWORD ProcessId, DWORD ExitCode) +BOOL WINAPI WTSTerminateProcess(HANDLE hServer, DWORD ProcessId, DWORD ExitCode) { if (!g_WtsApi || !g_WtsApi->TerminateProcess) return FALSE; @@ -187,7 +185,7 @@ BOOL WTSTerminateProcess(HANDLE hServer, DWORD ProcessId, DWORD ExitCode) return g_WtsApi->TerminateProcess(hServer, ProcessId, ExitCode); } -BOOL WTSQuerySessionInformationW(HANDLE hServer, DWORD SessionId, WTS_INFO_CLASS WTSInfoClass, LPWSTR* ppBuffer, DWORD* pBytesReturned) +BOOL WINAPI WTSQuerySessionInformationW(HANDLE hServer, DWORD SessionId, WTS_INFO_CLASS WTSInfoClass, LPWSTR* ppBuffer, DWORD* pBytesReturned) { if (!g_WtsApi || !g_WtsApi->QuerySessionInformationW) return FALSE; @@ -195,7 +193,7 @@ BOOL WTSQuerySessionInformationW(HANDLE hServer, DWORD SessionId, WTS_INFO_CLASS return g_WtsApi->QuerySessionInformationW(hServer, SessionId, WTSInfoClass, ppBuffer, pBytesReturned); } -BOOL WTSQuerySessionInformationA(HANDLE hServer, DWORD SessionId, WTS_INFO_CLASS WTSInfoClass, LPSTR* ppBuffer, DWORD* pBytesReturned) +BOOL WINAPI WTSQuerySessionInformationA(HANDLE hServer, DWORD SessionId, WTS_INFO_CLASS WTSInfoClass, LPSTR* ppBuffer, DWORD* pBytesReturned) { if (!g_WtsApi || !g_WtsApi->QuerySessionInformationA) return FALSE; @@ -203,7 +201,7 @@ BOOL WTSQuerySessionInformationA(HANDLE hServer, DWORD SessionId, WTS_INFO_CLASS return g_WtsApi->QuerySessionInformationA(hServer, SessionId, WTSInfoClass, ppBuffer, pBytesReturned); } -BOOL WTSQueryUserConfigW(LPWSTR pServerName, LPWSTR pUserName, WTS_CONFIG_CLASS WTSConfigClass, LPWSTR* ppBuffer, DWORD* pBytesReturned) +BOOL WINAPI WTSQueryUserConfigW(LPWSTR pServerName, LPWSTR pUserName, WTS_CONFIG_CLASS WTSConfigClass, LPWSTR* ppBuffer, DWORD* pBytesReturned) { if (!g_WtsApi || !g_WtsApi->QueryUserConfigW) return FALSE; @@ -211,7 +209,7 @@ BOOL WTSQueryUserConfigW(LPWSTR pServerName, LPWSTR pUserName, WTS_CONFIG_CLASS return g_WtsApi->QueryUserConfigW(pServerName, pUserName, WTSConfigClass, ppBuffer, pBytesReturned); } -BOOL WTSQueryUserConfigA(LPSTR pServerName, LPSTR pUserName, WTS_CONFIG_CLASS WTSConfigClass, LPSTR* ppBuffer, DWORD* pBytesReturned) +BOOL WINAPI WTSQueryUserConfigA(LPSTR pServerName, LPSTR pUserName, WTS_CONFIG_CLASS WTSConfigClass, LPSTR* ppBuffer, DWORD* pBytesReturned) { if (!g_WtsApi || !g_WtsApi->QueryUserConfigA) return FALSE; @@ -219,7 +217,7 @@ BOOL WTSQueryUserConfigA(LPSTR pServerName, LPSTR pUserName, WTS_CONFIG_CLASS WT return g_WtsApi->QueryUserConfigA(pServerName, pUserName, WTSConfigClass, ppBuffer, pBytesReturned); } -BOOL WTSSetUserConfigW(LPWSTR pServerName, LPWSTR pUserName, WTS_CONFIG_CLASS WTSConfigClass, LPWSTR pBuffer, DWORD DataLength) +BOOL WINAPI WTSSetUserConfigW(LPWSTR pServerName, LPWSTR pUserName, WTS_CONFIG_CLASS WTSConfigClass, LPWSTR pBuffer, DWORD DataLength) { if (!g_WtsApi || !g_WtsApi->SetUserConfigW) return FALSE; @@ -227,7 +225,7 @@ BOOL WTSSetUserConfigW(LPWSTR pServerName, LPWSTR pUserName, WTS_CONFIG_CLASS WT return g_WtsApi->SetUserConfigW(pServerName, pUserName, WTSConfigClass, pBuffer, DataLength); } -BOOL WTSSetUserConfigA(LPSTR pServerName, LPSTR pUserName, WTS_CONFIG_CLASS WTSConfigClass, LPSTR pBuffer, DWORD DataLength) +BOOL WINAPI WTSSetUserConfigA(LPSTR pServerName, LPSTR pUserName, WTS_CONFIG_CLASS WTSConfigClass, LPSTR pBuffer, DWORD DataLength) { if (!g_WtsApi || !g_WtsApi->SetUserConfigA) return FALSE; @@ -235,7 +233,7 @@ BOOL WTSSetUserConfigA(LPSTR pServerName, LPSTR pUserName, WTS_CONFIG_CLASS WTSC return g_WtsApi->SetUserConfigA(pServerName, pUserName, WTSConfigClass, pBuffer, DataLength); } -BOOL WTSSendMessageW(HANDLE hServer, DWORD SessionId, LPWSTR pTitle, DWORD TitleLength, +BOOL WINAPI WTSSendMessageW(HANDLE hServer, DWORD SessionId, LPWSTR pTitle, DWORD TitleLength, LPWSTR pMessage, DWORD MessageLength, DWORD Style, DWORD Timeout, DWORD* pResponse, BOOL bWait) { if (!g_WtsApi || !g_WtsApi->SendMessageW) @@ -245,7 +243,7 @@ BOOL WTSSendMessageW(HANDLE hServer, DWORD SessionId, LPWSTR pTitle, DWORD Title pMessage, MessageLength, Style, Timeout, pResponse, bWait); } -BOOL WTSSendMessageA(HANDLE hServer, DWORD SessionId, LPSTR pTitle, DWORD TitleLength, +BOOL WINAPI WTSSendMessageA(HANDLE hServer, DWORD SessionId, LPSTR pTitle, DWORD TitleLength, LPSTR pMessage, DWORD MessageLength, DWORD Style, DWORD Timeout, DWORD* pResponse, BOOL bWait) { if (!g_WtsApi || !g_WtsApi->SendMessageA) @@ -255,7 +253,7 @@ BOOL WTSSendMessageA(HANDLE hServer, DWORD SessionId, LPSTR pTitle, DWORD TitleL pMessage, MessageLength, Style, Timeout, pResponse, bWait); } -BOOL WTSDisconnectSession(HANDLE hServer, DWORD SessionId, BOOL bWait) +BOOL WINAPI WTSDisconnectSession(HANDLE hServer, DWORD SessionId, BOOL bWait) { if (!g_WtsApi || !g_WtsApi->DisconnectSession) return FALSE; @@ -263,7 +261,7 @@ BOOL WTSDisconnectSession(HANDLE hServer, DWORD SessionId, BOOL bWait) return g_WtsApi->DisconnectSession(hServer, SessionId, bWait); } -BOOL WTSLogoffSession(HANDLE hServer, DWORD SessionId, BOOL bWait) +BOOL WINAPI WTSLogoffSession(HANDLE hServer, DWORD SessionId, BOOL bWait) { if (!g_WtsApi || !g_WtsApi->LogoffSession) return FALSE; @@ -271,7 +269,7 @@ BOOL WTSLogoffSession(HANDLE hServer, DWORD SessionId, BOOL bWait) return g_WtsApi->LogoffSession(hServer, SessionId, bWait); } -BOOL WTSShutdownSystem(HANDLE hServer, DWORD ShutdownFlag) +BOOL WINAPI WTSShutdownSystem(HANDLE hServer, DWORD ShutdownFlag) { if (!g_WtsApi || !g_WtsApi->ShutdownSystem) return FALSE; @@ -279,7 +277,7 @@ BOOL WTSShutdownSystem(HANDLE hServer, DWORD ShutdownFlag) return g_WtsApi->ShutdownSystem(hServer, ShutdownFlag); } -BOOL WTSWaitSystemEvent(HANDLE hServer, DWORD EventMask, DWORD* pEventFlags) +BOOL WINAPI WTSWaitSystemEvent(HANDLE hServer, DWORD EventMask, DWORD* pEventFlags) { if (!g_WtsApi || !g_WtsApi->WaitSystemEvent) return FALSE; @@ -287,7 +285,7 @@ BOOL WTSWaitSystemEvent(HANDLE hServer, DWORD EventMask, DWORD* pEventFlags) return g_WtsApi->WaitSystemEvent(hServer, EventMask, pEventFlags); } -HANDLE WTSVirtualChannelOpen(HANDLE hServer, DWORD SessionId, LPSTR pVirtualName) +HANDLE WINAPI WTSVirtualChannelOpen(HANDLE hServer, DWORD SessionId, LPSTR pVirtualName) { if (!g_WtsApi || !g_WtsApi->VirtualChannelOpen) return FALSE; @@ -295,7 +293,7 @@ HANDLE WTSVirtualChannelOpen(HANDLE hServer, DWORD SessionId, LPSTR pVirtualName return g_WtsApi->VirtualChannelOpen(hServer, SessionId, pVirtualName); } -HANDLE WTSVirtualChannelOpenEx(DWORD SessionId, LPSTR pVirtualName, DWORD flags) +HANDLE WINAPI WTSVirtualChannelOpenEx(DWORD SessionId, LPSTR pVirtualName, DWORD flags) { if (!g_WtsApi || !g_WtsApi->VirtualChannelOpenEx) return FALSE; @@ -303,7 +301,7 @@ HANDLE WTSVirtualChannelOpenEx(DWORD SessionId, LPSTR pVirtualName, DWORD flags) return g_WtsApi->VirtualChannelOpenEx(SessionId, pVirtualName, flags); } -BOOL WTSVirtualChannelClose(HANDLE hChannelHandle) +BOOL WINAPI WTSVirtualChannelClose(HANDLE hChannelHandle) { if (!g_WtsApi || !g_WtsApi->VirtualChannelClose) return FALSE; @@ -311,7 +309,7 @@ BOOL WTSVirtualChannelClose(HANDLE hChannelHandle) return g_WtsApi->VirtualChannelClose(hChannelHandle); } -BOOL WTSVirtualChannelRead(HANDLE hChannelHandle, ULONG TimeOut, PCHAR Buffer, ULONG BufferSize, PULONG pBytesRead) +BOOL WINAPI WTSVirtualChannelRead(HANDLE hChannelHandle, ULONG TimeOut, PCHAR Buffer, ULONG BufferSize, PULONG pBytesRead) { if (!g_WtsApi || !g_WtsApi->VirtualChannelRead) return FALSE; @@ -319,7 +317,7 @@ BOOL WTSVirtualChannelRead(HANDLE hChannelHandle, ULONG TimeOut, PCHAR Buffer, U return g_WtsApi->VirtualChannelRead(hChannelHandle, TimeOut, Buffer, BufferSize, pBytesRead); } -BOOL WTSVirtualChannelWrite(HANDLE hChannelHandle, PCHAR Buffer, ULONG Length, PULONG pBytesWritten) +BOOL WINAPI WTSVirtualChannelWrite(HANDLE hChannelHandle, PCHAR Buffer, ULONG Length, PULONG pBytesWritten) { if (!g_WtsApi || !g_WtsApi->VirtualChannelWrite) return FALSE; @@ -327,7 +325,7 @@ BOOL WTSVirtualChannelWrite(HANDLE hChannelHandle, PCHAR Buffer, ULONG Length, P return g_WtsApi->VirtualChannelWrite(hChannelHandle, Buffer, Length, pBytesWritten); } -BOOL WTSVirtualChannelPurgeInput(HANDLE hChannelHandle) +BOOL WINAPI WTSVirtualChannelPurgeInput(HANDLE hChannelHandle) { if (!g_WtsApi || !g_WtsApi->VirtualChannelPurgeInput) return FALSE; @@ -335,7 +333,7 @@ BOOL WTSVirtualChannelPurgeInput(HANDLE hChannelHandle) return g_WtsApi->VirtualChannelPurgeInput(hChannelHandle); } -BOOL WTSVirtualChannelPurgeOutput(HANDLE hChannelHandle) +BOOL WINAPI WTSVirtualChannelPurgeOutput(HANDLE hChannelHandle) { if (!g_WtsApi || !g_WtsApi->VirtualChannelPurgeOutput) return FALSE; @@ -343,7 +341,7 @@ BOOL WTSVirtualChannelPurgeOutput(HANDLE hChannelHandle) return g_WtsApi->VirtualChannelPurgeOutput(hChannelHandle); } -BOOL WTSVirtualChannelQuery(HANDLE hChannelHandle, WTS_VIRTUAL_CLASS WtsVirtualClass, PVOID* ppBuffer, DWORD* pBytesReturned) +BOOL WINAPI WTSVirtualChannelQuery(HANDLE hChannelHandle, WTS_VIRTUAL_CLASS WtsVirtualClass, PVOID* ppBuffer, DWORD* pBytesReturned) { if (!g_WtsApi || !g_WtsApi->VirtualChannelQuery) return FALSE; @@ -351,7 +349,7 @@ BOOL WTSVirtualChannelQuery(HANDLE hChannelHandle, WTS_VIRTUAL_CLASS WtsVirtualC return g_WtsApi->VirtualChannelQuery(hChannelHandle, WtsVirtualClass, ppBuffer, pBytesReturned); } -VOID WTSFreeMemory(PVOID pMemory) +VOID WINAPI WTSFreeMemory(PVOID pMemory) { if (!g_WtsApi || !g_WtsApi->FreeMemory) return; @@ -359,7 +357,7 @@ VOID WTSFreeMemory(PVOID pMemory) g_WtsApi->FreeMemory(pMemory); } -BOOL WTSFreeMemoryExW(WTS_TYPE_CLASS WTSTypeClass, PVOID pMemory, ULONG NumberOfEntries) +BOOL WINAPI WTSFreeMemoryExW(WTS_TYPE_CLASS WTSTypeClass, PVOID pMemory, ULONG NumberOfEntries) { if (!g_WtsApi || !g_WtsApi->FreeMemoryExW) return FALSE; @@ -367,7 +365,7 @@ BOOL WTSFreeMemoryExW(WTS_TYPE_CLASS WTSTypeClass, PVOID pMemory, ULONG NumberOf return g_WtsApi->FreeMemoryExW(WTSTypeClass, pMemory, NumberOfEntries); } -BOOL WTSFreeMemoryExA(WTS_TYPE_CLASS WTSTypeClass, PVOID pMemory, ULONG NumberOfEntries) +BOOL WINAPI WTSFreeMemoryExA(WTS_TYPE_CLASS WTSTypeClass, PVOID pMemory, ULONG NumberOfEntries) { if (!g_WtsApi || !g_WtsApi->FreeMemoryExA) return FALSE; @@ -375,7 +373,7 @@ BOOL WTSFreeMemoryExA(WTS_TYPE_CLASS WTSTypeClass, PVOID pMemory, ULONG NumberOf return g_WtsApi->FreeMemoryExA(WTSTypeClass, pMemory, NumberOfEntries); } -BOOL WTSRegisterSessionNotification(HWND hWnd, DWORD dwFlags) +BOOL WINAPI WTSRegisterSessionNotification(HWND hWnd, DWORD dwFlags) { if (!g_WtsApi || !g_WtsApi->RegisterSessionNotification) return FALSE; @@ -383,7 +381,7 @@ BOOL WTSRegisterSessionNotification(HWND hWnd, DWORD dwFlags) return g_WtsApi->RegisterSessionNotification(hWnd, dwFlags); } -BOOL WTSUnRegisterSessionNotification(HWND hWnd) +BOOL WINAPI WTSUnRegisterSessionNotification(HWND hWnd) { if (!g_WtsApi || !g_WtsApi->UnRegisterSessionNotification) return FALSE; @@ -391,7 +389,7 @@ BOOL WTSUnRegisterSessionNotification(HWND hWnd) return g_WtsApi->UnRegisterSessionNotification(hWnd); } -BOOL WTSRegisterSessionNotificationEx(HANDLE hServer, HWND hWnd, DWORD dwFlags) +BOOL WINAPI WTSRegisterSessionNotificationEx(HANDLE hServer, HWND hWnd, DWORD dwFlags) { if (!g_WtsApi || !g_WtsApi->RegisterSessionNotificationEx) return FALSE; @@ -399,7 +397,7 @@ BOOL WTSRegisterSessionNotificationEx(HANDLE hServer, HWND hWnd, DWORD dwFlags) return g_WtsApi->RegisterSessionNotificationEx(hServer, hWnd, dwFlags); } -BOOL WTSUnRegisterSessionNotificationEx(HANDLE hServer, HWND hWnd) +BOOL WINAPI WTSUnRegisterSessionNotificationEx(HANDLE hServer, HWND hWnd) { if (!g_WtsApi || !g_WtsApi->UnRegisterSessionNotificationEx) return FALSE; @@ -407,7 +405,7 @@ BOOL WTSUnRegisterSessionNotificationEx(HANDLE hServer, HWND hWnd) return g_WtsApi->UnRegisterSessionNotificationEx(hServer, hWnd); } -BOOL WTSQueryUserToken(ULONG SessionId, PHANDLE phToken) +BOOL WINAPI WTSQueryUserToken(ULONG SessionId, PHANDLE phToken) { if (!g_WtsApi || !g_WtsApi->QueryUserToken) return FALSE; @@ -415,7 +413,7 @@ BOOL WTSQueryUserToken(ULONG SessionId, PHANDLE phToken) return g_WtsApi->QueryUserToken(SessionId, phToken); } -BOOL WTSEnumerateProcessesExW(HANDLE hServer, DWORD* pLevel, DWORD SessionId, LPWSTR* ppProcessInfo, DWORD* pCount) +BOOL WINAPI WTSEnumerateProcessesExW(HANDLE hServer, DWORD* pLevel, DWORD SessionId, LPWSTR* ppProcessInfo, DWORD* pCount) { if (!g_WtsApi || !g_WtsApi->EnumerateProcessesExW) return FALSE; @@ -423,7 +421,7 @@ BOOL WTSEnumerateProcessesExW(HANDLE hServer, DWORD* pLevel, DWORD SessionId, LP return g_WtsApi->EnumerateProcessesExW(hServer, pLevel, SessionId, ppProcessInfo, pCount); } -BOOL WTSEnumerateProcessesExA(HANDLE hServer, DWORD* pLevel, DWORD SessionId, LPSTR* ppProcessInfo, DWORD* pCount) +BOOL WINAPI WTSEnumerateProcessesExA(HANDLE hServer, DWORD* pLevel, DWORD SessionId, LPSTR* ppProcessInfo, DWORD* pCount) { if (!g_WtsApi || !g_WtsApi->EnumerateProcessesExA) return FALSE; @@ -431,7 +429,7 @@ BOOL WTSEnumerateProcessesExA(HANDLE hServer, DWORD* pLevel, DWORD SessionId, LP return g_WtsApi->EnumerateProcessesExA(hServer, pLevel, SessionId, ppProcessInfo, pCount); } -BOOL WTSEnumerateListenersW(HANDLE hServer, PVOID pReserved, DWORD Reserved, PWTSLISTENERNAMEW pListeners, DWORD* pCount) +BOOL WINAPI WTSEnumerateListenersW(HANDLE hServer, PVOID pReserved, DWORD Reserved, PWTSLISTENERNAMEW pListeners, DWORD* pCount) { if (!g_WtsApi || !g_WtsApi->EnumerateListenersW) return FALSE; @@ -439,7 +437,7 @@ BOOL WTSEnumerateListenersW(HANDLE hServer, PVOID pReserved, DWORD Reserved, PWT return g_WtsApi->EnumerateListenersW(hServer, pReserved, Reserved, pListeners, pCount); } -BOOL WTSEnumerateListenersA(HANDLE hServer, PVOID pReserved, DWORD Reserved, PWTSLISTENERNAMEA pListeners, DWORD* pCount) +BOOL WINAPI WTSEnumerateListenersA(HANDLE hServer, PVOID pReserved, DWORD Reserved, PWTSLISTENERNAMEA pListeners, DWORD* pCount) { if (!g_WtsApi || !g_WtsApi->EnumerateListenersA) return FALSE; @@ -447,7 +445,7 @@ BOOL WTSEnumerateListenersA(HANDLE hServer, PVOID pReserved, DWORD Reserved, PWT return g_WtsApi->EnumerateListenersA(hServer, pReserved, Reserved, pListeners, pCount); } -BOOL WTSQueryListenerConfigW(HANDLE hServer, PVOID pReserved, DWORD Reserved, LPWSTR pListenerName, PWTSLISTENERCONFIGW pBuffer) +BOOL WINAPI WTSQueryListenerConfigW(HANDLE hServer, PVOID pReserved, DWORD Reserved, LPWSTR pListenerName, PWTSLISTENERCONFIGW pBuffer) { if (!g_WtsApi || !g_WtsApi->QueryListenerConfigW) return FALSE; @@ -455,7 +453,7 @@ BOOL WTSQueryListenerConfigW(HANDLE hServer, PVOID pReserved, DWORD Reserved, LP return g_WtsApi->QueryListenerConfigW(hServer, pReserved, Reserved, pListenerName, pBuffer); } -BOOL WTSQueryListenerConfigA(HANDLE hServer, PVOID pReserved, DWORD Reserved, LPSTR pListenerName, PWTSLISTENERCONFIGA pBuffer) +BOOL WINAPI WTSQueryListenerConfigA(HANDLE hServer, PVOID pReserved, DWORD Reserved, LPSTR pListenerName, PWTSLISTENERCONFIGA pBuffer) { if (!g_WtsApi || !g_WtsApi->QueryListenerConfigA) return FALSE; @@ -463,7 +461,7 @@ BOOL WTSQueryListenerConfigA(HANDLE hServer, PVOID pReserved, DWORD Reserved, LP return g_WtsApi->QueryListenerConfigA(hServer, pReserved, Reserved, pListenerName, pBuffer); } -BOOL WTSCreateListenerW(HANDLE hServer, PVOID pReserved, DWORD Reserved, +BOOL WINAPI WTSCreateListenerW(HANDLE hServer, PVOID pReserved, DWORD Reserved, LPWSTR pListenerName, PWTSLISTENERCONFIGW pBuffer, DWORD flag) { if (!g_WtsApi || !g_WtsApi->CreateListenerW) @@ -472,7 +470,7 @@ BOOL WTSCreateListenerW(HANDLE hServer, PVOID pReserved, DWORD Reserved, return g_WtsApi->CreateListenerW(hServer, pReserved, Reserved, pListenerName, pBuffer, flag); } -BOOL WTSCreateListenerA(HANDLE hServer, PVOID pReserved, DWORD Reserved, +BOOL WINAPI WTSCreateListenerA(HANDLE hServer, PVOID pReserved, DWORD Reserved, LPSTR pListenerName, PWTSLISTENERCONFIGA pBuffer, DWORD flag) { if (!g_WtsApi || !g_WtsApi->CreateListenerA) @@ -481,7 +479,7 @@ BOOL WTSCreateListenerA(HANDLE hServer, PVOID pReserved, DWORD Reserved, return g_WtsApi->CreateListenerA(hServer, pReserved, Reserved, pListenerName, pBuffer, flag); } -BOOL WTSSetListenerSecurityW(HANDLE hServer, PVOID pReserved, DWORD Reserved, +BOOL WINAPI WTSSetListenerSecurityW(HANDLE hServer, PVOID pReserved, DWORD Reserved, LPWSTR pListenerName, SECURITY_INFORMATION SecurityInformation, PSECURITY_DESCRIPTOR pSecurityDescriptor) { @@ -492,7 +490,7 @@ BOOL WTSSetListenerSecurityW(HANDLE hServer, PVOID pReserved, DWORD Reserved, pListenerName, SecurityInformation, pSecurityDescriptor); } -BOOL WTSSetListenerSecurityA(HANDLE hServer, PVOID pReserved, DWORD Reserved, +BOOL WINAPI WTSSetListenerSecurityA(HANDLE hServer, PVOID pReserved, DWORD Reserved, LPSTR pListenerName, SECURITY_INFORMATION SecurityInformation, PSECURITY_DESCRIPTOR pSecurityDescriptor) { @@ -503,7 +501,7 @@ BOOL WTSSetListenerSecurityA(HANDLE hServer, PVOID pReserved, DWORD Reserved, pListenerName, SecurityInformation, pSecurityDescriptor); } -BOOL WTSGetListenerSecurityW(HANDLE hServer, PVOID pReserved, DWORD Reserved, +BOOL WINAPI WTSGetListenerSecurityW(HANDLE hServer, PVOID pReserved, DWORD Reserved, LPWSTR pListenerName, SECURITY_INFORMATION SecurityInformation, PSECURITY_DESCRIPTOR pSecurityDescriptor, DWORD nLength, LPDWORD lpnLengthNeeded) { @@ -514,7 +512,7 @@ BOOL WTSGetListenerSecurityW(HANDLE hServer, PVOID pReserved, DWORD Reserved, SecurityInformation, pSecurityDescriptor, nLength, lpnLengthNeeded); } -BOOL WTSGetListenerSecurityA(HANDLE hServer, PVOID pReserved, DWORD Reserved, +BOOL WINAPI WTSGetListenerSecurityA(HANDLE hServer, PVOID pReserved, DWORD Reserved, LPSTR pListenerName, SECURITY_INFORMATION SecurityInformation, PSECURITY_DESCRIPTOR pSecurityDescriptor, DWORD nLength, LPDWORD lpnLengthNeeded) { @@ -525,7 +523,7 @@ BOOL WTSGetListenerSecurityA(HANDLE hServer, PVOID pReserved, DWORD Reserved, SecurityInformation, pSecurityDescriptor, nLength, lpnLengthNeeded); } -BOOL WTSEnableChildSessions(BOOL bEnable) +BOOL CDECL WTSEnableChildSessions(BOOL bEnable) { if (!g_WtsApi || !g_WtsApi->EnableChildSessions) return FALSE; @@ -533,7 +531,7 @@ BOOL WTSEnableChildSessions(BOOL bEnable) return g_WtsApi->EnableChildSessions(bEnable); } -BOOL WTSIsChildSessionsEnabled(PBOOL pbEnabled) +BOOL CDECL WTSIsChildSessionsEnabled(PBOOL pbEnabled) { if (!g_WtsApi || !g_WtsApi->IsChildSessionsEnabled) return FALSE; @@ -541,7 +539,7 @@ BOOL WTSIsChildSessionsEnabled(PBOOL pbEnabled) return g_WtsApi->IsChildSessionsEnabled(pbEnabled); } -BOOL WTSGetChildSessionId(PULONG pSessionId) +BOOL CDECL WTSGetChildSessionId(PULONG pSessionId) { if (!g_WtsApi || !g_WtsApi->GetChildSessionId) return FALSE; @@ -549,7 +547,13 @@ BOOL WTSGetChildSessionId(PULONG pSessionId) return g_WtsApi->GetChildSessionId(pSessionId); } -DWORD WTSGetActiveConsoleSessionId(void) +#ifndef _WIN32 + +/** + * WTSGetActiveConsoleSessionId is declared in WinBase.h and exported by kernel32.dll + */ + +DWORD WINAPI WTSGetActiveConsoleSessionId(void) { if (!g_WtsApi || !g_WtsApi->GetActiveConsoleSessionId) return 0xFFFFFFFF;