summaryrefslogtreecommitdiff
path: root/lib/cdreader.cpp
diff options
context:
space:
mode:
authorpixel <pixel>2003-10-20 16:27:54 +0000
committerpixel <pixel>2003-10-20 16:27:54 +0000
commit100de0d7a830ad1567ff2b4867490961bdb4b384 (patch)
tree734861178fe2791460e98320177cb315374b9e18 /lib/cdreader.cpp
parent9f4bc95bd406adecf8803b455cb20e79f3cccadb (diff)
Commit of the month
Diffstat (limited to 'lib/cdreader.cpp')
-rw-r--r--lib/cdreader.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/cdreader.cpp b/lib/cdreader.cpp
index bb785cf..33ba1b2 100644
--- a/lib/cdreader.cpp
+++ b/lib/cdreader.cpp
@@ -175,7 +175,17 @@ void cdreader::getsector(void *buf, int sec) throw (GeneralException) {
}
}
if (dwErrCode != ERROR_IO_PENDING) {
- throw GeneralException("Gave up on reading CD");
+ LPVOID lpMsgBuf;
+ if (!FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
+ FORMAT_MESSAGE_FROM_SYSTEM |
+ FORMAT_MESSAGE_IGNORE_INSERTS,
+ NULL, GetLastError(),
+ MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
+ (LPTSTR) &lpMsgBuf, 0, NULL ))
+ throw GeneralException("Gave up on reading CD: unknown error");
+ String errmsg = (LPCTSTR) lpMsgBuf;
+ LocalFree(lpMsgBuf);
+ throw GeneralException("Gave up on reading CD: " + errmsg);
}
} else {
done = true;