Solved

WNetGetCachedPassword

Posted on 1997-04-29
4
171 Views
Last Modified: 2013-12-04
Does anyone have a C definition for WNetGetCachedPassword ?  If so, please post answer here or email to nigelf@compuserve.com...

Many thanks

nigelf
0
Comment
Question by:nigelf
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 3

Accepted Solution

by:
sperling earned 50 total points
ID: 1397008
WORD
WNetGetCachedPassword(pbResource, cbResource, pbPassword, pcbPassword, nType)

LPSTR pbResource;                                                      // name of workgroup, computer, or resource
WORD cbResource;                                                      // size of name, in bytes
LPSTR pbPassword;                                                      // buffer to receive password
LPWORD pcbPassword;                                                // receives size of password, in bytes
BYTE nType;                                                                  // type of password to retrieve


Regards,

Erik.
0
 

Author Comment

by:nigelf
ID: 1397009
A good start, but would you have the range of acceptable values for the nType element ?
0
 
LVL 3

Expert Comment

by:sperling
ID: 1397010
nType
Specifies the type of password to retrieve. This parameter can be one of the following values:
 
Value      Meaning

1      This retrieves the password for a workgroup.
2      This retrieves password for computer. The resource name must have the format:COMPUTERThe format should contain no leading double backslash (\\), and all the letters should be uppercase.
3      This retrieves the password for shared directory or printer. The resource name must have the format:COMPUTER\SHARENAMEThe format should contain no leading double backslash (\\) and all the letters should be uppercase.
4 through 0x7F      This retrieves the password for an application-defined resource. The format for the resource name and password is defined by the application.
0x80 through 0xFE      This retrieves a nondiscardable password for an application-defined resource. The format for the resource name and password is defined by the application.
0xFF      Reserved.
Return Values
The return value is WN_SUCCESS if the function is successful; otherwise, it is one of the following values:
 
Value      Meaning

WN_ACCESS_DENIED      The password cache is not available.
WN_BAD_PASSWORD      The given password is not valid.
WN_BAD_VALUE      The given type is not valid.
WN_NET_ERROR      This indicates an unspecified error. Use the WNetGetError function to retrieve the error number, and the WNetGetErrorText function to retrieve a text description of the error.
 
Value      Meaning

WN_NOT_SUPPORTED      The function is not supported.
WN_OUT_OF_MEMORY      The function could not allocate sufficient memory to complete its operation.


0
 
LVL 3

Expert Comment

by:sperling
ID: 1397011
nType
Specifies the type of password to retrieve. This parameter can be one of the following values:
 
Value      Meaning

1      This retrieves the password for a workgroup.
2      This retrieves password for computer. The resource name must have the format:COMPUTERThe format should contain no leading double backslash (\\), and all the letters should be uppercase.
3      This retrieves the password for shared directory or printer. The resource name must have the format:COMPUTER\SHARENAMEThe format should contain no leading double backslash (\\) and all the letters should be uppercase.
4 through 0x7F      This retrieves the password for an application-defined resource. The format for the resource name and password is defined by the application.
0x80 through 0xFE      This retrieves a nondiscardable password for an application-defined resource. The format for the resource name and password is defined by the application.
0xFF      Reserved.
Return Values
The return value is WN_SUCCESS if the function is successful; otherwise, it is one of the following values:
 
Value      Meaning

WN_ACCESS_DENIED      The password cache is not available.
WN_BAD_PASSWORD      The given password is not valid.
WN_BAD_VALUE      The given type is not valid.
WN_NET_ERROR      This indicates an unspecified error. Use the WNetGetError function to retrieve the error number, and the WNetGetErrorText function to retrieve a text description of the error.
 
Value      Meaning

WN_NOT_SUPPORTED      The function is not supported.
WN_OUT_OF_MEMORY      The function could not allocate sufficient memory to complete its operation.


Regards,

Erik.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
SQL to ElasticSearch Query 1 773
SAPE.heur.AE935 Visual Studio 3 61
Problem to adjust sheet 1 94
dialer.exe 4 68
If you have ever found yourself doing a repetitive action with the mouse and keyboard, and if you have even a little programming experience, there is a good chance that you can use a text editor to whip together a sort of macro to automate the proce…
In this article, I will show how to use the Ribbon IDs Tool Window to assign the built-in Office icons to a ribbon button.  This tool will help us to find the OfficeImageId that corresponds to our desired built-in Office icon. The tool is part of…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question