From b1700953dd26c79909c93993a2e3e8602dca520a Mon Sep 17 00:00:00 2001 From: Christoph von Wittich Date: Fri, 14 Oct 2005 22:31:06 +0000 Subject: [PATCH] *add some more stubs for Virtual DOS Machine Debug (six still missing) svn path=/trunk/; revision=18461 --- reactos/lib/vdmdbg/vdmdbg.c | 166 ++++++++++++++++++++++++++++++++-- reactos/lib/vdmdbg/vdmdbg.def | 34 +++---- reactos/lib/vdmdbg/vdmdbg.h | 61 +++++++++++-- 3 files changed, 230 insertions(+), 31 deletions(-) diff --git a/reactos/lib/vdmdbg/vdmdbg.c b/reactos/lib/vdmdbg/vdmdbg.c index b05f431f275..914a4bbf115 100644 --- a/reactos/lib/vdmdbg/vdmdbg.c +++ b/reactos/lib/vdmdbg/vdmdbg.c @@ -12,39 +12,189 @@ BOOL WINAPI VDMBreakThread( HANDLE hProcess, return FALSE; } +DWORD WINAPI VDMGetDbgFlags( HANDLE hProcess ) +{ + UNIMPLEMENTED; + return ERROR_CALL_NOT_IMPLEMENTED; +} + +BOOL WINAPI VDMIsModuleLoaded( LPSTR szPath ) +{ + UNIMPLEMENTED; + return FALSE; +} + +ULONG WINAPI VDMGetPointer( HANDLE handle, + HANDLE handle2, + WORD wSelector, + DWORD dwOffset, + BOOL fProtMode ) +{ + UNIMPLEMENTED; + return ERROR_CALL_NOT_IMPLEMENTED; +} + +BOOL WINAPI VDMProcessException( LPDEBUG_EVENT lpDebugEvent ) +{ + UNIMPLEMENTED; + return FALSE; +} + +BOOL WINAPI VDMGetSegmentInfo( WORD word, + ULONG ulong, + BOOL boolVal, + VDM_SEGINFO *pVDMSegInfo ) +{ + UNIMPLEMENTED; + return FALSE; +} + + +BOOL WINAPI VDMSetDbgFlags( HANDLE hProcess, + DWORD dwFlags ) +{ + UNIMPLEMENTED; + return FALSE; +} + BOOL WINAPI VDMDetectWOW( void ) { UNIMPLEMENTED; return FALSE; } -INT WINAPI VDMEnumProcessWOW( PROCESSENUMPROC fp, - LPARAM lparam ) +INT WINAPI VDMEnumTaskWOW( DWORD dword, + TASKENUMPROC TaskEnumProc, + LPARAM lParam ) +{ + UNIMPLEMENTED; + return ERROR_CALL_NOT_IMPLEMENTED; +} + +BOOL WINAPI VDMStartTaskInWOW( DWORD dwProcessId, + LPSTR lpCommandLine, + WORD wShow ) { UNIMPLEMENTED; return FALSE; } +BOOL WINAPI VDMKillWOW( VOID ) +{ + UNIMPLEMENTED; + return FALSE; +} + +INT WINAPI VDMEnumProcessWOW( PROCESSENUMPROC ProcessEnumProc, + LPARAM lParam ) +{ + UNIMPLEMENTED; + return ERROR_CALL_NOT_IMPLEMENTED; +} + INT WINAPI VDMEnumTaskWOWEx( DWORD dwProcessId, - TASKENUMPROCEX fp, - LPARAM lparam ) + TASKENUMPROCEX TaskEnumProcEx, + LPARAM lParam ) { UNIMPLEMENTED; return ERROR_CALL_NOT_IMPLEMENTED; } BOOL WINAPI VDMTerminateTaskWOW( DWORD dwProcessId, - WORD htask ) + WORD hTask ) +{ + UNIMPLEMENTED; + return FALSE; +} + +BOOL WINAPI VDMGetContext( HANDLE handle, + HANDLE handle2, + LPVDMCONTEXT lpVDMContext ) +{ + UNIMPLEMENTED; + return FALSE; +} + +BOOL WINAPI VDMSetContext( HANDLE handle, + HANDLE handle2, + LPVDMCONTEXT lpVDMContext) +{ + UNIMPLEMENTED; + return FALSE; +} + + +BOOL WINAPI VDMGetSelectorModule( HANDLE handle, + HANDLE handle2, + WORD word, + PUINT punit, + LPSTR lpModuleName, + UINT uInt, + LPSTR lpstr, + UINT uInt2 ) +{ + UNIMPLEMENTED; + return FALSE; +} + + +BOOL WINAPI VDMGetModuleSelector( HANDLE handle, + HANDLE handle2, + UINT uInt, + LPSTR lpModuleName, + LPWORD lpword ) +{ + UNIMPLEMENTED; + return FALSE; +} + +BOOL WINAPI VDMModuleFirst( HANDLE handle, + HANDLE handle2, + LPMODULEENTRY lpModuleEntry, + DEBUGEVENTPROC lpDebugEventProc, + LPVOID lpvoid ) +{ + UNIMPLEMENTED; + return FALSE; +} + +BOOL WINAPI VDMGlobalFirst( HANDLE handle, + HANDLE handle2, + LPGLOBALENTRY lpGlobalEntry, + WORD word, + DEBUGEVENTPROC lpDebugEventProc, + LPVOID lpvoid ) +{ + UNIMPLEMENTED; + return FALSE; +} + +BOOL WINAPI VDMGlobalNext( HANDLE handle, + HANDLE handle2, + LPGLOBALENTRY lpGlobalEntry, + WORD word, + DEBUGEVENTPROC lpDebugEventProc, + LPVOID lpvoid ) +{ + UNIMPLEMENTED; + return FALSE; +} + +BOOL WINAPI VDMModuleNext( HANDLE handle, + HANDLE handle2, + LPMODULEENTRY lpModuleEntry, + DEBUGEVENTPROC lpDebugEventProc, + LPVOID lpvoid ) { UNIMPLEMENTED; return FALSE; } BOOL STDCALL -DllMain(IN HINSTANCE hinstDLL, - IN DWORD dwReason, - IN LPVOID lpvReserved) +DllMain( IN HINSTANCE hinstDLL, + IN DWORD dwReason, + IN LPVOID lpvReserved ) { switch (dwReason) { diff --git a/reactos/lib/vdmdbg/vdmdbg.def b/reactos/lib/vdmdbg/vdmdbg.def index b16b2c58b66..677c504fa13 100644 --- a/reactos/lib/vdmdbg/vdmdbg.def +++ b/reactos/lib/vdmdbg/vdmdbg.def @@ -29,28 +29,28 @@ EXPORTS VDMBreakThread@8 VDMDetectWOW@0 VDMEnumProcessWOW@8 -;VDMEnumTaskWOW@12 +VDMEnumTaskWOW@12 VDMEnumTaskWOWEx@12 ;VDMGetAddrExpression@20 -;VDMGetContext@12 -;VDMGetDbgFlags@4 -;VDMGetModuleSelector@20 -;VDMGetPointer@20 -;VDMGetSegmentInfo@16 +VDMGetContext@12 +VDMGetDbgFlags@4 +VDMGetModuleSelector@20 +VDMGetPointer@20 +VDMGetSegmentInfo@16 ;VDMGetSegtablePointer@0 -;VDMGetSelectorModule@32 +VDMGetSelectorModule@32 ;VDMGetSymbol@28 ;VDMGetThreadContext@8 ;VDMGetThreadSelectorEntry@16 -;VDMGlobalFirst@24 -;VDMGlobalNext@24 -;VDMIsModuleLoaded@4 -;VDMKillWOW@0 -;VDMModuleFirst@20 -;VDMModuleNext@20 -;VDMProcessException@4 -;VDMSetContext@12 -;VDMSetDbgFlags@8 +VDMGlobalFirst@24 +VDMGlobalNext@24 +VDMIsModuleLoaded@4 +VDMKillWOW@0 +VDMModuleFirst@20 +VDMModuleNext@20 +VDMProcessException@4 +VDMSetContext@12 +VDMSetDbgFlags@8 ;VDMSetThreadContext@8 -;VDMStartTaskInWOW@12 +VDMStartTaskInWOW@12 VDMTerminateTaskWOW@8 diff --git a/reactos/lib/vdmdbg/vdmdbg.h b/reactos/lib/vdmdbg/vdmdbg.h index 85ba0b7fcf8..ed44c9f2064 100644 --- a/reactos/lib/vdmdbg/vdmdbg.h +++ b/reactos/lib/vdmdbg/vdmdbg.h @@ -1,24 +1,73 @@ #include +#define MAX_PATH16 255 +#define MAX_MODULE_NAME 9 + ULONG DbgPrint(PCH Format,...); +typedef struct _CONTEXT VDMCONTEXT; +typedef VDMCONTEXT *LPVDMCONTEXT; + +typedef struct _VDM_SEGINFO { + WORD Selector; + WORD SegNumber; + DWORD Length; + WORD Type; + CHAR ModuleName[MAX_MODULE_NAME]; + CHAR FileName[MAX_PATH16]; +} VDM_SEGINFO; + +typedef struct { + DWORD dwSize; + char szModule[MAX_MODULE_NAME+1]; + HANDLE hModule; + WORD wcUsage; + char szExePath[MAX_PATH16+1]; + WORD wNext; +} MODULEENTRY, *LPMODULEENTRY; + typedef BOOL ( WINAPI *PROCESSENUMPROC ) ( - DWORD dwProcessId, - DWORD dwAttributes, + DWORD dwProcessId, + DWORD dwAttributes, LPARAM lpUserDefined ); typedef BOOL ( WINAPI *TASKENUMPROCEX ) ( DWORD dwThreadId, - WORD hMod16, - WORD hTask16, - PSZ pszModName, - PSZ pszFileName, + WORD hMod16, + WORD hTask16, + PSZ pszModName, + PSZ pszFileName, LPARAM lpUserDefined ); +typedef struct { + DWORD dwSize; + DWORD dwAddress; + DWORD dwBlockSize; + HANDLE hBlock; + WORD wcLock; + WORD wcPageLock; + WORD wFlags; + BOOL wHeapPresent; + HANDLE hOwner; + WORD wType; + WORD wData; + DWORD dwNext; + DWORD dwNextAlt; +} GLOBALENTRY, *LPGLOBALENTRY; + +typedef DWORD ( CALLBACK* DEBUGEVENTPROC ) + ( LPDEBUG_EVENT, LPVOID ); + +typedef BOOL ( WINAPI *TASKENUMPROC ) + ( DWORD dwThreadId, + WORD hMod16, + WORD hTask16, + LPARAM lpUserDefined ); + extern HINSTANCE hDllInstance; /* EOF */