Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
2655ca25
Commit
2655ca25
authored
Aug 05, 2015
by
Hans Leidekker
Committed by
Alexandre Julliard
Aug 06, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdsapi: Implement DsClientMakeSpnForTargetServerW.
parent
a8baf4d3
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
62 additions
and
1 deletion
+62
-1
ntdsapi.c
dlls/ntdsapi/ntdsapi.c
+26
-0
ntdsapi.spec
dlls/ntdsapi/ntdsapi.spec
+1
-1
ntdsapi.c
dlls/ntdsapi/tests/ntdsapi.c
+31
-0
ntdsapi.h
include/ntdsapi.h
+4
-0
No files found.
dlls/ntdsapi/ntdsapi.c
View file @
2655ca25
...
...
@@ -203,3 +203,29 @@ DWORD WINAPI DsServerRegisterSpnW(DS_SPN_WRITE_OP operation, LPCWSTR ServiceClas
debugstr_w
(
ServiceClass
),
debugstr_w
(
UserObjectDN
));
return
ERROR_CALL_NOT_IMPLEMENTED
;
}
DWORD
WINAPI
DsClientMakeSpnForTargetServerW
(
LPCWSTR
class
,
LPCWSTR
name
,
DWORD
*
buflen
,
LPWSTR
buf
)
{
DWORD
len
;
WCHAR
*
p
;
TRACE
(
"(%s,%s,%p,%p)
\n
"
,
debugstr_w
(
class
),
debugstr_w
(
name
),
buflen
,
buf
);
if
(
!
class
||
!
name
||
!
buflen
)
return
ERROR_INVALID_PARAMETER
;
len
=
strlenW
(
class
)
+
1
+
strlenW
(
name
)
+
1
;
if
(
*
buflen
<
len
)
{
*
buflen
=
len
;
return
ERROR_BUFFER_OVERFLOW
;
}
*
buflen
=
len
;
memcpy
(
buf
,
class
,
strlenW
(
class
)
*
sizeof
(
WCHAR
));
p
=
buf
+
strlenW
(
class
);
*
p
++
=
'/'
;
memcpy
(
p
,
name
,
strlenW
(
name
)
*
sizeof
(
WCHAR
));
buf
[
len
]
=
0
;
return
ERROR_SUCCESS
;
}
dlls/ntdsapi/ntdsapi.spec
View file @
2655ca25
...
...
@@ -7,7 +7,7 @@
@ stub DsBindWithSpnA
@ stub DsBindWithSpnW
@ stub DsClientMakeSpnForTargetServerA
@ st
ub DsClientMakeSpnForTargetServerW
@ st
dcall DsClientMakeSpnForTargetServerW(wstr wstr ptr ptr)
@ stub DsCrackNamesA
@ stub DsCrackNamesW
@ stub DsCrackSpn2A
...
...
dlls/ntdsapi/tests/ntdsapi.c
View file @
2655ca25
...
...
@@ -84,7 +84,38 @@ static void test_DsMakeSpn(void)
ok
(
spn_length
==
lstrlenW
(
wszSpn5
)
+
1
,
"DsMakeSpnW should have returned spn_length of %d instead of %d
\n
"
,
lstrlenW
(
wszSpn5
)
+
1
,
spn_length
);
}
static
void
test_DsClientMakeSpnForTargetServer
(
void
)
{
static
const
WCHAR
classW
[]
=
{
'c'
,
'l'
,
'a'
,
's'
,
's'
,
0
};
static
const
WCHAR
hostW
[]
=
{
'h'
,
'o'
,
's'
,
't'
,
'.'
,
'd'
,
'o'
,
'm'
,
'a'
,
'i'
,
'n'
,
0
};
static
const
WCHAR
resultW
[]
=
{
'c'
,
'l'
,
'a'
,
's'
,
's'
,
'/'
,
'h'
,
'o'
,
's'
,
't'
,
'.'
,
'd'
,
'o'
,
'm'
,
'a'
,
'i'
,
'n'
,
0
};
DWORD
ret
,
len
;
WCHAR
buf
[
256
];
ret
=
DsClientMakeSpnForTargetServerW
(
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
ret
==
ERROR_INVALID_PARAMETER
,
"got %u
\n
"
,
ret
);
ret
=
DsClientMakeSpnForTargetServerW
(
classW
,
NULL
,
NULL
,
NULL
);
ok
(
ret
==
ERROR_INVALID_PARAMETER
,
"got %u
\n
"
,
ret
);
ret
=
DsClientMakeSpnForTargetServerW
(
classW
,
hostW
,
NULL
,
NULL
);
ok
(
ret
==
ERROR_INVALID_PARAMETER
,
"got %u
\n
"
,
ret
);
len
=
0
;
ret
=
DsClientMakeSpnForTargetServerW
(
classW
,
hostW
,
&
len
,
NULL
);
ok
(
ret
==
ERROR_BUFFER_OVERFLOW
,
"got %u
\n
"
,
ret
);
ok
(
len
==
lstrlenW
(
resultW
)
+
1
,
"got %u
\n
"
,
len
);
len
=
sizeof
(
buf
)
/
sizeof
(
buf
[
0
]);
buf
[
0
]
=
0
;
ret
=
DsClientMakeSpnForTargetServerW
(
classW
,
hostW
,
&
len
,
buf
);
ok
(
ret
==
ERROR_SUCCESS
,
"got %u
\n
"
,
ret
);
ok
(
len
==
lstrlenW
(
resultW
)
+
1
,
"got %u
\n
"
,
len
);
ok
(
!
lstrcmpW
(
buf
,
resultW
),
"wrong data
\n
"
);
}
START_TEST
(
ntdsapi
)
{
test_DsMakeSpn
();
test_DsClientMakeSpnForTargetServer
();
}
include/ntdsapi.h
View file @
2655ca25
...
...
@@ -25,6 +25,10 @@
extern
"C"
{
#endif
DWORD
WINAPI
DsClientMakeSpnForTargetServerA
(
LPCSTR
,
LPCSTR
,
DWORD
*
,
LPSTR
);
DWORD
WINAPI
DsClientMakeSpnForTargetServerW
(
LPCWSTR
,
LPCWSTR
,
DWORD
*
,
LPWSTR
);
#define DsClientMakeSpnForTargetServer WINELIB_NAME_AW(DsClientMakeSpnForTargetServer)
DWORD
WINAPI
DsMakeSpnA
(
LPCSTR
,
LPCSTR
,
LPCSTR
,
USHORT
,
LPCSTR
,
DWORD
*
,
LPSTR
);
DWORD
WINAPI
DsMakeSpnW
(
LPCWSTR
,
LPCWSTR
,
LPCWSTR
,
USHORT
,
LPCWSTR
,
DWORD
*
,
LPWSTR
);
#define DsMakeSpn WINELIB_NAME_AW(DsMakeSpn)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment