2 * Misc Toolhelp functions
4 * Copyright 1996 Marcus Meissner
17 /* FIXME: to make this working, we have to callback all these registered
18 * functions from all over the WINE code. Someone with more knowledge than
19 * me please do that. -Marcus
24 FARPROC16 lpfnCallback;
28 static int nrofnotifys = 0;
30 static FARPROC16 HookNotify = NULL;
32 BOOL16 WINAPI NotifyRegister( HTASK16 htask, FARPROC16 lpfnCallback,
37 TRACE(toolhelp, "(%x,%lx,%x) called.\n",
38 htask, (DWORD)lpfnCallback, wFlags );
39 if (!htask) htask = GetCurrentTask();
40 for (i=0;i<nrofnotifys;i++)
41 if (notifys[i].htask==htask)
45 notifys=(struct notify*)HeapAlloc( SystemHeap, 0,
46 sizeof(struct notify) );
48 notifys=(struct notify*)HeapReAlloc( SystemHeap, 0, notifys,
49 sizeof(struct notify)*(nrofnotifys+1));
50 if (!notifys) return FALSE;
53 notifys[i].htask=htask;
54 notifys[i].lpfnCallback=lpfnCallback;
55 notifys[i].wFlags=wFlags;
59 BOOL16 WINAPI NotifyUnregister( HTASK16 htask )
63 TRACE(toolhelp, "(%x) called.\n", htask );
64 if (!htask) htask = GetCurrentTask();
65 for (i=nrofnotifys;i--;)
66 if (notifys[i].htask==htask)
70 memcpy(notifys+i,notifys+(i+1),sizeof(struct notify)*(nrofnotifys-i-1));
71 notifys=(struct notify*)HeapReAlloc( SystemHeap, 0, notifys,
72 (nrofnotifys-1)*sizeof(struct notify));
77 BOOL16 WINAPI StackTraceCSIPFirst(STACKTRACEENTRY *ste, WORD wSS, WORD wCS, WORD wIP, WORD wBP)
82 BOOL16 WINAPI StackTraceFirst(STACKTRACEENTRY *ste, HTASK16 Task)
87 BOOL16 WINAPI StackTraceNext(STACKTRACEENTRY *ste)
92 /***********************************************************************
93 * ToolHelpHook (KERNEL.341)
94 * see "Undocumented Windows"
96 FARPROC16 WINAPI ToolHelpHook(FARPROC16 lpfnNotifyHandler)
100 HookNotify = lpfnNotifyHandler;
101 /* just return previously installed notification function */
105 /***********************************************************************
106 * CreateToolHelp32Snapshot (KERNEL32.179)
107 * see "Undocumented Windows"
109 HANDLE32 WINAPI CreateToolhelp32Snapshot(DWORD dwFlags, DWORD th32ProcessID) {
110 FIXME(toolhelp,"(0x%08lx,0x%08lx), stub!\n",dwFlags,th32ProcessID);
111 return INVALID_HANDLE_VALUE32;