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.

72 lines
3.2 KiB

  1. #ifndef _UTILS_H_
  2. #define _UTILS_H_
  3. // macro definitions
  4. #define MAX_URL INTERNET_MAX_URL_LENGTH
  5. //WIn64 macros
  6. #ifdef _WIN64
  7. #if defined (_AMD64_) || defined (_IA64_)
  8. #define ALIGNTYPE LARGE_INTEGER
  9. #else
  10. #define ALIGNTYPE DWORD
  11. #endif
  12. #define ALIGN ((ULONG) (sizeof(ALIGNTYPE) - 1))
  13. #define LcbAlignLcb(lcb) (((lcb) + ALIGN) & ~ALIGN)
  14. #define PbAlignPb(pb) ((LPBYTE) ((((DWORD) (pb)) + ALIGN) & ~ALIGN))
  15. #define MYALIGN ((POINTER_64_INT) (sizeof(ALIGNTYPE) - 1))
  16. #define MyPbAlignPb(pb) ((LPBYTE) ((((POINTER_64_INT) (pb)) + MYALIGN) & ~MYALIGN))
  17. #else //!WIN64
  18. #define LcbAlignLcb(lcb) (lcb)
  19. #define PbAlignPb(pb) (pb)
  20. #define MyPbAlignPb(pb) (pb)
  21. #endif
  22. // prototype declarations
  23. #define IsBitmapFile(hDlg, nID) (IsBitmapFileValid((hDlg), (nID), NULL, NULL, 0, 0, 0, 0))
  24. void AppendCommaHex(LPTSTR pszBuf, BYTE bData, DWORD dwFlags);
  25. void MoveFileToWorkDir(LPCTSTR pcszFile, LPCTSTR pcszSrcDir, LPCTSTR pcszWorkDir, BOOL fHTM = FALSE);
  26. // conversion functions between ansi and unicode in convert.cpp
  27. LPNMTVGETINFOTIPW TVInfoTipA2W(LPNMTVGETINFOTIPA pTvInfoTipA, LPNMTVGETINFOTIPW pTvInfoTipW);
  28. LPNMTVGETINFOTIPA TVInfoTipW2A(LPNMTVGETINFOTIPW pTvInfoTipW, LPNMTVGETINFOTIPA pTvInfoTipA);
  29. LPNMTVGETINFOTIP TVInfoTipSameToSame(LPNMTVGETINFOTIP pTvInfoTipIn,
  30. LPNMTVGETINFOTIP pTvInfoTipOut);
  31. LPRESULTITEMW ResultItemA2W(LPRESULTITEMA pResultItemA, LPRESULTITEMW pResultItemW);
  32. LPRESULTITEMA ResultItemW2A(LPRESULTITEMW pResultItemW, LPRESULTITEMA pResultItemA);
  33. LPRESULTITEM ResultItemSameToSame(LPRESULTITEM pResultItemIn, LPRESULTITEM pResultItemOut);
  34. #ifdef UNICODE
  35. #define TVInfoTipT2W(pTvInfoTip, pTvInfoTipW) TVInfoTipSameToSame((pTvInfoTip), (pTvInfoTipW))
  36. #define TVInfoTipW2T(pTvInfoTipW, pTvInfoTip) TVInfoTipSameToSame((pTvInfoTipW), (pTvInfoTip))
  37. #define TVInfoTipT2A(pTvInfoTip, pTvInfoTipA) TVInfoTipW2A((pTvInfoTip), (pTvInfoTipA))
  38. #define TVInfoTipA2T(pTvInfoTipA, pTvInfoTip) TVInfoTipA2W((pTvInfoTipA), (pTvInfoTip))
  39. #define ResultItemT2W(pResultItem, pResultItemW) ResultItemSameToSame((pResultItem), (pResultItemW))
  40. #define ResultItemW2T(pResultItemW, pResultItem) ResultItemSameToSame((pResultItemW), (pResultItem))
  41. #define ResultItemT2A(pResultItem, pResultItemA) ResultItemW2A((pResultItem), (pResultItemA))
  42. #define ResultItemA2T(pResultItemA, pResultItem) ResultItemA2W((pResultItemA), (pResultItem))
  43. #else
  44. #define TVInfoTipT2W(pTvInfoTip, pTvInfoTipW) TVInfoTipA2W((pTvInfoTip), (pTvInfoTipW))
  45. #define TVInfoTipW2T(pTvInfoTipW, pTvInfoTip) TVInfoTipW2A((pTvInfoTipW), (pTvInfoTip))
  46. #define TVInfoTipT2A(pTvInfoTip, pTvInfoTipA) TVInfoTipSameToSame((pTvInfoTip), (pTvInfoTipA))
  47. #define TVInfoTipA2T(pTvInfoTipA, pTvInfoTip) TVInfoTipSameToSame((pTvInfoTipA), (pTvInfoTip))
  48. #define ResultItemT2W(pResultItem, pResultItemW) ResultItemA2W((pResultItem), (pResultItemW))
  49. #define ResultItemW2T(pResultItemW, pResultItem) ResultItemW2A((pResultItemW), (pResultItem))
  50. #define ResultItemT2A(pResultItem, pResultItemA) ResultItemSameToSame((pResultItem), (pResultItemA))
  51. #define ResultItemA2T(pResultItemA, pResultItem) ResultItemSameToSame((pResultItemA), (pResultItem))
  52. #endif
  53. #endif