source: Daodan/MinGW/include/nspapi.h@ 1051

Last change on this file since 1051 was 1046, checked in by alloc, 8 years ago

Daodan: Added Windows MinGW and build batch file

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