Solved

WNetGetCachedPassword

Posted on 1997-04-29
4
173 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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

This article shows a few slightly more advanced techniques for Windows 7 gadget programming, including how to save and restore user settings for your gadget and how to populate the "details" panel that is displayed in the Windows 7 gadget gallery.  …
With most software applications trying to cater to multiple user needs nowadays, the focus is to make them as configurable as possible. For e.g., when creating Silverlight applications which will connect to WCF services, the service end point usuall…
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…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

615 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