
Change Windows 95 and Windows NT password
What I did was the following:
Option Explicit
Type LOGONINFO
lpUsername As String
lpPassword As String
cbUsername As Long
cbPassword As Long
End Type
Declare Function PPChangePassword Lib "msnp32.dll" _
(lpAuthentInfo As LOGONINFO, _
lpPreviousAuthentInfo As LOGONINFO, _
ByVal dwAction&) As Long
Declare Function PwdChangePassword Lib "mpr.dll" (ByVal lpProvider$, ByVal
hwndOwner&, ByVal dwFlags&)
The following header file I used "PWDSPI.H"
/*****************************************************************/
/** Microsoft Windows for Workgroups **/
/** Copyright (C) Microsoft Corp., 1991-1994 **/
/*****************************************************************/
/* PWDSPI.H -- Password provider interface definitions.
*
* History:
* 10/7/94 jeremys Created
*
*/
#ifndef _INC_PWDSPI
#define _INC_PWDSPI
#ifndef RC_INVOKED
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#endif
typedef struct _CHANGEPWDINFO {
LPTSTR lpUsername;
LPTSTR lpPassword;
DWORD cbPassword;
Quote:
} CHANGEPWDINFO, FAR *LPCHANGEPWDINFO;
#define PWDCHANGE_MASTERPWD_NOTIFY 1
#define PWDCHANGE_PROVIDERPWD_PENDING 2
#define PWDCHANGE_PROVIDERPWD_COMMIT 3
#define PWDCHANGE_PROVIDERPWD_CANCEL 4
//
// PASSWORD SYNCHRONIZATION FUNCTIONS
//
DWORD APIENTRY
PwdChangePasswordA (
LPCSTR lpPassword,
HWND hwndOwner,
DWORD dwFlags,
LPCHANGEPWDINFO lpChangePwdInfo
);
DWORD APIENTRY
PwdChangePasswordW (
LPCWSTR lpPassword,
HWND hwndOwner,
DWORD dwFlags,
LPCHANGEPWDINFO lpChangePwdInfo
);
#ifdef UNICODE
#define PwdChangePassword PwdChangePasswordW
#else
#define PwdChangePassword PwdChangePasswordA
#endif // UNICODE
#define CHANGEPWD_OLDPWDONLY 0x01 // only prompt for old password, use
// login password for new password
DWORD APIENTRY
PwdGetPasswordStatusA (
LPCSTR lpPassword,
DWORD dwIndex,
LPDWORD lpStatus
);
DWORD APIENTRY
PwdGetPasswordStatusW (
LPCWSTR lpPassword,
DWORD dwIndex,
LPDWORD lpStatus
);
#ifdef UNICODE
#define PwdGetPasswordStatus PwdGetPasswordStatusW
#else
#define PwdGetPasswordStatus PwdGetPasswordStatusA
#endif // UNICODE
// ordinals for index to WNetGetPasswordStatus
#define PS_ONOFF 0x01
#define PS_HASOLDPWD 0x02
#define PS_SYNCMASTERPWD 0x03
#define PS_STORAGETYPE 0x04
// bits for each index
#define PS_ONOFF_OFF 0x00
#define PS_ONOFF_ON 0x01
#define PS_HASOLDPWD_OFF 0x00
#define PS_HASOLDPWD_ON 0x01
#define PS_SYNCMASTERPWD_OFF 0x00
#define PS_SYNCMASTERPWD_ON 0x01
#define PS_SYNCMASTERPWD_NOTSUPP 0x02
#define PS_STORAGETYPE_LOCAL 0x01
#define PS_STORAGETYPE_NETWORK 0x02
DWORD APIENTRY
PwdSetPasswordStatusA (
LPCSTR lpPassword,
DWORD dwIndex,
DWORD dwStatus
);
DWORD APIENTRY
PwdSetPasswordStatusW (
LPCWSTR lpPassword,
DWORD dwIndex,
DWORD dwStatus
);
#ifdef UNICODE
#define PwdSetPasswordStatus PwdSetPasswordStatusW
#else
#define PwdSetPasswordStatus PwdSetPasswordStatusA
#endif // UNICODE
#ifndef RC_INVOKED
#ifdef __cplusplus
Quote:
}; /* extern "C" */
#endif /* __cplusplus */
#endif
#endif // _INC_PWDSPI
Is there anyone out there that has any idea how I should change the Windows
95 password in a progragram written in VB?
Thanks,
Ron Rong
Quote:
>: Hi,
>: What I would like to change the NT password and the Windows password in
>one
>: program. I have found two ways of changing the Windows NT password.
>: 1. PwdChangePassword
>: 2. PPChangePassword
>: Can anyone help me with the function I should use to change the Windows
>95
>: password or does anyone know of a program that does this?
>:
>: Thanks,
>: Ron Rong
>:
>:
>:
> Don't know where you got those names from but they don't exist as
>Microsoft APIs in NT workstation or NT Server at least 4.0 or 5.0 b1. From
>what I've seen so far They must have come from some third party dlls.
>therefore I can't give you any help with them in 95.
>Sorry.
>--
>=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
>It just told me what I knew all along, | Zaphod BeebleBrox |
>I'm a really great guy! Didn't I tell | #1 Ego Maniac |
>ya baby, I am Zaphod Beeblebrox!! | HHGttG |
>=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
>What Not 2-Do About Spam - http://spam.abuse.net/dontdo.html