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.1 KiB

  1. /**********************************************************
  2. (C) 2001 Microsoft Corp.
  3. File : utils.h
  4. ***********************************************************/
  5. #ifndef _UTILS_H_
  6. #define _UTILS_H_
  7. #include "msgrua.h"
  8. #ifdef DEBUG
  9. #define FAILED_HR(msg, hr) (FAILED(hr)?OutMessageBox(_T("Line: %d\n") msg ,__LINE__,GetStringFromError(hr)):0)
  10. #define DEBUG_MSG(msg) OutMessageBox(_T("Remote Assistance Error\nLine: %d\n") msg, __LINE__)
  11. #else
  12. #define FAILED_HR(msg,hr) (FAILED(hr)?TraceSpew(msg,GetStringFromError(hr)):0)
  13. #define DEBUG_MSG(msg) TraceSpew(_T("%s"), msg)
  14. #endif
  15. #include "mdisp.h"
  16. #include "basicim.h"
  17. #include "sessions.h"
  18. #define MAXBUFSIZE 2000
  19. void PrintDefaultVal(LPSTR szVal, int id, HWND hDlg);
  20. LPCTSTR GetStringFromCOMError(HRESULT hr);
  21. LPCTSTR GetStringFromError(HRESULT hr);
  22. LPCTSTR GetStringFromBasicIMError(HRESULT hr);
  23. LPCTSTR GetStringFromSessionState(SESSION_STATE ss);
  24. LPCTSTR GetStringFromLockAndKeyStatus(long lK);
  25. LPCTSTR GetStringFromContactStatus(MISTATUS bs);
  26. LPCTSTR GetStringFromServiceStatus(MSVCSTATUS bs);
  27. LPCTSTR GetStringFromUserProperty(MUSERPROPERTY ps);
  28. LPCTSTR GetStringFromProfileField(MPFLFIELD fl);
  29. LPCTSTR GetStringFromVoiceSessionState(VOICESESSIONSTATE vs);
  30. LPCTSTR GetStringFromMURLType(MURLTYPE mt);
  31. HRESULT HrEncode64 (LPSTR lpszTextIn, LPSTR lpszTextOut, DWORD dwOutLen);
  32. LPCTSTR GetStringFromState(long lK);
  33. LPCTSTR GetStringFromBasicIMState(long lK);
  34. LPCTSTR GetStringFromMessagePrivacy(long lK);
  35. LPCTSTR GetStringFromPrompt(long lK);
  36. LPCTSTR GetStringFromEventId(long dispid);
  37. LPCTSTR GetStringFromSessionEventId(long dispid);
  38. LPCTSTR GetStringFromLocalOption(long lK);
  39. LPCTSTR GetStringFromInboxFolder(long lK);
  40. LPCTSTR GetStringFromProxyType(long lK);
  41. HRESULT LPTSTR_to_BSTR (BSTR *pbstr, LPCTSTR psz);
  42. HRESULT BSTR_to_LPTSTR (LPTSTR *ppsz, BSTR bstr);
  43. BOOL _cdecl OutMessageBox(LPCTSTR sFormat, ...);
  44. int GetDigit(int iLen);
  45. #ifdef UNICODE
  46. #define TraceSpew TraceSpewW
  47. #else
  48. #define TraceSpew TraceSpewA
  49. #endif
  50. BOOL TraceSpewA(LPCSTR sFormat, ...);
  51. BOOL TraceSpewW(WCHAR* sFormat, ...);
  52. #endif // _UTILS_H_