Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/external/source/vncdll/winvnc/common.h
Views: 11779
#ifndef _COMMON_H1#define _COMMON_H23#define WIN32_LEAN_AND_MEAN4#include <winsock2.h>5#include <windows.h>6#include <stdio.h>78//#define DEBUGTRACE910#ifdef DEBUGTRACE11#include <stdlib.h>12#define dprintf(...) real_dprintf(__VA_ARGS__)13#ifndef DPRINTF14#define DPRINTF15static void real_dprintf(char *format, ...) {16va_list args;17char buffer[1024];18FILE * fp = fopen("c:\\debug_log_vncdll.txt","a");19va_start(args,format);20vsnprintf_s(buffer, sizeof(buffer), sizeof(buffer)-3, format,args);21strcat_s(buffer, sizeof(buffer), "\r\n\x00");22if(fp)23{24fputs( buffer, fp );25fclose(fp);26}27OutputDebugString(buffer);28}29#endif30#else31#define dprintf(...) do{}while(0);32#endif3334// Simple macro to close a handle and set the handle to NULL.35#define CLOSE_HANDLE( h ) if( h ) { CloseHandle( h ); h = NULL; }3637#define BREAK_ON_ERROR( str ) { dwResult = GetLastError(); dprintf( "%s. error=%d", str, dwResult ); break; }38#define BREAK_WITH_ERROR( str, err ) { dwResult = err; dprintf( "%s. error=%d", str, dwResult ); break; }39#define BREAK_ON_WSAERROR( str ) { dwResult = WSAGetLastError(); dprintf( "%s. error=%d", str, dwResult ); break; }4041typedef struct _PIXELFORMAT42{43BYTE bpp;44BYTE depth;45BYTE bigendian;46BYTE truecolour;47WORD redmax;48WORD greenmax;49WORD bluemax;50BYTE redshift;51BYTE greenshift;52BYTE blueshift;53BYTE pad1;54WORD pad2;55} PIXELFORMAT;5657/*typedef struct _DICTMSG58{59DWORD dwId;60DWORD dwDictLength;61BYTE bDictBuffer[1];62} DICTMSG;*/6364/*65* The context used for the agent to keep the vnc stream back to the client consistent during session switching.66*/67typedef struct _AGENT_CTX68{69// The WSAPROTOCOL_INFO structure for the socket back to the client.70WSAPROTOCOL_INFO info;71// Flag to disable the creation of a courtesy shell on the input desktop.72BOOL bDisableCourtesyShell;73// The event to terminate the vnc agent.74HANDLE hCloseEvent;75// A flag to force only the first agent instance to perform the RFB initilization.76BOOL bInit;77// The encoding used by the last agent, we can then force the next agent to keep using78// the last known encoding in order to keep the remote client's RFB stream consistent.79DWORD dwEncoding;80// A hex value used for the loaders pipe server81DWORD dwPipeName;82// The rfb streams current pixel format.83PIXELFORMAT PixelFormat;84// Various settings for the rfb stream.85DWORD dwCompressLevel;86DWORD dwQualityLevel;87BOOL bUseCopyRect;88BOOL bEncodingRichCursor;89BOOL bEncodingPointerPos;90BOOL bEncodingLastRect;91BOOL bEncodingNewfbSize;92BOOL bEncodingXCursor;93//DICTMSG * dictionaries[4];94} AGENT_CTX, * LPAGENT_CTX;9596#define MESSAGE_SETENCODING 0x2847164997#define MESSAGE_SETPIXELFORMAT 0x9278592698#define MESSAGE_SETCOMPRESSLEVEL 0x8265892699#define MESSAGE_SETQUALITYLEVEL 0x31857295100#define MESSAGE_SETCOPYRECTUSE 0x91748275101#define MESSAGE_SETENCODINGRICHCURSOR 0x39185037102#define MESSAGE_SETENCODINGPOINTERPOS 0x47295620103#define MESSAGE_SETENCODINGLASTRECT 0x11984659104#define MESSAGE_SETENCODINGNEWFBSIZE 0x94856345105#define MESSAGE_SETENCODINGXCURSOR 0x81659265106#define MESSAGE_SETZLIBDICTIONARY 0x91601668107108#endif109110