????? ??????? ????? VDMDBG ??? Windows NT ? Windows 2000 ? Windows XP

?????? ????????? ?????? ?????????
???? ???????: 182559 - ??? ???????? ???? ????? ????? ??? ???????.
??? ????? ??? ???????. ????? "??? ??" ??? ??? ??????? ??? ????.
????? ???? | ?? ????

?? ??? ??????

??????

??? ??? ??????? ?? ???? 32-?? ? ???? ????? ???????? ??? ????? ?? ????????? ??? 16 ??. ?? Windows NT ?? ????? ????????? ??? 16 ?? ???? ??????? DOS ?????? (VDM). ????? VDMDBG.dll ??? ?????? ?? ??????? ??????? ????? ?? ????????? ??? 16 ??. ??? ??????? ????? ?? Microsoft Platform SDK.

???? ????? VDMDBG ????? ???? ????? ????? ?????? ?????? 16-?? (??????) ???? VDM. ???? ??? ??????? ????? ??????? ??? ??????? ?? Microsoft Windows NT ? Windows 2000 ? Windows XP.

??????? ????

??? ??????? ?? ?? ????? VDMDBG ????? ??? ??? VDMDBG.lib ?? ??????? ????? ??.

??????? VDMDBG ???????? ????? ?????? ????? ??? ?? ??????? ????????. ??? ???? ??? ????? ??????? ??? ???? ??? ????? ??? ???? ?????.

????? VDMs

???? VDMEnumProcessWOW() ???? ????? ????? ????? ???? VDMs ????? ???? Windows 16-??. ????? ??? VDMs ?????? WowExec.exe. ?? ??? ????? VDMs DOS.

??? ????? ??? ?????? ??? ???:
   INT WINAPI VDMEnumProcessWOW( PROCESSENUMPROC fp, LPARAM lparam );
				
???? ??????? ?????? ??? ?? ??? VDMs ??? ??????? ?????? ?? ?? ????? ??????? ????? ????? ??? ???????. fp ???? ??? ????? ?? ?????. ??? ??????? ?????? ?? VDM ??? ?????. lParam ?????? ??????? ?? ??? ???????? ???? ??? ??????? ??? ????? ?? ???????.

?? ??????? PROCESSENUMPROC ??? ???:
   typedef BOOL ( WINAPI *PROCESSENUMPROC )(
      DWORD dwProcessId,
      DWORD dwAttributes,
      LPARAM lpUserDefined
   );
				
??? ????? ?????? TRUE ??? ????? ??????? ?? FALSE ?????? ???????. dwProcessId ?? ????? ??????? ??????? NTVDM.exe. ?????? ??? ??????? ??? ??????? ????? VDM ?????? ???????? ?????.

????? ???? Windows 16-??

????? ??????? VDMEnumTaskWOW() VDMEnumTaskWOWEx() ????? ?????? ??? VDM ?????. ???????? ?????? ?? VDMEnumTaskWOWEx() ???? ???? ?? ????????? ??? ????? ?? ???????. ??? ??????? VDMs ???????? VDMEnumProcessWOW() ?????? ??????? ??? ?????? ???. ???????? VDMs DOS ?? ???? ??????? ???? ??? ????? ?? ????? DOS ?? VDM ?????? ??.

??? ?????????:
   INT WINAPI VDMEnumTaskWOW( DWORD dwProcessId, TASKENUMPROC fp,
                              LPARAM lparam );
				
   INT WINAPI VDMEnumTaskWOWEx( DWORD dwProcessId, TASKENUMPROCEX fp,
                                LPARAM lparam );
				
?????? ??????? ??? ?? ??? ??????? ??? ?????? ??? ??????? ?????? ??? VDM ?????? ???? ?? ?? ????? ??????? ????? ????? ??? ???????. dwProcessId ????? ??????? fp VDM. ???? ????? ?? ?????. ??? ??????? ?????? ??? ???? ??? ?????. lparam ?????? ??????? ?? ??? ???????? ???? ??? ??????? ??? ????? ?? ???????.

TASKENUMPROC ? TASKENUMPROCEX ??? ????? ???????:
   typedef BOOL ( WINAPI *TASKENUMPROC )(
      DWORD dwThreadId,
      WORD hMod16,
      WORD hTask16,
      LPARAM lpUserDefined
   );
				
   typedef BOOL ( WINAPI *TASKENUMPROCEX )(
      DWORD dwThreadId,
      WORD hMod16,
      WORD hTask16,
      PSZ pszModName,
      PSZ pszFileName,
      LPARAM lpUserDefined
   );
				
??? ?? ??? ??????? ?????? TRUE ??? ????? ??????? ?? FALSE ?????? ???????. ????? ??????? hTask16 ?? ??????? ????? ??????.

