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.

187 lines
7.1 KiB

  1. //**********************************************************************
  2. //
  3. // NETDI.H
  4. //
  5. // Copyright (c) 1995 - Microsoft Corp.
  6. // All rights reserved.
  7. // Microsoft Confidential
  8. //
  9. // Public include file for Chicago Network Device Installer services.
  10. //
  11. //**********************************************************************
  12. #ifndef _INC_NETDI
  13. #define _INC_NETDI // NETDI.H signature
  14. #include <prsht.h> // Property sheet API
  15. #include <setupx.h> // Device Installer API
  16. // Return error codes for NDI_ messages.
  17. #define NDI_ERROR (1200) // ISSUE-2002/01/16-roelfc: see setupx.h for error #
  18. enum _ERR_NET_DEVICE_INSTALL
  19. {
  20. ERR_NDI_ERROR = NDI_ERROR, // generic failure
  21. ERR_NDI_INVALID_HNDI,
  22. ERR_NDI_INVALID_DEVICE_INFO,
  23. ERR_NDI_INVALID_DRIVER_PROC,
  24. ERR_NDI_LOW_MEM,
  25. ERR_NDI_REG_API,
  26. ERR_NDI_NOTBOUND,
  27. ERR_NDI_NO_MATCH,
  28. ERR_NDI_INVALID_NETCLASS,
  29. ERR_NDI_INSTANCE_ONCE,
  30. ERR_NDI_CANCEL,
  31. ERR_NDI_NO_DEFAULT,
  32. };
  33. // Network Driver Info Handle
  34. DECLARE_HANDLE(HNDI);
  35. // Network Driver Installer Callback
  36. typedef RETERR (CALLBACK* NDIPROC)(HNDI, UINT, WPARAM, LPARAM);
  37. RETERR WINAPI DefNdiProc(HNDI,UINT,WPARAM,LPARAM);
  38. // Network Driver Installer Messages
  39. #define NDI_NULL 0x0000
  40. #define NDI_CREATE 0x0001
  41. #define NDI_DESTROY 0x0002
  42. #define NDI_VALIDATE 0x0003
  43. #define NDI_INSTALL 0x0004
  44. // johnri 3/8/84 removed-using property sheets only
  45. //#define NDI_ASSIGNRESOURCES 0x0005
  46. #define NDI_HASPROPPAGES 0x0005
  47. #define NDI_ADDPROPPAGES 0x0006
  48. // lpapp = (LPNDIADDPROPPAGES)lParam;
  49. typedef BOOL (CALLBACK* LPFNADDNDIPROPPAGE)(LPCPROPSHEETPAGE,LPARAM,BOOL);
  50. typedef struct tagNDIADDPROPPAGES
  51. {
  52. LPFNADDNDIPROPPAGE lpfnAddNdiPropPage;
  53. LPARAM lParam;
  54. } NDIADDPROPPAGES, FAR* LPNDIADDPROPPAGES;
  55. #define NDI_REMOVE 0x0007
  56. #define NDI_FIRSTTIMESETUP 0x0008
  57. #define NDI_QUERY_BIND 0x0009
  58. #define NDI_NOTIFY_BIND 0x000A
  59. #define NDI_NOTIFY_UNBIND 0x000B
  60. #define NDI_GETTEXT 0x000C
  61. #define NDI_SETTEXT 0x000D
  62. #define NDI_SYSTEMCHANGE 0x000E
  63. #define NDI_NDICREATE 0x0040
  64. #define NDI_NDIDESTROY 0x0041
  65. // Messages above NDI_INSTALLER are reserved for installer dlls
  66. #define NDI_INSTALLER 0x8000
  67. // Ndi_Create: lParam flags:
  68. #define NDI_CREATE_BATCHMODE 0x00000001
  69. #define NDI_CREATE_NODISPLAY 0x00000002
  70. #define NDI_CREATE_WORKSTATION 0x00000004
  71. // General NDI management
  72. HNDI WINAPI NdiGetFirst(VOID);
  73. HNDI WINAPI NdiGetNext(HNDI hndi);
  74. HNDI WINAPI NdiFindNdi(HNDI ndiRelation, WORD wNetClass, LPCSTR lpszDeviceId);
  75. RETERR WINAPI NdiIsNdi(HNDI hndi);
  76. RETERR WINAPI NdiCallInstaller(HNDI hndi,UINT,WPARAM,LPARAM);
  77. RETERR WINAPI NdiAddNewDriver(HNDI FAR* lphndi, LPDEVICE_INFO lpdi, LPCSTR lpszDeviceID, UINT uFlags);
  78. #define NDI_ADD_NO_DISELECT 0x0001
  79. HNDI WINAPI NdiFindDefNdi( WORD wNetClass );
  80. RETERR WINAPI NdiSetDefNdi( HNDI ndi );
  81. RETERR WINAPI NdiClrDefNdi( HNDI ndi );
  82. HNDI WINAPI NdiChooseCandidateDefNdi( HNDI ndi, WORD wClass );
  83. RETERR WINAPI NdiNeedReboot ( HNDI ndi, DWORD wRebootType );
  84. RETERR WINAPI CreateNdiFromDeviceId (LPCSTR szId);
  85. // Device Manager
  86. RETERR WINAPI NdiValidate(HNDI hndi, HWND hwndParent);
  87. RETERR WINAPI NdiInstall(HNDI hndi);
  88. RETERR WINAPI NdiRemove(HNDI hndi);
  89. RETERR WINAPI NdiProperties(HNDI hndi, HWND hwndParent);
  90. // Bindings
  91. RETERR WINAPI NdiBind(HNDI hndiLower, HNDI hndiUpper);
  92. RETERR WINAPI NdiUnbind(HNDI hndiLower, HNDI hndiUpper);
  93. RETERR WINAPI NdiQueryBind(HNDI hndiLower, HNDI hndiUpper, UINT uBindType);
  94. RETERR WINAPI NdiIsBound(HNDI hndiLower, HNDI hndiUpper);
  95. RETERR WINAPI NdiGetBinding(HNDI hndi, HNDI FAR* lphndi, UINT uBindType);
  96. enum _NDIBIND {
  97. NDIBIND_UPPER = 1,
  98. NDIBIND_UPPER_FIRST = NDIBIND_UPPER,
  99. NDIBIND_UPPER_NEXT,
  100. NDIBIND_LOWER,
  101. NDIBIND_LOWER_FIRST = NDIBIND_LOWER,
  102. NDIBIND_LOWER_NEXT};
  103. // Ndi_SystemChange object properties
  104. RETERR WINAPI NdiSystemChange(UINT uTypeOfChange, HNDI hndi);
  105. enum _NDISYTEMCHANGE { //lpwClass
  106. NDISYSTEMCHANGE_ADD,
  107. NDISYSTEMCHANGE_REMOVE};
  108. // General NDI Object Properties
  109. RETERR WINAPI NdiGetText(HNDI hndi, LPSTR, UINT);
  110. RETERR WINAPI NdiSetText(HNDI hndi, LPSTR);
  111. RETERR WINAPI NdiGetDeviceInfo(HNDI hndi, LPLPDEVICE_INFO);
  112. RETERR WINAPI NdiGetClass(HNDI hndi, LPWORD lpwClass);
  113. enum _NDICLASS { // lpwClass
  114. NDI_CLASS_NET,
  115. NDI_CLASS_TRANS,
  116. NDI_CLASS_CLIENT,
  117. NDI_CLASS_SERVICE};
  118. RETERR WINAPI NdiGetProperties(HNDI hndi, LPVOID FAR* lplpvProperties);
  119. RETERR WINAPI NdiSetProperties(HNDI hndi, LPVOID lpvProperties);
  120. RETERR WINAPI NdiGetOwnerWindow(HNDI hndi, HWND FAR* lphwnd);
  121. RETERR WINAPI NdiGetDeviceId(HNDI hndi, LPSTR, UINT);
  122. RETERR WINAPI NdiGetFlags(HNDI hndi, LPDWORD lpdwFlags);
  123. // hiword is reserved for internal use
  124. #define NDIF_ADDED 0x00000001
  125. #define NDIF_REMOVED 0x00000002
  126. #define NDIF_MODIFIED_BINDINGS 0x00000004
  127. #define NDIF_MODIFIED_PROPERTIES 0x00000008
  128. #define NDIF_SAVE_MASK 0x0000000F
  129. #define NDIF_DEFAULT 0x00000010
  130. #define NDIF_INVISIBLE 0x00000020
  131. #define NDIF_HAS_PARAMS 0x00000040
  132. // Interfaces
  133. RETERR WINAPI NdiCompareInterface(HNDI ndi, UINT uRelation, HNDI ndi2, UINT uRelation2);
  134. RETERR WINAPI NdiGetInterface(HNDI ndi, UINT uRelation, UINT index, LPSTR lpsz, UINT cbSizeOflpsz);
  135. RETERR WINAPI NdiAddInterface(HNDI ndi, UINT uRelation, LPCSTR lpsz);
  136. RETERR WINAPI NdiRemoveInterface(HNDI ndi, UINT uRelation, LPCSTR lpsz);
  137. enum _NDIEDGERELATION {
  138. NDI_EDGE_ALL=100, // used to free all edges and marker for first in edge class
  139. NDI_EDGE_UPPER,
  140. NDI_EDGE_LOWER,
  141. NDI_EDGE_UPPERRANGE,
  142. NDI_EDGE_LOWERRANGE,
  143. NDI_EDGE_REQUIRELOWER,
  144. NDI_EDGE_REQUIREANY,
  145. NDI_EDGE_EXCLUDELOWER,
  146. NDI_EDGE_EXCLUDEANY,
  147. NDI_EDGE_ORGUPPER,
  148. NDI_EDGE_ORGLOWER,
  149. NDI_EDGE_END, // marker only for end of edges
  150. NDI_COMATIBLE_ALL=200, // used to free all edges and marker for first in compatible class
  151. NDI_COMPATIBLE_REQUIREDUPPER,
  152. NDI_COMPATIBLE_REQUIREDLOWER,
  153. NDI_COMPATIBLE_REQUIREDALL,
  154. NDI_COMPATIBLE_REQUIREDANY,
  155. NDI_COMPATIBLE_EXCLUDEUPPER,
  156. NDI_COMPATIBLE_EXCLUDELOWER,
  157. NDI_COMPATIBLE_EXCLUDEALL,
  158. NDI_COMPATIBLE_END }; // marker only for end of edges
  159. // Driver Registry Access
  160. RETERR WINAPI NdiRegOpenKey(HNDI hndi, LPCSTR lpszSubKey, LPHKEY lphk);
  161. RETERR WINAPI NdiRegCreateKey(HNDI hndi, LPCSTR lpszSubKey, LPHKEY lphk);
  162. RETERR WINAPI NdiRegCloseKey(HKEY hkey);
  163. RETERR WINAPI NdiRegQueryValue(HNDI hndi, LPCSTR lpszSubKey, LPCSTR lpszValueName, LPSTR lpValue, DWORD cbValue);
  164. RETERR WINAPI NdiRegSetValue(HNDI hndi, LPCSTR lpszSubKey, LPCSTR lpszValueName, DWORD dwType, LPCSTR lpValue, DWORD cbValue);
  165. RETERR WINAPI NdiRegDeleteValue(HNDI hndi,LPCSTR lpszSubKey, LPCSTR lpszValueName);
  166. // Entry point called by NETCPL.
  167. RETERR WINAPI NdiCplProperties(HWND hwndCpl);
  168. #endif // _INC_NETDI