View Issue Details

IDProjectCategoryView StatusLast Update
0013287Open CASCADEOCCT:Foundation Classespublic2017-06-26 16:11
ReporteragvAssigned Toski 
PrioritynormalSeveritytrivial 
Status assignedResolutionopen 
OSAll 
Summary0013287: Compatinility problems in package OSD
DescriptionDuring the work on OCC13258 I detected some problems in OSD that are wider than
64-bit compatibility, they concern porting between UNIX and Windows in general.
So they may need some deeper analysis including not only FoundationClasses but
also dependent code in OCC, samples and customer applications.

Note that the compatibility problems in OSD_File are not listed here because I
intend to start a separate improvement of this class.

1. Class OSD_FileNode: "myFileChannel: Size from Standard". This field stores
the result of OS API calls:
  int open (...); // on UNIX, LINUX
  HANDLE CreateFile (...); // on Windows

Types "int" and "HANDLE" (aka void *) are incompatible. I propose to create a
new primitive type (typedef) "FileHandle from OSD" and modify with it OSD, FSD,
WOKNT, etc. This will also improve the code while suppressing explicit casts
to/from HANDLE type.

The new type should be also used as OSD_DirectoryIterator::myHandle,
OSD_FileIterator::myHandle.

2. Type OSD_ThreadFunction has "Standard_Address" return value. This is correct
on UNIX/LINUX but wrong on Windows that uses DWORD type as exit value. I propose
to create a new primitive type (typedef) to define the relevant type on each
platform.

3. Methods OSD_Process::UserId, OSD_FileNode::UserId, OSD_FileNode::GroupId
return Standard_Integer, seems to be wrong on all platforms. It should
correspond to:
  long on POSIX platforms (uid_t, result of getuid())
  pointer (PSID or PGROUP_SID) on Windows.

I propose to create a corresponding primitive type (typedef) to represent the
return value of these methods.

4. OSD_signal_WNT.cxx: remaining problem overlooked in OCC13258 patch: line 340,
"conversion from 'ULONG_PTR' to 'int'".

5. In OSD_WNT.cxx, function MoveDirectory, the internal variable "level" should
be defined as ptrdiff_t rather than DWORD, because it corresponds to LPVOID
parameter of TlsSetValue.
TagsNo tags attached.
Test case number

Relationships

related to 0024259 closedbugmaster Clean up OSD_File implementation 

Activities

abv

2015-09-09 12:05

manager   ~0045294

Point (1) has been addressed by 0024259
Point (4) should have been fixed long time ago

Issue History

Date Modified Username Field Change
2011-08-02 11:23 bugmaster Category OCCT:FDC => OCCT:Foundation Classes
2015-09-09 11:57 abv Relationship added related to 0024259
2015-09-09 12:05 abv Note Added: 0045294
2017-04-20 10:28 bugmaster Assigned To bugmaster => ski
2017-06-26 16:11 apv Status new => assigned