/*
* CertContextDialog.h
* Copyright (c) 2011 Antillia.com TOSHIYUKI ARAI. ALL RIGHTS RESERVED.
*/
#pragma once
#include <sol/crypt/CertDialog.h>
namespace SOL {
class CertContextDialog :public CertDialog {
private:
DWORD dwContextType;
public:
/**
* Constructor
*
* @param hwnd Handle of the window for the display. If NULL, it's the desktop window.
* @param contextType;
CERT_STORE_CERTIFICATE_CONTEXT
CERT_STORE_CRL_CONTEXT PCCRL_CONTEXT
CERT_STORE_CTL_CONTEXT PCCTL_CONTEXT
*/
CertContextDialog(HWND hParent=NULL,
DWORD contextType=CERT_STORE_CERTIFICATE_CONTEXT)
:CertDialog(hParent),
dwContextType(contextType)
{
}
public:
/**
* @param pvContext For example, this takes a pointer(PCCERT_CONTEXT) to CERT_CONTEXT
*/
int show(__in const void* pvContext,
__in const wchar_t* title=NULL,
__in DWORD dwFlags=0)
{
int rc = NO_ERROR;
HWND hParent = getParent();
if (!CryptUIDlgViewContext(
this->dwContextType,
pvContext,
hParent,
title,
dwFlags,
NULL)) {
//Error
rc = GetLastError();
}
return rc;
}
};
}
|