NspAPI.h
上传用户:dzyhzl
上传日期:2019-04-29
资源大小:56270k
文件大小:19k
源码类别:

模拟服务器

开发平台:

C/C++

  1. /*++
  2. Copyright (c) 1991-1998  Microsoft Corporation
  3. Module Name:
  4.     nspapi.h
  5. Abstract:
  6.     Name Space Provider API prototypes and manifests. See the
  7.     "Windows NT NameSpace Provider Specification" document for
  8.     details.
  9. Environment:
  10.     User Mode -Win32
  11. Notes:
  12.     You must include "basetyps.h" first. Some types should
  13.     use definitions from base files rather than redefine here.
  14.     Unfortunately, so such base file exists.
  15. --*/
  16. #ifndef _NSPAPI_INCLUDED
  17. #define _NSPAPI_INCLUDED
  18. #ifdef __cplusplus
  19. extern "C" {
  20. #endif /* __cplusplus */
  21. #ifndef _tagBLOB_DEFINED
  22. #define _tagBLOB_DEFINED
  23. #define _BLOB_DEFINED
  24. #define _LPBLOB_DEFINED
  25. typedef struct _BLOB {
  26.     ULONG cbSize ;
  27. #ifdef MIDL_PASS
  28.     [size_is(cbSize)] BYTE *pBlobData;
  29. #else  // MIDL_PASS
  30.     BYTE *pBlobData ;
  31. #endif // MIDL_PASS
  32. } BLOB, *LPBLOB ;
  33. #endif
  34. #ifndef GUID_DEFINED
  35. #define GUID_DEFINED
  36. typedef struct _GUID
  37. {
  38.     unsigned long  Data1;
  39.     unsigned short Data2;
  40.     unsigned short Data3;
  41.     unsigned char  Data4[8];
  42. } GUID;
  43. #endif /* GUID_DEFINED */
  44. #ifndef __LPGUID_DEFINED__
  45. #define __LPGUID_DEFINED__
  46. typedef GUID *LPGUID;
  47. #endif
  48. //
  49. // Service categories
  50. //
  51. #define SERVICE_RESOURCE            (0x00000001)
  52. #define SERVICE_SERVICE             (0x00000002)
  53. #define SERVICE_LOCAL               (0x00000004)
  54. //
  55. // Operation used when calling SetService()
  56. //
  57. #define SERVICE_REGISTER            (0x00000001)
  58. #define SERVICE_DEREGISTER          (0x00000002)
  59. #define SERVICE_FLUSH               (0x00000003)
  60. #define SERVICE_ADD_TYPE            (0x00000004)
  61. #define SERVICE_DELETE_TYPE         (0x00000005)
  62. //
  63. // Flags that affect the operations above
  64. //
  65. #define SERVICE_FLAG_DEFER          (0x00000001)
  66. #define SERVICE_FLAG_HARD           (0x00000002)
  67. //
  68. // Used as input to GetService() for setting the dwProps parameter
  69. //
  70. #define PROP_COMMENT                (0x00000001)
  71. #define PROP_LOCALE                 (0x00000002)
  72. #define PROP_DISPLAY_HINT           (0x00000004)
  73. #define PROP_VERSION                (0x00000008)
  74. #define PROP_START_TIME             (0x00000010)
  75. #define PROP_MACHINE                (0x00000020)
  76. #define PROP_ADDRESSES              (0x00000100)
  77. #define PROP_SD                     (0x00000200)
  78. #define PROP_ALL                    (0x80000000)
  79. //
  80. // Flags that describe attributes of Service Addresses
  81. //
  82. #define SERVICE_ADDRESS_FLAG_RPC_CN (0x00000001)
  83. #define SERVICE_ADDRESS_FLAG_RPC_DG (0x00000002)
  84. #define SERVICE_ADDRESS_FLAG_RPC_NB (0x00000004)
  85. //
  86. // Name Spaces
  87. //
  88. #define NS_DEFAULT                  (0)
  89. #define NS_SAP                      (1)
  90. #define NS_NDS                      (2)
  91. #define NS_PEER_BROWSE              (3)
  92. #define NS_TCPIP_LOCAL              (10)
  93. #define NS_TCPIP_HOSTS              (11)
  94. #define NS_DNS                      (12)
  95. #define NS_NETBT                    (13)
  96. #define NS_WINS                     (14)
  97. #define NS_NBP                      (20)
  98. #define NS_MS                       (30)
  99. #define NS_STDA                     (31)
  100. #define NS_NTDS                     (32)
  101. #define NS_X500                     (40)
  102. #define NS_NIS                      (41)
  103. #define NS_VNS                      (50)
  104. //
  105. // Name space attributes.
  106. //
  107. #define NSTYPE_HIERARCHICAL         (0x00000001)
  108. #define NSTYPE_DYNAMIC              (0x00000002)
  109. #define NSTYPE_ENUMERABLE           (0x00000004)
  110. #define NSTYPE_WORKGROUP            (0x00000008)
  111. //
  112. // Transport attributes.
  113. //
  114. #define XP_CONNECTIONLESS           (0x00000001)
  115. #define XP_GUARANTEED_DELIVERY      (0x00000002)
  116. #define XP_GUARANTEED_ORDER         (0x00000004)
  117. #define XP_MESSAGE_ORIENTED         (0x00000008)
  118. #define XP_PSEUDO_STREAM            (0x00000010)
  119. #define XP_GRACEFUL_CLOSE           (0x00000020)
  120. #define XP_EXPEDITED_DATA           (0x00000040)
  121. #define XP_CONNECT_DATA             (0x00000080)
  122. #define XP_DISCONNECT_DATA          (0x00000100)
  123. #define XP_SUPPORTS_BROADCAST       (0x00000200)
  124. #define XP_SUPPORTS_MULTICAST       (0x00000400)
  125. #define XP_BANDWIDTH_ALLOCATION     (0x00000800)
  126. #define XP_FRAGMENTATION            (0x00001000)
  127. #define XP_ENCRYPTS                 (0x00002000)
  128. //
  129. // Resolution flags for GetAddressByName().
  130. //
  131. #define RES_SOFT_SEARCH             (0x00000001)
  132. #define RES_FIND_MULTIPLE           (0x00000002)
  133. #define RES_SERVICE                 (0x00000004)
  134. //
  135. // Well known value names for Service Types
  136. //
  137. #define SERVICE_TYPE_VALUE_SAPIDA        "SapId"
  138. #define SERVICE_TYPE_VALUE_SAPIDW       L"SapId"
  139. #define SERVICE_TYPE_VALUE_CONNA         "ConnectionOriented"
  140. #define SERVICE_TYPE_VALUE_CONNW        L"ConnectionOriented"
  141. #define SERVICE_TYPE_VALUE_TCPPORTA      "TcpPort"
  142. #define SERVICE_TYPE_VALUE_TCPPORTW     L"TcpPort"
  143. #define SERVICE_TYPE_VALUE_UDPPORTA      "UdpPort"
  144. #define SERVICE_TYPE_VALUE_UDPPORTW     L"UdpPort"
  145. #ifdef UNICODE
  146. #define SERVICE_TYPE_VALUE_SAPID        SERVICE_TYPE_VALUE_SAPIDW
  147. #define SERVICE_TYPE_VALUE_CONN         SERVICE_TYPE_VALUE_CONNW
  148. #define SERVICE_TYPE_VALUE_TCPPORT      SERVICE_TYPE_VALUE_TCPPORTW
  149. #define SERVICE_TYPE_VALUE_UDPPORT      SERVICE_TYPE_VALUE_UDPPORTW
  150. #else // not UNICODE
  151. #define SERVICE_TYPE_VALUE_SAPID        SERVICE_TYPE_VALUE_SAPIDA
  152. #define SERVICE_TYPE_VALUE_CONN         SERVICE_TYPE_VALUE_CONNA
  153. #define SERVICE_TYPE_VALUE_TCPPORT      SERVICE_TYPE_VALUE_TCPPORTA
  154. #define SERVICE_TYPE_VALUE_UDPPORT      SERVICE_TYPE_VALUE_UDPPORTA
  155. #endif
  156. //
  157. // status flags returned by SetService
  158. //
  159. #define SET_SERVICE_PARTIAL_SUCCESS  (0x00000001)
  160. //
  161. // Name Space Information
  162. //
  163. typedef struct _NS_INFOA {
  164.     DWORD dwNameSpace ;
  165.     DWORD dwNameSpaceFlags ;
  166.     LPSTR   lpNameSpace ;
  167. } NS_INFOA,  * PNS_INFOA, FAR * LPNS_INFOA;
  168. //
  169. // Name Space Information
  170. //
  171. typedef struct _NS_INFOW {
  172.     DWORD dwNameSpace ;
  173.     DWORD dwNameSpaceFlags ;
  174.     LPWSTR  lpNameSpace ;
  175. } NS_INFOW,  * PNS_INFOW, FAR * LPNS_INFOW;
  176. #ifdef UNICODE
  177. typedef NS_INFOW NS_INFO;
  178. typedef PNS_INFOW PNS_INFO;
  179. typedef LPNS_INFOW LPNS_INFO;
  180. #else
  181. typedef NS_INFOA NS_INFO;
  182. typedef PNS_INFOA PNS_INFO;
  183. typedef LPNS_INFOA LPNS_INFO;
  184. #endif // UNICODE
  185. //
  186. // Service Type Values. The structures are used to define named Service
  187. // Type specific values. This structure is self relative and has no pointers.
  188. //
  189. typedef struct _SERVICE_TYPE_VALUE {
  190.     DWORD dwNameSpace ;
  191.     DWORD dwValueType ;
  192.     DWORD dwValueSize ;
  193.     DWORD dwValueNameOffset ;
  194.     DWORD dwValueOffset ;
  195. } SERVICE_TYPE_VALUE, *PSERVICE_TYPE_VALUE, FAR *LPSERVICE_TYPE_VALUE ;
  196. //
  197. // An absolute version of above. This structure does contain pointers.
  198. //
  199. typedef struct _SERVICE_TYPE_VALUE_ABSA  {
  200.     DWORD dwNameSpace ;
  201.     DWORD dwValueType ;
  202.     DWORD dwValueSize ;
  203.     LPSTR   lpValueName ;
  204.     PVOID lpValue ;
  205. } SERVICE_TYPE_VALUE_ABSA,
  206.   *PSERVICE_TYPE_VALUE_ABSA,
  207.   FAR *LPSERVICE_TYPE_VALUE_ABSA;
  208. //
  209. // An absolute version of above. This structure does contain pointers.
  210. //
  211. typedef struct _SERVICE_TYPE_VALUE_ABSW  {
  212.     DWORD dwNameSpace ;
  213.     DWORD dwValueType ;
  214.     DWORD dwValueSize ;
  215.     LPWSTR  lpValueName ;
  216.     PVOID lpValue ;
  217. } SERVICE_TYPE_VALUE_ABSW,
  218.   *PSERVICE_TYPE_VALUE_ABSW,
  219.   FAR *LPSERVICE_TYPE_VALUE_ABSW;
  220. #ifdef UNICODE
  221. typedef SERVICE_TYPE_VALUE_ABSW SERVICE_TYPE_VALUE_ABS;
  222. typedef PSERVICE_TYPE_VALUE_ABSW PSERVICE_TYPE_VALUE_ABS;
  223. typedef LPSERVICE_TYPE_VALUE_ABSW LPSERVICE_TYPE_VALUE_ABS;
  224. #else
  225. typedef SERVICE_TYPE_VALUE_ABSA SERVICE_TYPE_VALUE_ABS;
  226. typedef PSERVICE_TYPE_VALUE_ABSA PSERVICE_TYPE_VALUE_ABS;
  227. typedef LPSERVICE_TYPE_VALUE_ABSA LPSERVICE_TYPE_VALUE_ABS;
  228. #endif // UNICODE
  229. //
  230. // Service Type Information. Contains the name of the Service Type and
  231. // and an array of SERVICE_NS_TYPE_VALUE structures. This structure is self
  232. // relative and has no pointers in it.
  233. //
  234. typedef struct _SERVICE_TYPE_INFO {
  235.     DWORD dwTypeNameOffset ;
  236.     DWORD dwValueCount ;
  237.     SERVICE_TYPE_VALUE Values[1] ;
  238. } SERVICE_TYPE_INFO, *PSERVICE_TYPE_INFO, FAR *LPSERVICE_TYPE_INFO ;
  239. typedef struct _SERVICE_TYPE_INFO_ABSA {
  240.     LPSTR   lpTypeName ;
  241.     DWORD dwValueCount ;
  242.     SERVICE_TYPE_VALUE_ABSA Values[1] ;
  243. } SERVICE_TYPE_INFO_ABSA,
  244.   *PSERVICE_TYPE_INFO_ABSA,
  245.   FAR *LPSERVICE_TYPE_INFO_ABSA ;
  246. typedef struct _SERVICE_TYPE_INFO_ABSW {
  247.     LPWSTR  lpTypeName ;
  248.     DWORD dwValueCount ;
  249.     SERVICE_TYPE_VALUE_ABSW Values[1] ;
  250. } SERVICE_TYPE_INFO_ABSW,
  251.   *PSERVICE_TYPE_INFO_ABSW,
  252.   FAR *LPSERVICE_TYPE_INFO_ABSW ;
  253. #ifdef UNICODE
  254. typedef SERVICE_TYPE_INFO_ABSW SERVICE_TYPE_INFO_ABS;
  255. typedef PSERVICE_TYPE_INFO_ABSW PSERVICE_TYPE_INFO_ABS;
  256. typedef LPSERVICE_TYPE_INFO_ABSW LPSERVICE_TYPE_INFO_ABS;
  257. #else
  258. typedef SERVICE_TYPE_INFO_ABSA SERVICE_TYPE_INFO_ABS;
  259. typedef PSERVICE_TYPE_INFO_ABSA PSERVICE_TYPE_INFO_ABS;
  260. typedef LPSERVICE_TYPE_INFO_ABSA LPSERVICE_TYPE_INFO_ABS;
  261. #endif // UNICODE
  262. //
  263. // A Single Address definition.
  264. //
  265. typedef struct _SERVICE_ADDRESS {
  266.     DWORD   dwAddressType ;
  267.     DWORD   dwAddressFlags ;
  268.     DWORD   dwAddressLength ;
  269.     DWORD   dwPrincipalLength ;
  270. #ifdef MIDL_PASS
  271.     [size_is(dwAddressLength)] BYTE *lpAddress;
  272. #else  // MIDL_PASS
  273.     BYTE   *lpAddress ;
  274. #endif // MIDL_PASS
  275. #ifdef MIDL_PASS
  276.     [size_is(dwPrincipalLength)] BYTE *lpPrincipal;
  277. #else  // MIDL_PASS
  278.     BYTE   *lpPrincipal ;
  279. #endif // MIDL_PASS
  280. } SERVICE_ADDRESS, *PSERVICE_ADDRESS, *LPSERVICE_ADDRESS;
  281. //
  282. // Addresses used by the service. Contains array of SERVICE_ADDRESS.
  283. //
  284. typedef struct _SERVICE_ADDRESSES {
  285.     DWORD           dwAddressCount ;
  286. #ifdef MIDL_PASS
  287.     [size_is(dwAddressCount)] SERVICE_ADDRESS Addressses[*];
  288. #else  // MIDL_PASS
  289.     SERVICE_ADDRESS Addresses[1] ;
  290. #endif // MIDL_PASS
  291. } SERVICE_ADDRESSES, *PSERVICE_ADDRESSES, *LPSERVICE_ADDRESSES;
  292. //
  293. // Service Information.
  294. //
  295. typedef struct _SERVICE_INFOA {
  296.     LPGUID lpServiceType ;
  297.     LPSTR   lpServiceName ;
  298.     LPSTR   lpComment ;
  299.     LPSTR   lpLocale ;
  300.     DWORD dwDisplayHint ;
  301.     DWORD dwVersion ;
  302.     DWORD dwTime ;
  303.     LPSTR   lpMachineName ;
  304.     LPSERVICE_ADDRESSES lpServiceAddress ;
  305.     BLOB ServiceSpecificInfo ;
  306. } SERVICE_INFOA, *PSERVICE_INFOA, FAR * LPSERVICE_INFOA ;
  307. //
  308. // Service Information.
  309. //
  310. typedef struct _SERVICE_INFOW {
  311.     LPGUID lpServiceType ;
  312.     LPWSTR  lpServiceName ;
  313.     LPWSTR  lpComment ;
  314.     LPWSTR  lpLocale ;
  315.     DWORD dwDisplayHint ;
  316.     DWORD dwVersion ;
  317.     DWORD dwTime ;
  318.     LPWSTR  lpMachineName ;
  319.     LPSERVICE_ADDRESSES lpServiceAddress ;
  320.     BLOB ServiceSpecificInfo ;
  321. } SERVICE_INFOW, *PSERVICE_INFOW, FAR * LPSERVICE_INFOW ;
  322. #ifdef UNICODE
  323. typedef SERVICE_INFOW SERVICE_INFO;
  324. typedef PSERVICE_INFOW PSERVICE_INFO;
  325. typedef LPSERVICE_INFOW LPSERVICE_INFO;
  326. #else
  327. typedef SERVICE_INFOA SERVICE_INFO;
  328. typedef PSERVICE_INFOA PSERVICE_INFO;
  329. typedef LPSERVICE_INFOA LPSERVICE_INFO;
  330. #endif // UNICODE
  331. //
  332. // Name Space & Service Information
  333. //
  334. typedef struct _NS_SERVICE_INFOA {
  335.     DWORD dwNameSpace ;
  336.     SERVICE_INFOA ServiceInfo ;
  337. } NS_SERVICE_INFOA, *PNS_SERVICE_INFOA, FAR * LPNS_SERVICE_INFOA ;
  338. //
  339. // Name Space & Service Information
  340. //
  341. typedef struct _NS_SERVICE_INFOW {
  342.     DWORD dwNameSpace ;
  343.     SERVICE_INFOW ServiceInfo ;
  344. } NS_SERVICE_INFOW, *PNS_SERVICE_INFOW, FAR * LPNS_SERVICE_INFOW ;
  345. #ifdef UNICODE
  346. typedef NS_SERVICE_INFOW NS_SERVICE_INFO;
  347. typedef PNS_SERVICE_INFOW PNS_SERVICE_INFO;
  348. typedef LPNS_SERVICE_INFOW LPNS_SERVICE_INFO;
  349. #else
  350. typedef NS_SERVICE_INFOA NS_SERVICE_INFO;
  351. typedef PNS_SERVICE_INFOA PNS_SERVICE_INFO;
  352. typedef LPNS_SERVICE_INFOA LPNS_SERVICE_INFO;
  353. #endif // UNICODE
  354. #ifndef __CSADDR_DEFINED__
  355. #define __CSADDR_DEFINED__
  356. //
  357. // SockAddr Information
  358. //
  359. typedef struct _SOCKET_ADDRESS {
  360.     LPSOCKADDR lpSockaddr ;
  361.     INT iSockaddrLength ;
  362. } SOCKET_ADDRESS, *PSOCKET_ADDRESS, FAR * LPSOCKET_ADDRESS ;
  363. //
  364. // CSAddr Information
  365. //
  366. typedef struct _CSADDR_INFO {
  367.     SOCKET_ADDRESS LocalAddr ;
  368.     SOCKET_ADDRESS RemoteAddr ;
  369.     INT iSocketType ;
  370.     INT iProtocol ;
  371. } CSADDR_INFO, *PCSADDR_INFO, FAR * LPCSADDR_INFO ;
  372. #endif
  373. //
  374. // Protocol Information
  375. //
  376. typedef struct _PROTOCOL_INFOA {
  377.     DWORD dwServiceFlags ;
  378.     INT iAddressFamily ;
  379.     INT iMaxSockAddr ;
  380.     INT iMinSockAddr ;
  381.     INT iSocketType ;
  382.     INT iProtocol ;
  383.     DWORD dwMessageSize ;
  384.     LPSTR   lpProtocol ;
  385. } PROTOCOL_INFOA, *PPROTOCOL_INFOA, FAR * LPPROTOCOL_INFOA ;
  386. //
  387. // Protocol Information
  388. //
  389. typedef struct _PROTOCOL_INFOW {
  390.     DWORD dwServiceFlags ;
  391.     INT iAddressFamily ;
  392.     INT iMaxSockAddr ;
  393.     INT iMinSockAddr ;
  394.     INT iSocketType ;
  395.     INT iProtocol ;
  396.     DWORD dwMessageSize ;
  397.     LPWSTR  lpProtocol ;
  398. } PROTOCOL_INFOW, *PPROTOCOL_INFOW, FAR * LPPROTOCOL_INFOW ;
  399. #ifdef UNICODE
  400. typedef PROTOCOL_INFOW PROTOCOL_INFO;
  401. typedef PPROTOCOL_INFOW PPROTOCOL_INFO;
  402. typedef LPPROTOCOL_INFOW LPPROTOCOL_INFO;
  403. #else
  404. typedef PROTOCOL_INFOA PROTOCOL_INFO;
  405. typedef PPROTOCOL_INFOA PPROTOCOL_INFO;
  406. typedef LPPROTOCOL_INFOA LPPROTOCOL_INFO;
  407. #endif // UNICODE
  408. //
  409. // NETRESOURCE2 Structure
  410. //
  411. typedef struct _NETRESOURCE2A {
  412.     DWORD dwScope ;
  413.     DWORD dwType ;
  414.     DWORD dwUsage ;
  415.     DWORD dwDisplayType ;
  416.     LPSTR   lpLocalName ;
  417.     LPSTR   lpRemoteName ;
  418.     LPSTR   lpComment ;
  419.     NS_INFO ns_info ;
  420.     GUID ServiceType ;
  421.     DWORD dwProtocols ;
  422.     LPINT lpiProtocols ;
  423. } NETRESOURCE2A, *PNETRESOURCE2A, FAR * LPNETRESOURCE2A ;
  424. //
  425. // NETRESOURCE2 Structure
  426. //
  427. typedef struct _NETRESOURCE2W {
  428.     DWORD dwScope ;
  429.     DWORD dwType ;
  430.     DWORD dwUsage ;
  431.     DWORD dwDisplayType ;
  432.     LPWSTR  lpLocalName ;
  433.     LPWSTR  lpRemoteName ;
  434.     LPWSTR  lpComment ;
  435.     NS_INFO ns_info ;
  436.     GUID ServiceType ;
  437.     DWORD dwProtocols ;
  438.     LPINT lpiProtocols ;
  439. } NETRESOURCE2W, *PNETRESOURCE2W, FAR * LPNETRESOURCE2W ;
  440. #ifdef UNICODE
  441. typedef NETRESOURCE2W NETRESOURCE2;
  442. typedef PNETRESOURCE2W PNETRESOURCE2;
  443. typedef LPNETRESOURCE2W LPNETRESOURCE2;
  444. #else
  445. typedef NETRESOURCE2A NETRESOURCE2;
  446. typedef PNETRESOURCE2A PNETRESOURCE2;
  447. typedef LPNETRESOURCE2A LPNETRESOURCE2;
  448. #endif // UNICODE
  449. typedef  DWORD (* LPFN_NSPAPI) (VOID ) ;
  450. //
  451. // Structures for using the service routines asynchronously.
  452. //
  453. typedef
  454. VOID
  455. (*LPSERVICE_CALLBACK_PROC) (
  456.     IN LPARAM lParam,
  457.     IN HANDLE hAsyncTaskHandle
  458.     );
  459. typedef struct _SERVICE_ASYNC_INFO {
  460.     LPSERVICE_CALLBACK_PROC lpServiceCallbackProc;
  461.     LPARAM lParam;
  462.     HANDLE hAsyncTaskHandle;
  463. } SERVICE_ASYNC_INFO, *PSERVICE_ASYNC_INFO, FAR * LPSERVICE_ASYNC_INFO;
  464. //
  465. // Public NSP API prototypes.
  466. //
  467. INT
  468. APIENTRY
  469. EnumProtocolsA (
  470.     IN     LPINT           lpiProtocols,
  471.     IN OUT LPVOID          lpProtocolBuffer,
  472.     IN OUT LPDWORD         lpdwBufferLength
  473.     );
  474. //
  475. // Public NSP API prototypes.
  476. //
  477. INT
  478. APIENTRY
  479. EnumProtocolsW (
  480.     IN     LPINT           lpiProtocols,
  481.     IN OUT LPVOID          lpProtocolBuffer,
  482.     IN OUT LPDWORD         lpdwBufferLength
  483.     );
  484. #ifdef UNICODE
  485. #define EnumProtocols  EnumProtocolsW
  486. #else
  487. #define EnumProtocols  EnumProtocolsA
  488. #endif // !UNICODE
  489. INT
  490. APIENTRY
  491. GetAddressByNameA (
  492.     IN     DWORD                dwNameSpace,
  493.     IN     LPGUID               lpServiceType,
  494.     IN     LPSTR              lpServiceName OPTIONAL,
  495.     IN     LPINT                lpiProtocols OPTIONAL,
  496.     IN     DWORD                dwResolution,
  497.     IN     LPSERVICE_ASYNC_INFO lpServiceAsyncInfo OPTIONAL,
  498.     IN OUT LPVOID               lpCsaddrBuffer,
  499.     IN OUT LPDWORD              lpdwBufferLength,
  500.     IN OUT LPSTR              lpAliasBuffer OPTIONAL,
  501.     IN OUT LPDWORD              lpdwAliasBufferLength OPTIONAL
  502.     );
  503. INT
  504. APIENTRY
  505. GetAddressByNameW (
  506.     IN     DWORD                dwNameSpace,
  507.     IN     LPGUID               lpServiceType,
  508.     IN     LPWSTR              lpServiceName OPTIONAL,
  509.     IN     LPINT                lpiProtocols OPTIONAL,
  510.     IN     DWORD                dwResolution,
  511.     IN     LPSERVICE_ASYNC_INFO lpServiceAsyncInfo OPTIONAL,
  512.     IN OUT LPVOID               lpCsaddrBuffer,
  513.     IN OUT LPDWORD              lpdwBufferLength,
  514.     IN OUT LPWSTR              lpAliasBuffer OPTIONAL,
  515.     IN OUT LPDWORD              lpdwAliasBufferLength OPTIONAL
  516.     );
  517. #ifdef UNICODE
  518. #define GetAddressByName  GetAddressByNameW
  519. #else
  520. #define GetAddressByName  GetAddressByNameA
  521. #endif // !UNICODE
  522. INT
  523. APIENTRY
  524. GetTypeByNameA (
  525.     IN     LPSTR         lpServiceName,
  526.     IN OUT LPGUID          lpServiceType
  527.     );
  528. INT
  529. APIENTRY
  530. GetTypeByNameW (
  531.     IN     LPWSTR         lpServiceName,
  532.     IN OUT LPGUID          lpServiceType
  533.     );
  534. #ifdef UNICODE
  535. #define GetTypeByName  GetTypeByNameW
  536. #else
  537. #define GetTypeByName  GetTypeByNameA
  538. #endif // !UNICODE
  539. INT
  540. APIENTRY
  541. GetNameByTypeA (
  542.     IN     LPGUID          lpServiceType,
  543.     IN OUT LPSTR         lpServiceName,
  544.     IN     DWORD           dwNameLength
  545.     );
  546. INT
  547. APIENTRY
  548. GetNameByTypeW (
  549.     IN     LPGUID          lpServiceType,
  550.     IN OUT LPWSTR         lpServiceName,
  551.     IN     DWORD           dwNameLength
  552.     );
  553. #ifdef UNICODE
  554. #define GetNameByType  GetNameByTypeW
  555. #else
  556. #define GetNameByType  GetNameByTypeA
  557. #endif // !UNICODE
  558. INT
  559. APIENTRY
  560. SetServiceA (
  561.     IN     DWORD                dwNameSpace,
  562.     IN     DWORD                dwOperation,
  563.     IN     DWORD                dwFlags,
  564.     IN     LPSERVICE_INFOA      lpServiceInfo,
  565.     IN     LPSERVICE_ASYNC_INFO lpServiceAsyncInfo,
  566.     IN OUT LPDWORD              lpdwStatusFlags
  567.     );
  568. INT
  569. APIENTRY
  570. SetServiceW (
  571.     IN     DWORD                dwNameSpace,
  572.     IN     DWORD                dwOperation,
  573.     IN     DWORD                dwFlags,
  574.     IN     LPSERVICE_INFOW      lpServiceInfo,
  575.     IN     LPSERVICE_ASYNC_INFO lpServiceAsyncInfo,
  576.     IN OUT LPDWORD              lpdwStatusFlags
  577.     );
  578. #ifdef UNICODE
  579. #define SetService  SetServiceW
  580. #else
  581. #define SetService  SetServiceA
  582. #endif // !UNICODE
  583. INT
  584. APIENTRY
  585. GetServiceA (
  586.     IN     DWORD                dwNameSpace,
  587.     IN     LPGUID               lpGuid,
  588.     IN     LPSTR              lpServiceName,
  589.     IN     DWORD                dwProperties,
  590.     IN OUT LPVOID               lpBuffer,
  591.     IN OUT LPDWORD              lpdwBufferSize,
  592.     IN     LPSERVICE_ASYNC_INFO lpServiceAsyncInfo
  593.     );
  594. INT
  595. APIENTRY
  596. GetServiceW (
  597.     IN     DWORD                dwNameSpace,
  598.     IN     LPGUID               lpGuid,
  599.     IN     LPWSTR              lpServiceName,
  600.     IN     DWORD                dwProperties,
  601.     IN OUT LPVOID               lpBuffer,
  602.     IN OUT LPDWORD              lpdwBufferSize,
  603.     IN     LPSERVICE_ASYNC_INFO lpServiceAsyncInfo
  604.     );
  605. #ifdef UNICODE
  606. #define GetService  GetServiceW
  607. #else
  608. #define GetService  GetServiceA
  609. #endif // !UNICODE
  610. #ifdef __cplusplus
  611. }
  612. #endif  /* __cplusplus */
  613. #endif  // _NSPAPI_INCLUDED