Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

WNetGetCachedPassword

Posted on 1997-04-29
4
Medium Priority
?
174 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 100 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: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

This article describes how to programmatically preset the "Pages per Sheet" option that's available with most printer drivers.   This setting lets you do "n-Up" printing, where two, four, or more pages are printed on each sheet of paper. If your …
This article describes how to add a user-defined command button to the Windows 7 Explorer toolbar.  In the previous article (http://www.experts-exchange.com/A_2172.html), we saw how to put the Delete button back there where it belongs.  "Delete" is …
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…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

688 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