| Platform SDK: Certificate Enrollment Control |
The RootStoreType property specifies the type of store to use for the store specified by the RootStoreName property. The value for RootStoreType is passed directly on to CertOpenStore. By default, this value is sz_CERT_STORE_PROV_SYSTEM.
Currently only system stores are supported.
[Visual Basic] objEnroll.RootStoreType [ = Type ] [C++] HRESULT put_RootStoreType(BSTR Type); HRESULT get_RootStoreType(BSTR * pType);
| Store provider type | Value |
|---|---|
| sz_CERT_STORE_PROV_SYSTEM_W | "System" |
| sz_CERT_STORE_PROV_SYSTEM | "System" |
RootStoreType affects the behavior of the following methods:
BSTR bstrStoreType = NULL;
HRESULT hr;
// pEnroll is previously instantiated ICEnroll interface pointer
// get the storetype
hr = pEnroll->get_RootStoreType( &bstrStoreType );
if ( FAILED ( hr ) )
printf("Failed getting RootStoreType - %x\n", hr );
else
printf( "RootStoreType: %ws\n", bstrStoreType );
// free BSTR when done
if ( NULL != bstrStoreType )
SysFreeString( bstrStoreType );
// set the storetype
// bstrNewType previously set to a valid store type
hr = pEnroll->put_RootStoreType( bstrNewType );
if ( FAILED ( hr ) )
printf("Failed setting RootStoreType - %x\n", hr );
else
printf( "RootStoreType was set to %ws\n", bstrNewType );
' declare Certificate Enrollment Control object
Dim objXen As Object
Dim strStoreType As String
' instantiate the object
Set objXen = CreateObject("CEnroll.CEnroll.1")
' retrieve and display the RootStoreType
strStoreType = objXen.RootStoreType
MsgBox strStoreType, vbOKOnly, "RootStoreType"
' set the RootStoreType
' (strNewType previously set to a valid store type)
objXen.RootStoreType = strNewType
Windows NT/2000: Requires Windows 2000 (or Windows NT 4.0 with the Windows NT 4.0 Option Pack).
Header: Declared in Xenroll.h.
Library: Use Uuid.lib.