ReactOS 0.4.16-dev-1113-g99ecbf5
ntdsapi.c
Go to the documentation of this file.
1/*
2 * Copyright (C) 2006 Dmitry Timoshkov
3 *
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.
8 *
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.
13 *
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
17 */
18
19#include <stdarg.h>
20
21#include "windef.h"
22#include "winbase.h"
23#include "winerror.h"
24#include "winuser.h"
25#include "ntdsapi.h"
26#include "wine/debug.h"
27
29
30/*****************************************************
31 * DllMain
32 */
34{
35 TRACE("(%p, %d, %p)\n", hinst, reason, reserved);
36
37 switch(reason)
38 {
39#ifndef __REACTOS__
40 case DLL_WINE_PREATTACH:
41 return FALSE; /* prefer native version */
42#endif
43
46 break;
47 }
48 return TRUE;
49}
50
51/***********************************************************************
52 * DsBindA (NTDSAPI.@)
53 */
55 {
56 FIXME("(%s,%s, %p): stub!\n", debugstr_a(controller), debugstr_a(domain), handle);
58}
59
60/***********************************************************************
61 * DsBindW (NTDSAPI.@)
62 */
64 {
65 FIXME("(%s,%s, %p): stub!\n", debugstr_w(controller), debugstr_w(domain), handle);
67}
68
69/***********************************************************************
70 * DsMakeSpnW (NTDSAPI.@)
71 */
73 LPCWSTR inst_name, USHORT inst_port,
74 LPCWSTR ref, DWORD *spn_length, LPWSTR spn)
75{
76 DWORD new_spn_length;
77 INT len;
78 LPWSTR p;
79
80 TRACE("(%s,%s,%s,%d,%s,%p,%p)\n", debugstr_w(svc_class),
81 debugstr_w(svc_name), debugstr_w(inst_name), inst_port,
82 debugstr_w(ref), spn_length, spn);
83
84 if (!svc_class || !svc_name)
86
87 new_spn_length = lstrlenW(svc_class) + 1 /* for '/' */ + 1 /* for terminating '\0' */;
88 if (inst_name)
89 new_spn_length += lstrlenW(inst_name);
90 else
91 new_spn_length += lstrlenW(svc_name);
92 if (inst_port)
93 {
94 USHORT n = inst_port;
95 new_spn_length += 1 /* for ':' */;
96 do
97 {
98 n /= 10;
99 new_spn_length++;
100 } while (n != 0);
101 }
102 if (inst_name)
103 new_spn_length += 1 /* for '/' */ + lstrlenW(svc_name);
104
105 if (*spn_length < new_spn_length)
106 {
107 *spn_length = new_spn_length;
109 }
110 *spn_length = new_spn_length;
111
112 p = spn;
113 len = lstrlenW(svc_class);
114 memcpy(p, svc_class, len * sizeof(WCHAR));
115 p += len;
116 *p = '/';
117 p++;
118 if (inst_name)
119 {
120 len = lstrlenW(inst_name);
121 memcpy(p, inst_name, len * sizeof(WCHAR));
122 p += len;
123 *p = '\0';
124 }
125 else
126 {
127 len = lstrlenW(svc_name);
128 memcpy(p, svc_name, len * sizeof(WCHAR));
129 p += len;
130 *p = '\0';
131 }
132
133 if (inst_port)
134 {
135 static const WCHAR percentU[] = {'%','u',0};
136 *p = ':';
137 p++;
138 wsprintfW(p, percentU, inst_port);
139 p += lstrlenW(p);
140 }
141
142 if (inst_name)
143 {
144 *p = '/';
145 p++;
146 len = lstrlenW(svc_name);
147 memcpy(p, svc_name, len * sizeof(WCHAR));
148 p += len;
149 *p = '\0';
150 }
151
152 TRACE("spn = %s\n", debugstr_w(spn));
153
154 return ERROR_SUCCESS;
155}
156
157/***********************************************************************
158 * DsMakeSpnA (NTDSAPI.@)
159 *
160 * See DsMakeSpnW.
161 */
162DWORD WINAPI DsMakeSpnA(LPCSTR svc_class, LPCSTR svc_name,
163 LPCSTR inst_name, USHORT inst_port,
164 LPCSTR ref, DWORD *spn_length, LPSTR spn)
165{
166 FIXME("(%s,%s,%s,%d,%s,%p,%p): stub!\n", debugstr_a(svc_class),
167 debugstr_a(svc_name), debugstr_a(inst_name), inst_port,
168 debugstr_a(ref), spn_length, spn);
169
171}
172
173/***********************************************************************
174 * DsMakeSpnA (NTDSAPI.@)
175 */
176DWORD WINAPI DsGetSpnA(DS_SPN_NAME_TYPE ServType, LPCSTR Servlass, LPCSTR ServName,
177 USHORT InstPort, USHORT nInstanceNames,
178 LPCSTR *pInstanceNames, const USHORT *pInstancePorts,
179 DWORD *pSpn, LPSTR **pszSpn)
180{
181 FIXME("(%d,%s,%s,%d,%d,%p,%p,%p,%p): stub!\n", ServType,
182 debugstr_a(Servlass), debugstr_a(ServName), InstPort,
183 nInstanceNames, pInstanceNames, pInstancePorts, pSpn, pszSpn);
184
186}
187
188/***********************************************************************
189 * DsServerRegisterSpnA (NTDSAPI.@)
190 */
192{
193 FIXME("(%d,%s,%s): stub!\n", operation,
194 debugstr_a(ServiceClass), debugstr_a(UserObjectDN));
196}
197
198/***********************************************************************
199 * DsServerRegisterSpnW (NTDSAPI.@)
200 */
202{
203 FIXME("(%d,%s,%s): stub!\n", operation,
204 debugstr_w(ServiceClass), debugstr_w(UserObjectDN));
206}
207
208/***********************************************************************
209 * DsClientMakeSpnForTargetServerW (NTDSAPI.@)
210 */
212{
213 DWORD len;
214 WCHAR *p;
215
216 TRACE("(%s,%s,%p,%p)\n", debugstr_w(class), debugstr_w(name), buflen, buf);
217
218 if (!class || !name || !buflen) return ERROR_INVALID_PARAMETER;
219
220 len = lstrlenW(class) + 1 + lstrlenW(name) + 1;
221 if (*buflen < len)
222 {
223 *buflen = len;
225 }
226 *buflen = len;
227
228 memcpy(buf, class, lstrlenW(class) * sizeof(WCHAR));
229 p = buf + lstrlenW(class);
230 *p++ = '/';
231 memcpy(p, name, lstrlenW(name) * sizeof(WCHAR));
232 buf[len - 1] = 0;
233
234 return ERROR_SUCCESS;
235}
236
237/***********************************************************************
238 * DsCrackNamesA (NTDSAPI.@)
239 */
242{
243 FIXME("(%p %u %u %u %u %p %p stub\n", handle, flags, offered, desired, num, names, result);
245}
246
247/***********************************************************************
248 * DsCrackNamesW (NTDSAPI.@)
249 */
252{
253 FIXME("(%p %u %u %u %u %p %p stub\n", handle, flags, offered, desired, num, names, result);
255}
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
operation
Definition: copy.c:29
#define FIXME(fmt,...)
Definition: precomp.h:53
#define ERROR_SUCCESS
Definition: deptool.c:10
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
static WCHAR reason[MAX_STRING_RESOURCE_LEN]
Definition: object.c:1904
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:102
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define DLL_PROCESS_ATTACH
Definition: compat.h:131
#define lstrlenW
Definition: compat.h:750
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
Definition: loader.c:85
DWORD WINAPI DsGetSpnA(DS_SPN_NAME_TYPE ServType, LPCSTR Servlass, LPCSTR ServName, USHORT InstPort, USHORT nInstanceNames, LPCSTR *pInstanceNames, const USHORT *pInstancePorts, DWORD *pSpn, LPSTR **pszSpn)
Definition: ntdsapi.c:176
DWORD WINAPI DsMakeSpnW(LPCWSTR svc_class, LPCWSTR svc_name, LPCWSTR inst_name, USHORT inst_port, LPCWSTR ref, DWORD *spn_length, LPWSTR spn)
Definition: ntdsapi.c:72
BOOL WINAPI DllMain(HINSTANCE hinst, DWORD reason, LPVOID reserved)
Definition: ntdsapi.c:33
DWORD WINAPI DsCrackNamesW(HANDLE handle, DS_NAME_FLAGS flags, DS_NAME_FORMAT offered, DS_NAME_FORMAT desired, DWORD num, const WCHAR **names, PDS_NAME_RESULTW *result)
Definition: ntdsapi.c:250
DWORD WINAPI DsBindA(LPCSTR controller, LPCSTR domain, HANDLE *handle)
Definition: ntdsapi.c:54
DWORD WINAPI DsBindW(LPCWSTR controller, LPCWSTR domain, HANDLE *handle)
Definition: ntdsapi.c:63
DWORD WINAPI DsCrackNamesA(HANDLE handle, DS_NAME_FLAGS flags, DS_NAME_FORMAT offered, DS_NAME_FORMAT desired, DWORD num, const CHAR **names, PDS_NAME_RESULTA *result)
Definition: ntdsapi.c:240
DWORD WINAPI DsClientMakeSpnForTargetServerW(LPCWSTR class, LPCWSTR name, DWORD *buflen, LPWSTR buf)
Definition: ntdsapi.c:211
DWORD WINAPI DsMakeSpnA(LPCSTR svc_class, LPCSTR svc_name, LPCSTR inst_name, USHORT inst_port, LPCSTR ref, DWORD *spn_length, LPSTR spn)
Definition: ntdsapi.c:162
DWORD WINAPI DsServerRegisterSpnA(DS_SPN_WRITE_OP operation, LPCSTR ServiceClass, LPCSTR UserObjectDN)
Definition: ntdsapi.c:191
DWORD WINAPI DsServerRegisterSpnW(DS_SPN_WRITE_OP operation, LPCWSTR ServiceClass, LPCWSTR UserObjectDN)
Definition: ntdsapi.c:201
r reserved
Definition: btrfs.c:3006
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
GLdouble n
Definition: glext.h:7729
GLuint GLuint * names
Definition: glext.h:11545
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
GLbitfield flags
Definition: glext.h:7161
GLuint64EXT * result
Definition: glext.h:11304
GLfloat GLfloat p
Definition: glext.h:8902
GLuint GLuint num
Definition: glext.h:9618
GLenum GLsizei len
Definition: glext.h:6722
int desired
Definition: jpeglib.h:1119
#define debugstr_a
Definition: kernel32.h:31
#define debugstr_w
Definition: kernel32.h:32
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
static HINSTANCE hinst
Definition: edit.c:551
DS_SPN_NAME_TYPE
Definition: ntdsapi.h:61
DS_NAME_FLAGS
Definition: ntdsapi.h:37
DS_NAME_FORMAT
Definition: ntdsapi.h:46
DS_SPN_WRITE_OP
Definition: ntdsapi.h:71
unsigned short USHORT
Definition: pedump.c:61
#define TRACE(s)
Definition: solgame.cpp:4
Definition: cookie.c:42
Definition: name.c:39
Definition: send.c:48
int32_t INT
Definition: typedefs.h:58
#define WINAPI
Definition: msvc.h:6
#define ERROR_BUFFER_OVERFLOW
Definition: winerror.h:185
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)
const char * LPCSTR
Definition: xmlstorage.h:183
char * LPSTR
Definition: xmlstorage.h:182
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
char CHAR
Definition: xmlstorage.h:175