Windows Vista 之啟動一二

來源:互聯網
上載者:User

Windows Vista 啟動時已經不再使用 ntldr 了,取而代之的是 winload,啟動項目也不再從 boot.ini 讀取,而是從註冊表。

我們需要實現一個功能,重啟 Vista 然後讓它進入帶網路連結的安全模式,這樣使得我們可以從遠端控制電腦進入安全模式進行一些維護和修複工作。以前這個工作是在 boot.ini 相關的啟動項中添加參數 /safeboot 來實現的。

微軟定義了一套名為 Boot Config Data 的資料類型,協助我們控制系統的啟動。關於啟動類型有一下定義

typedef enum BcdOSLoaderElementTypes
{
  BcdOSLoaderDevice_OSDevice = 0x21000001,
  BcdOSLoaderString_SystemRoot = 0x22000002,
  BcdOSLoaderBoolean_DetectKernelAndHal = 0x26000010,
  BcdOSLoaderString_KernelPath = 0x22000011,
  BcdOSLoaderString_HalPath = 0x22000012,
  BcdOSLoaderString_DbgTransportPath = 0x22000013,
  BcdOSLoaderInteger_NxPolicy = 0x25000020,
  BcdOSLoaderInteger_PAEPolicy = 0x25000021,
  BcdOSLoaderBoolean_WinPEMode = 0x26000022,
  BcdOSLoaderBoolean_DisableVerifier = 0x26000023,
  BcdOSLoaderBoolean_DisableCrashAutoReboot = 0x26000024,
  BcdOSLoaderBoolean_UseLastGoodSettings = 0x26000025,
  BcdOSLoaderBoolean_NoLowMemory = 0x26000030,
  BcdOSLoaderInteger_RemoveMemory = 0x25000031,
  BcdOSLoaderInteger_IncreaseUserVa = 0x25000032,
  BcdOSLoaderBoolean_UseVgaDriver = 0x26000040,
  BcdOSLoaderBoolean_DisableBootDisplay = 0x26000041,
  BcdOSLoaderBoolean_DisableVesaBios = 0x26000042,
  BcdOSLoaderInteger_ClusterModeAddressing = 0x25000050,
  BcdOSLoaderBoolean_UsePhysicalDestination = 0x26000051,
  BcdOSLoaderInteger_RestrictApicCluster = 0x25000052,
  BcdOSLoaderBoolean_UseBootProcessorOnly = 0x26000060,
  BcdOSLoaderInteger_NumberOfProcessors = 0x25000061,
  BcdOSLoaderBoolean_ForceMaximumProcessors = 0x26000062,
  BcdOSLoaderInteger_UseFirmwarePciSettings = 0x26000070,
  BcdOSLoaderInteger_SafeBoot = 0x25000080,
  BcdOSLoaderBoolean_SafeBootAlternateShell = 0x26000081,
  BcdOSLoaderBoolean_BootLogInitialization = 0x26000090,
  BcdOSLoaderBoolean_VerboseObjectLoadMode = 0x26000091,
  BcdOSLoaderBoolean_KernelDebuggerEnabled = 0x260000A0,
  BcdOSLoaderBoolean_DebuggerHalBreakpoint = 0x260000A1,
  BcdOSLoaderBoolean_EmsEnabled = 0x260000B0
}BcdOSLoaderElementTypes; 

 

看來安全模式啟動是解決了,還有個小問題,我們是需要帶網路的安全模式

typedef enum BcdLibrary_SafeBoot
{
  SafemodeMinimal = 0,
  SafemodeNetwork = 1,
  SafemodeDsRepair = 2
}BcdLibrary_SafeBoot;

至於具體如何使用這些結構,看看

HKLM/BCD00000000/Objects 下的內容,你就清楚了。

 

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.