Added exception handling wrapper to a number of server requests.
[wine] / dlls / mpr / pwcache.c
1 /*
2  * MPR Password Cache functions
3  */
4
5 #include "winbase.h"
6 #include "winnetwk.h"
7 #include "debugtools.h"
8
9 DEFAULT_DEBUG_CHANNEL(mpr)
10
11 /**************************************************************************
12  * WNetCachePassword [MPR.52]  Saves password in cache
13  *
14  * NOTES
15  *      only the parameter count is verifyed  
16  *
17  *      ---- everything below this line might be wrong (js) -----
18  * RETURNS
19  *    Success: WN_SUCCESS
20  *    Failure: WN_ACCESS_DENIED, WN_BAD_PASSWORD, WN_BADVALUE, WN_NET_ERROR,
21  *             WN_NOT_SUPPORTED, WN_OUT_OF_MEMORY
22  */
23 DWORD WINAPI WNetCachePassword(
24     LPSTR pbResource, /* [in] Name of workgroup, computer, or resource */
25     WORD cbResource,  /* [in] Size of name */
26     LPSTR pbPassword, /* [in] Buffer containing password */
27     WORD cbPassword,  /* [in] Size of password */
28     BYTE nType,       /* [in] Type of password to cache */
29     WORD x)
30     
31 {
32     FIXME( "(%p(%s), %d, %p(%s), %d, %d, 0x%08x): stub\n", 
33            pbResource, debugstr_a(pbResource), cbResource,
34            pbPassword, debugstr_a(pbPassword), cbPassword,
35            nType, x );
36
37     return WN_SUCCESS;
38 }
39
40 /*****************************************************************
41  *  WNetRemoveCachedPassword [MPR.95]
42  */
43 UINT WINAPI WNetRemoveCachedPassword( LPSTR pbResource, WORD cbResource, 
44                                       BYTE nType )
45 {
46     FIXME( "(%p(%s), %d, %d): stub\n", 
47            pbResource, debugstr_a(pbResource), cbResource, nType );
48
49     return WN_SUCCESS;
50 }
51
52 /*****************************************************************
53  * WNetGetCachedPassword [MPR.69]  Retrieves password from cache
54  *
55  * NOTES
56  *  the stub seems to be wrong:
57  *      arg1:   ptr     0x40xxxxxx -> (no string)
58  *      arg2:   len     36
59  *      arg3:   ptr     0x40xxxxxx -> (no string)
60  *      arg4:   ptr     0x40xxxxxx -> 0xc8
61  *      arg5:   type?   4
62  *  
63  *      ---- everything below this line might be wrong (js) -----
64  * RETURNS
65  *    Success: WN_SUCCESS
66  *    Failure: WN_ACCESS_DENIED, WN_BAD_PASSWORD, WN_BAD_VALUE, 
67  *             WN_NET_ERROR, WN_NOT_SUPPORTED, WN_OUT_OF_MEMORY
68  */
69 DWORD WINAPI WNetGetCachedPassword(
70     LPSTR pbResource,   /* [in]  Name of workgroup, computer, or resource */
71     WORD cbResource,    /* [in]  Size of name */
72     LPSTR pbPassword,   /* [out] Buffer to receive password */
73     LPWORD pcbPassword, /* [out] Receives size of password */
74     BYTE nType)         /* [in]  Type of password to retrieve */
75 {
76     FIXME( "(%p(%s), %d, %p, %p, %d): stub\n",
77            pbResource, debugstr_a(pbResource), cbResource,
78            pbPassword, pcbPassword, nType );
79
80     SetLastError(WN_NO_NETWORK);
81     return WN_NO_NETWORK;
82 }
83
84 /*******************************************************************
85  * WNetEnumCachedPasswords [MPR.61]
86  *
87  * NOTES
88  *      the parameter count is verifyed  
89  *
90  *  observed values:
91  *      arg1    ptr     0x40xxxxxx -> (no string)
92  *      arg2    int     32
93  *      arg3    type?   4
94  *      arg4    enumPasswordProc (verifyed)
95  *      arg5    ptr     0x40xxxxxx -> 0x0
96  *
97  *      ---- everything below this line might be wrong (js) -----
98  */
99
100 UINT WINAPI WNetEnumCachedPasswords( LPSTR pbPrefix, WORD cbPrefix,
101                                      BYTE nType, ENUMPASSWORDPROC enumPasswordProc, DWORD x)
102 {
103     FIXME( "(%p(%s), %d, %d, %p, 0x%08lx): stub\n",
104            pbPrefix, debugstr_a(pbPrefix), cbPrefix,
105            nType, enumPasswordProc, x );
106
107     SetLastError(WN_NO_NETWORK);
108     return WN_NO_NETWORK;
109 }
110
111