Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
1.5 KiB

  1. #if defined(_WIN64)
  2. #define UNICODE
  3. #define _UNICODE
  4. #endif
  5. #include <utility>
  6. #pragma warning(disable:4663) /* C++ language change */
  7. #pragma warning(disable:4512) /* assignment operator could not be generated */
  8. #pragma warning(disable:4511) /* copy constructor could not be generated */
  9. #if defined(_WIN64)
  10. #pragma warning(disable:4267) /* conversion, possible loss of data */
  11. #pragma warning(disable:4244) /* conversion, possible loss of data */
  12. #endif
  13. #pragma warning(disable:4018) /* '<=' : signed/unsigned mismatch */
  14. #pragma warning(disable:4389) /* '!=' : signed/unsigned */
  15. #include "windows.h"
  16. #include <vector>
  17. #include <string>
  18. #include <fstream>
  19. #include <iostream>
  20. #include <algorithm>
  21. #include <sstream>
  22. #include <map>
  23. #include <stdio.h>
  24. #define NUMBER_OF(x) (sizeof(x)/sizeof((x)[0]))
  25. using std::wstring;
  26. using std::string;
  27. using std::vector;
  28. using std::wistream;
  29. using std::wifstream;
  30. using std::getline;
  31. using std::basic_string;
  32. typedef CONST VOID* PCVOID;
  33. class CByteVector : public std::vector<BYTE>
  34. {
  35. public:
  36. CByteVector() { }
  37. ~CByteVector() { }
  38. const BYTE* bytes() const { return &front(); }
  39. BYTE* bytes() { return &front(); }
  40. operator PCSTR () const { return reinterpret_cast<PCSTR>(this->bytes()); }
  41. operator PSTR () { return reinterpret_cast<PSTR>(this->bytes()); }
  42. operator PCWSTR () const { return reinterpret_cast<PCWSTR>(this->bytes()); }
  43. operator PWSTR () { return reinterpret_cast<PWSTR>(this->bytes()); }
  44. };