FreeRDP
dsparse.h
1 
20 #ifndef WINPR_DSPARSE_H
21 #define WINPR_DSPARSE_H
22 
23 #if defined(_WIN32) && !defined(_UWP)
24 
25 #include <winpr/windows.h>
26 #include <winpr/rpc.h>
27 
28 #include <ntdsapi.h>
29 
30 #else
31 
32 #include <winpr/crt.h>
33 #include <winpr/winpr.h>
34 #include <winpr/wtypes.h>
35 #include <winpr/error.h>
36 
37 typedef enum
38 {
39  DS_NAME_NO_FLAGS = 0x0,
40  DS_NAME_FLAG_SYNTACTICAL_ONLY = 0x1,
41  DS_NAME_FLAG_EVAL_AT_DC = 0x2,
42  DS_NAME_FLAG_GCVERIFY = 0x4,
43  DS_NAME_FLAG_TRUST_REFERRAL = 0x8
44 } DS_NAME_FLAGS;
45 
46 typedef enum
47 {
48  DS_UNKNOWN_NAME = 0,
49  DS_FQDN_1779_NAME = 1,
50  DS_NT4_ACCOUNT_NAME = 2,
51  DS_DISPLAY_NAME = 3,
52  DS_UNIQUE_ID_NAME = 6,
53  DS_CANONICAL_NAME = 7,
54  DS_USER_PRINCIPAL_NAME = 8,
55  DS_CANONICAL_NAME_EX = 9,
56  DS_SERVICE_PRINCIPAL_NAME = 10,
57  DS_SID_OR_SID_HISTORY_NAME = 11,
58  DS_DNS_DOMAIN_NAME = 12
59 } DS_NAME_FORMAT;
60 
61 typedef enum
62 {
63  DS_NAME_NO_ERROR = 0,
64  DS_NAME_ERROR_RESOLVING = 1,
65  DS_NAME_ERROR_NOT_FOUND = 2,
66  DS_NAME_ERROR_NOT_UNIQUE = 3,
67  DS_NAME_ERROR_NO_MAPPING = 4,
68  DS_NAME_ERROR_DOMAIN_ONLY = 5,
69  DS_NAME_ERROR_NO_SYNTACTICAL_MAPPING = 6,
70  DS_NAME_ERROR_TRUST_REFERRAL = 7
71 } DS_NAME_ERROR;
72 
73 typedef enum
74 {
75  DS_SPN_DNS_HOST = 0,
76  DS_SPN_DN_HOST = 1,
77  DS_SPN_NB_HOST = 2,
78  DS_SPN_DOMAIN = 3,
79  DS_SPN_NB_DOMAIN = 4,
80  DS_SPN_SERVICE = 5
81 } DS_SPN_NAME_TYPE;
82 
83 typedef struct
84 {
85  DWORD status;
86  LPTSTR pDomain;
87  LPTSTR pName;
89 
90 typedef struct
91 {
92  DWORD cItems;
93  PDS_NAME_RESULT_ITEM rItems;
95 
96 #ifdef __cplusplus
97 extern "C"
98 {
99 #endif
100 
101 #ifdef UNICODE
102 #define DsMakeSpn DsMakeSpnW
103 #else
104 #define DsMakeSpn DsMakeSpnA
105 #endif
106 
107  WINPR_API DWORD DsMakeSpnW(LPCWSTR ServiceClass, LPCWSTR ServiceName, LPCWSTR InstanceName,
108  USHORT InstancePort, LPCWSTR Referrer, DWORD* pcSpnLength,
109  LPWSTR pszSpn);
110 
111  WINPR_API DWORD DsMakeSpnA(LPCSTR ServiceClass, LPCSTR ServiceName, LPCSTR InstanceName,
112  USHORT InstancePort, LPCSTR Referrer, DWORD* pcSpnLength,
113  LPSTR pszSpn);
114 
115 #ifdef __cplusplus
116 }
117 #endif
118 
119 #ifdef UNICODE
120 #define DsMakeSpn DsMakeSpnW
121 #else
122 #define DsMakeSpn DsMakeSpnA
123 #endif
124 
125 #endif
126 
127 #endif /* WINPR_DSPARSE_H */