/*++ * @name BlInitializeLibrary * * The BlInitializeLibrary function initializes, or re-initializes, the * Boot Library. * * @param BootParameters * Pointer to the Boot Application Parameter Block. * * @param LibraryParameters * Pointer to the Boot Library Parameters. * * @return NT_SUCCESS if the boot library was loaded correctly, relevant error * otherwise. * *--*/ NTSTATUS BlInitializeLibrary( _In_ PBOOT_APPLICATION_PARAMETER_BLOCK BootAppParameters, _In_ PBL_LIBRARY_PARAMETERS LibraryParameters ) { NTSTATUS Status; /* Are we re-initializing the library? */ if (LibraryParameters->LibraryFlags & BL_LIBRARY_FLAG_REINITIALIZE) { /* From scratch? */ BlpLibraryParameters = *LibraryParameters; if (LibraryParameters->LibraryFlags & BL_LIBRARY_FLAG_REINITIALIZE_ALL) { #ifdef BL_TPM_SUPPORT /* Reinitialize the TPM security enclave as BCD hash changed */ BlpSiInitialize(1); #endif #ifdef BL_KD_SUPPORT /* Reinitialize the boot debugger as BCD debug options changed */ BlBdInitialize(); #endif /* Reparse the bad page list now that the BCD has been reloaded */ BlMmRemoveBadMemory(); /* Reparse the low/high physical address limits as well */ BlpMmInitializeConstraints(); /* Redraw the graphics console as needed */ BlpDisplayInitialize(LibraryParameters->LibraryFlags); /* Reinitialize resources (language may have changed) */ BlpResourceInitialize(); } /* Nothing to do, we're done */ Status = STATUS_SUCCESS; } else { /* Nope, this is first time initialization */ Status = InitializeLibrary(BootAppParameters, LibraryParameters); } /* Return initialization status */ return Status; }
void CCollectionsComboBox::Initialize(long selectCollection, UINT include) { if(m_nIsForLibrary == 1) { return; } CBCGPToolBarImages lImages; m_ImageList = new CImageList; lImages.SetImageSize(CSize(16, 16)); lImages.Load(IDB_COLLECTIONS_BMP); m_ImageList->Create(16, 16, ILC_COLOR32, lImages.GetCount(), 1); for (int i = 0; i < lImages.GetCount(); i++) m_ImageList->Add(lImages.ExtractIcon(i)); SetImageList(m_ImageList); mSelectedCollection = selectCollection; if (include & includeLibrary) InitializeLibrary(); if (include & includeCollections) InitializeCollections(); //#ifndef _FREE // Smart collections only for professional edition if (include & includeSmartCollections) InitializeSmartCollections(); //#endif int i = -1; if (include & includeCurrentSelection) { i = AddCollectionItem(_T("Current selection"), -1, 0, FILTERTREE_CURRENT_SELECTION); SetItemItalic(i, true); } if (GetCurSel() == -1) SetCurSel(0); }
int __stdcall AddClientDV ( LPDVINFO lpDVInfo ) { BOOL bRet = TRUE ; __try { __try { // Check all the parameters. ASSERT ( NULL != lpDVInfo ) ; ASSERT ( FALSE == IsBadCodePtr ( (FARPROC)lpDVInfo->pfnDump) ) ; ASSERT ( FALSE == IsBadCodePtr ( (FARPROC)lpDVInfo->pfnValidate )); ASSERT ( 0 == lpDVInfo->dwValue ) ; if ( ( NULL == lpDVInfo ) || ( TRUE == IsBadCodePtr((FARPROC)lpDVInfo->pfnDump ) )|| ( TRUE == IsBadCodePtr((FARPROC)lpDVInfo->pfnValidate ) )|| ( 0 != lpDVInfo->dwValue ) ) { TRACE ( "Bad parameters to AddClientDV\n" ); return ( FALSE ) ; } // Has everything been initialized? if ( FALSE == g_bLibInit ) { InitializeLibrary ( ) ; } // Block access to the library. EnterCriticalSection ( &g_stCritSec ) ; // No matter what, bump up g_dwDVCount. g_dwDVCount++ ; // Check that this is not one bump too many. ASSERT ( (WORD)g_dwDVCount < (WORD)0xFFFF ) ; if ( (WORD)g_dwDVCount == (WORD)0xFFFF ) { bRet = FALSE ; __leave ; } // Generate the client block ID. lpDVInfo->dwValue = CLIENT_BLOCK_VALUE ( g_dwDVCount ) ; // Is this the first time through? if ( 1 == g_dwDVCount ) { ASSERT ( NULL == g_pstDVInfo ) ; // Allocate the array for the first time. g_pstDVInfo = (LPDVINFO)HeapAlloc ( g_hHeap , HEAP_GENERATE_EXCEPTIONS | HEAP_ZERO_MEMORY , sizeof ( DVINFO ) ); g_pstDVInfo[ 0 ] = *lpDVInfo ; } else { // This is not the first time so reallocate the array // and tack this new puppy on the end. g_pstDVInfo = (LPDVINFO)HeapReAlloc ( g_hHeap , HEAP_GENERATE_EXCEPTIONS | HEAP_ZERO_MEMORY , g_pstDVInfo , g_dwDVCount * sizeof ( DVINFO)); g_pstDVInfo[ g_dwDVCount - 1 ] = *lpDVInfo ; } } __except ( EXCEPTION_EXECUTE_HANDLER ) { ASSERT ( !"Had a crash in AddClientDV!" ) ; bRet = FALSE ; } } __finally { LeaveCriticalSection ( &g_stCritSec ) ; } return ( bRet ) ; }