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 BOOL WINAPI
DllMain(HINSTANCE hinst
, DWORD reason
, LPVOID reserved
)
35 TRACE("(%p, %d, %p)\n", hinst
, reason
, reserved
);
39 case DLL_WINE_PREATTACH
:
40 return FALSE
; /* prefer native version */
42 case DLL_PROCESS_ATTACH
:
43 DisableThreadLibraryCalls( hinst
);
49 /***********************************************************************
52 DWORD WINAPI
DsBindA(LPCSTR controller
, LPCSTR domain
, HANDLE
*handle
)
54 FIXME("(%s,%s, %p): stub!\n", debugstr_a(controller
), debugstr_a(domain
), handle
);
55 return ERROR_CALL_NOT_IMPLEMENTED
;
58 /***********************************************************************
61 DWORD WINAPI
DsBindW(LPCWSTR controller
, LPCWSTR domain
, HANDLE
*handle
)
63 FIXME("(%s,%s, %p): stub!\n", debugstr_w(controller
), debugstr_w(domain
), handle
);
64 return ERROR_CALL_NOT_IMPLEMENTED
;
67 /***********************************************************************
68 * DsMakeSpnW (NTDSAPI.@)
70 DWORD WINAPI
DsMakeSpnW(LPCWSTR svc_class
, LPCWSTR svc_name
,
71 LPCWSTR inst_name
, USHORT inst_port
,
72 LPCWSTR ref
, DWORD
*spn_length
, LPWSTR spn
)
78 TRACE("(%s,%s,%s,%d,%s,%p,%p)\n", debugstr_w(svc_class
),
79 debugstr_w(svc_name
), debugstr_w(inst_name
), inst_port
,
80 debugstr_w(ref
), spn_length
, spn
);
82 if (!svc_class
|| !svc_name
)
83 return ERROR_INVALID_PARAMETER
;
85 new_spn_length
= lstrlenW(svc_class
) + 1 /* for '/' */ + 1 /* for terminating '\0' */;
87 new_spn_length
+= lstrlenW(inst_name
);
89 new_spn_length
+= lstrlenW(svc_name
);
93 new_spn_length
+= 1 /* for ':' */;
101 new_spn_length
+= 1 /* for '/' */ + lstrlenW(svc_name
);
103 if (*spn_length
< new_spn_length
)
105 *spn_length
= new_spn_length
;
106 return ERROR_BUFFER_OVERFLOW
;
108 *spn_length
= new_spn_length
;
111 len
= lstrlenW(svc_class
);
112 memcpy(p
, svc_class
, len
* sizeof(WCHAR
));
118 len
= lstrlenW(inst_name
);
119 memcpy(p
, inst_name
, len
* sizeof(WCHAR
));
125 len
= lstrlenW(svc_name
);
126 memcpy(p
, svc_name
, len
* sizeof(WCHAR
));
133 static const WCHAR percentU
[] = {'%','u',0};
136 wsprintfW(p
, percentU
, inst_port
);
144 len
= lstrlenW(svc_name
);
145 memcpy(p
, svc_name
, len
* sizeof(WCHAR
));
150 TRACE("spn = %s\n", debugstr_w(spn
));
152 return ERROR_SUCCESS
;
155 /***********************************************************************
156 * DsMakeSpnA (NTDSAPI.@)
160 DWORD WINAPI
DsMakeSpnA(LPCSTR svc_class
, LPCSTR svc_name
,
161 LPCSTR inst_name
, USHORT inst_port
,
162 LPCSTR ref
, DWORD
*spn_length
, LPSTR spn
)
164 FIXME("(%s,%s,%s,%d,%s,%p,%p): stub!\n", debugstr_a(svc_class
),
165 debugstr_a(svc_name
), debugstr_a(inst_name
), inst_port
,
166 debugstr_a(ref
), spn_length
, spn
);
168 return ERROR_CALL_NOT_IMPLEMENTED
;
171 /***********************************************************************
172 * DsMakeSpnA (NTDSAPI.@)
174 DWORD WINAPI
DsGetSpnA(DS_SPN_NAME_TYPE ServType
, LPCSTR Servlass
, LPCSTR ServName
,
175 USHORT InstPort
, USHORT nInstanceNames
,
176 LPCSTR
*pInstanceNames
, const USHORT
*pInstancePorts
,
177 DWORD
*pSpn
, LPSTR
**pszSpn
)
179 FIXME("(%d,%s,%s,%d,%d,%p,%p,%p,%p): stub!\n", ServType
,
180 debugstr_a(Servlass
), debugstr_a(ServName
), InstPort
,
181 nInstanceNames
, pInstanceNames
, pInstancePorts
, pSpn
, pszSpn
);
183 return ERROR_CALL_NOT_IMPLEMENTED
;
186 /***********************************************************************
187 * DsServerRegisterSpnA (NTDSAPI.@)
189 DWORD WINAPI
DsServerRegisterSpnA(DS_SPN_WRITE_OP operation
, LPCSTR ServiceClass
, LPCSTR UserObjectDN
)
191 FIXME("(%d,%s,%s): stub!\n", operation
,
192 debugstr_a(ServiceClass
), debugstr_a(UserObjectDN
));
193 return ERROR_CALL_NOT_IMPLEMENTED
;
196 /***********************************************************************
197 * DsServerRegisterSpnW (NTDSAPI.@)
199 DWORD WINAPI
DsServerRegisterSpnW(DS_SPN_WRITE_OP operation
, LPCWSTR ServiceClass
, LPCWSTR UserObjectDN
)
201 FIXME("(%d,%s,%s): stub!\n", operation
,
202 debugstr_w(ServiceClass
), debugstr_w(UserObjectDN
));
203 return ERROR_CALL_NOT_IMPLEMENTED
;
206 /***********************************************************************
207 * DsClientMakeSpnForTargetServerW (NTDSAPI.@)
209 DWORD WINAPI
DsClientMakeSpnForTargetServerW(LPCWSTR
class, LPCWSTR name
, DWORD
*buflen
, LPWSTR buf
)
214 TRACE("(%s,%s,%p,%p)\n", debugstr_w(class), debugstr_w(name
), buflen
, buf
);
216 if (!class || !name
|| !buflen
) return ERROR_INVALID_PARAMETER
;
218 len
= lstrlenW(class) + 1 + lstrlenW(name
) + 1;
222 return ERROR_BUFFER_OVERFLOW
;
226 memcpy(buf
, class, lstrlenW(class) * sizeof(WCHAR
));
227 p
= buf
+ lstrlenW(class);
229 memcpy(p
, name
, lstrlenW(name
) * sizeof(WCHAR
));
232 return ERROR_SUCCESS
;
235 /***********************************************************************
236 * DsCrackNamesA (NTDSAPI.@)
238 DWORD WINAPI
DsCrackNamesA(HANDLE handle
, DS_NAME_FLAGS flags
, DS_NAME_FORMAT offered
, DS_NAME_FORMAT desired
,
239 DWORD num
, const CHAR
**names
, PDS_NAME_RESULTA
*result
)
241 FIXME("(%p %u %u %u %u %p %p stub\n", handle
, flags
, offered
, desired
, num
, names
, result
);
242 return ERROR_CALL_NOT_IMPLEMENTED
;
245 /***********************************************************************
246 * DsCrackNamesW (NTDSAPI.@)
248 DWORD WINAPI
DsCrackNamesW(HANDLE handle
, DS_NAME_FLAGS flags
, DS_NAME_FORMAT offered
, DS_NAME_FORMAT desired
,
249 DWORD num
, const WCHAR
**names
, PDS_NAME_RESULTW
*result
)
251 FIXME("(%p %u %u %u %u %p %p stub\n", handle
, flags
, offered
, desired
, num
, names
, result
);
252 return ERROR_CALL_NOT_IMPLEMENTED
;