Class: WMI::Win32_Process

Inherits:
Base
  • Object
show all
Defined in:
lib/Win32_Process.rb

Overview

Win32_Process クラスは、Win32 システムのイベントのシーケンスを表します。プロセッサまたはインタープリタ、実行可能コードの一部、入力セットの一連の連続する操作は、このクラスの子孫 (またはメンバ) です。 例: Win32 システムで実行するクライアント アプリケーションです。

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Methods inherited from Base

#AddRef, #AssociatorsAsync_, #Associators_, #Clone_, #CompareTo_, #DeleteAsync_, #Delete_, #Derivation_, #ExecMethodAsync_, #ExecMethod_, #GetIDsOfNames, #GetObjectText_, #GetText_, #GetTypeInfo, #GetTypeInfoCount, #InstancesAsync_, #Instances_, #Invoke, #Methods_, #Path_, #Properties_, #PutAsync_, #Put_, #Qualifiers_, #QueryInterface, #ReferencesAsync_, #References_, #Refresh_, #Release, #Security_, #SetFromText_, #SpawnDerivedClass_, #SpawnInstance_, #SubclassesAsync_, #Subclasses_, #SystemProperties_

Instance Attribute Details

- (string) Caption (readonly)

Caption プロパティは、オブジェクトについての簡単な説明 (1 行分の文字列) です。

Returns:

  • (string)

    Caption



182
183
184
# File 'lib/Win32_Process.rb', line 182

def Caption
  @Caption
end

- (string) CommandLine (readonly)

CommandLine プロパティにより、適用できる場合は、特定の処理を開始するのに使用されるコマンド ラインが指定されます。

Returns:

  • (string)

    CommandLine



187
188
189
# File 'lib/Win32_Process.rb', line 187

def CommandLine
  @CommandLine
end

- (string) CreationClassName (readonly)

CreationClassName は、インスタンスの作成で使用されるクラス名、またはサブクラス名を示します。

 

Returns:

  • (string)

    CreationClassName



193
194
195
# File 'lib/Win32_Process.rb', line 193

def CreationClassName
  @CreationClassName
end

- (datetime) CreationDate (readonly)

プロセスが実行開始した時刻です。

Returns:

  • (datetime)

    CreationDate



198
199
200
# File 'lib/Win32_Process.rb', line 198

def CreationDate
  @CreationDate
end

- (string) CSCreationClassName (readonly)

CSCreationClassName にはスコーピング コンピュータ システムの作成クラス名が含まれています。

Returns:

  • (string)

    CSCreationClassName



203
204
205
# File 'lib/Win32_Process.rb', line 203

def CSCreationClassName
  @CSCreationClassName
end

- (string) CSName (readonly)

スコーピング コンピュータ システムの名前です。

Returns:

  • (string)

    CSName



208
209
210
# File 'lib/Win32_Process.rb', line 208

def CSName
  @CSName
end

- (string) Description (readonly)

Description プロパティでオブジェクトの説明が提供されます。

Returns:

  • (string)

    Description



214
215
216
# File 'lib/Win32_Process.rb', line 214

def Description
  @Description
end

- (string) ExecutablePath (readonly)

ExecutablePath プロパティは、プロセスの実行可能ファイルへのパスを示します。

 

Returns:

  • (string)

    ExecutablePath



221
222
223
# File 'lib/Win32_Process.rb', line 221

def ExecutablePath
  @ExecutablePath
end

- (uint16) ExecutionState (readonly)

プロセスの現在の操作状態を示します。

 

Returns:

  • (uint16)

    ExecutionState



227
228
229
# File 'lib/Win32_Process.rb', line 227

def ExecutionState
  @ExecutionState
end

- (string) Handle (readonly)

プロセスを識別するのに使用される文字列です。

 

Returns:

  • (string)

    Handle



233
234
235
# File 'lib/Win32_Process.rb', line 233

def Handle
  @Handle
end

- (uint32) HandleCount (readonly)

HandleCount プロパティにより、このプロセスで現在開かれているハンドルの合計が指定されます。

 

