Bug #393
closedUsage of "errno" in Windows
70%
Description
Unlike in Unix, several routines (network and file) in Windows don't set the "errno" variable. Yet DCMTK still asks for the value, resulting in funny error messages such as "Error: no error"
A GetLastError() could help very much here...
Files
Updated by Jörg Riesmeier over 13 years ago
Siehe z.B. folgende Funktion in dcompat.cc:
void dcmtk_plockerr(const char *s) { LPVOID lpMsgBuf=NULL; FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language (LPTSTR) &lpMsgBuf, 0, NULL); if (lpMsgBuf && s) DCMNET_ERROR(s << ": " << (const char*)lpMsgBuf); LocalFree(lpMsgBuf); }
Updated by Jörg Riesmeier over 13 years ago
Siehe auch folgenden MSDN-Eintrag zu diesem Thema: http://msdn.microsoft.com/en-us/library/windows/desktop/ms737828(v=vs.85).aspx
Updated by Andrew Chiw over 12 years ago
- Subject changed from Verwendung von "errno" unter Windows to Usage of "errno" in Windows
Updated by Jörg Riesmeier about 12 years ago
- Category set to Library and Apps
- Target version set to 3.6.2
- Module changed from alle to all
Probably, a good idea would be to add a new helper function for this purpose to OFStandard.
Updated by Jörg Riesmeier almost 12 years ago
- File 0002-fixed-wrong-error-message-in-dcmnet-with-win32.patch 0002-fixed-wrong-error-message-in-dcmnet-with-win32.patch added
Atsushi Suzuki <email-address-obfuscated> sent an email with the attached patch on 2013-10-09:
1) dcmnet error messages are not correct in win32.
When network functions in dcmnet failed, error messages in their return status
(OFCondition.text()) is not correct message.
For example, when ASC_requestAssociation failed with ECONNRESET,
they says "TCP Initialization Error: no error.".
To fix this, use WSAGetLastError instead of errno in dul.cc and dulfsm.cc for win32.
Updated by Jörg Riesmeier almost 11 years ago
See also this forum posting: http://forum.dcmtk.org/viewtopic.php?f=1&p=16439#p16439
Refers to WinSock function WSAGetLastError().
Updated by Jan Schlamelcher over 8 years ago
- Status changed from New to Closed
Closed, since the remaining part of the problem has been added as a separate feature #754.