Bug #393
closed
Usage of "errno" in Windows
Added by Jörg Riesmeier over 22 years ago.
Updated over 8 years ago.
Category:
Library and Apps
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
Related issues
1 (1 open — 0 closed)
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);
}
- Subject changed from Verwendung von "errno" unter Windows to Usage of "errno" in Windows
- 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.
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.
- Private changed from No to Yes
- Assignee set to Nikolas Goldhammer
- Private changed from Yes to No
- % Done changed from 0 to 30
- % Done changed from 30 to 70
- Status changed from New to Closed
Closed, since the remaining part of the problem has been added as a separate feature #754.
Also available in: Atom
PDF