VirtualBox

source: vbox/trunk/src/VBox/Main/include/VirtualBoxSDSImpl.h@ 66274

Last change on this file since 66274 was 66274, checked in by vboxsync, 8 years ago

VBox/Main: ​bugref:3300: VBoxSVC from terminal server session is not 'visible' - added VBoxSDS implementation

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.7 KB
Line 
1/* $Id: VirtualBoxSDSImpl.h 66274 2017-03-28 00:19:45Z vboxsync $ */
2/** @file
3 * VBox Global COM Class definition
4 */
5
6/*
7 * Copyright (C) 2015-2015 Oracle Corporation
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.215389.xyz. 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#ifndef ____H_VIRTUALBOXSDSIMPL
19#define ____H_VIRTUALBOXSDSIMPL
20
21#include "VirtualBoxSDSWrap.h"
22
23#ifdef RT_OS_WINDOWS
24# include "win/resource.h"
25#endif
26
27class ATL_NO_VTABLE VirtualBoxSDS :
28 public VirtualBoxSDSWrap
29#ifdef RT_OS_WINDOWS
30 , public ATL::CComCoClass<VirtualBoxSDS, &CLSID_VirtualBoxSDS>
31#endif
32{
33public:
34
35 DECLARE_CLASSFACTORY_SINGLETON(VirtualBoxSDS)
36
37 //DECLARE_REGISTRY_RESOURCEID(IDR_VIRTUALBOX)
38
39 // Kind of redundant (VirtualBoxSDSWrap declares itself not aggregatable
40 // and CComCoClass<VirtualBoxSDS, &CLSID_VirtualBoxSDS> as aggregatable,
41 // the former is the first inheritance), but the C multiple inheritance
42 // rules and the class factory in VBoxSDS.cpp needs this to disambiguate.
43 DECLARE_NOT_AGGREGATABLE(VirtualBoxSDS)
44
45 DECLARE_EMPTY_CTOR_DTOR(VirtualBoxSDS)
46
47 HRESULT FinalConstruct();
48 void FinalRelease();
49
50 // public initializers/uninitializers for internal purposes only
51 HRESULT init();
52 void uninit();
53
54private:
55
56 // Wrapped IVirtualBoxSDS properties
57
58 /**
59 * Returns the instance of VirtualBox for client.
60 * It impersonates client and returns his VirtualBox instance
61 * either from cahce or makes new one.
62 */
63 HRESULT getVirtualBox(ComPtr<IVirtualBox> &aVirtualBox);
64
65 /**
66 * Should be called by client to deregister it from VBoxSDS when client beign finished
67 */
68 HRESULT releaseVirtualBox();
69
70 // Wrapped IVirtualBoxSDS methods
71
72 // Inner methods
73
74 /**
75 * Gets the current user name of current thread
76 */
77 int GetCurrentUserName(std::wstring& wstrUserName);
78
79 /**
80 * Prints current user name of this thread to the log
81 * @prefix - strigng fragment that will be inserted at beginning of logging line
82 */
83 void LogUserName(char *prefix);
84
85 /**
86 * Thread that periodically checks items in cache and cleans obsolete items
87 */
88 static DWORD WINAPI CheckCacheThread(LPVOID);
89
90 // data fields
91 class VirtualBoxCache;
92 static VirtualBoxCache m_cache;
93};
94
95
96#endif // !____H_VIRTUALBOXSDSIMPL
97/* vi: set tabstop=4 shiftwidth=4 expandtab: */
Note: See TracBrowser for help on using the repository browser.

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