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.

239 lines
6.8 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. LPWSTR lpszDefExt,
  87. BOOL fSave);
  88. VOID ProcessRightClick (LPNMHDR lpnm);
  89. VOID ShowComponentMenu (HWND hwndOwner,
  90. HTREEITEM hItem,
  91. LPARAM lParam);
  92. VOID ShowBindingPathMenu (HWND hwndOwner,
  93. HTREEITEM hItem,
  94. LPARAM lParam,
  95. BOOL fEnabled);
  96. BOOL GetItemInfo (HWND hwndTree,
  97. HTREEITEM hItem,
  98. LPARAM *lParam,
  99. LPDWORD lpdwItemType,
  100. BOOL *fEnabled);
  101. HTREEITEM AddBindNameToTree (INetCfgBindingPath *pncbp,
  102. HWND hwndTree,
  103. HTREEITEM hParent,
  104. ULONG ulIndex);
  105. HTREEITEM AddToTree (HWND hwndTree,
  106. HTREEITEM hParent,
  107. INetCfgComponent *pncc);
  108. VOID RefreshAll (HWND hwndDlg);
  109. VOID RefreshItemState (HWND hwndTree,
  110. HTREEITEM hItem,
  111. BOOL fEnable);
  112. VOID RefreshBindings (HWND hwndTree,
  113. LPWSTR lpszInfId);
  114. VOID ReleaseMemory (HWND hwndTree,
  115. HTREEITEM hTreeItem);
  116. VOID DeleteChildren (HWND hwndTree,
  117. HTREEITEM hTreeItem);
  118. HTREEITEM InsertItem (HWND hwndTree,
  119. UINT uiType);
  120. BOOL UpdateComponentTypeList (HWND hwndTypeList);
  121. VOID ErrMsg (HRESULT hr,
  122. LPCWSTR lpFmt,
  123. ...);
  124. //
  125. // Functions defined in component.cpp
  126. //
  127. VOID HandleComponentOperation (HWND hwndOwner,
  128. ULONG ulSelection,
  129. HTREEITEM hItem,
  130. LPARAM lParam);
  131. VOID BindUnbindComponents( HWND hwndOwner,
  132. HTREEITEM hItem,
  133. LPWSTR lpszInfId,
  134. BOOL fBindTo);
  135. HRESULT InstallComponent (HWND hwndDlg,
  136. const GUID *pguidClass);
  137. HRESULT InstallSpecifiedComponent (LPWSTR lpszInfFile,
  138. LPWSTR lpszPnpID,
  139. const GUID *pguidClass);
  140. DWORD ListCompToBindUnbind (LPWSTR lpszInfId,
  141. UINT uiType,
  142. HWND hwndTree,
  143. BOOL fBound);
  144. BOOL BindUnbind (LPWSTR lpszInfId,
  145. HWND hwndTree,
  146. BOOL fBind);
  147. VOID ListInstalledComponents (HWND hwndTree,
  148. const GUID *pguidClass);
  149. HRESULT UninstallComponent (LPWSTR lpszInfId);
  150. //
  151. // Functions defined in binding.cpp
  152. //
  153. VOID WriteBindings (FILE *fp);
  154. VOID WriteBindingPath (FILE *fp,
  155. INetCfgComponent *pncc);
  156. VOID WriteInterfaces (FILE *fp,
  157. INetCfgBindingPath *pncbp);
  158. BOOL EnumNetBindings (HWND hwndTree,
  159. UINT uiTypeSelected);
  160. VOID ListBindings (INetCfgComponent *pncc,
  161. HWND hwndTree,
  162. HTREEITEM hTreeItemRoot);
  163. VOID ListInterfaces (INetCfgBindingPath *pncbp,
  164. HWND hwndTree,
  165. HTREEITEM hTreeItemRoot);
  166. VOID HandleBindingPathOperation (HWND hwndOwner,
  167. ULONG ulSelection,
  168. HTREEITEM hItem,
  169. LPARAM lParam);
  170. VOID EnableBindingPath (HWND hwndOwner,
  171. HTREEITEM hItem,
  172. LPWSTR lpszTokenPath,
  173. BOOL fEnable);
  174. LPWSTR GetComponentId (HWND hwndTree,
  175. HTREEITEM hItem);
  176. INetCfgBindingPath *FindBindingPath (INetCfg *pnc,
  177. LPWSTR lpszInfId,
  178. LPWSTR lpszPathTokenSelected);
  179. #endif