2 * Misc Toolhelp functions
4 * Copyright 1996 Marcus Meissner
18 /* FIXME: to make this working, we have to callback all these registered
19 * functions from all over the WINE code. Someone with more knowledge than
20 * me please do that. -Marcus
25 FARPROC16 lpfnCallback;
29 static int nrofnotifys = 0;
31 BOOL16 WINAPI NotifyRegister( HTASK16 htask, FARPROC16 lpfnCallback,
36 dprintf_toolhelp( stddeb, "NotifyRegister(%x,%lx,%x) called.\n",
37 htask, (DWORD)lpfnCallback, wFlags );
38 for (i=0;i<nrofnotifys;i++)
39 if (notifys[i].htask==htask)
43 notifys=(struct notify*)HeapAlloc( GetProcessHeap(), 0,
44 sizeof(struct notify) );
46 notifys=(struct notify*)HeapReAlloc( GetProcessHeap(), 0, notifys,
47 sizeof(struct notify)*(nrofnotifys+1));
48 if (!notifys) return FALSE;
51 notifys[i].htask=htask;
52 notifys[i].lpfnCallback=lpfnCallback;
53 notifys[i].wFlags=wFlags;
57 BOOL16 WINAPI NotifyUnregister( HTASK16 htask )
61 dprintf_toolhelp( stddeb, "NotifyUnregister(%x) called.\n", htask );
62 for (i=nrofnotifys;i--;)
63 if (notifys[i].htask==htask)
67 memcpy(notifys+i,notifys+(i+1),sizeof(struct notify)*(nrofnotifys-i-1));
68 notifys=(struct notify*)HeapReAlloc( GetProcessHeap(), 0, notifys,
69 (nrofnotifys-1)*sizeof(struct notify));