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.

159 lines
4.0 KiB

  1. #include "pch.h"
  2. #pragma hdrstop
  3. /*-----------------------------------------------------------------------------
  4. / Local functions / data
  5. /----------------------------------------------------------------------------*/
  6. static WCHAR c_szQueryPrefix[] = L"(objectClass=nTFRSMember)";
  7. static LPWSTR c_szClassList[] =
  8. {
  9. L"nTFRSMember",
  10. };
  11. static PAGECTRL ctrls[] =
  12. {
  13. IDC_DOMNAME, c_szName, FILTER_CONTAINS,
  14. IDC_DOMDESC, c_szDescription, FILTER_CONTAINS,
  15. };
  16. static COLUMNINFO columns[] =
  17. {
  18. 0, 0, IDS_CN, 0, c_szDistinguishedName,
  19. 0, DEFAULT_WIDTH_DESCRIPTION, IDS_DESCRIPTION, 0, c_szDescription,
  20. };
  21. //
  22. // Help ID mappings
  23. //
  24. static DWORD const aFormHelpIDs[] =
  25. {
  26. 0, 0
  27. };
  28. /*-----------------------------------------------------------------------------
  29. / PageProc_FrsMember
  30. / ------------------
  31. / PageProc for handling the messages for this object.
  32. /
  33. / In:
  34. / pPage -> instance data for this form
  35. / hwnd = window handle for the form dialog
  36. / uMsg, wParam, lParam = message parameters
  37. /
  38. / Out:
  39. / HRESULT (E_NOTIMPL) if not handled
  40. /----------------------------------------------------------------------------*/
  41. HRESULT CALLBACK PageProc_FrsMember(LPCQPAGE pPage, HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
  42. {
  43. HRESULT hr = S_OK;
  44. LPWSTR pQuery = NULL;
  45. TraceEnter(TRACE_FORMS, "PageProc_FrsMember");
  46. switch ( uMsg )
  47. {
  48. case CQPM_INITIALIZE:
  49. case CQPM_RELEASE:
  50. break;
  51. case CQPM_ENABLE:
  52. EnablePageControls(hwnd, ctrls, ARRAYSIZE(ctrls), (BOOL)wParam);
  53. break;
  54. case CQPM_GETPARAMETERS:
  55. {
  56. hr = GetQueryString(&pQuery, c_szQueryPrefix, hwnd, ctrls, ARRAYSIZE(ctrls));
  57. if ( SUCCEEDED(hr) )
  58. {
  59. hr = QueryParamsAlloc((LPDSQUERYPARAMS*)lParam, pQuery, GLOBAL_HINSTANCE, ARRAYSIZE(columns), columns);
  60. LocalFreeStringW(&pQuery);
  61. }
  62. FailGracefully(hr, "Failed to build DS argument block");
  63. break;
  64. }
  65. case CQPM_CLEARFORM:
  66. ResetPageControls(hwnd, ctrls, ARRAYSIZE(ctrls));
  67. break;
  68. case CQPM_PERSIST:
  69. {
  70. BOOL fRead = (BOOL)wParam;
  71. IPersistQuery* pPersistQuery = (IPersistQuery*)lParam;
  72. hr = PersistQuery(pPersistQuery, fRead, c_szMsFrsMembers, hwnd, ctrls, ARRAYSIZE(ctrls));
  73. FailGracefully(hr, "Failed to persist page");
  74. break;
  75. }
  76. case CQPM_HELP:
  77. {
  78. LPHELPINFO pHelpInfo = (LPHELPINFO)lParam;
  79. WinHelp((HWND)pHelpInfo->hItemHandle,
  80. DSQUERY_HELPFILE,
  81. HELP_WM_HELP,
  82. (DWORD_PTR)aFormHelpIDs);
  83. break;
  84. }
  85. case DSQPM_GETCLASSLIST:
  86. {
  87. hr = ClassListAlloc((LPDSQUERYCLASSLIST*)lParam, c_szClassList, ARRAYSIZE(c_szClassList));
  88. FailGracefully(hr, "Failed to allocate class list");
  89. break;
  90. }
  91. case DSQPM_HELPTOPICS:
  92. {
  93. HWND hwndFrame = (HWND)lParam;
  94. HtmlHelp(hwndFrame, TEXT("omc.chm"), HH_HELP_FINDER, 0);
  95. break;
  96. }
  97. default:
  98. hr = E_NOTIMPL;
  99. break;
  100. }
  101. exit_gracefully:
  102. TraceLeaveResult(hr);
  103. }
  104. /*-----------------------------------------------------------------------------
  105. / DlgProc_FrsMember
  106. / ------------
  107. / Handle dialog specific message for the FRS Members page.
  108. /
  109. / In:
  110. / hwnd, uMsg, wParam, lParam = standard parameters
  111. /
  112. / Out:
  113. / INT_PTR
  114. /----------------------------------------------------------------------------*/
  115. INT_PTR CALLBACK DlgProc_FrsMember(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
  116. {
  117. INT_PTR fResult = 0;
  118. LPCQPAGE pQueryPage;
  119. if ( uMsg == WM_INITDIALOG )
  120. {
  121. pQueryPage = (LPCQPAGE)lParam;
  122. SetWindowLongPtr(hwnd, DWLP_USER, (LONG_PTR)pQueryPage);
  123. Edit_LimitText(GetDlgItem(hwnd, IDC_DOMNAME), MAX_PATH);
  124. Edit_LimitText(GetDlgItem(hwnd, IDC_DOMDESC), MAX_PATH);
  125. }
  126. return fResult;
  127. }