xref: /reactos/sdk/include/psdk/nspapi.h (revision 1734f297)
1 #ifndef _NSPAPI_H
2 #define _NSPAPI_H
3 
4 #ifdef __cplusplus
5 extern "C" {
6 #endif
7 
8 #define NS_ALL		0
9 
10 #define NS_SAP		1
11 #define NS_NDS		2
12 #define NS_PEER_BROWSE	3
13 
14 #define NS_TCPIP_LOCAL	10
15 #define NS_TCPIP_HOSTS	11
16 #define NS_DNS		12
17 #define NS_NETBT	13
18 #define NS_WINS		14
19 
20 #define NS_NBP		20
21 
22 #define NS_MS		30
23 #define NS_STDA		31
24 #define NS_NTDS		32
25 
26 #define NS_X500		40
27 #define NS_NIS		41
28 #define NS_NISPLUS	42
29 
30 #define NS_WRQ		50
31 
32 #define SERVICE_REGISTER	1
33 #define SERVICE_DEREGISTER	2
34 #define SERVICE_FLUSH		3
35 #define SERVICE_FLAG_HARD	0x00000002
36 
37 #ifndef RC_INVOKED
38 
39 #if defined (_WINSOCKAPI_) || defined (_WINSOCK2API_) /* needed for LPSOCKADDR */
40 #ifndef __CSADDR_DEFINED__ /* also in winsock2.h, but not in winsock.h */
41 #define __CSADDR_DEFINED__
42 typedef struct _SOCKET_ADDRESS {
43 	LPSOCKADDR lpSockaddr;
44 	INT iSockaddrLength;
45 } SOCKET_ADDRESS,*PSOCKET_ADDRESS,*LPSOCKET_ADDRESS;
46 typedef struct _CSADDR_INFO {
47 	SOCKET_ADDRESS LocalAddr;
48 	SOCKET_ADDRESS RemoteAddr;
49 	INT iSocketType;
50 	INT iProtocol;
51 } CSADDR_INFO,*PCSADDR_INFO,*LPCSADDR_INFO;
52 #endif
53 #endif
54 
55 #ifndef __BLOB_T_DEFINED /* also in wtypes.h and winsock2.h */
56 #define __BLOB_T_DEFINED
57 typedef struct _BLOB {
58 	ULONG	cbSize;
59 	BYTE	*pBlobData;
60 } BLOB,*PBLOB,*LPBLOB;
61 #endif
62 
63 typedef struct _SERVICE_ADDRESS {
64 	DWORD dwAddressType;
65 	DWORD dwAddressFlags;
66 	DWORD dwAddressLength;
67 	DWORD dwPrincipalLength;
68 	BYTE *lpAddress;
69 	BYTE *lpPrincipal;
70 } SERVICE_ADDRESS;
71 typedef struct _SERVICE_ADDRESSES {
72 	DWORD dwAddressCount;
73 	SERVICE_ADDRESS Addresses[1];
74 } SERVICE_ADDRESSES, *PSERVICE_ADDRESSES, *LPSERVICE_ADDRESSES;
75 typedef struct _SERVICE_INFOA {
76 	LPGUID lpServiceType;
77 	LPSTR lpServiceName;
78 	LPSTR lpComment;
79 	LPSTR lpLocale;
80 	DWORD dwDisplayHint;
81 	DWORD dwVersion;
82 	DWORD dwTime;
83 	LPSTR lpMachineName;
84 	LPSERVICE_ADDRESSES lpServiceAddress;
85 	BLOB ServiceSpecificInfo;
86 } SERVICE_INFOA, *LPSERVICE_INFOA;
87 typedef struct _SERVICE_INFOW {
88 	LPGUID lpServiceType;
89 	LPWSTR lpServiceName;
90 	LPWSTR lpComment;
91 	LPWSTR lpLocale;
92 	DWORD dwDisplayHint;
93 	DWORD dwVersion;
94 	DWORD dwTime;
95 	LPWSTR lpMachineName;
96 	LPSERVICE_ADDRESSES lpServiceAddress;
97 	BLOB ServiceSpecificInfo;
98 } SERVICE_INFOW, *LPSERVICE_INFOW;
99 
100 typedef void *LPSERVICE_ASYNC_INFO;
101 INT WINAPI SetServiceA(DWORD,DWORD,DWORD,LPSERVICE_INFOA,LPSERVICE_ASYNC_INFO,LPDWORD);
102 INT WINAPI SetServiceW(DWORD,DWORD,DWORD,LPSERVICE_INFOW,LPSERVICE_ASYNC_INFO,LPDWORD);
103 INT WINAPI GetAddressByNameA(DWORD,LPGUID,LPSTR,LPINT,DWORD,LPSERVICE_ASYNC_INFO,LPVOID,LPDWORD,LPSTR,LPDWORD);
104 INT WINAPI GetAddressByNameW(DWORD,LPGUID,LPWSTR,LPINT,DWORD,LPSERVICE_ASYNC_INFO,LPVOID,LPDWORD,LPWSTR,LPDWORD);
105 
106 #ifdef UNICODE
107 typedef SERVICE_INFOW SERVICE_INFO, *LPSERVICE_INFO;
108 #define _SERVICE_INFO SERVICE_INFOW
109 #define SetService SetServiceW
110 #define GetAddressByName GetAddressByNameW
111 #else
112 typedef SERVICE_INFOA SERVICE_INFO, *LPSERVICE_INFO;
113 #define _SERVICE_INFO SERVICE_INFOA
114 #define SetService SetServiceA
115 #define GetAddressByName GetAddressByNameA
116 #endif
117 
118 #endif /* RC_INVOKED */
119 
120 #ifdef __cplusplus
121 }
122 #endif
123 #endif /* _NSPAPI_H */
124