ReactOS 0.4.15-dev-8100-g1887773
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)
 
BOOL WINAPI DllMain (HINSTANCE hinst, DWORD reason, LPVOID reserved)
 
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

◆ DllMain()

BOOL WINAPI DllMain ( HINSTANCE  hinst,
DWORD  reason,
LPVOID  reserved 
)

Definition at line 33 of file ntdsapi.c.

34{
35 TRACE("(%p, %d, %p)\n", hinst, reason, reserved);
36
37 switch(reason)
38 {
39 case DLL_WINE_PREATTACH:
40 return FALSE; /* prefer native version */
41
44 break;
45 }
46 return TRUE;
47}
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
static WCHAR reason[MAX_STRING_RESOURCE_LEN]
Definition: object.c:1904
#define DLL_PROCESS_ATTACH
Definition: compat.h:131
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
Definition: loader.c:85
r reserved
Definition: btrfs.c:3006
static HINSTANCE hinst
Definition: edit.c:551
#define TRACE(s)
Definition: solgame.cpp:4

◆ DsBindA()

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

Definition at line 52 of file ntdsapi.c.

53 {
54 FIXME("(%s,%s, %p): stub!\n", debugstr_a(controller), debugstr_a(domain), handle);
56}
#define FIXME(fmt,...)
Definition: debug.h:114
#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 61 of file ntdsapi.c.

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

◆ DsClientMakeSpnForTargetServerW()

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

Definition at line 209 of file ntdsapi.c.

210{
211 DWORD len;
212 WCHAR *p;
213
214 TRACE("(%s,%s,%p,%p)\n", debugstr_w(class), debugstr_w(name), buflen, buf);
215
216 if (!class || !name || !buflen) return ERROR_INVALID_PARAMETER;
217
218 len = lstrlenW(class) + 1 + lstrlenW(name) + 1;
219 if (*buflen < len)
220 {
221 *buflen = len;
223 }
224 *buflen = len;
225
226 memcpy(buf, class, lstrlenW(class) * sizeof(WCHAR));
227 p = buf + lstrlenW(class);
228 *p++ = '/';
229 memcpy(p, name, lstrlenW(name) * sizeof(WCHAR));
230 buf[len - 1] = 0;
231
232 return ERROR_SUCCESS;
233}
#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
Definition: name.c:39
#define ERROR_BUFFER_OVERFLOW
Definition: winerror.h:185
__wchar_t WCHAR
Definition: xmlstorage.h:180

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 238 of file ntdsapi.c.

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

◆ 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 248 of file ntdsapi.c.

250{
251 FIXME("(%p %u %u %u %u %p %p stub\n", handle, flags, offered, desired, num, names, result);
253}

◆ 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 174 of file ntdsapi.c.

178{
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);
182
184}

◆ 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 160 of file ntdsapi.c.

163{
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);
167
169}
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 70 of file ntdsapi.c.

73{
74 DWORD new_spn_length;
75 INT len;
76 LPWSTR p;
77
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);
81
82 if (!svc_class || !svc_name)
84
85 new_spn_length = lstrlenW(svc_class) + 1 /* for '/' */ + 1 /* for terminating '\0' */;
86 if (inst_name)
87 new_spn_length += lstrlenW(inst_name);
88 else
89 new_spn_length += lstrlenW(svc_name);
90 if (inst_port)
91 {
92 USHORT n = inst_port;
93 new_spn_length += 1 /* for ':' */;
94 do
95 {
96 n /= 10;
97 new_spn_length++;
98 } while (n != 0);
99 }
100 if (inst_name)
101 new_spn_length += 1 /* for '/' */ + lstrlenW(svc_name);
102
103 if (*spn_length < new_spn_length)
104 {
105 *spn_length = new_spn_length;
107 }
108 *spn_length = new_spn_length;
109
110 p = spn;
111 len = lstrlenW(svc_class);
112 memcpy(p, svc_class, len * sizeof(WCHAR));
113 p += len;
114 *p = '/';
115 p++;
116 if (inst_name)
117 {
118 len = lstrlenW(inst_name);
119 memcpy(p, inst_name, len * sizeof(WCHAR));
120 p += len;
121 *p = '\0';
122 }
123 else
124 {
125 len = lstrlenW(svc_name);
126 memcpy(p, svc_name, len * sizeof(WCHAR));
127 p += len;
128 *p = '\0';
129 }
130
131 if (inst_port)
132 {
133 static const WCHAR percentU[] = {'%','u',0};
134 *p = ':';
135 p++;
136 wsprintfW(p, percentU, inst_port);
137 p += lstrlenW(p);
138 }
139
140 if (inst_name)
141 {
142 *p = '/';
143 p++;
144 len = lstrlenW(svc_name);
145 memcpy(p, svc_name, len * sizeof(WCHAR));
146 p += len;
147 *p = '\0';
148 }
149
150 TRACE("spn = %s\n", debugstr_w(spn));
151
152 return ERROR_SUCCESS;
153}
GLdouble n
Definition: glext.h:7729
unsigned short USHORT
Definition: pedump.c:61
int32_t INT
Definition: typedefs.h:58
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by test_DsMakeSpn().

◆ DsServerRegisterSpnA()

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

Definition at line 189 of file ntdsapi.c.

190{
191 FIXME("(%d,%s,%s): stub!\n", operation,
192 debugstr_a(ServiceClass), debugstr_a(UserObjectDN));
194}
operation
Definition: copy.c:29

◆ DsServerRegisterSpnW()

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

Definition at line 199 of file ntdsapi.c.

200{
201 FIXME("(%d,%s,%s): stub!\n", operation,
202 debugstr_w(ServiceClass), debugstr_w(UserObjectDN));
204}

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( ntdsapi  )