VirtualBox

source: vbox/trunk/src/VBox/Additions/WINNT/VBoxCredProv/VBoxCredProvProvider.h@ 78393

Last change on this file since 78393 was 76563, checked in by vboxsync, 6 years ago

Additions: Use GA_INCLUDED_ and variations_ as header guard prefixes with scm.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.7 KB
Line 
1/* $Id: VBoxCredProvProvider.h 76563 2019-01-01 03:53:56Z vboxsync $ */
2/** @file
3 * VBoxCredProvProvider - The actual credential provider class.
4 */
5
6/*
7 * Copyright (C) 2012-2019 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#ifndef GA_INCLUDED_SRC_WINNT_VBoxCredProv_VBoxCredProvProvider_h
19#define GA_INCLUDED_SRC_WINNT_VBoxCredProv_VBoxCredProvProvider_h
20#ifndef RT_WITHOUT_PRAGMA_ONCE
21# pragma once
22#endif
23
24#include <credentialprovider.h>
25#include <iprt/win/windows.h>
26#include <strsafe.h>
27
28#include <VBox/VBoxGuestLib.h>
29
30#include "VBoxCredProvCredential.h"
31#include "VBoxCredProvPoller.h"
32
33class VBoxCredProvProvider : public ICredentialProvider
34{
35public:
36
37 /** @name IUnknown methods.
38 * @{ */
39 IFACEMETHODIMP_(ULONG) AddRef(void);
40 IFACEMETHODIMP_(ULONG) Release(void);
41 IFACEMETHODIMP QueryInterface(REFIID interfaceID, void **ppvInterface);
42 /** @} */
43
44
45 /** @name ICredentialProvider interface
46 * @{ */
47 IFACEMETHODIMP SetUsageScenario(CREDENTIAL_PROVIDER_USAGE_SCENARIO cpUsageScenario, DWORD dwFlags);
48 IFACEMETHODIMP SetSerialization(const CREDENTIAL_PROVIDER_CREDENTIAL_SERIALIZATION *pcpCredentialSerialization);
49
50 IFACEMETHODIMP Advise(__in ICredentialProviderEvents *pcpEvents, UINT_PTR upAdviseContext);
51 IFACEMETHODIMP UnAdvise();
52
53 IFACEMETHODIMP GetFieldDescriptorCount(__out DWORD* pdwCount);
54 IFACEMETHODIMP GetFieldDescriptorAt(DWORD dwIndex, __deref_out CREDENTIAL_PROVIDER_FIELD_DESCRIPTOR **ppFieldDescriptor);
55
56 IFACEMETHODIMP GetCredentialCount(__out DWORD *pdwCount,
57 __out DWORD *pdwDefault,
58 __out BOOL *pfAutoLogonWithDefault);
59 IFACEMETHODIMP GetCredentialAt(DWORD dwIndex,
60 __out ICredentialProviderCredential **ppCredProvCredential);
61 /** @} */
62
63 friend HRESULT VBoxCredProvProviderCreate(REFIID riid, __deref_out void **ppvInterface);
64
65protected:
66
67 VBoxCredProvProvider(void);
68 virtual ~VBoxCredProvProvider(void);
69
70public:
71
72 /** Loads the configuration from the registry. */
73 DWORD LoadConfiguration(void);
74 /** Determines whether the current session this provider is
75 * loaded into needs to be handled or not. */
76 bool HandleCurrentSession(void);
77 /** Event which gets triggered by the poller thread in case
78 * there are credentials available from the host. */
79 void OnCredentialsProvided(void);
80
81private:
82
83 /** Interface reference count. */
84 LONG m_cRefs;
85 /** Our one and only credential. */
86 VBoxCredProvCredential *m_pCred;
87 /** Poller thread for credential lookup. */
88 VBoxCredProvPoller *m_pPoller;
89 /** Used to tell our owner to re-enumerate credentials. */
90 ICredentialProviderEvents *m_pEvents;
91 /** Used to tell our owner who we are when asking to re-enumerate credentials. */
92 UINT_PTR m_upAdviseContext;
93 /** Saved usage scenario. */
94 CREDENTIAL_PROVIDER_USAGE_SCENARIO m_enmUsageScenario;
95 /** Flag whether we need to handle remote session over Windows Remote
96 * Desktop Service. */
97 bool m_fHandleRemoteSessions;
98};
99
100#endif /* !GA_INCLUDED_SRC_WINNT_VBoxCredProv_VBoxCredProvProvider_h */
101
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