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
b44d713d
Commit
b44d713d
authored
Sep 20, 2006
by
Juan Lang
Committed by
Alexandre Julliard
Sep 21, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
netapi32: Partially implement DsRoleGetPrimaryDomainInformation, and DsRoleFreeMemory.
parent
0624ba1b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
56 additions
and
3 deletions
+56
-3
ds.c
dlls/netapi32/ds.c
+55
-2
ds.c
dlls/netapi32/tests/ds.c
+1
-1
No files found.
dlls/netapi32/ds.c
View file @
b44d713d
...
...
@@ -20,9 +20,13 @@
#include <stdarg.h>
#include "ntstatus.h"
#define WIN32_NO_STATUS
#include "windef.h"
#include "winbase.h"
#include "winerror.h"
#include "winternl.h"
#include "ntsecapi.h"
#include "wine/debug.h"
#include "dsrole.h"
...
...
@@ -39,7 +43,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(ds);
*/
VOID
WINAPI
DsRoleFreeMemory
(
PVOID
Buffer
)
{
FIXME
(
"(%p) stub
\n
"
,
Buffer
);
TRACE
(
"(%p)
\n
"
,
Buffer
);
HeapFree
(
GetProcessHeap
(),
0
,
Buffer
);
}
/************************************************************
...
...
@@ -59,6 +64,8 @@ DWORD WINAPI DsRoleGetPrimaryDomainInformation(
LPCWSTR
lpServer
,
DSROLE_PRIMARY_DOMAIN_INFO_LEVEL
InfoLevel
,
PBYTE
*
Buffer
)
{
DWORD
ret
;
FIXME
(
"(%p, %d, %p) stub
\n
"
,
lpServer
,
InfoLevel
,
Buffer
);
/* Check some input parameters */
...
...
@@ -66,5 +73,51 @@ DWORD WINAPI DsRoleGetPrimaryDomainInformation(
if
(
!
Buffer
)
return
ERROR_INVALID_PARAMETER
;
if
((
InfoLevel
<
DsRolePrimaryDomainInfoBasic
)
||
(
InfoLevel
>
DsRoleOperationState
))
return
ERROR_INVALID_PARAMETER
;
return
E_NOTIMPL
;
switch
(
InfoLevel
)
{
case
DsRolePrimaryDomainInfoBasic
:
{
LSA_OBJECT_ATTRIBUTES
ObjectAttributes
;
LSA_HANDLE
PolicyHandle
;
PPOLICY_ACCOUNT_DOMAIN_INFO
DomainInfo
;
NTSTATUS
NtStatus
;
int
logon_domain_sz
;
DWORD
size
;
PDSROLE_PRIMARY_DOMAIN_INFO_BASIC
basic
;
ZeroMemory
(
&
ObjectAttributes
,
sizeof
(
ObjectAttributes
));
NtStatus
=
LsaOpenPolicy
(
NULL
,
&
ObjectAttributes
,
POLICY_VIEW_LOCAL_INFORMATION
,
&
PolicyHandle
);
if
(
NtStatus
!=
STATUS_SUCCESS
)
{
ERR
(
"LsaOpenPolicyFailed with NT status %lx
\n
"
,
LsaNtStatusToWinError
(
NtStatus
));
return
ERROR_OUTOFMEMORY
;
}
LsaQueryInformationPolicy
(
PolicyHandle
,
PolicyAccountDomainInformation
,
(
PVOID
*
)
&
DomainInfo
);
logon_domain_sz
=
lstrlenW
(
DomainInfo
->
DomainName
.
Buffer
)
+
1
;
LsaClose
(
PolicyHandle
);
size
=
sizeof
(
DSROLE_PRIMARY_DOMAIN_INFO_BASIC
)
+
logon_domain_sz
*
sizeof
(
WCHAR
);
basic
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
size
);
if
(
basic
)
{
basic
->
MachineRole
=
DsRole_RoleStandaloneWorkstation
;
basic
->
DomainNameFlat
=
(
LPWSTR
)((
LPBYTE
)
basic
+
sizeof
(
DSROLE_PRIMARY_DOMAIN_INFO_BASIC
));
lstrcpyW
(
basic
->
DomainNameFlat
,
DomainInfo
->
DomainName
.
Buffer
);
ret
=
ERROR_SUCCESS
;
}
else
ret
=
ERROR_OUTOFMEMORY
;
*
Buffer
=
(
PBYTE
)
basic
;
LsaFreeMemory
(
DomainInfo
);
}
break
;
default:
ret
=
ERROR_CALL_NOT_IMPLEMENTED
;
}
return
ret
;
}
dlls/netapi32/tests/ds.c
View file @
b44d713d
...
...
@@ -59,7 +59,7 @@ static void test_get(void)
SetLastError
(
0xdeadbeef
);
ret
=
pDsRoleGetPrimaryDomainInformation
(
NULL
,
DsRolePrimaryDomainInfoBasic
,
(
PBYTE
*
)
&
dpdi
);
todo_wine
{
ok
(
ret
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got (%ld)
\n
"
,
ret
);
}
ok
(
ret
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got (%ld)
\n
"
,
ret
);
pDsRoleFreeMemory
(
&
dpdi
);
SetLastError
(
0xdeadbeef
);
...
...
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