Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

WNetGetCachedPassword

Posted on 1997-04-29
4
Medium Priority
?
175 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 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

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

Question has a verified solution.

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

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…
After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
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…

916 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