summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/Handle.cc12
-rw-r--r--lib/Main.cc5
2 files changed, 16 insertions, 1 deletions
diff --git a/lib/Handle.cc b/lib/Handle.cc
index 2006b19..4b2b4f1 100644
--- a/lib/Handle.cc
+++ b/lib/Handle.cc
@@ -248,6 +248,13 @@ void Handle::close() throw (GeneralException) {
}
}
}
+
+#ifdef _WIN32
+ if (hFile) {
+ CloseHandle(hFile);
+ hFile = 0;
+ }
+#endif
h = -1;
closed = 1;
@@ -514,7 +521,10 @@ void Handle::Flush() {
}
}
-void * Handle::mmap(off_t offset, size_t length) {
+void * Handle::mmap(off_t offset, size_t length) throw (GeneralException) {
+ if (h == -1) {
+ throw GeneralException("Can't mmap() a virtual handle");
+ }
if (length == -1) {
length = GetSize();
}
diff --git a/lib/Main.cc b/lib/Main.cc
index 74b83cc..4007abc 100644
--- a/lib/Main.cc
+++ b/lib/Main.cc
@@ -20,6 +20,11 @@ void Main::set_args(int a_argc, char ** a_argv, char ** a_enve) {
setted = true;
}
+/*
+_open_osfhandle
+CreateFileMapping
+*/
+
int Main::truemain(Main * Application, int argc, char ** argv, char ** enve) {
int r;