Returns:

  • (uint32)

    HandleCount



242
243
244
# File 'lib/Win32_Process.rb', line 242

def HandleCount
  @HandleCount
end

- (datetime) InstallDate (readonly)

InstallDate プロパティは、オブジェクトがインストールされた日時を示す値です。

 

Returns:

  • (datetime)

    InstallDate



248
249
250
# File 'lib/Win32_Process.rb', line 248

def InstallDate
  @InstallDate
end

- (uint64) KernelModeTime (readonly)

カーネル モードでの時間 (100 ナノ秒) です。

 

Returns:

  • (uint64)

    KernelModeTime



254
255
256
# File 'lib/Win32_Process.rb', line 254

def KernelModeTime
  @KernelModeTime
end

- (uint32) MaximumWorkingSetSize (readonly)

MaximumWorkingSetSize プロパティは、プロセスの動作セットの最大サイズを示します。

 

Returns:

  • (uint32)

    MaximumWorkingSetSize



263
264
265
# File 'lib/Win32_Process.rb', line 263

def MaximumWorkingSetSize
  @MaximumWorkingSetSize
end

- (uint32) MinimumWorkingSetSize (readonly)

MinimumWorkingSetSize プロパティは、プロセスの動作セットの最小サイズを示します。

 

Returns:

  • (uint32)

    MinimumWorkingSetSize



272
273
274
# File 'lib/Win32_Process.rb', line 272

def MinimumWorkingSetSize
  @MinimumWorkingSetSize
end

- (string) Name (readonly)

Name プロパティで、オブジェクトを認識するラベルを定義します。

 

Returns:

  • (string)

    Name



278
279
280
# File 'lib/Win32_Process.rb', line 278

def Name
  @Name
end

- (string) OSCreationClassName (readonly)

スコーピング オペレーティング システムの作成クラス名です。

Returns:

  • (string)

    OSCreationClassName



283
284
285
# File 'lib/Win32_Process.rb', line 283

def OSCreationClassName
  @OSCreationClassName
end

- (string) OSName (readonly)

スコーピング オペレーティング システムの名前です。

Returns:

  • (string)

    OSName



288
289
290
# File 'lib/Win32_Process.rb', line 288

def OSName
  @OSName
end

- (uint64) OtherOperationCount (readonly)

OtherOperationCount プロパティにより、読み取りおよび書き込み操作のほかに実行された I/O 操作の数が指定されます。

Returns:

  • (uint64)

    OtherOperationCount



293
294
295
# File 'lib/Win32_Process.rb', line 293

def OtherOperationCount
  @OtherOperationCount
end

- (uint64) OtherTransferCount (readonly)

OtherTransferCount プロパティにより、読み取りと書き込み操作以外の操作中に転送されたデータの量が指定されます。

Returns:

  • (uint64)

    OtherTransferCount



298
299
300
# File 'lib/Win32_Process.rb', line 298

def OtherTransferCount
  @OtherTransferCount
end

- (uint32) PageFaults (readonly)

PageFaults プロパティは、プロセスに生成されるページ フォールトの数を示します。

 

Returns:

  • (uint32)

    PageFaults



305
306
307
# File 'lib/Win32_Process.rb', line 305

def PageFaults
  @PageFaults
end

- (uint32) PageFileUsage (readonly)

PageFileUsage プロパティは、プロセスに現在使用されているページ ファイル領域の量を示します。

 

Returns:

  • (uint32)

    PageFileUsage



312
313
314
# File 'lib/Win32_Process.rb', line 312

def PageFileUsage
  @PageFileUsage
end

- (uint32) ParentProcessId (readonly)

ParentProcessId プロパティにより、このプロセスを作成したプロセスの一意な識別子が指定されます。

 

Returns:

  • (uint32)

    ParentProcessId



321
322
323
# File 'lib/Win32_Process.rb', line 321

def ParentProcessId
  @ParentProcessId
end

- (uint32) PeakPageFileUsage (readonly)

