Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /* Copyright (C) 2002-2005 RealVNC Ltd. All Rights Reserved.
  2. *
  3. * This 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 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. 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 software; if not, write to the Free Software
  15. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  16. * USA.
  17. */
  18. // -=- WMShatter.h
  19. //
  20. // WMShatter provides the IsSafeWM routine, which returns true iff the
  21. // supplied window message is safe to pass to DispatchMessage, or to
  22. // process in the window procedure.
  23. //
  24. // This is only required, of course, to avoid so-called "shatter" attacks
  25. // to be made against the VNC server, which take advantage of the noddy
  26. // design of the Win32 window messaging system.
  27. //
  28. // The API here is designed to hopefully be future proof, so that if they
  29. // ever come up with a proper way to determine whether a message is safe
  30. // or not then it can just be reimplemented here...
  31. #ifndef __RFB_WIN32_SHATTER_H__
  32. #define __RFB_WIN32_SHATTER_H__
  33. #include <windows.h>
  34. namespace rfb {
  35. namespace win32 {
  36. bool IsSafeWM(HWND window, UINT msg, WPARAM wParam, LPARAM lParam);
  37. LRESULT SafeDefWindowProc(HWND wnd, UINT msg, WPARAM wParam, LPARAM lParam);
  38. LRESULT SafeDispatchMessage(const MSG* msg);
  39. };
  40. };
  41. #endif // __RFB_WIN32_SHATTER_H__