source: trunk/src/vdmdbg/vdmdbg.cpp@ 10367

Last change on this file since 10367 was 6641, checked in by bird, 24 years ago

Corrected description for VDMEnumProcessWOW.

File size: 13.2 KB
Line 
1/* $Id: vdmdbg.cpp,v 1.2 2001-09-05 11:56:57 bird Exp $
2 *
3 * VDMDbg - Virtual Dos Machine Debug interface.
4 * (It's not only debuging. TaskMgr uses it and that's the reason for implementing it.)
5 *
6 * Copyright (c) 2001 knut st. osmundsen (knut.stange.osmundsen@mynd.no)
7 *
8 * Project Odin Software License can be found in LICENSE.TXT
9 *
10 */
11
12
13/*******************************************************************************
14* Header Files *
15*******************************************************************************/
16#include <odin.h>
17#include <odinwrap.h>
18#include <os2sel.h>
19
20#include <os2win.h>
21#include <winnt.h>
22#include <winnls.h>
23#include <stdlib.h>
24#include <string.h>
25#include <ctype.h>
26
27#include <misc.h>
28#include <unicode.h>
29#include <versionos2.h>
30
31#include <vdmdbg.h>
32
33#define DBG_LOCALLOG DBG_vdmdbg
34#include "dbglocal.h"
35
36/*******************************************************************************
37* Defined Constants And Macros *
38*******************************************************************************/
39ODINDEBUGCHANNEL(VDMDBG-VDMVDG)
40
41/**
42 *
43 * @returns Success indicator.
44 * @status stub
45 * @author knut st. osmundsen (knut.stange.osmundsen@mynd.no)
46 */
47BOOL WIN32API VDMProcessException(
48 LPDEBUG_EVENT lpDebugEvent
49 )
50{
51 dprintf(("VDMDBG: " __FUNCTION__ "(%x) - stub\n", lpDebugEvent));
52 return FALSE;
53}
54
55/**
56 *
57 * @returns Success indicator.
58 * @status stub
59 * @author knut st. osmundsen (knut.stange.osmundsen@mynd.no)
60 */
61BOOL WIN32API VDMGetThreadSelectorEntry(
62 HANDLE hProcess,
63 HANDLE hThread,
64 WORD wSelector,
65 LPVDMLDT_ENTRY lpSelectorEntry
66 )
67{
68 dprintf(("VDMDBG: " __FUNCTION__ "(%x, %x, %x, %x) - stub\n", hProcess, hThread, wSelector, lpSelectorEntry));
69 return FALSE;
70}
71
72
73/**
74 *
75 * @returns Pointer.
76 * @status stub
77 * @author knut st. osmundsen (knut.stange.osmundsen@mynd.no)
78 */
79ULONG WIN32API VDMGetPointer(
80 HANDLE hProcess,
81 HANDLE hThread,
82 WORD wSelector,
83 DWORD dwOffset,
84 BOOL fProtMode
85 )
86{
87 dprintf(("VDMDBG: " __FUNCTION__ "(%x, %x, %x, %x, %x) - stub\n", hProcess, hThread, wSelector, dwOffset, fProtMode));
88 return NULL;
89}
90
91/**
92 *
93 * @returns Success indicator.
94 * @status stub
95 * @author knut st. osmundsen (knut.stange.osmundsen@mynd.no)
96 * @remark Marked as obsolete, use VDMGetContex.
97 */
98BOOL WIN32API VDMGetThreadContext(
99 LPDEBUG_EVENT lpDebugEvent,
100 LPVDMCONTEXT lpVDMContext
101)
102{
103 dprintf(("VDMDBG: " __FUNCTION__ "(%x, %x) - stub\n", lpDebugEvent, lpVDMContext));
104 return FALSE;
105}
106
107/**
108 *
109 * @returns Success indicator.
110 * @status stub
111 * @author knut st. osmundsen (knut.stange.osmundsen@mynd.no)
112 * @remark Marked as obsolete, use VDMSetContex.
113 */
114BOOL WIN32API VDMSetThreadContext(
115 LPDEBUG_EVENT lpDebugEvent,
116 LPVDMCONTEXT lpVDMContext
117)
118{
119 dprintf(("VDMDBG: " __FUNCTION__ "(%x, %x) - stub\n", lpDebugEvent, lpVDMContext));
120 return FALSE;
121}
122
123/**
124 *
125 * @returns Success indicator.
126 * @status stub
127 * @author knut st. osmundsen (knut.stange.osmundsen@mynd.no)
128 */
129BOOL WIN32API VDMGetContext(
130 HANDLE hProcess,
131 HANDLE hThread,
132 LPVDMCONTEXT lpVDMContext
133 )
134{
135 dprintf(("VDMDBG: " __FUNCTION__ "(%x, %x, %x) - stub\n", hProcess, hThread, lpVDMContext));
136 return FALSE;
137}
138
139/**
140 *
141 * @returns Success indicator.
142 * @status stub
143 * @author knut st. osmundsen (knut.stange.osmundsen@mynd.no)
144 */
145BOOL WIN32API VDMSetContext(
146 HANDLE hProcess,
147 HANDLE hThread,
148 LPVDMCONTEXT lpVDMContext
149 )
150{
151 dprintf(("VDMDBG: " __FUNCTION__ "(%x, %x, %x) - stub\n", hProcess, hThread, lpVDMContext));
152 return FALSE;
153}
154
155/**
156 *
157 * @returns Success indicator.
158 * @status stub
159 * @author knut st. osmundsen (knut.stange.osmundsen@mynd.no)
160 */
161BOOL WIN32API VDMGetSelectorModule(
162 HANDLE hProcess,
163 HANDLE hThread,
164 WORD wSelector,
165 PUINT lpSegmentNumber,
166 LPSTR lpModuleName,
167 UINT nNameSize,
168 LPSTR lpModulePath,
169 UINT nPathSize
170)
171{
172 dprintf(("VDMDBG: " __FUNCTION__ "(%x, %x, %x, %x, %x, %x, %x, %x) - stub\n",
173 hProcess, hThread, wSelector, lpSegmentNumber, lpModuleName, nNameSize, lpModulePath, nPathSize));
174 return FALSE;
175}
176
177
178/**
179 *
180 * @returns Success indicator.
181 * @status stub
182 * @author knut st. osmundsen (knut.stange.osmundsen@mynd.no)
183 */
184BOOL WIN32API VDMGetModuleSelector(
185 HANDLE hProcess,
186 HANDLE hThread,
187 UINT wSegmentNumber,
188 LPSTR lpModuleName,
189 LPWORD lpSelector
190)
191{
192 dprintf(("VDMDBG: " __FUNCTION__ "(%x, %x, %x, %x, %x) - stub\n",
193 hProcess, hThread, wSegmentNumber, lpModuleName, lpSelector));
194 return FALSE;
195}
196
197/**
198 *
199 * @returns Success indicator.
200 * @status stub
201 * @author knut st. osmundsen (knut.stange.osmundsen@mynd.no)
202 */
203BOOL WIN32API VDMModuleFirst(
204 HANDLE hProcess,
205 HANDLE hThread,
206 LPMODULEENTRY lpModuleEntry,
207 DEBUGEVENTPROC lpEventProc,
208 LPVOID lpData
209)
210{
211 dprintf(("VDMDBG: " __FUNCTION__ "(%x, %x, %x, %x, %x) - stub\n",
212 hProcess, hThread, lpModuleEntry, lpEventProc, lpData));
213 return FALSE;
214}
215
216
217/**
218 *
219 * @returns Success indicator.
220 * @status stub
221 * @author knut st. osmundsen (knut.stange.osmundsen@mynd.no)
222 */
223BOOL WIN32API VDMModuleNext(
224 HANDLE hProcess,
225 HANDLE hThread,
226 LPMODULEENTRY lpModuleEntry,
227 DEBUGEVENTPROC lpEventProc,
228 LPVOID lpData
229)
230{
231 dprintf(("VDMDBG: " __FUNCTION__ "(%x, %x, %x, %x, %x) - stub\n",
232 hProcess, hThread, lpModuleEntry, lpEventProc, lpData));
233 return FALSE;
234}
235
236
237/**
238 *
239 * @returns Success indicator.
240 * @status stub
241 * @author knut st. osmundsen (knut.stange.osmundsen@mynd.no)
242 */
243BOOL WIN32API VDMGlobalFirst(
244 HANDLE hProcess,
245 HANDLE hThread,
246 LPGLOBALENTRY lpGlobalEntry,
247 WORD wFlags,
248 DEBUGEVENTPROC lpEventProc,
249 LPVOID lpData
250)
251{
252 dprintf(("VDMDBG: " __FUNCTION__ "(%x, %x, %x, %x, %x, %x) - stub\n",
253 hProcess, hThread, lpGlobalEntry, wFlags, lpEventProc, lpData));
254 return FALSE;
255}
256
257/**
258 *
259 * @returns Success indicator.
260 * @status stub
261 * @author knut st. osmundsen (knut.stange.osmundsen@mynd.no)
262 */
263BOOL WIN32API VDMGlobalNext(
264 HANDLE hProcess,
265 HANDLE hThread,
266 LPGLOBALENTRY lpGlobalEntry,
267 WORD wFlags,
268 DEBUGEVENTPROC lpEventProc,
269 LPVOID lpData
270)
271{
272 dprintf(("VDMDBG: " __FUNCTION__ "(%x, %x, %x, %x, %x, %x) - stub\n",
273 hProcess, hThread, lpGlobalEntry, wFlags, lpEventProc, lpData));
274 return FALSE;
275}
276
277
278
279/**
280 *
281 * @returns Count of Win16 subsystem processes or the count of subsystem processes enumerated before terminating.
282 * @param fp
283 * @param lparam
284 * @status stub
285 * @author knut st. osmundsen (knut.stange.osmundsen@mynd.no)
286 */
287INT WIN32API VDMEnumProcessWOW(
288 PROCESSENUMPROC fp,
289 LPARAM lparam
290)
291{
292 dprintf(("VDMDBG: " __FUNCTION__ "(%x, %x) - stub\n", fp, lparam));
293 return 0;
294}
295
296
297/**
298 *
299 * @returns Count of Win16 tasks or the count of tasks enumerated before terminating.
300 * @param dwProcessId
301 * @param fp
302 * @param lparam
303 * @status stub
304 * @author knut st. osmundsen (knut.stange.osmundsen@mynd.no)
305 */
306INT WIN32API VDMEnumTaskWOW(
307 DWORD dwProcessId,
308 TASKENUMPROC fp,
309 LPARAM lparam
310)
311{
312 dprintf(("VDMDBG: " __FUNCTION__ "(%x, %x, %x) - stub\n", dwProcessId, fp, lparam));
313 return 0;
314}
315
316
317/**
318 * Same as VDMEnumTaskWOW, but the callback procedure gets two extra
319 * parameters. The module name of the EXE and the full path to the EXE.
320 *
321 * @returns Count of Win16 tasks or the count of tasks enumerated before terminating.
322 * @param dwProcessId
323 * @param fp
324 * @param lparam
325 * @status stub
326 * @author knut st. osmundsen (knut.stange.osmundsen@mynd.no)
327 */
328INT WIN32API VDMEnumTaskWOWEx(
329 DWORD dwProcessId,
330 TASKENUMPROCEX fp,
331 LPARAM lparam
332)
333{
334 dprintf(("VDMDBG: " __FUNCTION__ "(%x, %x, %x) - stub\n", dwProcessId, fp, lparam));
335 return 0;
336}
337
338
339/**
340 * This function rudely terminates a WOW task.
341 * It's similar to the way TerminateProcess kills a Win32 process.
342 * @returns Success indicator.
343 * @param dwProcessId
344 * @param htask
345 * @status stub
346 * @author knut st. osmundsen (knut.stange.osmundsen@mynd.no)
347 */
348BOOL WIN32API VDMTerminateTaskWOW(
349 DWORD dwProcessId,
350 WORD htask
351)
352{
353 dprintf(("VDMDBG: " __FUNCTION__ "(%x, %x) - stub\n", dwProcessId, htask));
354 return FALSE;
355}
356
357
358/**
359 * VDMStartTaskInWOW launches a Win16 task in a pre-existing WOW VDM.
360 * The caller is responsible for ensuring the program is a 16-bit
361 * Windows program. If it is a DOS or Win32 program, it will still
362 * be launched from within the target WOW VDM.
363 *
364 * The supplied command line and show command are passed
365 * unchanged to the 16-bit WinExec API in the target WOW VDM.
366 *
367 * @returns Success indicator.
368 * @param dwProcessId
369 * @param lpCommandLine
370 * @param wShow
371 * @status stub
372 * @author knut st. osmundsen (knut.stange.osmundsen@mynd.no)
373 * @remark This routine is ANSI-only.
374 * Not 100% sure this is WIN32API... (kso)
375 */
376BOOL WIN32API VDMStartTaskInWOW(
377 DWORD dwProcessId,
378 LPSTR lpCommandLine,
379 WORD wShow
380)
381{
382 dprintf(("VDMDBG: " __FUNCTION__ " (%x, %s, %x) - stub\n", dwProcessId, lpCommandLine, wShow));
383 return FALSE;
384}
385
386
387/**
388 *
389 * @returns Success indicator.
390 * @status stub
391 * @author knut st. osmundsen (knut.stange.osmundsen@mynd.no)
392 * @remark SDK says: VDMKillWOW is not implemented.
393 */
394BOOL WIN32API VDMKillWOW(VOID)
395{
396 dprintf(("VDMDBG: " __FUNCTION__ " - stub\n"));
397 return FALSE;
398}
399
400
401/**
402 *
403 * @returns Success indicator.
404 * @status stub
405 * @author knut st. osmundsen (knut.stange.osmundsen@mynd.no)
406 * @remark SDK says: VDMDetectWOW is not implemented.
407 */
408BOOL WIN32API VDMDetectWOW(VOID)
409{
410 dprintf(("VDMDBG: " __FUNCTION__ " - stub\n"));
411 return FALSE;
412}
413
414/**
415 *
416 * @returns Success indicator.
417 * @param hProcess
418 * @param hThread
419 * @status stub
420 * @author knut st. osmundsen (knut.stange.osmundsen@mynd.no)
421 */
422BOOL WIN32API VDMBreakThread(
423 HANDLE hProcess,
424 HANDLE hThread
425)
426{
427 dprintf(("VDMDBG: " __FUNCTION__ "(%x, %x) - stub\n", hProcess, hThread));
428 return FALSE;
429}
430
431
432/**
433 *
434 * @returns Debug flags.
435 * @status stub
436 * @author knut st. osmundsen (knut.stange.osmundsen@mynd.no)
437 */
438DWORD WIN32API VDMGetDbgFlags(
439 HANDLE hProcess
440 )
441{
442 dprintf(("VDMDBG: " __FUNCTION__ "(%x, %x) - stub\n", hProcess));
443 return 0;
444}
445
446/**
447 *
448 * @returns Success indicator.
449 * @status stub
450 * @author knut st. osmundsen (knut.stange.osmundsen@mynd.no)
451 */
452BOOL WIN32API VDMSetDbgFlags(
453 HANDLE hProcess,
454 DWORD dwFlags
455 )
456{
457 dprintf(("VDMDBG: " __FUNCTION__ "(%x, %x) - stub\n", hProcess, dwFlags));
458 return FALSE;
459}
460
461/**
462 * Used to check if a module is loaded.
463 * @returns Success indicator.
464 * @status stub
465 * @author knut st. osmundsen (knut.stange.osmundsen@mynd.no)
466 */
467BOOL WIN32API VDMIsModuleLoaded(
468 LPSTR szPath
469 )
470{
471 dprintf(("VDMDBG: " __FUNCTION__ "(%s) - stub\n", szPath));
472 return FALSE;
473}
474
475/**
476 *
477 * @returns Success indicator.
478 * @status stub
479 * @author knut st. osmundsen (knut.stange.osmundsen@mynd.no)
480 */
481BOOL WIN32API VDMGetSegmentInfo(
482 WORD Selector,
483 ULONG Offset,
484 BOOL bProtectMode,
485 VDM_SEGINFO *pSegInfo
486 )
487{
488 dprintf(("VDMDBG: " __FUNCTION__ "(%x, %x, %x, %x) - stub\n", Selector, Offset, bProtectMode, pSegInfo));
489 return FALSE;
490}
491
492/**
493 * This API is used to read the standard .SYM file format.
494 * @returns Success indicator.
495 * @param pszModule module name (max 9 chars)
496 * @param SegNumber logical segment number of segment (see VDM_SEGINFO)
497 * @param Offset offset in segment
498 * @param bProtectMode TRUE for PM, FALSE for V86 mode
499 * @param bNextSymbol FALSE to find nearest sym BEFORE offset, TRUE for AFTER
500 * @param szSymbolName receives symbol name (must point to 256 byte buffer)
501 * @param pDisplacement distance in bytes from nearest symbol
502 * @status stub
503 * @author knut st. osmundsen (knut.stange.osmundsen@mynd.no)
504 */
505BOOL WIN32API VDMGetSymbol(
506 LPSTR pszModule,
507 WORD SegNumber,
508 DWORD Offset,
509 BOOL bProtectMode,
510 BOOL bNextSymbol,
511 LPSTR szSymbolName,
512 PDWORD pDisplacement
513 )
514{
515 dprintf(("VDMDBG: " __FUNCTION__ "(%x, %x, %x, %x, %x, %x, %x) - stub\n",
516 pszModule, SegNumber, Offset, bProtectMode, bNextSymbol, szSymbolName, pDisplacement));
517 return FALSE;
518}
519
520/**
521 *
522 * @returns Success indicator.
523 * @status stub
524 * @author knut st. osmundsen (knut.stange.osmundsen@mynd.no)
525 */
526BOOL WIN32API VDMGetAddrExpression(
527 LPSTR szModule,
528 LPSTR szSymbol,
529 LPWORD Selector,
530 PDWORD Offset,
531 LPWORD Type
532 )
533{
534 dprintf(("VDMDBG: " __FUNCTION__ "(%x, %x, %x, %x, %x) - stub\n",
535 szModule, szSymbol, Selector, Offset, Type));
536 return FALSE;
537}
Note: See TracBrowser for help on using the repository browser.