???? ???????

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

   BOOL WINAPI ProcessEnumProc( DWORD, DWORD, LPARAM );
   BOOL WINAPI TaskEnumProcEx( DWORD, WORD, WORD, PSZ, PSZ, LPARAM );

   void main()
   {
      // Enumerate VDMs.
      VDMEnumProcessWOW(
         (PROCESSENUMPROC)ProcessEnumProc,
         (LPARAM)NULL
      );

   }

   BOOL WINAPI ProcessEnumProc( 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)TaskEnumProcEx,
         (LPARAM)NULL
      );

      // Keep enumerating.
      return FALSE;
   }

   BOOL WINAPI TaskEnumProcEx( 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;
   }
				

????? ???? 16-??

???? VDMStartTaskInWOW() ???? ??? VDM. ?? ??????? ??? ???:
   BOOL WINAPI VDMStartTaskInWOW( DWORD dwProcessId, LPSTR lpCommandLine,
                                  WORD wShow );
				
?? ???? ??????? ??? ?????? TRUE ??? ????? ?????? ????? ? ???? ??? FALSE. dwProcessId ?? ????? ????? VDM ????. lpCommandLine ????? ???? ??? ??? ????? ????? 16-?? ?? ?? ?????? ??? ???????. wShow ??????? ??? ????? ????? ??????. ???? wShow ?? ???? ????? ?????? ShowWindow() 16-??.

????? ?????? 16-??

????? ???? ??? ?????? VDM VDMTerminateTaskWOW(). ?? ??????? ??? ???:
   BOOL WINAPI VDMTerminateTaskWOW( DWORD dwProcessId, WORD htask );
				
?? ???? ??????? ??? ?????? TRUE ??? ?? ????? ????? ?????? ? ???? ??? ??? FALSE. dwProcessId hTask ?????. ????? VDM ?? ?????? ??? ??????. ???? ?????? ??? ??? ?????? ?????? ???? VDMEnumTaskWOW() ?? VDMEnumTaskWOWEx().

??? ??????? ????? ????? TerminateProcess() ?? Win32. ??? ??? ???? ? ??? ??? ??? ??????. ???? ?? ???? ?????? ??? ????? cleanly ???? ??? ?? ???? ????????. ???? Win32 ? WowExec ??? ????? ????? ??? ????? ????. ???? ??? ??? ?? VDM ????? ???? ???? ?????????. ?????? ?????? ????? ????? WM_CLOSE ??? ???? ??????? ?????? ????? ??.

?????? ??????? ??????? DOS 16-??

?? ?? ????? VDMDBG ????? ?? ??????? DOS 16-??. ????? VDMs DOS ? ????? ??? ??????? ????? ???. ?????? ????? ?? ?????? VDMEnumProcessWOW() ???? ????? VDMs Win16 ???? ?? ?? ????? ???? ?????? NTVDM.exe ???????? ???? ??? (??? PSAPI). ?? ?? NTVDM.exe ?? ?????? ??????? ?? ??? ?? ??????? Win16 VDM DOS. ????? ????? ?? ????? ????????? DOS ??? 16 ?? ?? CreateProcess() ? TerminateProcess().

???????

???? ???????: 182559 - ????? ??? ??????: 24/???? ??????/1435 - ??????: 3.4
????? ???
  • Microsoft Win32 ????? ????? ???????, ????? ?????? ??:
    • Microsoft Windows NT 4.0
    • the operating system: Microsoft Windows 2000
    • the operating system: Microsoft Windows XP
????? ??????: 
kbnosurvey kbarchive kbmt kbapi kbhowto kbkernbase kbthread KB182559 KbMtar
????? ????
???: ??? ????? ??? ?????? ???????? ?????? ????? ???? ????? ?????????? ????? ?? ????????? ?????? ????. ???? ???? ?????????? ???? ?? ???????? ???????? ?????? ????????? ????? ????????? ???????? ????? ???????? ?????? ?? ?????? ??? ?? ???????? ???????? ?? ????? ??????? ?????? ??? ??????? ?????? ??. ?????? ?? ???? ??? ??????? ???????? ????? ?? ???? ????? ?????? ??? ????? ??? ????? ??????? ?? ????? ?? ?????? ??? ??? ??????? ??????? ?? ????? ????? ????? ????? ?????. ?? ????? ???? ?????????? ??????? ??? ????? ?? ??????? ?? ????? ?????? ?? ??? ????? ?? ????? ??????? ?? ???????? ?? ??? ???????. ???? ???? ?????????? ???????? ??? ????? ?????? ??????? ??????
???? ??? ????? ??????? ?????? ??????????182559

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com