PeakPageFileUsage プロパティは、プロセス中に使用される最大のページ ファイル領域を示します。

 

Returns:

  • (uint32)

    PeakPageFileUsage



328
329
330
# File 'lib/Win32_Process.rb', line 328

def PeakPageFileUsage
  @PeakPageFileUsage
end

- (uint64) PeakVirtualSize (readonly)

PeakVirtualSize プロパティにより、プロセスにより一度に使用される最大の仮想アドレス領域が指定されます。

 

Returns:

  • (uint64)

    PeakVirtualSize



335
336
337
# File 'lib/Win32_Process.rb', line 335

def PeakVirtualSize
  @PeakVirtualSize
end

- (uint32) PeakWorkingSetSize (readonly)

PeakWorkingSetSize プロパティは、プロセスのワーキング セットのピークのサイズを示します。

 

Returns:

  • (uint32)

    PeakWorkingSetSize



342
343
344
# File 'lib/Win32_Process.rb', line 342

def PeakWorkingSetSize
  @PeakWorkingSetSize
end

- (uint32) Priority (readonly)

Priority プロパティは、オペレーティング システム内でスケジュールされているプロセスの優先順位を示します。

 

Returns:

  • (uint32)

    Priority



351
352
353
# File 'lib/Win32_Process.rb', line 351

def Priority
  @Priority
end

- (uint64) PrivatePageCount (readonly)

PrivatePageCount プロパティにより、このプロセスだけにアクセス可能な現在の割り当てページ数が指定されます。

Returns:

  • (uint64)

    PrivatePageCount



356
357
358
# File 'lib/Win32_Process.rb', line 356

def PrivatePageCount
  @PrivatePageCount
end

- (uint32) ProcessId (readonly)

ProcessId プロパティには、プロセスを識別するのに使用されるグローバル プロセス識別子が含まれています。

 

Returns:

  • (uint32)

    ProcessId



362
363
364
# File 'lib/Win32_Process.rb', line 362

def ProcessId
  @ProcessId
end

- (uint32) QuotaNonPagedPoolUsage (readonly)

QuotaNonPagedPoolUsage プロパティは、プロセスに対する非ページ プールのクウォータ 使用量を示します。

 

Returns:

  • (uint32)

    QuotaNonPagedPoolUsage



369
370
371
# File 'lib/Win32_Process.rb', line 369

def QuotaNonPagedPoolUsage
  @QuotaNonPagedPoolUsage
end

- (uint32) QuotaPagedPoolUsage (readonly)

QuotaPagedPoolUsage プロパティは、プロセスに対するページ プールのクウォータ 使用量を示します。

 

Returns:

  • (uint32)

    QuotaPagedPoolUsage



376
377
378
# File 'lib/Win32_Process.rb', line 376

def QuotaPagedPoolUsage
  @QuotaPagedPoolUsage
end

- (uint32) QuotaPeakNonPagedPoolUsage (readonly)

QuotaPeakNonPagedPoolUsage プロパティは、プロセスに対する非ページ プールのピーク時のクウォータ 使用量を示します。

 

Returns:

  • (uint32)

    QuotaPeakNonPagedPoolUsage



383
384
385
# File 'lib/Win32_Process.rb', line 383

def QuotaPeakNonPagedPoolUsage
  @QuotaPeakNonPagedPoolUsage
end

- (uint32) QuotaPeakPagedPoolUsage (readonly)

QuotaPeakPagedPoolUsage プロパティは、プロセスに対するページ プールのピーク時のクウォータ 使用量を示します。

  

Returns:

  • (uint32)

    QuotaPeakPagedPoolUsage



390
391
392
# File 'lib/Win32_Process.rb', line 390

def QuotaPeakPagedPoolUsage
  @QuotaPeakPagedPoolUsage
end

- (uint64) ReadOperationCount (readonly)

ReadOperationCount プロパティにより、実行される読み取り操作数が指定されます。

Returns:

  • (uint64)

    ReadOperationCount



395
396
397
# File 'lib/Win32_Process.rb', line 395

