6d310dbf016b33774803c73777c146fd68331e1e
[openafs.git] / src / WINNT / afsadmsvr / TaAfsAdmSvrClientCell.cpp
1 /*
2  * Copyright 2000, International Business Machines Corporation and others.
3  * All Rights Reserved.
4  * 
5  * This software has been released under the terms of the IBM Public
6  * License.  For details, see the LICENSE file in the top-level source
7  * directory or online at http://www.openafs.org/dl/license10.html
8  */
9
10 #include <winsock2.h>
11 #include <ws2tcpip.h>
12
13 extern "C" {
14 #include <afs/param.h>
15 #include <afs/stds.h>
16 }
17
18 #include "TaAfsAdmSvrClientInternal.h"
19
20
21 /*
22  * ROUTINES ___________________________________________________________________
23  *
24  */
25
26 BOOL ADMINAPI asc_CellChange (UINT_PTR idClient, ASID idCell, LPAFSADMSVR_CHANGECELL_PARAMS pChange, ULONG *pStatus)
27 {
28    BOOL rc = TRUE;
29    ULONG status = 0;
30
31    RpcTryExcept
32       {
33       if ((rc = AfsAdmSvr_ChangeCell (idClient, idCell, pChange, &status)) != FALSE)
34          {
35          // If we succeeded in changing this cell's properties, get the
36          // newest values for our cache.
37          //
38          ASOBJPROP Properties;
39          rc = asc_ObjectPropertiesGet (idClient, GET_ALL_DATA, idCell, idCell, &Properties, &status);
40          }
41       }
42    RpcExcept(1)
43       {
44       rc = FALSE;
45       status = RPC_S_CALL_FAILED_DNE;
46       }
47    RpcEndExcept
48
49    if (!rc && pStatus)
50       *pStatus = status;
51    return rc;
52 }
53
54
55 BOOL ADMINAPI asc_CellRefreshRateSet (UINT_PTR idClient, ASID idCell, ULONG cminRefreshRate, ULONG *pStatus)
56 {
57    BOOL rc = TRUE;
58    ULONG status = 0;
59
60    RpcTryExcept
61       {
62       rc = AfsAdmSvr_SetRefreshRate (idClient, idCell, cminRefreshRate, &status);
63       }
64    RpcExcept(1)
65       {
66       rc = FALSE;
67       status = RPC_S_CALL_FAILED_DNE;
68       }
69    RpcEndExcept
70
71    if (!rc && pStatus)
72       *pStatus = status;
73    return rc;
74 }
75