1
/* $Id: tstUserInfo.cpp 32652 2010-09-21 07:04:49Z vboxsync $ */
3
* Test case for correct user environment.
7
* Copyright (C) 2010 Oracle Corporation
9
* This file is part of VirtualBox Open Source Edition (OSE), as
10
* available from http://www.virtualbox.org. This file is free software;
11
* you can redistribute it and/or modify it under the terms of the GNU
12
* General Public License (GPL) as published by the Free Software
13
* Foundation, in version 2 as it comes in the "COPYING" file of the
14
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
19
/*******************************************************************************
21
*******************************************************************************/
29
#include <iprt/initterm.h>
30
#include <iprt/path.h>
31
#include <iprt/stream.h>
32
#include <iprt/string.h>
34
#include <VBox/version.h>
35
#include <VBox/VBoxGuestLib.h>
41
* Init globals and such.
45
int rc = VbglR3Init();
48
printf("VbglR3Init failed with rc=%Rrc.\n", rc);
52
TCHAR szPath[MAX_PATH];
53
HRESULT hRes = SHGetFolderPath(0, CSIDL_APPDATA, 0, 0, szPath);
57
RTPrintf("SHGetFolderPathW (CSIDL_APPDATA) = %ls\n", szPath);
58
hRes = SHGetFolderPath(0, CSIDL_PERSONAL, 0, 0, szPath);
61
RTPrintf("SHGetFolderPathW (CSIDL_PERSONAL) = %ls\n", szPath);
64
RTPrintf("SHGetFolderPathW (CSIDL_PERSONAL) returned error: 0x%x\n", hRes);
67
RTPrintf("SHGetFolderPathW (CSIDL_APPDATA) returned error: 0x%x\n", hRes);
70
rc = RTErrConvertFromWin32(hRes);
73
RTPrintf("Environment:\n\n");
74
RTPrintf("APPDATA = %s\n", getenv("APPDATA"));
76
return RT_SUCCESS(rc) ? 0 : 1;