Commit Graph

1383 Commits (475a2c944731aa5c578f1fc4aba51a3ae0069c2d)
 

Author SHA1 Message Date
Daniel Cohen Gindi fd075263f9 Signal is a fundamental UNIX function, and must be omitted for any windows compilation 11 years ago
Daniel Cohen Gindi a7f79b696e These are UNIX headers, and are not available on MSVC 11 years ago
Daniel Cohen Gindi e69e1efd75 Those are generally the windows headers, not just MinGW 11 years ago
Daniel Cohen Gindi 1fc2951f22 On windows, use the Win32 calls for directory enumerations.
We also do not need the conversion between UNIX values to Windows values in the RTF_FIND_DATA struct, as we already are on windows.
11 years ago
Daniel Cohen Gindi 901eba9f46 Generally adjusting headers for compiling on windows without the mixing of Winsock 1 and 2. 11 years ago
Daniel Cohen Gindi 8c58593649 Just use a macro to bridge to the Win32 version of `mkdir`
The additional compat_mkdir function was not necessary at all.
11 years ago
Daniel Cohen Gindi 741a18446c Use correct `winsock2.h` version header instead of winsock.h.
`windows.h` is referring to `winsock.h` (unless the `WIN32_LEAN_AND_MEAN` is defined).
The structs used in this header are defined in `winsock2.h` or in `winsock.h`, but we are using Winsock2 of course!
So we have to include winsock2.h and refrain from including windows.h here
11 years ago
Daniel Cohen Gindi 026c48e7fc Fixed a violation of the C89 standard ("declarations must come before instructions") 11 years ago
Daniel Cohen Gindi 7f8520d05c A windows version for directory enumerations
Basically taken from https://github.com/danielgindi/FileDir with some adjustments
11 years ago
Daniel Cohen Gindi 42ff7fb85b MSVC also has the __FUNCTION__ predefined 11 years ago
Daniel Cohen Gindi 51d0db7107 `CreateDirectory` might clash with the `CreateDirectoryA`/`CreateDirectoryW` macros on MSVC 11 years ago
Daniel Cohen Gindi b2b705aa33 Fail when NULL is passed to CreateFileListInfo()
Passing NULL to sprintf() would most likely crash the program.
11 years ago
Daniel Cohen Gindi fbf48c65f3 `strings.h` and `resolv.h` are not available on MSVC, and some POSIX functions are renamed or deprecated
For all of those missing/deprecated POSIX functions, we just add a macro mapping to the _underscored version of MSVC.
11 years ago
Christian Beier fdf5f8876f The HAVE_X11 define is not there anymore, but we don't need it either. 11 years ago
Christian Beier d999a8eae3 Move vncterm to https://github.com/LibVNC/vncterm. 11 years ago
Christian Beier 7960c6871d Move VisualNaCro to https://github.com/LibVNC/VisualNaCro. 11 years ago
Christian Beier 9bf5fe0160 Move prepare_x11vnc_dist.sh over to x11vnc repo. 11 years ago
Christian Beier 0f25ea7324 Remove x11vnc from autotools build system. 11 years ago
Christian Beier 7dfd4f3b04 Remove tightvnc-1.3dev5-vncviewer-alpha-cursor.patch. 11 years ago
Christian Beier 498d222976 Remove x11vnc subdir.
The new x11vnc repo is at https://github.com/LibVNC/x11vnc.
11 years ago
Johannes Schindelin 8d2db0486d Fix tv_usec calculation
This bug was introduced in the MSVC patches.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
11 years ago
Johannes Schindelin 70783a4d60 Merge branch 'msvc'
This topic branch provides compatibility for Windows, without the
MINGW32 dependency.

It is based on https://github.com/LibVNC/libvncserver/pull/22.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
11 years ago
Daniel Cohen Gindi 54b2400dd7 Use Windows' critical sections to emulate pthread's mutexes
With Microsoft Visual C++, we cannot use pthreads (MinGW sports an
emulation library which is the reason we did not need Windows-specific
hacks earlier). Happily, it is very easy to provide Windows-specific
emulations for the pthread calls we use.

[JES: fixed commit message]

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
11 years ago
Daniel Cohen Gindi dfdb11144a Perform pointer arithmetic on char * instead of void *
Microsoft Visual C++ does not allow pointer arithmetic on void pointers.

[JES: fixed commit message]

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
11 years ago
Daniel Cohen Gindi e26aeb4062 MSVC: Use the Unix emulation headers
[JES: provided commit message, split out unrelated changes]

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
11 years ago
Daniel Cohen Gindi 366dda9951 Use WIN32 for Windows-specific #ifdef guards
To support Microsoft Visual C++, we must not guard Windows-specific code
in MinGW-specific #ifdef guards.

Happily, even 64-bit MSVC defines the WIN32 constant, therefore we can use
that instead.

[JES: fixed commit message, reordered commit, split out unrelated changes]

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
11 years ago
Daniel Cohen Gindi 4c2cfb17f0 Add MSVC compatible unix headers
The stdint.h file was copied from:

	https://runexe.googlecode.com/svn-history/r9/trunk/src/runlib/msstdint.h

(we can incorporate it because it is licensed under the 3-clause BSD
license.)

[JES: fixed commit message, fixed stripped copyright header]

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
11 years ago
Daniel Cohen Gindi cd578bf529 MSVC: Use _snprintf instead of snprintf
In Microsoft's Visual C runtime, the snprintf() function is actually
called _snprintf. Let's just #define the former to call the latter.

[JES: fixed commit message]

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
11 years ago
Daniel Cohen Gindi 8175f428dc Use correct winsock header
We link to ws2_32.lib which corresponds to the winsock2.h header, not the
winsock.h header.

[JES: fixed commit message]

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
11 years ago
Daniel Cohen Gindi 3059282751 Include Winsock2 header before windows.h include
That's because there are duplicate #defines, and when Winsock2 is defined
before windows.h then windows.h detects that and prevent redefinition.

See
http://social.msdn.microsoft.com/Forums/windowsdesktop/en-US/4a90b143-1fb8-43e9-a54c-956127e0c579/windowsh-and-winsock2h?forum=windowssdk

[JES: fixed commit message]

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
11 years ago
Daniel Cohen Gindi 914460cac5 Remove unused variables
This change is technically not required to support MSVC, but it was
detected by Microsoft's compiler.

[JES: fixed commit message]

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
11 years ago
dscho 50dbe1df75 Merge pull request #21 from newsoft/master
Fixing two more security issues (remote server crash)
11 years ago
Nicolas Ruff 05a9bd41a8 Do not accept a scaling factor of zero on PalmVNCSetScaleFactor and SetScale client->server messages. This would cause a division by zero and crash the server. 11 years ago
Nicolas Ruff 6037a9074d Check malloc() return value on client->server ClientCutText message. Client can send up to 2**32-1 bytes of text, and such a large allocation is likely to fail in case of high memory pressure. This would in a server crash (write at address 0). 11 years ago
dscho 7c9ef6372d Merge pull request #16 from sandsmark/master
Merge patches from KDE/krfb
11 years ago
Luca Falavigna 4276864096 Merge pull request #17 from dktrkranz/master
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
11 years ago
Johannes Schindelin cdd8675fd9 Fix whitespace
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
11 years ago
Luca Falavigna 0c08b5db65 Enable support for ppc64el architecture 11 years ago
Luca Falavigna ce8e04a761 Use Libs.private to avoid unnecessary linkage 11 years ago
Johannes Schindelin 27b0c0deb7 Fix indentation
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
11 years ago
dscho ba710eb145 Merge pull request #20 from newsoft/master
Fix integer overflow in MallocFrameBuffer()
11 years ago
newsoft 85a778c0e4 Check for MallocFrameBuffer() return value
If MallocFrameBuffer() returns FALSE, frame buffer pointer is left to
NULL. Subsequent writes into that buffer could lead to memory
corruption, or even arbitrary code execution.
11 years ago
newsoft 045a044e8a Fix integer overflow in MallocFrameBuffer()
Promote integers to uint64_t to avoid integer overflow issue during
frame buffer allocation for very large screen sizes
11 years ago
Amandeep Singh 012594b970 allow rfbInitSockets with non-ready states.
This allows for reinitializations of e. g. sockets in a SHUTDOWN state.
The only state that doesn't make sense to reinitialize are READY states.
11 years ago
Amandeep Singh afd1d329ed Fix crash in krfb
Krfb crashes on quit, if any client is connected
due to a rfbClientConnectionGone call missing
11 years ago
Will Thompson dca1048239 x11vnc: fix double X_UNLOCK on xrandr events
check_xrandr_event() assumes X_LOCK is taken before it is called, and
currently calls X_UNLOCK on behalf of the caller. But in practice, all
callers assume that the lock is still held after check_xrandr_event()
returns. In particular, this leads to a double-unlock and crash in
check_xevents() on any xrandr event.
11 years ago
dscho 9453be4201 Merge pull request #13 from wjt/fix-double-X_UNLOCK-on-xrandr-event
x11vnc: fix double X_UNLOCK on xrandr events
11 years ago
Will Thompson c4dff87c8f x11vnc: fix double X_UNLOCK on xrandr events
check_xrandr_event() assumes X_LOCK is taken before it is called, and
currently calls X_UNLOCK on behalf of the caller. But in practice, all
callers assume that the lock is still held after check_xrandr_event()
returns. In particular, this leads to a double-unlock and crash in
check_xevents() on any xrandr event.
11 years ago
Johannes Schindelin 3238443dc1 Update LZO to version 2.07
It was reported that LZO has security issues in LMS-2014-06-16-1:
Oberhumer LZO (CVE-2014-4607): http://seclists.org/oss-sec/2014/q2/665

This was also reported by Alex Xu as
https://github.com/LibVNC/libvncserver/issues/9.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
11 years ago
dscho d1a3eb9db5 Merge pull request #7 from waldheinz/init-sfae-padding
Initialize padding in SetFormatAndEncodings' rfbSetPixelFormatMsg.
11 years ago