def ReadOperationCount
  @ReadOperationCount
end

- (uint64) ReadTransferCount (readonly)

ReadTransferCount プロパティにより、読み取りデータ量が指定されます。

Returns:

  • (uint64)

    ReadTransferCount



400
401
402
# File 'lib/Win32_Process.rb', line 400

def ReadTransferCount
  @ReadTransferCount
end

- (uint32) SessionId (readonly)

SessionId プロパティにより、セッションが作成されるときにオペレーティング システムに生成される一意な識別子が指定されます。

 

Returns:

  • (uint32)

    SessionId



406
407
408
# File 'lib/Win32_Process.rb', line 406

def SessionId
  @SessionId
end

- (string) Status (readonly)

Status プロパティはオブジェクトの現在の状態を示す文字列です。

 

Returns:

  • (string)

    Status



419
420
421
# File 'lib/Win32_Process.rb', line 419

def Status
  @Status
end

- (datetime) TerminationDate (readonly)

プロセスが停止または終了した時刻です。

Returns:

  • (datetime)

    TerminationDate



424
425
426
# File 'lib/Win32_Process.rb', line 424

def TerminationDate
  @TerminationDate
end

- (uint32) ThreadCount (readonly)

ThreadCount プロパティにより、このプロセスでアクティブなスレッドの数が指定されます。

 

Returns:

  • (uint32)

    ThreadCount



432
433
434
# File 'lib/Win32_Process.rb', line 432

def ThreadCount
  @ThreadCount
end

- (uint64) UserModeTime (readonly)

ユーザー モードでの時間 (100 ナノ秒) です。

 

Returns:

  • (uint64)

    UserModeTime



438
439
440
# File 'lib/Win32_Process.rb', line 438

def UserModeTime
  @UserModeTime
end

- (uint64) VirtualSize (readonly)

VirtualSize プロパティにより、プロセスにより使用されている仮想アドレス領域の現在のサイズがバイト数で指定されます。

 

Returns:

  • (uint64)

    VirtualSize



445
446
447
# File 'lib/Win32_Process.rb', line 445

def VirtualSize
  @VirtualSize
end

- (string) WindowsVersion (readonly)

WindowsVersion プロパティは、プロセスが実行している Windows のバージョンを示します。

 

Returns:

  • (string)

    WindowsVersion



452
453
454
# File 'lib/Win32_Process.rb', line 452

def WindowsVersion
  @WindowsVersion
end

- (uint64) WorkingSetSize (readonly)

ページ べースのメモリ管理を使用するオペレーティング システムで、プロセスが効率的に実行されるために必要な、バイト数で表されたメモリ容量。

 

Returns:

  • (uint64)

    WorkingSetSize



460
461
462
# File 'lib/Win32_Process.rb', line 460

def WorkingSetSize
  @WorkingSetSize
end

- (uint64) WriteOperationCount (readonly)

WriteOperationCount プロパティにより、実行される書き込み操作の数が指定されます。

Returns:

  • (uint64)

    WriteOperationCount



465
466
467
# File 'lib/Win32_Process.rb', line 465

def WriteOperationCount
  @WriteOperationCount
end

- (uint64) WriteTransferCount (readonly)

WriteTransferCount プロパティにより、書き込まれるデータの量が指定されます。

Returns:

  • (uint64)

    WriteTransferCount



470
471
472
# File 'lib/Win32_Process.rb', line 470

def WriteTransferCount
  @WriteTransferCount
end

Instance Method Details

- (uint32) AttachDebugger

AttachDebugger メソッドはこのプロセスに対して現在登録されているデバッガを起動します。 ただし、ワトソン博士はサポートされていません。

レジストリ キーに無効な文字列見つけた場合、または次のように変換される整数値を見つけた場合、メソッドは ’一般エラー’ を返します: 0 - 正常に完了しました。

2 - ユーザーは要求された情報に対するアクセス権がありません。

3 - ユーザーには十分な特権がありません。

8 - 不明なエラーです。

