VDMEnumProcessWOW 函式 (vdmdbg.h)

[不支援此函式,未來可能會變更或無法使用。]

列舉執行 16 位 Windows 工作的所有虛擬 DOS 機器。

語法

INT VDMEnumProcessWOW(
  [in] PROCESSENUMPROC fp,
  [in] LPARAM          lparam
);

參數

[in] fp

回呼函式的指標。 會針對每個列舉的 VDM 呼叫 函式。 如需詳細資訊,請參閱 ProcessVDMs 回 呼函式。

[in] lparam

傳遞至回調函式的用戶定義值。

傳回值

執行中的 VM 數目,或列舉終止之前列舉的數位。

備註

這些 VM 包含 WowExec.exe 工作。 不會列舉 DOS VM。 若要列舉 DOS VM,您必須使用其他方法。 首先,您可以使用 VDMEnumProcessWOW () 來建立所有 Win16 VM 的清單,然後使用 PSAPI) 之類的 (其他配置來列舉 NTVDM.exe 的所有實例。 來自未在 Win16 清單中完整列舉的任何 NTVDM.exe 都是 DOS VDM。

範例

下列範例示範如何列舉執行 16 位 Windows 工作的虛擬 DOS 機器。

   // Enumerate all 16-bit tasks on the system.
   
   #include <windows.h>
   #include <stdio.h>
   #include <vdmdbg.h>

   BOOL WINAPI ProcessVDMs( DWORD, DWORD, LPARAM );
   BOOL WINAPI ProcessTasks( DWORD, WORD, WORD, PSZ, PSZ, LPARAM );

   #pragma comment( lib, "vdmdbg.lib" )
   
   void main()
   {
      // Enumerate VDMs
      VDMEnumProcessWOW(
         (PROCESSENUMPROC)ProcessVDMs,
         (LPARAM)NULL
      );

   }

   BOOL WINAPI ProcessVDMs( DWORD dwProcessId, DWORD dwAttrib,
      LPARAM t )
   {
      printf("\nProcess ID: %d\n", dwProcessId);

      // Use process ID of VDM to enumerate through its tasks
      VDMEnumTaskWOWEx(
         dwProcessId,
         (TASKENUMPROCEX)ProcessTasks,
         (LPARAM)NULL
      );

      // Keep enumerating
      return FALSE;
   }

   BOOL WINAPI ProcessTasks( DWORD dwThreadId, WORD hMod16, WORD hTask16,
      PSZ pszModName, PSZ pszFileName, LPARAM lParam )
   {
      // Print task's information
      printf("Thread ID: %d\n", dwThreadId);
      printf("Module handle: %d\n", hMod16);
      printf("Task handle: %d\n", hTask16);
      printf("Module Name: %s\n", pszModName);
      printf("File Name: %s\n", pszFileName);

      // Keep enumerating
      return FALSE;
   }


規格需求

需求
目標平台 Windows
標頭 vdmdbg.h
程式庫 VdmDbg.lib
Dll VdmDbg.dll