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.

81 lines
3.1 KiB

  1. #include "precomp.h"
  2. // functions used internally by ieakeng to convert between ansi and unicode versions of
  3. // various structs
  4. // Note: these functions assume ptrs to buffers already have the buffers allocated.
  5. LPNMTVGETINFOTIPW TVInfoTipA2W(LPNMTVGETINFOTIPA pTvInfoTipA, LPNMTVGETINFOTIPW pTvInfoTipW)
  6. {
  7. pTvInfoTipW->cchTextMax = pTvInfoTipA->cchTextMax;
  8. pTvInfoTipW->hdr = pTvInfoTipA->hdr;
  9. pTvInfoTipW->hItem = pTvInfoTipA->hItem;
  10. pTvInfoTipW->lParam = pTvInfoTipA->lParam;
  11. A2Wbux(pTvInfoTipA->pszText, pTvInfoTipW->pszText);
  12. return pTvInfoTipW;
  13. }
  14. LPNMTVGETINFOTIPA TVInfoTipW2A(LPNMTVGETINFOTIPW pTvInfoTipW, LPNMTVGETINFOTIPA pTvInfoTipA)
  15. {
  16. pTvInfoTipA->cchTextMax = pTvInfoTipW->cchTextMax;
  17. pTvInfoTipA->hdr = pTvInfoTipW->hdr;
  18. pTvInfoTipA->hItem = pTvInfoTipW->hItem;
  19. pTvInfoTipA->lParam = pTvInfoTipW->lParam;
  20. W2Abux(pTvInfoTipW->pszText, pTvInfoTipA->pszText);
  21. return pTvInfoTipA;
  22. }
  23. LPNMTVGETINFOTIP TVInfoTipSameToSame(LPNMTVGETINFOTIP pTvInfoTipIn,
  24. LPNMTVGETINFOTIP pTvInfoTipOut)
  25. {
  26. pTvInfoTipOut->cchTextMax = pTvInfoTipIn->cchTextMax;
  27. pTvInfoTipOut->hdr = pTvInfoTipIn->hdr;
  28. pTvInfoTipOut->hItem = pTvInfoTipIn->hItem;
  29. pTvInfoTipOut->lParam = pTvInfoTipIn->lParam;
  30. StrCpy(pTvInfoTipOut->pszText, pTvInfoTipIn->pszText);
  31. return pTvInfoTipOut;
  32. }
  33. LPRESULTITEMW ResultItemA2W(LPRESULTITEMA pResultItemA, LPRESULTITEMW pResultItemW)
  34. {
  35. pResultItemW->dwNameSpaceItem = pResultItemA->dwNameSpaceItem;
  36. pResultItemW->iDescID = pResultItemA->iDescID;
  37. pResultItemW->iDlgID = pResultItemA->iDlgID;
  38. pResultItemW->iImage = pResultItemA->iImage;
  39. pResultItemW->iNameID = pResultItemA->iNameID;
  40. A2Wbux(pResultItemA->pszName, pResultItemW->pszName);
  41. A2Wbux(pResultItemA->pszDesc, pResultItemW->pszDesc);
  42. pResultItemW->pfnDlgProc = pResultItemA->pfnDlgProc;
  43. return pResultItemW;
  44. }
  45. LPRESULTITEMA ResultItemW2A(LPRESULTITEMW pResultItemW, LPRESULTITEMA pResultItemA)
  46. {
  47. pResultItemA->dwNameSpaceItem = pResultItemW->dwNameSpaceItem;
  48. pResultItemA->iDescID = pResultItemW->iDescID;
  49. pResultItemA->iDlgID = pResultItemW->iDlgID;
  50. pResultItemA->iImage = pResultItemW->iImage;
  51. pResultItemA->iNameID = pResultItemW->iNameID;
  52. W2Abux(pResultItemW->pszName, pResultItemA->pszName);
  53. W2Abux(pResultItemW->pszDesc, pResultItemA->pszDesc);
  54. pResultItemA->pfnDlgProc = pResultItemW->pfnDlgProc;
  55. return pResultItemA;
  56. }
  57. LPRESULTITEM ResultItemSameToSame(LPRESULTITEM pResultItemIn, LPRESULTITEM pResultItemOut)
  58. {
  59. pResultItemOut->dwNameSpaceItem = pResultItemIn->dwNameSpaceItem;
  60. pResultItemOut->iDescID = pResultItemIn->iDescID;
  61. pResultItemOut->iDlgID = pResultItemIn->iDlgID;
  62. pResultItemOut->iImage = pResultItemIn->iImage;
  63. pResultItemOut->iNameID = pResultItemIn->iNameID;
  64. StrCpy(pResultItemOut->pszName, pResultItemIn->pszName);
  65. StrCpy(pResultItemOut->pszDesc, pResultItemIn->pszDesc);
  66. pResultItemOut->pfnDlgProc = pResultItemIn->pfnDlgProc;
  67. return pResultItemOut;
  68. }