2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
9 #include "dos_intern.h"
10 #include <exec/lists.h>
11 #include <proto/exec.h>
13 /*****************************************************************************
17 #include <dos/notify.h>
18 #include <proto/dos.h>
22 AROS_LH1(void, EndNotify
,
25 AROS_LHA(struct NotifyRequest
*, notify
, D1
),
28 struct DosLibrary
*, DOSBase
, 149, Dos
)
32 End a notification (quit notifying for a request previously sent with
37 notify -- NotifyRequest used with StartNotify()
53 *****************************************************************************/
57 struct IOFileSys iofs
;
60 if ((dvp
= GetDeviceProc(notify
->nr_FullName
, NULL
)) == NULL
)
63 InitIOFS(&iofs
, FSA_REMOVE_NOTIFY
, DOSBase
);
64 iofs
.io_Union
.io_NOTIFY
.io_NotificationRequest
= notify
;
66 iofs
.IOFS
.io_Device
= (struct Device
*) dvp
->dvp_Port
;
68 if (dvp
->dvp_Lock
!= NULL
)
69 iofs
.IOFS
.io_Unit
= ((struct FileHandle
*) BADDR(dvp
->dvp_Lock
))->fh_Unit
;
71 iofs
.IOFS
.io_Unit
= dvp
->dvp_DevNode
->dol_Ext
.dol_AROS
.dol_Unit
;
77 if (notify
->nr_FullName
!= notify
->nr_Name
)
78 FreeVec(notify
->nr_FullName
);
80 if (notify
->nr_Flags
& NRF_SEND_MESSAGE
&&
81 (notify
->nr_Flags
& NRF_WAIT_REPLY
|| notify
->nr_MsgCount
)) {
83 struct MsgPort
*port
= notify
->nr_stuff
.nr_Msg
.nr_Port
;
84 struct NotifyMessage
*nm
, *tmp
;
86 notify
->nr_Flags
&= ~NRF_MAGIC
;
90 ForeachNodeSafe(&port
->mp_MsgList
, nm
, tmp
) {
91 if (nm
->nm_Class
== NOTIFY_CLASS
&&
92 nm
->nm_Code
== NOTIFY_CODE
&&
93 nm
->nm_NReq
== notify
) {
95 Remove((struct Node
*) nm
);
96 ReplyMsg((struct Message
*) nm
);
98 notify
->nr_MsgCount
--;
99 if (notify
->nr_MsgCount
== 0)