-
Notifications
You must be signed in to change notification settings - Fork 1
/
RemoteDesktop.h
46 lines (40 loc) · 1.47 KB
/
RemoteDesktop.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#include <winsock2.h>
#define WM_MAINSOCKET (WM_USER + 1)
#define TM_KEEPALIVE 0
typedef struct {
SOCKET hSocket;
SOCKADDR_IN hSin;
char SocketBuffer[4096];
HANDLE hFile;
bool Transferring;
} Client;
typedef struct {
HANDLE hFile;
SOCKET hSocket;
DWORD FileSize;
DWORD Offset;
} FILETRANSFERARGS;
extern char *gpHost;
extern bool gbConnected;
extern bool gbTransferring;
extern HINSTANCE ghInstance;
extern HWND ghWnd;
extern SOCKET ghTcpSocket;
extern bool Processing;
extern int ClientCount;
extern Client *Clients;
extern char *RecvBuffer, *SendBuffer;
extern unsigned long RecvBufSize, SendBufSize;
void RemoteDesktopListen(int port);
void RemoteDesktopAccept(SOCKET wParam);
void RemoteDesktopCleanup(SOCKET wParam);
void RemoteDesktopSendData(unsigned short cmd, unsigned long datac, char **data, unsigned long *datal, unsigned short ci);
void RemoteDesktopSendStr(char *msg, unsigned short ci);
DWORD WINAPI RemoteDesktopReceiveFileThread(LPVOID lpArgs);
DWORD WINAPI RemoteDesktopSendFileThread(LPVOID lpArgs);
void RemoteDesktopStartSendThread(SOCKET wParam, unsigned short ci);
void RemoteDesktopParseData(unsigned short cmd, unsigned long datac, char **data, unsigned long *datal, unsigned short ci);
void RemoteDesktopProcessQueue(unsigned short ci);
LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
void RemoteDesktopParseCommand(int argc, char **argv);
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow);