1 | /* $Id: VBoxServiceUtils.h 106061 2024-09-16 14:03:52Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBoxServiceUtils - Guest Additions Services (Utilities).
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2009-2024 Oracle and/or its affiliates.
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox base platform packages, as
|
---|
10 | * available from https://www.virtualbox.org.
|
---|
11 | *
|
---|
12 | * This program is free software; you can redistribute it and/or
|
---|
13 | * modify it under the terms of the GNU General Public License
|
---|
14 | * as published by the Free Software Foundation, in version 3 of the
|
---|
15 | * License.
|
---|
16 | *
|
---|
17 | * This program is distributed in the hope that it will be useful, but
|
---|
18 | * WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
20 | * General Public License for more details.
|
---|
21 | *
|
---|
22 | * You should have received a copy of the GNU General Public License
|
---|
23 | * along with this program; if not, see <https://www.gnu.org/licenses>.
|
---|
24 | *
|
---|
25 | * SPDX-License-Identifier: GPL-3.0-only
|
---|
26 | */
|
---|
27 |
|
---|
28 | #ifndef GA_INCLUDED_SRC_common_VBoxService_VBoxServiceUtils_h
|
---|
29 | #define GA_INCLUDED_SRC_common_VBoxService_VBoxServiceUtils_h
|
---|
30 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
31 | # pragma once
|
---|
32 | #endif
|
---|
33 |
|
---|
34 | #include "VBoxServiceInternal.h"
|
---|
35 |
|
---|
36 | /** ID cache entry. */
|
---|
37 | typedef struct VGSVCUIDENTRY
|
---|
38 | {
|
---|
39 | /** The identifier name. */
|
---|
40 | uint32_t id;
|
---|
41 | /** Set if UID, clear if GID. */
|
---|
42 | bool fIsUid;
|
---|
43 | /** The name. */
|
---|
44 | char szName[128 - 4 - 1];
|
---|
45 | } VGSVCUIDENTRY;
|
---|
46 | typedef VGSVCUIDENTRY *PVGSVCUIDENTRY;
|
---|
47 |
|
---|
48 |
|
---|
49 | /** ID cache. */
|
---|
50 | typedef struct VGSVCIDCACHE
|
---|
51 | {
|
---|
52 | /** Number of valid cache entries. */
|
---|
53 | uint32_t cEntries;
|
---|
54 | /** The next entry to replace. */
|
---|
55 | uint32_t iNextReplace;
|
---|
56 | /** The cache entries. */
|
---|
57 | VGSVCUIDENTRY aEntries[16];
|
---|
58 | } VGSVCIDCACHE;
|
---|
59 | typedef VGSVCIDCACHE *PVGSVCIDCACHE;
|
---|
60 |
|
---|
61 | #ifdef VBOX_WITH_GUEST_PROPS
|
---|
62 | int VGSvcReadProp(uint32_t u32ClientId, const char *pszPropName, char **ppszValue, char **ppszFlags, uint64_t *puTimestamp);
|
---|
63 | int VGSvcReadPropUInt32(uint32_t u32ClientId, const char *pszPropName, uint32_t *pu32, uint32_t u32Min, uint32_t u32Max);
|
---|
64 | int VGSvcReadHostProp(uint32_t u32ClientId, const char *pszPropName, bool fReadOnly, char **ppszValue, char **ppszFlags,
|
---|
65 | uint64_t *puTimestamp);
|
---|
66 | int VGSvcWritePropF(uint32_t u32ClientId, const char *pszName, const char *pszValueFormat, ...);
|
---|
67 | #endif
|
---|
68 |
|
---|
69 | #ifdef RT_OS_WINDOWS
|
---|
70 | int VGSvcUtilWinGetFileVersionString(const char *pszPath, const char *pszFileName, char *pszVersion, size_t cbVersion);
|
---|
71 | #endif
|
---|
72 |
|
---|
73 | const char *VGSvcIdCacheGetUidName(PVGSVCIDCACHE pIdCache, RTUID uid, const char *pszEntry, const char *pszRelativeTo);
|
---|
74 | const char *VGSvcIdCacheGetGidName(PVGSVCIDCACHE pIdCache, RTGID gid, const char *pszEntry, const char *pszRelativeTo);
|
---|
75 |
|
---|
76 | #endif /* !GA_INCLUDED_SRC_common_VBoxService_VBoxServiceUtils_h */
|
---|
77 |
|
---|