VirtualBox

source: vbox/trunk/src/VBox/Additions/WINNT/VBoxCredProv/VBoxCredProvUtils.cpp@ 57358

Last change on this file since 57358 was 57358, checked in by vboxsync, 9 years ago

*: scm cleanup run.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.6 KB
Line 
1/* $Id: VBoxCredProvUtils.cpp 57358 2015-08-14 15:16:38Z vboxsync $ */
2/** @file
3 * VBoxCredProvUtils - Misc. utility functions for VBoxCredProv.
4 */
5
6/*
7 * Copyright (C) 2012 Oracle Corporation
8 *
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.
16 */
17
18
19/*********************************************************************************************************************************
20* Header Files *
21*********************************************************************************************************************************/
22#include <Windows.h>
23#include <iprt/string.h>
24#include <VBox/log.h>
25#include <VBox/VBoxGuestLib.h>
26
27
28/*********************************************************************************************************************************
29* Global Variables *
30*********************************************************************************************************************************/
31/** Verbosity flag for guest logging. */
32DWORD g_dwVerbosity = 0;
33
34
35/**
36 * Displays a verbose message.
37 *
38 * @param iLevel Minimum log level required to display this message.
39 * @param pszFormat The message text.
40 * @param ... Format arguments.
41 */
42void VBoxCredProvVerbose(DWORD dwLevel, const char *pszFormat, ...)
43{
44 if (dwLevel <= g_dwVerbosity)
45 {
46 va_list args;
47 va_start(args, pszFormat);
48 char *psz = NULL;
49 RTStrAPrintfV(&psz, pszFormat, args);
50 va_end(args);
51
52 AssertPtr(psz);
53 LogRel(("%s", psz));
54
55 RTStrFree(psz);
56 }
57}
58
59
60/**
61 * Reports VBoxGINA's status to the host (treated as a guest facility).
62 *
63 * @return IPRT status code.
64 * @param enmStatus Status to report to the host.
65 */
66int VBoxCredProvReportStatus(VBoxGuestFacilityStatus enmStatus)
67{
68 VBoxCredProvVerbose(0, "VBoxCredProv: reporting status %d\n", enmStatus);
69
70 int rc = VbglR3AutoLogonReportStatus(enmStatus);
71 if (RT_FAILURE(rc))
72 VBoxCredProvVerbose(0, "VBoxCredProv: failed to report status %d, rc=%Rrc\n", enmStatus, rc);
73 return rc;
74}
75
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette