/////////////////////////////////////////////////////////////////////////////
//++
//
//  DllRegisterCluAdminExtension
//
//  Description:
//      Register the extension with the cluster database.
//
//  Arguments:
//      hClusterIn      Handle to the cluster to modify.
//
//  Return Value:
//      S_OK            Extension registered successfully.
//      Win32 error code if another failure occurred.
//
//--
/////////////////////////////////////////////////////////////////////////////
STDAPI
DllRegisterCluAdminExtension(
    HCLUSTER hClusterIn
    )
{
    DWORD       sc = ERROR_SUCCESS;
    DWORD       scTemp = ERROR_SUCCESS;
    LPCWSTR     pwszResTypes = g_wszResourceTypeNames;

    AFX_MANAGE_STATE( AfxGetStaticModuleState() );

    //
    // Register to extend our resource type(s).
    //

    while ( *pwszResTypes != L'\0' )
    {
        wprintf( L"  %s\n", pwszResTypes );
        scTemp = RegisterCluAdminResourceTypeExtension(
                      hClusterIn
                    , pwszResTypes
                    , &CLSID_CoClipBookServerEx
                    );
        if ( scTemp != ERROR_SUCCESS )
        {
            sc = scTemp;
        } // if:  error registering the extension

        pwszResTypes += lstrlenW( pwszResTypes ) + 1;
    }  // while:  more resource types

    if ( sc != ERROR_SUCCESS )
    {
        goto Cleanup;
    } // if:

Cleanup:

    return HRESULT_FROM_WIN32( sc );

}  //*** DllRegisterCluAdminExtension
示例#2
0
/////////////////////////////////////////////////////////////////////////////
//++
//
//	DllRegisterCluAdminExtension
//
//	Routine Description:
//		Register the extension with the cluster database.
//
//	Arguments:
//		hCluster		[IN] Handle to the cluster to modify.
//
//	Return Value:
//		S_OK			Extension registered successfully.
//		Win32 error code if another failure occurred.
//
//--
/////////////////////////////////////////////////////////////////////////////
STDAPI DllRegisterCluAdminExtension(IN HCLUSTER hCluster)
{
	HRESULT		hr;
	HRESULT		hrReturn = S_OK;
	LPCWSTR		pwszResTypes = g_wszResourceTypeNames;

	while (*pwszResTypes != L'\0')
	{
		wprintf(L"  %s\n", pwszResTypes);
		hr = RegisterCluAdminResourceTypeExtension(
					hCluster,
					pwszResTypes,
					&CLSID_CoB2CServiceEx
					);
		if (hr != S_OK)
			hrReturn = hr;
		pwszResTypes += lstrlenW(pwszResTypes) + 1;
	}  // while:  more resource types

	return hrReturn;

}  //*** DllRegisterCluAdminExtension()