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
192cc0ac
Commit
192cc0ac
authored
Nov 12, 2013
by
Hans Leidekker
Committed by
Alexandre Julliard
Nov 12, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
netapi32: Merge ds.c into netapi32.c.
parent
01fb3a1b
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
126 additions
and
158 deletions
+126
-158
Makefile.in
dlls/netapi32/Makefile.in
+0
-1
ds.c
dlls/netapi32/ds.c
+0
-156
netapi32.c
dlls/netapi32/netapi32.c
+126
-1
No files found.
dlls/netapi32/Makefile.in
View file @
192cc0ac
...
...
@@ -4,7 +4,6 @@ IMPORTLIB = netapi32
IMPORTS
=
iphlpapi ws2_32 advapi32
C_SRCS
=
\
ds.c
\
local_group.c
\
nbcmdqueue.c
\
nbnamecache.c
\
...
...
dlls/netapi32/ds.c
deleted
100644 → 0
View file @
01fb3a1b
/*
* Copyright 2005 Paul Vriens
*
* netapi32 directory service functions
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <stdarg.h>
#include "ntstatus.h"
#define WIN32_NO_STATUS
#include "windef.h"
#include "winbase.h"
#include "winerror.h"
#include "ntsecapi.h"
#include "wine/debug.h"
#include "dsrole.h"
#include "dsgetdc.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
ds
);
DWORD
WINAPI
DsGetDcNameW
(
LPCWSTR
ComputerName
,
LPCWSTR
AvoidDCName
,
GUID
*
DomainGuid
,
LPCWSTR
SiteName
,
ULONG
Flags
,
PDOMAIN_CONTROLLER_INFOW
*
DomainControllerInfo
)
{
FIXME
(
"(%s, %s, %s, %s, %08x, %p): stub
\n
"
,
debugstr_w
(
ComputerName
),
debugstr_w
(
AvoidDCName
),
debugstr_guid
(
DomainGuid
),
debugstr_w
(
SiteName
),
Flags
,
DomainControllerInfo
);
return
ERROR_CALL_NOT_IMPLEMENTED
;
}
DWORD
WINAPI
DsGetDcNameA
(
LPCSTR
ComputerName
,
LPCSTR
AvoidDCName
,
GUID
*
DomainGuid
,
LPCSTR
SiteName
,
ULONG
Flags
,
PDOMAIN_CONTROLLER_INFOA
*
DomainControllerInfo
)
{
FIXME
(
"(%s, %s, %s, %s, %08x, %p): stub
\n
"
,
debugstr_a
(
ComputerName
),
debugstr_a
(
AvoidDCName
),
debugstr_guid
(
DomainGuid
),
debugstr_a
(
SiteName
),
Flags
,
DomainControllerInfo
);
return
ERROR_CALL_NOT_IMPLEMENTED
;
}
DWORD
WINAPI
DsGetSiteNameW
(
LPCWSTR
ComputerName
,
LPWSTR
*
SiteName
)
{
FIXME
(
"(%s, %p): stub
\n
"
,
debugstr_w
(
ComputerName
),
SiteName
);
return
ERROR_CALL_NOT_IMPLEMENTED
;
}
DWORD
WINAPI
DsGetSiteNameA
(
LPCSTR
ComputerName
,
LPSTR
*
SiteName
)
{
FIXME
(
"(%s, %p): stub
\n
"
,
debugstr_a
(
ComputerName
),
SiteName
);
return
ERROR_CALL_NOT_IMPLEMENTED
;
}
/************************************************************
* DsRoleFreeMemory (NETAPI32.@)
*
* PARAMS
* Buffer [I] Pointer to the to-be-freed buffer.
*
* RETURNS
* Nothing
*/
VOID
WINAPI
DsRoleFreeMemory
(
PVOID
Buffer
)
{
TRACE
(
"(%p)
\n
"
,
Buffer
);
HeapFree
(
GetProcessHeap
(),
0
,
Buffer
);
}
/************************************************************
* DsRoleGetPrimaryDomainInformation (NETAPI32.@)
*
* PARAMS
* lpServer [I] Pointer to UNICODE string with ComputerName
* InfoLevel [I] Type of data to retrieve
* Buffer [O] Pointer to to the requested data
*
* RETURNS
*
* NOTES
* When lpServer is NULL, use the local computer
*/
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 */
if
(
!
Buffer
)
return
ERROR_INVALID_PARAMETER
;
if
((
InfoLevel
<
DsRolePrimaryDomainInfoBasic
)
||
(
InfoLevel
>
DsRoleOperationState
))
return
ERROR_INVALID_PARAMETER
;
*
Buffer
=
NULL
;
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
)
{
TRACE
(
"LsaOpenPolicyFailed with NT status %x
\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/netapi32.c
View file @
192cc0ac
/* Copyright 2001 Mike McCormack
* Copyright 2002 Andriy Palamarchuk
* Copyright 2003 Juan Lang
* Copyright 2006 Paul Vriens
* Copyright 200
5,200
6 Paul Vriens
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
...
...
@@ -45,6 +45,8 @@
#include "iphlpapi.h"
#include "ntsecapi.h"
#include "winnls.h"
#include "dsrole.h"
#include "dsgetdc.h"
#include "wine/debug.h"
#include "wine/list.h"
...
...
@@ -1996,3 +1998,126 @@ NET_API_STATUS WINAPI I_BrowserQueryEmulatedDomains(
{
return
ERROR_NOT_SUPPORTED
;
}
DWORD
WINAPI
DsGetDcNameW
(
LPCWSTR
ComputerName
,
LPCWSTR
AvoidDCName
,
GUID
*
DomainGuid
,
LPCWSTR
SiteName
,
ULONG
Flags
,
PDOMAIN_CONTROLLER_INFOW
*
DomainControllerInfo
)
{
FIXME
(
"(%s, %s, %s, %s, %08x, %p): stub
\n
"
,
debugstr_w
(
ComputerName
),
debugstr_w
(
AvoidDCName
),
debugstr_guid
(
DomainGuid
),
debugstr_w
(
SiteName
),
Flags
,
DomainControllerInfo
);
return
ERROR_CALL_NOT_IMPLEMENTED
;
}
DWORD
WINAPI
DsGetDcNameA
(
LPCSTR
ComputerName
,
LPCSTR
AvoidDCName
,
GUID
*
DomainGuid
,
LPCSTR
SiteName
,
ULONG
Flags
,
PDOMAIN_CONTROLLER_INFOA
*
DomainControllerInfo
)
{
FIXME
(
"(%s, %s, %s, %s, %08x, %p): stub
\n
"
,
debugstr_a
(
ComputerName
),
debugstr_a
(
AvoidDCName
),
debugstr_guid
(
DomainGuid
),
debugstr_a
(
SiteName
),
Flags
,
DomainControllerInfo
);
return
ERROR_CALL_NOT_IMPLEMENTED
;
}
DWORD
WINAPI
DsGetSiteNameW
(
LPCWSTR
ComputerName
,
LPWSTR
*
SiteName
)
{
FIXME
(
"(%s, %p): stub
\n
"
,
debugstr_w
(
ComputerName
),
SiteName
);
return
ERROR_CALL_NOT_IMPLEMENTED
;
}
DWORD
WINAPI
DsGetSiteNameA
(
LPCSTR
ComputerName
,
LPSTR
*
SiteName
)
{
FIXME
(
"(%s, %p): stub
\n
"
,
debugstr_a
(
ComputerName
),
SiteName
);
return
ERROR_CALL_NOT_IMPLEMENTED
;
}
/************************************************************
* DsRoleFreeMemory (NETAPI32.@)
*
* PARAMS
* Buffer [I] Pointer to the to-be-freed buffer.
*
* RETURNS
* Nothing
*/
VOID
WINAPI
DsRoleFreeMemory
(
PVOID
Buffer
)
{
TRACE
(
"(%p)
\n
"
,
Buffer
);
HeapFree
(
GetProcessHeap
(),
0
,
Buffer
);
}
/************************************************************
* DsRoleGetPrimaryDomainInformation (NETAPI32.@)
*
* PARAMS
* lpServer [I] Pointer to UNICODE string with ComputerName
* InfoLevel [I] Type of data to retrieve
* Buffer [O] Pointer to to the requested data
*
* RETURNS
*
* NOTES
* When lpServer is NULL, use the local computer
*/
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 */
if
(
!
Buffer
)
return
ERROR_INVALID_PARAMETER
;
if
((
InfoLevel
<
DsRolePrimaryDomainInfoBasic
)
||
(
InfoLevel
>
DsRoleOperationState
))
return
ERROR_INVALID_PARAMETER
;
*
Buffer
=
NULL
;
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
)
{
TRACE
(
"LsaOpenPolicyFailed with NT status %x
\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
;
}
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