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.

77 lines
1.5 KiB

  1. #ifndef _CSTD_H_
  2. #define _CSTD_H_
  3. #include <windows.h>
  4. #define PvCast(type, TYPE) ((TYPE) (type))
  5. #define OFFSET(field, type) ((ULONG) &(type).field - (ULONG) &(type))
  6. #ifndef VOID
  7. typedef void VOID;
  8. #endif
  9. typedef TCHAR* SZ;
  10. //typedef TCHAR* PSZ;
  11. typedef const TCHAR* SZC;
  12. #ifndef max
  13. #define max(a, b) ((a) >= (b) ? (a) : (b))
  14. #endif
  15. #ifndef TRUE
  16. #define TRUE 1
  17. #define FALSE 0
  18. #endif
  19. typedef enum
  20. {
  21. fFalse = 0,
  22. fTrue = !fFalse
  23. };
  24. typedef enum
  25. {
  26. bFalse = 0,
  27. bTrue = !bFalse
  28. };
  29. //typedef char* PCH;
  30. typedef int BOOL;
  31. #ifndef _WINDOWS
  32. typedef unsigned short WORD;
  33. typedef unsigned long DWORD;
  34. typedef long LONG;
  35. #endif
  36. typedef unsigned char UCHAR;
  37. typedef short SHORT;
  38. typedef unsigned char BYTE;
  39. typedef BYTE* PB;
  40. typedef unsigned short USHORT;
  41. typedef int INT;
  42. typedef unsigned int UINT;
  43. typedef unsigned long ULONG;
  44. typedef double DBL;
  45. typedef double REAL;
  46. typedef ULONG RVA; // Relative Virtual Address
  47. typedef ULONG LFA; // Long File Address
  48. typedef INT (*PFNCMP)(const VOID*, const VOID*);
  49. #include "debug.h"
  50. #define CelemArray(rgtype) (sizeof(rgtype) / sizeof(rgtype[0]))
  51. SZ SzCopy(SZC);
  52. #ifdef _WINDOWS
  53. /* BUGBUG: See if this still compiles
  54. void __cdecl perror(const char*);
  55. int __cdecl printf(const char*, ...);
  56. int __cdecl vprintf(const char*, va_list);
  57. void __cdecl exit(int);
  58. */
  59. #endif
  60. #endif