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.

237 lines
6.5 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 2001.
  5. //
  6. // File: B I N D V I E W . H
  7. //
  8. // Contents: Function Prototypes
  9. //
  10. // Notes:
  11. //
  12. // Author: Alok Sinha 15-May-01
  13. //
  14. //----------------------------------------------------------------------------
  15. #ifndef _BINDVIEW_H_INCLUDED
  16. #define _BINDVIEW_H_INCLUDED
  17. #include <stdio.h>
  18. #include <stdlib.h>
  19. #include <windows.h>
  20. #include <windowsx.h>
  21. #include <wchar.h>
  22. #include <commctrl.h> // For common controls, e.g. Tree
  23. #include <commdlg.h>
  24. #include <setupapi.h>
  25. #include <devguid.h>
  26. #include "NetCfgAPI.h"
  27. #include "resource.h"
  28. #define ID_STATUS 100
  29. #define APP_NAME L"BindView"
  30. #define CLIENTS_SELECTED 0
  31. #define SERVICES_SELECTED 1
  32. #define PROTOCOLS_SELECTED 2
  33. #define ADAPTERS_SELECTED 3
  34. #define ITEM_NET_COMPONENTS 1
  35. #define ITEM_NET_BINDINGS 2
  36. #define ITEM_NET_ADAPTERS 4
  37. #define DEFAULT_COMPONENT_SELECTED CLIENTS_SELECTED
  38. #define WM_NO_COMPONENTS WM_USER+1
  39. #define MENUITEM_ENABLE L"Enable"
  40. #define MENUITEM_DISABLE L"Disable"
  41. extern HINSTANCE hInstance;
  42. extern const GUID *pguidNetClass [];
  43. extern LPWSTR lpszNetClass [];
  44. typedef struct _BIND_UNBIND_INFO {
  45. LPWSTR lpszInfId;
  46. BOOL fBindTo;
  47. } BIND_UNBIND_INFO, *LPBIND_UNBIND_INFO;
  48. //
  49. // Functions defined in bindview.cpp
  50. //
  51. INT_PTR CALLBACK MainDlgProc (HWND hwndDlg,
  52. UINT uMsg,
  53. WPARAM wParam,
  54. LPARAM lParam);
  55. INT_PTR CALLBACK BindComponentDlg (HWND hwndDlg,
  56. UINT uMsg,
  57. WPARAM wParam,
  58. LPARAM lParam);
  59. INT_PTR CALLBACK InstallDlg (HWND hwndDlg,
  60. UINT uMsg,
  61. WPARAM wParam,
  62. LPARAM lParam);
  63. INT_PTR CALLBACK UninstallDlg (HWND hwndDlg,
  64. UINT uMsg,
  65. WPARAM wParam,
  66. LPARAM lParam);
  67. VOID DumpBindings (LPWSTR lpszFile);
  68. VOID InstallSelectedComponentType (HWND hwndDlg,
  69. LPWSTR lpszInfFile);
  70. HRESULT GetPnpID (LPWSTR lpszInfFile,
  71. LPWSTR *lppszPnpID);
  72. HRESULT GetKeyValue (HINF hInf,
  73. LPCWSTR lpszSection,
  74. LPCWSTR lpszKey,
  75. DWORD dwIndex,
  76. LPWSTR *lppszValue);
  77. VOID UninstallSelectedComponent (HWND hwndDlg);
  78. VOID ExpandCollapseAll (HWND hwndTree,
  79. HTREEITEM hTreeItem,
  80. UINT uiFlag);
  81. BOOL GetFileName (HWND hwndDlg,
  82. LPWSTR lpszFilter,
  83. LPWSTR lpszTitle,
  84. DWORD dwFlags,
  85. LPWSTR lpszFile);
  86. VOID ProcessRightClick (LPNMHDR lpnm);
  87. VOID ShowComponentMenu (HWND hwndOwner,
  88. HTREEITEM hItem,
  89. LPARAM lParam);
  90. VOID ShowBindingPathMenu (HWND hwndOwner,
  91. HTREEITEM hItem,
  92. LPARAM lParam,
  93. BOOL fEnabled);
  94. BOOL GetItemInfo (HWND hwndTree,
  95. HTREEITEM hItem,
  96. LPARAM *lParam,
  97. LPDWORD lpdwItemType,
  98. BOOL *fEnabled);
  99. HTREEITEM AddBindNameToTree (INetCfgBindingPath *pncbp,
  100. HWND hwndTree,
  101. HTREEITEM hParent,
  102. ULONG ulIndex);
  103. HTREEITEM AddToTree (HWND hwndTree,
  104. HTREEITEM hParent,
  105. INetCfgComponent *pncc);
  106. VOID RefreshAll (HWND hwndDlg);
  107. VOID RefreshItemState (HWND hwndTree,
  108. HTREEITEM hItem,
  109. BOOL fEnable);
  110. VOID RefreshBindings (HWND hwndTree,
  111. LPWSTR lpszInfId);
  112. VOID ReleaseMemory (HWND hwndTree,
  113. HTREEITEM hTreeItem);
  114. VOID DeleteChildren (HWND hwndTree,
  115. HTREEITEM hTreeItem);
  116. HTREEITEM InsertItem (HWND hwndTree,
  117. UINT uiType);
  118. BOOL UpdateComponentTypeList (HWND hwndTypeList);
  119. VOID ErrMsg (HRESULT hr,
  120. LPCWSTR lpFmt,
  121. ...);
  122. //
  123. // Functions defined in component.cpp
  124. //
  125. VOID HandleComponentOperation (HWND hwndOwner,
  126. ULONG ulSelection,
  127. HTREEITEM hItem,
  128. LPARAM lParam);
  129. VOID BindUnbindComponents( HWND hwndOwner,
  130. HTREEITEM hItem,
  131. LPWSTR lpszInfId,
  132. BOOL fBindTo);
  133. HRESULT InstallComponent (HWND hwndDlg,
  134. const GUID *pguidClass);
  135. HRESULT InstallSpecifiedComponent (LPWSTR lpszInfFile,
  136. LPWSTR lpszPnpID,
  137. const GUID *pguidClass);
  138. DWORD ListCompToBindUnbind (LPWSTR lpszInfId,
  139. UINT uiType,
  140. HWND hwndTree,
  141. BOOL fBound);
  142. BOOL BindUnbind (LPWSTR lpszInfId,
  143. HWND hwndTree,
  144. BOOL fBind);
  145. VOID ListInstalledComponents (HWND hwndTree,
  146. const GUID *pguidClass);
  147. HRESULT UninstallComponent (LPWSTR lpszInfId);
  148. //
  149. // Functions defined in binding.cpp
  150. //
  151. VOID WriteBindings (FILE *fp);
  152. VOID WriteBindingPath (FILE *fp,
  153. INetCfgComponent *pncc);
  154. VOID WriteInterfaces (FILE *fp,
  155. INetCfgBindingPath *pncbp);
  156. BOOL EnumNetBindings (HWND hwndTree,
  157. UINT uiTypeSelected);
  158. VOID ListBindings (INetCfgComponent *pncc,
  159. HWND hwndTree,
  160. HTREEITEM hTreeItemRoot);
  161. VOID ListInterfaces (INetCfgBindingPath *pncbp,
  162. HWND hwndTree,
  163. HTREEITEM hTreeItemRoot);
  164. VOID HandleBindingPathOperation (HWND hwndOwner,
  165. ULONG ulSelection,
  166. HTREEITEM hItem,
  167. LPARAM lParam);
  168. VOID EnableBindingPath (HWND hwndOwner,
  169. HTREEITEM hItem,
  170. LPWSTR lpszTokenPath,
  171. BOOL fEnable);
  172. LPWSTR GetComponentId (HWND hwndTree,
  173. HTREEITEM hItem);
  174. INetCfgBindingPath *FindBindingPath (INetCfg *pnc,
  175. LPWSTR lpszInfId,
  176. LPWSTR lpszPathTokenSelected);
  177. #endif