Project

General

Profile

Actions

Bug #393

closed

Usage of "errno" in Windows

Added by Jörg Riesmeier over 22 years ago. Updated over 8 years ago.

Status:
Closed
Priority:
High
Category:
Library and Apps
Target version:
Start date:
Due date:
% Done:

70%

Estimated time:
Module:
all
Operating System:
Compiler:

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

0002-fixed-wrong-error-message-in-dcmnet-with-win32.patch (17.9 KB) 0002-fixed-wrong-error-message-in-dcmnet-with-win32.patch This patch should not be applied directly to the DCMTK! Jörg Riesmeier, 2013-10-12 12:38

Related issues 1 (1 open0 closed)

Related to DCMTK - Feature #754: Add OFerror_condition an replace platform specific error constantsNewNikolas Goldhammer2017-05-02

Actions
Actions #1

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);
}
Actions #2

Updated by Jörg Riesmeier over 13 years ago

Actions #3

Updated by Andrew Chiw over 12 years ago

  • Subject changed from Verwendung von "errno" unter Windows to Usage of "errno" in Windows
Actions #4

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.

Actions #5

Updated by Jörg Riesmeier almost 12 years ago

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.

Actions #6

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().

Actions #7

Updated by Michael Onken over 10 years ago

  • Private changed from No to Yes
Actions #8

Updated by Michael Onken over 10 years ago

  • Assignee set to Nikolas Goldhammer
Actions #9

Updated by Jörg Riesmeier almost 10 years ago

  • Private changed from Yes to No
Actions #10

Updated by Jan Schlamelcher over 8 years ago

  • % Done changed from 0 to 30
Actions #11

Updated by Jan Schlamelcher over 8 years ago

  • % Done changed from 30 to 70
Actions #12

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.

Actions

Also available in: Atom PDF