Platform SDK: Certificate Enrollment Control

ICEnroll::MyStoreFlags [C++]

CEnroll.MyStoreFlags [Visual Basic]

The MyStoreFlags property value is passed directly to CertOpenStore when the MY store is opened. This value is passed as CertOpenStore's dwFlags parameter. For details, see CertOpenStore in the CryptoAPI documentation. The default value for MyStoreFlags is CERT_SYSTEM_STORE_CURRENT_USER.

[Visual Basic]
objEnroll.MyStoreFlags [ = Flags ]
[C++]
HRESULT put_MyStoreFlags(DWORD Flags);
HRESULT get_MyStoreFlags(DWORD * pFlags);

Parameters

[Visual Basic] objEnroll
Object expression that resolves to a CEnroll object.
[Visual Basic,C++] Flags
Value assigned to the MyStoreFlags property. The datatype is a DWORD in C++, and a Long in Visual Basic. It is one of the following values:
[C++] pFlags
Pointer to retrieved property value.

Remarks

MyStoreFlags affects the behavior of the following methods:

Example Code [C++]

DWORD    dwFlags;
HRESULT  hr;

// pEnroll is previously instantiated ICEnroll interface pointer

// retrieve the flag value
hr = pEnroll->get_MyStoreFlags( &dwFlags );
if ( FAILED ( hr ) )
    printf("Failed retrieving MyStoreFlags - %x\n", hr );
else
    printf("MyStoreFlags is %x\n", dwFlags );

// set the flag
hr = pEnroll->put_MyStoreFlags( CERT_SYSTEM_STORE_LOCAL_MACHINE );
if ( FAILED ( hr ) )
    printf("Failed updating MyStoreFlags - %x\n", hr );
else
    printf("Updated MyStoreFlags\n"); 

Example Code [Visual Basic]

Const CERT_SYSTEM_STORE_LOCAL_MACHINE As Long = &H20000

' declare Certificate Enrollment Control object
Dim objXen As Object

Dim flags As Long
    
' instantiate the object
Set objXen = CreateObject("CEnroll.CEnroll.1")

' retrieve and display the MyStoreFlags value
flags = objXen.MyStoreFlags
MsgBox flags, vbOKOnly, "MyStoreFlags"

' set the MyStoreFlags value
objXen.MyStoreFlags = CERT_SYSTEM_STORE_LOCAL_MACHINE 

Requirements

  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.