次の方法で共有


HKLM\SYSTEM\CurrentControlSet\Services レジストリ ツリー

The HKLM\SYSTEM\CurrentControlSet\Services registry tree stores information about each service on the system. Each driver has a key of the form HKLM\SYSTEM\CurrentControlSet\Services\DriverName.

The PnP manager passes this path of a driver in the RegistryPath parameter when it calls the driver's DriverEntry routine. A driver can store global driver-defined data under the Parameters subkey of its key in the Services tree using an AddReg directive in the driver's INF file. To access that key at runtime, a WDM driver should use IoOpenDriverRegistryKey with a DRIVER_REGKEY_TYPE of DriverRegKeyParameters and a WDF driver should use WdfDriverOpenParametersRegistryKey. このキーの下に格納されている情報は、初期化中にドライバーで使用できます。

ドライバーが通常使用するレジストリ キーの詳細については、「ドライバーの レジストリ キーの概要」を参照してください。

HKLM\SYSTEM\CurrentControlSet\Services の追加キー

Parameters
ドライバー固有のデータを格納するために使用されるキー。 一部の種類のドライバーでは、システムは特定の値エントリを見つけることを想定しています。 You can add value entries to this subkey using AddReg directives in the driver's INF file.

Performance
オプションのパフォーマンス監視の情報を指定するキー。 このキーの下の値は、ドライバーのパフォーマンス DLL の名前と、その DLL 内のエクスポートされた特定の関数の名前を指定します。 You can add value entries to this subkey using AddReg directives in the driver's INF file.

HKLM\SYSTEM\CurrentControlSet\Services<DriverName の一般的なレジストリ キーと値>

Start

Start値は、サービスを開始するタイミングを指定します。 次のいずれかの値になります。

  • 0x0 (ブート): ブート ローダーによって読み込まれます。
  • 0x1 (システム): I/O サブシステムによって読み込まれます。
  • 0x2 (自動): システムの起動時に Service Control Manager によって自動的に読み込まれます。
  • 0x3 (需要): デバイスに必要な場合、PnP によって自動的に読み込まれます。
  • 0x4 (無効): サービスは無効になっており、読み込まれません。

タイプ

Type値は、サービスの種類を指定します。 次の値を組み合わせて使用できます。

  • 0x1 (カーネル ドライバー): デバイス ドライバー。
  • 0x2 (ファイル システム ドライバー): ファイル システム ドライバー。
  • 0x10 (Win32 独自のプロセス): 独自のプロセスで実行される Win32 プログラム。
  • 0x20 (Win32 共有プロセス): プロセスを他のサービスと共有する Win32 プログラム。

ErrorControl

ErrorControl値は、サービスの開始に失敗した場合のエラーの重大度を指定します。 次のいずれかの値になります。

  • 0x0 (無視): エラーは無視され、スタートアップは続行されます。
  • 0x1 (通常): エラーがログに記録され、メッセージ ボックスが表示される場合がありますが、起動は続行されます。
  • 0x2 (重大): エラーがログに記録され、システムは最新の正常な構成で再起動されます。
  • 0x3 (重大): エラーがログに記録され、システムは最後に既知の正常な構成で再起動を試みます。 これが失敗すると、起動が失敗し、システムが停止します。

その他の一般的な値

  • ImagePath: サービス バイナリへのパスを指定します。 Windows creates this value by using the required ServiceBinary entry in the driver's INF file. This entry is in the service-install-section referenced by the driver's INF AddService directive.
  • DisplayName: サービスのフレンドリ名。
  • Description: サービスの説明。

Example

サービスのレジストリ エントリの例を次に示します。

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ExampleService]
"Start"=dword:00000002
"Type"=dword:00000010
"ErrorControl"=dword:00000001
"ImagePath"="C:\\Program Files\\ExampleService\\example.exe"
"DisplayName"="Example Service"
"Description"="This is an example service."