1 | /* $Id: VBoxVMInfoOS.cpp 11982 2008-09-02 13:09:44Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBoxVMInfoOS - Guest OS information for the host.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2006-2007 Sun Microsystems, Inc.
|
---|
8 | *
|
---|
9 | * Sun Microsystems, Inc. confidential
|
---|
10 | * All rights reserved
|
---|
11 | */
|
---|
12 |
|
---|
13 | #include "VBoxService.h"
|
---|
14 | #include "VBoxVMInfo.h"
|
---|
15 | #include "VBoxVMInfoOS.h"
|
---|
16 |
|
---|
17 | #include <iprt/system.h>
|
---|
18 |
|
---|
19 | int getPlatformInfo(VBOXINFORMATIONCONTEXT* a_pCtx)
|
---|
20 | {
|
---|
21 | if (FALSE == a_pCtx->fFirstRun) /* Only do this at the initial run. */
|
---|
22 | return 0;
|
---|
23 |
|
---|
24 | char szInfo[256] = {0};
|
---|
25 | int rc = 0;
|
---|
26 |
|
---|
27 | rc = RTSystemQueryOSInfo(RTSYSOSINFO_PRODUCT, szInfo, sizeof(szInfo));
|
---|
28 | vboxVMInfoWriteProp(a_pCtx, "GuestInfo/OS/Product", szInfo);
|
---|
29 |
|
---|
30 | rc = RTSystemQueryOSInfo(RTSYSOSINFO_RELEASE, szInfo, sizeof(szInfo));
|
---|
31 | vboxVMInfoWriteProp(a_pCtx, "GuestInfo/OS/Release", szInfo);
|
---|
32 |
|
---|
33 | rc = RTSystemQueryOSInfo(RTSYSOSINFO_VERSION, szInfo, sizeof(szInfo));
|
---|
34 | vboxVMInfoWriteProp(a_pCtx, "GuestInfo/OS/Version", szInfo);
|
---|
35 |
|
---|
36 | rc = RTSystemQueryOSInfo(RTSYSOSINFO_SERVICE_PACK, szInfo, sizeof(szInfo));
|
---|
37 | vboxVMInfoWriteProp(a_pCtx, "GuestInfo/OS/ServicePack", szInfo);
|
---|
38 |
|
---|
39 | return 0;
|
---|
40 | }
|
---|
41 |
|
---|
42 | int vboxVMInfoOS(VBOXINFORMATIONCONTEXT* a_pCtx)
|
---|
43 | {
|
---|
44 | getPlatformInfo(a_pCtx);
|
---|
45 |
|
---|
46 | return 0;
|
---|
47 | }
|
---|
48 |
|
---|