2012-09-16 04:29:33 +04:00
|
|
|
/**
|
2012-10-09 06:31:40 +04:00
|
|
|
* FreeRDP: A Remote Desktop Protocol Client
|
|
|
|
* FreeRDP Windows Server
|
|
|
|
*
|
|
|
|
* Copyright 2012 Marc-Andre Moreau <marcandre.moreau@gmail.com>
|
|
|
|
* Copyright 2012 Corey Clayton <can.of.tuna@gmail.com>
|
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
2012-09-16 04:29:33 +04:00
|
|
|
|
|
|
|
#ifndef WF_INTERFACE_H
|
|
|
|
#define WF_INTERFACE_H
|
|
|
|
|
|
|
|
#include <winpr/windows.h>
|
2012-09-16 06:19:26 +04:00
|
|
|
|
|
|
|
#include <freerdp/api.h>
|
2012-09-16 04:29:33 +04:00
|
|
|
#include <freerdp/freerdp.h>
|
|
|
|
#include <freerdp/listener.h>
|
|
|
|
|
2012-09-16 06:19:26 +04:00
|
|
|
#include <freerdp/freerdp.h>
|
|
|
|
#include <freerdp/codec/rfx.h>
|
2012-10-20 01:29:44 +04:00
|
|
|
|
2012-10-11 04:44:27 +04:00
|
|
|
#include <freerdp/server/rdpsnd.h>
|
2012-09-16 06:19:26 +04:00
|
|
|
|
2012-10-09 06:31:40 +04:00
|
|
|
#define WF_SRV_CALLBACK_EVENT_CONNECT 1
|
|
|
|
#define WF_SRV_CALLBACK_EVENT_DISCONNECT 2
|
|
|
|
#define WF_SRV_CALLBACK_EVENT_ACTIVATE 4
|
|
|
|
#define WF_SRV_CALLBACK_EVENT_AUTH 8
|
|
|
|
|
2012-09-16 06:19:26 +04:00
|
|
|
typedef struct wf_info wfInfo;
|
|
|
|
typedef struct wf_peer_context wfPeerContext;
|
|
|
|
|
|
|
|
struct wf_info
|
|
|
|
{
|
|
|
|
STREAM* s;
|
|
|
|
int width;
|
|
|
|
int height;
|
2012-09-17 07:09:36 +04:00
|
|
|
int frame_idx;
|
2012-09-16 06:19:26 +04:00
|
|
|
int bitsPerPixel;
|
|
|
|
HDC driverDC;
|
|
|
|
int peerCount;
|
2012-09-17 05:05:51 +04:00
|
|
|
int activePeerCount;
|
2012-09-16 06:19:26 +04:00
|
|
|
void* changeBuffer;
|
|
|
|
int framesPerSecond;
|
|
|
|
LPTSTR deviceKey;
|
|
|
|
TCHAR deviceName[32];
|
2012-09-17 05:05:51 +04:00
|
|
|
freerdp_peer** peers;
|
|
|
|
BOOL mirrorDriverActive;
|
2012-09-18 22:07:38 +04:00
|
|
|
UINT framesWaiting;
|
2012-09-16 06:19:26 +04:00
|
|
|
|
2012-10-13 05:02:42 +04:00
|
|
|
HANDLE snd_mutex;
|
|
|
|
BOOL snd_stop;
|
|
|
|
|
2012-09-16 06:19:26 +04:00
|
|
|
RECT invalid;
|
|
|
|
HANDLE mutex;
|
|
|
|
BOOL updatePending;
|
|
|
|
HANDLE updateEvent;
|
|
|
|
HANDLE updateThread;
|
|
|
|
HANDLE updateSemaphore;
|
|
|
|
RFX_CONTEXT* rfx_context;
|
|
|
|
unsigned long lastUpdate;
|
|
|
|
unsigned long nextUpdate;
|
|
|
|
SURFACE_BITS_COMMAND cmd;
|
2012-10-05 23:25:30 +04:00
|
|
|
|
|
|
|
BOOL input_disabled;
|
|
|
|
BOOL force_all_disconnect;
|
2012-09-16 06:19:26 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
struct wf_peer_context
|
|
|
|
{
|
|
|
|
rdpContext _p;
|
|
|
|
|
|
|
|
wfInfo* info;
|
2012-09-17 07:09:36 +04:00
|
|
|
int frame_idx;
|
2012-09-16 06:19:26 +04:00
|
|
|
HANDLE updateEvent;
|
|
|
|
BOOL socketClose;
|
|
|
|
HANDLE socketEvent;
|
|
|
|
HANDLE socketThread;
|
|
|
|
HANDLE socketSemaphore;
|
2012-10-11 04:44:27 +04:00
|
|
|
|
|
|
|
WTSVirtualChannelManager* vcm;
|
|
|
|
rdpsnd_server_context* rdpsnd;
|
2012-09-16 06:19:26 +04:00
|
|
|
};
|
|
|
|
|
2012-09-16 04:29:33 +04:00
|
|
|
struct wf_server
|
|
|
|
{
|
|
|
|
DWORD port;
|
|
|
|
HANDLE thread;
|
|
|
|
freerdp_listener* instance;
|
|
|
|
};
|
|
|
|
typedef struct wf_server wfServer;
|
|
|
|
|
2012-10-09 06:31:40 +04:00
|
|
|
typedef void (__stdcall* cbCallback) (int, UINT32);
|
2012-10-06 07:25:18 +04:00
|
|
|
|
2012-10-24 02:49:03 +04:00
|
|
|
FREERDP_API void get_screen_info();
|
|
|
|
|
2012-09-16 06:19:26 +04:00
|
|
|
FREERDP_API BOOL wfreerdp_server_start(wfServer* server);
|
|
|
|
FREERDP_API BOOL wfreerdp_server_stop(wfServer* server);
|
2012-09-16 04:29:33 +04:00
|
|
|
|
2012-09-16 06:19:26 +04:00
|
|
|
FREERDP_API wfServer* wfreerdp_server_new();
|
|
|
|
FREERDP_API void wfreerdp_server_free(wfServer* server);
|
2012-09-16 04:29:33 +04:00
|
|
|
|
2012-10-05 00:51:23 +04:00
|
|
|
FREERDP_API BOOL wfreerdp_server_is_running(wfServer* server);
|
|
|
|
|
2012-10-06 02:18:59 +04:00
|
|
|
FREERDP_API UINT32 wfreerdp_server_num_peers();
|
|
|
|
FREERDP_API UINT32 wfreerdp_server_get_peer_hostname(int pId, wchar_t * dstStr);
|
2012-10-06 03:22:38 +04:00
|
|
|
FREERDP_API BOOL wfreerdp_server_peer_is_local(int pId);
|
|
|
|
FREERDP_API BOOL wfreerdp_server_peer_is_connected(int pId);
|
|
|
|
FREERDP_API BOOL wfreerdp_server_peer_is_activated(int pId);
|
|
|
|
FREERDP_API BOOL wfreerdp_server_peer_is_authenticated(int pId);
|
2012-10-06 02:18:59 +04:00
|
|
|
|
2012-10-09 06:31:40 +04:00
|
|
|
FREERDP_API void wfreerdp_server_register_callback_event(cbCallback cb);
|
|
|
|
|
|
|
|
void wfreerdp_server_peer_callback_event(int pId, UINT32 eType);
|
2012-10-06 07:25:18 +04:00
|
|
|
|
2012-09-16 04:29:33 +04:00
|
|
|
#endif /* WF_INTERFACE_H */
|