Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
35771347
Commit
35771347
authored
Apr 29, 2006
by
Robert Reif
Committed by
Alexandre Julliard
May 05, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
netapi32: Implement NetUserModalsGet level 2.
parent
a15ef7b1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
117 additions
and
5 deletions
+117
-5
access.c
dlls/netapi32/access.c
+117
-5
No files found.
dlls/netapi32/access.c
View file @
35771347
...
...
@@ -20,6 +20,8 @@
#include <stdarg.h>
#include "ntstatus.h"
#define WIN32_NO_STATUS
#include "windef.h"
#include "winbase.h"
#include "winerror.h"
...
...
@@ -27,6 +29,9 @@
#include "lmaccess.h"
#include "lmapibuf.h"
#include "lmerr.h"
#include "winreg.h"
#include "winternl.h"
#include "ntsecapi.h"
#include "netapi32_misc.h"
#include "wine/debug.h"
#include "wine/unicode.h"
...
...
@@ -548,19 +553,126 @@ NetGetDCName(LPCWSTR servername, LPCWSTR domainname, LPBYTE *bufptr)
}
/************************************************************
/************************************************************
******************
* NetUserModalsGet (NETAPI32.@)
*
* Retrieves global information for all users and global groups in the security
* database.
*
* PARAMS
* szServer [I] Specifies the DNS or the NetBIOS name of the remote server
* on which the function is to execute.
* level [I] Information level of the data.
* 0 Return global passwords parameters. bufptr points to a
* USER_MODALS_INFO_0 struct.
* 1 Return logon server and domain controller information. bufptr
* points to a USER_MODALS_INFO_1 struct.
* 2 Return domain name and identifier. bufptr points to a
* USER_MODALS_INFO_2 struct.
* 3 Return lockout information. bufptr points to a USER_MODALS_INFO_3
* struct.
* pbuffer [I] Buffer that receives the data.
*
* RETURNS
* Success: NERR_Success.
* Failure:
* ERROR_ACCESS_DENIED - the user does not have access to the info.
* NERR_InvalidComputer - computer name is invalid.
*/
NET_API_STATUS
WINAPI
NetUserModalsGet
(
LPCWSTR
szServer
,
DWORD
level
,
LPBYTE
*
pbuffer
)
NET_API_STATUS
WINAPI
NetUserModalsGet
(
LPCWSTR
szServer
,
DWORD
level
,
LPBYTE
*
pbuffer
)
{
FIXME
(
"(%s %ld %p) stub!
\n
"
,
debugstr_w
(
szServer
),
level
,
pbuffer
);
TRACE
(
"(%s %ld %p)
\n
"
,
debugstr_w
(
szServer
),
level
,
pbuffer
);
if
(
level
==
2
)
switch
(
level
)
{
case
0
:
/* return global passwords parameters */
FIXME
(
"level 0 not implemented!
\n
"
);
*
pbuffer
=
NULL
;
return
NERR_Success
;
return
NERR_InternalError
;
case
1
:
/* return logon server and domain controller info */
FIXME
(
"level 1 not implemented!
\n
"
);
*
pbuffer
=
NULL
;
return
NERR_InternalError
;
case
2
:
{
/* return domain name and identifier */
PUSER_MODALS_INFO_2
umi
;
LSA_HANDLE
policyHandle
;
LSA_OBJECT_ATTRIBUTES
objectAttributes
;
PPOLICY_ACCOUNT_DOMAIN_INFO
domainInfo
;
NTSTATUS
ntStatus
;
PSID
domainIdentifier
=
NULL
;
int
domainNameLen
;
ZeroMemory
(
&
objectAttributes
,
sizeof
(
objectAttributes
));
ntStatus
=
LsaOpenPolicy
(
NULL
,
&
objectAttributes
,
POLICY_VIEW_LOCAL_INFORMATION
,
&
policyHandle
);
if
(
ntStatus
!=
STATUS_SUCCESS
)
{
WARN
(
"LsaOpenPolicy failed with NT status %lx
\n
"
,
LsaNtStatusToWinError
(
ntStatus
));
return
ntStatus
;
}
ntStatus
=
LsaQueryInformationPolicy
(
policyHandle
,
PolicyAccountDomainInformation
,
(
PVOID
*
)
&
domainInfo
);
if
(
ntStatus
!=
STATUS_SUCCESS
)
{
WARN
(
"LsaQueryInformationPolicy failed with NT status %lx
\n
"
,
LsaNtStatusToWinError
(
ntStatus
));
return
ntStatus
;
}
domainIdentifier
=
domainInfo
->
DomainSid
;
domainNameLen
=
lstrlenW
(
domainInfo
->
DomainName
.
Buffer
)
+
1
;
LsaClose
(
policyHandle
);
ntStatus
=
NetApiBufferAllocate
(
sizeof
(
USER_MODALS_INFO_2
)
+
GetLengthSid
(
domainIdentifier
)
+
domainNameLen
*
sizeof
(
WCHAR
),
(
LPVOID
*
)
pbuffer
);
if
(
ntStatus
!=
NERR_Success
)
{
WARN
(
"NetApiBufferAllocate() failed
\n
"
);
LsaFreeMemory
(
domainInfo
);
return
ntStatus
;
}
umi
=
(
USER_MODALS_INFO_2
*
)
*
pbuffer
;
umi
->
usrmod2_domain_id
=
(
PSID
)(
*
pbuffer
+
sizeof
(
USER_MODALS_INFO_2
));
umi
->
usrmod2_domain_name
=
(
LPWSTR
)(
*
pbuffer
+
sizeof
(
USER_MODALS_INFO_2
)
+
GetLengthSid
(
domainIdentifier
));
lstrcpynW
(
umi
->
usrmod2_domain_name
,
domainInfo
->
DomainName
.
Buffer
,
domainNameLen
);
CopySid
(
GetLengthSid
(
domainIdentifier
),
umi
->
usrmod2_domain_id
,
domainIdentifier
);
LsaFreeMemory
(
domainInfo
);
break
;
}
case
3
:
/* return lockout information */
FIXME
(
"level 3 not implemented!
\n
"
);
*
pbuffer
=
NULL
;
return
NERR_InternalError
;
default:
WARN
(
"Invalid level %ld is specified
\n
"
,
level
);
*
pbuffer
=
NULL
;
return
ERROR_INVALID_LEVEL
;
}
return
NERR_Success
;
}
/************************************************************
...
...
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