Protect.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. /*
  2. ** Command & Conquer Renegade(tm)
  3. ** Copyright 2025 Electronic Arts Inc.
  4. **
  5. ** This program 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 3 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, see <http://www.gnu.org/licenses/>.
  17. */
  18. /******************************************************************************
  19. *
  20. * FILE
  21. * $Archive: /Commando/Code/Launcher/Protect.h $
  22. *
  23. * DESCRIPTION
  24. * Copy protection
  25. *
  26. * PROGRAMMER
  27. * Denzil E. Long, Jr.
  28. * $Author: Denzil_l $
  29. *
  30. * VERSION INFO
  31. * $Modtime: 10/18/01 4:50p $
  32. * $Revision: 1 $
  33. *
  34. ******************************************************************************/
  35. #ifndef __PROTECT_H__
  36. #define __PROTECT_H__
  37. #ifdef COPY_PROTECT
  38. #include <windows.h>
  39. //#define OLDWAY
  40. #ifdef OLDWAY
  41. template<typename T> class RefPtr;
  42. class UString;
  43. class Protect
  44. {
  45. public:
  46. Protect();
  47. ~Protect();
  48. void SendMappedFileHandle(HANDLE process, DWORD threadID) const;
  49. private:
  50. // Prevent copy & assignment
  51. Protect(const Protect&);
  52. const Protect& operator=(const Protect&);
  53. // Retrieve machine unique key
  54. RefPtr<UString> GetPassKey(void) const;
  55. HANDLE mLauncherMutex;
  56. HANDLE mMappedFile;
  57. };
  58. #else
  59. #ifdef __cplusplus
  60. extern "C" {
  61. #endif
  62. void __cdecl InitializeProtect(void);
  63. void __cdecl ShutdownProtect(void);
  64. void __cdecl SendProtectMessage(HANDLE process, DWORD threadID);
  65. #ifdef __cplusplus
  66. };
  67. #endif
  68. #endif
  69. #endif // COPY_PROTECT
  70. #endif // PROTECT_H