vfs: check userland buffers before reading them.
[haiku.git] / src / apps / diskprobe / ProbeWindow.cpp
bloba39e4a6104764520693b925608238c1117a82f13
1 /*
2 * Copyright 2004-2006, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
3 * Distributed under the terms of the MIT License.
4 */
7 #include "ProbeWindow.h"
8 #include "DiskProbe.h"
10 #include <Application.h>
11 #include <View.h>
14 ProbeWindow::ProbeWindow(BRect rect, entry_ref *ref)
15 : BWindow(rect, ref->name, B_DOCUMENT_WINDOW,
16 B_ASYNCHRONOUS_CONTROLS | B_AUTO_UPDATE_SIZE_LIMITS),
17 fRef(*ref)
22 ProbeWindow::~ProbeWindow()
27 void
28 ProbeWindow::MessageReceived(BMessage *message)
30 switch (message->what) {
31 case B_MOUSE_WHEEL_CHANGED:
32 if (BView *view = FindView("dataView"))
33 view->MessageReceived(message);
34 break;
36 case B_SIMPLE_DATA:
38 BMessage refsReceived(*message);
39 refsReceived.what = B_REFS_RECEIVED;
40 be_app_messenger.SendMessage(&refsReceived);
41 break;
44 default:
45 BWindow::MessageReceived(message);
50 bool
51 ProbeWindow::QuitRequested()
53 BMessage update(kMsgSettingsChanged);
54 update.AddRect("window_frame", Frame());
55 be_app_messenger.SendMessage(&update);
57 be_app_messenger.SendMessage(kMsgWindowClosed);
58 return true;