diff options
Diffstat (limited to 'lib/cdreader.cpp')
-rw-r--r-- | lib/cdreader.cpp | 12 |
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;
|