1
/* Editor Settings: expandtabs and use 4 spaces for indentation
2
* ex: set softtabstop=4 tabstop=8 expandtab shiftwidth=4: *
6
* Copyright Likewise Software 2004-2008
9
* This library is free software; you can redistribute it and/or modify it
10
* under the terms of the GNU Lesser General Public License as published by
11
* the Free Software Foundation; either version 2.1 of the license, or (at
12
* your option) any later version.
14
* This library is distributed in the hope that it will be useful,
15
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
17
* General Public License for more details. You should have received a copy
18
* of the GNU Lesser General Public License along with this program. If
19
* not, see <http://www.gnu.org/licenses/>.
21
* LIKEWISE SOFTWARE MAKES THIS SOFTWARE AVAILABLE UNDER OTHER LICENSING
22
* TERMS AS WELL. IF YOU HAVE ENTERED INTO A SEPARATE LICENSE AGREEMENT
23
* WITH LIKEWISE SOFTWARE, THEN YOU MAY ELECT TO USE THE SOFTWARE UNDER THE
24
* TERMS OF THAT SOFTWARE LICENSE AGREEMENT INSTEAD OF THE TERMS OF THE GNU
25
* LESSER GENERAL PUBLIC LICENSE, NOTWITHSTANDING THE ABOVE NOTICE. IF YOU
26
* HAVE QUESTIONS, OR WISH TO REQUEST A COPY OF THE ALTERNATE LICENSING
27
* TERMS OFFERED BY LIKEWISE SOFTWARE, PLEASE CONTACT LIKEWISE SOFTWARE AT
28
* license@likewisesoftware.com
36
IN PCWSTR pwszServername,
37
IN PCWSTR pwszNetname,
42
NET_API_STATUS err = ERROR_SUCCESS;
43
NTSTATUS ntStatus = STATUS_SUCCESS;
44
RPCSTATUS rpcStatus = RPC_S_OK;
45
handle_t hBinding = NULL;
46
PSTR pszServername = NULL;
47
PIO_CREDS pCreds = NULL;
48
PWSTR pwszServer = NULL;
49
PWSTR pwszShare = NULL;
52
BAIL_ON_INVALID_PTR(pwszNetname, err);
53
BAIL_ON_INVALID_PTR(ppBuffer, err);
57
err = LwWc16sToMbs(pwszServername, &pszServername);
58
BAIL_ON_WIN_ERROR(err);
60
err = LwAllocateWc16String(&pwszServer, pwszServername);
61
BAIL_ON_WIN_ERROR(err);
65
err = LwAllocateWc16String(&pwszShare, pwszNetname);
66
BAIL_ON_WIN_ERROR(err);
68
ntStatus = LwIoGetActiveCreds(NULL, &pCreds);
69
BAIL_ON_NT_STATUS(ntStatus);
71
rpcStatus = InitSrvSvcBindingDefault(&hBinding,
76
ntStatus = LwRpcStatusToNtStatus(rpcStatus);
77
BAIL_ON_NT_STATUS(ntStatus);
80
err = NetrShareGetInfo(hBinding,
85
BAIL_ON_WIN_ERROR(err);
92
FreeSrvSvcBinding(&hBinding);
95
LW_SAFE_FREE_MEMORY(pszServername);
96
LW_SAFE_FREE_MEMORY(pwszServer);
97
LW_SAFE_FREE_MEMORY(pwszShare);
99
if (err == ERROR_SUCCESS &&
100
ntStatus != STATUS_SUCCESS)
102
err = LwNtStatusToWin32Error(ntStatus);
118
indent-tabs-mode: nil