ReactOS 0.4.17-dev-966-gf06eace
ntdsapi.c File Reference
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winerror.h"
#include "winuser.h"
#include "ntdsapi.h"
#include "wine/debug.h"
Include dependency graph for ntdsapi.c:

Go to the source code of this file.

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (ntdsapi)
 
DWORD WINAPI DsBindA (LPCSTR controller, LPCSTR domain, HANDLE *handle)
 
DWORD WINAPI DsBindW (LPCWSTR controller, LPCWSTR domain, HANDLE *handle)
 
DWORD WINAPI DsMakeSpnW (LPCWSTR svc_class, LPCWSTR svc_name, LPCWSTR inst_name, USHORT inst_port, LPCWSTR ref, DWORD *spn_length, LPWSTR spn)
 
DWORD WINAPI DsMakeSpnA (LPCSTR svc_class, LPCSTR svc_name, LPCSTR inst_name, USHORT inst_port, LPCSTR ref, DWORD *spn_length, LPSTR spn)
 
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)
 
DWORD WINAPI DsServerRegisterSpnA (DS_SPN_WRITE_OP operation, LPCSTR ServiceClass, LPCSTR UserObjectDN)
 
DWORD WINAPI DsServerRegisterSpnW (DS_SPN_WRITE_OP operation, LPCWSTR ServiceClass, LPCWSTR UserObjectDN)
 
DWORD WINAPI DsClientMakeSpnForTargetServerW (LPCWSTR class, LPCWSTR name, DWORD *buflen, LPWSTR buf)
 
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)
 
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)
 

Function Documentation

◆ DsBindA()

DWORD WINAPI DsBindA ( LPCSTR  controller,
LPCSTR  domain,
HANDLE *  handle 
)

Definition at line 33 of file ntdsapi.c.

34 {
35 FIXME("(%s,%s, %p): stub!\n", debugstr_a(controller), debugstr_a(domain), handle);
37}
#define FIXME(fmt,...)
Definition: precomp.h:53
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:102
#define debugstr_a
Definition: kernel32.h:31
Definition: cookie.c:42

◆ DsBindW()

DWORD WINAPI DsBindW ( LPCWSTR  controller,
LPCWSTR  domain,
HANDLE *  handle 
)

Definition at line 42 of file ntdsapi.c.

43 {
44 FIXME("(%s,%s, %p): stub!\n", debugstr_w(controller), debugstr_w(domain), handle);
46}
#define debugstr_w
Definition: kernel32.h:32

◆ DsClientMakeSpnForTargetServerW()

DWORD WINAPI DsClientMakeSpnForTargetServerW ( LPCWSTR  class,
LPCWSTR  name,
DWORD *  buflen,
LPWSTR  buf 
)

Definition at line 189 of file ntdsapi.c.

190{
191 DWORD len;
192 WCHAR *p;
193
194 TRACE("(%s,%s,%p,%p)\n", debugstr_w(class), debugstr_w(name), buflen, buf);
195
196 if (!class || !name || !buflen) return ERROR_INVALID_PARAMETER;
197
198 len = lstrlenW(class) + 1 + lstrlenW(name) + 1;
199 if (*buflen < len)
200 {
201 *buflen = len;
203 }
204 *buflen = len;
205
206 memcpy(buf, class, lstrlenW(class) * sizeof(WCHAR));
207 p = buf + lstrlenW(class);
208 *p++ = '/';
209 memcpy(p, name, lstrlenW(name) * sizeof(WCHAR));
210 buf[len - 1] = 0;
211
212 return ERROR_SUCCESS;
213}
#define ERROR_SUCCESS
Definition: deptool.c:10
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define lstrlenW
Definition: compat.h:750
unsigned long DWORD
Definition: ntddk_ex.h:95
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
GLfloat GLfloat p
Definition: glext.h:8902
GLenum GLsizei len
Definition: glext.h:6722
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
short WCHAR
Definition: pedump.c:58
#define TRACE(s)
Definition: solgame.cpp:4
Definition: name.c:39
#define ERROR_BUFFER_OVERFLOW
Definition: winerror.h:307

Referenced by test_DsClientMakeSpnForTargetServer().

◆ DsCrackNamesA()

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 at line 218 of file ntdsapi.c.

220{
221 FIXME("(%p %u %u %u %lu %p %p stub\n", handle, flags, offered, desired, num, names, result);
223}
GLuint GLuint * names
Definition: glext.h:11545
GLbitfield flags
Definition: glext.h:7161
GLuint64EXT * result
Definition: glext.h:11304
GLuint GLuint num
Definition: glext.h:9618
int desired
Definition: jpeglib.h:1121

