eppsman
asked on
Syntax for WNetCachePassword() and WNetGetCachedPassword()
Does anybody know the prototypes for WNetCachePassword() and WNetGetCachedPassword() for Windows 95? They are undocumented functions exported by mpr.dll for modifying .PWL files.
ASKER
What is the meaning of the 18 sent to the functions? Is this just a unique identifier? What does the final 0 do for WNetCachePassword()? If you can tell me these things, you can propose it as an answer, and I'll give it grade A. Thanks!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
What other types besides NetWare are available?
Also, do you have the prototype for WNetRemoveCachedPassword() ?
If you do, I will adjust the points, since that was not part of the original question.
Thanks in advance.
Also, do you have the prototype for WNetRemoveCachedPassword()
If you do, I will adjust the points, since that was not part of the original question.
Thanks in advance.
ASKER
Oh, I can see the prototype for WNetRemoveCachedPassword on your first code sample - never mind that. I would still like to know what other password types besides NetWare are available. Thanks.
I wish i could tell you more but sorry everything above was all i had on the subject and i tried win95 ddk on msdn but it's not there anymore or at least the texts that used to be there are'nt :-(
i also scanned net and newsgroups and could find nothing we dont already know .it seems to be one subject that is hard to get info about i thought being unsupported there would be plenty of people talking bout it on the net somewhere .
this quoted text below is is all i could get that may be of assistance :
"You need to get hold of the win 95 ddk, in their you will find netmpr.h header file which will show the cached headers. DDK will also give you some brief descriptions of the functions."
hope you find what you need
Regards Barry
i also scanned net and newsgroups and could find nothing we dont already know .it seems to be one subject that is hard to get info about i thought being unsupported there would be plenty of people talking bout it on the net somewhere .
this quoted text below is is all i could get that may be of assistance :
"You need to get hold of the win 95 ddk, in their you will find netmpr.h header file which will show the cached headers. DDK will also give you some brief descriptions of the functions."
hope you find what you need
Regards Barry
ASKER
I'll check that out. Thanks.
is this of any help ,Here are two functions for setting/getting a netware password in the pwl file:
CString CNovell::GetPwd(CString szServer)
{
char pbPassword[100];
LPSTR p;
DWORD ret;
WORD cbPassword = sizeof(pbPassword);
ret = WNetGetCachedPassword((LPS
szServer.GetLength(), pbPassword, &cbPassword, (BYTE)18);
if (ret == 0) {
try {
p = pbPassword;
p += (strlen(pbPassword) +1);
return (p);
}catch(...) {
return "";
}
}
else
return "";
}
void CNovell::SetPwd(LPBYTE lpDataSites)
{
DWORD cbUserPwd;
ULONG dwRet;
LPSTR lpUserID, lpPwd,p, lpServer;
LPSTR lpUserPwd = new char[1000];
LPSITEDATA pDataSites;
pDataSites = (LPSITEDATA) lpDataSites;
CString szBuf;
pDataSites->NovellUserID.T
//pDataSites->NovellServer
pDataSites->NovellRemoteDe
pDataSites->NovellPassword
if (pDataSites->NovellPasswor
return;
// extract novell server from the remote path
try {
szBuf = pDataSites->NovellRemoteDe
szBuf = szBuf.Mid(2); // skip "\\"
szBuf = szBuf.Left(szBuf.Find("\\"
lpServer = (LPSTR)(LPCSTR)szBuf;
}
catch(...){
return;
}
//lpServer = (LPSTR)(LPCSTR)pDataSites-
lpPwd = (LPSTR)(LPCSTR)pDataSites-
lpUserID = (LPSTR)(LPCSTR)pDataSites-
strcpy(lpUserPwd, lpUserID);
strcat(lpUserPwd, " ");
strcat(lpUserPwd, lpPwd);
cbUserPwd = strlen(lpUserPwd);
p=strstr(lpUserPwd, " ");
if (p)
*p=0;
else {
delete lpUserPwd;
return;
}
dwRet = WNetRemoveCachedPassword(l
dwRet = WNetCachePassword(lpServer
lpUserPwd, cbUserPwd, (BYTE) 18, 0);
delete lpUserPwd;
Regards Barry