Source code of Windows XP (NT5)
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.

76 lines
1.6 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1997 - 1999
  6. //
  7. // File: SnpUtils.h
  8. //
  9. //--------------------------------------------------------------------------
  10. #pragma once
  11. #define DimensionOf(rgx) (sizeof((rgx)) / sizeof(*(rgx)))
  12. inline BOOL FHrFailed(HRESULT hr)
  13. {
  14. return FAILED(hr);
  15. }
  16. #define CORg(hResult) \
  17. do\
  18. {\
  19. hr = (hResult);\
  20. if (FHrFailed(hr))\
  21. {\
  22. goto Error;\
  23. }\
  24. }\
  25. while (FALSE)
  26. #define CWRg(hResult) \
  27. do\
  28. {\
  29. hr = (DWORD) hResult;\
  30. hr = HRESULT_FROM_WIN32(hr);\
  31. if (FHrFailed(hr))\
  32. {\
  33. goto Error;\
  34. }\
  35. }\
  36. while (FALSE)
  37. LPCTSTR GetErrorMessage(HRESULT hr);
  38. void ReportError(UINT uMsgId, HRESULT hr);
  39. HRESULT CreateWirelessPolicyDataBuffer(PWIRELESS_POLICY_DATA * ppPolicy);
  40. void FreeAndThenDupString(LPWSTR * ppwszDest, LPCWSTR pwszSource);
  41. void SSIDDupString(WCHAR *ppwszDest, LPCWSTR pwszSource);
  42. BOOL IsDuplicateSSID(CString &, DWORD, PWIRELESS_POLICY_DATA, DWORD);
  43. HRESULT DeleteWirelessPolicy(
  44. HANDLE hPolicyStore,
  45. PWIRELESS_POLICY_DATA pPolicy
  46. );
  47. HPROPSHEETPAGE MyCreatePropertySheetPage(PROPSHEETPAGE* ppsp);
  48. class CThemeContextActivator
  49. {
  50. public:
  51. CThemeContextActivator() : m_ulActivationCookie(0)
  52. { SHActivateContext (&m_ulActivationCookie); }
  53. ~CThemeContextActivator()
  54. { SHDeactivateContext (m_ulActivationCookie); }
  55. private:
  56. ULONG_PTR m_ulActivationCookie;
  57. };
  58. void
  59. SetLargeFont(HWND dialog, int bigBoldResID);