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.

192 lines
5.1 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1997.
  5. //
  6. // File: U T I L. H
  7. //
  8. // Contents: Utility functions shared within lanui
  9. //
  10. //
  11. //----------------------------------------------------------------------------
  12. #pragma once
  13. #include "chklist.h"
  14. #include "ncnetcfg.h"
  15. #include "netcon.h"
  16. #include "wzcsapi.h"
  17. extern const WCHAR c_szEmpty[];
  18. //
  19. // image state entries
  20. //
  21. const UINT SELS_INTENTCHECKED = 0x1;
  22. const UINT SELS_CHECKED = 0x2;
  23. const UINT SELS_UNCHECKED = 0x3;
  24. const UINT SELS_FIXEDBINDING_DISABLED = 0x4;
  25. const UINT SELS_FIXEDBINDING_ENABLED = 0x5;
  26. const UINT SELS_INTERMEDIATE = 0x6;
  27. struct NET_ITEM_DATA
  28. {
  29. INetCfgComponent * pncc;
  30. CComponentObj * pCompObj;
  31. PWSTR szwName;
  32. PWSTR szwDesc;
  33. DWORD dwFlags;
  34. };
  35. struct HANDLES
  36. {
  37. HWND m_hList;
  38. HWND m_hAdd;
  39. HWND m_hRemove;
  40. HWND m_hProperty;
  41. HWND m_hDescription;
  42. };
  43. // Function prototypes
  44. HRESULT HrInitCheckboxListView(HWND hwndList,
  45. HIMAGELIST* philStateIcons,
  46. SP_CLASSIMAGELIST_DATA* pcild);
  47. HRESULT HrInitListView(HWND hwndList,
  48. INetCfg* pnc,
  49. INetCfgComponent * pnccAdapter,
  50. ListBPObj * plistBindingPaths,
  51. HIMAGELIST* philStateIcons);
  52. VOID UninitListView(HWND hwndList);
  53. HRESULT HrRefreshListView(HWND hwndList,
  54. INetCfg* pnc,
  55. INetCfgComponent * pnccAdapter,
  56. ListBPObj * plistBindingPaths);
  57. HRESULT HrLvGetSelectedComponent(HWND hwndList,
  58. INetCfgComponent **pncc);
  59. VOID LvDeleteItem(HWND hwndList, int iItem);
  60. HRESULT HrLvRemove(HWND hwndLV, HWND hwndParent,
  61. INetCfg *pnc, INetCfgComponent *pnccAdapter,
  62. ListBPObj * plistBindingPaths);
  63. HRESULT HrLvAdd(HWND hwndLV, HWND hwndParent, INetCfg *pnc,
  64. INetCfgComponent *pnccAdapter,
  65. ListBPObj * plistBindingPaths);
  66. HRESULT HrLvProperties(HWND hwndLV, HWND hwndParent, INetCfg *pnc,
  67. IUnknown *punk, INetCfgComponent *pnccAdapter,
  68. ListBPObj * plistBindingPaths,
  69. BOOL *bChanged);
  70. INT OnListClick(HWND hwndList,
  71. HWND hwndParent,
  72. INetCfg *pnc,
  73. IUnknown *punk,
  74. INetCfgComponent *pnccAdapter,
  75. ListBPObj * plistBindingPaths,
  76. BOOL fDoubleClk,
  77. BOOL fReadOnly = FALSE);
  78. HRESULT HrToggleLVItemState(HWND hwndList,
  79. ListBPObj * plistBindingPaths,
  80. INT iItem);
  81. INT OnListKeyDown(HWND hwndList, ListBPObj * plistBindingPaths, WORD wVKey);
  82. VOID LvSetButtons(HWND hwndParent, HANDLES& h, BOOL fReadOnly, IUnknown *punk);
  83. VOID LvReportErrorHr(HRESULT hr, INT ids, HWND hwnd, PCWSTR szDesc);
  84. VOID LvReportError(INT ids, HWND hwnd, PCWSTR szDesc, PCWSTR szText);
  85. HRESULT HrRefreshAll(HWND hwndList,
  86. INetCfg* pnc,
  87. INetCfgComponent * pnccAdapter,
  88. ListBPObj * plistBindingPaths);
  89. VOID ReleaseAll(HWND hwndList,
  90. ListBPObj * plistBindingPaths);
  91. BOOL FValidatePageContents( HWND hwndDlg,
  92. HWND hwndList,
  93. INetCfg * pnc,
  94. INetCfgComponent * pnccAdapter,
  95. ListBPObj * plistBindingPaths);
  96. //
  97. // EAPOL related funtions
  98. //
  99. HRESULT
  100. HrElSetCustomAuthData (
  101. IN WCHAR *pwszGuid,
  102. IN DWORD dwEapTypeId,
  103. IN DWORD dwSizeOfSSID,
  104. IN BYTE *pbSSID,
  105. IN BYTE *pbConnInfo,
  106. IN DWORD dwInfoSize);
  107. HRESULT
  108. HrElGetCustomAuthData (
  109. IN WCHAR *pwszGuid,
  110. IN DWORD dwEapTypeId,
  111. IN DWORD dwSizeOfSSID,
  112. IN BYTE *pbSSID,
  113. IN BYTE *pbConnInfo,
  114. IN DWORD *pdwInfoSize);
  115. HRESULT
  116. HrElSetInterfaceParams (
  117. IN WCHAR *pwszGUID,
  118. IN EAPOL_INTF_PARAMS *pIntfParams);
  119. HRESULT
  120. HrElGetInterfaceParams (
  121. IN WCHAR *pwszGUID,
  122. IN OUT EAPOL_INTF_PARAMS *pIntfParams);
  123. VOID
  124. ComboBox_SetCurSelNotify(
  125. IN HWND hwndLb,
  126. IN INT nIndex );
  127. VOID
  128. ComboBox_AutoSizeDroppedWidth(
  129. IN HWND hwndLb );
  130. INT
  131. ComboBox_AddItem(
  132. IN HWND hwndLb,
  133. IN LPCTSTR pszText,
  134. IN VOID* pItem );
  135. VOID*
  136. ComboBox_GetItemDataPtr(
  137. IN HWND hwndLb,
  138. IN INT nIndex );
  139. TCHAR*
  140. ComboBox_GetPsz(
  141. IN HWND hwnd,
  142. IN INT nIndex );
  143. BOOL
  144. ElCanEapolRunOnInterface (
  145. IN INetConnection * m_pconn);
  146. #ifdef ENABLETRACE
  147. VOID PrintBindingPath (
  148. TRACETAGID ttidToTrace,
  149. INetCfgBindingPath* pncbp,
  150. PCSTR pszaExtraText);
  151. #else
  152. #define PrintBindingPath(a, b, c)
  153. #endif //ENABLETRACE