9 - 指定されたパスは存在しません。

21 - 指定されたパラメータは無効です。

その他 - 上の一覧以外の整数値については Win32 エラー コードのドキュメントを参照してください。

Returns:

  • (uint32)


176
177
# File 'lib/Win32_Process.rb', line 176

def AttachDebugger 
end

- (uint32) Create(CommandLine, CurrentDirectory, ProcessStartupInformation)

KernelDumpOnly プロパティは、同じクラスの DebugInfoType のために使用されていません。 今後の作業のすべてにこの新しいプロパティを使用する必要があります。

KernelDumpOnly プロパティは、カーネル デバッグ情報のみがデバッグ ログ ファイルに書き込まれるかどうかを示します。

値は TRUE または FALSE です。 TRUE の場合は、カーネルの状態のみがシステム エラーのイベントのファイルに書き込まれます。 FALSE の場合は、メモリの状態とエラーが発生したときにシステムに関する情報を提供できるデバイスの状態がシステムによりログに記録されます。

Parameters:

  • (string, #read) CommandLine

    CommandLine パラメータにより、実行するコマンド ラインが指定されます。 システムにより、実際使用されていたファイルを示すため、必要な場合は文字列を切って、コマンド ラインにヌル文字が追加されます。 起動されるプログラムが Winmgmt (ユーザーのパスではない) 検索パスにない場合は、完全修飾パスは指定されなければなりません。

  • (string, #read) CurrentDirectory

    CurrentDirectory パラメータにより、子プロセスの現在のドライブとディレクトリが指定されます。 文字列は、現在のディレクトリが既知のパスに解決されることが必要です。 ユーザーにより、現在の作業ディレクトリへの絶対パスまたは相対パスが指定されます。 このパラメータが NULL の場合、新規プロセスには呼び出しプロセスと同じパスがあります。 このオプションは、アプリケーションを開始し、アプリケーションの初期ドライブと作業ディレクトリを指定する必要がある主なシェルに提供されます。

  • (Win32_ProcessStartup, #read) ProcessStartupInformation

    ProcessStartupInformation パラメータは、Win32 プロセスのスタートアップ構成を表します。 ウィンドウの表示、コンソール アプリケーションの特質、エラーの処理についての情報が含まれます。

    Windows XP 以降では、(以前 "winsta0\default" と既定されていた) WinstationDesktop プロパティがすべての場合に無視されていることに注意してください。 このパラメータの代わりに使われた値は空の文字列 ("") です。

  • (uint32, #write) ProcessId

    ProcessId パラメータにより、プロセスを識別するために使用されるグローバル プロセス識別子が返されます。 値は、プロセスの終了時間までプロセスの作成時間から有効です。

Returns:

  • (uint32)


35
36
# File 'lib/Win32_Process.rb', line 35

def Create CommandLine, CurrentDirectory, ProcessStartupInformation
end

- (uint32) GetOwner

GetOwner メソッドはプロセスが実行しているユーザー名とドメイン名を取得します。

メソッドは次のように変換される整数値を返します: 0 - 正常に完了しました。

2 - ユーザーは要求された情報に対するアクセス権がありません。

3 - ユーザーには十分な特権がありません。

8 - 不明なエラーです。

9 - 指定されたパスは存在しません。

21 - 指定されたパラメータは無効です。

その他 - 上の一覧以外の整数値については Win32 エラー コードのドキュメントを参照してください。

Parameters:

  • (string, #write) Domain

    Domain パラメータにより、このプロセスを実行しているドメイン名が返されます。

  • (string, #write) User

    User パラメータにより、このプロセスの所有者のユーザー名が返されます。

Returns:

  • (uint32)


82
83
# File 'lib/Win32_Process.rb', line 82

def GetOwner 
end

- (uint32) GetOwnerSid

GetOwnerSid メソッドはこのプロセスの所有者のセキュリティ ID (SID) を取得します。

メソッドは次のように変換される整数値を返します: 0 - 正常に完了しました。

2 - ユーザーは要求された情報に対するアクセス権がありません。

3 - ユーザーには十分な特権がありません。

8 - 不明なエラーです。

9 - 指定されたパスは存在しません。

21 - 指定されたパラメータは無効です。

その他 - 上の一覧以外の整数値については Win32 エラー コードのドキュメントを参照してください。

Parameters:

  • (string, #write) Sid

    SID プロパティにより、このプロセスのセキュリティ記述子が返されます。

Returns:

  • (uint32)


105
106
# File 'lib/Win32_Process.rb', line 105

def GetOwnerSid 
end

- (uint32) SetPriority(Priority)

SetPriority メソッドはプロセスの実行優先度を変更します。 リアルタイムに優先度を設定するためには、呼び出し元が SeIncreaseBasePriorityPrivilege を保持しなければなりません。 この特権がない場合は、設定できる最も高い優先度は高優先度です。

メソッドは次のように変換される整数値を返します: 0 - 正常に完了しました。

2 - ユーザーは要求された情報に対するアクセス権がありません。

3 - ユーザーには十分な特権がありません。

8 - 不明なエラーです。

9 - 指定されたパスは存在しません。

21 - 指定されたパラメータは無効です。

その他 - 上の一覧以外の整数値については Win32 エラー コードのドキュメントを参照してください。

Parameters:

  • (sint32, #read) Priority

    Priority パラメータにより、プロセスの新しい優先順位のクラスが指定されます。 値: Idle - システムがアイドル状態のときだけにスレッドが実行されるプロセスのために指定されています。

     

    例はスクリーン セーバーです。 Idle Priority クラスは子プロセスによって継承されています。

    Below Normal - IDLE_PRIORITY_CLASS よりも優先順位が高く NORMAL_PRIORITY_CLASS よりは優先順位が低いプロセスを示します。 Windows 2000 にとってです。

    Normal - 特別なスケジュールを必要としないプロセスに指定されています。

    Above Normal - NORMAL_PRIORITY_CLASS よりも優先順位が高く HIGH_PRIORITY_CLASS よりは優先順位が低いことを示します。 Windows 2000 にとってです。

    High Priority - 直ちに実行される必要がある時間的に重要タスクに指定されています。 プロセスのスレッドにより、通常の優先順位またはアイドル状態の優先順位のクラス プロセスのスレッドが横取りされます。 例は Task List で、オペレーティング システムでの読み込みに関係なく、ユーザーに呼び出されたときに素早く応答する必要があります。 優先度が高いクラスを使用するときは細心の注意を払ってください。 これは、優先度が高いクラスのアプリケーション はほとんどすべての利用可能な時間を使用できるためです。

    Realtime - 予想される優先順位が最も高いプロセスに指定されています。 プロセスのスレッドにより、重要なタスクを実行するオペレーティング システムのプロセスを含むそのほかのすべてのプロセスのスレッドが横取りされます。 たとえば、非常に短い間隔で実行されるリアルタイム プロセスにより、ディスク キャッシュがフラッシュしないか、またはマウスが反応しなくなります。

Returns:

  • (uint32)


154
155
# File 'lib/Win32_Process.rb', line 154

def SetPriority Priority
end

- (uint32) Terminate(Reason)

Terminate メソッドはプロセスとそのスレッドのすべてを強制終了します。 メソッドは次のように変換される整数値を返します: 0 - 正常に完了しました。

2 - ユーザーは要求された情報に対するアクセス権がありません。

3 - ユーザーには十分な特権がありません。

8 - 不明なエラーです。

9 - 指定されたパスは存在しません。

21 - 指定されたパラメータは無効です。

その他 - 上の一覧以外の整数値については Win32 エラー コードのドキュメントを参照してください。

Parameters:

  • (uint32, #read) Reason

    Reason パラメータにより、プロセスとこの呼び出しの結果強制終了したスレッドすべてに対する終了コードが指定されます。

Returns:

  • (uint32)


57
58
# File 'lib/Win32_Process.rb', line 57

def Terminate Reason
end