├── AggressiveOptimize.h ├── DSMPlugin ├── DSMPlugin.cpp ├── DSMPlugin.h └── TestPlugin │ ├── ReadMe.txt │ ├── StdAfx.cpp │ ├── StdAfx.h │ ├── TestPlugin.cpp │ ├── TestPlugin.dsp │ ├── TestPlugin.dsw │ ├── TestPlugin.h │ ├── TestPlugin.rc │ └── resource.h ├── README.txt ├── Xregion ├── Region.c ├── Region_old.c ├── Xregion.dsp ├── Xregion.h ├── Xregion.vcproj ├── Xregion.vcproj.ACER.rudi.user ├── Xregion.vcproj.PIV.rudi.user ├── Xregion.vcproj.VIRTUALXP-63912.XPMUser.user ├── Xregion.vcproj.rudi-PC.rudi.user ├── Xregion.vcxproj ├── Xregion.vcxproj.filters ├── Xregion.vcxproj.user ├── Xregion_old.h ├── region.h └── region_old.h ├── ZipUnZip32 ├── LICENSE ├── README ├── UnZip32.dll ├── Zip32.dll ├── ZipUnZip32.h └── ZipUnzip32.cpp ├── custom ├── bg1.bmp ├── bg2.bmp ├── bg3.bmp ├── bg4.bmp └── custom.zip ├── rdr ├── Exception.h ├── FdInStream.cxx ├── FdInStream.h ├── FdOutStream.cxx ├── FdOutStream.h ├── FixedMemOutStream.h ├── InStream.cxx ├── InStream.h ├── Makefile.bcc32 ├── Makefile.in ├── MemInStream.h ├── MemOutStream.h ├── NullOutStream.cxx ├── NullOutStream.h ├── OutStream.h ├── ZlibInStream.cxx ├── ZlibInStream.h ├── ZlibOutStream.cxx ├── ZlibOutStream.h ├── rdr.dsp ├── rdr.vcproj ├── rdr.vcproj.ACER.rudi.user ├── rdr.vcproj.PIV.rudi.user ├── rdr.vcproj.VIRTUALXP-63912.XPMUser.user ├── rdr.vcproj.rudi-PC.rudi.user ├── rdr.vcxproj ├── rdr.vcxproj.filters ├── rdr.vcxproj.user └── types.h ├── rfb ├── Makefile.in ├── d3des.c ├── d3des.h ├── rfbproto.h ├── vncauth.c ├── vncauth.h ├── zrleDecode.h └── zrleEncode.h ├── winvnc ├── CCNSMT.tlh ├── building.txt ├── history.txt ├── omnithread │ ├── build-bcc32.bat │ ├── nt.cpp │ ├── nt.h │ ├── omnithread.dsp │ ├── omnithread.h │ ├── omnithread.vcproj │ ├── omnithread.vcproj.ACER.rudi.user │ ├── omnithread.vcproj.PIV.rudi.user │ ├── omnithread.vcproj.VIRTUALXP-63912.XPMUser.user │ ├── omnithread.vcproj.rudi-PC.rudi.user │ ├── omnithread.vcxproj │ ├── omnithread.vcxproj.user │ ├── omnithread │ │ ├── nt.cpp │ │ └── nt.h │ └── threaddata.cpp ├── winvnc.dsw ├── winvnc.sln └── winvnc │ ├── DeskdupEngine.cpp │ ├── DeskdupEngine.h │ ├── Dtwinver.cpp │ ├── Dtwinver.h │ ├── HideDesktop.cpp │ ├── HideDesktop.h │ ├── IPC.cpp │ ├── IPC.h │ ├── Localization.h │ ├── ScreenCapture.cpp │ ├── ScreenCapture.h │ ├── Test.cpp │ ├── TextChat.cpp │ ├── TextChat.h │ ├── Timer.cpp │ ├── Timer.h │ ├── VersionHelpers.h │ ├── WINVNC.DEP │ ├── WINVNC.DSW │ ├── WINVNC.MAK │ ├── black_layered.cpp │ ├── buildtime.cpp │ ├── d3des.h │ ├── dpi.h │ ├── keysymdef.h │ ├── minmax.h │ ├── rebootsafemode.cpp │ ├── res │ ├── Image1.bmp │ ├── Image10.bmp │ ├── Image11.bmp │ ├── Image12.bmp │ ├── Image2.bmp │ ├── Image3.bmp │ ├── Image4.bmp │ ├── Image5.bmp │ ├── Image6.bmp │ ├── Image7.bmp │ ├── Image9.bmp │ ├── Thumbs.db │ ├── icon1.ico │ ├── icon11.ico │ ├── icon2.ico │ ├── icon22.ico │ └── vnc-1.bmp │ ├── resource.h │ ├── rfb.h │ ├── rfbMisc.h │ ├── rfbRect.h │ ├── rfbRegion.h │ ├── rfbRegion_win32.cpp │ ├── rfbRegion_win32.h │ ├── rfbUpdateTracker.cpp │ ├── rfbUpdateTracker.h │ ├── stdhdrs.cpp │ ├── stdhdrs.h │ ├── tableinitcmtemplate.cpp │ ├── tableinittctemplate.cpp │ ├── tabletranstemplate.cpp │ ├── translate.cpp │ ├── translate.h │ ├── videodriver.cpp │ ├── videodriver.h │ ├── videodrivercheck.cpp │ ├── vncDesktopSW.cpp │ ├── vncEncodeTight.cpp │ ├── vncEncodeTight.h │ ├── vncMultiMonitor.cpp │ ├── vncOSVersion.cpp │ ├── vncOSVersion.h │ ├── vncabout.cpp │ ├── vncabout.h │ ├── vncbuffer.cpp │ ├── vncbuffer.h │ ├── vncclient.cpp │ ├── vncclient.h │ ├── vncdesktop.cpp │ ├── vncdesktop.h │ ├── vncdesktopthread.cpp │ ├── vncdesktopthread.h │ ├── vncencodehext.cpp │ ├── vncencodehext.h │ ├── vncencodemgr.h │ ├── vncencoder.cpp │ ├── vncencoder.h │ ├── vncencoderCursor.cpp │ ├── vncencodezrle.cpp │ ├── vncencodezrle.h │ ├── vncinsthandler.cpp │ ├── vncinsthandler.h │ ├── vnckeymap.cpp │ ├── vnckeymap.h │ ├── vnclog.cpp │ ├── vnclog.h │ ├── vnclogon.cpp │ ├── vnclogon.h │ ├── vncmemcpy.h │ ├── vncmenu.cpp │ ├── vncmenu.h │ ├── vncproperties.cpp │ ├── vncproperties.h │ ├── vncpropertiesPoll.cpp │ ├── vncpropertiesPoll.h │ ├── vncserver.cpp │ ├── vncserver.h │ ├── vncservice.cpp │ ├── vncservice.h │ ├── vncsockconnect.cpp │ ├── vncsockconnect.h │ ├── vsocket.cpp │ ├── vsocket.h │ ├── vtypes.h │ ├── winapifamily.h │ ├── winvnc.cpp │ ├── winvnc.dsp │ ├── winvnc.exe.manifest │ ├── winvnc.h │ ├── winvnc.rc │ ├── winvnc.rc_VS │ ├── winvnc.vcproj │ ├── winvnc.vcproj.ACER.rudi.user │ ├── winvnc.vcproj.PIV.rudi.user │ ├── winvnc.vcproj.VIRTUALXP-63912.XPMUser.user │ ├── winvnc.vcproj.rudi-PC.rudi.user │ ├── winvnc.vcxproj │ ├── winvnc.vcxproj.filters │ └── winvnc.vcxproj.user └── zlib ├── ChangeLog ├── FAQ ├── INDEX ├── Makefile ├── Makefile.bcc32 ├── Makefile.in ├── README ├── adler32.c ├── algorithm.txt ├── compress.c ├── configure ├── crc32.c ├── crc32.h ├── deflate.c ├── deflate.h ├── example.c ├── gzio.c ├── infback.c ├── inffast.c ├── inffast.h ├── inffixed.h ├── inflate.c ├── inflate.h ├── inftrees.c ├── inftrees.h ├── minigzip.c ├── trees.c ├── trees.h ├── uncompr.c ├── zconf.h ├── zconf.in.h ├── zlib.3 ├── zlib.dsp ├── zlib.h ├── zlib.vcproj ├── zlib.vcproj.ACER.rudi.user ├── zlib.vcproj.PIV.rudi.user ├── zlib.vcproj.VIRTUALXP-63912.XPMUser.user ├── zlib.vcproj.rudi-PC.rudi.user ├── zlib.vcxproj ├── zlib.vcxproj.filters ├── zlib.vcxproj.user ├── zutil.c └── zutil.h /AggressiveOptimize.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ultravnc/SC/386d3a42ccbb1d5f531cde896195ee4531288610/AggressiveOptimize.h -------------------------------------------------------------------------------- /DSMPlugin/TestPlugin/ReadMe.txt: -------------------------------------------------------------------------------- 1 | ======================================================================== 2 | DYNAMIC LINK LIBRARY : TestPlugin 3 | ======================================================================== 4 | 5 | 6 | AppWizard has created this TestPlugin DLL for you. 7 | 8 | This file contains a summary of what you will find in each of the files that 9 | make up your TestPlugin application. 10 | 11 | TestPlugin.dsp 12 | This file (the project file) contains information at the project level and 13 | is used to build a single project or subproject. Other users can share the 14 | project (.dsp) file, but they should export the makefiles locally. 15 | 16 | TestPlugin.cpp 17 | This is the main DLL source file. 18 | 19 | TestPlugin.h 20 | This file contains your DLL exports. 21 | 22 | ///////////////////////////////////////////////////////////////////////////// 23 | Other standard files: 24 | 25 | StdAfx.h, StdAfx.cpp 26 | These files are used to build a precompiled header (PCH) file 27 | named TestPlugin.pch and a precompiled types file named StdAfx.obj. 28 | 29 | 30 | ///////////////////////////////////////////////////////////////////////////// 31 | Other notes: 32 | 33 | AppWizard uses "TODO:" to indicate parts of the source code you 34 | should add to or customize. 35 | 36 | 37 | ///////////////////////////////////////////////////////////////////////////// 38 | -------------------------------------------------------------------------------- /DSMPlugin/TestPlugin/StdAfx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // TestPlugin.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /DSMPlugin/TestPlugin/StdAfx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #if !defined(AFX_STDAFX_H__213115EB_FB9E_4844_A26F_B6FF22C547BB__INCLUDED_) 7 | #define AFX_STDAFX_H__213115EB_FB9E_4844_A26F_B6FF22C547BB__INCLUDED_ 8 | 9 | #if _MSC_VER > 1000 10 | #pragma once 11 | #endif // _MSC_VER > 1000 12 | 13 | 14 | // Insert your headers here 15 | #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers 16 | 17 | #include 18 | 19 | // TODO: reference additional headers your program requires here 20 | 21 | //{{AFX_INSERT_LOCATION}} 22 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 23 | 24 | #endif // !defined(AFX_STDAFX_H__213115EB_FB9E_4844_A26F_B6FF22C547BB__INCLUDED_) 25 | -------------------------------------------------------------------------------- /DSMPlugin/TestPlugin/TestPlugin.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "TestPlugin"=.\TestPlugin.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Global: 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<3> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | -------------------------------------------------------------------------------- /DSMPlugin/TestPlugin/TestPlugin.rc: -------------------------------------------------------------------------------- 1 | #include "resource.h" 2 | 3 | #define APSTUDIO_READONLY_SYMBOLS 4 | #include "afxres.h" 5 | #undef APSTUDIO_READONLY_SYMBOLS 6 | 7 | ///////////////////////////////////////////////////////////////////////////// 8 | // French (France) resources 9 | 10 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_FRA) 11 | #ifdef _WIN32 12 | LANGUAGE LANG_FRENCH, SUBLANG_FRENCH 13 | #pragma code_page(1252) 14 | #endif //_WIN32 15 | 16 | #ifdef APSTUDIO_INVOKED 17 | ///////////////////////////////////////////////////////////////////////////// 18 | // 19 | // TEXTINCLUDE 20 | // 21 | 22 | 1 TEXTINCLUDE DISCARDABLE 23 | BEGIN 24 | "resource.h\0" 25 | END 26 | 27 | 2 TEXTINCLUDE DISCARDABLE 28 | BEGIN 29 | "#include ""afxres.h""\r\n" 30 | "\0" 31 | END 32 | 33 | 3 TEXTINCLUDE DISCARDABLE 34 | BEGIN 35 | "\r\n" 36 | "\0" 37 | END 38 | 39 | #endif // APSTUDIO_INVOKED 40 | 41 | 42 | ///////////////////////////////////////////////////////////////////////////// 43 | // 44 | // Dialog 45 | // 46 | 47 | IDD_CONFIG_DIALOG DIALOG DISCARDABLE 0, 0, 186, 95 48 | STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU 49 | CAPTION " TestPlugin Configuration" 50 | FONT 8, "MS Sans Serif" 51 | BEGIN 52 | DEFPUSHBUTTON "Save",IDOK,28,75,50,14,NOT WS_VISIBLE | WS_DISABLED 53 | PUSHBUTTON "Cancel",IDCANCEL,109,75,50,14 54 | LTEXT "This Plugin is only an example and is used to test all the Data Stream Modification Plugin mechanism", 55 | IDC_STATIC,13,6,161,19 56 | LTEXT "A Plugin that really does something may get its various parameters from this dialog box", 57 | IDC_STATIC,14,27,155,17 58 | LTEXT "By default, Ultr@VNC uses the VNC password as the only Plugin parameter.", 59 | IDC_STATIC,14,50,161,19 60 | END 61 | 62 | 63 | ///////////////////////////////////////////////////////////////////////////// 64 | // 65 | // DESIGNINFO 66 | // 67 | 68 | #ifdef APSTUDIO_INVOKED 69 | GUIDELINES DESIGNINFO DISCARDABLE 70 | BEGIN 71 | IDD_CONFIG_DIALOG, DIALOG 72 | BEGIN 73 | LEFTMARGIN, 7 74 | RIGHTMARGIN, 179 75 | TOPMARGIN, 7 76 | BOTTOMMARGIN, 88 77 | END 78 | END 79 | #endif // APSTUDIO_INVOKED 80 | 81 | #endif // French (France) resources 82 | ///////////////////////////////////////////////////////////////////////////// 83 | 84 | 85 | 86 | #ifndef APSTUDIO_INVOKED 87 | ///////////////////////////////////////////////////////////////////////////// 88 | // 89 | // Generated from the TEXTINCLUDE 3 resource. 90 | // 91 | 92 | 93 | ///////////////////////////////////////////////////////////////////////////// 94 | #endif // not APSTUDIO_INVOKED 95 | 96 | -------------------------------------------------------------------------------- /DSMPlugin/TestPlugin/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Used by TestPlugin.rc 3 | // 4 | #define IDD_CONFIG_DIALOG 101 5 | 6 | // Next default values for new objects 7 | // 8 | #ifdef APSTUDIO_INVOKED 9 | #ifndef APSTUDIO_READONLY_SYMBOLS 10 | #define _APS_NEXT_RESOURCE_VALUE 102 11 | #define _APS_NEXT_COMMAND_VALUE 40001 12 | #define _APS_NEXT_CONTROL_VALUE 1002 13 | #define _APS_NEXT_SYMED_VALUE 101 14 | #endif 15 | #endif 16 | -------------------------------------------------------------------------------- /README.txt: -------------------------------------------------------------------------------- 1 | Aug 2022 2 | 3 | SC is now part of the ultraVNC git. 4 | Using SC_20 or SC_20_DEBUG. 5 | 6 | https://github.com/ultravnc/UltraVNC/releases/tag/1.4.0.5 7 | 8 | https://user-images.githubusercontent.com/71467484/212483531-1e261e11-d6c1-4795-98fd-a013ec233cf0.png 9 | -------------------------------------------------------------------------------- /Xregion/Xregion.dsp: -------------------------------------------------------------------------------- 1 | # Microsoft Developer Studio Project File - Name="Xregion" - Package Owner=<4> 2 | # Microsoft Developer Studio Generated Build File, Format Version 6.00 3 | # ** DO NOT EDIT ** 4 | 5 | # TARGTYPE "Win32 (x86) Static Library" 0x0104 6 | 7 | CFG=Xregion - Win32 Debug 8 | !MESSAGE This is not a valid makefile. To build this project using NMAKE, 9 | !MESSAGE use the Export Makefile command and run 10 | !MESSAGE 11 | !MESSAGE NMAKE /f "Xregion.mak". 12 | !MESSAGE 13 | !MESSAGE You can specify a configuration when running NMAKE 14 | !MESSAGE by defining the macro CFG on the command line. For example: 15 | !MESSAGE 16 | !MESSAGE NMAKE /f "Xregion.mak" CFG="Xregion - Win32 Debug" 17 | !MESSAGE 18 | !MESSAGE Possible choices for configuration are: 19 | !MESSAGE 20 | !MESSAGE "Xregion - Win32 Release" (based on "Win32 (x86) Static Library") 21 | !MESSAGE "Xregion - Win32 Debug" (based on "Win32 (x86) Static Library") 22 | !MESSAGE 23 | 24 | # Begin Project 25 | # PROP AllowPerConfigDependencies 0 26 | # PROP Scc_ProjName "" 27 | # PROP Scc_LocalPath "" 28 | CPP=cl.exe 29 | RSC=rc.exe 30 | 31 | !IF "$(CFG)" == "Xregion - Win32 Release" 32 | 33 | # PROP BASE Use_MFC 0 34 | # PROP BASE Use_Debug_Libraries 0 35 | # PROP BASE Output_Dir "Release" 36 | # PROP BASE Intermediate_Dir "Release" 37 | # PROP BASE Target_Dir "" 38 | # PROP Use_MFC 0 39 | # PROP Use_Debug_Libraries 0 40 | # PROP Output_Dir "Release" 41 | # PROP Intermediate_Dir "Release" 42 | # PROP Target_Dir "" 43 | # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c 44 | # ADD CPP /nologo /MD /W3 /GX /O1 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /QaxWK /O3 /c 45 | # ADD BASE RSC /l 0x809 /d "NDEBUG" 46 | # ADD RSC /l 0x809 /d "NDEBUG" 47 | BSC32=bscmake.exe 48 | # ADD BASE BSC32 /nologo 49 | # ADD BSC32 /nologo 50 | LIB32=link.exe -lib 51 | # ADD BASE LIB32 /nologo 52 | # ADD LIB32 /nologo 53 | 54 | !ELSEIF "$(CFG)" == "Xregion - Win32 Debug" 55 | 56 | # PROP BASE Use_MFC 0 57 | # PROP BASE Use_Debug_Libraries 1 58 | # PROP BASE Output_Dir "Debug" 59 | # PROP BASE Intermediate_Dir "Debug" 60 | # PROP BASE Target_Dir "" 61 | # PROP Use_MFC 0 62 | # PROP Use_Debug_Libraries 1 63 | # PROP Output_Dir "Debug" 64 | # PROP Intermediate_Dir "Debug" 65 | # PROP Target_Dir "" 66 | # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c 67 | # ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /FR /YX /FD /GZ /c 68 | # ADD BASE RSC /l 0x809 /d "_DEBUG" 69 | # ADD RSC /l 0x809 /d "_DEBUG" 70 | BSC32=bscmake.exe 71 | # ADD BASE BSC32 /nologo 72 | # ADD BSC32 /nologo 73 | LIB32=link.exe -lib 74 | # ADD BASE LIB32 /nologo 75 | # ADD LIB32 /nologo 76 | 77 | !ENDIF 78 | 79 | # Begin Target 80 | 81 | # Name "Xregion - Win32 Release" 82 | # Name "Xregion - Win32 Debug" 83 | # Begin Group "Source Files" 84 | 85 | # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" 86 | # Begin Source File 87 | 88 | SOURCE=.\Region.c 89 | # End Source File 90 | # End Group 91 | # Begin Group "Header Files" 92 | 93 | # PROP Default_Filter "h;hpp;hxx;hm;inl" 94 | # Begin Source File 95 | 96 | SOURCE=.\region.h 97 | # End Source File 98 | # Begin Source File 99 | 100 | SOURCE=.\Xregion.h 101 | # End Source File 102 | # End Group 103 | # End Target 104 | # End Project 105 | -------------------------------------------------------------------------------- /Xregion/Xregion.vcproj.ACER.rudi.user: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 11 | 35 | 36 | 39 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /Xregion/Xregion.vcproj.PIV.rudi.user: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 11 | 35 | 36 | 39 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /Xregion/Xregion.vcproj.VIRTUALXP-63912.XPMUser.user: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 11 | 35 | 36 | 39 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /Xregion/Xregion.vcproj.rudi-PC.rudi.user: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 11 | 35 | 36 | 39 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /Xregion/Xregion.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {7978575f-ac8d-40b2-9c06-fcf05fea27f8} 6 | cpp;c;cxx;rc;def;r;odl;idl;hpj;bat 7 | 8 | 9 | {733e121c-0083-4e9c-9ee7-73785d8a57b9} 10 | h;hpp;hxx;hm;inl 11 | 12 | 13 | 14 | 15 | Source Files 16 | 17 | 18 | 19 | 20 | Header Files 21 | 22 | 23 | Header Files 24 | 25 | 26 | -------------------------------------------------------------------------------- /Xregion/Xregion.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /ZipUnZip32/LICENSE: -------------------------------------------------------------------------------- 1 | This is version 2000-Apr-09 of the Info-ZIP copyright and license. 2 | The definitive version of this document should be available at 3 | ftp://ftp.info-zip.org/pub/infozip/license.html indefinitely. 4 | 5 | 6 | Copyright (c) 1990-2000 Info-ZIP. All rights reserved. 7 | 8 | For the purposes of this copyright and license, "Info-ZIP" is defined as 9 | the following set of individuals: 10 | 11 | Mark Adler, John Bush, Karl Davis, Harald Denker, Jean-Michel Dubois, 12 | Jean-loup Gailly, Hunter Goatley, Ian Gorman, Chris Herborth, Dirk Haase, 13 | Greg Hartwig, Robert Heath, Jonathan Hudson, Paul Kienitz, David Kirschbaum, 14 | Johnny Lee, Onno van der Linden, Igor Mandrichenko, Steve P. Miller, 15 | Sergio Monesi, Keith Owens, George Petrov, Greg Roelofs, Kai Uwe Rommel, 16 | Steve Salisbury, Dave Smith, Christian Spieler, Antoine Verheijen, 17 | Paul von Behren, Rich Wales, Mike White 18 | 19 | This software is provided "as is," without warranty of any kind, express 20 | or implied. In no event shall Info-ZIP or its contributors be held liable 21 | for any direct, indirect, incidental, special or consequential damages 22 | arising out of the use of or inability to use this software. 23 | 24 | Permission is granted to anyone to use this software for any purpose, 25 | including commercial applications, and to alter it and redistribute it 26 | freely, subject to the following restrictions: 27 | 28 | 1. Redistributions of source code must retain the above copyright notice, 29 | definition, disclaimer, and this list of conditions. 30 | 31 | 2. Redistributions in binary form must reproduce the above copyright 32 | notice, definition, disclaimer, and this list of conditions in 33 | documentation and/or other materials provided with the distribution. 34 | 35 | 3. Altered versions--including, but not limited to, ports to new operating 36 | systems, existing ports with new graphical interfaces, and dynamic, 37 | shared, or static library versions--must be plainly marked as such 38 | and must not be misrepresented as being the original source. Such 39 | altered versions also must not be misrepresented as being Info-ZIP 40 | releases--including, but not limited to, labeling of the altered 41 | versions with the names "Info-ZIP" (or any variation thereof, including, 42 | but not limited to, different capitalizations), "Pocket UnZip," "WiZ" 43 | or "MacZip" without the explicit permission of Info-ZIP. Such altered 44 | versions are further prohibited from misrepresentative use of the 45 | Zip-Bugs or Info-ZIP e-mail addresses or of the Info-ZIP URL(s). 46 | 47 | 4. Info-ZIP retains the right to use the names "Info-ZIP," "Zip," "UnZip," 48 | "WiZ," "Pocket UnZip," "Pocket Zip," and "MacZip" for its own source and 49 | binary releases. 50 | -------------------------------------------------------------------------------- /ZipUnZip32/README: -------------------------------------------------------------------------------- 1 | 2 | *** 3 | Zip32.dll is the original Info-Zip Zip 2.3 version (without encryption) that can be found on the Info-Zip sites: 4 | http://www.info-zip.org/pub/infozip/ 5 | http://www.cdrom.com/pub/infozip/ 6 | ftp://ftp.info-zip.org/pub/infozip 7 | *** 8 | 9 | *** 10 | unzip32.dll was compiled using the portable unzip550 source code that can be found on the Info-Zip sites: 11 | http://www.info-zip.org/pub/infozip/ 12 | http://www.cdrom.com/pub/infozip/ 13 | ftp://ftp.info-zip.org/pub/infozip 14 | The only thing that was modified is that the "crypt.c" and "crypt.h" files have been replaced with the dummy ones coming from the Zip 2.3 sources. 15 | So this unzip32.dll does not contain any encryption/decryption code or binary. 16 | *** 17 | 18 | 19 | -------------------------------------------------------------------------------- /ZipUnZip32/UnZip32.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ultravnc/SC/386d3a42ccbb1d5f531cde896195ee4531288610/ZipUnZip32/UnZip32.dll -------------------------------------------------------------------------------- /ZipUnZip32/Zip32.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ultravnc/SC/386d3a42ccbb1d5f531cde896195ee4531288610/ZipUnZip32/Zip32.dll -------------------------------------------------------------------------------- /custom/bg1.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ultravnc/SC/386d3a42ccbb1d5f531cde896195ee4531288610/custom/bg1.bmp -------------------------------------------------------------------------------- /custom/bg2.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ultravnc/SC/386d3a42ccbb1d5f531cde896195ee4531288610/custom/bg2.bmp -------------------------------------------------------------------------------- /custom/bg3.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ultravnc/SC/386d3a42ccbb1d5f531cde896195ee4531288610/custom/bg3.bmp -------------------------------------------------------------------------------- /custom/bg4.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ultravnc/SC/386d3a42ccbb1d5f531cde896195ee4531288610/custom/bg4.bmp -------------------------------------------------------------------------------- /custom/custom.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ultravnc/SC/386d3a42ccbb1d5f531cde896195ee4531288610/custom/custom.zip -------------------------------------------------------------------------------- /rdr/Exception.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2002 RealVNC Ltd. All Rights Reserved. 3 | // 4 | // This is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This software is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License 15 | // along with this software; if not, write to the Free Software 16 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 17 | // USA. 18 | 19 | #ifndef __RDR_EXCEPTION_H__ 20 | #define __RDR_EXCEPTION_H__ 21 | 22 | #include 23 | #include 24 | 25 | namespace rdr { 26 | 27 | struct Exception { 28 | enum { len = 256 }; 29 | char str_[len]; 30 | Exception(const char* s=0, const char* e="rdr::Exception") { 31 | str_[0] = 0; 32 | strncat(str_, e, len-1); 33 | if (s) { 34 | strncat(str_, ": ", len-1-strlen(str_)); 35 | strncat(str_, s, len-1-strlen(str_)); 36 | } 37 | } 38 | virtual const char* str() const { return str_; } 39 | }; 40 | 41 | struct SystemException : public Exception { 42 | int err; 43 | SystemException(const char* s, int err_) : err(err_) { 44 | str_[0] = 0; 45 | strncat(str_, "rdr::SystemException: ", len-1); 46 | strncat(str_, s, len-1-strlen(str_)); 47 | strncat(str_, ": ", len-1-strlen(str_)); 48 | strncat(str_, strerror(err), len-1-strlen(str_)); 49 | strncat(str_, " (", len-1-strlen(str_)); 50 | char buf[20]; 51 | sprintf(buf,"%d",err); 52 | strncat(str_, buf, len-1-strlen(str_)); 53 | strncat(str_, ")", len-1-strlen(str_)); 54 | } 55 | }; 56 | 57 | struct TimedOut : public Exception { 58 | TimedOut(const char* s=0) : Exception(s,"rdr::TimedOut") {} 59 | }; 60 | 61 | struct EndOfStream : public Exception { 62 | EndOfStream(const char* s=0) : Exception(s,"rdr::EndOfStream") {} 63 | }; 64 | 65 | struct FrameException : public Exception { 66 | FrameException(const char* s=0) : Exception(s,"rdr::FrameException") {} 67 | }; 68 | 69 | } 70 | 71 | #endif 72 | -------------------------------------------------------------------------------- /rdr/FdInStream.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2002 RealVNC Ltd. All Rights Reserved. 3 | // 4 | // This is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This software is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License 15 | // along with this software; if not, write to the Free Software 16 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 17 | // USA. 18 | 19 | // 20 | // FdInStream streams from a file descriptor. 21 | // 22 | 23 | #ifndef __RDR_FDINSTREAM_H__ 24 | #define __RDR_FDINSTREAM_H__ 25 | 26 | #pragma once 27 | 28 | #include "InStream.h" 29 | 30 | namespace rdr { 31 | 32 | class FdInStream : public InStream { 33 | 34 | public: 35 | 36 | FdInStream(int fd, int timeout=0, int bufSize=0); 37 | FdInStream(int fd, void (*blockCallback)(void*), void* blockCallbackArg=0, 38 | int bufSize=0); 39 | virtual ~FdInStream(); 40 | 41 | int getFd() { return fd; } 42 | int pos(); 43 | void readBytes(void* data, int length); 44 | int bytesInBuf() { return end - ptr; } 45 | 46 | void startTiming(); 47 | void stopTiming(); 48 | unsigned int kbitsPerSecond(); 49 | unsigned int timeWaited() { return timeWaitedIn100us; } 50 | 51 | void SetDSMMode(bool fDSMMode){m_fDSMMode = fDSMMode;}; // sf@2002 52 | void SetReadFromMemoryBuffer(int nReadSize, char* pMemBuffer); // sf@2002 53 | bool GetReadFromMemoryBuffer(void) {return m_fReadFromNetRectBuf;}; // sf@2002 54 | long GetBytesRead() {return m_nBytesRead;}; 55 | int Check_if_buffer_has_data(); 56 | 57 | protected: 58 | int overrun(int itemSize, int nItems); 59 | 60 | private: 61 | int checkReadable(int fd, int timeout); 62 | int readWithTimeoutOrCallback(void* buf, int len); 63 | 64 | int fd; 65 | int timeout; 66 | void (*blockCallback)(void*); 67 | void* blockCallbackArg; 68 | 69 | bool timing; 70 | unsigned int timeWaitedIn100us; 71 | unsigned int timedKbits; 72 | 73 | int bufSize; 74 | int offset; 75 | U8* start; 76 | 77 | // sf@2002 - DSMPlugin hack 78 | bool m_fDSMMode; 79 | char* m_pNetRectBuf; 80 | bool m_fReadFromNetRectBuf; 81 | int m_nNetRectBufOffset; 82 | int m_nReadSize; 83 | long m_nBytesRead; 84 | }; 85 | 86 | } // end of namespace rdr 87 | 88 | #endif 89 | -------------------------------------------------------------------------------- /rdr/FdOutStream.cxx: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2002 RealVNC Ltd. All Rights Reserved. 3 | // 4 | // This is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This software is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License 15 | // along with this software; if not, write to the Free Software 16 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 17 | // USA. 18 | 19 | #include 20 | #include 21 | #include 22 | #include 23 | #ifdef _WIN32 24 | #include 25 | #define write(s,b,l) send(s,(const char*)b,l,0) 26 | #undef errno 27 | #define errno WSAGetLastError() 28 | #else 29 | #include 30 | #include 31 | #endif 32 | 33 | #include "FdOutStream.h" 34 | #include "Exception.h" 35 | 36 | 37 | using namespace rdr; 38 | 39 | enum { DEFAULT_BUF_SIZE = 16384, 40 | MIN_BULK_SIZE = 1024 }; 41 | 42 | FdOutStream::FdOutStream(int fd_, int bufSize_) 43 | : fd(fd_), bufSize(bufSize_ ? bufSize_ : DEFAULT_BUF_SIZE), offset(0) 44 | { 45 | ptr = start = new U8[bufSize]; 46 | end = start + bufSize; 47 | } 48 | 49 | FdOutStream::~FdOutStream() 50 | { 51 | try { 52 | flush(); 53 | } catch (Exception&) { 54 | } 55 | delete [] start; 56 | } 57 | 58 | 59 | void FdOutStream::writeBytes(const void* data, int length) 60 | { 61 | if (length < MIN_BULK_SIZE) { 62 | OutStream::writeBytes(data, length); 63 | return; 64 | } 65 | 66 | const U8* dataPtr = (const U8*)data; 67 | 68 | flush(); 69 | 70 | while (length > 0) { 71 | int n = write(fd, dataPtr, length); 72 | 73 | if (n < 0) throw SystemException("write",errno); 74 | 75 | length -= n; 76 | dataPtr += n; 77 | offset += n; 78 | } 79 | } 80 | 81 | int FdOutStream::length() 82 | { 83 | return offset + ptr - start; 84 | } 85 | 86 | void FdOutStream::flush() 87 | { 88 | U8* sentUpTo = start; 89 | while (sentUpTo < ptr) { 90 | int n = write(fd, (const void*) sentUpTo, ptr - sentUpTo); 91 | 92 | if (n < 0) throw SystemException("write",errno); 93 | 94 | sentUpTo += n; 95 | offset += n; 96 | } 97 | 98 | ptr = start; 99 | } 100 | 101 | 102 | int FdOutStream::overrun(int itemSize, int nItems) 103 | { 104 | if (itemSize > bufSize) 105 | throw Exception("FdOutStream overrun: max itemSize exceeded"); 106 | 107 | flush(); 108 | 109 | if (itemSize * nItems > end - ptr) 110 | nItems = (end - ptr) / itemSize; 111 | 112 | return nItems; 113 | } 114 | -------------------------------------------------------------------------------- /rdr/FdOutStream.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2002 RealVNC Ltd. All Rights Reserved. 3 | // 4 | // This is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This software is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License 15 | // along with this software; if not, write to the Free Software 16 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 17 | // USA. 18 | 19 | // 20 | // FdOutStream streams to a file descriptor. 21 | // 22 | 23 | #ifndef __RDR_FDOUTSTREAM_H__ 24 | #define __RDR_FDOUTSTREAM_H__ 25 | 26 | #include "OutStream.h" 27 | 28 | namespace rdr { 29 | 30 | class FdOutStream : public OutStream { 31 | 32 | public: 33 | 34 | FdOutStream(int fd, int bufSize=0); 35 | virtual ~FdOutStream(); 36 | 37 | int getFd() { return fd; } 38 | 39 | void flush(); 40 | int length(); 41 | void writeBytes(const void* data, int length); 42 | 43 | private: 44 | int overrun(int itemSize, int nItems); 45 | int fd; 46 | int bufSize; 47 | int offset; 48 | U8* start; 49 | }; 50 | 51 | } 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /rdr/FixedMemOutStream.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2002 RealVNC Ltd. All Rights Reserved. 3 | // 4 | // This is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This software is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License 15 | // along with this software; if not, write to the Free Software 16 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 17 | // USA. 18 | 19 | // 20 | // A FixedMemOutStream writes to a buffer of a fixed length. 21 | // 22 | 23 | #ifndef __RDR_FIXEDMEMOUTSTREAM_H__ 24 | #define __RDR_FIXEDMEMOUTSTREAM_H__ 25 | 26 | #include "OutStream.h 27 | #include "Exception.h" 28 | 29 | namespace rdr { 30 | 31 | class FixedMemOutStream : public OutStream { 32 | 33 | public: 34 | 35 | FixedMemOutStream(void* buf, int len) { 36 | ptr = start = (U8*)buf; 37 | end = start + len; 38 | } 39 | 40 | int length() { return ptr - start; } 41 | void reposition(int pos) { ptr = start + pos; } 42 | const void* data() { return (const void*)start; } 43 | 44 | private: 45 | 46 | int overrun(int itemSize, int nItems) { throw EndOfStream(); } 47 | U8* start; 48 | }; 49 | 50 | } 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /rdr/InStream.cxx: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2002 RealVNC Ltd. All Rights Reserved. 3 | // 4 | // This is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This software is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License 15 | // along with this software; if not, write to the Free Software 16 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 17 | // USA. 18 | 19 | #include "InStream.h" 20 | #include "Exception.h" 21 | 22 | using namespace rdr; 23 | 24 | U32 InStream::maxStringLength = 65535; 25 | 26 | char* InStream::readString() 27 | { 28 | U32 len = readU32(); 29 | if (len > maxStringLength) 30 | throw Exception("InStream max string length exceeded"); 31 | char* str = new char[len+1]; 32 | readBytes(str, len); 33 | str[len] = 0; 34 | return str; 35 | } 36 | -------------------------------------------------------------------------------- /rdr/Makefile.bcc32: -------------------------------------------------------------------------------- 1 | # ------------- Borland C++ 5.5 (Win32) ------------- 2 | 3 | CC=bcc32 4 | LIB=tlib 5 | 6 | CFLAGS= -v- -O2 -3 -tWM -q -P -xd- -w-8004 -w-8057 7 | LIBFLAGS= /C 8 | 9 | OBJS=FdInStream.obj FdOutStream.obj InStream.obj NullOutStream.obj \ 10 | ZlibInStream.obj ZlibOutStream.obj 11 | 12 | pOBJS=+FdInStream.obj+FdOutStream.obj+InStream.obj+NullOutStream.obj \ 13 | +ZlibInStream.obj+ZlibOutStream.obj 14 | 15 | LIBS=..\zlib\zlib.lib 16 | 17 | .autodepend 18 | .cxx.obj: 19 | $(CC) -c $(CFLAGS) $< 20 | 21 | rdr.lib: $(OBJS) $(LIBS) 22 | @if exist $@ del $@ 23 | $(LIB) $@ $(LIBFLAGS) $(pOBJS) 24 | 25 | ..\zlib\zlib.lib: 26 | cd .. 27 | cd zlib 28 | make -fMakefile.bcc32 -l -s 29 | cd .. 30 | 31 | clean: 32 | del *.obj *.lib 33 | 34 | -------------------------------------------------------------------------------- /rdr/Makefile.in: -------------------------------------------------------------------------------- 1 | 2 | SRCS = FdInStream.cxx FdOutStream.cxx InStream.cxx NullOutStream.cxx \ 3 | ZlibInStream.cxx ZlibOutStream.cxx 4 | 5 | OBJS = $(SRCS:.cxx=.o) 6 | 7 | DIR_CPPFLAGS = -I$(top_srcdir) @ZLIB_INCLUDE@ 8 | 9 | library = librdr.a 10 | 11 | all:: $(library) 12 | 13 | $(library): $(OBJS) 14 | rm -f $(library) 15 | $(AR) $(library) $(OBJS) 16 | $(RANLIB) $(library) 17 | 18 | # followed by boilerplate.mk 19 | -------------------------------------------------------------------------------- /rdr/MemInStream.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2002 RealVNC Ltd. All Rights Reserved. 3 | // 4 | // This is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This software is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License 15 | // along with this software; if not, write to the Free Software 16 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 17 | // USA. 18 | 19 | #ifndef __RDR_MEMINSTREAM_H__ 20 | #define __RDR_MEMINSTREAM_H__ 21 | 22 | #include InStream.h" 23 | #include "Exception.h" 24 | 25 | namespace rdr { 26 | 27 | class MemInStream : public InStream { 28 | 29 | public: 30 | 31 | MemInStream(const void* data, int len) { 32 | ptr = start = (const U8*)data; 33 | end = start + len; 34 | } 35 | 36 | int pos() { return ptr - start; } 37 | void reposition(int pos) { ptr = start + pos; } 38 | 39 | private: 40 | 41 | int overrun(int itemSize, int nItems) { throw EndOfStream(); } 42 | const U8* start; 43 | }; 44 | 45 | } 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /rdr/MemOutStream.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2002 RealVNC Ltd. All Rights Reserved. 3 | // 4 | // This is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This software is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License 15 | // along with this software; if not, write to the Free Software 16 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 17 | // USA. 18 | 19 | // 20 | // A MemOutStream grows as needed when data is written to it. 21 | // 22 | 23 | #ifndef __RDR_MEMOUTSTREAM_H__ 24 | #define __RDR_MEMOUTSTREAM_H__ 25 | 26 | #include "OutStream.h" 27 | 28 | namespace rdr { 29 | 30 | class MemOutStream : public OutStream { 31 | 32 | public: 33 | 34 | MemOutStream(int len=1024) { 35 | start = ptr = new U8[len]; 36 | end = start + len; 37 | } 38 | 39 | virtual ~MemOutStream() { 40 | delete [] start; 41 | } 42 | 43 | void writeBytes(const void* data, int length) { 44 | check(length); 45 | memcpy(ptr, data, length); 46 | ptr += length; 47 | } 48 | 49 | int length() { return ptr - start; } 50 | void clear() { ptr = start; }; 51 | void reposition(int pos) { ptr = start + pos; } 52 | 53 | // data() returns a pointer to the buffer. 54 | 55 | const void* data() { return (const void*)start; } 56 | 57 | private: 58 | 59 | // overrun() either doubles the buffer or adds enough space for nItems of 60 | // size itemSize bytes. 61 | 62 | int overrun(int itemSize, int nItems) { 63 | int len = ptr - start + itemSize * nItems; 64 | if (len < (end - start) * 2) 65 | len = (end - start) * 2; 66 | 67 | U8* newStart = new U8[len]; 68 | memcpy(newStart, start, ptr - start); 69 | ptr = newStart + (ptr - start); 70 | delete [] start; 71 | start = newStart; 72 | end = newStart + len; 73 | 74 | return nItems; 75 | } 76 | 77 | U8* start; 78 | }; 79 | 80 | } 81 | 82 | #endif 83 | -------------------------------------------------------------------------------- /rdr/NullOutStream.cxx: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2002 RealVNC Ltd. All Rights Reserved. 3 | // 4 | // This is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This software is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License 15 | // along with this software; if not, write to the Free Software 16 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 17 | // USA. 18 | 19 | #include "NullOutStream.h" 20 | #include "Exception.h" 21 | 22 | using namespace rdr; 23 | 24 | static const int bufferSize = 1024; 25 | 26 | NullOutStream::NullOutStream() 27 | : offset(0) 28 | { 29 | start = ptr = new U8[bufferSize]; 30 | end = start + bufferSize; 31 | } 32 | 33 | NullOutStream::~NullOutStream() 34 | { 35 | delete [] start; 36 | } 37 | 38 | int NullOutStream::length() 39 | { 40 | return offset + ptr - start; 41 | } 42 | 43 | void NullOutStream::writeBytes(const void* data, int length) 44 | { 45 | offset += length; 46 | } 47 | 48 | int NullOutStream::overrun(int itemSize, int nItems) 49 | { 50 | if (itemSize > bufferSize) 51 | throw Exception("NullOutStream overrun: max itemSize exceeded"); 52 | 53 | offset += ptr - start; 54 | ptr = start; 55 | 56 | if (itemSize * nItems > end - ptr) 57 | nItems = (end - ptr) / itemSize; 58 | 59 | return nItems; 60 | } 61 | -------------------------------------------------------------------------------- /rdr/NullOutStream.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2002 RealVNC Ltd. All Rights Reserved. 3 | // 4 | // This is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This software is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License 15 | // along with this software; if not, write to the Free Software 16 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 17 | // USA. 18 | 19 | #ifndef __RDR_NULLOUTSTREAM_H__ 20 | #define __RDR_NULLOUTSTREAM_H__ 21 | 22 | #include "OutStream.h" 23 | 24 | namespace rdr { 25 | 26 | class NullOutStream : public OutStream { 27 | 28 | public: 29 | NullOutStream(); 30 | virtual ~NullOutStream(); 31 | int length(); 32 | void writeBytes(const void* data, int length); 33 | 34 | private: 35 | int overrun(int itemSize, int nItems); 36 | int offset; 37 | U8* start; 38 | }; 39 | 40 | } 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /rdr/ZlibInStream.cxx: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2002 RealVNC Ltd. All Rights Reserved. 3 | // 4 | // This is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This software is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License 15 | // along with this software; if not, write to the Free Software 16 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 17 | // USA. 18 | 19 | #include "ZlibInStream.h" 20 | #include "Exception.h" 21 | #include "../zlib/zlib.h" 22 | 23 | using namespace rdr; 24 | 25 | enum { DEFAULT_BUF_SIZE = 16384 }; 26 | 27 | ZlibInStream::ZlibInStream(int bufSize_) 28 | : underlying(0), bufSize(bufSize_ ? bufSize_ : DEFAULT_BUF_SIZE), offset(0), 29 | bytesIn(0) 30 | { 31 | zs = new z_stream; 32 | zs->zalloc = Z_NULL; 33 | zs->zfree = Z_NULL; 34 | zs->opaque = Z_NULL; 35 | zs->next_in = Z_NULL; 36 | zs->avail_in = 0; 37 | if (inflateInit(zs) != Z_OK) { 38 | delete zs; 39 | throw Exception("ZlibInStream: inflateInit failed"); 40 | } 41 | ptr = end = start = new U8[bufSize]; 42 | } 43 | 44 | ZlibInStream::~ZlibInStream() 45 | { 46 | delete [] start; 47 | inflateEnd(zs); 48 | delete zs; 49 | } 50 | 51 | void ZlibInStream::setUnderlying(InStream* is, int bytesIn_) 52 | { 53 | underlying = is; 54 | bytesIn = bytesIn_; 55 | ptr = end = start; 56 | } 57 | 58 | int ZlibInStream::pos() 59 | { 60 | return offset + ptr - start; 61 | } 62 | 63 | void ZlibInStream::reset() 64 | { 65 | ptr = end = start; 66 | if (!underlying) return; 67 | 68 | while (bytesIn > 0) { 69 | decompress(); 70 | end = start; // throw away any data 71 | } 72 | underlying = 0; 73 | } 74 | 75 | int ZlibInStream::overrun(int itemSize, int nItems) 76 | { 77 | if (itemSize > bufSize) 78 | throw Exception("ZlibInStream overrun: max itemSize exceeded"); 79 | if (!underlying) 80 | throw Exception("ZlibInStream overrun: no underlying stream"); 81 | 82 | if (end - ptr != 0) 83 | memmove(start, ptr, end - ptr); 84 | 85 | offset += ptr - start; 86 | end -= ptr - start; 87 | ptr = start; 88 | 89 | while (end - ptr < itemSize) { 90 | decompress(); 91 | } 92 | 93 | if (itemSize * nItems > end - ptr) 94 | nItems = (end - ptr) / itemSize; 95 | 96 | return nItems; 97 | } 98 | 99 | // decompress() calls the decompressor once. Note that this won't necessarily 100 | // generate any output data - it may just consume some input data. 101 | 102 | void ZlibInStream::decompress() 103 | { 104 | zs->next_out = (U8*)end; 105 | zs->avail_out = start + bufSize - end; 106 | 107 | underlying->check(1); 108 | zs->next_in = (U8*)underlying->getptr(); 109 | zs->avail_in = underlying->getend() - underlying->getptr(); 110 | if ((int)zs->avail_in > bytesIn) 111 | zs->avail_in = bytesIn; 112 | 113 | int rc = inflate(zs, Z_SYNC_FLUSH); 114 | if (rc != Z_OK) { 115 | throw Exception("ZlibInStream: inflate failed"); 116 | } 117 | 118 | bytesIn -= zs->next_in - underlying->getptr(); 119 | end = zs->next_out; 120 | underlying->setptr(zs->next_in); 121 | } 122 | -------------------------------------------------------------------------------- /rdr/ZlibInStream.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2002 RealVNC Ltd. All Rights Reserved. 3 | // 4 | // This is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This software is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License 15 | // along with this software; if not, write to the Free Software 16 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 17 | // USA. 18 | 19 | // 20 | // ZlibInStream streams from a compressed data stream ("underlying"), 21 | // decompressing with zlib on the fly. 22 | // 23 | 24 | #ifndef __RDR_ZLIBINSTREAM_H__ 25 | #define __RDR_ZLIBINSTREAM_H__ 26 | 27 | #pragma once 28 | 29 | #include "InStream.h" 30 | 31 | struct z_stream_s; 32 | 33 | namespace rdr { 34 | 35 | class ZlibInStream : public InStream { 36 | 37 | public: 38 | 39 | ZlibInStream(int bufSize=0); 40 | virtual ~ZlibInStream(); 41 | 42 | void setUnderlying(InStream* is, int bytesIn); 43 | void reset(); 44 | int pos(); 45 | 46 | private: 47 | 48 | int overrun(int itemSize, int nItems); 49 | void decompress(); 50 | 51 | InStream* underlying; 52 | int bufSize; 53 | int offset; 54 | z_stream_s* zs; 55 | int bytesIn; 56 | U8* start; 57 | }; 58 | 59 | } // end of namespace rdr 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /rdr/ZlibOutStream.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2002 RealVNC Ltd. All Rights Reserved. 3 | // 4 | // This is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This software is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License 15 | // along with this software; if not, write to the Free Software 16 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 17 | // USA. 18 | 19 | 20 | // 21 | // ZlibOutStream streams to a compressed data stream (underlying), compressing 22 | // with zlib on the fly. 23 | // 24 | 25 | #ifndef __RDR_ZLIBOUTSTREAM_H__ 26 | #define __RDR_ZLIBOUTSTREAM_H__ 27 | 28 | #include "OutStream.h" 29 | 30 | struct z_stream_s; 31 | 32 | namespace rdr { 33 | 34 | class ZlibOutStream : public OutStream { 35 | 36 | public: 37 | 38 | ZlibOutStream(OutStream* os=0, int bufSize=0); 39 | virtual ~ZlibOutStream(); 40 | 41 | void setUnderlying(OutStream* os); 42 | void flush(); 43 | int length(); 44 | 45 | private: 46 | 47 | int overrun(int itemSize, int nItems); 48 | 49 | OutStream* underlying; 50 | int bufSize; 51 | int offset; 52 | z_stream_s* zs; 53 | U8* start; 54 | }; 55 | 56 | } // end of namespace rdr 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /rdr/rdr.vcproj.ACER.rudi.user: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 11 | 35 | 36 | 39 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /rdr/rdr.vcproj.PIV.rudi.user: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 11 | 35 | 36 | 39 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /rdr/rdr.vcproj.VIRTUALXP-63912.XPMUser.user: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 11 | 35 | 36 | 39 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /rdr/rdr.vcproj.rudi-PC.rudi.user: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 11 | 35 | 36 | 39 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /rdr/rdr.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {a74bf05a-b204-46ac-b8e9-b81b80649460} 6 | cpp;c;cxx;rc;def;r;odl;idl;hpj;bat 7 | 8 | 9 | {6a796c70-eeae-450d-9978-f0eaa55168f3} 10 | h;hpp;hxx;hm;inl 11 | 12 | 13 | 14 | 15 | Source Files 16 | 17 | 18 | Source Files 19 | 20 | 21 | Source Files 22 | 23 | 24 | Source Files 25 | 26 | 27 | Source Files 28 | 29 | 30 | Source Files 31 | 32 | 33 | 34 | 35 | Header Files 36 | 37 | 38 | Header Files 39 | 40 | 41 | Header Files 42 | 43 | 44 | Header Files 45 | 46 | 47 | Header Files 48 | 49 | 50 | Header Files 51 | 52 | 53 | Header Files 54 | 55 | 56 | Header Files 57 | 58 | 59 | Header Files 60 | 61 | 62 | Header Files 63 | 64 | 65 | Header Files 66 | 67 | 68 | Header Files 69 | 70 | 71 | -------------------------------------------------------------------------------- /rdr/rdr.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /rdr/types.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2002 RealVNC Ltd. All Rights Reserved. 3 | // 4 | // This is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This software is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License 15 | // along with this software; if not, write to the Free Software 16 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 17 | // USA. 18 | 19 | #ifndef __RDR_TYPES_H__ 20 | #define __RDR_TYPES_H__ 21 | 22 | #pragma once 23 | 24 | 25 | namespace rdr 26 | { 27 | typedef unsigned char U8; 28 | typedef unsigned short U16; 29 | typedef unsigned int U32; 30 | typedef signed char S8; 31 | typedef signed short S16; 32 | typedef signed int S32; 33 | 34 | } // end of namespace rdr 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /rfb/Makefile.in: -------------------------------------------------------------------------------- 1 | 2 | SRCS = d3des.c vncauth.c 3 | 4 | OBJS = d3des.o vncauth.o 5 | 6 | DIR_CPPFLAGS = -I$(top_srcdir) 7 | 8 | library = librfb.a 9 | 10 | all:: $(library) 11 | 12 | $(library): $(OBJS) 13 | rm -f $(library) 14 | $(AR) $(library) $(OBJS) 15 | $(RANLIB) $(library) 16 | 17 | # followed by boilerplate.mk 18 | -------------------------------------------------------------------------------- /rfb/d3des.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This is D3DES (V5.09) by Richard Outerbridge with the double and 3 | * triple-length support removed for use in VNC. 4 | * 5 | * These changes are: 6 | * Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved. 7 | * 8 | * This software is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 11 | */ 12 | 13 | /* d3des.h - 14 | * 15 | * Headers and defines for d3des.c 16 | * Graven Imagery, 1992. 17 | * 18 | * Copyright (c) 1988,1989,1990,1991,1992 by Richard Outerbridge 19 | * (GEnie : OUTER; CIS : [71755,204]) 20 | */ 21 | 22 | #define EN0 0 /* MODE == encrypt */ 23 | #define DE1 1 /* MODE == decrypt */ 24 | 25 | extern void deskey(unsigned char *, int); 26 | /* hexkey[8] MODE 27 | * Sets the internal key register according to the hexadecimal 28 | * key contained in the 8 bytes of hexkey, according to the DES, 29 | * for encryption or decryption according to MODE. 30 | */ 31 | 32 | extern void usekey(unsigned long *); 33 | /* cookedkey[32] 34 | * Loads the internal key register with the data in cookedkey. 35 | */ 36 | 37 | extern void cpkey(unsigned long *); 38 | /* cookedkey[32] 39 | * Copies the contents of the internal key register into the storage 40 | * located at &cookedkey[0]. 41 | */ 42 | 43 | extern void des(unsigned char *, unsigned char *); 44 | /* from[8] to[8] 45 | * Encrypts/Decrypts (according to the key currently loaded in the 46 | * internal key register) one block of eight bytes at address 'from' 47 | * into the block at address 'to'. They can be the same. 48 | */ 49 | 50 | /* d3des.h V5.09 rwo 9208.04 15:06 Graven Imagery 51 | ********************************************************************/ 52 | -------------------------------------------------------------------------------- /rfb/vncauth.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved. 3 | * 4 | * This is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This software is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this software; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 17 | * USA. 18 | */ 19 | 20 | /* 21 | * vncauth.h - describes the functions provided by the vncauth library. 22 | */ 23 | 24 | #define MAXPWLEN 8 25 | #define CHALLENGESIZE 16 26 | 27 | extern int vncEncryptAndStorePasswd(char *passwd, char *fname); 28 | extern char *vncDecryptPasswdFromFile(char *fname); 29 | extern void vncRandomBytes(unsigned char *bytes); 30 | extern void vncEncryptBytes(unsigned char *bytes, char *passwd); 31 | -------------------------------------------------------------------------------- /winvnc/building.txt: -------------------------------------------------------------------------------- 1 | NOTES ON BUILDING WINVNC: 2 | 3 | The WinVNC project file (WinVNC.dsp) contains four sets of project 4 | settings. The settings required to re-build the publicly released 5 | executable are stored in the Release configuration. 6 | 7 | The public configurations are: 8 | 9 | /////////////////////////////////////////////////////////////////////////// 10 | 11 | Release - This is the intended build configuration for external use 12 | and is used directly to create the distributed executables. 13 | This configuration is identical to the Release (CORBA) configuration, 14 | barring the use of the definition NCORBA rather than the 15 | definition _CORBA. 16 | 17 | **> Use this release when building WinVNC for general distribution. <** 18 | 19 | Debug - The public debug build. This builds debug executables and 20 | libraries, equivalent in all other respects to the release builds. 21 | 22 | /////////////////////////////////////////////////////////////////////////// 23 | 24 | Internally, AT&T Labs and the Laboratory for Communications Engineering use 25 | CORBA-based session-management. Within the labs, the following builds are used 26 | in place of the public builds above. 27 | 28 | Release (CORBA) - 29 | Release build providing session management interface. 30 | This build assumes the presence of CORBA session-control code 31 | in the vncCorbaConnect files. These are not supplied 32 | as part of the public release distribution because 33 | they are dependent upon AT&T infrastructure. 34 | 35 | Debug (CORBA) - 36 | Debug build providing session management. This build 37 | also assumes the presence of the CORBA session-control 38 | routines. 39 | 40 | /////////////////////////////////////////////////////////////////////////// 41 | -------------------------------------------------------------------------------- /winvnc/omnithread/build-bcc32.bat: -------------------------------------------------------------------------------- 1 | @echo on 2 | bcc32.exe -v- -O2 -3 -tWM -xd- -q -w-8066 -c -oomnithread.obj nt.cpp 3 | -------------------------------------------------------------------------------- /winvnc/omnithread/nt.h: -------------------------------------------------------------------------------- 1 | // Package : omnithread 2 | // omnithread/nt.h Created : 6/95 tjr 3 | // 4 | // Copyright (C) 1995, 1996, 1997 Olivetti & Oracle Research Laboratory 5 | // 6 | // This file is part of the omnithread library 7 | // 8 | // The omnithread library is free software; you can redistribute it and/or 9 | // modify it under the terms of the GNU Library General Public 10 | // License as published by the Free Software Foundation; either 11 | // version 2 of the License, or (at your option) any later version. 12 | // 13 | // This library is distributed in the hope that it will be useful, 14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | // Library General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU Library General Public 19 | // License along with this library; if not, write to the Free 20 | // Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 21 | // 02111-1307, USA 22 | // 23 | // 24 | // OMNI thread implementation classes for NT threads. 25 | // 26 | 27 | #ifndef __omnithread_nt_h_ 28 | #define __omnithread_nt_h_ 29 | 30 | #ifndef WIN32_LEAN_AND_MEAN 31 | # define WIN32_LEAN_AND_MEAN 32 | # define OMNI_DEFINED_WIN32_LEAN_AND_MEAN 33 | #endif 34 | 35 | #include 36 | 37 | #ifdef OMNI_DEFINED_WIN32_LEAN_AND_MEAN 38 | # undef WIN32_LEAN_AND_MEAN 39 | # undef OMNI_DEFINED_WIN32_LEAN_AND_MEAN 40 | #endif 41 | 42 | 43 | #ifndef __BCPLUSPLUS__ 44 | #define OMNI_THREAD_WRAPPER \ 45 | unsigned __stdcall omni_thread_wrapper(LPVOID ptr); 46 | #else 47 | #define OMNI_THREAD_WRAPPER \ 48 | void _USERENTRY omni_thread_wrapper(void *ptr) 49 | #endif 50 | 51 | extern "C" OMNI_THREAD_WRAPPER; 52 | 53 | #define OMNI_MUTEX_IMPLEMENTATION \ 54 | CRITICAL_SECTION crit; 55 | 56 | #define OMNI_MUTEX_LOCK_IMPLEMENTATION \ 57 | EnterCriticalSection(&crit); 58 | 59 | #define OMNI_MUTEX_UNLOCK_IMPLEMENTATION \ 60 | LeaveCriticalSection(&crit); 61 | 62 | #define OMNI_CONDITION_IMPLEMENTATION \ 63 | CRITICAL_SECTION crit; \ 64 | omni_thread* waiting_head; \ 65 | omni_thread* waiting_tail; 66 | 67 | #define OMNI_SEMAPHORE_IMPLEMENTATION \ 68 | HANDLE nt_sem; 69 | 70 | #define OMNI_THREAD_IMPLEMENTATION \ 71 | HANDLE handle; \ 72 | DWORD nt_id; \ 73 | void* return_val; \ 74 | HANDLE cond_semaphore; \ 75 | omni_thread* cond_next; \ 76 | omni_thread* cond_prev; \ 77 | BOOL cond_waiting; \ 78 | static int nt_priority(priority_t); \ 79 | friend class omni_condition; \ 80 | friend OMNI_THREAD_WRAPPER; 81 | 82 | #endif 83 | -------------------------------------------------------------------------------- /winvnc/omnithread/omnithread.dsp: -------------------------------------------------------------------------------- 1 | # Microsoft Developer Studio Project File - Name="omnithread" - Package Owner=<4> 2 | # Microsoft Developer Studio Generated Build File, Format Version 6.00 3 | # ** DO NOT EDIT ** 4 | 5 | # TARGTYPE "Win32 (x86) Static Library" 0x0104 6 | 7 | CFG=omnithread - Win32 Debug 8 | !MESSAGE This is not a valid makefile. To build this project using NMAKE, 9 | !MESSAGE use the Export Makefile command and run 10 | !MESSAGE 11 | !MESSAGE NMAKE /f "omnithread.mak". 12 | !MESSAGE 13 | !MESSAGE You can specify a configuration when running NMAKE 14 | !MESSAGE by defining the macro CFG on the command line. For example: 15 | !MESSAGE 16 | !MESSAGE NMAKE /f "omnithread.mak" CFG="omnithread - Win32 Debug" 17 | !MESSAGE 18 | !MESSAGE Possible choices for configuration are: 19 | !MESSAGE 20 | !MESSAGE "omnithread - Win32 Release" (based on "Win32 (x86) Static Library") 21 | !MESSAGE "omnithread - Win32 Debug" (based on "Win32 (x86) Static Library") 22 | !MESSAGE 23 | 24 | # Begin Project 25 | # PROP AllowPerConfigDependencies 0 26 | # PROP Scc_ProjName ""$/vncviewer/omnithread", MQBAAAAA" 27 | # PROP Scc_LocalPath "." 28 | CPP=xicl6.exe 29 | RSC=rc.exe 30 | 31 | !IF "$(CFG)" == "omnithread - Win32 Release" 32 | 33 | # PROP BASE Use_MFC 0 34 | # PROP BASE Use_Debug_Libraries 0 35 | # PROP BASE Output_Dir "Release" 36 | # PROP BASE Intermediate_Dir "Release" 37 | # PROP BASE Target_Dir "" 38 | # PROP Use_MFC 0 39 | # PROP Use_Debug_Libraries 0 40 | # PROP Output_Dir "Release" 41 | # PROP Intermediate_Dir "Release" 42 | # PROP Target_Dir "" 43 | # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c 44 | # ADD CPP /nologo /MD /W3 /GX /O1 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "__NT__" /D "_WINSTATIC" /D "__WIN32__" /D _WIN32_WINNT=0x400 /YX /FD /c 45 | # ADD BASE RSC /l 0x809 46 | # ADD RSC /l 0x409 47 | BSC32=bscmake.exe 48 | # ADD BASE BSC32 /nologo 49 | # ADD BSC32 /nologo 50 | LIB32=xilink6.exe -lib 51 | # ADD BASE LIB32 /nologo 52 | # ADD LIB32 /nologo 53 | 54 | !ELSEIF "$(CFG)" == "omnithread - Win32 Debug" 55 | 56 | # PROP BASE Use_MFC 0 57 | # PROP BASE Use_Debug_Libraries 1 58 | # PROP BASE Output_Dir "Debug" 59 | # PROP BASE Intermediate_Dir "Debug" 60 | # PROP BASE Target_Dir "" 61 | # PROP Use_MFC 0 62 | # PROP Use_Debug_Libraries 1 63 | # PROP Output_Dir "Debug" 64 | # PROP Intermediate_Dir "Debug" 65 | # PROP Target_Dir "" 66 | # ADD BASE CPP /nologo /W3 /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c 67 | # ADD CPP /nologo /MTd /W3 /GX /Z7 /Od /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "__NT__" /D "_WINSTATIC" /D "__WIN32__" /D _WIN32_WINNT=0x400 /YX /FD /c 68 | # ADD BASE RSC /l 0x809 69 | # ADD RSC /l 0x809 70 | BSC32=bscmake.exe 71 | # ADD BASE BSC32 /nologo 72 | # ADD BSC32 /nologo 73 | LIB32=xilink6.exe -lib 74 | # ADD BASE LIB32 /nologo 75 | # ADD LIB32 /nologo 76 | 77 | !ENDIF 78 | 79 | # Begin Target 80 | 81 | # Name "omnithread - Win32 Release" 82 | # Name "omnithread - Win32 Debug" 83 | # Begin Source File 84 | 85 | SOURCE=.\nt.cpp 86 | # End Source File 87 | # Begin Source File 88 | 89 | SOURCE=.\nt.h 90 | # End Source File 91 | # Begin Source File 92 | 93 | SOURCE=.\omnithread.h 94 | # End Source File 95 | # End Target 96 | # End Project 97 | -------------------------------------------------------------------------------- /winvnc/omnithread/omnithread.vcproj.ACER.rudi.user: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 11 | 35 | 36 | 39 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /winvnc/omnithread/omnithread.vcproj.PIV.rudi.user: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 11 | 35 | 36 | 39 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /winvnc/omnithread/omnithread.vcproj.VIRTUALXP-63912.XPMUser.user: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 11 | 35 | 36 | 39 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /winvnc/omnithread/omnithread.vcproj.rudi-PC.rudi.user: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 11 | 35 | 36 | 39 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /winvnc/omnithread/omnithread.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /winvnc/omnithread/omnithread/nt.h: -------------------------------------------------------------------------------- 1 | // Package : omnithread 2 | // omnithread/nt.h Created : 6/95 tjr 3 | // 4 | // Copyright (C) 1995, 1996, 1997 Olivetti & Oracle Research Laboratory 5 | // 6 | // This file is part of the omnithread library 7 | // 8 | // The omnithread library is free software; you can redistribute it and/or 9 | // modify it under the terms of the GNU Library General Public 10 | // License as published by the Free Software Foundation; either 11 | // version 2 of the License, or (at your option) any later version. 12 | // 13 | // This library is distributed in the hope that it will be useful, 14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | // Library General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU Library General Public 19 | // License along with this library; if not, write to the Free 20 | // Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 21 | // 02111-1307, USA 22 | // 23 | // 24 | // OMNI thread implementation classes for NT threads. 25 | // 26 | 27 | #ifndef __omnithread_nt_h_ 28 | #define __omnithread_nt_h_ 29 | 30 | #include 31 | 32 | #ifndef __BCPLUSPLUS__ 33 | #define OMNI_THREAD_WRAPPER \ 34 | unsigned __stdcall omni_thread_wrapper(LPVOID ptr); 35 | #else 36 | #define OMNI_THREAD_WRAPPER \ 37 | void _USERENTRY omni_thread_wrapper(void *ptr); 38 | #endif 39 | 40 | extern "C" OMNI_THREAD_WRAPPER; 41 | 42 | #define OMNI_MUTEX_IMPLEMENTATION \ 43 | CRITICAL_SECTION crit; 44 | 45 | #define OMNI_CONDITION_IMPLEMENTATION \ 46 | CRITICAL_SECTION crit; \ 47 | omni_thread* waiting_head; \ 48 | omni_thread* waiting_tail; 49 | 50 | #define OMNI_SEMAPHORE_IMPLEMENTATION \ 51 | HANDLE nt_sem; 52 | 53 | #define OMNI_THREAD_IMPLEMENTATION \ 54 | HANDLE handle; \ 55 | DWORD nt_id; \ 56 | void* return_val; \ 57 | HANDLE cond_semaphore; \ 58 | omni_thread* cond_next; \ 59 | omni_thread* cond_prev; \ 60 | BOOL cond_waiting; \ 61 | static int nt_priority(priority_t); \ 62 | friend class omni_condition; \ 63 | friend OMNI_THREAD_WRAPPER; 64 | 65 | #endif 66 | -------------------------------------------------------------------------------- /winvnc/omnithread/threaddata.cpp: -------------------------------------------------------------------------------- 1 | // Package : omnithread 2 | // omnithread/threaddata.cc Created : 10/2000 dpg1 3 | // 4 | // Copyright (C) 2000 AT&T Laboratories Cambridge 5 | // 6 | // This file is part of the omnithread library 7 | // 8 | // The omnithread library is free software; you can redistribute it and/or 9 | // modify it under the terms of the GNU Library General Public 10 | // License as published by the Free Software Foundation; either 11 | // version 2 of the License, or (at your option) any later version. 12 | // 13 | // This library is distributed in the hope that it will be useful, 14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | // Library General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU Library General Public 19 | // License along with this library; if not, write to the Free 20 | // Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 21 | // 02111-1307, USA 22 | // 23 | 24 | // Implementation of per-thread data 25 | 26 | #ifndef INSIDE_THREAD_IMPL_CC 27 | #error "threaddata.cc must be #included by a thread implementation." 28 | #endif 29 | 30 | 31 | static omni_thread::key_t allocated_keys = 0; 32 | 33 | omni_thread::key_t 34 | omni_thread::allocate_key() 35 | { 36 | omni_mutex_lock l(*next_id_mutex); 37 | return ++allocated_keys; 38 | } 39 | 40 | omni_thread::value_t* 41 | omni_thread::set_value(key_t k, value_t* v) 42 | { 43 | if (k == 0) return 0; 44 | if (k > _value_alloc) { 45 | next_id_mutex->lock(); 46 | key_t alloc = allocated_keys; 47 | next_id_mutex->unlock(); 48 | 49 | if (k > alloc) return 0; 50 | 51 | value_t** nv = new value_t*[alloc]; 52 | key_t i = 0; 53 | if (_values) { 54 | for (; i < _value_alloc; i++) 55 | nv[i] = _values[i]; 56 | delete [] _values; 57 | } 58 | for (; i < alloc; i++) 59 | nv[i] = 0; 60 | 61 | _values = nv; 62 | _value_alloc = alloc; 63 | } 64 | if (_values[k-1]) delete _values[k-1]; 65 | _values[k-1] = v; 66 | return v; 67 | } 68 | 69 | omni_thread::value_t* 70 | omni_thread::get_value(key_t k) 71 | { 72 | if (k > _value_alloc) return 0; 73 | return _values[k-1]; 74 | } 75 | 76 | omni_thread::value_t* 77 | omni_thread::remove_value(key_t k) 78 | { 79 | if (k > _value_alloc) return 0; 80 | value_t* v = _values[k-1]; 81 | _values[k-1] = 0; 82 | return v; 83 | } 84 | -------------------------------------------------------------------------------- /winvnc/winvnc.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "Xregion"="..\Xregion\Xregion.dsp" - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Project: "omnithread"=".\omnithread\omnithread.dsp" - Package Owner=<4> 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<4> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | Project: "rdr"="..\rdr\rdr.dsp" - Package Owner=<4> 31 | 32 | Package=<5> 33 | {{{ 34 | }}} 35 | 36 | Package=<4> 37 | {{{ 38 | }}} 39 | 40 | ############################################################################### 41 | 42 | Project: "vnchooks"=".\vnchooks\vnchooks.dsp" - Package Owner=<4> 43 | 44 | Package=<5> 45 | {{{ 46 | }}} 47 | 48 | Package=<4> 49 | {{{ 50 | }}} 51 | 52 | ############################################################################### 53 | 54 | Project: "winvnc"=".\winvnc\winvnc.dsp" - Package Owner=<4> 55 | 56 | Package=<5> 57 | {{{ 58 | }}} 59 | 60 | Package=<4> 61 | {{{ 62 | Begin Project Dependency 63 | Project_Dep_Name pointstat 64 | End Project Dependency 65 | Begin Project Dependency 66 | Project_Dep_Name omnithread 67 | End Project Dependency 68 | Begin Project Dependency 69 | Project_Dep_Name rdr 70 | End Project Dependency 71 | Begin Project Dependency 72 | Project_Dep_Name Xregion 73 | End Project Dependency 74 | Begin Project Dependency 75 | Project_Dep_Name zlib 76 | End Project Dependency 77 | }}} 78 | 79 | ############################################################################### 80 | 81 | Project: "zlib"="..\zlib\zlib.dsp" - Package Owner=<4> 82 | 83 | Package=<5> 84 | {{{ 85 | }}} 86 | 87 | Package=<4> 88 | {{{ 89 | }}} 90 | 91 | ############################################################################### 92 | 93 | Global: 94 | 95 | Package=<5> 96 | {{{ 97 | }}} 98 | 99 | Package=<3> 100 | {{{ 101 | }}} 102 | 103 | ############################################################################### 104 | 105 | -------------------------------------------------------------------------------- /winvnc/winvnc/DeskdupEngine.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "ScreenCapture.h" 3 | #include 4 | 5 | typedef bool(*StartW8Fn)(bool); 6 | typedef bool (*StopW8Fn)(); 7 | 8 | typedef void (*LockW8Fn)(); 9 | typedef void (*UnlockW8Fn)(); 10 | 11 | typedef void (*ShowCursorW8Fn)(); 12 | typedef void (*HideCursorW8Fn)(); 13 | 14 | const static LPCTSTR g_szIPCSharedMMF = _T("{3DA76AC7-62E7-44AF-A8D1-45022044BB3E}"); 15 | const static LPCTSTR g_szIPCSharedMMFBitmap = _T("{0E3D996F-B070-4503-9090-198A9DA092D5}"); 16 | 17 | class DeskDupEngine : public ScreenCapture 18 | { 19 | public: 20 | DeskDupEngine(); 21 | ~DeskDupEngine(); 22 | virtual void videoDriver_start(int x, int y, int w, int h); 23 | virtual void videoDriver_Stop(); 24 | virtual bool hardwareCursor(); 25 | virtual bool noHardwareCursor(); 26 | virtual void Lock(); 27 | virtual void Unlock(); 28 | private: 29 | HMODULE hModule; 30 | StartW8Fn StartW8; 31 | StopW8Fn StopW8; 32 | 33 | LockW8Fn LockW8; 34 | UnlockW8Fn UnlockW8; 35 | 36 | ShowCursorW8Fn ShowCursorW8; 37 | HideCursorW8Fn HideCursorW8; 38 | 39 | HANDLE hFileMap; 40 | LPVOID fileView; 41 | 42 | HANDLE hFileMapBitmap; 43 | LPVOID fileViewBitmap; 44 | }; 45 | 46 | -------------------------------------------------------------------------------- /winvnc/winvnc/HideDesktop.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2002 Ultr@VNC Team Members. All Rights Reserved. 2 | // Copyright (C) 2002 RealVNC Ltd. All Rights Reserved. 3 | // Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved. 4 | // 5 | // This file is part of the VNC system. 6 | // 7 | // The VNC system is free software; you can redistribute it and/or modify 8 | // it under the terms of the GNU General Public License as published by 9 | // the Free Software Foundation; either version 2 of the License, or 10 | // (at your option) any later version. 11 | // 12 | // This program is distributed in the hope that it will be useful, 13 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | // GNU General Public License for more details. 16 | // 17 | // You should have received a copy of the GNU General Public License 18 | // along with this program; if not, write to the Free Software 19 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 20 | // USA. 21 | // 22 | // 23 | // Functions to hide the Windows Desktop 24 | // 25 | // This hides three variants: 26 | // - Desktop Patterns (WIN.INI [Desktop] Pattern=) 27 | // - Desktop Wallpaper (.bmp [and JPEG on Windows XP]) 28 | // - Active Desktop 29 | // 30 | // Written by Ed Hardebeck - Glance Networks, Inc. 31 | // With some code from Paul DiLascia, MSDN Magazine - May 2001 32 | // 33 | 34 | #ifndef _G_HIDEDESKTOP_H_ 35 | #define _G_HIDEDESKTOP_H_ 36 | 37 | // Everything 38 | 39 | void HideDesktop(); // hide it 40 | void RestoreDesktop(); // restore it (warning: uses some global state set by HideDesktop) 41 | 42 | // Just the Active Desktop 43 | 44 | bool HideActiveDesktop(); // returns true if the Active Desktop was enabled and has been hidden 45 | void ShowActiveDesktop(); // show it always (if Shell version >= 4.71) 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /winvnc/winvnc/IPC.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | struct mystruct 4 | { 5 | short counter; 6 | short locked; 7 | RECT rect1[2000]; 8 | RECT rect2[2000]; 9 | short type[2000]; 10 | // ULONG cursor[2000]; 11 | }; 12 | 13 | // Class for Inter Process Communication using Memory Mapped Files 14 | class CIPC 15 | { 16 | public: 17 | CIPC(); 18 | virtual ~CIPC(); 19 | 20 | unsigned char * CreateBitmap(); 21 | void CloseBitmap(); 22 | bool CreateIPCMMF(void); 23 | bool OpenIPCMMF(void); 24 | void CloseIPCMMF(void); 25 | mystruct* listall(); 26 | 27 | bool CreateIPCMMFBitmap(int size); 28 | bool OpenIPCMMFBitmap(void); 29 | void CloseIPCMMFBitmap(void); 30 | 31 | bool IsOpen(void) const {return (m_hFileMap != NULL);} 32 | 33 | bool Lock(void); 34 | void Unlock(void); 35 | 36 | bool LockBitmap(void); 37 | void UnlockBitmap(void); 38 | 39 | void Addrect(int type, int x1, int y1, int x2, int y2,int x11,int y11, int x22,int y22); 40 | void Addcursor(ULONG cursor); 41 | 42 | protected: 43 | HANDLE m_hFileMap; 44 | HANDLE m_hMutex; 45 | LPVOID m_FileView; 46 | 47 | HANDLE m_hFileMapBitmap; 48 | HANDLE m_hMutexBitmap; 49 | LPVOID m_FileViewBitmap; 50 | 51 | mystruct list; 52 | mystruct *plist; 53 | unsigned char *pBitmap; 54 | }; 55 | -------------------------------------------------------------------------------- /winvnc/winvnc/ScreenCapture.cpp: -------------------------------------------------------------------------------- 1 | #include "ScreenCapture.h" 2 | 3 | //just make it run with SDK 8.1 4 | #ifndef _WIN32_WINNT_WINTHRESHOLD 5 | #define _WIN32_WINNT_WINTHRESHOLD 0x0A00 6 | VERSIONHELPERAPI 7 | IsWindows10OrGreater() 8 | { 9 | return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WINTHRESHOLD), LOBYTE(_WIN32_WINNT_WINTHRESHOLD), 0); 10 | } 11 | #endif 12 | 13 | //---------------------------------------------------------- 14 | ScreenCapture::ScreenCapture() 15 | { 16 | int a = 0; 17 | } 18 | //---------------------------------------------------------- 19 | int ScreenCapture::osVersion() 20 | { 21 | int version = OSOLD; 22 | if (IsWindowsXPSP3OrGreater()) 23 | version = OSWINXP; 24 | if (IsWindowsVistaOrGreater()) 25 | version = OSVISTA; 26 | if (IsWindows8OrGreater()) 27 | version = OSWIN10; 28 | return version; 29 | } 30 | -------------------------------------------------------------------------------- /winvnc/winvnc/ScreenCapture.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include "VersionHelpers.h" 5 | 6 | #define MAXCHANGES_BUF 2000 7 | #define OSWIN10 10 8 | #define OSVISTA 6 9 | #define OSWINXP 5 10 | #define OSOLD 4 11 | 12 | #define SCREEN_SCREEN 11 13 | #define BLIT 12 14 | #define SOLIDFILL 13 15 | #define BLEND 14 16 | #define TRANS 15 17 | #define PLG 17 18 | #define TEXTOUT 18 19 | #define POINTERCHANGE 19 20 | 21 | #ifndef _WIN32_WINNT_WINTHRESHOLD 22 | VERSIONHELPERAPI IsWindows10OrGreater(); 23 | #endif 24 | 25 | typedef struct _CHANGES_RECORD 26 | { 27 | ULONG type; //screen_to_screen, blit, newcache,oldcache 28 | RECT rect; 29 | POINT point; 30 | }CHANGES_RECORD; 31 | typedef CHANGES_RECORD *PCHANGES_RECORD; 32 | typedef struct _CHANGES_BUF 33 | { 34 | ULONG counter; 35 | CHANGES_RECORD pointrect[MAXCHANGES_BUF]; 36 | }CHANGES_BUF; 37 | typedef CHANGES_BUF *PCHANGES_BUF; 38 | 39 | 40 | class ScreenCapture 41 | { 42 | public: 43 | ScreenCapture(); 44 | virtual ~ScreenCapture() { ; } 45 | PCHAR getFramebuffer() { return pFramebuffer; } 46 | PCHANGES_BUF getChangeBuffer() { return pChangebuf; } 47 | int getPreviousCounter() { return oldAantal; } 48 | void setPreviousCounter(int oldAantal) { this->oldAantal = oldAantal; } 49 | void setBlocked(bool blocked) { this->blocked = blocked; } 50 | bool getBlocked() { return blocked; } 51 | 52 | virtual void videoDriver_start(int x, int y, int w, int h) = 0; 53 | virtual void videoDriver_Stop() = 0; 54 | virtual bool hardwareCursor() = 0; 55 | virtual bool noHardwareCursor() = 0; 56 | virtual void Lock() = 0; 57 | virtual void Unlock() = 0; 58 | 59 | protected: 60 | int osVersion(); 61 | int osVer; 62 | PCHAR pSharedMemory; 63 | PCHAR pFramebuffer; 64 | PCHANGES_BUF pChangebuf; 65 | ULONG oldAantal; 66 | bool blocked; 67 | bool init; 68 | }; 69 | 70 | -------------------------------------------------------------------------------- /winvnc/winvnc/TextChat.h: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////////////////////// 2 | // Copyright (C) 2002 Ultr@VNC Team Members. All Rights Reserved. 3 | // 4 | // This program is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License 15 | // along with this program; if not, write to the Free Software 16 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 17 | // USA. 18 | // 19 | // If the source code for the program is not available from the place from 20 | // which you received this file, check 21 | // http://ultravnc.sourceforge.net/ 22 | 23 | 24 | #ifndef TEXTCHAT_H__ 25 | #define TEXTCHAT_H__ 26 | #pragma once 27 | 28 | #define BLACK 0x00000000 29 | #define RED 0x000000FF 30 | #define GREEN 0x0000FF00 31 | #define BLUE 0x00FF0000 32 | #define GREY 0x00888888 33 | 34 | class vncClient; 35 | 36 | class TextChat 37 | { 38 | public: 39 | // Props 40 | vncClient *m_pCC; 41 | HWND m_hWnd; 42 | HWND m_hDlg; 43 | bool m_fTextChatRunning; 44 | char* m_szLocalText; 45 | char* m_szLastLocalText; 46 | char* m_szRemoteText; 47 | char* m_szRemoteName; 48 | char* m_szLocalName; 49 | char* m_szTextBoxBuffer; 50 | HMODULE m_hRichEdit; 51 | bool m_fPersistentTexts; 52 | // char m_szUserID[16]; 53 | 54 | // Methods 55 | TextChat(vncClient *pCC); 56 | int DoDialog(); 57 | HWND DisplayTextChat(); 58 | void KillDialog(); 59 | void OrderTextChat(); 60 | void RefuseTextChat(); 61 | void ProcessTextChatMsg(int nTO); 62 | virtual ~TextChat(); 63 | static LRESULT CALLBACK DoDialogThread(LPVOID lpParameter); 64 | static BOOL CALLBACK TextChatDlgProc(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lParam); 65 | void SendTextChatRequest(int Msg); 66 | void SendLocalText(void); 67 | void PrintMessage(const char* szMessage, const char* szSender, DWORD color = BLACK); 68 | void SetTextFormat(bool bBold = false, bool bItalic = false, long nSize = 0x75, const char* szFaceName = "MS Sans Serif", DWORD dwColor = BLACK); 69 | void TextChat::ShowChatWindow(bool fVisible); 70 | }; 71 | 72 | #endif 73 | 74 | 75 | 76 | -------------------------------------------------------------------------------- /winvnc/winvnc/Timer.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2002 Ultr@VNC Team Members. All Rights Reserved. 2 | // Copyright (C) 2000-2002 Const Kaplinsky. All Rights Reserved. 3 | // Copyright (C) 2002 RealVNC Ltd. All Rights Reserved. 4 | // Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved. 5 | // 6 | // This file is part of the VNC system. 7 | // 8 | // The VNC system is free software; you can redistribute it and/or modify 9 | // it under the terms of the GNU General Public License as published by 10 | // the Free Software Foundation; either version 2 of the License, or 11 | // (at your option) any later version. 12 | // 13 | // This program is distributed in the hope that it will be useful, 14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | // GNU General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU General Public License 19 | // along with this program; if not, write to the Free Software 20 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 21 | // USA. 22 | // 23 | // If the source code for the VNC system is not available from the place 24 | // whence you received this file, check http://www.uk.research.att.com/vnc or contact 25 | // the authors on vnc@uk.research.att.com for information on obtaining it. 26 | // Class was copied from another project...but can find it back 27 | // If someone find it please message me to add it.. 28 | 29 | #include "Timer.h" 30 | Timer :: Timer() 31 | { 32 | total = 0.0; 33 | endT.tv_sec = startT.tv_sec = 0; 34 | endT.tv_usec = startT.tv_usec = 0; 35 | tScale = 1.0 / CLOCKS_PER_SEC; 36 | start(); 37 | stop(); 38 | reset(); 39 | } -------------------------------------------------------------------------------- /winvnc/winvnc/Timer.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2002 Ultr@VNC Team Members. All Rights Reserved. 2 | // Copyright (C) 2000-2002 Const Kaplinsky. All Rights Reserved. 3 | // Copyright (C) 2002 RealVNC Ltd. All Rights Reserved. 4 | // Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved. 5 | // 6 | // This file is part of the VNC system. 7 | // 8 | // The VNC system is free software; you can redistribute it and/or modify 9 | // it under the terms of the GNU General Public License as published by 10 | // the Free Software Foundation; either version 2 of the License, or 11 | // (at your option) any later version. 12 | // 13 | // This program is distributed in the hope that it will be useful, 14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | // GNU General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU General Public License 19 | // along with this program; if not, write to the Free Software 20 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 21 | // USA. 22 | // 23 | // If the source code for the VNC system is not available from the place 24 | // whence you received this file, check http://www.uk.research.att.com/vnc or contact 25 | // the authors on vnc@uk.research.att.com for information on obtaining it. 26 | // Class was copied from another project...but can find it back 27 | // If someone find it please message me to add it.. 28 | 29 | #ifndef _TIMER_H 30 | 31 | #include 32 | #include 33 | #include 34 | 35 | inline void gettimeofday( struct timeval *t, void* ) 36 | { 37 | t->tv_sec = 0; 38 | t->tv_usec = clock(); 39 | } 40 | 41 | 42 | class Timer 43 | { 44 | 45 | public: 46 | 47 | Timer(); 48 | virtual ~Timer(){}; 49 | 50 | inline double frame() 51 | { 52 | if( !stopped ) 53 | gettimeofday( &endT, 0 ); 54 | else 55 | { 56 | frameT.tv_sec = endT.tv_sec; 57 | frameT.tv_usec = endT.tv_usec; 58 | } 59 | 60 | secs = endT.tv_sec - frameT.tv_sec; 61 | usecs = endT.tv_usec - frameT.tv_usec; 62 | 63 | frameT.tv_sec = endT.tv_sec; 64 | frameT.tv_usec = endT.tv_usec; 65 | 66 | return( secs + ( usecs * tScale ) ); 67 | } 68 | 69 | //! Reset the timer to \b newVal. 70 | inline void reset( float newVal = 0.0f ) 71 | { 72 | total = newVal; 73 | if( !stopped ) 74 | gettimeofday( &startT, 0 ); 75 | } 76 | 77 | //! Read the current elapsed time (in seconds). 78 | inline double read() 79 | { 80 | if( !stopped ) 81 | gettimeofday( &endT, 0 ); 82 | else 83 | { 84 | endT.tv_sec = startT.tv_sec; 85 | endT.tv_usec = startT.tv_usec; 86 | } 87 | 88 | secs = endT.tv_sec - startT.tv_sec; 89 | usecs = endT.tv_usec - startT.tv_usec; 90 | return( secs + ( usecs * tScale ) + total ); 91 | } 92 | 93 | //! Start the timer. 94 | inline void start() 95 | { 96 | stopped = false; 97 | gettimeofday( &startT, 0 ); 98 | frameT.tv_sec = startT.tv_sec; 99 | frameT.tv_usec = startT.tv_usec; 100 | } 101 | 102 | //! Stop the timer. 103 | inline void stop() 104 | { 105 | gettimeofday( &endT, 0 ); 106 | secs = endT.tv_sec - startT.tv_sec; 107 | usecs = endT.tv_usec - startT.tv_usec; 108 | total += ( secs + ( usecs * tScale) ); 109 | frameT.tv_sec = endT.tv_sec; 110 | frameT.tv_usec = endT.tv_usec; 111 | stopped = true; 112 | } 113 | 114 | private: 115 | 116 | timeval endT, frameT, startT; 117 | double secs, usecs, tScale, total; 118 | bool stopped; 119 | 120 | }; /* end class Timer */ 121 | 122 | #define _TIMER_H 123 | #endif 124 | -------------------------------------------------------------------------------- /winvnc/winvnc/WINVNC.DSW: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "winvnc"=".\WINVNC.DSP" - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Global: 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<3> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | -------------------------------------------------------------------------------- /winvnc/winvnc/buildtime.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2002 RealVNC Ltd. All Rights Reserved. 2 | // 3 | // This program is free software; you can redistribute it and/or modify 4 | // it under the terms of the GNU General Public License as published by 5 | // the Free Software Foundation; either version 2 of the License, or 6 | // (at your option) any later version. 7 | // 8 | // This program is distributed in the hope that it will be useful, 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | // GNU General Public License for more details. 12 | // 13 | // You should have received a copy of the GNU General Public License 14 | // along with this program; if not, write to the Free Software 15 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 16 | // USA. 17 | // 18 | // If the source code for the program is not available from the place from 19 | // which you received this file, check http://www.realvnc.com/ or contact 20 | // the authors on info@realvnc.com for information on obtaining it. 21 | #define WIN32_LEAN_AND_MEAN 22 | #include "../../AggressiveOptimize.h" 23 | char buildtime[] = __DATE__ " " __TIME__; 24 | -------------------------------------------------------------------------------- /winvnc/winvnc/d3des.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This is D3DES (V5.09) by Richard Outerbridge with the double and 3 | * triple-length support removed for use in VNC. 4 | * 5 | * These changes are 6 | * Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved. 7 | * 8 | * This software is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 11 | */ 12 | 13 | /* d3des.h - 14 | * 15 | * Headers and defines for d3des.c 16 | * Graven Imagery, 1992. 17 | * 18 | * Copyright (c) 1988,1989,1990,1991,1992 by Richard Outerbridge 19 | * (GEnie : OUTER; CIS : [71755,204]) 20 | */ 21 | 22 | #define EN0 0 /* MODE == encrypt */ 23 | #define DE1 1 /* MODE == decrypt */ 24 | 25 | extern void deskey(unsigned char *, int); 26 | /* hexkey[8] MODE 27 | * Sets the internal key register according to the hexadecimal 28 | * key contained in the 8 bytes of hexkey, according to the DES, 29 | * for encryption or decryption according to MODE. 30 | */ 31 | 32 | extern void usekey(unsigned long *); 33 | /* cookedkey[32] 34 | * Loads the internal key register with the data in cookedkey. 35 | */ 36 | 37 | extern void cpkey(unsigned long *); 38 | /* cookedkey[32] 39 | * Copies the contents of the internal key register into the storage 40 | * located at &cookedkey[0]. 41 | */ 42 | 43 | extern void des(unsigned char *, unsigned char *); 44 | /* from[8] to[8] 45 | * Encrypts/Decrypts (according to the key currently loaded in the 46 | * internal key register) one block of eight bytes at address 'from' 47 | * into the block at address 'to'. They can be the same. 48 | */ 49 | 50 | /* d3des.h V5.09 rwo 9208.04 15:06 Graven Imagery 51 | ********************************************************************/ 52 | -------------------------------------------------------------------------------- /winvnc/winvnc/dpi.h: -------------------------------------------------------------------------------- 1 | #include 2 | #ifndef DPI_H__ 3 | #define DPI_H__ 4 | 5 | class CDPI 6 | { 7 | public: 8 | CDPI() : _fInitialized(false), _dpiX(96), _dpiY(96) { } 9 | 10 | // Get screen DPI. 11 | int GetDPIX() { _Init(); return _dpiX; } 12 | int GetDPIY() { _Init(); return _dpiY; } 13 | 14 | // Convert between raw pixels and relative pixels. 15 | int ScaleX(int x) { _Init(); return MulDiv(x, _dpiX, 96); } 16 | int ScaleY(int y) { _Init(); return MulDiv(y, _dpiY, 96); } 17 | int UnscaleX(int x) { _Init(); return MulDiv(x, 96, _dpiX); } 18 | int UnscaleY(int y) { _Init(); return MulDiv(y, 96, _dpiY); } 19 | 20 | // Determine the screen dimensions in relative pixels. 21 | int ScaledScreenWidth() { return _ScaledSystemMetricX(SM_CXSCREEN); } 22 | int ScaledScreenHeight() { return _ScaledSystemMetricY(SM_CYSCREEN); } 23 | int ScaledScreenVirtualWidth() { return _ScaledSystemMetricX(SM_CXVIRTUALSCREEN); } 24 | int ScaledScreenVirtualHeight() { return _ScaledSystemMetricY(SM_CYVIRTUALSCREEN); } 25 | int ScaledScreenVirtualX() { return _ScaledSystemMetricX(SM_XVIRTUALSCREEN); } 26 | int ScaledScreenVirtualY() { return _ScaledSystemMetricY(SM_YVIRTUALSCREEN); } 27 | 28 | // Scale rectangle from raw pixels to relative pixels. 29 | void ScaleRect(RECT *pRect) 30 | { 31 | pRect->left = ScaleX(pRect->left); 32 | pRect->right = ScaleX(pRect->right); 33 | pRect->top = ScaleY(pRect->top); 34 | pRect->bottom = ScaleY(pRect->bottom); 35 | } 36 | // Determine if screen resolution meets minimum requirements in relative 37 | // pixels. 38 | bool IsResolutionAtLeast(int cxMin, int cyMin) 39 | { 40 | return (ScaledScreenWidth() >= cxMin) && (ScaledScreenHeight() >= cyMin); 41 | } 42 | 43 | // Convert a point size (1/72 of an inch) to raw pixels. 44 | int PointsToPixels(int pt) { return MulDiv(pt, _dpiY, 72); } 45 | 46 | // Invalidate any cached metrics. 47 | void Invalidate() { _fInitialized = false; } 48 | 49 | private: 50 | void _Init() 51 | { 52 | if (!_fInitialized) 53 | { 54 | HDC hdc = GetDC(NULL); 55 | if (hdc) 56 | { 57 | RECT rect; 58 | GetClipBox(hdc,&rect); 59 | int dpiwidth=GetSystemMetrics(SM_CXVIRTUALSCREEN); 60 | int dpiheight=GetSystemMetrics(SM_CYVIRTUALSCREEN); 61 | int fullwidth=rect.right-rect.left; 62 | int fullheight=rect.bottom-rect.top; 63 | // Seeme GetDC can return NULL, in that case fullwidth=0 and devide by 0 64 | if (fullwidth==0) fullwidth=dpiwidth; 65 | if (fullheight==0) fullheight=dpiheight; 66 | 67 | _dpiX = dpiwidth*96/fullwidth;//GetDeviceCaps(hdc, LOGPIXELSX); 68 | _dpiY = dpiheight*96/fullheight;//GetDeviceCaps(hdc, LOGPIXELSY); 69 | ReleaseDC(NULL, hdc); 70 | } 71 | _fInitialized = true; 72 | } 73 | } 74 | 75 | int _ScaledSystemMetricX(int nIndex) 76 | { 77 | _Init(); 78 | return MulDiv(GetSystemMetrics(nIndex), 96, _dpiX); 79 | } 80 | 81 | int _ScaledSystemMetricY(int nIndex) 82 | { 83 | _Init(); 84 | return MulDiv(GetSystemMetrics(nIndex), 96, _dpiY); 85 | } 86 | private: 87 | bool _fInitialized; 88 | 89 | int _dpiX; 90 | int _dpiY; 91 | }; 92 | #endif -------------------------------------------------------------------------------- /winvnc/winvnc/minmax.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved. 2 | // 3 | // This file is part of the VNC system. 4 | // 5 | // The VNC system is free software; you can redistribute it and/or modify 6 | // it under the terms of the GNU General Public License as published by 7 | // the Free Software Foundation; either version 2 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU General Public License 16 | // along with this program; if not, write to the Free Software 17 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 18 | // USA. 19 | // 20 | // If the source code for the VNC system is not available from the place 21 | // whence you received this file, check http://www.uk.research.att.com/vnc or contact 22 | // the authors on vnc@uk.research.att.com for information on obtaining it. 23 | 24 | 25 | // Routines to calculate the maximum and minimum of two integers 26 | 27 | #if !defined(MINMAX_INCLUDED) 28 | #define MINMAX_INCLUDED 29 | #pragma once 30 | 31 | // Some routines used internally to minimise and maximise integers 32 | static inline int Max(int x, int y) 33 | { 34 | if (x>y) 35 | return x; 36 | else 37 | return y; 38 | } 39 | 40 | static inline int Min(int x, int y) 41 | { 42 | if (x>y) 43 | return y; 44 | else 45 | return x; 46 | } 47 | 48 | #endif -------------------------------------------------------------------------------- /winvnc/winvnc/res/Image1.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ultravnc/SC/386d3a42ccbb1d5f531cde896195ee4531288610/winvnc/winvnc/res/Image1.bmp -------------------------------------------------------------------------------- /winvnc/winvnc/res/Image10.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ultravnc/SC/386d3a42ccbb1d5f531cde896195ee4531288610/winvnc/winvnc/res/Image10.bmp -------------------------------------------------------------------------------- /winvnc/winvnc/res/Image11.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ultravnc/SC/386d3a42ccbb1d5f531cde896195ee4531288610/winvnc/winvnc/res/Image11.bmp -------------------------------------------------------------------------------- /winvnc/winvnc/res/Image12.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ultravnc/SC/386d3a42ccbb1d5f531cde896195ee4531288610/winvnc/winvnc/res/Image12.bmp -------------------------------------------------------------------------------- /winvnc/winvnc/res/Image2.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ultravnc/SC/386d3a42ccbb1d5f531cde896195ee4531288610/winvnc/winvnc/res/Image2.bmp -------------------------------------------------------------------------------- /winvnc/winvnc/res/Image3.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ultravnc/SC/386d3a42ccbb1d5f531cde896195ee4531288610/winvnc/winvnc/res/Image3.bmp -------------------------------------------------------------------------------- /winvnc/winvnc/res/Image4.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ultravnc/SC/386d3a42ccbb1d5f531cde896195ee4531288610/winvnc/winvnc/res/Image4.bmp -------------------------------------------------------------------------------- /winvnc/winvnc/res/Image5.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ultravnc/SC/386d3a42ccbb1d5f531cde896195ee4531288610/winvnc/winvnc/res/Image5.bmp -------------------------------------------------------------------------------- /winvnc/winvnc/res/Image6.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ultravnc/SC/386d3a42ccbb1d5f531cde896195ee4531288610/winvnc/winvnc/res/Image6.bmp -------------------------------------------------------------------------------- /winvnc/winvnc/res/Image7.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ultravnc/SC/386d3a42ccbb1d5f531cde896195ee4531288610/winvnc/winvnc/res/Image7.bmp -------------------------------------------------------------------------------- /winvnc/winvnc/res/Image9.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ultravnc/SC/386d3a42ccbb1d5f531cde896195ee4531288610/winvnc/winvnc/res/Image9.bmp -------------------------------------------------------------------------------- /winvnc/winvnc/res/Thumbs.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ultravnc/SC/386d3a42ccbb1d5f531cde896195ee4531288610/winvnc/winvnc/res/Thumbs.db -------------------------------------------------------------------------------- /winvnc/winvnc/res/icon1.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ultravnc/SC/386d3a42ccbb1d5f531cde896195ee4531288610/winvnc/winvnc/res/icon1.ico -------------------------------------------------------------------------------- /winvnc/winvnc/res/icon11.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ultravnc/SC/386d3a42ccbb1d5f531cde896195ee4531288610/winvnc/winvnc/res/icon11.ico -------------------------------------------------------------------------------- /winvnc/winvnc/res/icon2.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ultravnc/SC/386d3a42ccbb1d5f531cde896195ee4531288610/winvnc/winvnc/res/icon2.ico -------------------------------------------------------------------------------- /winvnc/winvnc/res/icon22.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ultravnc/SC/386d3a42ccbb1d5f531cde896195ee4531288610/winvnc/winvnc/res/icon22.ico -------------------------------------------------------------------------------- /winvnc/winvnc/res/vnc-1.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ultravnc/SC/386d3a42ccbb1d5f531cde896195ee4531288610/winvnc/winvnc/res/vnc-1.bmp -------------------------------------------------------------------------------- /winvnc/winvnc/rfb.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2002 RealVNC Ltd. All Rights Reserved. 2 | // Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved. 3 | // 4 | // This file is part of the VNC system. 5 | // 6 | // The VNC system is free software; you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation; either version 2 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // This program is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with this program; if not, write to the Free Software 18 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 19 | // USA. 20 | // 21 | // If the source code for the VNC system is not available from the place 22 | // whence you received this file, check http://www.uk.research.att.com/vnc or contact 23 | // the authors on vnc@uk.research.att.com for information on obtaining it. 24 | 25 | 26 | // rfb.h 27 | // This includes the rfb spec header, the port numbers, 28 | // the CARD type definitions and various useful macros. 29 | // 30 | 31 | #ifndef RFB_H__ 32 | #define RFB_H__ 33 | 34 | // Define the CARD* types as used in X11/Xmd.h 35 | 36 | typedef unsigned long CARD32; 37 | typedef unsigned short CARD16; 38 | typedef short INT16; 39 | typedef unsigned char CARD8; 40 | 41 | // Define the port number offsets 42 | #define FLASH_PORT_OFFSET 5400 43 | #define INCOMING_PORT_OFFSET 5500 44 | #define HTTP_PORT_OFFSET 5800 // we don't use this in Venice 45 | #define RFB_PORT_OFFSET 5900 46 | 47 | #define PORT_TO_DISPLAY(p) ( (p) - RFB_PORT_OFFSET ) 48 | #define HPORT_TO_DISPLAY(p) ( (p) - HTTP_PORT_OFFSET ) 49 | #define DISPLAY_TO_PORT(d) ( (d) + RFB_PORT_OFFSET ) 50 | #define DISPLAY_TO_HPORT(d) ( (d) + HTTP_PORT_OFFSET ) 51 | 52 | // include the protocol spec 53 | #include 54 | 55 | // define some quick endian conversions 56 | // change this if necessary 57 | #define LITTLE_ENDIAN_HOST 58 | 59 | #ifdef LITTLE_ENDIAN_HOST 60 | 61 | #define Swap16IfLE(s) \ 62 | ((CARD16) ((((s) & 0xff) << 8) | (((s) >> 8) & 0xff))) 63 | #define Swap32IfLE(l) \ 64 | ((CARD32) ((((l) & 0xff000000) >> 24) | \ 65 | (((l) & 0x00ff0000) >> 8) | \ 66 | (((l) & 0x0000ff00) << 8) | \ 67 | (((l) & 0x000000ff) << 24))) 68 | 69 | #else 70 | 71 | #define Swap16IfLE(s) (s) 72 | #define Swap32IfLE(l) (l) 73 | 74 | #endif 75 | 76 | // unconditional swaps 77 | #define Swap16(s) \ 78 | ((CARD16) ((((s) & 0xff) << 8) | (((s) >> 8) & 0xff))) 79 | #define Swap32(l) \ 80 | ((CARD32) ((((l) & 0xff000000) >> 24) | \ 81 | (((l) & 0x00ff0000) >> 8) | \ 82 | (((l) & 0x0000ff00) << 8) | \ 83 | (((l) & 0x000000ff) << 24))) 84 | 85 | 86 | #endif 87 | -------------------------------------------------------------------------------- /winvnc/winvnc/rfbRegion.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2002-2003 RealVNC Ltd. All Rights Reserved. 2 | // 3 | // This program is free software; you can redistribute it and/or modify 4 | // it under the terms of the GNU General Public License as published by 5 | // the Free Software Foundation; either version 2 of the License, or 6 | // (at your option) any later version. 7 | // 8 | // This program is distributed in the hope that it will be useful, 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | // GNU General Public License for more details. 12 | // 13 | // You should have received a copy of the GNU General Public License 14 | // along with this program; if not, write to the Free Software 15 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 16 | // USA. 17 | // 18 | // If the source code for the program is not available from the place from 19 | // which you received this file, check http://www.realvnc.com/ or contact 20 | // the authors on info@realvnc.com for information on obtaining it. 21 | #include "rfbRegion_win32.h" -------------------------------------------------------------------------------- /winvnc/winvnc/rfbRegion_win32.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2002-2003 RealVNC Ltd. All Rights Reserved. 2 | // 3 | // This program is free software; you can redistribute it and/or modify 4 | // it under the terms of the GNU General Public License as published by 5 | // the Free Software Foundation; either version 2 of the License, or 6 | // (at your option) any later version. 7 | // 8 | // This program is distributed in the hope that it will be useful, 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | // GNU General Public License for more details. 12 | // 13 | // You should have received a copy of the GNU General Public License 14 | // along with this program; if not, write to the Free Software 15 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 16 | // USA. 17 | // 18 | // If the source code for the program is not available from the place from 19 | // which you received this file, check http://www.realvnc.com/ or contact 20 | // the authors on info@realvnc.com for information on obtaining it. 21 | 22 | // rfb::Region2D class for Win32 23 | 24 | #ifndef __RFB_REGION_WIN32_INCLUDED__ 25 | #define __RFB_REGION_WIN32_INCLUDED__ 26 | 27 | #include "rfbRect.h" 28 | #include 29 | 30 | namespace rfb { 31 | 32 | // rfb::Region2D 33 | // 34 | // See the rfbRegion.h header for documentation. 35 | 36 | class Region { 37 | public: 38 | // Create an empty region 39 | Region(); 40 | // Create a rectangular region 41 | Region(int x1, int y1, int x2, int y2); 42 | Region(const Rect& r); 43 | 44 | Region(const Region& r); 45 | Region &operator=(const Region& src); 46 | bool IsPtInRegion(int x, int y); 47 | 48 | ~Region(); 49 | 50 | // the following methods alter the region in place: 51 | 52 | void clear(); 53 | void reset(const Rect& r); 54 | void translate(const rfb::Point& delta); 55 | void setOrderedRects(const std::vector& rects); 56 | 57 | void name(const char *n) 58 | { 59 | free(m_name); 60 | m_name = _strdup(n); 61 | } 62 | 63 | void assign_intersect(const Region& r); 64 | void assign_union(const Region& r); 65 | void assign_subtract(const Region& r); 66 | 67 | // the following three operations return a new region: 68 | 69 | Region intersect(const Region& r) const; 70 | Region union_(const Region& r) const; 71 | Region subtract(const Region& r) const; 72 | 73 | bool equals(const Region& b) const; 74 | bool is_empty() const; 75 | 76 | bool get_rects(std::vector& rects, bool left2right=true, 77 | bool topdown=true) const; 78 | Rect get_bounding_rect() const; 79 | int Numrects(); 80 | 81 | void debug_print(const char *prefix) const; 82 | 83 | protected: 84 | HRGN rgn; 85 | char *m_name; 86 | }; 87 | typedef Region Region2D; 88 | 89 | }; 90 | 91 | #endif /* __RFB_REGION_WIN32_INCLUDED__ */ 92 | 93 | 94 | -------------------------------------------------------------------------------- /winvnc/winvnc/stdhdrs.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2002 RealVNC Ltd. All Rights Reserved. 2 | // Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved. 3 | // 4 | // This file is part of the VNC system. 5 | // 6 | // The VNC system is free software; you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation; either version 2 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // This program is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with this program; if not, write to the Free Software 18 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 19 | // USA. 20 | // 21 | // If the source code for the VNC system is not available from the place 22 | // whence you received this file, check http://www.uk.research.att.com/vnc or contact 23 | // the authors on vnc@uk.research.att.com for information on obtaining it. 24 | 25 | #include "stdhdrs.h" 26 | 27 | // Create the main log object 28 | VNCLog vnclog; -------------------------------------------------------------------------------- /winvnc/winvnc/stdhdrs.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2002 RealVNC Ltd. All Rights Reserved. 2 | // Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved. 3 | // 4 | // This file is part of the VNC system. 5 | // 6 | // The VNC system is free software; you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation; either version 2 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // This program is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with this program; if not, write to the Free Software 18 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 19 | // USA. 20 | // 21 | // If the source code for the VNC system is not available from the place 22 | // whence you received this file, check http://www.uk.research.att.com/vnc or contact 23 | // the authors on vnc@uk.research.att.com for information on obtaining it. 24 | 25 | #define WIN32_LEAN_AND_MEAN 26 | #define STRICT 27 | 28 | #include 29 | #include 30 | #include 31 | 32 | #include 33 | #include 34 | #include 35 | #include 36 | 37 | // LOGGING SUPPORT 38 | void *memcpy_amd(void *dest, const void *src, size_t n); 39 | #define MAXPATH 256 40 | 41 | #include "VNCLog.h" 42 | extern VNCLog vnclog; 43 | 44 | // No logging at all 45 | #define LL_NONE 0 46 | // Log server startup/shutdown 47 | #define LL_STATE 0 48 | // Log connect/disconnect 49 | #define LL_CLIENTS 1 50 | // Log connection errors (wrong pixfmt, etc) 51 | #define LL_CONNERR 0 52 | // Log socket errors 53 | #define LL_SOCKERR 4 54 | // Log internal errors 55 | #define LL_INTERR 0 56 | 57 | // Log internal warnings 58 | #define LL_INTWARN 8 59 | // Log internal info 60 | #define LL_INTINFO 9 61 | // Log socket errors 62 | #define LL_SOCKINFO 10 63 | // Log everything, including internal table setup, etc. 64 | #define LL_ALL 10 65 | 66 | // Macros for sticking in the current file name 67 | #define VNCLOG(s) (__FILE__ " : " s) 68 | 69 | 70 | //#define memcpy memcpy_amd 71 | //remove comment to compiler for >=athhlon or >=PIII -------------------------------------------------------------------------------- /winvnc/winvnc/tableinitcmtemplate.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * tableinitcmtemplate.c - template for initialising lookup tables for 3 | * translation from a colour map to true colour. 4 | * 5 | * This file shouldn't be compiled. It is included multiple times by 6 | * translate.c, each time with a different definition of the macro OUT. 7 | * For each value of OUT, this file defines a function which allocates an 8 | * appropriately sized lookup table and initialises it. 9 | * 10 | * I know this code isn't nice to read because of all the macros, but 11 | * efficiency is important here. 12 | */ 13 | 14 | #if !defined(OUTVNC) 15 | #error "This file shouldn't be compiled." 16 | #error "It is included as part of translate.c" 17 | #endif 18 | 19 | #define OUT_T CONCAT2E(CARD,OUTVNC) 20 | #define SwapOUTVNC(x) CONCAT2E(Swap,OUTVNC) (x) 21 | #define rfbInitColourMapSingleTableOUTVNC \ 22 | CONCAT2E(rfbInitColourMapSingleTable,OUTVNC) 23 | 24 | // THIS CODE HAS BEEN MODIFIED FROM THE ORIGINAL UNIX SOURCE 25 | // TO WORK FOR WINVNC. THE PALETTE SHOULD REALLY BE RETRIEVED 26 | // FROM THE VNCDESKTOP OBJECT, RATHER THAN FROM THE OS DIRECTLY 27 | 28 | static void 29 | rfbInitColourMapSingleTableOUTVNC (char **table, 30 | rfbPixelFormat *in, 31 | rfbPixelFormat *out) 32 | { 33 | vnclog.Print(LL_ALL, VNCLOG("rfbInitColourMapSingleTable called\n")); 34 | 35 | // ALLOCATE SPACE FOR COLOUR TABLE 36 | 37 | int nEntries = 1 << in->bitsPerPixel; 38 | 39 | // Allocate the table 40 | if (*table) free(*table); 41 | *table = (char *)malloc(nEntries * sizeof(OUT_T)); 42 | if (*table == NULL) 43 | { 44 | vnclog.Print(LL_INTERR, VNCLOG("failed to allocate translation table\n")); 45 | return; 46 | } 47 | 48 | // Obtain the system palette 49 | HDC hDC = GetDcMirror(); 50 | if (hDC==NULL) vnclog.Print(LL_ALL, VNCLOG("Using video Palette\n")); 51 | else vnclog.Print(LL_ALL, VNCLOG("Using mirror video Palette\n")); 52 | if (hDC==NULL) hDC = GetDC(NULL); 53 | PALETTEENTRY palette[256]; 54 | UINT entries = ::GetSystemPaletteEntries(hDC, 0, 256, palette); 55 | vnclog.Print(LL_INTINFO, VNCLOG("got %u palette entries\n"), GetLastError()); 56 | ReleaseDC(NULL, hDC); 57 | 58 | // - Set the rest of the palette to something nasty but usable 59 | unsigned int i; 60 | for (i=entries;i<256;i++) { 61 | palette[i].peRed = i % 2 ? 255 : 0; 62 | palette[i].peGreen = i/2 % 2 ? 255 : 0; 63 | palette[i].peBlue = i/4 % 2 ? 255 : 0; 64 | } 65 | 66 | // COLOUR TRANSLATION 67 | 68 | // We now have the colour table intact. Map it into a translation table 69 | int r, g, b; 70 | OUT_T *t = (OUT_T *)*table; 71 | 72 | for (i = 0; i < nEntries; i++) 73 | { 74 | // Split down the RGB data 75 | r = palette[i].peRed; 76 | g = palette[i].peGreen; 77 | b = palette[i].peBlue; 78 | 79 | // Now translate it 80 | t[i] = ((((r * out->redMax + 127) / 255) << out->redShift) | 81 | (((g * out->greenMax + 127) / 255) << out->greenShift) | 82 | (((b * out->blueMax + 127) / 255) << out->blueShift)); 83 | #if (OUTVNC != 8) 84 | if (out->bigEndian != in->bigEndian) 85 | { 86 | t[i] = SwapOUTVNC(t[i]); 87 | } 88 | #endif 89 | } 90 | 91 | vnclog.Print(LL_ALL, VNCLOG("rfbInitColourMapSingleTable done\n")); 92 | } 93 | 94 | #undef OUT_T 95 | #undef SwapOUT 96 | #undef rfbInitColourMapSingleTableOUTVNC 97 | -------------------------------------------------------------------------------- /winvnc/winvnc/tabletranstemplate.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * tabletranstemplate.c - template for translation using lookup tables. 3 | * 4 | * This file shouldn't be compiled. It is included multiple times by 5 | * translate.c, each time with different definitions of the macros IN and OUT. 6 | * 7 | * For each pair of values IN and OUT, this file defines two functions for 8 | * translating a given rectangle of pixel data. One uses a single lookup 9 | * table, and the other uses three separate lookup tables for the red, green 10 | * and blue values. 11 | * 12 | * I know this code isn't nice to read because of all the macros, but 13 | * efficiency is important here. 14 | */ 15 | 16 | #if !defined(INVNC) || !defined(OUTVNC) 17 | #error "This file shouldn't be compiled." 18 | #error "It is included as part of translate.c" 19 | #endif 20 | 21 | #define IN_T CONCAT2E(CARD,INVNC) 22 | #define OUT_T CONCAT2E(CARD,OUTVNC) 23 | #define rfbTranslateWithSingleTableINVNCtoOUTVNC \ 24 | CONCAT4E(rfbTranslateWithSingleTable,INVNC,to,OUTVNC) 25 | #define rfbTranslateWithRGBTablesINVNCtoOUTVNC \ 26 | CONCAT4E(rfbTranslateWithRGBTables,INVNC,to,OUTVNC) 27 | 28 | /* 29 | * rfbTranslateWithSingleTableINVNCtoOUTVNC translates a rectangle of pixel data 30 | * using a single lookup table. 31 | */ 32 | 33 | static void 34 | rfbTranslateWithSingleTableINVNCtoOUTVNC (char *table, rfbPixelFormat *in, 35 | rfbPixelFormat *out, 36 | char *iptr, char *optr, 37 | int bytesBetweenInputLines, 38 | int width, int height) 39 | { 40 | IN_T *ip = (IN_T *)iptr; 41 | OUT_T *op = (OUT_T *)optr; 42 | int ipextra = bytesBetweenInputLines / sizeof(IN_T) - width; 43 | OUT_T *opLineEnd; 44 | OUT_T *t = (OUT_T *)table; 45 | 46 | while (height > 0) { 47 | opLineEnd = op + width; 48 | 49 | while (op < opLineEnd) { 50 | *(op++) = t[*(ip++)]; 51 | } 52 | 53 | ip += ipextra; 54 | height--; 55 | } 56 | } 57 | 58 | 59 | /* 60 | * rfbTranslateWithRGBTablesINVNCtoOUTVNC translates a rectangle of pixel data 61 | * using three separate lookup tables for the red, green and blue values. 62 | */ 63 | 64 | static void 65 | rfbTranslateWithRGBTablesINVNCtoOUTVNC (char *table, rfbPixelFormat *in, 66 | rfbPixelFormat *out, 67 | char *iptr, char *optr, 68 | int bytesBetweenInputLines, 69 | int width, int height) 70 | { 71 | IN_T *ip = (IN_T *)iptr; 72 | OUT_T *op = (OUT_T *)optr; 73 | int ipextra = bytesBetweenInputLines / sizeof(IN_T) - width; 74 | OUT_T *opLineEnd; 75 | OUT_T *redTable = (OUT_T *)table; 76 | OUT_T *greenTable = redTable + in->redMax + 1; 77 | OUT_T *blueTable = greenTable + in->greenMax + 1; 78 | 79 | while (height > 0) { 80 | opLineEnd = op + width; 81 | 82 | while (op < opLineEnd) { 83 | *(op++) = (redTable[(*ip >> in->redShift) & in->redMax] | 84 | greenTable[(*ip >> in->greenShift) & in->greenMax] | 85 | blueTable[(*ip >> in->blueShift) & in->blueMax]); 86 | ip++; 87 | } 88 | ip += ipextra; 89 | height--; 90 | } 91 | } 92 | 93 | #undef IN_T 94 | #undef OUT_T 95 | #undef rfbTranslateWithSingleTableINVNCtoOUTVNC 96 | #undef rfbTranslateWithRGBTablesINVNCtoOUTVNC 97 | -------------------------------------------------------------------------------- /winvnc/winvnc/translate.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved. 2 | // 3 | // This file is part of the VNC system. 4 | // 5 | // The VNC system is free software; you can redistribute it and/or modify 6 | // it under the terms of the GNU General Public License as published by 7 | // the Free Software Foundation; either version 2 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU General Public License 16 | // along with this program; if not, write to the Free Software 17 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 18 | // USA. 19 | // 20 | // If the source code for the VNC system is not available from the place 21 | // whence you received this file, check http://www.uk.research.att.com/vnc or contact 22 | // the authors on vnc@uk.research.att.com for information on obtaining it. 23 | 24 | 25 | /* translate.h - prototypes of functions in translate.cpp */ 26 | 27 | #ifndef TRANSLATE_H__ 28 | #define TRANSLATE_H__ 29 | 30 | #include "stdhdrs.h" 31 | #include "rfb.h" 32 | #include "vncmemcpy.h" 33 | 34 | // Translate function prototype! 35 | typedef void (*rfbTranslateFnType)(char *table, rfbPixelFormat *in, 36 | rfbPixelFormat *out, 37 | char *iptr, char *optr, 38 | int bytesBetweenInputLines, 39 | int width, int height); 40 | 41 | // Init function prototype! 42 | typedef void (*rfbInitTableFnType)(char **table, rfbPixelFormat *in, 43 | rfbPixelFormat *out); 44 | 45 | 46 | // External translation stuff 47 | extern void rfbTranslateNone(char *table, rfbPixelFormat *in, 48 | rfbPixelFormat *out, 49 | char *iptr, char *optr, 50 | int bytesBetweenInputLines, 51 | int width, int height); 52 | 53 | extern HDC GetDcMirror(); 54 | 55 | // Macro to compare pixel formats. 56 | #define PF_EQ(x,y) \ 57 | ((x.bitsPerPixel == y.bitsPerPixel) && \ 58 | (x.depth == y.depth) && \ 59 | (x.trueColour == y.trueColour) && \ 60 | ((x.bigEndian == y.bigEndian) || (x.bitsPerPixel == 8)) && \ 61 | (!x.trueColour || ((x.redMax == y.redMax) && \ 62 | (x.greenMax == y.greenMax) && \ 63 | (x.blueMax == y.blueMax) && \ 64 | (x.redShift == y.redShift) && \ 65 | (x.greenShift == y.greenShift) && \ 66 | (x.blueShift == y.blueShift)))) 67 | 68 | // Translation functions themselves 69 | extern rfbInitTableFnType rfbInitTrueColourSingleTableFns[]; 70 | extern rfbInitTableFnType rfbInitColourMapSingleTableFns[]; 71 | extern rfbInitTableFnType rfbInitTrueColourRGBTablesFns[]; 72 | extern rfbTranslateFnType rfbTranslateWithSingleTableFns[3][3]; 73 | extern rfbTranslateFnType rfbTranslateWithRGBTablesFns[3][3]; 74 | /* 75 | extern Bool rfbSetTranslateFunction(rfbClientPtr cl); 76 | extern void rfbSetClientColourMaps(int firstColour, int nColours); 77 | extern Bool rfbSetClientColourMap(rfbClientPtr cl, int firstColour, 78 | int nColours); 79 | */ 80 | 81 | #endif -------------------------------------------------------------------------------- /winvnc/winvnc/videodriver.h: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////////////////////// 2 | // Copyright (C) 2002-2013 UltraVNC Team Members. All Rights Reserved. 3 | // 4 | // This program is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License 15 | // along with this program; if not, write to the Free Software 16 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 17 | // USA. 18 | // 19 | // If the source code for the program is not available from the place from 20 | // which you received this file, check 21 | // http://www.uvnc.com/ 22 | // 23 | //////////////////////////////////////////////////////////////////////////// 24 | 25 | #ifndef _VIDEOD_H 26 | #define _VIDEOD_H 27 | 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include "ScreenCapture.h" 37 | 38 | class VideoDriver : public ScreenCapture 39 | { 40 | public: 41 | VideoDriver(); 42 | virtual ~VideoDriver(); 43 | virtual void videoDriver_start(int x, int y, int w, int h); 44 | virtual void videoDriver_Stop(); 45 | virtual bool hardwareCursor(); 46 | virtual bool noHardwareCursor(); 47 | virtual void Lock(){}; 48 | virtual void Unlock(){}; 49 | 50 | private: 51 | 52 | bool mirror_driver_attach_XP(int x, int y, int w, int h); 53 | void mirror_driver_detach_XP(); 54 | bool mirror_driver_Vista(DWORD dwAttach, int x, int y, int w, int h); 55 | PCHAR videoMemory_GetSharedMemory(void); 56 | void videoMemory_ReleaseSharedMemory(PCHAR pVideoMemory); 57 | HDC getDcMirror(); 58 | DWORD shared_buffer_size; 59 | }; 60 | 61 | #endif -------------------------------------------------------------------------------- /winvnc/winvnc/vncOSVersion.cpp: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////////////////////// 2 | // Copyright (C) 2002 Ultr@VNC Team Members. All Rights Reserved. 3 | // 4 | // This program is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License 15 | // along with this program; if not, write to the Free Software 16 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 17 | // USA. 18 | // 19 | // If the source code for the program is not available from the place from 20 | // which you received this file, check 21 | // http://ultravnc.sourceforge.net/ 22 | // 23 | ///////////////////////////////////////////////////////////////////////////// 24 | 25 | #include 26 | 27 | int 28 | OSVersion() 29 | { 30 | OSVERSIONINFO OSversion; 31 | 32 | OSversion.dwOSVersionInfoSize=sizeof(OSVERSIONINFO); 33 | 34 | GetVersionEx(&OSversion); 35 | 36 | switch(OSversion.dwPlatformId) 37 | { 38 | case VER_PLATFORM_WIN32_NT: 39 | if(OSversion.dwMajorVersion>=5) 40 | return 1; 41 | if(OSversion.dwMajorVersion<=4) 42 | return 3; 43 | case VER_PLATFORM_WIN32_WINDOWS: 44 | if(OSversion.dwMinorVersion==0) return 5; //95 45 | return 4; 46 | } 47 | return 0; 48 | } -------------------------------------------------------------------------------- /winvnc/winvnc/vncOSVersion.h: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////////////////////// 2 | // Copyright (C) 2002 Ultr@VNC Team Members. All Rights Reserved. 3 | // 4 | // This program is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License 15 | // along with this program; if not, write to the Free Software 16 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 17 | // USA. 18 | // 19 | // If the source code for the program is not available from the place from 20 | // which you received this file, check 21 | // http://ultravnc.sourceforge.net/ 22 | // 23 | ///////////////////////////////////////////////////////////////////////////// 24 | 25 | #if !defined(DISPL) 26 | #define DISPL 27 | #pragma once 28 | int 29 | OSVersion(); 30 | #endif -------------------------------------------------------------------------------- /winvnc/winvnc/vncabout.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved. 2 | // 3 | // This file is part of the VNC system. 4 | // 5 | // The VNC system is free software; you can redistribute it and/or modify 6 | // it under the terms of the GNU General Public License as published by 7 | // the Free Software Foundation; either version 2 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU General Public License 16 | // along with this program; if not, write to the Free Software 17 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 18 | // USA. 19 | // 20 | // If the source code for the VNC system is not available from the place 21 | // whence you received this file, check http://www.uk.research.att.com/vnc or contact 22 | // the authors on vnc@uk.research.att.com for information on obtaining it. 23 | 24 | 25 | // vncAbout 26 | 27 | // Object implementing the About dialog for WinVNC. 28 | 29 | class vncAbout; 30 | 31 | #if (!defined(_WINVNC_VNCABOUT)) 32 | #define _WINVNC_VNCABOUT 33 | 34 | // Includes 35 | #include "stdhdrs.h" 36 | 37 | // The vncAbout class itself 38 | class vncAbout 39 | { 40 | public: 41 | // Constructor/destructor 42 | vncAbout(); 43 | ~vncAbout(); 44 | 45 | // Initialisation 46 | BOOL Init(); 47 | 48 | // The dialog box window proc 49 | static BOOL CALLBACK DialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam); 50 | 51 | // General 52 | void Show(BOOL show); 53 | 54 | // Implementation 55 | BOOL m_dlgvisible; 56 | }; 57 | 58 | #endif // _WINVNC_VNCABOUT 59 | -------------------------------------------------------------------------------- /winvnc/winvnc/vncdesktopthread.h: -------------------------------------------------------------------------------- 1 | #if !defined(_WINVNC_VNCDESKTOPTHREAD) 2 | #define _WINVNC_VNCDESKTOPTHREAD 3 | #include "stdhdrs.h" 4 | #include "vncServer.h" 5 | #include "vncKeymap.h" 6 | #include "vncDesktop.h" 7 | #include "vncService.h" 8 | #include "mmsystem.h" 9 | #include "ipc.h" 10 | 11 | 12 | typedef struct _CURSORINFO 13 | { 14 | DWORD cbSize; 15 | DWORD flags; 16 | HCURSOR hCursor; 17 | POINT ptScreenPos; 18 | } MyCURSORINFO, *PMyCURSORINFO, *LPMyCURSORINFO; 19 | // The desktop handler thread 20 | // This handles the messages posted by RFBLib to the vncDesktop window 21 | typedef BOOL (WINAPI *_GetCursorInfo)(PMyCURSORINFO pci); 22 | extern bool g_DesktopThread_running; 23 | 24 | class vncDesktopThread : public omni_thread 25 | { 26 | public: 27 | vncDesktopThread() { 28 | m_returnsig = NULL; 29 | user32 = LoadLibrary("user32.dll"); 30 | MyGetCursorInfo=NULL; 31 | if (user32) MyGetCursorInfo=(_GetCursorInfo )GetProcAddress(user32, "GetCursorInfo"); 32 | g_DesktopThread_running=true; 33 | 34 | m_lLastMouseMoveTime = 0L; 35 | m_lLastUpdateTime = 0L; 36 | }; 37 | protected: 38 | ~vncDesktopThread() { 39 | if (m_returnsig != NULL) delete m_returnsig; 40 | if (user32) FreeLibrary(user32); 41 | g_DesktopThread_running=false; 42 | }; 43 | public: 44 | virtual BOOL Init(vncDesktop *desktop, vncServer *server); 45 | virtual void *run_undetached(void *arg); 46 | virtual void ReturnVal(BOOL result); 47 | void PollWindow(rfb::Region2D &rgn, HWND hwnd); 48 | // Modif rdv@2002 - v1.1.x - videodriver 49 | virtual BOOL handle_driver_changes(rfb::Region2D &rgncache,rfb::UpdateTracker &tracker); 50 | virtual void copy_bitmaps_to_buffer(ULONG i,rfb::Region2D &rgncache,rfb::UpdateTracker &tracker); 51 | bool Handle_Ringbuffer(mystruct *ringbuffer,rfb::Region2D &rgncache); 52 | CIPC g_obIPC; 53 | vncDesktop *m_desktop; 54 | protected: 55 | 56 | vncServer *m_server; 57 | 58 | omni_mutex m_returnLock; 59 | omni_condition *m_returnsig; 60 | BOOL m_return; 61 | BOOL m_returnset; 62 | bool m_screen_moved; 63 | bool lastsend; 64 | HMODULE user32; 65 | _GetCursorInfo MyGetCursorInfo; 66 | bool XRichCursorEnabled; 67 | DWORD newtick,oldtick; 68 | 69 | DWORD m_lLastUpdateTime; 70 | DWORD m_lLastMouseMoveTime; 71 | bool capture; 72 | }; 73 | #endif -------------------------------------------------------------------------------- /winvnc/winvnc/vncencodehext.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2002 RealVNC Ltd. All Rights Reserved. 2 | // Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved. 3 | // 4 | // This file is part of the VNC system. 5 | // 6 | // The VNC system is free software; you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation; either version 2 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // This program is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with this program; if not, write to the Free Software 18 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 19 | // USA. 20 | // 21 | // If the source code for the VNC system is not available from the place 22 | // whence you received this file, check http://www.uk.research.att.com/vnc or contact 23 | // the authors on vnc@uk.research.att.com for information on obtaining it. 24 | 25 | 26 | // vncEncodeHexT object 27 | 28 | // The vncEncodeHexT object uses a compression encoding to send rectangles 29 | // to a client 30 | 31 | class vncEncodeHexT; 32 | 33 | #if !defined(_WINVNC_ENCODEHEXTILE) 34 | #define _WINVNC_ENCODEHEXTILE 35 | #pragma once 36 | 37 | #include "vncEncoder.h" 38 | 39 | // Class definition 40 | 41 | class vncEncodeHexT : public vncEncoder 42 | { 43 | // Fields 44 | public: 45 | 46 | // Methods 47 | public: 48 | // Create/Destroy methods 49 | vncEncodeHexT(); 50 | ~vncEncodeHexT(); 51 | 52 | virtual void Init(); 53 | 54 | virtual UINT RequiredBuffSize(UINT width, UINT height); 55 | virtual UINT NumCodedRects(const rfb::Rect &rect); 56 | 57 | virtual UINT EncodeRect(BYTE *source, BYTE *dest, const rfb::Rect &rect); 58 | 59 | protected: 60 | virtual UINT EncodeHextiles8(BYTE *source, BYTE *dest, 61 | int x, int y, int w, int h); 62 | virtual UINT EncodeHextiles16(BYTE *source, BYTE *dest, 63 | int x, int y, int w, int h); 64 | virtual UINT EncodeHextiles32(BYTE *source, BYTE *dest, 65 | int x, int y, int w, int h); 66 | 67 | // Implementation 68 | protected: 69 | }; 70 | 71 | #endif // _WINVNC_ENCODEHEXTILE 72 | 73 | -------------------------------------------------------------------------------- /winvnc/winvnc/vncencodezrle.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2002 RealVNC Ltd. All Rights Reserved. 2 | // 3 | // This program is free software; you can redistribute it and/or modify 4 | // it under the terms of the GNU General Public License as published by 5 | // the Free Software Foundation; either version 2 of the License, or 6 | // (at your option) any later version. 7 | // 8 | // This program is distributed in the hope that it will be useful, 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | // GNU General Public License for more details. 12 | // 13 | // You should have received a copy of the GNU General Public License 14 | // along with this program; if not, write to the Free Software 15 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 16 | // USA. 17 | // 18 | // If the source code for the program is not available from the place from 19 | // which you received this file, check http://www.realvnc.com/ or contact 20 | // the authors on info@realvnc.com for information on obtaining it. 21 | 22 | #ifndef _WINVNC_ENCODEZRLE 23 | #define _WINVNC_ENCODEZRLE 24 | 25 | #include "vncEncoder.h" 26 | 27 | namespace rdr { class ZlibOutStream; class MemOutStream; } 28 | 29 | class vncEncodeZRLE : public vncEncoder 30 | { 31 | public: 32 | vncEncodeZRLE(); 33 | ~vncEncodeZRLE(); 34 | 35 | virtual void Init(); 36 | 37 | virtual UINT RequiredBuffSize(UINT width, UINT height); 38 | 39 | virtual UINT EncodeRect(BYTE *source, BYTE *dest, const rfb::Rect &rect); 40 | 41 | private: 42 | rdr::ZlibOutStream* zos; 43 | rdr::MemOutStream* mos; 44 | void* beforeBuf; 45 | }; 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /winvnc/winvnc/vncinsthandler.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved. 2 | // 3 | // This file is part of the VNC system. 4 | // 5 | // The VNC system is free software; you can redistribute it and/or modify 6 | // it under the terms of the GNU General Public License as published by 7 | // the Free Software Foundation; either version 2 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU General Public License 16 | // along with this program; if not, write to the Free Software 17 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 18 | // USA. 19 | // 20 | // If the source code for the VNC system is not available from the place 21 | // whence you received this file, check http://www.uk.research.att.com/vnc or contact 22 | // the authors on vnc@uk.research.att.com for information on obtaining it. 23 | 24 | 25 | // vncInstHandler.cpp 26 | 27 | // Implementation of the class used to ensure that only 28 | // one instance is running 29 | 30 | #include "stdhdrs.h" 31 | #include "vncInstHandler.h" 32 | 33 | // Name of the mutex 34 | 35 | const char mutexname [] = "WinVNC_Win32_SC_Instance_Mutex"; 36 | 37 | // The class methods 38 | vncInstHandler::vncInstHandler() 39 | { 40 | mutex=NULL; 41 | } 42 | 43 | vncInstHandler::~vncInstHandler() 44 | { 45 | if (mutex) 46 | ReleaseMutex(mutex); 47 | } 48 | 49 | BOOL 50 | vncInstHandler::Init() 51 | { 52 | // Create the named mutex 53 | mutex = CreateMutex(NULL, FALSE, mutexname); 54 | if (mutex == NULL) 55 | return FALSE; 56 | 57 | // Check that the mutex didn't already exist 58 | if (GetLastError() == ERROR_ALREADY_EXISTS) 59 | return FALSE; 60 | 61 | return TRUE; 62 | } 63 | -------------------------------------------------------------------------------- /winvnc/winvnc/vncinsthandler.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved. 2 | // 3 | // This file is part of the VNC system. 4 | // 5 | // The VNC system is free software; you can redistribute it and/or modify 6 | // it under the terms of the GNU General Public License as published by 7 | // the Free Software Foundation; either version 2 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU General Public License 16 | // along with this program; if not, write to the Free Software 17 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 18 | // USA. 19 | // 20 | // If the source code for the VNC system is not available from the place 21 | // whence you received this file, check http://www.uk.research.att.com/vnc or contact 22 | // the authors on vnc@uk.research.att.com for information on obtaining it. 23 | 24 | 25 | // vncInstHandler 26 | 27 | // The WinMain procedure for WinVNC produces one of these objects. 28 | // It creates a named mutex and checks to see whether that mutex 29 | // already existed in the system. If it did, then there is a previous 30 | // instance of WinVNC running, which must be requested to quit cleanly. 31 | 32 | class vncInstHandler; 33 | 34 | #if (!defined(_WINVNC_VNCINSTHANDLER)) 35 | #define _WINVNC_VNCINSTHANDLER 36 | 37 | // Includes 38 | #include "stdhdrs.h" 39 | 40 | // The vncInstHandler class itself 41 | class vncInstHandler 42 | { 43 | 44 | public: 45 | vncInstHandler(); 46 | ~vncInstHandler(); 47 | // Constructor/destructor 48 | BOOL Init(); 49 | HANDLE mutex; 50 | }; 51 | 52 | #endif // _WINVNC_VNCINSTHANDLER 53 | -------------------------------------------------------------------------------- /winvnc/winvnc/vnckeymap.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2002 RealVNC Ltd. All Rights Reserved. 2 | // Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved. 3 | // 4 | // This file is part of the VNC system. 5 | // 6 | // The VNC system is free software; you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation; either version 2 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // This program is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with this program; if not, write to the Free Software 18 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 19 | // USA. 20 | // 21 | // If the source code for the program is not available from the place from 22 | // which you received this file, check http://www.realvnc.com/ or contact 23 | // the authors on info@realvnc.com for information on obtaining it. 24 | 25 | #ifndef KEYMAP_H__ 26 | #define KEYMAP_H__ 27 | 28 | #include "rfb.h" 29 | 30 | class vncKeymap { 31 | public: 32 | static void keyEvent(CARD32 keysym, bool down); 33 | static void ClearShiftKeys(); 34 | }; 35 | 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /winvnc/winvnc/vnclog.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2002 RealVNC Ltd. All Rights Reserved. 2 | // Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved. 3 | // 4 | // This program is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License 15 | // along with this program; if not, write to the Free Software 16 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 17 | // USA. 18 | // 19 | // If the source code for the program is not available from the place from 20 | // which you received this file, check http://www.realvnc.com/ or contact 21 | // the authors on info@realvnc.com for information on obtaining it. 22 | 23 | // This is an object and macros which provide general logging and debugging functions. 24 | // It can log to a file, to a new console, and/or to debug - others maybe to follow. 25 | // Every log object has a logging level (which can be changed). 26 | // Only log requests with a high enough level attached get logged. So the 27 | // level can be thought of as 'amount of detail'. 28 | // We use Unicode-portable stuff here for compatibility with WinCE. 29 | // 30 | // Typical use: 31 | // 32 | // Log log; 33 | // log.SetFile( _T("myapp.log") ); 34 | // ... 35 | // log.Print(2, _T("x = %d\n"), x); 36 | // 37 | 38 | #ifndef VNCLOGGING 39 | #define VNCLOGGING 40 | 41 | #include 42 | #include 43 | #include 44 | 45 | class VNCLog 46 | { 47 | public: 48 | // Logging mode flags: 49 | static const int ToDebug; 50 | static const int ToFile; 51 | static const int ToConsole; 52 | 53 | // Create a new log object. 54 | // Parameters as follows: 55 | // mode - specifies where output should go, using combination 56 | // of flags above. 57 | // level - the default level 58 | // filename - if flag Log::ToFile is specified in the type, 59 | // a filename must be specified here. 60 | // append - if logging to a file, whether or not to append to any 61 | // existing log. 62 | VNCLog(); 63 | 64 | inline void Print(int level, const char* format, ...) { 65 | if (level > m_level) return; 66 | va_list ap; 67 | va_start(ap, format); 68 | ReallyPrint(format, ap); 69 | va_end(ap); 70 | } 71 | 72 | // Change the log level 73 | void SetLevel(int level); 74 | int GetLevel() {return m_level;}; 75 | 76 | // Change the logging mode 77 | void SetMode(int mode); 78 | int GetMode() {return m_mode;}; 79 | 80 | // Change or set the logging filename. This only has an effect if 81 | // the log mode includes ToFile 82 | void SetFile(const char* filename, bool append = false); 83 | 84 | virtual ~VNCLog(); 85 | 86 | private: 87 | void ReallyPrintLine(const char* line); 88 | void ReallyPrint(const char* format, va_list ap); 89 | void OpenFile(); 90 | void CloseFile(); 91 | bool m_tofile, m_todebug, m_toconsole; 92 | int m_mode; 93 | int m_level; 94 | HANDLE hlogfile; 95 | LPSTR m_filename; 96 | bool m_append; 97 | 98 | time_t m_lastLogTime; 99 | void GetLastErrorMsg(LPSTR szErrorMsg); 100 | }; 101 | 102 | #endif // VNCLOGGING -------------------------------------------------------------------------------- /winvnc/winvnc/vnclogon.cpp: -------------------------------------------------------------------------------- 1 | #include "stdhdrs.h" 2 | #include "resource.h" 3 | #include 4 | #include "vncDesktop.h" 5 | #include "vnclogon.h" 6 | 7 | 8 | extern HINSTANCE hAppInstance; 9 | extern BOOL WINAPI SSPLogonUser(LPTSTR szDomain, LPTSTR szUser, LPTSTR szPassword); 10 | TCHAR szUsername[64]; 11 | TCHAR szPassword[64]; 12 | TCHAR szDomain[64]; 13 | 14 | BOOL vncLogonThread::Init(vncDesktop *desktop) 15 | { 16 | m_desktop = desktop; 17 | m_desktop->logon=1; 18 | logonhwnd=NULL; 19 | rect.left=0; 20 | rect.top=0; 21 | rect.right=32; 22 | rect.bottom=32; 23 | start_undetached(); 24 | return TRUE; 25 | } 26 | 27 | void *vncLogonThread::run_undetached(void * arg) 28 | { 29 | int logonstatus; 30 | logonstatus=CreateLogonWindow(hAppInstance); 31 | m_desktop->logon=logonstatus; 32 | 33 | return NULL; 34 | } 35 | BOOL CALLBACK 36 | vncLogonThread::LogonDlgProc(HWND hDlg, 37 | UINT Message, 38 | WPARAM wParam, 39 | LPARAM lParam) 40 | { 41 | TCHAR TempString[63]; 42 | vncLogonThread *_this = (vncLogonThread *) GetWindowLong(hDlg, GWL_USERDATA); 43 | switch (Message) 44 | { 45 | case WM_INITDIALOG: 46 | _this = (vncLogonThread *) lParam; 47 | _this->CenterWindow(hDlg); 48 | SetDlgItemText(hDlg, IDD_DOMAIN,TEXT(".")); 49 | SetDlgItemText(hDlg, IDD_USER_NAME,TEXT("")); 50 | SetDlgItemText(hDlg, IDD_PASSWORD, TEXT("")); 51 | SetFocus(GetDlgItem(hDlg, IDD_USER_NAME)); 52 | 53 | return(TRUE); 54 | 55 | case WM_COMMAND: 56 | if (LOWORD(wParam) == IDCANCEL) 57 | { 58 | EndDialog(hDlg, 0); 59 | } 60 | if (LOWORD(wParam) == IDOK) 61 | { 62 | GetDlgItemText(hDlg, IDD_USER_NAME, TempString, 63); 63 | strcpy(szUsername,TempString); 64 | GetDlgItemText(hDlg, IDD_PASSWORD,TempString, 63); 65 | strcpy(szPassword,TempString); 66 | GetDlgItemText(hDlg, IDD_DOMAIN,TempString, 63); 67 | strcpy(szDomain,TempString); 68 | EndDialog(hDlg, 1); 69 | } 70 | return(TRUE); 71 | } 72 | 73 | return(FALSE); 74 | 75 | } 76 | int vncLogonThread::CreateLogonWindow(HINSTANCE hInstance) 77 | { 78 | int returnvalue=0; 79 | returnvalue = DialogBoxParam(hAppInstance,MAKEINTRESOURCE(IDD_LOGON), 80 | NULL, 81 | (DLGPROC) LogonDlgProc, 82 | (LONG) this); 83 | 84 | if (returnvalue==1) 85 | 86 | if ((strcmp(szUsername ,TEXT(""))!=0) && (strcmp(szPassword ,TEXT(""))!=0)) 87 | 88 | 89 | if (SSPLogonUser(szDomain, szUsername,szPassword)) return 3; 90 | 91 | 92 | 93 | 94 | 95 | return 2; 96 | } 97 | VOID vncLogonThread::CenterWindow(HWND hwnd) 98 | { 99 | LONG dx, dy; 100 | LONG dxParent, dyParent; 101 | LONG Style; 102 | logonhwnd=hwnd; 103 | GetWindowRect(hwnd, &rect); 104 | dx = rect.right - rect.left; 105 | dy = rect.bottom - rect.top; 106 | 107 | Style = GetWindowLong(hwnd, GWL_STYLE); 108 | if ((Style & WS_CHILD) == 0) 109 | { 110 | dxParent = GetSystemMetrics(SM_CXSCREEN); 111 | dyParent = GetSystemMetrics(SM_CYSCREEN); 112 | } 113 | else 114 | { 115 | HWND hwndParent; 116 | RECT rectParent; 117 | 118 | hwndParent = GetParent(hwnd); 119 | if (hwndParent == NULL) 120 | { 121 | hwndParent = GetDesktopWindow(); 122 | } 123 | 124 | GetWindowRect(hwndParent, &rectParent); 125 | 126 | dxParent = rectParent.right - rectParent.left; 127 | dyParent = rectParent.bottom - rectParent.top; 128 | } 129 | 130 | rect.left = (dxParent - dx) / 2+m_desktop->m_ScreenOffsetx; 131 | rect.top = (dyParent - dy) / 3+m_desktop->m_ScreenOffsety; 132 | 133 | SetWindowPos(hwnd, HWND_TOPMOST, rect.left, rect.top, 0, 0, SWP_NOSIZE); 134 | 135 | SetForegroundWindow(hwnd); 136 | } 137 | 138 | -------------------------------------------------------------------------------- /winvnc/winvnc/vnclogon.h: -------------------------------------------------------------------------------- 1 | #include "stdhdrs.h" 2 | #if !defined(_WINVNC_LOGON) 3 | #define _WINVNC_LOGON 4 | #pragma once 5 | class vncLogonThread : public omni_thread 6 | { 7 | public: 8 | vncLogonThread() {m_returnsig = NULL;}; 9 | ~vncLogonThread() {if (m_returnsig != NULL) delete m_returnsig;}; 10 | public: 11 | virtual BOOL Init(vncDesktop *desktop); 12 | virtual void *run_undetached(void *arg); 13 | HWND logonhwnd; 14 | RECT rect; 15 | 16 | protected: 17 | omni_mutex m_returnLock; 18 | omni_condition *m_returnsig; 19 | vncDesktop *m_desktop; 20 | int x1,x2,y1,y2; 21 | VOID CenterWindow(HWND hwnd); 22 | static BOOL CALLBACK LogonDlgProc(HWND hDlg,UINT Message,WPARAM wParam,LPARAM lParam); 23 | int CreateLogonWindow(HINSTANCE hInstance); 24 | }; 25 | #endif -------------------------------------------------------------------------------- /winvnc/winvnc/vncmemcpy.h: -------------------------------------------------------------------------------- 1 | #ifndef __CPU_H__ 2 | #define __CPU_H__ 3 | #define CPUID_STD_FPU 0x00000001 4 | #define CPUID_STD_VME 0x00000002 5 | #define CPUID_STD_DEBUGEXT 0x00000004 6 | #define CPUID_STD_4MPAGE 0x00000008 7 | #define CPUID_STD_TSC 0x00000010 8 | #define CPUID_STD_MSR 0x00000020 9 | #define CPUID_STD_PAE 0x00000040 10 | #define CPUID_STD_MCHKXCP 0x00000080 11 | #define CPUID_STD_CMPXCHG8B 0x00000100 12 | #define CPUID_STD_APIC 0x00000200 13 | #define CPUID_STD_SYSENTER 0x00000800 14 | #define CPUID_STD_MTRR 0x00001000 15 | #define CPUID_STD_GPE 0x00002000 16 | #define CPUID_STD_MCHKARCH 0x00004000 17 | #define CPUID_STD_CMOV 0x00008000 18 | #define CPUID_STD_PAT 0x00010000 19 | #define CPUID_STD_PSE36 0x00020000 20 | #define CPUID_STD_MMX 0x00800000 21 | #define CPUID_STD_FXSAVE 0x01000000 22 | #define CPUID_STD_SSE 0x02000000 23 | #define CPUID_STD_SSE2 0x04000000 24 | #define CPUID_EXT_3DNOW 0x80000000 25 | #define CPUID_EXT_AMD_3DNOWEXT 0x40000000 26 | #define CPUID_EXT_AMD_MMXEXT 0x00400000 27 | 28 | #define FEATURE_CPUID 0x00000001 29 | #define FEATURE_STD_FEATURES 0x00000002 30 | #define FEATURE_EXT_FEATURES 0x00000004 31 | #define FEATURE_TSC 0x00000010 32 | #define FEATURE_MMX 0x00000020 33 | #define FEATURE_CMOV 0x00000040 34 | #define FEATURE_3DNOW 0x00000080 35 | #define FEATURE_3DNOWEXT 0x00000100 36 | #define FEATURE_MMXEXT 0x00000200 37 | #define FEATURE_SSEFP 0x00000400 38 | #define FEATURE_K6_MTRR 0x00000800 39 | #define FEATURE_P6_MTRR 0x00001000 40 | #define FEATURE_SSE 0x00002000 41 | #define FEATURE_SSE2 0x00004000 42 | 43 | class Ultravncmemcpy 44 | { 45 | public: 46 | Ultravncmemcpy(); 47 | ~Ultravncmemcpy(); 48 | inline void Set_memcpu(); 49 | bool Save_memcpy(void* dest,void* src,size_t count); 50 | bool Save_memcmp(void* dest,void* src,size_t count); 51 | inline void memcpyMMX(void* dest,void* src,DWORD count); 52 | inline void memcpySSE(void *dest, const void *src, size_t nbytes); 53 | UINT get_feature_flags(void); 54 | bool cputype; 55 | }; 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /winvnc/winvnc/vncmenu.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved. 2 | // 3 | // This file is part of the VNC system. 4 | // 5 | // The VNC system is free software; you can redistribute it and/or modify 6 | // it under the terms of the GNU General Public License as published by 7 | // the Free Software Foundation; either version 2 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU General Public License 16 | // along with this program; if not, write to the Free Software 17 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 18 | // USA. 19 | // 20 | // If the source code for the VNC system is not available from the place 21 | // whence you received this file, check http://www.uk.research.att.com/vnc or contact 22 | // the authors on vnc@uk.research.att.com for information on obtaining it. 23 | 24 | 25 | // vncMenu 26 | 27 | // This class handles creation of a system-tray icon & menu 28 | 29 | class vncMenu; 30 | 31 | #if (!defined(_WINVNC_VNCMENU)) 32 | #define _WINVNC_VNCMENU 33 | 34 | #include "stdhdrs.h" 35 | #include 36 | #include "vncServer.h" 37 | #include "vncProperties.h" 38 | #include "vncPropertiesPoll.h" 39 | #include "vncAbout.h" 40 | //#include "vncListDlg.h" 41 | 42 | // Constants 43 | extern const UINT MENU_PROPERTIES_SHOW; 44 | extern const UINT MENU_DEFAULT_PROPERTIES_SHOW; 45 | extern const UINT MENU_ABOUTBOX_SHOW; 46 | extern const UINT MENU_SERVICEHELPER_MSG; 47 | extern const UINT MENU_ADD_CLIENT_MSG; 48 | extern const char *MENU_CLASS_NAME; 49 | 50 | extern const UINT FileTransferSendPacketMessage; 51 | 52 | // The tray menu class itself 53 | class vncMenu 54 | { 55 | public: 56 | vncMenu(vncServer *server); 57 | ~vncMenu(); 58 | protected: 59 | // Tray icon handling 60 | void AddTrayIcon(); 61 | void DelTrayIcon(); 62 | void FlashTrayIcon(BOOL flash); 63 | void SendTrayMsg(DWORD msg, BOOL flash); 64 | 65 | // Message handler for the tray window 66 | static LRESULT CALLBACK WndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam); 67 | 68 | // Fields 69 | protected: 70 | // Check that the password has been set 71 | void CheckPassword(); 72 | 73 | // The server that this tray icon handles 74 | vncServer *m_server; 75 | 76 | // Properties object for this server 77 | vncProperties m_properties; 78 | vncPropertiesPoll m_propertiesPoll; 79 | 80 | // About dialog for this server 81 | vncAbout m_about; 82 | 83 | // List of viewers 84 | // vncListDlg m_ListDlg; 85 | 86 | HWND m_hwnd; 87 | HMENU m_hmenu; 88 | 89 | NOTIFYICONDATA m_nid; 90 | 91 | char m_username[UNLEN+1]; 92 | 93 | // The icon handles 94 | HICON m_winvnc_icon; 95 | HICON m_flash_icon; 96 | 97 | HINSTANCE hWtsLib2; 98 | BOOL bConnectSock; 99 | BOOL bAutoPort; 100 | UINT port_rfb; 101 | UINT port_http; 102 | BOOL ports_set; 103 | 104 | }; 105 | 106 | 107 | #endif -------------------------------------------------------------------------------- /winvnc/winvnc/vncpropertiesPoll.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved. 2 | // 3 | // This file is part of the VNC system. 4 | // 5 | // The VNC system is free software; you can redistribute it and/or modify 6 | // it under the terms of the GNU General Public License as published by 7 | // the Free Software Foundation; either version 2 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU General Public License 16 | // along with this program; if not, write to the Free Software 17 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 18 | // USA. 19 | // 20 | // If the source code for the VNC system is not available from the place 21 | // whence you received this file, check http://www.uk.research.att.com/vnc or contact 22 | // the authors on vnc@uk.research.att.com for information on obtaining it. 23 | 24 | 25 | // vncPropertiesPoll 26 | 27 | // Object implementing the Properties dialog for WinVNC. 28 | // The Properties dialog is displayed whenever the user selects the 29 | // Properties option from the system tray menu. 30 | // The Properties dialog also takes care of loading the program 31 | // settings and saving them on exit. 32 | 33 | class vncPropertiesPoll; 34 | 35 | #if (!defined(_WINVNC_VNCPROPERTIESPOLL)) 36 | #define _WINVNC_VNCPROPERTIESPOLL 37 | 38 | // Includes 39 | #include "stdhdrs.h" 40 | #include "vncServer.h" 41 | 42 | // The vncPropertiesPoll class itself 43 | class vncPropertiesPoll 44 | { 45 | public: 46 | // Constructor/destructor 47 | vncPropertiesPoll(); 48 | ~vncPropertiesPoll(); 49 | 50 | // Initialisation 51 | BOOL Init(vncServer *server); 52 | // The dialog box window proc 53 | static BOOL CALLBACK DialogProcPoll(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam); 54 | 55 | // Display the properties dialog 56 | // If usersettings is TRUE then the per-user settings come up 57 | // If usersettings is FALSE then the default system settings come up 58 | void Show(BOOL show, BOOL usersettings); 59 | 60 | // Loading & saving of preferences 61 | void Load(BOOL usersettings); 62 | void ResetRegistry(); 63 | 64 | 65 | 66 | 67 | 68 | // Implementation 69 | protected: 70 | // The server object to which this properties object is attached. 71 | vncServer * m_server; 72 | 73 | // Flag to indicate whether the currently loaded settings are for 74 | // the current user, or are default system settings 75 | BOOL m_usersettings; 76 | 77 | 78 | // Making the loaded user prefs active 79 | void ApplyUserPrefs(); 80 | 81 | BOOL m_returncode_valid; 82 | BOOL m_dlgvisible; 83 | 84 | BOOL m_pref_TurboMode; 85 | 86 | BOOL m_pref_PollUnderCursor; 87 | BOOL m_pref_PollForeground; 88 | BOOL m_pref_PollFullScreen; 89 | BOOL m_pref_PollConsoleOnly; 90 | BOOL m_pref_PollOnEventOnly; 91 | 92 | BOOL m_pref_Driver; 93 | BOOL m_pref_Hook; 94 | BOOL m_pref_Virtual; 95 | 96 | }; 97 | 98 | #endif // _WINVNC_vncPropertiesPoll 99 | -------------------------------------------------------------------------------- /winvnc/winvnc/vncsockconnect.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved. 2 | // 3 | // This file is part of the VNC system. 4 | // 5 | // The VNC system is free software; you can redistribute it and/or modify 6 | // it under the terms of the GNU General Public License as published by 7 | // the Free Software Foundation; either version 2 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU General Public License 16 | // along with this program; if not, write to the Free Software 17 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 18 | // USA. 19 | // 20 | // If the source code for the VNC system is not available from the place 21 | // whence you received this file, check http://www.uk.research.att.com/vnc or contact 22 | // the authors on vnc@uk.research.att.com for information on obtaining it. 23 | 24 | // vncSockConnect.h 25 | 26 | // The vncSockConnect class creates a listening socket and binds 27 | // it to the specified port. It then creates a listen thread which 28 | // goes into a loop, listening on the socket. 29 | // When the vncSockConnect object is destroyed, all resources are 30 | // freed automatically, including the listen thread. 31 | 32 | class vncSockConnect; 33 | 34 | #if (!defined(_WINVNC_VNCSOCKCONNECT)) 35 | #define _WINVNC_VNCSOCKCONNECT 36 | 37 | // Includes 38 | #include "stdhdrs.h" 39 | #include "VSocket.h" 40 | #include "vncServer.h" 41 | #include 42 | 43 | // The vncSockConnect class itself 44 | class vncSockConnect 45 | { 46 | public: 47 | // Constructor/destructor 48 | vncSockConnect(); 49 | virtual ~vncSockConnect(); 50 | 51 | // Init 52 | virtual VBool Init(vncServer *server, UINT port); 53 | 54 | // Implementation 55 | protected: 56 | // The listening socket 57 | VSocket m_socket; 58 | 59 | // The port to listen on 60 | UINT m_port; 61 | 62 | // The in-coming accept thread 63 | omni_thread *m_thread; 64 | }; 65 | 66 | #endif // _WINVNC_VNCSOCKCONNECT -------------------------------------------------------------------------------- /winvnc/winvnc/vtypes.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved. 2 | // 3 | // This file is part of the VNC system. 4 | // 5 | // The VNC system is free software; you can redistribute it and/or modify 6 | // it under the terms of the GNU General Public License as published by 7 | // the Free Software Foundation; either version 2 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU General Public License 16 | // along with this program; if not, write to the Free Software 17 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 18 | // USA. 19 | // 20 | // If the source code for the VNC system is not available from the place 21 | // whence you received this file, check http://www.uk.research.att.com/vnc or contact 22 | // the authors on vnc@uk.research.att.com for information on obtaining it. 23 | 24 | // VTypes.h 25 | 26 | // RFB V3.0 27 | 28 | // Datatypes used by the VGui system 29 | 30 | #if (!defined(_ATT_VTYPES_DEFINED)) 31 | #define _ATT_VTYPES_DEFINED 32 | 33 | //////////////////////////// 34 | // Numeric data types 35 | 36 | //////////////////////////// 37 | // Fixed size (derived from rfb.h) 38 | 39 | typedef unsigned int VCard32; 40 | typedef unsigned short VCard16; 41 | typedef unsigned char VCard8; 42 | typedef int VInt32; 43 | typedef short VInt16; 44 | typedef char VInt8; 45 | 46 | //////////////////////////// 47 | // Variable size 48 | // These will always be at least as big as the largest 49 | // fixed-size data-type 50 | 51 | typedef VCard32 VCard; 52 | typedef VInt32 VInt; 53 | 54 | //////////////////////////// 55 | // Useful functions on integers 56 | 57 | static inline VInt Max(VInt x, VInt y) {if (x>y) return x; else return y;} 58 | static inline VInt Min(VInt x, VInt y) {if (x 2 | 3 | 9 | UltraVNC 10 | 11 | 12 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /winvnc/winvnc/winvnc.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved. 2 | // 3 | // This file is part of the VNC system. 4 | // 5 | // The VNC system is free software; you can redistribute it and/or modify 6 | // it under the terms of the GNU General Public License as published by 7 | // the Free Software Foundation; either version 2 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU General Public License 16 | // along with this program; if not, write to the Free Software 17 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 18 | // USA. 19 | // 20 | // If the source code for the VNC system is not available from the place 21 | // whence you received this file, check http://www.uk.research.att.com/vnc or contact 22 | // the authors on vnc@uk.research.att.com for information on obtaining it. 23 | 24 | 25 | // WinVNC header file 26 | 27 | #include "stdhdrs.h" 28 | #include "resource.h" 29 | 30 | // Application specific messages 31 | 32 | // Message used for system tray notifications 33 | #define WM_TRAYNOTIFY WM_USER+1 34 | 35 | // Messages used for the server object to notify windows of things 36 | #define WM_SRV_CLIENT_CONNECT WM_USER+2 37 | #define WM_SRV_CLIENT_AUTHENTICATED WM_USER+3 38 | #define WM_SRV_CLIENT_DISCONNECT WM_USER+4 39 | 40 | #define WM_HOOKCHANGE WM_APP+7 41 | 42 | // Export the application details 43 | extern HINSTANCE hAppInstance; 44 | extern const char *szAppName; 45 | extern DWORD mainthreadId; 46 | 47 | // Main VNC server routine 48 | #ifndef SINGLECLICKULTRA 49 | extern int WinVNCAppMain(); 50 | #else 51 | extern int WinVNCAppMain(unsigned long ipaddress = 0, unsigned short port = 0); 52 | #endif 53 | 54 | // Standard command-line flag definitions 55 | const char winvncRunService[] = "-service"; 56 | const char winvncRunServiceHelper[] = "-servicehelper"; 57 | const char winvncRunAsUserApp[] = "-run"; 58 | 59 | const char winvncInstallService[] = "-install"; 60 | const char winvncInstallServices[] = "-sinstall"; 61 | const char winvncRemoveService[] = "-remove"; 62 | const char winvncReinstallService[] = "-reinstall"; 63 | 64 | const char winvncShowProperties[] = "-settings"; 65 | const char winvncShowDefaultProperties[] = "-defaultsettings"; 66 | const char winvncShowAbout[] = "-about"; 67 | const char winvncKillRunningCopy[] = "-kill"; 68 | 69 | const char winvncAddNewClient[] = "-connect"; 70 | 71 | const char winvncShowHelp[] = "-help"; 72 | const char winvncAllowMulti[] = "-multi"; 73 | const char winvncDisableMultiWarning[] = "-fus"; 74 | const char winvncAutoReconnect[] = "-autoreconnect"; 75 | 76 | #ifdef SINGLECLICKULTRA 77 | const char winvncId[] = "-id"; 78 | const char winvncplugin[] = "-plugin"; 79 | const char winvncNewplugin[] = "-secureplugin"; 80 | const char winvncPassword[] = "-password"; 81 | const char winvncNoRegistry[] = "-noregistry"; 82 | const char winvncNoTrayicon[] = "-notrayicon"; 83 | const char winvncReadonly[] = "-readonly"; 84 | const char winvncUsername[] = "-username"; 85 | 86 | #endif 87 | 88 | //const char winvncFTNoUserImpersonation[] = "-ftnouserimpersonation"; 89 | 90 | 91 | // Usage string 92 | const char winvncUsageText[] = "winvnc [-run] [-kill] [-autoreconnect] [-connect host[:display]] [-connect host[::port]] [-install] [-installs] [-remove] [-settings] [-defaultsettings] [-about]\n"; 93 | -------------------------------------------------------------------------------- /winvnc/winvnc/winvnc.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ultravnc/SC/386d3a42ccbb1d5f531cde896195ee4531288610/winvnc/winvnc/winvnc.rc -------------------------------------------------------------------------------- /winvnc/winvnc/winvnc.rc_VS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ultravnc/SC/386d3a42ccbb1d5f531cde896195ee4531288610/winvnc/winvnc/winvnc.rc_VS -------------------------------------------------------------------------------- /winvnc/winvnc/winvnc.vcproj.ACER.rudi.user: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 11 | 35 | 36 | 39 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /winvnc/winvnc/winvnc.vcproj.PIV.rudi.user: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 11 | 35 | 36 | 39 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /winvnc/winvnc/winvnc.vcproj.VIRTUALXP-63912.XPMUser.user: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 11 | 35 | 36 | 39 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /winvnc/winvnc/winvnc.vcproj.rudi-PC.rudi.user: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 11 | 35 | 36 | 39 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /winvnc/winvnc/winvnc.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /zlib/ChangeLog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ultravnc/SC/386d3a42ccbb1d5f531cde896195ee4531288610/zlib/ChangeLog -------------------------------------------------------------------------------- /zlib/INDEX: -------------------------------------------------------------------------------- 1 | ChangeLog history of changes 2 | FAQ Frequently Asked Questions about zlib 3 | INDEX this file 4 | Makefile makefile for Unix (generated by configure) 5 | Makefile.in makefile for Unix (template for configure) 6 | README guess what 7 | algorithm.txt description of the (de)compression algorithm 8 | configure configure script for Unix 9 | zconf.in.h template for zconf.h (used by configure) 10 | 11 | msdos/ makefiles for MSDOS 12 | old/ makefiles for various architectures and zlib documentation 13 | files that have not yet been updated for zlib 1.2.x 14 | qnx/ makefiles for QNX 15 | win32/ makefiles for Windows 16 | 17 | zlib public header files (must be kept): 18 | zconf.h 19 | zlib.h 20 | 21 | private source files used to build the zlib library: 22 | adler32.c 23 | compress.c 24 | crc32.c 25 | crc32.h 26 | deflate.c 27 | deflate.h 28 | gzio.c 29 | infback.c 30 | inffast.c 31 | inffast.h 32 | inffixed.h 33 | inflate.c 34 | inflate.h 35 | inftrees.c 36 | inftrees.h 37 | trees.c 38 | trees.h 39 | uncompr.c 40 | zutil.c 41 | zutil.h 42 | 43 | source files for sample programs: 44 | example.c 45 | minigzip.c 46 | 47 | unsupported contribution by third parties 48 | See contrib/README.contrib 49 | -------------------------------------------------------------------------------- /zlib/Makefile.bcc32: -------------------------------------------------------------------------------- 1 | # ------------- Borland C++ 5.5 (Win32) ------------- 2 | 3 | CC=bcc32 4 | LIB=tlib 5 | 6 | CFLAGS= -v- -O2 -3 -tWM -q -w-8004 -w-8057 7 | LIBFLAGS= /C 8 | 9 | OBJS=adler32.obj compress.obj crc32.obj deflate.obj gzio.obj infblock.obj \ 10 | infcodes.obj inflate.obj inftrees.obj infutil.obj inffast.obj \ 11 | trees.obj uncompr.obj zutil.obj 12 | 13 | pOBJS=+adler32.obj+compress.obj+crc32.obj+deflate.obj+gzio.obj+infblock.obj \ 14 | +infcodes.obj+inflate.obj+inftrees.obj+infutil.obj+inffast.obj \ 15 | +trees.obj+uncompr.obj+zutil.obj 16 | 17 | .autodepend 18 | .c.obj: 19 | $(CC) -c $(CFLAGS) $< 20 | 21 | zlib.lib: $(OBJS) 22 | @if exist $@ del $@ 23 | $(LIB) $@ $(LIBFLAGS) $(pOBJS) 24 | 25 | clean: 26 | del *.obj *.lib 27 | 28 | -------------------------------------------------------------------------------- /zlib/adler32.c: -------------------------------------------------------------------------------- 1 | /* adler32.c -- compute the Adler-32 checksum of a data stream 2 | * Copyright (C) 1995-2003 Mark Adler 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | /* @(#) $Id: adler32.c,v 1.2 2003/11/24 22:55:50 cyberfox123 Exp $ */ 7 | 8 | #define ZLIB_INTERNAL 9 | #include "zlib.h" 10 | 11 | #define BASE 65521UL /* largest prime smaller than 65536 */ 12 | #define NMAX 5552 13 | /* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */ 14 | 15 | #define DO1(buf,i) {s1 += buf[i]; s2 += s1;} 16 | #define DO2(buf,i) DO1(buf,i); DO1(buf,i+1); 17 | #define DO4(buf,i) DO2(buf,i); DO2(buf,i+2); 18 | #define DO8(buf,i) DO4(buf,i); DO4(buf,i+4); 19 | #define DO16(buf) DO8(buf,0); DO8(buf,8); 20 | 21 | #ifdef NO_DIVIDE 22 | # define MOD(a) \ 23 | do { \ 24 | if (a >= (BASE << 16)) a -= (BASE << 16); \ 25 | if (a >= (BASE << 15)) a -= (BASE << 15); \ 26 | if (a >= (BASE << 14)) a -= (BASE << 14); \ 27 | if (a >= (BASE << 13)) a -= (BASE << 13); \ 28 | if (a >= (BASE << 12)) a -= (BASE << 12); \ 29 | if (a >= (BASE << 11)) a -= (BASE << 11); \ 30 | if (a >= (BASE << 10)) a -= (BASE << 10); \ 31 | if (a >= (BASE << 9)) a -= (BASE << 9); \ 32 | if (a >= (BASE << 8)) a -= (BASE << 8); \ 33 | if (a >= (BASE << 7)) a -= (BASE << 7); \ 34 | if (a >= (BASE << 6)) a -= (BASE << 6); \ 35 | if (a >= (BASE << 5)) a -= (BASE << 5); \ 36 | if (a >= (BASE << 4)) a -= (BASE << 4); \ 37 | if (a >= (BASE << 3)) a -= (BASE << 3); \ 38 | if (a >= (BASE << 2)) a -= (BASE << 2); \ 39 | if (a >= (BASE << 1)) a -= (BASE << 1); \ 40 | if (a >= BASE) a -= BASE; \ 41 | } while (0) 42 | #else 43 | # define MOD(a) a %= BASE 44 | #endif 45 | 46 | /* ========================================================================= */ 47 | uLong ZEXPORT adler32(adler, buf, len) 48 | uLong adler; 49 | const Bytef *buf; 50 | uInt len; 51 | { 52 | unsigned long s1 = adler & 0xffff; 53 | unsigned long s2 = (adler >> 16) & 0xffff; 54 | int k; 55 | 56 | if (buf == Z_NULL) return 1L; 57 | 58 | while (len > 0) { 59 | k = len < NMAX ? (int)len : NMAX; 60 | len -= k; 61 | while (k >= 16) { 62 | DO16(buf); 63 | buf += 16; 64 | k -= 16; 65 | } 66 | if (k != 0) do { 67 | s1 += *buf++; 68 | s2 += s1; 69 | } while (--k); 70 | MOD(s1); 71 | MOD(s2); 72 | } 73 | return (s2 << 16) | s1; 74 | } 75 | -------------------------------------------------------------------------------- /zlib/compress.c: -------------------------------------------------------------------------------- 1 | /* compress.c -- compress a memory buffer 2 | * Copyright (C) 1995-2002 Jean-loup Gailly. 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | /* @(#) $Id: compress.c,v 1.2 2003/11/24 22:55:50 cyberfox123 Exp $ */ 7 | 8 | #define ZLIB_INTERNAL 9 | #include "zlib.h" 10 | 11 | /* =========================================================================== 12 | Compresses the source buffer into the destination buffer. The level 13 | parameter has the same meaning as in deflateInit. sourceLen is the byte 14 | length of the source buffer. Upon entry, destLen is the total size of the 15 | destination buffer, which must be at least 0.1% larger than sourceLen plus 16 | 12 bytes. Upon exit, destLen is the actual size of the compressed buffer. 17 | 18 | compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough 19 | memory, Z_BUF_ERROR if there was not enough room in the output buffer, 20 | Z_STREAM_ERROR if the level parameter is invalid. 21 | */ 22 | int ZEXPORT compress2 (dest, destLen, source, sourceLen, level) 23 | Bytef *dest; 24 | uLongf *destLen; 25 | const Bytef *source; 26 | uLong sourceLen; 27 | int level; 28 | { 29 | z_stream stream; 30 | int err; 31 | 32 | stream.next_in = (Bytef*)source; 33 | stream.avail_in = (uInt)sourceLen; 34 | #ifdef MAXSEG_64K 35 | /* Check for source > 64K on 16-bit machine: */ 36 | if ((uLong)stream.avail_in != sourceLen) return Z_BUF_ERROR; 37 | #endif 38 | stream.next_out = dest; 39 | stream.avail_out = (uInt)*destLen; 40 | if ((uLong)stream.avail_out != *destLen) return Z_BUF_ERROR; 41 | 42 | stream.zalloc = (alloc_func)0; 43 | stream.zfree = (free_func)0; 44 | stream.opaque = (voidpf)0; 45 | 46 | err = deflateInit(&stream, level); 47 | if (err != Z_OK) return err; 48 | 49 | err = deflate(&stream, Z_FINISH); 50 | if (err != Z_STREAM_END) { 51 | deflateEnd(&stream); 52 | return err == Z_OK ? Z_BUF_ERROR : err; 53 | } 54 | *destLen = stream.total_out; 55 | 56 | err = deflateEnd(&stream); 57 | return err; 58 | } 59 | 60 | /* =========================================================================== 61 | */ 62 | int ZEXPORT compress (dest, destLen, source, sourceLen) 63 | Bytef *dest; 64 | uLongf *destLen; 65 | const Bytef *source; 66 | uLong sourceLen; 67 | { 68 | return compress2(dest, destLen, source, sourceLen, Z_DEFAULT_COMPRESSION); 69 | } 70 | 71 | /* =========================================================================== 72 | If the default memLevel or windowBits for deflateInit() is changed, then 73 | this function needs to be updated. 74 | */ 75 | uLong ZEXPORT compressBound (sourceLen) 76 | uLong sourceLen; 77 | { 78 | return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) + 11; 79 | } 80 | -------------------------------------------------------------------------------- /zlib/inffast.h: -------------------------------------------------------------------------------- 1 | /* inffast.h -- header to use inffast.c 2 | * Copyright (C) 1995-2003 Mark Adler 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | /* WARNING: this file should *not* be used by applications. It is 7 | part of the implementation of the compression library and is 8 | subject to change. Applications should only use zlib.h. 9 | */ 10 | 11 | void inflate_fast OF((z_streamp strm, unsigned start)); 12 | -------------------------------------------------------------------------------- /zlib/inftrees.h: -------------------------------------------------------------------------------- 1 | /* inftrees.h -- header to use inftrees.c 2 | * Copyright (C) 1995-2003 Mark Adler 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | /* WARNING: this file should *not* be used by applications. It is 7 | part of the implementation of the compression library and is 8 | subject to change. Applications should only use zlib.h. 9 | */ 10 | 11 | /* Structure for decoding tables. Each entry provides either the 12 | information needed to do the operation requested by the code that 13 | indexed that table entry, or it provides a pointer to another 14 | table that indexes more bits of the code. op indicates whether 15 | the entry is a pointer to another table, a literal, a length or 16 | distance, an end-of-block, or an invalid code. For a table 17 | pointer, the low four bits of op is the number of index bits of 18 | that table. For a length or distance, the low four bits of op 19 | is the number of extra bits to get after the code. bits is 20 | the number of bits in this code or part of the code to drop off 21 | of the bit buffer. val is the actual byte to output in the case 22 | of a literal, the base length or distance, or the offset from 23 | the current table to the next table. Each entry is four bytes. */ 24 | typedef struct { 25 | unsigned char op; /* operation, extra bits, table bits */ 26 | unsigned char bits; /* bits in this part of the code */ 27 | unsigned short val; /* offset in table or code value */ 28 | } code; 29 | 30 | /* op values as set by inflate_table(): 31 | 00000000 - literal 32 | 0000tttt - table link, tttt != 0 is the number of table index bits 33 | 0001eeee - length or distance, eeee is the number of extra bits 34 | 01100000 - end of block 35 | 01000000 - invalid code 36 | */ 37 | 38 | /* Maximum size of dynamic tree. The maximum found in a long but non- 39 | exhaustive search was 1004 code structures (850 for length/literals 40 | and 154 for distances, the latter actually the result of an 41 | exhaustive search). The true maximum is not known, but the value 42 | below is more than safe. */ 43 | #define ENOUGH 1440 44 | #define MAXD 154 45 | 46 | /* Type of code to build for inftable() */ 47 | typedef enum { 48 | CODES, 49 | LENS, 50 | DISTS 51 | } codetype; 52 | 53 | extern int inflate_table OF((codetype type, unsigned short FAR *lens, 54 | unsigned codes, code FAR * FAR *table, 55 | unsigned FAR *bits, unsigned short FAR *work)); 56 | -------------------------------------------------------------------------------- /zlib/uncompr.c: -------------------------------------------------------------------------------- 1 | /* uncompr.c -- decompress a memory buffer 2 | * Copyright (C) 1995-2003 Jean-loup Gailly. 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | /* @(#) $Id: uncompr.c,v 1.2 2003/11/24 22:55:50 cyberfox123 Exp $ */ 7 | 8 | #define ZLIB_INTERNAL 9 | #include "zlib.h" 10 | 11 | /* =========================================================================== 12 | Decompresses the source buffer into the destination buffer. sourceLen is 13 | the byte length of the source buffer. Upon entry, destLen is the total 14 | size of the destination buffer, which must be large enough to hold the 15 | entire uncompressed data. (The size of the uncompressed data must have 16 | been saved previously by the compressor and transmitted to the decompressor 17 | by some mechanism outside the scope of this compression library.) 18 | Upon exit, destLen is the actual size of the compressed buffer. 19 | This function can be used to decompress a whole file at once if the 20 | input file is mmap'ed. 21 | 22 | uncompress returns Z_OK if success, Z_MEM_ERROR if there was not 23 | enough memory, Z_BUF_ERROR if there was not enough room in the output 24 | buffer, or Z_DATA_ERROR if the input data was corrupted. 25 | */ 26 | int ZEXPORT uncompress (dest, destLen, source, sourceLen) 27 | Bytef *dest; 28 | uLongf *destLen; 29 | const Bytef *source; 30 | uLong sourceLen; 31 | { 32 | z_stream stream; 33 | int err; 34 | 35 | stream.next_in = (Bytef*)source; 36 | stream.avail_in = (uInt)sourceLen; 37 | /* Check for source > 64K on 16-bit machine: */ 38 | if ((uLong)stream.avail_in != sourceLen) return Z_BUF_ERROR; 39 | 40 | stream.next_out = dest; 41 | stream.avail_out = (uInt)*destLen; 42 | if ((uLong)stream.avail_out != *destLen) return Z_BUF_ERROR; 43 | 44 | stream.zalloc = (alloc_func)0; 45 | stream.zfree = (free_func)0; 46 | 47 | err = inflateInit(&stream); 48 | if (err != Z_OK) return err; 49 | 50 | err = inflate(&stream, Z_FINISH); 51 | if (err != Z_STREAM_END) { 52 | inflateEnd(&stream); 53 | if (err == Z_NEED_DICT || (err == Z_BUF_ERROR && stream.avail_in == 0)) 54 | return Z_DATA_ERROR; 55 | return err; 56 | } 57 | *destLen = stream.total_out; 58 | 59 | err = inflateEnd(&stream); 60 | return err; 61 | } 62 | -------------------------------------------------------------------------------- /zlib/zlib.vcproj.ACER.rudi.user: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 11 | 35 | 36 | 39 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /zlib/zlib.vcproj.PIV.rudi.user: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 11 | 35 | 36 | 39 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /zlib/zlib.vcproj.VIRTUALXP-63912.XPMUser.user: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 11 | 35 | 36 | 39 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /zlib/zlib.vcproj.rudi-PC.rudi.user: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 11 | 35 | 36 | 39 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /zlib/zlib.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {7062e345-651f-4235-b45a-94da3bbb663a} 6 | cpp;c;cxx;rc;def;r;odl;idl;hpj;bat 7 | 8 | 9 | {88a6edf4-0f6f-4d2a-89ad-e5678799d96f} 10 | h;hpp;hxx;hm;inl 11 | 12 | 13 | 14 | 15 | Source Files 16 | 17 | 18 | Source Files 19 | 20 | 21 | Source Files 22 | 23 | 24 | Source Files 25 | 26 | 27 | Source Files 28 | 29 | 30 | Source Files 31 | 32 | 33 | Source Files 34 | 35 | 36 | Source Files 37 | 38 | 39 | Source Files 40 | 41 | 42 | Source Files 43 | 44 | 45 | Source Files 46 | 47 | 48 | 49 | 50 | Header Files 51 | 52 | 53 | Header Files 54 | 55 | 56 | Header Files 57 | 58 | 59 | Header Files 60 | 61 | 62 | Header Files 63 | 64 | 65 | Header Files 66 | 67 | 68 | Header Files 69 | 70 | 71 | Header Files 72 | 73 | 74 | -------------------------------------------------------------------------------- /zlib/zlib.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | --------------------------------------------------------------------------------