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.

71 lines
2.0 KiB

  1. #ifdef WIN32
  2. // These things have direct equivalents.
  3. // Shouldn't be using these things.
  4. #define WINCAPI __cdecl
  5. #define _huge
  6. #define _export
  7. #define _loadds
  8. #define SELECTOROF(x) ((UINT)(x))
  9. #define OFFSETOF(x) ((UINT)(x))
  10. #define ISLPTR(pv) ((BOOL)pv)
  11. #define MAKELP(hmem,off) ((LPVOID)((LPBYTE)hmem+off))
  12. #define MAKELRESULTFROMUINT(i) ((LRESULT)i)
  13. #define ISVALIDHINSTANCE(hinst) ((BOOL)hinst)
  14. #define DATASEG_READONLY ".text" // read only data, same as one generated by linker
  15. #define DATASEG_PERINSTANCE "INSTDATA" // per instance data
  16. #define DATASEG_SHARED // default data goes here
  17. #define CODESEG_INIT ".text"
  18. #define GetWindowInt GetWindowLong
  19. #define SetWindowInt SetWindowLong
  20. #define SetWindowID(hwnd,id) SetWindowLong(hwnd, GWL_ID, id)
  21. #define GetClassCursor(hwnd) ((HCURSOR)GetClassLong(hwnd, GCL_HCURSOR))
  22. #define GetClassIcon(hwnd) ((HICON)GetClassLong(hwnd, GCL_HICON))
  23. #ifdef WINNT
  24. #else
  25. typedef TBYTE TUCHAR;
  26. #endif
  27. #else // !WIN32
  28. typedef LPCSTR LPCTSTR;
  29. typedef LPSTR LPTSTR;
  30. typedef const short far *LPCWSTR;
  31. #define TEXT(x) (x)
  32. #define ISLPTR(pv) (SELECTOROF(pv))
  33. #define MAKELRESULTFROMUINT(i) MAKELRESULT(i,0)
  34. #define ISVALIDHINSTANCE(hinst) ((UINT)hinst>=(UINT)HINSTANCE_ERROR)
  35. #define DATASEG_READONLY "_TEXT"
  36. #define DATASEG_PERINSTANCE
  37. #define DATASEG_SHARED
  38. #define CODESEG_INIT "_INIT"
  39. #define GetWindowInt GetWindowWord
  40. #define SetWindowInt SetWindowWord
  41. #define SetWindowID(hwnd,id) SetWindowWord(hwnd, GWW_ID, id)
  42. #define GetClassCursor(hwnd) ((HCURSOR)GetClassWord(hwnd, GCW_HCURSOR))
  43. #define GetClassIcon(hwnd) ((HICON)GetClassWord(hwnd, GCW_HICON))
  44. #define MAKEPOINTS(l) (*((POINTS FAR*)&(l)))
  45. #define GlobalAlloc16(f, s) GlobalAlloc(f, s)
  46. #define GlobalLock16(h) GlobalLock(h)
  47. #define GlobalUnlock16(h) GlobalUnlock(h)
  48. #define GlobalFree16(h) GlobalFree(h)
  49. #define GlobalSize16(h) GlobalSize(h)
  50. #endif // WIN32