VirtualBox

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

Last change on this file since 95890 was 95890, checked in by vboxsync, 23 months ago

Add/Nt/VBoxCredProv: Make it compile in VBOX_WITH_NOCRT_STATIC mode. bugref:10261

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

© 2023 Oracle
ContactPrivacy policyTerms of Use