352bb6b9d2fa1f7df7797f50c58e297ac37059a2vboxsync/* $Id$ */
352bb6b9d2fa1f7df7797f50c58e297ac37059a2vboxsync/** @file
352bb6b9d2fa1f7df7797f50c58e297ac37059a2vboxsync * VBoxCredPoller - Thread for retrieving user credentials.
352bb6b9d2fa1f7df7797f50c58e297ac37059a2vboxsync */
352bb6b9d2fa1f7df7797f50c58e297ac37059a2vboxsync
352bb6b9d2fa1f7df7797f50c58e297ac37059a2vboxsync/*
352bb6b9d2fa1f7df7797f50c58e297ac37059a2vboxsync * Copyright (C) 2012 Oracle Corporation
352bb6b9d2fa1f7df7797f50c58e297ac37059a2vboxsync *
352bb6b9d2fa1f7df7797f50c58e297ac37059a2vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
352bb6b9d2fa1f7df7797f50c58e297ac37059a2vboxsync * available from http://www.virtualbox.org. This file is free software;
352bb6b9d2fa1f7df7797f50c58e297ac37059a2vboxsync * you can redistribute it and/or modify it under the terms of the GNU
352bb6b9d2fa1f7df7797f50c58e297ac37059a2vboxsync * General Public License (GPL) as published by the Free Software
352bb6b9d2fa1f7df7797f50c58e297ac37059a2vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
352bb6b9d2fa1f7df7797f50c58e297ac37059a2vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
352bb6b9d2fa1f7df7797f50c58e297ac37059a2vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
352bb6b9d2fa1f7df7797f50c58e297ac37059a2vboxsync */
352bb6b9d2fa1f7df7797f50c58e297ac37059a2vboxsync
352bb6b9d2fa1f7df7797f50c58e297ac37059a2vboxsync#ifndef ___VBOX_CREDPROV_POLLER_H___
352bb6b9d2fa1f7df7797f50c58e297ac37059a2vboxsync#define ___VBOX_CREDPROV_POLLER_H___
352bb6b9d2fa1f7df7797f50c58e297ac37059a2vboxsync
352bb6b9d2fa1f7df7797f50c58e297ac37059a2vboxsync#include <iprt/critsect.h>
352bb6b9d2fa1f7df7797f50c58e297ac37059a2vboxsync#include <iprt/thread.h>
352bb6b9d2fa1f7df7797f50c58e297ac37059a2vboxsync#include <iprt/semaphore.h>
352bb6b9d2fa1f7df7797f50c58e297ac37059a2vboxsync
352bb6b9d2fa1f7df7797f50c58e297ac37059a2vboxsyncclass VBoxCredProvProvider;
352bb6b9d2fa1f7df7797f50c58e297ac37059a2vboxsync
352bb6b9d2fa1f7df7797f50c58e297ac37059a2vboxsyncclass VBoxCredProvPoller
352bb6b9d2fa1f7df7797f50c58e297ac37059a2vboxsync{
352bb6b9d2fa1f7df7797f50c58e297ac37059a2vboxsyncpublic:
352bb6b9d2fa1f7df7797f50c58e297ac37059a2vboxsync VBoxCredProvPoller(void);
352bb6b9d2fa1f7df7797f50c58e297ac37059a2vboxsync virtual ~VBoxCredProvPoller(void);
352bb6b9d2fa1f7df7797f50c58e297ac37059a2vboxsync
352bb6b9d2fa1f7df7797f50c58e297ac37059a2vboxsync int Initialize(VBoxCredProvProvider *pProvider);
352bb6b9d2fa1f7df7797f50c58e297ac37059a2vboxsync int Shutdown(void);
352bb6b9d2fa1f7df7797f50c58e297ac37059a2vboxsync
352bb6b9d2fa1f7df7797f50c58e297ac37059a2vboxsyncprotected:
352bb6b9d2fa1f7df7797f50c58e297ac37059a2vboxsync /** Static function for our poller routine, used in an own thread to
352bb6b9d2fa1f7df7797f50c58e297ac37059a2vboxsync * check for credentials on the host. */
352bb6b9d2fa1f7df7797f50c58e297ac37059a2vboxsync static DECLCALLBACK(int) threadPoller(RTTHREAD ThreadSelf, void *pvUser);
352bb6b9d2fa1f7df7797f50c58e297ac37059a2vboxsync
352bb6b9d2fa1f7df7797f50c58e297ac37059a2vboxsync /** Thread handle. */
352bb6b9d2fa1f7df7797f50c58e297ac37059a2vboxsync RTTHREAD m_hThreadPoller;
352bb6b9d2fa1f7df7797f50c58e297ac37059a2vboxsync /** Pointer to parent. Needed for notifying if credentials
352bb6b9d2fa1f7df7797f50c58e297ac37059a2vboxsync * are available. */
352bb6b9d2fa1f7df7797f50c58e297ac37059a2vboxsync VBoxCredProvProvider *m_pProv;
352bb6b9d2fa1f7df7797f50c58e297ac37059a2vboxsync};
352bb6b9d2fa1f7df7797f50c58e297ac37059a2vboxsync
352bb6b9d2fa1f7df7797f50c58e297ac37059a2vboxsync#endif /* !___VBOX_CREDPROV_POLLER_H___ */
352bb6b9d2fa1f7df7797f50c58e297ac37059a2vboxsync