16 unsigned char *
line =
p;
27 for (
i = 0;
i < thisline;
i++)
33 for (
i = 0;
i < thisline;
i++)
91 char bmpcache_dir[256];
106 sprintf(bmpcache_dir,
"%s/%s",
home,
".rdesktop/cache");
234 This = static_cast<RDPCLIENT *>(reinterpret_cast<LPCREATESTRUCT>(
lparam)->lpCreateParams);
396 rcClip.right =
This->width + 1;
397 rcClip.bottom =
This->height + 1;
432 PCHANNEL_DEF pChannel,
434 ULONG versionRequested,
435 PCHANNEL_INIT_EVENT_FN pChannelInitEventProc
438 if(channelCount <= 0)
439 return CHANNEL_RC_BAD_CHANNEL;
441 if(ppInitHandle ==
NULL)
442 return CHANNEL_RC_BAD_INIT_HANDLE;
445 return CHANNEL_RC_BAD_CHANNEL;
447 if(pChannelInitEventProc ==
NULL)
448 return CHANNEL_RC_BAD_PROC;
453 return CHANNEL_RC_NOT_IN_VIRTUALCHANNELENTRY;
455 if(
This->num_channels + channelCount > CHANNEL_MAX_COUNT)
456 return CHANNEL_RC_TOO_MANY_CHANNELS;
458 for(
INT i = 0;
i < channelCount; ++
i)
461 return CHANNEL_RC_BAD_CHANNEL;
464 memcpy(
This->channel_defs +
This->num_channels, pChannel,
sizeof(*pChannel) * channelCount);
467 for(
INT i = 0;
i < channelCount; ++
i)
471 int j =
This->num_channels +
i;
472 This->channel_data[
j].opened = 0;
473 This->channel_data[
j].pChannelInitEventProc = pChannelInitEventProc;
474 This->channel_data[
j].pChannelOpenEventProc =
NULL;
478 This->num_channels += channelCount;
480 *ppInitHandle =
This;
482 return CHANNEL_RC_OK;
492 PCHANNEL_OPEN_EVENT_FN pChannelOpenEventProc
495 if(pInitHandle ==
NULL)
496 return CHANNEL_RC_BAD_INIT_HANDLE;
498 if(pOpenHandle ==
NULL)
499 return CHANNEL_RC_BAD_CHANNEL_HANDLE;
501 if(pChannelName ==
NULL)
502 return CHANNEL_RC_UNKNOWN_CHANNEL_NAME;
504 if(pChannelOpenEventProc ==
NULL)
505 return CHANNEL_RC_BAD_PROC;
510 for(
unsigned i = 0;
i <
This->num_channels; ++
i)
512 if(
strcmp(pChannelName,
This->channel_defs[
i].name) == 0)
514 if(
This->channel_data[
i].opened)
515 return CHANNEL_RC_ALREADY_OPEN;
517 This->channel_data[
i].opened = 1;
518 This->channel_data[
i].pChannelOpenEventProc = pChannelOpenEventProc;
528 return CHANNEL_RC_OK;
537 return CHANNEL_RC_BAD_CHANNEL_HANDLE;
549 return CHANNEL_RC_BAD_CHANNEL_HANDLE;
574 This->keylayout = 0x409;
575 This->keyboard_type = 0x4;
576 This->keyboard_subtype = 0x0;
577 This->keyboard_functionkeys = 0xc;
580 This->server_depth = 24;
584 This->bitmap_cache_persist_enable =
False;
609 This->rdp.current_status = 1;
HGDIOBJ WINAPI GetStockObject(_In_ int)
BOOL WINAPI TranslateMessage(_In_ const MSG *)
static DWORD WINAPI mstsc_ProtocolIOThread(LPVOID lpArgument)
BITMAPINFOHEADER bmiHeader
_CRTIMP int __cdecl _write(_In_ int _FileHandle, _In_reads_bytes_(_MaxCharCount) const void *_Buf, _In_ unsigned int _MaxCharCount)
ACPI_SIZE strlen(const char *String)
#define RDP_LOGON_COMPRESSION
static GLenum _GLUfuncptr fn
TW_UINT32 TW_UINT16 TW_UINT16 MSG
void channel_process(RDPCLIENT *This, STREAM s, uint16 mcs_channel)
void warning(char *format,...)
void unimpl(char *format,...)
DWORD WINAPI GetTickCount(VOID)
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
LONG WINAPI GetMessageTime(void)
void rdp_main_loop(RD_BOOL *deactivated, uint32 *ext_disc_reason)
#define MOUSE_FLAG_BUTTON1
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
BOOL WINAPI GetComputerNameW(LPWSTR lpBuffer, LPDWORD lpnSize)
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
static UINT VCAPITYPE VirtualChannelInit(LPVOID *ppInitHandle, PCHANNEL_DEF pChannel, INT channelCount, ULONG versionRequested, PCHANNEL_INIT_EVENT_FN pChannelInitEventProc)
BOOL WINAPI DestroyWindow(_In_ HWND)
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
#define MOUSE_FLAG_BUTTON4
static LRESULT CALLBACK mstsc_WndProc(HWND hwnd, UINT uMsg, WPARAM wparam, LPARAM lparam)
int load_licence(RDPCLIENT *This, unsigned char **data)
#define sprintf(buf, format,...)
void hexdump(unsigned char *p, unsigned int len)
RD_BOOL rdp_connect(char *server, uint32 flags, char *domain, char *password, char *command, char *directory, RD_BOOL reconnect)
UINT VCAPITYPE VirtualChannelOpen(LPVOID pInitHandle, LPDWORD pOpenHandle, PCHAR pChannelName, PCHANNEL_OPEN_EVENT_FN pChannelOpenEventProc)
_CRTIMP void __cdecl perror(_In_opt_z_ const char *_ErrMsg)
#define CHANNEL_OPTION_INITIALIZED
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)
static UINT WPARAM LPARAM lparam
GLenum GLuint GLenum GLsizei length
REFIID LPVOID DWORD_PTR dw
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
INT WINAPI WSAStartup(IN WORD wVersionRequested, OUT LPWSADATA lpWSAData)
#define MOUSE_FLAG_BUTTON3
void error(char *format,...)
_Check_return_opt_ _CRTIMP int __cdecl _close(_In_ int _FileHandle)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
#define RDP5_NO_MENUANIMATIONS
void rdp_send_input(uint32 time, uint16 message_type, uint16 device_flags, uint16 param1, uint16 param2)
#define RDP5_NO_FULLWINDOWDRAG
int rd_open_file(char *filename)
struct CHANNEL_HANDLE_ CHANNEL_HANDLE
UINT VCAPITYPE VirtualChannelClose(DWORD openHandle)
_Check_return_ _CRTIMP int __cdecl _read(_In_ int _FileHandle, _Out_writes_bytes_(_MaxCharCount) void *_DstBuf, _In_ unsigned int _MaxCharCount)
#define RDP_LOGON_COMPRESSION2
int rd_write_file(int fd, void *ptr, int len)
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
BOOL rd_lock_file(int fd, int start, int len)
#define RDP5_NO_WALLPAPER
static void mstsc_mousewheel(RDPCLIENT *This, int value, LPARAM lparam)
#define memcpy(s1, s2, n)
GLsizei const GLfloat * value
int rd_lseek_file(int fd, int offset)
#define RegisterWindowMessage
#define MAX_COMPUTERNAME_LENGTH
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
void generate_random(uint8 *random)
_Check_return_ char *__cdecl getenv(_In_z_ const char *_VarName)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
#define MOUSE_FLAG_BUTTON5
void save_licence(RDPCLIENT *This, unsigned char *data, int length)
HBITMAP WINAPI CreateDIBSection(HDC hDC, CONST BITMAPINFO *BitmapInfo, UINT Usage, VOID **Bits, HANDLE hSection, DWORD dwOffset)
_CRTIMP int __cdecl _open(const char *_Filename, int _OpenFlag,...)
BOOL rd_pstcache_mkdir(void)
void rd_close_file(int fd)
_Check_return_ _CRTIMP int __cdecl _mkdir(_In_z_ const char *_Path)
LPVOID WINAPI TlsGetValue(IN DWORD Index)
int rd_read_file(int fd, void *ptr, int len)
#define MOUSE_FLAG_BUTTON2
void int int ULONGLONG int va_list * ap
int strcmp(const char *String1, const char *String2)
_Check_return_opt_ _CRTIMP long __cdecl _lseek(_In_ int _FileHandle, _In_ long _Offset, _In_ int _Origin)
GLboolean GLboolean GLboolean GLboolean a
UINT VCAPITYPE VirtualChannelWrite(DWORD openHandle, LPVOID pData, ULONG dataLength, LPVOID pUserData)
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
_Check_return_opt_ _CRTIMP int __cdecl vfprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format, va_list _ArgList)
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
static VOID NTAPI BitBlt(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Width, _In_ ULONG Height, _In_reads_bytes_(Delta *Height) PUCHAR Buffer, _In_ ULONG BitsPerPixel, _In_ ULONG Delta)
static UINT WPARAM wparam