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.

145 lines
3.9 KiB

  1. #ifndef _WINDEFS_H_
  2. #define _WINDEFS_H_
  3. // USER DEFINED MESSAGES
  4. #define WM_TOKEDIT WM_USER + 2
  5. #define WM_UPDSTATLINE WM_USER + 2
  6. #define WM_FMTSTATLINE WM_USER + 3
  7. #define WM_READMPJDATA WM_USER + 3
  8. #define WM_LOADPROJECT WM_USER + 3
  9. #define WM_LOADTOKENS WM_USER + 4
  10. #define WM_SAVEPROJECT WM_USER + 5
  11. #define WM_EDITER_CLOSED WM_USER + 6
  12. #define WM_VIEW WM_USER + 7
  13. #define WM_TRANSLATE WM_USER + 8
  14. #define WM_SAVETOKENS WM_USER + 9
  15. #define ID_ICON 1
  16. /* Windows macros */
  17. #pragma message("Using the WIN translation of the common macros.")
  18. #ifdef RLWIN32
  19. #ifdef _DEBUG
  20. FILE * MyFopen( char *, char *, char *, int);
  21. int MyClose( FILE **, char *, int);
  22. #define FALLOC(n) MyAlloc( (size_t)(n), __FILE__, __LINE__)
  23. #define FREALLOC(p,n) MyReAlloc( (p),(n), __FILE__, __LINE__)
  24. #define FOPEN(f,m) MyFopen( (f), (m), __FILE__, __LINE__)
  25. #define FCLOSE(p) MyClose( &(p), __FILE__, __LINE__)
  26. #else // _DEBUG
  27. FILE *MyFopen( char *, char *);
  28. int MyClose( FILE **);
  29. #define FALLOC(n) MyAlloc( (size_t)(n))
  30. #define FREALLOC(p,n) MyReAlloc( (p),(n))
  31. #define FOPEN(f,m) fopen( (f),(m))
  32. //#define FOPEN(f,m) MyFopen( (f),(m))
  33. //#define FCLOSE(p) MyClose( &(p))
  34. //#define FCLOSE(p) {if(p){fclose( p);p=NULL;}}
  35. #define FCLOSE(p) fclose( p);
  36. #endif // _DEBUG
  37. //#define RLFREE(p) if(p){GlobalFree(p);p=NULL;}
  38. #define RLFREE(p) MyFree(&p)
  39. #define ALLOC(n) FALLOC(n)
  40. #define REALLOC(p,n) FREALLOC( (p),(n))
  41. #define FMEMMOVE( szDst, szSrc, uSize) memmove( (szDst), (szSrc), (uSize))
  42. #define FSTRNCPY( szDst, szSrc, uSize) strncpy( (szDst), (szSrc), (uSize))
  43. #else // RLWIN32
  44. #define FALLOC(n) (VOID FAR *)MAKELONG( 0, GlobalAlloc(GPTR, (DWORD)n))
  45. #define FFREE(n) GlobalFree((HANDLE)HIWORD( (LONG)n))
  46. #define FREALLOC(p,n) (VOID FAR *)MAKELONG( 0, GlobalReAlloc( (HANDLE)HIWORD( (LONG)n),n,GPTR))
  47. #define ALLOC(n) (VOID NEAR *)LocalAlloc( LPTR,n)
  48. #define FREE(p) LocalFree( (LOCALHANDLE) p)
  49. #define REALLOC(p,n) LocalRealloc( p, n, LMEM_MOVEABLE)
  50. #define FMEMMOVE( szDst, szSrc, uSize) _fmemmove( szDst, szSrc, uSize )
  51. #define FSTRNCPY( szDst, szSrc, uSize) _fstrncpy( szDst, szSrc, uSize )
  52. #endif // RLWIN32
  53. #ifndef UNICODE
  54. #define MessageBoxA MessageBox
  55. #define SetWindowTextA SetWindowText
  56. #define WinHelpA WinHelp
  57. #define SetDlgItemTextA SetDlgItemText
  58. #define GetDlgItemTextA GetDlgItemText
  59. #define GetOpenFileNameA GetOpenFileName
  60. #define OPENFILENAMEA OPENFILENAME
  61. #define DragQueryFileA DragQueryFile
  62. #endif
  63. #ifndef RLWIN32
  64. #ifndef CONST
  65. #define CONST const
  66. #endif
  67. #define CHAR char
  68. typedef CHAR *LPSTR;
  69. typedef CONST CHAR *LPCSTR, *PCSTR;
  70. #ifndef _WCHAR_T_DEFINED
  71. typedef unsigned short wchar_t;
  72. #define _WCHAR_T_DEFINED
  73. #endif
  74. #define WCHAR wchar_t
  75. typedef WCHAR *PWCHAR;
  76. typedef WCHAR *LPWSTR, *PWSTR;
  77. typedef LPSTR LPTCH, PTCH;
  78. typedef LPSTR PTSTR, LPTSTR;
  79. typedef LPCSTR LPCTSTR;
  80. #define TEXT(quote) quote
  81. typedef unsigned char UCHAR;
  82. typedef char *PCHAR;
  83. #define UNALIGNED
  84. #endif
  85. #ifdef CAIRO
  86. #define OPENFILENAMEA OPENFILENAME
  87. #define GetOpenFileNameA GetOpenFileName
  88. #define HDROP HANDLE
  89. #endif
  90. #ifndef RLWIN32
  91. #define _MBSTOWCS(ds,ss,dc,sc) mbstowcs(ds,ss,sc)
  92. #define _WCSTOMBS(ds,ss,dc,sc) wcstombs(ds,ss,sc)
  93. #else //RLWIN32
  94. UINT _MBSTOWCS( WCHAR*, CHAR*, UINT, UINT);
  95. UINT _WCSTOMBS( CHAR*, WCHAR*, UINT, UINT);
  96. #endif // RLWIN32
  97. #ifndef MAKEINTRESOURCE
  98. #define MAKEINTRESOURCEA(i) (LPSTR)((DWORD)((WORD)(i)))
  99. #define MAKEINTRESOURCEW(i) (LPWSTR)((DWORD)((WORD)(i)))
  100. #ifdef UNICODE
  101. #define MAKEINTRESOURCE MAKEINTRESOURCEW
  102. #else
  103. #define MAKEINTRESOURCE MAKEINTRESOURCEA
  104. #endif // UNICODE
  105. #endif // !MAKEINTRESOURCE
  106. #endif // _WINDEFS_H_
  107.