Solved

WNetGetCachedPassword

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
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…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

708 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now