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
1daf9a1e
Commit
1daf9a1e
authored
Mar 24, 2007
by
Kai Blin
Committed by
Alexandre Julliard
Mar 26, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
netapi32: Implement NetUserChangePassword.
parent
2207f20b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
3 deletions
+40
-3
access.c
dlls/netapi32/access.c
+19
-2
access.c
dlls/netapi32/tests/access.c
+21
-1
No files found.
dlls/netapi32/access.c
View file @
1daf9a1e
...
...
@@ -813,6 +813,23 @@ NET_API_STATUS WINAPI NetUserModalsGet(
NET_API_STATUS
WINAPI
NetUserChangePassword
(
LPCWSTR
domainname
,
LPCWSTR
username
,
LPCWSTR
oldpassword
,
LPCWSTR
newpassword
)
{
FIXME
(
"(%s, %s, ..., ...)
\n
"
,
debugstr_w
(
domainname
),
debugstr_w
(
username
));
return
NERR_InternalError
;
struct
sam_user
*
user
;
TRACE
(
"(%s, %s, ..., ...)
\n
"
,
debugstr_w
(
domainname
),
debugstr_w
(
username
));
if
(
domainname
)
FIXME
(
"Ignoring domainname %s.
\n
"
,
debugstr_w
(
domainname
));
if
((
user
=
NETAPI_FindUser
(
username
))
==
NULL
)
return
NERR_UserNotFound
;
if
(
lstrcmpW
(
user
->
user_password
,
oldpassword
)
!=
0
)
return
ERROR_INVALID_PASSWORD
;
if
(
lstrlenW
(
newpassword
)
>
PWLEN
)
return
ERROR_PASSWORD_RESTRICTION
;
lstrcpyW
(
user
->
user_password
,
newpassword
);
return
NERR_Success
;
}
dlls/netapi32/tests/access.c
View file @
1daf9a1e
...
...
@@ -254,9 +254,29 @@ static void run_userhandling_tests(void)
if
(
ret
!=
NERR_Success
)
return
;
ret
=
pNetUserChangePassword
(
NULL
,
sNonexistentUser
,
sTestUserOldPass
,
sTestUserNewPass
);
ok
(
ret
==
NERR_UserNotFound
,
"Changing password for nonexistent user returned 0x%08x.
\n
"
,
ret
);
ret
=
pNetUserChangePassword
(
NULL
,
sTestUserName
,
sTestUserOldPass
,
sTestUserOldPass
);
ok
(
ret
==
NERR_Success
,
"Changing old password to old password returned 0x%08x.
\n
"
,
ret
);
ret
=
pNetUserChangePassword
(
NULL
,
sTestUserName
,
sTestUserNewPass
,
sTestUserOldPass
);
ok
(
ret
==
ERROR_INVALID_PASSWORD
,
"Trying to change password giving an invalid password returned 0x%08x.
\n
"
,
ret
);
ret
=
pNetUserChangePassword
(
NULL
,
sTestUserName
,
sTestUserOldPass
,
sTooLongPassword
);
ok
(
ret
==
ERROR_PASSWORD_RESTRICTION
,
"Changing to a password that's too long returned 0x%08x.
\n
"
,
ret
);
ret
=
pNetUserChangePassword
(
NULL
,
sTestUserName
,
sTestUserOldPass
,
sTestUserNewPass
);
todo_wine
ok
(
ret
==
NERR_Success
,
"Changing the password failed.
\n
"
);
ok
(
ret
==
NERR_Success
,
"Changing the password correctly returned 0x%08x.
\n
"
,
ret
);
ret
=
pNetUserDel
(
NULL
,
sTestUserName
);
ok
(
ret
==
NERR_Success
,
"Deleting the user failed.
\n
"
);
...
...
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