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.

166 lines
7.4 KiB

  1. //
  2. // NetConn.h
  3. //
  4. // Header file for APIs exported by NConn32.dll
  5. //
  6. // History:
  7. //
  8. // 3/12/1999 KenSh Created
  9. // 9/29/1999 KenSh Changed JetNet stuff to NetConn for HNW
  10. //
  11. #ifndef __NETCONN_H__
  12. #define __NETCONN_H__
  13. // Callback procedure - return TRUE to continue, FALSE to abort
  14. typedef BOOL (CALLBACK FAR* PROGRESS_CALLBACK)(LPVOID pvParam, DWORD dwCurrent, DWORD dwTotal);
  15. // NetConn return values
  16. //
  17. #define FACILITY_NETCONN 0x0177
  18. #define NETCONN_SUCCESS MAKE_HRESULT(SEVERITY_SUCCESS, FACILITY_NETCONN, 0x0000)
  19. #define NETCONN_NEED_RESTART MAKE_HRESULT(SEVERITY_SUCCESS, FACILITY_NETCONN, 0x0001)
  20. #define NETCONN_ALREADY_INSTALLED MAKE_HRESULT(SEVERITY_SUCCESS, FACILITY_NETCONN, 0x0002)
  21. #define NETCONN_NIC_INSTALLED MAKE_HRESULT(SEVERITY_SUCCESS, FACILITY_NETCONN, 0x0003)
  22. #define NETCONN_NIC_INSTALLED_OTHER MAKE_HRESULT(SEVERITY_SUCCESS, FACILITY_NETCONN, 0x0004)
  23. #define NETCONN_UNKNOWN_ERROR MAKE_HRESULT(SEVERITY_ERROR, FACILITY_NETCONN, 0x0000)
  24. #define NETCONN_USER_ABORT MAKE_HRESULT(SEVERITY_ERROR, FACILITY_NETCONN, 0x0001)
  25. #define NETCONN_PROTOCOL_NOT_FOUND MAKE_HRESULT(SEVERITY_ERROR, FACILITY_NETCONN, 0x0002)
  26. #define NETCONN_NOT_IMPLEMENTED MAKE_HRESULT(SEVERITY_ERROR, FACILITY_NETCONN, 0x0003)
  27. #define NETCONN_WRONG_PLATFORM MAKE_HRESULT(SEVERITY_ERROR, FACILITY_NETCONN, 0x0004)
  28. #define NETCONN_MISSING_DLL MAKE_HRESULT(SEVERITY_ERROR, FACILITY_NETCONN, 0x0005)
  29. #define NETCONN_OS_NOT_SUPPORTED MAKE_HRESULT(SEVERITY_ERROR, FACILITY_NETCONN, 0x0006)
  30. #define NETCONN_INVALID_ARGUMENT MAKE_HRESULT(SEVERITY_ERROR, FACILITY_NETCONN, 0x0007)
  31. #define SZ_CLASS_ADAPTER L"Net"
  32. #define SZ_CLASS_CLIENT L"NetClient"
  33. #define SZ_CLASS_PROTOCOL L"NetTrans"
  34. #define SZ_CLASS_SERVICE L"NetService"
  35. #define SZ_PROTOCOL_TCPIP L"MSTCP"
  36. #define SZ_PROTOCOL_NETBEUI L"NETBEUI"
  37. #define SZ_PROTOCOL_IPXSPX L"NWLINK"
  38. #define SZ_SERVICE_VSERVER L"VSERVER"
  39. #define SZ_CLIENT_MICROSOFT L"VREDIR"
  40. #define SZ_CLIENT_NETWARE L"NWREDIR"
  41. #define NIC_UNKNOWN 0x00
  42. #define NIC_VIRTUAL 0x01
  43. #define NIC_ISA 0x02
  44. #define NIC_PCI 0x03
  45. #define NIC_PCMCIA 0x04
  46. #define NIC_USB 0x05
  47. #define NIC_PARALLEL 0x06
  48. #define NIC_MF 0x07
  49. #define NIC_1394 0x08 // NDIS 1394 Net Adapter
  50. #define NETTYPE_LAN 0x00 // a network card
  51. #define NETTYPE_DIALUP 0x01 // a Dial-Up Networking adapter
  52. #define NETTYPE_IRDA 0x02 // an IrDA connection
  53. #define NETTYPE_PPTP 0x03 // a virtual private networking adapter for PPTP
  54. #define NETTYPE_TV 0x04 // a TV adapter
  55. #define NETTYPE_ISDN 0x05 // ISDN adapter
  56. #define SUBTYPE_NONE 0x00 // nothing special
  57. #define SUBTYPE_ICS 0x01 // ICS adapter (NIC_VIRTUAL, NETTYPE_LAN)
  58. #define SUBTYPE_AOL 0x02 // AOL adapter (NIC_VIRTUAL, NETTYPE_LAN)
  59. #define SUBTYPE_VPN 0x03 // VPN support (NETTYPE_DIALUP)
  60. #define ICS_NONE 0x00 // NIC has no connection to ICS
  61. #define ICS_EXTERNAL 0x01 // NIC is ICS's external adapter
  62. #define ICS_INTERNAL 0x02 // NIC is ICS's internal adapter
  63. #define NICERR_NONE 0x00 // no error
  64. #define NICERR_MISSING 0x01 // device is in registry but not physically present
  65. #define NICERR_DISABLED 0x02 // device exists but has been disabled (red X in devmgr)
  66. #define NICERR_BANGED 0x03 // device has a problem (yellow ! in devmgr)
  67. #define NICERR_CORRUPT 0x04 // NIC has class key but no enum key
  68. #define NICWARN_NONE 0x00 // no warning
  69. #define NICWARN_WARNING 0x01 // yellow ! in devmgr, otherwise everything looks ok
  70. #include <pshpack1.h>
  71. typedef struct tagNETADAPTER {
  72. WCHAR szDisplayName[260]; // so-called friendly name of adapter
  73. WCHAR szDeviceID[260]; // e.g. "PCI\VEN_10b7&DEV_9050"
  74. WCHAR szEnumKey[260]; // e.g. "Enum\PCI\VEN_10b7&DEV_9050&SUBSYS_00000000&REV_00\407000"
  75. WCHAR szClassKey[40]; // PnP-assigned class name + ID, e.g. "Net\0000"
  76. WCHAR szManufacturer[60]; // Company that manufactured the card, e.g. "3Com"
  77. WCHAR szInfFileName[50]; // File title of INF file, e.g. "NETEL90X.INF"
  78. BYTE bNicType; // a NIC_xxx constant, defined above
  79. BYTE bNetType; // a NETTYPE_xxx constant, defined above
  80. BYTE bNetSubType; // a SUBTYPE_xxx constant, defined above
  81. BYTE bIcsStatus; // an ICS_xxx constant, defined above
  82. BYTE bError; // a NICERR_xxx constant, defined above
  83. BYTE bWarning; // a NICWARN_xxx constant, defined above
  84. DWORD devnode; // configmg device node
  85. } NETADAPTER;
  86. typedef struct tagNETSERVICE {
  87. WCHAR szDisplayName[260]; // (supposedly) friendly name of service
  88. WCHAR szDeviceID[260]; // e.g. "VSERVER"
  89. WCHAR szClassKey[40]; // PnP-assigned class name + ID, e.g. "NetService\0000"
  90. } NETSERVICE;
  91. #include <poppack.h>
  92. #ifdef __cplusplus
  93. extern "C" {
  94. #endif
  95. // NCONN32.DLL exported functions
  96. //
  97. // NOTE: if you change anything here, change NConn32.cpp also!!
  98. //
  99. LPVOID WINAPI NetConnAlloc(DWORD cbAlloc);
  100. VOID WINAPI NetConnFree(LPVOID pMem);
  101. BOOL WINAPI IsProtocolInstalled(LPCWSTR pszProtocolDeviceID, BOOL bExhaustive);
  102. HRESULT WINAPI InstallProtocol(LPCWSTR pszProtocol, HWND hwndParent, PROGRESS_CALLBACK pfnCallback, LPVOID pvCallbackParam);
  103. HRESULT WINAPI InstallTCPIP(HWND hwndParent, PROGRESS_CALLBACK pfnProgress, LPVOID pvProgressParam);
  104. HRESULT WINAPI RemoveProtocol(LPCWSTR pszProtocol);
  105. BOOL WINAPI IsMSClientInstalled(BOOL bExhaustive);
  106. HRESULT WINAPI InstallMSClient(HWND hwndParent, PROGRESS_CALLBACK pfnProgress, LPVOID pvProgressParam);
  107. HRESULT WINAPI EnableBrowseMaster();
  108. BOOL WINAPI IsSharingInstalled(BOOL bExhaustive);
  109. BOOL WINAPI IsFileSharingEnabled();
  110. BOOL WINAPI IsPrinterSharingEnabled();
  111. HRESULT WINAPI InstallSharing(HWND hwndParent, PROGRESS_CALLBACK pfnProgress, LPVOID pvProgressParam);
  112. BOOL WINAPI FindConflictingService(LPCWSTR pszWantService, NETSERVICE* pConflict);
  113. HRESULT WINAPI EnableSharingAppropriately();
  114. int WINAPI EnumNetAdapters(NETADAPTER FAR** pprgNetAdapters);
  115. HRESULT WINAPI InstallNetAdapter(LPCWSTR pszDeviceID, LPCWSTR pszInfPath, HWND hwndParent, PROGRESS_CALLBACK pfnProgress, LPVOID pvCallbackParam);
  116. BOOL WINAPI IsAccessControlUserLevel();
  117. HRESULT WINAPI DisableUserLevelAccessControl();
  118. HRESULT WINAPI EnableQuickLogon();
  119. BOOL WINAPI IsProtocolBoundToAdapter(LPCWSTR pszProtocolID, const NETADAPTER* pAdapter);
  120. HRESULT WINAPI EnableNetAdapter(const NETADAPTER* pAdapter);
  121. BOOL WINAPI IsClientInstalled(LPCWSTR pszClient, BOOL bExhaustive);
  122. HRESULT WINAPI RemoveClient(LPCWSTR pszClient);
  123. HRESULT WINAPI RemoveGhostedAdapters(LPCWSTR pszDeviceID);
  124. HRESULT WINAPI RemoveUnknownAdapters(LPCWSTR pszDeviceID);
  125. BOOL WINAPI DoesAdapterMatchDeviceID(const NETADAPTER* pAdapter, LPCWSTR pszDeviceID);
  126. BOOL WINAPI IsAdapterBroadband(const NETADAPTER* pAdapter);
  127. void WINAPI SaveBroadbandSettings(LPCWSTR pszBroadbandAdapterNumber);
  128. BOOL WINAPI UpdateBroadbandSettings(LPWSTR pszEnumKeyBuf, int cchEnumKeyBuf);
  129. HRESULT WINAPI DetectHardware(LPCWSTR pszDeviceID);
  130. int WINAPI EnumMatchingNetBindings(LPCWSTR pszParentBinding, LPCWSTR pszDeviceID, LPWSTR** pprgBindings);
  131. HRESULT WINAPI RestartNetAdapter(DWORD devnode);
  132. HRESULT WINAPI HrFromLastWin32Error();
  133. HRESULT WINAPI HrWideCharToMultiByte( const WCHAR* szwString, char** ppszString );
  134. HRESULT WINAPI HrEnableDhcp( VOID* pContext, DWORD dwFlags );
  135. BOOLEAN WINAPI IsAdapterDisconnected( VOID* pContext );
  136. HRESULT WINAPI IcsUninstall(void);
  137. #ifdef __cplusplus
  138. }
  139. #endif
  140. #endif // !__NETCONN_H__