1 | /* $Id: VBoxCredPoller.h 25811 2010-01-13 17:10:01Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBoxCredPoller - Thread for retrieving user credentials.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2009 Sun Microsystems, Inc.
|
---|
8 | *
|
---|
9 | * Sun Microsystems, Inc. confidential
|
---|
10 | * All rights reserved
|
---|
11 | */
|
---|
12 |
|
---|
13 | #ifndef ___VBoxCredPoller_h
|
---|
14 | #define ___VBoxCredPoller_h
|
---|
15 |
|
---|
16 | #include <iprt/critsect.h>
|
---|
17 | #include <iprt/thread.h>
|
---|
18 | #include <iprt/semaphore.h>
|
---|
19 |
|
---|
20 | class VBoxCredProv;
|
---|
21 | class VBoxCredential;
|
---|
22 |
|
---|
23 | class VBoxCredPoller
|
---|
24 | {
|
---|
25 | public:
|
---|
26 |
|
---|
27 | VBoxCredPoller();
|
---|
28 | virtual ~VBoxCredPoller();
|
---|
29 |
|
---|
30 | public:
|
---|
31 |
|
---|
32 | bool Initialize(VBoxCredProv *pProvider);
|
---|
33 | bool Shutdown();
|
---|
34 | VBoxCredProv* GetProvider() { return m_pProv; }
|
---|
35 | bool QueryCredentials(VBoxCredential *pCred);
|
---|
36 |
|
---|
37 | protected:
|
---|
38 |
|
---|
39 | void credentialsReset(void);
|
---|
40 | int credentialsRetrieve(void);
|
---|
41 | static int threadPoller(RTTHREAD ThreadSelf, void *pvUser);
|
---|
42 |
|
---|
43 | protected:
|
---|
44 |
|
---|
45 | RTTHREAD m_hThreadPoller; /* Thread handle */
|
---|
46 | RTCRITSECT m_csCredUpate;
|
---|
47 | VBoxCredProv *m_pProv; /* Pointer to parent */
|
---|
48 |
|
---|
49 | char *m_pszUser; /* Our lovely credentials */
|
---|
50 | char *m_pszPw;
|
---|
51 | char *m_pszDomain;
|
---|
52 |
|
---|
53 | };
|
---|
54 |
|
---|
55 | #endif /* ___VBoxCredPoller_h */
|
---|