Implemented {Start,Stop}Watching().

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2679 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2003-02-10 00:21:42 +00:00
parent 7a452094ee
commit c947b11347

View File

@ -447,7 +447,26 @@ BDiskDeviceRoster::GetPartitionWithID(int32 id, BDiskDevice *device,
status_t
BDiskDeviceRoster::StartWatching(BMessenger target, uint32 eventMask)
{
return B_ERROR; // not implemented
status_t error = B_OK;
// compose request message
BMessage request(B_REG_DEVICE_START_WATCHING);
if (error == B_OK)
error = request.AddMessenger("target", target);
if (error == B_OK)
error = request.AddInt32("events", (int32)eventMask);
// send request
BMessage reply;
if (error == B_OK)
error = fManager.SendMessage(&request, &reply);
// analyze reply
if (error == B_OK) {
// result
status_t result = B_OK;
error = reply.FindInt32("result", &result);
if (error == B_OK)
error = result;
}
return error;
}
// StopWatching
@ -460,7 +479,24 @@ BDiskDeviceRoster::StartWatching(BMessenger target, uint32 eventMask)
status_t
BDiskDeviceRoster::StopWatching(BMessenger target)
{
return B_ERROR; // not implemented
status_t error = B_OK;
// compose request message
BMessage request(B_REG_DEVICE_STOP_WATCHING);
if (error == B_OK)
error = request.AddMessenger("target", target);
// send request
BMessage reply;
if (error == B_OK)
error = fManager.SendMessage(&request, &reply);
// analyze reply
if (error == B_OK) {
// result
status_t result = B_OK;
error = reply.FindInt32("result", &result);
if (error == B_OK)
error = result;
}
return error;
}
// _GetObjectWithID