2 * Copyright (C) 2006 Dmitry Timoshkov
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
26 #include "wine/debug.h"
28 WINE_DEFAULT_DEBUG_CHANNEL(ntdsapi
);
30 /***********************************************************************
33 DWORD WINAPI
DsBindA(LPCSTR controller
, LPCSTR domain
, HANDLE
*handle
)
35 FIXME("(%s,%s, %p): stub!\n", debugstr_a(controller
), debugstr_a(domain
), handle
);
36 return ERROR_CALL_NOT_IMPLEMENTED
;
39 /***********************************************************************
42 DWORD WINAPI
DsBindW(LPCWSTR controller
, LPCWSTR domain
, HANDLE
*handle
)
44 FIXME("(%s,%s, %p): stub!\n", debugstr_w(controller
), debugstr_w(domain
), handle
);
45 return ERROR_CALL_NOT_IMPLEMENTED
;
48 /***********************************************************************
49 * DsMakeSpnW (NTDSAPI.@)
51 DWORD WINAPI
DsMakeSpnW(LPCWSTR svc_class
, LPCWSTR svc_name
,
52 LPCWSTR inst_name
, USHORT inst_port
,
53 LPCWSTR ref
, DWORD
*spn_length
, LPWSTR spn
)
59 TRACE("(%s,%s,%s,%d,%s,%p,%p)\n", debugstr_w(svc_class
),
60 debugstr_w(svc_name
), debugstr_w(inst_name
), inst_port
,
61 debugstr_w(ref
), spn_length
, spn
);
63 if (!svc_class
|| !svc_name
)
64 return ERROR_INVALID_PARAMETER
;
66 new_spn_length
= lstrlenW(svc_class
) + 1 /* for '/' */ + 1 /* for terminating '\0' */;
68 new_spn_length
+= lstrlenW(inst_name
);
70 new_spn_length
+= lstrlenW(svc_name
);
74 new_spn_length
+= 1 /* for ':' */;
82 new_spn_length
+= 1 /* for '/' */ + lstrlenW(svc_name
);
84 if (*spn_length
< new_spn_length
)
86 *spn_length
= new_spn_length
;
87 return ERROR_BUFFER_OVERFLOW
;
89 *spn_length
= new_spn_length
;
92 len
= lstrlenW(svc_class
);
93 memcpy(p
, svc_class
, len
* sizeof(WCHAR
));
99 len
= lstrlenW(inst_name
);
100 memcpy(p
, inst_name
, len
* sizeof(WCHAR
));
106 len
= lstrlenW(svc_name
);
107 memcpy(p
, svc_name
, len
* sizeof(WCHAR
));
116 wsprintfW(p
, L
"%u", inst_port
);
124 len
= lstrlenW(svc_name
);
125 memcpy(p
, svc_name
, len
* sizeof(WCHAR
));
130 TRACE("spn = %s\n", debugstr_w(spn
));
132 return ERROR_SUCCESS
;
135 /***********************************************************************
136 * DsMakeSpnA (NTDSAPI.@)
140 DWORD WINAPI
DsMakeSpnA(LPCSTR svc_class
, LPCSTR svc_name
,
141 LPCSTR inst_name
, USHORT inst_port
,
142 LPCSTR ref
, DWORD
*spn_length
, LPSTR spn
)
144 FIXME("(%s,%s,%s,%d,%s,%p,%p): stub!\n", debugstr_a(svc_class
),
145 debugstr_a(svc_name
), debugstr_a(inst_name
), inst_port
,
146 debugstr_a(ref
), spn_length
, spn
);
148 return ERROR_CALL_NOT_IMPLEMENTED
;
151 /***********************************************************************
152 * DsMakeSpnA (NTDSAPI.@)
154 DWORD WINAPI
DsGetSpnA(DS_SPN_NAME_TYPE ServType
, LPCSTR Servlass
, LPCSTR ServName
,
155 USHORT InstPort
, USHORT nInstanceNames
,
156 LPCSTR
*pInstanceNames
, const USHORT
*pInstancePorts
,
157 DWORD
*pSpn
, LPSTR
**pszSpn
)
159 FIXME("(%d,%s,%s,%d,%d,%p,%p,%p,%p): stub!\n", ServType
,
160 debugstr_a(Servlass
), debugstr_a(ServName
), InstPort
,
161 nInstanceNames
, pInstanceNames
, pInstancePorts
, pSpn
, pszSpn
);
163 return ERROR_CALL_NOT_IMPLEMENTED
;
166 /***********************************************************************
167 * DsServerRegisterSpnA (NTDSAPI.@)
169 DWORD WINAPI
DsServerRegisterSpnA(DS_SPN_WRITE_OP operation
, LPCSTR ServiceClass
, LPCSTR UserObjectDN
)
171 FIXME("(%d,%s,%s): stub!\n", operation
,
172 debugstr_a(ServiceClass
), debugstr_a(UserObjectDN
));
173 return ERROR_CALL_NOT_IMPLEMENTED
;
176 /***********************************************************************
177 * DsServerRegisterSpnW (NTDSAPI.@)
179 DWORD WINAPI
DsServerRegisterSpnW(DS_SPN_WRITE_OP operation
, LPCWSTR ServiceClass
, LPCWSTR UserObjectDN
)
181 FIXME("(%d,%s,%s): stub!\n", operation
,
182 debugstr_w(ServiceClass
), debugstr_w(UserObjectDN
));
183 return ERROR_CALL_NOT_IMPLEMENTED
;
186 /***********************************************************************
187 * DsClientMakeSpnForTargetServerW (NTDSAPI.@)
189 DWORD WINAPI
DsClientMakeSpnForTargetServerW(LPCWSTR
class, LPCWSTR name
, DWORD
*buflen
, LPWSTR buf
)
194 TRACE("(%s,%s,%p,%p)\n", debugstr_w(class), debugstr_w(name
), buflen
, buf
);
196 if (!class || !name
|| !buflen
) return ERROR_INVALID_PARAMETER
;
198 len
= lstrlenW(class) + 1 + lstrlenW(name
) + 1;
202 return ERROR_BUFFER_OVERFLOW
;
206 memcpy(buf
, class, lstrlenW(class) * sizeof(WCHAR
));
207 p
= buf
+ lstrlenW(class);
209 memcpy(p
, name
, lstrlenW(name
) * sizeof(WCHAR
));
212 return ERROR_SUCCESS
;
215 /***********************************************************************
216 * DsCrackNamesA (NTDSAPI.@)
218 DWORD WINAPI
DsCrackNamesA(HANDLE handle
, DS_NAME_FLAGS flags
, DS_NAME_FORMAT offered
, DS_NAME_FORMAT desired
,
219 DWORD num
, const CHAR
**names
, PDS_NAME_RESULTA
*result
)
221 FIXME("(%p %u %u %u %u %p %p stub\n", handle
, flags
, offered
, desired
, num
, names
, result
);
222 return ERROR_CALL_NOT_IMPLEMENTED
;
225 /***********************************************************************
226 * DsCrackNamesW (NTDSAPI.@)
228 DWORD WINAPI
DsCrackNamesW(HANDLE handle
, DS_NAME_FLAGS flags
, DS_NAME_FORMAT offered
, DS_NAME_FORMAT desired
,
229 DWORD num
, const WCHAR
**names
, PDS_NAME_RESULTW
*result
)
231 FIXME("(%p %u %u %u %u %p %p stub\n", handle
, flags
, offered
, desired
, num
, names
, result
);
232 return ERROR_CALL_NOT_IMPLEMENTED
;