◆ DsCrackNamesW()

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 at line 228 of file ntdsapi.c.

230{
231 FIXME("(%p %u %u %u %lu %p %p stub\n", handle, flags, offered, desired, num, names, result);
233}

◆ DsGetSpnA()

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 at line 154 of file ntdsapi.c.

158{
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);
162
164}

◆ DsMakeSpnA()

DWORD WINAPI DsMakeSpnA ( LPCSTR  svc_class,
LPCSTR  svc_name,
LPCSTR  inst_name,
USHORT  inst_port,
LPCSTR  ref,
DWORD *  spn_length,
LPSTR  spn 
)

Definition at line 140 of file ntdsapi.c.

143{
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);
147
149}
Definition: send.c:48

◆ DsMakeSpnW()

DWORD WINAPI DsMakeSpnW ( LPCWSTR  svc_class,
LPCWSTR  svc_name,
LPCWSTR  inst_name,
USHORT  inst_port,
LPCWSTR  ref,
DWORD *  spn_length,
LPWSTR  spn 
)

Definition at line 51 of file ntdsapi.c.

54{
55 DWORD new_spn_length;
56 INT len;
57 LPWSTR p;
58
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);
62
63 if (!svc_class || !svc_name)
65
66 new_spn_length = lstrlenW(svc_class) + 1 /* for '/' */ + 1 /* for terminating '\0' */;
67 if (inst_name)
68 new_spn_length += lstrlenW(inst_name);
69 else
70 new_spn_length += lstrlenW(svc_name);
71 if (inst_port)
72 {
73 USHORT n = inst_port;
74 new_spn_length += 1 /* for ':' */;
75 do
76 {
77 n /= 10;
78 new_spn_length++;
79 } while (n != 0);
80 }
81 if (inst_name)
82 new_spn_length += 1 /* for '/' */ + lstrlenW(svc_name);
83
84 if (*spn_length < new_spn_length)
85 {
86 *spn_length = new_spn_length;
88 }
89 *spn_length = new_spn_length;
90
91 p = spn;
92 len = lstrlenW(svc_class);
93 memcpy(p, svc_class, len * sizeof(WCHAR));
94 p += len;
95 *p = '/';
96 p++;
97 if (inst_name)
98 {
99 len = lstrlenW(inst_name);
100 memcpy(p, inst_name, len * sizeof(WCHAR));
101 p += len;
102 *p = '\0';
103 }
104 else
105 {
106 len = lstrlenW(svc_name);
107 memcpy(p, svc_name, len * sizeof(WCHAR));
108 p += len;
109 *p = '\0';
110 }
111
112 if (inst_port)
113 {
114 *p = ':';
115 p++;
116 wsprintfW(p, L"%u", inst_port);
117 p += lstrlenW(p);
118 }
119
120 if (inst_name)
121 {
122 *p = '/';
123 p++;
124 len = lstrlenW(svc_name);
125 memcpy(p, svc_name, len * sizeof(WCHAR));
126 p += len;
127 *p = '\0';
128 }
129
130 TRACE("spn = %s\n", debugstr_w(spn));
131
132 return ERROR_SUCCESS;
133}
#define L(x)
Definition: resources.c:13
GLdouble n
Definition: glext.h:7729
unsigned short USHORT
Definition: pedump.c:61
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)
uint16_t * LPWSTR
Definition: typedefs.h:56
int32_t INT
Definition: typedefs.h:58

Referenced by test_DsMakeSpn().

◆ DsServerRegisterSpnA()

DWORD WINAPI DsServerRegisterSpnA ( DS_SPN_WRITE_OP  operation,
LPCSTR  ServiceClass,
LPCSTR  UserObjectDN 
)

Definition at line 169 of file ntdsapi.c.

170{
171 FIXME("(%d,%s,%s): stub!\n", operation,
172 debugstr_a(ServiceClass), debugstr_a(UserObjectDN));
174}
operation
Definition: copy.c:29

◆ DsServerRegisterSpnW()

DWORD WINAPI DsServerRegisterSpnW ( DS_SPN_WRITE_OP  operation,
LPCWSTR  ServiceClass,
LPCWSTR  UserObjectDN 
)

Definition at line 179 of file ntdsapi.c.

180{
181 FIXME("(%d,%s,%s): stub!\n", operation,
182 debugstr_w(ServiceClass), debugstr_w(UserObjectDN));
184}

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( ntdsapi  )